accessibleprimevue
Version:
Note: This is the forked version of the Primefaces/PrimeVue repository. Since V3 has reached its EOL this is use to fix identified accessibility bugs in the v3 version of primevue. PrimeVue is an open source UI library for Vue featuring a rich set of 80+
79 lines (70 loc) • 2.37 kB
JavaScript
this.primevue = this.primevue || {};
this.primevue.inputtext = (function (BaseComponent, InputTextStyle, vue) {
'use strict';
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
var InputTextStyle__default = /*#__PURE__*/_interopDefaultLegacy(InputTextStyle);
var script$1 = {
name: 'BaseInputText',
"extends": BaseComponent__default["default"],
props: {
modelValue: null,
size: {
type: String,
"default": null
},
invalid: {
type: Boolean,
"default": false
},
variant: {
type: String,
"default": null
}
},
style: InputTextStyle__default["default"],
provide: function provide() {
return {
$parentInstance: this
};
}
};
var script = {
name: 'InputText',
"extends": script$1,
inheritAttrs: false,
emits: ['update:modelValue'],
methods: {
getPTOptions: function getPTOptions(key) {
var _ptm = key === 'root' ? this.ptmi : this.ptm;
return _ptm(key, {
context: {
filled: this.filled,
disabled: this.$attrs.disabled || this.$attrs.disabled === ''
}
});
},
onInput: function onInput(event) {
this.$emit('update:modelValue', event.target.value);
}
},
computed: {
filled: function filled() {
return this.modelValue != null && this.modelValue.toString().length > 0;
}
}
};
var _hoisted_1 = ["value", "aria-invalid"];
function render(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
"class": _ctx.cx('root'),
value: _ctx.modelValue,
"aria-invalid": _ctx.invalid || undefined,
onInput: _cache[0] || (_cache[0] = function () {
return $options.onInput && $options.onInput.apply($options, arguments);
})
}, $options.getPTOptions('root')), null, 16, _hoisted_1);
}
script.render = render;
return script;
})(primevue.basecomponent, primevue.inputtext.style, Vue);