-
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
78552d8
commit e58fc57
Showing
7 changed files
with
175 additions
and
112 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
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<script> | ||
import BaseComponent from 'primevue/basecomponent'; | ||
import { useStyle } from 'primevue/usestyle'; | ||
const styles = ` | ||
.p-accordion-header-action { | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
user-select: none; | ||
position: relative; | ||
text-decoration: none; | ||
} | ||
.p-accordion-header-action:focus { | ||
z-index: 1; | ||
} | ||
.p-accordion-header-text { | ||
line-height: 1; | ||
} | ||
`; | ||
const classes = { | ||
root: 'p-accordion p-component', | ||
tab: { | ||
root: ({ instance, index }) => [ | ||
'p-accordion-tab', | ||
{ | ||
'p-accordion-tab-active': instance.isTabActive(index) | ||
} | ||
], | ||
header: ({ instance, tab, index }) => [ | ||
'p-accordion-header', | ||
{ | ||
'p-highlight': instance.isTabActive(index), | ||
'p-disabled': instance.getTabProp(tab, 'disabled') | ||
} | ||
], | ||
headerAction: 'p-accordion-header-link p-accordion-header-action', | ||
headerIcon: 'p-accordion-toggle-icon', | ||
headerTitle: 'p-accordion-header-text', | ||
toggleableContent: 'p-toggleable-content', | ||
content: 'p-accordion-content' | ||
} | ||
}; | ||
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_accordion_style', manual: true }); | ||
export default { | ||
name: 'BaseAccordion', | ||
extends: BaseComponent, | ||
props: { | ||
multiple: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
activeIndex: { | ||
type: [Number, Array], | ||
default: null | ||
}, | ||
lazy: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
expandIcon: { | ||
type: String, | ||
default: undefined | ||
}, | ||
collapseIcon: { | ||
type: String, | ||
default: undefined | ||
}, | ||
tabindex: { | ||
type: Number, | ||
default: 0 | ||
}, | ||
selectOnFocus: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script> | ||
import BaseComponent from 'primevue/basecomponent'; | ||
export default { | ||
name: 'BaseAccordionTab', | ||
extends: BaseComponent, | ||
props: { | ||
header: null, | ||
headerStyle: null, | ||
headerClass: null, | ||
headerProps: null, | ||
headerActionProps: null, | ||
contentStyle: null, | ||
contentClass: null, | ||
contentProps: null, | ||
disabled: Boolean | ||
} | ||
}; | ||
</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
Oops, something went wrong.