@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
91 lines (86 loc) • 3.54 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { g as watchString, e as watchBoolean } from './common-Cx_AGO_M.js';
import { v as validateAutoComplete } from './auto-complete-BbMivzAV.js';
import { a as validateHasCounter, v as validateMaxLengthBehavior, b as validateMaxLength } from './max-length-behavior-CpaNmMus.js';
import { v as validatePlaceholder } from './placeholder-DTOUrN5s.js';
import { v as validateReadOnly } from './read-only-DUMeby7s.js';
import { v as validateRequired } from './required-DFzRSWky.js';
import { v as validateVariantClassName } from './variant-class-name-BCcQYpIV.js';
import { I as InputIconController } from './controller-icon-DekcIBGR.js';
const validatePattern = (component, value, options = {}) => {
watchString(component, '_pattern', value, options);
};
const validateVisibilityToggle = (component, value, hooks) => {
watchBoolean(component, '_visibilityToggle', value, hooks);
};
class InputPasswordController extends InputIconController {
constructor(component, name, host) {
super(component, name, host);
this.afterSyncCharCounter = () => {
if (typeof this.component._value === 'string') {
this.component.state._currentLength = this.component._value.length;
this.updateCurrentLengthDebounced(this.component._value.length);
}
};
this.component = component;
}
validateAutoComplete(value) {
validateAutoComplete(this.component, value);
}
validateHasCounter(value) {
validateHasCounter(this.component, value);
}
validateMaxLengthBehavior(value) {
validateMaxLengthBehavior(this.component, value);
}
validateMaxLength(value) {
validateMaxLength(this.component, value, {
hooks: { afterPatch: this.afterSyncCharCounter },
});
}
validatePattern(value) {
validatePattern(this.component, value);
}
validatePlaceholder(value) {
validatePlaceholder(this.component, value);
}
validateReadOnly(value) {
validateReadOnly(this.component, value);
}
validateRequired(value) {
validateRequired(this.component, value);
}
validateValue(value) {
watchString(this.component, '_value', value, {
hooks: {
afterPatch: this.afterSyncCharCounter,
},
});
this.setFormAssociatedValue(this.component.state._value);
}
validateVariant(value) {
validateVariantClassName(this.component, value);
}
validateVisibilityToggle(value) {
validateVisibilityToggle(this.component, value);
}
componentWillLoad() {
super.componentWillLoad();
this.validateAutoComplete(this.component._autoComplete);
this.validateHasCounter(this.component._hasCounter);
this.validateMaxLengthBehavior(this.component._maxLengthBehavior);
this.validateMaxLength(this.component._maxLength);
this.validatePattern(this.component._pattern);
this.validatePlaceholder(this.component._placeholder);
this.validateReadOnly(this.component._readOnly);
this.validateRequired(this.component._required);
this.validateValue(this.component._value);
this.validateVariant(this.component._variant);
this.validateVisibilityToggle(this.component._visibilityToggle);
}
}
export { InputPasswordController as I };
//# sourceMappingURL=controller-CJmWOqQQ.js.map
//# sourceMappingURL=controller-CJmWOqQQ.js.map