@public-ui/components 5.0.0-beta.1 → 5.0.0-beta.3
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 +31 -77
- package/dist/cjs/{Heading-C9osvqjY.js → Heading-D1EJem-Q.js} +7 -7
- package/dist/cjs/{access-and-short-key-D40HWCJe.js → access-and-short-key-BCyKbrgd.js} +2 -0
- package/dist/cjs/{api-U7I3XBPI.js → api-DU50b7pU.js} +39 -41
- package/dist/cjs/{app-globals-DsADKGEe.js → app-globals-Cshxaw1i.js} +6 -5
- package/dist/cjs/aria-current-service-XKodxE3I.js +30 -0
- package/dist/cjs/{aria-labelledby-BRMgWRVp.js → aria-labelledby-Du7FNBK5.js} +2 -13
- package/dist/cjs/{base-CyqDmoZZ.js → base-2k8L5Z0t.js} +14 -15
- package/dist/cjs/{base-l99dGLYo.js → base-CrH3N2Zu.js} +108 -80
- package/dist/cjs/{base-DcN_YC72.js → base-DXysZJF0.js} +13 -14
- package/dist/cjs/{base-DCxbMk0f.js → base-lY3OV-WH.js} +17 -19
- package/dist/cjs/{base-web-component-DxJ0hQ9u.js → base-web-component-CB32nH5g.js} +17 -19
- package/dist/cjs/{base-web-component-BnaxS2Z3.js → base-web-component-CnTCSVmC.js} +16 -19
- package/dist/cjs/{base-web-component-B6mwGD0m.js → base-web-component-vlBTFoc9.js} +2 -1
- package/dist/cjs/{behavior-CTaw4dj3.js → behavior-BonfWPFJ.js} +6 -6
- package/dist/cjs/{behavior-BNyFQ_B5.js → behavior-DdUDpqCO.js} +10 -10
- package/dist/cjs/{behavior-DrFJy0QC.js → behavior-Dznxy-IT.js} +33 -33
- package/dist/cjs/{bem-registry-CyxrH26c.js → bem-registry-CGf0w2u7.js} +61 -15
- package/dist/cjs/bootstrap-W0pDCbwR.js +59 -0
- package/dist/cjs/{color-BW4t1Cif.js → color-gGnOnvt7.js} +4 -4
- package/dist/cjs/component-B6wRTFBN.js +19 -0
- package/dist/cjs/component-B7ixbeft.js +52 -0
- package/dist/cjs/{component-4OErV1Bg.js → component-BaHA5GQ0.js} +11 -13
- package/dist/cjs/{component-Cty_HlJR.js → component-BeAWp-m9.js} +6 -5
- package/dist/cjs/component-Bnj9veMz.js +177 -0
- package/dist/cjs/{component-Cvjqbxf4.js → component-C9dVa2_4.js} +16 -19
- package/dist/cjs/{component-DF5q9ssd.js → component-D680TPaU.js} +13 -14
- package/dist/cjs/{component-DtxKrISb.js → component-DNRlsQ2M.js} +6 -7
- package/dist/cjs/{component-lmJOXuD6.js → component-WkG3-M2X.js} +8 -11
- package/dist/cjs/component-names-B-xDXf8U.js +121 -0
- package/dist/cjs/{component-DAQ1XSNA.js → component-vjLswij7.js} +6 -8
- package/dist/cjs/{contrast-4mAdSLs0.js → contrast-B6L84xFP.js} +5 -5
- package/dist/cjs/{controller-tEyAFJN9.js → controller-BcC7oIkq.js} +20 -20
- package/dist/cjs/{dev.utils-D5qh-RLT.js → dev.utils-Bk_hA4qQ.js} +9 -10
- package/dist/cjs/{devtools-Dtv-Apvj.js → devtools-CJixr1wI.js} +24 -25
- package/dist/cjs/{disabled-jYcvcwjv.js → disabled-BoM7lglH.js} +2 -1
- package/dist/cjs/{element-focus-CzkKMwtn.js → element-focus-BL2fXDD1.js} +1 -0
- package/dist/cjs/{element-interaction-BtYQAbhu.js → element-interaction-CKiHuPu0.js} +2 -1
- package/dist/cjs/{events-BJC5JJcU.js → events-Ce8f_epW.js} +2 -0
- package/dist/cjs/{field-control-Btb5zapE.js → field-control-Bn_hd-6N.js} +12 -13
- package/dist/cjs/{group-Dg2gJze5.js → group-TVkuA3Dx.js} +8 -9
- package/dist/cjs/{has-closer-CvNa5gqv.js → has-closer-CKT_frM5.js} +2 -1
- package/dist/cjs/{href-BBhiVyPb.js → href-yo_BPSR1.js} +2 -1
- package/dist/cjs/{i18n-BSWM5nea.js → i18n-DOGd0sdR.js} +15 -10
- package/dist/cjs/{i18n-BnOWw1MQ.js → i18n-DdWdytnt.js} +3 -3
- package/dist/cjs/{id-D1VZsLkg.js → id-C7_ak25l.js} +2 -1
- package/dist/cjs/{index-BacpU-d0.js → index-DLwNpyJ5.js} +1740 -61
- package/dist/cjs/index.cjs.js +21 -15
- package/dist/cjs/{input-container-PaL4ZNf3.js → input-container-CvDde8uk.js} +17 -20
- package/dist/cjs/input-uZRNVUsq.js +18 -0
- package/dist/cjs/{item-CLnIJY4J.js → item-D23h7gmK.js} +10 -10
- package/dist/cjs/{item-CPxmIcoq.js → item-D5hmTqf_.js} +17 -18
- package/dist/cjs/{item-Cckqxc6T.js → item-DimqWDZ7.js} +65 -44
- package/dist/cjs/{item-CErU-EPA.js → item-FYvfrXLj.js} +10 -10
- package/dist/cjs/{item-pool-CY0WyGOL.js → item-pool-BJcplkbh.js} +2 -0
- package/dist/cjs/{keyboard-Ca1I5RM2.js → keyboard-21hAUDzL.js} +2 -0
- package/dist/cjs/kol-abbr.cjs.entry.js +12 -16
- package/dist/cjs/kol-accordion.cjs.entry.js +23 -25
- package/dist/cjs/kol-alert.cjs.entry.js +35 -37
- package/dist/cjs/kol-avatar.cjs.entry.js +22 -25
- package/dist/cjs/kol-badge.cjs.entry.js +35 -38
- package/dist/cjs/kol-breadcrumb.cjs.entry.js +41 -44
- package/dist/cjs/kol-button-link.cjs.entry.js +34 -36
- package/dist/cjs/kol-button.cjs.entry.js +34 -36
- package/dist/cjs/kol-card.cjs.entry.js +59 -101
- package/dist/cjs/kol-combobox.cjs.entry.js +88 -90
- package/dist/cjs/kol-details.cjs.entry.js +23 -25
- package/dist/cjs/kol-dialog.cjs.entry.js +39 -42
- package/dist/cjs/kol-drawer.cjs.entry.js +39 -42
- package/dist/cjs/kol-form.cjs.entry.js +34 -37
- package/dist/cjs/kol-heading.cjs.entry.js +20 -22
- package/dist/cjs/kol-icon.cjs.entry.js +20 -18
- package/dist/cjs/kol-image.cjs.entry.js +25 -27
- package/dist/cjs/kol-input-checkbox.cjs.entry.js +95 -96
- package/dist/cjs/kol-input-color.cjs.entry.js +69 -70
- package/dist/cjs/kol-input-date.cjs.entry.js +82 -84
- package/dist/cjs/kol-input-email.cjs.entry.js +85 -86
- package/dist/cjs/kol-input-file.cjs.entry.js +62 -63
- package/dist/cjs/kol-input-number.cjs.entry.js +84 -85
- package/dist/cjs/kol-input-password.cjs.entry.js +84 -85
- package/dist/cjs/kol-input-radio.cjs.entry.js +66 -69
- package/dist/cjs/kol-input-range.cjs.entry.js +67 -69
- package/dist/cjs/kol-input-text.cjs.entry.js +98 -99
- package/dist/cjs/kol-kolibri.cjs.entry.js +13 -16
- package/dist/cjs/kol-link-button.cjs.entry.js +43 -45
- package/dist/cjs/kol-link.cjs.entry.js +41 -43
- package/dist/cjs/kol-meter.cjs.entry.js +27 -36
- package/dist/cjs/kol-modal.cjs.entry.js +39 -42
- package/dist/cjs/kol-nav.cjs.entry.js +51 -54
- package/dist/cjs/kol-pagination.cjs.entry.js +70 -73
- package/dist/cjs/kol-popover-button.cjs.entry.js +67 -104
- package/dist/cjs/kol-progress.cjs.entry.js +27 -27
- package/dist/cjs/kol-quote.cjs.entry.js +17 -19
- package/dist/cjs/kol-select.cjs.entry.js +73 -75
- package/dist/cjs/kol-single-select.cjs.entry.js +96 -93
- package/dist/cjs/kol-skip-nav.cjs.entry.js +40 -43
- package/dist/cjs/kol-spin.cjs.entry.js +26 -29
- package/dist/cjs/kol-split-button.cjs.entry.js +40 -42
- package/dist/cjs/kol-table-stateful.cjs.entry.js +140 -113
- package/dist/cjs/kol-table-stateless.cjs.entry.js +62 -74
- package/dist/cjs/kol-tabs.cjs.entry.js +58 -64
- package/dist/cjs/kol-textarea.cjs.entry.js +84 -84
- package/dist/cjs/kol-toast-container.cjs.entry.js +24 -28
- package/dist/cjs/kol-toolbar.cjs.entry.js +68 -67
- package/dist/cjs/kol-tree-item.cjs.entry.js +44 -44
- package/dist/cjs/kol-tree.cjs.entry.js +35 -25
- package/dist/cjs/kol-version.cjs.entry.js +26 -29
- package/dist/cjs/kolibri.cjs.js +6 -5
- package/dist/cjs/{label-vVOiX4dC.js → label-CCqNq5tW.js} +4 -3
- package/dist/cjs/{label-hints-D6EBRW9T.js → label-hints-qecpxRCt.js} +4 -4
- package/dist/cjs/{label-lang-segment-CYlAqtUl.js → label-lang-segment-BGLGUvz3.js} +3 -2
- package/dist/cjs/{label-with-expert-slot-B9z4nqW1.js → label-with-expert-slot-VcIxokIa.js} +4 -3
- package/dist/cjs/{level-BAiEYu4U.js → level-CVJUatGG.js} +2 -1
- package/dist/cjs/{link-target-4AzB3I84.js → link-target-BchnvpO8.js} +2 -1
- package/dist/cjs/{links-CPNK7VZo.js → links-B1TspXWw.js} +3 -3
- package/dist/cjs/loader.cjs.js +5 -4
- package/dist/cjs/{multiple-B3ZpkzWu.js → multiple-DO-7DpoM.js} +2 -1
- package/dist/cjs/{number-value-B2yoKlvx.js → number-value-C4kXarZR.js} +3 -2
- package/dist/cjs/{open-CvoX_qxD.js → open-Cmz8IDwx.js} +2 -1
- package/dist/cjs/{open-items-cache-B6hP2Aqy.js → open-items-cache-C162W-_D.js} +2 -0
- package/dist/cjs/{options-z7FKffHh.js → options-B5TaPd9X.js} +2 -0
- package/dist/cjs/{options-B2pQC9w2.js → options-CYbRA9bk.js} +3 -3
- package/dist/cjs/{orientation-u2cvwgBc.js → orientation-qw5D2TnY.js} +2 -1
- package/dist/cjs/{placeholder-C9Ngp2tQ.js → placeholder-BKqOq75d.js} +2 -1
- package/dist/cjs/{props-from-config-BQ2SOZlz.js → props-from-config-utp9cExR.js} +149 -74
- package/dist/cjs/{read-only-DfWF-Coi.js → read-only-BA_w8-u1.js} +2 -1
- package/dist/cjs/{required-CdXn16dq.js → required-CxAjKjbz.js} +2 -1
- package/dist/cjs/{resolve-props-B8kPPEMw.js → resolve-props--Nci0LhR.js} +9 -9
- package/dist/cjs/{resolve-props-B5MED90T.js → resolve-props-Dj6sEqG7.js} +9 -10
- package/dist/cjs/{rows-Ca5ya9tG.js → rows-DIswNtTH.js} +2 -1
- package/dist/cjs/{scroll-lock-jojYHBR3.js → scroll-lock-DCG-yvr9.js} +8 -7
- package/dist/cjs/shared-state-DgRutURI.js +16 -0
- package/dist/cjs/{smart-button-CB8qIzgQ.js → smart-button-DseYlks-.js} +3 -3
- package/dist/cjs/{spell-check-DKRC8xbW.js → spell-check-dk8U8oOc.js} +2 -1
- package/dist/cjs/{src-C3NG0rLO.js → src-CtFQUaCM.js} +2 -1
- package/dist/cjs/{step-CZNyTb2h.js → step-CvPxSo00.js} +2 -1
- package/dist/cjs/{suggestions-BRclldK2.js → suggestions-DUxsRVmB.js} +4 -4
- package/dist/cjs/{suggestions-CRyB_YCX.js → suggestions-DgLZZdei.js} +3 -3
- package/dist/cjs/test-component.cjs.entry.js +3 -3
- package/dist/cjs/theme-store-CLf_JZmz.js +13 -0
- package/dist/cjs/{toggle-handler-DRPltZqQ.js → toggle-handler-B-_ojZ0I.js} +13 -16
- package/dist/cjs/{tooltip-open-tracking-Ba0udJRU.js → tooltip-open-tracking-CewIRZOe.js} +8 -5
- package/dist/cjs/{unique-nav-labels-CIAwid5V.js → unique-nav-labels-CFCBdBmd.js} +3 -3
- package/dist/cjs/{unit-bsoemclF.js → unit-DexLlB8H.js} +2 -1
- package/dist/cjs/{validators-DuLdbf2D.js → validators-CxXwm4f6.js} +4 -1
- package/dist/cjs/{value-string-DZ_FFaUt.js → value-string-Ct7kzFWf.js} +2 -1
- package/dist/cjs/{width-BklaRCqt.js → width-BXrduM1f.js} +2 -1
- package/dist/collection/collection-manifest.json +1 -8
- package/dist/collection/components/abbr/component.js +2 -2
- package/dist/collection/components/abbr/style.css +21 -0
- package/dist/collection/components/accordion/component.js +2 -2
- package/dist/collection/components/accordion/style.css +23 -2
- package/dist/collection/components/alert/component.js +8 -6
- package/dist/collection/components/alert/style.css +23 -2
- package/dist/collection/components/avatar/component.js +5 -8
- package/dist/collection/components/avatar/style.css +21 -0
- package/dist/collection/components/badge/component.js +5 -5
- package/dist/collection/components/badge/style.css +23 -2
- package/dist/collection/components/breadcrumb/component.js +4 -4
- package/dist/collection/components/breadcrumb/style.css +23 -2
- package/dist/collection/components/button/component.js +3 -3
- package/dist/collection/components/button/style.css +23 -2
- package/dist/collection/components/button-link/component.js +3 -3
- package/dist/collection/components/button-link/style.css +23 -2
- package/dist/collection/components/card/component.js +54 -19
- package/dist/collection/components/card/style.css +26 -2
- package/dist/collection/components/combobox/component.js +116 -116
- package/dist/collection/components/combobox/style.css +23 -2
- package/dist/collection/components/details/component.js +2 -2
- package/dist/collection/components/details/style.css +23 -2
- package/dist/collection/components/dialog/base.js +2 -2
- package/dist/collection/components/dialog/component.js +6 -6
- package/dist/collection/components/dialog/style.css +26 -2
- package/dist/collection/components/drawer/component.js +4 -4
- package/dist/collection/components/drawer/style.css +26 -2
- package/dist/collection/components/form/component.js +4 -4
- package/dist/collection/components/form/controller.js +4 -3
- package/dist/collection/components/form/style.css +23 -2
- package/dist/collection/components/heading/component.js +5 -5
- package/dist/collection/components/heading/style.css +21 -0
- package/dist/collection/components/icon/component.js +6 -6
- package/dist/collection/components/icon/style.css +2 -2
- package/dist/collection/components/image/component.js +40 -40
- package/dist/collection/components/image/style.css +21 -0
- package/dist/collection/components/input-checkbox/component.js +119 -117
- package/dist/collection/components/input-checkbox/style.css +23 -2
- package/dist/collection/components/input-color/component.js +42 -40
- package/dist/collection/components/input-color/style.css +23 -2
- package/dist/collection/components/input-date/component.js +83 -81
- package/dist/collection/components/input-date/style.css +23 -2
- package/dist/collection/components/input-email/component.js +89 -86
- package/dist/collection/components/input-email/style.css +23 -2
- package/dist/collection/components/input-file/component.js +37 -34
- package/dist/collection/components/input-file/style.css +23 -2
- package/dist/collection/components/input-number/component.js +70 -68
- package/dist/collection/components/input-number/style.css +23 -2
- package/dist/collection/components/input-password/component.js +90 -87
- package/dist/collection/components/input-password/style.css +23 -2
- package/dist/collection/components/input-radio/component.js +36 -37
- package/dist/collection/components/input-radio/style.css +23 -2
- package/dist/collection/components/input-range/component.js +38 -38
- package/dist/collection/components/input-range/style.css +23 -2
- package/dist/collection/components/input-text/component.js +148 -146
- package/dist/collection/components/input-text/style.css +23 -2
- package/dist/collection/components/kolibri/component.js +2 -2
- package/dist/collection/components/kolibri/style.css +21 -0
- package/dist/collection/components/link/base.js +1 -1
- package/dist/collection/components/link/component.js +27 -27
- package/dist/collection/components/link/style.css +23 -2
- package/dist/collection/components/link-button/component.js +28 -28
- package/dist/collection/components/link-button/style.css +23 -2
- package/dist/collection/components/meter/component.js +7 -13
- package/dist/collection/components/meter/style.css +21 -0
- package/dist/collection/components/modal/component.js +6 -6
- package/dist/collection/components/modal/style.css +26 -2
- package/dist/collection/components/nav/component.js +3 -3
- package/dist/collection/components/nav/style.css +23 -2
- package/dist/collection/components/pagination/component.js +92 -94
- package/dist/collection/components/pagination/style.css +23 -2
- package/dist/collection/components/popover-button/component.js +40 -11
- package/dist/collection/components/popover-button/style.css +23 -2
- package/dist/collection/components/progress/component.js +10 -10
- package/dist/collection/components/progress/style.css +21 -0
- package/dist/collection/components/public-api/contract.js +46 -6
- package/dist/collection/components/quote/component.js +6 -6
- package/dist/collection/components/quote/style.css +21 -0
- package/dist/collection/components/select/component.js +61 -61
- package/dist/collection/components/select/style.css +23 -2
- package/dist/collection/components/single-select/component.js +141 -137
- package/dist/collection/components/single-select/style.css +23 -2
- package/dist/collection/components/skip-nav/component.js +3 -3
- package/dist/collection/components/skip-nav/style.css +23 -2
- package/dist/collection/components/spin/component.js +30 -30
- package/dist/collection/components/spin/style.css +29 -1
- package/dist/collection/components/split-button/component.js +5 -5
- package/dist/collection/components/split-button/style.css +23 -2
- package/dist/collection/components/table-stateful/component.js +118 -122
- package/dist/collection/components/table-stateful/style.css +35 -4
- package/dist/collection/components/table-stateless/base.js +11 -2
- package/dist/collection/components/table-stateless/component.js +34 -75
- package/dist/collection/components/table-stateless/style.css +35 -4
- package/dist/collection/components/tabs/component.js +19 -28
- package/dist/collection/components/tabs/style.css +24 -3
- package/dist/collection/components/textarea/component.js +91 -89
- package/dist/collection/components/textarea/style.css +23 -2
- package/dist/collection/components/toaster/shadow.js +3 -4
- package/dist/collection/components/toaster/style.css +23 -2
- package/dist/collection/components/toaster/toaster.js +2 -1
- package/dist/collection/components/toolbar/component.js +46 -42
- package/dist/collection/components/toolbar/style.css +23 -2
- package/dist/collection/components/tree/component.js +23 -12
- package/dist/collection/components/tree/style.css +21 -0
- package/dist/collection/components/tree-item/component.js +43 -40
- package/dist/collection/components/tree-item/style.css +23 -2
- package/dist/collection/components/version/component.js +3 -3
- package/dist/collection/components/version/style.css +23 -2
- package/dist/collection/core/bootstrap.js +8 -5
- package/dist/collection/core/component-names.js +52 -106
- package/dist/collection/core/i18n.js +7 -6
- package/dist/collection/core/shared-state.js +10 -0
- package/dist/collection/core/tag-transformer.js +27 -0
- package/dist/collection/core/theme-store.js +8 -0
- package/dist/collection/global/script.js +3 -1
- package/dist/collection/index.js +3 -1
- package/dist/collection/internal/functional-components/alert/component.js +2 -1
- package/dist/collection/internal/functional-components/avatar/component.js +2 -2
- package/dist/collection/internal/functional-components/badge/component.js +2 -1
- package/dist/collection/internal/functional-components/bem-root-node/component.js +16 -6
- package/dist/collection/internal/functional-components/breadcrumb/component.js +2 -2
- package/dist/collection/internal/functional-components/breadcrumb/link-item.js +2 -2
- package/dist/collection/internal/functional-components/button/item.js +2 -2
- package/dist/collection/internal/functional-components/card/component.js +3 -1
- package/dist/collection/internal/functional-components/collapsible/component.js +3 -2
- package/dist/collection/internal/functional-components/counter/api.js +1 -1
- package/dist/collection/internal/functional-components/dialog/component.js +6 -3
- package/dist/collection/internal/functional-components/dialog/item.js +4 -4
- package/dist/collection/internal/functional-components/drawer/component.js +1 -1
- package/dist/collection/internal/functional-components/form/error-link-item.js +2 -2
- package/dist/collection/internal/functional-components/form-association/api.js +2 -2
- package/dist/collection/internal/functional-components/form-association/behavior.js +18 -15
- package/dist/collection/internal/functional-components/form-field/base-web-component.js +7 -8
- package/dist/collection/internal/functional-components/form-field/custom-suggestions.js +1 -1
- package/dist/collection/internal/functional-components/form-field/msg.js +2 -2
- package/dist/collection/internal/functional-components/form-field/number-value.js +1 -1
- package/dist/collection/internal/functional-components/heading/component.js +3 -4
- package/dist/collection/internal/functional-components/icon/api.js +2 -2
- package/dist/collection/internal/functional-components/icon/component.js +2 -2
- package/dist/collection/internal/functional-components/image/component.js +2 -4
- package/dist/collection/internal/functional-components/link/api.js +1 -1
- package/dist/collection/internal/functional-components/link/aria-current-service.js +23 -0
- package/dist/collection/internal/functional-components/link/component.js +2 -2
- package/dist/collection/internal/functional-components/link/item.js +3 -3
- package/dist/collection/internal/functional-components/meter/component.js +5 -7
- package/dist/collection/internal/functional-components/pagination/api.js +2 -2
- package/dist/collection/internal/functional-components/pagination/component.js +2 -3
- package/dist/collection/internal/functional-components/pagination/item.js +26 -11
- package/dist/collection/internal/functional-components/pagination/page-size-select.js +17 -9
- package/dist/collection/internal/functional-components/popover-button/item.js +2 -2
- package/dist/collection/internal/functional-components/progress/api.js +1 -1
- package/dist/collection/internal/functional-components/progress/component.js +2 -1
- package/dist/collection/internal/functional-components/quote/component.js +2 -3
- package/dist/collection/internal/functional-components/single-select/component.js +2 -1
- package/dist/collection/internal/functional-components/skip-nav/api.js +1 -1
- package/dist/collection/internal/functional-components/skip-nav/component.js +2 -2
- package/dist/collection/internal/functional-components/skip-nav/link-item.js +2 -2
- package/dist/collection/internal/functional-components/span/component.js +3 -2
- package/dist/collection/internal/functional-components/table-stateful/component.js +17 -0
- package/dist/collection/internal/functional-components/table-stateful/model.js +21 -7
- package/dist/collection/internal/functional-components/table-stateless/api.js +2 -2
- package/dist/collection/internal/functional-components/table-stateless/component.js +11 -8
- package/dist/collection/internal/functional-components/table-stateless/selection-tooltip-item.js +29 -0
- package/dist/collection/internal/functional-components/table-stateless/settings.js +12 -7
- package/dist/collection/internal/functional-components/table-stateless/table-model.js +2 -6
- package/dist/collection/internal/functional-components/tabs/button-item.js +2 -2
- package/dist/collection/internal/functional-components/tabs/component.js +7 -1
- package/dist/collection/internal/functional-components/toolbar/{item.js → entry-item.js} +4 -4
- package/dist/collection/internal/functional-components/tree/component.js +2 -2
- package/dist/collection/internal/functional-components/tree-item/component.js +2 -2
- package/dist/collection/internal/props/helpers/factory.js +1 -1
- package/dist/collection/internal/props/helpers/normalizers.js +2 -5
- package/dist/collection/internal/props/helpers/validators.js +1 -0
- package/dist/collection/internal/props/index.js +1 -1
- package/dist/collection/internal/props/label-decorative.js +10 -0
- package/dist/collection/locales/de.js +3 -2
- package/dist/collection/locales/en.js +3 -2
- package/dist/collection/schema/bem-registry.js +59 -13
- package/dist/collection/schema/components/index.js +0 -29
- package/dist/collection/schema/i18n-keys.js +29 -28
- package/dist/collection/schema/props/accept.js +1 -7
- package/dist/collection/schema/props/access-key.js +1 -7
- package/dist/collection/schema/props/active.js +1 -7
- package/dist/collection/schema/props/adjust-height.js +1 -7
- package/dist/collection/schema/props/alert-type.js +0 -7
- package/dist/collection/schema/props/align.js +0 -4
- package/dist/collection/schema/props/allow-multi-sort.js +1 -7
- package/dist/collection/schema/props/alt.js +1 -7
- package/dist/collection/schema/props/alternative-button-link-role.js +1 -8
- package/dist/collection/schema/props/aria-controls.js +1 -7
- package/dist/collection/schema/props/aria-current-value.js +1 -10
- package/dist/collection/schema/props/aria-description.js +1 -7
- package/dist/collection/schema/props/aria-details.js +1 -22
- package/dist/collection/schema/props/aria-expanded.js +1 -7
- package/dist/collection/schema/props/aria-labelledby.js +8 -15
- package/dist/collection/schema/props/aria-owns.js +1 -9
- package/dist/collection/schema/props/aria-selected.js +1 -7
- package/dist/collection/schema/props/auto-complete.js +0 -6
- package/dist/collection/schema/props/badge-text.js +1 -7
- package/dist/collection/schema/props/button-callbacks.js +1 -7
- package/dist/collection/schema/props/button-type.js +1 -8
- package/dist/collection/schema/props/button-variant.js +1 -10
- package/dist/collection/schema/props/checked.js +1 -7
- package/dist/collection/schema/props/collapsible.js +1 -7
- package/dist/collection/schema/props/color.js +1 -14
- package/dist/collection/schema/props/current-length.js +1 -7
- package/dist/collection/schema/props/custom-class.js +1 -9
- package/dist/collection/schema/props/disabled.js +1 -15
- package/dist/collection/schema/props/download.js +1 -7
- package/dist/collection/schema/props/error-list.js +1 -14
- package/dist/collection/schema/props/has-closer.js +1 -7
- package/dist/collection/schema/props/has-compact-button.js +1 -7
- package/dist/collection/schema/props/has-counter.js +1 -7
- package/dist/collection/schema/props/has-create-button.js +1 -7
- package/dist/collection/schema/props/has-icons-when-expanded.js +1 -7
- package/dist/collection/schema/props/has-settings-menu.js +1 -7
- package/dist/collection/schema/props/has-value.js +1 -7
- package/dist/collection/schema/props/hide-label.js +1 -7
- package/dist/collection/schema/props/hide-msg.js +1 -7
- package/dist/collection/schema/props/hint.js +1 -7
- package/dist/collection/schema/props/href.js +1 -7
- package/dist/collection/schema/props/icons-input-checkbox.js +1 -18
- package/dist/collection/schema/props/icons.js +0 -43
- package/dist/collection/schema/props/id.js +1 -7
- package/dist/collection/schema/props/image-sizes.js +1 -7
- package/dist/collection/schema/props/image-source.js +1 -7
- package/dist/collection/schema/props/image-srcset.js +1 -7
- package/dist/collection/schema/props/indeterminate.js +1 -7
- package/dist/collection/schema/props/index.js +5 -1
- package/dist/collection/schema/props/inline.js +1 -7
- package/dist/collection/schema/props/label-align.js +1 -8
- package/dist/collection/schema/props/label.js +0 -35
- package/dist/collection/schema/props/link-on-callbacks.js +1 -8
- package/dist/collection/schema/props/link-target.js +1 -7
- package/dist/collection/schema/props/loading.js +1 -8
- package/dist/collection/schema/props/max-length-behavior.js +1 -8
- package/dist/collection/schema/props/max-length.js +1 -7
- package/dist/collection/schema/props/max.js +1 -7
- package/dist/collection/schema/props/modal.js +1 -7
- package/dist/collection/schema/props/msg.js +1 -24
- package/dist/collection/schema/props/multiple.js +1 -7
- package/dist/collection/schema/props/name.js +1 -7
- package/dist/collection/schema/props/open.js +1 -7
- package/dist/collection/schema/props/options.js +1 -11
- package/dist/collection/schema/props/orientation.js +1 -10
- package/dist/collection/schema/props/pagination-position.js +1 -10
- package/dist/collection/schema/props/pattern.js +1 -7
- package/dist/collection/schema/props/placeholder.js +1 -7
- package/dist/collection/schema/props/popover-align.js +1 -7
- package/dist/collection/schema/props/read-only.js +1 -7
- package/dist/collection/schema/props/required.js +1 -7
- package/dist/collection/schema/props/resize-textarea.js +0 -9
- package/dist/collection/schema/props/rows.js +1 -7
- package/dist/collection/schema/props/short-key.js +1 -7
- package/dist/collection/schema/props/show.js +1 -7
- package/dist/collection/schema/props/spell-check.js +1 -9
- package/dist/collection/schema/props/suggestions.js +1 -16
- package/dist/collection/schema/props/tab-behavior.js +1 -8
- package/dist/collection/schema/props/tab-index.js +1 -16
- package/dist/collection/schema/props/table-data-foot.js +1 -21
- package/dist/collection/schema/props/table-data.js +1 -21
- package/dist/collection/schema/props/table-fixed-cols.js +1 -14
- package/dist/collection/schema/props/table-selection.js +1 -22
- package/dist/collection/schema/props/toolbar-items.js +1 -21
- package/dist/collection/schema/props/tooltip-align.js +1 -7
- package/dist/collection/schema/props/touched.js +1 -7
- package/dist/collection/schema/props/type-input-date.js +0 -7
- package/dist/collection/schema/props/type-input-text.js +0 -7
- package/dist/collection/schema/props/unit.js +1 -7
- package/dist/collection/schema/props/variant/dialog.js +1 -8
- package/dist/collection/schema/props/variant/modal.js +1 -4
- package/dist/collection/schema/props/variant/password-variant.js +1 -8
- package/dist/collection/schema/props/variant-alert.js +0 -7
- package/dist/collection/schema/props/variant-class-name.js +0 -33
- package/dist/collection/schema/props/variant-input-checkbox.js +0 -7
- package/dist/collection/schema/props/variant-progress.js +0 -7
- package/dist/collection/schema/props/visibility-toggle.js +1 -7
- package/dist/collection/schema/props/width.js +1 -7
- package/dist/collection/schema/utils/contrast.js +1 -1
- package/dist/collection/schema/utils/prop.validators.js +1 -1
- package/dist/collection/schema/validators/common.js +4 -0
- package/dist/collection/schema/validators/index.js +0 -1
- package/dist/collection/utils/aria-labelledby.js +0 -12
- package/dist/collection/utils/dev.utils.js +1 -2
- package/dist/collection/utils/markdown.js +49 -3
- package/dist/collection/utils/testing/logged-messages.js +4 -0
- package/dist/collection/utils/testing/snapshot-input-testing.js +1 -1
- package/dist/collection/utils/testing/snapshot-testing.js +2 -1
- package/dist/collection/utils/tooltip-open-tracking.js +6 -5
- package/dist/components/Heading.js +1 -1
- package/dist/components/access-and-short-key.js +1 -1
- package/dist/components/aria-current-service.js +4 -0
- package/dist/components/base-web-component.js +1 -1
- package/dist/components/base-web-component2.js +1 -1
- package/dist/components/base-web-component3.js +1 -1
- package/dist/components/base-web-component4.js +1 -1
- package/dist/components/base.js +1 -1
- package/dist/components/base2.js +1 -1
- package/dist/components/base3.js +1 -1
- package/dist/components/base4.js +1 -1
- package/dist/components/behavior.js +1 -1
- package/dist/components/behavior2.js +1 -1
- package/dist/components/behavior3.js +1 -1
- package/dist/components/behavior4.js +1 -1
- package/dist/components/bem-registry.js +1 -1
- package/dist/components/bootstrap.js +1 -1
- package/dist/components/color.js +1 -1
- package/dist/components/component-names.js +1 -1
- package/dist/components/component.js +1 -1
- package/dist/components/component10.js +1 -1
- package/dist/components/component11.js +1 -1
- package/dist/components/component12.js +4 -0
- package/dist/components/component13.js +4 -0
- package/dist/components/component14.js +4 -0
- package/dist/components/component2.js +1 -1
- package/dist/components/component3.js +1 -1
- package/dist/components/component4.js +1 -1
- package/dist/components/component5.js +1 -1
- package/dist/components/component6.js +1 -1
- package/dist/components/component7.js +1 -1
- package/dist/components/component8.js +1 -1
- package/dist/components/component9.js +1 -1
- package/dist/components/contrast.js +1 -1
- package/dist/components/controller.js +1 -1
- package/dist/components/dev.utils.js +1 -1
- package/dist/components/devtools.js +1 -1
- package/dist/components/disabled.js +1 -1
- package/dist/components/element-focus.js +1 -1
- package/dist/components/element-interaction.js +1 -1
- package/dist/components/events.js +1 -1
- package/dist/components/field-control.js +1 -1
- package/dist/components/group.js +1 -1
- package/dist/components/has-closer.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/i18n2.js +1 -1
- package/dist/components/id.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/input-container.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/item-pool.js +1 -1
- package/dist/components/item.js +1 -1
- package/dist/components/item2.js +1 -1
- package/dist/components/item3.js +1 -1
- package/dist/components/item4.js +1 -1
- package/dist/components/keyboard.js +1 -1
- package/dist/components/kol-abbr.js +1 -1
- package/dist/components/kol-accordion.js +1 -1
- package/dist/components/kol-alert.js +1 -1
- package/dist/components/kol-avatar.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-heading.js +1 -1
- package/dist/components/kol-icon.js +1 -1
- package/dist/components/kol-image.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 +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-kolibri.js +1 -1
- package/dist/components/kol-link-button.js +1 -1
- package/dist/components/kol-link.js +1 -1
- package/dist/components/kol-meter.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 +1 -1
- package/dist/components/kol-progress.js +1 -1
- package/dist/components/kol-quote.js +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-spin.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 +1 -1
- package/dist/components/kol-toast-container.js +1 -1
- package/dist/components/kol-toolbar.js +1 -1
- package/dist/components/kol-tree-item.js +1 -1
- package/dist/components/kol-tree.js +1 -1
- package/dist/components/kol-version.js +1 -1
- package/dist/components/label-hints.js +1 -1
- package/dist/components/label-lang-segment.js +1 -1
- package/dist/components/label-with-expert-slot.js +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/level.js +1 -1
- package/dist/components/link-target.js +1 -1
- package/dist/components/links.js +1 -1
- package/dist/components/multiple.js +1 -1
- package/dist/components/number-value.js +1 -1
- package/dist/components/open-items-cache.js +1 -1
- package/dist/components/open.js +1 -1
- package/dist/components/options.js +1 -1
- package/dist/components/options2.js +1 -1
- package/dist/components/orientation.js +1 -1
- package/dist/components/placeholder.js +1 -1
- package/dist/components/prop.validators.js +4 -0
- package/dist/components/read-only.js +1 -1
- package/dist/components/required.js +1 -1
- package/dist/components/resolve-props.js +1 -1
- package/dist/components/resolve-props2.js +1 -1
- package/dist/components/rows.js +1 -1
- package/dist/components/scroll-lock.js +1 -1
- package/dist/components/shared-state.js +4 -0
- package/dist/components/smart-button.js +1 -1
- package/dist/components/spell-check.js +1 -1
- package/dist/components/src.js +1 -1
- package/dist/components/step.js +1 -1
- package/dist/components/suggestions.js +1 -1
- package/dist/components/suggestions2.js +1 -1
- package/dist/components/test-component.js +1 -1
- package/dist/components/toggle-handler.js +1 -1
- package/dist/components/tooltip-open-tracking.js +1 -1
- package/dist/components/unique-nav-labels.js +1 -1
- package/dist/components/unit.js +1 -1
- package/dist/components/validators.js +1 -1
- package/dist/components/value-string.js +1 -1
- package/dist/components/width.js +1 -1
- package/dist/esm/{Heading-BVhjT9av.js → Heading-foerLIu9.js} +2 -2
- package/dist/esm/{access-and-short-key-ijzCZfHm.js → access-and-short-key-BTEwnScd.js} +2 -0
- package/dist/esm/{api-D92_O-0H.js → api-Ba9FNPRn.js} +29 -31
- package/dist/esm/{app-globals-CBGjgNge.js → app-globals-CqYpXngl.js} +4 -3
- package/dist/esm/aria-current-service-4eUMzpeO.js +27 -0
- package/dist/esm/{aria-labelledby-CLehu03h.js → aria-labelledby-C4wUnR-v.js} +3 -13
- package/dist/esm/{base-BLBSJu_1.js → base-AKIr0rpk.js} +13 -14
- package/dist/esm/{base-qvPPg-dn.js → base-C7nTPc7u.js} +95 -67
- package/dist/esm/{base-DIcqHqMz.js → base-CpUNedp9.js} +13 -14
- package/dist/esm/{base-CHmdLgoO.js → base-D7qItqyf.js} +14 -16
- package/dist/esm/{base-web-component-XgI4wUyN.js → base-web-component-B3wi5eWH.js} +2 -1
- package/dist/esm/{base-web-component-CaAexWy_.js → base-web-component-BpL_hXcg.js} +16 -18
- package/dist/esm/{base-web-component-DbagnM7m.js → base-web-component-DorOeD_U.js} +10 -13
- package/dist/esm/{behavior-B08CXmI4.js → behavior-D9BHiFnH.js} +29 -28
- package/dist/esm/{behavior-CwUUkdaP.js → behavior-DDo87iUM.js} +6 -6
- package/dist/esm/{behavior-DW7_5Wxp.js → behavior-XAV9GSxI.js} +6 -6
- package/dist/esm/{bem-registry-CWN7_O1L.js → bem-registry-CrZZQahR.js} +60 -14
- package/dist/esm/bootstrap-Cz7Iq2I2.js +52 -0
- package/dist/esm/{color-eAL9I7Wq.js → color-CnVBqZd5.js} +3 -3
- package/dist/esm/{component-8ALsFV4i.js → component-0npqUhj2.js} +5 -6
- package/dist/esm/{component-nR5Bf9G5.js → component-BCKsZOoB.js} +6 -5
- package/dist/esm/component-BZjDp_Lf.js +17 -0
- package/dist/esm/component-CjdTbGlP.js +172 -0
- package/dist/esm/component-Cn693XeT.js +47 -0
- package/dist/esm/{component-D0mBOGjS.js → component-Cvd5HXbX.js} +10 -12
- package/dist/esm/{component-DCw1ZAE5.js → component-CvdxCpjC.js} +5 -7
- package/dist/esm/{component-CdKSiR5P.js → component-DFhRTaqb.js} +6 -9
- package/dist/esm/{component-BTMWoACz.js → component-DP_p5few.js} +11 -13
- package/dist/esm/{component-DBAicJ2u.js → component-DlROeCCe.js} +14 -17
- package/dist/esm/component-names-DzmdvSkQ.js +115 -0
- package/dist/esm/{contrast-D78VGPFR.js → contrast-BHjNzQvB.js} +2 -2
- package/dist/esm/{controller-C3O9ohSP.js → controller-DYkXzFqc.js} +5 -5
- package/dist/esm/{dev.utils-wYkYn08d.js → dev.utils-BgFDROtc.js} +1 -2
- package/dist/esm/{devtools-DrBkkLdP.js → devtools-B6h2bVMJ.js} +4 -5
- package/dist/esm/{disabled-Cqhc40CU.js → disabled-BZIZZ6wy.js} +2 -1
- package/dist/esm/{element-focus-BIRmGg5W.js → element-focus-C0L8NWU8.js} +1 -0
- package/dist/esm/{element-interaction-sGYdEpmv.js → element-interaction-B3GEli6r.js} +2 -1
- package/dist/esm/{events-BIT-JUP2.js → events-DdfMb1U7.js} +2 -0
- package/dist/esm/{field-control-Cs5VvsYo.js → field-control-QF0yTcyb.js} +7 -8
- package/dist/esm/{group-uNo1CfbK.js → group-8Me6YSO8.js} +6 -7
- package/dist/esm/{has-closer-B9NQY7BK.js → has-closer-B-uYNNCw.js} +2 -1
- package/dist/esm/{href-JqLbNBsW.js → href-DKPJq0Rh.js} +2 -1
- package/dist/esm/{i18n-Dl6Jjofb.js → i18n-TlIXBsgS.js} +15 -10
- package/dist/esm/{i18n-DtLKn3Xt.js → i18n-Uze_l4Ts.js} +2 -2
- package/dist/esm/{id-CIYvVaNr.js → id-CkUYl2hO.js} +2 -1
- package/dist/esm/{index-BKEJuyFi.js → index-D1fZ9xFt.js} +1677 -46
- package/dist/esm/index.js +14 -12
- package/dist/esm/{input-Dja5Qioc.js → input-DwlolkOG.js} +4 -6
- package/dist/esm/{input-container-C2Am7LEP.js → input-container-DC3x4oGg.js} +6 -9
- package/dist/esm/{item-DIAFIFSy.js → item-DThxrTZc.js} +60 -39
- package/dist/esm/{item-C4AmpdVD.js → item-cArH2C6l.js} +9 -9
- package/dist/esm/{item-pool-BOxAYePG.js → item-pool-D4qvvY-S.js} +2 -0
- package/dist/esm/{item-D627ShRd.js → item-uC3h4pj3.js} +15 -16
- package/dist/esm/{item-ConW1c81.js → item-zPmzbSvE.js} +9 -9
- package/dist/esm/{keyboard-Cnv7zP3N.js → keyboard-DzlBdECG.js} +2 -0
- package/dist/esm/kol-abbr.entry.js +11 -15
- package/dist/esm/kol-accordion.entry.js +22 -24
- package/dist/esm/kol-alert.entry.js +35 -37
- package/dist/esm/kol-avatar.entry.js +22 -25
- package/dist/esm/kol-badge.entry.js +32 -35
- package/dist/esm/kol-breadcrumb.entry.js +38 -41
- package/dist/esm/kol-button-link.entry.js +34 -36
- package/dist/esm/kol-button.entry.js +34 -36
- package/dist/esm/kol-card.entry.js +59 -101
- package/dist/esm/kol-combobox.entry.js +87 -89
- package/dist/esm/kol-details.entry.js +22 -24
- package/dist/esm/kol-dialog.entry.js +39 -42
- package/dist/esm/kol-drawer.entry.js +39 -42
- package/dist/esm/kol-form.entry.js +32 -35
- package/dist/esm/kol-heading.entry.js +20 -22
- package/dist/esm/kol-icon.entry.js +20 -18
- package/dist/esm/kol-image.entry.js +25 -27
- package/dist/esm/kol-input-checkbox.entry.js +90 -91
- package/dist/esm/kol-input-color.entry.js +69 -70
- package/dist/esm/kol-input-date.entry.js +81 -83
- package/dist/esm/kol-input-email.entry.js +85 -86
- package/dist/esm/kol-input-file.entry.js +62 -63
- package/dist/esm/kol-input-number.entry.js +83 -84
- package/dist/esm/kol-input-password.entry.js +83 -84
- package/dist/esm/kol-input-radio.entry.js +63 -66
- package/dist/esm/kol-input-range.entry.js +67 -69
- package/dist/esm/kol-input-text.entry.js +98 -99
- package/dist/esm/kol-kolibri.entry.js +12 -15
- package/dist/esm/kol-link-button.entry.js +42 -44
- package/dist/esm/kol-link.entry.js +41 -43
- package/dist/esm/kol-meter.entry.js +27 -36
- package/dist/esm/kol-modal.entry.js +39 -42
- package/dist/esm/kol-nav.entry.js +44 -47
- package/dist/esm/kol-pagination.entry.js +70 -73
- package/dist/esm/kol-popover-button.entry.js +67 -104
- package/dist/esm/kol-progress.entry.js +27 -27
- package/dist/esm/kol-quote.entry.js +17 -19
- package/dist/esm/kol-select.entry.js +73 -75
- package/dist/esm/kol-single-select.entry.js +95 -92
- package/dist/esm/kol-skip-nav.entry.js +38 -41
- package/dist/esm/kol-spin.entry.js +26 -29
- package/dist/esm/kol-split-button.entry.js +38 -40
- package/dist/esm/kol-table-stateful.entry.js +136 -109
- package/dist/esm/kol-table-stateless.entry.js +62 -74
- package/dist/esm/kol-tabs.entry.js +54 -60
- package/dist/esm/kol-textarea.entry.js +82 -82
- package/dist/esm/kol-toast-container.entry.js +22 -26
- package/dist/esm/kol-toolbar.entry.js +63 -62
- package/dist/esm/kol-tree-item.entry.js +44 -44
- package/dist/esm/kol-tree.entry.js +35 -25
- package/dist/esm/kol-version.entry.js +25 -28
- package/dist/esm/kolibri.js +7 -6
- package/dist/esm/{label-BRosRgdX.js → label-G82W4YoW.js} +4 -3
- package/dist/esm/{label-hints-Jn18RUT-.js → label-hints-DiRb_zIZ.js} +2 -2
- package/dist/esm/{label-lang-segment-2_GnxjFp.js → label-lang-segment-BSVexfSR.js} +3 -2
- package/dist/esm/label-with-expert-slot-C1i0atAL.js +13 -0
- package/dist/esm/{level-CA1s1_Mf.js → level-CWkPM-CS.js} +2 -1
- package/dist/esm/{link-target-FX94oqMo.js → link-target-B2OC2sZU.js} +2 -1
- package/dist/esm/{links-DwucTqcR.js → links-CiNHSAYH.js} +2 -2
- package/dist/esm/loader.js +6 -5
- package/dist/esm/{multiple-DqrZxybx.js → multiple-CuU2AuEM.js} +2 -1
- package/dist/esm/{number-value-B-SJ1dRo.js → number-value-adUq1zr1.js} +2 -1
- package/dist/esm/{open-DRRv1KFK.js → open-DR8Z7RtS.js} +2 -1
- package/dist/esm/{open-items-cache-D-kml1h6.js → open-items-cache-CS2mDRNB.js} +2 -0
- package/dist/esm/{options-B0rBHetL.js → options-BDTJtk6H.js} +2 -0
- package/dist/esm/{options-DCaUcfAu.js → options-BPwcDIDO.js} +2 -2
- package/dist/esm/{orientation-XNOCaPwy.js → orientation-BUPO9LJU.js} +2 -1
- package/dist/esm/{placeholder-BeLIzdJv.js → placeholder-BTFnryTd.js} +2 -1
- package/dist/esm/{props-from-config-Ci0dILpz.js → props-from-config-DqFgiUwD.js} +136 -63
- package/dist/esm/{read-only-Bby9r6ZX.js → read-only-DRmmHb2G.js} +2 -1
- package/dist/esm/{required-hoaT7UmZ.js → required-D4CdAA4s.js} +2 -1
- package/dist/esm/{resolve-props-D2KiItuv.js → resolve-props-BAambGug.js} +9 -9
- package/dist/esm/{resolve-props-BLZxWC3j.js → resolve-props-Dpl38Wpe.js} +7 -8
- package/dist/esm/{rows-B0x8CR7K.js → rows-DRKSoawJ.js} +2 -1
- package/dist/esm/{scroll-lock-Y2hf47KW.js → scroll-lock-C66lpb8L.js} +9 -7
- package/dist/esm/shared-state-Dn94ivRg.js +14 -0
- package/dist/esm/{smart-button-CS_ZriPt.js → smart-button-BYEk3DzS.js} +2 -2
- package/dist/esm/{spell-check-DzgftyqL.js → spell-check-DlQ_d2GL.js} +2 -1
- package/dist/esm/{src-DaGhmCL1.js → src-Cikg9qhP.js} +2 -1
- package/dist/esm/{step-Bdj89bGO.js → step-C7WPZrUp.js} +2 -1
- package/dist/esm/{suggestions-Dy1X-Pc3.js → suggestions-CotfxJG1.js} +2 -2
- package/dist/esm/{suggestions-DuqzGDve.js → suggestions-qW9OdwO3.js} +3 -3
- package/dist/esm/test-component.entry.js +3 -3
- package/dist/esm/theme-store-DroJsU6S.js +11 -0
- package/dist/esm/{toggle-handler-BRLmxe1J.js → toggle-handler-BB_SIgS1.js} +12 -15
- package/dist/esm/tooltip-open-tracking-CxHWKk8f.js +21 -0
- package/dist/esm/{unique-nav-labels-h2KOu5Qy.js → unique-nav-labels-CQgKoOXd.js} +2 -2
- package/dist/esm/{unit-BUhhJbhT.js → unit-D2lG-lEM.js} +2 -1
- package/dist/esm/{validators-BVM40IEr.js → validators-yh10eyXe.js} +4 -2
- package/dist/esm/{value-string-e9pwLcS-.js → value-string-DwEIOG1f.js} +2 -1
- package/dist/esm/{width-CgYY17tL.js → width-xawzWTVW.js} +2 -1
- package/dist/kolibri/Heading-foerLIu9.js +4 -0
- package/dist/kolibri/access-and-short-key-BTEwnScd.js +4 -0
- package/dist/kolibri/api-Ba9FNPRn.js +4 -0
- package/dist/kolibri/app-globals-CqYpXngl.js +4 -0
- package/dist/kolibri/aria-current-service-4eUMzpeO.js +4 -0
- package/dist/kolibri/aria-labelledby-C4wUnR-v.js +4 -0
- package/dist/kolibri/base-AKIr0rpk.js +4 -0
- package/dist/kolibri/base-C7nTPc7u.js +4 -0
- package/dist/kolibri/base-CpUNedp9.js +4 -0
- package/dist/kolibri/base-D7qItqyf.js +4 -0
- package/dist/kolibri/base-web-component-B3wi5eWH.js +4 -0
- package/dist/kolibri/base-web-component-BpL_hXcg.js +4 -0
- package/dist/kolibri/base-web-component-DorOeD_U.js +4 -0
- package/dist/kolibri/behavior-D9BHiFnH.js +4 -0
- package/dist/kolibri/behavior-DDo87iUM.js +4 -0
- package/dist/kolibri/behavior-XAV9GSxI.js +4 -0
- package/dist/kolibri/bem-registry-CrZZQahR.js +4 -0
- package/dist/kolibri/bootstrap-Cz7Iq2I2.js +4 -0
- package/dist/kolibri/color-CnVBqZd5.js +4 -0
- package/dist/kolibri/component-0npqUhj2.js +4 -0
- package/dist/kolibri/component-BCKsZOoB.js +4 -0
- package/dist/kolibri/component-BZjDp_Lf.js +4 -0
- package/dist/kolibri/component-CjdTbGlP.js +4 -0
- package/dist/kolibri/component-Cn693XeT.js +4 -0
- package/dist/kolibri/component-Cvd5HXbX.js +4 -0
- package/dist/kolibri/component-CvdxCpjC.js +4 -0
- package/dist/kolibri/component-DFhRTaqb.js +4 -0
- package/dist/kolibri/component-DP_p5few.js +4 -0
- package/dist/kolibri/component-DlROeCCe.js +4 -0
- package/dist/kolibri/component-names-DzmdvSkQ.js +4 -0
- package/dist/kolibri/contrast-BHjNzQvB.js +4 -0
- package/dist/kolibri/controller-DYkXzFqc.js +4 -0
- package/dist/kolibri/dev.utils-BgFDROtc.js +4 -0
- package/dist/kolibri/devtools-B6h2bVMJ.js +4 -0
- package/dist/kolibri/disabled-BZIZZ6wy.js +4 -0
- package/dist/kolibri/element-focus-C0L8NWU8.js +4 -0
- package/dist/kolibri/element-interaction-B3GEli6r.js +4 -0
- package/dist/kolibri/events-DdfMb1U7.js +4 -0
- package/dist/kolibri/field-control-QF0yTcyb.js +4 -0
- package/dist/kolibri/group-8Me6YSO8.js +4 -0
- package/dist/kolibri/has-closer-B-uYNNCw.js +4 -0
- package/dist/kolibri/href-DKPJq0Rh.js +4 -0
- package/dist/kolibri/i18n-TlIXBsgS.js +4 -0
- package/dist/kolibri/i18n-Uze_l4Ts.js +4 -0
- package/dist/kolibri/id-CkUYl2hO.js +4 -0
- package/dist/kolibri/index-D1fZ9xFt.js +6 -0
- package/dist/kolibri/index.esm.js +1 -1
- package/dist/kolibri/input-DwlolkOG.js +4 -0
- package/dist/kolibri/input-container-DC3x4oGg.js +4 -0
- package/dist/kolibri/item-DThxrTZc.js +4 -0
- package/dist/kolibri/item-cArH2C6l.js +4 -0
- package/dist/kolibri/item-pool-D4qvvY-S.js +4 -0
- package/dist/kolibri/item-uC3h4pj3.js +4 -0
- package/dist/kolibri/item-zPmzbSvE.js +4 -0
- package/dist/kolibri/keyboard-DzlBdECG.js +4 -0
- 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-combobox.entry.js +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.js +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.js +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-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.js +1 -1
- package/dist/kolibri/kol-toast-container.entry.js +1 -1
- package/dist/kolibri/kol-toolbar.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/kolibri.esm.js +1 -1
- package/dist/kolibri/label-G82W4YoW.js +4 -0
- package/dist/kolibri/label-hints-DiRb_zIZ.js +4 -0
- package/dist/kolibri/label-lang-segment-BSVexfSR.js +4 -0
- package/dist/kolibri/label-with-expert-slot-C1i0atAL.js +4 -0
- package/dist/kolibri/level-CWkPM-CS.js +4 -0
- package/dist/kolibri/link-target-B2OC2sZU.js +4 -0
- package/dist/kolibri/links-CiNHSAYH.js +4 -0
- package/dist/kolibri/multiple-CuU2AuEM.js +4 -0
- package/dist/kolibri/number-value-adUq1zr1.js +4 -0
- package/dist/kolibri/open-DR8Z7RtS.js +4 -0
- package/dist/kolibri/open-items-cache-CS2mDRNB.js +4 -0
- package/dist/kolibri/options-BDTJtk6H.js +4 -0
- package/dist/kolibri/options-BPwcDIDO.js +4 -0
- package/dist/kolibri/orientation-BUPO9LJU.js +4 -0
- package/dist/kolibri/placeholder-BTFnryTd.js +4 -0
- package/dist/kolibri/props-from-config-DqFgiUwD.js +4 -0
- package/dist/kolibri/read-only-DRmmHb2G.js +4 -0
- package/dist/kolibri/required-D4CdAA4s.js +4 -0
- package/dist/kolibri/resolve-props-BAambGug.js +4 -0
- package/dist/kolibri/resolve-props-Dpl38Wpe.js +4 -0
- package/dist/kolibri/rows-DRKSoawJ.js +4 -0
- package/dist/kolibri/scroll-lock-C66lpb8L.js +4 -0
- package/dist/kolibri/shared-state-Dn94ivRg.js +4 -0
- package/dist/kolibri/smart-button-BYEk3DzS.js +4 -0
- package/dist/kolibri/spell-check-DlQ_d2GL.js +4 -0
- package/dist/kolibri/src-Cikg9qhP.js +4 -0
- package/dist/kolibri/step-C7WPZrUp.js +4 -0
- package/dist/kolibri/suggestions-CotfxJG1.js +4 -0
- package/dist/kolibri/suggestions-qW9OdwO3.js +4 -0
- package/dist/kolibri/test-component.entry.js +1 -1
- package/dist/kolibri/theme-store-DroJsU6S.js +4 -0
- package/dist/kolibri/toggle-handler-BB_SIgS1.js +4 -0
- package/dist/kolibri/tooltip-open-tracking-CxHWKk8f.js +4 -0
- package/dist/kolibri/unique-nav-labels-CQgKoOXd.js +4 -0
- package/dist/kolibri/unit-D2lG-lEM.js +4 -0
- package/dist/kolibri/validators-yh10eyXe.js +4 -0
- package/dist/kolibri/value-string-DwEIOG1f.js +4 -0
- package/dist/kolibri/width-xawzWTVW.js +4 -0
- package/dist/types/components/accordion/component.d.ts +2 -2
- package/dist/types/components/alert/component.d.ts +3 -2
- package/dist/types/components/badge/component.d.ts +2 -2
- package/dist/types/components/breadcrumb/component.d.ts +2 -2
- package/dist/types/components/button/base.d.ts +1 -1
- package/dist/types/components/button/component.d.ts +2 -2
- package/dist/types/components/button-link/component.d.ts +2 -2
- package/dist/types/components/card/component.d.ts +12 -5
- package/dist/types/components/combobox/component.d.ts +10 -10
- package/dist/types/components/details/component.d.ts +2 -2
- package/dist/types/components/dialog/base.d.ts +1 -1
- package/dist/types/components/dialog/component.d.ts +3 -3
- package/dist/types/components/drawer/component.d.ts +2 -2
- package/dist/types/components/form/component.d.ts +2 -2
- package/dist/types/components/heading/component.d.ts +2 -2
- package/dist/types/components/image/component.d.ts +2 -2
- package/dist/types/components/input-checkbox/component.d.ts +9 -9
- package/dist/types/components/input-color/component.d.ts +4 -4
- package/dist/types/components/input-date/component.d.ts +7 -7
- package/dist/types/components/input-email/component.d.ts +8 -8
- package/dist/types/components/input-file/component.d.ts +4 -4
- package/dist/types/components/input-number/component.d.ts +6 -6
- package/dist/types/components/input-password/component.d.ts +8 -8
- package/dist/types/components/input-radio/component.d.ts +5 -5
- package/dist/types/components/input-range/component.d.ts +4 -4
- package/dist/types/components/input-text/component.d.ts +12 -12
- package/dist/types/components/kolibri/component.d.ts +2 -2
- package/dist/types/components/link/component.d.ts +4 -4
- package/dist/types/components/link-button/component.d.ts +4 -4
- package/dist/types/components/modal/component.d.ts +3 -3
- package/dist/types/components/nav/component.d.ts +2 -2
- package/dist/types/components/pagination/component.d.ts +8 -8
- package/dist/types/components/popover-button/component.d.ts +10 -3
- package/dist/types/components/progress/component.d.ts +1 -0
- package/dist/types/components/public-api/contract.d.ts +7 -2
- package/dist/types/components/select/component.d.ts +6 -6
- package/dist/types/components/single-select/component.d.ts +11 -10
- package/dist/types/components/skip-nav/component.d.ts +2 -2
- package/dist/types/components/spin/component.d.ts +2 -2
- package/dist/types/components/split-button/component.d.ts +2 -2
- package/dist/types/components/table-stateful/component.d.ts +10 -11
- package/dist/types/components/table-stateless/base.d.ts +4 -2
- package/dist/types/components/table-stateless/component.d.ts +5 -8
- package/dist/types/components/tabs/component.d.ts +4 -5
- package/dist/types/components/textarea/component.d.ts +8 -8
- package/dist/types/components/toolbar/component.d.ts +6 -6
- package/dist/types/components/tree/component.d.ts +3 -2
- package/dist/types/components/tree-item/component.d.ts +4 -4
- package/dist/types/components/version/component.d.ts +2 -2
- package/dist/types/components.d.ts +64 -177
- package/dist/types/core/component-names.d.ts +52 -53
- package/dist/types/core/i18n.d.ts +1 -1
- package/dist/types/core/shared-state.d.ts +1 -0
- package/dist/types/core/tag-transformer.d.ts +4 -0
- package/dist/types/core/theme-store.d.ts +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/internal/functional-components/abbr/api.d.ts +1 -1
- package/dist/types/internal/functional-components/alert/api.d.ts +1 -1
- package/dist/types/internal/functional-components/avatar/api.d.ts +2 -2
- package/dist/types/internal/functional-components/badge/api.d.ts +2 -26
- package/dist/types/internal/functional-components/base-web-component.d.ts +1 -1
- package/dist/types/internal/functional-components/bem-root-node/component.d.ts +8 -4
- package/dist/types/internal/functional-components/breadcrumb/api.d.ts +1 -1
- package/dist/types/internal/functional-components/button/api.d.ts +2 -2
- package/dist/types/internal/functional-components/button/item.d.ts +1 -1
- package/dist/types/internal/functional-components/card/api.d.ts +2 -2
- package/dist/types/internal/functional-components/collapsible/api.d.ts +2 -2
- package/dist/types/internal/functional-components/combobox/api.d.ts +4 -4
- package/dist/types/internal/functional-components/counter/api.d.ts +1 -1
- package/dist/types/internal/functional-components/dialog/api.d.ts +2 -2
- package/dist/types/internal/functional-components/dialog/component.d.ts +8 -4
- package/dist/types/internal/functional-components/dialog/item.d.ts +1 -1
- package/dist/types/internal/functional-components/drawer/api.d.ts +2 -2
- package/dist/types/internal/functional-components/form/api.d.ts +1 -1
- package/dist/types/internal/functional-components/form-association/api.d.ts +1 -1
- package/dist/types/internal/functional-components/form-association/behavior.d.ts +2 -2
- package/dist/types/internal/functional-components/form-field/api.d.ts +3 -3
- package/dist/types/internal/functional-components/form-field/base-web-component.d.ts +2 -2
- package/dist/types/internal/functional-components/form-field/custom-suggestions.d.ts +1 -0
- package/dist/types/internal/functional-components/form-field/number-value.d.ts +1 -1
- package/dist/types/internal/functional-components/form-field/select-value.d.ts +1 -1
- package/dist/types/internal/functional-components/generic-types.d.ts +2 -2
- package/dist/types/internal/functional-components/heading/api.d.ts +2 -2
- package/dist/types/internal/functional-components/icon/api.d.ts +1 -1
- package/dist/types/internal/functional-components/image/api.d.ts +2 -2
- package/dist/types/internal/functional-components/input-checkbox/api.d.ts +3 -3
- package/dist/types/internal/functional-components/input-color/api.d.ts +4 -28
- package/dist/types/internal/functional-components/input-date/api.d.ts +4 -28
- package/dist/types/internal/functional-components/input-email/api.d.ts +4 -28
- package/dist/types/internal/functional-components/input-file/api.d.ts +4 -28
- package/dist/types/internal/functional-components/input-number/api.d.ts +4 -28
- package/dist/types/internal/functional-components/input-password/api.d.ts +4 -28
- package/dist/types/internal/functional-components/input-radio/api.d.ts +3 -3
- package/dist/types/internal/functional-components/input-range/api.d.ts +4 -4
- package/dist/types/internal/functional-components/input-text/api.d.ts +4 -28
- package/dist/types/internal/functional-components/kolibri/api.d.ts +1 -1
- package/dist/types/internal/functional-components/link/api.d.ts +2 -2
- package/dist/types/internal/functional-components/meter/api.d.ts +3 -3
- package/dist/types/internal/functional-components/nav/api.d.ts +2 -2
- package/dist/types/internal/functional-components/pagination/api.d.ts +2 -2
- package/dist/types/internal/functional-components/pagination/item.d.ts +5 -3
- package/dist/types/internal/functional-components/pagination/page-size-select.d.ts +2 -1
- package/dist/types/internal/functional-components/popover/api.d.ts +1 -1
- package/dist/types/internal/functional-components/popover-button/api.d.ts +2 -2
- package/dist/types/internal/functional-components/progress/api.d.ts +3 -3
- package/dist/types/internal/functional-components/quote/api.d.ts +2 -2
- package/dist/types/internal/functional-components/select/api.d.ts +4 -4
- package/dist/types/internal/functional-components/single-select/api.d.ts +4 -4
- package/dist/types/internal/functional-components/single-select/component.d.ts +3 -0
- package/dist/types/internal/functional-components/skip-nav/api.d.ts +1 -1
- package/dist/types/internal/functional-components/spin/api.d.ts +1 -1
- package/dist/types/internal/functional-components/split-button/api.d.ts +1 -1
- package/dist/types/internal/functional-components/table-stateful/api.d.ts +2 -2
- package/dist/types/internal/functional-components/table-stateful/component.d.ts +10 -0
- package/dist/types/internal/functional-components/table-stateful/model.d.ts +4 -2
- package/dist/types/internal/functional-components/table-stateless/api.d.ts +2 -2
- package/dist/types/internal/functional-components/table-stateless/component.d.ts +2 -0
- package/dist/types/internal/functional-components/table-stateless/selection-tooltip-item.d.ts +10 -0
- package/dist/types/internal/functional-components/table-stateless/table-model.d.ts +5 -5
- package/dist/types/internal/functional-components/tabs/api.d.ts +2 -2
- package/dist/types/internal/functional-components/text-input/api.d.ts +4 -28
- package/dist/types/internal/functional-components/textarea/api.d.ts +4 -4
- package/dist/types/internal/functional-components/toolbar/api.d.ts +3 -3
- package/dist/types/internal/functional-components/toolbar/{item.d.ts → entry-item.d.ts} +1 -1
- package/dist/types/internal/functional-components/tooltip/api.d.ts +2 -2
- package/dist/types/internal/functional-components/tree/api.d.ts +1 -1
- package/dist/types/internal/functional-components/tree-item/api.d.ts +2 -2
- package/dist/types/internal/functional-components/version/api.d.ts +1 -1
- package/dist/types/internal/props/breadcrumb-links.d.ts +1 -1
- package/dist/types/internal/props/helpers/iso-date.d.ts +1 -5
- package/dist/types/internal/props/helpers/normalizers.d.ts +1 -2
- package/dist/types/internal/props/helpers/validators.d.ts +2 -1
- package/dist/types/internal/props/index.d.ts +2 -1
- package/dist/types/internal/props/info-popover.d.ts +1 -1
- package/dist/types/internal/props/input-date-max.d.ts +1 -1
- package/dist/types/internal/props/input-date-min.d.ts +1 -1
- package/dist/types/internal/props/label-decorative.d.ts +4 -0
- package/dist/types/internal/props/nav-links.d.ts +1 -1
- package/dist/types/internal/props/skip-nav-links.d.ts +1 -1
- package/dist/types/internal/props/smart-button.d.ts +1 -25
- package/dist/types/internal/props/table-headers.d.ts +2 -2
- package/dist/types/internal/props/table-stateful-headers.d.ts +2 -2
- package/dist/types/internal/props/value-input-date.d.ts +1 -1
- package/dist/types/locales/de.d.ts +1 -0
- package/dist/types/locales/en.d.ts +1 -0
- package/dist/types/schema/bem-registry.d.ts +87 -23
- package/dist/types/schema/components/alert.d.ts +2 -8
- package/dist/types/schema/components/badge.d.ts +3 -16
- package/dist/types/schema/components/breadcrumb.d.ts +0 -15
- package/dist/types/schema/components/button.d.ts +3 -3
- package/dist/types/schema/components/card.d.ts +0 -9
- package/dist/types/schema/components/form.d.ts +0 -13
- package/dist/types/schema/components/index.d.ts +0 -29
- package/dist/types/schema/components/link.d.ts +2 -2
- package/dist/types/schema/components/pagination.d.ts +3 -17
- package/dist/types/schema/components/popover-button.d.ts +3 -6
- package/dist/types/schema/components/table.d.ts +2 -3
- package/dist/types/schema/components/tableStateless.d.ts +5 -4
- package/dist/types/schema/components/tabs.d.ts +3 -21
- package/dist/types/schema/components/textarea.d.ts +0 -28
- package/dist/types/schema/i18n-keys.d.ts +29 -28
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/props/accept.d.ts +0 -3
- package/dist/types/schema/props/access-key.d.ts +0 -2
- package/dist/types/schema/props/active.d.ts +0 -3
- package/dist/types/schema/props/adjust-height.d.ts +0 -2
- package/dist/types/schema/props/alert-type.d.ts +0 -2
- package/dist/types/schema/props/align.d.ts +0 -2
- package/dist/types/schema/props/allow-multi-sort.d.ts +0 -3
- package/dist/types/schema/props/alt.d.ts +0 -3
- package/dist/types/schema/props/alternative-button-link-role.d.ts +1 -5
- package/dist/types/schema/props/aria-controls.d.ts +0 -2
- package/dist/types/schema/props/aria-current-value.d.ts +1 -5
- package/dist/types/schema/props/aria-description.d.ts +0 -2
- package/dist/types/schema/props/aria-details.d.ts +0 -2
- package/dist/types/schema/props/aria-expanded.d.ts +0 -2
- package/dist/types/schema/props/aria-labelledby.d.ts +1 -2
- package/dist/types/schema/props/aria-owns.d.ts +0 -2
- package/dist/types/schema/props/aria-selected.d.ts +0 -2
- package/dist/types/schema/props/auto-complete.d.ts +0 -2
- package/dist/types/schema/props/badge-text.d.ts +0 -2
- package/dist/types/schema/props/button-callbacks.d.ts +0 -3
- package/dist/types/schema/props/button-type.d.ts +1 -5
- package/dist/types/schema/props/button-variant.d.ts +1 -5
- package/dist/types/schema/props/checked.d.ts +0 -2
- package/dist/types/schema/props/collapsible.d.ts +0 -2
- package/dist/types/schema/props/color.d.ts +0 -4
- package/dist/types/schema/props/current-length.d.ts +0 -3
- package/dist/types/schema/props/custom-class.d.ts +0 -2
- package/dist/types/schema/props/disabled.d.ts +0 -2
- package/dist/types/schema/props/download.d.ts +0 -2
- package/dist/types/schema/props/error-list.d.ts +0 -2
- package/dist/types/schema/props/has-closer.d.ts +0 -2
- package/dist/types/schema/props/has-compact-button.d.ts +0 -2
- package/dist/types/schema/props/has-counter.d.ts +0 -3
- package/dist/types/schema/props/has-create-button.d.ts +0 -2
- package/dist/types/schema/props/has-icons-when-expanded.d.ts +0 -2
- package/dist/types/schema/props/has-settings-menu.d.ts +0 -2
- package/dist/types/schema/props/has-value.d.ts +0 -3
- package/dist/types/schema/props/hide-label.d.ts +0 -3
- package/dist/types/schema/props/hide-msg.d.ts +0 -3
- package/dist/types/schema/props/hint.d.ts +0 -2
- package/dist/types/schema/props/href.d.ts +2 -4
- package/dist/types/schema/props/icons-input-checkbox.d.ts +0 -2
- package/dist/types/schema/props/icons.d.ts +0 -3
- package/dist/types/schema/props/id.d.ts +0 -2
- package/dist/types/schema/props/image-sizes.d.ts +0 -3
- package/dist/types/schema/props/image-source.d.ts +0 -3
- package/dist/types/schema/props/image-srcset.d.ts +0 -3
- package/dist/types/schema/props/indeterminate.d.ts +0 -2
- package/dist/types/schema/props/index.d.ts +5 -1
- package/dist/types/schema/props/inline.d.ts +0 -3
- package/dist/types/schema/props/label-align.d.ts +1 -5
- package/dist/types/schema/props/label.d.ts +4 -7
- package/dist/types/schema/props/link-on-callbacks.d.ts +0 -2
- package/dist/types/schema/props/link-target.d.ts +0 -2
- package/dist/types/schema/props/loading.d.ts +1 -5
- package/dist/types/schema/props/max-length-behavior.d.ts +1 -5
- package/dist/types/schema/props/max-length.d.ts +0 -3
- package/dist/types/schema/props/max.d.ts +0 -4
- package/dist/types/schema/props/modal.d.ts +0 -2
- package/dist/types/schema/props/msg.d.ts +0 -2
- package/dist/types/schema/props/multiple.d.ts +0 -3
- package/dist/types/schema/props/name.d.ts +0 -3
- package/dist/types/schema/props/open.d.ts +0 -3
- package/dist/types/schema/props/options.d.ts +0 -4
- package/dist/types/schema/props/orientation.d.ts +1 -5
- package/dist/types/schema/props/pagination-position.d.ts +1 -5
- package/dist/types/schema/props/pattern.d.ts +0 -3
- package/dist/types/schema/props/placeholder.d.ts +0 -3
- package/dist/types/schema/props/popover-align.d.ts +0 -2
- package/dist/types/schema/props/read-only.d.ts +0 -2
- package/dist/types/schema/props/required.d.ts +0 -2
- package/dist/types/schema/props/resize-textarea.d.ts +0 -2
- package/dist/types/schema/props/rows.d.ts +0 -2
- package/dist/types/schema/props/short-key.d.ts +0 -2
- package/dist/types/schema/props/show.d.ts +0 -3
- package/dist/types/schema/props/spell-check.d.ts +0 -2
- package/dist/types/schema/props/suggestions.d.ts +0 -2
- package/dist/types/schema/props/tab-behavior.d.ts +1 -5
- package/dist/types/schema/props/tab-index.d.ts +0 -2
- package/dist/types/schema/props/table-callbacks.d.ts +5 -5
- package/dist/types/schema/props/table-data-foot.d.ts +0 -3
- package/dist/types/schema/props/table-data.d.ts +0 -3
- package/dist/types/schema/props/table-fixed-cols.d.ts +0 -2
- package/dist/types/schema/props/table-headers.d.ts +3 -0
- package/dist/types/schema/props/table-selection.d.ts +0 -2
- package/dist/types/schema/props/toolbar-items.d.ts +0 -2
- package/dist/types/schema/props/tooltip-align.d.ts +0 -2
- package/dist/types/schema/props/touched.d.ts +0 -2
- package/dist/types/schema/props/type-input-date.d.ts +4 -2
- package/dist/types/schema/props/type-input-text.d.ts +0 -2
- package/dist/types/schema/props/unit.d.ts +0 -2
- package/dist/types/schema/props/variant/dialog.d.ts +1 -5
- package/dist/types/schema/props/variant/modal.d.ts +0 -1
- package/dist/types/schema/props/variant/password-variant.d.ts +1 -5
- package/dist/types/schema/props/variant-alert.d.ts +0 -2
- package/dist/types/schema/props/variant-class-name.d.ts +0 -3
- package/dist/types/schema/props/variant-input-checkbox.d.ts +0 -2
- package/dist/types/schema/props/variant-progress.d.ts +0 -2
- package/dist/types/schema/props/visibility-toggle.d.ts +0 -3
- package/dist/types/schema/props/width.d.ts +0 -3
- package/dist/types/schema/types/button-link-text.d.ts +4 -4
- package/dist/types/schema/validators/common.d.ts +2 -0
- package/dist/types/schema/validators/index.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +1 -1
- package/dist/types/utils/aria-labelledby.d.ts +0 -6
- package/dist/types/utils/testing/logged-messages.d.ts +1 -0
- package/dist/types/utils/testing/snapshot-input-testing.d.ts +2 -1
- package/dist/types/utils/testing/snapshot-testing.d.ts +4 -1
- package/doc/badge.md +21 -6
- package/doc/button.md +13 -0
- package/doc/combobox.md +23 -23
- package/doc/input-checkbox.md +17 -2
- package/doc/input-color.md +22 -22
- package/doc/input-date.md +28 -28
- package/doc/input-email.md +30 -30
- package/doc/input-file.md +22 -22
- package/doc/input-number.md +43 -28
- package/doc/input-password.md +29 -29
- package/doc/input-radio.md +19 -19
- package/doc/input-range.md +24 -24
- package/doc/input-text.md +31 -31
- package/doc/link.md +13 -0
- package/doc/pagination.md +13 -13
- package/doc/quote.md +13 -0
- package/doc/select.md +24 -24
- package/doc/single-select.md +24 -24
- package/doc/table-stateful.md +33 -16
- package/doc/table-stateless.md +31 -15
- package/doc/tabs.md +1 -1
- package/doc/textarea.md +29 -29
- package/package.json +25 -17
- package/vscode-custom-data.json +53 -158
- package/dist/cjs/ariaCurrentService-3051l6MI.js +0 -28
- package/dist/cjs/block-bem-BI7yfoFU.js +0 -18
- package/dist/cjs/bootstrap-DkgMbRSL.js +0 -33
- package/dist/cjs/clsx-Bm_HQUnh.js +0 -54
- package/dist/cjs/common-C-hcIfzh.js +0 -1755
- package/dist/cjs/component-BEzksV1U.js +0 -9300
- package/dist/cjs/component-BQUKg-qY.js +0 -53
- package/dist/cjs/component-BlAPlTfV.js +0 -20
- package/dist/cjs/component-DMfcX1br.js +0 -14
- package/dist/cjs/component-Dkx5Zyhq.js +0 -18
- package/dist/cjs/component-names-BMpML1sX.js +0 -113
- package/dist/cjs/input-CgTL2oH6.js +0 -20
- package/dist/cjs/kol-click-button.cjs.entry.js +0 -55
- package/dist/cjs/kol-skeleton.cjs.entry.js +0 -107
- package/dist/cjs/name-D4qpL1m-.js +0 -10
- package/dist/collection/components/card/base.js +0 -79
- package/dist/collection/components/click-button/component.js +0 -105
- package/dist/collection/components/link/ariaCurrentService.js +0 -23
- package/dist/collection/components/popover-button/base.js +0 -69
- package/dist/collection/components/skeleton/component.js +0 -215
- package/dist/collection/internal/functional-components/click-button/api.js +0 -7
- package/dist/collection/internal/functional-components/click-button/component.js +0 -9
- package/dist/collection/internal/functional-components/skeleton/api.js +0 -7
- package/dist/collection/internal/functional-components/skeleton/component.js +0 -20
- package/dist/collection/schema/components/button-link.js +0 -1
- package/dist/collection/schema/components/collapsible.js +0 -1
- package/dist/collection/schema/components/combobox.js +0 -1
- package/dist/collection/schema/components/details.js +0 -1
- package/dist/collection/schema/components/dialog.js +0 -1
- package/dist/collection/schema/components/drawer.js +0 -1
- package/dist/collection/schema/components/heading.js +0 -1
- package/dist/collection/schema/components/input-checkbox.js +0 -1
- package/dist/collection/schema/components/input-color.js +0 -1
- package/dist/collection/schema/components/input-date.js +0 -1
- package/dist/collection/schema/components/input-email.js +0 -1
- package/dist/collection/schema/components/input-file.js +0 -1
- package/dist/collection/schema/components/input-number.js +0 -1
- package/dist/collection/schema/components/input-password.js +0 -1
- package/dist/collection/schema/components/input-radio.js +0 -1
- package/dist/collection/schema/components/input-range.js +0 -1
- package/dist/collection/schema/components/input-text.js +0 -1
- package/dist/collection/schema/components/kolibri.js +0 -1
- package/dist/collection/schema/components/link-button.js +0 -1
- package/dist/collection/schema/components/modal.js +0 -1
- package/dist/collection/schema/components/nav.js +0 -1
- package/dist/collection/schema/components/select.js +0 -1
- package/dist/collection/schema/components/single-select.js +0 -1
- package/dist/collection/schema/components/skip-nav.js +0 -1
- package/dist/collection/schema/components/split-button.js +0 -1
- package/dist/collection/schema/components/toolbar.js +0 -1
- package/dist/collection/schema/components/tree-item.js +0 -1
- package/dist/collection/schema/components/tree.js +0 -1
- package/dist/collection/schema/components/version.js +0 -1
- package/dist/collection/schema/props/table-header-cells.js +0 -36
- package/dist/collection/schema/validators/alignment.js +0 -10
- package/dist/collection/utils/testing/legacy-component.js +0 -16
- package/dist/components/aria-labelledby.js +0 -4
- package/dist/components/ariaCurrentService.js +0 -4
- package/dist/components/block-bem.js +0 -4
- package/dist/components/clsx.js +0 -4
- package/dist/components/href.js +0 -4
- package/dist/components/kol-click-button.d.ts +0 -11
- package/dist/components/kol-click-button.js +0 -4
- package/dist/components/kol-skeleton.d.ts +0 -11
- package/dist/components/kol-skeleton.js +0 -4
- package/dist/components/name.js +0 -4
- package/dist/components/props-from-config.js +0 -4
- package/dist/esm/ariaCurrentService-YoLNpD5S.js +0 -25
- package/dist/esm/block-bem-BpQSY04L.js +0 -16
- package/dist/esm/bootstrap-B9DtStuh.js +0 -28
- package/dist/esm/clsx-COFh-Vc8.js +0 -52
- package/dist/esm/common-OzsC_6kt.js +0 -1709
- package/dist/esm/component-Bc1n82Y8.js +0 -16
- package/dist/esm/component-CZZNha2e.js +0 -9295
- package/dist/esm/component-Cdnq5GYF.js +0 -18
- package/dist/esm/component-DLSlbWg8.js +0 -12
- package/dist/esm/component-DeMf195P.js +0 -48
- package/dist/esm/component-names-CrfBV37S.js +0 -111
- package/dist/esm/kol-click-button.entry.js +0 -53
- package/dist/esm/kol-skeleton.entry.js +0 -105
- package/dist/esm/label-with-expert-slot-CicRes-W.js +0 -12
- package/dist/esm/name-B2Yf3EpX.js +0 -8
- package/dist/esm/tooltip-open-tracking-D3tCiiGP.js +0 -18
- package/dist/kolibri/Heading-BVhjT9av.js +0 -4
- package/dist/kolibri/access-and-short-key-ijzCZfHm.js +0 -4
- package/dist/kolibri/api-D92_O-0H.js +0 -4
- package/dist/kolibri/app-globals-CBGjgNge.js +0 -4
- package/dist/kolibri/aria-labelledby-CLehu03h.js +0 -4
- package/dist/kolibri/ariaCurrentService-YoLNpD5S.js +0 -4
- package/dist/kolibri/base-BLBSJu_1.js +0 -4
- package/dist/kolibri/base-CHmdLgoO.js +0 -4
- package/dist/kolibri/base-DIcqHqMz.js +0 -4
- package/dist/kolibri/base-qvPPg-dn.js +0 -4
- package/dist/kolibri/base-web-component-CaAexWy_.js +0 -4
- package/dist/kolibri/base-web-component-DbagnM7m.js +0 -4
- package/dist/kolibri/base-web-component-XgI4wUyN.js +0 -4
- package/dist/kolibri/behavior-B08CXmI4.js +0 -4
- package/dist/kolibri/behavior-CwUUkdaP.js +0 -4
- package/dist/kolibri/behavior-DW7_5Wxp.js +0 -4
- package/dist/kolibri/bem-registry-CWN7_O1L.js +0 -4
- package/dist/kolibri/block-bem-BpQSY04L.js +0 -4
- package/dist/kolibri/bootstrap-B9DtStuh.js +0 -4
- package/dist/kolibri/clsx-COFh-Vc8.js +0 -4
- package/dist/kolibri/color-eAL9I7Wq.js +0 -4
- package/dist/kolibri/common-OzsC_6kt.js +0 -4
- package/dist/kolibri/component-8ALsFV4i.js +0 -4
- package/dist/kolibri/component-BTMWoACz.js +0 -4
- package/dist/kolibri/component-Bc1n82Y8.js +0 -4
- package/dist/kolibri/component-CZZNha2e.js +0 -4
- package/dist/kolibri/component-CdKSiR5P.js +0 -4
- package/dist/kolibri/component-Cdnq5GYF.js +0 -4
- package/dist/kolibri/component-D0mBOGjS.js +0 -4
- package/dist/kolibri/component-DBAicJ2u.js +0 -4
- package/dist/kolibri/component-DCw1ZAE5.js +0 -4
- package/dist/kolibri/component-DLSlbWg8.js +0 -4
- package/dist/kolibri/component-DeMf195P.js +0 -4
- package/dist/kolibri/component-nR5Bf9G5.js +0 -4
- package/dist/kolibri/component-names-CrfBV37S.js +0 -4
- package/dist/kolibri/contrast-D78VGPFR.js +0 -4
- package/dist/kolibri/controller-C3O9ohSP.js +0 -4
- package/dist/kolibri/dev.utils-wYkYn08d.js +0 -4
- package/dist/kolibri/devtools-DrBkkLdP.js +0 -4
- package/dist/kolibri/disabled-Cqhc40CU.js +0 -4
- package/dist/kolibri/element-focus-BIRmGg5W.js +0 -4
- package/dist/kolibri/element-interaction-sGYdEpmv.js +0 -4
- package/dist/kolibri/events-BIT-JUP2.js +0 -4
- package/dist/kolibri/field-control-Cs5VvsYo.js +0 -4
- package/dist/kolibri/group-uNo1CfbK.js +0 -4
- package/dist/kolibri/has-closer-B9NQY7BK.js +0 -4
- package/dist/kolibri/href-JqLbNBsW.js +0 -4
- package/dist/kolibri/i18n-Dl6Jjofb.js +0 -4
- package/dist/kolibri/i18n-DtLKn3Xt.js +0 -4
- package/dist/kolibri/id-CIYvVaNr.js +0 -4
- package/dist/kolibri/index-BKEJuyFi.js +0 -6
- package/dist/kolibri/input-Dja5Qioc.js +0 -4
- package/dist/kolibri/input-container-C2Am7LEP.js +0 -4
- package/dist/kolibri/item-C4AmpdVD.js +0 -4
- package/dist/kolibri/item-ConW1c81.js +0 -4
- package/dist/kolibri/item-D627ShRd.js +0 -4
- package/dist/kolibri/item-DIAFIFSy.js +0 -4
- package/dist/kolibri/item-pool-BOxAYePG.js +0 -4
- package/dist/kolibri/keyboard-Cnv7zP3N.js +0 -4
- package/dist/kolibri/kol-click-button.entry.js +0 -4
- package/dist/kolibri/kol-skeleton.entry.js +0 -4
- package/dist/kolibri/label-BRosRgdX.js +0 -4
- package/dist/kolibri/label-hints-Jn18RUT-.js +0 -4
- package/dist/kolibri/label-lang-segment-2_GnxjFp.js +0 -4
- package/dist/kolibri/label-with-expert-slot-CicRes-W.js +0 -4
- package/dist/kolibri/level-CA1s1_Mf.js +0 -4
- package/dist/kolibri/link-target-FX94oqMo.js +0 -4
- package/dist/kolibri/links-DwucTqcR.js +0 -4
- package/dist/kolibri/multiple-DqrZxybx.js +0 -4
- package/dist/kolibri/name-B2Yf3EpX.js +0 -4
- package/dist/kolibri/number-value-B-SJ1dRo.js +0 -4
- package/dist/kolibri/open-DRRv1KFK.js +0 -4
- package/dist/kolibri/open-items-cache-D-kml1h6.js +0 -4
- package/dist/kolibri/options-B0rBHetL.js +0 -4
- package/dist/kolibri/options-DCaUcfAu.js +0 -4
- package/dist/kolibri/orientation-XNOCaPwy.js +0 -4
- package/dist/kolibri/placeholder-BeLIzdJv.js +0 -4
- package/dist/kolibri/props-from-config-Ci0dILpz.js +0 -4
- package/dist/kolibri/read-only-Bby9r6ZX.js +0 -4
- package/dist/kolibri/required-hoaT7UmZ.js +0 -4
- package/dist/kolibri/resolve-props-BLZxWC3j.js +0 -4
- package/dist/kolibri/resolve-props-D2KiItuv.js +0 -4
- package/dist/kolibri/rows-B0x8CR7K.js +0 -4
- package/dist/kolibri/scroll-lock-Y2hf47KW.js +0 -4
- package/dist/kolibri/smart-button-CS_ZriPt.js +0 -4
- package/dist/kolibri/spell-check-DzgftyqL.js +0 -4
- package/dist/kolibri/src-DaGhmCL1.js +0 -4
- package/dist/kolibri/step-Bdj89bGO.js +0 -4
- package/dist/kolibri/suggestions-DuqzGDve.js +0 -4
- package/dist/kolibri/suggestions-Dy1X-Pc3.js +0 -4
- package/dist/kolibri/toggle-handler-BRLmxe1J.js +0 -4
- package/dist/kolibri/tooltip-open-tracking-D3tCiiGP.js +0 -4
- package/dist/kolibri/unique-nav-labels-h2KOu5Qy.js +0 -4
- package/dist/kolibri/unit-BUhhJbhT.js +0 -4
- package/dist/kolibri/validators-BVM40IEr.js +0 -4
- package/dist/kolibri/value-string-e9pwLcS-.js +0 -4
- package/dist/kolibri/width-CgYY17tL.js +0 -4
- package/dist/types/components/card/base.d.ts +0 -27
- package/dist/types/components/click-button/component.d.ts +0 -15
- package/dist/types/components/popover-button/base.d.ts +0 -21
- package/dist/types/components/skeleton/component.d.ts +0 -26
- package/dist/types/internal/functional-components/click-button/api.d.ts +0 -15
- package/dist/types/internal/functional-components/click-button/component.d.ts +0 -4
- package/dist/types/internal/functional-components/skeleton/api.d.ts +0 -29
- package/dist/types/internal/functional-components/skeleton/component.d.ts +0 -4
- package/dist/types/schema/components/accordion.d.ts +0 -11
- package/dist/types/schema/components/button-link.d.ts +0 -7
- package/dist/types/schema/components/collapsible.d.ts +0 -7
- package/dist/types/schema/components/combobox.d.ts +0 -26
- package/dist/types/schema/components/details.d.ts +0 -11
- package/dist/types/schema/components/dialog.d.ts +0 -21
- package/dist/types/schema/components/drawer.d.ts +0 -17
- package/dist/types/schema/components/heading.d.ts +0 -17
- package/dist/types/schema/components/input-checkbox.d.ts +0 -25
- package/dist/types/schema/components/input-color.d.ts +0 -25
- package/dist/types/schema/components/input-date.d.ts +0 -34
- package/dist/types/schema/components/input-email.d.ts +0 -31
- package/dist/types/schema/components/input-file.d.ts +0 -22
- package/dist/types/schema/components/input-number.d.ts +0 -33
- package/dist/types/schema/components/input-password.d.ts +0 -31
- package/dist/types/schema/components/input-radio.d.ts +0 -22
- package/dist/types/schema/components/input-range.d.ts +0 -27
- package/dist/types/schema/components/input-text.d.ts +0 -33
- package/dist/types/schema/components/kolibri.d.ts +0 -21
- package/dist/types/schema/components/link-button.d.ts +0 -7
- package/dist/types/schema/components/modal.d.ts +0 -4
- package/dist/types/schema/components/nav.d.ts +0 -16
- package/dist/types/schema/components/select.d.ts +0 -24
- package/dist/types/schema/components/single-select.d.ts +0 -24
- package/dist/types/schema/components/skip-nav.d.ts +0 -16
- package/dist/types/schema/components/split-button.d.ts +0 -9
- package/dist/types/schema/components/toolbar.d.ts +0 -11
- package/dist/types/schema/components/tree-item.d.ts +0 -12
- package/dist/types/schema/components/tree.d.ts +0 -10
- package/dist/types/schema/components/version.d.ts +0 -10
- package/dist/types/schema/props/table-header-cells.d.ts +0 -11
- package/dist/types/schema/validators/alignment.d.ts +0 -3
- package/dist/types/utils/testing/legacy-component.d.ts +0 -4
- package/doc/skeleton.md +0 -54
- /package/dist/collection/{components → internal/functional-components}/tree/open-items-cache.js +0 -0
- /package/dist/collection/schema/{components/accordion.js → props/table-headers.js} +0 -0
- /package/dist/types/{components/link/ariaCurrentService.d.ts → internal/functional-components/link/aria-current-service.d.ts} +0 -0
- /package/dist/types/{components → internal/functional-components}/tree/open-items-cache.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{p as e,k as i,H as t,b as o}from"./bem-registry.js";import{a as s,F as l}from"./behavior3.js";import{d as r}from"./disabled.js";import{h as a,e as n,k as d,T as h}from"./component3.js";import{c,n as p,b as u,a as m,t as v}from"./props-from-config.js";import{l as b}from"./label-with-expert-slot.js";import{n as f}from"./name.js";import{a as g}from"./tslib.es6.js";import{S as y,b as j,s as _}from"./component7.js";import{r as B}from"./aria-labelledby.js";import{a as L,c as O,n as T}from"./dev.utils.js";import{K as F,d as N}from"./events.js";import{B as x}from"./base-web-component.js";import{c as k}from"./item.js";import{c as K}from"./item2.js";import{T as w}from"./behavior.js";import{h as A}from"@stencil/core/internal/client";import{t as P}from"./i18n.js";import{c as C}from"./clsx.js";import{B as H}from"./component.js";import{P as D}from"./behavior4.js";import{A as I}from"./component2.js";function M(e,i){return Boolean(e)&&!0===i}function S(e){var i;return"string"==typeof e?"error":null!==(i=null==e?void 0:e._type)&&void 0!==i?i:"error"}const q=c("hideMsg",!1,p),E=c("hint","",u),$=c("infoPopover",void 0,(function(e){if("object"==typeof e&&null!==e)return e;throw new Error("Invalid info popover: "+typeof e)})),z=m(),R=c("msg",void 0,(function(i){if("string"==typeof i)try{return e(i)}catch(e){return i}return i}),(function(e){return void 0===e||("string"==typeof e?e.length>0:i(e)&&t(e._description,1))})),V=c("touched",!1,p),G={required:[b],optional:[s,r,a,q,E,$,z,R,f,n,V]},J=e=>{var{id:i,class:t,hint:o,baseClassName:s="kol-form-field"}=e,l=g(e,["id","class","hint","baseClassName"]);return o?A("span",Object.assign({class:C(`${s}__hint`,t),id:L(i||"","hint")},l),o):null},Q=e=>{var{component:i="label",id:t,baseClassName:o="kol-form-field",class:s,accessKey:l,shortKey:r,label:a,hideLabel:n,hasExpertSlot:d,omitId:h,showBadge:c=!0,readOnly:p,infoPopover:u}=e,m=g(e,["component","id","baseClassName","class","accessKey","shortKey","label","hideLabel","hasExpertSlot","omitId","showBadge","readOnly","infoPopover"]);const v=!d&&n,b=!1===c?void 0:j(l,r);return A(i,Object.assign({},m,{class:C(`${o}__label`,s),id:v||h?void 0:L(t,"label"),hidden:v,htmlFor:"legend"===i?void 0:t}),A(y,{class:`${o}__label-text`,label:d?"":null!=a?a:"",badgeText:b},A("slot",{name:"expert"})),!d&&p&&A("span",{class:`${o}__label__read-only`,"aria-hidden":"true"},"(",P("kol-readonly"),")"),!d&&u&&A("span",null,A(D,Object.assign({},u.popoverButton),A("div",{class:"kol-popover-button__popover--styled"},u.content))))},U=i=>{var t,o,{alert:s,hideMsg:l,msg:r,id:a,class:n}=i,d=g(i,["alert","hideMsg","msg","id","class"]);const h=function(i){if("string"==typeof i)try{return e(i)}catch(e){return{_description:i,_type:"error"}}return i&&"object"==typeof i&&!("_type"in i)?Object.assign(Object.assign({},i),{_type:"error"}):i}(r);return A(I,Object.assign({alert:!l&&(null!==(t=null==h?void 0:h._alert)&&void 0!==t?t:!0===s),class:C("kol-form-field__msg",l&&"visually-hidden",n),closerAriaDescriptionId:T(),handleCloserClick:()=>{},hasCloser:!1,headingId:O("alert-heading"),id:L(a,"msg"),label:"",level:0,refCloserButton:()=>{},refCloserTooltip:()=>{},type:null!==(o=null==h?void 0:h._type)&&void 0!==o?o:"error",variant:"msg"},d),(null==h?void 0:h._description)||void 0)},W=o.forBlock("kol-form-field"),X=({hideLabel:e,label:i,renderNoTooltip:t})=>!t&&!_(i)&&!0===e,Y=e=>{const i=S(e);return{[i]:!0,[`msg-type-${i}`]:!0}},Z=(e,i)=>{const{renderNoLabel:t,renderNoTooltip:o,renderNoHint:s,id:l,required:r,alert:a,disabled:n,class:c,msg:p,hideMsg:u,hideLabel:m,label:v,infoPopover:b,hint:f,accessKey:y,shortKey:B,counter:O,readOnly:T,touched:F,maxLength:N,ariaDescribedBy:x,showBadge:k,tooltipAlign:K,variant:w,component:D="div",orientation:I,refInput:S,refTooltip:q}=e,E=g(e,["renderNoLabel","renderNoTooltip","renderNoHint","id","required","alert","disabled","class","msg","hideMsg","hideLabel","label","infoPopover","hint","accessKey","shortKey","counter","readOnly","touched","maxLength","ariaDescribedBy","showBadge","tooltipAlign","variant","component","orientation","refInput","refTooltip"]),$=_(v),z=M(p,F),R=j(y,B),V=X({hideLabel:m,label:v,renderNoTooltip:o}),G="fieldset"===D;return A(H,Object.assign({component:D,block:"kol-form-field",modifiers:Object.assign({disabled:Boolean(n),required:Boolean(r),touched:Boolean(F),"hide-label":Boolean(m),"read-only":Boolean(T),"hidden-msg":Boolean(u)},z?Y(p):{}),class:C(w&&d(w,"form-field"),c),disabled:!(!G||!n)||void 0,"aria-describedby":x},E),!t&&A(Q,{component:G?"legend":"label",class:G?"kol-form-field__label--legend":void 0,id:l,hasExpertSlot:$,hideLabel:m,label:v,accessKey:y,shortKey:B,readOnly:T,showBadge:k,infoPopover:b}),A("div",{class:W("input",{"orientation-horizontal":"horizontal"===I,"orientation-vertical":"vertical"===I}),ref:S},i,V&&A("div",{class:W("tooltip")},A(h,{badgeText:R||"",label:v,align:K,id:L(l,"label"),refFloating:q}))),O&&!("soft"===O.maxLengthBehavior&&"number"!=typeof O.maxLength)&&A("div",{class:W("counter")},A("span",{"aria-hidden":"true",class:W("counter"),ref:O.visualRef}),A("span",{"aria-live":"polite",class:"visually-hidden",id:L(l,"counter"),ref:O.ariaRef})),z&&A(U,{id:l,alert:a,hideMsg:u,msg:p}),!s&&A(J,{id:l,hint:f}),"number"==typeof N&&!O&&A("span",{id:L(l,"character-limit-hint"),class:"visually-hidden"},P("kol-character-limit-hint",{placeholders:{limit:String(N)}})))};function ee({ariaDescribedBy:e,hideLabel:i,label:t}){return{title:"",autoCapitalize:"off",autoCorrect:"off","aria-describedby":(null==e?void 0:e.length)?e.join(" "):void 0,"aria-label":i&&t?v(t):void 0}}const ie=class extends x{constructor(){super(...arguments),this.tooltipBehavior=new w(x.stateLess),this.smartButton=k((()=>this.host)),this.infoPopover=K({getFlagHost:()=>this.host,getOpen:()=>!0===this.infoPopoverOpen,setOpen:e=>{this.infoPopoverOpen=e}}),this.focusEventSent=!1,this.handleChange=(e,i)=>{var t,o;e.stopPropagation(),void 0===i&&(i=e.target.value),this.emit(F.change,i),null===(o=null===(t=this._on)||void 0===t?void 0:t.onChange)||void 0===o||o.call(t,e,i)},this.handleInput=(e,i)=>{var t,o;e.stopPropagation(),void 0===i&&(i=e.target.value),this.emit(F.input,i),this.formAssociation.setFormAssociatedValue(i),null===(o=null===(t=this._on)||void 0===t?void 0:t.onInput)||void 0===o||o.call(t,e,i)},this.handleClick=e=>{var i,t;this.emit(F.click),null===(t=null===(i=this._on)||void 0===i?void 0:i.onClick)||void 0===t||t.call(i,e)},this.handleFocus=e=>{var i,t;this.focusEventSent||(this.emit(F.focus),null===(t=null===(i=this._on)||void 0===i?void 0:i.onFocus)||void 0===t||t.call(i,e),this.focusEventSent=!0),this.shared.setState("inputHasFocus",!0)},this.handleBlur=e=>{this.handleFocusLeave(e),this.shared.setState("inputHasFocus",!1)},this.handleKeyDown=e=>{var i,t;this.emit(F.keydown),null===(t=null===(i=this._on)||void 0===i?void 0:i.onKeyDown)||void 0===t||t.call(i,e)},this.setInputRef=e=>{this.tooltipAnchor=e,e&&this.isTooltipShown()&&(this.tooltipBehavior.initContext(e),this.tooltipBehavior.syncListeners(void 0,e,!0))},this.setTooltipRef=e=>{this.tooltipBehavior.setTooltipElementRef(e)}}get shared(){return this}initFormAssociation(e,i){this.formAssociation=new l(x.stateLess,{host:this.host,type:e,name:i})}syncFormField(){this.smartButton.syncListeners(),this.infoPopover.syncListeners(),this.syncAriaDetails()}destroyFormField(){this.tooltipBehavior.destroy(),this.smartButton.destroy(),this.infoPopover.destroy()}connectedCallback(){this.syncFormField(),this.tooltipAnchor&&this.isTooltipShown()&&(this.tooltipBehavior.initContext(this.tooltipAnchor),this.tooltipBehavior.syncListeners(void 0,this.tooltipAnchor,!0))}getInfoPopover(){const e=this.shared.getRenderProp("infoPopover");if(!e)return;const{_content:i}=e,t=g(e,["_content"]);return{popoverButton:this.infoPopover.getFcProps(Object.assign(Object.assign({_variant:"ghost"},t),{_hideLabel:!0,_inline:!0})),content:i}}getSmartButtonFcProps(e,i){if("object"==typeof e&&null!==e)return this.smartButton.getFcProps(Object.assign({_hideLabel:!0,_disabled:i},e),{class:"kol-input-container__smart-button"})}applyAriaDetails(e){s.apply(e,(e=>this.shared.setRenderProp("ariaDetails",e))),this.formAssociation.watchAriaDetails(e),this.syncAriaDetails()}syncAriaDetails(){var e,i,t,o;const s=null===(i=null===(e=this.host)||void 0===e?void 0:e.shadowRoot)||void 0===i?void 0:i.querySelector("input, select, textarea");if(!s||!("ariaDetailsElements"in s))return;const l=B(this.host,this.shared.getRenderProp("ariaDetails")),r=this.pushedDetailsElements;(s!==this.ariaDetailsTarget||(null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0)!==l.length||null!==(o=null==r?void 0:r.some(((e,i)=>e!==l[i])))&&void 0!==o&&o)&&(this.ariaDetailsTarget=s,this.pushedDetailsElements=l,s.ariaDetailsElements=l.length?l:null)}applyDisabled(e){r.apply(e,(e=>this.shared.setRenderProp("disabled",e)))}applyHideLabel(e){a.apply(e,(e=>this.shared.setRenderProp("hideLabel",e)))}applyHideMsg(e){q.apply(e,(e=>this.shared.setRenderProp("hideMsg",e)))}applyHint(e){E.apply(e,(e=>this.shared.setRenderProp("hint",e)))}applyInfoPopover(e){$.apply(e,(e=>this.shared.setRenderProp("infoPopover",e)))}applyLabel(e){b.apply(e,(e=>this.shared.setRenderProp("label",e)),this.isRequired("label"))}applyMsg(e){R.apply(e,(e=>this.shared.setRenderProp("msg",e)))}applyName(e){f.apply(e,(e=>this.shared.setRenderProp("name",e))),this.formAssociation.watchName(e)}applyOn(e){z.apply(e,(e=>this.shared.setRenderProp("on",e)))}applySyncValueBySelector(e){this.formAssociation.watchSyncValueBySelector(e)}applyTooltipAlign(e){n.apply(null!=e?e:"top",(e=>this.shared.setRenderProp("tooltipAlign",e)))}applyTouched(e){V.apply(e,(e=>this.shared.setRenderProp("touched",e)))}get eventHost(){var e,i;return null!==(i=null===(e=this.formAssociation)||void 0===e?void 0:e.host)&&void 0!==i?i:this.host}emit(e,i){this.eventHost&&N(this.eventHost,e,i)}handleFocusLeave(e){var i,t;if(this._disabled)return;const o=this.eventHost,s=(null==o?void 0:o.shadowRoot)||o,l=(null==s?void 0:s.contains(e.relatedTarget))||o===e.relatedTarget;this.focusEventSent&&!l&&(this._touched=!0,this.emit(F.blur),null===(t=null===(i=this._on)||void 0===i?void 0:i.onBlur)||void 0===t||t.call(i,e),this.focusEventSent=!1)}getAria(){const e=this.shared;return(({id:e,msg:i,hint:t,touched:o})=>{const s="string"==typeof i?i:null==i?void 0:i._description,l=Boolean(s&&s.length>0),r="error"===S(i)&&l&&!0===o,a="string"==typeof t&&t.length>0,n=[];return l&&!0===o&&n.push(L(e,"msg")),a&&n.push(L(e,"hint")),{hasError:r,hasHint:a,ariaDescribedBy:n}})({id:e.getState("id"),msg:e.getRenderProp("msg"),hint:e.getRenderProp("hint"),touched:e.getRenderProp("touched")})}showAsAlert(){return Boolean(this.shared.getRenderProp("touched"))&&!this.shared.getState("inputHasFocus")}isTooltipShown(){const e=this.shared;return X({hideLabel:e.getRenderProp("hideLabel"),label:v(e.getRenderProp("label"))})}getLabelTooltipRefs(){return{refInput:this.setInputRef,refTooltip:this.setTooltipRef}}getFormFieldProps({class:e,accessKey:i,shortKey:t,variant:o,counter:s,maxLength:l,readOnly:r,renderNoLabel:a,renderNoTooltip:n,required:d}){const h=this.shared,c=h.getState("id"),p=h.getRenderProp("label"),u=h.getRenderProp("tooltipAlign");return this.isTooltipShown()?(this.tooltipBehavior.watchAlign(u),this.tooltipBehavior.watchBadgeText(j(i,t)||""),this.tooltipBehavior.watchId(L(c,"label")),this.tooltipBehavior.watchLabel(p)):this.tooltipBehavior.destroy(),{id:c,disabled:h.getRenderProp("disabled"),msg:h.getRenderProp("msg"),hint:h.getRenderProp("hint"),label:p,hideLabel:h.getRenderProp("hideLabel"),hideMsg:h.getRenderProp("hideMsg"),touched:h.getRenderProp("touched"),showBadge:Boolean(i)||Boolean(t),required:d,readOnly:r,accessKey:i,shortKey:t,maxLength:l,counter:s,variant:o,class:e,tooltipAlign:u,alert:this.showAsAlert(),infoPopover:this.getInfoPopover(),renderNoLabel:a,renderNoTooltip:n,refInput:n?void 0:this.setInputRef,refTooltip:this.setTooltipRef}}};export{ie as B,Z as F,J as a,Q as b,ee as c,G as f,S as g,M as i}
|
|
4
|
+
import{P as e,u as i,_ as t,h as o}from"./prop.validators.js";import{d as s}from"./disabled.js";import{h as l,e as a,T as r,k as n}from"./component6.js";import{c as d,d as h,n as c,b as p,f as u,B as v,t as m,a as b}from"./base-web-component.js";import{l as f}from"./label-with-expert-slot.js";import{n as g}from"./component9.js";import{S as y,b as j,s as _}from"./component5.js";import{a as B}from"./tslib.es6.js";import{a as L}from"./dev.utils.js";import{K as O,d as T}from"./events.js";import{c as F}from"./item.js";import{F as N}from"./behavior3.js";import{c as w}from"./item2.js";import{T as x}from"./behavior.js";import{t as A}from"./i18n.js";import{b as K}from"./bem-registry.js";import{P}from"./behavior4.js";import{A as k}from"./component.js";const D=(e,i)=>{const t=(null!=i?i:"").trim().split(/\s+/).filter(Boolean);if(!t.length)return[];const o=null==e?void 0:e.getRootNode();return t.map((e=>"undefined"!=typeof Document&&o instanceof Document?o.getElementById(e):"undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot?o.querySelector(`#${(e=>{var i;return(null===(i=globalThis.CSS)||void 0===i?void 0:i.escape)?globalThis.CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,"\\$&")})(e)}`):"undefined"!=typeof document?document.getElementById(e):null)).filter((e=>!!e))};function C(e,i){return Boolean(e)&&!0===i}function H(e){var i;return"string"==typeof e?"error":null!==(i=null==e?void 0:e._type)&&void 0!==i?i:"error"}const I=d("ariaDetails","",h),M=d("hideMsg",!1,c),S=d("hint","",h),$=d("infoPopover",void 0,(function(e){if("object"==typeof e&&null!==e)return e;throw new Error("Invalid info popover: "+typeof e)})),q=p(),E=d("msg",void 0,(function(i){if("string"==typeof i)try{return e(i)}catch(e){return i}return i}),(function(e){return void 0===e||("string"==typeof e?e.length>0:i(e)&&t(e._description,1))})),z=d("touched",!1,c),R={required:[f],optional:[I,s,l,M,S,$,q,E,g,a,z]},V=e=>{var{id:i,class:t,hint:s,baseClassName:l="kol-form-field"}=e,a=B(e,["id","class","hint","baseClassName"]);return s?o("span",Object.assign({class:u(`${l}__hint`,t),id:L(i||"","hint")},a),s):null},Z=e=>{var{component:i="label",id:t,baseClassName:s="kol-form-field",class:l,accessKey:a,shortKey:r,label:n,hideLabel:d,hasExpertSlot:h,omitId:c,showBadge:p=!0,readOnly:v,infoPopover:m}=e,b=B(e,["component","id","baseClassName","class","accessKey","shortKey","label","hideLabel","hasExpertSlot","omitId","showBadge","readOnly","infoPopover"]);const f=!h&&d,g=!1===p?void 0:j(a,r);return o(i,Object.assign({},b,{class:u(`${s}__label`,l),id:f||c?void 0:L(t,"label"),hidden:f,htmlFor:"legend"===i?void 0:t}),o(y,{class:`${s}__label-text`,label:h?"":null!=n?n:"",badgeText:g},o("slot",{name:"expert"})),!h&&v&&o("span",{class:`${s}__label__read-only`,"aria-hidden":"true"},"(",A("kol-readonly"),")"),!h&&m&&o("span",null,o(P,Object.assign({},m.popoverButton),o("div",{class:"kol-popover-button__popover--styled"},m.content))))},G=i=>{var t,s,{alert:l,hideMsg:a,msg:r,id:n,class:d}=i,h=B(i,["alert","hideMsg","msg","id","class"]);const c=function(i){if("string"==typeof i)try{return e(i)}catch(e){return{_description:i,_type:"error"}}return i&&"object"==typeof i&&!("_type"in i)?Object.assign(Object.assign({},i),{_type:"error"}):i}(r);return o(k,Object.assign({alert:!a&&(null!==(t=null==c?void 0:c._alert)&&void 0!==t?t:!0===l),class:u("kol-form-field__msg",a&&"visually-hidden",d),closerAriaDescriptionId:L(n,"msg-closer-description"),handleCloserClick:()=>{},hasCloser:!1,headingId:L(n,"msg-heading"),id:L(n,"msg"),label:"",level:0,refCloserButton:()=>{},refCloserTooltip:()=>{},type:null!==(s=null==c?void 0:c._type)&&void 0!==s?s:"error",variant:"msg"},h),(null==c?void 0:c._description)||void 0)},J=K.forBlock("kol-form-field"),Q=({hideLabel:e,label:i,renderNoTooltip:t})=>!t&&!_(i)&&!0===e,U=e=>{const i=H(e);return{[i]:!0,[`msg-type-${i}`]:!0}},W=(e,i)=>{const{renderNoLabel:t,renderNoTooltip:s,renderNoHint:l,id:a,required:d,alert:h,disabled:c,class:p,msg:m,hideMsg:b,hideLabel:f,label:g,infoPopover:y,hint:O,accessKey:T,shortKey:F,counter:N,readOnly:w,touched:x,maxLength:K,ariaDescribedBy:P,showBadge:k,tooltipAlign:D,variant:H,component:I="div",orientation:M,refInput:S,refTooltip:$}=e,q=B(e,["renderNoLabel","renderNoTooltip","renderNoHint","id","required","alert","disabled","class","msg","hideMsg","hideLabel","label","infoPopover","hint","accessKey","shortKey","counter","readOnly","touched","maxLength","ariaDescribedBy","showBadge","tooltipAlign","variant","component","orientation","refInput","refTooltip"]),E=_(g),z=C(m,x),R=j(T,F),W=Q({hideLabel:f,label:g,renderNoTooltip:s}),X="fieldset"===I;return o(v,Object.assign({component:I,block:"kol-form-field",modifiers:Object.assign({disabled:Boolean(c),required:Boolean(d),touched:Boolean(x),"hide-label":Boolean(f),"read-only":Boolean(w),"hidden-msg":Boolean(b)},z?U(m):{}),class:u(H&&n(H,"form-field"),p),disabled:!(!X||!c)||void 0,"aria-describedby":P},q),!t&&o(Z,{component:X?"legend":"label",class:X?"kol-form-field__label--legend":void 0,id:a,hasExpertSlot:E,hideLabel:f,label:g,accessKey:T,shortKey:F,readOnly:w,showBadge:k,infoPopover:y}),o("div",{class:J("input",{"orientation-horizontal":"horizontal"===M,"orientation-vertical":"vertical"===M}),ref:S},i,W&&o("div",{class:J("tooltip")},o(r,{badgeText:R||"",label:g,align:D,id:L(a,"label"),refFloating:$}))),N&&!("soft"===N.maxLengthBehavior&&"number"!=typeof N.maxLength)&&o("div",{class:J("counter")},o("span",{"aria-hidden":"true",class:J("counter"),ref:N.visualRef}),o("span",{"aria-live":"polite",class:"visually-hidden",id:L(a,"counter"),ref:N.ariaRef})),z&&o(G,{id:a,alert:h,hideMsg:b,msg:m}),!l&&o(V,{id:a,hint:O}),"number"==typeof K&&!N&&o("span",{id:L(a,"character-limit-hint"),class:"visually-hidden"},A("kol-character-limit-hint",{placeholders:{limit:String(K)}})))};function X({ariaDescribedBy:e,hideLabel:i,label:t}){return{title:"",autoCapitalize:"off",autoCorrect:"off","aria-describedby":(null==e?void 0:e.length)?e.join(" "):void 0,"aria-label":i&&t?m(t):void 0}}const Y=class extends b{constructor(){super(...arguments),this.tooltipBehavior=new x(b.stateLess),this.smartButton=F((()=>this.host)),this.infoPopover=w({getFlagHost:()=>this.host,getOpen:()=>!0===this.infoPopoverOpen,setOpen:e=>{this.infoPopoverOpen=e}}),this.focusEventSent=!1,this.handleChange=(e,i)=>{var t,o;e.stopPropagation(),void 0===i&&(i=e.target.value),this.emit(O.change,i),null===(o=null===(t=this._on)||void 0===t?void 0:t.onChange)||void 0===o||o.call(t,e,i)},this.handleInput=(e,i)=>{var t,o;e.stopPropagation(),void 0===i&&(i=e.target.value),this.emit(O.input,i),this.formAssociation.setFormAssociatedValue(i),null===(o=null===(t=this._on)||void 0===t?void 0:t.onInput)||void 0===o||o.call(t,e,i)},this.handleClick=e=>{var i,t;this.emit(O.click),null===(t=null===(i=this._on)||void 0===i?void 0:i.onClick)||void 0===t||t.call(i,e)},this.handleFocus=e=>{var i,t;this.focusEventSent||(this.emit(O.focus),null===(t=null===(i=this._on)||void 0===i?void 0:i.onFocus)||void 0===t||t.call(i,e),this.focusEventSent=!0),this.shared.setState("inputHasFocus",!0)},this.handleBlur=e=>{this.handleFocusLeave(e),this.shared.setState("inputHasFocus",!1)},this.handleKeyDown=e=>{var i,t;this.emit(O.keydown),null===(t=null===(i=this._on)||void 0===i?void 0:i.onKeyDown)||void 0===t||t.call(i,e)},this.setInputRef=e=>{this.tooltipAnchor=e,e&&this.isTooltipShown()&&(this.tooltipBehavior.initContext(e),this.tooltipBehavior.syncListeners(void 0,e,!0))},this.setTooltipRef=e=>{this.tooltipBehavior.setTooltipElementRef(e)}}connectedCallback(){this.syncFormField(),this.tooltipAnchor&&this.isTooltipShown()&&(this.tooltipBehavior.initContext(this.tooltipAnchor),this.tooltipBehavior.syncListeners(void 0,this.tooltipAnchor,!0))}get shared(){return this}initFormAssociation(e,i){this.formAssociation=new N(b.stateLess,{host:this.host,type:e,name:i})}syncFormField(){this.smartButton.syncListeners(),this.infoPopover.syncListeners(),this.syncAriaDetails()}destroyFormField(){this.tooltipBehavior.destroy(),this.smartButton.destroy(),this.infoPopover.destroy()}getInfoPopover(){const e=this.shared.getRenderProp("infoPopover");if(!e)return;const{_content:i}=e,t=B(e,["_content"]);return{popoverButton:this.infoPopover.getFcProps(Object.assign(Object.assign({_variant:"ghost"},t),{_hideLabel:!0,_inline:!0})),content:i}}getSmartButtonFcProps(e,i){if("object"==typeof e&&null!==e)return this.smartButton.getFcProps(Object.assign({_hideLabel:!0,_disabled:i},e),{class:"kol-input-container__smart-button"})}applyAriaDetails(e){I.apply(e,(e=>this.shared.setRenderProp("ariaDetails",e))),this.syncAriaDetails()}syncAriaDetails(){var e,i,t,o;const s=null===(i=null===(e=this.host)||void 0===e?void 0:e.shadowRoot)||void 0===i?void 0:i.querySelector("input, select, textarea");if(!s||!("ariaDetailsElements"in s))return;const l=D(this.host,this.shared.getRenderProp("ariaDetails")),a=this.pushedDetailsElements;(s!==this.ariaDetailsTarget||(null!==(t=null==a?void 0:a.length)&&void 0!==t?t:0)!==l.length||null!==(o=null==a?void 0:a.some(((e,i)=>e!==l[i])))&&void 0!==o&&o)&&(this.ariaDetailsTarget=s,this.pushedDetailsElements=l,s.ariaDetailsElements=l.length?l:null)}applyDisabled(e){s.apply(e,(e=>this.shared.setRenderProp("disabled",e)))}applyHideLabel(e){l.apply(e,(e=>this.shared.setRenderProp("hideLabel",e)))}applyHideMsg(e){M.apply(e,(e=>this.shared.setRenderProp("hideMsg",e)))}applyHint(e){S.apply(e,(e=>this.shared.setRenderProp("hint",e)))}applyInfoPopover(e){$.apply(e,(e=>this.shared.setRenderProp("infoPopover",e)))}applyLabel(e){f.apply(e,(e=>this.shared.setRenderProp("label",e)),this.isRequired("label"))}applyMsg(e){E.apply(e,(e=>this.shared.setRenderProp("msg",e)))}applyName(e){g.apply(e,(e=>this.shared.setRenderProp("name",e))),this.formAssociation.watchName(e)}applyOn(e){q.apply(e,(e=>this.shared.setRenderProp("on",e)))}applySyncValueBySelector(e){this.formAssociation.watchSyncValueBySelector(e)}applyTooltipAlign(e){a.apply(null!=e?e:"top",(e=>this.shared.setRenderProp("tooltipAlign",e)))}applyTouched(e){z.apply(e,(e=>this.shared.setRenderProp("touched",e)))}get eventHost(){var e,i;return null!==(i=null===(e=this.formAssociation)||void 0===e?void 0:e.host)&&void 0!==i?i:this.host}emit(e,i){this.eventHost&&T(this.eventHost,e,i)}handleFocusLeave(e){var i,t;if(this._disabled)return;const o=this.eventHost,s=(null==o?void 0:o.shadowRoot)||o,l=(null==s?void 0:s.contains(e.relatedTarget))||o===e.relatedTarget;this.focusEventSent&&!l&&(this._touched=!0,this.emit(O.blur),null===(t=null===(i=this._on)||void 0===i?void 0:i.onBlur)||void 0===t||t.call(i,e),this.focusEventSent=!1)}getAria(){const e=this.shared;return(({id:e,msg:i,hint:t,touched:o})=>{const s="string"==typeof i?i:null==i?void 0:i._description,l=Boolean(s&&s.length>0),a="error"===H(i)&&l&&!0===o,r="string"==typeof t&&t.length>0,n=[];return l&&!0===o&&n.push(L(e,"msg")),r&&n.push(L(e,"hint")),{hasError:a,hasHint:r,ariaDescribedBy:n}})({id:e.getState("id"),msg:e.getRenderProp("msg"),hint:e.getRenderProp("hint"),touched:e.getRenderProp("touched")})}showAsAlert(){return Boolean(this.shared.getRenderProp("touched"))&&!this.shared.getState("inputHasFocus")}isTooltipShown(){const e=this.shared;return Q({hideLabel:e.getRenderProp("hideLabel"),label:m(e.getRenderProp("label"))})}getLabelTooltipRefs(){return{refInput:this.setInputRef,refTooltip:this.setTooltipRef}}getFormFieldProps({class:e,accessKey:i,shortKey:t,variant:o,counter:s,maxLength:l,readOnly:a,renderNoLabel:r,renderNoTooltip:n,required:d}){const h=this.shared,c=h.getState("id"),p=h.getRenderProp("label"),u=h.getRenderProp("tooltipAlign");return this.isTooltipShown()?(this.tooltipBehavior.watchAlign(u),this.tooltipBehavior.watchBadgeText(j(i,t)||""),this.tooltipBehavior.watchId(L(c,"label")),this.tooltipBehavior.watchLabel(p)):this.tooltipBehavior.destroy(),{id:c,disabled:h.getRenderProp("disabled"),msg:h.getRenderProp("msg"),hint:h.getRenderProp("hint"),label:p,hideLabel:h.getRenderProp("hideLabel"),hideMsg:h.getRenderProp("hideMsg"),touched:h.getRenderProp("touched"),showBadge:Boolean(i)||Boolean(t),required:d,readOnly:a,accessKey:i,shortKey:t,maxLength:l,counter:s,variant:o,class:e,tooltipAlign:u,alert:this.showAsAlert(),infoPopover:this.getInfoPopover(),renderNoLabel:r,renderNoTooltip:n,refInput:n?void 0:this.setInputRef,refTooltip:this.setTooltipRef}}};export{Y as B,W as F,X as a,V as b,Z as c,R as f,H as g,C as i,D as r}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import"./
|
|
4
|
+
import{h as t}from"./prop.validators.js";import{a as s,d as i,v as e}from"./component6.js";import{a,S as o}from"./suggestions2.js";import{h as r,g as h}from"./input-container.js";import{c as l,d as n,a as d,f as p}from"./base-web-component.js";import{p as u}from"./placeholder.js";import{r as c}from"./read-only.js";import{r as m}from"./required.js";import{s as v}from"./smart-button.js";import{s as y}from"./value-string.js";import{f as b,B as j}from"./base-web-component2.js";import{s as g}from"./controller.js";import{v as f}from"./access-and-short-key.js";import{c as O}from"./element-interaction.js";import{C as x}from"./behavior2.js";const B=l("pattern",void 0,n),K={required:[...b.required],optional:[...b.optional,s,a,r,B,u,c,m,i,v,y,e]},q=class extends j{constructor(){super(...arguments),this.ctaRef=O(),this.counter=new x(d.stateLess),this.needsImmediateCounterUpdate=!1,this.hasValue=!1,this.handleTextInput=t=>{this._value=t.target.value,this.handleInput(t)},this.handleTextChange=(t,s)=>{this.handleChange(t,s)},this.handleTextFocus=t=>{var s,i;this.handleFocus(t),this.counter.retriggerAria(null!==(i=null===(s=this._value)||void 0===s?void 0:s.length)&&void 0!==i?i:0)},this.handleTextKeyDown=t=>{var s,i;this.handleKeyDown(t),this.counter.handleKeyDown(t,null!==(i=null===(s=this.ctaRef.el)||void 0===s?void 0:s.value.length)&&void 0!==i?i:0),g(t,{form:this.host,ref:this.ctaRef.el})}}get textShared(){return this}initHasValue(){this.hasValue=Boolean(this.textShared.getRenderProp("value"))}didLoadTextInput(){var t,s;this.needsImmediateCounterUpdate=!1,(this.counter.hasCounter()||this.counter.hasSoftLimit())&&this.counter.updateImmediate(null!==(s=null===(t=this._value)||void 0===t?void 0:t.length)&&void 0!==s?s:0)}didUpdateTextInput(){var t,s;this.needsImmediateCounterUpdate&&(this.needsImmediateCounterUpdate=!1,(this.counter.hasCounter()||this.counter.hasSoftLimit())&&this.counter.updateImmediate(null!==(s=null===(t=this._value)||void 0===t?void 0:t.length)&&void 0!==s?s:0))}destroyTextInput(){this.destroyFormField(),this.counter.destroy()}applyAccessKey(t){s.apply(t,(t=>this.textShared.setRenderProp("accessKey",t))),f(t,this._shortKey)}applyAutoComplete(t){a.apply(t,(t=>this.textShared.setRenderProp("autoComplete",t)))}applyIcons(t){r.apply(t,(t=>this.textShared.setRenderProp("icons",t)))}applyPattern(t){B.apply(t,(t=>this.textShared.setRenderProp("pattern",t)))}applyPlaceholder(t){u.apply(t,(t=>this.textShared.setRenderProp("placeholder",t)))}applyReadOnly(t){c.apply(t,(t=>this.textShared.setRenderProp("readOnly",t)))}applyRequired(t){m.apply(t,(t=>this.textShared.setRenderProp("required",t)))}applyShortKey(t){i.apply(t,(t=>this.textShared.setRenderProp("shortKey",t))),f(this._accessKey,t)}applySmartButton(t){null==t?this.textShared.unsetRenderProp("smartButton"):v.apply(t,(t=>this.textShared.setRenderProp("smartButton",t)))}applyValue(t){var s;this.initValue(t),this.hasValue=Boolean(this.textShared.getRenderProp("value")),this.counter.update(null!==(s=null==t?void 0:t.length)&&void 0!==s?s:0)}initValue(t){y.apply(t,(t=>this.textShared.setRenderProp("value",t))),this.formAssociation.setFormAssociatedValue(this.textShared.getRenderProp("value"))}initMaxLength(t){this.counter.watchMaxLength(t)}applyVariant(t){e.apply(t,(t=>this.textShared.setRenderProp("variant",t)))}applyHasCounter(t){this.counter.watchHasCounter(t),this.needsImmediateCounterUpdate=!0}applyMaxLength(t){var s,i;this.counter.watchMaxLength(t),this.counter.updateImmediate(null!==(i=null===(s=this._value)||void 0===s?void 0:s.length)&&void 0!==i?i:0)}applyMaxLengthBehavior(t){this.counter.watchMaxLengthBehavior(t),this.needsImmediateCounterUpdate=!0}getTextFormFieldProps(t){const s=this.textShared;return this.getFormFieldProps({class:p(t,{"has-value":this.hasValue,"kol-form-field--has-counter":this.counter.hasSoftLimit()||this.counter.hasCounter()}),accessKey:s.getRenderProp("accessKey")||void 0,shortKey:s.getRenderProp("shortKey")||void 0,variant:s.getRenderProp("variant"),required:s.getRenderProp("required"),readOnly:s.getRenderProp("readOnly"),maxLength:this.counter.getRenderProp("maxLength"),counter:this.counter.getCounterProps()})}getTextInputAdornments(t){return h({icons:this.textShared.getRenderProp("icons"),smartButton:this.getSmartButtonFcProps(this.textShared.getRenderProp("smartButton"),this.textShared.getRenderProp("disabled")),endAdornment:t})}getTextInputProps({type:s,spellcheck:i,multiple:e,suggestions:a},r={}){const h=this.textShared,l=h.getState("id"),n=h.getRenderProp("accessKey"),d=h.getRenderProp("shortKey"),p=h.getRenderProp("placeholder"),u=h.getRenderProp("pattern"),c=this.counter.getMaxLengthAttribute(),m=this.counter.getCharacterLimitHintId(l),{ariaDescribedBy:v,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:l,hideLabel:h.getRenderProp("hideLabel"),label:h.getRenderProp("label"),disabled:h.getRenderProp("disabled"),name:h.getRenderProp("name")||void 0},n?{accessKey:n}:{}),void 0!==s?{type:s}:{}),{value:h.getRenderProp("value"),required:h.getRenderProp("required")}),void 0!==c?{maxlength:c}:{}),void 0!==p?{placeholder:p}:{}),{autoComplete:h.getRenderProp("autoComplete")}),void 0!==i?{spellcheck:i}:{}),void 0!==u?{pattern:u}:{}),{readonly:h.getRenderProp("readOnly")}),void 0!==e?{multiple:e}:{}),{touched:h.getRenderProp("touched"),msg:h.getRenderProp("msg")}),d?{"aria-keyshortcuts":d}:{}),a&&a.length>0?{suggestions:t(o,{id:l,suggestions:a})}:{}),{ref:this.ctaRef,onBlur:this.handleBlur,onChange:this.handleTextChange,onClick:this.handleClick,onFocus:this.handleTextFocus,onInput:this.handleTextInput,onKeyDown:this.handleTextKeyDown}),r),{ariaDescribedBy:m?[...v,m]:v,"aria-invalid":y?"true":void 0})}};export{q as B,K as t}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{
|
|
4
|
+
import{C as e,P as s,h as t,F as i}from"./prop.validators.js";import{a as o,d as r,t as a,v as l}from"./component6.js";import{h as n,g as d,I as h}from"./input-container.js";import{s as c,u as p,c as u,g as b,f as v}from"./base-web-component.js";import{m}from"./multiple.js";import{r as y}from"./required.js";import{r as f}from"./rows.js";import{f as O,i as j,g,a as A,B,F as w}from"./base-web-component2.js";import{v as K}from"./access-and-short-key.js";import{f as q}from"./options.js";import{a as P}from"./tslib.es6.js";const k=s=>{if("object"==typeof s&&null!==s){if("string"==typeof s.label&&s.label.length>0)return s.disabled=!0===s.disabled,s.label=`${s.label}`.trim(),!1===c(s.label,3)&&!1===p(s.label)&&e(`A differing Aria-Label (${s.label}) is inaccessible. A differing Aria-Label should consist of at least three readable characters.`),!Array.isArray(s.options)||void 0===s.options.find((e=>!1===k(e)));if("number"==typeof s.label)return!0}return!1},x=u("options",[],(function(e){const t="string"==typeof e?s(e):e;if(Array.isArray(t)&&t.every((e=>k(e))))return t;throw new Error("Invalid select options")})),L=u("value",[],(e=>Array.isArray(e)?e:[e])),$={required:[...O.required],optional:[...O.optional,o,n,m,x,y,f,L,r,a,l]},D=b("kol-select"),E=e=>{var{class:s,index:i,selectedValue:o,selected:r,value:a,label:l,disabled:n}=e,d=P(e,["class","index","selectedValue","selected","value","label","disabled"]);const h=void 0===o?[]:Array.isArray(o)?o:[o],c=r||h.includes(a);return t("option",Object.assign({class:v(D("option",{selected:Boolean(c),disabled:Boolean(n)}),s),selected:c,disabled:n,value:i},d),l)},I=({preKey:e,options:s,disabled:o,value:r,OptionProps:a={},OptionGroupProps:l={}})=>(null==s?void 0:s.length)?t(i,null,s.map(((s,i)=>{const n=[e,`-${i}`].join("");if("options"in s){const e=Boolean(o||s.disabled),{label:i}=s,d=P(s,["label"]);return t("optgroup",Object.assign({class:D("optgroup",{disabled:e}),key:n},l,{label:null==i?void 0:i.toString(),disabled:e}),t(I,Object.assign({OptionGroupProps:l,OptionProps:a,value:r,preKey:n},d,{disabled:e})))}return"value"in s?t(E,Object.assign({key:n},a,{index:n,selectedValue:r},s,{disabled:Boolean(o||s.disabled)})):null}))):null,V=e=>{const{class:s,msg:i,touched:o,disabled:r,required:a,options:l,value:n,OptionProps:d,OptionGroupProps:h,ariaDescribedBy:c,hideLabel:p,label:u}=e,b=P(e,["class","msg","touched","disabled","required","options","value","OptionProps","OptionGroupProps","ariaDescribedBy","hideLabel","label"]),m=Object.assign(Object.assign({class:v(D(Object.assign({disabled:Boolean(r),required:Boolean(a),touched:Boolean(o)},j(i,o)?{[g(i)]:!0}:{})),s),required:a,disabled:r},A({ariaDescribedBy:c,hideLabel:p,label:u})),b);return t("select",Object.assign({},m),t(I,{OptionGroupProps:h,OptionProps:d,disabled:r,options:l,value:n}))},G=(e,s,t)=>{const i=Array.isArray(e);if(s){if(void 0!==e&&!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)})`)},S=(e,s=!1)=>e.flatMap((e=>"options"in e&&Array.isArray(e.options)?S(e.options,Boolean(s||e.disabled)):[Object.assign(Object.assign({},e),{disabled:Boolean(s||e.disabled)})])),T=(e,s,t)=>{if(0===s.length)return e;const i=S(s),o=i.map((e=>e.value)),r=e.every((e=>o.includes(e)))?e:e.filter((e=>o.includes(e)));if(!1===t&&0===r.length){const e=i.find((e=>!0!==e.disabled));return e?[e.value]:r}return r},C=class extends B{constructor(){super(...arguments),this.keyOptionMap=new Map,this.hasValue=!0,this.handleSelectInput=e=>{var s;const t=Array.from((null===(s=this.ctaRef.el)||void 0===s?void 0:s.options)||[]).filter((e=>e.selected)).map((e=>{var s;return null===(s=this.keyOptionMap.get(e.value))||void 0===s?void 0:s.value}));if(this._multiple)this._value=t,this.handleInput(e,t);else{const s=t.length>0?t[0]:void 0;this._value=s,this.handleInput(e,s)}},this.handleSelectChange=e=>{const s=this._value;this.handleChange(e,s),this.hasValue=!!s}}applyAccessKey(e){o.apply(e,(e=>this.setRenderProp("accessKey",e))),K(e,this.getShortKeyProp())}applyShortKey(e){r.apply(e,(e=>this.setRenderProp("shortKey",e))),K(this.getAccessKeyProp(),e)}applyIcons(e){n.apply(e,(e=>this.setRenderProp("icons",e)))}applyMultiple(e){G(this._value,!0===e,"current"),m.apply(e,(e=>{this.setRenderProp("multiple",e),this.setRenderProp("value",T(this.getRenderProp("value"),this.getRenderProp("options"),this._multiple))}))}applyOptions(e){x.apply(e,(e=>{this.setRenderProp("options",e),e.length>0&&(this.keyOptionMap.clear(),q(this.keyOptionMap,e),this.setRenderProp("value",T(this.getRenderProp("value"),e,this._multiple)))}))}applyRequired(e){y.apply(e,(e=>this.setRenderProp("required",e)))}applyRows(e){f.apply(e,(e=>this.setRenderProp("rows",e)))}applyTabIndex(e){a.apply(e,(e=>this.setRenderProp("tabIndex",e)))}applyValue(e){G(e,!0===this._multiple,"received");const s=e=>{const s=T(e,this.getRenderProp("options"),this._multiple);this.setRenderProp("value",s),this.formAssociation.setFormAssociatedValue(this.getModelValue())};null===e?s([null]):L.apply(e,s)}applyVariant(e){l.apply(e,(e=>this.setRenderProp("variant",e)))}getModelValue(){const e=this.getRenderProp("value");return this._multiple?e:Array.isArray(e)&&e.length>0?e[0]:e}getSelectProps(){const{ariaDescribedBy:e,hasError:s}=this.getAria(),t=this.getRenderProp("multiple"),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")||void 0,disabled:this.getRenderProp("disabled"),name:this.getRenderProp("name")||void 0,"aria-invalid":s?"true":void 0,ariaDescribedBy:e,size:t?this.getRenderProp("rows"):void 0,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"),{startAdornment:s,endAdornment:i}=d({icons:this.getRenderProp("icons")});return t(w,Object.assign({},this.getFormFieldProps({class:v("kol-form-field-select",{"kol-form-field--has-value":this.hasValue}),accessKey:this.getRenderProp("accessKey")||void 0,shortKey:this.getRenderProp("shortKey")||void 0,required:this.getRenderProp("required"),variant:this.getRenderProp("variant")}),{onClick:()=>{var e;return null===(e=this.ctaRef.el)||void 0===e?void 0:e.focus()}}),t(h,{disabled:e,msg:this.getRenderProp("msg"),touched:this.getRenderProp("touched"),startAdornment:s,endAdornment:i},t(V,Object.assign({},this.getSelectProps()))))}};export{C as B,$ as s}
|
package/dist/components/base.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{
|
|
4
|
+
import{i as s,X as i,h as t}from"./prop.validators.js";import{a}from"./base-web-component.js";import{b as e,e as o,a as h,n as l,c as r,d as n,B as p}from"./component9.js";import{F as d}from"./behavior3.js";import{T as c}from"./behavior.js";import{a as m,b as y,c as b,g as u,j as f,h as v,s as j,i as x,l as A,d as C,t as I,e as B,v as D}from"./component6.js";import{d as K}from"./disabled.js";import{i as T}from"./id.js";import{l as g}from"./label-with-expert-slot.js";import{v as S}from"./access-and-short-key.js";import{c as L}from"./element-interaction.js";import{d as w,K as F}from"./events.js";import{p as H,a as P}from"./controller.js";const E=class extends a{constructor(){super(...arguments),this.ctaRef=L(),this.propsConfig=e,this.tooltipBehavior=new c(this.stateAccess),this.handleClick=i=>{i.stopPropagation(),this.tooltipBehavior.hideTooltip();const t=this.getRenderProp("type");if("submit"===t)H({form:this.host});else if("reset"===t)P({form:this.host});else{this.formAssociation.setFormAssociatedValue(this.formValue);const t=this.getRenderProp("on").onClick;"function"==typeof t&&(s(i,this.ctaRef.el),t(i,this.formValue))}this.host&&w(this.host,F.click,this.formValue)},this.handleMouseDown=s=>{var i,t;null===(t=(i=this.getRenderProp("on")).onMouseDown)||void 0===t||t.call(i,s),this.host&&w(this.host,F.mousedown)},this.handleFocus=s=>{var i,t;null===(t=(i=this.getRenderProp("on")).onFocus)||void 0===t||t.call(i,s),this.host&&w(this.host,F.focus)},this.handleBlur=s=>{var i,t;null===(t=(i=this.getRenderProp("on")).onBlur)||void 0===t||t.call(i,s),this.host&&w(this.host,F.blur)}}initFormAssociation(){this.formAssociation=new d(a.stateLess,{host:this.host,type:"button"})}unsetButtonTabIndex(){this.unsetRenderProp("tabIndex")}initTooltipBehavior(){this.tooltipBehavior.componentWillLoad({label:this.getRenderProp("label"),align:this.getRenderProp("tooltipAlign")})}syncTooltipListeners(){this.ctaRef.el&&this.tooltipBehavior.syncListeners(void 0,this.ctaRef.el,!0)}destroyTooltipBehavior(){this.tooltipBehavior.destroy()}applyAccessKey(s,i){m.apply(s,(s=>this.setRenderProp("accessKey",s))),S(s,i)}applyAriaControls(s){y.apply(s,(s=>this.setRenderProp("ariaControls",s)))}applyAriaDescription(s){b.apply(s,(s=>this.setRenderProp("ariaDescription",s)))}applyAriaExpanded(s){u.apply(s,(s=>this.setRenderProp("ariaExpanded",s)))}applyAriaHasPopup(s){o.apply(s,(s=>this.setRenderProp("ariaHasPopup",s)))}applyAriaSelected(s){h.apply(s,(s=>this.setRenderProp("ariaSelected",s)))}applyCustomClass(s){f.apply(s,(s=>this.setRenderProp("customClass",s)))}applyDisabled(s){K.apply(s,(s=>this.setRenderProp("disabled",s)))}applyHideLabel(s){v.apply(s,(s=>this.setRenderProp("hideLabel",s)))}applyIcons(s){j.apply(s,(s=>this.setRenderProp("icons",s)))}applyId(s){T.apply(s,(s=>this.setRenderProp("id",s)))}applyInline(s){x.apply(s,(s=>this.setRenderProp("inline",s)))}applyLabel(s){g.apply(s,(s=>{this.setRenderProp("label",s),this.tooltipBehavior.watchLabel(s)}),this.isRequired("label"))}applyName(s){l.apply(s,(s=>this.setRenderProp("name",s))),this.formAssociation.watchName(s)}applyOn(s){r.apply(s,(s=>this.setRenderProp("on",s)))}applyRole(s){A.apply(s,(s=>this.setRenderProp("role",s)))}applyShortKey(s,i){C.apply(s,(s=>this.setRenderProp("shortKey",s))),S(i,s)}applySyncValueBySelector(s){this.formAssociation.watchSyncValueBySelector(s)}applyTabIndex(s){"number"==typeof s?I.apply(s,(s=>this.setRenderProp("tabIndex",s))):this.unsetRenderProp("tabIndex")}applyTooltipAlign(s){B.apply(null!=s?s:"top",(s=>{this.setRenderProp("tooltipAlign",s),this.tooltipBehavior.watchAlign(s)}))}applyType(s){n.apply(s,(s=>this.setRenderProp("type",s)))}applyValue(s){this.formValue=s,this.formAssociation.setFormAssociatedValue(s)}applyVariant(s){var t;D.apply(null!==(t=null!=s?s:i("buttonVariantDefault",this.host))&&void 0!==t?t:"normal",(s=>this.setRenderProp("variant",s)))}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 t(p,Object.assign({},this.getButtonFCProps()))}};export{E as B}
|
package/dist/components/base2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h as i}from"
|
|
4
|
+
import{h as i}from"./prop.validators.js";import{E as s,a as t,t as l}from"./base-web-component.js";import{r as o,C as a}from"./component8.js";import{l as h}from"./level.js";import{d as e,w as r}from"./width.js";import{l as n}from"./label-lang-segment.js";import{u as d,l as p,D as m}from"./scroll-lock.js";import{T as v}from"./behavior.js";import{c}from"./element-interaction.js";import{d as u,K as b}from"./events.js";import{h as f}from"./tooltip-open-tracking.js";const g={required:[n],optional:[e,h,s,r]},j=class extends t{constructor(){super(...arguments),this.dialogRef=c(),this.cardCloseButtonRef=c(),this.cardCloseTooltipBehavior=new v(this.stateAccess),this.propsConfig=g,this.handleCancel=i=>{var s,t;f(i),i.defaultPrevented||(null===(t=(s=this.getRenderProp("on")).onCancel)||void 0===t||t.call(s,i),i.defaultPrevented||this.host&&!u(this.host,b.cancel)&&i.preventDefault())},this.handleClose=i=>{var s,t,l,o;i.target===this.dialogRef.el&&(d(this),null===(t=(s=this.getRenderProp("on")).onClose)||void 0===t||t.call(s),null===(o=(l=this.getRenderProp("on")).onToggle)||void 0===o||o.call(l,!1),this.host&&(u(this.host,b.close),u(this.host,b.toggle)))},this.handleCardClose=()=>{this.cardCloseTooltipBehavior.hideTooltip(),this.closeDialog(),this.host&&u(this.host,b.close)}}initCardCloseButton(){this.cardCloseButtonProps=o(this.host),this.cardCloseTooltipBehavior.componentWillLoad({label:this.cardCloseButtonProps.label,align:this.cardCloseButtonProps.tooltipAlign})}syncCardCloseTooltipListeners(){this.cardCloseButtonRef.el&&this.cardCloseTooltipBehavior.syncListeners(void 0,this.cardCloseButtonRef.el,!0)}teardownDialog(){this.closeDialog(),d(this),this.cardCloseTooltipBehavior.destroy()}applyLabel(i){n.apply(i,(i=>this.setRenderProp("label",i)),this.isRequired("label"))}applyLevel(i){h.apply(i,(i=>this.setRenderProp("level",i)))}applyOn(i){e.apply(i,(i=>this.setRenderProp("on",i)))}applyVariant(i){s.apply(i,(i=>this.setRenderProp("variant",i)))}applyWidth(i){r.apply(i,(i=>this.setRenderProp("width",i)))}showDialog(i){var s,t,l,o;const a=this.dialogRef.el;(null==a?void 0:a.open)||(this.setState("modal",i),i?(null===(s=null==a?void 0:a.showModal)||void 0===s||s.call(a),a&&p(this)):null===(t=null==a?void 0:a.show)||void 0===t||t.call(a),null===(o=(l=this.getRenderProp("on")).onToggle)||void 0===o||o.call(l,!0),this.host&&u(this.host,b.toggle))}closeDialog(){var i,s;null===(s=null===(i=this.dialogRef.el)||void 0===i?void 0:i.close)||void 0===s||s.call(i)}buildCardProps(){return{ariaDescriptionId:this.getState("ariaDescriptionId"),closeButtonProps:this.cardCloseButtonProps,handleClose:this.handleCardClose,hasCloser:!0,headingId:this.getState("headingId"),label:this.getRenderProp("label"),level:this.getRenderProp("level"),refCloseButton:this.cardCloseButtonRef,refTooltip:this.cardCloseTooltipBehavior.setTooltipElementRef}}renderDialogFC(){const s=this.getRenderProp("variant"),t="card"===s;return i(m,{handleCancel:this.handleCancel,handleClose:this.handleClose,label:l(this.getRenderProp("label")),labelledBy:t?this.getState("headingId"):void 0,modal:this.getState("modal"),refDialog:this.dialogRef,variant:s,width:this.getRenderProp("width")},t?i(a,Object.assign({},this.buildCardProps()),this.renderSlot()):this.renderSlot())}};export{j as B}
|
package/dist/components/base3.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h as
|
|
4
|
+
import{i,h as s}from"./prop.validators.js";import{a as t}from"./base-web-component.js";import{l as a,a as e,c as r,d as o,b as h,L as n}from"./component4.js";import{o as l}from"./aria-current-service.js";import{T as p}from"./behavior.js";import{a as d,b as c,c as y,g as b,j as m,h as u,s as f,i as C,l as x,d as g,t as v,e as A,v as j}from"./component6.js";import{d as L}from"./disabled.js";import{h as w,l as I}from"./link-target.js";import{l as K}from"./label-with-expert-slot.js";import{c as D}from"./element-interaction.js";import{d as T,K as k}from"./events.js";const V=class extends t{constructor(){super(...arguments),this.ctaRef=D((()=>!0===this.getRenderProp("disabled"))),this.tooltipBehavior=new p(this.stateAccess),this.propsConfig=a,this.handleAnchorClick=s=>{if(this.tooltipBehavior.hideTooltip(),!0===this.getRenderProp("disabled"))return void s.preventDefault();const t=this.getRenderProp("href"),a=this.getRenderProp("on");"function"==typeof(null==a?void 0:a.onClick)&&(i(s,this.ctaRef.el),a.onClick(s,t)),this.host&&T(this.host,k.click,t)},this.setAnchorRef=i=>{this.ctaRef(i)}}unsetLinkTabIndex(){this.unsetRenderProp("tabIndex")}initLinkBehaviors(){this.unsubscribeOnLocationChange=l((i=>{const s=this.getRenderProp("href"),t=this.getRenderProp("ariaCurrentValue"),a=i===s?t:"";this.getState("ariaCurrent")!==a&&this.setState("ariaCurrent",a)})),this.tooltipBehavior.componentWillLoad({label:this.getTooltipLabel(),align:this.getRenderProp("tooltipAlign")})}syncTooltipListeners(){this.ctaRef.el&&this.tooltipBehavior.syncListeners(void 0,this.ctaRef.el,!0)}destroyLinkBehaviors(){this.unsubscribeOnLocationChange&&(this.unsubscribeOnLocationChange(),this.unsubscribeOnLocationChange=void 0),this.tooltipBehavior.destroy()}getTooltipLabel(){const i=this.getRenderProp("label");if("string"==typeof i&&i.length>0)return i;const s=this.getRenderProp("href");return"string"==typeof s?s:""}applyAccessKey(i){d.apply(i,(i=>this.setRenderProp("accessKey",i)))}applyAriaControls(i){c.apply(i,(i=>this.setRenderProp("ariaControls",i)))}applyAriaCurrentValue(i){e.apply(i,(i=>this.setRenderProp("ariaCurrentValue",i)))}applyAriaDescription(i){y.apply(i,(i=>this.setRenderProp("ariaDescription",i)))}applyAriaExpanded(i){b.apply(i,(i=>this.setRenderProp("ariaExpanded",i)))}applyAriaOwns(i){r.apply(i,(i=>this.setRenderProp("ariaOwns",i)))}applyCustomClass(i){m.apply(i,(i=>this.setRenderProp("customClass",i)))}applyDisabled(i){L.apply(i,(i=>this.setRenderProp("disabled",i)))}applyDownload(i){o.apply(i,(i=>this.setRenderProp("download",i)))}applyHideLabel(i){u.apply(i,(i=>this.setRenderProp("hideLabel",i)))}applyHref(i){w.apply(i,(i=>this.setRenderProp("href",i)),this.isRequired("href"))}applyIcons(i){f.apply(i,(i=>this.setRenderProp("icons",i)))}applyInline(i){C.apply(i,(i=>this.setRenderProp("inline",i)))}applyLabel(i){K.apply(i,(s=>{this.setRenderProp("label",s),this.setState("expertSlot",""===i),this.tooltipBehavior.watchLabel(this.getTooltipLabel())}),this.isRequired("label"))}applyOn(i){h.apply(i,(i=>this.setRenderProp("on",i)))}applyRole(i){x.apply(i,(i=>this.setRenderProp("role",i)))}applyShortKey(i){g.apply(i,(i=>this.setRenderProp("shortKey",i)))}applyTabIndex(i){"number"==typeof i?v.apply(i,(i=>this.setRenderProp("tabIndex",i))):this.unsetRenderProp("tabIndex")}applyTarget(i){I.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 s(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{V as B}
|
package/dist/components/base4.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{r as t}from"./aria-labelledby.js";import{I as e,L as o,p as l,b as i}from"./bem-registry.js";import{h as s,Fragment as n,forceUpdate as a}from"@stencil/core/internal/client";import{B as r}from"./base-web-component.js";import{c}from"./item.js";import{c as d}from"./item-pool.js";import{c as h}from"./item3.js";import{c as b,e as u,n as p,a as v,r as f,t as m,A as y}from"./props-from-config.js";import{l as g}from"./label-lang-segment.js";import{v as k,k as j,T as C}from"./component3.js";import{c as S,d as w,e as _}from"./component-names.js";import{t as x}from"./i18n.js";import{B as O}from"./component.js";import{B as $}from"./component10.js";import{I as F}from"./component5.js";import{L}from"./component6.js";import{r as I}from"./component7.js";import{S as D}from"./component11.js";import{a as T}from"./tslib.es6.js";import{n as z,c as A}from"./dev.utils.js";import{d as E,K as M}from"./events.js";import{A as B}from"./component2.js";import{l as H}from"./level.js";import{c as K}from"./element-interaction.js";import{u as N,l as P,d as W,D as R}from"./scroll-lock.js";import{h as q}from"./tooltip-open-tracking.js";import{d as U,w as V}from"./width.js";import{r as G,C as J}from"./component8.js";import{T as Q}from"./behavior.js";import{C as X}from"./keyboard.js";const Y=(l,i,s,n)=>{const a=t=>"string"==typeof t||void 0===t;if(e(l,"_ariaLabelledby",a,new Set(["string"]),n),!a(n))return[];const r=t(i,n);if(s){try{s.ariaLabelledByElements=r}catch(t){}o.debug(["WebComponent internals",s])}return r},Z=t=>"number"==typeof t&&Number.isInteger(t)&&t>=0,tt=b("fixedCols",[0,0],(t=>u(t)),(t=>2===t.length&&t.every(Z))),et=b("hasSettingsMenu",!1,p),ot=v();function lt(t){const e="string"==typeof t?l(t):t;if(Array.isArray(e))return e;throw new Error("Invalid table data: expected an array of row objects.")}function it(t){return t.every((t=>"object"==typeof t&&null!==t))}const st=b("data",[],lt,it),nt=b("dataFoot",[],lt,it),at=t=>Array.isArray(t)&&t.every((t=>Array.isArray(t))),rt=b("headers",{horizontal:[],vertical:[]},(function(t){const e="string"==typeof t?l(t):t;if("object"!=typeof e||null===e)throw new Error("Invalid table headers: expected an object.");const{horizontal:o=[],vertical:i=[]}=e;if(!at(o)||!at(i))throw new Error("Invalid table headers: horizontal and vertical must be arrays of header rows.");return{horizontal:o,vertical:i}}),(function({horizontal:t,vertical:e}){return[...t,...e].every((t=>t.every((t=>void 0===t.width||"number"==typeof t.width))))})),ct=b("loading",!1,p),dt=b("selection",!1,(function(t){const e="string"==typeof t?l(t):t;if("object"==typeof e&&null!==e)return e;throw new Error("Invalid table selection: expected an object.")}),(function(t){return!1===t||"function"==typeof t.label&&(!t.selectedKeys||Array.isArray(t.selectedKeys))})),ht={required:[g,st],optional:[tt,et,ot,nt,rt,ct,dt,k]},bt=t=>t.flatMap((t=>t.filter((t=>"string"==typeof t.key||"function"==typeof t.render)))),ut=t=>{const e=bt(t.horizontal);if(e.length>0)return{cells:e,horizontal:!0};const o=bt(t.vertical);return{cells:o,horizontal:0===o.length}},pt=(t,e)=>{let o=0;return Array.isArray(t)&&t.forEach((t=>{var l;o+=null!==(l=t[e])&&void 0!==l?l:1})),o},vt=(t,e)=>{const o=Math.max(0,...t.map((t=>pt(t,"colSpan"))));return 0===o?e.length:o},ft=t=>{var e;return null!==(e=null==t?void 0:t.reduce(((t,e)=>"visible"in e&&!1===e.visible?t:t+(e.colSpan||1)),0))&&void 0!==e?e:0},mt=(t,e,o,l)=>{if(void 0!==l&&!e)return l<t[0]?"left":t[1]>0&&l>=o-t[1]?"right":void 0},yt=(t,e,o,l)=>{var i,s,n,a,r,c;const d=[];for(let a=0;a<e;a++)"left"===mt(o,l,e,a)&&(d[a]=(null!==(i=d[a-1])&&void 0!==i?i:0)+(null!==(n=null===(s=t[a-1])||void 0===s?void 0:s.width)&&void 0!==n?n:0));for(let i=e-1;i>=0;i--)"right"===mt(o,l,e,i)&&(d[i]=(null!==(a=d[i+1])&&void 0!==a?a:0)+(null!==(c=null===(r=t[i+1])||void 0===r?void 0:r.width)&&void 0!==c?c:0));return d},gt=(t,e,o,l)=>{const i=void 0===e?void 0:t[e];return o&&l?`calc( var(--kol-table-selection-col-width) + ${i}px)`:`${i}px`},kt=(t,e,o,l)=>{if(0===(e.horizontal?t.horizontal:t.vertical).length)return;const i=e.cells[o];return(null==i?void 0:i.type)===l?i:void 0},jt=({data:t,dataFoot:e,headers:o,isFoot:l,noEntriesLabel:i,primaryHeaders:s})=>{const n=vt(o.horizontal,t),a=s.cells;let r=((t,e,o)=>{const l=Math.max(0,...t.map((t=>pt(t,"rowSpan"))));return 0===l?e.length:l-o})(o.vertical,t,e.length),c=0;l&&(c=r,r+=e.length);const d=[],h=[],b=[];o.vertical.forEach(((t,e)=>{h[e]=0,b[e]=[]}));for(let i=c;i<r;i++){const r=[];o.vertical.forEach(((t,e)=>{let o=0;if(b[e].forEach((t=>o+=t)),o<=i){const l=t[i-o+h[e]];if("object"==typeof l){r.push(Object.assign(Object.assign({},l),{headerCell:!0,data:{}}));let t=1;if("number"==typeof l.rowSpan&&l.rowSpan>1&&(t=l.rowSpan),b[e].push(t),"number"==typeof l.colSpan&&l.colSpan>1)for(let o=1;o<l.colSpan;o++)b[e+o].push(t);h[e]++}}}));for(let o=0;o<n;o++)if(s.horizontal){const s=l?e[i-c]:t[i],n=a[o];"object"==typeof n&&null!==n&&"object"==typeof s&&null!==s&&r.push(Object.assign(Object.assign({},n),{colIndex:o,colSpan:void 0,rowSpan:void 0,data:s,label:s[n.key]}))}else{const e=a[i];"object"==typeof e&&null!==e&&"object"==typeof t[o]&&null!==t[o]&&r.push(Object.assign(Object.assign({},e),{colIndex:o,colSpan:void 0,rowSpan:void 0,data:t[o],label:t[o][e.key]}))}d.push(r)}if(0===t.length){let t=ft(o.horizontal[0]),e=0;o.vertical.length>0&&(t-=o.vertical.length,o.vertical[0].forEach((t=>{e+=t.rowSpan||1})));const l={colSpan:t,label:i,render:void 0,rowSpan:Math.max(e,1)};0===d.length?d.push([l]):d[0].push(l)}return d},Ct=({horizontal:t,vertical:e})=>{const o=t.flatMap((t=>t.filter((t=>!1!==t.visible&&void 0!==t.width&&t.width>0)).map((t=>t.width)))),l=[...e.flatMap((t=>t.filter((t=>void 0!==t.width&&t.width>0)).map((t=>t.width)))),...o];return 0===l.length?"0px":1===l.length?`${l[0]}px`:`calc(${l.map((t=>`${t}px`)).join(" + ")})`},St=t=>void 0===t?[]:Array.isArray(t)?t:[t],wt=t=>{var e;return null!==(e=t?t.keyPropertyName:void 0)&&void 0!==e?e:"id"},_t=t=>{const e=t?St(t.selectedKeys):[];return{disabledKeys:new Set((t?St(t.disabledKeys):[]).map(String)),keyPropertyName:wt(t),selectedKeys:e,selectedKeysSet:new Set(e.map(String))}},xt=(t,e)=>t.filter((t=>!e.disabledKeys.has(String(t[e.keyPropertyName])))),Ot=i.forBlock("kol-table"),$t=Ot("body"),Ft=Ot("cell-actions"),Lt=Ot("cell-states"),It=Ot("footer"),Dt=Ot("head"),Tt=Ot("head-row"),zt=Ot("scroll-container"),At=Ot("selection-icon"),Et=Ot("selection-input-tooltip"),Mt=Ot("sort"),Bt=Ot("sort-button"),Ht=Ot("sort-order"),Kt=Ot("table"),Nt=`${Ot("focus-element")} ${Ot("caption")}`,Pt="caption",Wt=(t,e)=>mt(t.fixedCols,t.stickyColsDisabled,t.maxCols,e),Rt=(t,e,o)=>({left:"left"===e?gt(t.fixedOffsets,o,!0,!1!==t.selection):void 0,right:"right"===e?gt(t.fixedOffsets,o,!1,!1!==t.selection):void 0}),qt=(t,e,o)=>{var l,i;return null!==(i=t.primaryHeaders.horizontal&&(null===(l=e[0])||void 0===l?void 0:l.data)?t.rowKeys.get(e[0].data):void 0)&&void 0!==i?i:String(o)},Ut=t=>{const e=x("kol-sort");return"number"==typeof t&&t>0?`${e} – ${x("kol-table-sort-order").replace("{{order}}",`${t}`)}`:e},Vt=(t,e,o,l,i)=>{if(!1===e.visible)return"";const n=!1!==(null==e?void 0:e.sortable)&&"string"==typeof e.sortDirection;let a="none",r="kolicon-sort-neutral";if(n&&e.sortDirection)switch(e.sortDirection){case"ASC":r="kolicon-sort-asc",a="ascending";break;case"DESC":r="kolicon-sort-desc",a="descending";break;default:a="none"}const c=i?"row":"number"==typeof e.colSpan&&e.colSpan>1?"colgroup":"col",d="number"==typeof e.sortOrder&&e.sortOrder>0?e.sortOrder:void 0,h=void 0!==e.width?`${e.width}px`:void 0,b=Wt(t,l),{left:u,right:p}=Rt(t,b,l),v=e.textAlign,f=n?e.sortDirection:void 0;return s("th",{key:`${o}-${l}-${e.label}`,class:Ot("cell",{[a]:!0,"align-center":"center"===v,"align-justify":"justify"===v,"align-left":"left"===v,"align-right":"right"===v,header:!0,"sticky-left":"left"===b,"sticky-right":"right"===b}),scope:c,colSpan:e.colSpan,rowSpan:e.rowSpan,style:{width:h,left:u,right:p},"aria-sort":a,"data-sort":f?`sort-${f}`:void 0},f?s("span",{class:Mt},s($,Object.assign({},t.getButtonFcProps(`sort-${i?"vertical":"horizontal"}-${o}-${l}`,{_icons:{right:r},_label:e.label,_ariaDescription:Ut(d),_on:{onClick:o=>{t.handleSort(o,{key:e.key,currentSortDirection:f})}}},{class:Bt}))),d&&s("span",{"aria-hidden":"true",class:Ht},d)):e.label)},Gt=(t,e,o,l,i=!1)=>s("tr",{class:Ot("row",{body:!i,footer:i}),key:`row-${qt(t,e,o)}`},((t,e,o)=>{var l;const{handleSelectionChange:i,selection:n,selectionModel:a}=t;if(!n)return"";const r=null===(l=e[0])||void 0===l?void 0:l.data;if(!r)return"";const c=r[a.keyPropertyName],d=n.multiple||void 0===n.multiple,h=String(c),b=a.selectedKeysSet.has(h),u=a.disabledKeys.has(h),p=n.label(r),v={name:"selection",checked:b,disabled:u,id:String(c),"aria-label":p};return s("td",{key:`tbody-${o}-selection`,class:Ot("cell",{selection:!0})},s("div",{class:Ot("selection",{checked:b})},d?s("label",{class:Ot("selection-label",{disabled:u})},s(F,{class:At,icons:"kolicon "+(b?"kolicon-check":""),label:""}),s("input",Object.assign({class:Ot("selection-input",{checkbox:!0})},v,{type:"checkbox",onInput:t=>{const e=b?a.selectedKeys.filter((t=>String(t)!==h)):[...a.selectedKeys,c];i(t,e)}}))):s("label",{class:Ot("selection-label")},s("input",Object.assign({class:Ot("selection-input",{radio:!0})},v,{type:"radio",onInput:t=>{i(t,[c])}}))),s("div",{class:Et},s(C,{label:p,badgeText:"",id:`${c}-label`,refFloating:()=>{}}))))})(t,e,o),e.map(((e,i)=>((t,e,o,l,i)=>{if(!1===e.visible)return"";let n=`${o}-${l}-${e.label}`;if(e.data){const i=t.rowKeys.get(e.data);n=i?`${i}-${t.primaryHeaders.horizontal?l:o}`:n}if(e.headerCell)return Vt(t,e,o,l,i);const a="function"!=typeof e.render&&e.label===t.translateNoEntries,r=kt(t.headers,t.primaryHeaders,l,"action"),c=Boolean(r&&e.data),d=kt(t.headers,t.primaryHeaders,l,"state"),h=Boolean(d&&e.data),b=Wt(t,l),{left:u,right:p}=Rt(t,b,e.colIndex),v="function"==typeof e.render,f=e.textAlign;return s("td",{key:`cell-${n}-${t.settingsChangedCounter}`,class:Ot("cell",{actions:c,"align-center":"center"===f,"align-justify":"justify"===f,"align-left":"left"===f,"align-right":"right"===f,body:!0,states:h,"sticky-left":"left"===b,"sticky-right":"right"===b}),"aria-atomic":a?"false":void 0,"aria-live":a?"polite":void 0,"aria-relevant":a?"text":void 0,colSpan:e.colSpan,rowSpan:e.rowSpan,style:{textAlign:f,left:u,right:p},ref:v?o=>t.handleRenderCell(e,o):void 0},c&&r&&e.data?((t,e,o,l)=>s("div",{class:Ft},e.actions(o).map(((e,o)=>{const i=`action-${l}-${o}`;return"button"===e.type?s("span",{key:i},s($,Object.assign({},t.getButtonFcProps(i,e)))):"link"===e.type?s("span",{key:i},s(L,Object.assign({},t.getLinkFcProps(i,e)))):null}))))(t,r,e.data,n):h&&d&&e.data?((t,e,o)=>{const l=t.key;if(!l)return"";const i=e[l];return i?s("div",{class:Lt},i.map(((t,e)=>"badge"===t.type?s(S,Object.assign({key:`state-${o}-${e}`},t)):null))):""})(d,e.data,n):v?"":e.label)})(t,e,o,i,l)))),Jt=(t,e,o)=>{const l=t.headers.vertical.length+ft(null==o?void 0:o[0])+(t.selection?1:0);return s("tr",{"aria-hidden":"true",class:Ot("spacer",{[e]:!0})},s("td",{class:Ot("spacer-line",{[e]:!0}),colSpan:l}))},Qt=t=>{const e=f(ht,t),{data:o,dataFoot:l,externalLabelElements:i,fixedCols:a,hasScrollbar:r,hasSettingsMenu:c,headers:d,label:h,loading:b,refScrollContainer:u,refTable:p,selection:v,stickyColsDisabled:y,variant:g}=e,k=x("kol-no-entries"),S=ut(d),w=vt(d.horizontal,o),_=Object.assign(Object.assign({},e),{fixedOffsets:yt(S.cells,w,a,y),maxCols:w,primaryHeaders:S,selectionModel:_t(v),translateNoEntries:k}),$=jt({data:o,dataFoot:l,headers:d,isFoot:!1,noEntriesLabel:k,primaryHeaders:S}),L=0===i.length;return s(O,{block:"kol-table",class:j(g,"table")},c&&t.renderSettings(d.horizontal),s("div",{ref:u,class:zt,tabindex:r?L?"-1":"0":void 0},s("table",{ref:p,"aria-labelledby":L?Pt:void 0,class:Kt,style:{minWidth:Ct(d)}},L&&s("caption",{class:Nt,id:Pt,ref:t=>{t&&(r?t.tabIndex=0:t.removeAttribute("tabindex"))}},I(h)),s("thead",{class:Dt},[d.horizontal.map(((t,e)=>s("tr",{class:Tt,key:`thead-${e}`},v&&(t=>{const{data:e,handleSelectionChange:o,selection:l,selectionModel:i}=t;if(!l)return s("td",{class:Ot("cell",{header:!0}),key:"thead-0"});if(!1===l.multiple)return s("th",{scope:"col",key:"thead-0-selection",class:Ot("cell",{header:!0,selection:!0})},s("span",{class:"visually-hidden"},x("kol-table-selection")));const n=i.selectedKeys.filter((t=>!i.disabledKeys.has(String(t)))).length,a=n===xt(e,i).length,r=0!==n&&!a;let c;return c=x(0===n?"kol-table-selection-all":a&&!r?"kol-table-selection-none":"kol-table-selection-indeterminate"),s("th",{scope:"col",key:"thead-0-selection",class:Ot("cell",{header:!0,selection:!0})},s("span",{class:"visually-hidden"},x("kol-table-selection")),s("div",{class:Ot("selection",{checked:a,indeterminate:r})},s("label",{class:Ot("selection-label")},s(F,{class:At,icons:"kolicon "+(r?"kolicon-minus":a?"kolicon-check":""),label:""}),s("input",{class:Ot("selection-input",{checkbox:!0}),name:"selection",checked:a&&!r,indeterminate:r,"aria-label":c,type:"checkbox",onInput:t=>{o(t,((t,e,o)=>{const l=e.selectedKeys.filter((t=>e.disabledKeys.has(String(t))));return o&&l.push(...xt(t,e).map((t=>null==t?void 0:t[e.keyPropertyName]))),l})(e,i,!a))}})),s("div",{class:Et},s(C,{label:c,badgeText:"",refFloating:()=>{}}))))})(_),0===e&&(({headers:t})=>{const{horizontal:e,vertical:o}=t;if(0===e.length||0===o.length)return s(n,null);const l=o.reduce(((t,e)=>{var o,l;return t+(null!==(l=null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.width)&&void 0!==l?l:0)}),0);return s("td",{"aria-hidden":"true",colSpan:o.length,rowSpan:e.length,style:l>0?{width:`${l}px`}:void 0})})(_),Array.isArray(t)&&t.map(((t,o)=>Vt(_,t,e,o,!1)))))),Jt(_,"head",d.horizontal)]),s("tbody",{class:$t},s("div",{class:Ot("loader",{shown:b})},s(D,{label:x(b?"kol-table-data-loading":"kol-table-data-loaded").replace("{{caption}}",m(h)),show:b,variant:"cycle"})),$.map(((t,e)=>Gt(_,t,e,!0)))),(t=>{const{dataFoot:e,headers:o,primaryHeaders:l,translateNoEntries:i}=t;if(0===e.length)return null;const n=jt({data:e,dataFoot:e,headers:o,isFoot:!0,noEntriesLabel:i,primaryHeaders:l}),a=vt(o.horizontal,e),r=Object.assign(Object.assign({},t),{fixedOffsets:yt(l.cells,a,t.fixedCols,t.stickyColsDisabled),maxCols:a});return s("tfoot",{class:It},[Jt(t,"foot",n),n.map(((t,e)=>Gt(r,t,e,!0,!0)))])})(_))))},Xt=({dialog:t,card:e},o)=>s(R,Object.assign({},t),e?s(J,Object.assign({},e),o):o),Yt=i.forBlock("kol-table")("settings"),Zt=t=>Number.isFinite(t)&&void 0!==t&&t>0?t:void 0,te=()=>{},ee=(t,e)=>{const o=x("kol-table-settings"),l=x("kol-table-settings-cancel"),i=x("kol-table-settings-apply"),n=x("kol-table-settings-error-all-invisible");let a,h=!1,b=!1;const u=()=>{h=!0,e()},p=d((()=>c(t)),(t=>t.syncListeners()),(t=>t.destroy())),v=((t,e)=>{const o=K(),l=K(),i=new Q(r.stateLess),s=z(),n=A("dialog-heading"),c={};let d,h=!0,b={};const u=t=>!a||E(a,t),p=()=>{var t,e;null===(e=null===(t=o.el)||void 0===t?void 0:t.close)||void 0===e||e.call(t)},v=t=>{var e;q(t),t.defaultPrevented||(null===(e=b.onCancel)||void 0===e||e.call(b,t),t.defaultPrevented||u(M.cancel)||t.preventDefault())},f=t=>{var e;t.target===o.el&&(N(c),null===(e=b.onClose)||void 0===e||e.call(b),u(M.close))},k=()=>{i.hideTooltip(),p(),u(M.close)};return{getFcProps:e=>{var a,r,c;let u="",p=0,j="blank",C="100%";g.apply(e.label,(t=>{u=t})),H.apply(null!==(a=e.level)&&void 0!==a?a:0,(t=>{p=t})),U.apply(e.on,(t=>{b=t})),y.apply(null!==(r=e.variant)&&void 0!==r?r:"blank",(t=>{j=t})),V.apply(null!==(c=e.width)&&void 0!==c?c:"100%",(t=>{C=t}));const S="card"===j;return S&&!d&&(d=G(t()),i.componentWillLoad({label:d.label,align:d.tooltipAlign})),{dialog:{blockClass:W(j),handleCancel:v,handleClose:f,label:m(u),labelledBy:S?n:void 0,modal:h,refDialog:o,width:C},card:S&&d?{ariaDescriptionId:s,closeButtonProps:d,handleClose:k,hasCloser:!0,headingId:n,label:u,level:p,refCloseButton:l,refTooltip:i.setTooltipElementRef}:void 0}},show:t=>{var l,i;const s=o.el;(null==s?void 0:s.open)||(h!==t&&(h=t,e()),t?(null===(l=null==s?void 0:s.showModal)||void 0===l||l.call(s),s&&P(c)):null===(i=null==s?void 0:s.show)||void 0===i||i.call(s))},close:p,syncListeners:()=>{l.el&&i.syncListeners(void 0,l.el,!0)},destroy:()=>{p(),N(c),i.destroy()}}})(t,u),f=A("alert-heading"),k=z();let j,C=[],S=[],O=null;const F=()=>{var t;return null!==(t=S[S.length-1])&&void 0!==t?t:[]},L=t=>{S=S.map(((e,o,l)=>o===l.length-1?t:e)),u()},I=(t,e)=>{const o=[...F()],l=o.findIndex((e=>e.key===t));if(-1===l)return;let i;if("up"===e){if(0===l)return;i=l-1}else{if(l===o.length-1)return;i=l+1}const[s]=o.splice(l,1);o.splice(i,0,s),L(o)},D=t=>{if(t.preventDefault(),!F().some((t=>!1!==t.visible)))return O=n,void u();if(a){O=null,C=S.map((t=>t.map((t=>Object.assign({},t))))),u();const t=S.map((t=>t.map((t=>{const e=t,{hidable:o,resizable:l,sortable:i,visible:s,width:n}=e,a=T(e,["hidable","resizable","sortable","visible","width"]),r=Object.assign({},a);return void 0!==s&&(r.visible=s),void 0!==o&&(r.hidable=o),void 0!==i&&(r.sortable=i),void 0!==l&&(r.resizable=l),null!=n&&(r.width=n),r}))));E(a,M.changeHeaderCells,t),v.close()}},R=t=>{t&&(a=t)};return{beginRender:()=>{p.beginRender(),b=h,h=!1},render:t=>{var e;b||t===j||(j=t,C=(e=t).map((t=>[...t])),S=e.map((t=>t.map((t=>Object.assign({},t))))));const n=F();return s("div",{class:Yt,ref:R},s("div",{class:"kol-table-settings"},s($,Object.assign({},p.get("toggle").getFcProps({_icons:"kolicon-settings",_label:o,_hideLabel:!0,_on:{onClick:()=>v.show(!0)}})))),s(Xt,Object.assign({},v.getFcProps({label:o,variant:"card",width:"fit-content"})),s("div",{class:"kol-table-settings__content"},O&&s("div",{class:"kol-table-settings__error-message"},s(B,{alert:!1,closerAriaDescriptionId:k,handleCloserClick:te,hasCloser:!1,headingId:f,label:O,level:0,refCloserButton:te,refCloserTooltip:te,type:"error",variant:"msg"})),s("form",{onSubmit:D},s("div",{class:"kol-table-settings__columns"},n.map(((t,e)=>((t,e,o)=>s("div",{key:t.key,class:"kol-table-settings__column"},s(w,{_checked:!1!==t.visible,_label:x(t.hidable?"kol-table-settings-column-hidable":"kol-table-settings-column-not-hidable",{placeholders:{column:t.label}}),_value:!0,_hideLabel:!0,_disabled:!1===t.hidable,_on:{onInput:(e,o)=>{var l;return((t,e)=>{const o=F().map((o=>o.key===t&&!1!==o.hidable?Object.assign(Object.assign({},o),{visible:Boolean(e)}):o));L(o)})(null!==(l=t.key)&&void 0!==l?l:"",o)}}}),s("span",{class:"kol-table-settings__column-label"},t.label),s(_,{_hideLabel:!0,_value:Zt(t.width),_label:x("kol-table-settings-column-width",{placeholders:{column:t.label}}),_min:1,_disabled:!1===t.resizable,_on:{onInput:(e,o)=>{var l;return((t,e)=>{const o=Zt(Number(e)),l=F().map((e=>e.key===t&&!1!==e.resizable?Object.assign(Object.assign({},e),{width:o}):e));L(l)})(null!==(l=t.key)&&void 0!==l?l:"",o)}}}),s($,Object.assign({},p.get(`move-up-${t.key}`).getFcProps({_icons:"kolicon-chevron-up",_label:x(!1===t.sortable||0===e?"kol-table-settings-not-move":"kol-table-settings-move-up",{placeholders:{column:t.label}}),_hideLabel:!0,_variant:"ghost",_on:{onClick:()=>{var e;return I(null!==(e=t.key)&&void 0!==e?e:"","up")}},_disabled:!1===t.sortable||0===e}))),s($,Object.assign({},p.get(`move-down-${t.key}`).getFcProps({_icons:"kolicon-chevron-down",_label:x(!1===t.sortable||e===o.length-1?"kol-table-settings-not-move":"kol-table-settings-move-down",{placeholders:{column:t.label}}),_hideLabel:!0,_variant:"ghost",_on:{onClick:()=>{var e;return I(null!==(e=t.key)&&void 0!==e?e:"","down")}},_disabled:!1===t.sortable||e===o.length-1})))))(t,e,n)))),s("div",{class:"kol-table-settings__actions"},s($,Object.assign({},p.get("cancel").getFcProps({_label:l,_variant:"secondary",_on:{onClick:()=>(S=C.map((t=>[...t])),O=null,u(),void v.close())}}))),s($,Object.assign({},p.get("apply").getFcProps({_label:i,_variant:"primary",_type:"submit"}))))))))},sync:()=>{p.endRender(),v.syncListeners()},destroy:()=>{p.destroy(),v.destroy()}}},oe=class extends r{constructor(){super(...arguments),this.hasExternalTableLabelRefs=!1,this.cellRenderTimeouts=new Map,this.buttonItems=d((()=>c((()=>this.host))),(t=>t.syncListeners()),(t=>t.destroy())),this.settings=ee((()=>this.host),(()=>a(this))),this.linkItems=d((()=>h((()=>a(this)))),(t=>t.syncListeners()),(t=>t.destroy())),this.propsConfig=ht,this.handleResize=()=>{this.updateScrollbarState(),clearTimeout(this.resizeDebounceTimeout),this.resizeDebounceTimeout=setTimeout((()=>{this.updateStickyColsDisabled()}),150)},this.handleSelectionChange=(t,e)=>{this.emitSelectionChange(t,e)},this.handleSort=(t,e)=>{this.emitSort(t,e)},this.handleRenderCell=(t,e)=>{e&&(clearTimeout(this.cellRenderTimeouts.get(e)),this.cellRenderTimeouts.set(e,setTimeout((()=>{if("function"==typeof t.render){const o=t.render(e,t,t.data,this.getRenderProp("data"));"string"==typeof o&&(e.textContent=o)}}))))},this.refScrollContainer=t=>{this.scrollContainerElement=t},this.refTable=t=>{this.tableElement=t,this.syncTableLabel(this.getState("externalLabelElements"))},this.getButtonFcProps=(t,e,o)=>this.buttonItems.get(t).getFcProps(e,o),this.renderSettings=t=>this.settings.render(t),this.getLinkFcProps=(t,e)=>this.linkItems.get(t).getFcProps(e)}observeScrollContainer(){this.scrollContainerElement&&ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.scrollContainerElement)),this.updateStickyColsDisabled()}teardownTable(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),clearTimeout(this.resizeDebounceTimeout),this.buttonItems.destroy(),this.linkItems.destroy(),this.settings.destroy()}syncTableItems(){this.buttonItems.endRender(),this.linkItems.endRender(),this.settings.sync()}applyData(t){st.apply(t,(t=>{this.setRenderProp("data",t),this.setState("rowKeys",((t,e)=>new Map(t.map((t=>{var o;return[t,null!==(o=e.get(t))&&void 0!==o?o:z()]}))))(t,this.getState("rowKeys")))}))}applyDataFoot(t){nt.apply(t,(t=>this.setRenderProp("dataFoot",t)))}applyFixedCols(t){tt.apply(t,(t=>this.setRenderProp("fixedCols",t))),this.updateStickyColsDisabled()}applyHasSettingsMenu(t){et.apply(t,(t=>this.setRenderProp("hasSettingsMenu",t)))}applyHeaders(t){rt.apply(t,(t=>this.setRenderProp("headers",(t=>0===t.horizontal.length?t:Object.assign(Object.assign({},t),{horizontal:t.horizontal.map((t=>t.map((t=>Object.assign(Object.assign({},t),{visible:"boolean"!=typeof t.visible||t.visible,hidable:"boolean"!=typeof t.hidable||t.hidable})))))}))(t))))}applyLabel(t){g.apply(t,(t=>this.setRenderProp("label",t)),this.isRequired("label"))}applyLoading(t){ct.apply(t,(t=>this.setRenderProp("loading",t)))}applyOn(t){ot.apply(t,(t=>this.setRenderProp("on",t)))}applySelection(t){dt.apply(t,(t=>this.setRenderProp("selection",t))),this.updateStickyColsDisabled()}applyVariant(t){k.apply(t,(t=>this.setRenderProp("variant",t)))}syncTableLabel(t){this.tableElement&&"ariaLabelledByElements"in this.tableElement&&((null==t?void 0:t.length)?(this.tableElement.ariaLabelledByElements=t,this.hasExternalTableLabelRefs=!0,o.debug([this.tableElement,t,this.tableElement.ariaLabelledByElements])):this.hasExternalTableLabelRefs&&(this.hasExternalTableLabelRefs=!1,this.tableElement.ariaLabelledByElements=null,this.tableElement.setAttribute("aria-labelledby",Pt)))}moveCheckboxFocus(t){var e,o,l;if("ArrowUp"!==t.key&&"ArrowDown"!==t.key)return;const i=Array.from(null!==(o=null===(e=this.scrollContainerElement)||void 0===e?void 0:e.querySelectorAll(".kol-table__selection-input--checkbox"))&&void 0!==o?o:[]),s=null===(l=this.scrollContainerElement)||void 0===l?void 0:l.querySelector(":focus");let n=i.indexOf(s);n>-1&&(t.preventDefault(),n=(n+("ArrowDown"===t.key?1:i.length-1))%i.length,i[n].focus())}applyChangedHeaderCells(t){const e=Object.assign(Object.assign({},this.getRenderProp("headers")),{horizontal:t.detail});this.setRenderProp("headers",e),this.setState("settingsChangedCounter",this.getState("settingsChangedCounter")+1);const o=this.getRenderProp("on")[X.onChangeHeaderCells];"function"==typeof o&&o(t,e)}updateScrollbarState(){if(this.scrollContainerElement){const{clientHeight:t,clientWidth:e,scrollHeight:o,scrollWidth:l}=this.scrollContainerElement;this.setState("hasScrollbar",l>e||o>t&&["auto","scroll"].includes(getComputedStyle(this.scrollContainerElement).overflowY))}}calculateFixedColsWidth(){var t,e,o,l,i,s;const[n,a]=this.getRenderProp("fixedCols"),r=this.getRenderProp("headers"),c=ut(r).cells,d=vt(r.horizontal,this.getRenderProp("data"));let h=0;for(let o=0;o<n&&o<c.length;o++)h+=null!==(e=null===(t=c[o])||void 0===t?void 0:t.width)&&void 0!==e?e:0;for(let t=d-a;t<d&&t<c.length;t++)h+=null!==(l=null===(o=c[t])||void 0===o?void 0:o.width)&&void 0!==l?l:0;if(this.getRenderProp("selection")){const t=null===(i=this.scrollContainerElement)||void 0===i?void 0:i.querySelector(".kol-table__cell--selection");h+=null!==(s=null==t?void 0:t.offsetWidth)&&void 0!==s?s:0}return h}updateStickyColsDisabled(){if(!this.scrollContainerElement)return void this.setState("stickyColsDisabled",!1);const t=this.calculateFixedColsWidth();this.setState("stickyColsDisabled",t>0&&t>=this.scrollContainerElement.clientWidth)}emitSelectionChange(t,e){const o=this.getRenderProp("on")[X.onSelectionChange];"function"==typeof o&&o(t,e),this.host&&E(this.host,M.selectionChange,e)}emitSort(t,e){const o=this.getRenderProp("on")[X.onSort];"function"==typeof o&&e.key&&o(t,e),this.host&&E(this.host,M.sort,e)}renderTableStatelessFC(){return this.buttonItems.beginRender(),this.linkItems.beginRender(),this.settings.beginRender(),s(Qt,{data:this.getRenderProp("data"),dataFoot:this.getRenderProp("dataFoot"),externalLabelElements:this.getState("externalLabelElements"),fixedCols:this.getRenderProp("fixedCols"),getButtonFcProps:this.getButtonFcProps,getLinkFcProps:this.getLinkFcProps,renderSettings:this.renderSettings,handleRenderCell:this.handleRenderCell,handleSelectionChange:this.handleSelectionChange,handleSort:this.handleSort,hasScrollbar:this.getState("hasScrollbar"),hasSettingsMenu:this.getRenderProp("hasSettingsMenu"),headers:this.getRenderProp("headers"),label:this.getRenderProp("label"),loading:this.getRenderProp("loading"),on:this.getRenderProp("on"),refScrollContainer:this.refScrollContainer,refTable:this.refTable,rowKeys:this.getState("rowKeys"),selection:this.getRenderProp("selection"),settingsChangedCounter:this.getState("settingsChangedCounter"),stickyColsDisabled:this.getState("stickyColsDisabled"),variant:this.getRenderProp("variant")})}};export{oe as B,nt as a,st as t,Y as v}
|
|
4
|
+
import{a1 as e,l as t,P as o,h as l,F as i,L as s,$ as n}from"./prop.validators.js";import{r as a}from"./base-web-component2.js";import{c as r,h as c,n as d,b as h,r as u,t as b,B as p,a as v,E as f}from"./base-web-component.js";import{c as m}from"./item.js";import{c as y}from"./item-pool.js";import{c as g}from"./item3.js";import{l as k}from"./label-lang-segment.js";import{v as j,k as w,T as S}from"./component6.js";import{t as C}from"./i18n.js";import{b as _}from"./bem-registry.js";import{B as x}from"./component9.js";import{I as O}from"./component3.js";import{L as $}from"./component4.js";import{r as F}from"./component5.js";import{S as T}from"./component14.js";import{T as L}from"./behavior.js";import{a as I}from"./tslib.es6.js";import{c as D,n as z}from"./dev.utils.js";import{d as A,K as E}from"./events.js";import{A as M}from"./component.js";import{l as B}from"./level.js";import{c as H}from"./element-interaction.js";import{u as K,l as N,D as P}from"./scroll-lock.js";import{h as R}from"./tooltip-open-tracking.js";import{d as W,w as q}from"./width.js";import{r as U,C as V}from"./component8.js";import{C as G}from"./keyboard.js";const J=(o,l,i)=>"string"!=typeof i&&void 0!==i?(e()&&t(`[${o.constructor.name}] The property value: (${i}) for '_ariaLabelledby' is not valid. Allowed values are: string, null`),[]):a(l,i),Q=e=>"number"==typeof e&&Number.isInteger(e)&&e>=0,X=r("fixedCols",[0,0],(e=>c(e)),(e=>2===e.length&&e.every(Q))),Y=r("hasSettingsMenu",!1,d),Z=h();function ee(e){const t="string"==typeof e?o(e):e;if(Array.isArray(t))return t;throw new Error("Invalid table data: expected an array of row objects.")}function te(e){return e.every((e=>"object"==typeof e&&null!==e))}const oe=r("data",[],ee,te),le=r("dataFoot",[],ee,te),ie=e=>Array.isArray(e)&&e.every((e=>Array.isArray(e))),se=r("headers",{horizontal:[],vertical:[]},(function(e){const t="string"==typeof e?o(e):e;if("object"!=typeof t||null===t)throw new Error("Invalid table headers: expected an object.");const{horizontal:l=[],vertical:i=[]}=t;if(!ie(l)||!ie(i))throw new Error("Invalid table headers: horizontal and vertical must be arrays of header rows.");return{horizontal:l,vertical:i}}),(function({horizontal:e,vertical:t}){return[...e,...t].every((e=>e.every((e=>void 0===e.width||"number"==typeof e.width))))})),ne=r("loading",!1,d),ae=r("selection",!1,(function(e){const t="string"==typeof e?o(e):e;if("object"==typeof t&&null!==t)return t;throw new Error("Invalid table selection: expected an object.")}),(function(e){return!1===e||"function"==typeof e.label&&(!e.selectedKeys||Array.isArray(e.selectedKeys))})),re={required:[k,oe,se],optional:[X,Y,Z,le,ne,ae,j]},ce=e=>e.flatMap((e=>e.filter((e=>"string"==typeof e.key||"function"==typeof e.render)))),de=e=>{const t=ce(e.horizontal);if(t.length>0)return{cells:t,horizontal:!0};const o=ce(e.vertical);return{cells:o,horizontal:0===o.length}},he=(e,t)=>{let o=0;return Array.isArray(e)&&e.forEach((e=>{var l;o+=null!==(l=e[t])&&void 0!==l?l:1})),o},ue=(e,t)=>{const o=Math.max(0,...e.map((e=>he(e,"colSpan"))));return 0===o?t.length:o},be=e=>{var t;return null!==(t=null==e?void 0:e.reduce(((e,t)=>"visible"in t&&!1===t.visible?e:e+(t.colSpan||1)),0))&&void 0!==t?t:0},pe=(e,t,o,l)=>{if(void 0!==l&&!t)return l<e[0]?"left":e[1]>0&&l>=o-e[1]?"right":void 0},ve=(e,t,o,l)=>{var i,s,n,a,r,c;const d=[];for(let a=0;a<t;a++)"left"===pe(o,l,t,a)&&(d[a]=(null!==(i=d[a-1])&&void 0!==i?i:0)+(null!==(n=null===(s=e[a-1])||void 0===s?void 0:s.width)&&void 0!==n?n:0));for(let i=t-1;i>=0;i--)"right"===pe(o,l,t,i)&&(d[i]=(null!==(a=d[i+1])&&void 0!==a?a:0)+(null!==(c=null===(r=e[i+1])||void 0===r?void 0:r.width)&&void 0!==c?c:0));return d},fe=(e,t,o,l)=>{const i=void 0===t?void 0:e[t];return o&&l?`calc( var(--kol-table-selection-col-width) + ${i}px)`:`${i}px`},me=({data:e,dataFoot:t,headers:o,isFoot:l,noEntriesLabel:i,primaryHeaders:s})=>{const n=ue(o.horizontal,e),a=s.cells;let r=((e,t,o)=>{const l=Math.max(0,...e.map((e=>he(e,"rowSpan"))));return 0===l?t.length:l-o})(o.vertical,e,t.length),c=0;l&&(c=r,r+=t.length);const d=[],h=[],u=[];o.vertical.forEach(((e,t)=>{h[t]=0,u[t]=[]}));for(let i=c;i<r;i++){const r=[];o.vertical.forEach(((e,t)=>{let o=0;if(u[t].forEach((e=>o+=e)),o<=i){const l=e[i-o+h[t]];if("object"==typeof l){r.push(Object.assign(Object.assign({},l),{headerCell:!0,data:{}}));let e=1;if("number"==typeof l.rowSpan&&l.rowSpan>1&&(e=l.rowSpan),u[t].push(e),"number"==typeof l.colSpan&&l.colSpan>1)for(let o=1;o<l.colSpan;o++)u[t+o].push(e);h[t]++}}}));for(let o=0;o<n;o++)if(s.horizontal){const s=l?t[i-c]:e[i],n=a[o];"object"==typeof n&&null!==n&&"object"==typeof s&&null!==s&&r.push(Object.assign(Object.assign({},n),{colIndex:o,colSpan:void 0,rowSpan:void 0,data:s,label:s[n.key]}))}else{const t=a[i];"object"==typeof t&&null!==t&&"object"==typeof e[o]&&null!==e[o]&&r.push(Object.assign(Object.assign({},t),{colIndex:o,colSpan:void 0,rowSpan:void 0,data:e[o],label:e[o][t.key]}))}d.push(r)}if(0===e.length){let e=be(o.horizontal[0]),t=0;o.vertical.length>0&&(e-=o.vertical.length,o.vertical[0].forEach((e=>{t+=e.rowSpan||1})));const l={colSpan:e,label:i,render:void 0,rowSpan:Math.max(t,1)};0===d.length?d.push([l]):d[0].push(l)}return d},ye=({horizontal:e,vertical:t})=>{const o=e.flatMap((e=>e.filter((e=>!1!==e.visible&&void 0!==e.width&&e.width>0)).map((e=>e.width)))),l=[...t.flatMap((e=>e.filter((e=>void 0!==e.width&&e.width>0)).map((e=>e.width)))),...o];return 0===l.length?"0px":1===l.length?`${l[0]}px`:`calc(${l.map((e=>`${e}px`)).join(" + ")})`},ge=e=>void 0===e?[]:Array.isArray(e)?e:[e],ke=e=>{var t;return null!==(t=e?e.keyPropertyName:void 0)&&void 0!==t?t:"id"},je=e=>{const t=e?ge(e.selectedKeys):[];return{disabledKeys:new Set((e?ge(e.disabledKeys):[]).map(String)),keyPropertyName:ke(e),selectedKeys:t,selectedKeysSet:new Set(t.map(String))}},we=(e,t)=>e.filter((e=>!t.disabledKeys.has(String(e[t.keyPropertyName])))),Se=_.forBlock("kol-table"),Ce=Se("body"),_e=Se("cell-actions"),xe=Se("cell-states"),Oe=Se("footer"),$e=Se("head"),Fe=Se("head-row"),Te=Se("scroll-container"),Le=Se("selection-icon"),Ie=Se("selection-input-tooltip"),De=Se("sort"),ze=Se("sort-button"),Ae=Se("sort-order"),Ee=Se("table"),Me=`${Se("focus-element")} ${Se("caption")}`,Be="caption",He=(e,t)=>pe(e.fixedCols,e.stickyColsDisabled,e.maxCols,t),Ke=(e,t,o)=>({left:"left"===t?fe(e.fixedOffsets,o,!0,!1!==e.selection):void 0,right:"right"===t?fe(e.fixedOffsets,o,!1,!1!==e.selection):void 0}),Ne=(e,t,o)=>{var l,i;return null!==(i=e.primaryHeaders.horizontal&&(null===(l=t[0])||void 0===l?void 0:l.data)?e.rowKeys.get(t[0].data):void 0)&&void 0!==i?i:String(o)},Pe=e=>{const t=C("kol-sort");return"number"==typeof e&&e>0?`${t} – ${C("kol-table-sort-order").replace("{{order}}",`${e}`)}`:t},Re=(e,t,o,i,s)=>{if(!1===t.visible)return"";const n=!1!==(null==t?void 0:t.sortable)&&"string"==typeof t.sortDirection;let a="none",r="kolicon-sort-neutral";if(n&&t.sortDirection)switch(t.sortDirection){case"ASC":r="kolicon-sort-asc",a="ascending";break;case"DESC":r="kolicon-sort-desc",a="descending";break;default:a="none"}const c=s?"row":"number"==typeof t.colSpan&&t.colSpan>1?"colgroup":"col",d="number"==typeof t.sortOrder&&t.sortOrder>0?t.sortOrder:void 0,h=void 0!==t.width?`${t.width}px`:void 0,u=He(e,i),{left:b,right:p}=Ke(e,u,i),v=t.textAlign,f=n?t.sortDirection:void 0;return l("th",{key:`${o}-${i}-${t.label}`,class:Se("cell",{[a]:!0,"align-center":"center"===v,"align-justify":"justify"===v,"align-left":"left"===v,"align-right":"right"===v,header:!0,"sticky-left":"left"===u,"sticky-right":"right"===u}),scope:c,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{width:h,left:b,right:p},"aria-sort":a,"data-sort":f?`sort-${f}`:void 0},f?l("span",{class:De},l(x,Object.assign({},e.getButtonFcProps(`sort-${s?"vertical":"horizontal"}-${o}-${i}`,{_icons:{right:r},_label:t.label,_ariaDescription:Pe(d),_on:{onClick:o=>{e.handleSort(o,{key:t.key,currentSortDirection:f})}}},{class:ze}))),d&&l("span",{"aria-hidden":"true",class:Ae},d)):t.label)},We=(e,t,o,i,s=!1)=>l("tr",{class:Se("row",{body:!s,footer:s}),key:`row-${Ne(e,t,o)}`},((e,t,o)=>{var i;const{handleSelectionChange:s,selection:n,selectionModel:a}=e;if(!n)return"";const r=null===(i=t[0])||void 0===i?void 0:i.data;if(!r)return"";const c=r[a.keyPropertyName],d=n.multiple||void 0===n.multiple,h=String(c),u=a.selectedKeysSet.has(h),b=a.disabledKeys.has(h),p=n.label(r),{refInput:v,refTooltip:f}=e.getSelectionTooltipRefs(`selection-${h}`,p),m={name:"selection",checked:u,disabled:b,id:String(c),ref:v,"aria-label":p};return l("td",{key:`tbody-${o}-selection`,class:Se("cell",{selection:!0})},l("div",{class:Se("selection",{checked:u})},d?l("label",{class:Se("selection-label",{disabled:b})},l(O,{class:Le,icons:"kolicon "+(u?"kolicon-check":""),label:""}),l("input",Object.assign({class:Se("selection-input",{checkbox:!0})},m,{type:"checkbox",onInput:e=>{const t=u?a.selectedKeys.filter((e=>String(e)!==h)):[...a.selectedKeys,c];s(e,t)}}))):l("label",{class:Se("selection-label")},l("input",Object.assign({class:Se("selection-input",{radio:!0})},m,{type:"radio",onInput:e=>{s(e,[c])}}))),l("div",{class:Ie},l(S,{label:p,badgeText:"",id:`${c}-label`,refFloating:f}))))})(e,t,o),t.map(((t,s)=>((e,t,o,i,s)=>{if(!1===t.visible)return"";let n=`${o}-${i}-${t.label}`;if(t.data){const l=e.rowKeys.get(t.data);n=l?`${l}-${e.primaryHeaders.horizontal?i:o}`:n}if(t.headerCell)return Re(e,t,o,i,s);const a="function"!=typeof t.render&&t.label===e.translateNoEntries,r=((e,t,o)=>{if(0!==(t.horizontal?e.horizontal:e.vertical).length)return t.cells[o]})(e.headers,e.primaryHeaders,i),c="action"===(null==r?void 0:r.type)?r:void 0,d=Boolean(c&&t.data),h="state"===(null==r?void 0:r.type)?r:void 0,u=Boolean(h&&t.data),b=He(e,i),{left:p,right:v}=Ke(e,b,t.colIndex),f="function"==typeof t.render,m=t.textAlign;return l("td",{key:`cell-${n}-${e.settingsChangedCounter}`,class:Se("cell",{actions:d,"align-center":"center"===m,"align-justify":"justify"===m,"align-left":"left"===m,"align-right":"right"===m,body:!0,states:u,"sticky-left":"left"===b,"sticky-right":"right"===b}),"aria-atomic":a?"false":void 0,"aria-live":a?"polite":void 0,"aria-relevant":a?"text":void 0,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{textAlign:m,left:p,right:v},ref:f?o=>e.handleRenderCell(t,o):void 0},d&&c&&t.data?((e,t,o,i)=>l("div",{class:_e},t.actions(o).map(((t,o)=>{const s=`action-${i}-${o}`;return"button"===t.type?l("span",{key:s},l(x,Object.assign({},e.getButtonFcProps(s,t)))):"link"===t.type?l("span",{key:s},l($,Object.assign({},e.getLinkFcProps(s,t)))):null}))))(e,c,t.data,n):u&&h&&t.data?((e,t,o)=>{const i=e.key;if(!i)return"";const s=t[i];return s?l("div",{class:xe},s.map(((e,t)=>"badge"===e.type?l("kol-badge",Object.assign({key:`state-${o}-${t}`},e)):null))):""})(h,t.data,n):f?"":t.label)})(e,t,o,s,i)))),qe=(e,t,o)=>{const i=e.headers.vertical.length+be(null==o?void 0:o[0])+(e.selection?1:0);return l("tr",{"aria-hidden":"true",class:Se("spacer",{[t]:!0})},l("td",{class:Se("spacer-line",{[t]:!0}),colSpan:i}))},Ue=e=>{const t=u(re,e),{data:o,dataFoot:s,externalLabelElements:n,fixedCols:a,hasScrollbar:r,hasSettingsMenu:c,headers:d,label:h,loading:v,refScrollContainer:f,refTable:m,selection:y,stickyColsDisabled:g,variant:k}=t,j=C("kol-no-entries"),_=de(d),x=ue(d.horizontal,o),$=Object.assign(Object.assign({},t),{fixedOffsets:ve(_.cells,x,a,g),maxCols:x,primaryHeaders:_,selectionModel:je(y),translateNoEntries:j}),L=me({data:o,dataFoot:s,headers:d,isFoot:!1,noEntriesLabel:j,primaryHeaders:_}),I=0===n.length;return l(p,{block:"kol-table",class:w(k,"table")},c&&e.renderSettings(d.horizontal),l("div",{ref:f,class:Te,tabindex:r?I?"-1":"0":void 0},l("table",{ref:m,"aria-labelledby":I?Be:void 0,class:Ee,style:{minWidth:ye(d)}},I&&l("caption",{class:Me,id:Be,ref:e=>{e&&(r?e.tabIndex=0:e.removeAttribute("tabindex"))}},F(h)),l("thead",{class:$e},[d.horizontal.map(((e,t)=>l("tr",{class:Fe,key:`thead-${t}`},y&&(e=>{const{data:t,handleSelectionChange:o,selection:i,selectionModel:s}=e;if(!i)return l("td",{class:Se("cell",{header:!0}),key:"thead-0"});if(!1===i.multiple)return l("th",{scope:"col",key:"thead-0-selection",class:Se("cell",{header:!0,selection:!0})},l("span",{class:"visually-hidden"},C("kol-table-selection")));const n=s.selectedKeys.filter((e=>!s.disabledKeys.has(String(e)))).length,a=n===we(t,s).length,r=0!==n&&!a;let c;c=C(0===n?"kol-table-selection-all":a&&!r?"kol-table-selection-none":"kol-table-selection-indeterminate");const{refInput:d,refTooltip:h}=e.getSelectionTooltipRefs("selection-all",c);return l("th",{scope:"col",key:"thead-0-selection",class:Se("cell",{header:!0,selection:!0})},l("span",{class:"visually-hidden"},C("kol-table-selection")),l("div",{class:Se("selection",{checked:a,indeterminate:r})},l("label",{class:Se("selection-label")},l(O,{class:Le,icons:"kolicon "+(r?"kolicon-minus":a?"kolicon-check":""),label:""}),l("input",{class:Se("selection-input",{checkbox:!0}),ref:d,name:"selection",checked:a&&!r,indeterminate:r,"aria-label":c,type:"checkbox",onInput:e=>{o(e,((e,t,o)=>{const l=t.selectedKeys.filter((e=>t.disabledKeys.has(String(e))));return o&&l.push(...we(e,t).map((e=>null==e?void 0:e[t.keyPropertyName]))),l})(t,s,!a))}})),l("div",{class:Ie},l(S,{label:c,badgeText:"",refFloating:h}))))})($),0===t&&(({headers:e})=>{const{horizontal:t,vertical:o}=e;if(0===t.length||0===o.length)return l(i,null);const s=o.reduce(((e,t)=>{var o,l;return e+(null!==(l=null===(o=null==t?void 0:t[0])||void 0===o?void 0:o.width)&&void 0!==l?l:0)}),0);return l("td",{"aria-hidden":"true",colSpan:o.length,rowSpan:t.length,style:s>0?{width:`${s}px`}:void 0})})($),Array.isArray(e)&&e.map(((e,o)=>Re($,e,t,o,!1)))))),qe($,"head",d.horizontal)]),l("tbody",{class:Ce},l("div",{class:Se("loader",{shown:v})},l(T,{label:C(v?"kol-table-data-loading":"kol-table-data-loaded").replace("{{caption}}",b(h)),show:v,variant:"cycle"})),L.map(((e,t)=>We($,e,t,!0)))),(e=>{const{dataFoot:t,headers:o,primaryHeaders:i,translateNoEntries:s}=e;if(0===t.length)return null;const n=me({data:t,dataFoot:t,headers:o,isFoot:!0,noEntriesLabel:s,primaryHeaders:i}),a=ue(o.horizontal,t),r=Object.assign(Object.assign({},e),{fixedOffsets:ve(i.cells,a,e.fixedCols,e.stickyColsDisabled),maxCols:a});return l("tfoot",{class:Oe},[qe(e,"foot",n),n.map(((e,t)=>We(r,e,t,!0,!0)))])})($))))},Ve=({dialog:e,card:t},o)=>l(P,Object.assign({},e),t?l(V,Object.assign({},t),o):o),Ge=_.forBlock("kol-table")("settings"),Je=_.forBlock("kol-table-settings"),Qe=Je(),Xe=Je("actions"),Ye=Je("columns"),Ze=Je("content"),et=Je("error-message"),tt=e=>Number.isFinite(e)&&void 0!==e&&e>0?e:void 0,ot=()=>{},lt=(e,t)=>{const o=C("kol-table-settings"),i=C("kol-table-settings-cancel"),s=C("kol-table-settings-apply"),n=C("kol-table-settings-error-all-invisible");let a,r=!1,c=!1;const d=()=>{r=!0,t()},h=y((()=>m(e)),(e=>e.syncListeners()),(e=>e.destroy())),u=((e,t)=>{const o=H(),l=H(),i=new L(v.stateLess),s=D("aria-description"),n=D("dialog-heading"),r={};let c,d=!0,h={};const u=e=>!a||A(a,e),p=()=>{var e,t;null===(t=null===(e=o.el)||void 0===e?void 0:e.close)||void 0===t||t.call(e)},m=e=>{var t;R(e),e.defaultPrevented||(null===(t=h.onCancel)||void 0===t||t.call(h,e),e.defaultPrevented||u(E.cancel)||e.preventDefault())},y=e=>{var t;e.target===o.el&&(K(r),null===(t=h.onClose)||void 0===t||t.call(h),u(E.close))},g=()=>{i.hideTooltip(),p(),u(E.close)};return{getFcProps:t=>{var a,r,u;let p="",v=0,j="blank",w="100%";k.apply(t.label,(e=>{p=e})),B.apply(null!==(a=t.level)&&void 0!==a?a:0,(e=>{v=e})),W.apply(t.on,(e=>{h=e})),f.apply(null!==(r=t.variant)&&void 0!==r?r:"blank",(e=>{j=e})),q.apply(null!==(u=t.width)&&void 0!==u?u:"100%",(e=>{w=e}));const S="card"===j;return S&&!c&&(c=U(e()),i.componentWillLoad({label:c.label,align:c.tooltipAlign})),{dialog:{handleCancel:m,handleClose:y,label:b(p),labelledBy:S?n:void 0,modal:d,refDialog:o,variant:j,width:w},card:S&&c?{ariaDescriptionId:s,closeButtonProps:c,handleClose:g,hasCloser:!0,headingId:n,label:p,level:v,refCloseButton:l,refTooltip:i.setTooltipElementRef}:void 0}},show:e=>{var l,i;const s=o.el;(null==s?void 0:s.open)||(d!==e&&(d=e,t()),e?(null===(l=null==s?void 0:s.showModal)||void 0===l||l.call(s),s&&N(r)):null===(i=null==s?void 0:s.show)||void 0===i||i.call(s))},close:p,syncListeners:()=>{l.el&&i.syncListeners(void 0,l.el,!0)},destroy:()=>{p(),K(r),i.destroy()}}})(e,d),p=D("alert-heading"),g=D("closer-description");let j,w=[],S=[],_=null;const O=()=>{var e;return null!==(e=S[S.length-1])&&void 0!==e?e:[]},$=e=>{S=S.map(((t,o,l)=>o===l.length-1?e:t)),d()},F=(e,t)=>{const o=[...O()],l=o.findIndex((t=>t.key===e));if(-1===l)return;let i;if("up"===t){if(0===l)return;i=l-1}else{if(l===o.length-1)return;i=l+1}const[s]=o.splice(l,1);o.splice(i,0,s),$(o)},T=e=>{if(e.preventDefault(),!O().some((e=>!1!==e.visible)))return _=n,void d();if(a){_=null,w=S.map((e=>e.map((e=>Object.assign({},e))))),d();const e=S.map((e=>e.map((e=>{const t=e,{hidable:o,resizable:l,sortable:i,visible:s,width:n}=t,a=I(t,["hidable","resizable","sortable","visible","width"]),r=Object.assign({},a);return void 0!==s&&(r.visible=s),void 0!==o&&(r.hidable=o),void 0!==i&&(r.sortable=i),void 0!==l&&(r.resizable=l),null!=n&&(r.width=n),r}))));A(a,E.changeHeaderCells,e),u.close()}},z=e=>{e&&(a=e)};return{beginRender:()=>{h.beginRender(),c=r,r=!1},render:e=>{var t;c||e===j||(j=e,w=(t=e).map((e=>[...e])),S=t.map((e=>e.map((e=>Object.assign({},e))))));const n=O();return l("div",{class:Ge,ref:z},l("div",{class:Qe},l(x,Object.assign({},h.get("toggle").getFcProps({_icons:"kolicon-settings",_label:o,_hideLabel:!0,_on:{onClick:()=>u.show(!0)}})))),l(Ve,Object.assign({},u.getFcProps({label:o,variant:"card",width:"fit-content"})),l("div",{class:Ze},_&&l("div",{class:et},l(M,{alert:!1,closerAriaDescriptionId:g,handleCloserClick:ot,hasCloser:!1,headingId:p,label:_,level:0,refCloserButton:ot,refCloserTooltip:ot,type:"error",variant:"msg"})),l("form",{onSubmit:T},l("div",{class:Ye},n.map(((e,t)=>((e,t,o)=>l("div",{key:e.key,class:"kol-table-settings__column"},l("kol-input-checkbox",{_checked:!1!==e.visible,_label:C(e.hidable?"kol-table-settings-column-hidable":"kol-table-settings-column-not-hidable",{placeholders:{column:e.label}}),_value:!0,_hideLabel:!0,_disabled:!1===e.hidable,_on:{onInput:(t,o)=>{var l;return((e,t)=>{const o=O().map((o=>o.key===e&&!1!==o.hidable?Object.assign(Object.assign({},o),{visible:Boolean(t)}):o));$(o)})(null!==(l=e.key)&&void 0!==l?l:"",o)}}}),l("span",{class:"kol-table-settings__column-label"},e.label),l("kol-input-number",{_hideLabel:!0,_value:tt(e.width),_label:C("kol-table-settings-column-width",{placeholders:{column:e.label}}),_min:1,_disabled:!1===e.resizable,_on:{onInput:(t,o)=>{var l;return((e,t)=>{const o=tt(Number(t)),l=O().map((t=>t.key===e&&!1!==t.resizable?Object.assign(Object.assign({},t),{width:o}):t));$(l)})(null!==(l=e.key)&&void 0!==l?l:"",o)}}}),l(x,Object.assign({},h.get(`move-up-${e.key}`).getFcProps({_icons:"kolicon-chevron-up",_label:C(!1===e.sortable||0===t?"kol-table-settings-not-move":"kol-table-settings-move-up",{placeholders:{column:e.label}}),_hideLabel:!0,_variant:"ghost",_on:{onClick:()=>{var t;return F(null!==(t=e.key)&&void 0!==t?t:"","up")}},_disabled:!1===e.sortable||0===t}))),l(x,Object.assign({},h.get(`move-down-${e.key}`).getFcProps({_icons:"kolicon-chevron-down",_label:C(!1===e.sortable||t===o.length-1?"kol-table-settings-not-move":"kol-table-settings-move-down",{placeholders:{column:e.label}}),_hideLabel:!0,_variant:"ghost",_on:{onClick:()=>{var t;return F(null!==(t=e.key)&&void 0!==t?t:"","down")}},_disabled:!1===e.sortable||t===o.length-1})))))(e,t,n)))),l("div",{class:Xe},l(x,Object.assign({},h.get("cancel").getFcProps({_label:i,_variant:"secondary",_on:{onClick:()=>(S=w.map((e=>[...e])),_=null,d(),void u.close())}}))),l(x,Object.assign({},h.get("apply").getFcProps({_label:s,_variant:"primary",_type:"submit"}))))))))},sync:()=>{h.endRender(),u.syncListeners()},destroy:()=>{h.destroy(),u.destroy()}}},it=class extends v{constructor(){super(...arguments),this.hasExternalTableLabelRefs=!1,this.cellRenderTimeouts=new Map,this.buttonItems=y((()=>m((()=>this.host))),(e=>e.syncListeners()),(e=>e.destroy())),this.settings=lt((()=>this.host),(()=>n(this))),this.linkItems=y((()=>g((()=>n(this)))),(e=>e.syncListeners()),(e=>e.destroy())),this.selectionTooltipItems=y((()=>(()=>{const e=new L(v.stateLess);let t;const o={refInput:e=>{t=e},refTooltip:e.setTooltipElementRef};return{getRefs:t=>(e.componentWillLoad({label:t}),o),syncListeners:()=>{t&&e.syncListeners(void 0,t,!0)},destroy:()=>{e.destroy()}}})()),(e=>e.syncListeners()),(e=>e.destroy())),this.propsConfig=re,this.handleResize=()=>{this.updateScrollbarState(),clearTimeout(this.resizeDebounceTimeout),this.resizeDebounceTimeout=setTimeout((()=>{this.updateStickyColsDisabled()}),150)},this.handleSelectionChange=(e,t)=>{this.emitSelectionChange(e,t)},this.handleSort=(e,t)=>{this.emitSort(e,t)},this.handleRenderCell=(e,t)=>{t&&(clearTimeout(this.cellRenderTimeouts.get(t)),this.cellRenderTimeouts.set(t,setTimeout((()=>{if(this.cellRenderTimeouts.delete(t),"function"==typeof e.render){const o=e.render(t,e,e.data,this.getRenderProp("data"));"string"==typeof o&&(t.textContent=o)}}))))},this.refScrollContainer=e=>{this.scrollContainerElement=e},this.refTable=e=>{this.tableElement=e,this.syncTableLabel(this.getState("externalLabelElements"))},this.getButtonFcProps=(e,t,o)=>this.buttonItems.get(e).getFcProps(t,o),this.renderSettings=e=>this.settings.render(e),this.getLinkFcProps=(e,t)=>this.linkItems.get(e).getFcProps(t),this.getSelectionTooltipRefs=(e,t)=>this.selectionTooltipItems.get(e).getRefs(t)}observeScrollContainer(){this.scrollContainerElement&&ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.scrollContainerElement)),this.updateStickyColsDisabled()}teardownTable(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),clearTimeout(this.resizeDebounceTimeout),this.cellRenderTimeouts.forEach((e=>clearTimeout(e))),this.cellRenderTimeouts.clear(),this.buttonItems.destroy(),this.linkItems.destroy(),this.selectionTooltipItems.destroy(),this.settings.destroy()}syncTableItems(){this.buttonItems.endRender(),this.linkItems.endRender(),this.selectionTooltipItems.endRender(),this.settings.sync()}applyData(e){oe.apply(e,(e=>{this.setRenderProp("data",e),this.setState("rowKeys",((e,t)=>new Map(e.map((e=>{var o;return[e,null!==(o=t.get(e))&&void 0!==o?o:z()]}))))(e,this.getState("rowKeys")))}))}applyDataFoot(e){le.apply(e,(e=>this.setRenderProp("dataFoot",e)))}applyFixedCols(e){X.apply(e,(e=>this.setRenderProp("fixedCols",e))),this.updateStickyColsDisabled()}applyHasSettingsMenu(e){Y.apply(e,(e=>this.setRenderProp("hasSettingsMenu",e)))}applyHeaders(e){se.apply(e,(e=>this.setRenderProp("headers",(e=>0===e.horizontal.length?e:Object.assign(Object.assign({},e),{horizontal:e.horizontal.map((e=>e.map((e=>Object.assign(Object.assign({},e),{visible:"boolean"!=typeof e.visible||e.visible,hidable:"boolean"!=typeof e.hidable||e.hidable})))))}))(e))),this.isRequired("headers"))}applyLabel(e){k.apply(e,(e=>this.setRenderProp("label",e)),this.isRequired("label"))}applyLoading(e){ne.apply(e,(e=>this.setRenderProp("loading",e)))}applyOn(e){Z.apply(e,(e=>this.setRenderProp("on",e)))}applySelection(e){ae.apply(e,(e=>this.setRenderProp("selection",e))),this.updateStickyColsDisabled()}applyVariant(e){j.apply(e,(e=>this.setRenderProp("variant",e)))}syncTableLabel(e){this.tableElement&&"ariaLabelledByElements"in this.tableElement&&((null==e?void 0:e.length)?(this.tableElement.ariaLabelledByElements=e,this.hasExternalTableLabelRefs=!0,s.debug([this.tableElement,e,this.tableElement.ariaLabelledByElements])):this.hasExternalTableLabelRefs&&(this.hasExternalTableLabelRefs=!1,this.tableElement.ariaLabelledByElements=null,this.tableElement.setAttribute("aria-labelledby",Be)))}moveCheckboxFocus(e){var t,o,l;if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;const i=Array.from(null!==(o=null===(t=this.scrollContainerElement)||void 0===t?void 0:t.querySelectorAll(".kol-table__selection-input--checkbox"))&&void 0!==o?o:[]),s=null===(l=this.scrollContainerElement)||void 0===l?void 0:l.querySelector(":focus");let n=i.indexOf(s);n>-1&&(e.preventDefault(),n=(n+("ArrowDown"===e.key?1:i.length-1))%i.length,i[n].focus())}applyChangedHeaderCells(e){const t=Object.assign(Object.assign({},this.getRenderProp("headers")),{horizontal:e.detail});this.setRenderProp("headers",t),this.setState("settingsChangedCounter",this.getState("settingsChangedCounter")+1);const o=this.getRenderProp("on")[G.onChangeHeaderCells];"function"==typeof o&&o(e,t)}updateScrollbarState(){if(this.scrollContainerElement){const{clientHeight:e,clientWidth:t,scrollHeight:o,scrollWidth:l}=this.scrollContainerElement;this.setState("hasScrollbar",l>t||o>e&&["auto","scroll"].includes(getComputedStyle(this.scrollContainerElement).overflowY))}}calculateFixedColsWidth(){var e,t,o,l,i,s;const[n,a]=this.getRenderProp("fixedCols"),r=this.getRenderProp("headers"),c=de(r).cells,d=ue(r.horizontal,this.getRenderProp("data"));let h=0;for(let o=0;o<n&&o<c.length;o++)h+=null!==(t=null===(e=c[o])||void 0===e?void 0:e.width)&&void 0!==t?t:0;for(let e=d-a;e<d&&e<c.length;e++)h+=null!==(l=null===(o=c[e])||void 0===o?void 0:o.width)&&void 0!==l?l:0;if(this.getRenderProp("selection")){const e=null===(i=this.scrollContainerElement)||void 0===i?void 0:i.querySelector(".kol-table__cell--selection");h+=null!==(s=null==e?void 0:e.offsetWidth)&&void 0!==s?s:0}return h}updateStickyColsDisabled(){if(!this.scrollContainerElement)return void this.setState("stickyColsDisabled",!1);const e=this.calculateFixedColsWidth();this.setState("stickyColsDisabled",e>0&&e>=this.scrollContainerElement.clientWidth)}emitSelectionChange(e,t){const o=this.getRenderProp("on")[G.onSelectionChange];"function"==typeof o&&o(e,t),this.host&&A(this.host,E.selectionChange,t)}emitSort(e,t){const o=this.getRenderProp("on")[G.onSort];"function"==typeof o&&t.key&&o(e,t),this.host&&A(this.host,E.sort,t)}renderTableStatelessFC(){return this.buttonItems.beginRender(),this.linkItems.beginRender(),this.selectionTooltipItems.beginRender(),this.settings.beginRender(),l(Ue,{data:this.getRenderProp("data"),dataFoot:this.getRenderProp("dataFoot"),externalLabelElements:this.getState("externalLabelElements"),fixedCols:this.getRenderProp("fixedCols"),getButtonFcProps:this.getButtonFcProps,getLinkFcProps:this.getLinkFcProps,getSelectionTooltipRefs:this.getSelectionTooltipRefs,renderSettings:this.renderSettings,handleRenderCell:this.handleRenderCell,handleSelectionChange:this.handleSelectionChange,handleSort:this.handleSort,hasScrollbar:this.getState("hasScrollbar"),hasSettingsMenu:this.getRenderProp("hasSettingsMenu"),headers:this.getRenderProp("headers"),label:this.getRenderProp("label"),loading:this.getRenderProp("loading"),on:this.getRenderProp("on"),refScrollContainer:this.refScrollContainer,refTable:this.refTable,rowKeys:this.getState("rowKeys"),selection:this.getRenderProp("selection"),settingsChangedCounter:this.getState("settingsChangedCounter"),stickyColsDisabled:this.getState("stickyColsDisabled"),variant:this.getRenderProp("variant")})}};export{it as B,le as a,oe as t,J as v}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{y as t,q as e}from"./bem-registry.js";import{t as n,a as i}from"./tooltip-open-tracking.js";import{j as o}from"./component3.js";import{c as r,b as s,d as l}from"./props-from-config.js";import{i as a}from"./id.js";import{l as c}from"./label-lang-segment.js";const u=o("align","top"),f=r("badgeText","",s),h=Math.min,d=Math.max,m=Math.round,p=Math.floor,y=t=>({x:t,y:t}),w={left:"right",right:"left",bottom:"top",top:"bottom"};function g(t,e,n){return d(t,h(e,n))}function x(t,e){return"function"==typeof t?t(e):t}function v(t){return t.split("-")[0]}function b(t){return t.split("-")[1]}function A(t){return"x"===t?"y":"x"}function T(t){return"y"===t?"height":"width"}function S(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function k(t){return A(S(t))}function R(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const O=["left","right"],F=["right","left"],E=["top","bottom"],j=["bottom","top"];function L(t){const e=v(t);return w[e]+t.slice(e.length)}function z(t){return"number"!=typeof t?function(t){var e,n,i,o;return{top:null!=(e=t.top)?e:0,right:null!=(n=t.right)?n:0,bottom:null!=(i=t.bottom)?i:0,left:null!=(o=t.left)?o:0}}(t):{top:t,right:t,bottom:t,left:t}}function C(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function P(t,e,n){let{reference:i,floating:o}=t;const r=S(e),s=k(e),l=T(s),a=v(e),c="y"===r,u=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;let d;switch(a){case"top":d={x:u,y:i.y-o.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-o.width,y:f};break;default:d={x:i.x,y:i.y}}const m=b(e);return m&&(d[s]+=h*("end"===m?1:-1)*(n&&c?-1:1)),d}async function D(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=x(e,t),m=z(d),p=l[h?"floating"===f?"reference":"floating":f],y=C(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(p)))||n?p:p.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),w="floating"===f?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,g=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),v=await(null==r.isElement?void 0:r.isElement(g))&&await(null==r.getScale?void 0:r.getScale(g))||{x:1,y:1},b=C(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:g,strategy:a}):w);return{top:(y.top-b.top+m.top)/v.y,bottom:(b.bottom-y.bottom+m.bottom)/v.y,left:(y.left-b.left+m.left)/v.x,right:(b.right-y.right+m.right)/v.x}}const M=new Set(["left","top"]);function $(){return"undefined"!=typeof window}function B(t){return I(t)?(t.nodeName||"").toLowerCase():"#document"}function q(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function H(t){var e;return null==(e=(I(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function I(t){return!!$()&&(t instanceof Node||t instanceof q(t).Node)}function N(t){return!!$()&&(t instanceof Element||t instanceof q(t).Element)}function V(t){return!!$()&&(t instanceof HTMLElement||t instanceof q(t).HTMLElement)}function _(t){return!(!$()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof q(t).ShadowRoot)}function W(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=et(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&"inline"!==o&&"contents"!==o}function X(t){return/^(table|td|th)$/.test(B(t))}function Y(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const G=/transform|translate|scale|rotate|perspective|filter/,J=/paint|layout|strict|content/,K=t=>!!t&&"none"!==t;let Q;function U(t){const e=N(t)?et(t):t;return K(e.transform)||K(e.translate)||K(e.scale)||K(e.rotate)||K(e.perspective)||!Z()&&(K(e.backdropFilter)||K(e.filter))||G.test(e.willChange||"")||J.test(e.contain||"")}function Z(){return null==Q&&(Q="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Q}function tt(t){return/^(html|body|#document)$/.test(B(t))}function et(t){return q(t).getComputedStyle(t)}function nt(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function it(t){if("html"===B(t))return t;const e=t.assignedSlot||t.parentNode||_(t)&&t.host||H(t);return _(e)?e.host:e}function ot(t){const e=it(t);return tt(e)?(t.ownerDocument||t).body:V(e)&&W(e)?e:ot(e)}function rt(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=ot(t),r=o===(null==(i=t.ownerDocument)?void 0:i.body),s=q(o);if(r){const t=st(s);return e.concat(s,s.visualViewport||[],W(o)?o:[],t&&n?rt(t):[])}return e.concat(o,rt(o,[],n))}function st(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function lt(t){const e=et(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=V(t),r=o?t.offsetWidth:n,s=o?t.offsetHeight:i,l=m(n)!==r||m(i)!==s;return l&&(n=r,i=s),{width:n,height:i,$:l}}function at(t){return N(t)?t:t.contextElement}function ct(t){const e=at(t);if(!V(e))return y(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=lt(e);let s=(r?m(n.width):n.width)/i,l=(r?m(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const ut=y(0);function ft(t){const e=q(t);return Z()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ut}function ht(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),r=at(t);let s=y(1);e&&(i?N(i)&&(s=ct(i)):s=ct(t));const l=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===q(t)}(r,n,i)?ft(r):y(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(r&&i){const t=q(r),e=N(i)?q(i):i;let n=t,o=st(n);for(;o&&e!==n;){const t=ct(o),e=o.getBoundingClientRect(),i=et(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;a*=t.x,c*=t.y,u*=t.x,f*=t.y,a+=r,c+=s,n=q(o),o=st(n)}}return C({width:u,height:f,x:a,y:c})}function dt(t,e){const n=nt(t).scrollLeft;return e?e.left+n:ht(H(t)).left+n}function mt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-dt(t,n),y:n.top+e.scrollTop}}function pt(t,e,n){let i;if("viewport"===e||"layoutViewport"===e)i=function(t,e,n){void 0===n&&(n="viewport");const i="layoutViewport"===n,o=q(t),r=H(t),s=o.visualViewport;let l=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){const t=!Z()||"fixed"===e;i?t||(c=-s.offsetLeft,u=-s.offsetTop):(l=s.width,a=s.height,t&&(c=s.offsetLeft,u=s.offsetTop))}if(dt(r)<=0){const t=r.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-e.clientWidth-i),s="stable both-edges"===getComputedStyle(r).scrollbarGutter?o/2:o;s<=25&&(l-=s)}return{width:l,height:a,x:c,y:u}}(t,n,e);else if("document"===e)i=function(t){const e=nt(t),n=t.ownerDocument.body,i=d(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=d(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+dt(t);const s=-e.scrollTop;return"rtl"===et(n).direction&&(r+=d(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:r,y:s}}(H(t));else if(N(e))i=function(t,e){const n=ht(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=ct(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:i*r.y}}(e,n);else{const n=ft(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return C(i)}function yt(t,e,n){const i=V(e),o=H(e),r="fixed"===n,s=ht(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=y(0);if((i||!r)&&(("body"!==B(e)||W(o))&&(l=nt(e)),i)){const t=ht(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}!i&&o&&(a.x=dt(o));const c=!o||i||r?y(0):mt(o,l);return{x:s.left+l.scrollLeft-a.x-c.x,y:s.top+l.scrollTop-a.y-c.y,width:s.width,height:s.height}}function wt(t){return"static"===et(t).position}function gt(t,e){if(!V(t)||"fixed"===et(t).position)return null;if(e)return e(t);let n=t.offsetParent;return H(t)===n&&(n=n.ownerDocument.body),n}function xt(t,e){const n=q(t);if(Y(t))return n;if(!V(t)){let e=it(t);for(;e&&!tt(e);){if(N(e)&&!wt(e))return e;e=it(e)}return n}let i=gt(t,e);for(;i&&X(i)&&wt(i);)i=gt(i,e);return i&&tt(i)&&wt(i)&&!U(i)?n:i||function(t){let e=it(t);for(;V(e)&&!tt(e);){if(U(e))return e;if(Y(e))return null;e=it(e)}return null}(t)||n}const vt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r="fixed"===o,s=H(i),l=!!e&&Y(e.floating);if(i===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=y(1);const u=y(0),f=V(i);if((f||!r)&&(("body"!==B(i)||W(s))&&(a=nt(i)),f)){const t=ht(i);c=ct(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}const h=!s||f||r?y(0):mt(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-a.scrollTop*c.y+u.y+h.y}},getDocumentElement:H,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[..."clippingAncestors"===n?Y(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter((t=>N(t)&&"body"!==B(t))),o=null;const r="fixed"===et(t).position;let s=r?it(t):t;for(;N(s)&&!tt(s);){const t=et(s),e=U(s),n=o?o.position:r?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?o=t:i=i.filter((t=>t!==s)),s=it(s)}return e.set(t,i),i}(e,this._c):[].concat(n),i],s=pt(e,r[0],o);let l=s.top,a=s.right,c=s.bottom,u=s.left;for(let t=1;t<r.length;t++){const n=pt(e,r[t],o);l=d(n.top,l),a=h(n.right,a),c=h(n.bottom,c),u=d(n.left,u)}return{width:a-u,height:c-l,x:u,y:l}},getOffsetParent:xt,getElementRects:async function(t){const e=this.getOffsetParent||xt,n=this.getDimensions,i=await n(t.floating);return{reference:yt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=lt(t);return{width:e,height:n}},getScale:ct,isElement:N,isRTL:function(t){return"rtl"===et(t).direction}};function bt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function At(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:a=!1}=i,c=at(t),u=o||r?[...c?rt(c):[],...e?rt(e):[]]:[];u.forEach((t=>{o&&t.addEventListener("scroll",n),r&&t.addEventListener("resize",n)}));const f=c&&l?function(t,e,n){let i,o=null;const r=H(t);function s(){var t;clearTimeout(i),null==(t=o)||t.disconnect(),o=null}function l(n,a){void 0===n&&(n=!1),void 0===a&&(a=1),s();const c=t.getBoundingClientRect(),{left:u,top:f,width:m,height:y}=c;if(n||e(),!m||!y)return;const w={rootMargin:-p(f)+"px "+-p(r.clientWidth-(u+m))+"px "+-p(r.clientHeight-(f+y))+"px "+-p(u)+"px",threshold:d(0,h(1,a))||1};let g=!0;function x(e){const n=e[0].intersectionRatio;if(!bt(c,t.getBoundingClientRect()))return l();if(n!==a){if(!g)return l();n?l(!1,n):i=setTimeout((()=>{l(!1,1e-7)}),1e3)}g=!1}try{o=new IntersectionObserver(x,{...w,root:r.ownerDocument})}catch(t){o=new IntersectionObserver(x,w)}o.observe(t)}const a=q(t),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),s()}}(c,n,r):null;let m,y=-1,w=null;s&&(w=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&w&&e&&(w.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{var t;null==(t=w)||t.observe(e)}))),n()})),c&&!a&&w.observe(c),e&&w.observe(e));let g=a?ht(t):null;return a&&function e(){const i=ht(t);g&&!bt(g,i)&&n(),g=i,m=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{o&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==f||f(),null==(t=w)||t.disconnect(),w=null,a&&cancelAnimationFrame(m)}}const Tt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=x(t,e),u={x:n,y:i},f=await r.detectOverflow(e,c),h=S(o),d=A(h);let m=u[d],p=u[h];const y=(t,e)=>g(e+f["y"===t?"top":"left"],e,e-f["y"===t?"bottom":"right"]);s&&(m=y(d,m)),l&&(p=y(h,p));const w=a.fn({...e,[d]:m,[h]:p});return{...w,data:{x:w.x-n,y:w.y-i,enabled:{[d]:s,[h]:l}}}}}},St=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=x(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const w=v(o),g=S(l),A=v(l)===l,z=await(null==a.isRTL?void 0:a.isRTL(c.floating)),C=h||(A||!p?[L(l)]:function(t){const e=L(t);return[R(t),e,R(e)]}(l)),P="none"!==m;!h&&P&&C.push(...function(t,e,n,i){const o=b(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?F:O:e?O:F;case"left":case"right":return e?E:j;default:return[]}}(v(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(R)))),r}(l,p,m,z));const D=[l,...C],M=await a.detectOverflow(e,y),$=[];let B=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&$.push(M[w]),f){const t=function(t,e,n){void 0===n&&(n=!1);const i=b(t),o=k(t),r=T(o);let s="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=L(s)),[s,L(s)]}(o,s,z);$.push(M[t[0]],M[t[1]])}if(B=[...B,{placement:o,overflows:$}],!$.every((t=>t<=0))){var q,H;const t=((null==(q=r.flip)?void 0:q.index)||0)+1,e=D[t];if(e&&("alignment"!==f||g===S(e)||B.every((t=>S(t.placement)!==g||t.overflows[0]>0))))return{data:{index:t,overflows:B},reset:{placement:e}};let n=null==(H=B.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:H.placement;if(!n)switch(d){case"bestFit":{var I;const t=null==(I=B.filter((t=>{if(P){const e=S(t.placement);return e===g||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:I[0];t&&(n=t);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},kt=async({floatingElement:e,referenceElement:n,arrowElement:i,align:o="top"})=>{var r,s,l;if(!t()){const t=[(l=(null==i?void 0:i.offsetHeight)||10,void 0===l&&(l=0),{name:"offset",options:l,async fn(t){var e,n;const{x:i,y:o,placement:r,middlewareData:s}=t,a=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=v(n),l=b(n),a="y"===S(n),c=M.has(s)?-1:1,u=r&&a?-1:1,f=x(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof m&&(d="end"===l?-1*m:m),a?{x:d*u,y:h*c}:{x:h*c,y:d*u}}(t,l);return r===(null==(e=s.offset)?void 0:e.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:r}}}}),St(),Tt()];i&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:r,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:u=0}=x(t,e)||{};if(null==c)return{};const f=z(u),d={x:n,y:i},m=k(o),p=T(m),y=await s.getDimensions(c),w="y"===m,v=w?"top":"left",A=w?"bottom":"right",S=w?"clientHeight":"clientWidth",R=r.reference[p]+r.reference[m]-d[m]-r.floating[p],O=d[m]-r.reference[m],F=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=F?F[S]:0;E&&await(null==s.isElement?void 0:s.isElement(F))||(E=l.floating[S]||r.floating[p]);const j=R/2-O/2,L=E/2-y[p]/2-1,C=h(f[v],L),P=h(f[A],L),D=E-y[p]-P,M=E/2-y[p]/2+j,$=g(C,M,D),B=!a.arrow&&null!=b(o)&&M!==$&&r.reference[p]/2-(M<C?C:P)-y[p]/2<0,q=B?M<C?M-C:M-D:0;return{[m]:d[m]+q,data:{[m]:$,centerOffset:M-$-q,...B&&{alignmentOffset:q}},reset:B}}}))({element:i}));const{x:a,y:c,middlewareData:u,placement:f}=await((t,e,n)=>{const i=new Map,o=null!=n?n:{},r={...vt,...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:D},a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:f}=P(c,i,a),h=i,d=0;const m={};for(let n=0;n<r.length;n++){const p=r[n];if(!p)continue;const{name:y,fn:w}=p,{x:g,y:x,data:v,reset:b}=await w({x:u,y:f,initialPlacement:i,placement:h,strategy:o,middlewareData:m,rects:c,platform:l,elements:{reference:t,floating:e}});u=null!=g?g:u,f=null!=x?x:f,m[y]={...m[y],...v},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):b.rects),({x:u,y:f}=P(c,h,a))),n=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:m}})(t,e,{...o,platform:r})})(n,e,{placement:o,middleware:t,strategy:"fixed"});Object.assign(e.style,{left:`${a}px`,top:`${c}px`,visibility:"visible"}),i&&((null===(r=u.arrow)||void 0===r?void 0:r.x)?Object.assign(i.style,{left:`${u.arrow.x}px`,top:"bottom"===f?-i.offsetHeight/2+"px":"",bottom:"top"===f?-i.offsetHeight/2+"px":""}):(null===(s=u.arrow)||void 0===s?void 0:s.y)&&Object.assign(i.style,{left:"right"===f?-i.offsetWidth/2+"px":"",right:"left"===f?-i.offsetWidth/2+"px":"",top:`${u.arrow.y}px`}))}},Rt=new Set;let Ot=null;class Ft{constructor(t,e){this.setState=t.setState,this.getState=t.getState,this.renderProps=l(e)}setRenderProp(t,e){this.renderProps[t]=e}getRenderProp(t){return this.renderProps[t]}}const Et={required:[c],optional:[u,f,a]};class jt extends Ft{constructor(t){super(t,Et),this.hasFocusIn=!1,this.hasMouseIn=!1,this.isHiddenForCurrentVisit=!1,this.setTooltipElementRef=t=>{this.tooltipElement=t,this.tooltipElement&&this.addListeners(this.tooltipElement)},this.hideTooltipByEscape=t=>{"Escape"===t.key&&(t.stopPropagation(),t.preventDefault(),this.hideTooltip())},this.handleMouseEnter=()=>{const t=this.isNewVisit();this.hasMouseIn=!0,t&&(this.isHiddenForCurrentVisit=!1),this.showOrHideTooltip()},this.handleMouseLeave=()=>{this.hasMouseIn=!1,this.resetHideFlag(),this.showOrHideTooltip()},this.handleFocusIn=()=>{const t=this.isNewVisit();this.hasFocusIn=!0,t&&(this.isHiddenForCurrentVisit=!1),this.showOrHideTooltip()},this.handleFocusOut=()=>{this.hasFocusIn=!1,this.resetHideFlag(),this.showOrHideTooltip()}}componentWillLoad(t){this.watchLabel(t.label),this.watchAlign(t.align),this.watchBadgeText(t.badgeText),this.watchId(t.id)}watchLabel(t){c.apply(t||void 0,(t=>{this.setRenderProp("label",t)}))}watchAlign(t){u.apply(t,(t=>{this.setRenderProp("align",t)}))}watchBadgeText(t){f.apply(t,(t=>{this.setRenderProp("badgeText",t)}))}watchId(t){a.apply(t,(t=>{this.setRenderProp("id",t)}))}initContext(t){this.previousSibling=t}syncListeners(t,e,n=!1){t&&this.removeListeners(t),e&&(n&&(this.previousSibling=e),this.removeListeners(e),this.addListeners(e))}handleEventListeners(t){this.syncListeners(this.previousSibling,t.previousElementSibling,!0)}hideTooltip(){this.isHiddenForCurrentVisit=!0,this.tooltipElement&&(function(t){if(Rt.delete(t)&&Ot===t){Ot=null;for(const t of Rt)Ot=t;Ot&&Ot.style.setProperty("z-index","1000")}}(this.tooltipElement),n(),this.tooltipElement.classList.remove("show"),this.tooltipElement.classList.add("hide"),this.tooltipElement.addEventListener("animationend",(()=>{var t;(null===(t=this.tooltipElement)||void 0===t?void 0:t.classList.contains("hide"))&&this.tooltipElement.style.removeProperty("display")}),{once:!0}),this.cleanupAutoPositioning&&(this.cleanupAutoPositioning(),this.cleanupAutoPositioning=void 0)),e().removeEventListener("keydown",this.hideTooltipByEscape)}destroy(){clearTimeout(this.overFocusTimeout),this.previousSibling&&(this.removeListeners(this.previousSibling),this.previousSibling=void 0),this.tooltipElement&&this.removeListeners(this.tooltipElement),this.cleanupAutoPositioning&&(this.cleanupAutoPositioning(),this.cleanupAutoPositioning=void 0),e().removeEventListener("keydown",this.hideTooltipByEscape)}isNewVisit(){return!this.hasMouseIn&&!this.hasFocusIn}resetHideFlag(){this.isNewVisit()&&(this.isHiddenForCurrentVisit=!1)}async alignTooltip(){this.tooltipElement&&this.previousSibling&&await kt({align:this.getRenderProp("align"),arrowElement:this.tooltipElement.querySelector(".kol-tooltip__arrow"),floatingElement:this.tooltipElement,referenceElement:this.previousSibling})}showTooltip(){var t;!this.isHiddenForCurrentVisit&&this.previousSibling&&this.tooltipElement&&(Ot!==(t=this.tooltipElement)&&(Ot&&Ot.style.setProperty("z-index","999"),Rt.delete(t),Rt.add(t),t.style.setProperty("z-index","1000"),Ot=t),i(),this.tooltipElement.classList.remove("hide"),this.tooltipElement.classList.add("show"),this.tooltipElement.style.setProperty("display","block"),e().addEventListener("keydown",this.hideTooltipByEscape),this.cleanupAutoPositioning=At(this.previousSibling,this.tooltipElement,(()=>{this.alignTooltip()})))}showOrHideTooltip(){clearTimeout(this.overFocusTimeout),this.overFocusTimeout=setTimeout((()=>{this.hasMouseIn||this.hasFocusIn?this.showTooltip():this.hideTooltip()}),300)}addListeners(t){t.addEventListener("mouseover",this.handleMouseEnter),t.addEventListener("mouseout",this.handleMouseLeave),t.addEventListener("focusin",this.handleFocusIn),t.addEventListener("focusout",this.handleFocusOut)}removeListeners(t){t.removeEventListener("mouseover",this.handleMouseEnter),t.removeEventListener("mouseout",this.handleMouseLeave),t.removeEventListener("focusin",this.handleFocusIn),t.removeEventListener("focusout",this.handleFocusOut)}}export{Ft as B,jt as T,u as a,kt as b,At as c}
|
|
4
|
+
import{O as t,I as e}from"./prop.validators.js";import{t as n,a as i}from"./tooltip-open-tracking.js";import{f as o}from"./component6.js";import{c as r,d as s,e as l}from"./base-web-component.js";import{i as a}from"./id.js";import{l as c}from"./label-lang-segment.js";const u=o("align","top"),f=r("badgeText","",s),h=Math.min,d=Math.max,m=Math.round,p=Math.floor,y=t=>({x:t,y:t}),w={left:"right",right:"left",bottom:"top",top:"bottom"};function g(t,e,n){return d(t,h(e,n))}function x(t,e){return"function"==typeof t?t(e):t}function v(t){return t.split("-")[0]}function b(t){return t.split("-")[1]}function A(t){return"x"===t?"y":"x"}function T(t){return"y"===t?"height":"width"}function S(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function k(t){return A(S(t))}function O(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const R=["left","right"],F=["right","left"],E=["top","bottom"],L=["bottom","top"];function j(t){const e=v(t);return w[e]+t.slice(e.length)}function z(t){return"number"!=typeof t?function(t){var e,n,i,o;return{top:null!=(e=t.top)?e:0,right:null!=(n=t.right)?n:0,bottom:null!=(i=t.bottom)?i:0,left:null!=(o=t.left)?o:0}}(t):{top:t,right:t,bottom:t,left:t}}function C(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function P(t,e,n){let{reference:i,floating:o}=t;const r=S(e),s=k(e),l=T(s),a=v(e),c="y"===r,u=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;let d;switch(a){case"top":d={x:u,y:i.y-o.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-o.width,y:f};break;default:d={x:i.x,y:i.y}}const m=b(e);return m&&(d[s]+=h*("end"===m?1:-1)*(n&&c?-1:1)),d}async function D(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=x(e,t),m=z(d),p=l[h?"floating"===f?"reference":"floating":f],y=C(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(p)))||n?p:p.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),w="floating"===f?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,g=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),v=await(null==r.isElement?void 0:r.isElement(g))&&await(null==r.getScale?void 0:r.getScale(g))||{x:1,y:1},b=C(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:g,strategy:a}):w);return{top:(y.top-b.top+m.top)/v.y,bottom:(b.bottom-y.bottom+m.bottom)/v.y,left:(y.left-b.left+m.left)/v.x,right:(b.right-y.right+m.right)/v.x}}const M=new Set(["left","top"]);function $(){return"undefined"!=typeof window}function B(t){return N(t)?(t.nodeName||"").toLowerCase():"#document"}function I(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function H(t){var e;return null==(e=(N(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function N(t){return!!$()&&(t instanceof Node||t instanceof I(t).Node)}function V(t){return!!$()&&(t instanceof Element||t instanceof I(t).Element)}function q(t){return!!$()&&(t instanceof HTMLElement||t instanceof I(t).HTMLElement)}function _(t){return!(!$()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof I(t).ShadowRoot)}function W(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=et(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&"inline"!==o&&"contents"!==o}function X(t){return/^(table|td|th)$/.test(B(t))}function Y(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const G=/transform|translate|scale|rotate|perspective|filter/,J=/paint|layout|strict|content/,K=t=>!!t&&"none"!==t;let Q;function U(t){const e=V(t)?et(t):t;return K(e.transform)||K(e.translate)||K(e.scale)||K(e.rotate)||K(e.perspective)||!Z()&&(K(e.backdropFilter)||K(e.filter))||G.test(e.willChange||"")||J.test(e.contain||"")}function Z(){return null==Q&&(Q="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Q}function tt(t){return/^(html|body|#document)$/.test(B(t))}function et(t){return I(t).getComputedStyle(t)}function nt(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function it(t){if("html"===B(t))return t;const e=t.assignedSlot||t.parentNode||_(t)&&t.host||H(t);return _(e)?e.host:e}function ot(t){const e=it(t);return tt(e)?(t.ownerDocument||t).body:q(e)&&W(e)?e:ot(e)}function rt(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=ot(t),r=o===(null==(i=t.ownerDocument)?void 0:i.body),s=I(o);if(r){const t=st(s);return e.concat(s,s.visualViewport||[],W(o)?o:[],t&&n?rt(t):[])}return e.concat(o,rt(o,[],n))}function st(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function lt(t){const e=et(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=q(t),r=o?t.offsetWidth:n,s=o?t.offsetHeight:i,l=m(n)!==r||m(i)!==s;return l&&(n=r,i=s),{width:n,height:i,$:l}}function at(t){return V(t)?t:t.contextElement}function ct(t){const e=at(t);if(!q(e))return y(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=lt(e);let s=(r?m(n.width):n.width)/i,l=(r?m(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const ut=y(0);function ft(t){const e=I(t);return Z()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ut}function ht(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),r=at(t);let s=y(1);e&&(i?V(i)&&(s=ct(i)):s=ct(t));const l=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===I(t)}(r,n,i)?ft(r):y(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(r&&i){const t=I(r),e=V(i)?I(i):i;let n=t,o=st(n);for(;o&&e!==n;){const t=ct(o),e=o.getBoundingClientRect(),i=et(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;a*=t.x,c*=t.y,u*=t.x,f*=t.y,a+=r,c+=s,n=I(o),o=st(n)}}return C({width:u,height:f,x:a,y:c})}function dt(t,e){const n=nt(t).scrollLeft;return e?e.left+n:ht(H(t)).left+n}function mt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-dt(t,n),y:n.top+e.scrollTop}}function pt(t,e,n){let i;if("viewport"===e||"layoutViewport"===e)i=function(t,e,n){void 0===n&&(n="viewport");const i="layoutViewport"===n,o=I(t),r=H(t),s=o.visualViewport;let l=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){const t=!Z()||"fixed"===e;i?t||(c=-s.offsetLeft,u=-s.offsetTop):(l=s.width,a=s.height,t&&(c=s.offsetLeft,u=s.offsetTop))}if(dt(r)<=0){const t=r.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-e.clientWidth-i),s="stable both-edges"===getComputedStyle(r).scrollbarGutter?o/2:o;s<=25&&(l-=s)}return{width:l,height:a,x:c,y:u}}(t,n,e);else if("document"===e)i=function(t){const e=nt(t),n=t.ownerDocument.body,i=d(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=d(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+dt(t);const s=-e.scrollTop;return"rtl"===et(n).direction&&(r+=d(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:r,y:s}}(H(t));else if(V(e))i=function(t,e){const n=ht(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=ct(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:i*r.y}}(e,n);else{const n=ft(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return C(i)}function yt(t,e,n){const i=q(e),o=H(e),r="fixed"===n,s=ht(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=y(0);if((i||!r)&&(("body"!==B(e)||W(o))&&(l=nt(e)),i)){const t=ht(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}!i&&o&&(a.x=dt(o));const c=!o||i||r?y(0):mt(o,l);return{x:s.left+l.scrollLeft-a.x-c.x,y:s.top+l.scrollTop-a.y-c.y,width:s.width,height:s.height}}function wt(t){return"static"===et(t).position}function gt(t,e){if(!q(t)||"fixed"===et(t).position)return null;if(e)return e(t);let n=t.offsetParent;return H(t)===n&&(n=n.ownerDocument.body),n}function xt(t,e){const n=I(t);if(Y(t))return n;if(!q(t)){let e=it(t);for(;e&&!tt(e);){if(V(e)&&!wt(e))return e;e=it(e)}return n}let i=gt(t,e);for(;i&&X(i)&&wt(i);)i=gt(i,e);return i&&tt(i)&&wt(i)&&!U(i)?n:i||function(t){let e=it(t);for(;q(e)&&!tt(e);){if(U(e))return e;if(Y(e))return null;e=it(e)}return null}(t)||n}const vt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r="fixed"===o,s=H(i),l=!!e&&Y(e.floating);if(i===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=y(1);const u=y(0),f=q(i);if((f||!r)&&(("body"!==B(i)||W(s))&&(a=nt(i)),f)){const t=ht(i);c=ct(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}const h=!s||f||r?y(0):mt(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-a.scrollTop*c.y+u.y+h.y}},getDocumentElement:H,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[..."clippingAncestors"===n?Y(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter((t=>V(t)&&"body"!==B(t))),o=null;const r="fixed"===et(t).position;let s=r?it(t):t;for(;V(s)&&!tt(s);){const t=et(s),e=U(s),n=o?o.position:r?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?o=t:i=i.filter((t=>t!==s)),s=it(s)}return e.set(t,i),i}(e,this._c):[].concat(n),i],s=pt(e,r[0],o);let l=s.top,a=s.right,c=s.bottom,u=s.left;for(let t=1;t<r.length;t++){const n=pt(e,r[t],o);l=d(n.top,l),a=h(n.right,a),c=h(n.bottom,c),u=d(n.left,u)}return{width:a-u,height:c-l,x:u,y:l}},getOffsetParent:xt,getElementRects:async function(t){const e=this.getOffsetParent||xt,n=this.getDimensions,i=await n(t.floating);return{reference:yt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=lt(t);return{width:e,height:n}},getScale:ct,isElement:V,isRTL:function(t){return"rtl"===et(t).direction}};function bt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function At(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:a=!1}=i,c=at(t),u=o||r?[...c?rt(c):[],...e?rt(e):[]]:[];u.forEach((t=>{o&&t.addEventListener("scroll",n),r&&t.addEventListener("resize",n)}));const f=c&&l?function(t,e,n){let i,o=null;const r=H(t);function s(){var t;clearTimeout(i),null==(t=o)||t.disconnect(),o=null}function l(n,a){void 0===n&&(n=!1),void 0===a&&(a=1),s();const c=t.getBoundingClientRect(),{left:u,top:f,width:m,height:y}=c;if(n||e(),!m||!y)return;const w={rootMargin:-p(f)+"px "+-p(r.clientWidth-(u+m))+"px "+-p(r.clientHeight-(f+y))+"px "+-p(u)+"px",threshold:d(0,h(1,a))||1};let g=!0;function x(e){const n=e[0].intersectionRatio;if(!bt(c,t.getBoundingClientRect()))return l();if(n!==a){if(!g)return l();n?l(!1,n):i=setTimeout((()=>{l(!1,1e-7)}),1e3)}g=!1}try{o=new IntersectionObserver(x,{...w,root:r.ownerDocument})}catch(t){o=new IntersectionObserver(x,w)}o.observe(t)}const a=I(t),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),s()}}(c,n,r):null;let m,y=-1,w=null;s&&(w=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&w&&e&&(w.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{var t;null==(t=w)||t.observe(e)}))),n()})),c&&!a&&w.observe(c),e&&w.observe(e));let g=a?ht(t):null;return a&&function e(){const i=ht(t);g&&!bt(g,i)&&n(),g=i,m=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{o&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==f||f(),null==(t=w)||t.disconnect(),w=null,a&&cancelAnimationFrame(m)}}const Tt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=x(t,e),u={x:n,y:i},f=await r.detectOverflow(e,c),h=S(o),d=A(h);let m=u[d],p=u[h];const y=(t,e)=>g(e+f["y"===t?"top":"left"],e,e-f["y"===t?"bottom":"right"]);s&&(m=y(d,m)),l&&(p=y(h,p));const w=a.fn({...e,[d]:m,[h]:p});return{...w,data:{x:w.x-n,y:w.y-i,enabled:{[d]:s,[h]:l}}}}}},St=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=x(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const w=v(o),g=S(l),A=v(l)===l,z=await(null==a.isRTL?void 0:a.isRTL(c.floating)),C=h||(A||!p?[j(l)]:function(t){const e=j(t);return[O(t),e,O(e)]}(l)),P="none"!==m;!h&&P&&C.push(...function(t,e,n,i){const o=b(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?F:R:e?R:F;case"left":case"right":return e?E:L;default:return[]}}(v(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(O)))),r}(l,p,m,z));const D=[l,...C],M=await a.detectOverflow(e,y),$=[];let B=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&$.push(M[w]),f){const t=function(t,e,n){void 0===n&&(n=!1);const i=b(t),o=k(t),r=T(o);let s="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=j(s)),[s,j(s)]}(o,s,z);$.push(M[t[0]],M[t[1]])}if(B=[...B,{placement:o,overflows:$}],!$.every((t=>t<=0))){var I,H;const t=((null==(I=r.flip)?void 0:I.index)||0)+1,e=D[t];if(e&&("alignment"!==f||g===S(e)||B.every((t=>S(t.placement)!==g||t.overflows[0]>0))))return{data:{index:t,overflows:B},reset:{placement:e}};let n=null==(H=B.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:H.placement;if(!n)switch(d){case"bestFit":{var N;const t=null==(N=B.filter((t=>{if(P){const e=S(t.placement);return e===g||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:N[0];t&&(n=t);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},kt=async({floatingElement:e,referenceElement:n,arrowElement:i,align:o="top"})=>{var r,s,l;if(!t()){const t=[(l=(null==i?void 0:i.offsetHeight)||10,void 0===l&&(l=0),{name:"offset",options:l,async fn(t){var e,n;const{x:i,y:o,placement:r,middlewareData:s}=t,a=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=v(n),l=b(n),a="y"===S(n),c=M.has(s)?-1:1,u=r&&a?-1:1,f=x(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof m&&(d="end"===l?-1*m:m),a?{x:d*u,y:h*c}:{x:h*c,y:d*u}}(t,l);return r===(null==(e=s.offset)?void 0:e.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:r}}}}),St(),Tt()];i&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:r,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:u=0}=x(t,e)||{};if(null==c)return{};const f=z(u),d={x:n,y:i},m=k(o),p=T(m),y=await s.getDimensions(c),w="y"===m,v=w?"top":"left",A=w?"bottom":"right",S=w?"clientHeight":"clientWidth",O=r.reference[p]+r.reference[m]-d[m]-r.floating[p],R=d[m]-r.reference[m],F=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=F?F[S]:0;E&&await(null==s.isElement?void 0:s.isElement(F))||(E=l.floating[S]||r.floating[p]);const L=O/2-R/2,j=E/2-y[p]/2-1,C=h(f[v],j),P=h(f[A],j),D=E-y[p]-P,M=E/2-y[p]/2+L,$=g(C,M,D),B=!a.arrow&&null!=b(o)&&M!==$&&r.reference[p]/2-(M<C?C:P)-y[p]/2<0,I=B?M<C?M-C:M-D:0;return{[m]:d[m]+I,data:{[m]:$,centerOffset:M-$-I,...B&&{alignmentOffset:I}},reset:B}}}))({element:i}));const{x:a,y:c,middlewareData:u,placement:f}=await((t,e,n)=>{const i=new Map,o=null!=n?n:{},r={...vt,...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:D},a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:f}=P(c,i,a),h=i,d=0;const m={};for(let n=0;n<r.length;n++){const p=r[n];if(!p)continue;const{name:y,fn:w}=p,{x:g,y:x,data:v,reset:b}=await w({x:u,y:f,initialPlacement:i,placement:h,strategy:o,middlewareData:m,rects:c,platform:l,elements:{reference:t,floating:e}});u=null!=g?g:u,f=null!=x?x:f,m[y]={...m[y],...v},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):b.rects),({x:u,y:f}=P(c,h,a))),n=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:m}})(t,e,{...o,platform:r})})(n,e,{placement:o,middleware:t,strategy:"fixed"});Object.assign(e.style,{left:`${a}px`,top:`${c}px`,visibility:"visible"}),i&&((null===(r=u.arrow)||void 0===r?void 0:r.x)?Object.assign(i.style,{left:`${u.arrow.x}px`,top:"bottom"===f?-i.offsetHeight/2+"px":"",bottom:"top"===f?-i.offsetHeight/2+"px":""}):(null===(s=u.arrow)||void 0===s?void 0:s.y)&&Object.assign(i.style,{left:"right"===f?-i.offsetWidth/2+"px":"",right:"left"===f?-i.offsetWidth/2+"px":"",top:`${u.arrow.y}px`}))}},Ot=new Set;let Rt=null;class Ft{constructor(t,e){this.setState=t.setState,this.getState=t.getState,this.renderProps=l(e)}setRenderProp(t,e){this.renderProps[t]=e}getRenderProp(t){return this.renderProps[t]}}const Et={required:[c],optional:[u,f,a]};class Lt extends Ft{constructor(t){super(t,Et),this.hasFocusIn=!1,this.hasMouseIn=!1,this.isHiddenForCurrentVisit=!1,this.setTooltipElementRef=t=>{this.tooltipElement=t,this.tooltipElement&&this.addListeners(this.tooltipElement)},this.hideTooltipByEscape=t=>{"Escape"===t.key&&(t.stopPropagation(),t.preventDefault(),this.hideTooltip())},this.handleMouseEnter=()=>{const t=this.isNewVisit();this.hasMouseIn=!0,t&&(this.isHiddenForCurrentVisit=!1),this.showOrHideTooltip()},this.handleMouseLeave=()=>{this.hasMouseIn=!1,this.resetHideFlag(),this.showOrHideTooltip()},this.handleFocusIn=()=>{const t=this.isNewVisit();this.hasFocusIn=!0,t&&(this.isHiddenForCurrentVisit=!1),this.showOrHideTooltip()},this.handleFocusOut=()=>{this.hasFocusIn=!1,this.resetHideFlag(),this.showOrHideTooltip()}}componentWillLoad(t){this.watchLabel(t.label),this.watchAlign(t.align),this.watchBadgeText(t.badgeText),this.watchId(t.id)}watchLabel(t){c.apply(t||void 0,(t=>{this.setRenderProp("label",t)}))}watchAlign(t){u.apply(t,(t=>{this.setRenderProp("align",t)}))}watchBadgeText(t){f.apply(t,(t=>{this.setRenderProp("badgeText",t)}))}watchId(t){a.apply(t,(t=>{this.setRenderProp("id",t)}))}initContext(t){this.previousSibling=t}syncListeners(t,e,n=!1){t&&this.removeListeners(t),e&&(n&&(this.previousSibling=e),this.removeListeners(e),this.addListeners(e))}handleEventListeners(t){this.syncListeners(this.previousSibling,t.previousElementSibling,!0)}hideTooltip(){this.isHiddenForCurrentVisit=!0,this.tooltipElement&&(function(t){if(Ot.delete(t)&&Rt===t){Rt=null;for(const t of Ot)Rt=t;Rt&&Rt.style.setProperty("z-index","1000")}}(this.tooltipElement),n(),this.tooltipElement.classList.remove("show"),this.tooltipElement.classList.add("hide"),this.tooltipElement.addEventListener("animationend",(()=>{var t;(null===(t=this.tooltipElement)||void 0===t?void 0:t.classList.contains("hide"))&&this.tooltipElement.style.removeProperty("display")}),{once:!0}),this.cleanupAutoPositioning&&(this.cleanupAutoPositioning(),this.cleanupAutoPositioning=void 0)),e().removeEventListener("keydown",this.hideTooltipByEscape)}destroy(){clearTimeout(this.overFocusTimeout),this.previousSibling&&(this.removeListeners(this.previousSibling),this.previousSibling=void 0),this.tooltipElement&&this.removeListeners(this.tooltipElement),this.cleanupAutoPositioning&&(this.cleanupAutoPositioning(),this.cleanupAutoPositioning=void 0),e().removeEventListener("keydown",this.hideTooltipByEscape)}isNewVisit(){return!this.hasMouseIn&&!this.hasFocusIn}resetHideFlag(){this.isNewVisit()&&(this.isHiddenForCurrentVisit=!1)}async alignTooltip(){this.tooltipElement&&this.previousSibling&&await kt({align:this.getRenderProp("align"),arrowElement:this.tooltipElement.querySelector(".kol-tooltip__arrow"),floatingElement:this.tooltipElement,referenceElement:this.previousSibling})}showTooltip(){var t;!this.isHiddenForCurrentVisit&&this.previousSibling&&this.tooltipElement&&(Rt!==(t=this.tooltipElement)&&(Rt&&Rt.style.setProperty("z-index","999"),Ot.delete(t),Ot.add(t),t.style.setProperty("z-index","1000"),Rt=t),i(),this.tooltipElement.classList.remove("hide"),this.tooltipElement.classList.add("show"),this.tooltipElement.style.setProperty("display","block"),e().addEventListener("keydown",this.hideTooltipByEscape),this.cleanupAutoPositioning=At(this.previousSibling,this.tooltipElement,(()=>{this.alignTooltip()})))}showOrHideTooltip(){clearTimeout(this.overFocusTimeout),this.overFocusTimeout=setTimeout((()=>{this.hasMouseIn||this.hasFocusIn?this.showTooltip():this.hideTooltip()}),300)}addListeners(t){t.addEventListener("mouseover",this.handleMouseEnter),t.addEventListener("mouseout",this.handleMouseLeave),t.addEventListener("focusin",this.handleFocusIn),t.addEventListener("focusout",this.handleFocusOut)}removeListeners(t){t.removeEventListener("mouseover",this.handleMouseEnter),t.removeEventListener("mouseout",this.handleMouseLeave),t.removeEventListener("focusin",this.handleFocusIn),t.removeEventListener("focusout",this.handleFocusOut)}}export{Ft as B,Lt as T,u as a,kt as b,At as c}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{a as t}from"./dev.utils.js";import
|
|
4
|
+
import"./prop.validators.js";import{a as t}from"./dev.utils.js";import{c as e,n as r,m as i,d as a,j as h}from"./base-web-component.js";import{B as n}from"./behavior.js";import{t as o}from"./i18n.js";const s=e("hasCounter",!1,r),c=e("maxLength",void 0,i,(t=>t>=0)),m=["hard","soft"],u=e("maxLengthBehavior","hard",(function(t){const e=a(t);if(h(e,m))return e;throw new Error(`Invalid max length behavior: ${e}`)})),l={optional:[s,u,c]},g=(t,e,r)=>{if("number"!=typeof e)return o("kol-character-counter-current",{placeholders:{current:String(r)}});if("soft"===t){const t=e-r;return t<0?o("kol-character-limit-exceeded",{placeholders:{over:String(Math.abs(t))}}):o("kol-character-limit-remaining",{placeholders:{remaining:String(t)}})}return o("kol-character-counter-current-of-max-aria",{placeholders:{current:String(r),max:String(e)}})},x=(t,e,r)=>"hard"===t&&"number"==typeof e&&r>=e?o("kol-character-counter-max-aria"):"";class d extends n{constructor(t){super(t,l),this.reannounceToggle=!1,this.setVisualRef=t=>{this.visualSpan=t},this.setAriaRef=t=>{this.ariaSpan=t},this.handleKeyDown=(t,e)=>{const{maxLength:r,maxLengthBehavior:i}=this.getLimit();"hard"!==i||"number"!=typeof r||e<r||(t=>1===t.key.length&&!t.ctrlKey&&!t.metaKey&&!t.altKey)(t)&&this.retriggerAria(e)}}componentWillLoad(t){this.watchHasCounter(t.hasCounter),this.watchMaxLength(t.maxLength),this.watchMaxLengthBehavior(t.maxLengthBehavior)}watchHasCounter(t){s.apply(t,(t=>this.setRenderProp("hasCounter",t)))}watchMaxLength(t){c.apply(t,(t=>this.setRenderProp("maxLength",t)))}watchMaxLengthBehavior(t){u.apply(t,(t=>this.setRenderProp("maxLengthBehavior",t)))}hasCounter(){return!0===this.getRenderProp("hasCounter")}hasSoftLimit(){const{maxLength:t,maxLengthBehavior:e}=this.getLimit();return"number"==typeof t&&"soft"===e}getMaxLengthAttribute(){const{maxLength:t,maxLengthBehavior:e}=this.getLimit();return"hard"===e?t:void 0}getCounterProps(){if(!this.hasCounter())return;const{maxLength:t,maxLengthBehavior:e}=this.getLimit();return{maxLength:t,maxLengthBehavior:e,visualRef:this.setVisualRef,ariaRef:this.setAriaRef}}getCharacterLimitHintId(e){return"number"!=typeof this.getRenderProp("maxLength")||this.hasCounter()?void 0:t(e,"character-limit-hint")}update(t){const e=this.getLimit();this.updateVisual(t,e),clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>this.updateAria(t,e)),1e3)}updateImmediate(t){const e=this.getLimit();this.updateVisual(t,e),clearTimeout(this.debounceTimer),this.updateAria(t,e)}retriggerAria(t){if(!this.ariaSpan)return;const e=this.getLimit();clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>this.updateAria(t,e,!0)),1e3)}destroy(){clearTimeout(this.debounceTimer)}getLimit(){return{maxLength:this.getRenderProp("maxLength"),maxLengthBehavior:this.getRenderProp("maxLengthBehavior")}}updateVisual(t,{maxLength:e,maxLengthBehavior:r}){this.visualSpan&&(this.visualSpan.innerText=((t,e,r)=>{if("number"!=typeof e)return o("kol-character-counter-current",{placeholders:{current:String(r)}});if("soft"===t){const t=e-r;return t<0?o("kol-character-limit-exceeded",{placeholders:{over:String(Math.abs(t))}}):o("kol-character-limit-remaining",{placeholders:{remaining:String(t)}})}return o("kol-character-counter-current-of-max",{placeholders:{current:String(r),max:String(e)}})})(r,e,t),this.visualSpan.classList.toggle("kol-form-field__counter--exceeded","soft"===r&&"number"==typeof e&&t>e))}updateAria(t,{maxLength:e,maxLengthBehavior:r},i=!1){if(!this.ariaSpan)return;let a=[g(r,e,t),x(r,e,t)].filter(Boolean).join(" ");i&&(this.reannounceToggle=!this.reannounceToggle,this.reannounceToggle&&(a+=" ")),this.ariaSpan.innerText=a}}export{d as C}
|