1 |
- {"version":3,"file":"VExpansionPanelTitle.mjs","names":["VExpansionPanelSymbol","VIcon","useBackgroundColor","makeComponentProps","IconValue","Ripple","computed","inject","genericComponent","propsFactory","useRender","makeVExpansionPanelTitleProps","color","String","expandIcon","type","default","collapseIcon","hideActions","Boolean","ripple","Object","readonly","VExpansionPanelTitle","name","directives","props","setup","_ref","slots","expansionPanel","Error","backgroundColorClasses","backgroundColorStyles","slotProps","disabled","value","expanded","isSelected","_withDirectives","_createVNode","class","style","undefined","toggle","actions","_resolveDirective"],"sources":["../../../src/components/VExpansionPanel/VExpansionPanelTitle.tsx"],"sourcesContent":["// Components\nimport { VExpansionPanelSymbol } from './VExpansionPanels'\nimport { VIcon } from '@/components/VIcon'\n\n// Composables\nimport { useBackgroundColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { IconValue } from '@/composables/icons'\n\n// Directives\nimport { Ripple } from '@/directives/ripple'\n\n// Utilities\nimport { computed, inject } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { RippleDirectiveBinding } from '@/directives/ripple'\n\ninterface ExpansionPanelTitleSlot {\n collapseIcon: IconValue\n disabled: boolean | undefined\n expanded: boolean\n expandIcon: IconValue\n readonly: boolean\n}\n\nexport type VExpansionPanelTitleSlots = {\n default: ExpansionPanelTitleSlot\n actions: ExpansionPanelTitleSlot\n}\n\nexport const makeVExpansionPanelTitleProps = propsFactory({\n color: String,\n expandIcon: {\n type: IconValue,\n default: '$expand',\n },\n collapseIcon: {\n type: IconValue,\n default: '$collapse',\n },\n hideActions: Boolean,\n ripple: {\n type: [Boolean, Object] as PropType<RippleDirectiveBinding['value']>,\n default: false,\n },\n readonly: Boolean,\n\n ...makeComponentProps(),\n}, 'VExpansionPanelTitle')\n\nexport const VExpansionPanelTitle = genericComponent<VExpansionPanelTitleSlots>()({\n name: 'VExpansionPanelTitle',\n\n directives: { Ripple },\n\n props: makeVExpansionPanelTitleProps(),\n\n setup (props, { slots }) {\n const expansionPanel = inject(VExpansionPanelSymbol)\n\n if (!expansionPanel) throw new Error('[Vuetify] v-expansion-panel-title needs to be placed inside v-expansion-panel')\n\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(props, 'color')\n\n const slotProps = computed(() => ({\n collapseIcon: props.collapseIcon,\n disabled: expansionPanel.disabled.value,\n expanded: expansionPanel.isSelected.value,\n expandIcon: props.expandIcon,\n readonly: props.readonly,\n }))\n\n useRender(() => (\n <button\n class={[\n 'v-expansion-panel-title',\n {\n 'v-expansion-panel-title--active': expansionPanel.isSelected.value,\n },\n backgroundColorClasses.value,\n props.class,\n ]}\n style={[\n backgroundColorStyles.value,\n props.style,\n ]}\n type=\"button\"\n tabindex={ expansionPanel.disabled.value ? -1 : undefined }\n disabled={ expansionPanel.disabled.value }\n aria-expanded={ expansionPanel.isSelected.value }\n onClick={ !props.readonly ? expansionPanel.toggle : undefined }\n v-ripple={ props.ripple }\n >\n <span class=\"v-expansion-panel-title__overlay\" />\n\n { slots.default?.(slotProps.value) }\n\n { !props.hideActions && (\n <span class=\"v-expansion-panel-title__icon\">\n {\n slots.actions ? slots.actions(slotProps.value)\n : <VIcon icon={ expansionPanel.isSelected.value ? props.collapseIcon : props.expandIcon } />\n }\n </span>\n )}\n </button>\n ))\n\n return {}\n },\n})\n\nexport type VExpansionPanelTitle = InstanceType<typeof VExpansionPanelTitle>\n"],"mappings":";AAAA;AAAA,SACSA,qBAAqB;AAAA,SACrBC,KAAK,8BAEd;AAAA,SACSC,kBAAkB;AAAA,SAClBC,kBAAkB;AAAA,SAClBC,SAAS,uCAElB;AAAA,SACSC,MAAM,6CAEf;AACA,SAASC,QAAQ,EAAEC,MAAM,QAAQ,KAAK;AAAA,SAC7BC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,gCAElD;AAiBA,OAAO,MAAMC,6BAA6B,GAAGF,YAAY,CAAC;EACxDG,KAAK,EAAEC,MAAM;EACbC,UAAU,EAAE;IACV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