@public-ui/components 4.6.0-rc.0 → 4.6.0-rc.1
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 +4 -42
- package/dist/cjs/{Heading-CSxHzc97.js → Heading-DpKpW9_U.js} +1 -1
- package/dist/cjs/{api-CgWeKMMq.js → api-DSnFV5pX.js} +16 -16
- package/dist/cjs/{app-globals-pY-Cyxgv.js → app-globals-DWk29tH4.js} +2 -2
- package/dist/cjs/{base-qwdvh9pf.js → base-B1L6tTOu.js} +4 -4
- package/dist/cjs/{base-YsLg9vB1.js → base-Cdk10fDz.js} +4 -4
- package/dist/cjs/{base-Bza2102z.js → base-DB-5MCfF.js} +6 -7
- package/dist/cjs/{base-CYqcl2o4.js → base-uTtcb6OV.js} +17 -17
- package/dist/cjs/{base-web-component-CkEUtzNr.js → base-web-component-BdHm5Oq9.js} +5 -5
- package/dist/cjs/{base-web-component-Cp4fQ2Mh.js → base-web-component-CyF5QpIH.js} +6 -6
- package/dist/cjs/{behavior-DV-LMyJJ.js → behavior-BnUihLzw.js} +4 -4
- package/dist/cjs/{behavior-BqwUv55g.js → behavior-C3w_8ifK.js} +2 -2
- package/dist/cjs/{behavior-DvLNQY2U.js → behavior-D5F_9gEC.js} +1 -1
- package/dist/cjs/{bem-registry-CyxrH26c.js → bem-registry-ZJZujhCi.js} +0 -15
- package/dist/cjs/{block-bem-BI7yfoFU.js → block-bem-CMvCkLkl.js} +1 -1
- package/dist/cjs/{component-DtmmNGjm.js → component-B2l8N5t_.js} +4 -4
- package/dist/cjs/{component-COEAaB_B.js → component-BE_gS80r.js} +2 -2
- package/dist/cjs/{component-B9y7UnKg.js → component-BXz1XtoE.js} +7 -7
- package/dist/cjs/{component-DXBzTkOY.js → component-BwrQID5A.js} +3 -3
- package/dist/cjs/{component-D_9ZydZA.js → component-C46QQbMS.js} +10 -8
- package/dist/cjs/{component-q87oQHev.js → component-CWEYNtAH.js} +3 -3
- package/dist/cjs/{component-CRDSSR7G.js → component-CrW05zUq.js} +2 -2
- package/dist/cjs/{component-BM0H6uUo.js → component-DfChjUi8.js} +7 -7
- package/dist/cjs/{component-CeT2UQLF.js → component-DsWMXDya.js} +3 -3
- package/dist/cjs/{component-Br2jlQXL.js → component-N-3XFtFS.js} +6 -6
- package/dist/cjs/{component-CKMtvWhe.js → component-_p4OHWcc.js} +6 -6
- package/dist/cjs/{component-D5PYQ9Ku.js → component-eYoUHQ64.js} +2 -2
- package/dist/cjs/{dev.utils-DOgQN_zk.js → dev.utils-Bxq7b-n1.js} +1 -1
- package/dist/cjs/{devtools-CG9Ov5FS.js → devtools-BLvPSoCH.js} +2 -2
- package/dist/cjs/{field-control-BT1ZyKNR.js → field-control-D9t3USqP.js} +7 -7
- package/dist/cjs/{group-0C7hEZpp.js → group-CFBPF3hG.js} +5 -5
- package/dist/cjs/{index-14cLFAPd.js → index-CNhjOFBg.js} +2 -32
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{input-DOHuLJaE.js → input-C3F73RZW.js} +4 -4
- package/dist/cjs/{input-container-Ddovz1-b.js → input-container-B5-_NcRy.js} +6 -6
- package/dist/cjs/{item--tny4oQM.js → item-CfCrfeQL.js} +3 -3
- package/dist/cjs/{item-CWoQfEPo.js → item-DvddzW3M.js} +3 -3
- package/dist/cjs/{item-aV2WKcK3.js → item-dlea1NHr.js} +13 -13
- package/dist/cjs/{item-ZLQ1Yy47.js → item-nAB1wPvv.js} +7 -8
- package/dist/cjs/kol-abbr.cjs.entry.js +5 -5
- package/dist/cjs/kol-accordion.cjs.entry.js +10 -10
- package/dist/cjs/kol-alert.cjs.entry.js +15 -16
- package/dist/cjs/kol-avatar.cjs.entry.js +3 -3
- package/dist/cjs/kol-badge.cjs.entry.js +15 -16
- package/dist/cjs/kol-breadcrumb.cjs.entry.js +13 -13
- package/dist/cjs/kol-button-link.cjs.entry.js +15 -16
- package/dist/cjs/kol-button.cjs.entry.js +15 -16
- package/dist/cjs/kol-card.cjs.entry.js +16 -17
- package/dist/cjs/kol-combobox.cjs.entry.js +26 -27
- package/dist/cjs/kol-details.cjs.entry.js +10 -10
- package/dist/cjs/kol-dialog.cjs.entry.js +18 -19
- package/dist/cjs/kol-drawer.cjs.entry.js +17 -18
- package/dist/cjs/kol-form.cjs.entry.js +15 -16
- package/dist/cjs/kol-heading.cjs.entry.js +5 -5
- package/dist/cjs/kol-icon.cjs.entry.js +5 -5
- package/dist/cjs/kol-image.cjs.entry.js +3 -3
- package/dist/cjs/kol-input-checkbox.cjs.entry.js +29 -30
- package/dist/cjs/kol-input-color.cjs.entry.js +25 -26
- package/dist/cjs/kol-input-date.cjs.entry.js +25 -26
- package/dist/cjs/kol-input-email.cjs.entry.js +31 -32
- package/dist/cjs/kol-input-file.cjs.entry.js +24 -25
- package/dist/cjs/kol-input-number.cjs.entry.js +25 -26
- package/dist/cjs/kol-input-password.cjs.entry.js +26 -27
- package/dist/cjs/kol-input-radio.cjs.entry.js +24 -25
- package/dist/cjs/kol-input-range.cjs.entry.js +25 -26
- package/dist/cjs/kol-input-text.cjs.entry.js +26 -27
- package/dist/cjs/kol-kolibri.cjs.entry.js +5 -5
- package/dist/cjs/kol-link-button.cjs.entry.js +14 -14
- package/dist/cjs/kol-link.cjs.entry.js +14 -14
- package/dist/cjs/kol-meter.cjs.entry.js +5 -5
- package/dist/cjs/kol-modal.cjs.entry.js +18 -19
- package/dist/cjs/kol-nav.cjs.entry.js +18 -19
- package/dist/cjs/kol-pagination.cjs.entry.js +26 -28
- package/dist/cjs/kol-popover-button.cjs.entry.js +16 -17
- package/dist/cjs/kol-progress.cjs.entry.js +5 -5
- package/dist/cjs/kol-quote.cjs.entry.js +3 -3
- package/dist/cjs/kol-select.cjs.entry.js +23 -24
- package/dist/cjs/kol-single-select.cjs.entry.js +26 -27
- package/dist/cjs/kol-skip-nav.cjs.entry.js +13 -13
- package/dist/cjs/kol-spin.cjs.entry.js +6 -6
- package/dist/cjs/kol-split-button.cjs.entry.js +18 -19
- package/dist/cjs/kol-table-stateful.cjs.entry.js +31 -32
- package/dist/cjs/kol-table-stateless.cjs.entry.js +24 -25
- package/dist/cjs/kol-tabs.cjs.entry.js +14 -15
- package/dist/cjs/kol-textarea.cjs.entry.js +24 -25
- package/dist/cjs/kol-toast-container.cjs.entry.js +14 -15
- package/dist/cjs/kol-toolbar.cjs.entry.js +16 -17
- package/dist/cjs/kol-tooltip-wc.cjs.entry.js +7 -7
- package/dist/cjs/kol-tree-item.cjs.entry.js +12 -12
- package/dist/cjs/kol-tree.cjs.entry.js +3 -3
- package/dist/cjs/kol-version.cjs.entry.js +12 -13
- package/dist/cjs/kolibri.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{resolve-props-DhLgYN4l.js → resolve-props-BUSerQcI.js} +2 -2
- package/dist/cjs/{resolve-props-BpLJmK75.js → resolve-props-ClWlRbhz.js} +3 -4
- package/dist/cjs/{scroll-lock-C7PeigI_.js → scroll-lock-CSW_wA0P.js} +2 -2
- package/dist/cjs/{suggestions-CZjGY0Eu.js → suggestions-CIGYxDps.js} +2 -2
- package/dist/cjs/test-component.cjs.entry.js +1 -1
- package/dist/cjs/{toggle-handler-rQkcX4QY.js → toggle-handler-Cy5RcTS_.js} +4 -4
- package/dist/collection/collection-manifest.json +0 -7
- package/dist/collection/components/abbr/component.js +1 -1
- package/dist/collection/components/accordion/component.js +1 -1
- package/dist/collection/components/accordion/style.css +2 -2
- package/dist/collection/components/alert/component.js +1 -1
- package/dist/collection/components/alert/style.css +2 -2
- package/dist/collection/components/avatar/component.js +1 -1
- package/dist/collection/components/badge/component.js +1 -1
- package/dist/collection/components/badge/style.css +2 -2
- package/dist/collection/components/breadcrumb/component.js +1 -1
- package/dist/collection/components/breadcrumb/style.css +2 -2
- package/dist/collection/components/button/component.js +1 -1
- package/dist/collection/components/button/style.css +2 -2
- package/dist/collection/components/button-link/component.js +1 -1
- package/dist/collection/components/button-link/style.css +2 -2
- package/dist/collection/components/card/component.js +1 -1
- package/dist/collection/components/card/style.css +2 -2
- package/dist/collection/components/combobox/component.js +3 -3
- package/dist/collection/components/combobox/style.css +2 -2
- package/dist/collection/components/details/component.js +1 -1
- package/dist/collection/components/details/style.css +2 -2
- package/dist/collection/components/dialog/component.js +1 -1
- package/dist/collection/components/dialog/style.css +2 -2
- package/dist/collection/components/drawer/component.js +1 -1
- package/dist/collection/components/drawer/style.css +2 -2
- package/dist/collection/components/form/component.js +1 -1
- package/dist/collection/components/form/style.css +2 -2
- package/dist/collection/components/heading/component.js +1 -1
- package/dist/collection/components/icon/component.js +1 -1
- package/dist/collection/components/icon/style.css +2 -2
- package/dist/collection/components/image/component.js +1 -1
- package/dist/collection/components/input-checkbox/component.js +3 -3
- package/dist/collection/components/input-checkbox/style.css +2 -2
- package/dist/collection/components/input-color/component.js +2 -2
- package/dist/collection/components/input-color/style.css +2 -2
- package/dist/collection/components/input-date/component.js +2 -2
- package/dist/collection/components/input-date/style.css +2 -2
- package/dist/collection/components/input-email/component.js +1 -1
- package/dist/collection/components/input-email/style.css +2 -2
- package/dist/collection/components/input-file/component.js +2 -2
- package/dist/collection/components/input-file/style.css +2 -2
- package/dist/collection/components/input-number/component.js +2 -2
- package/dist/collection/components/input-number/style.css +2 -2
- package/dist/collection/components/input-password/component.js +1 -1
- package/dist/collection/components/input-password/style.css +2 -2
- package/dist/collection/components/input-radio/component.js +1 -1
- package/dist/collection/components/input-radio/style.css +2 -2
- package/dist/collection/components/input-range/component.js +2 -2
- package/dist/collection/components/input-range/style.css +2 -2
- package/dist/collection/components/input-text/component.js +1 -1
- package/dist/collection/components/input-text/style.css +2 -2
- package/dist/collection/components/kolibri/component.js +1 -1
- package/dist/collection/components/link/component.js +1 -1
- package/dist/collection/components/link/style.css +2 -2
- package/dist/collection/components/link-button/component.js +1 -1
- package/dist/collection/components/link-button/style.css +2 -2
- package/dist/collection/components/meter/component.js +1 -1
- package/dist/collection/components/modal/component.js +1 -1
- package/dist/collection/components/modal/style.css +2 -2
- package/dist/collection/components/nav/component.js +1 -1
- package/dist/collection/components/nav/style.css +2 -2
- package/dist/collection/components/pagination/component.js +7 -9
- package/dist/collection/components/pagination/style.css +2 -2
- package/dist/collection/components/popover-button/component.js +1 -1
- package/dist/collection/components/popover-button/style.css +2 -2
- package/dist/collection/components/progress/component.js +1 -1
- package/dist/collection/components/quote/component.js +1 -1
- package/dist/collection/components/select/component.js +1 -1
- package/dist/collection/components/select/style.css +2 -2
- package/dist/collection/components/single-select/component.js +3 -3
- package/dist/collection/components/single-select/style.css +2 -2
- package/dist/collection/components/skip-nav/component.js +1 -1
- package/dist/collection/components/skip-nav/style.css +2 -2
- package/dist/collection/components/spin/component.js +1 -1
- package/dist/collection/components/split-button/component.js +1 -1
- package/dist/collection/components/split-button/style.css +2 -2
- package/dist/collection/components/table-stateful/component.js +2 -2
- package/dist/collection/components/table-stateful/style.css +2 -2
- package/dist/collection/components/table-stateless/component.js +1 -1
- package/dist/collection/components/table-stateless/style.css +2 -2
- package/dist/collection/components/tabs/component.js +1 -1
- package/dist/collection/components/tabs/style.css +2 -2
- package/dist/collection/components/textarea/component.js +2 -2
- package/dist/collection/components/textarea/style.css +2 -2
- package/dist/collection/components/toaster/shadow.js +1 -1
- package/dist/collection/components/toaster/style.css +2 -2
- package/dist/collection/components/toolbar/component.js +1 -1
- package/dist/collection/components/toolbar/style.css +2 -2
- package/dist/collection/components/tooltip/component.js +1 -1
- package/dist/collection/components/tree/component.js +1 -1
- package/dist/collection/components/tree-item/component.js +1 -1
- package/dist/collection/components/tree-item/style.css +2 -2
- package/dist/collection/components/version/component.js +1 -1
- package/dist/collection/components/version/style.css +2 -2
- package/dist/collection/internal/functional-components/pagination/api.js +2 -2
- package/dist/collection/internal/functional-components/pagination/item.js +3 -3
- package/dist/collection/schema/bem-registry.js +0 -15
- package/dist/components/base-web-component2.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/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/component10.js +1 -1
- package/dist/components/component11.js +1 -1
- package/dist/components/component2.js +1 -1
- package/dist/components/component3.js +1 -1
- package/dist/components/component4.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/field-control.js +1 -1
- package/dist/components/input-container.js +1 -1
- package/dist/components/item2.js +1 -1
- package/dist/components/item4.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-tooltip-wc.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/level.js +1 -1
- package/dist/components/props-from-config.js +1 -1
- package/dist/components/resolve-props.js +1 -1
- package/dist/components/rows.js +1 -1
- package/dist/components/unit.js +1 -1
- package/dist/components/validators.js +1 -1
- package/dist/esm/{Heading-Bj2Ma7Tr.js → Heading-wrhAEuG3.js} +1 -1
- package/dist/esm/{api-DhMNvXtN.js → api-7B_iI89k.js} +14 -14
- package/dist/esm/{app-globals-Dpmwwlv-.js → app-globals-tRqgHq3P.js} +2 -2
- package/dist/esm/{base-IzdO60L1.js → base-BDYPTFjC.js} +4 -4
- package/dist/esm/{base-CJ5WCVaj.js → base-BVztEKgJ.js} +17 -17
- package/dist/esm/{base-DV_Pzm7z.js → base-C32RNC8q.js} +5 -6
- package/dist/esm/{base-Ba-xzpOT.js → base-D_-9Lzkd.js} +4 -4
- package/dist/esm/{base-web-component-BB3dHStd.js → base-web-component-BUu68byc.js} +6 -6
- package/dist/esm/{base-web-component-ug9DZUOx.js → base-web-component-DdY5aIHN.js} +5 -5
- package/dist/esm/{behavior-BMXrK4gj.js → behavior-DN-22cB1.js} +2 -2
- package/dist/esm/{behavior-BgmZcrK6.js → behavior-DsTiTiJC.js} +2 -2
- package/dist/esm/{behavior-B4IW5_Qt.js → behavior-fGxZN96S.js} +1 -1
- package/dist/esm/{bem-registry-CWN7_O1L.js → bem-registry-Crcs_65u.js} +0 -15
- package/dist/esm/{block-bem-BpQSY04L.js → block-bem-DehcAQZQ.js} +1 -1
- package/dist/esm/{component-BiYFPpjn.js → component-0IO2wu9i.js} +7 -7
- package/dist/esm/{component-DdIOGRgB.js → component-4xXBb7K-.js} +4 -4
- package/dist/esm/{component-scm3PBuq.js → component-BJ4gGOph.js} +2 -2
- package/dist/esm/{component-BvvE8aim.js → component-CPq3i3I_.js} +2 -2
- package/dist/esm/{component-ChtW1HQv.js → component-CTOYF3q6.js} +3 -3
- package/dist/esm/{component-BKfXEtN0.js → component-ChuoBFI-.js} +3 -3
- package/dist/esm/{component-Dt6efHXY.js → component-Cxdi6on4.js} +9 -8
- package/dist/esm/{component-Drxdk3mb.js → component-DHNcVTi0.js} +6 -6
- package/dist/esm/{component-gj7TBL0i.js → component-DWywPG_a.js} +6 -6
- package/dist/esm/{component-Ua7-J4C-.js → component-EK9BJR6z.js} +7 -7
- package/dist/esm/{component-C0zMsvYl.js → component-NEw1tN3M.js} +3 -3
- package/dist/esm/{component-C5QCCLLa.js → component-et0GdBuf.js} +2 -2
- package/dist/esm/{dev.utils-CwXr_J8N.js → dev.utils-Bg7nZBMk.js} +1 -1
- package/dist/esm/{devtools-QEDvmhav.js → devtools-nUT3JVTV.js} +2 -2
- package/dist/esm/{field-control-BOsAM8BW.js → field-control-D2tOd14v.js} +7 -7
- package/dist/esm/{group-D4WbZY27.js → group-CxWsx0aJ.js} +5 -5
- package/dist/esm/{index-D_P2XoAc.js → index-B_bJG8-2.js} +3 -32
- package/dist/esm/index.js +1 -1
- package/dist/esm/{input-C0kj1MmP.js → input-Ia9Z3AP7.js} +4 -4
- package/dist/esm/{input-container-B4TgBfDz.js → input-container-Y_8n5Sen.js} +6 -6
- package/dist/esm/{item-WrCdQw7F.js → item-BKVeXzUO.js} +13 -13
- package/dist/esm/{item-DRC1CmzC.js → item-BZtI88zF.js} +3 -3
- package/dist/esm/{item-e4SzwxHe.js → item-BjriQHQl.js} +3 -3
- package/dist/esm/{item-BMniY_My.js → item-BuqBMSYI.js} +6 -7
- package/dist/esm/kol-abbr.entry.js +5 -5
- package/dist/esm/kol-accordion.entry.js +10 -10
- package/dist/esm/kol-alert.entry.js +15 -16
- package/dist/esm/kol-avatar.entry.js +3 -3
- package/dist/esm/kol-badge.entry.js +15 -16
- package/dist/esm/kol-breadcrumb.entry.js +13 -13
- package/dist/esm/kol-button-link.entry.js +15 -16
- package/dist/esm/kol-button.entry.js +15 -16
- package/dist/esm/kol-card.entry.js +16 -17
- package/dist/esm/kol-combobox.entry.js +26 -27
- package/dist/esm/kol-details.entry.js +10 -10
- package/dist/esm/kol-dialog.entry.js +18 -19
- package/dist/esm/kol-drawer.entry.js +17 -18
- package/dist/esm/kol-form.entry.js +15 -16
- package/dist/esm/kol-heading.entry.js +5 -5
- package/dist/esm/kol-icon.entry.js +5 -5
- package/dist/esm/kol-image.entry.js +3 -3
- package/dist/esm/kol-input-checkbox.entry.js +29 -30
- package/dist/esm/kol-input-color.entry.js +25 -26
- package/dist/esm/kol-input-date.entry.js +25 -26
- package/dist/esm/kol-input-email.entry.js +31 -32
- package/dist/esm/kol-input-file.entry.js +24 -25
- package/dist/esm/kol-input-number.entry.js +25 -26
- package/dist/esm/kol-input-password.entry.js +26 -27
- package/dist/esm/kol-input-radio.entry.js +24 -25
- package/dist/esm/kol-input-range.entry.js +25 -26
- package/dist/esm/kol-input-text.entry.js +26 -27
- package/dist/esm/kol-kolibri.entry.js +5 -5
- package/dist/esm/kol-link-button.entry.js +14 -14
- package/dist/esm/kol-link.entry.js +14 -14
- package/dist/esm/kol-meter.entry.js +5 -5
- package/dist/esm/kol-modal.entry.js +18 -19
- package/dist/esm/kol-nav.entry.js +18 -19
- package/dist/esm/kol-pagination.entry.js +26 -28
- package/dist/esm/kol-popover-button.entry.js +16 -17
- package/dist/esm/kol-progress.entry.js +5 -5
- package/dist/esm/kol-quote.entry.js +3 -3
- package/dist/esm/kol-select.entry.js +23 -24
- package/dist/esm/kol-single-select.entry.js +26 -27
- package/dist/esm/kol-skip-nav.entry.js +13 -13
- package/dist/esm/kol-spin.entry.js +6 -6
- package/dist/esm/kol-split-button.entry.js +18 -19
- package/dist/esm/kol-table-stateful.entry.js +31 -32
- package/dist/esm/kol-table-stateless.entry.js +24 -25
- package/dist/esm/kol-tabs.entry.js +14 -15
- package/dist/esm/kol-textarea.entry.js +24 -25
- package/dist/esm/kol-toast-container.entry.js +14 -15
- package/dist/esm/kol-toolbar.entry.js +16 -17
- package/dist/esm/kol-tooltip-wc.entry.js +7 -7
- package/dist/esm/kol-tree-item.entry.js +12 -12
- package/dist/esm/kol-tree.entry.js +3 -3
- package/dist/esm/kol-version.entry.js +12 -13
- package/dist/esm/kolibri.js +4 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{resolve-props-CqTztQhV.js → resolve-props-BkF1VBBB.js} +2 -2
- package/dist/esm/{resolve-props-B-67viId.js → resolve-props-CHPFh7Tn.js} +2 -3
- package/dist/esm/{scroll-lock-CKnC0y0o.js → scroll-lock-D7Zo0QLt.js} +2 -2
- package/dist/esm/{suggestions-Be1_H9fA.js → suggestions-GEr-cvbz.js} +2 -2
- package/dist/esm/test-component.entry.js +1 -1
- package/dist/esm/{toggle-handler-Cjc991vd.js → toggle-handler-Bqoo8tCo.js} +4 -4
- package/dist/kolibri/Heading-wrhAEuG3.js +4 -0
- package/dist/kolibri/api-7B_iI89k.js +4 -0
- package/dist/kolibri/app-globals-tRqgHq3P.js +4 -0
- package/dist/kolibri/{base-IzdO60L1.js → base-BDYPTFjC.js} +1 -1
- package/dist/kolibri/base-BVztEKgJ.js +4 -0
- package/dist/kolibri/base-C32RNC8q.js +4 -0
- package/dist/kolibri/{base-Ba-xzpOT.js → base-D_-9Lzkd.js} +1 -1
- package/dist/kolibri/{base-web-component-BB3dHStd.js → base-web-component-BUu68byc.js} +1 -1
- package/dist/kolibri/{base-web-component-ug9DZUOx.js → base-web-component-DdY5aIHN.js} +1 -1
- package/dist/kolibri/behavior-DN-22cB1.js +4 -0
- package/dist/kolibri/{behavior-BgmZcrK6.js → behavior-DsTiTiJC.js} +1 -1
- package/dist/kolibri/{behavior-B4IW5_Qt.js → behavior-fGxZN96S.js} +1 -1
- package/dist/kolibri/bem-registry-Crcs_65u.js +4 -0
- package/dist/kolibri/block-bem-DehcAQZQ.js +4 -0
- package/dist/kolibri/component-0IO2wu9i.js +4 -0
- package/dist/kolibri/{component-DdIOGRgB.js → component-4xXBb7K-.js} +1 -1
- package/dist/kolibri/component-BJ4gGOph.js +4 -0
- package/dist/kolibri/component-CPq3i3I_.js +4 -0
- package/dist/kolibri/component-CTOYF3q6.js +4 -0
- package/dist/kolibri/{component-BKfXEtN0.js → component-ChuoBFI-.js} +1 -1
- package/dist/kolibri/component-Cxdi6on4.js +4 -0
- package/dist/kolibri/{component-Drxdk3mb.js → component-DHNcVTi0.js} +1 -1
- package/dist/kolibri/component-DWywPG_a.js +4 -0
- package/dist/kolibri/component-EK9BJR6z.js +4 -0
- package/dist/kolibri/{component-C0zMsvYl.js → component-NEw1tN3M.js} +1 -1
- package/dist/kolibri/{component-C5QCCLLa.js → component-et0GdBuf.js} +1 -1
- package/dist/kolibri/{dev.utils-CwXr_J8N.js → dev.utils-Bg7nZBMk.js} +1 -1
- package/dist/kolibri/{devtools-QEDvmhav.js → devtools-nUT3JVTV.js} +1 -1
- package/dist/kolibri/field-control-D2tOd14v.js +4 -0
- package/dist/kolibri/{group-D4WbZY27.js → group-CxWsx0aJ.js} +1 -1
- package/dist/kolibri/{index-D_P2XoAc.js → index-B_bJG8-2.js} +2 -2
- package/dist/kolibri/index.esm.js +1 -1
- package/dist/kolibri/input-Ia9Z3AP7.js +4 -0
- package/dist/kolibri/{input-container-B4TgBfDz.js → input-container-Y_8n5Sen.js} +1 -1
- package/dist/kolibri/item-BKVeXzUO.js +4 -0
- package/dist/kolibri/item-BZtI88zF.js +4 -0
- package/dist/kolibri/item-BjriQHQl.js +4 -0
- package/dist/kolibri/item-BuqBMSYI.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-tooltip-wc.entry.js +1 -1
- package/dist/kolibri/kol-tree-item.entry.js +1 -1
- package/dist/kolibri/kol-tree.entry.js +1 -1
- package/dist/kolibri/kol-version.entry.js +1 -1
- package/dist/kolibri/kolibri.esm.js +1 -1
- package/dist/kolibri/resolve-props-BkF1VBBB.js +4 -0
- package/dist/kolibri/resolve-props-CHPFh7Tn.js +4 -0
- package/dist/kolibri/{scroll-lock-CKnC0y0o.js → scroll-lock-D7Zo0QLt.js} +1 -1
- package/dist/kolibri/suggestions-GEr-cvbz.js +4 -0
- package/dist/kolibri/test-component.entry.js +1 -1
- package/dist/kolibri/toggle-handler-Bqoo8tCo.js +4 -0
- package/dist/types/components/pagination/component.d.ts +1 -1
- package/dist/types/components.d.ts +3 -97
- package/dist/types/internal/functional-components/pagination/api.d.ts +2 -2
- package/dist/types/internal/functional-components/pagination/item.d.ts +1 -1
- package/dist/types/schema/bem-registry.d.ts +0 -25
- package/dist/types/schema/components/pagination.d.ts +2 -2
- package/doc/pagination.md +13 -13
- package/doc/table-stateful.md +1 -1
- package/package.json +3 -3
- package/vscode-custom-data.json +0 -13
- package/dist/cjs/component-r497oHWq.js +0 -14
- 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/click-button/component.js +0 -105
- 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/components/component12.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/esm/component-Db9HadXA.js +0 -12
- package/dist/esm/kol-click-button.entry.js +0 -53
- package/dist/esm/kol-skeleton.entry.js +0 -105
- package/dist/esm/name-B2Yf3EpX.js +0 -8
- package/dist/kolibri/Heading-Bj2Ma7Tr.js +0 -4
- package/dist/kolibri/api-DhMNvXtN.js +0 -4
- package/dist/kolibri/app-globals-Dpmwwlv-.js +0 -4
- package/dist/kolibri/base-CJ5WCVaj.js +0 -4
- package/dist/kolibri/base-DV_Pzm7z.js +0 -4
- package/dist/kolibri/behavior-BMXrK4gj.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/component-BiYFPpjn.js +0 -4
- package/dist/kolibri/component-BvvE8aim.js +0 -4
- package/dist/kolibri/component-ChtW1HQv.js +0 -4
- package/dist/kolibri/component-Db9HadXA.js +0 -4
- package/dist/kolibri/component-Dt6efHXY.js +0 -4
- package/dist/kolibri/component-Ua7-J4C-.js +0 -4
- package/dist/kolibri/component-gj7TBL0i.js +0 -4
- package/dist/kolibri/component-scm3PBuq.js +0 -4
- package/dist/kolibri/field-control-BOsAM8BW.js +0 -4
- package/dist/kolibri/input-C0kj1MmP.js +0 -4
- package/dist/kolibri/item-BMniY_My.js +0 -4
- package/dist/kolibri/item-DRC1CmzC.js +0 -4
- package/dist/kolibri/item-WrCdQw7F.js +0 -4
- package/dist/kolibri/item-e4SzwxHe.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/name-B2Yf3EpX.js +0 -4
- package/dist/kolibri/resolve-props-B-67viId.js +0 -4
- package/dist/kolibri/resolve-props-CqTztQhV.js +0 -4
- package/dist/kolibri/suggestions-Be1_H9fA.js +0 -4
- package/dist/kolibri/toggle-handler-Cjc991vd.js +0 -4
- package/dist/types/components/click-button/component.d.ts +0 -15
- 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/doc/skeleton.md +0 -54
|
@@ -169,21 +169,6 @@ const BEM = {
|
|
|
169
169
|
},
|
|
170
170
|
modifiers: null,
|
|
171
171
|
},
|
|
172
|
-
'kol-skeleton': {
|
|
173
|
-
elements: {
|
|
174
|
-
actions: { modifiers: null },
|
|
175
|
-
container: { modifiers: null },
|
|
176
|
-
counter: { modifiers: null },
|
|
177
|
-
name: { modifiers: null },
|
|
178
|
-
},
|
|
179
|
-
modifiers: new Set(['has-name', 'is-hidden']),
|
|
180
|
-
},
|
|
181
|
-
'kol-click-button': {
|
|
182
|
-
elements: {
|
|
183
|
-
label: { modifiers: null },
|
|
184
|
-
},
|
|
185
|
-
modifiers: null,
|
|
186
|
-
},
|
|
187
172
|
'kol-span': {
|
|
188
173
|
elements: {
|
|
189
174
|
container: { modifiers: null },
|
|
@@ -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,j as d}from"./component3.js";import{c as h,n as c,b as p,a as u,t as m}from"./props-from-config.js";import{l as v}from"./label-with-expert-slot.js";import{n as b}from"./name.js";import{a as f}from"./tslib.es6.js";import{S as g,b as y,s as j}from"./component7.js";import{r as _}from"./aria-labelledby.js";import{a as B,c as L,n as O}from"./dev.utils.js";import{K as T,d as F}from"./events.js";import{B as N}from"./base-web-component.js";import{c as x}from"./item.js";import{c as K}from"./item2.js";import{T as k}from"./behavior.js";import{h as w}from"@stencil/core/internal/client";import{t as A}from"./i18n.js";import{c as P}from"./clsx.js";import{B as C}from"./component.js";import{T as H}from"./component11.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=h("hideMsg",!1,c),E=h("hint","",p),$=h("infoPopover",void 0,(function(e){if("object"==typeof e&&null!==e)return e;throw new Error("Invalid info popover: "+typeof e)})),z=u(),R=h("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=h("touched",!1,c),G={required:[v],optional:[s,r,a,q,E,$,z,R,b,n,V]},J=e=>{var{id:i,class:t,hint:o,baseClassName:s="kol-form-field"}=e,l=f(e,["id","class","hint","baseClassName"]);return o?w("span",Object.assign({class:P(`${s}__hint`,t),id:B(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=f(e,["component","id","baseClassName","class","accessKey","shortKey","label","hideLabel","hasExpertSlot","omitId","showBadge","readOnly","infoPopover"]);const v=!d&&n,b=!1===c?void 0:y(l,r);return w(i,Object.assign({},m,{class:P(`${o}__label`,s),id:v||h?void 0:B(t,"label"),hidden:v,htmlFor:"legend"===i?void 0:t}),w(g,{class:`${o}__label-text`,label:d?"":null!=a?a:"",badgeText:b},w("slot",{name:"expert"})),!d&&p&&w("span",{class:`${o}__label__read-only`,"aria-hidden":"true"},"(",A("kol-readonly"),")"),!d&&u&&w("span",null,w(D,Object.assign({},u.popoverButton),w("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=f(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 w(I,Object.assign({alert:!l&&(null!==(t=null==h?void 0:h._alert)&&void 0!==t?t:!0===s),class:P("kol-form-field__msg",l&&"visually-hidden",n),closerAriaDescriptionId:O(),handleCloserClick:()=>{},hasCloser:!1,headingId:L("alert-heading"),id:B(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&&!j(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:h,msg:c,hideMsg:p,hideLabel:u,label:m,infoPopover:v,hint:b,accessKey:g,shortKey:_,counter:L,readOnly:O,touched:T,maxLength:F,ariaDescribedBy:N,showBadge:x,tooltipAlign:K,variant:k,component:D="div",orientation:I,refInput:S,refTooltip:q}=e,E=f(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"]),$=j(m),z=M(c,T),R=y(g,_),V=X({hideLabel:u,label:m,renderNoTooltip:o}),G="fieldset"===D;return w(C,Object.assign({component:D,block:"kol-form-field",modifiers:Object.assign({disabled:Boolean(n),required:Boolean(r),touched:Boolean(T),"hide-label":Boolean(u),"read-only":Boolean(O),"hidden-msg":Boolean(p)},z?Y(c):{}),class:P(k&&d(k,"form-field"),h),disabled:!(!G||!n)||void 0,"aria-describedby":N},E),!t&&w(Q,{component:G?"legend":"label",class:G?"kol-form-field__label--legend":void 0,id:l,hasExpertSlot:$,hideLabel:u,label:m,accessKey:g,shortKey:_,readOnly:O,showBadge:x,infoPopover:v}),w("div",{class:W("input",{"orientation-horizontal":"horizontal"===I,"orientation-vertical":"vertical"===I}),ref:S},i,V&&w("div",{class:W("tooltip")},w(H,{badgeText:R||"",label:m,align:K,id:B(l,"label"),refFloating:q}))),L&&!("soft"===L.maxLengthBehavior&&"number"!=typeof L.maxLength)&&w("div",{class:W("counter")},w("span",{"aria-hidden":"true",class:W("counter"),ref:L.visualRef}),w("span",{"aria-live":"polite",class:"visually-hidden",id:B(l,"counter"),ref:L.ariaRef})),z&&w(U,{id:l,alert:a,hideMsg:p,msg:c}),!s&&w(J,{id:l,hint:b}),"number"==typeof F&&!L&&w("span",{id:B(l,"character-limit-hint"),class:"visually-hidden"},A("kol-character-limit-hint",{placeholders:{limit:String(F)}})))};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?m(t):void 0}}const ie=class extends N{constructor(){super(...arguments),this.tooltipBehavior=new k(N.stateLess),this.smartButton=x((()=>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(T.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(T.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(T.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(T.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(T.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(N.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=f(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=_(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){v.apply(e,(e=>this.shared.setRenderProp("label",e)),this.isRequired("label"))}applyMsg(e){R.apply(e,(e=>this.shared.setRenderProp("msg",e)))}applyName(e){b.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&&F(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(T.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(B(e,"msg")),a&&n.push(B(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: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: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(y(i,t)||""),this.tooltipBehavior.watchId(B(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,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,j as d}from"./component3.js";import{c as h,n as c,b as p,a as u,t as m}from"./props-from-config.js";import{l as v}from"./label-with-expert-slot.js";import{n as b}from"./component9.js";import{a as f}from"./tslib.es6.js";import{S as g,b as y,s as j}from"./component7.js";import{r as _}from"./aria-labelledby.js";import{a as B,c as L,n as O}from"./dev.utils.js";import{K as T,d as F}from"./events.js";import{B as N}from"./base-web-component.js";import{c as x}from"./item.js";import{c as K}from"./item2.js";import{T as k}from"./behavior.js";import{h as w}from"@stencil/core/internal/client";import{t as A}from"./i18n.js";import{c as P}from"./clsx.js";import{B as C}from"./component.js";import{T as H}from"./component10.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=h("hideMsg",!1,c),E=h("hint","",p),$=h("infoPopover",void 0,(function(e){if("object"==typeof e&&null!==e)return e;throw new Error("Invalid info popover: "+typeof e)})),z=u(),R=h("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=h("touched",!1,c),G={required:[v],optional:[s,r,a,q,E,$,z,R,b,n,V]},J=e=>{var{id:i,class:t,hint:o,baseClassName:s="kol-form-field"}=e,l=f(e,["id","class","hint","baseClassName"]);return o?w("span",Object.assign({class:P(`${s}__hint`,t),id:B(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=f(e,["component","id","baseClassName","class","accessKey","shortKey","label","hideLabel","hasExpertSlot","omitId","showBadge","readOnly","infoPopover"]);const v=!d&&n,b=!1===c?void 0:y(l,r);return w(i,Object.assign({},m,{class:P(`${o}__label`,s),id:v||h?void 0:B(t,"label"),hidden:v,htmlFor:"legend"===i?void 0:t}),w(g,{class:`${o}__label-text`,label:d?"":null!=a?a:"",badgeText:b},w("slot",{name:"expert"})),!d&&p&&w("span",{class:`${o}__label__read-only`,"aria-hidden":"true"},"(",A("kol-readonly"),")"),!d&&u&&w("span",null,w(D,Object.assign({},u.popoverButton),w("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=f(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 w(I,Object.assign({alert:!l&&(null!==(t=null==h?void 0:h._alert)&&void 0!==t?t:!0===s),class:P("kol-form-field__msg",l&&"visually-hidden",n),closerAriaDescriptionId:O(),handleCloserClick:()=>{},hasCloser:!1,headingId:L("alert-heading"),id:B(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&&!j(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:h,msg:c,hideMsg:p,hideLabel:u,label:m,infoPopover:v,hint:b,accessKey:g,shortKey:_,counter:L,readOnly:O,touched:T,maxLength:F,ariaDescribedBy:N,showBadge:x,tooltipAlign:K,variant:k,component:D="div",orientation:I,refInput:S,refTooltip:q}=e,E=f(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"]),$=j(m),z=M(c,T),R=y(g,_),V=X({hideLabel:u,label:m,renderNoTooltip:o}),G="fieldset"===D;return w(C,Object.assign({component:D,block:"kol-form-field",modifiers:Object.assign({disabled:Boolean(n),required:Boolean(r),touched:Boolean(T),"hide-label":Boolean(u),"read-only":Boolean(O),"hidden-msg":Boolean(p)},z?Y(c):{}),class:P(k&&d(k,"form-field"),h),disabled:!(!G||!n)||void 0,"aria-describedby":N},E),!t&&w(Q,{component:G?"legend":"label",class:G?"kol-form-field__label--legend":void 0,id:l,hasExpertSlot:$,hideLabel:u,label:m,accessKey:g,shortKey:_,readOnly:O,showBadge:x,infoPopover:v}),w("div",{class:W("input",{"orientation-horizontal":"horizontal"===I,"orientation-vertical":"vertical"===I}),ref:S},i,V&&w("div",{class:W("tooltip")},w(H,{badgeText:R||"",label:m,align:K,id:B(l,"label"),refFloating:q}))),L&&!("soft"===L.maxLengthBehavior&&"number"!=typeof L.maxLength)&&w("div",{class:W("counter")},w("span",{"aria-hidden":"true",class:W("counter"),ref:L.visualRef}),w("span",{"aria-live":"polite",class:"visually-hidden",id:B(l,"counter"),ref:L.ariaRef})),z&&w(U,{id:l,alert:a,hideMsg:p,msg:c}),!s&&w(J,{id:l,hint:b}),"number"==typeof F&&!L&&w("span",{id:B(l,"character-limit-hint"),class:"visually-hidden"},A("kol-character-limit-hint",{placeholders:{limit:String(F)}})))};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?m(t):void 0}}const ie=class extends N{constructor(){super(...arguments),this.tooltipBehavior=new k(N.stateLess),this.smartButton=x((()=>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(T.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(T.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(T.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(T.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(T.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(N.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=f(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=_(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){v.apply(e,(e=>this.shared.setRenderProp("label",e)),this.isRequired("label"))}applyMsg(e){R.apply(e,(e=>this.shared.setRenderProp("msg",e)))}applyName(e){b.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&&F(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(T.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(B(e,"msg")),a&&n.push(B(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: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: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(y(i,t)||""),this.tooltipBehavior.watchId(B(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}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h as e,p as s}from"./bem-registry.js";import{a as t,d as i,t as o,v as r}from"./component3.js";import{h as a,g as l,I as n}from"./input-container.js";import{
|
|
4
|
+
import{h as e,p as s}from"./bem-registry.js";import{a as t,d as i,t as o,v as r}from"./component3.js";import{h as a,g as l,I as n}from"./input-container.js";import{q as d,s as h,c}from"./props-from-config.js";import{m as p}from"./multiple.js";import{r as u}from"./required.js";import{r as b}from"./rows.js";import{f as m,i as v,g as y,c as f,B as j,F as O}from"./base-web-component2.js";import{h as g,Fragment as A}from"@stencil/core/internal/client";import{v as B}from"./access-and-short-key.js";import{c as w}from"./clsx.js";import{f as K}from"./options.js";import{a as q}from"./tslib.es6.js";import{g as P}from"./block-bem.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===d(s.label,3)&&!1===h(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=c("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=c("value",[],(e=>Array.isArray(e)?e:[e])),$={required:[...m.required],optional:[...m.optional,t,a,p,x,u,b,L,i,o,r]},D=P("kol-select"),E=e=>{var{class:s,index:t,selectedValue:i,selected:o,value:r,label:a,disabled:l}=e,n=q(e,["class","index","selectedValue","selected","value","label","disabled"]);const d=void 0===i?[]:Array.isArray(i)?i:[i],h=o||d.includes(r);return g("option",Object.assign({class:w(D("option",{selected:Boolean(h),disabled:Boolean(l)}),s),selected:h,disabled:l,value:t},n),a)},I=({preKey:e,options:s,disabled:t,value:i,OptionProps:o={},OptionGroupProps:r={}})=>(null==s?void 0:s.length)?g(A,null,s.map(((s,a)=>{const l=[e,`-${a}`].join("");if("options"in s){const e=Boolean(t||s.disabled),{label:a}=s,n=q(s,["label"]);return g("optgroup",Object.assign({class:D("optgroup",{disabled:e}),key:l},r,{label:null==a?void 0:a.toString(),disabled:e}),g(I,Object.assign({OptionGroupProps:r,OptionProps:o,value:i,preKey:l},n,{disabled:e})))}return"value"in s?g(E,Object.assign({key:l},o,{index:l,selectedValue:i},s,{disabled:Boolean(t||s.disabled)})):null}))):null,V=e=>{const{class:s,msg:t,touched:i,disabled:o,required:r,options:a,value:l,OptionProps:n,OptionGroupProps:d,ariaDescribedBy:h,hideLabel:c,label:p}=e,u=q(e,["class","msg","touched","disabled","required","options","value","OptionProps","OptionGroupProps","ariaDescribedBy","hideLabel","label"]),b=Object.assign(Object.assign({class:w(D(Object.assign({disabled:Boolean(o),required:Boolean(r),touched:Boolean(i)},v(t,i)?{[y(t)]:!0}:{})),s),required:r,disabled:o},f({ariaDescribedBy:h,hideLabel:c,label:p})),u);return g("select",Object.assign({},b),g(I,{OptionGroupProps:d,OptionProps:n,disabled:o,options:a,value:l}))},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 j{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){t.apply(e,(e=>this.setRenderProp("accessKey",e))),B(e,this.getShortKeyProp())}applyShortKey(e){i.apply(e,(e=>this.setRenderProp("shortKey",e))),B(this.getAccessKeyProp(),e)}applyIcons(e){a.apply(e,(e=>this.setRenderProp("icons",e)))}applyMultiple(e){G(this._value,!0===e,"current"),p.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(),K(this.keyOptionMap,e),this.setRenderProp("value",T(this.getRenderProp("value"),e,this._multiple)))}))}applyRequired(e){u.apply(e,(e=>this.setRenderProp("required",e)))}applyRows(e){b.apply(e,(e=>this.setRenderProp("rows",e)))}applyTabIndex(e){o.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){r.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:t}=l({icons:this.getRenderProp("icons")});return g(O,Object.assign({},this.getFormFieldProps({class:w("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()}}),g(n,{disabled:e,msg:this.getRenderProp("msg"),touched:this.getRenderProp("touched"),startAdornment:s,endAdornment:t},g(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{h as s}from"@stencil/core/internal/client";import{s as i,X as t}from"./bem-registry.js";import{B as a}from"./base-web-component.js";import{b as e,e as o,a as h,
|
|
4
|
+
import{h as s}from"@stencil/core/internal/client";import{s as i,X as t}from"./bem-registry.js";import{B as 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,f as u,g 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 g}from"./component3.js";import{d as D}from"./disabled.js";import{i as K}from"./id.js";import"./props-from-config.js";import{l as T}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=s=>{s.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&&(i(s,this.ctaRef.el),t(s,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){D.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){K.apply(s,(s=>this.setRenderProp("id",s)))}applyInline(s){x.apply(s,(s=>this.setRenderProp("inline",s)))}applyLabel(s){T.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 i;g.apply(null!==(i=null!=s?s:t("buttonVariantDefault",this.host))&&void 0!==i?i:"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 s(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"@stencil/core/internal/client";import{B as s}from"./base-web-component.js";import{r as t,C as o}from"./component8.js";import"./bem-registry.js";import{l}from"./level.js";import{d as h,w as a}from"./width.js";import{
|
|
4
|
+
import{h as i}from"@stencil/core/internal/client";import{B as s}from"./base-web-component.js";import{r as t,C as o}from"./component8.js";import"./bem-registry.js";import{l}from"./level.js";import{d as h,w as a}from"./width.js";import{C as e,t as r}from"./props-from-config.js";import{l as n}from"./label-lang-segment.js";import{u as d,l as p,D as m,d as v}from"./scroll-lock.js";import{T as c}from"./behavior.js";import{c as u}from"./element-interaction.js";import{d as b,K as f}from"./events.js";import{h as g}from"./tooltip-open-tracking.js";const C={required:[n],optional:[h,l,e,a]},j=class extends s{constructor(){super(...arguments),this.dialogRef=u(),this.cardCloseButtonRef=u(),this.cardCloseTooltipBehavior=new c(this.stateAccess),this.propsConfig=C,this.handleCancel=i=>{var s,t;g(i),i.defaultPrevented||(null===(t=(s=this.getRenderProp("on")).onCancel)||void 0===t||t.call(s,i),i.defaultPrevented||this.host&&!b(this.host,f.cancel)&&i.preventDefault())},this.handleClose=i=>{var s,t,o,l;i.target===this.dialogRef.el&&(d(this),null===(t=(s=this.getRenderProp("on")).onClose)||void 0===t||t.call(s),null===(l=(o=this.getRenderProp("on")).onToggle)||void 0===l||l.call(o,!1),this.host&&(b(this.host,f.close),b(this.host,f.toggle)))},this.handleCardClose=()=>{this.cardCloseTooltipBehavior.hideTooltip(),this.closeDialog(),this.host&&b(this.host,f.close)}}initCardCloseButton(){this.cardCloseButtonProps=t(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){l.apply(i,(i=>this.setRenderProp("level",i)))}applyOn(i){h.apply(i,(i=>this.setRenderProp("on",i)))}applyVariant(i){e.apply(i,(i=>this.setRenderProp("variant",i)))}applyWidth(i){a.apply(i,(i=>this.setRenderProp("width",i)))}showDialog(i){var s,t,o,l;const h=this.dialogRef.el;(null==h?void 0:h.open)||(this.setState("modal",i),i?(null===(s=null==h?void 0:h.showModal)||void 0===s||s.call(h),h&&p(this)):null===(t=null==h?void 0:h.show)||void 0===t||t.call(h),null===(l=(o=this.getRenderProp("on")).onToggle)||void 0===l||l.call(o,!0),this.host&&b(this.host,f.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,{blockClass:v(s),handleCancel:this.handleCancel,handleClose:this.handleClose,label:r(this.getRenderProp("label")),labelledBy:t?this.getState("headingId"):void 0,modal:this.getState("modal"),refDialog:this.dialogRef,width:this.getRenderProp("width")},t?i(o,Object.assign({},this.buildCardProps()),this.renderSlot()):this.renderSlot())}};export{j 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,j}from"./component3.js";import{c as C,d as S,e as w}from"./component-names.js";import{t as _}from"./i18n.js";import{B as x}from"./component.js";import{B as O}from"./component10.js";import{I as $}from"./component5.js";import{L as F}from"./component6.js";import{r as L}from"./component7.js";import{S as I}from"./component12.js";import{T 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=_("kol-sort");return"number"==typeof t&&t>0?`${e} – ${_("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(O,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($,{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(D,{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(O,Object.assign({},t.getButtonFcProps(i,e)))):"link"===e.type?s("span",{key:i},s(F,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(C,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=_("kol-no-entries"),C=ut(d),S=vt(d.horizontal,o),w=Object.assign(Object.assign({},e),{fixedOffsets:yt(C.cells,S,a,y),maxCols:S,primaryHeaders:C,selectionModel:_t(v),translateNoEntries:k}),O=jt({data:o,dataFoot:l,headers:d,isFoot:!1,noEntriesLabel:k,primaryHeaders:C}),F=0===i.length;return s(x,{block:"kol-table",class:j(g,"table")},c&&t.renderSettings(d.horizontal),s("div",{ref:u,class:zt,tabindex:r?F?"-1":"0":void 0},s("table",{ref:p,"aria-labelledby":F?Pt:void 0,class:Kt,style:{minWidth:Ct(d)}},F&&s("caption",{class:Nt,id:Pt,ref:t=>{t&&(r?t.tabIndex=0:t.removeAttribute("tabindex"))}},L(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"},_("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=_(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"},_("kol-table-selection")),s("div",{class:Ot("selection",{checked:a,indeterminate:r})},s("label",{class:Ot("selection-label")},s($,{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(D,{label:c,badgeText:"",refFloating:()=>{}}))))})(w),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})})(w),Array.isArray(t)&&t.map(((t,o)=>Vt(w,t,e,o,!1)))))),Jt(w,"head",d.horizontal)]),s("tbody",{class:$t},s("div",{class:Ot("loader",{shown:b})},s(I,{label:_(b?"kol-table-data-loading":"kol-table-data-loaded").replace("{{caption}}",m(h)),show:b,variant:"cycle"})),O.map(((t,e)=>Gt(w,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)))])})(w))))},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=_("kol-table-settings"),l=_("kol-table-settings-cancel"),i=_("kol-table-settings-apply"),n=_("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=[],x=[],$=null;const F=()=>{var t;return null!==(t=x[x.length-1])&&void 0!==t?t:[]},L=t=>{x=x.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 $=n,void u();if(a){$=null,C=x.map((t=>t.map((t=>Object.assign({},t))))),u();const t=x.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])),x=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(O,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"},$&&s("div",{class:"kol-table-settings__error-message"},s(B,{alert:!1,closerAriaDescriptionId:k,handleCloserClick:te,hasCloser:!1,headingId:f,label:$,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(S,{_checked:!1!==t.visible,_label:_(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(w,{_hideLabel:!0,_value:Zt(t.width),_label:_("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(O,Object.assign({},p.get(`move-up-${t.key}`).getFcProps({_icons:"kolicon-chevron-up",_label:_(!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(O,Object.assign({},p.get(`move-down-${t.key}`).getFcProps({_icons:"kolicon-chevron-down",_label:_(!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(O,Object.assign({},p.get("cancel").getFcProps({_label:l,_variant:"secondary",_on:{onClick:()=>(x=C.map((t=>[...t])),$=null,u(),void v.close())}}))),s(O,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{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,C as y}from"./props-from-config.js";import{l as g}from"./label-lang-segment.js";import{v as k,j}from"./component3.js";import{c as C,d as S,e as w}from"./component-names.js";import{t as _}from"./i18n.js";import{B as x}from"./component.js";import{B as O}from"./component9.js";import{I as $}from"./component5.js";import{L as F}from"./component6.js";import{r as L}from"./component7.js";import{S as I}from"./component11.js";import{T as D}from"./component10.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=_("kol-sort");return"number"==typeof t&&t>0?`${e} – ${_("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(O,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($,{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(D,{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(O,Object.assign({},t.getButtonFcProps(i,e)))):"link"===e.type?s("span",{key:i},s(F,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(C,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=_("kol-no-entries"),C=ut(d),S=vt(d.horizontal,o),w=Object.assign(Object.assign({},e),{fixedOffsets:yt(C.cells,S,a,y),maxCols:S,primaryHeaders:C,selectionModel:_t(v),translateNoEntries:k}),O=jt({data:o,dataFoot:l,headers:d,isFoot:!1,noEntriesLabel:k,primaryHeaders:C}),F=0===i.length;return s(x,{block:"kol-table",class:j(g,"table")},c&&t.renderSettings(d.horizontal),s("div",{ref:u,class:zt,tabindex:r?F?"-1":"0":void 0},s("table",{ref:p,"aria-labelledby":F?Pt:void 0,class:Kt,style:{minWidth:Ct(d)}},F&&s("caption",{class:Nt,id:Pt,ref:t=>{t&&(r?t.tabIndex=0:t.removeAttribute("tabindex"))}},L(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"},_("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=_(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"},_("kol-table-selection")),s("div",{class:Ot("selection",{checked:a,indeterminate:r})},s("label",{class:Ot("selection-label")},s($,{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(D,{label:c,badgeText:"",refFloating:()=>{}}))))})(w),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})})(w),Array.isArray(t)&&t.map(((t,o)=>Vt(w,t,e,o,!1)))))),Jt(w,"head",d.horizontal)]),s("tbody",{class:$t},s("div",{class:Ot("loader",{shown:b})},s(I,{label:_(b?"kol-table-data-loading":"kol-table-data-loaded").replace("{{caption}}",m(h)),show:b,variant:"cycle"})),O.map(((t,e)=>Gt(w,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)))])})(w))))},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=_("kol-table-settings"),l=_("kol-table-settings-cancel"),i=_("kol-table-settings-apply"),n=_("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=[],x=[],$=null;const F=()=>{var t;return null!==(t=x[x.length-1])&&void 0!==t?t:[]},L=t=>{x=x.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 $=n,void u();if(a){$=null,C=x.map((t=>t.map((t=>Object.assign({},t))))),u();const t=x.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])),x=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(O,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"},$&&s("div",{class:"kol-table-settings__error-message"},s(B,{alert:!1,closerAriaDescriptionId:k,handleCloserClick:te,hasCloser:!1,headingId:f,label:$,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(S,{_checked:!1!==t.visible,_label:_(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(w,{_hideLabel:!0,_value:Zt(t.width),_label:_("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(O,Object.assign({},p.get(`move-up-${t.key}`).getFcProps({_icons:"kolicon-chevron-up",_label:_(!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(O,Object.assign({},p.get(`move-down-${t.key}`).getFcProps({_icons:"kolicon-chevron-down",_label:_(!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(O,Object.assign({},p.get("cancel").getFcProps({_label:l,_variant:"secondary",_on:{onClick:()=>(x=C.map((t=>[...t])),$=null,u(),void v.close())}}))),s(O,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}
|
|
@@ -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{c as o}from"./component11.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"],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 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?[j(l)]:function(t){const e=j(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:L;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=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 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 L=R/2-O/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,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 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(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,Lt as T,u as a,kt as b,At as c}
|
|
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{c as o}from"./component10.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"],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 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?[j(l)]:function(t){const e=j(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:L;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=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 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 L=R/2-O/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,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 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(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,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"./bem-registry.js";import{c as e,n as r,
|
|
4
|
+
import{a as t}from"./dev.utils.js";import"./bem-registry.js";import{c as e,n as r,j as i,b as a,i as h}from"./props-from-config.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}`)})),g={optional:[s,c,u]},l=(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,g),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=[l(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}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{g as t}from"./bootstrap.js";import{F as e,g as i,l as s}from"./bem-registry.js";import{c as o,b as a}from"./props-from-config.js";import{n}from"./
|
|
4
|
+
import{g as t}from"./bootstrap.js";import{F as e,g as i,l as s}from"./bem-registry.js";import{c as o,b as a}from"./props-from-config.js";import{n}from"./component9.js";import{B as r}from"./behavior.js";const l=o("ariaDetails","",a),c=o("syncValueBySelector",void 0,a),u={optional:[l,n,c]},h=new Set(["KOL-COMBOBOX","KOL-INPUT-CHECKBOX","KOL-INPUT-COLOR","KOL-INPUT-DATE","KOL-INPUT-EMAIL","KOL-INPUT-FILE","KOL-INPUT-NUMBER","KOL-INPUT-PASSWORD","KOL-INPUT-RADIO","KOL-INPUT-RANGE","KOL-INPUT-TEXT","KOL-SELECT","KOL-SINGLE-SELECT","KOL-TEXTAREA"]);class d extends r{constructor(s,{host:o,type:a,name:n}){var r,l,c,d,f;super(s,u),this.experimentalMode=e(),this.setFormAssociatedValue=t=>{var e;const s=null===(e=this.formAssociated)||void 0===e?void 0:e.getAttribute("name");null!==s&&""!==s||i(` The form field (${this.type}) must have a name attribute to be form-associated. Please define the _name attribute.`);const o=this.tryToStringifyValue(t);this.syncValue(t,o,this.formAssociated),this.syncValue(t,o,this.syncToOwnInput)},this.host=this.findHostWithShadowRoot(o),this.type=a,(null===(r=t())||void 0===r?void 0:r.reflectInputValues)&&h.has(null!==(c=null===(l=this.host)||void 0===l?void 0:l.tagName)&&void 0!==c?c:"")&&n&&(null===(d=this.host)||void 0===d||d.querySelectorAll("input,select,textarea").forEach((t=>{var e;null===(e=this.host)||void 0===e||e.removeChild(t)})),this.formAssociated=this.createFormAssociatedElement(),this.formAssociated.setAttribute("data-form-associated",""),this.formAssociated.setAttribute("hidden",""),null===(f=this.host)||void 0===f||f.appendChild(this.formAssociated))}componentWillLoad(t){this.watchName(t.name),this.watchSyncValueBySelector(t.syncValueBySelector),this.watchAriaDetails(t.ariaDetails)}watchAriaDetails(t){l.apply(t,(t=>this.setRenderProp("ariaDetails",t)))}watchName(t){n.apply(t,(t=>{this.setRenderProp("name",t),this.setNameAttribute(t)})),void 0===t&&i("A name on input fields or switches is not strictly required, but it might be relevant for the autocomplete function and for the static submission of the input field.")}watchSyncValueBySelector(t){if(this.experimentalMode&&"string"==typeof t){this.setRenderProp("syncValueBySelector",t);const e=document.querySelector(t);e&&(this.syncToOwnInput=e)}}setNameAttribute(t){this.setAttribute("name",this.formAssociated,t)}createFormAssociatedElement(){switch(this.type){case"color":case"date":case"email":case"file":case"number":case"password":case"radio":case"range":case"text":{const t=document.createElement("input");return t.setAttribute("type",this.type),t}case"select":{const t=document.createElement("select");return t.setAttribute("multiple",""),t}case"textarea":return document.createElement("textarea");default:{const t=document.createElement("input");return t.setAttribute("type","hidden"),t}}}findHostWithShadowRoot(t){for(;null===(null==t?void 0:t.shadowRoot)&&t!==document.body;){const e=t.parentNode;t=11===(null==e?void 0:e.nodeType)&&"host"in e?e.host:1===(null==e?void 0:e.nodeType)?e:void 0}return t}setAttribute(t,e,i){if(this.experimentalMode)try{if("boolean"!=typeof(i="object"==typeof i&&null!==i?JSON.stringify(i):i)&&"number"!=typeof i&&"string"!=typeof i)throw new Error("Invalid value type: "+typeof i);null==e||e.setAttribute(t,`${i}`)}catch(i){null==e||e.removeAttribute(t)}}tryToStringifyValue(t){try{return"object"==typeof t&&null!==t?JSON.stringify(t).toString():null==t?null:t.toString()}catch(t){return s(`The form field raw value is not able to stringify! ${t}`),""}}syncValue(t,e,i){if(i)switch(this.type){case"file":"undefined"!=typeof FileList&&t instanceof FileList?i.files=t:i.value="";break;case"select":"SELECT"===i.tagName?this.syncSelectOptions(t,i):this.syncValueAttribute(e,i);break;case"radio":"string"==typeof e&&(i.setAttribute("value",e),i.setAttribute("checked",""),i.value=e);break;default:this.syncValueAttribute(e,i)}}syncSelectOptions(t,e){e.querySelectorAll("option").forEach((t=>{e.removeChild(t)})),(Array.isArray(t)?t:null==t?[]:[t]).forEach((t=>{const i=this.tryToStringifyValue(t);if("string"==typeof i){const t=document.createElement("option");t.setAttribute("value",i),t.setAttribute("selected",""),e.appendChild(t)}}))}syncValueAttribute(t,e){"string"==typeof t?(e.setAttribute("value",t),e.value=t):(e.removeAttribute("value"),e.value="")}}export{d as F,l as a}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{c as o}from"./
|
|
4
|
+
import{c as o}from"./component10.js";import{h as i}from"@stencil/core/internal/client";import{B as t}from"./component.js";import{B as s}from"./component9.js";import{a as e}from"./tslib.es6.js";import{b as r}from"./bem-registry.js";import{c as a}from"./clsx.js";import{a as n,B as l,b as p,c as h}from"./behavior.js";import"./props-from-config.js";const c=o("popoverAlign","bottom"),d=r.forBlock("kol-popover"),m=(o,t)=>{const{align:s="bottom",popoverRef:r,arrowRef:n,class:l}=o,p=e(o,["align","popoverRef","arrowRef","class"]);return i("div",Object.assign({},p,{class:a(d(),l),ref:r,popover:"auto"}),i("div",{class:a(d("arrow"),d("arrow",{[s]:!0})),ref:n}),t.length>0?t:i("slot",null))},f=(o,e)=>{const{accessKey:r,ariaDescription:a,ariaDescriptionId:n,ariaHasPopup:l,ariaSelected:p,customClass:h,disabled:c,handleBlur:d,handleClick:f,handleFocus:v,handleMouseDown:u,hideLabel:b,icons:g,id:y,inline:w,label:j,name:k,on:B,popoverAlign:x,popoverOpen:A,popoverId:D,ref:C,refButton:I,refPopover:R,refTooltip:E,role:K,shortKey:P,tabIndex:_,tooltipAlign:F,type:L,variant:S}=o;return i(t,{block:"kol-popover-button",class:o.class,ref:C,modifiers:{open:A,inline:!0===w}},i(s,{accessKey:r,ariaControls:D,ariaDescription:a,ariaDescriptionId:n,ariaExpanded:A?"true":"false",ariaHasPopup:l,ariaSelected:p,customClass:h,disabled:c,handleBlur:d,handleClick:f,handleFocus:v,handleMouseDown:u,hideLabel:b,icons:g,id:y,inline:w,label:j,name:k,on:B,refButton:I,refTooltip:E,role:K,shortKey:P,tabIndex:_,tooltipAlign:F,type:L,variant:S}),i(m,{align:x,class:"kol-popover-button__popover",id:D,popoverRef:R},e))},v={optional:[n]};class u extends l{constructor(o){super(o,v),this.show=!1,this.setPopoverElementRef=o=>{this.popoverElement=o,this.arrowElement=null==o?void 0:o.querySelector(".kol-popover__arrow")},this.setTriggerElement=o=>{this.triggerElement=o},this.alignPopover=async()=>{this.popoverElement&&this.triggerElement&&await p({align:this.getRenderProp("align"),referenceElement:this.triggerElement,arrowElement:this.arrowElement,floatingElement:this.popoverElement})},this.setupAutoUpdate=()=>{this.popoverElement&&this.triggerElement&&!this.cleanupAutoUpdate&&(this.cleanupAutoUpdate=h(this.triggerElement,this.popoverElement,(()=>{this.alignPopover()})))}}componentWillLoad(o){this.watchAlign(o.align)}watchAlign(o){n.apply(o,(o=>{this.setRenderProp("align",o)}))}setShow(o){this.show=o,this.popoverElement&&(this.popoverElement.isConnected?this.toggleVisibility():requestAnimationFrame((()=>{this.toggleVisibility()})))}destroy(){var o;null===(o=this.cleanupAutoUpdate)||void 0===o||o.call(this),this.cleanupAutoUpdate=void 0,this.popoverElement=void 0,this.arrowElement=void 0,this.triggerElement=void 0}toggleVisibility(){var o;if(!this.popoverElement)return;const i=this.popoverElement.matches(":popover-open");if(this.show){if(!i)try{this.popoverElement.showPopover(),this.setupAutoUpdate(),this.alignPopover()}catch(o){}}else if(i)try{this.popoverElement.hidePopover(),null===(o=this.cleanupAutoUpdate)||void 0===o||o.call(this),this.cleanupAutoUpdate=void 0}catch(o){}}}export{f as P,u as a,c as p}
|