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 • 15.3 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../src/panel/BasePanel.vue","../../src/panel/Panel.vue","../../src/panel/Panel.vue?vue&type=template&id=7fee7348&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport PanelStyle from 'primevue/panel/style';\n\nexport default {\n name: 'BasePanel',\n extends: BaseComponent,\n props: {\n header: String,\n toggleable: Boolean,\n collapsed: Boolean,\n toggleButtonProps: {\n type: Object,\n default: () => {\n return {\n severity: 'secondary',\n text: true,\n rounded: true\n };\n }\n }\n },\n style: PanelStyle,\n provide() {\n return {\n $pcPanel: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :data-p=\"dataP\" v-bind=\"ptmi('root')\">\n <div :class=\"cx('header')\" :data-p=\"dataP\" v-bind=\"ptm('header')\">\n <slot :id=\"$id + '_header'\" name=\"header\" :class=\"cx('title')\">\n <span v-if=\"header\" :id=\"$id + '_header'\" :class=\"cx('title')\" v-bind=\"ptm('title')\">{{ header }}</span>\n </slot>\n <div :class=\"cx('headerActions')\" v-bind=\"ptm('headerActions')\">\n <slot name=\"icons\"></slot>\n <slot v-if=\"toggleable\" name=\"togglebutton\" :collapsed=\"d_collapsed\" :toggleCallback=\"(event) => toggle(event)\" :keydownCallback=\"(event) => onKeyDown(event)\">\n <Button\n :id=\"$id + '_header'\"\n :class=\"cx('pcToggleButton')\"\n :aria-label=\"buttonAriaLabel\"\n :aria-controls=\"$id + '_content'\"\n :aria-expanded=\"!d_collapsed\"\n :unstyled=\"unstyled\"\n @click=\"toggle(event)\"\n @keydown=\"onKeyDown(event)\"\n v-bind=\"toggleButtonProps\"\n :pt=\"ptm('pcToggleButton')\"\n >\n <template #icon=\"slotProps\">\n <!--TODO: togglericon deprecated since v4.0-->\n <slot :name=\"$slots.toggleicon ? 'toggleicon' : 'togglericon'\" :collapsed=\"d_collapsed\">\n <component :is=\"d_collapsed ? 'PlusIcon' : 'MinusIcon'\" :class=\"slotProps.class\" v-bind=\"ptm('pcToggleButton')['icon']\" />\n </slot>\n </template>\n </Button>\n </slot>\n </div>\n </div>\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 v-if=\"$slots.footer\" :class=\"cx('footer')\" v-bind=\"ptm('footer')\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </transition>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport MinusIcon from '@primevue/icons/minus';\nimport PlusIcon from '@primevue/icons/plus';\nimport Button from 'primevue/button';\nimport Ripple from 'primevue/ripple';\nimport BasePanel from './BasePanel.vue';\n\nexport default {\n name: 'Panel',\n extends: BasePanel,\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.header;\n },\n dataP() {\n return cn({\n toggleable: this.toggleable\n });\n }\n },\n components: {\n PlusIcon,\n MinusIcon,\n Button\n },\n directives: {\n ripple: Ripple\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :data-p=\"dataP\" v-bind=\"ptmi('root')\">\n <div :class=\"cx('header')\" :data-p=\"dataP\" v-bind=\"ptm('header')\">\n <slot :id=\"$id + '_header'\" name=\"header\" :class=\"cx('title')\">\n <span v-if=\"header\" :id=\"$id + '_header'\" :class=\"cx('title')\" v-bind=\"ptm('title')\">{{ header }}</span>\n </slot>\n <div :class=\"cx('headerActions')\" v-bind=\"ptm('headerActions')\">\n <slot name=\"icons\"></slot>\n <slot v-if=\"toggleable\" name=\"togglebutton\" :collapsed=\"d_collapsed\" :toggleCallback=\"(event) => toggle(event)\" :keydownCallback=\"(event) => onKeyDown(event)\">\n <Button\n :id=\"$id + '_header'\"\n :class=\"cx('pcToggleButton')\"\n :aria-label=\"buttonAriaLabel\"\n :aria-controls=\"$id + '_content'\"\n :aria-expanded=\"!d_collapsed\"\n :unstyled=\"unstyled\"\n @click=\"toggle(event)\"\n @keydown=\"onKeyDown(event)\"\n v-bind=\"toggleButtonProps\"\n :pt=\"ptm('pcToggleButton')\"\n >\n <template #icon=\"slotProps\">\n <!--TODO: togglericon deprecated since v4.0-->\n <slot :name=\"$slots.toggleicon ? 'toggleicon' : 'togglericon'\" :collapsed=\"d_collapsed\">\n <component :is=\"d_collapsed ? 'PlusIcon' : 'MinusIcon'\" :class=\"slotProps.class\" v-bind=\"ptm('pcToggleButton')['icon']\" />\n </slot>\n </template>\n </Button>\n </slot>\n </div>\n </div>\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 v-if=\"$slots.footer\" :class=\"cx('footer')\" v-bind=\"ptm('footer')\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </transition>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport MinusIcon from '@primevue/icons/minus';\nimport PlusIcon from '@primevue/icons/plus';\nimport Button from 'primevue/button';\nimport Ripple from 'primevue/ripple';\nimport BasePanel from './BasePanel.vue';\n\nexport default {\n name: 'Panel',\n extends: BasePanel,\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.header;\n },\n dataP() {\n return cn({\n toggleable: this.toggleable\n });\n }\n },\n components: {\n PlusIcon,\n MinusIcon,\n Button\n },\n directives: {\n ripple: Ripple\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","header","String","toggleable","Boolean","collapsed","toggleButtonProps","type","Object","default","severity","text","rounded","style","PanelStyle","provide","$pcPanel","$parentInstance","BasePanel","inheritAttrs","emits","data","d_collapsed","watch","newValue","methods","toggle","event","$emit","originalEvent","value","onKeyDown","code","preventDefault","computed","buttonAriaLabel","ariaLabel","dataP","cn","components","PlusIcon","MinusIcon","Button","directives","ripple","Ripple","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","$options","ptmi","_createElementVNode","ptm","_renderSlot","$slots","id","$id","$data","toggleCallback","keydownCallback","_createVNode","_component_Button","unstyled","onClick","_cache","$event","onKeydown","pt","icon","_withCtx","slotProps","toggleicon","_createBlock","_resolveDynamicComponent","_Transition","_withDirectives","role","footer"],"mappings":";;;;;;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