UNPKG

@public-ui/components

Version:

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

41 lines (35 loc) 1.34 kB
/*! * KoliBri - The accessible HTML-Standard */ 'use strict'; var normalizers = require('./normalizers-BCLslVaT.js'); function throwNoStateAccess() { throw new Error('This controller does not use component state.'); } class BaseWebComponent { constructor() { this.stateAccess = { setState: (key, value) => { this[key] = value; }, getState: (key) => { return this[key]; }, }; } } BaseWebComponent.stateLess = Object.freeze({ setState: throwNoStateAccess, getState: throwNoStateAccess, }); const LOADING_OPTIONS = ['eager', 'lazy']; const LOADING_SET = new Set(LOADING_OPTIONS); const loadingProp = normalizers.createPropDefinition('loading', 'lazy', (value) => normalizers.normalizeString(value), (v) => LOADING_SET.has(v)); const QUOTE_VARIANT_OPTIONS = ['block', 'inline']; const QUOTE_VARIANT_SET = new Set(QUOTE_VARIANT_OPTIONS); const variantQuoteProp = normalizers.createPropDefinition('variant', 'inline', (value) => normalizers.normalizeString(value), (v) => QUOTE_VARIANT_SET.has(v)); exports.BaseWebComponent = BaseWebComponent; exports.loadingProp = loadingProp; exports.variantQuoteProp = variantQuoteProp; //# sourceMappingURL=variant-quote-DpNzmCtr.js.map //# sourceMappingURL=variant-quote-DpNzmCtr.js.map