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 12.4 kB
{"version":3,"file":"index.mjs","sources":["../../src/message/BaseMessage.vue","../../src/message/Message.vue","../../src/message/Message.vue?vue&type=template&id=47f98d28&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport MessageStyle from 'primevue/message/style';\n\nexport default {\n name: 'BaseMessage',\n extends: BaseComponent,\n props: {\n severity: {\n type: String,\n default: 'info'\n },\n closable: {\n type: Boolean,\n default: false\n },\n life: {\n type: Number,\n default: null\n },\n icon: {\n type: String,\n default: undefined\n },\n closeIcon: {\n type: String,\n default: undefined\n },\n closeButtonProps: {\n type: null,\n default: null\n },\n size: {\n type: String,\n default: null\n },\n variant: {\n type: String,\n default: null\n }\n },\n style: MessageStyle,\n provide() {\n return {\n $pcMessage: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <transition name=\"p-message\" appear v-bind=\"ptmi('transition')\">\n <div v-show=\"visible\" :class=\"cx('root')\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" :data-p=\"dataP\" v-bind=\"ptm('root')\">\n <slot v-if=\"$slots.container\" name=\"container\" :closeCallback=\"close\"></slot>\n <div v-else :class=\"cx('content')\" :data-p=\"dataP\" v-bind=\"ptm('content')\">\n <slot name=\"icon\" :class=\"cx('icon')\">\n <component :is=\"icon ? 'span' : null\" :class=\"[cx('icon'), icon]\" :data-p=\"dataP\" v-bind=\"ptm('icon')\"></component>\n </slot>\n <div v-if=\"$slots.default\" :class=\"cx('text')\" :data-p=\"dataP\" v-bind=\"ptm('text')\">\n <slot></slot>\n </div>\n <button v-if=\"closable\" v-ripple :class=\"cx('closeButton')\" :aria-label=\"closeAriaLabel\" type=\"button\" @click=\"close($event)\" :data-p=\"dataP\" v-bind=\"{ ...closeButtonProps, ...ptm('closeButton') }\">\n <slot name=\"closeicon\">\n <i v-if=\"closeIcon\" :class=\"[cx('closeIcon'), closeIcon]\" :data-p=\"dataP\" v-bind=\"ptm('closeIcon')\" />\n <TimesIcon v-else :class=\"[cx('closeIcon'), closeIcon]\" :data-p=\"dataP\" v-bind=\"ptm('closeIcon')\" />\n </slot>\n </button>\n </div>\n </div>\n </transition>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport TimesIcon from '@primevue/icons/times';\nimport Ripple from 'primevue/ripple';\nimport BaseMessage from './BaseMessage.vue';\n\nexport default {\n name: 'Message',\n extends: BaseMessage,\n inheritAttrs: false,\n emits: ['close', 'life-end'],\n timeout: null,\n data() {\n return {\n visible: true\n };\n },\n mounted() {\n if (this.life) {\n setTimeout(() => {\n this.visible = false;\n this.$emit('life-end');\n }, this.life);\n }\n },\n methods: {\n close(event) {\n this.visible = false;\n this.$emit('close', event);\n }\n },\n computed: {\n closeAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;\n },\n dataP() {\n return cn({\n outlined: this.variant === 'outlined',\n simple: this.variant === 'simple',\n [this.severity]: this.severity,\n [this.size]: this.size\n });\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n TimesIcon\n }\n};\n</script>\n","<template>\n <transition name=\"p-message\" appear v-bind=\"ptmi('transition')\">\n <div v-show=\"visible\" :class=\"cx('root')\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" :data-p=\"dataP\" v-bind=\"ptm('root')\">\n <slot v-if=\"$slots.container\" name=\"container\" :closeCallback=\"close\"></slot>\n <div v-else :class=\"cx('content')\" :data-p=\"dataP\" v-bind=\"ptm('content')\">\n <slot name=\"icon\" :class=\"cx('icon')\">\n <component :is=\"icon ? 'span' : null\" :class=\"[cx('icon'), icon]\" :data-p=\"dataP\" v-bind=\"ptm('icon')\"></component>\n </slot>\n <div v-if=\"$slots.default\" :class=\"cx('text')\" :data-p=\"dataP\" v-bind=\"ptm('text')\">\n <slot></slot>\n </div>\n <button v-if=\"closable\" v-ripple :class=\"cx('closeButton')\" :aria-label=\"closeAriaLabel\" type=\"button\" @click=\"close($event)\" :data-p=\"dataP\" v-bind=\"{ ...closeButtonProps, ...ptm('closeButton') }\">\n <slot name=\"closeicon\">\n <i v-if=\"closeIcon\" :class=\"[cx('closeIcon'), closeIcon]\" :data-p=\"dataP\" v-bind=\"ptm('closeIcon')\" />\n <TimesIcon v-else :class=\"[cx('closeIcon'), closeIcon]\" :data-p=\"dataP\" v-bind=\"ptm('closeIcon')\" />\n </slot>\n </button>\n </div>\n </div>\n </transition>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport TimesIcon from '@primevue/icons/times';\nimport Ripple from 'primevue/ripple';\nimport BaseMessage from './BaseMessage.vue';\n\nexport default {\n name: 'Message',\n extends: BaseMessage,\n inheritAttrs: false,\n emits: ['close', 'life-end'],\n timeout: null,\n data() {\n return {\n visible: true\n };\n },\n mounted() {\n if (this.life) {\n setTimeout(() => {\n this.visible = false;\n this.$emit('life-end');\n }, this.life);\n }\n },\n methods: {\n close(event) {\n this.visible = false;\n this.$emit('close', event);\n }\n },\n computed: {\n closeAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;\n },\n dataP() {\n return cn({\n outlined: this.variant === 'outlined',\n simple: this.variant === 'simple',\n [this.severity]: this.severity,\n [this.size]: this.size\n });\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n TimesIcon\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","severity","type","String","closable","Boolean","life","Number","icon","undefined","closeIcon","closeButtonProps","size","variant","style","MessageStyle","provide","$pcMessage","$parentInstance","BaseMessage","inheritAttrs","emits","timeout","data","visible","mounted","_this","setTimeout","$emit","methods","close","event","computed","closeAriaLabel","$primevue","config","locale","aria","dataP","cn","_defineProperty","outlined","simple","directives","ripple","Ripple","components","TimesIcon","_openBlock","_createBlock","_Transition","_mergeProps","appear","_ctx","ptmi","_withDirectives","_createElementVNode","cx","role","$options","ptm","$slots","container","_renderSlot","closeCallback","_createElementBlock","_resolveDynamicComponent","onClick","_cache","$event","_objectSpread","_hoisted_5","_component_TimesIcon","$data"],"mappings":";;;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,aAAa;AACnB,EAAA,SAAA,EAASC,aAAa;AACtBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,QAAQ,EAAE;AACNC,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDC,IAAAA,QAAQ,EAAE;AACNF,MAAAA,IAAI,EAAEG,OAAO;MACb,SAAS,EAAA;KACZ;AACDC,IAAAA,IAAI,EAAE;AACFJ,MAAAA,IAAI,EAAEK,MAAM;MACZ,SAAS,EAAA;KACZ;AACDC,IAAAA,IAAI,EAAE;AACFN,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAASM,EAAAA;KACZ;AACDC,IAAAA,SAAS,EAAE;AACPR,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAASM,EAAAA;KACZ;AACDE,IAAAA,gBAAgB,EAAE;AACdT,MAAAA,IAAI,EAAE,IAAI;MACV,SAAS,EAAA;KACZ;AACDU,IAAAA,IAAI,EAAE;AACFV,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDU,IAAAA,OAAO,EAAE;AACLX,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;AACb;GACH;AACDW,EAAAA,KAAK,EAAEC,YAAY;EACnBC,OAAO,EAAA,SAAPA,OAAOA,GAAG;IACN,OAAO;AACHC,MAAAA,UAAU,EAAE,IAAI;AAChBC,MAAAA,eAAe,EAAE;KACpB;AACL;AACJ,CAAC;;;;;;ACpBD,aAAe;AACXpB,EAAAA,IAAI,EAAE,SAAS;AACf,EAAA,SAAA,EAASqB,QAAW;AACpBC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;A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