UNPKG

@public-ui/components

Version:

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

79 lines (71 loc) 4.92 kB
/*! * KoliBri - The accessible HTML-Standard */ 'use strict'; var index = require('./index-BrhW8s5h.js'); var variantQuote = require('./variant-quote-DpNzmCtr.js'); var component = require('./component-CuHGwo27.js'); require('./common-DPb6NWR4.js'); var normalizers = require('./normalizers-BCLslVaT.js'); var label = require('./label-DRrPbj-j.js'); var baseController = require('./base-controller-DAzsTqX9.js'); require('./tslib.es6-Cm0ytgPY.js'); require('./bem-registry-DevvgGUu.js'); require('./clsx-Bm_HQUnh.js'); require('./_Uint8Array-BAQUGozM.js'); require('./isArray-BOIOdEQh.js'); const iconsProp = normalizers.createPropDefinition('icons', 'kolicon-logo', normalizers.normalizeString); const iconPropsConfig = { required: [iconsProp, label.labelProp], }; class IconController extends baseController.BaseController { constructor(stateAccess) { super(stateAccess, iconPropsConfig); } componentWillLoad(props) { const { icons, label } = props; this.watchIcons(icons); this.watchLabel(label); } watchIcons(value) { iconsProp.apply(value, (v) => { this.setRenderProp('icons', v); }); } watchLabel(value) { label.labelProp.apply(value, (v) => { this.setRenderProp('label', v); }); } } const defaultStyleCss = "@font-face {\n font-family: \"kolicons\";\n src: url(\"kolicons.eot?t=1780571516250\"); /* IE9*/\n src: url(\"kolicons.eot?t=1780571516250#iefix\") format(\"embedded-opentype\"), url(\"kolicons.woff2?t=1780571516250\") format(\"woff2\"), url(\"kolicons.woff?t=1780571516250\") format(\"woff\"), url(\"kolicons.ttf?t=1780571516250\") format(\"truetype\"), url(\"kolicons.svg?t=1780571516250#kolicons\") format(\"svg\"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=\" kolicon-\"] {\n font-family: \"kolicons\";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: \"\\ea01\";\n }\n .kolicon-alert-info::before {\n content: \"\\ea02\";\n }\n .kolicon-alert-success::before {\n content: \"\\ea03\";\n }\n .kolicon-alert-warning::before {\n content: \"\\ea04\";\n }\n .kolicon-check::before {\n content: \"\\ea05\";\n }\n .kolicon-chevron-double-left::before {\n content: \"\\ea06\";\n }\n .kolicon-chevron-double-right::before {\n content: \"\\ea07\";\n }\n .kolicon-chevron-down::before {\n content: \"\\ea08\";\n }\n .kolicon-chevron-left::before {\n content: \"\\ea09\";\n }\n .kolicon-chevron-right::before {\n content: \"\\ea0a\";\n }\n .kolicon-chevron-up::before {\n content: \"\\ea0b\";\n }\n .kolicon-cogwheel::before {\n content: \"\\ea0c\";\n }\n .kolicon-cross::before {\n content: \"\\ea0d\";\n }\n .kolicon-eye-closed::before {\n content: \"\\ea0e\";\n }\n .kolicon-eye::before {\n content: \"\\ea0f\";\n }\n .kolicon-house::before {\n content: \"\\ea10\";\n }\n .kolicon-kolibri::before {\n content: \"\\ea11\";\n }\n .kolicon-link-external::before {\n content: \"\\ea12\";\n }\n .kolicon-link::before {\n content: \"\\ea13\";\n }\n .kolicon-minus::before {\n content: \"\\ea14\";\n }\n .kolicon-plus::before {\n content: \"\\ea15\";\n }\n .kolicon-settings::before {\n content: \"\\ea16\";\n }\n .kolicon-sort-asc::before {\n content: \"\\ea17\";\n }\n .kolicon-sort-desc::before {\n content: \"\\ea18\";\n }\n .kolicon-sort-neutral::before {\n content: \"\\ea19\";\n }\n .kolicon-up::before {\n content: \"\\ea1a\";\n }\n .kolicon-version::before {\n content: \"\\ea1b\";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n}"; const KolIcon = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.ctrl = new IconController(variantQuote.BaseWebComponent.stateLess); } watchIcons(value) { this.ctrl.watchIcons(value); } watchLabel(value) { this.ctrl.watchLabel(value); } componentWillLoad() { this.ctrl.componentWillLoad({ icons: this._icons, label: this._label, }); } render() { return (index.h(index.Host, { key: '0127f2d35f4164f440a30fec825e10158fc833a5' }, index.h(component.IconFC, { key: '6fa23897706337c29bc4ef2551904436b2a65785', icons: this.ctrl.getRenderProp('icons'), label: this.ctrl.getRenderProp('label') }))); } static get watchers() { return { "_icons": ["watchIcons"], "_label": ["watchLabel"] }; } }; KolIcon.style = { default: defaultStyleCss }; exports.kol_icon = KolIcon; //# sourceMappingURL=kol-icon.entry.cjs.js.map