@public-ui/components 3.0.4-rc.2 → 3.0.5-rc.0
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/custom-elements.json +1 -1
- package/dist/cjs/{Alert-Cn__GHrm.js → Alert-C3vof8gc.js} +1 -1
- package/dist/cjs/{Alert-Cn__GHrm.js.map → Alert-C3vof8gc.js.map} +1 -1
- package/dist/cjs/{Collapsible-DWSzDd1Q.js → Collapsible-BwQQh0mz.js} +1 -1
- package/dist/cjs/{Collapsible-DWSzDd1Q.js.map → Collapsible-BwQQh0mz.js.map} +1 -1
- package/dist/cjs/{CustomSuggestionsToggle-BOZ7gyXg.js → CustomSuggestionsToggle-B-bTmnBQ.js} +1 -1
- package/dist/cjs/{CustomSuggestionsToggle-BOZ7gyXg.js.map → CustomSuggestionsToggle-B-bTmnBQ.js.map} +1 -1
- package/dist/cjs/{FieldControlStateWrapper-BeahuAj_.js → FieldControlStateWrapper-Cmlj42uN.js} +1 -1
- package/dist/cjs/{FieldControlStateWrapper-BeahuAj_.js.map → FieldControlStateWrapper-Cmlj42uN.js.map} +1 -1
- package/dist/cjs/{FormFieldStateWrapper-CxVodEer.js → FormFieldStateWrapper-B3KooWZ3.js} +1 -1
- package/dist/cjs/{FormFieldStateWrapper-CxVodEer.js.map → FormFieldStateWrapper-B3KooWZ3.js.map} +1 -1
- package/dist/cjs/{Heading-Bc6J6UAU.js → Heading-BXbctWBt.js} +1 -1
- package/dist/{kolibri/Heading-Bx4SwJcX.js.map → cjs/Heading-BXbctWBt.js.map} +1 -1
- package/dist/cjs/{Icon-Dg77uirk.js → Icon-ttrOpSx4.js} +1 -1
- package/dist/cjs/{Icon-Dg77uirk.js.map → Icon-ttrOpSx4.js.map} +1 -1
- package/dist/cjs/Input-jk9vBtZy.js +4 -0
- package/dist/cjs/{Input-CPvmrua5.js.map → Input-jk9vBtZy.js.map} +1 -1
- package/dist/cjs/{InputStateWrapper-By2JfkJ_.js → InputStateWrapper-BUpZkpZ4.js} +1 -1
- package/dist/cjs/{InputStateWrapper-By2JfkJ_.js.map → InputStateWrapper-BUpZkpZ4.js.map} +1 -1
- package/dist/cjs/{InternalUnderlinedBadgeText-BbxT_Yo-.js → InternalUnderlinedBadgeText-B9JCUpQ0.js} +1 -1
- package/dist/cjs/{InternalUnderlinedBadgeText-BbxT_Yo-.js.map → InternalUnderlinedBadgeText-B9JCUpQ0.js.map} +1 -1
- package/dist/cjs/{Span-MNppCFVc.js → Span-B82DoaCk.js} +1 -1
- package/dist/cjs/{Span-MNppCFVc.js.map → Span-B82DoaCk.js.map} +1 -1
- package/dist/cjs/{app-globals-C8rtNS_J.js → app-globals-BBL5j1Pg.js} +1 -1
- package/dist/cjs/{app-globals-C8rtNS_J.js.map → app-globals-BBL5j1Pg.js.map} +1 -1
- package/dist/cjs/{associated.controller-DliVZLxU.js → associated.controller-DCjDhSZx.js} +1 -1
- package/dist/cjs/{associated.controller-DliVZLxU.js.map → associated.controller-DCjDhSZx.js.map} +1 -1
- package/dist/cjs/bootstrap-CtGLo8kW.js +4 -0
- package/dist/cjs/bootstrap-CtGLo8kW.js.map +1 -0
- package/dist/cjs/{controller-sflaowcD.js → controller-Ck-2hdGT.js} +1 -1
- package/dist/cjs/{controller-sflaowcD.js.map → controller-Ck-2hdGT.js.map} +1 -1
- package/dist/cjs/{controller-Clj3g7Ir.js → controller-CspoQhj4.js} +1 -1
- package/dist/cjs/{controller-Clj3g7Ir.js.map → controller-CspoQhj4.js.map} +1 -1
- package/dist/cjs/{controller-DVUhQuWI.js → controller-VVml6XNp.js} +1 -1
- package/dist/cjs/{controller-DVUhQuWI.js.map → controller-VVml6XNp.js.map} +1 -1
- package/dist/cjs/{controller-icon-BsFjV1Wt.js → controller-icon-5A-2C49Q.js} +1 -1
- package/dist/cjs/{controller-icon-BsFjV1Wt.js.map → controller-icon-5A-2C49Q.js.map} +1 -1
- package/dist/cjs/{dev.utils-B6gnx5E0.js → dev.utils-BmcUr5ps.js} +1 -1
- package/dist/cjs/{dev.utils-B6gnx5E0.js.map → dev.utils-BmcUr5ps.js.map} +1 -1
- package/dist/cjs/{devtools-DrXKZZc4.js → devtools-D1oXS0lZ.js} +1 -1
- package/dist/cjs/{devtools-DrXKZZc4.js.map → devtools-D1oXS0lZ.js.map} +1 -1
- package/dist/cjs/{index-DNUwdCyW.js → index-DZ4EBybr.js} +1 -1
- package/dist/cjs/{index-DNUwdCyW.js.map → index-DZ4EBybr.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
- package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kol-alert-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-alert.cjs.entry.js +1 -1
- package/dist/cjs/kol-avatar-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-avatar.cjs.entry.js +1 -1
- package/dist/cjs/kol-badge.cjs.entry.js +1 -1
- package/dist/cjs/kol-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/kol-button-link.cjs.entry.js +1 -1
- package/dist/cjs/kol-button-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-button.cjs.entry.js +1 -1
- package/dist/cjs/kol-card-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-card.cjs.entry.js +1 -1
- package/dist/cjs/kol-combobox.cjs.entry.js +1 -1
- package/dist/cjs/kol-details.cjs.entry.js +1 -1
- package/dist/cjs/kol-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kol-form.cjs.entry.js +1 -1
- package/dist/cjs/kol-heading.cjs.entry.js +1 -1
- package/dist/cjs/kol-icon.cjs.entry.js +1 -1
- package/dist/cjs/kol-image.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
- package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
- package/dist/cjs/kol-link-button.cjs.entry.js +1 -1
- package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-link.cjs.entry.js +1 -1
- package/dist/cjs/kol-modal.cjs.entry.js +1 -1
- package/dist/cjs/kol-nav.cjs.entry.js +1 -1
- package/dist/cjs/kol-pagination-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
- package/dist/cjs/kol-popover-button-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-popover-button.cjs.entry.js +1 -1
- package/dist/cjs/kol-popover-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-progress.cjs.entry.js +1 -1
- package/dist/cjs/kol-quote.cjs.entry.js +1 -1
- package/dist/cjs/kol-select.cjs.entry.js +1 -1
- package/dist/cjs/kol-single-select.cjs.entry.js +1 -1
- package/dist/cjs/kol-skip-nav.cjs.entry.js +1 -1
- package/dist/cjs/kol-spin.cjs.entry.js +1 -1
- package/dist/cjs/kol-split-button.cjs.entry.js +1 -1
- package/dist/cjs/kol-table-settings-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-table-stateful.cjs.entry.js +1 -1
- package/dist/cjs/kol-table-stateless-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-table-stateless.cjs.entry.js +1 -1
- package/dist/cjs/kol-tabs.cjs.entry.js +1 -1
- package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
- package/dist/cjs/kol-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/kol-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/kol-tooltip-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-tree-item-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-tree-item.cjs.entry.js +1 -1
- package/dist/cjs/kol-tree-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-tree.cjs.entry.js +1 -1
- package/dist/cjs/kol-version.cjs.entry.js +1 -1
- package/dist/cjs/kolibri.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/test-component.cjs.entry.js +1 -1
- package/dist/components/Heading.js.map +1 -1
- package/dist/components/bootstrap.js +1 -1
- package/dist/components/bootstrap.js.map +1 -1
- package/dist/esm/{Alert-CSRc8Vlr.js → Alert-C9KodDn-.js} +1 -1
- package/dist/{kolibri/Alert-CSRc8Vlr.js.map → esm/Alert-C9KodDn-.js.map} +1 -1
- package/dist/esm/{Collapsible--TI2kjff.js → Collapsible-DFegUHMu.js} +1 -1
- package/dist/esm/{Collapsible--TI2kjff.js.map → Collapsible-DFegUHMu.js.map} +1 -1
- package/dist/esm/{CustomSuggestionsToggle-uDye4Uns.js → CustomSuggestionsToggle-YLF12END.js} +1 -1
- package/dist/{kolibri/CustomSuggestionsToggle-uDye4Uns.js.map → esm/CustomSuggestionsToggle-YLF12END.js.map} +1 -1
- package/dist/esm/{FieldControlStateWrapper-CsCnsDKf.js → FieldControlStateWrapper-DlhKEQYv.js} +1 -1
- package/dist/{kolibri/FieldControlStateWrapper-CsCnsDKf.js.map → esm/FieldControlStateWrapper-DlhKEQYv.js.map} +1 -1
- package/dist/esm/{FormFieldStateWrapper-JzdOEGUS.js → FormFieldStateWrapper-CGvaBC47.js} +1 -1
- package/dist/{kolibri/FormFieldStateWrapper-JzdOEGUS.js.map → esm/FormFieldStateWrapper-CGvaBC47.js.map} +1 -1
- package/dist/esm/{Heading-Bx4SwJcX.js → Heading-BPYmDTUk.js} +1 -1
- package/dist/{cjs/Heading-Bc6J6UAU.js.map → esm/Heading-BPYmDTUk.js.map} +1 -1
- package/dist/esm/Icon-CPJLro7v.js +4 -0
- package/dist/esm/{Icon-B4HuRse0.js.map → Icon-CPJLro7v.js.map} +1 -1
- package/dist/esm/Input-DjC4bpJ5.js +4 -0
- package/dist/{kolibri/Input-Bfru3WQI.js.map → esm/Input-DjC4bpJ5.js.map} +1 -1
- package/dist/esm/{InputStateWrapper-DHAUSNAA.js → InputStateWrapper-C2VyGe6a.js} +1 -1
- package/dist/esm/{InputStateWrapper-DHAUSNAA.js.map → InputStateWrapper-C2VyGe6a.js.map} +1 -1
- package/dist/esm/InternalUnderlinedBadgeText-Cx9AyLre.js +4 -0
- package/dist/esm/{InternalUnderlinedBadgeText-uelJXiTq.js.map → InternalUnderlinedBadgeText-Cx9AyLre.js.map} +1 -1
- package/dist/esm/{Span-BRnL3F2G.js → Span-BebyS5Q1.js} +1 -1
- package/dist/esm/{Span-BRnL3F2G.js.map → Span-BebyS5Q1.js.map} +1 -1
- package/dist/esm/{app-globals-DHfxkIVm.js → app-globals-CESfn_CS.js} +1 -1
- package/dist/esm/{app-globals-DHfxkIVm.js.map → app-globals-CESfn_CS.js.map} +1 -1
- package/dist/esm/{associated.controller-BBBKf7S0.js → associated.controller-BVXWSO2G.js} +1 -1
- package/dist/esm/{associated.controller-BBBKf7S0.js.map → associated.controller-BVXWSO2G.js.map} +1 -1
- package/dist/esm/bootstrap-YDZ8Qb_h.js +4 -0
- package/dist/esm/bootstrap-YDZ8Qb_h.js.map +1 -0
- package/dist/esm/{controller-DzWd1W_P.js → controller-BhAbvioO.js} +1 -1
- package/dist/esm/{controller-DzWd1W_P.js.map → controller-BhAbvioO.js.map} +1 -1
- package/dist/esm/{controller-DYOqWrFp.js → controller-DOh6Y7if.js} +1 -1
- package/dist/esm/{controller-DYOqWrFp.js.map → controller-DOh6Y7if.js.map} +1 -1
- package/dist/esm/{controller-B3yN4MUJ.js → controller-DR6tEetQ.js} +1 -1
- package/dist/esm/{controller-B3yN4MUJ.js.map → controller-DR6tEetQ.js.map} +1 -1
- package/dist/esm/{controller-icon-BQ1Jj9uA.js → controller-icon-Dak8u7ck.js} +1 -1
- package/dist/{kolibri/controller-icon-BQ1Jj9uA.js.map → esm/controller-icon-Dak8u7ck.js.map} +1 -1
- package/dist/esm/{dev.utils-C5gRSnou.js → dev.utils-CMSYtmAz.js} +1 -1
- package/dist/esm/{dev.utils-C5gRSnou.js.map → dev.utils-CMSYtmAz.js.map} +1 -1
- package/dist/esm/{devtools-o8Bbxfop.js → devtools-CDwLKwYR.js} +1 -1
- package/dist/esm/{devtools-o8Bbxfop.js.map → devtools-CDwLKwYR.js.map} +1 -1
- package/dist/esm/{index-DeYD98_2.js → index-BRWth_lT.js} +1 -1
- package/dist/esm/{index-DeYD98_2.js.map → index-BRWth_lT.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kol-abbr.entry.js +1 -1
- package/dist/esm/kol-accordion.entry.js +1 -1
- package/dist/esm/kol-alert-wc.entry.js +1 -1
- package/dist/esm/kol-alert.entry.js +1 -1
- package/dist/esm/kol-avatar-wc.entry.js +1 -1
- package/dist/esm/kol-avatar.entry.js +1 -1
- package/dist/esm/kol-badge.entry.js +1 -1
- package/dist/esm/kol-breadcrumb.entry.js +1 -1
- package/dist/esm/kol-button-link.entry.js +1 -1
- package/dist/esm/kol-button-wc.entry.js +1 -1
- package/dist/esm/kol-button.entry.js +1 -1
- package/dist/esm/kol-card-wc.entry.js +1 -1
- package/dist/esm/kol-card.entry.js +1 -1
- package/dist/esm/kol-combobox.entry.js +1 -1
- package/dist/esm/kol-details.entry.js +1 -1
- package/dist/esm/kol-drawer.entry.js +1 -1
- package/dist/esm/kol-form.entry.js +1 -1
- package/dist/esm/kol-heading.entry.js +1 -1
- package/dist/esm/kol-icon.entry.js +1 -1
- package/dist/esm/kol-image.entry.js +1 -1
- package/dist/esm/kol-input-checkbox.entry.js +1 -1
- package/dist/esm/kol-input-color.entry.js +1 -1
- package/dist/esm/kol-input-date.entry.js +1 -1
- package/dist/esm/kol-input-email.entry.js +1 -1
- package/dist/esm/kol-input-file.entry.js +1 -1
- package/dist/esm/kol-input-number.entry.js +1 -1
- package/dist/esm/kol-input-password.entry.js +1 -1
- package/dist/esm/kol-input-radio.entry.js +1 -1
- package/dist/esm/kol-input-range.entry.js +1 -1
- package/dist/esm/kol-input-text.entry.js +1 -1
- package/dist/esm/kol-kolibri.entry.js +1 -1
- package/dist/esm/kol-link-button.entry.js +1 -1
- package/dist/esm/kol-link-wc.entry.js +1 -1
- package/dist/esm/kol-link.entry.js +1 -1
- package/dist/esm/kol-modal.entry.js +1 -1
- package/dist/esm/kol-nav.entry.js +1 -1
- package/dist/esm/kol-pagination-wc.entry.js +1 -1
- package/dist/esm/kol-pagination.entry.js +1 -1
- package/dist/esm/kol-popover-button-wc.entry.js +1 -1
- package/dist/esm/kol-popover-button.entry.js +1 -1
- package/dist/esm/kol-popover-wc.entry.js +1 -1
- package/dist/esm/kol-progress.entry.js +1 -1
- package/dist/esm/kol-quote.entry.js +1 -1
- package/dist/esm/kol-select.entry.js +1 -1
- package/dist/esm/kol-single-select.entry.js +1 -1
- package/dist/esm/kol-skip-nav.entry.js +1 -1
- package/dist/esm/kol-spin.entry.js +1 -1
- package/dist/esm/kol-split-button.entry.js +1 -1
- package/dist/esm/kol-table-settings-wc.entry.js +1 -1
- package/dist/esm/kol-table-stateful.entry.js +1 -1
- package/dist/esm/kol-table-stateless-wc.entry.js +1 -1
- package/dist/esm/kol-table-stateless.entry.js +1 -1
- package/dist/esm/kol-tabs.entry.js +1 -1
- package/dist/esm/kol-textarea.entry.js +1 -1
- package/dist/esm/kol-toast-container.entry.js +1 -1
- package/dist/esm/kol-toolbar.entry.js +1 -1
- package/dist/esm/kol-tooltip-wc.entry.js +1 -1
- package/dist/esm/kol-tree-item-wc.entry.js +1 -1
- package/dist/esm/kol-tree-item.entry.js +1 -1
- package/dist/esm/kol-tree-wc.entry.js +1 -1
- package/dist/esm/kol-tree.entry.js +1 -1
- package/dist/esm/kol-version.entry.js +1 -1
- package/dist/esm/kolibri.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/test-component.entry.js +1 -1
- package/dist/kolibri/{Alert-CSRc8Vlr.js → Alert-C9KodDn-.js} +1 -1
- package/dist/{esm/Alert-CSRc8Vlr.js.map → kolibri/Alert-C9KodDn-.js.map} +1 -1
- package/dist/kolibri/{Collapsible--TI2kjff.js → Collapsible-DFegUHMu.js} +1 -1
- package/dist/kolibri/{Collapsible--TI2kjff.js.map → Collapsible-DFegUHMu.js.map} +1 -1
- package/dist/kolibri/{CustomSuggestionsToggle-uDye4Uns.js → CustomSuggestionsToggle-YLF12END.js} +1 -1
- package/dist/{esm/CustomSuggestionsToggle-uDye4Uns.js.map → kolibri/CustomSuggestionsToggle-YLF12END.js.map} +1 -1
- package/dist/kolibri/FieldControlStateWrapper-DlhKEQYv.js +4 -0
- package/dist/{esm/FieldControlStateWrapper-CsCnsDKf.js.map → kolibri/FieldControlStateWrapper-DlhKEQYv.js.map} +1 -1
- package/dist/kolibri/{FormFieldStateWrapper-JzdOEGUS.js → FormFieldStateWrapper-CGvaBC47.js} +1 -1
- package/dist/{esm/FormFieldStateWrapper-JzdOEGUS.js.map → kolibri/FormFieldStateWrapper-CGvaBC47.js.map} +1 -1
- package/dist/kolibri/{Heading-Bx4SwJcX.js → Heading-BPYmDTUk.js} +1 -1
- package/dist/{esm/Heading-Bx4SwJcX.js.map → kolibri/Heading-BPYmDTUk.js.map} +1 -1
- package/dist/kolibri/Icon-CPJLro7v.js +4 -0
- package/dist/kolibri/{Icon-B4HuRse0.js.map → Icon-CPJLro7v.js.map} +1 -1
- package/dist/kolibri/Input-DjC4bpJ5.js +4 -0
- package/dist/{esm/Input-Bfru3WQI.js.map → kolibri/Input-DjC4bpJ5.js.map} +1 -1
- package/dist/kolibri/{InputStateWrapper-DHAUSNAA.js → InputStateWrapper-C2VyGe6a.js} +1 -1
- package/dist/kolibri/{InputStateWrapper-DHAUSNAA.js.map → InputStateWrapper-C2VyGe6a.js.map} +1 -1
- package/dist/kolibri/{InternalUnderlinedBadgeText-uelJXiTq.js → InternalUnderlinedBadgeText-Cx9AyLre.js} +1 -1
- package/dist/kolibri/{InternalUnderlinedBadgeText-uelJXiTq.js.map → InternalUnderlinedBadgeText-Cx9AyLre.js.map} +1 -1
- package/dist/kolibri/{Span-BRnL3F2G.js → Span-BebyS5Q1.js} +1 -1
- package/dist/kolibri/{Span-BRnL3F2G.js.map → Span-BebyS5Q1.js.map} +1 -1
- package/dist/kolibri/{app-globals-DHfxkIVm.js → app-globals-CESfn_CS.js} +1 -1
- package/dist/kolibri/{app-globals-DHfxkIVm.js.map → app-globals-CESfn_CS.js.map} +1 -1
- package/dist/kolibri/{associated.controller-BBBKf7S0.js → associated.controller-BVXWSO2G.js} +1 -1
- package/dist/kolibri/{associated.controller-BBBKf7S0.js.map → associated.controller-BVXWSO2G.js.map} +1 -1
- package/dist/kolibri/bootstrap-YDZ8Qb_h.js +4 -0
- package/dist/kolibri/bootstrap-YDZ8Qb_h.js.map +1 -0
- package/dist/kolibri/{controller-DzWd1W_P.js → controller-BhAbvioO.js} +1 -1
- package/dist/kolibri/{controller-DzWd1W_P.js.map → controller-BhAbvioO.js.map} +1 -1
- package/dist/kolibri/{controller-DYOqWrFp.js → controller-DOh6Y7if.js} +1 -1
- package/dist/kolibri/{controller-DYOqWrFp.js.map → controller-DOh6Y7if.js.map} +1 -1
- package/dist/kolibri/{controller-B3yN4MUJ.js → controller-DR6tEetQ.js} +1 -1
- package/dist/kolibri/{controller-B3yN4MUJ.js.map → controller-DR6tEetQ.js.map} +1 -1
- package/dist/kolibri/{controller-icon-BQ1Jj9uA.js → controller-icon-Dak8u7ck.js} +1 -1
- package/dist/{esm/controller-icon-BQ1Jj9uA.js.map → kolibri/controller-icon-Dak8u7ck.js.map} +1 -1
- package/dist/kolibri/{dev.utils-C5gRSnou.js → dev.utils-CMSYtmAz.js} +1 -1
- package/dist/kolibri/{dev.utils-C5gRSnou.js.map → dev.utils-CMSYtmAz.js.map} +1 -1
- package/dist/kolibri/{devtools-o8Bbxfop.js → devtools-CDwLKwYR.js} +1 -1
- package/dist/kolibri/{devtools-o8Bbxfop.js.map → devtools-CDwLKwYR.js.map} +1 -1
- package/dist/kolibri/{index-DeYD98_2.js → index-BRWth_lT.js} +1 -1
- package/dist/kolibri/{index-DeYD98_2.js.map → index-BRWth_lT.js.map} +1 -1
- package/dist/kolibri/index.esm.js +1 -1
- package/dist/kolibri/kol-abbr.entry.js +1 -1
- package/dist/kolibri/kol-accordion.entry.js +1 -1
- package/dist/kolibri/kol-alert-wc.entry.js +1 -1
- package/dist/kolibri/kol-alert.entry.js +1 -1
- package/dist/kolibri/kol-avatar-wc.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-wc.entry.js +1 -1
- package/dist/kolibri/kol-button.entry.js +1 -1
- package/dist/kolibri/kol-card-wc.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-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-wc.entry.js +1 -1
- package/dist/kolibri/kol-link-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-link.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-wc.entry.js +1 -1
- package/dist/kolibri/kol-pagination.entry.js +1 -1
- package/dist/kolibri/kol-popover-button-wc.entry.js +1 -1
- package/dist/kolibri/kol-popover-button.entry.js +1 -1
- package/dist/kolibri/kol-popover-wc.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-settings-wc.entry.js +1 -1
- package/dist/kolibri/kol-table-stateful.entry.js +1 -1
- package/dist/kolibri/kol-table-stateless-wc.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-wc.entry.js +1 -1
- package/dist/kolibri/kol-tree-item.entry.js +1 -1
- package/dist/kolibri/kol-tree-wc.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/test-component.entry.js +1 -1
- package/dist/types/functional-components/Heading/Heading.d.ts +2 -1
- package/package.json +1 -1
- package/dist/cjs/Input-CPvmrua5.js +0 -4
- package/dist/cjs/bootstrap-CKtJWjuP.js +0 -4
- package/dist/cjs/bootstrap-CKtJWjuP.js.map +0 -1
- package/dist/esm/Icon-B4HuRse0.js +0 -4
- package/dist/esm/Input-Bfru3WQI.js +0 -4
- package/dist/esm/InternalUnderlinedBadgeText-uelJXiTq.js +0 -4
- package/dist/esm/bootstrap-B_0ftOOI.js +0 -4
- package/dist/esm/bootstrap-B_0ftOOI.js.map +0 -1
- package/dist/kolibri/FieldControlStateWrapper-CsCnsDKf.js +0 -4
- package/dist/kolibri/Icon-B4HuRse0.js +0 -4
- package/dist/kolibri/Input-Bfru3WQI.js +0 -4
- package/dist/kolibri/bootstrap-B_0ftOOI.js +0 -4
- package/dist/kolibri/bootstrap-B_0ftOOI.js.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as t,h as e,F as i,g as n}from"./index-DeYD98_2.js";import{c as r}from"./clsx-eK3rPvPS.js";import{e as o,a,d as l,w as s}from"./component-names-CkE54Ym7.js";import{t as c}from"./i18n-C7ZsbK5l.js";import{O as u,o as d,p as f,w as h,s as v}from"./common-zXZUsQ7l.js";import{v as b}from"./label-DGzuU0HV.js";import{v as _,a as p,e as y,b as j,d as k}from"./table-settings-CF9uiyi4.js";import{C as m}from"./keyboard-D6PoWr38.js";import{n as w}from"./dev.utils-C5gRSnou.js";import{d as g,K as S}from"./events-CoPFQEiC.js";import{i as A,c as O,r as $,a as C,f as D,b as x,S as F}from"./isObject-DvSELytj.js";import"./i18n-ZF6JbdVP.js";const M=(e,t)=>{u(t,()=>{d(t,()=>{try{t=f(t)}catch(e){}h(e,"_headerCells",e=>"object"==typeof e&&null!==e&&(void 0===e.horizontal||Array.isArray(e.horizontal)&&void 0===e.horizontal.find(e=>!Array.isArray(e)))&&(void 0===e.vertical||Array.isArray(e.vertical)&&void 0===e.vertical.find(e=>!Array.isArray(e)))&&!0,new Set(["TableHeaderCellsPropType"]),t)})})};var P="[object AsyncFunction]",W="[object Function]",E="[object GeneratorFunction]",K="[object Proxy]";function R(e){if(!A(e))return!1;var t=O(e);return t==W||t==E||t==P||t==K}var T=$["__core-js_shared__"],H=function(){var e=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function z(e){return!!H&&H in e}var U=Function.prototype,N=U.toString;function B(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var I=/[\\^$.*+?()[\]{}|]/g,L=/^\[object .+?Constructor\]$/,V=Function.prototype,Z=Object.prototype,G=V.toString,Q=Z.hasOwnProperty,Y=RegExp("^"+G.call(Q).replace(I,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q(e){return!(!A(e)||z(e))&&(R(e)?Y:L).test(B(e))}function J(e,t){return null==e?void 0:e[t]}function X(e,t){var i=J(e,t);return q(i)?i:void 0}var tt=X($,"WeakMap"),et=9007199254740991,it=/^(?:0|[1-9]\d*)$/;function nt(e,t){var i=typeof e;return!!(t=null==t?et:t)&&("number"==i||"symbol"!=i&&it.test(e))&&e>-1&&e%1==0&&e<t}function rt(e,t){return e===t||e!=e&&t!=t}var ot=9007199254740991;function at(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=ot}function lt(e){return null!=e&&at(e.length)&&!R(e)}var st=Object.prototype;function ct(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||st)}function ut(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}var dt="[object Arguments]";function ft(e){return C(e)&&O(e)==dt}var ht=Object.prototype,vt=ht.hasOwnProperty,bt=ht.propertyIsEnumerable,_t=ft(function(){return arguments}())?ft:function(e){return C(e)&&vt.call(e,"callee")&&!bt.call(e,"callee")};function pt(){return!1}var yt="object"==typeof exports&&exports&&!exports.nodeType&&exports,jt=yt&&"object"==typeof module&&module&&!module.nodeType&&module,kt=jt&&jt.exports===yt,mt=kt?$.Buffer:void 0,wt=mt?mt.isBuffer:void 0,gt=wt||pt,St="[object Arguments]",At="[object Array]",Ot="[object Boolean]",$t="[object Date]",Ct="[object Error]",Dt="[object Function]",xt="[object Map]",Ft="[object Number]",Mt="[object Object]",Pt="[object RegExp]",Wt="[object Set]",Et="[object String]",Kt="[object WeakMap]",Rt="[object ArrayBuffer]",Tt="[object DataView]",Ht="[object Float32Array]",zt="[object Float64Array]",Ut="[object Int8Array]",Nt="[object Int16Array]",Bt="[object Int32Array]",It="[object Uint8Array]",Lt="[object Uint8ClampedArray]",Vt="[object Uint16Array]",Zt="[object Uint32Array]",Gt={};function Qt(e){return C(e)&&at(e.length)&&!!Gt[O(e)]}function Yt(e){return function(t){return e(t)}}Gt[Ht]=Gt[zt]=Gt[Ut]=Gt[Nt]=Gt[Bt]=Gt[It]=Gt[Lt]=Gt[Vt]=Gt[Zt]=!0,Gt[St]=Gt[At]=Gt[Rt]=Gt[Ot]=Gt[Tt]=Gt[$t]=Gt[Ct]=Gt[Dt]=Gt[xt]=Gt[Ft]=Gt[Mt]=Gt[Pt]=Gt[Wt]=Gt[Et]=Gt[Kt]=!1;var qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=qt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Jt&&Jt.exports===qt,te=Xt&&D.process,ee=function(){try{var e=Jt&&Jt.require&&Jt.require("util").types;return e||te&&te.binding&&te.binding("util")}catch(e){}}(),ie=ee&&ee.isTypedArray,ne=ie?Yt(ie):Qt,re=Object.prototype,oe=re.hasOwnProperty;function ae(e,t){var i=x(e),r=!i&&_t(e),a=!i&&!r&>(e),n=!i&&!r&&!a&&ne(e),o=i||r||a||n,l=o?ut(e.length,String):[],s=l.length;for(var c in e)!oe.call(e,c)||o&&("length"==c||a&&("offset"==c||"parent"==c)||n&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||nt(c,s))||l.push(c);return l}function le(e,t){return function(i){return e(t(i))}}var se=le(Object.keys,Object),ce=Object.prototype,ue=ce.hasOwnProperty;function de(e){if(!ct(e))return se(e);var t=[];for(var i in Object(e))ue.call(e,i)&&"constructor"!=i&&t.push(i);return t}function fe(e){return lt(e)?ae(e):de(e)}var he=X(Object,"create");function ve(){this.__data__=he?he(null):{},this.size=0}function be(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _e="__lodash_hash_undefined__",pe=Object.prototype,ye=pe.hasOwnProperty;function je(e){var t=this.__data__;if(he){var i=t[e];return i===_e?void 0:i}return ye.call(t,e)?t[e]:void 0}var ke=Object.prototype,me=ke.hasOwnProperty;function we(e){var t=this.__data__;return he?void 0!==t[e]:me.call(t,e)}var ge="__lodash_hash_undefined__";function Se(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=he&&void 0===t?ge:t,this}function Ae(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Oe(){this.__data__=[],this.size=0}function $e(e,t){for(var i=e.length;i--;)if(rt(e[i][0],t))return i;return-1}Ae.prototype.clear=ve,Ae.prototype.delete=be,Ae.prototype.get=je,Ae.prototype.has=we,Ae.prototype.set=Se;var Ce=Array.prototype,De=Ce.splice;function xe(e){var t=this.__data__,i=$e(t,e);return!(i<0)&&(i==t.length-1?t.pop():De.call(t,i,1),--this.size,!0)}function Fe(e){var t=this.__data__,i=$e(t,e);return i<0?void 0:t[i][1]}function Me(e){return $e(this.__data__,e)>-1}function Pe(e,t){var i=this.__data__,r=$e(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this}function We(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}We.prototype.clear=Oe,We.prototype.delete=xe,We.prototype.get=Fe,We.prototype.has=Me,We.prototype.set=Pe;var Ee=X($,"Map");function Ke(){this.size=0,this.__data__={hash:new Ae,map:new(Ee||We),string:new Ae}}function Re(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function Te(e,t){var i=e.__data__;return Re(t)?i["string"==typeof t?"string":"hash"]:i.map}function He(e){var t=Te(this,e).delete(e);return this.size-=t?1:0,t}function ze(e){return Te(this,e).get(e)}function Ue(e){return Te(this,e).has(e)}function Ne(e,t){var i=Te(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this}function Be(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Ie(e,t){for(var i=-1,r=t.length,a=e.length;++i<r;)e[a+i]=t[i];return e}function Le(){this.__data__=new We,this.size=0}function Ve(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function Ze(e){return this.__data__.get(e)}function Ge(e){return this.__data__.has(e)}Be.prototype.clear=Ke,Be.prototype.delete=He,Be.prototype.get=ze,Be.prototype.has=Ue,Be.prototype.set=Ne;var Qe=200;function Ye(e,t){var i=this.__data__;if(i instanceof We){var r=i.__data__;if(!Ee||r.length<Qe-1)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new Be(r)}return i.set(e,t),this.size=i.size,this}function qe(e){var t=this.__data__=new We(e);this.size=t.size}function Je(e,t){for(var i=-1,r=null==e?0:e.length,a=0,n=[];++i<r;){var o=e[i];t(o,i,e)&&(n[a++]=o)}return n}function Xe(){return[]}qe.prototype.clear=Le,qe.prototype.delete=Ve,qe.prototype.get=Ze,qe.prototype.has=Ge,qe.prototype.set=Ye;var ti=Object.prototype,ei=ti.propertyIsEnumerable,ii=Object.getOwnPropertySymbols,ni=ii?function(e){return null==e?[]:(e=Object(e),Je(ii(e),function(t){return ei.call(e,t)}))}:Xe;function ri(e,t,i){var r=t(e);return x(e)?r:Ie(r,i(e))}function oi(e){return ri(e,fe,ni)}var ai=X($,"DataView"),li=X($,"Promise"),si=X($,"Set"),ci="[object Map]",ui="[object Object]",di="[object Promise]",fi="[object Set]",hi="[object WeakMap]",vi="[object DataView]",bi=B(ai),_i=B(Ee),pi=B(li),yi=B(si),ji=B(tt),ki=O;(ai&&ki(new ai(new ArrayBuffer(1)))!=vi||Ee&&ki(new Ee)!=ci||li&&ki(li.resolve())!=di||si&&ki(new si)!=fi||tt&&ki(new tt)!=hi)&&(ki=function(e){var t=O(e),i=t==ui?e.constructor:void 0,r=i?B(i):"";if(r)switch(r){case bi:return vi;case _i:return ci;case pi:return di;case yi:return fi;case ji:return hi}return t});var mi=$.Uint8Array,wi="__lodash_hash_undefined__";function gi(e){return this.__data__.set(e,wi),this}function Si(e){return this.__data__.has(e)}function Ai(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Be;++t<i;)this.add(e[t])}function Oi(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(t(e[i],i,e))return!0;return!1}function $i(e,t){return e.has(t)}Ai.prototype.add=Ai.prototype.push=gi,Ai.prototype.has=Si;var Ci=1,Di=2;function xi(e,t,i,r,a,n){var o=i&Ci,l=e.length,s=t.length;if(l!=s&&!(o&&s>l))return!1;var c=n.get(e),h=n.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,b=i&Di?new Ai:void 0;for(n.set(e,t),n.set(t,e);++d<l;){var v=e[d],_=t[d];if(r)var f=o?r(_,v,d,t,e,n):r(v,_,d,e,t,n);if(void 0!==f){if(f)continue;u=!1;break}if(b){if(!Oi(t,function(e,t){if(!$i(b,t)&&(v===e||a(v,e,i,r,n)))return b.push(t)})){u=!1;break}}else if(v!==_&&!a(v,_,i,r,n)){u=!1;break}}return n.delete(e),n.delete(t),u}function Fi(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function Mi(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var Pi=1,Wi=2,Ei="[object Boolean]",Ki="[object Date]",Ri="[object Error]",Ti="[object Map]",Hi="[object Number]",zi="[object RegExp]",Ui="[object Set]",Ni="[object String]",Bi="[object Symbol]",Ii="[object ArrayBuffer]",Li="[object DataView]",Vi=F?F.prototype:void 0,Zi=Vi?Vi.valueOf:void 0;function Gi(e,t,i,r,a,n,o){switch(i){case Li:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ii:return!(e.byteLength!=t.byteLength||!n(new mi(e),new mi(t)));case Ei:case Ki:case Hi:return rt(+e,+t);case Ri:return e.name==t.name&&e.message==t.message;case zi:case Ni:return e==t+"";case Ti:var l=Fi;case Ui:var s=rΠif(l||(l=Mi),e.size!=t.size&&!s)return!1;var c=o.get(e);if(c)return c==t;r|=Wi,o.set(e,t);var h=xi(l(e),l(t),r,a,n,o);return o.delete(e),h;case Bi:if(Zi)return Zi.call(e)==Zi.call(t)}return!1}var Qi=1,Yi=Object.prototype,qi=Yi.hasOwnProperty;function Ji(e,t,i,r,a,n){var o=i&Qi,l=oi(e),s=l.length;if(s!=oi(t).length&&!o)return!1;for(var c=s;c--;){var h=l[c];if(!(o?h in t:qi.call(t,h)))return!1}var d=n.get(e),u=n.get(t);if(d&&u)return d==t&&u==e;var b=!0;n.set(e,t),n.set(t,e);for(var v=o;++c<s;){var _=e[h=l[c]],f=t[h];if(r)var p=o?r(f,_,h,t,e,n):r(_,f,h,e,t,n);if(!(void 0===p?_===f||a(_,f,i,r,n):p)){b=!1;break}v||(v="constructor"==h)}if(b&&!v){var y=e.constructor,g=t.constructor;y==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(b=!1)}return n.delete(e),n.delete(t),b}var Xi=1,tn="[object Arguments]",en="[object Array]",nn="[object Object]",rn=Object.prototype,on=rn.hasOwnProperty;function an(e,t,i,r,a,n){var o=x(e),l=x(t),s=o?en:ki(e),c=l?en:ki(t),h=(s=s==tn?nn:s)==nn,d=(c=c==tn?nn:c)==nn,u=s==c;if(u&>(e)){if(!gt(t))return!1;o=!0,h=!1}if(u&&!h)return n||(n=new qe),o||ne(e)?xi(e,t,i,r,a,n):Gi(e,t,s,i,r,a,n);if(!(i&Xi)){var b=h&&on.call(e,"__wrapped__"),v=d&&on.call(t,"__wrapped__");if(b||v){var _=b?e.value():e,f=v?t.value():t;return n||(n=new qe),a(_,f,i,r,n)}}return!!u&&(n||(n=new qe),Ji(e,t,i,r,a,n))}function ln(e,t,i,r,a){return e===t||(null==e||null==t||!C(e)&&!C(t)?e!=e&&t!=t:an(e,t,i,r,ln,a))}function sn(e,t){return ln(e,t)}const cn=/^\d+(\.\d+)?([a-z]+|%)?$/,un=(e,t,i)=>{h(e,"_minWidth",e=>"string"==typeof e&&cn.test(e),new Set(["String","/^\\d+(\\.\\d+)?([a-z]+|%)?$/"]),t,i)},dn=class{constructor(i){t(this,i),this.translateNoEntries=c("kol-no-entries"),this.state={_data:[],_headerCells:{horizontal:[],vertical:[]},_label:"",_minWidth:"auto"},this.horizontal=!0,this.cellsToRenderTimeouts=new Map,this.dataToKeyMap=new Map,this.checkboxRefs=[],this.translateSort=c("kol-sort"),this.tableDivElementHasScrollbar=!1,this.renderTableRow=(t,i,a,n=!1)=>{var o,l;let s=String(i);return this.horizontal&&(null===(o=t[0])||void 0===o?void 0:o.data)&&(s=null!==(l=this.getDataKey(t[0].data))&&void 0!==l?l:s),e("tr",{class:r("kol-table__row",{"kol-table__row--body":!n,"kol-table__row--footer":n}),key:`row-${s}`},this.renderSelectionCell(t,i),t.map((e,t)=>this.renderTableCell(e,i,t,a)))},this.renderTableCell=(t,i,a,n)=>{const o=this.getColumnSettings(t);if(o&&!o.visible)return"";let l=`${i}-${a}-${t.label}`;if(t.data){const e=this.getDataKey(t.data);l=e?`${e}-${this.horizontal?a:i}`:l}return t.headerCell?this.renderHeadingCell(t,i,a,n):e("td",{key:`cell-${l}`,class:r("kol-table__cell kol-table__cell--body",{[`kol-table__cell--align-${t.textAlign}`]:t.textAlign}),colSpan:t.colSpan,rowSpan:t.rowSpan,style:{textAlign:t.textAlign,width:(null==o?void 0:o.width)?`${o.width}ch`:t.width},ref:"function"==typeof t.render?e=>{this.cellRender(t,e)}:void 0},"function"!=typeof t.render?t.label:"")}}validateData(e){_(this,e,{beforePatch:e=>{this.updateDataToKeyMap(e)}})}validateDataFoot(e){p(this,e)}validateHeaderCells(e){M(this,e),sn(this.previousHeaderCells,this.state._headerCells)||this.initializeTableSettings(),this.previousHeaderCells=this.state._headerCells}validateLabel(e){b(this,e,{required:!0})}validateMinWidth(e){un(this,e)}validateOn(e){y(this,e)}validateSelection(e){j(this,e)}validateTableSettings(e){k(this,e)}handleKeyDown(e){var t;if("ArrowUp"===e.key||"ArrowDown"===e.key){const i=null===(t=this.tableDivElement)||void 0===t?void 0:t.querySelector(":focus");let r=this.checkboxRefs.indexOf(i);r>-1&&(e.preventDefault(),"ArrowDown"===e.key?(r=(r+1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()):"ArrowUp"===e.key&&(e.preventDefault(),r=(r+this.checkboxRefs.length-1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()))}}componentDidRender(){this.checkDivElementScrollbar()}componentDidLoad(){this.tableDivElement&&ResizeObserver&&(this.tableDivElementResizeObserver=new ResizeObserver(this.checkDivElementScrollbar.bind(this)),this.tableDivElementResizeObserver.observe(this.tableDivElement))}handleSettingsChange(e){v(this,"_tableSettings",e.detail)}disconnectedCallback(){var e;null===(e=this.tableDivElementResizeObserver)||void 0===e||e.disconnect()}checkDivElementScrollbar(){this.tableDivElement&&(this.tableDivElementHasScrollbar=this.tableDivElement.scrollWidth>this.tableDivElement.clientWidth)}updateDataToKeyMap(e){e.forEach(e=>{this.dataToKeyMap.has(e)||this.dataToKeyMap.set(e,w())}),this.dataToKeyMap.forEach((t,i)=>{e.includes(i)||this.dataToKeyMap.delete(i)})}getDataKey(e){return this.dataToKeyMap.get(e)}cellRender(e,t){t&&(clearTimeout(this.cellsToRenderTimeouts.get(t)),this.cellsToRenderTimeouts.set(t,setTimeout(()=>{if("function"==typeof e.render){const i=e.render(t,e,e.data,this.state._data);"string"==typeof i&&(t.textContent=i)}})))}getNumberOfCols(e,t){let i=0;return e.forEach(e=>{let t=0;Array.isArray(e)&&e.forEach(e=>{var i;return t+=null!==(i=e.colSpan)&&void 0!==i?i:1}),i<t&&(i=t)}),0===i&&(i=t.length),i}getNumberOfRows(e,t){var i;let r=0;return e.forEach(e=>{let t=0;Array.isArray(e)&&e.forEach(e=>{var i;return t+=null!==(i=e.rowSpan)&&void 0!==i?i:1}),r<t&&(r=t)}),0===r?r=t.length:r-=(null===(i=this.state._dataFoot)||void 0===i?void 0:i.length)||0,r}getThePrimaryHeadersWithKeyOrRenderFunction(e){const t=[];return e.forEach(e=>{e.forEach(e=>{"string"!=typeof e.key&&"function"!=typeof e.render||t.push(e)})}),t}getPrimaryHeaders(e){var t,i;let r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(t=e.horizontal)&&void 0!==t?t:[]);return this.horizontal=!0,0===r.length&&(r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(i=e.vertical)&&void 0!==i?i:[]),r.length>0&&(this.horizontal=!1)),r}getColumnPositionMap(){var e;const t=new Map;return null===(e=this.state._tableSettings)||void 0===e||e.columns.forEach(e=>{t.set(e.key,e.position)}),t}sortByColumnPosition(e){const t=this.getColumnPositionMap();return[...e].sort((e,i)=>{var r,a,n,o;return(null!==(a=t.get(null!==(r=e.key)&&void 0!==r?r:""))&&void 0!==a?a:Number.MAX_SAFE_INTEGER)-(null!==(o=t.get(null!==(n=i.key)&&void 0!==n?n:""))&&void 0!==o?o:Number.MAX_SAFE_INTEGER)})}createDataField(e,t,i){var r;t.horizontal=Array.isArray(null==t?void 0:t.horizontal)?t.horizontal:[],t.vertical=Array.isArray(null==t?void 0:t.vertical)?t.vertical:[];const a=this.getPrimaryHeaders(t),n=this.getNumberOfCols(t.horizontal,e);let o=this.getNumberOfRows(t.vertical,e),l=0;i&&(l=o,o+=(null===(r=this.state._dataFoot)||void 0===r?void 0:r.length)||0);const s=[],c=[],h=[];t.vertical.forEach((e,t)=>{c[t]=0,h[t]=[]});const d=this.sortByColumnPosition(a);for(let r=l;r<o;r++){const a=[];t.vertical.forEach((e,t)=>{let i=0;if(h[t].forEach(e=>i+=e),i<=r){const n=e[r-i+c[t]];if("object"==typeof n){a.push(Object.assign(Object.assign({},n),{headerCell:!0,data:{}}));let e=1;if("number"==typeof n.rowSpan&&n.rowSpan>1&&(e=n.rowSpan),h[t].push(e),"number"==typeof n.colSpan&&n.colSpan>1)for(let i=1;i<n.colSpan;i++)h[t+i].push(e);c[t]++}}});for(let t=0;t<n;t++)if(!0===this.horizontal){const n=i&&this.state._dataFoot?this.state._dataFoot[r-l]:e[r];"object"!=typeof d[t]||null===d[t]||"object"!=typeof n||null===n||"string"!=typeof d[t].key&&"function"!=typeof d[t].render||a.push(Object.assign(Object.assign({},d[t]),{colSpan:void 0,data:n,label:n[d[t].key],rowSpan:void 0}))}else"object"!=typeof d[r]||null===d[r]||"object"!=typeof e[t]||null===e[t]||"string"!=typeof d[r].key&&"function"!=typeof d[r].render||a.push(Object.assign(Object.assign({},d[r]),{colSpan:void 0,data:e[t],label:e[t][d[r].key],rowSpan:void 0}));s.push(a)}if(0===e.length){let e=0,i=0;Array.isArray(t.horizontal)&&t.horizontal.length>0&&t.horizontal[0].forEach(t=>{e+=t.colSpan||1}),Array.isArray(t.vertical)&&t.vertical.length>0&&(e-=t.vertical.length,t.vertical[0].forEach(e=>{i+=e.rowSpan||1}));const r={colSpan:e,label:this.translateNoEntries,render:void 0,rowSpan:Math.max(i,1)};0===s.length?s.push([r]):s[0].push(r)}return s}handleSelectionChangeCallbackAndEvent(e,t){var i;"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i[m.onSelectionChange])&&this.state._on[m.onSelectionChange](e,t),this.host&&g(this.host,S.selectionChange,t)}initializeTableSettings(){if(this._tableSettings)return;const e=this.getPrimaryHeaders(this.state._headerCells);this.state._tableSettings||(this.state._tableSettings={columns:[]}),this.state._tableSettings.columns=e.filter(e=>e.key).map((e,t)=>{var i;return{hidable:!1!==e.hidable,key:null!==(i=e.key)&&void 0!==i?i:w(),label:e.label,position:t,visible:!0}})}componentWillLoad(){this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateHeaderCells(this._headerCells),this.validateLabel(this._label),this.validateMinWidth(this._minWidth),this.validateOn(this._on),this.validateSelection(this._selection),this.validateTableSettings(this._tableSettings)}renderSelectionCell(t,i){var n,l,s;const c=this.state._selection;if(!c)return"";const h=this.getSelectionKeyPropertyName(),d=null===(n=t[0])||void 0===n?void 0:n.data;if(!d)return"";const u=d[h],b=c.multiple||void 0===c.multiple,v=null===(l=null==c?void 0:c.selectedKeys)||void 0===l?void 0:l.includes(u),_=null===(s=null==c?void 0:c.disabledKeys)||void 0===s?void 0:s.includes(u),f=c.label(d),p={name:"selection",checked:v,disabled:_,id:u,"aria-label":f};return e("td",{key:`tbody-${i}-selection`,class:"kol-table__cell kol-table__cell--selection"},e("div",{class:r("kol-table__selection",{"kol-table__selection--checked":v})},b?e("label",{class:r("kol-table__selection-label",{"kol-table__selection-label--disabled":_})},e(o,{class:"kol-table__selection-icon",_icons:"codicon "+(v?"codicon-check":""),_label:""}),e("input",Object.assign({class:r("kol-table__selection-input kol-table__selection-input--checkbox"),ref:e=>e&&this.checkboxRefs.push(e)},p,{type:"checkbox",onInput:e=>{var t,i;const r=v?null===(i=null==c?void 0:c.selectedKeys)||void 0===i?void 0:i.filter(e=>e!==u):[...null!==(t=null==c?void 0:c.selectedKeys)&&void 0!==t?t:[],u];this.handleSelectionChangeCallbackAndEvent(e,null!=r?r:[])}}))):e("label",{class:"kol-table__selection-label"},e("input",Object.assign({class:r("kol-table__selection-input kol-table__selection-input--radio")},p,{type:"radio",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,u)}}))),e(a,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${u}-label`,_label:f})))}getColumnSettings(e){var t;return null===(t=this.state._tableSettings)||void 0===t?void 0:t.columns.find(t=>t.key===e.key)}getSelectionKeyPropertyName(){var e,t;return null!==(t=null===(e=this.state._selection)||void 0===e?void 0:e.keyPropertyName)&&void 0!==t?t:"id"}getDataWithSelectionEnabled(){const e=this.getSelectionKeyPropertyName();return this.state._data.filter(t=>{var i,r;return!(null===(r=null===(i=this.state._selection)||void 0===i?void 0:i.disabledKeys)||void 0===r?void 0:r.includes(t[e]))})}getSelectedKeysWithoutDisabledKeys(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter(e=>{var t,i;return!(null===(i=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===i?void 0:i.includes(e))})}getSelectedKeysWithDisabledKeysOnly(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter(e=>{var t,i;return null===(i=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===i?void 0:i.includes(e)})}getRevertedSelection(e){var t;const i=this.getSelectionKeyPropertyName(),r=null!==(t=this.getSelectedKeysWithDisabledKeysOnly())&&void 0!==t?t:[];return e&&r.push(...this.getDataWithSelectionEnabled().map(e=>null==e?void 0:e[i])),r}getTableMinWidth(){var e,t;const i=null!==(t=null===(e=this.state._tableSettings)||void 0===e?void 0:e.columns.filter(e=>e.visible).reduce((e,t)=>{var i;return e+(null!==(i=t.width)&&void 0!==i?i:0)},0))&&void 0!==t?t:0;return"auto"===this.state._minWidth?`${i}ch`:`max(${this.state._minWidth}, ${i}ch)`}renderHeadingSelectionCell(){var t,i;const n=this.state._selection;if(!n||!n.multiple&&void 0!==n.multiple)return e("th",{class:"kol-table__cell kol-table__cell--header",key:"thead-0"});const l=null!==(i=null===(t=this.getSelectedKeysWithoutDisabledKeys())||void 0===t?void 0:t.length)&&void 0!==i?i:0,s=l===this.getDataWithSelectionEnabled().length,h=0!==l&&!s;let d="kol-table-selection-indeterminate";s&&!h&&(d="kol-table-selection-none"),0===l&&(d="kol-table-selection-all");const u=c(d);return e("th",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header"},e("div",{class:r("kol-table__selection",{"kol-table__selection--indeterminate":h,"kol-table__selection--checked":s})},e("label",{class:"kol-table__selection-label"},e(o,{class:"kol-table__selection-icon",_icons:"codicon "+(h?"codicon-remove":s?"codicon-check":""),_label:""}),e("input",{class:r("kol-table__selection-input kol-table__selection-input--checkbox"),"data-testid":"selection-checkbox-all",ref:e=>e&&this.checkboxRefs.push(e),name:"selection",checked:s&&!h,indeterminate:h,"aria-label":u,type:"checkbox",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,this.getRevertedSelection(!s))}})),e(a,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${d}-label`,_label:u})))}renderHeaderTdCell(){return e(i,null,Array.isArray(this.state._headerCells.horizontal)&&this.state._headerCells.horizontal.length>0&&Array.isArray(this.state._headerCells.vertical)&&this.state._headerCells.vertical.length>0&&Array.isArray(this.state._headerCells.horizontal)&&e("td",{"aria-hidden":"true",colSpan:this.state._headerCells.vertical.length,rowSpan:this.state._headerCells.horizontal.length}))}renderHeadingCell(t,i,a,n){const o=this.getColumnSettings(t);if(o&&!o.visible)return"";let s="none",c="codicon codicon-fold";if(t.sortDirection)switch(t.sortDirection){case"ASC":c="codicon codicon-chevron-up",s="ascending";break;case"DESC":c="codicon codicon-chevron-down",s="descending";break;default:s="none"}const h=n?"row":"number"==typeof t.colSpan&&t.colSpan>1?"colgroup":"col";return e("th",{key:`${i}-${a}-${t.label}`,class:r("kol-table__cell kol-table__cell--header",{[`kol-table__cell--align-${t.textAlign}`]:t.textAlign,[`kol-table__cell--${s}`]:s}),scope:h,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{width:(null==o?void 0:o.width)?`${o.width}ch`:t.width},"aria-sort":s,"data-sort":`sort-${t.sortDirection}`},t.sortDirection?e(l,{class:"kol-table__sort-button",exportparts:"icon",_icons:{right:c},_label:t.label,_ariaDescription:this.translateSort,_on:{onClick:e=>{var i;"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i.onSort)&&t.key&&t.sortDirection&&this.state._on.onSort(e,{key:t.key,currentSortDirection:t.sortDirection}),this.host&&g(this.host,S.sort,{key:t.key,currentSortDirection:t.sortDirection})}}}):t.label)}renderSpacer(t,i){var a,n;const o=(null===(a=this.state._headerCells.vertical)||void 0===a?void 0:a.length)||0,l=null===(n=null==i?void 0:i[0])||void 0===n?void 0:n.reduce((e,t)=>e+(t.colSpan||1),0),s=this.state._selection?1:0;return e("tr",{"aria-hidden":"true",class:r("kol-table__spacer",`kol-table__spacer--${t}`)},e("td",{class:r(`kol-table__spacer-line kol-table__spacer-line--${t}`),colSpan:o+l+s}))}renderFoot(){if(!this.state._dataFoot||0===this.state._dataFoot.length)return null;const t=this.createDataField(this.state._dataFoot,this.state._headerCells,!0);return e("tfoot",{class:"kol-table__footer"},[this.renderSpacer("foot",t),t.map((e,t)=>this.renderTableRow(e,t,!0,!0))])}render(){var t;const i=this.createDataField(this.state._data,this.state._headerCells);this.checkboxRefs=[];const r=null===(t=this.state._headerCells.horizontal)||void 0===t?void 0:t.map(e=>this.sortByColumnPosition(e));return e("div",{key:"9a5961e0b7d62ddd9638239d19d7ff4ab2f228b3",class:"kol-table"},e(s,{key:"2275f945d4ceb256d190ee5a24a3080f6e532394",_tableSettings:this.state._tableSettings}),e("div",{key:"3ab04b967a4f5a372fb4c604c8d12413ecf96df4",ref:e=>this.tableDivElement=e,class:"kol-table__scroll-container",tabindex:this.tableDivElementHasScrollbar?"-1":void 0},e("table",{key:"ac15c574822a18850146efe34364c86031258273",class:"kol-table__table",style:{minWidth:this.getTableMinWidth()}},e("caption",{key:"82eb5c5eddb8041f4d04c07511c8a05536d9a14f",class:"kol-table__focus-element kol-table__caption",id:"caption",tabindex:this.tableDivElementHasScrollbar?"0":void 0},this.state._label),Array.isArray(r)&&e("thead",{key:"39b1dfec7459ee236bd02c10505a6032d6b9261c",class:"kol-table__head"},[r.map((t,i)=>e("tr",{class:"kol-table__head-row",key:`thead-${i}`},this.state._selection&&this.renderHeadingSelectionCell(),0===i&&this.renderHeaderTdCell(),Array.isArray(t)&&t.map((e,t)=>this.renderHeadingCell(e,i,t,!1)))),this.renderSpacer("head",r)]),e("tbody",{key:"ccdf8ac49eed375f5b4c8892bbfed2120a9cda33",class:"kol-table__body"},i.map((e,t)=>this.renderTableRow(e,t,!0))),this.renderFoot())))}get host(){return n(this)}static get watchers(){return{_data:["validateData"],_dataFoot:["validateDataFoot"],_headerCells:["validateHeaderCells"],_label:["validateLabel"],_minWidth:["validateMinWidth"],_on:["validateOn"],_selection:["validateSelection"],_tableSettings:["validateTableSettings"]}}};export{dn as kol_table_stateless_wc};
|
4
|
+
import{r as t,h as e,F as i,g as n}from"./index-BRWth_lT.js";import{c as r}from"./clsx-eK3rPvPS.js";import{e as o,a,d as l,w as s}from"./component-names-CkE54Ym7.js";import{t as c}from"./i18n-C7ZsbK5l.js";import{O as u,o as d,p as f,w as h,s as v}from"./common-zXZUsQ7l.js";import{v as b}from"./label-DGzuU0HV.js";import{v as _,a as p,e as y,b as j,d as k}from"./table-settings-CF9uiyi4.js";import{C as m}from"./keyboard-D6PoWr38.js";import{n as w}from"./dev.utils-CMSYtmAz.js";import{d as g,K as S}from"./events-CoPFQEiC.js";import{i as A,c as O,r as $,a as C,f as D,b as x,S as F}from"./isObject-DvSELytj.js";import"./i18n-ZF6JbdVP.js";const M=(e,t)=>{u(t,()=>{d(t,()=>{try{t=f(t)}catch(e){}h(e,"_headerCells",e=>"object"==typeof e&&null!==e&&(void 0===e.horizontal||Array.isArray(e.horizontal)&&void 0===e.horizontal.find(e=>!Array.isArray(e)))&&(void 0===e.vertical||Array.isArray(e.vertical)&&void 0===e.vertical.find(e=>!Array.isArray(e)))&&!0,new Set(["TableHeaderCellsPropType"]),t)})})};var W="[object AsyncFunction]",P="[object Function]",E="[object GeneratorFunction]",K="[object Proxy]";function T(e){if(!A(e))return!1;var t=O(e);return t==P||t==E||t==W||t==K}var R=$["__core-js_shared__"],z=function(){var e=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function H(e){return!!z&&z in e}var U=Function.prototype,B=U.toString;function N(e){if(null!=e){try{return B.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var I=/[\\^$.*+?()[\]{}|]/g,L=/^\[object .+?Constructor\]$/,V=Function.prototype,Z=Object.prototype,G=V.toString,Q=Z.hasOwnProperty,Y=RegExp("^"+G.call(Q).replace(I,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q(e){return!(!A(e)||H(e))&&(T(e)?Y:L).test(N(e))}function J(e,t){return null==e?void 0:e[t]}function X(e,t){var i=J(e,t);return q(i)?i:void 0}var tt=X($,"WeakMap"),et=9007199254740991,it=/^(?:0|[1-9]\d*)$/;function nt(e,t){var i=typeof e;return!!(t=null==t?et:t)&&("number"==i||"symbol"!=i&&it.test(e))&&e>-1&&e%1==0&&e<t}function rt(e,t){return e===t||e!=e&&t!=t}var ot=9007199254740991;function at(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=ot}function lt(e){return null!=e&&at(e.length)&&!T(e)}var st=Object.prototype;function ct(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||st)}function ut(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}var dt="[object Arguments]";function ft(e){return C(e)&&O(e)==dt}var ht=Object.prototype,vt=ht.hasOwnProperty,bt=ht.propertyIsEnumerable,_t=ft(function(){return arguments}())?ft:function(e){return C(e)&&vt.call(e,"callee")&&!bt.call(e,"callee")};function pt(){return!1}var yt="object"==typeof exports&&exports&&!exports.nodeType&&exports,jt=yt&&"object"==typeof module&&module&&!module.nodeType&&module,kt=jt&&jt.exports===yt,mt=kt?$.Buffer:void 0,wt=mt?mt.isBuffer:void 0,gt=wt||pt,St="[object Arguments]",At="[object Array]",Ot="[object Boolean]",$t="[object Date]",Ct="[object Error]",Dt="[object Function]",xt="[object Map]",Ft="[object Number]",Mt="[object Object]",Wt="[object RegExp]",Pt="[object Set]",Et="[object String]",Kt="[object WeakMap]",Tt="[object ArrayBuffer]",Rt="[object DataView]",zt="[object Float32Array]",Ht="[object Float64Array]",Ut="[object Int8Array]",Bt="[object Int16Array]",Nt="[object Int32Array]",It="[object Uint8Array]",Lt="[object Uint8ClampedArray]",Vt="[object Uint16Array]",Zt="[object Uint32Array]",Gt={};function Qt(e){return C(e)&&at(e.length)&&!!Gt[O(e)]}function Yt(e){return function(t){return e(t)}}Gt[zt]=Gt[Ht]=Gt[Ut]=Gt[Bt]=Gt[Nt]=Gt[It]=Gt[Lt]=Gt[Vt]=Gt[Zt]=!0,Gt[St]=Gt[At]=Gt[Tt]=Gt[Ot]=Gt[Rt]=Gt[$t]=Gt[Ct]=Gt[Dt]=Gt[xt]=Gt[Ft]=Gt[Mt]=Gt[Wt]=Gt[Pt]=Gt[Et]=Gt[Kt]=!1;var qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=qt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Jt&&Jt.exports===qt,te=Xt&&D.process,ee=function(){try{var e=Jt&&Jt.require&&Jt.require("util").types;return e||te&&te.binding&&te.binding("util")}catch(e){}}(),ie=ee&&ee.isTypedArray,ne=ie?Yt(ie):Qt,re=Object.prototype,oe=re.hasOwnProperty;function ae(e,t){var i=x(e),r=!i&&_t(e),a=!i&&!r&>(e),n=!i&&!r&&!a&&ne(e),o=i||r||a||n,l=o?ut(e.length,String):[],s=l.length;for(var c in e)!oe.call(e,c)||o&&("length"==c||a&&("offset"==c||"parent"==c)||n&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||nt(c,s))||l.push(c);return l}function le(e,t){return function(i){return e(t(i))}}var se=le(Object.keys,Object),ce=Object.prototype,ue=ce.hasOwnProperty;function de(e){if(!ct(e))return se(e);var t=[];for(var i in Object(e))ue.call(e,i)&&"constructor"!=i&&t.push(i);return t}function fe(e){return lt(e)?ae(e):de(e)}var he=X(Object,"create");function ve(){this.__data__=he?he(null):{},this.size=0}function be(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _e="__lodash_hash_undefined__",pe=Object.prototype,ye=pe.hasOwnProperty;function je(e){var t=this.__data__;if(he){var i=t[e];return i===_e?void 0:i}return ye.call(t,e)?t[e]:void 0}var ke=Object.prototype,me=ke.hasOwnProperty;function we(e){var t=this.__data__;return he?void 0!==t[e]:me.call(t,e)}var ge="__lodash_hash_undefined__";function Se(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=he&&void 0===t?ge:t,this}function Ae(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Oe(){this.__data__=[],this.size=0}function $e(e,t){for(var i=e.length;i--;)if(rt(e[i][0],t))return i;return-1}Ae.prototype.clear=ve,Ae.prototype.delete=be,Ae.prototype.get=je,Ae.prototype.has=we,Ae.prototype.set=Se;var Ce=Array.prototype,De=Ce.splice;function xe(e){var t=this.__data__,i=$e(t,e);return!(i<0)&&(i==t.length-1?t.pop():De.call(t,i,1),--this.size,!0)}function Fe(e){var t=this.__data__,i=$e(t,e);return i<0?void 0:t[i][1]}function Me(e){return $e(this.__data__,e)>-1}function We(e,t){var i=this.__data__,r=$e(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this}function Pe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}Pe.prototype.clear=Oe,Pe.prototype.delete=xe,Pe.prototype.get=Fe,Pe.prototype.has=Me,Pe.prototype.set=We;var Ee=X($,"Map");function Ke(){this.size=0,this.__data__={hash:new Ae,map:new(Ee||Pe),string:new Ae}}function Te(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function Re(e,t){var i=e.__data__;return Te(t)?i["string"==typeof t?"string":"hash"]:i.map}function ze(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t}function He(e){return Re(this,e).get(e)}function Ue(e){return Re(this,e).has(e)}function Be(e,t){var i=Re(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this}function Ne(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Ie(e,t){for(var i=-1,r=t.length,a=e.length;++i<r;)e[a+i]=t[i];return e}function Le(){this.__data__=new Pe,this.size=0}function Ve(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function Ze(e){return this.__data__.get(e)}function Ge(e){return this.__data__.has(e)}Ne.prototype.clear=Ke,Ne.prototype.delete=ze,Ne.prototype.get=He,Ne.prototype.has=Ue,Ne.prototype.set=Be;var Qe=200;function Ye(e,t){var i=this.__data__;if(i instanceof Pe){var r=i.__data__;if(!Ee||r.length<Qe-1)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new Ne(r)}return i.set(e,t),this.size=i.size,this}function qe(e){var t=this.__data__=new Pe(e);this.size=t.size}function Je(e,t){for(var i=-1,r=null==e?0:e.length,a=0,n=[];++i<r;){var o=e[i];t(o,i,e)&&(n[a++]=o)}return n}function Xe(){return[]}qe.prototype.clear=Le,qe.prototype.delete=Ve,qe.prototype.get=Ze,qe.prototype.has=Ge,qe.prototype.set=Ye;var ti=Object.prototype,ei=ti.propertyIsEnumerable,ii=Object.getOwnPropertySymbols,ni=ii?function(e){return null==e?[]:(e=Object(e),Je(ii(e),function(t){return ei.call(e,t)}))}:Xe;function ri(e,t,i){var r=t(e);return x(e)?r:Ie(r,i(e))}function oi(e){return ri(e,fe,ni)}var ai=X($,"DataView"),li=X($,"Promise"),si=X($,"Set"),ci="[object Map]",ui="[object Object]",di="[object Promise]",fi="[object Set]",hi="[object WeakMap]",vi="[object DataView]",bi=N(ai),_i=N(Ee),pi=N(li),yi=N(si),ji=N(tt),ki=O;(ai&&ki(new ai(new ArrayBuffer(1)))!=vi||Ee&&ki(new Ee)!=ci||li&&ki(li.resolve())!=di||si&&ki(new si)!=fi||tt&&ki(new tt)!=hi)&&(ki=function(e){var t=O(e),i=t==ui?e.constructor:void 0,r=i?N(i):"";if(r)switch(r){case bi:return vi;case _i:return ci;case pi:return di;case yi:return fi;case ji:return hi}return t});var mi=$.Uint8Array,wi="__lodash_hash_undefined__";function gi(e){return this.__data__.set(e,wi),this}function Si(e){return this.__data__.has(e)}function Ai(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Ne;++t<i;)this.add(e[t])}function Oi(e,t){for(var i=-1,r=null==e?0:e.length;++i<r;)if(t(e[i],i,e))return!0;return!1}function $i(e,t){return e.has(t)}Ai.prototype.add=Ai.prototype.push=gi,Ai.prototype.has=Si;var Ci=1,Di=2;function xi(e,t,i,r,a,n){var o=i&Ci,l=e.length,s=t.length;if(l!=s&&!(o&&s>l))return!1;var c=n.get(e),h=n.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,b=i&Di?new Ai:void 0;for(n.set(e,t),n.set(t,e);++d<l;){var v=e[d],_=t[d];if(r)var f=o?r(_,v,d,t,e,n):r(v,_,d,e,t,n);if(void 0!==f){if(f)continue;u=!1;break}if(b){if(!Oi(t,function(e,t){if(!$i(b,t)&&(v===e||a(v,e,i,r,n)))return b.push(t)})){u=!1;break}}else if(v!==_&&!a(v,_,i,r,n)){u=!1;break}}return n.delete(e),n.delete(t),u}function Fi(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function Mi(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var Wi=1,Pi=2,Ei="[object Boolean]",Ki="[object Date]",Ti="[object Error]",Ri="[object Map]",zi="[object Number]",Hi="[object RegExp]",Ui="[object Set]",Bi="[object String]",Ni="[object Symbol]",Ii="[object ArrayBuffer]",Li="[object DataView]",Vi=F?F.prototype:void 0,Zi=Vi?Vi.valueOf:void 0;function Gi(e,t,i,r,a,n,o){switch(i){case Li:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ii:return!(e.byteLength!=t.byteLength||!n(new mi(e),new mi(t)));case Ei:case Ki:case zi:return rt(+e,+t);case Ti:return e.name==t.name&&e.message==t.message;case Hi:case Bi:return e==t+"";case Ri:var l=Fi;case Ui:var s=r&Wi;if(l||(l=Mi),e.size!=t.size&&!s)return!1;var c=o.get(e);if(c)return c==t;r|=Pi,o.set(e,t);var h=xi(l(e),l(t),r,a,n,o);return o.delete(e),h;case Ni:if(Zi)return Zi.call(e)==Zi.call(t)}return!1}var Qi=1,Yi=Object.prototype,qi=Yi.hasOwnProperty;function Ji(e,t,i,r,a,n){var o=i&Qi,l=oi(e),s=l.length;if(s!=oi(t).length&&!o)return!1;for(var c=s;c--;){var h=l[c];if(!(o?h in t:qi.call(t,h)))return!1}var d=n.get(e),u=n.get(t);if(d&&u)return d==t&&u==e;var b=!0;n.set(e,t),n.set(t,e);for(var v=o;++c<s;){var _=e[h=l[c]],f=t[h];if(r)var p=o?r(f,_,h,t,e,n):r(_,f,h,e,t,n);if(!(void 0===p?_===f||a(_,f,i,r,n):p)){b=!1;break}v||(v="constructor"==h)}if(b&&!v){var y=e.constructor,g=t.constructor;y==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(b=!1)}return n.delete(e),n.delete(t),b}var Xi=1,tn="[object Arguments]",en="[object Array]",nn="[object Object]",rn=Object.prototype,on=rn.hasOwnProperty;function an(e,t,i,r,a,n){var o=x(e),l=x(t),s=o?en:ki(e),c=l?en:ki(t),h=(s=s==tn?nn:s)==nn,d=(c=c==tn?nn:c)==nn,u=s==c;if(u&>(e)){if(!gt(t))return!1;o=!0,h=!1}if(u&&!h)return n||(n=new qe),o||ne(e)?xi(e,t,i,r,a,n):Gi(e,t,s,i,r,a,n);if(!(i&Xi)){var b=h&&on.call(e,"__wrapped__"),v=d&&on.call(t,"__wrapped__");if(b||v){var _=b?e.value():e,f=v?t.value():t;return n||(n=new qe),a(_,f,i,r,n)}}return!!u&&(n||(n=new qe),Ji(e,t,i,r,a,n))}function ln(e,t,i,r,a){return e===t||(null==e||null==t||!C(e)&&!C(t)?e!=e&&t!=t:an(e,t,i,r,ln,a))}function sn(e,t){return ln(e,t)}const cn=/^\d+(\.\d+)?([a-z]+|%)?$/,un=(e,t,i)=>{h(e,"_minWidth",e=>"string"==typeof e&&cn.test(e),new Set(["String","/^\\d+(\\.\\d+)?([a-z]+|%)?$/"]),t,i)},dn=class{constructor(i){t(this,i),this.translateNoEntries=c("kol-no-entries"),this.state={_data:[],_headerCells:{horizontal:[],vertical:[]},_label:"",_minWidth:"auto"},this.horizontal=!0,this.cellsToRenderTimeouts=new Map,this.dataToKeyMap=new Map,this.checkboxRefs=[],this.translateSort=c("kol-sort"),this.tableDivElementHasScrollbar=!1,this.renderTableRow=(t,i,a,n=!1)=>{var o,l;let s=String(i);return this.horizontal&&(null===(o=t[0])||void 0===o?void 0:o.data)&&(s=null!==(l=this.getDataKey(t[0].data))&&void 0!==l?l:s),e("tr",{class:r("kol-table__row",{"kol-table__row--body":!n,"kol-table__row--footer":n}),key:`row-${s}`},this.renderSelectionCell(t,i),t.map((e,t)=>this.renderTableCell(e,i,t,a)))},this.renderTableCell=(t,i,a,n)=>{const o=this.getColumnSettings(t);if(o&&!o.visible)return"";let l=`${i}-${a}-${t.label}`;if(t.data){const e=this.getDataKey(t.data);l=e?`${e}-${this.horizontal?a:i}`:l}return t.headerCell?this.renderHeadingCell(t,i,a,n):e("td",{key:`cell-${l}`,class:r("kol-table__cell kol-table__cell--body",{[`kol-table__cell--align-${t.textAlign}`]:t.textAlign}),colSpan:t.colSpan,rowSpan:t.rowSpan,style:{textAlign:t.textAlign,width:(null==o?void 0:o.width)?`${o.width}ch`:t.width},ref:"function"==typeof t.render?e=>{this.cellRender(t,e)}:void 0},"function"!=typeof t.render?t.label:"")}}validateData(e){_(this,e,{beforePatch:e=>{this.updateDataToKeyMap(e)}})}validateDataFoot(e){p(this,e)}validateHeaderCells(e){M(this,e),sn(this.previousHeaderCells,this.state._headerCells)||this.initializeTableSettings(),this.previousHeaderCells=this.state._headerCells}validateLabel(e){b(this,e,{required:!0})}validateMinWidth(e){un(this,e)}validateOn(e){y(this,e)}validateSelection(e){j(this,e)}validateTableSettings(e){k(this,e)}handleKeyDown(e){var t;if("ArrowUp"===e.key||"ArrowDown"===e.key){const i=null===(t=this.tableDivElement)||void 0===t?void 0:t.querySelector(":focus");let r=this.checkboxRefs.indexOf(i);r>-1&&(e.preventDefault(),"ArrowDown"===e.key?(r=(r+1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()):"ArrowUp"===e.key&&(e.preventDefault(),r=(r+this.checkboxRefs.length-1)%this.checkboxRefs.length,this.checkboxRefs[r].focus()))}}componentDidRender(){this.checkDivElementScrollbar()}componentDidLoad(){this.tableDivElement&&ResizeObserver&&(this.tableDivElementResizeObserver=new ResizeObserver(this.checkDivElementScrollbar.bind(this)),this.tableDivElementResizeObserver.observe(this.tableDivElement))}handleSettingsChange(e){v(this,"_tableSettings",e.detail)}disconnectedCallback(){var e;null===(e=this.tableDivElementResizeObserver)||void 0===e||e.disconnect()}checkDivElementScrollbar(){this.tableDivElement&&(this.tableDivElementHasScrollbar=this.tableDivElement.scrollWidth>this.tableDivElement.clientWidth)}updateDataToKeyMap(e){e.forEach(e=>{this.dataToKeyMap.has(e)||this.dataToKeyMap.set(e,w())}),this.dataToKeyMap.forEach((t,i)=>{e.includes(i)||this.dataToKeyMap.delete(i)})}getDataKey(e){return this.dataToKeyMap.get(e)}cellRender(e,t){t&&(clearTimeout(this.cellsToRenderTimeouts.get(t)),this.cellsToRenderTimeouts.set(t,setTimeout(()=>{if("function"==typeof e.render){const i=e.render(t,e,e.data,this.state._data);"string"==typeof i&&(t.textContent=i)}})))}getNumberOfCols(e,t){let i=0;return e.forEach(e=>{let t=0;Array.isArray(e)&&e.forEach(e=>{var i;return t+=null!==(i=e.colSpan)&&void 0!==i?i:1}),i<t&&(i=t)}),0===i&&(i=t.length),i}getNumberOfRows(e,t){var i;let r=0;return e.forEach(e=>{let t=0;Array.isArray(e)&&e.forEach(e=>{var i;return t+=null!==(i=e.rowSpan)&&void 0!==i?i:1}),r<t&&(r=t)}),0===r?r=t.length:r-=(null===(i=this.state._dataFoot)||void 0===i?void 0:i.length)||0,r}getThePrimaryHeadersWithKeyOrRenderFunction(e){const t=[];return e.forEach(e=>{e.forEach(e=>{"string"!=typeof e.key&&"function"!=typeof e.render||t.push(e)})}),t}getPrimaryHeaders(e){var t,i;let r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(t=e.horizontal)&&void 0!==t?t:[]);return this.horizontal=!0,0===r.length&&(r=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(i=e.vertical)&&void 0!==i?i:[]),r.length>0&&(this.horizontal=!1)),r}getColumnPositionMap(){var e;const t=new Map;return null===(e=this.state._tableSettings)||void 0===e||e.columns.forEach(e=>{t.set(e.key,e.position)}),t}sortByColumnPosition(e){const t=this.getColumnPositionMap();return[...e].sort((e,i)=>{var r,a,n,o;return(null!==(a=t.get(null!==(r=e.key)&&void 0!==r?r:""))&&void 0!==a?a:Number.MAX_SAFE_INTEGER)-(null!==(o=t.get(null!==(n=i.key)&&void 0!==n?n:""))&&void 0!==o?o:Number.MAX_SAFE_INTEGER)})}createDataField(e,t,i){var r;t.horizontal=Array.isArray(null==t?void 0:t.horizontal)?t.horizontal:[],t.vertical=Array.isArray(null==t?void 0:t.vertical)?t.vertical:[];const a=this.getPrimaryHeaders(t),n=this.getNumberOfCols(t.horizontal,e);let o=this.getNumberOfRows(t.vertical,e),l=0;i&&(l=o,o+=(null===(r=this.state._dataFoot)||void 0===r?void 0:r.length)||0);const s=[],c=[],h=[];t.vertical.forEach((e,t)=>{c[t]=0,h[t]=[]});const d=this.sortByColumnPosition(a);for(let r=l;r<o;r++){const a=[];t.vertical.forEach((e,t)=>{let i=0;if(h[t].forEach(e=>i+=e),i<=r){const n=e[r-i+c[t]];if("object"==typeof n){a.push(Object.assign(Object.assign({},n),{headerCell:!0,data:{}}));let e=1;if("number"==typeof n.rowSpan&&n.rowSpan>1&&(e=n.rowSpan),h[t].push(e),"number"==typeof n.colSpan&&n.colSpan>1)for(let i=1;i<n.colSpan;i++)h[t+i].push(e);c[t]++}}});for(let t=0;t<n;t++)if(!0===this.horizontal){const n=i&&this.state._dataFoot?this.state._dataFoot[r-l]:e[r];"object"!=typeof d[t]||null===d[t]||"object"!=typeof n||null===n||"string"!=typeof d[t].key&&"function"!=typeof d[t].render||a.push(Object.assign(Object.assign({},d[t]),{colSpan:void 0,data:n,label:n[d[t].key],rowSpan:void 0}))}else"object"!=typeof d[r]||null===d[r]||"object"!=typeof e[t]||null===e[t]||"string"!=typeof d[r].key&&"function"!=typeof d[r].render||a.push(Object.assign(Object.assign({},d[r]),{colSpan:void 0,data:e[t],label:e[t][d[r].key],rowSpan:void 0}));s.push(a)}if(0===e.length){let e=0,i=0;Array.isArray(t.horizontal)&&t.horizontal.length>0&&t.horizontal[0].forEach(t=>{e+=t.colSpan||1}),Array.isArray(t.vertical)&&t.vertical.length>0&&(e-=t.vertical.length,t.vertical[0].forEach(e=>{i+=e.rowSpan||1}));const r={colSpan:e,label:this.translateNoEntries,render:void 0,rowSpan:Math.max(i,1)};0===s.length?s.push([r]):s[0].push(r)}return s}handleSelectionChangeCallbackAndEvent(e,t){var i;"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i[m.onSelectionChange])&&this.state._on[m.onSelectionChange](e,t),this.host&&g(this.host,S.selectionChange,t)}initializeTableSettings(){if(this._tableSettings)return;const e=this.getPrimaryHeaders(this.state._headerCells);this.state._tableSettings||(this.state._tableSettings={columns:[]}),this.state._tableSettings.columns=e.filter(e=>e.key).map((e,t)=>{var i;return{hidable:!1!==e.hidable,key:null!==(i=e.key)&&void 0!==i?i:w(),label:e.label,position:t,visible:!0}})}componentWillLoad(){this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateHeaderCells(this._headerCells),this.validateLabel(this._label),this.validateMinWidth(this._minWidth),this.validateOn(this._on),this.validateSelection(this._selection),this.validateTableSettings(this._tableSettings)}renderSelectionCell(t,i){var n,l,s;const c=this.state._selection;if(!c)return"";const h=this.getSelectionKeyPropertyName(),d=null===(n=t[0])||void 0===n?void 0:n.data;if(!d)return"";const u=d[h],b=c.multiple||void 0===c.multiple,v=null===(l=null==c?void 0:c.selectedKeys)||void 0===l?void 0:l.includes(u),_=null===(s=null==c?void 0:c.disabledKeys)||void 0===s?void 0:s.includes(u),f=c.label(d),p={name:"selection",checked:v,disabled:_,id:u,"aria-label":f};return e("td",{key:`tbody-${i}-selection`,class:"kol-table__cell kol-table__cell--selection"},e("div",{class:r("kol-table__selection",{"kol-table__selection--checked":v})},b?e("label",{class:r("kol-table__selection-label",{"kol-table__selection-label--disabled":_})},e(o,{class:"kol-table__selection-icon",_icons:"codicon "+(v?"codicon-check":""),_label:""}),e("input",Object.assign({class:r("kol-table__selection-input kol-table__selection-input--checkbox"),ref:e=>e&&this.checkboxRefs.push(e)},p,{type:"checkbox",onInput:e=>{var t,i;const r=v?null===(i=null==c?void 0:c.selectedKeys)||void 0===i?void 0:i.filter(e=>e!==u):[...null!==(t=null==c?void 0:c.selectedKeys)&&void 0!==t?t:[],u];this.handleSelectionChangeCallbackAndEvent(e,null!=r?r:[])}}))):e("label",{class:"kol-table__selection-label"},e("input",Object.assign({class:r("kol-table__selection-input kol-table__selection-input--radio")},p,{type:"radio",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,u)}}))),e(a,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${u}-label`,_label:f})))}getColumnSettings(e){var t;return null===(t=this.state._tableSettings)||void 0===t?void 0:t.columns.find(t=>t.key===e.key)}getSelectionKeyPropertyName(){var e,t;return null!==(t=null===(e=this.state._selection)||void 0===e?void 0:e.keyPropertyName)&&void 0!==t?t:"id"}getDataWithSelectionEnabled(){const e=this.getSelectionKeyPropertyName();return this.state._data.filter(t=>{var i,r;return!(null===(r=null===(i=this.state._selection)||void 0===i?void 0:i.disabledKeys)||void 0===r?void 0:r.includes(t[e]))})}getSelectedKeysWithoutDisabledKeys(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter(e=>{var t,i;return!(null===(i=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===i?void 0:i.includes(e))})}getSelectedKeysWithDisabledKeysOnly(){var e,t;return null===(t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys)||void 0===t?void 0:t.filter(e=>{var t,i;return null===(i=null===(t=this.state._selection)||void 0===t?void 0:t.disabledKeys)||void 0===i?void 0:i.includes(e)})}getRevertedSelection(e){var t;const i=this.getSelectionKeyPropertyName(),r=null!==(t=this.getSelectedKeysWithDisabledKeysOnly())&&void 0!==t?t:[];return e&&r.push(...this.getDataWithSelectionEnabled().map(e=>null==e?void 0:e[i])),r}getTableMinWidth(){var e,t;const i=null!==(t=null===(e=this.state._tableSettings)||void 0===e?void 0:e.columns.filter(e=>e.visible).reduce((e,t)=>{var i;return e+(null!==(i=t.width)&&void 0!==i?i:0)},0))&&void 0!==t?t:0;return"auto"===this.state._minWidth?`${i}ch`:`max(${this.state._minWidth}, ${i}ch)`}renderHeadingSelectionCell(){var t,i;const n=this.state._selection;if(!n||!n.multiple&&void 0!==n.multiple)return e("th",{class:"kol-table__cell kol-table__cell--header",key:"thead-0"});const l=null!==(i=null===(t=this.getSelectedKeysWithoutDisabledKeys())||void 0===t?void 0:t.length)&&void 0!==i?i:0,s=l===this.getDataWithSelectionEnabled().length,h=0!==l&&!s;let d="kol-table-selection-indeterminate";s&&!h&&(d="kol-table-selection-none"),0===l&&(d="kol-table-selection-all");const u=c(d);return e("th",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header"},e("div",{class:r("kol-table__selection",{"kol-table__selection--indeterminate":h,"kol-table__selection--checked":s})},e("label",{class:"kol-table__selection-label"},e(o,{class:"kol-table__selection-icon",_icons:"codicon "+(h?"codicon-remove":s?"codicon-check":""),_label:""}),e("input",{class:r("kol-table__selection-input kol-table__selection-input--checkbox"),"data-testid":"selection-checkbox-all",ref:e=>e&&this.checkboxRefs.push(e),name:"selection",checked:s&&!h,indeterminate:h,"aria-label":u,type:"checkbox",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,this.getRevertedSelection(!s))}})),e(a,{"aria-hidden":"true",class:"kol-table__selection-input-tooltip",_align:"right",_id:`${d}-label`,_label:u})))}renderHeaderTdCell(){return e(i,null,Array.isArray(this.state._headerCells.horizontal)&&this.state._headerCells.horizontal.length>0&&Array.isArray(this.state._headerCells.vertical)&&this.state._headerCells.vertical.length>0&&Array.isArray(this.state._headerCells.horizontal)&&e("td",{"aria-hidden":"true",colSpan:this.state._headerCells.vertical.length,rowSpan:this.state._headerCells.horizontal.length}))}renderHeadingCell(t,i,a,n){const o=this.getColumnSettings(t);if(o&&!o.visible)return"";let s="none",c="codicon codicon-fold";if(t.sortDirection)switch(t.sortDirection){case"ASC":c="codicon codicon-chevron-up",s="ascending";break;case"DESC":c="codicon codicon-chevron-down",s="descending";break;default:s="none"}const h=n?"row":"number"==typeof t.colSpan&&t.colSpan>1?"colgroup":"col";return e("th",{key:`${i}-${a}-${t.label}`,class:r("kol-table__cell kol-table__cell--header",{[`kol-table__cell--align-${t.textAlign}`]:t.textAlign,[`kol-table__cell--${s}`]:s}),scope:h,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{width:(null==o?void 0:o.width)?`${o.width}ch`:t.width},"aria-sort":s,"data-sort":`sort-${t.sortDirection}`},t.sortDirection?e(l,{class:"kol-table__sort-button",exportparts:"icon",_icons:{right:c},_label:t.label,_ariaDescription:this.translateSort,_on:{onClick:e=>{var i;"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i.onSort)&&t.key&&t.sortDirection&&this.state._on.onSort(e,{key:t.key,currentSortDirection:t.sortDirection}),this.host&&g(this.host,S.sort,{key:t.key,currentSortDirection:t.sortDirection})}}}):t.label)}renderSpacer(t,i){var a,n;const o=(null===(a=this.state._headerCells.vertical)||void 0===a?void 0:a.length)||0,l=null===(n=null==i?void 0:i[0])||void 0===n?void 0:n.reduce((e,t)=>e+(t.colSpan||1),0),s=this.state._selection?1:0;return e("tr",{"aria-hidden":"true",class:r("kol-table__spacer",`kol-table__spacer--${t}`)},e("td",{class:r(`kol-table__spacer-line kol-table__spacer-line--${t}`),colSpan:o+l+s}))}renderFoot(){if(!this.state._dataFoot||0===this.state._dataFoot.length)return null;const t=this.createDataField(this.state._dataFoot,this.state._headerCells,!0);return e("tfoot",{class:"kol-table__footer"},[this.renderSpacer("foot",t),t.map((e,t)=>this.renderTableRow(e,t,!0,!0))])}render(){var t;const i=this.createDataField(this.state._data,this.state._headerCells);this.checkboxRefs=[];const r=null===(t=this.state._headerCells.horizontal)||void 0===t?void 0:t.map(e=>this.sortByColumnPosition(e));return e("div",{key:"9a5961e0b7d62ddd9638239d19d7ff4ab2f228b3",class:"kol-table"},e(s,{key:"2275f945d4ceb256d190ee5a24a3080f6e532394",_tableSettings:this.state._tableSettings}),e("div",{key:"3ab04b967a4f5a372fb4c604c8d12413ecf96df4",ref:e=>this.tableDivElement=e,class:"kol-table__scroll-container",tabindex:this.tableDivElementHasScrollbar?"-1":void 0},e("table",{key:"ac15c574822a18850146efe34364c86031258273",class:"kol-table__table",style:{minWidth:this.getTableMinWidth()}},e("caption",{key:"82eb5c5eddb8041f4d04c07511c8a05536d9a14f",class:"kol-table__focus-element kol-table__caption",id:"caption",tabindex:this.tableDivElementHasScrollbar?"0":void 0},this.state._label),Array.isArray(r)&&e("thead",{key:"39b1dfec7459ee236bd02c10505a6032d6b9261c",class:"kol-table__head"},[r.map((t,i)=>e("tr",{class:"kol-table__head-row",key:`thead-${i}`},this.state._selection&&this.renderHeadingSelectionCell(),0===i&&this.renderHeaderTdCell(),Array.isArray(t)&&t.map((e,t)=>this.renderHeadingCell(e,i,t,!1)))),this.renderSpacer("head",r)]),e("tbody",{key:"ccdf8ac49eed375f5b4c8892bbfed2120a9cda33",class:"kol-table__body"},i.map((e,t)=>this.renderTableRow(e,t,!0))),this.renderFoot())))}get host(){return n(this)}static get watchers(){return{_data:["validateData"],_dataFoot:["validateDataFoot"],_headerCells:["validateHeaderCells"],_label:["validateLabel"],_minWidth:["validateMinWidth"],_on:["validateOn"],_selection:["validateSelection"],_tableSettings:["validateTableSettings"]}}};export{dn as kol_table_stateless_wc};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as n,h as e}from"./index-DeYD98_2.js";import{m as t}from"./component-names-CkE54Ym7.js";import"./common-zXZUsQ7l.js";const o="@charset \"UTF-8\";\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n :host {\n display: inline-block;\n }\n .kol-button {\n display: inline-flex;\n place-items: center;\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n text-align: center;\n text-decoration-line: none;\n }\n .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"\";\n }\n .kol-button__text {\n width: 100%;\n margin: auto;\n }\n .kol-popover-button__button {\n display: inline-block;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n .kol-table-settings {\n background: #fff;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n }\n .kol-table-settings .kol-popover-button__popover {\n background: #fff;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n border-radius: calc(8rem / var(--kolibri-root-font-size, 16));\n border: 1px solid #d1d5db;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200rem / var(--kolibri-root-font-size, 16));\n margin-top: calc(16rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n overflow: hidden;\n gap: calc(8rem / var(--kolibri-root-font-size, 16));\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content 1fr calc(100rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n .kol-table {\n display: block;\n position: relative;\n max-width: 100%;\n }\n .kol-table__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table:has(.kol-table__focus-element:focus) .kol-table__scroll-container {\n /* @see https://remysharp.com/til/css/focus-ring-default-styles */\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: 2px;\n }\n .kol-table__table {\n width: 100%;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n padding-right: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__body {\n text-align: left;\n }\n .kol-table__body .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-left {\n text-align: left;\n }\n .kol-table__cell--align-left .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n justify-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n justify-items: end;\n }\n .kol-table__cell--selection {\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection-label--disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-icon {\n display: block;\n position: absolute;\n inset: auto;\n z-index: 1;\n }\n .kol-table__selection-input {\n border-style: solid;\n margin: 0;\n appearance: none;\n cursor: pointer;\n }\n .kol-table__selection-input:disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-input:before {\n content: \"\";\n }\n .kol-table__selection-input--checkbox {\n background-color: rgb(255, 255, 255);\n display: flex;\n position: relative;\n width: calc(var(--a11y-min-size) / 2);\n height: calc(var(--a11y-min-size) / 2);\n border-width: 2px;\n align-items: center;\n justify-content: center;\n line-height: 1.5;\n }\n .kol-table__selection-input--radio {\n border-radius: 100%;\n display: flex;\n width: 1.5em;\n min-width: 1.5em;\n height: 1.5em;\n min-height: 1.5em;\n padding: 0;\n border-width: 2px;\n }\n .kol-table__selection-input--radio:before {\n border-radius: 100%;\n width: 0.75em;\n height: 0.75em;\n margin: auto;\n }\n .kol-table__selection-input--radio:checked:before {\n background-color: #000;\n }\n @media (forced-colors: active) {\n .kol-table__selection-input--radio:checked:before {\n /* Give it a visible background in forced colors mode */\n background-color: selectedItem !important;\n }\n }\n}",i=class{constructor(e){n(this,e)}render(){return e(t,{key:"8c15043ee319bd85b3aeb21cfc3760d6ae8ca434",_data:this._data,_dataFoot:this._dataFoot,_headerCells:this._headerCells,_label:this._label,_minWidth:this._minWidth,_on:this._on,_selection:this._selection,_tableSettings:this._tableSettings})}};i.style={default:o};export{i as kol_table_stateless};
|
4
|
+
import{r as n,h as e}from"./index-BRWth_lT.js";import{m as t}from"./component-names-CkE54Ym7.js";import"./common-zXZUsQ7l.js";const o="@charset \"UTF-8\";\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n :host {\n display: inline-block;\n }\n .kol-button {\n display: inline-flex;\n place-items: center;\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n text-align: center;\n text-decoration-line: none;\n }\n .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"\";\n }\n .kol-button__text {\n width: 100%;\n margin: auto;\n }\n .kol-popover-button__button {\n display: inline-block;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n .kol-table-settings {\n background: #fff;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n }\n .kol-table-settings .kol-popover-button__popover {\n background: #fff;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n border-radius: calc(8rem / var(--kolibri-root-font-size, 16));\n border: 1px solid #d1d5db;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200rem / var(--kolibri-root-font-size, 16));\n margin-top: calc(16rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n overflow: hidden;\n gap: calc(8rem / var(--kolibri-root-font-size, 16));\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content 1fr calc(100rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n .kol-table {\n display: block;\n position: relative;\n max-width: 100%;\n }\n .kol-table__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table:has(.kol-table__focus-element:focus) .kol-table__scroll-container {\n /* @see https://remysharp.com/til/css/focus-ring-default-styles */\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: 2px;\n }\n .kol-table__table {\n width: 100%;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n padding-right: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__body {\n text-align: left;\n }\n .kol-table__body .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-left {\n text-align: left;\n }\n .kol-table__cell--align-left .kol-button__text {\n justify-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n justify-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n justify-items: end;\n }\n .kol-table__cell--selection {\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection-label--disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-icon {\n display: block;\n position: absolute;\n inset: auto;\n z-index: 1;\n }\n .kol-table__selection-input {\n border-style: solid;\n margin: 0;\n appearance: none;\n cursor: pointer;\n }\n .kol-table__selection-input:disabled {\n cursor: not-allowed;\n }\n .kol-table__selection-input:before {\n content: \"\";\n }\n .kol-table__selection-input--checkbox {\n background-color: rgb(255, 255, 255);\n display: flex;\n position: relative;\n width: calc(var(--a11y-min-size) / 2);\n height: calc(var(--a11y-min-size) / 2);\n border-width: 2px;\n align-items: center;\n justify-content: center;\n line-height: 1.5;\n }\n .kol-table__selection-input--radio {\n border-radius: 100%;\n display: flex;\n width: 1.5em;\n min-width: 1.5em;\n height: 1.5em;\n min-height: 1.5em;\n padding: 0;\n border-width: 2px;\n }\n .kol-table__selection-input--radio:before {\n border-radius: 100%;\n width: 0.75em;\n height: 0.75em;\n margin: auto;\n }\n .kol-table__selection-input--radio:checked:before {\n background-color: #000;\n }\n @media (forced-colors: active) {\n .kol-table__selection-input--radio:checked:before {\n /* Give it a visible background in forced colors mode */\n background-color: selectedItem !important;\n }\n }\n}",i=class{constructor(e){n(this,e)}render(){return e(t,{key:"8c15043ee319bd85b3aeb21cfc3760d6ae8ca434",_data:this._data,_dataFoot:this._dataFoot,_headerCells:this._headerCells,_label:this._label,_minWidth:this._minWidth,_on:this._on,_selection:this._selection,_tableSettings:this._tableSettings})}};i.style={default:o};export{i as kol_table_stateless};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as t,h as n,g as e}from"./index-DeYD98_2.js";import{w as i,d as o,j as s,s as a,N as l,H as r,I as d,P as h}from"./common-zXZUsQ7l.js";import{v as c}from"./align-BU6S1qiO.js";import{v as u}from"./label-DGzuU0HV.js";import{t as b}from"./i18n-C7ZsbK5l.js";import{d as p}from"./component-names-CkE54Ym7.js";import{K as f}from"./keyboard-D6PoWr38.js";import{d as m,K as g}from"./events-CoPFQEiC.js";import{c as y}from"./clsx-eK3rPvPS.js";import"./i18n-ZF6JbdVP.js";const v=["select-automatic","select-manual"],k=(t,e)=>{i(t,"_behavior",t=>"string"==typeof t&&v.includes(t),new Set([`KoliBriTabBehavior {${v.join(", ")}`]),e)},_=(t,e)=>{o(t,"_hasCreateButton",e)},w="/* forward the rem function */\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-tabs {\n display: var(--display);\n grid-template-columns: var(--grid-template-columns);\n grid-template-rows: var(--grid-template-rows);\n }\n .kol-tabs--align-right {\n --display: grid;\n --grid-template-columns: 1fr auto;\n --button-group-flex-direction: column;\n --button-group-order: 2;\n }\n .kol-tabs--align-left {\n --display: grid;\n --grid-template-columns: auto 1fr;\n --button-group-flex-direction: column;\n --button-group-order: 0;\n }\n .kol-tabs--align-bottom {\n --display: grid;\n --grid-template-rows: 1fr auto;\n --button-group-order: 2;\n }\n .kol-tabs__tabs-align-top {\n --display: grid;\n --grid-template-rows: auto 1fr;\n --button-group-order: 0;\n }\n .kol-tabs__button-group {\n display: flex;\n order: var(--button-group-order);\n flex-direction: var(--button-group-flex-direction);\n flex-wrap: wrap;\n }\n .kol-tabs__button-group .kol-button {\n border-bottom-color: transparent;\n display: block;\n border-bottom-style: solid;\n }\n .kol-tabs__panel {\n height: 100%;\n }\n}",x=class{constructor(e){t(this,e),this.onCreateLabel=`${b("kol-new")} …`,this.nextPossibleTabIndex=(t,e,n=1)=>{const o=e+n;return o<t.length?t[o]._disabled?this.nextPossibleTabIndex(t,e,n+1):o:e},this.prevPossibleTabIndex=(t,e,n=1)=>{const o=e-n;return o>=0?t[o]._disabled?this.prevPossibleTabIndex(t,e,n+1):o:e},this.onKeyDown=t=>{switch(t.key){case f.ArrowRight:this.goToNextTab(t);break;case f.ArrowLeft:this.goToPreviousTab(t);break;case f.Space:case f.Enter:this.activateFocusedTab(t)}},this.onClickSelect=(t,e)=>{this.selectNextTabEvent(t,e)},this.onMouseDown=t=>{t.preventDefault()},this.callbacks={onClick:this.onClickSelect,onMouseDown:this.onMouseDown},this.catchTabPanelHost=t=>{this.tabPanelHost=t},this._align="top",this._hasCreateButton=!1,this._selected=0,this.state={_align:"top",_label:"",_selected:0,_tabs:[]},this.selectNextNotDisabledTab=(t,e,n=!0,o)=>{if(t>e.length-1&&(t=e.length-1),t<0&&(t=0),Array.isArray(e)&&e[t]&&e[t]._disabled){if(!0===n){if(t<e.length-1)return this.selectNextNotDisabledTab(t+1,e,!0,o||t);t=o||t,n=!1}if(!1===n){if(t>0)return this.selectNextNotDisabledTab(t-1,e,!1,o||t);s("[KolTabs] All tabs are disabled, and therefore no tab can be displayed.")}}return t},this.syncSelectedAndTabs=(t,e,n,o)=>{let a,i;a="_selected"===o?t:this.state._selected,i="_tabs"===o?t:this.state._tabs,i.length>0&&e.set("_selected",this.selectNextNotDisabledTab(a,i))},this.refreshTabPanels=()=>{var t,e,n,o;if(this.tabPanelHost){for(;this.tabPanelHost.firstChild;)this.tabPanelHost.removeChild(this.tabPanelHost.firstChild);for(let a=0;a<(null===(t=this.state._tabs)||void 0===t?void 0:t.length);a++){const t=document.createElement("div");t.setAttribute("aria-labelledby",`${this.state._label.replace(/\s/g,"-")}-tab-${a}`),t.setAttribute("id",`tabpanel-${a}`),t.setAttribute("role","tabpanel"),t.setAttribute("hidden","");const i=document.createElement("slot");i.setAttribute("name",`tabpanel-slot-${a}`),t.appendChild(i),null===(e=this.tabPanelHost)||void 0===e||e.appendChild(t),"undefined"!=typeof HTMLCollection&&(null===(n=this.host)||void 0===n?void 0:n.children)instanceof HTMLCollection&&(null===(o=this.host)||void 0===o?void 0:o.children[a])&&this.host.children[a].setAttribute("slot",`tabpanel-slot-${a}`)}this.updateVisiblePanel()}},this.updateVisiblePanel=()=>{this.tabPanelHost&&Array.from(this.tabPanelHost.children).forEach((t,e)=>{e===this.state._selected?t.removeAttribute("hidden"):t.setAttribute("hidden","")})},this.onCreate=t=>{var e,n;t.preventDefault(),null===(n=null===(e=this.state._on)||void 0===e?void 0:e.onCreate)||void 0===n||n.call(e,t),this.host&&m(this.host,g.create)},this.onBlur=()=>{this.currentFocusIndex=void 0}}getCurrentFocusIndex(){return"number"==typeof this.currentFocusIndex?this.currentFocusIndex:this.state._selected}getKeyboardTabChangeMode(){return"select-manual"===this._behavior?"selectFocusOnly":"activateCompletely"}goToNextTab(t){const e=this.nextPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}goToPreviousTab(t){const e=this.prevPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}activateFocusedTab(t){"number"==typeof this.currentFocusIndex&&this.onSelect(t,this.currentFocusIndex)}selectNextTabEvent(t,e,n="activateCompletely"){var o,a;if(this.currentFocusIndex=e,this.focusTabById(e),"activateCompletely"===n){this._selected=e;null===(a=null===(o=this.state._tabs[e]._on)||void 0===o?void 0:o.onSelect)||void 0===a||a.call(o,t,e),this.onSelect(t,e)}}renderButtonGroup(){return n("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map((t,e)=>n(p,{_disabled:t._disabled,_icons:t._icons,_hideLabel:t._hideLabel,_label:t._label,_on:this.callbacks,_tabIndex:this.state._selected===e?0:-1,_tooltipAlign:t._tooltipAlign,_buttonVariant:this.state._selected===e?"custom":void 0,_customClass:this.state._selected===e?"selected":void 0,_ariaControls:`tabpanel-${e}`,_ariaSelected:this.state._selected===e,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${e}`,_role:"tab",_value:e})),this.state._hasCreateButton&&n(p,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"codicon codicon-plus","data-testid":"tabs-create-button"}))}render(){return n("div",{key:"c90d53464702512863a3483602ed15645a6c0484",ref:t=>{this.tabPanelsElement=t},class:y("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),n("div",{key:"3e172f4835867233726b1ae2081e3a6729eb3b83",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(t){c(this,t)}validateBehavior(t){k(this,t)}validateHasCreateButton(t){_(this,t)}validateLabel(t){u(this,t,{required:!0})}validateOn(t){if("object"==typeof t&&null!==t){const e={};"function"==typeof t.onCreate&&(e.onCreate=t.onCreate),"function"==typeof t.onSelect&&(e.onSelect=t.onSelect),a(this,"_on",e)}}validateSelected(t){l(this,"_selected",t,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(t){r(this,"_tabs",t=>"object"==typeof t&&null!==t&&"string"==typeof t._label&&t._label.length>0,t,void 0,{hooks:{beforePatch:this.syncSelectedAndTabs,afterPatch:this.refreshTabPanels}}),d("KolTabs",this.state._tabs.length)}componentWillLoad(){this.validateAlign(this._align),this.validateLabel(this._label),this.validateOn(this._on),this.validateSelected(this._selected),this.validateTabs(this._tabs),this.validateBehavior(this._behavior),this.validateHasCreateButton(this._hasCreateButton)}componentDidRender(){this.refreshTabPanels()}focusTabById(t){if(this.tabPanelsElement){const e=h(`button#${this.state._label.replace(/\s/g,"-")}-tab-${t}`,this.tabPanelsElement);null==e||e.focus()}}onSelect(t,e){var n,o;null===(o=null===(n=this._on)||void 0===n?void 0:n.onSelect)||void 0===o||o.call(n,t,e),this.host&&m(this.host,g.select,e),this.focusTabById(e)}get host(){return e(this)}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}};x.style={default:w};export{x as kol_tabs};
|
4
|
+
import{r as t,h as n,g as e}from"./index-BRWth_lT.js";import{w as i,d as o,j as s,s as a,N as l,H as r,I as d,P as h}from"./common-zXZUsQ7l.js";import{v as c}from"./align-BU6S1qiO.js";import{v as u}from"./label-DGzuU0HV.js";import{t as b}from"./i18n-C7ZsbK5l.js";import{d as p}from"./component-names-CkE54Ym7.js";import{K as f}from"./keyboard-D6PoWr38.js";import{d as m,K as g}from"./events-CoPFQEiC.js";import{c as y}from"./clsx-eK3rPvPS.js";import"./i18n-ZF6JbdVP.js";const v=["select-automatic","select-manual"],k=(t,e)=>{i(t,"_behavior",t=>"string"==typeof t&&v.includes(t),new Set([`KoliBriTabBehavior {${v.join(", ")}`]),e)},_=(t,e)=>{o(t,"_hasCreateButton",e)},w="/* forward the rem function */\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-tabs {\n display: var(--display);\n grid-template-columns: var(--grid-template-columns);\n grid-template-rows: var(--grid-template-rows);\n }\n .kol-tabs--align-right {\n --display: grid;\n --grid-template-columns: 1fr auto;\n --button-group-flex-direction: column;\n --button-group-order: 2;\n }\n .kol-tabs--align-left {\n --display: grid;\n --grid-template-columns: auto 1fr;\n --button-group-flex-direction: column;\n --button-group-order: 0;\n }\n .kol-tabs--align-bottom {\n --display: grid;\n --grid-template-rows: 1fr auto;\n --button-group-order: 2;\n }\n .kol-tabs__tabs-align-top {\n --display: grid;\n --grid-template-rows: auto 1fr;\n --button-group-order: 0;\n }\n .kol-tabs__button-group {\n display: flex;\n order: var(--button-group-order);\n flex-direction: var(--button-group-flex-direction);\n flex-wrap: wrap;\n }\n .kol-tabs__button-group .kol-button {\n border-bottom-color: transparent;\n display: block;\n border-bottom-style: solid;\n }\n .kol-tabs__panel {\n height: 100%;\n }\n}",x=class{constructor(e){t(this,e),this.onCreateLabel=`${b("kol-new")} …`,this.nextPossibleTabIndex=(t,e,n=1)=>{const o=e+n;return o<t.length?t[o]._disabled?this.nextPossibleTabIndex(t,e,n+1):o:e},this.prevPossibleTabIndex=(t,e,n=1)=>{const o=e-n;return o>=0?t[o]._disabled?this.prevPossibleTabIndex(t,e,n+1):o:e},this.onKeyDown=t=>{switch(t.key){case f.ArrowRight:this.goToNextTab(t);break;case f.ArrowLeft:this.goToPreviousTab(t);break;case f.Space:case f.Enter:this.activateFocusedTab(t)}},this.onClickSelect=(t,e)=>{this.selectNextTabEvent(t,e)},this.onMouseDown=t=>{t.preventDefault()},this.callbacks={onClick:this.onClickSelect,onMouseDown:this.onMouseDown},this.catchTabPanelHost=t=>{this.tabPanelHost=t},this._align="top",this._hasCreateButton=!1,this._selected=0,this.state={_align:"top",_label:"",_selected:0,_tabs:[]},this.selectNextNotDisabledTab=(t,e,n=!0,o)=>{if(t>e.length-1&&(t=e.length-1),t<0&&(t=0),Array.isArray(e)&&e[t]&&e[t]._disabled){if(!0===n){if(t<e.length-1)return this.selectNextNotDisabledTab(t+1,e,!0,o||t);t=o||t,n=!1}if(!1===n){if(t>0)return this.selectNextNotDisabledTab(t-1,e,!1,o||t);s("[KolTabs] All tabs are disabled, and therefore no tab can be displayed.")}}return t},this.syncSelectedAndTabs=(t,e,n,o)=>{let a,i;a="_selected"===o?t:this.state._selected,i="_tabs"===o?t:this.state._tabs,i.length>0&&e.set("_selected",this.selectNextNotDisabledTab(a,i))},this.refreshTabPanels=()=>{var t,e,n,o;if(this.tabPanelHost){for(;this.tabPanelHost.firstChild;)this.tabPanelHost.removeChild(this.tabPanelHost.firstChild);for(let a=0;a<(null===(t=this.state._tabs)||void 0===t?void 0:t.length);a++){const t=document.createElement("div");t.setAttribute("aria-labelledby",`${this.state._label.replace(/\s/g,"-")}-tab-${a}`),t.setAttribute("id",`tabpanel-${a}`),t.setAttribute("role","tabpanel"),t.setAttribute("hidden","");const i=document.createElement("slot");i.setAttribute("name",`tabpanel-slot-${a}`),t.appendChild(i),null===(e=this.tabPanelHost)||void 0===e||e.appendChild(t),"undefined"!=typeof HTMLCollection&&(null===(n=this.host)||void 0===n?void 0:n.children)instanceof HTMLCollection&&(null===(o=this.host)||void 0===o?void 0:o.children[a])&&this.host.children[a].setAttribute("slot",`tabpanel-slot-${a}`)}this.updateVisiblePanel()}},this.updateVisiblePanel=()=>{this.tabPanelHost&&Array.from(this.tabPanelHost.children).forEach((t,e)=>{e===this.state._selected?t.removeAttribute("hidden"):t.setAttribute("hidden","")})},this.onCreate=t=>{var e,n;t.preventDefault(),null===(n=null===(e=this.state._on)||void 0===e?void 0:e.onCreate)||void 0===n||n.call(e,t),this.host&&m(this.host,g.create)},this.onBlur=()=>{this.currentFocusIndex=void 0}}getCurrentFocusIndex(){return"number"==typeof this.currentFocusIndex?this.currentFocusIndex:this.state._selected}getKeyboardTabChangeMode(){return"select-manual"===this._behavior?"selectFocusOnly":"activateCompletely"}goToNextTab(t){const e=this.nextPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}goToPreviousTab(t){const e=this.prevPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(t,e,this.getKeyboardTabChangeMode())}activateFocusedTab(t){"number"==typeof this.currentFocusIndex&&this.onSelect(t,this.currentFocusIndex)}selectNextTabEvent(t,e,n="activateCompletely"){var o,a;if(this.currentFocusIndex=e,this.focusTabById(e),"activateCompletely"===n){this._selected=e;null===(a=null===(o=this.state._tabs[e]._on)||void 0===o?void 0:o.onSelect)||void 0===a||a.call(o,t,e),this.onSelect(t,e)}}renderButtonGroup(){return n("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map((t,e)=>n(p,{_disabled:t._disabled,_icons:t._icons,_hideLabel:t._hideLabel,_label:t._label,_on:this.callbacks,_tabIndex:this.state._selected===e?0:-1,_tooltipAlign:t._tooltipAlign,_buttonVariant:this.state._selected===e?"custom":void 0,_customClass:this.state._selected===e?"selected":void 0,_ariaControls:`tabpanel-${e}`,_ariaSelected:this.state._selected===e,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${e}`,_role:"tab",_value:e})),this.state._hasCreateButton&&n(p,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"codicon codicon-plus","data-testid":"tabs-create-button"}))}render(){return n("div",{key:"c90d53464702512863a3483602ed15645a6c0484",ref:t=>{this.tabPanelsElement=t},class:y("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),n("div",{key:"3e172f4835867233726b1ae2081e3a6729eb3b83",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(t){c(this,t)}validateBehavior(t){k(this,t)}validateHasCreateButton(t){_(this,t)}validateLabel(t){u(this,t,{required:!0})}validateOn(t){if("object"==typeof t&&null!==t){const e={};"function"==typeof t.onCreate&&(e.onCreate=t.onCreate),"function"==typeof t.onSelect&&(e.onSelect=t.onSelect),a(this,"_on",e)}}validateSelected(t){l(this,"_selected",t,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(t){r(this,"_tabs",t=>"object"==typeof t&&null!==t&&"string"==typeof t._label&&t._label.length>0,t,void 0,{hooks:{beforePatch:this.syncSelectedAndTabs,afterPatch:this.refreshTabPanels}}),d("KolTabs",this.state._tabs.length)}componentWillLoad(){this.validateAlign(this._align),this.validateLabel(this._label),this.validateOn(this._on),this.validateSelected(this._selected),this.validateTabs(this._tabs),this.validateBehavior(this._behavior),this.validateHasCreateButton(this._hasCreateButton)}componentDidRender(){this.refreshTabPanels()}focusTabById(t){if(this.tabPanelsElement){const e=h(`button#${this.state._label.replace(/\s/g,"-")}-tab-${t}`,this.tabPanelsElement);null==e||e.focus()}}onSelect(t,e){var n,o;null===(o=null===(n=this._on)||void 0===n?void 0:n.onSelect)||void 0===o||o.call(n,t,e),this.host&&m(this.host,g.select,e),this.focusTabById(e)}get host(){return e(this)}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}};x.style={default:w};export{x as kol_tabs};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{h as e,r as t,g as n}from"./index-DeYD98_2.js";import{c as i}from"./clsx-eK3rPvPS.js";import{e as a,c as o,g as s,a as l,F as r}from"./FormFieldStateWrapper-JzdOEGUS.js";import{I as d,a as h}from"./controller-icon-BQ1Jj9uA.js";import{_ as c}from"./Heading-Bx4SwJcX.js";import{w as m,e as u}from"./common-zXZUsQ7l.js";import{n as p}from"./dev.utils-C5gRSnou.js";import{a as f,v as b,b as v}from"./max-length-behavior-DCUK2Rvw.js";import{v as g}from"./placeholder-CKKvVrmb.js";import{v as y}from"./read-only-D2aPahKx.js";import{v as k}from"./required-DZ-b_DWV.js";import{v as _}from"./rows-DZqgM5RX.js";import{v as w}from"./spell-check-Chr2J8Ox.js";import"./access-and-short-key-CBDgF26-.js";import"./disabled-oePQqAfy.js";import"./hide-label-BmYpplzr.js";import"./label-DGzuU0HV.js";import"./tooltip-align-CmSyNCv5.js";import"./align-BU6S1qiO.js";import"./events-CoPFQEiC.js";import"./associated.controller-BBBKf7S0.js";import"./bootstrap-B_0ftOOI.js";import"./component-names-CkE54Ym7.js";import"./i18n-ZF6JbdVP.js";import"./isObject-DvSELytj.js";import"./Alert-CSRc8Vlr.js";import"./i18n-C7ZsbK5l.js";import"./bem-DqV0swL_.js";import"./browser-DAVbNx-f.js";import"./InternalUnderlinedBadgeText-uelJXiTq.js";import"./reuse-CX4AQDkS.js";import"./Icon-B4HuRse0.js";import"./icons-CH_AgdgO.js";const x=["vertical","none"],j=e=>"string"==typeof e&&x.includes(e),z=(e,t)=>{m(e,"_resize",j,new Set(x),t,{defaultValue:"vertical"})},B=t=>{const{class:n,msg:l,touched:s,readonly:r,disabled:d,required:h,ariaDescribedBy:m,hideLabel:u,label:p}=t,v=c(t,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),f=o(l,s),b={"kol-textarea--disabled":Boolean(d),"kol-textarea--required":Boolean(h),"kol-textarea--touched":Boolean(s),"kol-textarea--readonly":Boolean(r),[`kol-textarea--${(null==l?void 0:l.type)||"error"}`]:f},g=Object.assign(Object.assign({class:i("kol-textarea",b,n),required:h,disabled:d,readonly:r},a({ariaDescribedBy:m,hideLabel:u,label:p})),v);return e("textarea",Object.assign({},g))};function S(e,t){var n;const a=[...s(e).ariaDescribedBy,...null!==(n=t.ariaDescribedBy)&&void 0!==n?n:[]],i=Object.assign(Object.assign({id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,touched:e._touched,msg:l(e._msg)},t),{ariaDescribedBy:a});return"_maxLength"in e&&"_maxLengthBehavior"in e&&"hard"===e._maxLengthBehavior&&(i.maxLength=e._maxLength),i}const L=t=>{var{state:n}=t,a=c(t,["state"]);return e(B,Object.assign({},S(n,a)))};class C extends d{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=e}validateHasCounter(e){f(this.component,e)}validateMaxLengthBehavior(e){b(this.component,e)}validateMaxLength(e){v(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePlaceholder(e){g(this.component,e)}validateReadOnly(e){y(this.component,e)}validateResize(e){z(this.component,e)}validateRequired(e){k(this.component,e)}validateRows(e){_(this.component,e)}validateSpellCheck(e){w(this.component,e)}validateValue(e){u(this.component,"_value",e,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(){super.componentWillLoad(),this.validateHasCounter(this.component._hasCounter),this.validateMaxLengthBehavior(this.component._maxLengthBehavior),this.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateResize(this.component._resize),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const O="/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: \"*\";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: \"*\";\n }\n .kol-input-container {\n background-color: white;\n display: grid;\n width: 100%;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n grid-template-columns: 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n .kol-textarea {\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}",q=e=>{e.style.overflow="hidden";const t=e.rows,n=e.clientHeight/t;e.rows=1;const a=Math.round(e.scrollHeight/n);return e.rows=t,a},D=class{async getValue(){var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.value}async kolFocus(){var e;null===(e=this.textareaRef)||void 0===e||e.focus()}getFormFieldProps(){return{state:this.state,class:i("kol-form-field-textarea",{"kol-form-field--has-value":this.state._hasValue,"kol-form-field--has-counter":this.controller.hasSoftCharacterLimit()||this.controller.hasCounter()}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getTextAreaProps(){const e="number"==typeof this.state._maxLength?[`${this.state._id}-character-limit-hint`]:void 0;return Object.assign(Object.assign({ref:this.catchRef,state:this.state,style:{resize:this.state._resize},ariaDescribedBy:e},this.controller.onFacade),{onInput:this.onInput,onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return e(r,Object.assign({key:"a04967ea2fecb1a7c6f238600d52f2d4d4b4cc72"},this.getFormFieldProps()),e(h,{key:"db4f3ed0dfa745c109a3a21346df79722b0f7595",state:this.state},e(L,Object.assign({key:"71376e1ff01a524c589632fff16023da5bb9774b"},this.getTextAreaProps()))))}constructor(e){t(this,e),this.catchRef=e=>{this.textareaRef=e},this._adjustHeight=!1,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._hasCounter=!1,this._maxLengthBehavior="hard",this._readOnly=!1,this._resize="vertical",this._required=!1,this._tooltipAlign="top",this._touched=!1,this.state={_adjustHeight:!1,_currentLength:0,_currentLengthDebounced:0,_hasValue:!1,_hideMsg:!1,_id:`id-${p()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,this.onInput=e=>{this.textareaRef instanceof HTMLTextAreaElement&&(this._value=this.textareaRef.value,this.state._adjustHeight&&(this._rows=q(this.textareaRef)),this.controller.onFacade.onInput(e))},this.controller=new C(this,"textarea",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAdjustHeight(e){this.controller.validateAdjustHeight(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateId(e){this.controller.validateId(e)}validateLabel(e){this.controller.validateLabel(e)}validateMaxLength(e){this.controller.validateMaxLength(e)}validateMaxLengthBehavior(e){this.controller.validateMaxLengthBehavior(e)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateReadOnly(e){this.controller.validateReadOnly(e)}validateResize(e){this.controller.validateResize(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSpellCheck(e){this.controller.validateSpellCheck(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentDidLoad(){setTimeout(()=>{var e;!0===this._adjustHeight&&this.textareaRef?this._rows=(null===(e=this.state)||void 0===e?void 0:e._rows)&&this.state._rows>q(this.textareaRef)?this.state._rows:q(this.textareaRef):this._rows||(this._rows=1)},0)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener(e=>this.state._hasValue=!!e)}static get delegatesFocus(){return!0}get host(){return n(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}}};D.style={default:O};export{D as kol_textarea};
|
4
|
+
import{h as e,r as t,g as n}from"./index-BRWth_lT.js";import{c as i}from"./clsx-eK3rPvPS.js";import{e as a,c as o,g as s,a as l,F as r}from"./FormFieldStateWrapper-CGvaBC47.js";import{I as d,a as h}from"./controller-icon-Dak8u7ck.js";import{_ as c}from"./Heading-BPYmDTUk.js";import{w as m,e as p}from"./common-zXZUsQ7l.js";import{n as u}from"./dev.utils-CMSYtmAz.js";import{a as f,v as b,b as v}from"./max-length-behavior-DCUK2Rvw.js";import{v as y}from"./placeholder-CKKvVrmb.js";import{v as g}from"./read-only-D2aPahKx.js";import{v as k}from"./required-DZ-b_DWV.js";import{v as _}from"./rows-DZqgM5RX.js";import{v as w}from"./spell-check-Chr2J8Ox.js";import"./access-and-short-key-CBDgF26-.js";import"./disabled-oePQqAfy.js";import"./hide-label-BmYpplzr.js";import"./label-DGzuU0HV.js";import"./tooltip-align-CmSyNCv5.js";import"./align-BU6S1qiO.js";import"./events-CoPFQEiC.js";import"./associated.controller-BVXWSO2G.js";import"./bootstrap-YDZ8Qb_h.js";import"./component-names-CkE54Ym7.js";import"./i18n-ZF6JbdVP.js";import"./isObject-DvSELytj.js";import"./Alert-C9KodDn-.js";import"./i18n-C7ZsbK5l.js";import"./bem-DqV0swL_.js";import"./browser-DAVbNx-f.js";import"./InternalUnderlinedBadgeText-Cx9AyLre.js";import"./reuse-CX4AQDkS.js";import"./Icon-CPJLro7v.js";import"./icons-CH_AgdgO.js";const x=["vertical","none"],j=e=>"string"==typeof e&&x.includes(e),z=(e,t)=>{m(e,"_resize",j,new Set(x),t,{defaultValue:"vertical"})},L=t=>{const{class:n,msg:l,touched:s,readonly:r,disabled:d,required:h,ariaDescribedBy:m,hideLabel:u,label:p}=t,v=c(t,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),f=o(l,s),b={"kol-textarea--disabled":Boolean(d),"kol-textarea--required":Boolean(h),"kol-textarea--touched":Boolean(s),"kol-textarea--readonly":Boolean(r),[`kol-textarea--${(null==l?void 0:l.type)||"error"}`]:f},g=Object.assign(Object.assign({class:i("kol-textarea",b,n),required:h,disabled:d,readonly:r},a({ariaDescribedBy:m,hideLabel:u,label:p})),v);return e("textarea",Object.assign({},g))};function C(e,t){var n;const a=[...s(e).ariaDescribedBy,...null!==(n=t.ariaDescribedBy)&&void 0!==n?n:[]],i=Object.assign(Object.assign({id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,touched:e._touched,msg:l(e._msg)},t),{ariaDescribedBy:a});return"_maxLength"in e&&"_maxLengthBehavior"in e&&"hard"===e._maxLengthBehavior&&(i.maxLength=e._maxLength),i}const B=t=>{var{state:n}=t,a=c(t,["state"]);return e(L,Object.assign({},C(n,a)))};class S extends d{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=e}validateHasCounter(e){f(this.component,e)}validateMaxLengthBehavior(e){b(this.component,e)}validateMaxLength(e){v(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePlaceholder(e){y(this.component,e)}validateReadOnly(e){g(this.component,e)}validateResize(e){z(this.component,e)}validateRequired(e){k(this.component,e)}validateRows(e){_(this.component,e)}validateSpellCheck(e){w(this.component,e)}validateValue(e){p(this.component,"_value",e,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(){super.componentWillLoad(),this.validateHasCounter(this.component._hasCounter),this.validateMaxLengthBehavior(this.component._maxLengthBehavior),this.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateResize(this.component._resize),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const D="/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: \"*\";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: \"*\";\n }\n .kol-input-container {\n background-color: white;\n display: grid;\n width: 100%;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n grid-template-columns: 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n .kol-textarea {\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}",O=e=>{e.style.overflow="hidden";const t=e.rows,n=e.clientHeight/t;e.rows=1;const a=Math.round(e.scrollHeight/n);return e.rows=t,a},q=class{async getValue(){var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.value}async kolFocus(){var e;null===(e=this.textareaRef)||void 0===e||e.focus()}getFormFieldProps(){return{state:this.state,class:i("kol-form-field-textarea",{"kol-form-field--has-value":this.state._hasValue,"kol-form-field--has-counter":this.controller.hasSoftCharacterLimit()||this.controller.hasCounter()}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getTextAreaProps(){const e="number"==typeof this.state._maxLength?[`${this.state._id}-character-limit-hint`]:void 0;return Object.assign(Object.assign({ref:this.catchRef,state:this.state,style:{resize:this.state._resize},ariaDescribedBy:e},this.controller.onFacade),{onInput:this.onInput,onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return e(r,Object.assign({key:"a04967ea2fecb1a7c6f238600d52f2d4d4b4cc72"},this.getFormFieldProps()),e(h,{key:"db4f3ed0dfa745c109a3a21346df79722b0f7595",state:this.state},e(B,Object.assign({key:"71376e1ff01a524c589632fff16023da5bb9774b"},this.getTextAreaProps()))))}constructor(e){t(this,e),this.catchRef=e=>{this.textareaRef=e},this._adjustHeight=!1,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._hasCounter=!1,this._maxLengthBehavior="hard",this._readOnly=!1,this._resize="vertical",this._required=!1,this._tooltipAlign="top",this._touched=!1,this.state={_adjustHeight:!1,_currentLength:0,_currentLengthDebounced:0,_hasValue:!1,_hideMsg:!1,_id:`id-${u()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,this.onInput=e=>{this.textareaRef instanceof HTMLTextAreaElement&&(this._value=this.textareaRef.value,this.state._adjustHeight&&(this._rows=O(this.textareaRef)),this.controller.onFacade.onInput(e))},this.controller=new S(this,"textarea",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAdjustHeight(e){this.controller.validateAdjustHeight(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateId(e){this.controller.validateId(e)}validateLabel(e){this.controller.validateLabel(e)}validateMaxLength(e){this.controller.validateMaxLength(e)}validateMaxLengthBehavior(e){this.controller.validateMaxLengthBehavior(e)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateReadOnly(e){this.controller.validateReadOnly(e)}validateResize(e){this.controller.validateResize(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSpellCheck(e){this.controller.validateSpellCheck(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentDidLoad(){setTimeout(()=>{var e;!0===this._adjustHeight&&this.textareaRef?this._rows=(null===(e=this.state)||void 0===e?void 0:e._rows)&&this.state._rows>O(this.textareaRef)?this.state._rows:O(this.textareaRef):this._rows||(this._rows=1)},0)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener(e=>this.state._hasValue=!!e)}static get delegatesFocus(){return!0}get host(){return n(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}}};q.style={default:D};export{q as kol_textarea};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{h as n,r as t,H as e}from"./index-
|
4
|
+
import{h as n,r as t,H as e}from"./index-BRWth_lT.js";import{t as o}from"./i18n-C7ZsbK5l.js";import{n as i}from"./dev.utils-CMSYtmAz.js";import{n as s}from"./component-names-CkE54Ym7.js";import{K as a}from"./Alert-C9KodDn-.js";import"./common-zXZUsQ7l.js";import"./markdown-BJ3cxn6B.js";import{_ as l}from"./Heading-BPYmDTUk.js";import{c as r}from"./clsx-eK3rPvPS.js";import"./i18n-ZF6JbdVP.js";import"./bem-DqV0swL_.js";import"./browser-DAVbNx-f.js";const c=t=>{var{status:e,toast:o,onClose:s}=t,i=l(t,["status","toast","onClose"]);const{type:d,label:c,description:h,variant:m}=o;return n("div",{class:r("kol-toast-item",`kol-toast-item--${e}`)},n(a,{class:"kol-toast-item__alert",alert:!0,label:c,level:0,hasCloser:!0,type:d,variant:m||"card",onCloserClick:s},n("div",Object.assign({},i),h)))},d="/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/* forward the rem function */\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n display: flex;\n place-items: center;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n :host {\n display: flex;\n position: fixed;\n z-index: 200;\n flex-direction: column;\n }\n .kol-toast-container__close-all {\n align-self: flex-end;\n }\n}",h=300,m=class{constructor(n){t(this,n),this.state={_toastStates:[]},this.translateToastCloseAll=o("kol-toast-close-all"),this.knownRenderFunctions=new Set}async enqueue(t){const n={toast:t,status:"adding",id:`toast-${i()}`};return this.state=Object.assign(Object.assign({},this.state),{_toastStates:[n,...this.state._toastStates]}),setTimeout(()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map(t=>t.id===n.id&&"removing"!==t.status?Object.assign(Object.assign({},t),{status:"settled"}):t)})},h),()=>{this.handleClose(n)}}handleClose(t){this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map(n=>(n.id===t.id&&(n.status="removing"),n))}),setTimeout(()=>{var n,e;this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter(n=>n.id!==t.id)}),null===(e=(n=t.toast).onClose)||void 0===e||e.call(n)},h)}async closeAll(t=!1){if(t)this.state=Object.assign(Object.assign({},this.state),{_toastStates:[]});else{const t=[...this.state._toastStates];this.state=Object.assign(Object.assign({},this.state),{_toastStates:t.map(t=>Object.assign(Object.assign({},t),{status:"removing"}))}),setTimeout(()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter(n=>t.every(t=>t.id!==n.id))}),t.forEach(t=>{var n,e;null===(e=(n=t.toast).onClose)||void 0===e||e.call(n)})},h)}}handleToastRef(t,n){n&&"function"==typeof t.toast.render&&!this.knownRenderFunctions.has(t.toast.render)&&(this.knownRenderFunctions.add(t.toast.render),t.toast.render(n,{close:()=>this.handleClose(t)}))}render(){return n(e,{key:"e6841e1a26bc8c24de441ed1d444175021f8d7b5",class:"kol-toast-container"},this.state._toastStates.length>1&&n(s,{key:"938ab38123fd91e356eb63b4c315d1884eb37197",_label:this.translateToastCloseAll,class:"kol-toast-container__button-close-all",_on:{onClick:()=>{this.closeAll()}}}),this.state._toastStates.map(t=>n(c,{key:t.id,onClose:()=>this.handleClose(t),ref:n=>this.handleToastRef(t,n),toast:t.toast,status:t.status})))}};m.style={default:d};export{m as kol_toast_container};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as n,h as e,g as t}from"./index-
|
4
|
+
import{r as n,h as e,g as t}from"./index-BRWth_lT.js";import{O as o,o as i,p as a,s as l}from"./common-zXZUsQ7l.js";import{v as s}from"./label-DGzuU0HV.js";import{f as r,d}from"./component-names-CkE54Ym7.js";import{v as c}from"./orientation-DdsLYtB3.js";import{K as h}from"./keyboard-D6PoWr38.js";const m=(n,e)=>{o(e,()=>{i(e,()=>{void 0===e&&(e=[]);try{e=a(e)}catch(n){}Array.isArray(e)&&e.every(n=>"object"==typeof n&&null!==n)&&l(n,"_items",e)})})},p="@charset \"UTF-8\";\n/* forward the rem function */\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n .kol-tooltip {\n display: contents;\n contain: layout;\n }\n .kol-tooltip__floating {\n display: none;\n position: fixed;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n max-width: 90vw;\n max-height: 90vh;\n visibility: hidden;\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__arrow {\n transform: rotate(45deg);\n color: #000;\n background-color: #fff;\n position: absolute;\n z-index: 999;\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tooltip__content {\n color: #000;\n background-color: #fff;\n position: relative;\n z-index: 1000;\n }\n}\n@layer kol-component {\n :host {\n display: inline-block;\n }\n .kol-link {\n display: inline-flex;\n place-items: center;\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n text-align: center;\n text-decoration-line: none;\n }\n .kol-link::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"\";\n }\n .kol-link__text {\n width: 100%;\n margin: auto;\n }\n .kol-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n .kol-toolbar--orientation-vertical {\n flex-direction: column;\n align-items: stretch;\n }\n .kol-toolbar:focus-within {\n outline: 1px solid;\n outline-offset: 2px;\n }\n}",f=class{constructor(t){n(this,t),this.state={_label:"",_items:[]},this.currentIndex=0,this.indexToElement=new Map,this.renderItem=(n,t)=>{const o=t!==this.currentIndex||(null==n?void 0:n._disabled)?-1:0,i={key:t,class:"button normal kol-toolbar__item",_tabIndex:o},a=n=>{n&&this.indexToElement.set(t,n)};return e("_href"in n?r:d,Object.assign({},n,i,{ref:a}))}}render(){return e("div",{key:"2b79702bb51922cea9ae81435bfce227b1c4ce5a",class:`kol-toolbar kol-toolbar--orientation-${this.state._orientation}`,role:"toolbar","aria-label":this.state._label},this.state._items.map(this.renderItem))}validateLabel(n){s(this,n)}validateItems(n){m(this,n)}validateOrientation(n){c(this,n)}getCurrentToolbarItem(n){return"number"==typeof n?this.indexToElement.get(n):void 0}setFirstEnabledItemIndex(){var n;this.currentIndex=null===(n=this.state._items)||void 0===n?void 0:n.findIndex(n=>!n._disabled)}handleKeyDown(n){var e,t;const o=n.code;if(![h.ArrowUp,h.ArrowDown,h.ArrowRight,h.ArrowLeft].includes(o))return;n.preventDefault();const i=(null===(e=this._items)||void 0===e?void 0:e.length)-1,a=this.currentIndex;let l=0;switch(o){case h.ArrowUp:case h.ArrowLeft:l=a!==l?a-1:i;break;case h.ArrowDown:case h.ArrowRight:i!==a&&(l=a+1)}a!==l&&(this.currentIndex=l,null===(t=this.getCurrentToolbarItem(l))||void 0===t||t.kolFocus())}handleBlur(n){n.target===this.host&&this.setFirstEnabledItemIndex()}componentWillLoad(){this.validateLabel(this._label),this.validateItems(this._items),this.validateOrientation(this._orientation),this.setFirstEnabledItemIndex()}get host(){return t(this)}static get watchers(){return{_label:["validateLabel"],_items:["validateItems"],_orientation:["validateOrientation"]}}};f.style={default:p};export{f as kol_toolbar};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as
|
4
|
+
import{r as t,h as i,H as s,g as e}from"./index-BRWth_lT.js";import{b as h,a as o}from"./align-floating-elements-CB8sErUz.js";import{e as a,A as n}from"./common-zXZUsQ7l.js";import{v as l}from"./align-BU6S1qiO.js";import{v as r}from"./label-DGzuU0HV.js";import"./Alert-C9KodDn-.js";import{K as d}from"./Span-BebyS5Q1.js";import"./i18n-C7ZsbK5l.js";import"./Heading-BPYmDTUk.js";import"./clsx-eK3rPvPS.js";import"./component-names-CkE54Ym7.js";import"./bem-DqV0swL_.js";import"./browser-DAVbNx-f.js";import"./Icon-CPJLro7v.js";import"./reuse-CX4AQDkS.js";import"./markdown-BJ3cxn6B.js";import"./InternalUnderlinedBadgeText-Cx9AyLre.js";import"./isObject-DvSELytj.js";import"./i18n-ZF6JbdVP.js";const c=(t,e)=>{a(t,"_badgeText",e)},m=(t,e)=>{a(t,"_id",e)},f=new Set;function p(t){f.forEach(t=>{t.style.setProperty("z-index","999")}),f.add(t),t.style.setProperty("z-index","1000")}function u(t){if(f.delete(t),f.size>0){const t=Array.from(f).pop();t&&t.style.setProperty("z-index","1000")}}const b=300,v=class{constructor(e){t(this,e),this.showTooltip=()=>{if(this.previousSibling&&this.tooltipElement){p(this.tooltipElement),this.tooltipElement.style.setProperty("display","block"),n().addEventListener("keyup",this.hideTooltipByEscape);const t=this.previousSibling,e=this.tooltipElement;this.cleanupAutoPositioning=h(t,e,()=>{this.alignTooltip()})}},this.showTooltipWithDelay=()=>{clearTimeout(this.hideTooltipTimeout),clearTimeout(this.showTooltipTimeout),this.showTooltipTimeout=setTimeout(()=>{this.showTooltip()},b)},this.hideTooltipWithDelay=()=>{clearTimeout(this.hideTooltipTimeout),this.hideTooltipTimeout=setTimeout(()=>{this.hideTooltip()},b)},this.hideTooltipByEscape=t=>{"Escape"===t.key&&this.hideTooltip()},this.addListeners=t=>{t.addEventListener("mouseenter",this.handleMouseEnter.bind(this)),t.addEventListener("mouseleave",this.handleMouseleave.bind(this)),t.addEventListener("focusin",this.handleFocusIn.bind(this)),t.addEventListener("focusout",this.handleFocusout.bind(this))},this.removeListeners=t=>{t.removeEventListener("mouseenter",this.handleMouseEnter.bind(this)),t.removeEventListener("mouseleave",this.handleMouseleave.bind(this)),t.removeEventListener("focusin",this.handleFocusIn.bind(this)),t.removeEventListener("focusout",this.handleFocusout.bind(this))},this.resyncListeners=(t,e,i=!1)=>{t&&this.removeListeners(t),e&&(i&&(this.previousSibling=e),this.addListeners(e))},this.catchTooltipElement=t=>{this.tooltipElement=t},this.catchArrowElement=t=>{this.arrowElement=t},this._align="top",this.state={_align:"top",_label:""}}async alignTooltip(){this.tooltipElement&&this.previousSibling&&await o({align:this._align,referenceElement:this.previousSibling,arrowElement:this.arrowElement,floatingElement:this.tooltipElement})}async hideTooltip(){clearTimeout(this.showTooltipTimeout),this.tooltipElement&&(u(this.tooltipElement),this.tooltipElement.style.setProperty("display","none"),this.tooltipElement.style.setProperty("visibility","hidden"),this.cleanupAutoPositioning&&(this.cleanupAutoPositioning(),this.cleanupAutoPositioning=void 0)),n().removeEventListener("keyup",this.hideTooltipByEscape)}handleMouseEnter(){this.showTooltipWithDelay()}handleMouseleave(){this.hideTooltipWithDelay()}handleFocusIn(){this.showTooltipWithDelay()}handleFocusout(){this.hideTooltipWithDelay()}render(){return i(s,{key:"60be1bd258bc5ae2b0ecce9374607d11476071b1",class:"kol-tooltip"},""!==this.state._label&&i("div",{key:"2af044756ca7d87c5b789181da84556a517c0ee4",class:"kol-tooltip__floating",ref:this.catchTooltipElement},i("div",{key:"057fc2de5c87f0f82e9477568992048bf3918e77",class:"kol-tooltip__arrow",ref:this.catchArrowElement}),i(d,{key:"1ba456fb877c04c0dc1e93431f90db07f2e90b47",class:"kol-tooltip__content",id:this.state._id,badgeText:this._badgeText,label:this.state._label})))}validateBadgeText(t){c(this,t)}validateAlign(t){l(this,t)}validateId(t){m(this,t)}validateLabel(t){r(this,t,{required:!0})}componentWillLoad(){this.validateBadgeText(this._badgeText),this.validateAlign(this._align),this.validateId(this._id),this.validateLabel(this._label)}handleEventListeners(){var t;this.resyncListeners(this.previousSibling,null===(t=this.host)||void 0===t?void 0:t.previousElementSibling,!0),this.resyncListeners(this.tooltipElement,this.tooltipElement)}connectedCallback(){var t;this.previousSibling=null===(t=this.host)||void 0===t?void 0:t.previousElementSibling}componentDidRender(){this.handleEventListeners()}disconnectedCallback(){this.previousSibling&&(this.removeListeners(this.previousSibling),this.previousSibling=void 0),this.tooltipElement&&this.removeListeners(this.tooltipElement),this.cleanupAutoPositioning&&this.cleanupAutoPositioning()}get host(){return e(this)}static get watchers(){return{_badgeText:["validateBadgeText"],_align:["validateAlign"],_id:["validateId"],_label:["validateLabel"]}}};export{v as kol_tooltip_wc};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as e,h as t,H as i,g as s}from"./index-
|
4
|
+
import{r as e,h as t,H as i,g as s}from"./index-BRWth_lT.js";import{d as a}from"./common-zXZUsQ7l.js";import{v as l}from"./href-BETcU_FA.js";import{v as o}from"./label-DGzuU0HV.js";import{v as n}from"./open-DDc2yKMt.js";import{f as c,e as r,x as h}from"./component-names-CkE54Ym7.js";import{n as d}from"./dev.utils-CMSYtmAz.js";import{c as f}from"./clsx-eK3rPvPS.js";const _=(e,t,s)=>{a(e,"_active",t,s)},m=class{constructor(t){e(this,t),this.groupId=`tree-group-${d()}`,this.state={_active:!1,_hasChildren:!1,_href:"",_label:"",_open:!1}}render(){const{_href:e,_active:a,_hasChildren:s,_open:l,_label:n}=this.state;return t(i,{key:"e8cebee52ed0f115c3aa30e82e2e3ccf5d09e626",onSlotchange:this.handleSlotchange.bind(this)},t("li",{key:"c4b1d56ae69f55ca57ad8d863df02fe0d7ff4f00",class:"kol-tree-item",style:{"--level":`${this.level}`}},t(c,{key:"8e87e00dae2d0e6dcad5602e28b5642bc31702f5",class:f("kol-tree-item__link",{"kol-tree-item__link--first-level":0===this.level,"kol-tree-item__link--active":a}),_href:e,_label:"",_role:"treeitem",_tabIndex:a?0:-1,_ariaExpanded:s?l:void 0,_ariaOwns:s?this.groupId:void 0,ref:e=>this.linkElement=e},t("span",{key:"2375f5ff6abe59419b5d4ef28e5e0f104034fef3",class:"kol-tree-item__link-inner",slot:"expert"},s?t("span",{class:"kol-tree-item__toggle-button",onClick:e=>l?void this.handleCollapseClick(e):void this.handleExpandClick(e)},t(r,{class:"kol-tree-item__toggle-button-icon",_icons:"codicon codicon-"+(l?"chevron-down":"chevron-right"),_label:""})):t("span",{class:"kol-tree-item__toggle-button-placeholder"}),t("span",{key:"39c07661723143bfafcc6ee8e96e51bd88daa940",class:"kol-tree-item__text"},n))),t("ul",{key:"2bd2e3a880b4d1946f00e46784f476e69508441b",class:"kol-tree-item__children",hidden:!s||!l,role:"group",id:this.groupId},t("slot",{key:"472cc53e288b84a99a0190a82be67e04ce851f99"}))))}validateActive(e){_(this,e||!1)}validateLabel(e){o(this,e)}validateOpen(e){n(this,e)}validateHref(e){l(this,e)}componentWillLoad(){this.validateActive(this._active),this.validateLabel(this._label),this.validateOpen(this._open),this.validateHref(this._href),this.checkForChildren(),this.determineTreeItemDepth()}determineTreeItemDepth(){let e=0,t=this.host.parentNode.host.parentNode;for(;null!==t&&t.tagName.toLowerCase()!==h&&t!==document.body;)t=t.parentElement,e+=1;this.level=e}handleSlotchange(){this.checkForChildren()}checkForChildren(){var e,t;this.state=Object.assign(Object.assign({},this.state),{_hasChildren:Boolean(null===(t=null===(e=this.host.querySelector("slot"))||void 0===e?void 0:e.assignedElements)||void 0===t?void 0:t.call(e).length)})}async focusLink(){await this.linkElement.kolFocus()}async handleExpandClick(e){e.preventDefault(),await this.linkElement.kolFocus(),await this.expand()}async expand(){this.state._hasChildren&&(this.state=Object.assign(Object.assign({},this.state),{_open:!0}))}async handleCollapseClick(e){e.preventDefault(),this.linkElement.focus(),await this.collapse()}async collapse(){this.state._hasChildren&&(this.state=Object.assign(Object.assign({},this.state),{_open:!1}))}async isOpen(){var e;return null!==(e=this.state._open)&&void 0!==e&&e}get host(){return s(this)}static get watchers(){return{_active:["validateActive"],_label:["validateLabel"],_open:["validateOpen"],_href:["validateHref"]}}};export{m as kol_tree_item_wc};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as n,h as e}from"./index-
|
4
|
+
import{r as n,h as e}from"./index-BRWth_lT.js";import{p as t}from"./component-names-CkE54Ym7.js";import"./common-zXZUsQ7l.js";const i="/* forward the rem function */\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n color: black;\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n /*\n * Verdana is an accessible font that can be used without requiring additional loading time.\n */\n font-family: Verdana;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n * {\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n hyphens: auto;\n /*\n * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n }\n /*\n * All interactive elements should have a minimum size of to-rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n button,\n .kol-input .input {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n /*\n * Letter spacing is required for all texts.\n */\n letter-spacing: inherit;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n }\n}\n@layer kol-global {\n /*\n * Dieses CSS stellt sicher, dass der Standard-Style\n * von A und Button resettet werden.\n */\n :is(a, button) {\n background-color: transparent;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n /* 100% needed for custom width from outside */\n }\n /*\n * Ensure elements with hidden attribute to be actually not visible\n * @see https://meowni.ca/hidden.is.a.lie.html\n */\n [hidden] {\n display: none !important;\n }\n .badge-text-hint {\n color: black;\n background-color: lightgray;\n }\n}\n@layer kol-global {\n :host {\n /*\n * The max-width is needed to prevent the table from overflowing the\n * parent node, if the table is wider than the parent node.\n */\n max-width: 100%;\n font-size: calc(16rem / var(--kolibri-root-font-size, 16));\n }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-tree-item {\n --indentation: var(--tree-item-indentation, calc(10rem / var(--kolibri-root-font-size, 16)));\n }\n .kol-tree-item__link .kol-link {\n display: inline-flex;\n min-height: var(--a11y-min-size);\n padding-right: calc(6rem / var(--kolibri-root-font-size, 16));\n padding-left: max(var(--indentation) * var(--level) + 8rem / var(--kolibri-root-font-size, 16), 8rem / var(--kolibri-root-font-size, 16));\n align-items: center;\n text-decoration: none;\n }\n .kol-tree-item__link--first-level .kol-link {\n padding-left: calc(6rem / var(--kolibri-root-font-size, 16));\n }\n .kol-tree-item__link-inner {\n display: flex;\n align-items: center;\n }\n .kol-tree-item__children {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n .kol-tree-item .kol-span {\n place-items: unset;\n }\n .kol-tree-item__toggle-button, .kol-tree-item__toggle-button-placeholder {\n display: inline-flex;\n width: var(--a11y-min-size);\n height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n }\n .kol-tree-item__text {\n text-decoration: underline;\n }\n}",o=class{constructor(e){n(this,e)}async focusLink(){this.element&&await this.element.focusLink()}async expand(){this.element&&await this.element.expand()}async collapse(){this.element&&await this.element.collapse()}async isOpen(){var n,e;return null!==(e=await(null===(n=this.element)||void 0===n?void 0:n.isOpen()))&&void 0!==e&&e}render(){return e(t,{key:"7bb3a408013bea8c9d87e7911df20651f5230f10",_active:this._active,_label:this._label,_open:this._open,_href:this._href,ref:n=>this.element=n},e("slot",{key:"f7e7f98c562a887973733fd19268d7c8efdda8d8"}))}};o.style={default:i};export{o as kol_tree_item};
|