UNPKG

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 8.16 kB
{"version":3,"file":"index.mjs","sources":["../../src/chip/BaseChip.vue","../../src/chip/Chip.vue","../../src/chip/Chip.vue?vue&type=template&id=f37b67c4&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport ChipStyle from 'primevue/chip/style';\n\nexport default {\n name: 'BaseChip',\n extends: BaseComponent,\n props: {\n label: {\n type: [String, Number],\n default: null\n },\n icon: {\n type: String,\n default: null\n },\n image: {\n type: String,\n default: null\n },\n removable: {\n type: Boolean,\n default: false\n },\n removeIcon: {\n type: String,\n default: undefined\n }\n },\n style: ChipStyle,\n provide() {\n return {\n $pcChip: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div v-if=\"visible\" :class=\"cx('root')\" :aria-label=\"label\" v-bind=\"ptmi('root')\" :data-p=\"dataP\">\n <slot>\n <img v-if=\"image\" :src=\"image\" v-bind=\"ptm('image')\" :class=\"cx('image')\" />\n <component v-else-if=\"$slots.icon\" :is=\"$slots.icon\" :class=\"cx('icon')\" v-bind=\"ptm('icon')\" />\n <span v-else-if=\"icon\" :class=\"[cx('icon'), icon]\" v-bind=\"ptm('icon')\" />\n <div v-if=\"label\" :class=\"cx('label')\" v-bind=\"ptm('label')\">{{ label }}</div>\n </slot>\n <slot v-if=\"removable\" name=\"removeicon\" :removeCallback=\"close\" :keydownCallback=\"onKeydown\">\n <component :is=\"removeIcon ? 'span' : 'TimesCircleIcon'\" :class=\"[cx('removeIcon'), removeIcon]\" @click=\"close\" @keydown=\"onKeydown\" v-bind=\"ptm('removeIcon')\"></component>\n </slot>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport TimesCircleIcon from '@primevue/icons/timescircle';\nimport BaseChip from './BaseChip.vue';\n\nexport default {\n name: 'Chip',\n extends: BaseChip,\n inheritAttrs: false,\n emits: ['remove'],\n data() {\n return {\n visible: true\n };\n },\n methods: {\n onKeydown(event) {\n if (event.key === 'Enter' || event.key === 'Backspace') {\n this.close(event);\n }\n },\n close(event) {\n this.visible = false;\n this.$emit('remove', event);\n }\n },\n computed: {\n dataP() {\n return cn({\n removable: this.removable\n });\n }\n },\n components: {\n TimesCircleIcon\n }\n};\n</script>\n","<template>\n <div v-if=\"visible\" :class=\"cx('root')\" :aria-label=\"label\" v-bind=\"ptmi('root')\" :data-p=\"dataP\">\n <slot>\n <img v-if=\"image\" :src=\"image\" v-bind=\"ptm('image')\" :class=\"cx('image')\" />\n <component v-else-if=\"$slots.icon\" :is=\"$slots.icon\" :class=\"cx('icon')\" v-bind=\"ptm('icon')\" />\n <span v-else-if=\"icon\" :class=\"[cx('icon'), icon]\" v-bind=\"ptm('icon')\" />\n <div v-if=\"label\" :class=\"cx('label')\" v-bind=\"ptm('label')\">{{ label }}</div>\n </slot>\n <slot v-if=\"removable\" name=\"removeicon\" :removeCallback=\"close\" :keydownCallback=\"onKeydown\">\n <component :is=\"removeIcon ? 'span' : 'TimesCircleIcon'\" :class=\"[cx('removeIcon'), removeIcon]\" @click=\"close\" @keydown=\"onKeydown\" v-bind=\"ptm('removeIcon')\"></component>\n </slot>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport TimesCircleIcon from '@primevue/icons/timescircle';\nimport BaseChip from './BaseChip.vue';\n\nexport default {\n name: 'Chip',\n extends: BaseChip,\n inheritAttrs: false,\n emits: ['remove'],\n data() {\n return {\n visible: true\n };\n },\n methods: {\n onKeydown(event) {\n if (event.key === 'Enter' || event.key === 'Backspace') {\n this.close(event);\n }\n },\n close(event) {\n this.visible = false;\n this.$emit('remove', event);\n }\n },\n computed: {\n dataP() {\n return cn({\n removable: this.removable\n });\n }\n },\n components: {\n TimesCircleIcon\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","label","type","String","Number","icon","image","removable","Boolean","removeIcon","undefined","style","ChipStyle","provide","$pcChip","$parentInstance","BaseChip","inheritAttrs","emits","data","visible","methods","onKeydown","event","key","close","$emit","computed","dataP","cn","components","TimesCircleIcon","$data","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","ptmi","$options","_renderSlot","src","ptm","$slots","_createBlock","_resolveDynamicComponent","removeCallback","keydownCallback","onClick"],"mappings":";;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,UAAU;AAChB,EAAA,SAAA,EAASC,aAAa;AACtBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,KAAK,EAAE;AACHC,MAAAA,IAAI,EAAE,CAACC,MAAM,EAAEC,MAAM,CAAC;MACtB,SAAS,EAAA;KACZ;AACDC,IAAAA,IAAI,EAAE;AACFH,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDG,IAAAA,KAAK,EAAE;AACHJ,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDI,IAAAA,SAAS,EAAE;AACPL,MAAAA,IAAI,EAAEM,OAAO;MACb,SAAS,EAAA;KACZ;AACDC,IAAAA,UAAU,EAAE;AACRP,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAASO,EAAAA;AACb;GACH;AACDC,EAAAA,KAAK,EAAEC,SAAS;EAChBC,OAAO,EAAA,SAAPA,OAAOA,GAAG;IACN,OAAO;AACHC,MAAAA,OAAO,EAAE,IAAI;AACbC,MAAAA,eAAe,EAAE;KACpB;AACL;AACJ,CAAC;;ACjBD,aAAe;AACXjB,EAAAA,IAAI,EAAE,MAAM;AACZ,EAAA,SAAA,EAASkB,QAAQ;AACjBC,EAAAA,YAAY,EAAE,KAAK;EACnBC,KAAK,EAAE,CAAC,QAAQ,CAAC;EACjBC,IAAI,EAAA,SAAJA,IAAIA,GAAG;IACH,OAAO;AACHC,MAAAA,OAAO,EAAE;KACZ;GACJ;AACDC,EAAAA,OAAO,EAAE;AACLC,IAAAA,SAAS,EAATA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