@public-ui/components 4.1.4-rc.2 → 4.1.4-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/kolicons/kolicons.eot +0 -0
- package/assets/kolicons/kolicons.ttf +0 -0
- package/assets/kolicons/kolicons.woff +0 -0
- package/assets/kolicons/kolicons.woff2 +0 -0
- package/assets/kolicons/style.css +6 -6
- package/custom-elements.json +1 -1
- package/dist/cjs/{Alert-DaZXLiRJ.js → Alert-DL2DMT7Q.js} +1 -1
- package/dist/cjs/{Alert-DaZXLiRJ.js.map → Alert-DL2DMT7Q.js.map} +1 -1
- package/dist/cjs/Collapsible-Bd8sj8NY.js +4 -0
- package/dist/cjs/Collapsible-Bd8sj8NY.js.map +1 -0
- package/dist/cjs/{CustomSuggestionsOptionsGroup-b6UUm2Um.js → CustomSuggestionsOptionsGroup-B_mA0AoP.js} +1 -1
- package/dist/cjs/{CustomSuggestionsOptionsGroup-b6UUm2Um.js.map → CustomSuggestionsOptionsGroup-B_mA0AoP.js.map} +1 -1
- package/dist/cjs/{FieldControlStateWrapper-DBMSjZur.js → FieldControlStateWrapper-BXt_BxW-.js} +1 -1
- package/dist/cjs/{FieldControlStateWrapper-DBMSjZur.js.map → FieldControlStateWrapper-BXt_BxW-.js.map} +1 -1
- package/dist/cjs/{FormFieldStateWrapper-DEAt0Q8g.js → FormFieldStateWrapper-DMxmb3JU.js} +1 -1
- package/dist/cjs/{FormFieldStateWrapper-DEAt0Q8g.js.map → FormFieldStateWrapper-DMxmb3JU.js.map} +1 -1
- package/dist/cjs/{Heading-bUgEdPM6.js → Heading-oRsUd62G.js} +1 -1
- package/dist/cjs/{Heading-bUgEdPM6.js.map → Heading-oRsUd62G.js.map} +1 -1
- package/dist/cjs/{Input-C6ejb_2n.js → Input-Cqp6PmAu.js} +1 -1
- package/dist/cjs/{Input-C6ejb_2n.js.map → Input-Cqp6PmAu.js.map} +1 -1
- package/dist/cjs/{InputStateWrapper-Bqq-nQSU.js → InputStateWrapper-KCGj8wDn.js} +1 -1
- package/dist/cjs/{InputStateWrapper-Bqq-nQSU.js.map → InputStateWrapper-KCGj8wDn.js.map} +1 -1
- package/dist/cjs/{app-globals-CSvQkgbb.js → app-globals-aujPWpO9.js} +1 -1
- package/dist/cjs/{app-globals-CSvQkgbb.js.map → app-globals-aujPWpO9.js.map} +1 -1
- package/dist/cjs/{component-BgajMvPn.js → component-6ZL1O0U_.js} +1 -1
- package/dist/cjs/{component-BgajMvPn.js.map → component-6ZL1O0U_.js.map} +1 -1
- package/dist/cjs/{component-DO56k-pA.js → component-DOLd2thD.js} +1 -1
- package/dist/cjs/{component-DO56k-pA.js.map → component-DOLd2thD.js.map} +1 -1
- package/dist/cjs/{component-CGZdM_I7.js → component-DgAfien9.js} +1 -1
- package/dist/cjs/{component-CGZdM_I7.js.map → component-DgAfien9.js.map} +1 -1
- package/dist/cjs/{controller-v5AjRsy6.js → controller-BIr72SGx.js} +1 -1
- package/dist/cjs/{controller-v5AjRsy6.js.map → controller-BIr72SGx.js.map} +1 -1
- package/dist/cjs/{controller-DB7cQNGe.js → controller-DbRMXk9Y.js} +1 -1
- package/dist/cjs/{controller-DB7cQNGe.js.map → controller-DbRMXk9Y.js.map} +1 -1
- package/dist/cjs/{controller-C-QE29Br.js → controller-DkBBfIWY.js} +1 -1
- package/dist/cjs/{controller-C-QE29Br.js.map → controller-DkBBfIWY.js.map} +1 -1
- package/dist/cjs/{controller-DxV_T1pY.js → controller-TQ9xm-_m.js} +1 -1
- package/dist/cjs/{controller-DxV_T1pY.js.map → controller-TQ9xm-_m.js.map} +1 -1
- package/dist/cjs/{controller-icon-DeoHgE-y.js → controller-icon-D5bNXTJO.js} +1 -1
- package/dist/cjs/{controller-icon-DeoHgE-y.js.map → controller-icon-D5bNXTJO.js.map} +1 -1
- package/dist/cjs/{dev.utils-C6ytdvUk.js → dev.utils-DHOj1xkx.js} +1 -1
- package/dist/cjs/{dev.utils-C6ytdvUk.js.map → dev.utils-DHOj1xkx.js.map} +1 -1
- package/dist/cjs/{devtools-DQvgw_RD.js → devtools-CIpskIj6.js} +1 -1
- package/dist/cjs/{devtools-DQvgw_RD.js.map → devtools-CIpskIj6.js.map} +1 -1
- package/dist/cjs/{index-B1GUv594.js → index-DNIgcxPq.js} +1 -1
- package/dist/cjs/{index-B1GUv594.js.map → index-DNIgcxPq.js.map} +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.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-wc.entry.cjs.js.map +1 -1
- package/dist/cjs/kol-card.cjs.entry.js +1 -1
- package/dist/cjs/kol-click-button.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-dialog-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-dialog.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-meter.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-progress.cjs.entry.js +1 -1
- package/dist/cjs/kol-quote.cjs.entry.js +1 -1
- package/dist/cjs/kol-select-wc.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-skeleton.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/Collapsible.js +1 -1
- package/dist/components/Collapsible.js.map +1 -1
- package/dist/components/kol-abbr.js +1 -1
- package/dist/components/kol-accordion.js +1 -1
- package/dist/components/kol-alert.js +1 -1
- package/dist/components/kol-badge.js +1 -1
- package/dist/components/kol-breadcrumb.js +1 -1
- package/dist/components/kol-button-link.js +1 -1
- package/dist/components/kol-button.js +1 -1
- package/dist/components/kol-card-wc.js +1 -1
- package/dist/components/kol-card-wc.js.map +1 -1
- package/dist/components/kol-card.js +1 -1
- package/dist/components/kol-combobox.js +1 -1
- package/dist/components/kol-details.js +1 -1
- package/dist/components/kol-dialog.js +1 -1
- package/dist/components/kol-drawer.js +1 -1
- package/dist/components/kol-form.js +1 -1
- package/dist/components/kol-icon.js +1 -1
- package/dist/components/kol-input-checkbox.js +1 -1
- package/dist/components/kol-input-color.js +1 -1
- package/dist/components/kol-input-date.js +1 -1
- package/dist/components/kol-input-email.js +1 -1
- package/dist/components/kol-input-file.js +1 -1
- package/dist/components/kol-input-number.js +1 -1
- package/dist/components/kol-input-password.js +1 -1
- package/dist/components/kol-input-radio.js +1 -1
- package/dist/components/kol-input-range.js +1 -1
- package/dist/components/kol-input-text.js +1 -1
- package/dist/components/kol-link-button.js +1 -1
- package/dist/components/kol-link.js +1 -1
- package/dist/components/kol-modal.js +1 -1
- package/dist/components/kol-nav.js +1 -1
- package/dist/components/kol-pagination.js +1 -1
- package/dist/components/kol-popover-button.js +1 -1
- package/dist/components/kol-select.js +1 -1
- package/dist/components/kol-single-select.js +1 -1
- package/dist/components/kol-skip-nav.js +1 -1
- package/dist/components/kol-split-button.js +1 -1
- package/dist/components/kol-table-stateful.js +1 -1
- package/dist/components/kol-table-stateless.js +1 -1
- package/dist/components/kol-tabs.js +1 -1
- package/dist/components/kol-textarea.js +1 -1
- package/dist/components/kol-toast-container.js +1 -1
- package/dist/components/kol-toolbar.js +1 -1
- package/dist/components/kol-tree-item.js +1 -1
- package/dist/esm/{Alert-CFPLa_5B.js → Alert-hXNHCfm_.js} +1 -1
- package/dist/esm/{Alert-CFPLa_5B.js.map → Alert-hXNHCfm_.js.map} +1 -1
- package/dist/esm/Collapsible-1cni8nnh.js +4 -0
- package/dist/esm/Collapsible-1cni8nnh.js.map +1 -0
- package/dist/esm/{CustomSuggestionsOptionsGroup-Rqanuvyw.js → CustomSuggestionsOptionsGroup-BP23m8St.js} +1 -1
- package/dist/{kolibri/CustomSuggestionsOptionsGroup-Rqanuvyw.js.map → esm/CustomSuggestionsOptionsGroup-BP23m8St.js.map} +1 -1
- package/dist/esm/{FieldControlStateWrapper-DObT7Npv.js → FieldControlStateWrapper-BGSSey7Q.js} +1 -1
- package/dist/{kolibri/FieldControlStateWrapper-DObT7Npv.js.map → esm/FieldControlStateWrapper-BGSSey7Q.js.map} +1 -1
- package/dist/esm/{FormFieldStateWrapper-B_uPqK4K.js → FormFieldStateWrapper-Bie2UIHn.js} +1 -1
- package/dist/{kolibri/FormFieldStateWrapper-B_uPqK4K.js.map → esm/FormFieldStateWrapper-Bie2UIHn.js.map} +1 -1
- package/dist/esm/{Heading-CqcVOA5r.js → Heading-DWgkQFZ1.js} +1 -1
- package/dist/{kolibri/Heading-CqcVOA5r.js.map → esm/Heading-DWgkQFZ1.js.map} +1 -1
- package/dist/esm/{Input-hpBPuL4Y.js → Input-BrliaeWb.js} +1 -1
- package/dist/esm/{Input-hpBPuL4Y.js.map → Input-BrliaeWb.js.map} +1 -1
- package/dist/esm/{InputStateWrapper-TP935JvQ.js → InputStateWrapper-C60_S_5c.js} +1 -1
- package/dist/esm/{InputStateWrapper-TP935JvQ.js.map → InputStateWrapper-C60_S_5c.js.map} +1 -1
- package/dist/esm/{app-globals-CshlgMos.js → app-globals-CMEmDvzu.js} +1 -1
- package/dist/esm/{app-globals-CshlgMos.js.map → app-globals-CMEmDvzu.js.map} +1 -1
- package/dist/esm/component-BXZfpcMd.js +4 -0
- package/dist/esm/{component-C-FsocqK.js.map → component-BXZfpcMd.js.map} +1 -1
- package/dist/esm/component-C83zal9K.js +4 -0
- package/dist/esm/{component-t7JbTUbQ.js.map → component-C83zal9K.js.map} +1 -1
- package/dist/esm/{component-C8-WC5-k.js → component-CrREMVcS.js} +1 -1
- package/dist/esm/{component-C8-WC5-k.js.map → component-CrREMVcS.js.map} +1 -1
- package/dist/esm/{controller-C-rK5Z_k.js → controller-CHOA7kSq.js} +1 -1
- package/dist/esm/{controller-C-rK5Z_k.js.map → controller-CHOA7kSq.js.map} +1 -1
- package/dist/esm/{controller-DEtz1QEp.js → controller-CWD52lwz.js} +1 -1
- package/dist/esm/{controller-DEtz1QEp.js.map → controller-CWD52lwz.js.map} +1 -1
- package/dist/esm/{controller-BsFmhfNl.js → controller-DRcYy1sz.js} +1 -1
- package/dist/esm/{controller-BsFmhfNl.js.map → controller-DRcYy1sz.js.map} +1 -1
- package/dist/esm/{controller-DfHtztaS.js → controller-IshajkrV.js} +1 -1
- package/dist/{kolibri/controller-DfHtztaS.js.map → esm/controller-IshajkrV.js.map} +1 -1
- package/dist/esm/{controller-icon-CfS-d0fl.js → controller-icon-JkLVILDC.js} +1 -1
- package/dist/esm/{controller-icon-CfS-d0fl.js.map → controller-icon-JkLVILDC.js.map} +1 -1
- package/dist/esm/{dev.utils-CxpBPLQA.js → dev.utils-BdOde_4s.js} +1 -1
- package/dist/esm/{dev.utils-CxpBPLQA.js.map → dev.utils-BdOde_4s.js.map} +1 -1
- package/dist/esm/{devtools-B393F2d_.js → devtools-D4hMxq6T.js} +1 -1
- package/dist/{kolibri/devtools-B393F2d_.js.map → esm/devtools-D4hMxq6T.js.map} +1 -1
- package/dist/esm/{index-CHTqQqxk.js → index-D1eeahGC.js} +1 -1
- package/dist/{kolibri/index-CHTqQqxk.js.map → esm/index-D1eeahGC.js.map} +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.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-wc.entry.js.map +1 -1
- package/dist/esm/kol-card.entry.js +1 -1
- package/dist/esm/kol-click-button.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-dialog-wc.entry.js +1 -1
- package/dist/esm/kol-dialog.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-meter.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-progress.entry.js +1 -1
- package/dist/esm/kol-quote.entry.js +1 -1
- package/dist/esm/kol-select-wc.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-skeleton.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-hXNHCfm_.js +4 -0
- package/dist/kolibri/{Alert-CFPLa_5B.js.map → Alert-hXNHCfm_.js.map} +1 -1
- package/dist/kolibri/Collapsible-1cni8nnh.js +4 -0
- package/dist/kolibri/Collapsible-1cni8nnh.js.map +1 -0
- package/dist/kolibri/CustomSuggestionsOptionsGroup-BP23m8St.js +4 -0
- package/dist/{esm/CustomSuggestionsOptionsGroup-Rqanuvyw.js.map → kolibri/CustomSuggestionsOptionsGroup-BP23m8St.js.map} +1 -1
- package/dist/kolibri/FieldControlStateWrapper-BGSSey7Q.js +4 -0
- package/dist/{esm/FieldControlStateWrapper-DObT7Npv.js.map → kolibri/FieldControlStateWrapper-BGSSey7Q.js.map} +1 -1
- package/dist/kolibri/{FormFieldStateWrapper-B_uPqK4K.js → FormFieldStateWrapper-Bie2UIHn.js} +1 -1
- package/dist/{esm/FormFieldStateWrapper-B_uPqK4K.js.map → kolibri/FormFieldStateWrapper-Bie2UIHn.js.map} +1 -1
- package/dist/kolibri/{Heading-CqcVOA5r.js → Heading-DWgkQFZ1.js} +1 -1
- package/dist/{esm/Heading-CqcVOA5r.js.map → kolibri/Heading-DWgkQFZ1.js.map} +1 -1
- package/dist/kolibri/Input-BrliaeWb.js +4 -0
- package/dist/kolibri/{Input-hpBPuL4Y.js.map → Input-BrliaeWb.js.map} +1 -1
- package/dist/kolibri/InputStateWrapper-C60_S_5c.js +4 -0
- package/dist/kolibri/{InputStateWrapper-TP935JvQ.js.map → InputStateWrapper-C60_S_5c.js.map} +1 -1
- package/dist/kolibri/{app-globals-CshlgMos.js → app-globals-CMEmDvzu.js} +1 -1
- package/dist/kolibri/{app-globals-CshlgMos.js.map → app-globals-CMEmDvzu.js.map} +1 -1
- package/dist/kolibri/component-BXZfpcMd.js +4 -0
- package/dist/kolibri/{component-C-FsocqK.js.map → component-BXZfpcMd.js.map} +1 -1
- package/dist/kolibri/component-C83zal9K.js +4 -0
- package/dist/kolibri/{component-t7JbTUbQ.js.map → component-C83zal9K.js.map} +1 -1
- package/dist/kolibri/{component-C8-WC5-k.js → component-CrREMVcS.js} +1 -1
- package/dist/kolibri/{component-C8-WC5-k.js.map → component-CrREMVcS.js.map} +1 -1
- package/dist/kolibri/{controller-C-rK5Z_k.js → controller-CHOA7kSq.js} +1 -1
- package/dist/kolibri/{controller-C-rK5Z_k.js.map → controller-CHOA7kSq.js.map} +1 -1
- package/dist/kolibri/{controller-DEtz1QEp.js → controller-CWD52lwz.js} +1 -1
- package/dist/kolibri/{controller-DEtz1QEp.js.map → controller-CWD52lwz.js.map} +1 -1
- package/dist/kolibri/{controller-BsFmhfNl.js → controller-DRcYy1sz.js} +1 -1
- package/dist/kolibri/{controller-BsFmhfNl.js.map → controller-DRcYy1sz.js.map} +1 -1
- package/dist/kolibri/controller-IshajkrV.js +4 -0
- package/dist/{esm/controller-DfHtztaS.js.map → kolibri/controller-IshajkrV.js.map} +1 -1
- package/dist/kolibri/controller-icon-JkLVILDC.js +4 -0
- package/dist/kolibri/{controller-icon-CfS-d0fl.js.map → controller-icon-JkLVILDC.js.map} +1 -1
- package/dist/kolibri/{dev.utils-CxpBPLQA.js → dev.utils-BdOde_4s.js} +1 -1
- package/dist/kolibri/{dev.utils-CxpBPLQA.js.map → dev.utils-BdOde_4s.js.map} +1 -1
- package/dist/kolibri/devtools-D4hMxq6T.js +4 -0
- package/dist/{esm/devtools-B393F2d_.js.map → kolibri/devtools-D4hMxq6T.js.map} +1 -1
- package/dist/kolibri/{index-CHTqQqxk.js → index-D1eeahGC.js} +1 -1
- package/dist/{esm/index-CHTqQqxk.js.map → kolibri/index-D1eeahGC.js.map} +1 -1
- package/dist/kolibri/kol-abbr.entry.js +1 -1
- package/dist/kolibri/kol-accordion.entry.js +1 -1
- package/dist/kolibri/kol-alert-wc.entry.js +1 -1
- package/dist/kolibri/kol-alert.entry.js +1 -1
- package/dist/kolibri/kol-avatar.entry.js +1 -1
- package/dist/kolibri/kol-badge.entry.js +1 -1
- package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
- package/dist/kolibri/kol-button-link.entry.js +1 -1
- package/dist/kolibri/kol-button-wc.entry.js +1 -1
- package/dist/kolibri/kol-button.entry.js +1 -1
- package/dist/kolibri/kol-card-wc.entry.esm.js.map +1 -1
- package/dist/kolibri/kol-card-wc.entry.js +1 -1
- package/dist/kolibri/kol-card-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-card.entry.js +1 -1
- package/dist/kolibri/kol-click-button.entry.js +1 -1
- package/dist/kolibri/kol-combobox.entry.js +1 -1
- package/dist/kolibri/kol-details.entry.js +1 -1
- package/dist/kolibri/kol-dialog-wc.entry.js +1 -1
- package/dist/kolibri/kol-dialog.entry.js +1 -1
- package/dist/kolibri/kol-drawer.entry.js +1 -1
- package/dist/kolibri/kol-form.entry.js +1 -1
- package/dist/kolibri/kol-heading.entry.js +1 -1
- package/dist/kolibri/kol-icon.entry.js +1 -1
- package/dist/kolibri/kol-image.entry.js +1 -1
- package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
- package/dist/kolibri/kol-input-color.entry.js +1 -1
- package/dist/kolibri/kol-input-date.entry.js +1 -1
- package/dist/kolibri/kol-input-date.entry.js.map +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.entry.js +1 -1
- package/dist/kolibri/kol-meter.entry.js +1 -1
- package/dist/kolibri/kol-modal.entry.js +1 -1
- package/dist/kolibri/kol-nav.entry.js +1 -1
- package/dist/kolibri/kol-pagination-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-progress.entry.js +1 -1
- package/dist/kolibri/kol-quote.entry.js +1 -1
- package/dist/kolibri/kol-select-wc.entry.js +1 -1
- package/dist/kolibri/kol-select.entry.js +1 -1
- package/dist/kolibri/kol-single-select.entry.js +1 -1
- package/dist/kolibri/kol-skeleton.entry.js +1 -1
- package/dist/kolibri/kol-skip-nav.entry.js +1 -1
- package/dist/kolibri/kol-spin.entry.js +1 -1
- package/dist/kolibri/kol-split-button.entry.js +1 -1
- package/dist/kolibri/kol-table-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/components.d.ts +36 -0
- package/package.json +3 -3
- package/dist/cjs/Collapsible-_unDj6rh.js +0 -4
- package/dist/cjs/Collapsible-_unDj6rh.js.map +0 -1
- package/dist/esm/Collapsible-BkOhhDot.js +0 -4
- package/dist/esm/Collapsible-BkOhhDot.js.map +0 -1
- package/dist/esm/component-C-FsocqK.js +0 -4
- package/dist/esm/component-t7JbTUbQ.js +0 -4
- package/dist/kolibri/Alert-CFPLa_5B.js +0 -4
- package/dist/kolibri/Collapsible-BkOhhDot.js +0 -4
- package/dist/kolibri/Collapsible-BkOhhDot.js.map +0 -1
- package/dist/kolibri/CustomSuggestionsOptionsGroup-Rqanuvyw.js +0 -4
- package/dist/kolibri/FieldControlStateWrapper-DObT7Npv.js +0 -4
- package/dist/kolibri/Input-hpBPuL4Y.js +0 -4
- package/dist/kolibri/InputStateWrapper-TP935JvQ.js +0 -4
- package/dist/kolibri/component-C-FsocqK.js +0 -4
- package/dist/kolibri/component-t7JbTUbQ.js +0 -4
- package/dist/kolibri/controller-DfHtztaS.js +0 -4
- package/dist/kolibri/controller-icon-CfS-d0fl.js +0 -4
- package/dist/kolibri/devtools-B393F2d_.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{r as n,h as t,H as e,g as i}from"./index-CHTqQqxk.js";import{g as o,k as l}from"./component-names-Dy77vq43.js";import{t as a}from"./i18n-BVaUp6qp.js";import{e as s,b as r,s as c,P as h,p as d,o as f,k as b}from"./common-BqV6Zb30.js";import{v as p,a as k,b as u,c as m,d as _,e as g}from"./table-selection-CXJmsMfX.js";import{v as y}from"./label-vxVEH2gH.js";import{C as v}from"./keyboard-DNd73LVa.js";import{K as x,d as w}from"./events-DHTi_wtD.js";import"./i18n-B2d_exHc.js";const z=(n,t,e={})=>{s(n,"_allowMultiSort",t,Object.assign({defaultValue:!1},e))},S=["top","bottom","both"],j=(n,t)=>{r(n,"_paginationPosition",n=>"string"==typeof n&&S.includes(n),new Set([`PaginationPositionPropType {${S.join(", ")}`]),t,{defaultValue:"bottom"})},C='@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(44 * 1rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without verifying the contrast ratio of its background and font colors.\n * By initially setting the background color to white and the font color to black,\n * the contrast ratio is ensured and explicit adjustment is forced.\n */\n color: black;\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 * Text should be aligned left by default to provide a predictable starting point.\n */\n text-align: left;\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 text color from his parent element.\n */\n color: inherit;\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: fixed;\n top: 0;\n left: 0;\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(16 * 1rem / 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: flex;\n flex-flow: column;\n align-items: center;\n justify-content: 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 align-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 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 .hastooltip {\n z-index: 900 !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1777087174897"); /* IE9*/\n src: url("kolicons.eot?t=1777087174897#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1777087174897") format("woff2"), url("kolicons.woff?t=1777087174897") format("woff"), url("kolicons.ttf?t=1777087174897") format("truetype"), url("kolicons.svg?t=1777087174897#kolicons") format("svg"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: "\\ea01";\n }\n .kolicon-alert-info::before {\n content: "\\ea02";\n }\n .kolicon-alert-success::before {\n content: "\\ea03";\n }\n .kolicon-alert-warning::before {\n content: "\\ea04";\n }\n .kolicon-check::before {\n content: "\\ea05";\n }\n .kolicon-chevron-double-left::before {\n content: "\\ea06";\n }\n .kolicon-chevron-double-right::before {\n content: "\\ea07";\n }\n .kolicon-chevron-down::before {\n content: "\\ea08";\n }\n .kolicon-chevron-left::before {\n content: "\\ea09";\n }\n .kolicon-chevron-right::before {\n content: "\\ea0a";\n }\n .kolicon-chevron-up::before {\n content: "\\ea0b";\n }\n .kolicon-cogwheel::before {\n content: "\\ea0c";\n }\n .kolicon-cross::before {\n content: "\\ea0d";\n }\n .kolicon-eye-closed::before {\n content: "\\ea0e";\n }\n .kolicon-eye::before {\n content: "\\ea0f";\n }\n .kolicon-house::before {\n content: "\\ea10";\n }\n .kolicon-kolibri::before {\n content: "\\ea11";\n }\n .kolicon-link-external::before {\n content: "\\ea12";\n }\n .kolicon-link::before {\n content: "\\ea13";\n }\n .kolicon-minus::before {\n content: "\\ea14";\n }\n .kolicon-plus::before {\n content: "\\ea15";\n }\n .kolicon-settings::before {\n content: "\\ea16";\n }\n .kolicon-sort-asc::before {\n content: "\\ea17";\n }\n .kolicon-sort-desc::before {\n content: "\\ea18";\n }\n .kolicon-sort-neutral::before {\n content: "\\ea19";\n }\n .kolicon-up::before {\n content: "\\ea1a";\n }\n .kolicon-version::before {\n content: "\\ea1b";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n opacity: 0;\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, max-content);\n min-width: calc(8 * 1rem / var(--kolibri-root-font-size, 16));\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip__floating.show {\n animation-name: showTooltip;\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(10 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(10 * 1rem / 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 @keyframes hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-alert :host {\n display: inline-block;\n }\n .kol-alert .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-alert .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-alert .kol-button__text {\n flex: 1 0 100%;\n }\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(1 * 1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n :host {\n display: inline-block;\n }\n .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\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 flex: 1 0 100%;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n .kol-popover-button--inline .kol-popover-button__button {\n display: inline;\n }\n .kol-popover {\n opacity: 0;\n transition: 0.2s ease-out opacity;\n }\n .kol-popover-button--open + .kol-popover {\n opacity: 1;\n }\n .kol-table-settings {\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(8 * 1rem / var(--kolibri-root-font-size, 16));\n border: 1px solid #d1d5db;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200 * 1rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content minmax(max-content, 1fr) calc(140 * 1rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table {\n --kol-table-selection-col-width: var(--a11y-min-size);\n display: block;\n position: relative;\n max-width: 100%;\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__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table__table {\n table-layout: fixed;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__sort {\n display: inline-flex;\n align-items: center;\n }\n .kol-table__sort-order {\n display: inline-flex;\n align-items: center;\n justify-content: center;\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 align-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n align-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n align-items: end;\n }\n .kol-table__cell--selection {\n background-color: white;\n position: sticky !important;\n left: 0;\n z-index: 2;\n width: var(--kol-table-selection-col-width, auto);\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__cell--actions {\n white-space: nowrap;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-table__cell--actions .kol-button__text {\n flex: 1 0 100%;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-link {\n display: inline-flex;\n max-width: fit-content;\n align-items: baseline;\n place-items: center;\n text-align: left;\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-link--standalone {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: stretch;\n }\n .kol-table__cell--actions .kol-link--standalone .kol-link__text {\n display: inline-flex;\n flex: 1 1 100%;\n place-items: center;\n }\n .kol-table__cell--actions .kol-link .kol-span__label {\n text-decoration-line: underline;\n }\n .kol-table__cell--actions .kol-link:focus:not([aria-disabled], [disabled]) .kol-span__label, .kol-table__cell--actions .kol-link:hover:not([aria-disabled], [disabled]) .kol-span__label {\n text-decoration-thickness: 0.2em;\n }\n .kol-table__cell--actions .kol-link__icon {\n display: inline-flex;\n }\n .kol-table__cell--sticky-left, .kol-table__cell--sticky-right {\n background-color: white;\n position: sticky !important;\n z-index: 1;\n }\n .kol-table__cell--sticky-left:nth-last-child(1 of .kol-table__cell--sticky-left) {\n border-right: 2px solid black;\n }\n .kol-table__cell--sticky-right:nth-child(1 of .kol-table__cell--sticky-left) {\n border-left: 2px solid black;\n }\n .kol-table__cell-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection {\n position: relative;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection--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 min-width: calc(var(--a11y-min-size) / 2);\n min-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 .kol-alert .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-alert :host {\n display: inline-block;\n }\n .kol-alert .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-alert .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-alert .kol-button__text {\n flex: 1 0 100%;\n }\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(1 * 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__label-text {\n flex-flow: row;\n align-items: flex-start;\n justify-content: flex-start;\n }\n .kol-form-field--required .kol-form-field__label-text:not(:has(> [name]))::after,\n .kol-form-field--required .kol-tooltip__content .kol-span__label::after {\n content: "*"/"";\n }\n .kol-input-container {\n background-color: transparent;\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 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 min-height: var(--a11y-min-size);\n place-items: center;\n }\n .kol-select {\n background-color: transparent;\n width: 100%;\n }\n .kol-select:not(:disabled) {\n cursor: pointer;\n }\n .kol-select:not([multiple], [size]) {\n height: 2.75em;\n }\n .kol-select:focus {\n outline: none;\n }\n .kol-select__option:checked::before {\n content: "✓ ";\n }\n .kol-select {\n /* needed hack for vertical alignment */\n }\n .kol-select[multiple] option {\n padding: calc((var(--a11y-min-size) - 16 * 1rem / var(--kolibri-root-font-size, 16)) / 2) 0.5em;\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-pagination {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n container: paging/inline-size;\n }\n .kol-pagination__navigation-list {\n display: inline-flex;\n margin: 0;\n padding: 0;\n flex-wrap: wrap;\n align-items: center;\n list-style: none;\n }\n .kol-pagination__separator:before {\n content: "•••";\n }\n .kol-pagination__page-size-select .kol-form-field-select {\n align-items: center;\n grid-template-columns: 1fr max-content;\n }\n @container paging (width < 600px) {\n .kol-pagination:has(.kol-pagination__button--first) li:has(.kol-pagination__button--numbers),\n .kol-pagination:has(.kol-pagination__button--first) li:has(.kol-pagination__separator) {\n display: none;\n }\n }\n}',T=[10,20,50,100],O=n=>!0===n||""===n||"object"==typeof n&&null!==n,D=class{constructor(t){n(this,t),this.catchRef=n=>{this.tableWcRef=n},this.sortData=[],this.showPagination=!1,this.pageStartSlice=0,this.pageEndSlice=10,this.disableSort=!1,this._paginationPosition="bottom",this.state={_allowMultiSort:!1,_fixedCols:[0,0],_data:[],_dataFoot:[],_headers:{horizontal:[],vertical:[]},_label:"",_pagination:{_page:1,_pageSize:10,_max:0},_sortedData:[],_paginationPosition:"bottom",_hasSettingsMenu:!1},this.handlePagination={onClick:(n,t)=>{var e;"function"==typeof(null===(e=this.state._pagination._on)||void 0===e?void 0:e.onClick)&&this.state._pagination._on.onClick(n,t),c(this,"_pagination",Object.assign(Object.assign({},this.state._pagination),{_page:t}))},onChangePage:(n,t)=>{var e;"function"==typeof(null===(e=this.state._pagination._on)||void 0===e?void 0:e.onChangePage)&&this.state._pagination._on.onChangePage(n,t),c(this,"_pagination",Object.assign(Object.assign({},this.state._pagination),{_page:t}))},onChangePageSize:(n,t)=>{var e;"function"==typeof(null===(e=this.state._pagination._on)||void 0===e?void 0:e.onChangePageSize)&&this.state._pagination._on.onChangePageSize(n,t),c(this,"_pagination",Object.assign(Object.assign({},this.state._pagination),{_pageSize:t})),c(this,"_pageSize",t)}},this.onSelectionChange=n=>{n.stopPropagation()},this.updateSortedData=()=>{if(this.disableSort)return void c(this,"_sortedData",this.state._data);const n=[...this.state._data];this.sortData.length>0&&n.sort((n,t)=>{for(let e=0;e<this.sortData.length;e++){const i=this.sortData[e],o=i.compareFn(n,t,i.direction);if(0!==o)return"ASC"===i.direction?o:-o}return 0}),c(this,"_sortedData",n)}}validateAllowMultiSort(n){z(this,n,{defaultValue:!1})}validateData(n){p(this,n,{afterPatch:()=>{setTimeout(this.updateSortedData)}})}validateDataFoot(n){k(this,n,{afterPatch:()=>{setTimeout(this.updateSortedData)}})}validateFixedCols(n){u(this,n)}validatePaginationPosition(n){j(this,n)}validateHasSettingsMenu(n){m(this,n)}changeCellSort(n){var t;if(void 0===n.type||"default"===n.type){if("function"!=typeof n.compareFn)return;this.state._allowMultiSort||n.key===(null===(t=this.sortData[0])||void 0===t?void 0:t.key)||(this.sortData=[]);const e=this.sortData.findIndex(t=>t.key===n.key);if(e>=0){const n=this.sortData[e];switch(n.direction){case"ASC":n.direction="DESC";break;case"DESC":this.sortData.splice(e,1);break;default:n.direction="ASC"}}else n.key&&this.sortData.push({label:n.label,key:n.key,compareFn:n.compareFn,direction:"ASC"});this.updateSortedData()}}validateHeaders(n){h(n,()=>{f(n,()=>{try{n=d(n)}catch(n){}r(this,"_headers",n=>"object"==typeof n&&null!==n,new Set(["KoliBriTableHeaders"]),n,{hooks:{beforePatch:n=>{var t,e,i,o;const a=n=>{let t=!1;this.sortData=[],n.forEach(n=>{if(void 0!==n.type&&"default"!==n.type)return;if("function"==typeof n.compareFn&&!n.key)return void b("[KolTableStateful] A sortable column requires the 'key' property.");const e=n.key;if(!e)return;const i=n.sortDirection;"ASC"!==i&&"DESC"!==i||"function"==typeof n.compareFn&&((this.state._allowMultiSort||0===this.sortData.length)&&this.sortData.push({label:n.label,key:e,compareFn:n.compareFn,direction:i}),t=!0)}),t&&setTimeout(()=>this.updateSortedData())},l=n;null===(t=l.horizontal)||void 0===t||t.forEach(a),null===(e=l.vertical)||void 0===e||e.forEach(a),l.horizontal&&l.vertical&&(null===(i=l.horizontal)||void 0===i?void 0:i.length)>0&&(null===(o=l.vertical)||void 0===o?void 0:o.length)>0&&(this.disableSort=!0,b("Table: You can not sort the table data, if horizontal and vertical headers are defined at the same time. (https://github.com/public-ui/kolibri/issues/2372)"))}}})})})}validateLabel(n){y(this,n,{required:!0})}validateSelection(n){_(this,n)}validateOn(n){g(this,n)}validatePagination(n){try{n=d(n)}catch(n){}this.showPagination=O(n),r(this,"_pagination",O,new Set(["boolean","KoliBriTablePagination"]),n,{defaultValue:{_page:1,_pageSize:10,_max:0}})}componentDidLoad(){var n;null===(n=this.tableWcRef)||void 0===n||n.addEventListener(x.selectionChange,this.onSelectionChange)}disconnectedCallback(){var n;null===(n=this.tableWcRef)||void 0===n||n.removeEventListener(x.selectionChange,this.onSelectionChange)}componentWillLoad(){this.validateAllowMultiSort(this._allowMultiSort),this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateFixedCols(this._fixedCols),this.validateHeaders(this._headers),this.validateLabel(this._label),this.validateOn(this._on),this.validatePagination(this._pagination),this.validatePaginationPosition(this._paginationPosition),this.validateSelection(this._selection),this.validateHasSettingsMenu(this._hasSettingsMenu)}selectDisplayedData(n,t,e){return"number"==typeof t&&t>0&&"number"==typeof e&&e>0?(this.pageStartSlice=t*(e-1),this.pageEndSlice=t*e>n.length?n.length:t*e,n.slice(this.pageStartSlice,this.pageEndSlice)):(this.pageStartSlice=0,this.pageEndSlice=n.length,n)}renderPagination(n){const e=a("kol-table-pagination-label",{placeholders:{label:`${this.state._label} (${a(`kol-pagination-position-${n}`)})`}});return t("div",{class:`kol-table-stateful__pagination kol-table-stateful__pagination--${this.state._paginationPosition}`},t("div",{class:"kol-table-stateful__pagination-wrapper"},t(o,{_boundaryCount:this.state._pagination._boundaryCount,_customClass:this.state._pagination._customClass,_hasButtons:this.state._pagination._hasButtons,_on:this.handlePagination,_page:this.state._pagination._page,_pageSize:this.state._pagination._pageSize,_pageSizeOptions:this.state._pagination._pageSizeOptions||T,_siblingCount:this.state._pagination._siblingCount,_tooltipAlign:"bottom",_max:this.state._pagination._max||this.state._pagination._max||this.state._data.length,_label:e})))}getHeaderCellSortState(n){if((void 0===n.type||"default"===n.type)&&!this.disableSort&&"function"==typeof n.compareFn){if(n.key){const t=this.sortData.find(t=>t.key===n.key);if(null==t?void 0:t.direction)return t.direction}return"NOS"}}getHeaderCellSortOrder(n){if((void 0===n.type||"default"===n.type)&&!this.disableSort&&this.state._allowMultiSort&&"function"==typeof n.compareFn&&n.key){const t=this.sortData.findIndex(t=>t.key===n.key);if(t>=0)return t+1}}handleSort({key:n}){const t=[...(this.state._headers.horizontal||[]).flat(),...(this.state._headers.vertical||[]).flat()].find(t=>t.key===n);t&&this.changeCellSort(t)}getSelectedData(n){var t;const e=this.state._selection;if(e){const i=null!==(t=e.keyPropertyName)&&void 0!==t?t:"id",o=new Set(n.map(String)),a=this.state._sortedData.filter(n=>o.has(String(n[i])));if(i)return a}return null}handleSelectionChange(n,t){var e;const i=this.state._selection;i&&(this.state=Object.assign(Object.assign({},this.state),{_selection:Object.assign(Object.assign({},i),{selectedKeys:t})}));const o=this.getSelectedData(t);"function"==typeof(null===(e=this.state._on)||void 0===e?void 0:e[v.onSelectionChange])&&this.state._on[v.onSelectionChange](n,o),this.host&&w(this.host,x.selectionChange,o)}async getSelection(){var n;const t=(null===(n=this.state._selection)||void 0===n?void 0:n.selectedKeys)||[];return this.getSelectedData(t)}render(){var n,i,o,a,s,r;const c=this.selectDisplayedData(this.state._sortedData,this.showPagination?null!==(i=null===(n=this.state._pagination)||void 0===n?void 0:n._pageSize)&&void 0!==i?i:10:this.state._sortedData.length,this.state._pagination._page||1),d="top"===this._paginationPosition||"both"===this._paginationPosition?this.renderPagination("top"):null,h="bottom"===this._paginationPosition||"both"===this._paginationPosition?this.renderPagination("bottom"):null,p={horizontal:null!==(a=null===(o=this.state._headers.horizontal)||void 0===o?void 0:o.map(n=>n.map(n=>Object.assign(Object.assign({},n),{sortDirection:this.getHeaderCellSortState(n),sortOrder:this.getHeaderCellSortOrder(n)}))))&&void 0!==a?a:[],vertical:null!==(r=null===(s=this.state._headers.vertical)||void 0===s?void 0:s.map(n=>n.map(n=>Object.assign(Object.assign({},n),{sortDirection:this.getHeaderCellSortState(n),sortOrder:this.getHeaderCellSortOrder(n)}))))&&void 0!==r?r:[]};return t(e,{key:"77fba3ac43752f6092890ed52c9e4359a0921a24",class:"kol-table-stateful"},this.pageEndSlice>0&&this.showPagination&&d,t(l,{key:"c991b5e049854fab6738028f6df0103501a05ca7",ref:this.catchRef,_data:c,_fixedCols:this._fixedCols,_headerCells:p,_label:this.state._label,_dataFoot:this.state._dataFoot,_on:{onSort:(n,t)=>{this.handleSort(t)},onSelectionChange:(n,t)=>{this.handleSelectionChange(n,t)}},_selection:this.state._selection,_hasSettingsMenu:this.state._hasSettingsMenu}),this.pageEndSlice>0&&this.showPagination&&h)}get host(){return i(this)}static get watchers(){return{_allowMultiSort:["validateAllowMultiSort"],_data:["validateData"],_dataFoot:["validateDataFoot"],_fixedCols:["validateFixedCols"],_paginationPosition:["validatePaginationPosition"],_hasSettingsMenu:["validateHasSettingsMenu"],_headers:["validateHeaders"],_label:["validateLabel"],_selection:["validateSelection"],_on:["validateOn"],_pagination:["validatePagination"]}}};D.style={default:C};export{D as kol_table_stateful};
|
|
4
|
+
import{r as n,h as t,H as e,g as i}from"./index-D1eeahGC.js";import{g as o,k as l}from"./component-names-Dy77vq43.js";import{t as a}from"./i18n-BVaUp6qp.js";import{e as s,b as r,s as c,P as h,p as d,o as f,k as b}from"./common-BqV6Zb30.js";import{v as p,a as k,b as u,c as m,d as _,e as g}from"./table-selection-CXJmsMfX.js";import{v as y}from"./label-vxVEH2gH.js";import{C as v}from"./keyboard-DNd73LVa.js";import{K as x,d as w}from"./events-DHTi_wtD.js";import"./i18n-B2d_exHc.js";const z=(n,t,e={})=>{s(n,"_allowMultiSort",t,Object.assign({defaultValue:!1},e))},S=["top","bottom","both"],j=(n,t)=>{r(n,"_paginationPosition",n=>"string"==typeof n&&S.includes(n),new Set([`PaginationPositionPropType {${S.join(", ")}`]),t,{defaultValue:"bottom"})},C='@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(44 * 1rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without verifying the contrast ratio of its background and font colors.\n * By initially setting the background color to white and the font color to black,\n * the contrast ratio is ensured and explicit adjustment is forced.\n */\n color: black;\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 * Text should be aligned left by default to provide a predictable starting point.\n */\n text-align: left;\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 text color from his parent element.\n */\n color: inherit;\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: fixed;\n top: 0;\n left: 0;\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(16 * 1rem / 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: flex;\n flex-flow: column;\n align-items: center;\n justify-content: 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 align-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 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 .hastooltip {\n z-index: 900 !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1777355226188"); /* IE9*/\n src: url("kolicons.eot?t=1777355226188#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1777355226188") format("woff2"), url("kolicons.woff?t=1777355226188") format("woff"), url("kolicons.ttf?t=1777355226188") format("truetype"), url("kolicons.svg?t=1777355226188#kolicons") format("svg"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: "\\ea01";\n }\n .kolicon-alert-info::before {\n content: "\\ea02";\n }\n .kolicon-alert-success::before {\n content: "\\ea03";\n }\n .kolicon-alert-warning::before {\n content: "\\ea04";\n }\n .kolicon-check::before {\n content: "\\ea05";\n }\n .kolicon-chevron-double-left::before {\n content: "\\ea06";\n }\n .kolicon-chevron-double-right::before {\n content: "\\ea07";\n }\n .kolicon-chevron-down::before {\n content: "\\ea08";\n }\n .kolicon-chevron-left::before {\n content: "\\ea09";\n }\n .kolicon-chevron-right::before {\n content: "\\ea0a";\n }\n .kolicon-chevron-up::before {\n content: "\\ea0b";\n }\n .kolicon-cogwheel::before {\n content: "\\ea0c";\n }\n .kolicon-cross::before {\n content: "\\ea0d";\n }\n .kolicon-eye-closed::before {\n content: "\\ea0e";\n }\n .kolicon-eye::before {\n content: "\\ea0f";\n }\n .kolicon-house::before {\n content: "\\ea10";\n }\n .kolicon-kolibri::before {\n content: "\\ea11";\n }\n .kolicon-link-external::before {\n content: "\\ea12";\n }\n .kolicon-link::before {\n content: "\\ea13";\n }\n .kolicon-minus::before {\n content: "\\ea14";\n }\n .kolicon-plus::before {\n content: "\\ea15";\n }\n .kolicon-settings::before {\n content: "\\ea16";\n }\n .kolicon-sort-asc::before {\n content: "\\ea17";\n }\n .kolicon-sort-desc::before {\n content: "\\ea18";\n }\n .kolicon-sort-neutral::before {\n content: "\\ea19";\n }\n .kolicon-up::before {\n content: "\\ea1a";\n }\n .kolicon-version::before {\n content: "\\ea1b";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n opacity: 0;\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, max-content);\n min-width: calc(8 * 1rem / var(--kolibri-root-font-size, 16));\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip__floating.show {\n animation-name: showTooltip;\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(10 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(10 * 1rem / 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 @keyframes hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-alert :host {\n display: inline-block;\n }\n .kol-alert .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-alert .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-alert .kol-button__text {\n flex: 1 0 100%;\n }\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(1 * 1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n :host {\n display: inline-block;\n }\n .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\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 flex: 1 0 100%;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n .kol-popover-button--inline .kol-popover-button__button {\n display: inline;\n }\n .kol-popover {\n opacity: 0;\n transition: 0.2s ease-out opacity;\n }\n .kol-popover-button--open + .kol-popover {\n opacity: 1;\n }\n .kol-table-settings {\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(8 * 1rem / var(--kolibri-root-font-size, 16));\n border: 1px solid #d1d5db;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200 * 1rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content minmax(max-content, 1fr) calc(140 * 1rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table {\n --kol-table-selection-col-width: var(--a11y-min-size);\n display: block;\n position: relative;\n max-width: 100%;\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__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table__table {\n table-layout: fixed;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__sort {\n display: inline-flex;\n align-items: center;\n }\n .kol-table__sort-order {\n display: inline-flex;\n align-items: center;\n justify-content: center;\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 align-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n align-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n align-items: end;\n }\n .kol-table__cell--selection {\n background-color: white;\n position: sticky !important;\n left: 0;\n z-index: 2;\n width: var(--kol-table-selection-col-width, auto);\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__cell--actions {\n white-space: nowrap;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-table__cell--actions .kol-button__text {\n flex: 1 0 100%;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-link {\n display: inline-flex;\n max-width: fit-content;\n align-items: baseline;\n place-items: center;\n text-align: left;\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-link--standalone {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: stretch;\n }\n .kol-table__cell--actions .kol-link--standalone .kol-link__text {\n display: inline-flex;\n flex: 1 1 100%;\n place-items: center;\n }\n .kol-table__cell--actions .kol-link .kol-span__label {\n text-decoration-line: underline;\n }\n .kol-table__cell--actions .kol-link:focus:not([aria-disabled], [disabled]) .kol-span__label, .kol-table__cell--actions .kol-link:hover:not([aria-disabled], [disabled]) .kol-span__label {\n text-decoration-thickness: 0.2em;\n }\n .kol-table__cell--actions .kol-link__icon {\n display: inline-flex;\n }\n .kol-table__cell--sticky-left, .kol-table__cell--sticky-right {\n background-color: white;\n position: sticky !important;\n z-index: 1;\n }\n .kol-table__cell--sticky-left:nth-last-child(1 of .kol-table__cell--sticky-left) {\n border-right: 2px solid black;\n }\n .kol-table__cell--sticky-right:nth-child(1 of .kol-table__cell--sticky-left) {\n border-left: 2px solid black;\n }\n .kol-table__cell-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection {\n position: relative;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection--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 min-width: calc(var(--a11y-min-size) / 2);\n min-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 .kol-alert .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-alert :host {\n display: inline-block;\n }\n .kol-alert .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-alert .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-alert .kol-button__text {\n flex: 1 0 100%;\n }\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(1 * 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__label-text {\n flex-flow: row;\n align-items: flex-start;\n justify-content: flex-start;\n }\n .kol-form-field--required .kol-form-field__label-text:not(:has(> [name]))::after,\n .kol-form-field--required .kol-tooltip__content .kol-span__label::after {\n content: "*"/"";\n }\n .kol-input-container {\n background-color: transparent;\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 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 min-height: var(--a11y-min-size);\n place-items: center;\n }\n .kol-select {\n background-color: transparent;\n width: 100%;\n }\n .kol-select:not(:disabled) {\n cursor: pointer;\n }\n .kol-select:not([multiple], [size]) {\n height: 2.75em;\n }\n .kol-select:focus {\n outline: none;\n }\n .kol-select__option:checked::before {\n content: "✓ ";\n }\n .kol-select {\n /* needed hack for vertical alignment */\n }\n .kol-select[multiple] option {\n padding: calc((var(--a11y-min-size) - 16 * 1rem / var(--kolibri-root-font-size, 16)) / 2) 0.5em;\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-pagination {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n container: paging/inline-size;\n }\n .kol-pagination__navigation-list {\n display: inline-flex;\n margin: 0;\n padding: 0;\n flex-wrap: wrap;\n align-items: center;\n list-style: none;\n }\n .kol-pagination__separator:before {\n content: "•••";\n }\n .kol-pagination__page-size-select .kol-form-field-select {\n align-items: center;\n grid-template-columns: 1fr max-content;\n }\n @container paging (width < 600px) {\n .kol-pagination:has(.kol-pagination__button--first) li:has(.kol-pagination__button--numbers),\n .kol-pagination:has(.kol-pagination__button--first) li:has(.kol-pagination__separator) {\n display: none;\n }\n }\n}',T=[10,20,50,100],O=n=>!0===n||""===n||"object"==typeof n&&null!==n,D=class{constructor(t){n(this,t),this.catchRef=n=>{this.tableWcRef=n},this.sortData=[],this.showPagination=!1,this.pageStartSlice=0,this.pageEndSlice=10,this.disableSort=!1,this._paginationPosition="bottom",this.state={_allowMultiSort:!1,_fixedCols:[0,0],_data:[],_dataFoot:[],_headers:{horizontal:[],vertical:[]},_label:"",_pagination:{_page:1,_pageSize:10,_max:0},_sortedData:[],_paginationPosition:"bottom",_hasSettingsMenu:!1},this.handlePagination={onClick:(n,t)=>{var e;"function"==typeof(null===(e=this.state._pagination._on)||void 0===e?void 0:e.onClick)&&this.state._pagination._on.onClick(n,t),c(this,"_pagination",Object.assign(Object.assign({},this.state._pagination),{_page:t}))},onChangePage:(n,t)=>{var e;"function"==typeof(null===(e=this.state._pagination._on)||void 0===e?void 0:e.onChangePage)&&this.state._pagination._on.onChangePage(n,t),c(this,"_pagination",Object.assign(Object.assign({},this.state._pagination),{_page:t}))},onChangePageSize:(n,t)=>{var e;"function"==typeof(null===(e=this.state._pagination._on)||void 0===e?void 0:e.onChangePageSize)&&this.state._pagination._on.onChangePageSize(n,t),c(this,"_pagination",Object.assign(Object.assign({},this.state._pagination),{_pageSize:t})),c(this,"_pageSize",t)}},this.onSelectionChange=n=>{n.stopPropagation()},this.updateSortedData=()=>{if(this.disableSort)return void c(this,"_sortedData",this.state._data);const n=[...this.state._data];this.sortData.length>0&&n.sort((n,t)=>{for(let e=0;e<this.sortData.length;e++){const i=this.sortData[e],o=i.compareFn(n,t,i.direction);if(0!==o)return"ASC"===i.direction?o:-o}return 0}),c(this,"_sortedData",n)}}validateAllowMultiSort(n){z(this,n,{defaultValue:!1})}validateData(n){p(this,n,{afterPatch:()=>{setTimeout(this.updateSortedData)}})}validateDataFoot(n){k(this,n,{afterPatch:()=>{setTimeout(this.updateSortedData)}})}validateFixedCols(n){u(this,n)}validatePaginationPosition(n){j(this,n)}validateHasSettingsMenu(n){m(this,n)}changeCellSort(n){var t;if(void 0===n.type||"default"===n.type){if("function"!=typeof n.compareFn)return;this.state._allowMultiSort||n.key===(null===(t=this.sortData[0])||void 0===t?void 0:t.key)||(this.sortData=[]);const e=this.sortData.findIndex(t=>t.key===n.key);if(e>=0){const n=this.sortData[e];switch(n.direction){case"ASC":n.direction="DESC";break;case"DESC":this.sortData.splice(e,1);break;default:n.direction="ASC"}}else n.key&&this.sortData.push({label:n.label,key:n.key,compareFn:n.compareFn,direction:"ASC"});this.updateSortedData()}}validateHeaders(n){h(n,()=>{f(n,()=>{try{n=d(n)}catch(n){}r(this,"_headers",n=>"object"==typeof n&&null!==n,new Set(["KoliBriTableHeaders"]),n,{hooks:{beforePatch:n=>{var t,e,i,o;const a=n=>{let t=!1;this.sortData=[],n.forEach(n=>{if(void 0!==n.type&&"default"!==n.type)return;if("function"==typeof n.compareFn&&!n.key)return void b("[KolTableStateful] A sortable column requires the 'key' property.");const e=n.key;if(!e)return;const i=n.sortDirection;"ASC"!==i&&"DESC"!==i||"function"==typeof n.compareFn&&((this.state._allowMultiSort||0===this.sortData.length)&&this.sortData.push({label:n.label,key:e,compareFn:n.compareFn,direction:i}),t=!0)}),t&&setTimeout(()=>this.updateSortedData())},l=n;null===(t=l.horizontal)||void 0===t||t.forEach(a),null===(e=l.vertical)||void 0===e||e.forEach(a),l.horizontal&&l.vertical&&(null===(i=l.horizontal)||void 0===i?void 0:i.length)>0&&(null===(o=l.vertical)||void 0===o?void 0:o.length)>0&&(this.disableSort=!0,b("Table: You can not sort the table data, if horizontal and vertical headers are defined at the same time. (https://github.com/public-ui/kolibri/issues/2372)"))}}})})})}validateLabel(n){y(this,n,{required:!0})}validateSelection(n){_(this,n)}validateOn(n){g(this,n)}validatePagination(n){try{n=d(n)}catch(n){}this.showPagination=O(n),r(this,"_pagination",O,new Set(["boolean","KoliBriTablePagination"]),n,{defaultValue:{_page:1,_pageSize:10,_max:0}})}componentDidLoad(){var n;null===(n=this.tableWcRef)||void 0===n||n.addEventListener(x.selectionChange,this.onSelectionChange)}disconnectedCallback(){var n;null===(n=this.tableWcRef)||void 0===n||n.removeEventListener(x.selectionChange,this.onSelectionChange)}componentWillLoad(){this.validateAllowMultiSort(this._allowMultiSort),this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateFixedCols(this._fixedCols),this.validateHeaders(this._headers),this.validateLabel(this._label),this.validateOn(this._on),this.validatePagination(this._pagination),this.validatePaginationPosition(this._paginationPosition),this.validateSelection(this._selection),this.validateHasSettingsMenu(this._hasSettingsMenu)}selectDisplayedData(n,t,e){return"number"==typeof t&&t>0&&"number"==typeof e&&e>0?(this.pageStartSlice=t*(e-1),this.pageEndSlice=t*e>n.length?n.length:t*e,n.slice(this.pageStartSlice,this.pageEndSlice)):(this.pageStartSlice=0,this.pageEndSlice=n.length,n)}renderPagination(n){const e=a("kol-table-pagination-label",{placeholders:{label:`${this.state._label} (${a(`kol-pagination-position-${n}`)})`}});return t("div",{class:`kol-table-stateful__pagination kol-table-stateful__pagination--${this.state._paginationPosition}`},t("div",{class:"kol-table-stateful__pagination-wrapper"},t(o,{_boundaryCount:this.state._pagination._boundaryCount,_customClass:this.state._pagination._customClass,_hasButtons:this.state._pagination._hasButtons,_on:this.handlePagination,_page:this.state._pagination._page,_pageSize:this.state._pagination._pageSize,_pageSizeOptions:this.state._pagination._pageSizeOptions||T,_siblingCount:this.state._pagination._siblingCount,_tooltipAlign:"bottom",_max:this.state._pagination._max||this.state._pagination._max||this.state._data.length,_label:e})))}getHeaderCellSortState(n){if((void 0===n.type||"default"===n.type)&&!this.disableSort&&"function"==typeof n.compareFn){if(n.key){const t=this.sortData.find(t=>t.key===n.key);if(null==t?void 0:t.direction)return t.direction}return"NOS"}}getHeaderCellSortOrder(n){if((void 0===n.type||"default"===n.type)&&!this.disableSort&&this.state._allowMultiSort&&"function"==typeof n.compareFn&&n.key){const t=this.sortData.findIndex(t=>t.key===n.key);if(t>=0)return t+1}}handleSort({key:n}){const t=[...(this.state._headers.horizontal||[]).flat(),...(this.state._headers.vertical||[]).flat()].find(t=>t.key===n);t&&this.changeCellSort(t)}getSelectedData(n){var t;const e=this.state._selection;if(e){const i=null!==(t=e.keyPropertyName)&&void 0!==t?t:"id",o=new Set(n.map(String)),a=this.state._sortedData.filter(n=>o.has(String(n[i])));if(i)return a}return null}handleSelectionChange(n,t){var e;const i=this.state._selection;i&&(this.state=Object.assign(Object.assign({},this.state),{_selection:Object.assign(Object.assign({},i),{selectedKeys:t})}));const o=this.getSelectedData(t);"function"==typeof(null===(e=this.state._on)||void 0===e?void 0:e[v.onSelectionChange])&&this.state._on[v.onSelectionChange](n,o),this.host&&w(this.host,x.selectionChange,o)}async getSelection(){var n;const t=(null===(n=this.state._selection)||void 0===n?void 0:n.selectedKeys)||[];return this.getSelectedData(t)}render(){var n,i,o,a,s,r;const c=this.selectDisplayedData(this.state._sortedData,this.showPagination?null!==(i=null===(n=this.state._pagination)||void 0===n?void 0:n._pageSize)&&void 0!==i?i:10:this.state._sortedData.length,this.state._pagination._page||1),d="top"===this._paginationPosition||"both"===this._paginationPosition?this.renderPagination("top"):null,h="bottom"===this._paginationPosition||"both"===this._paginationPosition?this.renderPagination("bottom"):null,p={horizontal:null!==(a=null===(o=this.state._headers.horizontal)||void 0===o?void 0:o.map(n=>n.map(n=>Object.assign(Object.assign({},n),{sortDirection:this.getHeaderCellSortState(n),sortOrder:this.getHeaderCellSortOrder(n)}))))&&void 0!==a?a:[],vertical:null!==(r=null===(s=this.state._headers.vertical)||void 0===s?void 0:s.map(n=>n.map(n=>Object.assign(Object.assign({},n),{sortDirection:this.getHeaderCellSortState(n),sortOrder:this.getHeaderCellSortOrder(n)}))))&&void 0!==r?r:[]};return t(e,{key:"77fba3ac43752f6092890ed52c9e4359a0921a24",class:"kol-table-stateful"},this.pageEndSlice>0&&this.showPagination&&d,t(l,{key:"c991b5e049854fab6738028f6df0103501a05ca7",ref:this.catchRef,_data:c,_fixedCols:this._fixedCols,_headerCells:p,_label:this.state._label,_dataFoot:this.state._dataFoot,_on:{onSort:(n,t)=>{this.handleSort(t)},onSelectionChange:(n,t)=>{this.handleSelectionChange(n,t)}},_selection:this.state._selection,_hasSettingsMenu:this.state._hasSettingsMenu}),this.pageEndSlice>0&&this.showPagination&&h)}get host(){return i(this)}static get watchers(){return{_allowMultiSort:["validateAllowMultiSort"],_data:["validateData"],_dataFoot:["validateDataFoot"],_fixedCols:["validateFixedCols"],_paginationPosition:["validatePaginationPosition"],_hasSettingsMenu:["validateHasSettingsMenu"],_headers:["validateHeaders"],_label:["validateLabel"],_selection:["validateSelection"],_on:["validateOn"],_pagination:["validatePagination"]}}};D.style={default:C};export{D as kol_table_stateful};
|
|
@@ -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-CHTqQqxk.js";import{_ as l}from"./tslib.es6-CxX45GIN.js";import{b as s,c as o,t as r}from"./component-names-Dy77vq43.js";import{t as a}from"./i18n-BVaUp6qp.js";import{I as c}from"./component-t7JbTUbQ.js";import{T as d}from"./component-C-FsocqK.js";import{P as u,o as f,p as h,b,s as v}from"./common-BqV6Zb30.js";import{c as _,v as p,a as k,b as y,f as m,d as g}from"./table-selection-CXJmsMfX.js";import{v as S}from"./label-vxVEH2gH.js";import{C as j}from"./keyboard-DNd73LVa.js";import{c as w}from"./clsx-COFh-Vc8.js";import{n as A}from"./dev.utils-CxpBPLQA.js";import{d as C,K as $}from"./events-DHTi_wtD.js";import{M as x,e as O,U as D,f as H,b as T,d as F,S as M,h as K}from"./_Uint8Array-kJHDjtoP.js";import{S as B,a as R,i as W}from"./isArray-CcrBs4JM.js";import"./i18n-B2d_exHc.js";import"./bem-registry-Bux_TllX.js";import"./component-C8-WC5-k.js";var z="__lodash_hash_undefined__";function P(e){return this.__data__.set(e,z),this}function q(e){return this.__data__.has(e)}function E(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new x;++t<i;)this.add(e[t])}function I(e,t){for(var i=-1,l=null==e?0:e.length;++i<l;)if(t(e[i],i,e))return!0;return!1}function U(e,t){return e.has(t)}E.prototype.add=E.prototype.push=P,E.prototype.has=q;var L=1,N=2;function V(e,t,i,l,a,s){var o=i&L,r=e.length,n=t.length;if(r!=n&&!(o&&n>r))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var h=-1,u=!0,b=i&N?new E:void 0;for(s.set(e,t),s.set(t,e);++h<r;){var f=e[h],v=t[h];if(l)var _=o?l(v,f,h,t,e,s):l(f,v,h,e,t,s);if(void 0!==_){if(_)continue;u=!1;break}if(b){if(!I(t,function(e,t){if(!U(b,t)&&(f===e||a(f,e,i,l,s)))return b.push(t)})){u=!1;break}}else if(f!==v&&!a(f,v,i,l,s)){u=!1;break}}return s.delete(e),s.delete(t),u}function J(e){var t=-1,i=Array(e.size);return e.forEach(function(e,l){i[++t]=[l,e]}),i}function X(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var Q=1,G=2,Z="[object Boolean]",Y="[object Date]",tt="[object Error]",et="[object Map]",it="[object Number]",nt="[object RegExp]",lt="[object Set]",st="[object String]",ot="[object Symbol]",rt="[object ArrayBuffer]",at="[object DataView]",ct=B?B.prototype:void 0,dt=ct?ct.valueOf:void 0;function ut(e,t,i,l,a,s,o){switch(i){case at:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rt:return!(e.byteLength!=t.byteLength||!s(new D(e),new D(t)));case Z:case Y:case it:return O(+e,+t);case tt:return e.name==t.name&&e.message==t.message;case nt:case st:return e==t+"";case et:var r=J;case lt:var n=l&Q;if(r||(r=X),e.size!=t.size&&!n)return!1;var c=o.get(e);if(c)return c==t;l|=G,o.set(e,t);var d=V(r(e),r(t),l,a,s,o);return o.delete(e),d;case ot:if(dt)return dt.call(e)==dt.call(t)}return!1}var ft=1,ht=Object.prototype,bt=ht.hasOwnProperty;function vt(e,t,i,l,a,s){var o=i&ft,r=H(e),n=r.length;if(n!=H(t).length&&!o)return!1;for(var c=n;c--;){var d=r[c];if(!(o?d in t:bt.call(t,d)))return!1}var h=s.get(e),u=s.get(t);if(h&&u)return h==t&&u==e;var b=!0;s.set(e,t),s.set(t,e);for(var f=o;++c<n;){var v=e[d=r[c]],_=t[d];if(l)var p=o?l(_,v,d,t,e,s):l(v,_,d,e,t,s);if(!(void 0===p?v===_||a(v,_,i,l,s):p)){b=!1;break}f||(f="constructor"==d)}if(b&&!f){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 s.delete(e),s.delete(t),b}var _t=1,pt="[object Arguments]",kt="[object Array]",yt="[object Object]",mt=Object.prototype,gt=mt.hasOwnProperty;function St(e,t,i,l,a,s){var o=R(e),r=R(t),n=o?kt:T(e),c=r?kt:T(t),d=(n=n==pt?yt:n)==yt,h=(c=c==pt?yt:c)==yt,u=n==c;if(u&&F(e)){if(!F(t))return!1;o=!0,d=!1}if(u&&!d)return s||(s=new M),o||K(e)?V(e,t,i,l,a,s):ut(e,t,n,i,l,a,s);if(!(i&_t)){var b=d&>.call(e,"__wrapped__"),f=h&>.call(t,"__wrapped__");if(b||f){var v=b?e.value():e,_=f?t.value():t;return s||(s=new M),a(v,_,i,l,s)}}return!!u&&(s||(s=new M),vt(e,t,i,l,a,s))}function jt(e,t,i,l,a){return e===t||(null==e||null==t||!W(e)&&!W(t)?e!=e&&t!=t:St(e,t,i,l,jt,a))}function wt(e,t){return jt(e,t)}const At=(e,t)=>{u(t,()=>{f(t,()=>{try{t=h(t)}catch(e){}b(e,"_headerCells",e=>{var t,i;return"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)))&&[...null!==(t=e.horizontal)&&void 0!==t?t:[],...null!==(i=e.vertical)&&void 0!==i?i:[]].flat().every(e=>void 0===e.width||"number"==typeof e.width)&&!0},new Set(["TableHeaderCellsPropType"]),t)})})},Ct=150,$t=class{constructor(i){t(this,i),this.translateNoEntries=a("kol-no-entries"),this.state={_data:[],_headerCells:{horizontal:[],vertical:[]},_label:"",_hasSettingsMenu:!1},this.horizontal=!0,this.cellsToRenderTimeouts=new Map,this.dataToKeyMap=new Map,this.checkboxRefs=[],this.translateSort=a("kol-sort"),this.translateSortOrder=a("kol-table-sort-order"),this.maxCols=0,this.fixedOffsets=[],this.settingsChangedCounter=0,this.tableDivElementHasScrollbar=!1,this.stickyColsDisabled=!1,this.renderTableRow=(t,i,l,a=!1)=>{var s,o;let r=String(i);return this.horizontal&&(null===(s=t[0])||void 0===s?void 0:s.data)&&(r=null!==(o=this.getDataKey(t[0].data))&&void 0!==o?o:r),e("tr",{class:w("kol-table__row",{"kol-table__row--body":!a,"kol-table__row--footer":a}),key:`row-${r}`},this.renderSelectionCell(t,i),t.map((e,t)=>this.renderTableCell(e,i,t,l)))},this.renderTableCell=(t,i,l,a)=>{if(!1===t.visible)return"";let s=`${i}-${l}-${t.label}`;if(t.data){const e=this.getDataKey(t.data);s=e?`${e}-${this.horizontal?l:i}`:s}if(t.headerCell)return this.renderHeadingCell(t,i,l,a);{const i="function"!=typeof t.render&&t.label===this.translateNoEntries,a=this.getActionColumnHeader(l),o=Boolean(a&&t.data),r=this.isFixedCol(l),n="left"===r?this.getOffsetString(t.colIndex,!0):void 0,c="right"===r?this.getOffsetString(t.colIndex):void 0,d="function"==typeof t.render;return e("td",{key:`cell-${s}-${this.settingsChangedCounter}`,class:w("kol-table__cell kol-table__cell--body",t.textAlign&&`kol-table__cell--align-${t.textAlign}`,o&&"kol-table__cell--actions",r&&`kol-table__cell--sticky-${r}`),"aria-atomic":i?"false":void 0,"aria-live":i?"polite":void 0,"aria-relevant":i?"text":void 0,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{textAlign:t.textAlign,left:n,right:c},ref:d?e=>{this.cellRender(t,e)}:void 0},o&&a&&t.data?this.renderActionItems(a,t.data,s):d?"":t.label)}},this.renderActionItems=(t,i,a)=>{const r=t.actions(i);return e("div",{class:"kol-table__cell-actions"},r.map((t,i)=>{if("button"===t.type){const o=l(t,[]);return e(s,Object.assign({key:`action-${a}-${i}`},o,{_variant:o._variant}))}if("link"===t.type){const s=l(t,[]);return e(o,Object.assign({key:`action-${a}-${i}`},s))}return null}))}}validateHasSettingsMenu(e){_(this,e)}validateData(e){p(this,e,{beforePatch:e=>{this.updateDataToKeyMap(e)}})}validateDataFoot(e){k(this,e)}validateFixedCols(e){y(this,e),this.checkAndUpdateStickyState()}validateHeaderCells(e){At(this,e),wt(this.previousHeaderCells,this.state._headerCells)||this.initializeHeaderCellSettings(),this.previousHeaderCells=this.state._headerCells}validateLabel(e){S(this,e,{required:!0})}validateOn(e){m(this,e)}validateSelection(e){g(this,e),this.checkAndUpdateStickyState()}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 l=this.checkboxRefs.indexOf(i);l>-1&&(e.preventDefault(),"ArrowDown"===e.key?(l=(l+1)%this.checkboxRefs.length,this.checkboxRefs[l].focus()):"ArrowUp"===e.key&&(e.preventDefault(),l=(l+this.checkboxRefs.length-1)%this.checkboxRefs.length,this.checkboxRefs[l].focus()))}}componentDidRender(){this.checkDivElementScrollbar()}componentDidLoad(){this.tableDivElement&&ResizeObserver&&(this.tableDivElementResizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.tableDivElementResizeObserver.observe(this.tableDivElement)),this.checkAndUpdateStickyState()}handleSettingsChange(e){var t;const i=Object.assign(Object.assign({},this.state._headerCells),{horizontal:e.detail});v(this,"_headerCells",i),this.settingsChangedCounter++,"function"==typeof(null===(t=this.state._on)||void 0===t?void 0:t[j.onChangeHeaderCells])&&this.state._on[j.onChangeHeaderCells](e,i)}disconnectedCallback(){var e;null===(e=this.tableDivElementResizeObserver)||void 0===e||e.disconnect(),clearTimeout(this.resizeDebounceTimeout)}handleResize(){this.checkDivElementScrollbar(),clearTimeout(this.resizeDebounceTimeout),this.resizeDebounceTimeout=setTimeout(()=>{this.checkAndUpdateStickyState()},Ct)}checkDivElementScrollbar(){this.tableDivElement&&(this.tableDivElementHasScrollbar=this.tableDivElement.scrollWidth>this.tableDivElement.clientWidth)}calculateFixedColsWidth(){var e,t,i,l,a,s;if(!this._fixedCols)return 0;const o=this.getPrimaryHeaders(this.state._headerCells);let r=0;for(let i=0;i<this._fixedCols[0]&&i<o.length;i++)r+=null!==(t=null===(e=o[i])||void 0===e?void 0:e.width)&&void 0!==t?t:0;for(let e=this.maxCols-this._fixedCols[1];e<this.maxCols&&e<o.length;e++)r+=null!==(l=null===(i=o[e])||void 0===i?void 0:i.width)&&void 0!==l?l:0;if(this.state._selection){const e=null===(a=this.tableDivElement)||void 0===a?void 0:a.querySelector(".kol-table__cell--selection");r+=null!==(s=null==e?void 0:e.offsetWidth)&&void 0!==s?s:0}return r}checkAndUpdateStickyState(){if(!this.tableDivElement||!this._fixedCols)return void(this.stickyColsDisabled=!1);const e=this.tableDivElement.clientWidth,t=this.calculateFixedColsWidth();this.stickyColsDisabled=t>0&&t>=e}updateDataToKeyMap(e){e.forEach(e=>{this.dataToKeyMap.has(e)||this.dataToKeyMap.set(e,A())}),this.dataToKeyMap.forEach((t,i)=>{e.includes(i)||this.dataToKeyMap.delete(i)})}getDataKey(e){return this.dataToKeyMap.get(e)}getActionColumnHeader(e){const t=this.horizontal?this.state._headerCells.horizontal:this.state._headerCells.vertical;if(!t||0===t.length)return;const i=this.getPrimaryHeaders(this.state._headerCells)[e];return i&&"action"===i.type?i:void 0}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;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 l=0;return e.forEach(e=>{let t=0;Array.isArray(e)&&e.forEach(e=>{var i;t+=null!==(i=e.rowSpan)&&void 0!==i?i:1}),l<t&&(l=t)}),0===l?l=t.length:l-=(null===(i=this.state._dataFoot)||void 0===i?void 0:i.length)||0,l}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 l=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(t=e.horizontal)&&void 0!==t?t:[]);return this.horizontal=!0,0===l.length&&(l=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(i=e.vertical)&&void 0!==i?i:[]),l.length>0&&(this.horizontal=!1)),l}createDataField(e,t,i){var l,a,s,o,r,n,c;t.horizontal=Array.isArray(null==t?void 0:t.horizontal)?t.horizontal:[],t.vertical=Array.isArray(null==t?void 0:t.vertical)?t.vertical:[],this.maxCols=this.getNumberOfCols(t.horizontal,e);const d=this.getPrimaryHeaders(t);let h=this.getNumberOfRows(t.vertical,e),u=0;i&&(u=h,h+=(null===(l=this.state._dataFoot)||void 0===l?void 0:l.length)||0);const b=[],f=[],v=[];t.vertical.forEach((e,t)=>{f[t]=0,v[t]=[]});const _=d;for(let l=u;l<h;l++){const d=[];t.vertical.forEach((e,t)=>{let i=0;if(v[t].forEach(e=>i+=e),i<=l){const a=e[l-i+f[t]];if("object"==typeof a){d.push(Object.assign(Object.assign({},a),{headerCell:!0,data:{}}));let e=1;if("number"==typeof a.rowSpan&&a.rowSpan>1&&(e=a.rowSpan),v[t].push(e),"number"==typeof a.colSpan&&a.colSpan>1)for(let i=1;i<a.colSpan;i++)v[t+i].push(e);f[t]++}}});for(let t=0;t<this.maxCols;t++){let h=this.isFixedCol(t);if("left"===h&&void 0===this.getFixedOffset(t)){let e=null!==(a=this.fixedOffsets[t-1])&&void 0!==a?a:0;e+=null!==(o=null===(s=_[t-1])||void 0===s?void 0:s.width)&&void 0!==o?o:0,this.fixedOffsets[t]=e}if("right"===h&&void 0===this.getFixedOffset(t)){let e=null!==(r=this.fixedOffsets[t+1])&&void 0!==r?r:0;e+=null!==(c=null===(n=_[t+1])||void 0===n?void 0:n.width)&&void 0!==c?c:0,this.fixedOffsets[t]=e}if(!0===this.horizontal){const a=i&&this.state._dataFoot?this.state._dataFoot[l-u]:e[l];if("object"==typeof _[t]&&null!==_[t]&&"object"==typeof a&&null!==a&&("string"==typeof _[t].key||"function"==typeof _[t].render)){const e=a[_[t].key];d.push(Object.assign(Object.assign({},_[t]),{colIndex:t,colSpan:void 0,rowSpan:void 0,data:a,label:e}))}}else if("object"==typeof _[l]&&null!==_[l]&&"object"==typeof e[t]&&null!==e[t]&&("string"==typeof _[l].key||"function"==typeof _[l].render)){const i=_[l].key,a=e[t][i];d.push(Object.assign(Object.assign({},_[l]),{colIndex:t,colSpan:void 0,rowSpan:void 0,data:e[t],label:a}))}}b.push(d)}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 l={colSpan:e,label:this.translateNoEntries,render:void 0,rowSpan:Math.max(i,1)};0===b.length?b.push([l]):b[0].push(l)}return b}isFixedCol(e){if(this._fixedCols&&void 0!==e&&!this.stickyColsDisabled)return e<this._fixedCols[0]?"left":e>=this.maxCols-this._fixedCols[1]?"right":void 0}getFixedOffset(e){if(this.tableDivElement&&void 0!==e)return void 0!==this.fixedOffsets[e]?this.fixedOffsets[e]:void 0}getOffsetString(e,t){return t&&this._selection?"calc( var(--kol-table-selection-col-width) + "+this.getFixedOffset(e)+"px)":this.getFixedOffset(e)+"px"}handleSelectionChangeCallbackAndEvent(e,t){var i;"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i[j.onSelectionChange])&&this.state._on[j.onSelectionChange](e,t),this.host&&C(this.host,$.selectionChange,t)}initializeHeaderCellSettings(){if(this.state._headerCells&&this.state._headerCells.horizontal&&this.state._headerCells.horizontal.length>0){const e=Object.assign(Object.assign({},this.state._headerCells),{horizontal:this.state._headerCells.horizontal.map(e=>e.map(e=>Object.assign(Object.assign({},e),{visible:"boolean"!=typeof e.visible||e.visible,hidable:"boolean"!=typeof e.hidable||e.hidable})))});v(this,"_headerCells",e)}}componentWillLoad(){this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateHeaderCells(this._headerCells),this.validateLabel(this._label),this.validateOn(this._on),this.validateSelection(this._selection),this.validateHasSettingsMenu(this._hasSettingsMenu)}renderSelectionCell(t,i){var l;const a=this.state._selection;if(!a)return"";const s=this.getSelectionKeyPropertyName(),o=null===(l=t[0])||void 0===l?void 0:l.data;if(!o)return"";const r=o[s],n=a.multiple||void 0===a.multiple,h=(()=>{const e=null==a?void 0:a.selectedKeys;return(void 0===e?[]:Array.isArray(e)?e:[e]).some(e=>String(e)===String(r))})(),u=(()=>{const e=null==a?void 0:a.disabledKeys;return(void 0===e?[]:Array.isArray(e)?e:[e]).some(e=>String(e)===String(r))})(),b=a.label(o),f={name:"selection",checked:h,disabled:u,id:String(r),"aria-label":b};return e("td",{key:`tbody-${i}-selection`,class:"kol-table__cell kol-table__cell--selection"},e("div",{class:w("kol-table__selection",{"kol-table__selection--checked":h})},n?e("label",{class:w("kol-table__selection-label",{"kol-table__selection-label--disabled":u})},e(c,{class:"kol-table__selection-icon",icons:"kolicon "+(h?"kolicon-check":""),label:""}),e("input",Object.assign({class:w("kol-table__selection-input kol-table__selection-input--checkbox"),ref:e=>e&&this.checkboxRefs.push(e)},f,{type:"checkbox",onInput:e=>{const t=(()=>{const e=null==a?void 0:a.selectedKeys;return void 0===e?[]:Array.isArray(e)?e:[e]})(),i=h?t.filter(e=>String(e)!==String(r)):[...t,r];this.handleSelectionChangeCallbackAndEvent(e,null!=i?i:[])}}))):e("label",{class:"kol-table__selection-label"},e("input",Object.assign({class:w("kol-table__selection-input kol-table__selection-input--radio")},f,{type:"radio",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,[r])}}))),e("div",{class:"kol-table__selection-input-tooltip"},e(d,{label:b,badgeText:"",id:`${r}-label`,refFloating:()=>{}}))))}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;const l=null===(i=this.state._selection)||void 0===i?void 0:i.disabledKeys;return!(void 0===l?[]:Array.isArray(l)?l:[l]).some(i=>String(i)===String(t[e]))})}getSelectedKeysWithoutDisabledKeys(){const e=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})(),t=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.disabledKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})();return e.filter(e=>!t.some(t=>String(t)===String(e)))}getSelectedKeysWithDisabledKeysOnly(){const e=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})(),t=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.disabledKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})();return e.filter(e=>t.some(t=>String(t)===String(e)))}getRevertedSelection(e){var t;const i=this.getSelectionKeyPropertyName(),l=null!==(t=this.getSelectedKeysWithDisabledKeysOnly())&&void 0!==t?t:[];return e&&l.push(...this.getDataWithSelectionEnabled().map(e=>null==e?void 0:e[i])),l}getTableMinWidth(){var e,t;const i=null!==(e=this.state._headerCells.horizontal)&&void 0!==e?e:[],l=[];i.forEach(e=>{e.forEach(e=>{!1!==e.visible&&void 0!==e.width&&e.width>0&&l.push(e.width)})});const a=null!==(t=this.state._headerCells.vertical)&&void 0!==t?t:[],s=[];a.forEach(e=>{e.forEach(e=>{void 0!==e.width&&e.width>0&&s.push(e.width)})});const o=[...s,...l];return 0===o.length?"0px":1===o.length?`${o[0]}px`:`calc(${o.map(e=>`${e}px`).join(" + ")})`}renderHeadingSelectionCell(){var t,i;const l=this.state._selection;if(!l)return e("td",{class:"kol-table__cell kol-table__cell--header",key:"thead-0"});if(!1===l.multiple)return e("td",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header kol-table__cell--selection"});const s=null!==(i=null===(t=this.getSelectedKeysWithoutDisabledKeys())||void 0===t?void 0:t.length)&&void 0!==i?i:0,o=s===this.getDataWithSelectionEnabled().length,r=0!==s&&!o;let n="kol-table-selection-indeterminate";o&&!r&&(n="kol-table-selection-none"),0===s&&(n="kol-table-selection-all");const h=a(n);return e("th",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header kol-table__cell--selection"},e("div",{class:w("kol-table__selection",{"kol-table__selection--indeterminate":r,"kol-table__selection--checked":o})},e("label",{class:"kol-table__selection-label"},e(c,{class:"kol-table__selection-icon",icons:"kolicon "+(r?"kolicon-minus":o?"kolicon-check":""),label:""}),e("input",{class:w("kol-table__selection-input kol-table__selection-input--checkbox"),"data-testid":"selection-checkbox-all",ref:e=>e&&this.checkboxRefs.push(e),name:"selection",checked:o&&!r,indeterminate:r,"aria-label":h,type:"checkbox",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,this.getRevertedSelection(!o))}})),e("div",{class:"kol-table__selection-input-tooltip"},e(d,{label:h,badgeText:"",id:`${n}-label`,refFloating:()=>{}}))))}renderHeaderTdCell(){const t=this.state._headerCells.horizontal,l=this.state._headerCells.vertical;if(!Array.isArray(t)||0===t.length||!Array.isArray(l)||0===l.length)return e(i,null);const a=l.reduce((e,t)=>{var i;const l=null==t?void 0:t[0];return e+(null!==(i=null==l?void 0:l.width)&&void 0!==i?i:0)},0);return e("td",{"aria-hidden":"true",colSpan:l.length,rowSpan:t.length,style:a>0?{width:`${a}px`}:void 0})}formatSortOrderDescription(e){return this.translateSortOrder.replace("{{order}}",`${e}`)}getSortAriaDescription(e){return"number"==typeof e&&e>0?`${this.translateSort} – ${this.formatSortOrderDescription(e)}`:this.translateSort}renderHeadingCell(t,i,l,a){if(!1===t.visible)return"";const o=!1!==(null==t?void 0:t.sortable),r="string"==typeof t.sortDirection,n=o&&r;let c="none",d="kolicon-sort-neutral";if(n&&t.sortDirection)switch(t.sortDirection){case"ASC":d="kolicon-sort-asc",c="ascending";break;case"DESC":d="kolicon-sort-desc",c="descending";break;default:c="none"}const h=a?"row":"number"==typeof t.colSpan&&t.colSpan>1?"colgroup":"col",u="number"==typeof t.sortOrder&&t.sortOrder>0?t.sortOrder:void 0,b=this.getSortAriaDescription(u),f=void 0!==t.width?`${t.width}px`:void 0,v=this.isFixedCol(l),_="left"===v?this.getOffsetString(l,!0):void 0,p="right"===v?this.getOffsetString(l):void 0;return e("th",{key:`${i}-${l}-${t.label}`,class:w("kol-table__cell kol-table__cell--header",`kol-table__cell--${c}`,t.textAlign&&`kol-table__cell--align-${t.textAlign}`,v&&`kol-table__cell--sticky-${v}`),scope:h,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{width:f,left:_,right:p},"aria-sort":c,"data-sort":n&&t.sortDirection?`sort-${t.sortDirection}`:void 0},n&&t.sortDirection?e("span",{class:"kol-table__sort"},e(s,{class:"kol-table__sort-button",_icons:{right:d},_label:t.label,_ariaDescription:b,_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&&C(this.host,$.sort,{key:t.key,currentSortDirection:t.sortDirection})}}}),u&&e("span",{"aria-hidden":"true",class:"kol-table__sort-order"},u)):t.label)}renderSpacer(t,i){var l,a;const s=(null===(l=this.state._headerCells.vertical)||void 0===l?void 0:l.length)||0,o=null===(a=null==i?void 0:i[0])||void 0===a?void 0:a.reduce((e,t)=>e+(t.colSpan||1),0),r=this.state._selection?1:0;return e("tr",{"aria-hidden":"true",class:w("kol-table__spacer",`kol-table__spacer--${t}`)},e("td",{class:w(`kol-table__spacer-line kol-table__spacer-line--${t}`),colSpan:s+o+r}))}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(){const t=this.createDataField(this.state._data,this.state._headerCells);this.checkboxRefs=[];const i=this.state._headerCells.horizontal;return e("div",{key:"58848c2a07a40c3fb4aa1edf058aeb08fa0769ba",class:"kol-table"},this.state._hasSettingsMenu&&e(r,{key:"83c320417d105e6a363b611766d65b8f93564496",_horizontalHeaderCells:null!=i?i:[]}),e("div",{key:"07d0d0857d6c2faac908b4ef27f1117f8b3657ff",ref:e=>this.tableDivElement=e,class:"kol-table__scroll-container",tabindex:this.tableDivElementHasScrollbar?"-1":void 0},e("table",{key:"ca0d7629e4311bc1259072fbc3e8041afe2ee29d",class:"kol-table__table",style:{minWidth:this.getTableMinWidth()}},e("caption",{key:"1d7b6fe18b3a10693e03b0d59bafe16f0b424ea5",class:"kol-table__focus-element kol-table__caption",id:"caption",tabindex:this.tableDivElementHasScrollbar?"0":void 0},this.state._label),Array.isArray(i)&&e("thead",{key:"7736a5e70ad8011b596486becf1937464fc5cc3d",class:"kol-table__head"},[i.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",i)]),e("tbody",{key:"c1c09fb657f46835b7d58be54752be62ad3ccca2",class:"kol-table__body"},t.map((e,t)=>this.renderTableRow(e,t,!0))),this.renderFoot())))}get host(){return n(this)}static get watchers(){return{_hasSettingsMenu:["validateHasSettingsMenu"],_data:["validateData"],_dataFoot:["validateDataFoot"],_fixedCols:["validateFixedCols"],_headerCells:["validateHeaderCells"],_label:["validateLabel"],_on:["validateOn"],_selection:["validateSelection"]}}};export{$t as kol_table_stateless_wc};
|
|
4
|
+
import{r as t,h as e,F as i,g as n}from"./index-D1eeahGC.js";import{_ as l}from"./tslib.es6-CxX45GIN.js";import{b as s,c as o,t as r}from"./component-names-Dy77vq43.js";import{t as a}from"./i18n-BVaUp6qp.js";import{I as c}from"./component-C83zal9K.js";import{T as d}from"./component-BXZfpcMd.js";import{P as u,o as f,p as h,b,s as v}from"./common-BqV6Zb30.js";import{c as _,v as p,a as k,b as y,f as m,d as g}from"./table-selection-CXJmsMfX.js";import{v as S}from"./label-vxVEH2gH.js";import{C as j}from"./keyboard-DNd73LVa.js";import{c as w}from"./clsx-COFh-Vc8.js";import{n as A}from"./dev.utils-BdOde_4s.js";import{d as C,K as $}from"./events-DHTi_wtD.js";import{M as x,e as O,U as D,f as H,b as T,d as F,S as M,h as K}from"./_Uint8Array-kJHDjtoP.js";import{S as B,a as R,i as z}from"./isArray-CcrBs4JM.js";import"./i18n-B2d_exHc.js";import"./bem-registry-Bux_TllX.js";import"./component-CrREMVcS.js";var E="__lodash_hash_undefined__";function W(e){return this.__data__.set(e,E),this}function I(e){return this.__data__.has(e)}function P(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new x;++t<i;)this.add(e[t])}function V(e,t){for(var i=-1,l=null==e?0:e.length;++i<l;)if(t(e[i],i,e))return!0;return!1}function N(e,t){return e.has(t)}P.prototype.add=P.prototype.push=W,P.prototype.has=I;var U=1,L=2;function X(e,t,i,l,a,s){var o=i&U,r=e.length,n=t.length;if(r!=n&&!(o&&n>r))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var h=-1,u=!0,b=i&L?new P:void 0;for(s.set(e,t),s.set(t,e);++h<r;){var f=e[h],v=t[h];if(l)var _=o?l(v,f,h,t,e,s):l(f,v,h,e,t,s);if(void 0!==_){if(_)continue;u=!1;break}if(b){if(!V(t,function(e,t){if(!N(b,t)&&(f===e||a(f,e,i,l,s)))return b.push(t)})){u=!1;break}}else if(f!==v&&!a(f,v,i,l,s)){u=!1;break}}return s.delete(e),s.delete(t),u}function q(e){var t=-1,i=Array(e.size);return e.forEach(function(e,l){i[++t]=[l,e]}),i}function J(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var G=1,Z=2,Q="[object Boolean]",Y="[object Date]",tt="[object Error]",et="[object Map]",it="[object Number]",nt="[object RegExp]",lt="[object Set]",st="[object String]",ot="[object Symbol]",rt="[object ArrayBuffer]",at="[object DataView]",ct=B?B.prototype:void 0,dt=ct?ct.valueOf:void 0;function ut(e,t,i,l,a,s,o){switch(i){case at:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rt:return!(e.byteLength!=t.byteLength||!s(new D(e),new D(t)));case Q:case Y:case it:return O(+e,+t);case tt:return e.name==t.name&&e.message==t.message;case nt:case st:return e==t+"";case et:var r=q;case lt:var n=l&G;if(r||(r=J),e.size!=t.size&&!n)return!1;var c=o.get(e);if(c)return c==t;l|=Z,o.set(e,t);var d=X(r(e),r(t),l,a,s,o);return o.delete(e),d;case ot:if(dt)return dt.call(e)==dt.call(t)}return!1}var ft=1,ht=Object.prototype,bt=ht.hasOwnProperty;function vt(e,t,i,l,a,s){var o=i&ft,r=H(e),n=r.length;if(n!=H(t).length&&!o)return!1;for(var c=n;c--;){var d=r[c];if(!(o?d in t:bt.call(t,d)))return!1}var h=s.get(e),u=s.get(t);if(h&&u)return h==t&&u==e;var b=!0;s.set(e,t),s.set(t,e);for(var f=o;++c<n;){var v=e[d=r[c]],_=t[d];if(l)var p=o?l(_,v,d,t,e,s):l(v,_,d,e,t,s);if(!(void 0===p?v===_||a(v,_,i,l,s):p)){b=!1;break}f||(f="constructor"==d)}if(b&&!f){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 s.delete(e),s.delete(t),b}var _t=1,pt="[object Arguments]",kt="[object Array]",yt="[object Object]",mt=Object.prototype,gt=mt.hasOwnProperty;function St(e,t,i,l,a,s){var o=R(e),r=R(t),n=o?kt:T(e),c=r?kt:T(t),d=(n=n==pt?yt:n)==yt,h=(c=c==pt?yt:c)==yt,u=n==c;if(u&&F(e)){if(!F(t))return!1;o=!0,d=!1}if(u&&!d)return s||(s=new M),o||K(e)?X(e,t,i,l,a,s):ut(e,t,n,i,l,a,s);if(!(i&_t)){var b=d&>.call(e,"__wrapped__"),f=h&>.call(t,"__wrapped__");if(b||f){var v=b?e.value():e,_=f?t.value():t;return s||(s=new M),a(v,_,i,l,s)}}return!!u&&(s||(s=new M),vt(e,t,i,l,a,s))}function jt(e,t,i,l,a){return e===t||(null==e||null==t||!z(e)&&!z(t)?e!=e&&t!=t:St(e,t,i,l,jt,a))}function wt(e,t){return jt(e,t)}const At=(e,t)=>{u(t,()=>{f(t,()=>{try{t=h(t)}catch(e){}b(e,"_headerCells",e=>{var t,i;return"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)))&&[...null!==(t=e.horizontal)&&void 0!==t?t:[],...null!==(i=e.vertical)&&void 0!==i?i:[]].flat().every(e=>void 0===e.width||"number"==typeof e.width)&&!0},new Set(["TableHeaderCellsPropType"]),t)})})},Ct=150,$t=class{constructor(i){t(this,i),this.translateNoEntries=a("kol-no-entries"),this.state={_data:[],_headerCells:{horizontal:[],vertical:[]},_label:"",_hasSettingsMenu:!1},this.horizontal=!0,this.cellsToRenderTimeouts=new Map,this.dataToKeyMap=new Map,this.checkboxRefs=[],this.translateSort=a("kol-sort"),this.translateSortOrder=a("kol-table-sort-order"),this.maxCols=0,this.fixedOffsets=[],this.settingsChangedCounter=0,this.tableDivElementHasScrollbar=!1,this.stickyColsDisabled=!1,this.renderTableRow=(t,i,l,a=!1)=>{var s,o;let r=String(i);return this.horizontal&&(null===(s=t[0])||void 0===s?void 0:s.data)&&(r=null!==(o=this.getDataKey(t[0].data))&&void 0!==o?o:r),e("tr",{class:w("kol-table__row",{"kol-table__row--body":!a,"kol-table__row--footer":a}),key:`row-${r}`},this.renderSelectionCell(t,i),t.map((e,t)=>this.renderTableCell(e,i,t,l)))},this.renderTableCell=(t,i,l,a)=>{if(!1===t.visible)return"";let s=`${i}-${l}-${t.label}`;if(t.data){const e=this.getDataKey(t.data);s=e?`${e}-${this.horizontal?l:i}`:s}if(t.headerCell)return this.renderHeadingCell(t,i,l,a);{const i="function"!=typeof t.render&&t.label===this.translateNoEntries,a=this.getActionColumnHeader(l),o=Boolean(a&&t.data),r=this.isFixedCol(l),n="left"===r?this.getOffsetString(t.colIndex,!0):void 0,c="right"===r?this.getOffsetString(t.colIndex):void 0,d="function"==typeof t.render;return e("td",{key:`cell-${s}-${this.settingsChangedCounter}`,class:w("kol-table__cell kol-table__cell--body",t.textAlign&&`kol-table__cell--align-${t.textAlign}`,o&&"kol-table__cell--actions",r&&`kol-table__cell--sticky-${r}`),"aria-atomic":i?"false":void 0,"aria-live":i?"polite":void 0,"aria-relevant":i?"text":void 0,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{textAlign:t.textAlign,left:n,right:c},ref:d?e=>{this.cellRender(t,e)}:void 0},o&&a&&t.data?this.renderActionItems(a,t.data,s):d?"":t.label)}},this.renderActionItems=(t,i,a)=>{const r=t.actions(i);return e("div",{class:"kol-table__cell-actions"},r.map((t,i)=>{if("button"===t.type){const o=l(t,[]);return e(s,Object.assign({key:`action-${a}-${i}`},o,{_variant:o._variant}))}if("link"===t.type){const s=l(t,[]);return e(o,Object.assign({key:`action-${a}-${i}`},s))}return null}))}}validateHasSettingsMenu(e){_(this,e)}validateData(e){p(this,e,{beforePatch:e=>{this.updateDataToKeyMap(e)}})}validateDataFoot(e){k(this,e)}validateFixedCols(e){y(this,e),this.checkAndUpdateStickyState()}validateHeaderCells(e){At(this,e),wt(this.previousHeaderCells,this.state._headerCells)||this.initializeHeaderCellSettings(),this.previousHeaderCells=this.state._headerCells}validateLabel(e){S(this,e,{required:!0})}validateOn(e){m(this,e)}validateSelection(e){g(this,e),this.checkAndUpdateStickyState()}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 l=this.checkboxRefs.indexOf(i);l>-1&&(e.preventDefault(),"ArrowDown"===e.key?(l=(l+1)%this.checkboxRefs.length,this.checkboxRefs[l].focus()):"ArrowUp"===e.key&&(e.preventDefault(),l=(l+this.checkboxRefs.length-1)%this.checkboxRefs.length,this.checkboxRefs[l].focus()))}}componentDidRender(){this.checkDivElementScrollbar()}componentDidLoad(){this.tableDivElement&&ResizeObserver&&(this.tableDivElementResizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.tableDivElementResizeObserver.observe(this.tableDivElement)),this.checkAndUpdateStickyState()}handleSettingsChange(e){var t;const i=Object.assign(Object.assign({},this.state._headerCells),{horizontal:e.detail});v(this,"_headerCells",i),this.settingsChangedCounter++,"function"==typeof(null===(t=this.state._on)||void 0===t?void 0:t[j.onChangeHeaderCells])&&this.state._on[j.onChangeHeaderCells](e,i)}disconnectedCallback(){var e;null===(e=this.tableDivElementResizeObserver)||void 0===e||e.disconnect(),clearTimeout(this.resizeDebounceTimeout)}handleResize(){this.checkDivElementScrollbar(),clearTimeout(this.resizeDebounceTimeout),this.resizeDebounceTimeout=setTimeout(()=>{this.checkAndUpdateStickyState()},Ct)}checkDivElementScrollbar(){this.tableDivElement&&(this.tableDivElementHasScrollbar=this.tableDivElement.scrollWidth>this.tableDivElement.clientWidth)}calculateFixedColsWidth(){var e,t,i,l,a,s;if(!this._fixedCols)return 0;const o=this.getPrimaryHeaders(this.state._headerCells);let r=0;for(let i=0;i<this._fixedCols[0]&&i<o.length;i++)r+=null!==(t=null===(e=o[i])||void 0===e?void 0:e.width)&&void 0!==t?t:0;for(let e=this.maxCols-this._fixedCols[1];e<this.maxCols&&e<o.length;e++)r+=null!==(l=null===(i=o[e])||void 0===i?void 0:i.width)&&void 0!==l?l:0;if(this.state._selection){const e=null===(a=this.tableDivElement)||void 0===a?void 0:a.querySelector(".kol-table__cell--selection");r+=null!==(s=null==e?void 0:e.offsetWidth)&&void 0!==s?s:0}return r}checkAndUpdateStickyState(){if(!this.tableDivElement||!this._fixedCols)return void(this.stickyColsDisabled=!1);const e=this.tableDivElement.clientWidth,t=this.calculateFixedColsWidth();this.stickyColsDisabled=t>0&&t>=e}updateDataToKeyMap(e){e.forEach(e=>{this.dataToKeyMap.has(e)||this.dataToKeyMap.set(e,A())}),this.dataToKeyMap.forEach((t,i)=>{e.includes(i)||this.dataToKeyMap.delete(i)})}getDataKey(e){return this.dataToKeyMap.get(e)}getActionColumnHeader(e){const t=this.horizontal?this.state._headerCells.horizontal:this.state._headerCells.vertical;if(!t||0===t.length)return;const i=this.getPrimaryHeaders(this.state._headerCells)[e];return i&&"action"===i.type?i:void 0}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;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 l=0;return e.forEach(e=>{let t=0;Array.isArray(e)&&e.forEach(e=>{var i;t+=null!==(i=e.rowSpan)&&void 0!==i?i:1}),l<t&&(l=t)}),0===l?l=t.length:l-=(null===(i=this.state._dataFoot)||void 0===i?void 0:i.length)||0,l}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 l=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(t=e.horizontal)&&void 0!==t?t:[]);return this.horizontal=!0,0===l.length&&(l=this.getThePrimaryHeadersWithKeyOrRenderFunction(null!==(i=e.vertical)&&void 0!==i?i:[]),l.length>0&&(this.horizontal=!1)),l}createDataField(e,t,i){var l,a,s,o,r,n,c;t.horizontal=Array.isArray(null==t?void 0:t.horizontal)?t.horizontal:[],t.vertical=Array.isArray(null==t?void 0:t.vertical)?t.vertical:[],this.maxCols=this.getNumberOfCols(t.horizontal,e);const d=this.getPrimaryHeaders(t);let h=this.getNumberOfRows(t.vertical,e),u=0;i&&(u=h,h+=(null===(l=this.state._dataFoot)||void 0===l?void 0:l.length)||0);const b=[],f=[],v=[];t.vertical.forEach((e,t)=>{f[t]=0,v[t]=[]});const _=d;for(let l=u;l<h;l++){const d=[];t.vertical.forEach((e,t)=>{let i=0;if(v[t].forEach(e=>i+=e),i<=l){const a=e[l-i+f[t]];if("object"==typeof a){d.push(Object.assign(Object.assign({},a),{headerCell:!0,data:{}}));let e=1;if("number"==typeof a.rowSpan&&a.rowSpan>1&&(e=a.rowSpan),v[t].push(e),"number"==typeof a.colSpan&&a.colSpan>1)for(let i=1;i<a.colSpan;i++)v[t+i].push(e);f[t]++}}});for(let t=0;t<this.maxCols;t++){let h=this.isFixedCol(t);if("left"===h&&void 0===this.getFixedOffset(t)){let e=null!==(a=this.fixedOffsets[t-1])&&void 0!==a?a:0;e+=null!==(o=null===(s=_[t-1])||void 0===s?void 0:s.width)&&void 0!==o?o:0,this.fixedOffsets[t]=e}if("right"===h&&void 0===this.getFixedOffset(t)){let e=null!==(r=this.fixedOffsets[t+1])&&void 0!==r?r:0;e+=null!==(c=null===(n=_[t+1])||void 0===n?void 0:n.width)&&void 0!==c?c:0,this.fixedOffsets[t]=e}if(!0===this.horizontal){const a=i&&this.state._dataFoot?this.state._dataFoot[l-u]:e[l];if("object"==typeof _[t]&&null!==_[t]&&"object"==typeof a&&null!==a&&("string"==typeof _[t].key||"function"==typeof _[t].render)){const e=a[_[t].key];d.push(Object.assign(Object.assign({},_[t]),{colIndex:t,colSpan:void 0,rowSpan:void 0,data:a,label:e}))}}else if("object"==typeof _[l]&&null!==_[l]&&"object"==typeof e[t]&&null!==e[t]&&("string"==typeof _[l].key||"function"==typeof _[l].render)){const i=_[l].key,a=e[t][i];d.push(Object.assign(Object.assign({},_[l]),{colIndex:t,colSpan:void 0,rowSpan:void 0,data:e[t],label:a}))}}b.push(d)}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 l={colSpan:e,label:this.translateNoEntries,render:void 0,rowSpan:Math.max(i,1)};0===b.length?b.push([l]):b[0].push(l)}return b}isFixedCol(e){if(this._fixedCols&&void 0!==e&&!this.stickyColsDisabled)return e<this._fixedCols[0]?"left":e>=this.maxCols-this._fixedCols[1]?"right":void 0}getFixedOffset(e){if(this.tableDivElement&&void 0!==e)return void 0!==this.fixedOffsets[e]?this.fixedOffsets[e]:void 0}getOffsetString(e,t){return t&&this._selection?"calc( var(--kol-table-selection-col-width) + "+this.getFixedOffset(e)+"px)":this.getFixedOffset(e)+"px"}handleSelectionChangeCallbackAndEvent(e,t){var i;"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i[j.onSelectionChange])&&this.state._on[j.onSelectionChange](e,t),this.host&&C(this.host,$.selectionChange,t)}initializeHeaderCellSettings(){if(this.state._headerCells&&this.state._headerCells.horizontal&&this.state._headerCells.horizontal.length>0){const e=Object.assign(Object.assign({},this.state._headerCells),{horizontal:this.state._headerCells.horizontal.map(e=>e.map(e=>Object.assign(Object.assign({},e),{visible:"boolean"!=typeof e.visible||e.visible,hidable:"boolean"!=typeof e.hidable||e.hidable})))});v(this,"_headerCells",e)}}componentWillLoad(){this.validateData(this._data),this.validateDataFoot(this._dataFoot),this.validateHeaderCells(this._headerCells),this.validateLabel(this._label),this.validateOn(this._on),this.validateSelection(this._selection),this.validateHasSettingsMenu(this._hasSettingsMenu)}renderSelectionCell(t,i){var l;const a=this.state._selection;if(!a)return"";const s=this.getSelectionKeyPropertyName(),o=null===(l=t[0])||void 0===l?void 0:l.data;if(!o)return"";const r=o[s],n=a.multiple||void 0===a.multiple,h=(()=>{const e=null==a?void 0:a.selectedKeys;return(void 0===e?[]:Array.isArray(e)?e:[e]).some(e=>String(e)===String(r))})(),u=(()=>{const e=null==a?void 0:a.disabledKeys;return(void 0===e?[]:Array.isArray(e)?e:[e]).some(e=>String(e)===String(r))})(),b=a.label(o),f={name:"selection",checked:h,disabled:u,id:String(r),"aria-label":b};return e("td",{key:`tbody-${i}-selection`,class:"kol-table__cell kol-table__cell--selection"},e("div",{class:w("kol-table__selection",{"kol-table__selection--checked":h})},n?e("label",{class:w("kol-table__selection-label",{"kol-table__selection-label--disabled":u})},e(c,{class:"kol-table__selection-icon",icons:"kolicon "+(h?"kolicon-check":""),label:""}),e("input",Object.assign({class:w("kol-table__selection-input kol-table__selection-input--checkbox"),ref:e=>e&&this.checkboxRefs.push(e)},f,{type:"checkbox",onInput:e=>{const t=(()=>{const e=null==a?void 0:a.selectedKeys;return void 0===e?[]:Array.isArray(e)?e:[e]})(),i=h?t.filter(e=>String(e)!==String(r)):[...t,r];this.handleSelectionChangeCallbackAndEvent(e,null!=i?i:[])}}))):e("label",{class:"kol-table__selection-label"},e("input",Object.assign({class:w("kol-table__selection-input kol-table__selection-input--radio")},f,{type:"radio",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,[r])}}))),e("div",{class:"kol-table__selection-input-tooltip"},e(d,{label:b,badgeText:"",id:`${r}-label`,refFloating:()=>{}}))))}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;const l=null===(i=this.state._selection)||void 0===i?void 0:i.disabledKeys;return!(void 0===l?[]:Array.isArray(l)?l:[l]).some(i=>String(i)===String(t[e]))})}getSelectedKeysWithoutDisabledKeys(){const e=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})(),t=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.disabledKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})();return e.filter(e=>!t.some(t=>String(t)===String(e)))}getSelectedKeysWithDisabledKeysOnly(){const e=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.selectedKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})(),t=(()=>{var e;const t=null===(e=this.state._selection)||void 0===e?void 0:e.disabledKeys;return void 0===t?[]:Array.isArray(t)?t:[t]})();return e.filter(e=>t.some(t=>String(t)===String(e)))}getRevertedSelection(e){var t;const i=this.getSelectionKeyPropertyName(),l=null!==(t=this.getSelectedKeysWithDisabledKeysOnly())&&void 0!==t?t:[];return e&&l.push(...this.getDataWithSelectionEnabled().map(e=>null==e?void 0:e[i])),l}getTableMinWidth(){var e,t;const i=null!==(e=this.state._headerCells.horizontal)&&void 0!==e?e:[],l=[];i.forEach(e=>{e.forEach(e=>{!1!==e.visible&&void 0!==e.width&&e.width>0&&l.push(e.width)})});const a=null!==(t=this.state._headerCells.vertical)&&void 0!==t?t:[],s=[];a.forEach(e=>{e.forEach(e=>{void 0!==e.width&&e.width>0&&s.push(e.width)})});const o=[...s,...l];return 0===o.length?"0px":1===o.length?`${o[0]}px`:`calc(${o.map(e=>`${e}px`).join(" + ")})`}renderHeadingSelectionCell(){var t,i;const l=this.state._selection;if(!l)return e("td",{class:"kol-table__cell kol-table__cell--header",key:"thead-0"});if(!1===l.multiple)return e("td",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header kol-table__cell--selection"});const s=null!==(i=null===(t=this.getSelectedKeysWithoutDisabledKeys())||void 0===t?void 0:t.length)&&void 0!==i?i:0,o=s===this.getDataWithSelectionEnabled().length,r=0!==s&&!o;let n="kol-table-selection-indeterminate";o&&!r&&(n="kol-table-selection-none"),0===s&&(n="kol-table-selection-all");const h=a(n);return e("th",{key:"thead-0-selection",class:"kol-table__cell kol-table__cell--header kol-table__cell--selection"},e("div",{class:w("kol-table__selection",{"kol-table__selection--indeterminate":r,"kol-table__selection--checked":o})},e("label",{class:"kol-table__selection-label"},e(c,{class:"kol-table__selection-icon",icons:"kolicon "+(r?"kolicon-minus":o?"kolicon-check":""),label:""}),e("input",{class:w("kol-table__selection-input kol-table__selection-input--checkbox"),"data-testid":"selection-checkbox-all",ref:e=>e&&this.checkboxRefs.push(e),name:"selection",checked:o&&!r,indeterminate:r,"aria-label":h,type:"checkbox",onInput:e=>{this.handleSelectionChangeCallbackAndEvent(e,this.getRevertedSelection(!o))}})),e("div",{class:"kol-table__selection-input-tooltip"},e(d,{label:h,badgeText:"",id:`${n}-label`,refFloating:()=>{}}))))}renderHeaderTdCell(){const t=this.state._headerCells.horizontal,l=this.state._headerCells.vertical;if(!Array.isArray(t)||0===t.length||!Array.isArray(l)||0===l.length)return e(i,null);const a=l.reduce((e,t)=>{var i;const l=null==t?void 0:t[0];return e+(null!==(i=null==l?void 0:l.width)&&void 0!==i?i:0)},0);return e("td",{"aria-hidden":"true",colSpan:l.length,rowSpan:t.length,style:a>0?{width:`${a}px`}:void 0})}formatSortOrderDescription(e){return this.translateSortOrder.replace("{{order}}",`${e}`)}getSortAriaDescription(e){return"number"==typeof e&&e>0?`${this.translateSort} – ${this.formatSortOrderDescription(e)}`:this.translateSort}renderHeadingCell(t,i,l,a){if(!1===t.visible)return"";const o=!1!==(null==t?void 0:t.sortable),r="string"==typeof t.sortDirection,n=o&&r;let c="none",d="kolicon-sort-neutral";if(n&&t.sortDirection)switch(t.sortDirection){case"ASC":d="kolicon-sort-asc",c="ascending";break;case"DESC":d="kolicon-sort-desc",c="descending";break;default:c="none"}const h=a?"row":"number"==typeof t.colSpan&&t.colSpan>1?"colgroup":"col",u="number"==typeof t.sortOrder&&t.sortOrder>0?t.sortOrder:void 0,b=this.getSortAriaDescription(u),f=void 0!==t.width?`${t.width}px`:void 0,v=this.isFixedCol(l),_="left"===v?this.getOffsetString(l,!0):void 0,p="right"===v?this.getOffsetString(l):void 0;return e("th",{key:`${i}-${l}-${t.label}`,class:w("kol-table__cell kol-table__cell--header",`kol-table__cell--${c}`,t.textAlign&&`kol-table__cell--align-${t.textAlign}`,v&&`kol-table__cell--sticky-${v}`),scope:h,colSpan:t.colSpan,rowSpan:t.rowSpan,style:{width:f,left:_,right:p},"aria-sort":c,"data-sort":n&&t.sortDirection?`sort-${t.sortDirection}`:void 0},n&&t.sortDirection?e("span",{class:"kol-table__sort"},e(s,{class:"kol-table__sort-button",_icons:{right:d},_label:t.label,_ariaDescription:b,_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&&C(this.host,$.sort,{key:t.key,currentSortDirection:t.sortDirection})}}}),u&&e("span",{"aria-hidden":"true",class:"kol-table__sort-order"},u)):t.label)}renderSpacer(t,i){var l,a;const s=(null===(l=this.state._headerCells.vertical)||void 0===l?void 0:l.length)||0,o=null===(a=null==i?void 0:i[0])||void 0===a?void 0:a.reduce((e,t)=>e+(t.colSpan||1),0),r=this.state._selection?1:0;return e("tr",{"aria-hidden":"true",class:w("kol-table__spacer",`kol-table__spacer--${t}`)},e("td",{class:w(`kol-table__spacer-line kol-table__spacer-line--${t}`),colSpan:s+o+r}))}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(){const t=this.createDataField(this.state._data,this.state._headerCells);this.checkboxRefs=[];const i=this.state._headerCells.horizontal;return e("div",{key:"58848c2a07a40c3fb4aa1edf058aeb08fa0769ba",class:"kol-table"},this.state._hasSettingsMenu&&e(r,{key:"83c320417d105e6a363b611766d65b8f93564496",_horizontalHeaderCells:null!=i?i:[]}),e("div",{key:"07d0d0857d6c2faac908b4ef27f1117f8b3657ff",ref:e=>this.tableDivElement=e,class:"kol-table__scroll-container",tabindex:this.tableDivElementHasScrollbar?"-1":void 0},e("table",{key:"ca0d7629e4311bc1259072fbc3e8041afe2ee29d",class:"kol-table__table",style:{minWidth:this.getTableMinWidth()}},e("caption",{key:"1d7b6fe18b3a10693e03b0d59bafe16f0b424ea5",class:"kol-table__focus-element kol-table__caption",id:"caption",tabindex:this.tableDivElementHasScrollbar?"0":void 0},this.state._label),Array.isArray(i)&&e("thead",{key:"7736a5e70ad8011b596486becf1937464fc5cc3d",class:"kol-table__head"},[i.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",i)]),e("tbody",{key:"c1c09fb657f46835b7d58be54752be62ad3ccca2",class:"kol-table__body"},t.map((e,t)=>this.renderTableRow(e,t,!0))),this.renderFoot())))}get host(){return n(this)}static get watchers(){return{_hasSettingsMenu:["validateHasSettingsMenu"],_data:["validateData"],_dataFoot:["validateDataFoot"],_fixedCols:["validateFixedCols"],_headerCells:["validateHeaderCells"],_label:["validateLabel"],_on:["validateOn"],_selection:["validateSelection"]}}};export{$t 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-CHTqQqxk.js";import{k as t}from"./component-names-Dy77vq43.js";import"./common-BqV6Zb30.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(44 * 1rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without verifying the contrast ratio of its background and font colors.\n * By initially setting the background color to white and the font color to black,\n * the contrast ratio is ensured and explicit adjustment is forced.\n */\n color: black;\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 * Text should be aligned left by default to provide a predictable starting point.\n */\n text-align: left;\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 text color from his parent element.\n */\n color: inherit;\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: fixed;\n top: 0;\n left: 0;\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(16 * 1rem / 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: flex;\n flex-flow: column;\n align-items: center;\n justify-content: 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 align-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 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 .hastooltip {\n z-index: 900 !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1777087174897"); /* IE9*/\n src: url("kolicons.eot?t=1777087174897#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1777087174897") format("woff2"), url("kolicons.woff?t=1777087174897") format("woff"), url("kolicons.ttf?t=1777087174897") format("truetype"), url("kolicons.svg?t=1777087174897#kolicons") format("svg"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: "\\ea01";\n }\n .kolicon-alert-info::before {\n content: "\\ea02";\n }\n .kolicon-alert-success::before {\n content: "\\ea03";\n }\n .kolicon-alert-warning::before {\n content: "\\ea04";\n }\n .kolicon-check::before {\n content: "\\ea05";\n }\n .kolicon-chevron-double-left::before {\n content: "\\ea06";\n }\n .kolicon-chevron-double-right::before {\n content: "\\ea07";\n }\n .kolicon-chevron-down::before {\n content: "\\ea08";\n }\n .kolicon-chevron-left::before {\n content: "\\ea09";\n }\n .kolicon-chevron-right::before {\n content: "\\ea0a";\n }\n .kolicon-chevron-up::before {\n content: "\\ea0b";\n }\n .kolicon-cogwheel::before {\n content: "\\ea0c";\n }\n .kolicon-cross::before {\n content: "\\ea0d";\n }\n .kolicon-eye-closed::before {\n content: "\\ea0e";\n }\n .kolicon-eye::before {\n content: "\\ea0f";\n }\n .kolicon-house::before {\n content: "\\ea10";\n }\n .kolicon-kolibri::before {\n content: "\\ea11";\n }\n .kolicon-link-external::before {\n content: "\\ea12";\n }\n .kolicon-link::before {\n content: "\\ea13";\n }\n .kolicon-minus::before {\n content: "\\ea14";\n }\n .kolicon-plus::before {\n content: "\\ea15";\n }\n .kolicon-settings::before {\n content: "\\ea16";\n }\n .kolicon-sort-asc::before {\n content: "\\ea17";\n }\n .kolicon-sort-desc::before {\n content: "\\ea18";\n }\n .kolicon-sort-neutral::before {\n content: "\\ea19";\n }\n .kolicon-up::before {\n content: "\\ea1a";\n }\n .kolicon-version::before {\n content: "\\ea1b";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n opacity: 0;\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, max-content);\n min-width: calc(8 * 1rem / var(--kolibri-root-font-size, 16));\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip__floating.show {\n animation-name: showTooltip;\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(10 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(10 * 1rem / 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 @keyframes hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-alert :host {\n display: inline-block;\n }\n .kol-alert .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-alert .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-alert .kol-button__text {\n flex: 1 0 100%;\n }\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(1 * 1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n :host {\n display: inline-block;\n }\n .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\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 flex: 1 0 100%;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n .kol-popover-button--inline .kol-popover-button__button {\n display: inline;\n }\n .kol-popover {\n opacity: 0;\n transition: 0.2s ease-out opacity;\n }\n .kol-popover-button--open + .kol-popover {\n opacity: 1;\n }\n .kol-table-settings {\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(8 * 1rem / var(--kolibri-root-font-size, 16));\n border: 1px solid #d1d5db;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200 * 1rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content minmax(max-content, 1fr) calc(140 * 1rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table {\n --kol-table-selection-col-width: var(--a11y-min-size);\n display: block;\n position: relative;\n max-width: 100%;\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__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table__table {\n table-layout: fixed;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__sort {\n display: inline-flex;\n align-items: center;\n }\n .kol-table__sort-order {\n display: inline-flex;\n align-items: center;\n justify-content: center;\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 align-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n align-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n align-items: end;\n }\n .kol-table__cell--selection {\n background-color: white;\n position: sticky !important;\n left: 0;\n z-index: 2;\n width: var(--kol-table-selection-col-width, auto);\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__cell--actions {\n white-space: nowrap;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-table__cell--actions .kol-button__text {\n flex: 1 0 100%;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-link {\n display: inline-flex;\n max-width: fit-content;\n align-items: baseline;\n place-items: center;\n text-align: left;\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-link--standalone {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: stretch;\n }\n .kol-table__cell--actions .kol-link--standalone .kol-link__text {\n display: inline-flex;\n flex: 1 1 100%;\n place-items: center;\n }\n .kol-table__cell--actions .kol-link .kol-span__label {\n text-decoration-line: underline;\n }\n .kol-table__cell--actions .kol-link:focus:not([aria-disabled], [disabled]) .kol-span__label, .kol-table__cell--actions .kol-link:hover:not([aria-disabled], [disabled]) .kol-span__label {\n text-decoration-thickness: 0.2em;\n }\n .kol-table__cell--actions .kol-link__icon {\n display: inline-flex;\n }\n .kol-table__cell--sticky-left, .kol-table__cell--sticky-right {\n background-color: white;\n position: sticky !important;\n z-index: 1;\n }\n .kol-table__cell--sticky-left:nth-last-child(1 of .kol-table__cell--sticky-left) {\n border-right: 2px solid black;\n }\n .kol-table__cell--sticky-right:nth-child(1 of .kol-table__cell--sticky-left) {\n border-left: 2px solid black;\n }\n .kol-table__cell-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection {\n position: relative;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection--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 min-width: calc(var(--a11y-min-size) / 2);\n min-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:"4f7161160a38949331d6141e8233f4ef0acf444c",_data:this._data,_dataFoot:this._dataFoot,_fixedCols:this._fixedCols,_headerCells:this._headerCells,_label:this._label,_on:this._on,_selection:this._selection,_hasSettingsMenu:this._hasSettingsMenu})}};i.style={default:o};export{i as kol_table_stateless};
|
|
4
|
+
import{r as n,h as e}from"./index-D1eeahGC.js";import{k as t}from"./component-names-Dy77vq43.js";import"./common-BqV6Zb30.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(44 * 1rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without verifying the contrast ratio of its background and font colors.\n * By initially setting the background color to white and the font color to black,\n * the contrast ratio is ensured and explicit adjustment is forced.\n */\n color: black;\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 * Text should be aligned left by default to provide a predictable starting point.\n */\n text-align: left;\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 text color from his parent element.\n */\n color: inherit;\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: fixed;\n top: 0;\n left: 0;\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(16 * 1rem / 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: flex;\n flex-flow: column;\n align-items: center;\n justify-content: 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 align-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 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 .hastooltip {\n z-index: 900 !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1777355226188"); /* IE9*/\n src: url("kolicons.eot?t=1777355226188#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1777355226188") format("woff2"), url("kolicons.woff?t=1777355226188") format("woff"), url("kolicons.ttf?t=1777355226188") format("truetype"), url("kolicons.svg?t=1777355226188#kolicons") format("svg"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: "\\ea01";\n }\n .kolicon-alert-info::before {\n content: "\\ea02";\n }\n .kolicon-alert-success::before {\n content: "\\ea03";\n }\n .kolicon-alert-warning::before {\n content: "\\ea04";\n }\n .kolicon-check::before {\n content: "\\ea05";\n }\n .kolicon-chevron-double-left::before {\n content: "\\ea06";\n }\n .kolicon-chevron-double-right::before {\n content: "\\ea07";\n }\n .kolicon-chevron-down::before {\n content: "\\ea08";\n }\n .kolicon-chevron-left::before {\n content: "\\ea09";\n }\n .kolicon-chevron-right::before {\n content: "\\ea0a";\n }\n .kolicon-chevron-up::before {\n content: "\\ea0b";\n }\n .kolicon-cogwheel::before {\n content: "\\ea0c";\n }\n .kolicon-cross::before {\n content: "\\ea0d";\n }\n .kolicon-eye-closed::before {\n content: "\\ea0e";\n }\n .kolicon-eye::before {\n content: "\\ea0f";\n }\n .kolicon-house::before {\n content: "\\ea10";\n }\n .kolicon-kolibri::before {\n content: "\\ea11";\n }\n .kolicon-link-external::before {\n content: "\\ea12";\n }\n .kolicon-link::before {\n content: "\\ea13";\n }\n .kolicon-minus::before {\n content: "\\ea14";\n }\n .kolicon-plus::before {\n content: "\\ea15";\n }\n .kolicon-settings::before {\n content: "\\ea16";\n }\n .kolicon-sort-asc::before {\n content: "\\ea17";\n }\n .kolicon-sort-desc::before {\n content: "\\ea18";\n }\n .kolicon-sort-neutral::before {\n content: "\\ea19";\n }\n .kolicon-up::before {\n content: "\\ea1a";\n }\n .kolicon-version::before {\n content: "\\ea1b";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n opacity: 0;\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, max-content);\n min-width: calc(8 * 1rem / var(--kolibri-root-font-size, 16));\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip__floating.show {\n animation-name: showTooltip;\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(10 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(10 * 1rem / 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 @keyframes hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-alert :host {\n display: inline-block;\n }\n .kol-alert .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-alert .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-alert .kol-button__text {\n flex: 1 0 100%;\n }\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(1 * 1rem / var(--kolibri-root-font-size, 16));\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n :host {\n display: inline-block;\n }\n .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\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 flex: 1 0 100%;\n }\n .kol-popover-button__popover {\n margin: 0;\n padding: 0;\n border: 0;\n }\n .kol-popover-button--inline .kol-popover-button__button {\n display: inline;\n }\n .kol-popover {\n opacity: 0;\n transition: 0.2s ease-out opacity;\n }\n .kol-popover-button--open + .kol-popover {\n opacity: 1;\n }\n .kol-table-settings {\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(8 * 1rem / var(--kolibri-root-font-size, 16));\n border: 1px solid #d1d5db;\n }\n .kol-table-settings__columns-container {\n max-height: calc(200 * 1rem / var(--kolibri-root-font-size, 16));\n overflow: auto;\n }\n .kol-table-settings__columns {\n display: grid;\n align-items: center;\n grid-auto-rows: min-content;\n grid-template-columns: min-content minmax(max-content, 1fr) calc(140 * 1rem / var(--kolibri-root-font-size, 16)) auto auto;\n }\n .kol-table-settings__column {\n display: contents;\n }\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table {\n --kol-table-selection-col-width: var(--a11y-min-size);\n display: block;\n position: relative;\n max-width: 100%;\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__scroll-container {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .kol-table__table {\n table-layout: fixed;\n }\n .kol-table__caption {\n min-height: var(--a11y-min-size);\n text-align: start;\n }\n .kol-table__sort-button .kol-button {\n color: inherit;\n }\n .kol-table__sort {\n display: inline-flex;\n align-items: center;\n }\n .kol-table__sort-order {\n display: inline-flex;\n align-items: center;\n justify-content: center;\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 align-items: start;\n }\n .kol-table__cell--align-center {\n text-align: center;\n }\n .kol-table__cell--align-center .kol-button__text {\n align-items: center;\n }\n .kol-table__cell--align-right {\n text-align: right;\n }\n .kol-table__cell--align-right .kol-button__text {\n align-items: end;\n }\n .kol-table__cell--selection {\n background-color: white;\n position: sticky !important;\n left: 0;\n z-index: 2;\n width: var(--kol-table-selection-col-width, auto);\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n white-space: nowrap;\n }\n .kol-table__cell--actions {\n white-space: nowrap;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-button {\n display: flex;\n min-height: var(--a11y-min-size);\n font-style: calc(16 * 1rem / var(--kolibri-root-font-size, 16));\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-table__cell--actions .kol-button__text {\n flex: 1 0 100%;\n }\n .kol-table__cell--actions .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-table__cell--actions :host {\n display: inline-block;\n }\n .kol-table__cell--actions .kol-link {\n display: inline-flex;\n max-width: fit-content;\n align-items: baseline;\n place-items: center;\n text-align: left;\n text-decoration-line: none;\n }\n .kol-table__cell--actions .kol-link--standalone {\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: stretch;\n }\n .kol-table__cell--actions .kol-link--standalone .kol-link__text {\n display: inline-flex;\n flex: 1 1 100%;\n place-items: center;\n }\n .kol-table__cell--actions .kol-link .kol-span__label {\n text-decoration-line: underline;\n }\n .kol-table__cell--actions .kol-link:focus:not([aria-disabled], [disabled]) .kol-span__label, .kol-table__cell--actions .kol-link:hover:not([aria-disabled], [disabled]) .kol-span__label {\n text-decoration-thickness: 0.2em;\n }\n .kol-table__cell--actions .kol-link__icon {\n display: inline-flex;\n }\n .kol-table__cell--sticky-left, .kol-table__cell--sticky-right {\n background-color: white;\n position: sticky !important;\n z-index: 1;\n }\n .kol-table__cell--sticky-left:nth-last-child(1 of .kol-table__cell--sticky-left) {\n border-right: 2px solid black;\n }\n .kol-table__cell--sticky-right:nth-child(1 of .kol-table__cell--sticky-left) {\n border-left: 2px solid black;\n }\n .kol-table__cell-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n }\n .kol-table__spacer {\n display: none;\n }\n .kol-table__selection {\n position: relative;\n }\n .kol-table__selection-label {\n display: flex;\n position: relative;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n .kol-table__selection--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 min-width: calc(var(--a11y-min-size) / 2);\n min-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:"4f7161160a38949331d6141e8233f4ef0acf444c",_data:this._data,_dataFoot:this._dataFoot,_fixedCols:this._fixedCols,_headerCells:this._headerCells,_label:this._label,_on:this._on,_selection:this._selection,_hasSettingsMenu:this._hasSettingsMenu})}};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 n,h as t,g as e}from"./index-CHTqQqxk.js";import{b as o,e as i,k as a,s,N as l,G as r,H as c,Q as h}from"./common-BqV6Zb30.js";import{v as d}from"./align-D3Z54kEL.js";import{v as f}from"./label-vxVEH2gH.js";import{b}from"./component-names-Dy77vq43.js";import{t as u}from"./i18n-BVaUp6qp.js";import{K as p}from"./keyboard-DNd73LVa.js";import{c as m}from"./clsx-COFh-Vc8.js";import{d as k,s as g}from"./element-click-BTxuJDNT.js";import{d as y,s as v}from"./element-focus-BKUtVrWY.js";import{d as w,K as _}from"./events-DHTi_wtD.js";import"./i18n-B2d_exHc.js";const x=["select-automatic","select-manual"],T=(e,t)=>{o(e,"_behavior",e=>"string"==typeof e&&x.includes(e),new Set([`KoliBriTabBehavior {${x.join(", ")}`]),t)},z=(e,t)=>{i(e,"_hasCreateButton",t)},C='/* 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(44 * 1rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without verifying the contrast ratio of its background and font colors.\n * By initially setting the background color to white and the font color to black,\n * the contrast ratio is ensured and explicit adjustment is forced.\n */\n color: black;\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 * Text should be aligned left by default to provide a predictable starting point.\n */\n text-align: left;\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 text color from his parent element.\n */\n color: inherit;\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: fixed;\n top: 0;\n left: 0;\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(16 * 1rem / 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: flex;\n flex-flow: column;\n align-items: center;\n justify-content: 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 align-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 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 .hastooltip {\n z-index: 900 !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1777087174897"); /* IE9*/\n src: url("kolicons.eot?t=1777087174897#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1777087174897") format("woff2"), url("kolicons.woff?t=1777087174897") format("woff"), url("kolicons.ttf?t=1777087174897") format("truetype"), url("kolicons.svg?t=1777087174897#kolicons") format("svg"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: "\\ea01";\n }\n .kolicon-alert-info::before {\n content: "\\ea02";\n }\n .kolicon-alert-success::before {\n content: "\\ea03";\n }\n .kolicon-alert-warning::before {\n content: "\\ea04";\n }\n .kolicon-check::before {\n content: "\\ea05";\n }\n .kolicon-chevron-double-left::before {\n content: "\\ea06";\n }\n .kolicon-chevron-double-right::before {\n content: "\\ea07";\n }\n .kolicon-chevron-down::before {\n content: "\\ea08";\n }\n .kolicon-chevron-left::before {\n content: "\\ea09";\n }\n .kolicon-chevron-right::before {\n content: "\\ea0a";\n }\n .kolicon-chevron-up::before {\n content: "\\ea0b";\n }\n .kolicon-cogwheel::before {\n content: "\\ea0c";\n }\n .kolicon-cross::before {\n content: "\\ea0d";\n }\n .kolicon-eye-closed::before {\n content: "\\ea0e";\n }\n .kolicon-eye::before {\n content: "\\ea0f";\n }\n .kolicon-house::before {\n content: "\\ea10";\n }\n .kolicon-kolibri::before {\n content: "\\ea11";\n }\n .kolicon-link-external::before {\n content: "\\ea12";\n }\n .kolicon-link::before {\n content: "\\ea13";\n }\n .kolicon-minus::before {\n content: "\\ea14";\n }\n .kolicon-plus::before {\n content: "\\ea15";\n }\n .kolicon-settings::before {\n content: "\\ea16";\n }\n .kolicon-sort-asc::before {\n content: "\\ea17";\n }\n .kolicon-sort-desc::before {\n content: "\\ea18";\n }\n .kolicon-sort-neutral::before {\n content: "\\ea19";\n }\n .kolicon-up::before {\n content: "\\ea1a";\n }\n .kolicon-version::before {\n content: "\\ea1b";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n opacity: 0;\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, max-content);\n min-width: calc(8 * 1rem / var(--kolibri-root-font-size, 16));\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip__floating.show {\n animation-name: showTooltip;\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(10 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(10 * 1rem / 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 @keyframes hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\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}',B=class{constructor(e){n(this,e),this.onCreateLabel=`${u("kol-new")} …`,this.nextPossibleTabIndex=(e,t,n=1)=>{const o=t+n;return o<e.length?e[o]._disabled?this.nextPossibleTabIndex(e,t,n+1):o:t},this.prevPossibleTabIndex=(e,t,n=1)=>{const o=t-n;return o>=0?e[o]._disabled?this.prevPossibleTabIndex(e,t,n+1):o:t},this.onKeyDown=e=>{switch(e.key){case p.ArrowRight:this.goToNextTab(e);break;case p.ArrowLeft:this.goToPreviousTab(e);break;case p.Space:case p.Enter:this.activateFocusedTab(e)}},this.onClickSelect=(e,t)=>{this.selectNextTabEvent(e,t)},this.onMouseDown=e=>{e.preventDefault()},this.callbacks={onClick:this.onClickSelect,onMouseDown:this.onMouseDown},this.setCurrentTabButtonRef=e=>{this.currentTabButtonRef=e},this.catchTabPanelHost=e=>{this.tabPanelHost=e},this._align="top",this._hasCreateButton=!1,this._selected=0,this.state={_align:"top",_label:"",_selected:0,_tabs:[]},this.selectNextNotDisabledTab=(e,t,n=!0,o)=>{if(e>t.length-1&&(e=t.length-1),e<0&&(e=0),Array.isArray(t)&&t[e]&&t[e]._disabled){if(!0===n){if(e<t.length-1)return this.selectNextNotDisabledTab(e+1,t,!0,o||e);e=o||e,n=!1}if(!1===n){if(e>0)return this.selectNextNotDisabledTab(e-1,t,!1,o||e);a("[KolTabs] All tabs are disabled, and therefore no tab can be displayed.")}}return e},this.syncSelectedAndTabs=(e,t,n,o)=>{let i,a;i="_selected"===o?e:this.state._selected,a="_tabs"===o?e:this.state._tabs,a.length>0&&t.set("_selected",this.selectNextNotDisabledTab(i,a))},this.refreshTabPanels=()=>{var e,t,n,o;if(this.tabPanelHost){for(;this.tabPanelHost.firstChild;)this.tabPanelHost.removeChild(this.tabPanelHost.firstChild);for(let i=0;i<(null===(e=this.state._tabs)||void 0===e?void 0:e.length);i++){const e=document.createElement("div");e.setAttribute("aria-labelledby",`${this.state._label.replace(/\s/g,"-")}-tab-${i}`),e.setAttribute("id",`tabpanel-${i}`),e.setAttribute("role","tabpanel"),e.setAttribute("hidden",""),e.setAttribute("tabindex","0");const a=document.createElement("slot");a.setAttribute("name",`tabpanel-slot-${i}`),e.appendChild(a),null===(t=this.tabPanelHost)||void 0===t||t.appendChild(e),"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[i])&&this.host.children[i].setAttribute("slot",`tabpanel-slot-${i}`)}this.updateVisiblePanel()}},this.updateVisiblePanel=()=>{this.tabPanelHost&&Array.from(this.tabPanelHost.children).forEach((e,t)=>{t===this.state._selected?e.removeAttribute("hidden"):e.setAttribute("hidden","")})},this.onCreate=e=>{var t,n;e.preventDefault(),null===(n=null===(t=this.state._on)||void 0===t?void 0:t.onCreate)||void 0===n||n.call(t,e),this.host&&w(this.host,_.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(e){const t=this.nextPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(e,t,this.getKeyboardTabChangeMode())}goToPreviousTab(e){const t=this.prevPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(e,t,this.getKeyboardTabChangeMode())}activateFocusedTab(e){"number"==typeof this.currentFocusIndex&&this.onSelect(e,this.currentFocusIndex)}selectNextTabEvent(e,t,n="activateCompletely"){var o,i;if(this.currentFocusIndex=t,this.focusTabById(t),"activateCompletely"===n){this._selected=t;null===(i=null===(o=this.state._tabs[t]._on)||void 0===o?void 0:o.onSelect)||void 0===i||i.call(o,e,t),this.onSelect(e,t)}}async focus(){return y(this.host,()=>v(this.currentTabButtonRef))}async click(){return k(this.host,async()=>g(this.currentTabButtonRef))}renderButtonGroup(){return t("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map((e,n)=>t(b,{ref:this.state._selected===n?this.setCurrentTabButtonRef:void 0,_disabled:e._disabled,_icons:e._icons,_hideLabel:e._hideLabel,_label:e._label,_on:this.callbacks,_tabIndex:this.state._selected===n?0:-1,_tooltipAlign:e._tooltipAlign,_variant:this.state._selected===n?"custom":void 0,_customClass:this.state._selected===n?"selected":"",_ariaControls:`tabpanel-${n}`,_ariaSelected:this.state._selected===n,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${n}`,_role:"tab",_value:n})),this.state._hasCreateButton&&t(b,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"kolicon-plus","data-testid":"tabs-create-button"}))}render(){return t("div",{key:"253099cbbf5db5fa1451dbfaa29670454939e581",ref:e=>{this.tabPanelsElement=e},class:m("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),t("div",{key:"8f6a109324808cf7914ca7cdd9db878268bf3383",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(e){d(this,e)}validateBehavior(e){T(this,e)}validateHasCreateButton(e){z(this,e)}validateLabel(e){f(this,e,{required:!0})}validateOn(e){if("object"==typeof e&&null!==e){const t={};"function"==typeof e.onCreate&&(t.onCreate=e.onCreate),"function"==typeof e.onSelect&&(t.onSelect=e.onSelect),s(this,"_on",t)}}validateSelected(e){l(this,"_selected",e,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(e){r(this,"_tabs",e=>"object"==typeof e&&null!==e&&"string"==typeof e._label&&e._label.length>0,e,void 0,{hooks:{beforePatch:this.syncSelectedAndTabs,afterPatch:this.refreshTabPanels}}),c("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(e){if(this.tabPanelsElement){const t=h(`button#${this.state._label.replace(/\s/g,"-")}-tab-${e}`,this.tabPanelsElement);null==t||t.focus()}}onSelect(e,t){var n,o;null===(o=null===(n=this._on)||void 0===n?void 0:n.onSelect)||void 0===o||o.call(n,e,t),this.host&&w(this.host,_.select,t),this.focusTabById(t)}get host(){return e(this)}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}};B.style={default:C};export{B as kol_tabs};
|
|
4
|
+
import{r as n,h as t,g as e}from"./index-D1eeahGC.js";import{b as o,e as i,k as a,s,N as l,G as r,H as c,Q as h}from"./common-BqV6Zb30.js";import{v as d}from"./align-D3Z54kEL.js";import{v as f}from"./label-vxVEH2gH.js";import{b}from"./component-names-Dy77vq43.js";import{t as u}from"./i18n-BVaUp6qp.js";import{K as p}from"./keyboard-DNd73LVa.js";import{c as m}from"./clsx-COFh-Vc8.js";import{d as k,s as g}from"./element-click-BTxuJDNT.js";import{d as y,s as v}from"./element-focus-BKUtVrWY.js";import{d as w,K as _}from"./events-DHTi_wtD.js";import"./i18n-B2d_exHc.js";const x=["select-automatic","select-manual"],T=(e,t)=>{o(e,"_behavior",e=>"string"==typeof e&&x.includes(e),new Set([`KoliBriTabBehavior {${x.join(", ")}`]),t)},z=(e,t)=>{i(e,"_hasCreateButton",t)},C='/* 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(44 * 1rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without verifying the contrast ratio of its background and font colors.\n * By initially setting the background color to white and the font color to black,\n * the contrast ratio is ensured and explicit adjustment is forced.\n */\n color: black;\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 * Text should be aligned left by default to provide a predictable starting point.\n */\n text-align: left;\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 text color from his parent element.\n */\n color: inherit;\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: fixed;\n top: 0;\n left: 0;\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(16 * 1rem / 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: flex;\n flex-flow: column;\n align-items: center;\n justify-content: 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 align-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 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 .hastooltip {\n z-index: 900 !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1777355226188"); /* IE9*/\n src: url("kolicons.eot?t=1777355226188#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1777355226188") format("woff2"), url("kolicons.woff?t=1777355226188") format("woff"), url("kolicons.ttf?t=1777355226188") format("truetype"), url("kolicons.svg?t=1777355226188#kolicons") format("svg"); /* iOS 4.1- */\n}\n@layer kol-component {\n [class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .kolicon-alert-error::before {\n content: "\\ea01";\n }\n .kolicon-alert-info::before {\n content: "\\ea02";\n }\n .kolicon-alert-success::before {\n content: "\\ea03";\n }\n .kolicon-alert-warning::before {\n content: "\\ea04";\n }\n .kolicon-check::before {\n content: "\\ea05";\n }\n .kolicon-chevron-double-left::before {\n content: "\\ea06";\n }\n .kolicon-chevron-double-right::before {\n content: "\\ea07";\n }\n .kolicon-chevron-down::before {\n content: "\\ea08";\n }\n .kolicon-chevron-left::before {\n content: "\\ea09";\n }\n .kolicon-chevron-right::before {\n content: "\\ea0a";\n }\n .kolicon-chevron-up::before {\n content: "\\ea0b";\n }\n .kolicon-cogwheel::before {\n content: "\\ea0c";\n }\n .kolicon-cross::before {\n content: "\\ea0d";\n }\n .kolicon-eye-closed::before {\n content: "\\ea0e";\n }\n .kolicon-eye::before {\n content: "\\ea0f";\n }\n .kolicon-house::before {\n content: "\\ea10";\n }\n .kolicon-kolibri::before {\n content: "\\ea11";\n }\n .kolicon-link-external::before {\n content: "\\ea12";\n }\n .kolicon-link::before {\n content: "\\ea13";\n }\n .kolicon-minus::before {\n content: "\\ea14";\n }\n .kolicon-plus::before {\n content: "\\ea15";\n }\n .kolicon-settings::before {\n content: "\\ea16";\n }\n .kolicon-sort-asc::before {\n content: "\\ea17";\n }\n .kolicon-sort-desc::before {\n content: "\\ea18";\n }\n .kolicon-sort-neutral::before {\n content: "\\ea19";\n }\n .kolicon-up::before {\n content: "\\ea1a";\n }\n .kolicon-version::before {\n content: "\\ea1b";\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n opacity: 0;\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, max-content);\n min-width: calc(8 * 1rem / var(--kolibri-root-font-size, 16));\n max-width: 90vw;\n max-height: 90vh;\n animation-direction: normal;\n /* Can be used to specify the animation duration from the outside. 250ms by default. */\n animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);\n animation-fill-mode: forwards;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n }\n .kol-tooltip__floating.hide {\n animation-name: hideTooltip;\n }\n .kol-tooltip__floating.show {\n animation-name: showTooltip;\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(10 * 1rem / var(--kolibri-root-font-size, 16));\n height: calc(10 * 1rem / 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 @keyframes hideTooltip {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n }\n @keyframes showTooltip {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-icon {\n color: inherit;\n display: inline-block;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\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}',B=class{constructor(e){n(this,e),this.onCreateLabel=`${u("kol-new")} …`,this.nextPossibleTabIndex=(e,t,n=1)=>{const o=t+n;return o<e.length?e[o]._disabled?this.nextPossibleTabIndex(e,t,n+1):o:t},this.prevPossibleTabIndex=(e,t,n=1)=>{const o=t-n;return o>=0?e[o]._disabled?this.prevPossibleTabIndex(e,t,n+1):o:t},this.onKeyDown=e=>{switch(e.key){case p.ArrowRight:this.goToNextTab(e);break;case p.ArrowLeft:this.goToPreviousTab(e);break;case p.Space:case p.Enter:this.activateFocusedTab(e)}},this.onClickSelect=(e,t)=>{this.selectNextTabEvent(e,t)},this.onMouseDown=e=>{e.preventDefault()},this.callbacks={onClick:this.onClickSelect,onMouseDown:this.onMouseDown},this.setCurrentTabButtonRef=e=>{this.currentTabButtonRef=e},this.catchTabPanelHost=e=>{this.tabPanelHost=e},this._align="top",this._hasCreateButton=!1,this._selected=0,this.state={_align:"top",_label:"",_selected:0,_tabs:[]},this.selectNextNotDisabledTab=(e,t,n=!0,o)=>{if(e>t.length-1&&(e=t.length-1),e<0&&(e=0),Array.isArray(t)&&t[e]&&t[e]._disabled){if(!0===n){if(e<t.length-1)return this.selectNextNotDisabledTab(e+1,t,!0,o||e);e=o||e,n=!1}if(!1===n){if(e>0)return this.selectNextNotDisabledTab(e-1,t,!1,o||e);a("[KolTabs] All tabs are disabled, and therefore no tab can be displayed.")}}return e},this.syncSelectedAndTabs=(e,t,n,o)=>{let i,a;i="_selected"===o?e:this.state._selected,a="_tabs"===o?e:this.state._tabs,a.length>0&&t.set("_selected",this.selectNextNotDisabledTab(i,a))},this.refreshTabPanels=()=>{var e,t,n,o;if(this.tabPanelHost){for(;this.tabPanelHost.firstChild;)this.tabPanelHost.removeChild(this.tabPanelHost.firstChild);for(let i=0;i<(null===(e=this.state._tabs)||void 0===e?void 0:e.length);i++){const e=document.createElement("div");e.setAttribute("aria-labelledby",`${this.state._label.replace(/\s/g,"-")}-tab-${i}`),e.setAttribute("id",`tabpanel-${i}`),e.setAttribute("role","tabpanel"),e.setAttribute("hidden",""),e.setAttribute("tabindex","0");const a=document.createElement("slot");a.setAttribute("name",`tabpanel-slot-${i}`),e.appendChild(a),null===(t=this.tabPanelHost)||void 0===t||t.appendChild(e),"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[i])&&this.host.children[i].setAttribute("slot",`tabpanel-slot-${i}`)}this.updateVisiblePanel()}},this.updateVisiblePanel=()=>{this.tabPanelHost&&Array.from(this.tabPanelHost.children).forEach((e,t)=>{t===this.state._selected?e.removeAttribute("hidden"):e.setAttribute("hidden","")})},this.onCreate=e=>{var t,n;e.preventDefault(),null===(n=null===(t=this.state._on)||void 0===t?void 0:t.onCreate)||void 0===n||n.call(t,e),this.host&&w(this.host,_.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(e){const t=this.nextPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(e,t,this.getKeyboardTabChangeMode())}goToPreviousTab(e){const t=this.prevPossibleTabIndex(this.state._tabs,this.getCurrentFocusIndex());this.selectNextTabEvent(e,t,this.getKeyboardTabChangeMode())}activateFocusedTab(e){"number"==typeof this.currentFocusIndex&&this.onSelect(e,this.currentFocusIndex)}selectNextTabEvent(e,t,n="activateCompletely"){var o,i;if(this.currentFocusIndex=t,this.focusTabById(t),"activateCompletely"===n){this._selected=t;null===(i=null===(o=this.state._tabs[t]._on)||void 0===o?void 0:o.onSelect)||void 0===i||i.call(o,e,t),this.onSelect(e,t)}}async focus(){return y(this.host,()=>v(this.currentTabButtonRef))}async click(){return k(this.host,async()=>g(this.currentTabButtonRef))}renderButtonGroup(){return t("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map((e,n)=>t(b,{ref:this.state._selected===n?this.setCurrentTabButtonRef:void 0,_disabled:e._disabled,_icons:e._icons,_hideLabel:e._hideLabel,_label:e._label,_on:this.callbacks,_tabIndex:this.state._selected===n?0:-1,_tooltipAlign:e._tooltipAlign,_variant:this.state._selected===n?"custom":void 0,_customClass:this.state._selected===n?"selected":"",_ariaControls:`tabpanel-${n}`,_ariaSelected:this.state._selected===n,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${n}`,_role:"tab",_value:n})),this.state._hasCreateButton&&t(b,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"kolicon-plus","data-testid":"tabs-create-button"}))}render(){return t("div",{key:"253099cbbf5db5fa1451dbfaa29670454939e581",ref:e=>{this.tabPanelsElement=e},class:m("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),t("div",{key:"8f6a109324808cf7914ca7cdd9db878268bf3383",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(e){d(this,e)}validateBehavior(e){T(this,e)}validateHasCreateButton(e){z(this,e)}validateLabel(e){f(this,e,{required:!0})}validateOn(e){if("object"==typeof e&&null!==e){const t={};"function"==typeof e.onCreate&&(t.onCreate=e.onCreate),"function"==typeof e.onSelect&&(t.onSelect=e.onSelect),s(this,"_on",t)}}validateSelected(e){l(this,"_selected",e,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(e){r(this,"_tabs",e=>"object"==typeof e&&null!==e&&"string"==typeof e._label&&e._label.length>0,e,void 0,{hooks:{beforePatch:this.syncSelectedAndTabs,afterPatch:this.refreshTabPanels}}),c("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(e){if(this.tabPanelsElement){const t=h(`button#${this.state._label.replace(/\s/g,"-")}-tab-${e}`,this.tabPanelsElement);null==t||t.focus()}}onSelect(e,t){var n,o;null===(o=null===(n=this._on)||void 0===n?void 0:n.onSelect)||void 0===o||o.call(n,e,t),this.host&&w(this.host,_.select,t),this.focusTabById(t)}get host(){return e(this)}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}};B.style={default:C};export{B as kol_tabs};
|