primevue
Version:
PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc
1 lines • 13 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../src/fieldset/BaseFieldset.vue","../../src/fieldset/Fieldset.vue","../../src/fieldset/Fieldset.vue?vue&type=template&id=9234344e&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport FieldsetStyle from 'primevue/fieldset/style';\n\nexport default {\n name: 'BaseFieldset',\n extends: BaseComponent,\n props: {\n legend: String,\n toggleable: Boolean,\n collapsed: Boolean,\n toggleButtonProps: {\n type: null,\n default: null\n }\n },\n style: FieldsetStyle,\n provide() {\n return {\n $pcFieldset: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <fieldset :class=\"cx('root')\" :data-p=\"dataP\" v-bind=\"ptmi('root')\">\n <legend :class=\"cx('legend')\" :data-p=\"dataP\" v-bind=\"ptm('legend')\">\n <slot name=\"legend\" :toggleCallback=\"toggle\">\n <span v-if=\"!toggleable\" :id=\"$id + '_header'\" :class=\"cx('legendLabel')\" v-bind=\"ptm('legendLabel')\">{{ legend }}</span>\n <button\n v-if=\"toggleable\"\n :id=\"$id + '_header'\"\n v-ripple\n type=\"button\"\n :aria-controls=\"$id + '_content'\"\n :aria-expanded=\"!d_collapsed\"\n :aria-label=\"buttonAriaLabel\"\n :class=\"cx('toggleButton')\"\n @click=\"toggle\"\n @keydown=\"onKeyDown\"\n v-bind=\"{ ...toggleButtonProps, ...ptm('toggleButton') }\"\n >\n <!--TODO: togglericon deprecated since v4.0-->\n <slot :name=\"$slots.toggleicon ? 'toggleicon' : 'togglericon'\" :collapsed=\"d_collapsed\" :class=\"cx('toggleIcon')\">\n <component :is=\"d_collapsed ? 'PlusIcon' : 'MinusIcon'\" :class=\"cx('toggleIcon')\" v-bind=\"ptm('toggleIcon')\" />\n </slot>\n <span :class=\"cx('legendLabel')\" v-bind=\"ptm('legendLabel')\">{{ legend }}</span>\n </button>\n </slot>\n </legend>\n <transition name=\"p-toggleable-content\" v-bind=\"ptm('transition')\">\n <div v-show=\"!d_collapsed\" :id=\"$id + '_content'\" :class=\"cx('contentContainer')\" role=\"region\" :aria-labelledby=\"$id + '_header'\" v-bind=\"ptm('contentContainer')\">\n <div :class=\"cx('content')\" v-bind=\"ptm('content')\">\n <slot></slot>\n </div>\n </div>\n </transition>\n </fieldset>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport MinusIcon from '@primevue/icons/minus';\nimport PlusIcon from '@primevue/icons/plus';\nimport Ripple from 'primevue/ripple';\nimport BaseFieldset from './BaseFieldset.vue';\n\nexport default {\n name: 'Fieldset',\n extends: BaseFieldset,\n inheritAttrs: false,\n emits: ['update:collapsed', 'toggle'],\n data() {\n return {\n d_collapsed: this.collapsed\n };\n },\n watch: {\n collapsed(newValue) {\n this.d_collapsed = newValue;\n }\n },\n methods: {\n toggle(event) {\n this.d_collapsed = !this.d_collapsed;\n this.$emit('update:collapsed', this.d_collapsed);\n this.$emit('toggle', {\n originalEvent: event,\n value: this.d_collapsed\n });\n },\n onKeyDown(event) {\n if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {\n this.toggle(event);\n event.preventDefault();\n }\n }\n },\n computed: {\n buttonAriaLabel() {\n return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.legend;\n },\n dataP() {\n return cn({\n toggleable: this.toggleable\n });\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n PlusIcon,\n MinusIcon\n }\n};\n</script>\n","<template>\n <fieldset :class=\"cx('root')\" :data-p=\"dataP\" v-bind=\"ptmi('root')\">\n <legend :class=\"cx('legend')\" :data-p=\"dataP\" v-bind=\"ptm('legend')\">\n <slot name=\"legend\" :toggleCallback=\"toggle\">\n <span v-if=\"!toggleable\" :id=\"$id + '_header'\" :class=\"cx('legendLabel')\" v-bind=\"ptm('legendLabel')\">{{ legend }}</span>\n <button\n v-if=\"toggleable\"\n :id=\"$id + '_header'\"\n v-ripple\n type=\"button\"\n :aria-controls=\"$id + '_content'\"\n :aria-expanded=\"!d_collapsed\"\n :aria-label=\"buttonAriaLabel\"\n :class=\"cx('toggleButton')\"\n @click=\"toggle\"\n @keydown=\"onKeyDown\"\n v-bind=\"{ ...toggleButtonProps, ...ptm('toggleButton') }\"\n >\n <!--TODO: togglericon deprecated since v4.0-->\n <slot :name=\"$slots.toggleicon ? 'toggleicon' : 'togglericon'\" :collapsed=\"d_collapsed\" :class=\"cx('toggleIcon')\">\n <component :is=\"d_collapsed ? 'PlusIcon' : 'MinusIcon'\" :class=\"cx('toggleIcon')\" v-bind=\"ptm('toggleIcon')\" />\n </slot>\n <span :class=\"cx('legendLabel')\" v-bind=\"ptm('legendLabel')\">{{ legend }}</span>\n </button>\n </slot>\n </legend>\n <transition name=\"p-toggleable-content\" v-bind=\"ptm('transition')\">\n <div v-show=\"!d_collapsed\" :id=\"$id + '_content'\" :class=\"cx('contentContainer')\" role=\"region\" :aria-labelledby=\"$id + '_header'\" v-bind=\"ptm('contentContainer')\">\n <div :class=\"cx('content')\" v-bind=\"ptm('content')\">\n <slot></slot>\n </div>\n </div>\n </transition>\n </fieldset>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport MinusIcon from '@primevue/icons/minus';\nimport PlusIcon from '@primevue/icons/plus';\nimport Ripple from 'primevue/ripple';\nimport BaseFieldset from './BaseFieldset.vue';\n\nexport default {\n name: 'Fieldset',\n extends: BaseFieldset,\n inheritAttrs: false,\n emits: ['update:collapsed', 'toggle'],\n data() {\n return {\n d_collapsed: this.collapsed\n };\n },\n watch: {\n collapsed(newValue) {\n this.d_collapsed = newValue;\n }\n },\n methods: {\n toggle(event) {\n this.d_collapsed = !this.d_collapsed;\n this.$emit('update:collapsed', this.d_collapsed);\n this.$emit('toggle', {\n originalEvent: event,\n value: this.d_collapsed\n });\n },\n onKeyDown(event) {\n if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {\n this.toggle(event);\n event.preventDefault();\n }\n }\n },\n computed: {\n buttonAriaLabel() {\n return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.legend;\n },\n dataP() {\n return cn({\n toggleable: this.toggleable\n });\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n PlusIcon,\n MinusIcon\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","legend","String","toggleable","Boolean","collapsed","toggleButtonProps","type","style","FieldsetStyle","provide","$pcFieldset","$parentInstance","BaseFieldset","inheritAttrs","emits","data","d_collapsed","watch","newValue","methods","toggle","event","$emit","originalEvent","value","onKeyDown","code","preventDefault","computed","buttonAriaLabel","ariaLabel","dataP","cn","directives","ripple","Ripple","components","PlusIcon","MinusIcon","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","$options","ptmi","_createElementVNode","ptm","_renderSlot","$slots","toggleCallback","id","$id","_hoisted_3","_withDirectives","$data","onClick","apply","arguments","onKeydown","_objectSpread","toggleicon","_createBlock","_resolveDynamicComponent","_createVNode","_Transition","role"],"mappings":";;;;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,cAAc;AACpB,EAAA,SAAA,EAASC,aAAa;AACtBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,MAAM,EAAEC,MAAM;AACdC,IAAAA,UAAU,EAAEC,OAAO;AACnBC,IAAAA,SAAS,EAAED,OAAO;AAClBE,IAAAA,iBAAiB,EAAE;AACfC,MAAAA,IAAI,EAAE,IAAI;MACV,SAAS,EAAA;AACb;GACH;AACDC,EAAAA,KAAK,EAAEC,aAAa;EACpBC,OAAO,EAAA,SAAPA,OAAOA,GAAG;IACN,OAAO;AACHC,MAAAA,WAAW,EAAE,IAAI;AACjBC,MAAAA,eAAe,EAAE;KACpB;AACL;AACJ,CAAC;;ACoBD,aAAe;AACXd,EAAAA,IAAI,EAAE,UAA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