@public-ui/components 4.5.0-rc.6 → 4.5.0-rc.7
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-d30Feghg.js} +3 -3
- package/dist/cjs/{Heading-Bck3PFpH.js.map → Heading-d30Feghg.js.map} +1 -1
- package/dist/cjs/{api-BcNl2vZm.js → api-C8ZkIyx7.js} +8 -8
- package/dist/cjs/{api-BcNl2vZm.js.map → api-C8ZkIyx7.js.map} +1 -1
- package/dist/cjs/{api-LP3gnw7U.js → api-CRSjJs8P.js} +12 -12
- package/dist/cjs/{api-LP3gnw7U.js.map → api-CRSjJs8P.js.map} +1 -1
- package/dist/cjs/{app-globals-oR-jEiju.js → app-globals-B6wB2cXk.js} +4 -4
- package/dist/cjs/{app-globals-oR-jEiju.js.map → app-globals-B6wB2cXk.js.map} +1 -1
- package/dist/cjs/{base-CwXJywKD.js → base-C3MDHUog.js} +4 -4
- package/dist/cjs/{base-CwXJywKD.js.map → base-C3MDHUog.js.map} +1 -1
- package/dist/cjs/{base-DbfvhKRa.js → base-CyQnTxi6.js} +4 -4
- package/dist/cjs/{base-DbfvhKRa.js.map → base-CyQnTxi6.js.map} +1 -1
- package/dist/cjs/{base-DaK2F3pq.js → base-DgUZAiNc.js} +16 -16
- package/dist/cjs/{base-DaK2F3pq.js.map → base-DgUZAiNc.js.map} +1 -1
- package/dist/cjs/{base-BDGmLWVj.js → base-LmwA5h1k.js} +5 -5
- package/dist/cjs/{base-BDGmLWVj.js.map → base-LmwA5h1k.js.map} +1 -1
- package/dist/cjs/{base-web-component-C8MLLGxi.js → base-web-component-C-CwpVZw.js} +16 -9
- package/dist/cjs/base-web-component-C-CwpVZw.js.map +1 -0
- package/dist/cjs/{base-web-component-mmgXJMg0.js → base-web-component-d2k3Mc9P.js} +7 -7
- package/dist/cjs/{base-web-component-mmgXJMg0.js.map → base-web-component-d2k3Mc9P.js.map} +1 -1
- package/dist/cjs/{behavior-DWqrO2yi.js → behavior-C-BdOoSN.js} +3 -3
- package/dist/cjs/{behavior-DWqrO2yi.js.map → behavior-C-BdOoSN.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-GfDUM7Um.js → component-B1kzY-J5.js} +4 -4
- package/dist/cjs/{component-GfDUM7Um.js.map → component-B1kzY-J5.js.map} +1 -1
- package/dist/cjs/{component-BT86Nj6R.js → component-B1zMXSkZ.js} +5 -5
- package/dist/cjs/{component-BT86Nj6R.js.map → component-B1zMXSkZ.js.map} +1 -1
- package/dist/cjs/{component-X_thXnkE.js → component-BHDnSaCH.js} +3 -3
- package/dist/cjs/{component-X_thXnkE.js.map → component-BHDnSaCH.js.map} +1 -1
- package/dist/cjs/{component-1NrcvQzp.js → component-BIz_gAas.js} +7 -7
- package/dist/cjs/{component-1NrcvQzp.js.map → component-BIz_gAas.js.map} +1 -1
- package/dist/cjs/{component-ZPvcKmPR.js → component-BairlFHi.js} +3 -3
- package/dist/cjs/{component-ZPvcKmPR.js.map → component-BairlFHi.js.map} +1 -1
- package/dist/cjs/{component-xIM903qi.js → component-CmyhDJ0r.js} +3 -3
- package/dist/cjs/{component-xIM903qi.js.map → component-CmyhDJ0r.js.map} +1 -1
- package/dist/cjs/{component-DNDfYzXZ.js → component-D2kI8uwF.js} +5 -5
- package/dist/cjs/{component-DNDfYzXZ.js.map → component-D2kI8uwF.js.map} +1 -1
- package/dist/cjs/{component-CmvG-auD.js → component-D33lYKYT.js} +3 -3
- package/dist/cjs/{component-CmvG-auD.js.map → component-D33lYKYT.js.map} +1 -1
- package/dist/cjs/{component-uHDfV5D8.js → component-DITtC2F9.js} +7 -7
- package/dist/cjs/{component-uHDfV5D8.js.map → component-DITtC2F9.js.map} +1 -1
- package/dist/cjs/{component-DuPEYx7z.js → component-DaAVlb5U.js} +4 -4
- package/dist/cjs/{component-DuPEYx7z.js.map → component-DaAVlb5U.js.map} +1 -1
- package/dist/cjs/{component-CtNPdMS0.js → component-KT0MKnL5.js} +5 -5
- package/dist/cjs/{component-CtNPdMS0.js.map → component-KT0MKnL5.js.map} +1 -1
- package/dist/cjs/{component-o3s7XplI.js → component-_jdRFw0Y.js} +4 -4
- package/dist/cjs/{component-o3s7XplI.js.map → component-_jdRFw0Y.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-B1bWgxrQ.js} +3 -3
- package/dist/cjs/{dev.utils-BjrG4FNf.js.map → dev.utils-B1bWgxrQ.js.map} +1 -1
- package/dist/cjs/{devtools-D_afWgpU.js → devtools-DlcIXbRm.js} +4 -4
- package/dist/cjs/{devtools-D_afWgpU.js.map → devtools-DlcIXbRm.js.map} +1 -1
- package/dist/cjs/{field-control-DAHkvYr4.js → field-control-D0lryu2-.js} +8 -8
- package/dist/cjs/{field-control-DAHkvYr4.js.map → field-control-D0lryu2-.js.map} +1 -1
- package/dist/cjs/{group-DHYxVn2x.js → group-DIGY9sM6.js} +5 -5
- package/dist/cjs/{group-DHYxVn2x.js.map → group-DIGY9sM6.js.map} +1 -1
- package/dist/cjs/{index-BnEus4Y9.js → index-qcrGfEY6.js} +3 -3
- package/dist/cjs/{index-BnEus4Y9.js.map → index-qcrGfEY6.js.map} +1 -1
- package/dist/cjs/{input-eDaEE80n.js → input-BjNjOSo5.js} +5 -5
- package/dist/cjs/{input-eDaEE80n.js.map → input-BjNjOSo5.js.map} +1 -1
- package/dist/cjs/{input-container-Cye4qL9S.js → input-container-DghKiuUH.js} +7 -7
- package/dist/cjs/{input-container-Cye4qL9S.js.map → input-container-DghKiuUH.js.map} +1 -1
- package/dist/cjs/{item-C0yzJQUg.js → item-BKz8BDg2.js} +4 -4
- package/dist/cjs/{item-C0yzJQUg.js.map → item-BKz8BDg2.js.map} +1 -1
- package/dist/cjs/{item-wz0gBnmK.js → item-BMB6SaVm.js} +4 -4
- package/dist/cjs/{item-wz0gBnmK.js.map → item-BMB6SaVm.js.map} +1 -1
- package/dist/cjs/{item-Dflr47KV.js → item-CFojolE7.js} +8 -8
- package/dist/cjs/{item-Dflr47KV.js.map → item-CFojolE7.js.map} +1 -1
- package/dist/cjs/{item-BSdQbEav.js → item-DdnTb-BP.js} +3 -3
- package/dist/cjs/{item-BSdQbEav.js.map → item-DdnTb-BP.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-pAyNSZMT.js} +3 -3
- package/dist/cjs/{resolve-props-DOU1VJNL.js.map → resolve-props-pAyNSZMT.js.map} +1 -1
- package/dist/cjs/{scroll-lock-C6dUw4on.js → scroll-lock-CNwobwd2.js} +3 -3
- package/dist/cjs/{scroll-lock-C6dUw4on.js.map → scroll-lock-CNwobwd2.js.map} +1 -1
- package/dist/cjs/{suggestions-0hcm13gT.js → suggestions-D4TMMZSv.js} +4 -4
- package/dist/cjs/{suggestions-0hcm13gT.js.map → suggestions-D4TMMZSv.js.map} +1 -1
- package/dist/cjs/test-component.cjs.entry.js +1 -1
- package/dist/cjs/{toggle-handler-kOflG5om.js → toggle-handler-mIB8gvse.js} +5 -5
- package/dist/cjs/{toggle-handler-kOflG5om.js.map → toggle-handler-mIB8gvse.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-NHB1reiQ.js} +3 -3
- package/dist/esm/{Heading-DXl16qig.js.map → Heading-NHB1reiQ.js.map} +1 -1
- package/dist/esm/{api-C8TfIYlY.js → api-BAEPnyL7.js} +12 -12
- package/dist/{kolibri/api-C8TfIYlY.js.map → esm/api-BAEPnyL7.js.map} +1 -1
- package/dist/esm/{api-BA-AFr5H.js → api-CagcODCX.js} +8 -8
- package/dist/{kolibri/api-BA-AFr5H.js.map → esm/api-CagcODCX.js.map} +1 -1
- package/dist/esm/{app-globals-lFdBwFG2.js → app-globals-CwlOH1sO.js} +4 -4
- package/dist/esm/{app-globals-lFdBwFG2.js.map → app-globals-CwlOH1sO.js.map} +1 -1
- package/dist/esm/{base-BpqjfzG1.js → base-BFU17cMm.js} +16 -16
- package/dist/{kolibri/base-BpqjfzG1.js.map → esm/base-BFU17cMm.js.map} +1 -1
- package/dist/esm/{base-D8GcFhvD.js → base-BpKxLJ6r.js} +4 -4
- package/dist/{kolibri/base-D8GcFhvD.js.map → esm/base-BpKxLJ6r.js.map} +1 -1
- package/dist/esm/{base-DiSQvfGU.js → base-Cm_c8klt.js} +5 -5
- package/dist/esm/{base-DiSQvfGU.js.map → base-Cm_c8klt.js.map} +1 -1
- package/dist/esm/{base-B5F8ROuQ.js → base-DitGpYOV.js} +4 -4
- package/dist/{kolibri/base-B5F8ROuQ.js.map → esm/base-DitGpYOV.js.map} +1 -1
- package/dist/esm/{base-web-component-CkaKv7O0.js → base-web-component-6J5sCsnZ.js} +16 -9
- package/dist/esm/base-web-component-6J5sCsnZ.js.map +1 -0
- package/dist/esm/{base-web-component-BozlJoj7.js → base-web-component-BFCVvyYG.js} +7 -7
- package/dist/esm/{base-web-component-BozlJoj7.js.map → base-web-component-BFCVvyYG.js.map} +1 -1
- package/dist/esm/{behavior-BuNqmjz8.js → behavior-CH_2MMuX.js} +3 -3
- package/dist/esm/{behavior-BuNqmjz8.js.map → behavior-CH_2MMuX.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-C9DexidK.js → component-BF8FPuIW.js} +3 -3
- package/dist/esm/{component-C9DexidK.js.map → component-BF8FPuIW.js.map} +1 -1
- package/dist/esm/{component-Da5dJMKj.js → component-Ba4gjLBG.js} +5 -5
- package/dist/{kolibri/component-Da5dJMKj.js.map → esm/component-Ba4gjLBG.js.map} +1 -1
- package/dist/esm/{component-BjH8s4-t.js → component-BpOMe842.js} +3 -3
- package/dist/{kolibri/component-BjH8s4-t.js.map → esm/component-BpOMe842.js.map} +1 -1
- package/dist/esm/{component-BxKN0JbT.js → component-C3sXiwbS.js} +3 -3
- package/dist/esm/{component-BxKN0JbT.js.map → component-C3sXiwbS.js.map} +1 -1
- package/dist/esm/{component-Bd7PXqOG.js → component-C5BFsKau.js} +5 -5
- package/dist/esm/{component-Bd7PXqOG.js.map → component-C5BFsKau.js.map} +1 -1
- package/dist/esm/{component-C3aqLFK2.js → component-CBpYh2q-.js} +7 -7
- package/dist/esm/{component-C3aqLFK2.js.map → component-CBpYh2q-.js.map} +1 -1
- package/dist/esm/{component-D_58mw87.js → component-C_d54ujF.js} +4 -4
- package/dist/{kolibri/component-D_58mw87.js.map → esm/component-C_d54ujF.js.map} +1 -1
- package/dist/esm/{component-xrrwVuiI.js → component-CvCfEqSE.js} +4 -4
- package/dist/esm/{component-xrrwVuiI.js.map → component-CvCfEqSE.js.map} +1 -1
- package/dist/esm/{component-CWGVLsSH.js → component-DZbJLUju.js} +4 -4
- package/dist/{kolibri/component-CWGVLsSH.js.map → esm/component-DZbJLUju.js.map} +1 -1
- package/dist/esm/{component-BKOep2WQ.js → component-Dg6TIbeY.js} +5 -5
- package/dist/{kolibri/component-BKOep2WQ.js.map → esm/component-Dg6TIbeY.js.map} +1 -1
- package/dist/esm/{component-DD5QqT5m.js → component-Do9rjnte.js} +7 -7
- package/dist/{kolibri/component-DD5QqT5m.js.map → esm/component-Do9rjnte.js.map} +1 -1
- package/dist/esm/{component-De6Do_gt.js → component-DzoBgfR4.js} +3 -3
- package/dist/esm/{component-De6Do_gt.js.map → component-DzoBgfR4.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-CJMVCYWh.js} +3 -3
- package/dist/esm/{dev.utils-CYtV9X0K.js.map → dev.utils-CJMVCYWh.js.map} +1 -1
- package/dist/esm/{devtools-B0qRaQdp.js → devtools-rRHULXVr.js} +4 -4
- package/dist/{kolibri/devtools-B0qRaQdp.js.map → esm/devtools-rRHULXVr.js.map} +1 -1
- package/dist/esm/{field-control-C5hjw2Rb.js → field-control-DXxCMXvx.js} +8 -8
- package/dist/{kolibri/field-control-C5hjw2Rb.js.map → esm/field-control-DXxCMXvx.js.map} +1 -1
- package/dist/esm/{group-2hP8qbvk.js → group-CI4sSgiu.js} +5 -5
- package/dist/esm/{group-2hP8qbvk.js.map → group-CI4sSgiu.js.map} +1 -1
- package/dist/esm/{index-DsCeQ9Ys.js → index-DQdQBwMc.js} +3 -3
- package/dist/{kolibri/index-DsCeQ9Ys.js.map → esm/index-DQdQBwMc.js.map} +1 -1
- package/dist/esm/{input-Dp5NBocQ.js → input-CDtJZ2sy.js} +5 -5
- package/dist/esm/{input-Dp5NBocQ.js.map → input-CDtJZ2sy.js.map} +1 -1
- package/dist/esm/{input-container-QA8-0_0p.js → input-container-DROwwh7_.js} +7 -7
- package/dist/esm/{input-container-QA8-0_0p.js.map → input-container-DROwwh7_.js.map} +1 -1
- package/dist/esm/{item-CaxJw3ad.js → item-C6p5wW-z.js} +4 -4
- package/dist/esm/{item-CaxJw3ad.js.map → item-C6p5wW-z.js.map} +1 -1
- package/dist/esm/{item-CXyolUj2.js → item-CHP-bw8Q.js} +4 -4
- package/dist/{kolibri/item-CXyolUj2.js.map → esm/item-CHP-bw8Q.js.map} +1 -1
- package/dist/esm/{item-DY0fVVnj.js → item-Cbi_ZY6o.js} +3 -3
- package/dist/esm/{item-DY0fVVnj.js.map → item-Cbi_ZY6o.js.map} +1 -1
- package/dist/esm/{item-BIjqEkyy.js → item-ZjrNIhfW.js} +8 -8
- package/dist/{kolibri/item-BIjqEkyy.js.map → esm/item-ZjrNIhfW.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-CjBvvXId.js} +3 -3
- package/dist/{kolibri/resolve-props-DJxTzf-G.js.map → esm/resolve-props-CjBvvXId.js.map} +1 -1
- package/dist/esm/{scroll-lock-BN6ZnBdc.js → scroll-lock-6SV-XFXR.js} +3 -3
- package/dist/{kolibri/scroll-lock-BN6ZnBdc.js.map → esm/scroll-lock-6SV-XFXR.js.map} +1 -1
- package/dist/esm/{suggestions-DlpHvEGv.js → suggestions-BYMmW1aV.js} +4 -4
- package/dist/esm/{suggestions-DlpHvEGv.js.map → suggestions-BYMmW1aV.js.map} +1 -1
- package/dist/esm/test-component.entry.js +1 -1
- package/dist/esm/{toggle-handler-Xex3lIll.js → toggle-handler-D-yalcds.js} +5 -5
- package/dist/{kolibri/toggle-handler-Xex3lIll.js.map → esm/toggle-handler-D-yalcds.js.map} +1 -1
- package/dist/kolibri/{Heading-DXl16qig.js → Heading-NHB1reiQ.js} +2 -2
- package/dist/kolibri/{Heading-DXl16qig.js.map → Heading-NHB1reiQ.js.map} +1 -1
- package/dist/kolibri/api-BAEPnyL7.js +5 -0
- package/dist/{esm/api-C8TfIYlY.js.map → kolibri/api-BAEPnyL7.js.map} +1 -1
- package/dist/kolibri/api-CagcODCX.js +5 -0
- package/dist/{esm/api-BA-AFr5H.js.map → kolibri/api-CagcODCX.js.map} +1 -1
- package/dist/kolibri/app-globals-CwlOH1sO.js +5 -0
- package/dist/kolibri/{app-globals-lFdBwFG2.js.map → app-globals-CwlOH1sO.js.map} +1 -1
- package/dist/kolibri/base-BFU17cMm.js +5 -0
- package/dist/{esm/base-BpqjfzG1.js.map → kolibri/base-BFU17cMm.js.map} +1 -1
- package/dist/kolibri/{base-D8GcFhvD.js → base-BpKxLJ6r.js} +2 -2
- package/dist/{esm/base-D8GcFhvD.js.map → kolibri/base-BpKxLJ6r.js.map} +1 -1
- package/dist/kolibri/{base-DiSQvfGU.js → base-Cm_c8klt.js} +2 -2
- package/dist/kolibri/{base-DiSQvfGU.js.map → base-Cm_c8klt.js.map} +1 -1
- package/dist/kolibri/{base-B5F8ROuQ.js → base-DitGpYOV.js} +2 -2
- package/dist/{esm/base-B5F8ROuQ.js.map → kolibri/base-DitGpYOV.js.map} +1 -1
- package/dist/kolibri/base-web-component-6J5sCsnZ.js +5 -0
- package/dist/kolibri/base-web-component-6J5sCsnZ.js.map +1 -0
- package/dist/kolibri/{base-web-component-BozlJoj7.js → base-web-component-BFCVvyYG.js} +2 -2
- package/dist/kolibri/{base-web-component-BozlJoj7.js.map → base-web-component-BFCVvyYG.js.map} +1 -1
- package/dist/kolibri/{behavior-BuNqmjz8.js → behavior-CH_2MMuX.js} +2 -2
- package/dist/kolibri/{behavior-BuNqmjz8.js.map → behavior-CH_2MMuX.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-C9DexidK.js → component-BF8FPuIW.js} +2 -2
- package/dist/kolibri/{component-C9DexidK.js.map → component-BF8FPuIW.js.map} +1 -1
- package/dist/kolibri/component-Ba4gjLBG.js +5 -0
- package/dist/{esm/component-Da5dJMKj.js.map → kolibri/component-Ba4gjLBG.js.map} +1 -1
- package/dist/kolibri/{component-BjH8s4-t.js → component-BpOMe842.js} +2 -2
- package/dist/{esm/component-BjH8s4-t.js.map → kolibri/component-BpOMe842.js.map} +1 -1
- package/dist/kolibri/component-C3sXiwbS.js +5 -0
- package/dist/kolibri/{component-BxKN0JbT.js.map → component-C3sXiwbS.js.map} +1 -1
- package/dist/kolibri/component-C5BFsKau.js +5 -0
- package/dist/kolibri/{component-Bd7PXqOG.js.map → component-C5BFsKau.js.map} +1 -1
- package/dist/kolibri/component-CBpYh2q-.js +5 -0
- package/dist/kolibri/{component-C3aqLFK2.js.map → component-CBpYh2q-.js.map} +1 -1
- package/dist/kolibri/{component-D_58mw87.js → component-C_d54ujF.js} +2 -2
- package/dist/{esm/component-D_58mw87.js.map → kolibri/component-C_d54ujF.js.map} +1 -1
- package/dist/kolibri/component-CvCfEqSE.js +5 -0
- package/dist/kolibri/{component-xrrwVuiI.js.map → component-CvCfEqSE.js.map} +1 -1
- package/dist/kolibri/{component-CWGVLsSH.js → component-DZbJLUju.js} +2 -2
- package/dist/{esm/component-CWGVLsSH.js.map → kolibri/component-DZbJLUju.js.map} +1 -1
- package/dist/kolibri/{component-BKOep2WQ.js → component-Dg6TIbeY.js} +2 -2
- package/dist/{esm/component-BKOep2WQ.js.map → kolibri/component-Dg6TIbeY.js.map} +1 -1
- package/dist/kolibri/{component-DD5QqT5m.js → component-Do9rjnte.js} +2 -2
- package/dist/{esm/component-DD5QqT5m.js.map → kolibri/component-Do9rjnte.js.map} +1 -1
- package/dist/kolibri/component-DzoBgfR4.js +5 -0
- package/dist/kolibri/{component-De6Do_gt.js.map → component-DzoBgfR4.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-CJMVCYWh.js} +2 -2
- package/dist/kolibri/{dev.utils-CYtV9X0K.js.map → dev.utils-CJMVCYWh.js.map} +1 -1
- package/dist/kolibri/{devtools-B0qRaQdp.js → devtools-rRHULXVr.js} +2 -2
- package/dist/{esm/devtools-B0qRaQdp.js.map → kolibri/devtools-rRHULXVr.js.map} +1 -1
- package/dist/kolibri/field-control-DXxCMXvx.js +5 -0
- package/dist/{esm/field-control-C5hjw2Rb.js.map → kolibri/field-control-DXxCMXvx.js.map} +1 -1
- package/dist/kolibri/{group-2hP8qbvk.js → group-CI4sSgiu.js} +2 -2
- package/dist/kolibri/{group-2hP8qbvk.js.map → group-CI4sSgiu.js.map} +1 -1
- package/dist/kolibri/{index-DsCeQ9Ys.js → index-DQdQBwMc.js} +2 -2
- package/dist/{esm/index-DsCeQ9Ys.js.map → kolibri/index-DQdQBwMc.js.map} +1 -1
- package/dist/kolibri/{input-Dp5NBocQ.js → input-CDtJZ2sy.js} +2 -2
- package/dist/kolibri/{input-Dp5NBocQ.js.map → input-CDtJZ2sy.js.map} +1 -1
- package/dist/kolibri/input-container-DROwwh7_.js +5 -0
- package/dist/kolibri/{input-container-QA8-0_0p.js.map → input-container-DROwwh7_.js.map} +1 -1
- package/dist/kolibri/item-C6p5wW-z.js +5 -0
- package/dist/kolibri/{item-CaxJw3ad.js.map → item-C6p5wW-z.js.map} +1 -1
- package/dist/kolibri/{item-CXyolUj2.js → item-CHP-bw8Q.js} +2 -2
- package/dist/{esm/item-CXyolUj2.js.map → kolibri/item-CHP-bw8Q.js.map} +1 -1
- package/dist/kolibri/item-Cbi_ZY6o.js +5 -0
- package/dist/kolibri/{item-DY0fVVnj.js.map → item-Cbi_ZY6o.js.map} +1 -1
- package/dist/kolibri/{item-BIjqEkyy.js → item-ZjrNIhfW.js} +2 -2
- package/dist/{esm/item-BIjqEkyy.js.map → kolibri/item-ZjrNIhfW.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-CjBvvXId.js +5 -0
- package/dist/{esm/resolve-props-DJxTzf-G.js.map → kolibri/resolve-props-CjBvvXId.js.map} +1 -1
- package/dist/kolibri/{scroll-lock-BN6ZnBdc.js → scroll-lock-6SV-XFXR.js} +2 -2
- package/dist/{esm/scroll-lock-BN6ZnBdc.js.map → kolibri/scroll-lock-6SV-XFXR.js.map} +1 -1
- package/dist/kolibri/suggestions-BYMmW1aV.js +5 -0
- package/dist/kolibri/{suggestions-DlpHvEGv.js.map → suggestions-BYMmW1aV.js.map} +1 -1
- package/dist/kolibri/test-component.entry.js +1 -1
- package/dist/kolibri/toggle-handler-D-yalcds.js +5 -0
- package/dist/{esm/toggle-handler-Xex3lIll.js.map → kolibri/toggle-handler-D-yalcds.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 +3 -3
- 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-web-component-CkaKv7O0.js +0 -5
- package/dist/kolibri/base-web-component-CkaKv7O0.js.map +0 -1
- package/dist/kolibri/component-Bd7PXqOG.js +0 -5
- 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/field-control-C5hjw2Rb.js +0 -5
- package/dist/kolibri/input-container-QA8-0_0p.js +0 -5
- package/dist/kolibri/item-CaxJw3ad.js +0 -5
- package/dist/kolibri/item-DY0fVVnj.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h as i}from"./index-
|
|
5
|
-
//# sourceMappingURL=base-
|
|
4
|
+
import{h as i}from"./index-DQdQBwMc.js";import{B as t}from"./base-web-component-3R1Dy3QK.js";import{l as s,a,c as e,d as r,b as o,L as n}from"./api-CagcODCX.js";import{T as h}from"./behavior-D1kOlK6p.js";import{s as l}from"./common-BqpMtheU.js";import{a as p,b as d,c,f,g as y,h as u,s as m,i as b,l as C,d as x,t as g,e as A,v as j}from"./variant-CeijQFzL.js";import{d as w}from"./disabled-CdyeAMlW.js";import{h as D}from"./href-DOi-fZMu.js";import{l as L}from"./label-with-expert-slot-CocPu9HB.js";import{l as v}from"./link-target-B7A-qwaP.js";import{c as K}from"./element-interaction-Cy9tx3Sx.js";import{d as I,K as B}from"./events-CRHxtwup.js";import{o as O}from"./ariaCurrentService-YoLNpD5S.js";class k extends t{constructor(){super(...arguments);this.ctaRef=K((()=>this.getRenderProp("disabled")===true));this.tooltipBehavior=new h(this.stateAccess);this.handleAnchorClick=i=>{this.tooltipBehavior.hideTooltip();const t=this.getRenderProp("disabled");if(t===true){i.preventDefault();return}const s=this.getRenderProp("href");const a=this.getRenderProp("on");if(typeof(a===null||a===void 0?void 0:a.onClick)==="function"){l(i,this.ctaRef.el);a.onClick(i,s)}if(this.host){I(this.host,B.click,s)}};this.setAnchorRef=i=>{this.ctaRef(i)}}initLinkRenderProps(){this.initRenderProps(s);this.unsetRenderProp("tabIndex")}initLinkBehaviors(){this.unsubscribeOnLocationChange=O((i=>{const t=this.getRenderProp("href");const s=this.getRenderProp("ariaCurrentValue");const a=i===t?s:"";if(this.getState("ariaCurrent")!==a){this.setState("ariaCurrent",a)}}));this.tooltipBehavior.componentWillLoad({label:this.getTooltipLabel(),align:this.getRenderProp("tooltipAlign")})}syncTooltipListeners(){if(this.ctaRef.el){this.tooltipBehavior.syncListeners(undefined,this.ctaRef.el,true)}}destroyLinkBehaviors(){if(this.unsubscribeOnLocationChange){this.unsubscribeOnLocationChange();this.unsubscribeOnLocationChange=undefined}this.tooltipBehavior.destroy()}getTooltipLabel(){const i=this.getRenderProp("label");if(typeof i==="string"&&i.length>0){return i}const t=this.getRenderProp("href");return typeof t==="string"?t:""}applyAccessKey(i){p.apply(i,(i=>this.setRenderProp("accessKey",i)))}applyAriaControls(i){d.apply(i,(i=>this.setRenderProp("ariaControls",i)))}applyAriaCurrentValue(i){a.apply(i,(i=>this.setRenderProp("ariaCurrentValue",i)))}applyAriaDescription(i){c.apply(i,(i=>this.setRenderProp("ariaDescription",i)))}applyAriaExpanded(i){f.apply(i,(i=>this.setRenderProp("ariaExpanded",i)))}applyAriaOwns(i){e.apply(i,(i=>this.setRenderProp("ariaOwns",i)))}applyCustomClass(i){y.apply(i,(i=>this.setRenderProp("customClass",i)))}applyDisabled(i){w.apply(i,(i=>this.setRenderProp("disabled",i)))}applyDownload(i){r.apply(i,(i=>this.setRenderProp("download",i)))}applyHideLabel(i){u.apply(i,(i=>this.setRenderProp("hideLabel",i)))}applyHref(i){D.apply(i,(i=>this.setRenderProp("href",i)))}applyIcons(i){m.apply(i,(i=>this.setRenderProp("icons",i)))}applyInline(i){b.apply(i,(i=>this.setRenderProp("inline",i)))}applyLabel(i){L.apply(i,(t=>{this.setRenderProp("label",t);this.setState("expertSlot",i==="");this.tooltipBehavior.watchLabel(this.getTooltipLabel())}))}applyOn(i){o.apply(i,(i=>this.setRenderProp("on",i)))}applyRole(i){C.apply(i,(i=>this.setRenderProp("role",i)))}applyShortKey(i){x.apply(i,(i=>this.setRenderProp("shortKey",i)))}applyTabIndex(i){if(typeof i==="number"){g.apply(i,(i=>this.setRenderProp("tabIndex",i)))}else{this.unsetRenderProp("tabIndex")}}applyTarget(i){v.apply(i,(i=>this.setRenderProp("target",i)))}applyTooltipAlign(i){A.apply(i,(i=>{this.setRenderProp("tooltipAlign",i);this.tooltipBehavior.watchAlign(i)}))}applyVariant(i){j.apply(i,(i=>this.setRenderProp("variant",i)))}renderLinkFC(){return i(n,{accessKey:this.getRenderProp("accessKey"),ariaControls:this.getRenderProp("ariaControls"),ariaCurrent:this.getState("ariaCurrent"),ariaCurrentValue:this.getRenderProp("ariaCurrentValue"),ariaDescription:this.getRenderProp("ariaDescription"),ariaDescriptionId:this.getState("ariaDescriptionId"),ariaExpanded:this.getRenderProp("ariaExpanded"),ariaOwns:this.getRenderProp("ariaOwns"),customClass:this.getRenderProp("customClass"),disabled:this.getRenderProp("disabled"),download:this.getRenderProp("download"),handleAnchorClick:this.handleAnchorClick,hideLabel:this.getRenderProp("hideLabel"),href:this.getRenderProp("href"),icons:this.getRenderProp("icons"),inline:this.getRenderProp("inline"),label:this.getRenderProp("label"),on:this.getRenderProp("on"),refAnchor:this.setAnchorRef,refTooltip:this.tooltipBehavior.setTooltipElementRef,role:this.getRenderProp("role"),shortKey:this.getRenderProp("shortKey"),tabIndex:this.getRenderProp("tabIndex"),target:this.getRenderProp("target"),tooltipAlign:this.getRenderProp("tooltipAlign"),variant:this.getRenderProp("variant"),expertSlot:this.getState("expertSlot")})}}export{k as B};
|
|
5
|
+
//# sourceMappingURL=base-BpKxLJ6r.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-D8GcFhvD.js","sources":["src/components/link/base.tsx"],"sourcesContent":["import type { JSX } from '@stencil/core';\nimport { h } from '@stencil/core';\n\nimport { BaseWebComponent } from '../../internal/functional-components/base-web-component';\nimport type { LinkApi } from '../../internal/functional-components/link/api';\nimport { linkPropsConfig } from '../../internal/functional-components/link/api';\nimport { LinkFC } from '../../internal/functional-components/link/component';\nimport { TooltipBehavior } from '../../internal/functional-components/tooltip/behavior';\nimport {\n\taccessKeyProp,\n\tariaControlsProp,\n\tariaCurrentValueProp,\n\tariaDescriptionProp,\n\tariaExpandedProp,\n\tariaOwnsProp,\n\tcustomClassProp,\n\tdisabledProp,\n\tdownloadProp,\n\thideLabelProp,\n\threfProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tlinkCallbacksProp,\n\tlinkRoleProp,\n\tlinkTargetProp,\n\tshortKeyProp,\n\tspanIconsProp,\n\ttabIndexProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../internal/props';\nimport type {\n\tAccessKeyPropType,\n\tAlternativeButtonLinkRolePropType,\n\tAriaCurrentValuePropType,\n\tAriaDescriptionPropType,\n\tAriaOwnsPropType,\n\tCustomClassPropType,\n\tDownloadPropType,\n\tHrefPropType,\n\tInlinePropType,\n\tKoliBriIconsProp,\n\tLabelWithExpertSlotPropType,\n\tLinkOnCallbacksPropType,\n\tLinkTargetPropType,\n\tShortKeyPropType,\n\tStringified,\n\tTooltipAlignPropType,\n\tVariantClassNamePropType,\n} from '../../schema';\nimport { setEventTarget } from '../../schema';\nimport { createCtaRef } from '../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../utils/events';\nimport type { UnsubscribeFunction } from './ariaCurrentService';\nimport { onLocationChange } from './ariaCurrentService';\n\n/**\n * Shared orchestrator implementation for every custom element that renders `LinkFC`:\n * `kol-link` and `kol-link-button`.\n *\n * The class carries everything that does not need a Stencil decorator — the composed\n * `TooltipBehavior`, the `aria-current` location subscription, the anchor click handler, one\n * `apply*` method per prop and the `LinkFC` render call. The concrete element keeps what Stencil\n * has to see in the component class itself: `@Component`, `@Element`, `@State`, `@Method`, every\n * `@Prop` with its `@Watch` (whose body is a one-line call into the matching `apply*` method) and\n * the lifecycle methods, which delegate here (ARC42 § 9, design decision 16).\n *\n * This is not a layer between the web component and the functional component — it *is* the web\n * component's implementation, shared between the tag variants of one FC.\n */\nexport abstract class BaseLinkWebComponent extends BaseWebComponent<LinkApi> {\n\t/** The custom element; declared with `@Element()` by the concrete class. */\n\tprotected abstract readonly host?: HTMLElement;\n\n\t/* An `<a>` carries no native `disabled`, so a disabled link stays focusable. Emptying the ref\n\t keeps the public `focus()` and `click()` methods from reaching it. */\n\tprotected readonly ctaRef = createCtaRef<HTMLAnchorElement>(() => this.getRenderProp('disabled') === true);\n\n\t// --- Composed behaviors ---\n\n\tprotected readonly tooltipBehavior = new TooltipBehavior(this.stateAccess);\n\tprivate unsubscribeOnLocationChange?: UnsubscribeFunction;\n\n\t// --- Lifecycle helpers (called from the concrete element's lifecycle methods) ---\n\n\t/**\n\t * Seeds the render props. Call first in `componentWillLoad`, before the prop watchers run.\n\t */\n\tprotected initLinkRenderProps(): void {\n\t\tthis.initRenderProps(linkPropsConfig);\n\t\t// An unset tabindex must not render as `tabindex=\"0\"` — links are natively tabbable and\n\t\t// the attribute would trigger focus outlines that the predecessor did not draw.\n\t\tthis.unsetRenderProp('tabIndex');\n\t}\n\n\t/**\n\t * Subscribes to location changes and hands the resolved label and alignment to the tooltip\n\t * behavior. Call last in `componentWillLoad`, after every prop watcher has run.\n\t */\n\tprotected initLinkBehaviors(): void {\n\t\tthis.unsubscribeOnLocationChange = onLocationChange((location) => {\n\t\t\tconst href = this.getRenderProp('href');\n\t\t\tconst ariaCurrentValue = this.getRenderProp('ariaCurrentValue');\n\t\t\tconst newValue = location === href ? ariaCurrentValue : '';\n\t\t\tif (this.getState('ariaCurrent') !== newValue) {\n\t\t\t\tthis.setState('ariaCurrent', newValue);\n\t\t\t}\n\t\t});\n\n\t\tthis.tooltipBehavior.componentWillLoad({\n\t\t\tlabel: this.getTooltipLabel(),\n\t\t\talign: this.getRenderProp('tooltipAlign'),\n\t\t});\n\t}\n\n\t/** Call from `componentDidRender`. */\n\tprotected syncTooltipListeners(): void {\n\t\tif (this.ctaRef.el) {\n\t\t\tthis.tooltipBehavior.syncListeners(undefined, this.ctaRef.el, true);\n\t\t}\n\t}\n\n\t/** Call from `disconnectedCallback`. */\n\tprotected destroyLinkBehaviors(): void {\n\t\tif (this.unsubscribeOnLocationChange) {\n\t\t\tthis.unsubscribeOnLocationChange();\n\t\t\tthis.unsubscribeOnLocationChange = undefined;\n\t\t}\n\t\tthis.tooltipBehavior.destroy();\n\t}\n\n\t// --- Click handling ---\n\n\tprotected readonly handleAnchorClick = (event: Event): void => {\n\t\tthis.tooltipBehavior.hideTooltip();\n\t\tconst disabled = this.getRenderProp('disabled');\n\t\tif (disabled === true) {\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\t\tconst href = this.getRenderProp('href');\n\t\tconst on = this.getRenderProp('on');\n\t\tif (typeof on?.onClick === 'function') {\n\t\t\tsetEventTarget(event, this.ctaRef.el);\n\t\t\ton.onClick(event, href);\n\t\t}\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.click, href);\n\t\t}\n\t};\n\n\t// --- Tooltip helpers ---\n\n\tprivate getTooltipLabel(): string {\n\t\tconst label = this.getRenderProp('label');\n\t\tif (typeof label === 'string' && label.length > 0) {\n\t\t\treturn label;\n\t\t}\n\t\tconst href = this.getRenderProp('href');\n\t\treturn typeof href === 'string' ? href : '';\n\t}\n\n\t// --- Prop application (one per prop; the concrete element's watchers delegate here) ---\n\n\tprotected applyAccessKey(value?: AccessKeyPropType): void {\n\t\taccessKeyProp.apply(value, (v) => this.setRenderProp('accessKey', v));\n\t}\n\n\tprotected applyAriaControls(value?: string): void {\n\t\tariaControlsProp.apply(value, (v) => this.setRenderProp('ariaControls', v));\n\t}\n\n\tprotected applyAriaCurrentValue(value?: AriaCurrentValuePropType): void {\n\t\tariaCurrentValueProp.apply(value, (v) => this.setRenderProp('ariaCurrentValue', v));\n\t}\n\n\tprotected applyAriaDescription(value?: AriaDescriptionPropType): void {\n\t\tariaDescriptionProp.apply(value, (v) => this.setRenderProp('ariaDescription', v));\n\t}\n\n\tprotected applyAriaExpanded(value?: boolean): void {\n\t\tariaExpandedProp.apply(value, (v) => this.setRenderProp('ariaExpanded', v));\n\t}\n\n\tprotected applyAriaOwns(value?: AriaOwnsPropType): void {\n\t\tariaOwnsProp.apply(value, (v) => this.setRenderProp('ariaOwns', v));\n\t}\n\n\tprotected applyCustomClass(value?: CustomClassPropType): void {\n\t\tcustomClassProp.apply(value, (v) => this.setRenderProp('customClass', v));\n\t}\n\n\tprotected applyDisabled(value?: boolean): void {\n\t\tdisabledProp.apply(value, (v) => this.setRenderProp('disabled', v));\n\t}\n\n\tprotected applyDownload(value?: DownloadPropType): void {\n\t\tdownloadProp.apply(value, (v) => this.setRenderProp('download', v));\n\t}\n\n\tprotected applyHideLabel(value?: boolean): void {\n\t\thideLabelProp.apply(value, (v) => this.setRenderProp('hideLabel', v));\n\t}\n\n\tprotected applyHref(value?: HrefPropType): void {\n\t\threfProp.apply(value, (v) => this.setRenderProp('href', v));\n\t}\n\n\tprotected applyIcons(value?: Stringified<KoliBriIconsProp>): void {\n\t\tspanIconsProp.apply(value, (v) => this.setRenderProp('icons', v));\n\t}\n\n\tprotected applyInline(value?: InlinePropType): void {\n\t\tinlineProp.apply(value, (v) => this.setRenderProp('inline', v));\n\t}\n\n\tprotected applyLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tlabelWithExpertSlotProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('label', v);\n\t\t\tthis.setState('expertSlot', value === '');\n\t\t\tthis.tooltipBehavior.watchLabel(this.getTooltipLabel());\n\t\t});\n\t}\n\n\tprotected applyOn(value?: LinkOnCallbacksPropType): void {\n\t\tlinkCallbacksProp.apply(value, (v) => this.setRenderProp('on', v));\n\t}\n\n\tprotected applyRole(value?: AlternativeButtonLinkRolePropType): void {\n\t\tlinkRoleProp.apply(value, (v) => this.setRenderProp('role', v));\n\t}\n\n\tprotected applyShortKey(value?: ShortKeyPropType): void {\n\t\tshortKeyProp.apply(value, (v) => this.setRenderProp('shortKey', v));\n\t}\n\n\tprotected applyTabIndex(value?: number): void {\n\t\t// The props config seeds `tabIndex` with its default `0`, but an unset tabindex must not\n\t\t// render as `tabindex=\"0\"`. Unsetting the prop has to restore that state, so the else branch\n\t\t// is not optional: without it a reset would keep the previous number.\n\t\tif (typeof value === 'number') {\n\t\t\ttabIndexProp.apply(value, (v) => this.setRenderProp('tabIndex', v));\n\t\t} else {\n\t\t\tthis.unsetRenderProp('tabIndex');\n\t\t}\n\t}\n\n\tprotected applyTarget(value?: LinkTargetPropType): void {\n\t\tlinkTargetProp.apply(value, (v) => this.setRenderProp('target', v));\n\t}\n\n\tprotected applyTooltipAlign(value?: TooltipAlignPropType): void {\n\t\ttooltipAlignProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('tooltipAlign', v);\n\t\t\tthis.tooltipBehavior.watchAlign(v);\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// --- Refs ---\n\n\tprivate readonly setAnchorRef = (el?: HTMLAnchorElement): void => {\n\t\tthis.ctaRef(el);\n\t};\n\n\t// --- Render ---\n\n\t/** Renders `LinkFC` from the current render props and state. */\n\tprotected renderLinkFC(): JSX.Element {\n\t\treturn (\n\t\t\t<LinkFC\n\t\t\t\taccessKey={this.getRenderProp('accessKey')}\n\t\t\t\tariaControls={this.getRenderProp('ariaControls')}\n\t\t\t\tariaCurrent={this.getState('ariaCurrent')}\n\t\t\t\tariaCurrentValue={this.getRenderProp('ariaCurrentValue')}\n\t\t\t\tariaDescription={this.getRenderProp('ariaDescription')}\n\t\t\t\tariaDescriptionId={this.getState('ariaDescriptionId')}\n\t\t\t\tariaExpanded={this.getRenderProp('ariaExpanded')}\n\t\t\t\tariaOwns={this.getRenderProp('ariaOwns')}\n\t\t\t\tcustomClass={this.getRenderProp('customClass')}\n\t\t\t\tdisabled={this.getRenderProp('disabled')}\n\t\t\t\tdownload={this.getRenderProp('download')}\n\t\t\t\thandleAnchorClick={this.handleAnchorClick}\n\t\t\t\thideLabel={this.getRenderProp('hideLabel')}\n\t\t\t\thref={this.getRenderProp('href')}\n\t\t\t\ticons={this.getRenderProp('icons')}\n\t\t\t\tinline={this.getRenderProp('inline')}\n\t\t\t\tlabel={this.getRenderProp('label')}\n\t\t\t\ton={this.getRenderProp('on')}\n\t\t\t\trefAnchor={this.setAnchorRef}\n\t\t\t\trefTooltip={this.tooltipBehavior.setTooltipElementRef}\n\t\t\t\trole={this.getRenderProp('role')}\n\t\t\t\tshortKey={this.getRenderProp('shortKey')}\n\t\t\t\ttabIndex={this.getRenderProp('tabIndex')}\n\t\t\t\ttarget={this.getRenderProp('target')}\n\t\t\t\ttooltipAlign={this.getRenderProp('tooltipAlign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,EACpC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAClC,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAC5B,SAAS,EAAE,IAAI,CAAC,YAAY,EAC5B,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,oBAAoB,EACrD,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAChC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EACxC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EACxC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EACpC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAChD,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EACtC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EACtC,CAAA;;AAGJ;;;;"}
|
|
1
|
+
{"version":3,"file":"base-BpKxLJ6r.js","sources":["src/components/link/base.tsx"],"sourcesContent":["import type { JSX } from '@stencil/core';\nimport { h } from '@stencil/core';\n\nimport { BaseWebComponent } from '../../internal/functional-components/base-web-component';\nimport type { LinkApi } from '../../internal/functional-components/link/api';\nimport { linkPropsConfig } from '../../internal/functional-components/link/api';\nimport { LinkFC } from '../../internal/functional-components/link/component';\nimport { TooltipBehavior } from '../../internal/functional-components/tooltip/behavior';\nimport {\n\taccessKeyProp,\n\tariaControlsProp,\n\tariaCurrentValueProp,\n\tariaDescriptionProp,\n\tariaExpandedProp,\n\tariaOwnsProp,\n\tcustomClassProp,\n\tdisabledProp,\n\tdownloadProp,\n\thideLabelProp,\n\threfProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tlinkCallbacksProp,\n\tlinkRoleProp,\n\tlinkTargetProp,\n\tshortKeyProp,\n\tspanIconsProp,\n\ttabIndexProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../internal/props';\nimport type {\n\tAccessKeyPropType,\n\tAlternativeButtonLinkRolePropType,\n\tAriaCurrentValuePropType,\n\tAriaDescriptionPropType,\n\tAriaOwnsPropType,\n\tCustomClassPropType,\n\tDownloadPropType,\n\tHrefPropType,\n\tInlinePropType,\n\tKoliBriIconsProp,\n\tLabelWithExpertSlotPropType,\n\tLinkOnCallbacksPropType,\n\tLinkTargetPropType,\n\tShortKeyPropType,\n\tStringified,\n\tTooltipAlignPropType,\n\tVariantClassNamePropType,\n} from '../../schema';\nimport { setEventTarget } from '../../schema';\nimport { createCtaRef } from '../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../utils/events';\nimport type { UnsubscribeFunction } from './ariaCurrentService';\nimport { onLocationChange } from './ariaCurrentService';\n\n/**\n * Shared orchestrator implementation for every custom element that renders `LinkFC`:\n * `kol-link` and `kol-link-button`.\n *\n * The class carries everything that does not need a Stencil decorator — the composed\n * `TooltipBehavior`, the `aria-current` location subscription, the anchor click handler, one\n * `apply*` method per prop and the `LinkFC` render call. The concrete element keeps what Stencil\n * has to see in the component class itself: `@Component`, `@Element`, `@State`, `@Method`, every\n * `@Prop` with its `@Watch` (whose body is a one-line call into the matching `apply*` method) and\n * the lifecycle methods, which delegate here (ARC42 § 9, design decision 16).\n *\n * This is not a layer between the web component and the functional component — it *is* the web\n * component's implementation, shared between the tag variants of one FC.\n */\nexport abstract class BaseLinkWebComponent extends BaseWebComponent<LinkApi> {\n\t/** The custom element; declared with `@Element()` by the concrete class. */\n\tprotected abstract readonly host?: HTMLElement;\n\n\t/* An `<a>` carries no native `disabled`, so a disabled link stays focusable. Emptying the ref\n\t keeps the public `focus()` and `click()` methods from reaching it. */\n\tprotected readonly ctaRef = createCtaRef<HTMLAnchorElement>(() => this.getRenderProp('disabled') === true);\n\n\t// --- Composed behaviors ---\n\n\tprotected readonly tooltipBehavior = new TooltipBehavior(this.stateAccess);\n\tprivate unsubscribeOnLocationChange?: UnsubscribeFunction;\n\n\t// --- Lifecycle helpers (called from the concrete element's lifecycle methods) ---\n\n\t/**\n\t * Seeds the render props. Call first in `componentWillLoad`, before the prop watchers run.\n\t */\n\tprotected initLinkRenderProps(): void {\n\t\tthis.initRenderProps(linkPropsConfig);\n\t\t// An unset tabindex must not render as `tabindex=\"0\"` — links are natively tabbable and\n\t\t// the attribute would trigger focus outlines that the predecessor did not draw.\n\t\tthis.unsetRenderProp('tabIndex');\n\t}\n\n\t/**\n\t * Subscribes to location changes and hands the resolved label and alignment to the tooltip\n\t * behavior. Call last in `componentWillLoad`, after every prop watcher has run.\n\t */\n\tprotected initLinkBehaviors(): void {\n\t\tthis.unsubscribeOnLocationChange = onLocationChange((location) => {\n\t\t\tconst href = this.getRenderProp('href');\n\t\t\tconst ariaCurrentValue = this.getRenderProp('ariaCurrentValue');\n\t\t\tconst newValue = location === href ? ariaCurrentValue : '';\n\t\t\tif (this.getState('ariaCurrent') !== newValue) {\n\t\t\t\tthis.setState('ariaCurrent', newValue);\n\t\t\t}\n\t\t});\n\n\t\tthis.tooltipBehavior.componentWillLoad({\n\t\t\tlabel: this.getTooltipLabel(),\n\t\t\talign: this.getRenderProp('tooltipAlign'),\n\t\t});\n\t}\n\n\t/** Call from `componentDidRender`. */\n\tprotected syncTooltipListeners(): void {\n\t\tif (this.ctaRef.el) {\n\t\t\tthis.tooltipBehavior.syncListeners(undefined, this.ctaRef.el, true);\n\t\t}\n\t}\n\n\t/** Call from `disconnectedCallback`. */\n\tprotected destroyLinkBehaviors(): void {\n\t\tif (this.unsubscribeOnLocationChange) {\n\t\t\tthis.unsubscribeOnLocationChange();\n\t\t\tthis.unsubscribeOnLocationChange = undefined;\n\t\t}\n\t\tthis.tooltipBehavior.destroy();\n\t}\n\n\t// --- Click handling ---\n\n\tprotected readonly handleAnchorClick = (event: Event): void => {\n\t\tthis.tooltipBehavior.hideTooltip();\n\t\tconst disabled = this.getRenderProp('disabled');\n\t\tif (disabled === true) {\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\t\tconst href = this.getRenderProp('href');\n\t\tconst on = this.getRenderProp('on');\n\t\tif (typeof on?.onClick === 'function') {\n\t\t\tsetEventTarget(event, this.ctaRef.el);\n\t\t\ton.onClick(event, href);\n\t\t}\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.click, href);\n\t\t}\n\t};\n\n\t// --- Tooltip helpers ---\n\n\tprivate getTooltipLabel(): string {\n\t\tconst label = this.getRenderProp('label');\n\t\tif (typeof label === 'string' && label.length > 0) {\n\t\t\treturn label;\n\t\t}\n\t\tconst href = this.getRenderProp('href');\n\t\treturn typeof href === 'string' ? href : '';\n\t}\n\n\t// --- Prop application (one per prop; the concrete element's watchers delegate here) ---\n\n\tprotected applyAccessKey(value?: AccessKeyPropType): void {\n\t\taccessKeyProp.apply(value, (v) => this.setRenderProp('accessKey', v));\n\t}\n\n\tprotected applyAriaControls(value?: string): void {\n\t\tariaControlsProp.apply(value, (v) => this.setRenderProp('ariaControls', v));\n\t}\n\n\tprotected applyAriaCurrentValue(value?: AriaCurrentValuePropType): void {\n\t\tariaCurrentValueProp.apply(value, (v) => this.setRenderProp('ariaCurrentValue', v));\n\t}\n\n\tprotected applyAriaDescription(value?: AriaDescriptionPropType): void {\n\t\tariaDescriptionProp.apply(value, (v) => this.setRenderProp('ariaDescription', v));\n\t}\n\n\tprotected applyAriaExpanded(value?: boolean): void {\n\t\tariaExpandedProp.apply(value, (v) => this.setRenderProp('ariaExpanded', v));\n\t}\n\n\tprotected applyAriaOwns(value?: AriaOwnsPropType): void {\n\t\tariaOwnsProp.apply(value, (v) => this.setRenderProp('ariaOwns', v));\n\t}\n\n\tprotected applyCustomClass(value?: CustomClassPropType): void {\n\t\tcustomClassProp.apply(value, (v) => this.setRenderProp('customClass', v));\n\t}\n\n\tprotected applyDisabled(value?: boolean): void {\n\t\tdisabledProp.apply(value, (v) => this.setRenderProp('disabled', v));\n\t}\n\n\tprotected applyDownload(value?: DownloadPropType): void {\n\t\tdownloadProp.apply(value, (v) => this.setRenderProp('download', v));\n\t}\n\n\tprotected applyHideLabel(value?: boolean): void {\n\t\thideLabelProp.apply(value, (v) => this.setRenderProp('hideLabel', v));\n\t}\n\n\tprotected applyHref(value?: HrefPropType): void {\n\t\threfProp.apply(value, (v) => this.setRenderProp('href', v));\n\t}\n\n\tprotected applyIcons(value?: Stringified<KoliBriIconsProp>): void {\n\t\tspanIconsProp.apply(value, (v) => this.setRenderProp('icons', v));\n\t}\n\n\tprotected applyInline(value?: InlinePropType): void {\n\t\tinlineProp.apply(value, (v) => this.setRenderProp('inline', v));\n\t}\n\n\tprotected applyLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tlabelWithExpertSlotProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('label', v);\n\t\t\tthis.setState('expertSlot', value === '');\n\t\t\tthis.tooltipBehavior.watchLabel(this.getTooltipLabel());\n\t\t});\n\t}\n\n\tprotected applyOn(value?: LinkOnCallbacksPropType): void {\n\t\tlinkCallbacksProp.apply(value, (v) => this.setRenderProp('on', v));\n\t}\n\n\tprotected applyRole(value?: AlternativeButtonLinkRolePropType): void {\n\t\tlinkRoleProp.apply(value, (v) => this.setRenderProp('role', v));\n\t}\n\n\tprotected applyShortKey(value?: ShortKeyPropType): void {\n\t\tshortKeyProp.apply(value, (v) => this.setRenderProp('shortKey', v));\n\t}\n\n\tprotected applyTabIndex(value?: number): void {\n\t\t// The props config seeds `tabIndex` with its default `0`, but an unset tabindex must not\n\t\t// render as `tabindex=\"0\"`. Unsetting the prop has to restore that state, so the else branch\n\t\t// is not optional: without it a reset would keep the previous number.\n\t\tif (typeof value === 'number') {\n\t\t\ttabIndexProp.apply(value, (v) => this.setRenderProp('tabIndex', v));\n\t\t} else {\n\t\t\tthis.unsetRenderProp('tabIndex');\n\t\t}\n\t}\n\n\tprotected applyTarget(value?: LinkTargetPropType): void {\n\t\tlinkTargetProp.apply(value, (v) => this.setRenderProp('target', v));\n\t}\n\n\tprotected applyTooltipAlign(value?: TooltipAlignPropType): void {\n\t\ttooltipAlignProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('tooltipAlign', v);\n\t\t\tthis.tooltipBehavior.watchAlign(v);\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// --- Refs ---\n\n\tprivate readonly setAnchorRef = (el?: HTMLAnchorElement): void => {\n\t\tthis.ctaRef(el);\n\t};\n\n\t// --- Render ---\n\n\t/** Renders `LinkFC` from the current render props and state. */\n\tprotected renderLinkFC(): JSX.Element {\n\t\treturn (\n\t\t\t<LinkFC\n\t\t\t\taccessKey={this.getRenderProp('accessKey')}\n\t\t\t\tariaControls={this.getRenderProp('ariaControls')}\n\t\t\t\tariaCurrent={this.getState('ariaCurrent')}\n\t\t\t\tariaCurrentValue={this.getRenderProp('ariaCurrentValue')}\n\t\t\t\tariaDescription={this.getRenderProp('ariaDescription')}\n\t\t\t\tariaDescriptionId={this.getState('ariaDescriptionId')}\n\t\t\t\tariaExpanded={this.getRenderProp('ariaExpanded')}\n\t\t\t\tariaOwns={this.getRenderProp('ariaOwns')}\n\t\t\t\tcustomClass={this.getRenderProp('customClass')}\n\t\t\t\tdisabled={this.getRenderProp('disabled')}\n\t\t\t\tdownload={this.getRenderProp('download')}\n\t\t\t\thandleAnchorClick={this.handleAnchorClick}\n\t\t\t\thideLabel={this.getRenderProp('hideLabel')}\n\t\t\t\thref={this.getRenderProp('href')}\n\t\t\t\ticons={this.getRenderProp('icons')}\n\t\t\t\tinline={this.getRenderProp('inline')}\n\t\t\t\tlabel={this.getRenderProp('label')}\n\t\t\t\ton={this.getRenderProp('on')}\n\t\t\t\trefAnchor={this.setAnchorRef}\n\t\t\t\trefTooltip={this.tooltipBehavior.setTooltipElementRef}\n\t\t\t\trole={this.getRenderProp('role')}\n\t\t\t\tshortKey={this.getRenderProp('shortKey')}\n\t\t\t\ttabIndex={this.getRenderProp('tabIndex')}\n\t\t\t\ttarget={this.getRenderProp('target')}\n\t\t\t\ttooltipAlign={this.getRenderProp('tooltipAlign')}\n\t\t\t\tvariant={this.getRenderProp('variant')}\n\t\t\t\texpertSlot={this.getState('expertSlot')}\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAsEM,MAAgB,oBAAqB,SAAQ,gBAAyB,CAAA;AAA5E,IAAA,WAAA,GAAA;;AAMoB,QAAA,IAAA,CAAA,MAAM,GAAG,YAAY,CAAoB,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;QAIvF,IAAe,CAAA,eAAA,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC;AAqDvD,QAAA,IAAA,CAAA,iBAAiB,GAAG,CAAC,KAAY,KAAU;AAC7D,YAAA,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;YAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;AAC/C,YAAA,IAAI,QAAQ,KAAK,IAAI,EAAE;gBACtB,KAAK,CAAC,cAAc,EAAE;gBACtB;;YAED,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;YACvC,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YACnC,IAAI,QAAO,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,MAAA,GAAA,MAAA,GAAF,EAAE,CAAE,OAAO,CAAA,KAAK,UAAU,EAAE;gBACtC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;AACrC,gBAAA,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;;AAExB,YAAA,IAAI,IAAI,CAAC,IAAI,EAAE;gBACd,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;;AAEnD,SAAC;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,aAAa,CAAC,OAAO,CAAC,EAClC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EACpC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAClC,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAC5B,SAAS,EAAE,IAAI,CAAC,YAAY,EAC5B,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,oBAAoB,EACrD,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAChC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EACxC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EACxC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EACpC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAChD,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EACtC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EACtC,CAAA;;AAGJ;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h as i}from"./index-
|
|
5
|
-
//# sourceMappingURL=base-
|
|
4
|
+
import{h as i}from"./index-DQdQBwMc.js";import{v as t,B as s}from"./base-web-component-3R1Dy3QK.js";import{r as o,C as l}from"./component-Ba4gjLBG.js";import"./common-BqpMtheU.js";import{l as e}from"./level-Q5lBISho.js";import{d as a,w as h}from"./width-BDh5pZvE.js";import{l as r}from"./label-c9P7yC4V.js";import{u as n,l as d,d as p,D as v}from"./scroll-lock-6SV-XFXR.js";import{T as m}from"./behavior-D1kOlK6p.js";import{c as u}from"./element-interaction-Cy9tx3Sx.js";import{d as c,K as f}from"./events-CRHxtwup.js";import{h as C}from"./tooltip-open-tracking-D3tCiiGP.js";const b={required:[r],optional:[a,e,t,h]};const j=()=>{};class D extends s{constructor(){super(...arguments);this.dialogRef=u();this.cardCloseButtonRef=u();this.cardCloseTooltipBehavior=new m(this.stateAccess);this.handleCancel=i=>{var t,s;C(i);if(i.defaultPrevented)return;(s=(t=this.getRenderProp("on")).onCancel)===null||s===void 0?void 0:s.call(t,i);if(i.defaultPrevented)return;if(this.host&&!c(this.host,f.cancel)){i.preventDefault()}};this.handleClose=i=>{var t,s;if(i.target!==this.dialogRef.el){return}n(this);(s=(t=this.getRenderProp("on")).onClose)===null||s===void 0?void 0:s.call(t);if(this.host){c(this.host,f.close)}};this.handleCardClose=()=>{this.cardCloseTooltipBehavior.hideTooltip();this.closeDialog();if(this.host){c(this.host,f.close)}}}initDialogRenderProps(){this.initRenderProps(b);this.cardCloseButtonProps=o(this.host);this.cardCloseTooltipBehavior.componentWillLoad({label:this.cardCloseButtonProps.label,align:this.cardCloseButtonProps.tooltipAlign})}syncCardCloseTooltipListeners(){if(this.cardCloseButtonRef.el){this.cardCloseTooltipBehavior.syncListeners(undefined,this.cardCloseButtonRef.el,true)}}teardownDialog(){this.closeDialog();n(this);this.cardCloseTooltipBehavior.destroy()}applyLabel(i){r.apply(i,(i=>this.setRenderProp("label",i)))}applyLevel(i){e.apply(i,(i=>this.setRenderProp("level",i)))}applyOn(i){a.apply(i,(i=>this.setRenderProp("on",i)))}applyVariant(i){t.apply(i,(i=>this.setRenderProp("variant",i)))}applyWidth(i){h.apply(i,(i=>this.setRenderProp("width",i)))}showDialog(i){var t,s;const o=this.dialogRef.el;if(o===null||o===void 0?void 0:o.open){return}this.setState("modal",i);if(i){(t=o===null||o===void 0?void 0:o.showModal)===null||t===void 0?void 0:t.call(o);if(o){d(this)}}else{(s=o===null||o===void 0?void 0:o.show)===null||s===void 0?void 0:s.call(o)}}closeDialog(){var i,t;(t=(i=this.dialogRef.el)===null||i===void 0?void 0:i.close)===null||t===void 0?void 0:t.call(i)}buildCardProps(){return{ariaDescriptionId:this.getState("ariaDescriptionId"),closeButtonProps:this.cardCloseButtonProps,handleBlur:j,handleClose:this.handleCardClose,handleFocus:j,hasCloser:true,headingId:this.getState("headingId"),href:"",label:this.getRenderProp("label"),level:this.getRenderProp("level"),on:{},refCloseButton:this.cardCloseButtonRef,refCta:j,refTooltip:this.cardCloseTooltipBehavior.setTooltipElementRef,target:""}}renderDialogFC(){const t=this.getRenderProp("variant");const s=t==="card";return i(v,{blockClass:p(t),handleCancel:this.handleCancel,handleClose:this.handleClose,label:this.getRenderProp("label"),labelledBy:s?this.getState("headingId"):undefined,modal:this.getState("modal"),refDialog:this.dialogRef,width:this.getRenderProp("width")},s?i(l,Object.assign({},this.buildCardProps()),this.renderSlot()):this.renderSlot())}}export{D as B};
|
|
5
|
+
//# sourceMappingURL=base-Cm_c8klt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-DiSQvfGU.js","sources":["src/internal/functional-components/dialog/api.tsx","src/components/dialog/base.tsx"],"sourcesContent":["import { dialogCallbacksProp, labelProp, levelProp, variantDialogProp, widthProp } from '../../props';\nimport type { ApiFromConfig, PropsConfigShape } from '../generic-types';\n\n/**\n * Props configuration for the dialog component.\n *\n * Notes on prop choices:\n * - `labelProp`, not `labelWithExpertSlotProp`: the label is either the `aria-label` of the blank\n * variant or the card's heading text — neither has an expert slot.\n * - `levelProp` only reaches the card variant's heading; the blank variant renders no heading.\n */\nexport const dialogPropsConfig = {\n\trequired: [labelProp],\n\toptional: [dialogCallbacksProp, levelProp, variantDialogProp, widthProp],\n} as const satisfies PropsConfigShape;\n\nexport type DialogApi = ApiFromConfig<\n\ttypeof dialogPropsConfig,\n\t{\n\t\t/** Both callbacks handle the native events of the `<dialog>` element. */\n\t\tCallbacks: {\n\t\t\tcancel: (event: Event) => void;\n\t\t\tclose: (event: Event) => void;\n\t\t};\n\t\tMethods: {\n\t\t\tclose: () => void;\n\t\t\tcloseModal: () => void;\n\t\t\topenModal: () => void;\n\t\t\tshow: (modal?: boolean) => void;\n\t\t\tshowModal: () => void;\n\t\t};\n\t\tRefs: {\n\t\t\tdialog: HTMLDialogElement;\n\t\t};\n\t\tStates: {\n\t\t\t/**\n\t\t\t * DOM id of the close button's visually-hidden description span, required by the card\n\t\t\t * variant's `ButtonFC`. Unused while that button carries no aria description.\n\t\t\t */\n\t\t\tariaDescriptionId: string;\n\t\t\t/**\n\t\t\t * DOM id of the card variant's heading, referenced by the `<dialog>`'s\n\t\t\t * `aria-labelledby`. Generated per instance.\n\t\t\t */\n\t\t\theadingId: string;\n\t\t\t/**\n\t\t\t * Whether the dialog is currently shown modally. Drives `aria-modal` and is set by\n\t\t\t * `show()`/`showModal()`.\n\t\t\t */\n\t\t\tmodal: boolean;\n\t\t};\n\t}\n>;\n","import type { JSX } from '@stencil/core';\nimport { h } from '@stencil/core';\n\nimport { BaseWebComponent } from '../../internal/functional-components/base-web-component';\nimport type { ResolvedButtonProps } from '../../internal/functional-components/button/resolve-props';\nimport { resolveCardCloseButtonProps } from '../../internal/functional-components/card/close-button';\nimport type { CardFCProps } from '../../internal/functional-components/card/component';\nimport { CardFC } from '../../internal/functional-components/card/component';\nimport type { DialogApi } from '../../internal/functional-components/dialog/api';\nimport { dialogPropsConfig } from '../../internal/functional-components/dialog/api';\nimport { dialogBlockClass, DialogFC } from '../../internal/functional-components/dialog/component';\nimport { TooltipBehavior } from '../../internal/functional-components/tooltip/behavior';\nimport { dialogCallbacksProp, labelProp, levelProp, variantDialogProp, widthProp } from '../../internal/props';\nimport type { HeadingLevel, KoliBriDialogEventCallbacks, LabelPropType } from '../../schema';\nimport type { ModalVariantPropType } from '../../schema/props/variant/modal';\nimport { createCtaRef } from '../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../utils/events';\nimport { lockScroll, unlockScroll } from '../../utils/scroll-lock';\nimport { handleCancelOverlay } from '../../utils/tooltip-open-tracking';\n\n/**\n * The card variant renders no link, so its anchor never exists: the card's own `_on` callbacks\n * describe that anchor, and its ref is never called.\n */\nconst NOOP = (): void => {};\n\n/**\n * Orchestrator shared by `kol-dialog` and the deprecated `kol-modal`. Both render the same\n * `DialogFC`; the concrete element only declares the Stencil members and delegates from its\n * watchers, methods and lifecycle hooks.\n *\n * The card variant renders `CardFC` directly, so this class also owns the close button's resolved\n * props, its tooltip behavior and its ref.\n */\nexport abstract class BaseDialogWebComponent extends BaseWebComponent<DialogApi> {\n\tprotected abstract readonly host?: HTMLElement;\n\n\tprotected readonly dialogRef = createCtaRef<HTMLDialogElement>();\n\tprivate readonly cardCloseButtonRef = createCtaRef<HTMLButtonElement>();\n\n\t/** Drives the card close button's tooltip — it renders with `hideLabel`, so its label lives there. */\n\tprivate readonly cardCloseTooltipBehavior = new TooltipBehavior(this.stateAccess);\n\n\t/** Resolved once in `componentWillLoad`: the close button's configuration never changes. */\n\tprivate cardCloseButtonProps!: ResolvedButtonProps;\n\n\t// --- Lifecycle ---\n\n\tprotected initDialogRenderProps(): void {\n\t\tthis.initRenderProps(dialogPropsConfig);\n\n\t\tthis.cardCloseButtonProps = resolveCardCloseButtonProps(this.host);\n\t\tthis.cardCloseTooltipBehavior.componentWillLoad({\n\t\t\tlabel: this.cardCloseButtonProps.label,\n\t\t\talign: this.cardCloseButtonProps.tooltipAlign,\n\t\t});\n\t}\n\n\tprotected syncCardCloseTooltipListeners(): void {\n\t\tif (this.cardCloseButtonRef.el) {\n\t\t\tthis.cardCloseTooltipBehavior.syncListeners(undefined, this.cardCloseButtonRef.el, true);\n\t\t}\n\t}\n\n\tprotected teardownDialog(): void {\n\t\tthis.closeDialog();\n\t\tunlockScroll(this);\n\t\tthis.cardCloseTooltipBehavior.destroy();\n\t}\n\n\t// --- Prop application ---\n\n\tprotected applyLabel(value?: LabelPropType): void {\n\t\tlabelProp.apply(value, (v) => this.setRenderProp('label', v));\n\t}\n\n\tprotected applyLevel(value?: HeadingLevel): void {\n\t\tlevelProp.apply(value, (v) => this.setRenderProp('level', v));\n\t}\n\n\tprotected applyOn(value?: KoliBriDialogEventCallbacks): void {\n\t\tdialogCallbacksProp.apply(value, (v) => this.setRenderProp('on', v));\n\t}\n\n\tprotected applyVariant(value?: ModalVariantPropType): void {\n\t\tvariantDialogProp.apply(value, (v) => this.setRenderProp('variant', v));\n\t}\n\n\tprotected applyWidth(value?: string): void {\n\t\twidthProp.apply(value, (v) => this.setRenderProp('width', v));\n\t}\n\n\t// --- Dialog control ---\n\n\t/*\n\t * The optional chaining on the native methods is a workaround for HTMLDialogElement not being\n\t * implemented in jsdom, which would otherwise fail the Jest tests.\n\t */\n\n\tprotected showDialog(modal: boolean): void {\n\t\tconst dialog = this.dialogRef.el;\n\t\tif (dialog?.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState('modal', modal);\n\t\tif (modal) {\n\t\t\tdialog?.showModal?.();\n\t\t\tif (dialog) {\n\t\t\t\tlockScroll(this);\n\t\t\t}\n\t\t} else {\n\t\t\tdialog?.show?.();\n\t\t}\n\t}\n\n\tprotected closeDialog(): void {\n\t\tthis.dialogRef.el?.close?.();\n\t}\n\n\t// --- Event handling ---\n\n\tprivate readonly handleCancel = (event: Event): void => {\n\t\thandleCancelOverlay(event);\n\t\tif (event.defaultPrevented) return;\n\n\t\tthis.getRenderProp('on').onCancel?.(event);\n\t\tif (event.defaultPrevented) return;\n\n\t\tif (this.host && !dispatchDomEvent(this.host, KolEvent.cancel)) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tprivate readonly handleClose = (event: Event): void => {\n\t\t// Ignore close events that bubble up from child components (e.g. KolAlert).\n\t\t// Only react when the dialog element itself is the event origin.\n\t\tif (event.target !== this.dialogRef.el) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlockScroll(this);\n\t\tthis.getRenderProp('on').onClose?.();\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.close);\n\t\t}\n\t};\n\n\t/** The card's close button closes the dialog, which then fires its own native close event. */\n\tprivate readonly handleCardClose = (): void => {\n\t\tthis.cardCloseTooltipBehavior.hideTooltip();\n\t\tthis.closeDialog();\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.close);\n\t\t}\n\t};\n\n\t// --- Render ---\n\n\t/**\n\t * Stencil derives light-DOM slot relocation from the `<slot />` it finds in the element file,\n\t * so each element supplies its own through `renderSlot`.\n\t */\n\tprotected abstract renderSlot(): JSX.Element;\n\n\tprivate buildCardProps(): CardFCProps {\n\t\treturn {\n\t\t\tariaDescriptionId: this.getState('ariaDescriptionId'),\n\t\t\tcloseButtonProps: this.cardCloseButtonProps,\n\t\t\thandleBlur: NOOP,\n\t\t\thandleClose: this.handleCardClose,\n\t\t\thandleFocus: NOOP,\n\t\t\thasCloser: true,\n\t\t\theadingId: this.getState('headingId'),\n\t\t\thref: '',\n\t\t\tlabel: this.getRenderProp('label'),\n\t\t\tlevel: this.getRenderProp('level'),\n\t\t\ton: {},\n\t\t\trefCloseButton: this.cardCloseButtonRef,\n\t\t\trefCta: NOOP,\n\t\t\trefTooltip: this.cardCloseTooltipBehavior.setTooltipElementRef,\n\t\t\ttarget: '',\n\t\t};\n\t}\n\n\tprotected renderDialogFC(): JSX.Element {\n\t\tconst variant = this.getRenderProp('variant');\n\t\tconst isCard = variant === 'card';\n\n\t\treturn (\n\t\t\t<DialogFC\n\t\t\t\tblockClass={dialogBlockClass(variant)}\n\t\t\t\thandleCancel={this.handleCancel}\n\t\t\t\thandleClose={this.handleClose}\n\t\t\t\tlabel={this.getRenderProp('label')}\n\t\t\t\tlabelledBy={isCard ? this.getState('headingId') : undefined}\n\t\t\t\tmodal={this.getState('modal')}\n\t\t\t\trefDialog={this.dialogRef}\n\t\t\t\twidth={this.getRenderProp('width')}\n\t\t\t>\n\t\t\t\t{isCard ? <CardFC {...this.buildCardProps()}>{this.renderSlot()}</CardFC> : this.renderSlot()}\n\t\t\t</DialogFC>\n\t\t);\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAWO,MAAM,iBAAiB,GAAG;IAChC,QAAQ,E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AAC,EAClC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,SAAS,EAC3D,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAA,EAEjC,MAAM,GAAG,CAAA,CAAC,MAAM,EAAK,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CAAC,cAAc,EAAE,CAAG,EAAA,IAAI,CAAC,UAAU,EAAE,CAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CACnF;;AAGb;;;;"}
|
|
1
|
+
{"version":3,"file":"base-Cm_c8klt.js","sources":["src/internal/functional-components/dialog/api.tsx","src/components/dialog/base.tsx"],"sourcesContent":["import { dialogCallbacksProp, labelProp, levelProp, variantDialogProp, widthProp } from '../../props';\nimport type { ApiFromConfig, PropsConfigShape } from '../generic-types';\n\n/**\n * Props configuration for the dialog component.\n *\n * Notes on prop choices:\n * - `labelProp`, not `labelWithExpertSlotProp`: the label is either the `aria-label` of the blank\n * variant or the card's heading text — neither has an expert slot.\n * - `levelProp` only reaches the card variant's heading; the blank variant renders no heading.\n */\nexport const dialogPropsConfig = {\n\trequired: [labelProp],\n\toptional: [dialogCallbacksProp, levelProp, variantDialogProp, widthProp],\n} as const satisfies PropsConfigShape;\n\nexport type DialogApi = ApiFromConfig<\n\ttypeof dialogPropsConfig,\n\t{\n\t\t/** Both callbacks handle the native events of the `<dialog>` element. */\n\t\tCallbacks: {\n\t\t\tcancel: (event: Event) => void;\n\t\t\tclose: (event: Event) => void;\n\t\t};\n\t\tMethods: {\n\t\t\tclose: () => void;\n\t\t\tcloseModal: () => void;\n\t\t\topenModal: () => void;\n\t\t\tshow: (modal?: boolean) => void;\n\t\t\tshowModal: () => void;\n\t\t};\n\t\tRefs: {\n\t\t\tdialog: HTMLDialogElement;\n\t\t};\n\t\tStates: {\n\t\t\t/**\n\t\t\t * DOM id of the close button's visually-hidden description span, required by the card\n\t\t\t * variant's `ButtonFC`. Unused while that button carries no aria description.\n\t\t\t */\n\t\t\tariaDescriptionId: string;\n\t\t\t/**\n\t\t\t * DOM id of the card variant's heading, referenced by the `<dialog>`'s\n\t\t\t * `aria-labelledby`. Generated per instance.\n\t\t\t */\n\t\t\theadingId: string;\n\t\t\t/**\n\t\t\t * Whether the dialog is currently shown modally. Drives `aria-modal` and is set by\n\t\t\t * `show()`/`showModal()`.\n\t\t\t */\n\t\t\tmodal: boolean;\n\t\t};\n\t}\n>;\n","import type { JSX } from '@stencil/core';\nimport { h } from '@stencil/core';\n\nimport { BaseWebComponent } from '../../internal/functional-components/base-web-component';\nimport type { ResolvedButtonProps } from '../../internal/functional-components/button/resolve-props';\nimport { resolveCardCloseButtonProps } from '../../internal/functional-components/card/close-button';\nimport type { CardFCProps } from '../../internal/functional-components/card/component';\nimport { CardFC } from '../../internal/functional-components/card/component';\nimport type { DialogApi } from '../../internal/functional-components/dialog/api';\nimport { dialogPropsConfig } from '../../internal/functional-components/dialog/api';\nimport { dialogBlockClass, DialogFC } from '../../internal/functional-components/dialog/component';\nimport { TooltipBehavior } from '../../internal/functional-components/tooltip/behavior';\nimport { dialogCallbacksProp, labelProp, levelProp, variantDialogProp, widthProp } from '../../internal/props';\nimport type { HeadingLevel, KoliBriDialogEventCallbacks, LabelPropType } from '../../schema';\nimport type { ModalVariantPropType } from '../../schema/props/variant/modal';\nimport { createCtaRef } from '../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../utils/events';\nimport { lockScroll, unlockScroll } from '../../utils/scroll-lock';\nimport { handleCancelOverlay } from '../../utils/tooltip-open-tracking';\n\n/**\n * The card variant renders no link, so its anchor never exists: the card's own `_on` callbacks\n * describe that anchor, and its ref is never called.\n */\nconst NOOP = (): void => {};\n\n/**\n * Orchestrator shared by `kol-dialog` and the deprecated `kol-modal`. Both render the same\n * `DialogFC`; the concrete element only declares the Stencil members and delegates from its\n * watchers, methods and lifecycle hooks.\n *\n * The card variant renders `CardFC` directly, so this class also owns the close button's resolved\n * props, its tooltip behavior and its ref.\n */\nexport abstract class BaseDialogWebComponent extends BaseWebComponent<DialogApi> {\n\tprotected abstract readonly host?: HTMLElement;\n\n\tprotected readonly dialogRef = createCtaRef<HTMLDialogElement>();\n\tprivate readonly cardCloseButtonRef = createCtaRef<HTMLButtonElement>();\n\n\t/** Drives the card close button's tooltip — it renders with `hideLabel`, so its label lives there. */\n\tprivate readonly cardCloseTooltipBehavior = new TooltipBehavior(this.stateAccess);\n\n\t/** Resolved once in `componentWillLoad`: the close button's configuration never changes. */\n\tprivate cardCloseButtonProps!: ResolvedButtonProps;\n\n\t// --- Lifecycle ---\n\n\tprotected initDialogRenderProps(): void {\n\t\tthis.initRenderProps(dialogPropsConfig);\n\n\t\tthis.cardCloseButtonProps = resolveCardCloseButtonProps(this.host);\n\t\tthis.cardCloseTooltipBehavior.componentWillLoad({\n\t\t\tlabel: this.cardCloseButtonProps.label,\n\t\t\talign: this.cardCloseButtonProps.tooltipAlign,\n\t\t});\n\t}\n\n\tprotected syncCardCloseTooltipListeners(): void {\n\t\tif (this.cardCloseButtonRef.el) {\n\t\t\tthis.cardCloseTooltipBehavior.syncListeners(undefined, this.cardCloseButtonRef.el, true);\n\t\t}\n\t}\n\n\tprotected teardownDialog(): void {\n\t\tthis.closeDialog();\n\t\tunlockScroll(this);\n\t\tthis.cardCloseTooltipBehavior.destroy();\n\t}\n\n\t// --- Prop application ---\n\n\tprotected applyLabel(value?: LabelPropType): void {\n\t\tlabelProp.apply(value, (v) => this.setRenderProp('label', v));\n\t}\n\n\tprotected applyLevel(value?: HeadingLevel): void {\n\t\tlevelProp.apply(value, (v) => this.setRenderProp('level', v));\n\t}\n\n\tprotected applyOn(value?: KoliBriDialogEventCallbacks): void {\n\t\tdialogCallbacksProp.apply(value, (v) => this.setRenderProp('on', v));\n\t}\n\n\tprotected applyVariant(value?: ModalVariantPropType): void {\n\t\tvariantDialogProp.apply(value, (v) => this.setRenderProp('variant', v));\n\t}\n\n\tprotected applyWidth(value?: string): void {\n\t\twidthProp.apply(value, (v) => this.setRenderProp('width', v));\n\t}\n\n\t// --- Dialog control ---\n\n\t/*\n\t * The optional chaining on the native methods is a workaround for HTMLDialogElement not being\n\t * implemented in jsdom, which would otherwise fail the Jest tests.\n\t */\n\n\tprotected showDialog(modal: boolean): void {\n\t\tconst dialog = this.dialogRef.el;\n\t\tif (dialog?.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState('modal', modal);\n\t\tif (modal) {\n\t\t\tdialog?.showModal?.();\n\t\t\tif (dialog) {\n\t\t\t\tlockScroll(this);\n\t\t\t}\n\t\t} else {\n\t\t\tdialog?.show?.();\n\t\t}\n\t}\n\n\tprotected closeDialog(): void {\n\t\tthis.dialogRef.el?.close?.();\n\t}\n\n\t// --- Event handling ---\n\n\tprivate readonly handleCancel = (event: Event): void => {\n\t\thandleCancelOverlay(event);\n\t\tif (event.defaultPrevented) return;\n\n\t\tthis.getRenderProp('on').onCancel?.(event);\n\t\tif (event.defaultPrevented) return;\n\n\t\tif (this.host && !dispatchDomEvent(this.host, KolEvent.cancel)) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tprivate readonly handleClose = (event: Event): void => {\n\t\t// Ignore close events that bubble up from child components (e.g. KolAlert).\n\t\t// Only react when the dialog element itself is the event origin.\n\t\tif (event.target !== this.dialogRef.el) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlockScroll(this);\n\t\tthis.getRenderProp('on').onClose?.();\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.close);\n\t\t}\n\t};\n\n\t/** The card's close button closes the dialog, which then fires its own native close event. */\n\tprivate readonly handleCardClose = (): void => {\n\t\tthis.cardCloseTooltipBehavior.hideTooltip();\n\t\tthis.closeDialog();\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.close);\n\t\t}\n\t};\n\n\t// --- Render ---\n\n\t/**\n\t * Stencil derives light-DOM slot relocation from the `<slot />` it finds in the element file,\n\t * so each element supplies its own through `renderSlot`.\n\t */\n\tprotected abstract renderSlot(): JSX.Element;\n\n\tprivate buildCardProps(): CardFCProps {\n\t\treturn {\n\t\t\tariaDescriptionId: this.getState('ariaDescriptionId'),\n\t\t\tcloseButtonProps: this.cardCloseButtonProps,\n\t\t\thandleBlur: NOOP,\n\t\t\thandleClose: this.handleCardClose,\n\t\t\thandleFocus: NOOP,\n\t\t\thasCloser: true,\n\t\t\theadingId: this.getState('headingId'),\n\t\t\thref: '',\n\t\t\tlabel: this.getRenderProp('label'),\n\t\t\tlevel: this.getRenderProp('level'),\n\t\t\ton: {},\n\t\t\trefCloseButton: this.cardCloseButtonRef,\n\t\t\trefCta: NOOP,\n\t\t\trefTooltip: this.cardCloseTooltipBehavior.setTooltipElementRef,\n\t\t\ttarget: '',\n\t\t};\n\t}\n\n\tprotected renderDialogFC(): JSX.Element {\n\t\tconst variant = this.getRenderProp('variant');\n\t\tconst isCard = variant === 'card';\n\n\t\treturn (\n\t\t\t<DialogFC\n\t\t\t\tblockClass={dialogBlockClass(variant)}\n\t\t\t\thandleCancel={this.handleCancel}\n\t\t\t\thandleClose={this.handleClose}\n\t\t\t\tlabel={this.getRenderProp('label')}\n\t\t\t\tlabelledBy={isCard ? this.getState('headingId') : undefined}\n\t\t\t\tmodal={this.getState('modal')}\n\t\t\t\trefDialog={this.dialogRef}\n\t\t\t\twidth={this.getRenderProp('width')}\n\t\t\t>\n\t\t\t\t{isCard ? <CardFC {...this.buildCardProps()}>{this.renderSlot()}</CardFC> : this.renderSlot()}\n\t\t\t</DialogFC>\n\t\t);\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAWO,MAAM,iBAAiB,GAAG;IAChC,QAAQ,EAAE,CAAC,SAAS,CAAC;IACrB,QAAQ,EAAE,CAAC,mBAAmB,EAAE,SAAS,EAAE,iBAAiB,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,EAC3D,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAA,EAEjC,MAAM,GAAG,CAAA,CAAC,MAAM,EAAK,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CAAC,cAAc,EAAE,CAAG,EAAA,IAAI,CAAC,UAAU,EAAE,CAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CACnF;;AAGb;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h as i}from"./index-
|
|
5
|
-
//# sourceMappingURL=base-
|
|
4
|
+
import{h as i}from"./index-DQdQBwMc.js";import{s,X as t}from"./common-BqpMtheU.js";import{B as a}from"./base-web-component-3R1Dy3QK.js";import{b as e,e as o,a as h,c as r,d as l}from"./api-BvTefIaj.js";import{B as p}from"./component-CBpYh2q-.js";import{F as n}from"./behavior-DnkpB_7O.js";import{T as d,i as m}from"./behavior-D1kOlK6p.js";import{a as c,b as y,c as f,f as u,g as b,h as v,s as j,i as C,l as x,d as B,t as D,e as A,v as I}from"./variant-CeijQFzL.js";import{d as K}from"./disabled-CdyeAMlW.js";import{l as H}from"./label-with-expert-slot-CocPu9HB.js";import{n as T}from"./name-D8963H-v.js";import{v as g}from"./access-and-short-key-ijzCZfHm.js";import{c as S}from"./element-interaction-Cy9tx3Sx.js";import{d as w,K as F}from"./events-CRHxtwup.js";import{p as L,a as P}from"./controller-D1hrFVo3.js";class V extends a{constructor(){super(...arguments);this.ctaRef=S();this.tooltipBehavior=new d(this.stateAccess);this.handleClick=i=>{i.stopPropagation();this.tooltipBehavior.hideTooltip();const t=this.getRenderProp("type");if(t==="submit"){L({form:this.host})}else if(t==="reset"){P({form:this.host})}else{this.formAssociation.setFormAssociatedValue(this.formValue);const t=this.getRenderProp("on").onClick;if(typeof t==="function"){s(i,this.ctaRef.el);t(i,this.formValue)}}if(this.host){w(this.host,F.click,this.formValue)}};this.handleMouseDown=i=>{var s,t;(t=(s=this.getRenderProp("on")).onMouseDown)===null||t===void 0?void 0:t.call(s,i);if(this.host){w(this.host,F.mousedown)}};this.handleFocus=i=>{var s,t;(t=(s=this.getRenderProp("on")).onFocus)===null||t===void 0?void 0:t.call(s,i);if(this.host){w(this.host,F.focus)}};this.handleBlur=i=>{var s,t;(t=(s=this.getRenderProp("on")).onBlur)===null||t===void 0?void 0:t.call(s,i);if(this.host){w(this.host,F.blur)}}}initFormAssociation(){this.formAssociation=new n(a.stateLess,{host:this.host,type:"button"})}initButtonRenderProps(){this.initRenderProps(e);this.unsetRenderProp("tabIndex")}initTooltipBehavior(){this.tooltipBehavior.componentWillLoad({label:this.getRenderProp("label"),align:this.getRenderProp("tooltipAlign")})}syncTooltipListeners(){if(this.ctaRef.el){this.tooltipBehavior.syncListeners(undefined,this.ctaRef.el,true)}}destroyTooltipBehavior(){this.tooltipBehavior.destroy()}applyAccessKey(i,s){c.apply(i,(i=>this.setRenderProp("accessKey",i)));g(i,s)}applyAriaControls(i){y.apply(i,(i=>this.setRenderProp("ariaControls",i)))}applyAriaDescription(i){f.apply(i,(i=>this.setRenderProp("ariaDescription",i)))}applyAriaExpanded(i){u.apply(i,(i=>this.setRenderProp("ariaExpanded",i)))}applyAriaHasPopup(i){o.apply(i,(i=>this.setRenderProp("ariaHasPopup",i)))}applyAriaSelected(i){h.apply(i,(i=>this.setRenderProp("ariaSelected",i)))}applyCustomClass(i){b.apply(i,(i=>this.setRenderProp("customClass",i)))}applyDisabled(i){K.apply(i,(i=>this.setRenderProp("disabled",i)))}applyHideLabel(i){v.apply(i,(i=>this.setRenderProp("hideLabel",i)))}applyIcons(i){j.apply(i,(i=>this.setRenderProp("icons",i)))}applyId(i){m.apply(i,(i=>this.setRenderProp("id",i)))}applyInline(i){C.apply(i,(i=>this.setRenderProp("inline",i)))}applyLabel(i){H.apply(i,(i=>{this.setRenderProp("label",i);this.tooltipBehavior.watchLabel(i)}))}applyName(i){T.apply(i,(i=>this.setRenderProp("name",i)));this.formAssociation.watchName(i)}applyOn(i){r.apply(i,(i=>this.setRenderProp("on",i)))}applyRole(i){x.apply(i,(i=>this.setRenderProp("role",i)))}applyShortKey(i,s){B.apply(i,(i=>this.setRenderProp("shortKey",i)));g(s,i)}applySyncValueBySelector(i){this.formAssociation.watchSyncValueBySelector(i)}applyTabIndex(i){if(typeof i==="number"){D.apply(i,(i=>this.setRenderProp("tabIndex",i)))}else{this.unsetRenderProp("tabIndex")}}applyTooltipAlign(i){A.apply(i,(i=>{this.setRenderProp("tooltipAlign",i);this.tooltipBehavior.watchAlign(i)}))}applyType(i){l.apply(i,(i=>this.setRenderProp("type",i)))}applyValue(i){this.formValue=i;this.formAssociation.setFormAssociatedValue(i)}applyVariant(i){var s;I.apply((s=i!==null&&i!==void 0?i:t("buttonVariantDefault",this.host))!==null&&s!==void 0?s:"normal",(i=>this.setRenderProp("variant",i)))}getButtonFCProps(){return{accessKey:this.getRenderProp("accessKey"),ariaControls:this.getRenderProp("ariaControls"),ariaDescription:this.getRenderProp("ariaDescription"),ariaDescriptionId:this.getState("ariaDescriptionId"),ariaExpanded:this.getRenderProp("ariaExpanded"),ariaHasPopup:this.getRenderProp("ariaHasPopup"),ariaSelected:this.getRenderProp("ariaSelected"),customClass:this.getRenderProp("customClass"),disabled:this.getRenderProp("disabled"),handleBlur:this.handleBlur,handleClick:this.handleClick,handleFocus:this.handleFocus,handleMouseDown:this.handleMouseDown,hideLabel:this.getRenderProp("hideLabel"),icons:this.getRenderProp("icons"),id:this.getRenderProp("id"),inline:this.getRenderProp("inline"),label:this.getRenderProp("label"),name:this.getRenderProp("name"),on:this.getRenderProp("on"),refButton:this.ctaRef,refTooltip:this.tooltipBehavior.setTooltipElementRef,role:this.getRenderProp("role"),shortKey:this.getRenderProp("shortKey"),tabIndex:this.getRenderProp("tabIndex"),tooltipAlign:this.getRenderProp("tooltipAlign"),type:this.getRenderProp("type"),variant:this.getRenderProp("variant")}}renderButtonFC(){return i(p,Object.assign({},this.getButtonFCProps()))}}export{V as B};
|
|
5
|
+
//# sourceMappingURL=base-DitGpYOV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-B5F8ROuQ.js","sources":["src/components/button/base.tsx"],"sourcesContent":["import type { JSX } from '@stencil/core';\nimport { h } from '@stencil/core';\nimport { getFeatureFlag } from 'adopted-style-sheets';\n\nimport { BaseWebComponent } from '../../internal/functional-components/base-web-component';\nimport type { ButtonApi } from '../../internal/functional-components/button/api';\nimport { buttonPropsConfig } from '../../internal/functional-components/button/api';\nimport { ButtonFC } from '../../internal/functional-components/button/component';\nimport { FormAssociationBehavior } from '../../internal/functional-components/form-association/behavior';\nimport type { FunctionalComponentProps } from '../../internal/functional-components/generic-types';\nimport { TooltipBehavior } from '../../internal/functional-components/tooltip/behavior';\nimport {\n\taccessKeyProp,\n\tariaControlsProp,\n\tariaDescriptionProp,\n\tariaExpandedProp,\n\tariaHasPopupProp,\n\tariaSelectedProp,\n\tbuttonCallbacksProp,\n\tbuttonTypeProp,\n\tcustomClassProp,\n\tdisabledProp,\n\thideLabelProp,\n\tidProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tlinkRoleProp,\n\tnameProp,\n\tshortKeyProp,\n\tspanIconsProp,\n\ttabIndexProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../internal/props';\nimport type {\n\tAccessKeyPropType,\n\tAlternativeButtonLinkRolePropType,\n\tAriaDescriptionPropType,\n\tButtonCallbacksPropType,\n\tButtonTypePropType,\n\tCustomClassPropType,\n\tIconsPropType,\n\tIdPropType,\n\tInlinePropType,\n\tLabelWithExpertSlotPropType,\n\tShortKeyPropType,\n\tStencilUnknown,\n\tSyncValueBySelectorPropType,\n\tTooltipAlignPropType,\n\tVariantClassNamePropType,\n} from '../../schema';\nimport { setEventTarget } from '../../schema';\nimport type { AriaHasPopupPropType } from '../../schema/props/aria-has-popup';\nimport { validateAccessAndShortKey } from '../../schema/validators/access-and-short-key';\nimport { createCtaRef } from '../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../utils/events';\nimport { propagateResetEventToForm, propagateSubmitEventToForm } from '../form/controller';\n\n/**\n * Shared orchestrator implementation for every custom element that renders `ButtonFC`:\n * `kol-button`, `kol-button-link` and `kol-split-button`.\n *\n * The class carries everything that does not need a Stencil decorator — the composed\n * `TooltipBehavior`, the form-association adapter, the event handlers, one `apply*` method per\n * prop and the `ButtonFC` render call. The concrete element keeps what Stencil has to see in the\n * component class itself: `@Component`, `@Element`, `@State`, `@Method`, every `@Prop` with its\n * `@Watch` (whose body is a one-line call into the matching `apply*` method) and the lifecycle\n * methods, which delegate here (ARC42 § 9, design decision 16).\n *\n * This is not a layer between the web component and the functional component — it *is* the web\n * component's implementation, shared between the tag variants of one FC.\n */\nexport abstract class BaseButtonWebComponent extends BaseWebComponent<ButtonApi> {\n\t/** The custom element; declared with `@Element()` by the concrete class. */\n\tprotected abstract readonly host?: HTMLElement;\n\n\tprotected readonly ctaRef = createCtaRef<HTMLButtonElement>();\n\n\t// --- Composed behaviors ---\n\n\tprotected readonly tooltipBehavior = new TooltipBehavior(this.stateAccess);\n\n\tprivate formAssociation!: FormAssociationBehavior;\n\n\t/**\n\t * The raw `_value`. It is neither rendered nor normalized (see `buttonPropsConfig`), but the\n\t * click handler hands it to the consumer callback and the custom event, so the last applied\n\t * value is kept here.\n\t */\n\tprivate formValue?: StencilUnknown;\n\n\t/**\n\t * Creates the form association. Must be called from the concrete element's constructor (after\n\t * `super()`), not from this base class's constructor: Stencil registers the host element at the\n\t * start of the *component* class's constructor, so `this.host` is only populated once the base\n\t * constructor has returned.\n\t *\n\t * No name is passed, because the name is only applied in `componentWillLoad`. The button therefore\n\t * never creates a hidden form element (#11036).\n\t */\n\tprotected initFormAssociation(): void {\n\t\tthis.formAssociation = new FormAssociationBehavior(BaseWebComponent.stateLess, { host: this.host, type: 'button' });\n\t}\n\n\t// --- Lifecycle helpers (called from the concrete element's lifecycle methods) ---\n\n\t/**\n\t * Seeds the render props. Call first in `componentWillLoad`, before the prop watchers run.\n\t */\n\tprotected initButtonRenderProps(): void {\n\t\tthis.initRenderProps(buttonPropsConfig);\n\t\t// Seed `tabIndex` as unset before any watcher runs: an unset tabindex must not render as\n\t\t// `tabindex=\"0\"` — buttons are natively tabbable and the attribute would pin them into the\n\t\t// document tab order. `applyTabIndex` does the same for elements that expose `_tabIndex`,\n\t\t// but a `shadow: false` element can abort mid-initialization under SSR (the form association\n\t\t// finds no host with a shadow root, because `instanceof Element` fails in Stencil's mock DOM,\n\t\t// then throws on `attachInternals(undefined)`, and Stencil swallows the error but renders\n\t\t// anyway, #11034). Without this line the props config default `0` would survive such an abort.\n\t\tthis.unsetRenderProp('tabIndex');\n\t}\n\n\t/**\n\t * Hands the resolved label and alignment to the tooltip behavior. Call last in\n\t * `componentWillLoad`, after every prop watcher has run.\n\t */\n\tprotected initTooltipBehavior(): void {\n\t\tthis.tooltipBehavior.componentWillLoad({\n\t\t\tlabel: this.getRenderProp('label'),\n\t\t\talign: this.getRenderProp('tooltipAlign'),\n\t\t});\n\t}\n\n\t/** Call from `componentDidRender`. */\n\tprotected syncTooltipListeners(): void {\n\t\tif (this.ctaRef.el) {\n\t\t\tthis.tooltipBehavior.syncListeners(undefined, this.ctaRef.el, true);\n\t\t}\n\t}\n\n\t/** Call from `disconnectedCallback`. */\n\tprotected destroyTooltipBehavior(): void {\n\t\tthis.tooltipBehavior.destroy();\n\t}\n\n\t// --- Event handling ---\n\n\tprotected readonly handleClick = (event: MouseEvent): void => {\n\t\tevent.stopPropagation();\n\t\tthis.tooltipBehavior.hideTooltip();\n\n\t\tconst type = this.getRenderProp('type');\n\t\tif (type === 'submit') {\n\t\t\tpropagateSubmitEventToForm({ form: this.host, ref: this.ctaRef.el });\n\t\t} else if (type === 'reset') {\n\t\t\tpropagateResetEventToForm({ form: this.host, ref: this.ctaRef.el });\n\t\t} else {\n\t\t\t// TODO: Static form handling\n\t\t\tthis.formAssociation.setFormAssociatedValue(this.formValue);\n\n\t\t\tconst onClick = this.getRenderProp('on').onClick;\n\t\t\tif (typeof onClick === 'function') {\n\t\t\t\tsetEventTarget(event, this.ctaRef.el);\n\t\t\t\tonClick(event, this.formValue);\n\t\t\t}\n\t\t}\n\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.click, this.formValue);\n\t\t}\n\t};\n\n\tprotected readonly handleMouseDown = (event: MouseEvent): void => {\n\t\tthis.getRenderProp('on').onMouseDown?.(event);\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.mousedown);\n\t\t}\n\t};\n\n\tprotected readonly handleFocus = (event: FocusEvent): void => {\n\t\tthis.getRenderProp('on').onFocus?.(event);\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.focus);\n\t\t}\n\t};\n\n\tprotected readonly handleBlur = (event: FocusEvent): void => {\n\t\tthis.getRenderProp('on').onBlur?.(event);\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.blur);\n\t\t}\n\t};\n\n\t// --- Prop application (one per prop; the concrete element's watchers delegate here) ---\n\n\tprotected applyAccessKey(value?: AccessKeyPropType, shortKey?: ShortKeyPropType): void {\n\t\taccessKeyProp.apply(value, (v) => this.setRenderProp('accessKey', v));\n\t\tvalidateAccessAndShortKey(value, shortKey);\n\t}\n\n\tprotected applyAriaControls(value?: string): void {\n\t\tariaControlsProp.apply(value, (v) => this.setRenderProp('ariaControls', v));\n\t}\n\n\tprotected applyAriaDescription(value?: AriaDescriptionPropType): void {\n\t\tariaDescriptionProp.apply(value, (v) => this.setRenderProp('ariaDescription', v));\n\t}\n\n\tprotected applyAriaExpanded(value?: boolean): void {\n\t\tariaExpandedProp.apply(value, (v) => this.setRenderProp('ariaExpanded', v));\n\t}\n\n\tprotected applyAriaHasPopup(value?: AriaHasPopupPropType): void {\n\t\tariaHasPopupProp.apply(value, (v) => this.setRenderProp('ariaHasPopup', v));\n\t}\n\n\tprotected applyAriaSelected(value?: boolean): void {\n\t\tariaSelectedProp.apply(value, (v) => this.setRenderProp('ariaSelected', v));\n\t}\n\n\tprotected applyCustomClass(value?: CustomClassPropType): void {\n\t\tcustomClassProp.apply(value, (v) => this.setRenderProp('customClass', v));\n\t}\n\n\tprotected applyDisabled(value?: boolean): void {\n\t\tdisabledProp.apply(value, (v) => this.setRenderProp('disabled', v));\n\t}\n\n\tprotected applyHideLabel(value?: boolean): void {\n\t\thideLabelProp.apply(value, (v) => this.setRenderProp('hideLabel', v));\n\t}\n\n\tprotected applyIcons(value?: IconsPropType): void {\n\t\tspanIconsProp.apply(value, (v) => this.setRenderProp('icons', v));\n\t}\n\n\tprotected applyId(value?: IdPropType): void {\n\t\tidProp.apply(value, (v) => this.setRenderProp('id', v));\n\t}\n\n\tprotected applyInline(value?: InlinePropType): void {\n\t\tinlineProp.apply(value, (v) => this.setRenderProp('inline', v));\n\t}\n\n\tprotected applyLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tlabelWithExpertSlotProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('label', v);\n\t\t\tthis.tooltipBehavior.watchLabel(v);\n\t\t});\n\t}\n\n\tprotected applyName(value?: string): void {\n\t\tnameProp.apply(value, (v) => this.setRenderProp('name', v));\n\t\tthis.formAssociation.watchName(value);\n\t}\n\n\tprotected applyOn(value?: ButtonCallbacksPropType<StencilUnknown>): void {\n\t\tbuttonCallbacksProp.apply(value, (v) => this.setRenderProp('on', v));\n\t}\n\n\tprotected applyRole(value?: AlternativeButtonLinkRolePropType): void {\n\t\tlinkRoleProp.apply(value, (v) => this.setRenderProp('role', v));\n\t}\n\n\tprotected applyShortKey(value?: ShortKeyPropType, accessKey?: AccessKeyPropType): void {\n\t\tshortKeyProp.apply(value, (v) => this.setRenderProp('shortKey', v));\n\t\tvalidateAccessAndShortKey(accessKey, value);\n\t}\n\n\tprotected applySyncValueBySelector(value?: SyncValueBySelectorPropType): void {\n\t\tthis.formAssociation.watchSyncValueBySelector(value);\n\t}\n\n\tprotected applyTabIndex(value?: number): void {\n\t\t// The props config seeds `tabIndex` with its default `0`, but an unset tabindex must not\n\t\t// render as `tabindex=\"0\"` — buttons are natively tabbable and the attribute would pin them\n\t\t// into the document tab order. Unsetting the prop has to restore that state, so the else\n\t\t// branch is not optional: without it a reset would keep the previous number.\n\t\tif (typeof value === 'number') {\n\t\t\ttabIndexProp.apply(value, (v) => this.setRenderProp('tabIndex', v));\n\t\t} else {\n\t\t\tthis.unsetRenderProp('tabIndex');\n\t\t}\n\t}\n\n\tprotected applyTooltipAlign(value?: TooltipAlignPropType): void {\n\t\ttooltipAlignProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('tooltipAlign', v);\n\t\t\tthis.tooltipBehavior.watchAlign(v);\n\t\t});\n\t}\n\n\tprotected applyType(value?: ButtonTypePropType): void {\n\t\tbuttonTypeProp.apply(value, (v) => this.setRenderProp('type', v));\n\t}\n\n\tprotected applyValue(value?: StencilUnknown): void {\n\t\tthis.formValue = value;\n\t\tthis.formAssociation.setFormAssociatedValue(value);\n\t}\n\n\tprotected applyVariant(value?: VariantClassNamePropType): void {\n\t\t// Resolved here rather than as a `@Prop` default: a field initializer runs in the\n\t\t// constructor, where `@Element()` is not yet populated for a `shadow: false` element under\n\t\t// SSR, so the theme-scoped feature flag would silently be ignored there. Keeping it a\n\t\t// fallback also leaves the public API unchanged. The rendered default is `normal` either way.\n\t\tvariantProp.apply(value ?? getFeatureFlag('buttonVariantDefault', this.host) ?? 'normal', (v) => this.setRenderProp('variant', v));\n\t}\n\n\t// --- Render ---\n\n\t/**\n\t * Collects the current render props and state into the prop set `ButtonFC` expects. Separate\n\t * from `renderButtonFC` because a component that embeds the button inside its own markup\n\t * (`kol-split-button`) hands the set to its own functional component instead of rendering the\n\t * button here.\n\t */\n\tprotected getButtonFCProps(): FunctionalComponentProps<ButtonApi> {\n\t\treturn {\n\t\t\taccessKey: this.getRenderProp('accessKey'),\n\t\t\tariaControls: this.getRenderProp('ariaControls'),\n\t\t\tariaDescription: this.getRenderProp('ariaDescription'),\n\t\t\tariaDescriptionId: this.getState('ariaDescriptionId'),\n\t\t\tariaExpanded: this.getRenderProp('ariaExpanded'),\n\t\t\tariaHasPopup: this.getRenderProp('ariaHasPopup'),\n\t\t\tariaSelected: this.getRenderProp('ariaSelected'),\n\t\t\tcustomClass: this.getRenderProp('customClass'),\n\t\t\tdisabled: this.getRenderProp('disabled'),\n\t\t\thandleBlur: this.handleBlur,\n\t\t\thandleClick: this.handleClick,\n\t\t\thandleFocus: this.handleFocus,\n\t\t\thandleMouseDown: this.handleMouseDown,\n\t\t\thideLabel: this.getRenderProp('hideLabel'),\n\t\t\ticons: this.getRenderProp('icons'),\n\t\t\tid: this.getRenderProp('id'),\n\t\t\tinline: this.getRenderProp('inline'),\n\t\t\tlabel: this.getRenderProp('label'),\n\t\t\tname: this.getRenderProp('name'),\n\t\t\ton: this.getRenderProp('on'),\n\t\t\trefButton: this.ctaRef,\n\t\t\trefTooltip: this.tooltipBehavior.setTooltipElementRef,\n\t\t\trole: this.getRenderProp('role'),\n\t\t\tshortKey: this.getRenderProp('shortKey'),\n\t\t\ttabIndex: this.getRenderProp('tabIndex'),\n\t\t\ttooltipAlign: this.getRenderProp('tooltipAlign'),\n\t\t\ttype: this.getRenderProp('type'),\n\t\t\tvariant: this.getRenderProp('variant'),\n\t\t};\n\t}\n\n\t/** Renders `ButtonFC` from the current render props and state. */\n\tprotected renderButtonFC(): JSX.Element {\n\t\treturn <ButtonFC {...this.getButtonFCProps()} />;\n\t}\n}\n"],"names":["getFeatureFlag"],"mappings":";;;;;;;;;;;;;;;;;;;AAwEM,MAAgB,sBAAuB,SAAQ,gBAA2B,CAAA;AAAhF,IAAA,WAAA,GAAA;;AAIoB,QAAA,IAAM,CAAA,MAAA,GAAG,YAAY,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AI,CAAC,aAAa,CAAC,UAAU,CAAC;AACxC,YAAA,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;AAChD,YAAA,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;AAChC,YAAA,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;SACtC;;IAIQ,cAAc,GAAA;AACvB,QAAA,OAAO,CAAA,CAAC,QAAQ,EAAK,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CAAC,gBAAgB,EAAE,EAAI;;AAEjD;;;;"}
|
|
1
|
+
{"version":3,"file":"base-DitGpYOV.js","sources":["src/components/button/base.tsx"],"sourcesContent":["import type { JSX } from '@stencil/core';\nimport { h } from '@stencil/core';\nimport { getFeatureFlag } from 'adopted-style-sheets';\n\nimport { BaseWebComponent } from '../../internal/functional-components/base-web-component';\nimport type { ButtonApi } from '../../internal/functional-components/button/api';\nimport { buttonPropsConfig } from '../../internal/functional-components/button/api';\nimport { ButtonFC } from '../../internal/functional-components/button/component';\nimport { FormAssociationBehavior } from '../../internal/functional-components/form-association/behavior';\nimport type { FunctionalComponentProps } from '../../internal/functional-components/generic-types';\nimport { TooltipBehavior } from '../../internal/functional-components/tooltip/behavior';\nimport {\n\taccessKeyProp,\n\tariaControlsProp,\n\tariaDescriptionProp,\n\tariaExpandedProp,\n\tariaHasPopupProp,\n\tariaSelectedProp,\n\tbuttonCallbacksProp,\n\tbuttonTypeProp,\n\tcustomClassProp,\n\tdisabledProp,\n\thideLabelProp,\n\tidProp,\n\tinlineProp,\n\tlabelWithExpertSlotProp,\n\tlinkRoleProp,\n\tnameProp,\n\tshortKeyProp,\n\tspanIconsProp,\n\ttabIndexProp,\n\ttooltipAlignProp,\n\tvariantProp,\n} from '../../internal/props';\nimport type {\n\tAccessKeyPropType,\n\tAlternativeButtonLinkRolePropType,\n\tAriaDescriptionPropType,\n\tButtonCallbacksPropType,\n\tButtonTypePropType,\n\tCustomClassPropType,\n\tIconsPropType,\n\tIdPropType,\n\tInlinePropType,\n\tLabelWithExpertSlotPropType,\n\tShortKeyPropType,\n\tStencilUnknown,\n\tSyncValueBySelectorPropType,\n\tTooltipAlignPropType,\n\tVariantClassNamePropType,\n} from '../../schema';\nimport { setEventTarget } from '../../schema';\nimport type { AriaHasPopupPropType } from '../../schema/props/aria-has-popup';\nimport { validateAccessAndShortKey } from '../../schema/validators/access-and-short-key';\nimport { createCtaRef } from '../../utils/element-interaction';\nimport { dispatchDomEvent, KolEvent } from '../../utils/events';\nimport { propagateResetEventToForm, propagateSubmitEventToForm } from '../form/controller';\n\n/**\n * Shared orchestrator implementation for every custom element that renders `ButtonFC`:\n * `kol-button`, `kol-button-link` and `kol-split-button`.\n *\n * The class carries everything that does not need a Stencil decorator — the composed\n * `TooltipBehavior`, the form-association adapter, the event handlers, one `apply*` method per\n * prop and the `ButtonFC` render call. The concrete element keeps what Stencil has to see in the\n * component class itself: `@Component`, `@Element`, `@State`, `@Method`, every `@Prop` with its\n * `@Watch` (whose body is a one-line call into the matching `apply*` method) and the lifecycle\n * methods, which delegate here (ARC42 § 9, design decision 16).\n *\n * This is not a layer between the web component and the functional component — it *is* the web\n * component's implementation, shared between the tag variants of one FC.\n */\nexport abstract class BaseButtonWebComponent extends BaseWebComponent<ButtonApi> {\n\t/** The custom element; declared with `@Element()` by the concrete class. */\n\tprotected abstract readonly host?: HTMLElement;\n\n\tprotected readonly ctaRef = createCtaRef<HTMLButtonElement>();\n\n\t// --- Composed behaviors ---\n\n\tprotected readonly tooltipBehavior = new TooltipBehavior(this.stateAccess);\n\n\tprivate formAssociation!: FormAssociationBehavior;\n\n\t/**\n\t * The raw `_value`. It is neither rendered nor normalized (see `buttonPropsConfig`), but the\n\t * click handler hands it to the consumer callback and the custom event, so the last applied\n\t * value is kept here.\n\t */\n\tprivate formValue?: StencilUnknown;\n\n\t/**\n\t * Creates the form association. Must be called from the concrete element's constructor (after\n\t * `super()`), not from this base class's constructor: Stencil registers the host element at the\n\t * start of the *component* class's constructor, so `this.host` is only populated once the base\n\t * constructor has returned.\n\t *\n\t * No name is passed, because the name is only applied in `componentWillLoad`. The button therefore\n\t * never creates a hidden form element (#11036).\n\t */\n\tprotected initFormAssociation(): void {\n\t\tthis.formAssociation = new FormAssociationBehavior(BaseWebComponent.stateLess, { host: this.host, type: 'button' });\n\t}\n\n\t// --- Lifecycle helpers (called from the concrete element's lifecycle methods) ---\n\n\t/**\n\t * Seeds the render props. Call first in `componentWillLoad`, before the prop watchers run.\n\t */\n\tprotected initButtonRenderProps(): void {\n\t\tthis.initRenderProps(buttonPropsConfig);\n\t\t// Seed `tabIndex` as unset before any watcher runs: an unset tabindex must not render as\n\t\t// `tabindex=\"0\"` — buttons are natively tabbable and the attribute would pin them into the\n\t\t// document tab order. `applyTabIndex` does the same for elements that expose `_tabIndex`,\n\t\t// but a `shadow: false` element can abort mid-initialization under SSR (the form association\n\t\t// finds no host with a shadow root, because `instanceof Element` fails in Stencil's mock DOM,\n\t\t// then throws on `attachInternals(undefined)`, and Stencil swallows the error but renders\n\t\t// anyway, #11034). Without this line the props config default `0` would survive such an abort.\n\t\tthis.unsetRenderProp('tabIndex');\n\t}\n\n\t/**\n\t * Hands the resolved label and alignment to the tooltip behavior. Call last in\n\t * `componentWillLoad`, after every prop watcher has run.\n\t */\n\tprotected initTooltipBehavior(): void {\n\t\tthis.tooltipBehavior.componentWillLoad({\n\t\t\tlabel: this.getRenderProp('label'),\n\t\t\talign: this.getRenderProp('tooltipAlign'),\n\t\t});\n\t}\n\n\t/** Call from `componentDidRender`. */\n\tprotected syncTooltipListeners(): void {\n\t\tif (this.ctaRef.el) {\n\t\t\tthis.tooltipBehavior.syncListeners(undefined, this.ctaRef.el, true);\n\t\t}\n\t}\n\n\t/** Call from `disconnectedCallback`. */\n\tprotected destroyTooltipBehavior(): void {\n\t\tthis.tooltipBehavior.destroy();\n\t}\n\n\t// --- Event handling ---\n\n\tprotected readonly handleClick = (event: MouseEvent): void => {\n\t\tevent.stopPropagation();\n\t\tthis.tooltipBehavior.hideTooltip();\n\n\t\tconst type = this.getRenderProp('type');\n\t\tif (type === 'submit') {\n\t\t\tpropagateSubmitEventToForm({ form: this.host, ref: this.ctaRef.el });\n\t\t} else if (type === 'reset') {\n\t\t\tpropagateResetEventToForm({ form: this.host, ref: this.ctaRef.el });\n\t\t} else {\n\t\t\t// TODO: Static form handling\n\t\t\tthis.formAssociation.setFormAssociatedValue(this.formValue);\n\n\t\t\tconst onClick = this.getRenderProp('on').onClick;\n\t\t\tif (typeof onClick === 'function') {\n\t\t\t\tsetEventTarget(event, this.ctaRef.el);\n\t\t\t\tonClick(event, this.formValue);\n\t\t\t}\n\t\t}\n\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.click, this.formValue);\n\t\t}\n\t};\n\n\tprotected readonly handleMouseDown = (event: MouseEvent): void => {\n\t\tthis.getRenderProp('on').onMouseDown?.(event);\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.mousedown);\n\t\t}\n\t};\n\n\tprotected readonly handleFocus = (event: FocusEvent): void => {\n\t\tthis.getRenderProp('on').onFocus?.(event);\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.focus);\n\t\t}\n\t};\n\n\tprotected readonly handleBlur = (event: FocusEvent): void => {\n\t\tthis.getRenderProp('on').onBlur?.(event);\n\t\tif (this.host) {\n\t\t\tdispatchDomEvent(this.host, KolEvent.blur);\n\t\t}\n\t};\n\n\t// --- Prop application (one per prop; the concrete element's watchers delegate here) ---\n\n\tprotected applyAccessKey(value?: AccessKeyPropType, shortKey?: ShortKeyPropType): void {\n\t\taccessKeyProp.apply(value, (v) => this.setRenderProp('accessKey', v));\n\t\tvalidateAccessAndShortKey(value, shortKey);\n\t}\n\n\tprotected applyAriaControls(value?: string): void {\n\t\tariaControlsProp.apply(value, (v) => this.setRenderProp('ariaControls', v));\n\t}\n\n\tprotected applyAriaDescription(value?: AriaDescriptionPropType): void {\n\t\tariaDescriptionProp.apply(value, (v) => this.setRenderProp('ariaDescription', v));\n\t}\n\n\tprotected applyAriaExpanded(value?: boolean): void {\n\t\tariaExpandedProp.apply(value, (v) => this.setRenderProp('ariaExpanded', v));\n\t}\n\n\tprotected applyAriaHasPopup(value?: AriaHasPopupPropType): void {\n\t\tariaHasPopupProp.apply(value, (v) => this.setRenderProp('ariaHasPopup', v));\n\t}\n\n\tprotected applyAriaSelected(value?: boolean): void {\n\t\tariaSelectedProp.apply(value, (v) => this.setRenderProp('ariaSelected', v));\n\t}\n\n\tprotected applyCustomClass(value?: CustomClassPropType): void {\n\t\tcustomClassProp.apply(value, (v) => this.setRenderProp('customClass', v));\n\t}\n\n\tprotected applyDisabled(value?: boolean): void {\n\t\tdisabledProp.apply(value, (v) => this.setRenderProp('disabled', v));\n\t}\n\n\tprotected applyHideLabel(value?: boolean): void {\n\t\thideLabelProp.apply(value, (v) => this.setRenderProp('hideLabel', v));\n\t}\n\n\tprotected applyIcons(value?: IconsPropType): void {\n\t\tspanIconsProp.apply(value, (v) => this.setRenderProp('icons', v));\n\t}\n\n\tprotected applyId(value?: IdPropType): void {\n\t\tidProp.apply(value, (v) => this.setRenderProp('id', v));\n\t}\n\n\tprotected applyInline(value?: InlinePropType): void {\n\t\tinlineProp.apply(value, (v) => this.setRenderProp('inline', v));\n\t}\n\n\tprotected applyLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tlabelWithExpertSlotProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('label', v);\n\t\t\tthis.tooltipBehavior.watchLabel(v);\n\t\t});\n\t}\n\n\tprotected applyName(value?: string): void {\n\t\tnameProp.apply(value, (v) => this.setRenderProp('name', v));\n\t\tthis.formAssociation.watchName(value);\n\t}\n\n\tprotected applyOn(value?: ButtonCallbacksPropType<StencilUnknown>): void {\n\t\tbuttonCallbacksProp.apply(value, (v) => this.setRenderProp('on', v));\n\t}\n\n\tprotected applyRole(value?: AlternativeButtonLinkRolePropType): void {\n\t\tlinkRoleProp.apply(value, (v) => this.setRenderProp('role', v));\n\t}\n\n\tprotected applyShortKey(value?: ShortKeyPropType, accessKey?: AccessKeyPropType): void {\n\t\tshortKeyProp.apply(value, (v) => this.setRenderProp('shortKey', v));\n\t\tvalidateAccessAndShortKey(accessKey, value);\n\t}\n\n\tprotected applySyncValueBySelector(value?: SyncValueBySelectorPropType): void {\n\t\tthis.formAssociation.watchSyncValueBySelector(value);\n\t}\n\n\tprotected applyTabIndex(value?: number): void {\n\t\t// The props config seeds `tabIndex` with its default `0`, but an unset tabindex must not\n\t\t// render as `tabindex=\"0\"` — buttons are natively tabbable and the attribute would pin them\n\t\t// into the document tab order. Unsetting the prop has to restore that state, so the else\n\t\t// branch is not optional: without it a reset would keep the previous number.\n\t\tif (typeof value === 'number') {\n\t\t\ttabIndexProp.apply(value, (v) => this.setRenderProp('tabIndex', v));\n\t\t} else {\n\t\t\tthis.unsetRenderProp('tabIndex');\n\t\t}\n\t}\n\n\tprotected applyTooltipAlign(value?: TooltipAlignPropType): void {\n\t\ttooltipAlignProp.apply(value, (v) => {\n\t\t\tthis.setRenderProp('tooltipAlign', v);\n\t\t\tthis.tooltipBehavior.watchAlign(v);\n\t\t});\n\t}\n\n\tprotected applyType(value?: ButtonTypePropType): void {\n\t\tbuttonTypeProp.apply(value, (v) => this.setRenderProp('type', v));\n\t}\n\n\tprotected applyValue(value?: StencilUnknown): void {\n\t\tthis.formValue = value;\n\t\tthis.formAssociation.setFormAssociatedValue(value);\n\t}\n\n\tprotected applyVariant(value?: VariantClassNamePropType): void {\n\t\t// Resolved here rather than as a `@Prop` default: a field initializer runs in the\n\t\t// constructor, where `@Element()` is not yet populated for a `shadow: false` element under\n\t\t// SSR, so the theme-scoped feature flag would silently be ignored there. Keeping it a\n\t\t// fallback also leaves the public API unchanged. The rendered default is `normal` either way.\n\t\tvariantProp.apply(value ?? getFeatureFlag('buttonVariantDefault', this.host) ?? 'normal', (v) => this.setRenderProp('variant', v));\n\t}\n\n\t// --- Render ---\n\n\t/**\n\t * Collects the current render props and state into the prop set `ButtonFC` expects. Separate\n\t * from `renderButtonFC` because a component that embeds the button inside its own markup\n\t * (`kol-split-button`) hands the set to its own functional component instead of rendering the\n\t * button here.\n\t */\n\tprotected getButtonFCProps(): FunctionalComponentProps<ButtonApi> {\n\t\treturn {\n\t\t\taccessKey: this.getRenderProp('accessKey'),\n\t\t\tariaControls: this.getRenderProp('ariaControls'),\n\t\t\tariaDescription: this.getRenderProp('ariaDescription'),\n\t\t\tariaDescriptionId: this.getState('ariaDescriptionId'),\n\t\t\tariaExpanded: this.getRenderProp('ariaExpanded'),\n\t\t\tariaHasPopup: this.getRenderProp('ariaHasPopup'),\n\t\t\tariaSelected: this.getRenderProp('ariaSelected'),\n\t\t\tcustomClass: this.getRenderProp('customClass'),\n\t\t\tdisabled: this.getRenderProp('disabled'),\n\t\t\thandleBlur: this.handleBlur,\n\t\t\thandleClick: this.handleClick,\n\t\t\thandleFocus: this.handleFocus,\n\t\t\thandleMouseDown: this.handleMouseDown,\n\t\t\thideLabel: this.getRenderProp('hideLabel'),\n\t\t\ticons: this.getRenderProp('icons'),\n\t\t\tid: this.getRenderProp('id'),\n\t\t\tinline: this.getRenderProp('inline'),\n\t\t\tlabel: this.getRenderProp('label'),\n\t\t\tname: this.getRenderProp('name'),\n\t\t\ton: this.getRenderProp('on'),\n\t\t\trefButton: this.ctaRef,\n\t\t\trefTooltip: this.tooltipBehavior.setTooltipElementRef,\n\t\t\trole: this.getRenderProp('role'),\n\t\t\tshortKey: this.getRenderProp('shortKey'),\n\t\t\ttabIndex: this.getRenderProp('tabIndex'),\n\t\t\ttooltipAlign: this.getRenderProp('tooltipAlign'),\n\t\t\ttype: this.getRenderProp('type'),\n\t\t\tvariant: this.getRenderProp('variant'),\n\t\t};\n\t}\n\n\t/** Renders `ButtonFC` from the current render props and state. */\n\tprotected renderButtonFC(): JSX.Element {\n\t\treturn <ButtonFC {...this.getButtonFCProps()} />;\n\t}\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Ae,CAAC,oBAAoB;AACrD,YAAA,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;AAChC,YAAA,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;AACxC,YAAA,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;AACxC,YAAA,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;AAChD,YAAA,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;AAChC,YAAA,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;SACtC;;IAIQ,cAAc,GAAA;AACvB,QAAA,OAAO,CAAA,CAAC,QAAQ,EAAK,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CAAC,gBAAgB,EAAE,EAAI;;AAEjD;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* KoliBri - The accessible HTML-Standard
|
|
3
|
+
*/
|
|
4
|
+
import{n as e,p as s}from"./common-BqpMtheU.js";import{a as t,d as i,t as o,v as r}from"./variant-CeijQFzL.js";import{h as a,g as n,I as l}from"./input-container-DROwwh7_.js";import{c as d}from"./base-web-component-3R1Dy3QK.js";import{m as c}from"./multiple-C3PDF11P.js";import{r as u}from"./required-9s98RyZz.js";import{r as h}from"./rows-ewozPs33.js";import{f as p,i as f,g as b,c as m,B as v,F as y}from"./api-BAEPnyL7.js";import{h as j,F as O}from"./index-DQdQBwMc.js";import{v as B}from"./access-and-short-key-ijzCZfHm.js";import{c as g}from"./clsx-COFh-Vc8.js";import{h as w,c as A}from"./label-c9P7yC4V.js";import{f as P}from"./options-B0rBHetL.js";import{a as K}from"./tslib.es6-QNbPBOk5.js";import{g as q}from"./block-bem-DxQXsOt3.js";const x=s=>{if(typeof s==="object"&&s!==null){if(typeof s.label==="string"&&s.label.length>0){s.disabled=s.disabled===true;s.label=`${s.label}`.trim();if(w(s.label,3)===false&&A(s.label)===false){e(`A differing Aria-Label (${s.label}) is inaccessible. A differing Aria-Label should consist of at least three readable characters.`)}if(Array.isArray(s.options)){return s.options.find((e=>x(e)===false))===undefined}return true}else if(typeof s.label==="number"){return true}}return false};function k(e){const t=typeof e==="string"?s(e):e;if(Array.isArray(t)&&t.every((e=>x(e)))){return t}throw new Error("Invalid select options")}const D=d("options",[],k);const L=d("value",[],(e=>Array.isArray(e)?e:[e]));const C={required:[...p.required],optional:[...p.optional,t,a,c,D,u,h,L,i,o,r]};const V=q("kol-select");const E=e=>{var{class:s,index:t,selectedValue:i,selected:o,value:r,label:a,disabled:n}=e,l=K(e,["class","index","selectedValue","selected","value","label","disabled"]);const d=i===undefined?[]:Array.isArray(i)?i:[i];const c=o||d.includes(r);return j("option",Object.assign({class:g(V("option",{selected:Boolean(c),disabled:Boolean(n)}),s),selected:c,disabled:n,value:t},l),a)};const F=({preKey:e,options:s,disabled:t,value:i,OptionProps:o={},OptionGroupProps:r={}})=>{if(!(s===null||s===void 0?void 0:s.length)){return null}return j(O,null,s.map(((s,a)=>{var n;const l=[e,`-${a}`].join("");if("options"in s){if(!((n=s.options)===null||n===void 0?void 0:n.length)){return null}const e=Boolean(t||s.disabled);const{label:a}=s,d=K(s,["label"]);return j("optgroup",Object.assign({class:V("optgroup",{disabled:e}),key:l},r,{label:a===null||a===void 0?void 0:a.toString(),disabled:e}),j(F,Object.assign({OptionGroupProps:r,OptionProps:o,value:i,preKey:l},d,{disabled:e})))}if("value"in s){return j(E,Object.assign({key:l},o,{index:l,selectedValue:i},s,{disabled:Boolean(t||s.disabled)}))}return null})))};const $=e=>{const{class:s,msg:t,touched:i,disabled:o,required:r,options:a,value:n,OptionProps:l,OptionGroupProps:d,ariaDescribedBy:c,hideLabel:u,label:h}=e,p=K(e,["class","msg","touched","disabled","required","options","value","OptionProps","OptionGroupProps","ariaDescribedBy","hideLabel","label"]);const v=Object.assign(Object.assign({class:g(V(Object.assign({disabled:Boolean(o),required:Boolean(r),touched:Boolean(i)},f(t,i)?{[b(t)]:true}:{})),s),required:r,disabled:o},m({ariaDescribedBy:c,hideLabel:u,label:h})),p);return j("select",Object.assign({},v),j(F,{OptionGroupProps:d,OptionProps:l,disabled:o,options:a,value:n}))};const I=(e,s,t)=>{const i=Array.isArray(e);if(s){if(e!==undefined&&!i){throw new Error(`↑ The schema for the property (_value) is not valid for multiple mode. Expected an array. The value will not be changed. (${t} = ${JSON.stringify(e)})`)}}else if(i){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. (${t} = ${JSON.stringify(e)})`)}};const Q=(e,s=false)=>e.flatMap((e=>"options"in e&&Array.isArray(e.options)?Q(e.options,Boolean(s||e.disabled)):[Object.assign(Object.assign({},e),{disabled:Boolean(s||e.disabled)})]));const z=(e,s,t)=>{if(s.length===0){return e}const i=Q(s);const o=i.map((e=>e.value));const r=e.every((e=>o.includes(e)))?e:e.filter((e=>o.includes(e)));if(t===false&&r.length===0){const e=i.find((e=>e.disabled!==true));return e?[e.value]:r}return r};class G extends v{constructor(){super(...arguments);this.keyOptionMap=new Map;this.hasValue=true;this.handleSelectInput=e=>{var s;const t=Array.from(((s=this.ctaRef.el)===null||s===void 0?void 0:s.options)||[]).filter((e=>e.selected)).map((e=>{var s;return(s=this.keyOptionMap.get(e.value))===null||s===void 0?void 0:s.value}));if(this._multiple){this._value=t;this.handleInput(e,t)}else{const s=t.length>0?t[0]:undefined;this._value=s;this.handleInput(e,s)}};this.handleSelectChange=e=>{const s=this._value;this.handleChange(e,s);this.hasValue=!!s}}applyAccessKey(e){t.apply(e,(e=>this.setRenderProp("accessKey",e)));B(e,this.getShortKeyProp())}applyShortKey(e){i.apply(e,(e=>this.setRenderProp("shortKey",e)));B(this.getAccessKeyProp(),e)}applyIcons(e){a.apply(e,(e=>this.setRenderProp("icons",e)))}applyMultiple(e){I(this._value,e===true,"current");c.apply(e,(e=>{this.setRenderProp("multiple",e);this.setRenderProp("value",z(this.getRenderProp("value"),this.getRenderProp("options"),this._multiple))}))}applyOptions(e){D.apply(e,(e=>{this.setRenderProp("options",e);if(e.length>0){this.keyOptionMap.clear();P(this.keyOptionMap,e);this.setRenderProp("value",z(this.getRenderProp("value"),e,this._multiple))}}))}applyRequired(e){u.apply(e,(e=>this.setRenderProp("required",e)))}applyRows(e){h.apply(e,(e=>this.setRenderProp("rows",e)))}applyTabIndex(e){o.apply(e,(e=>this.setRenderProp("tabIndex",e)))}applyValue(e){I(e,this._multiple===true,"received");const s=e=>{const s=z(e,this.getRenderProp("options"),this._multiple);this.setRenderProp("value",s);this.formAssociation.setFormAssociatedValue(this.getModelValue())};if(e===null){s([null])}else{L.apply(e,s)}}applyVariant(e){r.apply(e,(e=>this.setRenderProp("variant",e)))}getModelValue(){const e=this.getRenderProp("value");if(this._multiple){return e}return Array.isArray(e)&&e.length>0?e[0]:e}getSelectProps(){const{ariaDescribedBy:e,hasError:s}=this.getAria();const t=this.getRenderProp("multiple");const i=this.getRenderProp("shortKey");return Object.assign(Object.assign({id:this.getState("id"),hideLabel:this.getRenderProp("hideLabel"),label:this.getRenderProp("label"),value:this.getRenderProp("value"),options:this.getRenderProp("options"),accessKey:this.getRenderProp("accessKey")||undefined,disabled:this.getRenderProp("disabled"),name:this.getRenderProp("name")||undefined,"aria-invalid":s?"true":undefined,ariaDescribedBy:e,size:t?this.getRenderProp("rows"):undefined,multiple:t,required:this.getRenderProp("required"),touched:this.getRenderProp("touched"),msg:this.getRenderProp("msg")},i?{"aria-keyshortcuts":i}:{}),{ref:this.ctaRef,onBlur:this.handleBlur,onChange:this.handleSelectChange,onClick:this.handleClick,onFocus:this.handleFocus,onInput:this.handleSelectInput,onKeyDown:this.handleKeyDown})}renderSelectField(){const e=this.getRenderProp("disabled");const{startAdornment:s,endAdornment:t}=n({icons:this.getRenderProp("icons")});return j(y,Object.assign({},this.getFormFieldProps({class:g("kol-form-field-select",{"kol-form-field--has-value":this.hasValue}),accessKey:this.getRenderProp("accessKey")||undefined,shortKey:this.getRenderProp("shortKey")||undefined,required:this.getRenderProp("required"),variant:this.getRenderProp("variant")}),{onClick:()=>{var e;return(e=this.ctaRef.el)===null||e===void 0?void 0:e.focus()}}),j(l,{disabled:e,msg:this.getRenderProp("msg"),touched:this.getRenderProp("touched"),startAdornment:s,endAdornment:t},j($,Object.assign({},this.getSelectProps()))))}}export{G as B,C as s};
|
|
5
|
+
//# sourceMappingURL=base-web-component-6J5sCsnZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-web-component-6J5sCsnZ.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":[],"mappings":";;;;;;;;;;;;;;;;;;;AAIO,MAAM,0BAA0B,GAAG,CAAI,MAAuB,KAAa;IACjF,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;AAClD,QAAA,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAChE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,IAAI;YAC1C,MAAM,CAAC,KAAK,GAAG,CAAG,EAAA,MAAM,CAAC,KAAK,CAAE,CAAA,CAAC,IAAI,EAAE;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C,CAAC,IACF,OAAO,EAAE,MAAK,UAAC,OAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,EAAE,0CAAE,KAAK,EAAE,CAAA,EAAA,EAAA,CAAA,EAEtC,CAAA,CAAC,gBAAgB,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,EAE1B,CAAC,CAAA,QAAQ,EAAK,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,CAAC,cAAc,EAAE,CAAI,CAAA,CACrB,CACN;;AAGhB;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import"./common-BqpMtheU.js";import{a as t,d as e,v as s}from"./variant-CeijQFzL.js";import{a as i,S as a}from"./suggestions-
|
|
5
|
-
//# sourceMappingURL=base-web-component-
|
|
4
|
+
import"./common-BqpMtheU.js";import{a as t,d as e,v as s}from"./variant-CeijQFzL.js";import{a as i,S as a}from"./suggestions-BYMmW1aV.js";import{h as o,g as n}from"./input-container-DROwwh7_.js";import{c as r,b as h,B as l}from"./base-web-component-3R1Dy3QK.js";import{p as d}from"./placeholder-DYTECYZp.js";import{r as p}from"./read-only-CUfitD4v.js";import{r as u}from"./required-9s98RyZz.js";import{s as c}from"./smart-button-FqAnsJDb.js";import{s as m}from"./value-string-DTwx9glt.js";import{f as y,B as f}from"./api-BAEPnyL7.js";import{h as v}from"./index-DQdQBwMc.js";import{p as j}from"./controller-D1hrFVo3.js";import{v as b}from"./access-and-short-key-ijzCZfHm.js";import{c as g}from"./clsx-COFh-Vc8.js";import{c as O}from"./element-interaction-Cy9tx3Sx.js";import{C as x}from"./behavior-CH_2MMuX.js";const B=r("pattern",undefined,h);const C={required:[...y.required],optional:[...y.optional,t,i,o,B,d,p,u,e,c,m,s]};class K extends f{constructor(){super(...arguments);this.ctaRef=O();this.counter=new x(l.stateLess);this.hasValue=false;this.handleTextInput=t=>{this._value=t.target.value;this.handleInput(t)};this.handleTextChange=(t,e)=>{this.handleChange(t,e);this.hasValue=Boolean(e!==null&&e!==void 0?e:t.target.value)};this.handleTextFocus=t=>{var e,s;this.handleFocus(t);this.counter.retriggerAria((s=(e=this._value)===null||e===void 0?void 0:e.length)!==null&&s!==void 0?s:0)};this.handleTextKeyDown=t=>{var e,s;this.handleKeyDown(t);this.counter.handleKeyDown(t,(s=(e=this.ctaRef.el)===null||e===void 0?void 0:e.value.length)!==null&&s!==void 0?s:0);if(t.code==="Enter"||t.code==="NumpadEnter"){j({form:this.host})}}}get textShared(){return this}initHasValue(){this.hasValue=Boolean(this.textShared.getRenderProp("value"))}didLoadTextInput(){var t,e;if(this.counter.hasCounter()||this.counter.hasSoftLimit()){this.counter.updateImmediate((e=(t=this._value)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)}}destroyTextInput(){this.destroyFormField();this.counter.destroy()}applyAccessKey(e){t.apply(e,(t=>this.textShared.setRenderProp("accessKey",t)));b(e,this._shortKey)}applyAutoComplete(t){i.apply(t,(t=>this.textShared.setRenderProp("autoComplete",t)))}applyIcons(t){o.apply(t,(t=>this.textShared.setRenderProp("icons",t)))}applyPattern(t){B.apply(t,(t=>this.textShared.setRenderProp("pattern",t)))}applyPlaceholder(t){d.apply(t,(t=>this.textShared.setRenderProp("placeholder",t)))}applyReadOnly(t){p.apply(t,(t=>this.textShared.setRenderProp("readOnly",t)))}applyRequired(t){u.apply(t,(t=>this.textShared.setRenderProp("required",t)))}applyShortKey(t){e.apply(t,(t=>this.textShared.setRenderProp("shortKey",t)));b(this._accessKey,t)}applySmartButton(t){if(t===undefined||t===null){this.textShared.unsetRenderProp("smartButton")}else{c.apply(t,(t=>this.textShared.setRenderProp("smartButton",t)))}}applyValue(t){var e;this.initValue(t);this.counter.update((e=t===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)}initValue(t){m.apply(t,(t=>this.textShared.setRenderProp("value",t)));this.formAssociation.setFormAssociatedValue(this.textShared.getRenderProp("value"))}initMaxLength(t){this.counter.watchMaxLength(t)}applyVariant(t){s.apply(t,(t=>this.textShared.setRenderProp("variant",t)))}applyHasCounter(t){this.counter.watchHasCounter(t)}applyMaxLength(t){var e,s;this.counter.watchMaxLength(t);this.counter.updateImmediate((s=(e=this._value)===null||e===void 0?void 0:e.length)!==null&&s!==void 0?s:0)}applyMaxLengthBehavior(t){this.counter.watchMaxLengthBehavior(t)}getTextFormFieldProps(t){const e=this.textShared;return this.getFormFieldProps({class:g(t,{"has-value":this.hasValue,"kol-form-field--has-counter":this.counter.hasSoftLimit()||this.counter.hasCounter()}),accessKey:e.getRenderProp("accessKey")||undefined,shortKey:e.getRenderProp("shortKey")||undefined,variant:e.getRenderProp("variant"),required:e.getRenderProp("required"),readOnly:e.getRenderProp("readOnly"),maxLength:this.counter.getRenderProp("maxLength"),counter:this.counter.getCounterProps()})}getTextInputAdornments(t){return n({icons:this.textShared.getRenderProp("icons"),smartButton:this.getSmartButtonFcProps(this.textShared.getRenderProp("smartButton"),this.textShared.getRenderProp("disabled")),endAdornment:t})}getTextInputProps({type:t,spellcheck:e,multiple:s,suggestions:i},o={}){const n=this.textShared;const r=n.getState("id");const h=n.getRenderProp("accessKey");const l=n.getRenderProp("shortKey");const d=n.getRenderProp("placeholder");const p=n.getRenderProp("pattern");const u=this.counter.getMaxLengthAttribute();const c=this.counter.getCharacterLimitHintId(r);const{ariaDescribedBy:m,hasError:y}=this.getAria();return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({id:r,hideLabel:n.getRenderProp("hideLabel"),label:n.getRenderProp("label"),disabled:n.getRenderProp("disabled"),name:n.getRenderProp("name")||undefined},h?{accessKey:h}:{}),t!==undefined?{type:t}:{}),{value:n.getRenderProp("value"),required:n.getRenderProp("required")}),u!==undefined?{maxlength:u}:{}),d!==undefined?{placeholder:d}:{}),{autoComplete:n.getRenderProp("autoComplete")}),e!==undefined?{spellcheck:e}:{}),p!==undefined?{pattern:p}:{}),{readonly:n.getRenderProp("readOnly")}),s!==undefined?{multiple:s}:{}),{touched:n.getRenderProp("touched"),msg:n.getRenderProp("msg")}),l?{"aria-keyshortcuts":l}:{}),i&&i.length>0?{suggestions:v(a,{id:r,suggestions:i})}:{}),{ref:this.ctaRef,onBlur:this.handleBlur,onChange:this.handleTextChange,onClick:this.handleClick,onFocus:this.handleTextFocus,onInput:this.handleTextInput,onKeyDown:this.handleTextKeyDown}),o),{ariaDescribedBy:c?[...m,c]:m,"aria-invalid":y?"true":undefined})}}export{K as B,C as t};
|
|
5
|
+
//# sourceMappingURL=base-web-component-BFCVvyYG.js.map
|