UNPKG

@public-ui/components

Version:

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

38 lines (35 loc) 1.09 kB
/*! * KoliBri - The accessible HTML-Standard */ 'use strict'; function buildDefaultPropsFromConfig(config) { var _a, _b; const defaults = {}; for (const def of [...((_a = config.required) !== null && _a !== void 0 ? _a : []), ...((_b = config.optional) !== null && _b !== void 0 ? _b : [])]) { defaults[def.propName] = def.getDefaultValue(); } return defaults; } class BaseController { constructor(stateAccess, propsConfig) { this.rawProps = {}; this.setState = stateAccess.setState; this.getState = stateAccess.getState; this.renderProps = buildDefaultPropsFromConfig(propsConfig); } setRawProp(key, value) { this.rawProps[key] = value; } getRawProp(key) { return this.rawProps[key]; } setRenderProp(key, value) { this.renderProps[key] = value; } getRenderProp(key) { return this.renderProps[key]; } } exports.BaseController = BaseController; //# sourceMappingURL=base-controller-DAzsTqX9.js.map //# sourceMappingURL=base-controller-DAzsTqX9.js.map