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
83 lines (77 loc) • 2.5 kB
JavaScript
import { cn } from '@primeuix/utils';
import { mergeProps, openBlock, createBlock, resolveDynamicComponent, renderSlot, normalizeClass } from 'vue';
import BaseComponent from '@primevue/core/basecomponent';
import InputColorSliderHandleStyle from 'primevue/inputcolorsliderhandle/style';
var script$1 = {
name: 'BaseInputColorSliderHandle',
"extends": BaseComponent,
props: {
as: {
type: [String, Object, Function],
"default": 'DIV'
},
asChild: {
type: Boolean,
"default": false
}
},
style: InputColorSliderHandleStyle,
provide: function provide() {
return {
$pcInputColorSliderHandle: this,
$parentInstance: this
};
}
};
var script = {
name: 'InputColorSliderHandle',
"extends": script$1,
inheritAttrs: false,
inject: ['$pcInputColor', '$pcInputColorSlider'],
computed: {
attrs: function attrs() {
return mergeProps(this.a11yAttrs, this.ptmi('root'));
},
a11yAttrs: function a11yAttrs() {
var slider = this.$pcInputColorSlider;
var channel = slider.channel;
var range = slider.range;
var value = slider.currentValue;
return {
role: 'slider',
tabindex: this.$pcInputColor.disabled || slider.disabled ? -1 : 0,
'aria-disabled': this.$pcInputColor.disabled || slider.disabled || undefined,
'aria-orientation': slider.orientation,
'aria-label': channel,
'aria-valuemin': range.min,
'aria-valuemax': range.max,
'aria-valuenow': value,
'aria-valuetext': "".concat(channel, " ").concat(value),
'data-p': this.dataP,
style: slider.handleStyle,
onKeydown: slider.onSliderKeyDown
};
},
dataP: function dataP() {
var slider = this.$pcInputColorSlider;
return cn({
disabled: this.$pcInputColor.disabled || slider.disabled,
dragging: slider.isSliderDragging,
horizontal: slider.orientation === 'horizontal',
vertical: slider.orientation === 'vertical'
});
}
}
};
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), null, 16, ["class"])) : renderSlot(_ctx.$slots, "default", {
key: 1,
a11yAttrs: $options.a11yAttrs,
"class": normalizeClass(_ctx.cx('root'))
});
}
script.render = render;
export { script as default };