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
80 lines (74 loc) • 2.2 kB
JavaScript
import { cn } from '@primeuix/utils';
import InputColorAreaBackground from 'primevue/inputcolorareabackground';
import InputColorAreaHandle from 'primevue/inputcolorareahandle';
import { mergeProps, openBlock, createBlock, resolveDynamicComponent, withCtx, renderSlot, normalizeClass } from 'vue';
import BaseComponent from '@primevue/core/basecomponent';
import InputColorAreaStyle from 'primevue/inputcolorarea/style';
var script$1 = {
name: 'BaseInputColorArea',
"extends": BaseComponent,
props: {
as: {
type: [String, Object, Function],
"default": 'DIV'
},
asChild: {
type: Boolean,
"default": false
}
},
style: InputColorAreaStyle,
provide: function provide() {
return {
$pcInputColorArea: this,
$parentInstance: this
};
}
};
var script = {
name: 'InputColorArea',
"extends": script$1,
inheritAttrs: false,
inject: ['$pcInputColor'],
components: {
InputColorAreaBackground: InputColorAreaBackground,
InputColorAreaHandle: InputColorAreaHandle
},
computed: {
attrs: function attrs() {
return mergeProps(this.a11yAttrs, this.ptmi('root'));
},
a11yAttrs: function a11yAttrs() {
return {
style: this.$pcInputColor.areaStyles,
'data-p': this.dataP,
onPointerdown: this.$pcInputColor.onAreaPointerDown,
onPointermove: this.$pcInputColor.onAreaPointerMove,
onPointerup: this.$pcInputColor.onAreaPointerUp
};
},
dataP: function dataP() {
return cn({
disabled: this.$pcInputColor.disabled,
dragging: this.$pcInputColor.isAreaDragging
});
}
}
};
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), {
"default": withCtx(function () {
return [renderSlot(_ctx.$slots, "default")];
}),
_: 3
}, 16, ["class"])) : renderSlot(_ctx.$slots, "default", {
key: 1,
a11yAttrs: $options.a11yAttrs,
"class": normalizeClass(_ctx.cx('root'))
});
}
script.render = render;
export { script as default };