UNPKG

primevue

Version:

PrimeVue is a premium UI library for Vue featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, wh

84 lines (78 loc) 2.24 kB
import { cn } from '@primeuix/utils'; import { mergeProps, openBlock, createBlock, resolveDynamicComponent, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, normalizeClass } from 'vue'; import BaseComponent from '@primevue/core/basecomponent'; import Button from 'primevue/button'; import InputColorEyeDropperStyle from 'primevue/inputcoloreyedropper/style'; var script$1 = { name: 'BaseInputColorEyeDropper', "extends": BaseComponent, props: { as: { type: [String, Object, Function], "default": function _default() { return Button; } }, asChild: { type: Boolean, "default": false } }, style: InputColorEyeDropperStyle, provide: function provide() { return { $pcInputColorEyeDropper: this, $parentInstance: this }; } }; var script = { name: 'InputColorEyeDropper', "extends": script$1, inheritAttrs: false, inject: ['$pcInputColor'], methods: { onClick: function onClick(event) { this.$pcInputColor.openEyeDropper(event); } }, computed: { attrs: function attrs() { return mergeProps(this.a11yAttrs, this.ptmi('root')); }, a11yAttrs: function a11yAttrs() { return { type: 'button', disabled: this.$pcInputColor.disabled || undefined, 'data-p': this.dataP, onClick: this.onClick }; }, dataP: function dataP() { return cn({ disabled: this.$pcInputColor.disabled }); } } }; function render(_ctx, _cache, $props, $setup, $data, $options) { return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ key: 0, "class": _ctx.cx('root') }, $options.attrs), createSlots({ _: 2 }, [renderList(_ctx.$slots, function (_, slotName) { return { name: slotName, fn: withCtx(function (slotProps) { return [renderSlot(_ctx.$slots, slotName, normalizeProps(guardReactiveProps(slotProps || {})))]; }) }; })]), 1040, ["class"])) : renderSlot(_ctx.$slots, "default", { key: 1, a11yAttrs: $options.a11yAttrs, "class": normalizeClass(_ctx.cx('root')) }); } script.render = render; export { script as default };