UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

55 lines (50 loc) 1.85 kB
/*! * KoliBri - The accessible HTML-Standard */ 'use strict'; var common = require('./common-DPb6NWR4.js'); var spellCheck = require('./spell-check-DIEJiRbq.js'); var suggestions = require('./suggestions-CjIs1OMC.js'); var controller = require('./controller-B6zjPE-P.js'); const inputTextTypeOptions = ['text', 'search', 'url', 'tel']; const isInputTextTypePropType = (value) => { return typeof value === 'string' && inputTextTypeOptions.includes(value); }; const validateTypeInputText = (component, value) => { common.watchValidator(component, '_type', isInputTextTypePropType, new Set(inputTextTypeOptions), value); }; class InputTextEmailController extends controller.InputPasswordController { constructor(component, name, host) { super(component, name, host); this.component = component; } validateSuggestions(value) { suggestions.validateSuggestions(this.component, value); } componentWillLoad() { super.componentWillLoad(); this.validateSuggestions(this.component._suggestions); } } class InputTextController extends InputTextEmailController { constructor(component, name, host) { super(component, name, host); this.hasError = false; this.component = component; } validateSpellCheck(value) { spellCheck.validateSpellCheck(this.component, value); } validateType(value) { validateTypeInputText(this.component, value); } componentWillLoad() { super.componentWillLoad(); this.validateSpellCheck(this.component._spellCheck); this.validateType(this.component._type); } } exports.InputTextController = InputTextController; exports.InputTextEmailController = InputTextEmailController; //# sourceMappingURL=controller-DLDmoPss.js.map //# sourceMappingURL=controller-DLDmoPss.js.map