@public-ui/components 4.5.0-rc.6 → 4.5.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/kolicons/kolicons.eot +0 -0
- package/assets/kolicons/kolicons.ttf +0 -0
- package/assets/kolicons/kolicons.woff +0 -0
- package/assets/kolicons/kolicons.woff2 +0 -0
- package/assets/kolicons/style.css +6 -6
- package/custom-elements.json +1 -2
- package/dist/cjs/{Heading-Bck3PFpH.js → Heading-yiwXjRrz.js} +3 -3
- package/dist/cjs/{Heading-Bck3PFpH.js.map → Heading-yiwXjRrz.js.map} +1 -1
- package/dist/cjs/{api-BcNl2vZm.js → api-BDT5xkx5.js} +8 -8
- package/dist/cjs/{api-BcNl2vZm.js.map → api-BDT5xkx5.js.map} +1 -1
- package/dist/cjs/{api-LP3gnw7U.js → api-BI1qXrGa.js} +12 -12
- package/dist/cjs/{api-LP3gnw7U.js.map → api-BI1qXrGa.js.map} +1 -1
- package/dist/cjs/{app-globals-oR-jEiju.js → app-globals-DPVGNVgE.js} +4 -4
- package/dist/cjs/{app-globals-oR-jEiju.js.map → app-globals-DPVGNVgE.js.map} +1 -1
- package/dist/cjs/{base-DbfvhKRa.js → base-B_M9Y7nD.js} +4 -4
- package/dist/cjs/{base-DbfvhKRa.js.map → base-B_M9Y7nD.js.map} +1 -1
- package/dist/cjs/{base-BDGmLWVj.js → base-CaQNXZrN.js} +5 -5
- package/dist/cjs/{base-BDGmLWVj.js.map → base-CaQNXZrN.js.map} +1 -1
- package/dist/cjs/{base-CwXJywKD.js → base-DlsemYqM.js} +4 -4
- package/dist/cjs/{base-CwXJywKD.js.map → base-DlsemYqM.js.map} +1 -1
- package/dist/cjs/{base-DaK2F3pq.js → base-FZ2Hemhr.js} +16 -16
- package/dist/cjs/{base-DaK2F3pq.js.map → base-FZ2Hemhr.js.map} +1 -1
- package/dist/cjs/{base-web-component-C8MLLGxi.js → base-web-component-BK8X1O8C.js} +16 -9
- package/dist/cjs/base-web-component-BK8X1O8C.js.map +1 -0
- package/dist/cjs/{base-web-component-mmgXJMg0.js → base-web-component-GLk66TOu.js} +7 -7
- package/dist/cjs/{base-web-component-mmgXJMg0.js.map → base-web-component-GLk66TOu.js.map} +1 -1
- package/dist/cjs/{behavior-DWqrO2yi.js → behavior-BEaXHesG.js} +3 -3
- package/dist/cjs/{behavior-DWqrO2yi.js.map → behavior-BEaXHesG.js.map} +1 -1
- package/dist/cjs/{color-C9UZwMvC.js → color-CZiNkZFM.js} +3 -3
- package/dist/cjs/{color-C9UZwMvC.js.map → color-CZiNkZFM.js.map} +1 -1
- package/dist/cjs/{component-ZPvcKmPR.js → component-3EZdZbDH.js} +3 -3
- package/dist/cjs/{component-ZPvcKmPR.js.map → component-3EZdZbDH.js.map} +1 -1
- package/dist/cjs/{component-DuPEYx7z.js → component-B96XYPtn.js} +4 -4
- package/dist/cjs/{component-DuPEYx7z.js.map → component-B96XYPtn.js.map} +1 -1
- package/dist/cjs/{component-uHDfV5D8.js → component-BUCx7i5o.js} +7 -7
- package/dist/cjs/{component-uHDfV5D8.js.map → component-BUCx7i5o.js.map} +1 -1
- package/dist/cjs/{component-DNDfYzXZ.js → component-Bc8fDajy.js} +5 -5
- package/dist/cjs/{component-DNDfYzXZ.js.map → component-Bc8fDajy.js.map} +1 -1
- package/dist/cjs/{component-CmvG-auD.js → component-Be3QHUyC.js} +3 -3
- package/dist/cjs/{component-CmvG-auD.js.map → component-Be3QHUyC.js.map} +1 -1
- package/dist/cjs/{component-BT86Nj6R.js → component-Bj4QdlXm.js} +5 -5
- package/dist/cjs/{component-BT86Nj6R.js.map → component-Bj4QdlXm.js.map} +1 -1
- package/dist/cjs/{component-xIM903qi.js → component-CAkixzEQ.js} +3 -3
- package/dist/cjs/{component-xIM903qi.js.map → component-CAkixzEQ.js.map} +1 -1
- package/dist/cjs/{component-1NrcvQzp.js → component-CPVFCnaN.js} +7 -7
- package/dist/cjs/{component-1NrcvQzp.js.map → component-CPVFCnaN.js.map} +1 -1
- package/dist/cjs/{component-o3s7XplI.js → component-Dd-PS3jp.js} +4 -4
- package/dist/cjs/{component-o3s7XplI.js.map → component-Dd-PS3jp.js.map} +1 -1
- package/dist/cjs/{component-CtNPdMS0.js → component-DjDOgcWW.js} +5 -5
- package/dist/cjs/{component-CtNPdMS0.js.map → component-DjDOgcWW.js.map} +1 -1
- package/dist/cjs/{component-X_thXnkE.js → component-Du98sklA.js} +3 -3
- package/dist/cjs/{component-X_thXnkE.js.map → component-Du98sklA.js.map} +1 -1
- package/dist/cjs/{component-GfDUM7Um.js → component-Dw6Tq7Wb.js} +4 -4
- package/dist/cjs/{component-GfDUM7Um.js.map → component-Dw6Tq7Wb.js.map} +1 -1
- package/dist/cjs/{contrast-kLMuDQLl.js → contrast-CrL_sMV6.js} +3 -12
- package/dist/cjs/contrast-CrL_sMV6.js.map +1 -0
- package/dist/cjs/{dev.utils-BjrG4FNf.js → dev.utils-DybQ4euF.js} +3 -3
- package/dist/cjs/{dev.utils-BjrG4FNf.js.map → dev.utils-DybQ4euF.js.map} +1 -1
- package/dist/cjs/{devtools-D_afWgpU.js → devtools-Bw5sQJOl.js} +4 -4
- package/dist/cjs/{devtools-D_afWgpU.js.map → devtools-Bw5sQJOl.js.map} +1 -1
- package/dist/cjs/{field-control-DAHkvYr4.js → field-control-4CnbMR0i.js} +8 -8
- package/dist/cjs/{field-control-DAHkvYr4.js.map → field-control-4CnbMR0i.js.map} +1 -1
- package/dist/cjs/{group-DHYxVn2x.js → group-BCkxYeMA.js} +5 -5
- package/dist/cjs/{group-DHYxVn2x.js.map → group-BCkxYeMA.js.map} +1 -1
- package/dist/cjs/{index-BnEus4Y9.js → index-RAfZF5x0.js} +3 -3
- package/dist/cjs/{index-BnEus4Y9.js.map → index-RAfZF5x0.js.map} +1 -1
- package/dist/cjs/{input-eDaEE80n.js → input-7t7ZvgAy.js} +5 -5
- package/dist/cjs/{input-eDaEE80n.js.map → input-7t7ZvgAy.js.map} +1 -1
- package/dist/cjs/{input-container-Cye4qL9S.js → input-container-BUK2Fp_t.js} +7 -7
- package/dist/cjs/{input-container-Cye4qL9S.js.map → input-container-BUK2Fp_t.js.map} +1 -1
- package/dist/cjs/{item-Dflr47KV.js → item-BInO5rWQ.js} +8 -8
- package/dist/cjs/{item-Dflr47KV.js.map → item-BInO5rWQ.js.map} +1 -1
- package/dist/cjs/{item-BSdQbEav.js → item-D8Zz2ROC.js} +3 -3
- package/dist/cjs/{item-BSdQbEav.js.map → item-D8Zz2ROC.js.map} +1 -1
- package/dist/cjs/{item-C0yzJQUg.js → item-DO176juh.js} +4 -4
- package/dist/cjs/{item-C0yzJQUg.js.map → item-DO176juh.js.map} +1 -1
- package/dist/cjs/{item-wz0gBnmK.js → item-K1SS6pAu.js} +4 -4
- package/dist/cjs/{item-wz0gBnmK.js.map → item-K1SS6pAu.js.map} +1 -1
- package/dist/cjs/kol-abbr.cjs.entry.js +2 -2
- package/dist/cjs/kol-accordion.cjs.entry.js +7 -7
- package/dist/cjs/kol-alert.cjs.entry.js +11 -11
- package/dist/cjs/kol-avatar.cjs.entry.js +3 -3
- package/dist/cjs/kol-badge.cjs.entry.js +12 -12
- package/dist/cjs/kol-breadcrumb.cjs.entry.js +9 -9
- package/dist/cjs/kol-button-link.cjs.entry.js +10 -10
- package/dist/cjs/kol-button.cjs.entry.js +10 -10
- package/dist/cjs/kol-card.cjs.entry.js +11 -11
- package/dist/cjs/kol-click-button.cjs.entry.js +2 -2
- package/dist/cjs/kol-combobox.cjs.entry.js +18 -18
- package/dist/cjs/kol-details.cjs.entry.js +7 -7
- package/dist/cjs/kol-dialog.cjs.entry.js +13 -13
- package/dist/cjs/kol-drawer.cjs.entry.js +12 -12
- package/dist/cjs/kol-form.cjs.entry.js +12 -12
- package/dist/cjs/kol-heading.cjs.entry.js +1 -1
- package/dist/cjs/kol-icon.cjs.entry.js +3 -3
- package/dist/cjs/kol-image.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-checkbox.cjs.entry.js +17 -17
- package/dist/cjs/kol-input-color.cjs.entry.js +18 -18
- package/dist/cjs/kol-input-date.cjs.entry.js +18 -18
- package/dist/cjs/kol-input-email.cjs.entry.js +20 -20
- package/dist/cjs/kol-input-file.cjs.entry.js +17 -17
- package/dist/cjs/kol-input-number.cjs.entry.js +18 -18
- package/dist/cjs/kol-input-password.cjs.entry.js +22 -22
- package/dist/cjs/kol-input-password.entry.cjs.js.map +1 -1
- package/dist/cjs/kol-input-radio.cjs.entry.js +17 -17
- package/dist/cjs/kol-input-range.cjs.entry.js +18 -18
- package/dist/cjs/kol-input-text.cjs.entry.js +20 -20
- package/dist/cjs/kol-kolibri.cjs.entry.js +2 -2
- package/dist/cjs/kol-link-button.cjs.entry.js +10 -10
- package/dist/cjs/kol-link.cjs.entry.js +10 -10
- package/dist/cjs/kol-meter.cjs.entry.js +1 -1
- package/dist/cjs/kol-modal.cjs.entry.js +13 -13
- package/dist/cjs/kol-nav.cjs.entry.js +13 -13
- package/dist/cjs/kol-pagination.cjs.entry.js +18 -18
- package/dist/cjs/kol-popover-button.cjs.entry.js +12 -13
- package/dist/cjs/kol-popover-button.entry.cjs.js.map +1 -1
- package/dist/cjs/kol-progress.cjs.entry.js +1 -1
- package/dist/cjs/kol-quote.cjs.entry.js +1 -1
- package/dist/cjs/kol-select.cjs.entry.js +17 -17
- package/dist/cjs/kol-single-select.cjs.entry.js +18 -18
- package/dist/cjs/kol-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/kol-skip-nav.cjs.entry.js +9 -9
- package/dist/cjs/kol-spin.cjs.entry.js +3 -3
- package/dist/cjs/kol-split-button.cjs.entry.js +12 -12
- package/dist/cjs/kol-table-stateful.cjs.entry.js +25 -25
- package/dist/cjs/kol-table-stateless.cjs.entry.js +19 -19
- package/dist/cjs/kol-tabs.cjs.entry.js +9 -9
- package/dist/cjs/kol-textarea.cjs.entry.js +20 -20
- package/dist/cjs/kol-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/kol-toast-container.cjs.entry.js +11 -11
- package/dist/cjs/kol-toolbar.cjs.entry.js +33 -14
- package/dist/cjs/kol-toolbar.entry.cjs.js.map +1 -1
- package/dist/cjs/kol-tooltip-wc.cjs.entry.js +4 -4
- package/dist/cjs/kol-tree-item.cjs.entry.js +9 -9
- package/dist/cjs/kol-tree.cjs.entry.js +1 -1
- package/dist/cjs/kol-version.cjs.entry.js +10 -10
- package/dist/cjs/kolibri.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{resolve-props-DOU1VJNL.js → resolve-props-BBVQo_N5.js} +3 -3
- package/dist/cjs/{resolve-props-DOU1VJNL.js.map → resolve-props-BBVQo_N5.js.map} +1 -1
- package/dist/cjs/{scroll-lock-C6dUw4on.js → scroll-lock-zJbOf1Xr.js} +3 -3
- package/dist/cjs/{scroll-lock-C6dUw4on.js.map → scroll-lock-zJbOf1Xr.js.map} +1 -1
- package/dist/cjs/{suggestions-0hcm13gT.js → suggestions-quLXODgi.js} +4 -4
- package/dist/cjs/{suggestions-0hcm13gT.js.map → suggestions-quLXODgi.js.map} +1 -1
- package/dist/cjs/test-component.cjs.entry.js +1 -1
- package/dist/cjs/{toggle-handler-kOflG5om.js → toggle-handler-CENFGRWT.js} +5 -5
- package/dist/cjs/{toggle-handler-kOflG5om.js.map → toggle-handler-CENFGRWT.js.map} +1 -1
- package/dist/collection/components/accordion/style.css +2 -2
- package/dist/collection/components/alert/style.css +2 -2
- package/dist/collection/components/badge/style.css +2 -2
- package/dist/collection/components/breadcrumb/style.css +2 -2
- package/dist/collection/components/button/style.css +2 -2
- package/dist/collection/components/button-link/style.css +2 -2
- package/dist/collection/components/card/style.css +2 -2
- package/dist/collection/components/combobox/style.css +2 -2
- package/dist/collection/components/details/style.css +2 -2
- package/dist/collection/components/dialog/style.css +2 -2
- package/dist/collection/components/drawer/style.css +2 -2
- package/dist/collection/components/form/style.css +2 -2
- package/dist/collection/components/icon/style.css +2 -2
- package/dist/collection/components/input-checkbox/style.css +2 -2
- package/dist/collection/components/input-color/style.css +2 -2
- package/dist/collection/components/input-date/style.css +2 -2
- package/dist/collection/components/input-email/style.css +2 -2
- package/dist/collection/components/input-file/style.css +2 -2
- package/dist/collection/components/input-number/style.css +2 -2
- package/dist/collection/components/input-password/component.js +2 -2
- package/dist/collection/components/input-password/component.js.map +1 -1
- package/dist/collection/components/input-password/style.css +2 -2
- package/dist/collection/components/input-radio/style.css +2 -2
- package/dist/collection/components/input-range/style.css +2 -2
- package/dist/collection/components/input-text/style.css +2 -2
- package/dist/collection/components/link/style.css +2 -2
- package/dist/collection/components/link-button/style.css +2 -2
- package/dist/collection/components/modal/style.css +2 -2
- package/dist/collection/components/nav/style.css +2 -2
- package/dist/collection/components/pagination/style.css +2 -2
- package/dist/collection/components/popover-button/component.js +2 -4
- package/dist/collection/components/popover-button/component.js.map +1 -1
- package/dist/collection/components/popover-button/style.css +2 -2
- package/dist/collection/components/select/style.css +2 -2
- package/dist/collection/components/single-select/style.css +2 -2
- package/dist/collection/components/skip-nav/style.css +2 -2
- package/dist/collection/components/split-button/style.css +2 -2
- package/dist/collection/components/table-stateful/style.css +2 -2
- package/dist/collection/components/table-stateless/style.css +2 -2
- package/dist/collection/components/tabs/style.css +2 -2
- package/dist/collection/components/textarea/component.js +3 -3
- package/dist/collection/components/textarea/component.js.map +1 -1
- package/dist/collection/components/textarea/style.css +2 -2
- package/dist/collection/components/toaster/style.css +2 -2
- package/dist/collection/components/toolbar/component.js +1 -1
- package/dist/collection/components/toolbar/component.js.map +1 -1
- package/dist/collection/components/toolbar/style.css +9 -3
- package/dist/collection/components/tree-item/style.css +2 -2
- package/dist/collection/components/version/style.css +2 -2
- package/dist/collection/internal/functional-components/form-field/select-value.js +3 -1
- package/dist/collection/internal/functional-components/form-field/select-value.js.map +1 -1
- package/dist/collection/internal/functional-components/form-field/select.js +8 -3
- package/dist/collection/internal/functional-components/form-field/select.js.map +1 -1
- package/dist/collection/internal/functional-components/form-field/select.test.js +88 -0
- package/dist/collection/internal/functional-components/form-field/select.test.js.map +1 -1
- package/dist/collection/internal/functional-components/form-field/textarea.js.map +1 -1
- package/dist/collection/internal/functional-components/toolbar/api.js.map +1 -1
- package/dist/collection/internal/functional-components/toolbar/component.js +1 -1
- package/dist/collection/internal/functional-components/toolbar/component.js.map +1 -1
- package/dist/collection/internal/functional-components/toolbar/item.js +20 -1
- package/dist/collection/internal/functional-components/toolbar/item.js.map +1 -1
- package/dist/collection/schema/props/toolbar-items.js.map +1 -1
- package/dist/collection/schema/utils/contrast.js +2 -10
- package/dist/collection/schema/utils/contrast.js.map +1 -1
- package/dist/components/base-web-component4.js +11 -4
- package/dist/components/base-web-component4.js.map +1 -1
- package/dist/components/contrast.js +1 -10
- package/dist/components/contrast.js.map +1 -1
- package/dist/components/kol-accordion.js +1 -1
- package/dist/components/kol-alert.js +1 -1
- package/dist/components/kol-badge.js +1 -1
- package/dist/components/kol-breadcrumb.js +1 -1
- package/dist/components/kol-button-link.js +1 -1
- package/dist/components/kol-button.js +1 -1
- package/dist/components/kol-card.js +1 -1
- package/dist/components/kol-combobox.js +1 -1
- package/dist/components/kol-details.js +1 -1
- package/dist/components/kol-dialog.js +1 -1
- package/dist/components/kol-drawer.js +1 -1
- package/dist/components/kol-form.js +1 -1
- package/dist/components/kol-icon.js +1 -1
- package/dist/components/kol-input-checkbox.js +1 -1
- package/dist/components/kol-input-color.js +1 -1
- package/dist/components/kol-input-date.js +1 -1
- package/dist/components/kol-input-email.js +1 -1
- package/dist/components/kol-input-file.js +1 -1
- package/dist/components/kol-input-number.js +1 -1
- package/dist/components/kol-input-password.js +3 -3
- package/dist/components/kol-input-password.js.map +1 -1
- package/dist/components/kol-input-radio.js +1 -1
- package/dist/components/kol-input-range.js +1 -1
- package/dist/components/kol-input-text.js +1 -1
- package/dist/components/kol-link-button.js +1 -1
- package/dist/components/kol-link.js +1 -1
- package/dist/components/kol-modal.js +1 -1
- package/dist/components/kol-nav.js +1 -1
- package/dist/components/kol-pagination.js +1 -1
- package/dist/components/kol-popover-button.js +2 -3
- package/dist/components/kol-popover-button.js.map +1 -1
- package/dist/components/kol-select.js +1 -1
- package/dist/components/kol-single-select.js +1 -1
- package/dist/components/kol-skip-nav.js +1 -1
- package/dist/components/kol-split-button.js +1 -1
- package/dist/components/kol-table-stateful.js +1 -1
- package/dist/components/kol-table-stateless.js +1 -1
- package/dist/components/kol-tabs.js +1 -1
- package/dist/components/kol-textarea.js +4 -4
- package/dist/components/kol-textarea.js.map +1 -1
- package/dist/components/kol-toast-container.js +1 -1
- package/dist/components/kol-toolbar.js +23 -4
- package/dist/components/kol-toolbar.js.map +1 -1
- package/dist/components/kol-tree-item.js +1 -1
- package/dist/components/kol-version.js +1 -1
- package/dist/esm/{Heading-DXl16qig.js → Heading-BctDgC7M.js} +3 -3
- package/dist/esm/{Heading-DXl16qig.js.map → Heading-BctDgC7M.js.map} +1 -1
- package/dist/esm/{api-C8TfIYlY.js → api-B6fEjFVl.js} +12 -12
- package/dist/{kolibri/api-C8TfIYlY.js.map → esm/api-B6fEjFVl.js.map} +1 -1
- package/dist/esm/{api-BA-AFr5H.js → api-T-JuZMlj.js} +8 -8
- package/dist/esm/{api-BA-AFr5H.js.map → api-T-JuZMlj.js.map} +1 -1
- package/dist/esm/{app-globals-lFdBwFG2.js → app-globals-CvvWI2x9.js} +4 -4
- package/dist/esm/{app-globals-lFdBwFG2.js.map → app-globals-CvvWI2x9.js.map} +1 -1
- package/dist/esm/{base-DiSQvfGU.js → base-BARjFMg1.js} +5 -5
- package/dist/esm/{base-DiSQvfGU.js.map → base-BARjFMg1.js.map} +1 -1
- package/dist/esm/{base-D8GcFhvD.js → base-BbVXW6YI.js} +4 -4
- package/dist/{kolibri/base-D8GcFhvD.js.map → esm/base-BbVXW6YI.js.map} +1 -1
- package/dist/esm/{base-B5F8ROuQ.js → base-D8yYjJsn.js} +4 -4
- package/dist/esm/{base-B5F8ROuQ.js.map → base-D8yYjJsn.js.map} +1 -1
- package/dist/esm/{base-BpqjfzG1.js → base-Dvr4F_Pr.js} +16 -16
- package/dist/{kolibri/base-BpqjfzG1.js.map → esm/base-Dvr4F_Pr.js.map} +1 -1
- package/dist/esm/{base-web-component-CkaKv7O0.js → base-web-component-BzB5tP9s.js} +16 -9
- package/dist/esm/base-web-component-BzB5tP9s.js.map +1 -0
- package/dist/esm/{base-web-component-BozlJoj7.js → base-web-component-DU3hnIWD.js} +7 -7
- package/dist/esm/{base-web-component-BozlJoj7.js.map → base-web-component-DU3hnIWD.js.map} +1 -1
- package/dist/esm/{behavior-BuNqmjz8.js → behavior-CbqCHL6O.js} +3 -3
- package/dist/esm/{behavior-BuNqmjz8.js.map → behavior-CbqCHL6O.js.map} +1 -1
- package/dist/esm/{color-Du3Ft0XV.js → color-QYuhlVFz.js} +3 -3
- package/dist/esm/{color-Du3Ft0XV.js.map → color-QYuhlVFz.js.map} +1 -1
- package/dist/esm/{component-Da5dJMKj.js → component-BaD1OTyv.js} +5 -5
- package/dist/{kolibri/component-Da5dJMKj.js.map → esm/component-BaD1OTyv.js.map} +1 -1
- package/dist/esm/{component-DD5QqT5m.js → component-BjWF1SyZ.js} +7 -7
- package/dist/esm/{component-DD5QqT5m.js.map → component-BjWF1SyZ.js.map} +1 -1
- package/dist/esm/{component-Bd7PXqOG.js → component-Ch6fss2f.js} +5 -5
- package/dist/esm/{component-Bd7PXqOG.js.map → component-Ch6fss2f.js.map} +1 -1
- package/dist/esm/{component-C3aqLFK2.js → component-CmBM-Y1C.js} +7 -7
- package/dist/esm/{component-C3aqLFK2.js.map → component-CmBM-Y1C.js.map} +1 -1
- package/dist/esm/{component-xrrwVuiI.js → component-CvhmYY4a.js} +4 -4
- package/dist/esm/{component-xrrwVuiI.js.map → component-CvhmYY4a.js.map} +1 -1
- package/dist/esm/{component-De6Do_gt.js → component-D0iTurA_.js} +3 -3
- package/dist/esm/{component-De6Do_gt.js.map → component-D0iTurA_.js.map} +1 -1
- package/dist/esm/{component-BjH8s4-t.js → component-DKS73hKY.js} +3 -3
- package/dist/{kolibri/component-BjH8s4-t.js.map → esm/component-DKS73hKY.js.map} +1 -1
- package/dist/esm/{component-BxKN0JbT.js → component-DhBTawyT.js} +3 -3
- package/dist/esm/{component-BxKN0JbT.js.map → component-DhBTawyT.js.map} +1 -1
- package/dist/esm/{component-CWGVLsSH.js → component-G9vQ1mQA.js} +4 -4
- package/dist/{kolibri/component-CWGVLsSH.js.map → esm/component-G9vQ1mQA.js.map} +1 -1
- package/dist/esm/{component-D_58mw87.js → component-QCFfSS76.js} +4 -4
- package/dist/{kolibri/component-D_58mw87.js.map → esm/component-QCFfSS76.js.map} +1 -1
- package/dist/esm/{component-BKOep2WQ.js → component-d1d-AIsY.js} +5 -5
- package/dist/{kolibri/component-BKOep2WQ.js.map → esm/component-d1d-AIsY.js.map} +1 -1
- package/dist/esm/{component-C9DexidK.js → component-sf_0WjJF.js} +3 -3
- package/dist/esm/{component-C9DexidK.js.map → component-sf_0WjJF.js.map} +1 -1
- package/dist/esm/{contrast-BKAJJL2K.js → contrast-DMN9saXP.js} +3 -12
- package/dist/esm/contrast-DMN9saXP.js.map +1 -0
- package/dist/esm/{dev.utils-CYtV9X0K.js → dev.utils-BGy8dbtQ.js} +3 -3
- package/dist/esm/{dev.utils-CYtV9X0K.js.map → dev.utils-BGy8dbtQ.js.map} +1 -1
- package/dist/esm/{devtools-B0qRaQdp.js → devtools-CZ8Mnmwl.js} +4 -4
- package/dist/{kolibri/devtools-B0qRaQdp.js.map → esm/devtools-CZ8Mnmwl.js.map} +1 -1
- package/dist/esm/{field-control-C5hjw2Rb.js → field-control-CLnFuMmy.js} +8 -8
- package/dist/{kolibri/field-control-C5hjw2Rb.js.map → esm/field-control-CLnFuMmy.js.map} +1 -1
- package/dist/esm/{group-2hP8qbvk.js → group-BAOmF5Ok.js} +5 -5
- package/dist/esm/{group-2hP8qbvk.js.map → group-BAOmF5Ok.js.map} +1 -1
- package/dist/esm/{index-DsCeQ9Ys.js → index-DAKQV03B.js} +3 -3
- package/dist/{kolibri/index-DsCeQ9Ys.js.map → esm/index-DAKQV03B.js.map} +1 -1
- package/dist/esm/{input-Dp5NBocQ.js → input-D2i1QEbL.js} +5 -5
- package/dist/esm/{input-Dp5NBocQ.js.map → input-D2i1QEbL.js.map} +1 -1
- package/dist/esm/{input-container-QA8-0_0p.js → input-container-wQm8-W3s.js} +7 -7
- package/dist/esm/{input-container-QA8-0_0p.js.map → input-container-wQm8-W3s.js.map} +1 -1
- package/dist/esm/{item-BIjqEkyy.js → item-DJ8LXOMv.js} +8 -8
- package/dist/{kolibri/item-BIjqEkyy.js.map → esm/item-DJ8LXOMv.js.map} +1 -1
- package/dist/esm/{item-CXyolUj2.js → item-DbLIGnc9.js} +4 -4
- package/dist/{kolibri/item-CXyolUj2.js.map → esm/item-DbLIGnc9.js.map} +1 -1
- package/dist/esm/{item-CaxJw3ad.js → item-Dkm57tce.js} +4 -4
- package/dist/esm/{item-CaxJw3ad.js.map → item-Dkm57tce.js.map} +1 -1
- package/dist/esm/{item-DY0fVVnj.js → item-DuBSR8BS.js} +3 -3
- package/dist/esm/{item-DY0fVVnj.js.map → item-DuBSR8BS.js.map} +1 -1
- package/dist/esm/kol-abbr.entry.js +2 -2
- package/dist/esm/kol-accordion.entry.js +7 -7
- package/dist/esm/kol-alert.entry.js +11 -11
- package/dist/esm/kol-avatar.entry.js +3 -3
- package/dist/esm/kol-badge.entry.js +12 -12
- package/dist/esm/kol-breadcrumb.entry.js +9 -9
- package/dist/esm/kol-button-link.entry.js +10 -10
- package/dist/esm/kol-button.entry.js +10 -10
- package/dist/esm/kol-card.entry.js +11 -11
- package/dist/esm/kol-click-button.entry.js +2 -2
- package/dist/esm/kol-combobox.entry.js +18 -18
- package/dist/esm/kol-details.entry.js +7 -7
- package/dist/esm/kol-dialog.entry.js +13 -13
- package/dist/esm/kol-drawer.entry.js +12 -12
- package/dist/esm/kol-form.entry.js +12 -12
- package/dist/esm/kol-heading.entry.js +1 -1
- package/dist/esm/kol-icon.entry.js +3 -3
- package/dist/esm/kol-image.entry.js +1 -1
- package/dist/esm/kol-input-checkbox.entry.js +17 -17
- package/dist/esm/kol-input-color.entry.js +18 -18
- package/dist/esm/kol-input-date.entry.js +18 -18
- package/dist/esm/kol-input-email.entry.js +20 -20
- package/dist/esm/kol-input-file.entry.js +17 -17
- package/dist/esm/kol-input-number.entry.js +18 -18
- package/dist/esm/kol-input-password.entry.js +22 -22
- package/dist/esm/kol-input-password.entry.js.map +1 -1
- package/dist/esm/kol-input-radio.entry.js +17 -17
- package/dist/esm/kol-input-range.entry.js +18 -18
- package/dist/esm/kol-input-text.entry.js +20 -20
- package/dist/esm/kol-kolibri.entry.js +2 -2
- package/dist/esm/kol-link-button.entry.js +10 -10
- package/dist/esm/kol-link.entry.js +10 -10
- package/dist/esm/kol-meter.entry.js +1 -1
- package/dist/esm/kol-modal.entry.js +13 -13
- package/dist/esm/kol-nav.entry.js +13 -13
- package/dist/esm/kol-pagination.entry.js +18 -18
- package/dist/esm/kol-popover-button.entry.js +12 -13
- package/dist/esm/kol-popover-button.entry.js.map +1 -1
- package/dist/esm/kol-progress.entry.js +1 -1
- package/dist/esm/kol-quote.entry.js +1 -1
- package/dist/esm/kol-select.entry.js +17 -17
- package/dist/esm/kol-single-select.entry.js +18 -18
- package/dist/esm/kol-skeleton.entry.js +2 -2
- package/dist/esm/kol-skip-nav.entry.js +9 -9
- package/dist/esm/kol-spin.entry.js +3 -3
- package/dist/esm/kol-split-button.entry.js +12 -12
- package/dist/esm/kol-table-stateful.entry.js +25 -25
- package/dist/esm/kol-table-stateless.entry.js +19 -19
- package/dist/esm/kol-tabs.entry.js +9 -9
- package/dist/esm/kol-textarea.entry.js +20 -20
- package/dist/esm/kol-textarea.entry.js.map +1 -1
- package/dist/esm/kol-toast-container.entry.js +11 -11
- package/dist/esm/kol-toolbar.entry.js +33 -14
- package/dist/esm/kol-toolbar.entry.js.map +1 -1
- package/dist/esm/kol-tooltip-wc.entry.js +4 -4
- package/dist/esm/kol-tree-item.entry.js +9 -9
- package/dist/esm/kol-tree.entry.js +1 -1
- package/dist/esm/kol-version.entry.js +10 -10
- package/dist/esm/kolibri.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{resolve-props-DJxTzf-G.js → resolve-props-BTiKxg-8.js} +3 -3
- package/dist/{kolibri/resolve-props-DJxTzf-G.js.map → esm/resolve-props-BTiKxg-8.js.map} +1 -1
- package/dist/esm/{scroll-lock-BN6ZnBdc.js → scroll-lock-DRNyw9qH.js} +3 -3
- package/dist/{kolibri/scroll-lock-BN6ZnBdc.js.map → esm/scroll-lock-DRNyw9qH.js.map} +1 -1
- package/dist/esm/{suggestions-DlpHvEGv.js → suggestions-CG-TuGC4.js} +4 -4
- package/dist/esm/{suggestions-DlpHvEGv.js.map → suggestions-CG-TuGC4.js.map} +1 -1
- package/dist/esm/test-component.entry.js +1 -1
- package/dist/esm/{toggle-handler-Xex3lIll.js → toggle-handler-aTxO0Wem.js} +5 -5
- package/dist/{kolibri/toggle-handler-Xex3lIll.js.map → esm/toggle-handler-aTxO0Wem.js.map} +1 -1
- package/dist/kolibri/{Heading-DXl16qig.js → Heading-BctDgC7M.js} +2 -2
- package/dist/kolibri/{Heading-DXl16qig.js.map → Heading-BctDgC7M.js.map} +1 -1
- package/dist/kolibri/api-B6fEjFVl.js +5 -0
- package/dist/{esm/api-C8TfIYlY.js.map → kolibri/api-B6fEjFVl.js.map} +1 -1
- package/dist/kolibri/api-T-JuZMlj.js +5 -0
- package/dist/kolibri/{api-BA-AFr5H.js.map → api-T-JuZMlj.js.map} +1 -1
- package/dist/kolibri/app-globals-CvvWI2x9.js +5 -0
- package/dist/kolibri/{app-globals-lFdBwFG2.js.map → app-globals-CvvWI2x9.js.map} +1 -1
- package/dist/kolibri/base-BARjFMg1.js +5 -0
- package/dist/kolibri/{base-DiSQvfGU.js.map → base-BARjFMg1.js.map} +1 -1
- package/dist/kolibri/{base-D8GcFhvD.js → base-BbVXW6YI.js} +2 -2
- package/dist/{esm/base-D8GcFhvD.js.map → kolibri/base-BbVXW6YI.js.map} +1 -1
- package/dist/kolibri/{base-B5F8ROuQ.js → base-D8yYjJsn.js} +2 -2
- package/dist/kolibri/{base-B5F8ROuQ.js.map → base-D8yYjJsn.js.map} +1 -1
- package/dist/kolibri/base-Dvr4F_Pr.js +5 -0
- package/dist/{esm/base-BpqjfzG1.js.map → kolibri/base-Dvr4F_Pr.js.map} +1 -1
- package/dist/kolibri/base-web-component-BzB5tP9s.js +5 -0
- package/dist/kolibri/base-web-component-BzB5tP9s.js.map +1 -0
- package/dist/kolibri/{base-web-component-BozlJoj7.js → base-web-component-DU3hnIWD.js} +2 -2
- package/dist/kolibri/{base-web-component-BozlJoj7.js.map → base-web-component-DU3hnIWD.js.map} +1 -1
- package/dist/kolibri/{behavior-BuNqmjz8.js → behavior-CbqCHL6O.js} +2 -2
- package/dist/kolibri/{behavior-BuNqmjz8.js.map → behavior-CbqCHL6O.js.map} +1 -1
- package/dist/kolibri/{color-Du3Ft0XV.js → color-QYuhlVFz.js} +2 -2
- package/dist/kolibri/{color-Du3Ft0XV.js.map → color-QYuhlVFz.js.map} +1 -1
- package/dist/kolibri/component-BaD1OTyv.js +5 -0
- package/dist/{esm/component-Da5dJMKj.js.map → kolibri/component-BaD1OTyv.js.map} +1 -1
- package/dist/kolibri/{component-DD5QqT5m.js → component-BjWF1SyZ.js} +2 -2
- package/dist/kolibri/{component-DD5QqT5m.js.map → component-BjWF1SyZ.js.map} +1 -1
- package/dist/kolibri/{component-Bd7PXqOG.js → component-Ch6fss2f.js} +2 -2
- package/dist/kolibri/{component-Bd7PXqOG.js.map → component-Ch6fss2f.js.map} +1 -1
- package/dist/kolibri/component-CmBM-Y1C.js +5 -0
- package/dist/kolibri/{component-C3aqLFK2.js.map → component-CmBM-Y1C.js.map} +1 -1
- package/dist/kolibri/component-CvhmYY4a.js +5 -0
- package/dist/kolibri/{component-xrrwVuiI.js.map → component-CvhmYY4a.js.map} +1 -1
- package/dist/kolibri/component-D0iTurA_.js +5 -0
- package/dist/kolibri/{component-De6Do_gt.js.map → component-D0iTurA_.js.map} +1 -1
- package/dist/kolibri/{component-BjH8s4-t.js → component-DKS73hKY.js} +2 -2
- package/dist/{esm/component-BjH8s4-t.js.map → kolibri/component-DKS73hKY.js.map} +1 -1
- package/dist/kolibri/component-DhBTawyT.js +5 -0
- package/dist/kolibri/{component-BxKN0JbT.js.map → component-DhBTawyT.js.map} +1 -1
- package/dist/kolibri/{component-CWGVLsSH.js → component-G9vQ1mQA.js} +2 -2
- package/dist/{esm/component-CWGVLsSH.js.map → kolibri/component-G9vQ1mQA.js.map} +1 -1
- package/dist/kolibri/{component-D_58mw87.js → component-QCFfSS76.js} +2 -2
- package/dist/{esm/component-D_58mw87.js.map → kolibri/component-QCFfSS76.js.map} +1 -1
- package/dist/kolibri/{component-BKOep2WQ.js → component-d1d-AIsY.js} +2 -2
- package/dist/{esm/component-BKOep2WQ.js.map → kolibri/component-d1d-AIsY.js.map} +1 -1
- package/dist/kolibri/{component-C9DexidK.js → component-sf_0WjJF.js} +2 -2
- package/dist/kolibri/{component-C9DexidK.js.map → component-sf_0WjJF.js.map} +1 -1
- package/dist/kolibri/contrast-DMN9saXP.js +5 -0
- package/dist/kolibri/contrast-DMN9saXP.js.map +1 -0
- package/dist/kolibri/{dev.utils-CYtV9X0K.js → dev.utils-BGy8dbtQ.js} +2 -2
- package/dist/kolibri/{dev.utils-CYtV9X0K.js.map → dev.utils-BGy8dbtQ.js.map} +1 -1
- package/dist/kolibri/devtools-CZ8Mnmwl.js +5 -0
- package/dist/{esm/devtools-B0qRaQdp.js.map → kolibri/devtools-CZ8Mnmwl.js.map} +1 -1
- package/dist/kolibri/field-control-CLnFuMmy.js +5 -0
- package/dist/{esm/field-control-C5hjw2Rb.js.map → kolibri/field-control-CLnFuMmy.js.map} +1 -1
- package/dist/kolibri/{group-2hP8qbvk.js → group-BAOmF5Ok.js} +2 -2
- package/dist/kolibri/{group-2hP8qbvk.js.map → group-BAOmF5Ok.js.map} +1 -1
- package/dist/kolibri/{index-DsCeQ9Ys.js → index-DAKQV03B.js} +2 -2
- package/dist/{esm/index-DsCeQ9Ys.js.map → kolibri/index-DAKQV03B.js.map} +1 -1
- package/dist/kolibri/input-D2i1QEbL.js +5 -0
- package/dist/kolibri/{input-Dp5NBocQ.js.map → input-D2i1QEbL.js.map} +1 -1
- package/dist/kolibri/{input-container-QA8-0_0p.js → input-container-wQm8-W3s.js} +2 -2
- package/dist/kolibri/{input-container-QA8-0_0p.js.map → input-container-wQm8-W3s.js.map} +1 -1
- package/dist/kolibri/{item-BIjqEkyy.js → item-DJ8LXOMv.js} +2 -2
- package/dist/{esm/item-BIjqEkyy.js.map → kolibri/item-DJ8LXOMv.js.map} +1 -1
- package/dist/kolibri/item-DbLIGnc9.js +5 -0
- package/dist/{esm/item-CXyolUj2.js.map → kolibri/item-DbLIGnc9.js.map} +1 -1
- package/dist/kolibri/{item-CaxJw3ad.js → item-Dkm57tce.js} +2 -2
- package/dist/kolibri/{item-CaxJw3ad.js.map → item-Dkm57tce.js.map} +1 -1
- package/dist/kolibri/{item-DY0fVVnj.js → item-DuBSR8BS.js} +2 -2
- package/dist/kolibri/{item-DY0fVVnj.js.map → item-DuBSR8BS.js.map} +1 -1
- package/dist/kolibri/kol-abbr.entry.js +1 -1
- package/dist/kolibri/kol-accordion.entry.js +1 -1
- package/dist/kolibri/kol-alert.entry.js +1 -1
- package/dist/kolibri/kol-avatar.entry.js +1 -1
- package/dist/kolibri/kol-badge.entry.js +1 -1
- package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
- package/dist/kolibri/kol-button-link.entry.js +1 -1
- package/dist/kolibri/kol-button.entry.js +1 -1
- package/dist/kolibri/kol-card.entry.js +1 -1
- package/dist/kolibri/kol-click-button.entry.js +1 -1
- package/dist/kolibri/kol-combobox.entry.js +1 -1
- package/dist/kolibri/kol-combobox.entry.js.map +1 -1
- package/dist/kolibri/kol-details.entry.js +1 -1
- package/dist/kolibri/kol-dialog.entry.js +1 -1
- package/dist/kolibri/kol-drawer.entry.js +1 -1
- package/dist/kolibri/kol-form.entry.js +1 -1
- package/dist/kolibri/kol-heading.entry.js +1 -1
- package/dist/kolibri/kol-icon.entry.js +1 -1
- package/dist/kolibri/kol-image.entry.js +1 -1
- package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
- package/dist/kolibri/kol-input-color.entry.js +1 -1
- package/dist/kolibri/kol-input-date.entry.js +1 -1
- package/dist/kolibri/kol-input-email.entry.js +1 -1
- package/dist/kolibri/kol-input-file.entry.js +1 -1
- package/dist/kolibri/kol-input-number.entry.js +1 -1
- package/dist/kolibri/kol-input-password.entry.esm.js.map +1 -1
- package/dist/kolibri/kol-input-password.entry.js +1 -1
- package/dist/kolibri/kol-input-password.entry.js.map +1 -1
- package/dist/kolibri/kol-input-radio.entry.js +1 -1
- package/dist/kolibri/kol-input-range.entry.js +1 -1
- package/dist/kolibri/kol-input-text.entry.js +1 -1
- package/dist/kolibri/kol-kolibri.entry.js +1 -1
- package/dist/kolibri/kol-link-button.entry.js +1 -1
- package/dist/kolibri/kol-link.entry.js +1 -1
- package/dist/kolibri/kol-meter.entry.js +1 -1
- package/dist/kolibri/kol-modal.entry.js +1 -1
- package/dist/kolibri/kol-nav.entry.js +1 -1
- package/dist/kolibri/kol-pagination.entry.js +1 -1
- package/dist/kolibri/kol-popover-button.entry.esm.js.map +1 -1
- package/dist/kolibri/kol-popover-button.entry.js +1 -1
- package/dist/kolibri/kol-popover-button.entry.js.map +1 -1
- package/dist/kolibri/kol-progress.entry.js +1 -1
- package/dist/kolibri/kol-quote.entry.js +1 -1
- package/dist/kolibri/kol-select.entry.js +1 -1
- package/dist/kolibri/kol-single-select.entry.js +1 -1
- package/dist/kolibri/kol-skeleton.entry.js +1 -1
- package/dist/kolibri/kol-skip-nav.entry.js +1 -1
- package/dist/kolibri/kol-spin.entry.js +1 -1
- package/dist/kolibri/kol-split-button.entry.js +1 -1
- package/dist/kolibri/kol-table-stateful.entry.js +1 -1
- package/dist/kolibri/kol-table-stateless.entry.js +1 -1
- package/dist/kolibri/kol-tabs.entry.js +1 -1
- package/dist/kolibri/kol-textarea.entry.esm.js.map +1 -1
- package/dist/kolibri/kol-textarea.entry.js +1 -1
- package/dist/kolibri/kol-textarea.entry.js.map +1 -1
- package/dist/kolibri/kol-toast-container.entry.js +1 -1
- package/dist/kolibri/kol-toolbar.entry.esm.js.map +1 -1
- package/dist/kolibri/kol-toolbar.entry.js +1 -1
- package/dist/kolibri/kol-toolbar.entry.js.map +1 -1
- package/dist/kolibri/kol-tooltip-wc.entry.js +1 -1
- package/dist/kolibri/kol-tree-item.entry.js +1 -1
- package/dist/kolibri/kol-tree.entry.js +1 -1
- package/dist/kolibri/kol-version.entry.js +1 -1
- package/dist/kolibri/kol-version.entry.js.map +1 -1
- package/dist/kolibri/kolibri.esm.js +1 -1
- package/dist/kolibri/resolve-props-BTiKxg-8.js +5 -0
- package/dist/{esm/resolve-props-DJxTzf-G.js.map → kolibri/resolve-props-BTiKxg-8.js.map} +1 -1
- package/dist/kolibri/{scroll-lock-BN6ZnBdc.js → scroll-lock-DRNyw9qH.js} +2 -2
- package/dist/{esm/scroll-lock-BN6ZnBdc.js.map → kolibri/scroll-lock-DRNyw9qH.js.map} +1 -1
- package/dist/kolibri/suggestions-CG-TuGC4.js +5 -0
- package/dist/kolibri/{suggestions-DlpHvEGv.js.map → suggestions-CG-TuGC4.js.map} +1 -1
- package/dist/kolibri/test-component.entry.js +1 -1
- package/dist/kolibri/toggle-handler-aTxO0Wem.js +5 -0
- package/dist/{esm/toggle-handler-Xex3lIll.js.map → kolibri/toggle-handler-aTxO0Wem.js.map} +1 -1
- package/dist/types/components/toolbar/component.d.ts +2 -2
- package/dist/types/components.d.ts +0 -2
- package/dist/types/internal/functional-components/form-field/textarea.d.ts +1 -0
- package/dist/types/internal/functional-components/toolbar/api.d.ts +2 -2
- package/dist/types/internal/functional-components/toolbar/item.d.ts +5 -2
- package/dist/types/schema/props/toolbar-items.d.ts +3 -1
- package/doc/popover-button.md +1 -1
- package/package.json +1 -1
- package/dist/cjs/base-web-component-C8MLLGxi.js.map +0 -1
- package/dist/cjs/contrast-kLMuDQLl.js.map +0 -1
- package/dist/esm/base-web-component-CkaKv7O0.js.map +0 -1
- package/dist/esm/contrast-BKAJJL2K.js.map +0 -1
- package/dist/kolibri/api-BA-AFr5H.js +0 -5
- package/dist/kolibri/api-C8TfIYlY.js +0 -5
- package/dist/kolibri/app-globals-lFdBwFG2.js +0 -5
- package/dist/kolibri/base-BpqjfzG1.js +0 -5
- package/dist/kolibri/base-DiSQvfGU.js +0 -5
- package/dist/kolibri/base-web-component-CkaKv7O0.js +0 -5
- package/dist/kolibri/base-web-component-CkaKv7O0.js.map +0 -1
- package/dist/kolibri/component-BxKN0JbT.js +0 -5
- package/dist/kolibri/component-C3aqLFK2.js +0 -5
- package/dist/kolibri/component-Da5dJMKj.js +0 -5
- package/dist/kolibri/component-De6Do_gt.js +0 -5
- package/dist/kolibri/component-xrrwVuiI.js +0 -5
- package/dist/kolibri/contrast-BKAJJL2K.js +0 -5
- package/dist/kolibri/contrast-BKAJJL2K.js.map +0 -1
- package/dist/kolibri/devtools-B0qRaQdp.js +0 -5
- package/dist/kolibri/field-control-C5hjw2Rb.js +0 -5
- package/dist/kolibri/input-Dp5NBocQ.js +0 -5
- package/dist/kolibri/item-CXyolUj2.js +0 -5
- package/dist/kolibri/resolve-props-DJxTzf-G.js +0 -5
- package/dist/kolibri/suggestions-DlpHvEGv.js +0 -5
- package/dist/kolibri/toggle-handler-Xex3lIll.js +0 -5
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
var common = require('./common-B9-LvLNa.js');
|
|
7
7
|
var variant = require('./variant-wdbSxe--.js');
|
|
8
|
-
var inputContainer = require('./input-container-
|
|
8
|
+
var inputContainer = require('./input-container-BUK2Fp_t.js');
|
|
9
9
|
var baseWebComponent = require('./base-web-component-DK5Y-vq5.js');
|
|
10
10
|
var multiple = require('./multiple-Do6O5sIE.js');
|
|
11
11
|
var required = require('./required-ZyS6KTUB.js');
|
|
12
12
|
var rows = require('./rows-CTtKDSvD.js');
|
|
13
|
-
var api = require('./api-
|
|
14
|
-
var index = require('./index-
|
|
13
|
+
var api = require('./api-BI1qXrGa.js');
|
|
14
|
+
var index = require('./index-RAfZF5x0.js');
|
|
15
15
|
var accessAndShortKey = require('./access-and-short-key-D40HWCJe.js');
|
|
16
16
|
var clsx = require('./clsx-Bm_HQUnh.js');
|
|
17
17
|
var label = require('./label-DVnpZWVb.js');
|
|
@@ -81,13 +81,18 @@ const SelectOptionListFC = ({ preKey, options, disabled, value: selectedValue, O
|
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
83
|
return (index.h(index.Fragment, null, options.map((option, index$1) => {
|
|
84
|
+
var _a;
|
|
84
85
|
const key = [preKey, `-${index$1}`].join('');
|
|
85
86
|
if ('options' in option) {
|
|
87
|
+
if (!((_a = option.options) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const isOptgroupDisabled = Boolean(disabled || option.disabled);
|
|
86
91
|
const { label } = option, other = tslib_es6.__rest(option, ["label"]);
|
|
87
|
-
return (index.h("optgroup", Object.assign({ class: selectBem('optgroup', { disabled:
|
|
92
|
+
return (index.h("optgroup", Object.assign({ class: selectBem('optgroup', { disabled: isOptgroupDisabled }), key: key }, OptionGroupProps, { label: label === null || label === void 0 ? void 0 : label.toString(), disabled: isOptgroupDisabled }), index.h(SelectOptionListFC, Object.assign({ OptionGroupProps: OptionGroupProps, OptionProps: OptionProps, value: selectedValue, preKey: key }, other, { disabled: isOptgroupDisabled }))));
|
|
88
93
|
}
|
|
89
94
|
if ('value' in option) {
|
|
90
|
-
return index.h(SelectOptionFC, Object.assign({ key: key }, OptionProps, { index: key, selectedValue: selectedValue }, option));
|
|
95
|
+
return (index.h(SelectOptionFC, Object.assign({ key: key }, OptionProps, { index: key, selectedValue: selectedValue }, option, { disabled: Boolean(disabled || option.disabled) })));
|
|
91
96
|
}
|
|
92
97
|
return null;
|
|
93
98
|
})));
|
|
@@ -95,7 +100,7 @@ const SelectOptionListFC = ({ preKey, options, disabled, value: selectedValue, O
|
|
|
95
100
|
const SelectFC = (props) => {
|
|
96
101
|
const { class: classNames, msg, touched, disabled, required, options, value, OptionProps, OptionGroupProps, ariaDescribedBy, hideLabel, label } = props, other = tslib_es6.__rest(props, ["class", "msg", "touched", "disabled", "required", "options", "value", "OptionProps", "OptionGroupProps", "ariaDescribedBy", "hideLabel", "label"]);
|
|
97
102
|
const selectProps = Object.assign(Object.assign({ class: clsx.clsx(selectBem(Object.assign({ disabled: Boolean(disabled), required: Boolean(required), touched: Boolean(touched) }, (api.isMsgDefinedAndInputTouched(msg, touched) ? { [api.getMsgType(msg)]: true } : {}))), classNames), required: required, disabled: disabled }, api.getDefaultInputProps({ ariaDescribedBy, hideLabel, label })), other);
|
|
98
|
-
return (index.h("select", Object.assign({}, selectProps), index.h(SelectOptionListFC, {
|
|
103
|
+
return (index.h("select", Object.assign({}, selectProps), index.h(SelectOptionListFC, { OptionGroupProps: OptionGroupProps, OptionProps: OptionProps, disabled: disabled, options: options, value: value })));
|
|
99
104
|
};
|
|
100
105
|
|
|
101
106
|
const assertSelectValueMatchesMultiplicity = (value, multiple, source) => {
|
|
@@ -109,7 +114,9 @@ const assertSelectValueMatchesMultiplicity = (value, multiple, source) => {
|
|
|
109
114
|
throw new Error(`↑ The schema for the property (_value) is not valid for single mode. Expected a single value. The value will not be changed. (${source} = ${JSON.stringify(value)})`);
|
|
110
115
|
}
|
|
111
116
|
};
|
|
112
|
-
const flattenSelectOptions = (options) => options.flatMap((entry) =>
|
|
117
|
+
const flattenSelectOptions = (options, groupDisabled = false) => options.flatMap((entry) => 'options' in entry && Array.isArray(entry.options)
|
|
118
|
+
? flattenSelectOptions(entry.options, Boolean(groupDisabled || entry.disabled))
|
|
119
|
+
: [Object.assign(Object.assign({}, entry), { disabled: Boolean(groupDisabled || entry.disabled) })]);
|
|
113
120
|
const normalizeSelectValue = (value, options, multiple) => {
|
|
114
121
|
if (options.length === 0) {
|
|
115
122
|
return value;
|
|
@@ -232,6 +239,6 @@ class BaseSelectWebComponent extends api.BaseFormFieldWebComponent {
|
|
|
232
239
|
|
|
233
240
|
exports.BaseSelectWebComponent = BaseSelectWebComponent;
|
|
234
241
|
exports.selectPropsConfig = selectPropsConfig;
|
|
235
|
-
//# sourceMappingURL=base-web-component-
|
|
242
|
+
//# sourceMappingURL=base-web-component-BK8X1O8C.js.map
|
|
236
243
|
|
|
237
|
-
//# sourceMappingURL=base-web-component-
|
|
244
|
+
//# sourceMappingURL=base-web-component-BK8X1O8C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-web-component-BK8X1O8C.js","sources":["src/schema/validators/options.ts","src/internal/props/options-with-optgroup.ts","src/internal/props/select-value.ts","src/internal/functional-components/select/api.tsx","src/internal/functional-components/form-field/select.tsx","src/internal/functional-components/form-field/select-value.ts","src/internal/functional-components/select/base-web-component.tsx"],"sourcesContent":["import { containsOnlyNumbers, hasEnoughReadableChars } from '../props';\nimport { a11yHint } from '../utils';\n\nimport type { Optgroup, SelectOption } from '../types';\nexport const validateInputSelectOptions = <T>(option: SelectOption<T>): boolean => {\n\tif (typeof option === 'object' && option !== null) {\n\t\tif (typeof option.label === 'string' && option.label.length > 0) {\n\t\t\toption.disabled = option.disabled === true;\n\t\t\toption.label = `${option.label}`.trim();\n\t\t\tif (hasEnoughReadableChars(option.label, 3) === false && containsOnlyNumbers(option.label) === false) {\n\t\t\t\ta11yHint(`A differing Aria-Label (${option.label}) is inaccessible. A differing Aria-Label should consist of at least three readable characters.`);\n\t\t\t}\n\t\t\tif (Array.isArray((option as Optgroup<T>).options)) {\n\t\t\t\treturn (\n\t\t\t\t\t(option as Optgroup<T>).options.find((item) => {\n\t\t\t\t\t\treturn validateInputSelectOptions(item) === false;\n\t\t\t\t\t}) === undefined\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (typeof option.label === 'number') {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n","import type { Optgroup, Option, OptionsWithOptgroupPropType, StencilUnknown } from '../../schema';\nimport { parseJson, validateInputSelectOptions } from '../../schema';\nimport type { Prop } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\n\nexport type SelectOptionsList = (Option<StencilUnknown> | Optgroup<StencilUnknown>)[];\n\n/**\n * Options prop for `kol-select`\n *\n * Description:\n * Options and optgroups, as an array or as a JSON string when it is passed through an HTML attribute.\n * Every option needs a non-empty string or a number as `label`; one invalid option rejects the whole\n * list. An empty string is rejected as well, because Stencil can pass it for an empty array.\n *\n * The validation is `validateInputSelectOptions` of the schema, which also normalizes each option in\n * place: `disabled` becomes a boolean and a string `label` is trimmed.\n */\nexport type OptionsWithOptgroupProp = Prop<'options', OptionsWithOptgroupPropType, SelectOptionsList>;\n\nfunction normalizeOptionsWithOptgroup(value: unknown): SelectOptionsList | never {\n\tconst parsed = typeof value === 'string' ? parseJson<unknown>(value) : value;\n\tif (Array.isArray(parsed) && parsed.every((option) => validateInputSelectOptions(option as Option<StencilUnknown>))) {\n\t\treturn parsed as SelectOptionsList;\n\t}\n\tthrow new Error('Invalid select options');\n}\n\nexport const optionsWithOptgroupProp = createPropDefinition<OptionsWithOptgroupProp>('options', [], normalizeOptionsWithOptgroup);\n","import type { StencilUnknown, Stringified } from '../../schema';\nimport type { Prop } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\n\n/**\n * Value prop of `kol-select`\n *\n * Description:\n * The selected values; a single value is wrapped into a list. A JSON string is not parsed, it is a\n * value of its own. The default is the empty list. `kol-select` keeps `null` as `[null]` instead of\n * applying this definition to it.\n */\nexport type SelectValueProp = Prop<'value', Stringified<StencilUnknown[]> | Stringified<StencilUnknown>, StencilUnknown[]>;\nexport const selectValueProp = createPropDefinition<SelectValueProp>('value', [], (value: unknown) =>\n\tArray.isArray(value) ? (value as StencilUnknown[]) : [value as StencilUnknown],\n);\n","import {\n\taccessKeyProp,\n\thorizontalIconsProp,\n\tmultipleProp,\n\toptionsWithOptgroupProp,\n\trequiredProp,\n\trowsProp,\n\tselectValueProp,\n\tshortKeyProp,\n\ttabIndexProp,\n\tvariantProp,\n} from '../../props';\nimport type { FormFieldBaseStates } from '../form-field/api';\nimport { formFieldBasePropsConfig } from '../form-field/api';\nimport type { ApiFromConfig, PropsConfigShape } from '../generic-types';\n\nexport const selectPropsConfig = {\n\trequired: [...formFieldBasePropsConfig.required],\n\toptional: [\n\t\t...formFieldBasePropsConfig.optional,\n\t\taccessKeyProp,\n\t\thorizontalIconsProp,\n\t\tmultipleProp,\n\t\toptionsWithOptgroupProp,\n\t\trequiredProp,\n\t\trowsProp,\n\t\tselectValueProp,\n\t\tshortKeyProp,\n\t\ttabIndexProp,\n\t\tvariantProp,\n\t],\n} as const satisfies PropsConfigShape;\n\nexport type SelectApi = ApiFromConfig<typeof selectPropsConfig, { States: FormFieldBaseStates }>;\n","import { Fragment, h, type FunctionalComponent as FC } from '@stencil/core';\nimport type { JSXBase } from '@stencil/core/internal';\nimport type { MsgPropType, SelectOption, StencilUnknown, Stringified, W3CInputValue } from '../../../schema';\nimport { getMsgType, isMsgDefinedAndInputTouched } from '../../../schema';\nimport clsx from '../../../utils/clsx';\nimport { getBlockBem } from '../bem-root-node/block-bem';\nimport type { DefaultInputProps } from './default-input-props';\nimport { getDefaultInputProps } from './default-input-props';\n\nconst selectBem = getBlockBem('kol-select');\n\ntype SelectAttributes = JSXBase.SelectHTMLAttributes<HTMLSelectElement>;\n\nexport type SelectOptionFCProps = Omit<JSXBase.OptionHTMLAttributes<HTMLOptionElement>, 'value' | 'label'> & {\n\t/** The value, or the list of values, of the selected options. */\n\tselectedValue?: StencilUnknown | StencilUnknown[];\n\tvalue: StencilUnknown;\n\tlabel: W3CInputValue;\n\t/** The key of the option, rendered as its native value; the field maps it back to `value`. */\n\tindex?: string | number;\n};\n\nexport type SelectOptionListFCProps = {\n\t/** Key prefix of the options in an optgroup. */\n\tpreKey?: string;\n\tdisabled?: boolean;\n\tvalue?: StencilUnknown | StencilUnknown[];\n\toptions?: SelectOption<StencilUnknown>[];\n\tOptionProps?: Omit<JSXBase.OptionHTMLAttributes<HTMLOptionElement>, 'value' | 'label'>;\n\tOptionGroupProps?: Omit<JSXBase.OptgroupHTMLAttributes<HTMLOptGroupElement>, 'label'>;\n};\n\nexport type SelectFCProps = DefaultInputProps<SelectAttributes> &\n\tSelectOptionListFCProps & {\n\t\ttouched?: boolean;\n\t\tmsg?: Stringified<MsgPropType>;\n\t} & {\n\t\t[key: `aria-${string}`]: unknown;\n\t\t[key: `data-${string}`]: unknown;\n\t};\n\n/**\n * Native `<option>`. Its native value is the key (`-<index>`, in an optgroup `-<group>-<index>`), not\n * the option value, because a native value can only be a string.\n */\nexport const SelectOptionFC: FC<SelectOptionFCProps> = ({ class: classNames, index, selectedValue, selected, value, label, disabled, ...other }) => {\n\tconst selectedValues = selectedValue === undefined ? [] : Array.isArray(selectedValue) ? selectedValue : [selectedValue];\n\tconst isSelected = selected || selectedValues.includes(value);\n\n\treturn (\n\t\t<option\n\t\t\tclass={clsx(selectBem('option', { selected: Boolean(isSelected), disabled: Boolean(disabled) }), classNames)}\n\t\t\tselected={isSelected}\n\t\t\tdisabled={disabled}\n\t\t\tvalue={index}\n\t\t\t{...other}\n\t\t>\n\t\t\t{label}\n\t\t</option>\n\t);\n};\n\n/** Options and optgroups of a native select, recursively; an optgroup prefixes the keys of its options. */\nexport const SelectOptionListFC: FC<SelectOptionListFCProps> = ({\n\tpreKey,\n\toptions,\n\tdisabled,\n\tvalue: selectedValue,\n\tOptionProps = {},\n\tOptionGroupProps = {},\n}) => {\n\tif (!options?.length) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{options.map((option, index) => {\n\t\t\t\tconst key = [preKey, `-${index}`].join('');\n\n\t\t\t\tif ('options' in option) {\n\t\t\t\t\tif (!option.options?.length) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst isOptgroupDisabled = Boolean(disabled || option.disabled);\n\t\t\t\t\tconst { label, ...other } = option;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<optgroup\n\t\t\t\t\t\t\tclass={selectBem('optgroup', { disabled: isOptgroupDisabled })}\n\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\t{...OptionGroupProps}\n\t\t\t\t\t\t\tlabel={label?.toString()}\n\t\t\t\t\t\t\tdisabled={isOptgroupDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SelectOptionListFC\n\t\t\t\t\t\t\t\tOptionGroupProps={OptionGroupProps}\n\t\t\t\t\t\t\t\tOptionProps={OptionProps}\n\t\t\t\t\t\t\t\tvalue={selectedValue}\n\t\t\t\t\t\t\t\tpreKey={key}\n\t\t\t\t\t\t\t\t{...other}\n\t\t\t\t\t\t\t\tdisabled={isOptgroupDisabled}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</optgroup>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ('value' in option) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<SelectOptionFC key={key} {...OptionProps} index={key} selectedValue={selectedValue} {...option} disabled={Boolean(disabled || option.disabled)} />\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t})}\n\t\t</>\n\t);\n};\n\n/**\n * Native `<select>` of a form field with its options. The select itself is the root of the\n * `kol-select` block, so the block classes are set on it directly instead of through `BemRootNodeFC`.\n */\nexport const SelectFC: FC<SelectFCProps> = (props) => {\n\tconst {\n\t\tclass: classNames,\n\t\tmsg,\n\t\ttouched,\n\t\tdisabled,\n\t\trequired,\n\t\toptions,\n\t\tvalue,\n\t\tOptionProps,\n\t\tOptionGroupProps,\n\t\tariaDescribedBy,\n\t\thideLabel,\n\t\tlabel,\n\t\t...other\n\t} = props;\n\n\tconst selectProps: SelectAttributes = {\n\t\tclass: clsx(\n\t\t\tselectBem({\n\t\t\t\tdisabled: Boolean(disabled),\n\t\t\t\trequired: Boolean(required),\n\t\t\t\ttouched: Boolean(touched),\n\t\t\t\t...(isMsgDefinedAndInputTouched(msg, touched) ? { [getMsgType(msg) as string]: true } : {}),\n\t\t\t}),\n\t\t\tclassNames,\n\t\t),\n\t\trequired: required,\n\t\tdisabled: disabled,\n\t\t...getDefaultInputProps({ ariaDescribedBy, hideLabel, label }),\n\t\t...other,\n\t};\n\n\treturn (\n\t\t<select {...selectProps}>\n\t\t\t<SelectOptionListFC OptionGroupProps={OptionGroupProps} OptionProps={OptionProps} disabled={disabled} options={options} value={value} />\n\t\t</select>\n\t);\n};\n","import type { Option, StencilUnknown } from '../../../schema';\nimport type { SelectOptionsList } from '../../props/options-with-optgroup';\n\n/**\n * Throws when the shape of a `_value` does not match `_multiple`: a list in single mode, or a single\n * value in multiple mode. The field throws from its watcher, so the value is not applied. `source`\n * names the value in the message: the received value of a `_value` change, or the current value on\n * a `_multiple` change.\n */\nexport const assertSelectValueMatchesMultiplicity = (value: unknown, multiple: boolean, source: 'current' | 'received'): void => {\n\tconst isArray = Array.isArray(value);\n\n\tif (multiple) {\n\t\tif (value !== undefined && !isArray) {\n\t\t\tthrow new Error(\n\t\t\t\t`↑ The schema for the property (_value) is not valid for multiple mode. Expected an array. The value will not be changed. (${source} = ${JSON.stringify(value)})`,\n\t\t\t);\n\t\t}\n\t} else if (isArray) {\n\t\tthrow new Error(\n\t\t\t`↑ The schema for the property (_value) is not valid for single mode. Expected a single value. The value will not be changed. (${source} = ${JSON.stringify(value)})`,\n\t\t);\n\t}\n};\n\n/** The options of the list, with the options of each optgroup in place of the optgroup. */\nconst flattenSelectOptions = (options: SelectOptionsList, groupDisabled = false): Option<StencilUnknown>[] =>\n\toptions.flatMap((entry) =>\n\t\t'options' in entry && Array.isArray(entry.options)\n\t\t\t? flattenSelectOptions(entry.options, Boolean(groupDisabled || entry.disabled))\n\t\t\t: [{ ...(entry as Option<StencilUnknown>), disabled: Boolean(groupDisabled || (entry as Option<StencilUnknown>).disabled) }],\n\t);\n\n/**\n * Keeps only the values that belong to an option. Then, in single mode (`multiple === false`, not\n * merely falsy) without a value, the value becomes the value of the first enabled option, which is\n * the option the native select shows. Without options, the value is kept as it is, because the\n * options can follow the value.\n */\nexport const normalizeSelectValue = (value: StencilUnknown[], options: SelectOptionsList, multiple: boolean | undefined): StencilUnknown[] => {\n\tif (options.length === 0) {\n\t\treturn value;\n\t}\n\tconst flatOptions = flattenSelectOptions(options);\n\tconst optionValues = flatOptions.map((option) => option.value);\n\tconst filtered = value.every((item) => optionValues.includes(item)) ? value : value.filter((item) => optionValues.includes(item));\n\tif (multiple === false && filtered.length === 0) {\n\t\tconst firstEnabled = flatOptions.find((option) => option.disabled !== true);\n\t\treturn firstEnabled ? [firstEnabled.value] : filtered;\n\t}\n\treturn filtered;\n};\n","import { h, type JSX } from '@stencil/core';\nimport type {\n\tIconsHorizontalPropType,\n\tMultiplePropType,\n\tOption,\n\tOptionsWithOptgroupPropType,\n\tSelectOption,\n\tShortKeyPropType,\n\tStencilUnknown,\n\tStringified,\n\tVariantClassNamePropType,\n} from '../../../schema';\nimport { validateAccessAndShortKey } from '../../../schema/validators/access-and-short-key';\nimport clsx from '../../../utils/clsx';\nimport type { CtaRef } from '../../../utils/element-interaction';\nimport {\n\taccessKeyProp,\n\thorizontalIconsProp,\n\tmultipleProp,\n\toptionsWithOptgroupProp,\n\trequiredProp,\n\trowsProp,\n\tselectValueProp,\n\tshortKeyProp,\n\ttabIndexProp,\n\tvariantProp,\n} from '../../props';\nimport { getInputAdornments } from '../form-field/adornments';\nimport { BaseFormFieldWebComponent } from '../form-field/base-web-component';\nimport { FormFieldFC } from '../form-field/component';\nimport { InputContainerFC } from '../form-field/input-container';\nimport { fillKeyOptionMap } from '../form-field/options';\nimport type { SelectFCProps } from '../form-field/select';\nimport { SelectFC } from '../form-field/select';\nimport { assertSelectValueMatchesMultiplicity, normalizeSelectValue } from '../form-field/select-value';\nimport type { SelectApi } from './api';\n\n/**\n * Shared orchestrator implementation of `kol-select` and the page size select of the pagination\n * (`PageSizeSelect`): the option map, the value list and its normalization, the native select\n * events and the render.\n *\n * `kol-select` keeps what Stencil has to see in the component class itself (DD16).\n */\nexport abstract class BaseSelectWebComponent extends BaseFormFieldWebComponent<SelectApi> {\n\t/** Read for the multiplicity check and the first option preselection, like the raw prop. */\n\tpublic abstract _multiple?: boolean;\n\t/** Written on user input. */\n\tpublic abstract _value?: Stringified<StencilUnknown[]> | Stringified<StencilUnknown>;\n\n\tprotected abstract readonly ctaRef: CtaRef<HTMLSelectElement>;\n\n\t/** Option of each native option value (`-<index>`). */\n\tprivate readonly keyOptionMap = new Map<string, Option<StencilUnknown>>();\n\n\t/**\n\t * Whether the field has a value, for the class `kol-form-field--has-value`. It starts as `true`\n\t * and follows each `change`; it does not trigger a render of its own.\n\t */\n\tprivate hasValue = true;\n\n\t// --- Prop application (the concrete element's watchers delegate here) ---\n\n\tprotected applyAccessKey(value?: string): void {\n\t\taccessKeyProp.apply(value, (v) => this.setRenderProp('accessKey', v));\n\t\tvalidateAccessAndShortKey(value, this.getShortKeyProp());\n\t}\n\n\tprotected applyShortKey(value?: ShortKeyPropType): void {\n\t\tshortKeyProp.apply(value, (v) => this.setRenderProp('shortKey', v));\n\t\tvalidateAccessAndShortKey(this.getAccessKeyProp(), value);\n\t}\n\n\tprotected abstract getAccessKeyProp(): string | undefined;\n\tprotected abstract getShortKeyProp(): ShortKeyPropType | undefined;\n\n\tprotected applyIcons(value?: IconsHorizontalPropType): void {\n\t\thorizontalIconsProp.apply(value, (v) => this.setRenderProp('icons', v));\n\t}\n\n\tprotected applyMultiple(value?: MultiplePropType): void {\n\t\tassertSelectValueMatchesMultiplicity(this._value, value === true, 'current');\n\t\tmultipleProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('multiple', v);\n\t\t\tthis.setRenderProp('value', normalizeSelectValue(this.getRenderProp('value'), this.getRenderProp('options'), this._multiple));\n\t\t});\n\t}\n\n\t/** The option map keeps its entries while the list is empty. */\n\tprotected applyOptions(value?: OptionsWithOptgroupPropType): void {\n\t\toptionsWithOptgroupProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('options', v);\n\t\t\tif (v.length > 0) {\n\t\t\t\tthis.keyOptionMap.clear();\n\t\t\t\tfillKeyOptionMap(this.keyOptionMap, v as SelectOption<StencilUnknown>[]);\n\t\t\t\tthis.setRenderProp('value', normalizeSelectValue(this.getRenderProp('value'), v, this._multiple));\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected applyRequired(value?: boolean): void {\n\t\trequiredProp.apply(value, (v) => this.setRenderProp('required', v));\n\t}\n\n\tprotected applyRows(value?: number): void {\n\t\trowsProp.apply(value, (v) => this.setRenderProp('rows', v));\n\t}\n\n\tprotected applyTabIndex(value?: number): void {\n\t\ttabIndexProp.apply(value, (v) => this.setRenderProp('tabIndex', v));\n\t}\n\n\t/**\n\t * A single value is wrapped into a list and `null` is kept as `[null]`. Only a `_value` change sets\n\t * the form value; the preselection on an `_options` or `_multiple` change does not.\n\t */\n\tprotected applyValue(value?: Stringified<StencilUnknown[]> | Stringified<StencilUnknown>): void {\n\t\tassertSelectValueMatchesMultiplicity(value, this._multiple === true, 'received');\n\t\tconst setValue = (list: StencilUnknown[]): void => {\n\t\t\tconst normalized = normalizeSelectValue(list, this.getRenderProp('options'), this._multiple);\n\t\t\tthis.setRenderProp('value', normalized);\n\t\t\tthis.formAssociation.setFormAssociatedValue(this.getModelValue());\n\t\t};\n\t\tif (value === null) {\n\t\t\tsetValue([null]);\n\t\t} else {\n\t\t\tselectValueProp.apply(value, setValue);\n\t\t}\n\t}\n\n\tprotected applyVariant(value?: VariantClassNamePropType): void {\n\t\tvariantProp.apply(value, (v) => this.setRenderProp('variant', v));\n\t}\n\n\t// --- Value ---\n\n\t/** The value list with `_multiple`, otherwise its first entry (the list itself when empty). */\n\tprotected getModelValue(): StencilUnknown[] | StencilUnknown {\n\t\tconst value = this.getRenderProp('value');\n\t\tif (this._multiple) {\n\t\t\treturn value;\n\t\t}\n\t\treturn Array.isArray(value) && value.length > 0 ? value[0] : value;\n\t}\n\n\t// --- Event handling of the native select ---\n\n\tprivate readonly handleSelectInput = (event: Event): void => {\n\t\tconst selectedValues = Array.from(this.ctaRef.el?.options || [])\n\t\t\t.filter((option) => option.selected)\n\t\t\t.map((option) => this.keyOptionMap.get(option.value)?.value);\n\n\t\tif (this._multiple) {\n\t\t\tthis._value = selectedValues;\n\t\t\tthis.handleInput(event, selectedValues);\n\t\t} else {\n\t\t\tconst singleValue: StencilUnknown = selectedValues.length > 0 ? selectedValues[0] : undefined;\n\t\t\tthis._value = singleValue as Stringified<StencilUnknown>;\n\t\t\tthis.handleInput(event, singleValue);\n\t\t}\n\t};\n\n\tprivate readonly handleSelectChange = (event: Event): void => {\n\t\tconst value = this._value as StencilUnknown;\n\t\tthis.handleChange(event, value);\n\t\tthis.hasValue = !!value;\n\t};\n\n\t// --- Render ---\n\n\tprivate getSelectProps(): SelectFCProps {\n\t\tconst { ariaDescribedBy, hasError } = this.getAria();\n\t\tconst multiple = this.getRenderProp('multiple');\n\t\tconst shortKey = this.getRenderProp('shortKey');\n\n\t\treturn {\n\t\t\tid: this.getState('id'),\n\t\t\thideLabel: this.getRenderProp('hideLabel'),\n\t\t\tlabel: this.getRenderProp('label'),\n\t\t\tvalue: this.getRenderProp('value'),\n\t\t\toptions: this.getRenderProp('options'),\n\t\t\taccessKey: this.getRenderProp('accessKey') || undefined,\n\t\t\tdisabled: this.getRenderProp('disabled'),\n\t\t\tname: this.getRenderProp('name') || undefined,\n\t\t\t'aria-invalid': hasError ? 'true' : undefined,\n\t\t\tariaDescribedBy,\n\t\t\tsize: multiple ? this.getRenderProp('rows') : undefined,\n\t\t\tmultiple,\n\t\t\trequired: this.getRenderProp('required'),\n\t\t\ttouched: this.getRenderProp('touched'),\n\t\t\tmsg: this.getRenderProp('msg'),\n\t\t\t...(shortKey ? { 'aria-keyshortcuts': shortKey } : {}),\n\t\t\tref: this.ctaRef,\n\t\t\tonBlur: this.handleBlur,\n\t\t\tonChange: this.handleSelectChange,\n\t\t\tonClick: this.handleClick,\n\t\t\tonFocus: this.handleFocus,\n\t\t\tonInput: this.handleSelectInput,\n\t\t\tonKeyDown: this.handleKeyDown,\n\t\t};\n\t}\n\n\tprotected renderSelectField(): JSX.Element {\n\t\tconst disabled = this.getRenderProp('disabled');\n\t\tconst { startAdornment, endAdornment } = getInputAdornments({ icons: this.getRenderProp('icons') });\n\n\t\treturn (\n\t\t\t<FormFieldFC\n\t\t\t\t{...this.getFormFieldProps({\n\t\t\t\t\tclass: clsx('kol-form-field-select', { 'kol-form-field--has-value': this.hasValue }),\n\t\t\t\t\taccessKey: this.getRenderProp('accessKey') || undefined,\n\t\t\t\t\tshortKey: this.getRenderProp('shortKey') || undefined,\n\t\t\t\t\trequired: this.getRenderProp('required'),\n\t\t\t\t\tvariant: this.getRenderProp('variant'),\n\t\t\t\t})}\n\t\t\t\tonClick={() => this.ctaRef.el?.focus()}\n\t\t\t>\n\t\t\t\t<InputContainerFC\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tmsg={this.getRenderProp('msg')}\n\t\t\t\t\ttouched={this.getRenderProp('touched')}\n\t\t\t\t\tstartAdornment={startAdornment}\n\t\t\t\t\tendAdornment={endAdornment}\n\t\t\t\t>\n\t\t\t\t\t<SelectFC {...this.getSelectProps()} />\n\t\t\t\t</InputContainerFC>\n\t\t\t</FormFieldFC>\n\t\t);\n\t}\n}\n"],"names":["hasEnoughReadableChars","containsOnlyNumbers","a11yHint","parseJson","createPropDefinition","formFieldBasePropsConfig","accessKeyProp","horizontalIconsProp","multipleProp","requiredProp","rowsProp","shortKeyProp","tabIndexProp","variantProp","getBlockBem","index","__rest","h","clsx","Fragment","isMsgDefinedAndInputTouched","getMsgType","getDefaultInputProps","BaseFormFieldWebComponent","valid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AE,cAAc,EAAE,YAAY,EAAE,GAAGa,iCAAkB,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;AAEnG,QAAA,QACCT,OAAC,CAAAU,eAAW,oBACP,IAAI,CAAC,iBAAiB,CAAC;AAC1B,YAAA,KAAK,EAAET,SAAI,CAAC,uBAAuB,EAAE,EAAE,2BAA2B,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpF,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,SAAS;YACvD,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,SAAS;AACrD,YAAA,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;AACxC,YAAA,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;SACtC,CAAC,IACF,OAAO,EAAE,MAAK,UAAC,OAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,EAAE,0CAAE,KAAK,EAAE,CAAA,EAAA,EAAA,CAAA,EAEtCD,OAAA,CAACW,+BAAgB,EAAA,EAChB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAC9B,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EACtC,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAAA,EAE1BX,OAAC,CAAA,QAAQ,EAAK,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CAAC,cAAc,EAAE,CAAI,CAAA,CACrB,CACN;;AAGhB;;;;;"}
|
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
|
|
6
6
|
require('./common-B9-LvLNa.js');
|
|
7
7
|
var variant = require('./variant-wdbSxe--.js');
|
|
8
|
-
var suggestions = require('./suggestions-
|
|
9
|
-
var inputContainer = require('./input-container-
|
|
8
|
+
var suggestions = require('./suggestions-quLXODgi.js');
|
|
9
|
+
var inputContainer = require('./input-container-BUK2Fp_t.js');
|
|
10
10
|
var baseWebComponent = require('./base-web-component-DK5Y-vq5.js');
|
|
11
11
|
var placeholder = require('./placeholder-ClwJSSNT.js');
|
|
12
12
|
var readOnly = require('./read-only-DBvxEaxi.js');
|
|
13
13
|
var required = require('./required-ZyS6KTUB.js');
|
|
14
14
|
var smartButton = require('./smart-button-BVsd-3XP.js');
|
|
15
15
|
var valueString = require('./value-string-BG4BxeEb.js');
|
|
16
|
-
var api = require('./api-
|
|
17
|
-
var index = require('./index-
|
|
16
|
+
var api = require('./api-BI1qXrGa.js');
|
|
17
|
+
var index = require('./index-RAfZF5x0.js');
|
|
18
18
|
var controller = require('./controller-D45264J9.js');
|
|
19
19
|
var accessAndShortKey = require('./access-and-short-key-D40HWCJe.js');
|
|
20
20
|
var clsx = require('./clsx-Bm_HQUnh.js');
|
|
21
21
|
var elementInteraction = require('./element-interaction-7FI_z19L.js');
|
|
22
|
-
var behavior = require('./behavior-
|
|
22
|
+
var behavior = require('./behavior-BEaXHesG.js');
|
|
23
23
|
|
|
24
24
|
const patternProp = baseWebComponent.createPropDefinition('pattern', undefined, baseWebComponent.normalizeString);
|
|
25
25
|
|
|
@@ -185,6 +185,6 @@ class BaseTextInputWebComponent extends api.BaseFormFieldWebComponent {
|
|
|
185
185
|
|
|
186
186
|
exports.BaseTextInputWebComponent = BaseTextInputWebComponent;
|
|
187
187
|
exports.textInputBasePropsConfig = textInputBasePropsConfig;
|
|
188
|
-
//# sourceMappingURL=base-web-component-
|
|
188
|
+
//# sourceMappingURL=base-web-component-GLk66TOu.js.map
|
|
189
189
|
|
|
190
|
-
//# sourceMappingURL=base-web-component-
|
|
190
|
+
//# sourceMappingURL=base-web-component-GLk66TOu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-web-component-mmgXJMg0.js","sources":["src/internal/props/pattern.ts","src/internal/functional-components/text-input/api.tsx","src/internal/functional-components/text-input/base-web-component.tsx"],"sourcesContent":["import type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { normalizeString } from './helpers/normalizers';\n\n/**\n * Pattern prop for text-based inputs\n *\n * Description:\n * A regular expression the value has to match for the native constraint validation.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#attr-input-pattern\n */\nexport type PatternProp = SimpleProp<'pattern', string>;\n// The default is `undefined`: the native attribute is only rendered when a pattern is set.\nexport const patternProp = createPropDefinition<PatternProp>('pattern', undefined as unknown as string, normalizeString);\n","import {\n\taccessKeyProp,\n\tautoCompleteProp,\n\thorizontalIconsProp,\n\tpatternProp,\n\tplaceholderProp,\n\treadOnlyProp,\n\trequiredProp,\n\tshortKeyProp,\n\tsmartButtonProp,\n\tstringValueProp,\n\tvariantProp,\n} from '../../props';\nimport type { FormFieldBaseStates } from '../form-field/api';\nimport { formFieldBasePropsConfig } from '../form-field/api';\nimport type { ApiFromConfig, PropsConfigShape } from '../generic-types';\n\n/**\n * Props email, password and text have in common. The counter props (`hasCounter`, `maxLength`,\n * `maxLengthBehavior`) belong to the `CounterBehavior` and are not part of this config.\n */\nexport const textInputBasePropsConfig = {\n\trequired: [...formFieldBasePropsConfig.required],\n\toptional: [\n\t\t...formFieldBasePropsConfig.optional,\n\t\taccessKeyProp,\n\t\tautoCompleteProp,\n\t\thorizontalIconsProp,\n\t\tpatternProp,\n\t\tplaceholderProp,\n\t\treadOnlyProp,\n\t\trequiredProp,\n\t\tshortKeyProp,\n\t\tsmartButtonProp,\n\t\tstringValueProp,\n\t\tvariantProp,\n\t],\n} as const satisfies PropsConfigShape;\n\nexport type TextInputBaseApi = ApiFromConfig<typeof textInputBasePropsConfig, { States: FormFieldBaseStates }>;\n","import { h } from '@stencil/core';\nimport type { VNode } from '@stencil/core/internal';\nimport { propagateSubmitEventToForm } from '../../../components/form/controller';\nimport type {\n\tAccessKeyPropType,\n\tAutoCompletePropType,\n\tIconsHorizontalPropType,\n\tInternalButtonProps,\n\tMaxLengthBehaviorPropType,\n\tShortKeyPropType,\n\tStringified,\n\tVariantClassNamePropType,\n\tW3CInputValue,\n} from '../../../schema';\nimport { validateAccessAndShortKey } from '../../../schema/validators/access-and-short-key';\nimport clsx from '../../../utils/clsx';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport {\n\taccessKeyProp,\n\tautoCompleteProp,\n\thorizontalIconsProp,\n\tpatternProp,\n\tplaceholderProp,\n\treadOnlyProp,\n\trequiredProp,\n\tshortKeyProp,\n\tsmartButtonProp,\n\tstringValueProp,\n\tvariantProp,\n} from '../../props';\nimport { BaseWebComponent } from '../base-web-component';\nimport { CounterBehavior } from '../counter/behavior';\nimport { getInputAdornments } from '../form-field/adornments';\nimport { BaseFormFieldWebComponent } from '../form-field/base-web-component';\nimport type { FormFieldFCProps } from '../form-field/component';\nimport type { InputFCProps } from '../form-field/input';\nimport { SuggestionsFC } from '../form-field/suggestions';\nimport type { TextInputBaseApi } from './api';\n\ntype TextInputFieldProps = {\n\t/** Native type; `kol-input-text` passes it where its state carried `_type`, before the value. */\n\ttype?: InputFCProps['type'];\n\tspellcheck?: boolean;\n\tmultiple?: boolean;\n\tsuggestions?: W3CInputValue[];\n};\n\n/**\n * Shared orchestrator implementation of `kol-input-email`, `kol-input-password` and `kol-input-text`\n * on top of the form field base: the common text input props, the character counter, the submit on\n * Enter and the props of the native `<input>`.\n *\n * As in the form field base, the concrete element declares every `@Prop` with its `@Watch`, which\n * calls the matching `apply*` method (DD16).\n */\nexport abstract class BaseTextInputWebComponent<Api extends TextInputBaseApi> extends BaseFormFieldWebComponent<Api> {\n\tpublic abstract _accessKey?: AccessKeyPropType;\n\tpublic abstract _shortKey?: ShortKeyPropType;\n\t/** Written on every input, so the watcher updates the counter and the form value. */\n\tpublic abstract _value?: string;\n\n\tprotected readonly ctaRef = createCtaRef<HTMLInputElement>();\n\n\tprotected readonly counter = new CounterBehavior(BaseWebComponent.stateLess);\n\n\t/**\n\t * Whether the field has a value, rendered as the root class `has-value`. It is a plain field, not\n\t * state: changing it does not re-render, the class follows with the next render (#11053).\n\t */\n\tprotected hasValue = false;\n\n\t/** Typed view on the text input props, see `shared` in the form field base. */\n\tprivate get textShared(): BaseTextInputWebComponent<TextInputBaseApi> {\n\t\treturn this as unknown as BaseTextInputWebComponent<TextInputBaseApi>;\n\t}\n\n\t/** Call from `componentWillLoad`, after the value has been applied. */\n\tprotected initHasValue(): void {\n\t\tthis.hasValue = Boolean(this.textShared.getRenderProp('value'));\n\t}\n\n\t/** Call from `componentDidLoad`: fills the counter spans once they exist. */\n\tprotected didLoadTextInput(): void {\n\t\tif (this.counter.hasCounter() || this.counter.hasSoftLimit()) {\n\t\t\tthis.counter.updateImmediate(this._value?.length ?? 0);\n\t\t}\n\t}\n\n\t/** Call from `disconnectedCallback`. */\n\tprotected destroyTextInput(): void {\n\t\tthis.destroyFormField();\n\t\tthis.counter.destroy();\n\t}\n\n\t// --- Prop application ---\n\n\tprotected applyAccessKey(value?: AccessKeyPropType): void {\n\t\taccessKeyProp.apply(value, (v) => this.textShared.setRenderProp('accessKey', v));\n\t\tvalidateAccessAndShortKey(value, this._shortKey);\n\t}\n\n\tprotected applyAutoComplete(value?: AutoCompletePropType): void {\n\t\tautoCompleteProp.apply(value, (v) => this.textShared.setRenderProp('autoComplete', v));\n\t}\n\n\tprotected applyIcons(value?: IconsHorizontalPropType): void {\n\t\thorizontalIconsProp.apply(value, (v) => this.textShared.setRenderProp('icons', v));\n\t}\n\n\tprotected applyPattern(value?: string): void {\n\t\tpatternProp.apply(value, (v) => this.textShared.setRenderProp('pattern', v));\n\t}\n\n\tprotected applyPlaceholder(value?: string): void {\n\t\tplaceholderProp.apply(value, (v) => this.textShared.setRenderProp('placeholder', v));\n\t}\n\n\tprotected applyReadOnly(value?: boolean): void {\n\t\treadOnlyProp.apply(value, (v) => this.textShared.setRenderProp('readOnly', v));\n\t}\n\n\tprotected applyRequired(value?: boolean): void {\n\t\trequiredProp.apply(value, (v) => this.textShared.setRenderProp('required', v));\n\t}\n\n\tprotected applyShortKey(value?: ShortKeyPropType): void {\n\t\tshortKeyProp.apply(value, (v) => this.textShared.setRenderProp('shortKey', v));\n\t\tvalidateAccessAndShortKey(this._accessKey, value);\n\t}\n\n\t/** Without `_smartButton` no button is rendered, so no default may remain. */\n\tprotected applySmartButton(value?: Stringified<InternalButtonProps>): void {\n\t\tif (value === undefined || value === null) {\n\t\t\tthis.textShared.unsetRenderProp('smartButton');\n\t\t} else {\n\t\t\tsmartButtonProp.apply(value, (v) => this.textShared.setRenderProp('smartButton', v));\n\t\t}\n\t}\n\n\tprotected applyValue(value?: string): void {\n\t\tthis.initValue(value);\n\t\tthis.counter.update(value?.length ?? 0);\n\t}\n\n\t/** Applies the value on load, without a counter update: `didLoadTextInput` fills the counter once its spans exist. */\n\tprotected initValue(value?: string): void {\n\t\tstringValueProp.apply(value, (v) => this.textShared.setRenderProp('value', v));\n\t\tthis.formAssociation.setFormAssociatedValue(this.textShared.getRenderProp('value'));\n\t}\n\n\t/** Applies the maximum on load, without a counter update, see `initValue`. */\n\tprotected initMaxLength(value?: number): void {\n\t\tthis.counter.watchMaxLength(value);\n\t}\n\n\tprotected applyVariant(value?: VariantClassNamePropType): void {\n\t\tvariantProp.apply(value, (v) => this.textShared.setRenderProp('variant', v));\n\t}\n\n\tprotected applyHasCounter(value?: boolean): void {\n\t\tthis.counter.watchHasCounter(value);\n\t}\n\n\tprotected applyMaxLength(value?: number): void {\n\t\tthis.counter.watchMaxLength(value);\n\t\tthis.counter.updateImmediate(this._value?.length ?? 0);\n\t}\n\n\tprotected applyMaxLengthBehavior(value?: MaxLengthBehaviorPropType): void {\n\t\tthis.counter.watchMaxLengthBehavior(value);\n\t}\n\n\t// --- Event handling ---\n\n\t/** Writes the value before the input event is dispatched, so the watcher has run when listeners read it. */\n\tprotected readonly handleTextInput = (event: Event): void => {\n\t\tthis._value = (event.target as HTMLInputElement).value;\n\t\tthis.handleInput(event);\n\t};\n\n\tprotected readonly handleTextChange = (event: Event, value?: unknown): void => {\n\t\tthis.handleChange(event, value);\n\t\tthis.hasValue = Boolean(value ?? (event.target as HTMLInputElement).value);\n\t};\n\n\tprotected readonly handleTextFocus = (event: FocusEvent): void => {\n\t\tthis.handleFocus(event);\n\t\tthis.counter.retriggerAria(this._value?.length ?? 0);\n\t};\n\n\t/** Enter submits the surrounding `kol-form`, like in a native form. */\n\tprotected readonly handleTextKeyDown = (event: KeyboardEvent): void => {\n\t\tthis.handleKeyDown(event);\n\t\tthis.counter.handleKeyDown(event, this.ctaRef.el?.value.length ?? 0);\n\t\tif (event.code === 'Enter' || event.code === 'NumpadEnter') {\n\t\t\tpropagateSubmitEventToForm({\n\t\t\t\tform: this.host,\n\t\t\t\tref: this.ctaRef.el,\n\t\t\t});\n\t\t}\n\t};\n\n\t// --- Render ---\n\n\t/** Props of the form field shell, with the counter, the limit and the root classes of the text fields. */\n\tprotected getTextFormFieldProps(classNames: string): FormFieldFCProps {\n\t\tconst shared = this.textShared;\n\t\treturn this.getFormFieldProps({\n\t\t\tclass: clsx(classNames, {\n\t\t\t\t'has-value': this.hasValue,\n\t\t\t\t'kol-form-field--has-counter': this.counter.hasSoftLimit() || this.counter.hasCounter(),\n\t\t\t}),\n\t\t\taccessKey: shared.getRenderProp('accessKey') || undefined,\n\t\t\tshortKey: shared.getRenderProp('shortKey') || undefined,\n\t\t\tvariant: shared.getRenderProp('variant'),\n\t\t\trequired: shared.getRenderProp('required'),\n\t\t\treadOnly: shared.getRenderProp('readOnly'),\n\t\t\tmaxLength: this.counter.getRenderProp('maxLength'),\n\t\t\tcounter: this.counter.getCounterProps(),\n\t\t});\n\t}\n\n\t/** Adornments of the input container; `endAdornment` is the field-specific button, if any. */\n\tprotected getTextInputAdornments(endAdornment?: VNode | null): { startAdornment: VNode[]; endAdornment: VNode[] } {\n\t\treturn getInputAdornments({\n\t\t\ticons: this.textShared.getRenderProp('icons'),\n\t\t\tsmartButton: this.getSmartButtonFcProps(\n\t\t\t\tthis.textShared.getRenderProp('smartButton') as InternalButtonProps | undefined,\n\t\t\t\tthis.textShared.getRenderProp('disabled'),\n\t\t\t),\n\t\t\tendAdornment,\n\t\t});\n\t}\n\n\t/**\n\t * Props of the native `<input>`. The keys follow the order of the legacy state wrapper, and props\n\t * the legacy state only held once set are only passed when set: the rendered attributes keep their\n\t * order in the hydrate snapshot.\n\t */\n\tprotected getTextInputProps({ type, spellcheck, multiple, suggestions }: TextInputFieldProps, overrides: Partial<InputFCProps> = {}): InputFCProps {\n\t\tconst shared = this.textShared;\n\t\tconst id = shared.getState('id');\n\t\tconst accessKey = shared.getRenderProp('accessKey');\n\t\tconst shortKey = shared.getRenderProp('shortKey');\n\t\tconst placeholder = shared.getRenderProp('placeholder');\n\t\tconst pattern = shared.getRenderProp('pattern');\n\t\tconst maxLength = this.counter.getMaxLengthAttribute();\n\t\tconst characterLimitHintId = this.counter.getCharacterLimitHintId(id);\n\t\tconst { ariaDescribedBy, hasError } = this.getAria();\n\n\t\treturn {\n\t\t\tid,\n\t\t\thideLabel: shared.getRenderProp('hideLabel'),\n\t\t\tlabel: shared.getRenderProp('label'),\n\t\t\tdisabled: shared.getRenderProp('disabled'),\n\t\t\t// The name prop defaults to `''`; an unnamed field renders no `name` attribute.\n\t\t\tname: shared.getRenderProp('name') || undefined,\n\t\t\t...(accessKey ? { accessKey } : {}),\n\t\t\t...(type !== undefined ? { type } : {}),\n\t\t\tvalue: shared.getRenderProp('value'),\n\t\t\trequired: shared.getRenderProp('required'),\n\t\t\t...(maxLength !== undefined ? { maxlength: maxLength } : {}),\n\t\t\t...(placeholder !== undefined ? { placeholder } : {}),\n\t\t\tautoComplete: shared.getRenderProp('autoComplete'),\n\t\t\t...(spellcheck !== undefined ? { spellcheck } : {}),\n\t\t\t...(pattern !== undefined ? { pattern } : {}),\n\t\t\treadonly: shared.getRenderProp('readOnly'),\n\t\t\t...(multiple !== undefined ? { multiple } : {}),\n\t\t\ttouched: shared.getRenderProp('touched'),\n\t\t\tmsg: shared.getRenderProp('msg'),\n\t\t\t...(shortKey ? { 'aria-keyshortcuts': shortKey } : {}),\n\t\t\t...(suggestions && suggestions.length > 0 ? { suggestions: (<SuggestionsFC id={id} suggestions={suggestions} />) as VNode } : {}),\n\t\t\tref: this.ctaRef,\n\t\t\tonBlur: this.handleBlur,\n\t\t\tonChange: this.handleTextChange,\n\t\t\tonClick: this.handleClick,\n\t\t\tonFocus: this.handleTextFocus,\n\t\t\tonInput: this.handleTextInput,\n\t\t\tonKeyDown: this.handleTextKeyDown,\n\t\t\t...overrides,\n\t\t\tariaDescribedBy: characterLimitHintId ? [...ariaDescribedBy, characterLimitHintId] : ariaDescribedBy,\n\t\t\t'aria-invalid': hasError ? 'true' : undefined,\n\t\t};\n\t}\n}\n"],"names":["createPropDefinition","normalizeString","formFieldBasePropsConfig","accessKeyProp","autoCompleteProp","horizontalIconsProp","placeholderProp","readOnlyProp","requiredProp","shortKeyProp","smartButtonProp","stringValueProp","variantProp","BaseFormFieldWebComponent","createCtaRef","CounterBehavior","BaseWebComponent","propagateSubmitEventToForm","validateAccessAndShortKey","clsx","getInputAdornments","suggestions","h","SuggestionsFC"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,WAAW,GAAGA,qCAAoB,CAAc,SAAS,EAAE,SAA8B,EAAEC,gCAAe,CAAC;;ACO3G,MAAA,wBAAwB,GAAG;AACvC,IAAA,QAAQ,EAAE,CAAC,GAAGC,4BAAwB,CAAC,QAAQ,CAAC;AAChD,IAAA,QAAQ,EAAE;QACT,GAAGA,4BAAwB,CAAC,QAAQ;QACpCC,qBAAa;QACbC,4BAAgB;QAChBC,kCAAmB;QACnB,WAAW;QACXC,2BAAe;QACfC,qBAAY;QACZC,qBAAY;QACZC,oBAAY;QACZC,2BAAe;QACfC,2BAAe;QACfC,mBAAW;AACX,KAAA;;;ACmBI,MAAgB,yBAAwD,SAAQC,6BAA8B,CAAA;AAApH,IAAA,WAAA,GAAA;;AAMoB,QAAA,I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GAAC,QAAQ,GAAG,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,EAAE,EAClD,GAACA,aAAW,IAAIA,aAAW,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,WAAW,GAAGC,OAAA,CAACC,yBAAa,EAAC,EAAA,EAAE,EAAE,EAAE,EAAE,WAAW,EAAEF,aAAW,EAAI,CAAA,CAAU,EAAE,GAAG,EAAE,EAChI,EAAA,EAAA,GAAG,EAAE,IAAI,CAAC,MAAM,EAChB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAC/B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAA,CAAA,EAC9B,SAAS,CAAA,EAAA,EACZ,eAAe,EAAE,oBAAoB,GAAG,CAAC,GAAG,eAAe,EAAE,oBAAoB,CAAC,GAAG,eAAe,EACpG,cAAc,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,EAC5C,CAAA;;AAEH;;;;;"}
|
|
1
|
+
{"version":3,"file":"base-web-component-GLk66TOu.js","sources":["src/internal/props/pattern.ts","src/internal/functional-components/text-input/api.tsx","src/internal/functional-components/text-input/base-web-component.tsx"],"sourcesContent":["import type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { normalizeString } from './helpers/normalizers';\n\n/**\n * Pattern prop for text-based inputs\n *\n * Description:\n * A regular expression the value has to match for the native constraint validation.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#attr-input-pattern\n */\nexport type PatternProp = SimpleProp<'pattern', string>;\n// The default is `undefined`: the native attribute is only rendered when a pattern is set.\nexport const patternProp = createPropDefinition<PatternProp>('pattern', undefined as unknown as string, normalizeString);\n","import {\n\taccessKeyProp,\n\tautoCompleteProp,\n\thorizontalIconsProp,\n\tpatternProp,\n\tplaceholderProp,\n\treadOnlyProp,\n\trequiredProp,\n\tshortKeyProp,\n\tsmartButtonProp,\n\tstringValueProp,\n\tvariantProp,\n} from '../../props';\nimport type { FormFieldBaseStates } from '../form-field/api';\nimport { formFieldBasePropsConfig } from '../form-field/api';\nimport type { ApiFromConfig, PropsConfigShape } from '../generic-types';\n\n/**\n * Props email, password and text have in common. The counter props (`hasCounter`, `maxLength`,\n * `maxLengthBehavior`) belong to the `CounterBehavior` and are not part of this config.\n */\nexport const textInputBasePropsConfig = {\n\trequired: [...formFieldBasePropsConfig.required],\n\toptional: [\n\t\t...formFieldBasePropsConfig.optional,\n\t\taccessKeyProp,\n\t\tautoCompleteProp,\n\t\thorizontalIconsProp,\n\t\tpatternProp,\n\t\tplaceholderProp,\n\t\treadOnlyProp,\n\t\trequiredProp,\n\t\tshortKeyProp,\n\t\tsmartButtonProp,\n\t\tstringValueProp,\n\t\tvariantProp,\n\t],\n} as const satisfies PropsConfigShape;\n\nexport type TextInputBaseApi = ApiFromConfig<typeof textInputBasePropsConfig, { States: FormFieldBaseStates }>;\n","import { h } from '@stencil/core';\nimport type { VNode } from '@stencil/core/internal';\nimport { propagateSubmitEventToForm } from '../../../components/form/controller';\nimport type {\n\tAccessKeyPropType,\n\tAutoCompletePropType,\n\tIconsHorizontalPropType,\n\tInternalButtonProps,\n\tMaxLengthBehaviorPropType,\n\tShortKeyPropType,\n\tStringified,\n\tVariantClassNamePropType,\n\tW3CInputValue,\n} from '../../../schema';\nimport { validateAccessAndShortKey } from '../../../schema/validators/access-and-short-key';\nimport clsx from '../../../utils/clsx';\nimport { createCtaRef } from '../../../utils/element-interaction';\nimport {\n\taccessKeyProp,\n\tautoCompleteProp,\n\thorizontalIconsProp,\n\tpatternProp,\n\tplaceholderProp,\n\treadOnlyProp,\n\trequiredProp,\n\tshortKeyProp,\n\tsmartButtonProp,\n\tstringValueProp,\n\tvariantProp,\n} from '../../props';\nimport { BaseWebComponent } from '../base-web-component';\nimport { CounterBehavior } from '../counter/behavior';\nimport { getInputAdornments } from '../form-field/adornments';\nimport { BaseFormFieldWebComponent } from '../form-field/base-web-component';\nimport type { FormFieldFCProps } from '../form-field/component';\nimport type { InputFCProps } from '../form-field/input';\nimport { SuggestionsFC } from '../form-field/suggestions';\nimport type { TextInputBaseApi } from './api';\n\ntype TextInputFieldProps = {\n\t/** Native type; `kol-input-text` passes it where its state carried `_type`, before the value. */\n\ttype?: InputFCProps['type'];\n\tspellcheck?: boolean;\n\tmultiple?: boolean;\n\tsuggestions?: W3CInputValue[];\n};\n\n/**\n * Shared orchestrator implementation of `kol-input-email`, `kol-input-password` and `kol-input-text`\n * on top of the form field base: the common text input props, the character counter, the submit on\n * Enter and the props of the native `<input>`.\n *\n * As in the form field base, the concrete element declares every `@Prop` with its `@Watch`, which\n * calls the matching `apply*` method (DD16).\n */\nexport abstract class BaseTextInputWebComponent<Api extends TextInputBaseApi> extends BaseFormFieldWebComponent<Api> {\n\tpublic abstract _accessKey?: AccessKeyPropType;\n\tpublic abstract _shortKey?: ShortKeyPropType;\n\t/** Written on every input, so the watcher updates the counter and the form value. */\n\tpublic abstract _value?: string;\n\n\tprotected readonly ctaRef = createCtaRef<HTMLInputElement>();\n\n\tprotected readonly counter = new CounterBehavior(BaseWebComponent.stateLess);\n\n\t/**\n\t * Whether the field has a value, rendered as the root class `has-value`. It is a plain field, not\n\t * state: changing it does not re-render, the class follows with the next render (#11053).\n\t */\n\tprotected hasValue = false;\n\n\t/** Typed view on the text input props, see `shared` in the form field base. */\n\tprivate get textShared(): BaseTextInputWebComponent<TextInputBaseApi> {\n\t\treturn this as unknown as BaseTextInputWebComponent<TextInputBaseApi>;\n\t}\n\n\t/** Call from `componentWillLoad`, after the value has been applied. */\n\tprotected initHasValue(): void {\n\t\tthis.hasValue = Boolean(this.textShared.getRenderProp('value'));\n\t}\n\n\t/** Call from `componentDidLoad`: fills the counter spans once they exist. */\n\tprotected didLoadTextInput(): void {\n\t\tif (this.counter.hasCounter() || this.counter.hasSoftLimit()) {\n\t\t\tthis.counter.updateImmediate(this._value?.length ?? 0);\n\t\t}\n\t}\n\n\t/** Call from `disconnectedCallback`. */\n\tprotected destroyTextInput(): void {\n\t\tthis.destroyFormField();\n\t\tthis.counter.destroy();\n\t}\n\n\t// --- Prop application ---\n\n\tprotected applyAccessKey(value?: AccessKeyPropType): void {\n\t\taccessKeyProp.apply(value, (v) => this.textShared.setRenderProp('accessKey', v));\n\t\tvalidateAccessAndShortKey(value, this._shortKey);\n\t}\n\n\tprotected applyAutoComplete(value?: AutoCompletePropType): void {\n\t\tautoCompleteProp.apply(value, (v) => this.textShared.setRenderProp('autoComplete', v));\n\t}\n\n\tprotected applyIcons(value?: IconsHorizontalPropType): void {\n\t\thorizontalIconsProp.apply(value, (v) => this.textShared.setRenderProp('icons', v));\n\t}\n\n\tprotected applyPattern(value?: string): void {\n\t\tpatternProp.apply(value, (v) => this.textShared.setRenderProp('pattern', v));\n\t}\n\n\tprotected applyPlaceholder(value?: string): void {\n\t\tplaceholderProp.apply(value, (v) => this.textShared.setRenderProp('placeholder', v));\n\t}\n\n\tprotected applyReadOnly(value?: boolean): void {\n\t\treadOnlyProp.apply(value, (v) => this.textShared.setRenderProp('readOnly', v));\n\t}\n\n\tprotected applyRequired(value?: boolean): void {\n\t\trequiredProp.apply(value, (v) => this.textShared.setRenderProp('required', v));\n\t}\n\n\tprotected applyShortKey(value?: ShortKeyPropType): void {\n\t\tshortKeyProp.apply(value, (v) => this.textShared.setRenderProp('shortKey', v));\n\t\tvalidateAccessAndShortKey(this._accessKey, value);\n\t}\n\n\t/** Without `_smartButton` no button is rendered, so no default may remain. */\n\tprotected applySmartButton(value?: Stringified<InternalButtonProps>): void {\n\t\tif (value === undefined || value === null) {\n\t\t\tthis.textShared.unsetRenderProp('smartButton');\n\t\t} else {\n\t\t\tsmartButtonProp.apply(value, (v) => this.textShared.setRenderProp('smartButton', v));\n\t\t}\n\t}\n\n\tprotected applyValue(value?: string): void {\n\t\tthis.initValue(value);\n\t\tthis.counter.update(value?.length ?? 0);\n\t}\n\n\t/** Applies the value on load, without a counter update: `didLoadTextInput` fills the counter once its spans exist. */\n\tprotected initValue(value?: string): void {\n\t\tstringValueProp.apply(value, (v) => this.textShared.setRenderProp('value', v));\n\t\tthis.formAssociation.setFormAssociatedValue(this.textShared.getRenderProp('value'));\n\t}\n\n\t/** Applies the maximum on load, without a counter update, see `initValue`. */\n\tprotected initMaxLength(value?: number): void {\n\t\tthis.counter.watchMaxLength(value);\n\t}\n\n\tprotected applyVariant(value?: VariantClassNamePropType): void {\n\t\tvariantProp.apply(value, (v) => this.textShared.setRenderProp('variant', v));\n\t}\n\n\tprotected applyHasCounter(value?: boolean): void {\n\t\tthis.counter.watchHasCounter(value);\n\t}\n\n\tprotected applyMaxLength(value?: number): void {\n\t\tthis.counter.watchMaxLength(value);\n\t\tthis.counter.updateImmediate(this._value?.length ?? 0);\n\t}\n\n\tprotected applyMaxLengthBehavior(value?: MaxLengthBehaviorPropType): void {\n\t\tthis.counter.watchMaxLengthBehavior(value);\n\t}\n\n\t// --- Event handling ---\n\n\t/** Writes the value before the input event is dispatched, so the watcher has run when listeners read it. */\n\tprotected readonly handleTextInput = (event: Event): void => {\n\t\tthis._value = (event.target as HTMLInputElement).value;\n\t\tthis.handleInput(event);\n\t};\n\n\tprotected readonly handleTextChange = (event: Event, value?: unknown): void => {\n\t\tthis.handleChange(event, value);\n\t\tthis.hasValue = Boolean(value ?? (event.target as HTMLInputElement).value);\n\t};\n\n\tprotected readonly handleTextFocus = (event: FocusEvent): void => {\n\t\tthis.handleFocus(event);\n\t\tthis.counter.retriggerAria(this._value?.length ?? 0);\n\t};\n\n\t/** Enter submits the surrounding `kol-form`, like in a native form. */\n\tprotected readonly handleTextKeyDown = (event: KeyboardEvent): void => {\n\t\tthis.handleKeyDown(event);\n\t\tthis.counter.handleKeyDown(event, this.ctaRef.el?.value.length ?? 0);\n\t\tif (event.code === 'Enter' || event.code === 'NumpadEnter') {\n\t\t\tpropagateSubmitEventToForm({\n\t\t\t\tform: this.host,\n\t\t\t\tref: this.ctaRef.el,\n\t\t\t});\n\t\t}\n\t};\n\n\t// --- Render ---\n\n\t/** Props of the form field shell, with the counter, the limit and the root classes of the text fields. */\n\tprotected getTextFormFieldProps(classNames: string): FormFieldFCProps {\n\t\tconst shared = this.textShared;\n\t\treturn this.getFormFieldProps({\n\t\t\tclass: clsx(classNames, {\n\t\t\t\t'has-value': this.hasValue,\n\t\t\t\t'kol-form-field--has-counter': this.counter.hasSoftLimit() || this.counter.hasCounter(),\n\t\t\t}),\n\t\t\taccessKey: shared.getRenderProp('accessKey') || undefined,\n\t\t\tshortKey: shared.getRenderProp('shortKey') || undefined,\n\t\t\tvariant: shared.getRenderProp('variant'),\n\t\t\trequired: shared.getRenderProp('required'),\n\t\t\treadOnly: shared.getRenderProp('readOnly'),\n\t\t\tmaxLength: this.counter.getRenderProp('maxLength'),\n\t\t\tcounter: this.counter.getCounterProps(),\n\t\t});\n\t}\n\n\t/** Adornments of the input container; `endAdornment` is the field-specific button, if any. */\n\tprotected getTextInputAdornments(endAdornment?: VNode | null): { startAdornment: VNode[]; endAdornment: VNode[] } {\n\t\treturn getInputAdornments({\n\t\t\ticons: this.textShared.getRenderProp('icons'),\n\t\t\tsmartButton: this.getSmartButtonFcProps(\n\t\t\t\tthis.textShared.getRenderProp('smartButton') as InternalButtonProps | undefined,\n\t\t\t\tthis.textShared.getRenderProp('disabled'),\n\t\t\t),\n\t\t\tendAdornment,\n\t\t});\n\t}\n\n\t/**\n\t * Props of the native `<input>`. The keys follow the order of the legacy state wrapper, and props\n\t * the legacy state only held once set are only passed when set: the rendered attributes keep their\n\t * order in the hydrate snapshot.\n\t */\n\tprotected getTextInputProps({ type, spellcheck, multiple, suggestions }: TextInputFieldProps, overrides: Partial<InputFCProps> = {}): InputFCProps {\n\t\tconst shared = this.textShared;\n\t\tconst id = shared.getState('id');\n\t\tconst accessKey = shared.getRenderProp('accessKey');\n\t\tconst shortKey = shared.getRenderProp('shortKey');\n\t\tconst placeholder = shared.getRenderProp('placeholder');\n\t\tconst pattern = shared.getRenderProp('pattern');\n\t\tconst maxLength = this.counter.getMaxLengthAttribute();\n\t\tconst characterLimitHintId = this.counter.getCharacterLimitHintId(id);\n\t\tconst { ariaDescribedBy, hasError } = this.getAria();\n\n\t\treturn {\n\t\t\tid,\n\t\t\thideLabel: shared.getRenderProp('hideLabel'),\n\t\t\tlabel: shared.getRenderProp('label'),\n\t\t\tdisabled: shared.getRenderProp('disabled'),\n\t\t\t// The name prop defaults to `''`; an unnamed field renders no `name` attribute.\n\t\t\tname: shared.getRenderProp('name') || undefined,\n\t\t\t...(accessKey ? { accessKey } : {}),\n\t\t\t...(type !== undefined ? { type } : {}),\n\t\t\tvalue: shared.getRenderProp('value'),\n\t\t\trequired: shared.getRenderProp('required'),\n\t\t\t...(maxLength !== undefined ? { maxlength: maxLength } : {}),\n\t\t\t...(placeholder !== undefined ? { placeholder } : {}),\n\t\t\tautoComplete: shared.getRenderProp('autoComplete'),\n\t\t\t...(spellcheck !== undefined ? { spellcheck } : {}),\n\t\t\t...(pattern !== undefined ? { pattern } : {}),\n\t\t\treadonly: shared.getRenderProp('readOnly'),\n\t\t\t...(multiple !== undefined ? { multiple } : {}),\n\t\t\ttouched: shared.getRenderProp('touched'),\n\t\t\tmsg: shared.getRenderProp('msg'),\n\t\t\t...(shortKey ? { 'aria-keyshortcuts': shortKey } : {}),\n\t\t\t...(suggestions && suggestions.length > 0 ? { suggestions: (<SuggestionsFC id={id} suggestions={suggestions} />) as VNode } : {}),\n\t\t\tref: this.ctaRef,\n\t\t\tonBlur: this.handleBlur,\n\t\t\tonChange: this.handleTextChange,\n\t\t\tonClick: this.handleClick,\n\t\t\tonFocus: this.handleTextFocus,\n\t\t\tonInput: this.handleTextInput,\n\t\t\tonKeyDown: this.handleTextKeyDown,\n\t\t\t...overrides,\n\t\t\tariaDescribedBy: characterLimitHintId ? [...ariaDescribedBy, characterLimitHintId] : ariaDescribedBy,\n\t\t\t'aria-invalid': hasError ? 'true' : undefined,\n\t\t};\n\t}\n}\n"],"names":["createPropDefinition","normalizeString","formFieldBasePropsConfig","accessKeyProp","autoCompleteProp","horizontalIconsProp","placeholderProp","readOnlyProp","requiredProp","shortKeyProp","smartButtonProp","stringValueProp","variantProp","BaseFormFieldWebComponent","createCtaRef","CounterBehavior","BaseWebComponent","propagateSubmitEventToForm","validateAccessAndShortKey","clsx","getInputAdornments","suggestions","h","SuggestionsFC"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,WAAW,GAAGA,qCAAoB,CAAc,SAAS,EAAE,SAA8B,EAAEC,gCAAe,CAAC;;ACO3G,MAAA,wBAAwB,GAAG;AACvC,IAAA,QAAQ,EAAE,CAAC,GAAGC,4BAAwB,CAAC,QAAQ,CAAC;AAChD,IAAA,QAAQ,EAAE;QACT,GAAGA,4BAAwB,CAAC,QAAQ;QACpCC,qBAAa;QACbC,4BAAgB;QAChBC,kCAAmB;QACnB,WAAW;QACXC,2BAAe;QACfC,qBAAY;QACZC,qBAAY;QACZC,oBAAY;QACZC,2BAAe;QACfC,2BAAe;QACfC,mBAAW;AACX,KAAA;;;ACmBI,MAAgB,yBAAwD,SAAQC,6BAA8B,CAAA;AAApH,IAAA,WAAA,GAAA;;AAMoB,QAAA,IAAM,CAAA,MAAA,GAAGC,+BAAY,EAAoB;QAEzC,IAAO,CAAA,OAAA,GAAG,IAAIC,wBAAe,CAACC,iCAAgB,CAAC,SAAS,CAAC;AAMlE,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AA0GP,QAAA,IAAA,CAAA,eAAe,GAAG,CAAC,KAAY,KAAU;YAC3D,IAAI,CAAC,MAAM,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK;AACtD,YAAA,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACxB,SAAC;QAEkB,IAAA,CAAA,gBAAgB,GAAG,CAAC,KAAY,EAAE,KAAe,KAAU;AAC7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AC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAA,CAAA,EAC9B,SAAS,CAAA,EAAA,EACZ,eAAe,EAAE,oBAAoB,GAAG,CAAC,GAAG,eAAe,EAAE,oBAAoB,CAAC,GAAG,eAAe,EACpG,cAAc,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,EAC5C,CAAA;;AAEH;;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var dev_utils = require('./dev.utils-
|
|
6
|
+
var dev_utils = require('./dev.utils-DybQ4euF.js');
|
|
7
7
|
require('./common-B9-LvLNa.js');
|
|
8
8
|
var baseWebComponent = require('./base-web-component-DK5Y-vq5.js');
|
|
9
9
|
var behavior = require('./behavior-DMhnAIvG.js');
|
|
@@ -163,6 +163,6 @@ class CounterBehavior extends behavior.BaseBehavior {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
exports.CounterBehavior = CounterBehavior;
|
|
166
|
-
//# sourceMappingURL=behavior-
|
|
166
|
+
//# sourceMappingURL=behavior-BEaXHesG.js.map
|
|
167
167
|
|
|
168
|
-
//# sourceMappingURL=behavior-
|
|
168
|
+
//# sourceMappingURL=behavior-BEaXHesG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"behavior-DWqrO2yi.js","sources":["src/internal/props/has-counter.ts","src/internal/props/max-length.ts","src/internal/props/max-length-behavior.ts","src/internal/functional-components/counter/api.tsx","src/internal/functional-components/counter/texts.ts","src/internal/functional-components/counter/behavior.ts"],"sourcesContent":["import type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { normalizeBoolean } from './helpers/normalizers';\n\n/**\n * Has counter prop for text-based form fields\n *\n * Description:\n * Shows the character counter below the control.\n */\nexport type HasCounterProp = SimpleProp<'hasCounter', boolean>;\nexport const hasCounterProp = createPropDefinition<HasCounterProp>('hasCounter', false, normalizeBoolean);\n","import type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { normalizeNumber } from './helpers/normalizers';\n\n/**\n * Max length prop for text-based form fields\n *\n * Description:\n * The maximum number of characters. With the max length behavior `'hard'` it becomes the native\n * `maxlength` attribute, with `'soft'` it is only announced by the character counter.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#attr-input-maxlength\n */\nexport type MaxLengthProp = SimpleProp<'maxLength', number>;\n// The default is `undefined`: without a maximum there is no limit and no character limit hint. The\n// validation also runs on the default, so it accepts `undefined`.\nexport const maxLengthProp = createPropDefinition<MaxLengthProp>(\n\t'maxLength',\n\tundefined as unknown as number,\n\tnormalizeNumber,\n\t(value) => value === undefined || value >= 0,\n);\n","import type { MaxLengthBehaviorPropType } from '../../schema';\nimport type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { isEnumOption, normalizeString } from './helpers/normalizers';\n\nconst MAX_LENGTH_BEHAVIOR_OPTIONS: readonly MaxLengthBehaviorPropType[] = ['hard', 'soft'];\n\n/**\n * Max length behavior prop for text-based form fields\n *\n * Description:\n * `'hard'` prevents longer input through the native `maxlength` attribute, `'soft'` allows it and\n * lets the character counter announce the exceeded limit.\n */\nexport type MaxLengthBehaviorProp = SimpleProp<'maxLengthBehavior', MaxLengthBehaviorPropType>;\n\nfunction normalizeMaxLengthBehavior(value: unknown): MaxLengthBehaviorPropType {\n\tconst str = normalizeString(value);\n\tif (isEnumOption(str, MAX_LENGTH_BEHAVIOR_OPTIONS)) {\n\t\treturn str;\n\t}\n\tthrow new Error(`Invalid max length behavior: ${str}`);\n}\n\nexport const maxLengthBehaviorProp = createPropDefinition<MaxLengthBehaviorProp>('maxLengthBehavior', 'hard', normalizeMaxLengthBehavior);\n","import { hasCounterProp, maxLengthBehaviorProp, maxLengthProp } from '../../props';\nimport type { ApiFromConfig, PropsConfigShape } from '../generic-types';\n\nexport const counterPropsConfig = {\n\toptional: [hasCounterProp, maxLengthProp, maxLengthBehaviorProp],\n} as const satisfies PropsConfigShape;\n\nexport type CounterApi = ApiFromConfig<typeof counterPropsConfig>;\n","import { translate } from '../../../i18n';\nimport type { MaxLengthBehaviorPropType } from '../../../schema';\n\nexport const getCounterVisualText = (maxLengthBehavior: MaxLengthBehaviorPropType, maxLength: number | undefined, currentLength: number): string => {\n\tif (typeof maxLength !== 'number') {\n\t\treturn translate('kol-character-counter-current', { placeholders: { current: String(currentLength) } });\n\t}\n\tif (maxLengthBehavior === 'soft') {\n\t\tconst remaining = maxLength - currentLength;\n\t\treturn remaining < 0\n\t\t\t? translate('kol-character-limit-exceeded', { placeholders: { over: String(Math.abs(remaining)) } })\n\t\t\t: translate('kol-character-limit-remaining', { placeholders: { remaining: String(remaining) } });\n\t}\n\treturn translate('kol-character-counter-current-of-max', { placeholders: { current: String(currentLength), max: String(maxLength) } });\n};\n\nexport const getCounterAriaText = (maxLengthBehavior: MaxLengthBehaviorPropType, maxLength: number | undefined, currentLength: number): string => {\n\tif (typeof maxLength !== 'number') {\n\t\treturn translate('kol-character-counter-current', { placeholders: { current: String(currentLength) } });\n\t}\n\tif (maxLengthBehavior === 'soft') {\n\t\tconst remaining = maxLength - currentLength;\n\t\treturn remaining < 0\n\t\t\t? translate('kol-character-limit-exceeded', { placeholders: { over: String(Math.abs(remaining)) } })\n\t\t\t: translate('kol-character-limit-remaining', { placeholders: { remaining: String(remaining) } });\n\t}\n\treturn translate('kol-character-counter-current-of-max-aria', { placeholders: { current: String(currentLength), max: String(maxLength) } });\n};\n\nexport const getCounterMaxText = (maxLengthBehavior: MaxLengthBehaviorPropType, maxLength: number | undefined, currentLength: number): string => {\n\tif (maxLengthBehavior === 'hard' && typeof maxLength === 'number' && currentLength >= maxLength) {\n\t\treturn translate('kol-character-counter-max-aria');\n\t}\n\treturn '';\n};\n","import type { MaxLengthBehaviorPropType } from '../../../schema';\nimport { createRelatedUniqueId } from '../../../utils/dev.utils';\nimport { hasCounterProp, maxLengthBehaviorProp, maxLengthProp } from '../../props';\nimport { BaseBehavior } from '../base-behavior';\nimport type { FormFieldFCProps } from '../form-field/component';\nimport type { BehaviorInterface, ResolvedInputProps, StateAccess } from '../generic-types';\nimport type { CounterApi } from './api';\nimport { counterPropsConfig } from './api';\nimport { getCounterAriaText, getCounterMaxText, getCounterVisualText } from './texts';\n\n/** A printable single character without Ctrl, Meta or Alt, i.e. a key press that inserts a character. */\nconst isCharacterInputKey = (event: KeyboardEvent): boolean => event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\n\n/** Invisible no-break space that makes an identical live region text differ, so it is announced again. */\nconst REANNOUNCE_MARKER = ' ';\n\nconst ARIA_DEBOUNCE_MS = 1000;\n\ntype CounterLimit = {\n\tmaxLength?: number;\n\tmaxLengthBehavior: MaxLengthBehaviorPropType;\n};\n\n/**\n * Character counter and character limit of a text field.\n *\n * It owns `hasCounter`, `maxLength` and `maxLengthBehavior` and writes the texts of the two counter\n * spans of `FormFieldFC` directly into the DOM, without a re-render: the visible span immediately,\n * the `aria-live` span debounced, so a screen reader does not announce every key stroke.\n */\nexport class CounterBehavior extends BaseBehavior<CounterApi> implements BehaviorInterface<CounterApi> {\n\tprivate visualSpan?: HTMLSpanElement;\n\tprivate ariaSpan?: HTMLSpanElement;\n\tprivate debounceTimer?: ReturnType<typeof setTimeout>;\n\tprivate reannounceToggle = false;\n\n\tpublic constructor(stateAccess: StateAccess<CounterApi>) {\n\t\tsuper(stateAccess, counterPropsConfig);\n\t}\n\n\tpublic componentWillLoad(props: ResolvedInputProps<CounterApi>): void {\n\t\tthis.watchHasCounter(props.hasCounter);\n\t\tthis.watchMaxLength(props.maxLength);\n\t\tthis.watchMaxLengthBehavior(props.maxLengthBehavior);\n\t}\n\n\tpublic watchHasCounter(value?: boolean): void {\n\t\thasCounterProp.apply(value, (v) => this.setRenderProp('hasCounter', v));\n\t}\n\n\tpublic watchMaxLength(value?: number): void {\n\t\tmaxLengthProp.apply(value, (v) => this.setRenderProp('maxLength', v));\n\t}\n\n\tpublic watchMaxLengthBehavior(value?: MaxLengthBehaviorPropType): void {\n\t\tmaxLengthBehaviorProp.apply(value, (v) => this.setRenderProp('maxLengthBehavior', v));\n\t}\n\n\tpublic readonly setVisualRef = (el?: HTMLSpanElement): void => {\n\t\tthis.visualSpan = el;\n\t};\n\n\tpublic readonly setAriaRef = (el?: HTMLSpanElement): void => {\n\t\tthis.ariaSpan = el;\n\t};\n\n\tpublic hasCounter(): boolean {\n\t\treturn this.getRenderProp('hasCounter') === true;\n\t}\n\n\t/** A maximum with the behavior `'soft'`: the counter announces the exceeded limit instead of `maxlength` preventing it. */\n\tpublic hasSoftLimit(): boolean {\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\treturn typeof maxLength === 'number' && maxLengthBehavior === 'soft';\n\t}\n\n\t/** The native `maxlength` attribute: only a hard limit prevents longer input. */\n\tpublic getMaxLengthAttribute(): number | undefined {\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\treturn maxLengthBehavior === 'hard' ? maxLength : undefined;\n\t}\n\n\t/** The `counter` prop of `FormFieldFC`; the counter is only rendered with `hasCounter`. */\n\tpublic getCounterProps(): FormFieldFCProps['counter'] {\n\t\tif (!this.hasCounter()) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\treturn { maxLength, maxLengthBehavior, visualRef: this.setVisualRef, ariaRef: this.setAriaRef };\n\t}\n\n\t/**\n\t * The ID of the hidden character limit hint, which the control references in `aria-describedby`.\n\t * The hint only exists for a maximum without counter, because the counter announces the maximum itself.\n\t */\n\tpublic getCharacterLimitHintId(id: string): string | undefined {\n\t\treturn typeof this.getRenderProp('maxLength') === 'number' && !this.hasCounter() ? createRelatedUniqueId(id, 'character-limit-hint') : undefined;\n\t}\n\n\t/** Updates the visible span immediately and the `aria-live` span debounced. */\n\tpublic update(currentLength: number): void {\n\t\tconst limit = this.getLimit();\n\t\tthis.updateVisual(currentLength, limit);\n\t\tclearTimeout(this.debounceTimer);\n\t\tthis.debounceTimer = setTimeout(() => this.updateAria(currentLength, limit), ARIA_DEBOUNCE_MS);\n\t}\n\n\t/** Updates both spans without debounce, e.g. after the first render or a programmatic change of the limit. */\n\tpublic updateImmediate(currentLength: number): void {\n\t\tconst limit = this.getLimit();\n\t\tthis.updateVisual(currentLength, limit);\n\t\tclearTimeout(this.debounceTimer);\n\t\tthis.updateAria(currentLength, limit);\n\t}\n\n\t/**\n\t * Announces the reached hard limit again on every further typing attempt. `maxlength` blocks the\n\t * input without an `input` event, so the live region would otherwise stay silent.\n\t */\n\tpublic readonly handleKeyDown = (event: KeyboardEvent, currentLength: number): void => {\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\tif (maxLengthBehavior !== 'hard' || typeof maxLength !== 'number' || currentLength < maxLength) return;\n\t\tif (!isCharacterInputKey(event)) return;\n\t\tthis.retriggerAria(currentLength);\n\t};\n\n\t/** Announces the `aria-live` span again, debounced, even if its text did not change. */\n\tpublic retriggerAria(currentLength: number): void {\n\t\tif (!this.ariaSpan) return;\n\t\tconst limit = this.getLimit();\n\t\tclearTimeout(this.debounceTimer);\n\t\tthis.debounceTimer = setTimeout(() => this.updateAria(currentLength, limit, true), ARIA_DEBOUNCE_MS);\n\t}\n\n\tpublic destroy(): void {\n\t\tclearTimeout(this.debounceTimer);\n\t}\n\n\tprivate getLimit(): CounterLimit {\n\t\treturn { maxLength: this.getRenderProp('maxLength'), maxLengthBehavior: this.getRenderProp('maxLengthBehavior') };\n\t}\n\n\tprivate updateVisual(currentLength: number, { maxLength, maxLengthBehavior }: CounterLimit): void {\n\t\tif (!this.visualSpan) return;\n\t\tthis.visualSpan.innerText = getCounterVisualText(maxLengthBehavior, maxLength, currentLength);\n\t\tthis.visualSpan.classList.toggle(\n\t\t\t'kol-form-field__counter--exceeded',\n\t\t\tmaxLengthBehavior === 'soft' && typeof maxLength === 'number' && currentLength > maxLength,\n\t\t);\n\t}\n\n\tprivate updateAria(currentLength: number, { maxLength, maxLengthBehavior }: CounterLimit, forceReannounce = false): void {\n\t\tif (!this.ariaSpan) return;\n\t\tlet text = [getCounterAriaText(maxLengthBehavior, maxLength, currentLength), getCounterMaxText(maxLengthBehavior, maxLength, currentLength)]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ');\n\n\t\tif (forceReannounce) {\n\t\t\t// `aria-live` only announces a changed text. A repeated attempt produces the same text, so a\n\t\t\t// no-break space is appended on every other call to make it differ.\n\t\t\tthis.reannounceToggle = !this.reannounceToggle;\n\t\t\tif (this.reannounceToggle) {\n\t\t\t\ttext += REANNOUNCE_MARKER;\n\t\t\t}\n\t\t}\n\n\t\tthis.ariaSpan.innerText = text;\n\t}\n}\n"],"names":["createPropDefinition","normalizeBoolean","normalizeNumber","normalizeString","isEnumOption","translate","BaseBehavior","createRelatedUniqueId"],"mappings":";;;;;;;;;;;AAWO,MAAM,cAAc,GAAGA,qCAAoB,CAAiB,YAAY,EAAE,KAAK,EAAEC,iCAAgB,CAAC;;ACKlG,MAAM,aAAa,GAAGD,qCAAoB,CAChD,WAAW,EACX,SAA8B,EAC9BE,gCAAe,EACf,CAAC,KAAK,KAAK,KAAK,KAAK,SAAS,IAAI,KAAK,IAAI,CAAC,CAC5C;;AChBD,MAAM,2BAA2B,GAAyC,CAAC,MAAM,EAAE,MAAM,CAAC;AAW1F,SAAS,0BAA0B,CAAC,KAAc,EAAA;AACjD,IAAA,MAAM,GAAG,GAAGC,gCAAe,CAAC,KAAK,CAAC;AAClC,IAAA,IAAIC,6BAAY,CAAC,GAAG,EAAE,2BAA2B,CAAC,EAAE;AACnD,QAAA,OAAO,GAAG;;AAEX,IAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,CAAA,CAAE,CAAC;AACvD;AAEO,MAAM,qBAAqB,GAAGJ,qCAAoB,CAAwB,mBAAmB,EA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SAAS,EAAE,iBAAiB,EAAgB,EAAE,eAAe,GAAG,KAAK,EAAA;QAChH,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE;QACpB,IAAI,IAAI,GAAG,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,EAAE,SAAS,EAAE,aAAa,CAAC;aACzI,MAAM,CAAC,OAAO;aACd,IAAI,CAAC,GAAG,CAAC;QAEX,IAAI,eAAe,EAAE;AAGpB,YAAA,IAAI,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,gBAAgB;AAC9C,YAAA,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,IAAI,IAAI,iBAAiB;;;AAI3B,QAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAI;;AAE/B;;;;"}
|
|
1
|
+
{"version":3,"file":"behavior-BEaXHesG.js","sources":["src/internal/props/has-counter.ts","src/internal/props/max-length.ts","src/internal/props/max-length-behavior.ts","src/internal/functional-components/counter/api.tsx","src/internal/functional-components/counter/texts.ts","src/internal/functional-components/counter/behavior.ts"],"sourcesContent":["import type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { normalizeBoolean } from './helpers/normalizers';\n\n/**\n * Has counter prop for text-based form fields\n *\n * Description:\n * Shows the character counter below the control.\n */\nexport type HasCounterProp = SimpleProp<'hasCounter', boolean>;\nexport const hasCounterProp = createPropDefinition<HasCounterProp>('hasCounter', false, normalizeBoolean);\n","import type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { normalizeNumber } from './helpers/normalizers';\n\n/**\n * Max length prop for text-based form fields\n *\n * Description:\n * The maximum number of characters. With the max length behavior `'hard'` it becomes the native\n * `maxlength` attribute, with `'soft'` it is only announced by the character counter.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#attr-input-maxlength\n */\nexport type MaxLengthProp = SimpleProp<'maxLength', number>;\n// The default is `undefined`: without a maximum there is no limit and no character limit hint. The\n// validation also runs on the default, so it accepts `undefined`.\nexport const maxLengthProp = createPropDefinition<MaxLengthProp>(\n\t'maxLength',\n\tundefined as unknown as number,\n\tnormalizeNumber,\n\t(value) => value === undefined || value >= 0,\n);\n","import type { MaxLengthBehaviorPropType } from '../../schema';\nimport type { SimpleProp } from './helpers/factory';\nimport { createPropDefinition } from './helpers/factory';\nimport { isEnumOption, normalizeString } from './helpers/normalizers';\n\nconst MAX_LENGTH_BEHAVIOR_OPTIONS: readonly MaxLengthBehaviorPropType[] = ['hard', 'soft'];\n\n/**\n * Max length behavior prop for text-based form fields\n *\n * Description:\n * `'hard'` prevents longer input through the native `maxlength` attribute, `'soft'` allows it and\n * lets the character counter announce the exceeded limit.\n */\nexport type MaxLengthBehaviorProp = SimpleProp<'maxLengthBehavior', MaxLengthBehaviorPropType>;\n\nfunction normalizeMaxLengthBehavior(value: unknown): MaxLengthBehaviorPropType {\n\tconst str = normalizeString(value);\n\tif (isEnumOption(str, MAX_LENGTH_BEHAVIOR_OPTIONS)) {\n\t\treturn str;\n\t}\n\tthrow new Error(`Invalid max length behavior: ${str}`);\n}\n\nexport const maxLengthBehaviorProp = createPropDefinition<MaxLengthBehaviorProp>('maxLengthBehavior', 'hard', normalizeMaxLengthBehavior);\n","import { hasCounterProp, maxLengthBehaviorProp, maxLengthProp } from '../../props';\nimport type { ApiFromConfig, PropsConfigShape } from '../generic-types';\n\nexport const counterPropsConfig = {\n\toptional: [hasCounterProp, maxLengthProp, maxLengthBehaviorProp],\n} as const satisfies PropsConfigShape;\n\nexport type CounterApi = ApiFromConfig<typeof counterPropsConfig>;\n","import { translate } from '../../../i18n';\nimport type { MaxLengthBehaviorPropType } from '../../../schema';\n\nexport const getCounterVisualText = (maxLengthBehavior: MaxLengthBehaviorPropType, maxLength: number | undefined, currentLength: number): string => {\n\tif (typeof maxLength !== 'number') {\n\t\treturn translate('kol-character-counter-current', { placeholders: { current: String(currentLength) } });\n\t}\n\tif (maxLengthBehavior === 'soft') {\n\t\tconst remaining = maxLength - currentLength;\n\t\treturn remaining < 0\n\t\t\t? translate('kol-character-limit-exceeded', { placeholders: { over: String(Math.abs(remaining)) } })\n\t\t\t: translate('kol-character-limit-remaining', { placeholders: { remaining: String(remaining) } });\n\t}\n\treturn translate('kol-character-counter-current-of-max', { placeholders: { current: String(currentLength), max: String(maxLength) } });\n};\n\nexport const getCounterAriaText = (maxLengthBehavior: MaxLengthBehaviorPropType, maxLength: number | undefined, currentLength: number): string => {\n\tif (typeof maxLength !== 'number') {\n\t\treturn translate('kol-character-counter-current', { placeholders: { current: String(currentLength) } });\n\t}\n\tif (maxLengthBehavior === 'soft') {\n\t\tconst remaining = maxLength - currentLength;\n\t\treturn remaining < 0\n\t\t\t? translate('kol-character-limit-exceeded', { placeholders: { over: String(Math.abs(remaining)) } })\n\t\t\t: translate('kol-character-limit-remaining', { placeholders: { remaining: String(remaining) } });\n\t}\n\treturn translate('kol-character-counter-current-of-max-aria', { placeholders: { current: String(currentLength), max: String(maxLength) } });\n};\n\nexport const getCounterMaxText = (maxLengthBehavior: MaxLengthBehaviorPropType, maxLength: number | undefined, currentLength: number): string => {\n\tif (maxLengthBehavior === 'hard' && typeof maxLength === 'number' && currentLength >= maxLength) {\n\t\treturn translate('kol-character-counter-max-aria');\n\t}\n\treturn '';\n};\n","import type { MaxLengthBehaviorPropType } from '../../../schema';\nimport { createRelatedUniqueId } from '../../../utils/dev.utils';\nimport { hasCounterProp, maxLengthBehaviorProp, maxLengthProp } from '../../props';\nimport { BaseBehavior } from '../base-behavior';\nimport type { FormFieldFCProps } from '../form-field/component';\nimport type { BehaviorInterface, ResolvedInputProps, StateAccess } from '../generic-types';\nimport type { CounterApi } from './api';\nimport { counterPropsConfig } from './api';\nimport { getCounterAriaText, getCounterMaxText, getCounterVisualText } from './texts';\n\n/** A printable single character without Ctrl, Meta or Alt, i.e. a key press that inserts a character. */\nconst isCharacterInputKey = (event: KeyboardEvent): boolean => event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\n\n/** Invisible no-break space that makes an identical live region text differ, so it is announced again. */\nconst REANNOUNCE_MARKER = ' ';\n\nconst ARIA_DEBOUNCE_MS = 1000;\n\ntype CounterLimit = {\n\tmaxLength?: number;\n\tmaxLengthBehavior: MaxLengthBehaviorPropType;\n};\n\n/**\n * Character counter and character limit of a text field.\n *\n * It owns `hasCounter`, `maxLength` and `maxLengthBehavior` and writes the texts of the two counter\n * spans of `FormFieldFC` directly into the DOM, without a re-render: the visible span immediately,\n * the `aria-live` span debounced, so a screen reader does not announce every key stroke.\n */\nexport class CounterBehavior extends BaseBehavior<CounterApi> implements BehaviorInterface<CounterApi> {\n\tprivate visualSpan?: HTMLSpanElement;\n\tprivate ariaSpan?: HTMLSpanElement;\n\tprivate debounceTimer?: ReturnType<typeof setTimeout>;\n\tprivate reannounceToggle = false;\n\n\tpublic constructor(stateAccess: StateAccess<CounterApi>) {\n\t\tsuper(stateAccess, counterPropsConfig);\n\t}\n\n\tpublic componentWillLoad(props: ResolvedInputProps<CounterApi>): void {\n\t\tthis.watchHasCounter(props.hasCounter);\n\t\tthis.watchMaxLength(props.maxLength);\n\t\tthis.watchMaxLengthBehavior(props.maxLengthBehavior);\n\t}\n\n\tpublic watchHasCounter(value?: boolean): void {\n\t\thasCounterProp.apply(value, (v) => this.setRenderProp('hasCounter', v));\n\t}\n\n\tpublic watchMaxLength(value?: number): void {\n\t\tmaxLengthProp.apply(value, (v) => this.setRenderProp('maxLength', v));\n\t}\n\n\tpublic watchMaxLengthBehavior(value?: MaxLengthBehaviorPropType): void {\n\t\tmaxLengthBehaviorProp.apply(value, (v) => this.setRenderProp('maxLengthBehavior', v));\n\t}\n\n\tpublic readonly setVisualRef = (el?: HTMLSpanElement): void => {\n\t\tthis.visualSpan = el;\n\t};\n\n\tpublic readonly setAriaRef = (el?: HTMLSpanElement): void => {\n\t\tthis.ariaSpan = el;\n\t};\n\n\tpublic hasCounter(): boolean {\n\t\treturn this.getRenderProp('hasCounter') === true;\n\t}\n\n\t/** A maximum with the behavior `'soft'`: the counter announces the exceeded limit instead of `maxlength` preventing it. */\n\tpublic hasSoftLimit(): boolean {\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\treturn typeof maxLength === 'number' && maxLengthBehavior === 'soft';\n\t}\n\n\t/** The native `maxlength` attribute: only a hard limit prevents longer input. */\n\tpublic getMaxLengthAttribute(): number | undefined {\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\treturn maxLengthBehavior === 'hard' ? maxLength : undefined;\n\t}\n\n\t/** The `counter` prop of `FormFieldFC`; the counter is only rendered with `hasCounter`. */\n\tpublic getCounterProps(): FormFieldFCProps['counter'] {\n\t\tif (!this.hasCounter()) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\treturn { maxLength, maxLengthBehavior, visualRef: this.setVisualRef, ariaRef: this.setAriaRef };\n\t}\n\n\t/**\n\t * The ID of the hidden character limit hint, which the control references in `aria-describedby`.\n\t * The hint only exists for a maximum without counter, because the counter announces the maximum itself.\n\t */\n\tpublic getCharacterLimitHintId(id: string): string | undefined {\n\t\treturn typeof this.getRenderProp('maxLength') === 'number' && !this.hasCounter() ? createRelatedUniqueId(id, 'character-limit-hint') : undefined;\n\t}\n\n\t/** Updates the visible span immediately and the `aria-live` span debounced. */\n\tpublic update(currentLength: number): void {\n\t\tconst limit = this.getLimit();\n\t\tthis.updateVisual(currentLength, limit);\n\t\tclearTimeout(this.debounceTimer);\n\t\tthis.debounceTimer = setTimeout(() => this.updateAria(currentLength, limit), ARIA_DEBOUNCE_MS);\n\t}\n\n\t/** Updates both spans without debounce, e.g. after the first render or a programmatic change of the limit. */\n\tpublic updateImmediate(currentLength: number): void {\n\t\tconst limit = this.getLimit();\n\t\tthis.updateVisual(currentLength, limit);\n\t\tclearTimeout(this.debounceTimer);\n\t\tthis.updateAria(currentLength, limit);\n\t}\n\n\t/**\n\t * Announces the reached hard limit again on every further typing attempt. `maxlength` blocks the\n\t * input without an `input` event, so the live region would otherwise stay silent.\n\t */\n\tpublic readonly handleKeyDown = (event: KeyboardEvent, currentLength: number): void => {\n\t\tconst { maxLength, maxLengthBehavior } = this.getLimit();\n\t\tif (maxLengthBehavior !== 'hard' || typeof maxLength !== 'number' || currentLength < maxLength) return;\n\t\tif (!isCharacterInputKey(event)) return;\n\t\tthis.retriggerAria(currentLength);\n\t};\n\n\t/** Announces the `aria-live` span again, debounced, even if its text did not change. */\n\tpublic retriggerAria(currentLength: number): void {\n\t\tif (!this.ariaSpan) return;\n\t\tconst limit = this.getLimit();\n\t\tclearTimeout(this.debounceTimer);\n\t\tthis.debounceTimer = setTimeout(() => this.updateAria(currentLength, limit, true), ARIA_DEBOUNCE_MS);\n\t}\n\n\tpublic destroy(): void {\n\t\tclearTimeout(this.debounceTimer);\n\t}\n\n\tprivate getLimit(): CounterLimit {\n\t\treturn { maxLength: this.getRenderProp('maxLength'), maxLengthBehavior: this.getRenderProp('maxLengthBehavior') };\n\t}\n\n\tprivate updateVisual(currentLength: number, { maxLength, maxLengthBehavior }: CounterLimit): void {\n\t\tif (!this.visualSpan) return;\n\t\tthis.visualSpan.innerText = getCounterVisualText(maxLengthBehavior, maxLength, currentLength);\n\t\tthis.visualSpan.classList.toggle(\n\t\t\t'kol-form-field__counter--exceeded',\n\t\t\tmaxLengthBehavior === 'soft' && typeof maxLength === 'number' && currentLength > maxLength,\n\t\t);\n\t}\n\n\tprivate updateAria(currentLength: number, { maxLength, maxLengthBehavior }: CounterLimit, forceReannounce = false): void {\n\t\tif (!this.ariaSpan) return;\n\t\tlet text = [getCounterAriaText(maxLengthBehavior, maxLength, currentLength), getCounterMaxText(maxLengthBehavior, maxLength, currentLength)]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ');\n\n\t\tif (forceReannounce) {\n\t\t\t// `aria-live` only announces a changed text. A repeated attempt produces the same text, so a\n\t\t\t// no-break space is appended on every other call to make it differ.\n\t\t\tthis.reannounceToggle = !this.reannounceToggle;\n\t\t\tif (this.reannounceToggle) {\n\t\t\t\ttext += REANNOUNCE_MARKER;\n\t\t\t}\n\t\t}\n\n\t\tthis.ariaSpan.innerText = text;\n\t}\n}\n"],"names":["createPropDefinition","normalizeBoolean","normalizeNumber","normalizeString","isEnumOption","translate","BaseBehavior","createRelatedUniqueId"],"mappings":";;;;;;;;;;;AAWO,MAAM,cAAc,GAAGA,qCAAoB,CAAiB,YAAY,EAAE,KAAK,EAAEC,iCAAgB,CAAC;;ACKlG,MAAM,aAAa,GAAGD,qCAAoB,CAChD,WAAW,EACX,SAA8B,EAC9BE,gCAAe,EACf,CAAC,KAAK,KAAK,KAAK,KAAK,SAAS,IAAI,KAAK,IAAI,CAAC,CAC5C;;AChBD,MAAM,2BAA2B,GAAyC,CAAC,MAAM,EAAE,MAAM,CAAC;AAW1F,SAAS,0BAA0B,CAAC,KAAc,EAAA;AACjD,IAAA,MAAM,GAAG,GAAGC,gCAAe,CAAC,KAAK,CAAC;AAClC,IAAA,IAAIC,6BAAY,CAAC,GAAG,EAAE,2BAA2B,CAAC,EAAE;AACnD,QAAA,OAAO,GAAG;;AAEX,IAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,CAAA,CAAE,CAAC;AACvD;AAEO,MAAM,qBAAqB,GAAGJ,qCAAoB,CAAwB,mBAAmB,EAAE,MAAM,EAAE,0BAA0B,CAAC;;ACrBlI,MAAM,kBAAkB,GAAG;AACjC,IAAA,QAAQ,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,qBAAqB,CAAC;CAC5B;;ACF9B,MAAM,oBAAoB,GAAG,CAAC,iBAA4C,EAAE,SAA6B,EAAE,aAAqB,KAAY;AAClJ,IAAA,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;AAClC,QAAA,OAAOK,cAAS,CAAC,+BAA+B,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,aAAa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AC,IAAI,CAAC,gBAAgB;AAC9C,YAAA,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,IAAI,IAAI,iBAAiB;;;AAI3B,QAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAI;;AAE/B;;;;"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
var common = require('./common-B9-LvLNa.js');
|
|
7
7
|
var baseWebComponent = require('./base-web-component-DK5Y-vq5.js');
|
|
8
|
-
var contrast = require('./contrast-
|
|
8
|
+
var contrast = require('./contrast-CrL_sMV6.js');
|
|
9
9
|
|
|
10
10
|
const HEX_REGEX = /^#((\d|[a-f]){8}|(\d|[a-f]){6}|(\d|[a-f]){3,4})$/i;
|
|
11
11
|
function isHexString(value) {
|
|
@@ -47,6 +47,6 @@ const colorProp = baseWebComponent.createPropDefinition('color', {
|
|
|
47
47
|
}, normalizer, validator);
|
|
48
48
|
|
|
49
49
|
exports.colorProp = colorProp;
|
|
50
|
-
//# sourceMappingURL=color-
|
|
50
|
+
//# sourceMappingURL=color-CZiNkZFM.js.map
|
|
51
51
|
|
|
52
|
-
//# sourceMappingURL=color-
|
|
52
|
+
//# sourceMappingURL=color-CZiNkZFM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-
|
|
1
|
+
{"version":3,"file":"color-CZiNkZFM.js","sources":["src/internal/props/color.ts"],"sourcesContent":["import type { ColorPair } from '../../schema';\nimport { createContrastColorPair, parseJson } from '../../schema';\nimport { createPropDefinition, type Prop } from './helpers/factory';\n\n/**\n * Color prop for foreground/background color pairs\n *\n * Description:\n * Defines a color pair consisting of a foreground (text) and background color. Both colors\n * must be provided as valid hex values. The component automatically calculates contrast-safe\n * color pairs to ensure readability.\n *\n * Usage (according to WCAG 2.1):\n * - Single hex value: color=\"#003366\" (background; foreground is auto-calculated for contrast)\n * - Color pair object: color={ backgroundColor: \"#003366\", foregroundColor: \"#ffffff\" }\n * - All color combinations must meet WCAG contrast requirements:\n * - Normal text: minimum contrast ratio 4.5:1 (WCAG 1.4.3 Contrast Minimum, Level AA)\n * - Large text (≥18pt or ≥14pt bold): minimum contrast ratio 3:1\n * - Enhanced: minimum contrast ratio 7:1 for normal text (WCAG 1.4.6 Contrast Enhanced, Level AAA)\n * - Non-text elements (icons, borders) require a minimum contrast ratio of 3:1 (WCAG 1.4.11 Non-text Contrast)\n * - Color must not be the only means of conveying information (WCAG 1.4.1 Use of Color)\n *\n * @see https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html\n * @see https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html\n * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html\n * @see https://www.w3.org/WAI/WCAG21/Understanding/use-of-color.html\n */\nconst HEX_REGEX = /^#((\\d|[a-f]){8}|(\\d|[a-f]){6}|(\\d|[a-f]){3,4})$/i;\nfunction isHexString(value: string): boolean {\n\treturn HEX_REGEX.test(value);\n}\n\nfunction normalizer(value: unknown): ColorPair {\n\tif (typeof value === 'string' && isHexString(value)) {\n\t\tconst colors = createContrastColorPair(value);\n\t\treturn {\n\t\t\tbackgroundColor: colors.background,\n\t\t\tforegroundColor: colors.foreground,\n\t\t};\n\t}\n\t// The prop is declared `Stringified<PropColor>`, so a color pair also arrives as a JSON string\n\t// whenever it is set through an HTML attribute rather than a JS property.\n\tconst candidate = typeof value === 'string' ? parseJson<ColorPair>(value) : value;\n\tif (typeof candidate === 'object' && candidate) {\n\t\tconst colorPair = candidate as ColorPair;\n\t\tif (\n\t\t\ttypeof colorPair.backgroundColor === 'string' &&\n\t\t\ttypeof colorPair.foregroundColor === 'string' &&\n\t\t\tisHexString(colorPair.backgroundColor) &&\n\t\t\tisHexString(colorPair.foregroundColor)\n\t\t) {\n\t\t\tconst colors = createContrastColorPair({\n\t\t\t\tbackground: colorPair.backgroundColor,\n\t\t\t\tforeground: colorPair.foregroundColor,\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tbackgroundColor: colors.background,\n\t\t\t\tforegroundColor: colors.foreground,\n\t\t\t};\n\t\t}\n\t}\n\tthrow new Error(`Invalid color ${value as string}`);\n}\n\nfunction validator(value: ColorPair) {\n\treturn isHexString(value.foregroundColor) && isHexString(value.backgroundColor);\n}\n\nexport type ColorProp = Prop<'color', ColorPair | string, ColorPair>;\nexport const colorProp = createPropDefinition<ColorProp>(\n\t'color',\n\t{\n\t\tbackgroundColor: '#d3d3d3',\n\t\tforegroundColor: '#3f3f3f',\n\t},\n\tnormalizer,\n\tvalidator,\n);\n"],"names":["createContrastColorPair","parseJson","createPropDefinition"],"mappings":";;;;;;;;;AA2BA,MAAM,SAAS,GAAG,mDAAmD;AACrE,SAAS,WAAW,CAAC,KAAa,EAAA;AACjC,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B;AAEA,SAAS,UAAU,CAAC,KAAc,EAAA;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE;AACpD,QAAA,MAAM,MAAM,GAAGA,gCAAuB,CAAC,KAAK,CAAC;QAC7C,OAAO;YACN,eAAe,EAAE,MAAM,CAAC,UAAU;YAClC,eAAe,EAAE,MAAM,CAAC,UAAU;SAClC;;AAIF,IAAA,MAAM,SAAS,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAGC,gBAAS,CAAY,KAAK,CAAC,GAAG,KAAK;AACjF,IAAA,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,EAAE;QAC/C,MAAM,SAAS,GAAG,SAAsB;AACxC,QAAA,IACC,OAAO,SAAS,CAAC,eAAe,KAAK,QAAQ;AAC7C,YAAA,OAAO,SAAS,CAAC,eAAe,KAAK,QAAQ;AAC7C,YAAA,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC;AACtC,YAAA,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC,EACrC;YACD,MAAM,MAAM,GAAGD,gCAAuB,CAAC;gBACtC,UAAU,EAAE,SAAS,CAAC,eAAe;gBACrC,UAAU,EAAE,SAAS,CAAC,eAAe;AACrC,aAAA,CAAC;YACF,OAAO;gBACN,eAAe,EAAE,MAAM,CAAC,UAAU;gBAClC,eAAe,EAAE,MAAM,CAAC,UAAU;aAClC;;;AAGH,IAAA,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAe,CAAA,CAAE,CAAC;AACpD;AAEA,SAAS,SAAS,CAAC,KAAgB,EAAA;AAClC,IAAA,OAAO,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC;AAChF;AAGa,MAAA,SAAS,GAAGE,qCAAoB,CAC5C,OAAO,EACP;AACC,IAAA,eAAe,EAAE,SAAS;AAC1B,IAAA,eAAe,EAAE,SAAS;AAC1B,CAAA,EACD,UAAU,EACV,SAAS;;;;"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
var tslib_es6 = require('./tslib.es6-Cm0ytgPY.js');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-RAfZF5x0.js');
|
|
8
8
|
var bemRegistry = require('./bem-registry-BDVdt6ar.js');
|
|
9
9
|
var clsx = require('./clsx-Bm_HQUnh.js');
|
|
10
10
|
|
|
@@ -18,6 +18,6 @@ const IconFC = (_a) => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
exports.IconFC = IconFC;
|
|
21
|
-
//# sourceMappingURL=component-
|
|
21
|
+
//# sourceMappingURL=component-3EZdZbDH.js.map
|
|
22
22
|
|
|
23
|
-
//# sourceMappingURL=component-
|
|
23
|
+
//# sourceMappingURL=component-3EZdZbDH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-
|
|
1
|
+
{"version":3,"file":"component-3EZdZbDH.js","sources":["src/internal/functional-components/icon/component.tsx"],"sourcesContent":["import type { FunctionalComponent as FC } from '@stencil/core';\nimport { h } from '@stencil/core';\n\nimport { bem } from '../../../schema/bem-registry';\nimport clsx from '../../../utils/clsx';\nimport type { FunctionalComponentProps } from '../generic-types';\nimport type { IconApi } from './api';\n\nconst iconBem = bem.forBlock('kol-icon');\nconst BEM_CLASS_ICON = iconBem();\nconst BEM_CLASS_ICON__ICON = iconBem('icon');\n\nexport const IconFC: FC<FunctionalComponentProps<IconApi>> = ({ class: classNames, icons, label, ...htmlAttributes }) => {\n\t// label is always a normalized string ('' when unset — see labelProp definition)\n\tconst hasAriaLabel = label?.length > 0;\n\treturn (\n\t\t<i\n\t\t\t{...htmlAttributes}\n\t\t\t/**\n\t\t\t * Die Auszeichnung `aria-hidden` ist eigentlich nicht erforderlich, da die aktuellen\n\t\t\t * Screenreader, wie NVDA und JAWS, es auch ohne `aria-hidden` nicht vorlesen.\n\t\t\t *\n\t\t\t * Referenz: https://www.w3.org/TR/wai-aria/states_and_properties#aria-hidden\n\t\t\t */\n\t\t\taria-hidden={hasAriaLabel ? undefined : 'true'}\n\t\t\taria-label={hasAriaLabel ? label : undefined}\n\t\t\tclass={clsx(BEM_CLASS_ICON, BEM_CLASS_ICON__ICON, icons, classNames)}\n\t\t\trole={hasAriaLabel ? 'img' : 'presentation'}\n\t\t/>\n\t);\n};\n"],"names":["bem","__rest","h","clsx"],"mappings":";;;;;;;;;;AAQA,MAAM,OAAO,GAAGA,eAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;AACxC,MAAM,cAAc,GAAG,OAAO,EAAE;AAChC,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;AAE/B,MAAA,MAAM,GAA0C,CAAC,EAAsD,KAAI;IAA1D,IAAA,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAA,GAAA,EAAqB,EAAhB,cAAc,GAApDC,gBAAA,CAAA,EAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,OAAA,CAAsD,CAAF;IAEjH,MAAM,YAAY,GAAG,CAAA,KAAK,KAAL,IAAA,IAAA,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,MAAM,IAAG,CAAC;AACtC,IAAA,QACCC,+BACK,cAAc,EAAA,EAAA,aAAA,EAOL,YAAY,GAAG,SAAS,GAAG,MAAM,EAAA,YAAA,EAClC,YAAY,GAAG,KAAK,GAAG,SAAS,EAC5C,KAAK,EAAEC,SAAI,CAAC,cAAc,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,CAAC,EACpE,IAAI,EAAE,YAAY,GAAG,KAAK,GAAG,cAAc,EAC1C,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-RAfZF5x0.js');
|
|
7
7
|
var i18n = require('./i18n-UGaB-Dwg.js');
|
|
8
8
|
var bemRegistry = require('./bem-registry-BDVdt6ar.js');
|
|
9
|
-
var component = require('./component-
|
|
9
|
+
var component = require('./component-Du98sklA.js');
|
|
10
10
|
|
|
11
11
|
const spinBem = bemRegistry.bem.forBlock('kol-spin');
|
|
12
12
|
const BEM_CLASS_SPIN__LOADER = spinBem('loader');
|
|
@@ -27,6 +27,6 @@ const SpinFC = (props) => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
exports.SpinFC = SpinFC;
|
|
30
|
-
//# sourceMappingURL=component-
|
|
30
|
+
//# sourceMappingURL=component-B96XYPtn.js.map
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=component-
|
|
32
|
+
//# sourceMappingURL=component-B96XYPtn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-
|
|
1
|
+
{"version":3,"file":"component-B96XYPtn.js","sources":["src/internal/functional-components/spin/component.tsx"],"sourcesContent":["import type { FunctionalComponent as FC } from '@stencil/core';\nimport { Fragment, h } from '@stencil/core';\n\nimport { translate } from '../../../i18n';\nimport { bem } from '../../../schema/bem-registry';\nimport type { SpinVariantType } from '../../props';\nimport { BemRootNodeFC } from '../bem-root-node/component';\nimport type { FunctionalComponentProps } from '../generic-types';\nimport type { SpinApi } from './api';\n\nconst spinBem = bem.forBlock('kol-spin');\nconst BEM_CLASS_SPIN__LOADER = spinBem('loader');\nconst DOT_ELEMENTS = ['1', '2', '3', 'neutral'] as const;\n\nfunction renderSpinVariant(variant: SpinVariantType): unknown {\n\tswitch (variant) {\n\t\tcase 'cycle':\n\t\t\treturn <span class={BEM_CLASS_SPIN__LOADER}></span>;\n\t\tcase 'none':\n\t\t\treturn <slot name=\"expert\"></slot>;\n\t\tdefault:\n\t\t\treturn DOT_ELEMENTS.map((element) => <span class={spinBem('spinner-element', { [element]: true })}></span>);\n\t}\n}\n\nexport const SpinFC: FC<FunctionalComponentProps<SpinApi>> = (props) => {\n\tconst { show, label, variant } = props;\n\n\treturn (\n\t\t<BemRootNodeFC block=\"kol-spin\">\n\t\t\t{show ? (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<span class={spinBem('spinner', { [variant]: true })}>{renderSpinVariant(variant)}</span>\n\t\t\t\t\t<span aria-busy=\"true\" class=\"visually-hidden\" role=\"alert\">\n\t\t\t\t\t\t{label || translate('kol-action-running')}\n\t\t\t\t\t</span>\n\t\t\t\t</Fragment>\n\t\t\t) : (\n\t\t\t\t<span aria-busy=\"false\" class=\"visually-hidden\" role=\"alert\">\n\t\t\t\t\t{label || translate('kol-action-done')}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</BemRootNodeFC>\n\t);\n};\n"],"names":["bem","h","BemRootNodeFC","Fragment","translate"],"mappings":";;;;;;;;;;AAUA,MAAM,OAAO,GAAGA,eAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;AACxC,MAAM,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChD,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,CAAU;AAExD,SAAS,iBAAi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
|
|
6
6
|
var tslib_es6 = require('./tslib.es6-Cm0ytgPY.js');
|
|
7
|
-
var index = require('./index-
|
|
8
|
-
var Heading = require('./Heading-
|
|
7
|
+
var index = require('./index-RAfZF5x0.js');
|
|
8
|
+
var Heading = require('./Heading-yiwXjRrz.js');
|
|
9
9
|
var i18n = require('./i18n-UGaB-Dwg.js');
|
|
10
10
|
var bemRegistry = require('./bem-registry-BDVdt6ar.js');
|
|
11
11
|
var clsx = require('./clsx-Bm_HQUnh.js');
|
|
12
|
-
var component$2 = require('./component-
|
|
13
|
-
var component$1 = require('./component-
|
|
14
|
-
var component = require('./component-
|
|
12
|
+
var component$2 = require('./component-Du98sklA.js');
|
|
13
|
+
var component$1 = require('./component-CPVFCnaN.js');
|
|
14
|
+
var component = require('./component-3EZdZbDH.js');
|
|
15
15
|
|
|
16
16
|
const alertBem$1 = bemRegistry.bem.forBlock('kol-alert');
|
|
17
17
|
const BEM_CLASS_ALERT__ICON = alertBem$1('icon');
|
|
@@ -62,6 +62,6 @@ const AlertFC = (props, children) => {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
exports.AlertFC = AlertFC;
|
|
65
|
-
//# sourceMappingURL=component-
|
|
65
|
+
//# sourceMappingURL=component-BUCx7i5o.js.map
|
|
66
66
|
|
|
67
|
-
//# sourceMappingURL=component-
|
|
67
|
+
//# sourceMappingURL=component-BUCx7i5o.js.map
|