-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ce238b
commit a21c83e
Showing
3 changed files
with
69 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<script> | ||
import BaseComponent from 'primevue/basecomponent'; | ||
import { useStyle } from 'primevue/usestyle'; | ||
const styles = ` | ||
.p-toolbar { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
} | ||
.p-toolbar-group-start, | ||
.p-toolbar-group-center, | ||
.p-toolbar-group-end { | ||
display: flex; | ||
align-items: center; | ||
} | ||
.p-toolbar-group-left, | ||
.p-toolbar-group-right { | ||
display: flex; | ||
align-items: center; | ||
} | ||
`; | ||
const classes = { | ||
root: 'p-toolbar p-component', | ||
start: 'p-toolbar-group-start p-toolbar-group-left', | ||
center: 'p-toolbar-group-center', | ||
end: 'p-toolbar-group-end p-toolbar-group-right' | ||
}; | ||
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_toolbar_style', manual: true }); | ||
export default { | ||
name: 'BaseToolbar', | ||
extends: BaseComponent, | ||
props: { | ||
'aria-labelledby': { | ||
type: String, | ||
default: null | ||
} | ||
}, | ||
css: { | ||
classes | ||
}, | ||
watch: { | ||
isUnstyled: { | ||
immediate: true, | ||
handler(newValue) { | ||
!newValue && loadStyle(); | ||
} | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,22 @@ | ||
<template> | ||
<div class="p-toolbar p-component" role="toolbar" :aria-labelledby="ariaLabelledby" v-bind="ptm('root')"> | ||
<div class="p-toolbar-group-start p-toolbar-group-left" v-bind="ptm('start')"> | ||
<div :class="cx('root')" role="toolbar" :aria-labelledby="ariaLabelledby" data-pc-name="toolbar" data-pc-section="root" v-bind="ptm('root')"> | ||
<div :class="cx('start')" data-pc-section="start" v-bind="ptm('start')"> | ||
<slot name="start"></slot> | ||
</div> | ||
<div class="p-toolbar-group-center" v-bind="ptm('center')"> | ||
<div :class="cx('center')" data-pc-section="center" v-bind="ptm('center')"> | ||
<slot name="center"></slot> | ||
</div> | ||
<div class="p-toolbar-group-end p-toolbar-group-right" v-bind="ptm('end')"> | ||
<div :class="cx('end')" data-pc-section="end" v-bind="ptm('end')"> | ||
<slot name="end"></slot> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import BaseComponent from 'primevue/basecomponent'; | ||
import BaseToolbar from './BaseToolbar.vue'; | ||
export default { | ||
name: 'Toolbar', | ||
extends: BaseComponent, | ||
props: { | ||
'aria-labelledby': { | ||
type: String, | ||
default: null | ||
} | ||
} | ||
extends: BaseToolbar | ||
}; | ||
</script> | ||
|
||
<style> | ||
.p-toolbar { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
} | ||
.p-toolbar-group-start, | ||
.p-toolbar-group-center, | ||
.p-toolbar-group-end { | ||
display: flex; | ||
align-items: center; | ||
} | ||
.p-toolbar-group-left, | ||
.p-toolbar-group-right { | ||
display: flex; | ||
align-items: center; | ||
} | ||
</style> |