@public-ui/components 4.1.2-rc.9 → 4.1.2
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-B0V3X3wp.js → Alert-C0ni87zH.js} +1 -1
- package/dist/cjs/{Alert-B0V3X3wp.js.map → Alert-C0ni87zH.js.map} +1 -1
- package/dist/cjs/{Collapsible-D_iqIWGh.js → Collapsible-B2NYkr98.js} +1 -1
- package/dist/cjs/{Collapsible-D_iqIWGh.js.map → Collapsible-B2NYkr98.js.map} +1 -1
- package/dist/cjs/{CustomSuggestionsOptionsGroup-DaP3aVOD.js → CustomSuggestionsOptionsGroup-DsfBTk3u.js} +1 -1
- package/dist/cjs/{CustomSuggestionsOptionsGroup-DaP3aVOD.js.map → CustomSuggestionsOptionsGroup-DsfBTk3u.js.map} +1 -1
- package/dist/cjs/{FieldControlStateWrapper-CoK8uXUH.js → FieldControlStateWrapper-YEjIP80B.js} +1 -1
- package/dist/cjs/{FieldControlStateWrapper-CoK8uXUH.js.map → FieldControlStateWrapper-YEjIP80B.js.map} +1 -1
- package/dist/cjs/{FormFieldStateWrapper-B1k695Hd.js → FormFieldStateWrapper-BQWVVjWk.js} +1 -1
- package/dist/cjs/{FormFieldStateWrapper-B1k695Hd.js.map → FormFieldStateWrapper-BQWVVjWk.js.map} +1 -1
- package/dist/cjs/{Heading-DhPc_Tq3.js → Heading-CfhDOPMw.js} +1 -1
- package/dist/cjs/{Heading-DhPc_Tq3.js.map → Heading-CfhDOPMw.js.map} +1 -1
- package/dist/cjs/{Input-DkATfA96.js → Input-wBiCBqv3.js} +1 -1
- package/dist/cjs/{Input-DkATfA96.js.map → Input-wBiCBqv3.js.map} +1 -1
- package/dist/cjs/{InputStateWrapper-Ck7sMrXu.js → InputStateWrapper-BtfWhSAG.js} +1 -1
- package/dist/cjs/{InputStateWrapper-Ck7sMrXu.js.map → InputStateWrapper-BtfWhSAG.js.map} +1 -1
- package/dist/cjs/{app-globals-DaLgISvq.js → app-globals-DA5QbwLT.js} +1 -1
- package/dist/cjs/{app-globals-DaLgISvq.js.map → app-globals-DA5QbwLT.js.map} +1 -1
- package/dist/cjs/{component-CmSwyEt3.js → component-Cg-OygC_.js} +1 -1
- package/dist/cjs/{component-CmSwyEt3.js.map → component-Cg-OygC_.js.map} +1 -1
- package/dist/cjs/{component-b-IdWBee.js → component-O_tO7dUq.js} +1 -1
- package/dist/cjs/{component-b-IdWBee.js.map → component-O_tO7dUq.js.map} +1 -1
- package/dist/cjs/{component-BnSFJ1yj.js → component-TPBvP4ox.js} +1 -1
- package/dist/cjs/{component-BnSFJ1yj.js.map → component-TPBvP4ox.js.map} +1 -1
- package/dist/cjs/{controller-CTX_vdhu.js → controller-BIw-uUwK.js} +1 -1
- package/dist/cjs/{controller-CTX_vdhu.js.map → controller-BIw-uUwK.js.map} +1 -1
- package/dist/cjs/{controller-CwOOs92X.js → controller-DCfbk9ts.js} +1 -1
- package/dist/cjs/{controller-CwOOs92X.js.map → controller-DCfbk9ts.js.map} +1 -1
- package/dist/cjs/{controller-Cukn8V3a.js → controller-axvKW-gX.js} +1 -1
- package/dist/cjs/{controller-Cukn8V3a.js.map → controller-axvKW-gX.js.map} +1 -1
- package/dist/cjs/{controller-icon-BkgT5jQi.js → controller-icon-DpxEr5AX.js} +1 -1
- package/dist/cjs/{controller-icon-BkgT5jQi.js.map → controller-icon-DpxEr5AX.js.map} +1 -1
- package/dist/cjs/{controller-CSEvtexE.js → controller-pPoypcsX.js} +1 -1
- package/dist/cjs/{controller-CSEvtexE.js.map → controller-pPoypcsX.js.map} +1 -1
- package/dist/cjs/{dev.utils-Dm-X_NQd.js → dev.utils-ciOZUMnv.js} +1 -1
- package/dist/cjs/{dev.utils-Dm-X_NQd.js.map → dev.utils-ciOZUMnv.js.map} +1 -1
- package/dist/cjs/{devtools-Y5183eVO.js → devtools-CS0BGiIX.js} +1 -1
- package/dist/cjs/{devtools-Y5183eVO.js.map → devtools-CS0BGiIX.js.map} +1 -1
- package/dist/cjs/index-Dph1AncT.js +4 -0
- package/dist/cjs/index-Dph1AncT.js.map +1 -0
- 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.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/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.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-tCK86mR9.js → Alert-Ccw-DwxA.js} +1 -1
- package/dist/esm/{Alert-tCK86mR9.js.map → Alert-Ccw-DwxA.js.map} +1 -1
- package/dist/esm/{Collapsible-Cj9F89Xs.js → Collapsible-C8qbIZUD.js} +1 -1
- package/dist/esm/{Collapsible-Cj9F89Xs.js.map → Collapsible-C8qbIZUD.js.map} +1 -1
- package/dist/esm/{CustomSuggestionsOptionsGroup-nwMMJoTi.js → CustomSuggestionsOptionsGroup-Ct0Hm2uK.js} +1 -1
- package/dist/{kolibri/CustomSuggestionsOptionsGroup-nwMMJoTi.js.map → esm/CustomSuggestionsOptionsGroup-Ct0Hm2uK.js.map} +1 -1
- package/dist/esm/{FieldControlStateWrapper-jzhuJtcw.js → FieldControlStateWrapper-DshiHE0s.js} +1 -1
- package/dist/{kolibri/FieldControlStateWrapper-jzhuJtcw.js.map → esm/FieldControlStateWrapper-DshiHE0s.js.map} +1 -1
- package/dist/esm/{FormFieldStateWrapper-CYyPrkIu.js → FormFieldStateWrapper-DsX6gk6N.js} +1 -1
- package/dist/{kolibri/FormFieldStateWrapper-CYyPrkIu.js.map → esm/FormFieldStateWrapper-DsX6gk6N.js.map} +1 -1
- package/dist/esm/{Heading-NivGt5lH.js → Heading-D3N3WLAQ.js} +1 -1
- package/dist/{kolibri/Heading-NivGt5lH.js.map → esm/Heading-D3N3WLAQ.js.map} +1 -1
- package/dist/esm/{Input-DT4QeGU5.js → Input-vt6KaJWU.js} +1 -1
- package/dist/esm/{Input-DT4QeGU5.js.map → Input-vt6KaJWU.js.map} +1 -1
- package/dist/esm/{InputStateWrapper-DQ8WZAj6.js → InputStateWrapper-xUqVwJbq.js} +1 -1
- package/dist/esm/{InputStateWrapper-DQ8WZAj6.js.map → InputStateWrapper-xUqVwJbq.js.map} +1 -1
- package/dist/esm/{app-globals-QmLLrOhZ.js → app-globals-D4GzuCjA.js} +1 -1
- package/dist/esm/{app-globals-QmLLrOhZ.js.map → app-globals-D4GzuCjA.js.map} +1 -1
- package/dist/esm/{component-BU7rA3Iq.js → component-CAXga0_U.js} +1 -1
- package/dist/esm/{component-BU7rA3Iq.js.map → component-CAXga0_U.js.map} +1 -1
- package/dist/esm/{component-PEZ0eaV8.js → component-D3oJtEcp.js} +1 -1
- package/dist/esm/{component-PEZ0eaV8.js.map → component-D3oJtEcp.js.map} +1 -1
- package/dist/esm/{component-BcphpQc1.js → component-DpGGeM3i.js} +1 -1
- package/dist/esm/{component-BcphpQc1.js.map → component-DpGGeM3i.js.map} +1 -1
- package/dist/esm/{controller-30xZFasL.js → controller-B-NZHqJ8.js} +1 -1
- package/dist/esm/{controller-30xZFasL.js.map → controller-B-NZHqJ8.js.map} +1 -1
- package/dist/esm/{controller-B26Xzibc.js → controller-BBKoxit_.js} +1 -1
- package/dist/esm/{controller-B26Xzibc.js.map → controller-BBKoxit_.js.map} +1 -1
- package/dist/esm/{controller-90L8F3y2.js → controller-BKRP0tqb.js} +1 -1
- package/dist/{kolibri/controller-90L8F3y2.js.map → esm/controller-BKRP0tqb.js.map} +1 -1
- package/dist/esm/{controller-CXFmGceD.js → controller-VXnGF058.js} +1 -1
- package/dist/esm/{controller-CXFmGceD.js.map → controller-VXnGF058.js.map} +1 -1
- package/dist/esm/{controller-icon-CkbZA11D.js → controller-icon-CYmINtAB.js} +1 -1
- package/dist/esm/{controller-icon-CkbZA11D.js.map → controller-icon-CYmINtAB.js.map} +1 -1
- package/dist/esm/{dev.utils-1j51sOA0.js → dev.utils-BL9Lx_uf.js} +1 -1
- package/dist/esm/{dev.utils-1j51sOA0.js.map → dev.utils-BL9Lx_uf.js.map} +1 -1
- package/dist/esm/{devtools-BoxfKJ14.js → devtools-CJj45nCF.js} +1 -1
- package/dist/{kolibri/devtools-BoxfKJ14.js.map → esm/devtools-CJj45nCF.js.map} +1 -1
- package/dist/esm/index-G8af0_gG.js +4 -0
- package/dist/esm/index-G8af0_gG.js.map +1 -0
- 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.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-tCK86mR9.js → Alert-Ccw-DwxA.js} +1 -1
- package/dist/kolibri/{Alert-tCK86mR9.js.map → Alert-Ccw-DwxA.js.map} +1 -1
- package/dist/kolibri/Collapsible-C8qbIZUD.js +4 -0
- package/dist/kolibri/{Collapsible-Cj9F89Xs.js.map → Collapsible-C8qbIZUD.js.map} +1 -1
- package/dist/kolibri/{CustomSuggestionsOptionsGroup-nwMMJoTi.js → CustomSuggestionsOptionsGroup-Ct0Hm2uK.js} +1 -1
- package/dist/{esm/CustomSuggestionsOptionsGroup-nwMMJoTi.js.map → kolibri/CustomSuggestionsOptionsGroup-Ct0Hm2uK.js.map} +1 -1
- package/dist/kolibri/FieldControlStateWrapper-DshiHE0s.js +4 -0
- package/dist/{esm/FieldControlStateWrapper-jzhuJtcw.js.map → kolibri/FieldControlStateWrapper-DshiHE0s.js.map} +1 -1
- package/dist/kolibri/{FormFieldStateWrapper-CYyPrkIu.js → FormFieldStateWrapper-DsX6gk6N.js} +1 -1
- package/dist/{esm/FormFieldStateWrapper-CYyPrkIu.js.map → kolibri/FormFieldStateWrapper-DsX6gk6N.js.map} +1 -1
- package/dist/kolibri/{Heading-NivGt5lH.js → Heading-D3N3WLAQ.js} +1 -1
- package/dist/{esm/Heading-NivGt5lH.js.map → kolibri/Heading-D3N3WLAQ.js.map} +1 -1
- package/dist/kolibri/Input-vt6KaJWU.js +4 -0
- package/dist/kolibri/{Input-DT4QeGU5.js.map → Input-vt6KaJWU.js.map} +1 -1
- package/dist/kolibri/{InputStateWrapper-DQ8WZAj6.js → InputStateWrapper-xUqVwJbq.js} +1 -1
- package/dist/kolibri/{InputStateWrapper-DQ8WZAj6.js.map → InputStateWrapper-xUqVwJbq.js.map} +1 -1
- package/dist/kolibri/{app-globals-QmLLrOhZ.js → app-globals-D4GzuCjA.js} +1 -1
- package/dist/kolibri/{app-globals-QmLLrOhZ.js.map → app-globals-D4GzuCjA.js.map} +1 -1
- package/dist/kolibri/component-CAXga0_U.js +4 -0
- package/dist/kolibri/{component-BU7rA3Iq.js.map → component-CAXga0_U.js.map} +1 -1
- package/dist/kolibri/{component-PEZ0eaV8.js → component-D3oJtEcp.js} +1 -1
- package/dist/kolibri/{component-PEZ0eaV8.js.map → component-D3oJtEcp.js.map} +1 -1
- package/dist/kolibri/{component-BcphpQc1.js → component-DpGGeM3i.js} +1 -1
- package/dist/kolibri/{component-BcphpQc1.js.map → component-DpGGeM3i.js.map} +1 -1
- package/dist/kolibri/{controller-30xZFasL.js → controller-B-NZHqJ8.js} +1 -1
- package/dist/kolibri/{controller-30xZFasL.js.map → controller-B-NZHqJ8.js.map} +1 -1
- package/dist/kolibri/{controller-B26Xzibc.js → controller-BBKoxit_.js} +1 -1
- package/dist/kolibri/{controller-B26Xzibc.js.map → controller-BBKoxit_.js.map} +1 -1
- package/dist/kolibri/{controller-90L8F3y2.js → controller-BKRP0tqb.js} +1 -1
- package/dist/{esm/controller-90L8F3y2.js.map → kolibri/controller-BKRP0tqb.js.map} +1 -1
- package/dist/kolibri/{controller-CXFmGceD.js → controller-VXnGF058.js} +1 -1
- package/dist/kolibri/{controller-CXFmGceD.js.map → controller-VXnGF058.js.map} +1 -1
- package/dist/kolibri/{controller-icon-CkbZA11D.js → controller-icon-CYmINtAB.js} +1 -1
- package/dist/kolibri/{controller-icon-CkbZA11D.js.map → controller-icon-CYmINtAB.js.map} +1 -1
- package/dist/kolibri/{dev.utils-1j51sOA0.js → dev.utils-BL9Lx_uf.js} +1 -1
- package/dist/kolibri/{dev.utils-1j51sOA0.js.map → dev.utils-BL9Lx_uf.js.map} +1 -1
- package/dist/kolibri/{devtools-BoxfKJ14.js → devtools-CJj45nCF.js} +1 -1
- package/dist/{esm/devtools-BoxfKJ14.js.map → kolibri/devtools-CJj45nCF.js.map} +1 -1
- package/dist/kolibri/{index-Dva21o82.js → index-G8af0_gG.js} +1 -1
- package/dist/kolibri/index-G8af0_gG.js.map +1 -0
- 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.js +1 -1
- package/dist/kolibri/kol-card.entry.js +1 -1
- package/dist/kolibri/kol-click-button.entry.js +1 -1
- package/dist/kolibri/kol-combobox.entry.js +1 -1
- package/dist/kolibri/kol-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-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-number.entry.js.map +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-textarea.entry.js.map +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/package.json +1 -1
- package/dist/cjs/index-DAruRs4C.js +0 -4
- package/dist/cjs/index-DAruRs4C.js.map +0 -1
- package/dist/esm/index-Dva21o82.js +0 -4
- package/dist/esm/index-Dva21o82.js.map +0 -1
- package/dist/kolibri/Collapsible-Cj9F89Xs.js +0 -4
- package/dist/kolibri/FieldControlStateWrapper-jzhuJtcw.js +0 -4
- package/dist/kolibri/Input-DT4QeGU5.js +0 -4
- package/dist/kolibri/component-BU7rA3Iq.js +0 -4
- package/dist/kolibri/index-Dva21o82.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{b as watchValidator,d as watchBoolean,n as devHint,s as setState,O as watchNumber,M as watchJsonArrayString,N as uiUxHintMillerscheZahl,U as koliBriQuerySelector}from"./common.js";import{v as validateAlign}from"./align.js";import{v as validateLabel}from"./label.js";import{b as KolButtonWcTag}from"./component-names.js";import{t as translate}from"./i18n.js";import{K as KeyboardKey}from"./keyboard.js";import{c as clsx}from"./clsx.js";import{d as delegateClick,s as setClick}from"./element-click.js";import{d as delegateFocus,s as setFocus}from"./element-focus.js";import{d as dispatchDomEvent,K as KolEvent}from"./events.js";const tabBehaviorPropTypeOptions=["select-automatic","select-manual"],validateTabBehavior=(e,t)=>{watchValidator(e,"_behavior",e=>"string"==typeof e&&tabBehaviorPropTypeOptions.includes(e),new Set([`KoliBriTabBehavior {${tabBehaviorPropTypeOptions.join(", ")}`]),t)},validateHasCreateButton=(e,t)=>{watchBoolean(e,"_hasCreateButton",t)},defaultStyleCss='/* 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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .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=1775124354743"); /* IE9*/\n src: url("kolicons.eot?t=1775124354743#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775124354743") format("woff2"), url("kolicons.woff?t=1775124354743") format("woff"), url("kolicons.ttf?t=1775124354743") format("truetype"), url("kolicons.svg?t=1775124354743#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}',KolTabs$1=proxyCustomElement(class extends HTMLElement{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.onCreateLabel=`${translate("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 KeyboardKey.ArrowRight:this.goToNextTab(e);break;case KeyboardKey.ArrowLeft:this.goToPreviousTab(e);break;case KeyboardKey.Space:case KeyboardKey.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);devHint("[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&&dispatchDomEvent(this.host,KolEvent.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 delegateFocus(this.host,()=>setFocus(this.currentTabButtonRef))}async click(){return delegateClick(this.host,async()=>setClick(this.currentTabButtonRef))}renderButtonGroup(){return h("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map((e,t)=>h(KolButtonWcTag,{ref:this.state._selected===t?this.setCurrentTabButtonRef:void 0,_disabled:e._disabled,_icons:e._icons,_hideLabel:e._hideLabel,_label:e._label,_on:this.callbacks,_tabIndex:this.state._selected===t?0:-1,_tooltipAlign:e._tooltipAlign,_variant:this.state._selected===t?"custom":void 0,_customClass:this.state._selected===t?"selected":"",_ariaControls:`tabpanel-${t}`,_ariaSelected:this.state._selected===t,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${t}`,_role:"tab",_value:t})),this.state._hasCreateButton&&h(KolButtonWcTag,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"kolicon-plus","data-testid":"tabs-create-button"}))}render(){return h("div",{key:"40cde6ced5533ac105935fdd8399f2578f187116",ref:e=>{this.tabPanelsElement=e},class:clsx("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),h("div",{key:"b2e2655b1aa19615d5167da39db1151033a09462",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(e){validateAlign(this,e)}validateBehavior(e){validateTabBehavior(this,e)}validateHasCreateButton(e){validateHasCreateButton(this,e)}validateLabel(e){validateLabel(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),setState(this,"_on",t)}}validateSelected(e){watchNumber(this,"_selected",e,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(e){watchJsonArrayString(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}}),uiUxHintMillerscheZahl("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=koliBriQuerySelector(`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&&dispatchDomEvent(this.host,KolEvent.select,t),this.focusTabById(t)}get host(){return this}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}static get style(){return{default:defaultStyleCss}}},[289,"kol-tabs",{_align:[1],_behavior:[1],_hasCreateButton:[4,"_has-create-button"],_label:[1],_on:[16],_selected:[1538],_tabs:[1],state:[32],focus:[64],click:[64]},void 0,{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-tabs"].forEach(e=>{if("kol-tabs"===e)customElements.get(e)||customElements.define(e,KolTabs$1)})}const KolTabs=KolTabs$1,defineCustomElement=defineCustomElement$1;export{KolTabs,defineCustomElement};
|
|
4
|
+
import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{b as watchValidator,d as watchBoolean,n as devHint,s as setState,O as watchNumber,M as watchJsonArrayString,N as uiUxHintMillerscheZahl,U as koliBriQuerySelector}from"./common.js";import{v as validateAlign}from"./align.js";import{v as validateLabel}from"./label.js";import{b as KolButtonWcTag}from"./component-names.js";import{t as translate}from"./i18n.js";import{K as KeyboardKey}from"./keyboard.js";import{c as clsx}from"./clsx.js";import{d as delegateClick,s as setClick}from"./element-click.js";import{d as delegateFocus,s as setFocus}from"./element-focus.js";import{d as dispatchDomEvent,K as KolEvent}from"./events.js";const tabBehaviorPropTypeOptions=["select-automatic","select-manual"],validateTabBehavior=(e,t)=>{watchValidator(e,"_behavior",e=>"string"==typeof e&&tabBehaviorPropTypeOptions.includes(e),new Set([`KoliBriTabBehavior {${tabBehaviorPropTypeOptions.join(", ")}`]),t)},validateHasCreateButton=(e,t)=>{watchBoolean(e,"_hasCreateButton",t)},defaultStyleCss='/* 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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .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=1775135018085"); /* IE9*/\n src: url("kolicons.eot?t=1775135018085#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775135018085") format("woff2"), url("kolicons.woff?t=1775135018085") format("woff"), url("kolicons.ttf?t=1775135018085") format("truetype"), url("kolicons.svg?t=1775135018085#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}',KolTabs$1=proxyCustomElement(class extends HTMLElement{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.onCreateLabel=`${translate("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 KeyboardKey.ArrowRight:this.goToNextTab(e);break;case KeyboardKey.ArrowLeft:this.goToPreviousTab(e);break;case KeyboardKey.Space:case KeyboardKey.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);devHint("[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&&dispatchDomEvent(this.host,KolEvent.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 delegateFocus(this.host,()=>setFocus(this.currentTabButtonRef))}async click(){return delegateClick(this.host,async()=>setClick(this.currentTabButtonRef))}renderButtonGroup(){return h("div",{"aria-label":this.state._label,class:"kol-tabs__button-group",role:"tablist",onKeyDown:this.onKeyDown,onBlur:this.onBlur},this.state._tabs.map((e,t)=>h(KolButtonWcTag,{ref:this.state._selected===t?this.setCurrentTabButtonRef:void 0,_disabled:e._disabled,_icons:e._icons,_hideLabel:e._hideLabel,_label:e._label,_on:this.callbacks,_tabIndex:this.state._selected===t?0:-1,_tooltipAlign:e._tooltipAlign,_variant:this.state._selected===t?"custom":void 0,_customClass:this.state._selected===t?"selected":"",_ariaControls:`tabpanel-${t}`,_ariaSelected:this.state._selected===t,_id:`${this.state._label.replace(/\s/g,"-")}-tab-${t}`,_role:"tab",_value:t})),this.state._hasCreateButton&&h(KolButtonWcTag,{class:"kol-tabs__button-create",_label:this.onCreateLabel,_on:{onClick:this.onCreate},_icons:"kolicon-plus","data-testid":"tabs-create-button"}))}render(){return h("div",{key:"40cde6ced5533ac105935fdd8399f2578f187116",ref:e=>{this.tabPanelsElement=e},class:clsx("kol-tabs",`kol-tabs--align-${this.state._align}`)},this.renderButtonGroup(),h("div",{key:"b2e2655b1aa19615d5167da39db1151033a09462",class:"kol-tabs__content",ref:this.catchTabPanelHost}))}validateAlign(e){validateAlign(this,e)}validateBehavior(e){validateTabBehavior(this,e)}validateHasCreateButton(e){validateHasCreateButton(this,e)}validateLabel(e){validateLabel(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),setState(this,"_on",t)}}validateSelected(e){watchNumber(this,"_selected",e,{hooks:{beforePatch:this.syncSelectedAndTabs}})}validateTabs(e){watchJsonArrayString(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}}),uiUxHintMillerscheZahl("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=koliBriQuerySelector(`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&&dispatchDomEvent(this.host,KolEvent.select,t),this.focusTabById(t)}get host(){return this}static get watchers(){return{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}}static get style(){return{default:defaultStyleCss}}},[289,"kol-tabs",{_align:[1],_behavior:[1],_hasCreateButton:[4,"_has-create-button"],_label:[1],_on:[16],_selected:[1538],_tabs:[1],state:[32],focus:[64],click:[64]},void 0,{_align:["validateAlign"],_behavior:["validateBehavior"],_hasCreateButton:["validateHasCreateButton"],_label:["validateLabel"],_on:["validateOn"],_selected:["validateSelected"],_tabs:["validateTabs"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-tabs"].forEach(e=>{if("kol-tabs"===e)customElements.get(e)||customElements.define(e,KolTabs$1)})}const KolTabs=KolTabs$1,defineCustomElement=defineCustomElement$1;export{KolTabs,defineCustomElement};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h,proxyCustomElement,HTMLElement}from"@stencil/core/internal/client";import{c as clsx}from"./clsx.js";import{a as getMsgType,i as isMsgDefinedAndInputTouched,c as getDefaultProps,g as getRenderStates,F as FormFieldStateWrapper}from"./controller4.js";import{I as InputIconController,a as InputContainerStateWrapperFc}from"./controller-icon.js";import{_ as __rest}from"./tslib.es6.js";import{b as watchValidator,j as watchString}from"./common.js";import{n as nonce}from"./dev.utils.js";import{d as delegateClick,s as setClick}from"./element-click.js";import{d as delegateFocus,s as setFocus}from"./element-focus.js";import{a as validateHasCounter,v as validateMaxLengthBehavior,b as validateMaxLength}from"./max-length-behavior.js";import{v as validatePlaceholder}from"./placeholder.js";import{v as validateReadOnly}from"./read-only.js";import{v as validateRequired}from"./required.js";import{v as validateRows}from"./rows.js";import{v as validateSpellCheck}from"./spell-check.js";const textareaResizeOptions=["vertical","none"],isTextareaResizePropType=e=>"string"==typeof e&&textareaResizeOptions.includes(e),validateResizeTextarea=(e,t)=>{watchValidator(e,"_resize",isTextareaResizePropType,new Set(textareaResizeOptions),t,{defaultValue:"vertical"})},TextAreaFc=e=>{const{class:t,msg:n,touched:a,readonly:o,disabled:i,required:l,ariaDescribedBy:r,hideLabel:s,label:d}=e,c=__rest(e,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),u={"kol-textarea--disabled":Boolean(i),"kol-textarea--required":Boolean(l),"kol-textarea--touched":Boolean(a),"kol-textarea--readonly":Boolean(o),[`kol-textarea--${getMsgType(n)}`]:isMsgDefinedAndInputTouched(n,a)},m=Object.assign(Object.assign({class:clsx("kol-textarea",u,t),required:l,disabled:i,readonly:o},getDefaultProps({ariaDescribedBy:r,hideLabel:s,label:d})),c);return h("textarea",Object.assign({},m))};function getTextAreaProps(e,t){var n;const a=[...getRenderStates(e).ariaDescribedBy,...null!==(n=t.ariaDescribedBy)&&void 0!==n?n:[]],o=Object.assign(Object.assign({id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,touched:e._touched,msg:e._msg},t),{ariaDescribedBy:a});return"_maxLength"in e&&"_maxLengthBehavior"in e&&"hard"===e._maxLengthBehavior&&(o.maxLength=e._maxLength),"_shortKey"in e&&(o["aria-keyshortcuts"]=e._shortKey),o}const TextAreaStateWrapper=e=>{var{state:t}=e,n=__rest(e,["state"]);return h(TextAreaFc,Object.assign({},getTextAreaProps(t,n)))};class TextareaController extends InputIconController{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=e}validateHasCounter(e){validateHasCounter(this.component,e)}validateMaxLengthBehavior(e){validateMaxLengthBehavior(this.component,e)}validateMaxLength(e){validateMaxLength(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePlaceholder(e){validatePlaceholder(this.component,e)}validateReadOnly(e){validateReadOnly(this.component,e)}validateResize(e){validateResizeTextarea(this.component,e)}validateRequired(e){validateRequired(this.component,e)}validateRows(e){validateRows(this.component,e)}validateSpellCheck(e){validateSpellCheck(this.component,e)}validateValue(e){watchString(this.component,"_value",e,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(){super.componentWillLoad(),this.validateHasCounter(this.component._hasCounter),this.validateMaxLengthBehavior(this.component._maxLengthBehavior),this.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateResize(this.component._resize),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const defaultStyleCss='@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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .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=1775124354743"); /* IE9*/\n src: url("kolicons.eot?t=1775124354743#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775124354743") format("woff2"), url("kolicons.woff?t=1775124354743") format("woff"), url("kolicons.ttf?t=1775124354743") format("truetype"), url("kolicons.svg?t=1775124354743#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-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--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text:not(:has(> [name]))::after,\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: "*"/"";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\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-textarea {\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}',increaseTextareaHeight=e=>{e.style.overflow="hidden";const t=e.rows,n=e.clientHeight/t;e.rows=1;const a=Math.round(e.scrollHeight/n);return e.rows=t,a},KolTextarea$1=proxyCustomElement(class extends HTMLElement{async getValue(){var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.value}async focus(){return delegateFocus(this.host,()=>setFocus(this.textareaRef))}async click(){return delegateClick(this.host,async()=>setClick(this.textareaRef))}getFormFieldProps(){return{state:this.state,class:clsx("kol-form-field-textarea",{"kol-form-field--has-value":this.state._hasValue,"kol-form-field--has-counter":this.controller.hasSoftCharacterLimit()||this.controller.hasCounter()}),tooltipAlign:this._tooltipAlign,alert:this.showAsAlert()}}getTextAreaProps(){const e="number"==typeof this.state._maxLength?[`${this.state._id}-character-limit-hint`]:void 0;return Object.assign(Object.assign({ref:this.setTextareaRef,state:this.state,style:{resize:this.state._resize},ariaDescribedBy:e},this.controller.onFacade),{onInput:this.onInput,onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return h(FormFieldStateWrapper,Object.assign({key:"c5d6274603a8eb8f181a1fa740c922aa6979ff45"},this.getFormFieldProps()),h(InputContainerStateWrapperFc,{key:"427fec5fde0c9a6757da521ad6ab1fe4c408d2b9",state:this.state},h(TextAreaStateWrapper,Object.assign({key:"96be1d2f6d44bbece662a5c79aeaa03ece0c5232"},this.getTextAreaProps()))))}constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.setTextareaRef=e=>{this.textareaRef=e},this._adjustHeight=!1,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._hasCounter=!1,this._maxLengthBehavior="hard",this._readOnly=!1,this._resize="vertical",this._required=!1,this._tooltipAlign="top",this._touched=!1,this.state={_adjustHeight:!1,_currentLength:0,_currentLengthDebounced:0,_hasValue:!1,_hideMsg:!1,_id:`id-${nonce()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,this.onInput=e=>{this.textareaRef instanceof HTMLTextAreaElement&&(this._value=this.textareaRef.value,this.state._adjustHeight&&(this._rows=increaseTextareaHeight(this.textareaRef)),this.controller.onFacade.onInput(e))},this.controller=new TextareaController(this,"textarea",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAdjustHeight(e){this.controller.validateAdjustHeight(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateLabel(e){this.controller.validateLabel(e)}validateMaxLength(e){this.controller.validateMaxLength(e)}validateMaxLengthBehavior(e){this.controller.validateMaxLengthBehavior(e)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateReadOnly(e){this.controller.validateReadOnly(e)}validateResize(e){this.controller.validateResize(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSpellCheck(e){this.controller.validateSpellCheck(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentDidLoad(){setTimeout(()=>{var e;!0===this._adjustHeight&&this.textareaRef?this._rows=(null===(e=this.state)||void 0===e?void 0:e._rows)&&this.state._rows>increaseTextareaHeight(this.textareaRef)?this.state._rows:increaseTextareaHeight(this.textareaRef):this._rows||(this._rows=1)})}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener(e=>this.state._hasValue=!!e)}get host(){return this}static get watchers(){return{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}}static get style(){return{default:defaultStyleCss}}},[289,"kol-textarea",{_accessKey:[1,"_access-key"],_adjustHeight:[4,"_adjust-height"],_disabled:[4],_hideMsg:[4,"_hide-msg"],_hideLabel:[4,"_hide-label"],_hint:[1],_icons:[1],_label:[1],_maxLength:[2,"_max-length"],_hasCounter:[4,"_has-counter"],_maxLengthBehavior:[1,"_max-length-behavior"],_msg:[1],_name:[1],_on:[16],_placeholder:[1],_readOnly:[4,"_read-only"],_resize:[1],_required:[4],_rows:[1026],_shortKey:[1,"_short-key"],_spellCheck:[4,"_spell-check"],_syncValueBySelector:[1,"_sync-value-by-selector"],_tooltipAlign:[1,"_tooltip-align"],_touched:[1540],_value:[1537],state:[32],inputHasFocus:[32],getValue:[64],focus:[64],click:[64]},void 0,{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-textarea"].forEach(e=>{if("kol-textarea"===e)customElements.get(e)||customElements.define(e,KolTextarea$1)})}const KolTextarea=KolTextarea$1,defineCustomElement=defineCustomElement$1;export{KolTextarea,defineCustomElement};
|
|
4
|
+
import{h,proxyCustomElement,HTMLElement}from"@stencil/core/internal/client";import{c as clsx}from"./clsx.js";import{a as getMsgType,i as isMsgDefinedAndInputTouched,c as getDefaultProps,g as getRenderStates,F as FormFieldStateWrapper}from"./controller4.js";import{I as InputIconController,a as InputContainerStateWrapperFc}from"./controller-icon.js";import{_ as __rest}from"./tslib.es6.js";import{b as watchValidator,j as watchString}from"./common.js";import{n as nonce}from"./dev.utils.js";import{d as delegateClick,s as setClick}from"./element-click.js";import{d as delegateFocus,s as setFocus}from"./element-focus.js";import{a as validateHasCounter,v as validateMaxLengthBehavior,b as validateMaxLength}from"./max-length-behavior.js";import{v as validatePlaceholder}from"./placeholder.js";import{v as validateReadOnly}from"./read-only.js";import{v as validateRequired}from"./required.js";import{v as validateRows}from"./rows.js";import{v as validateSpellCheck}from"./spell-check.js";const textareaResizeOptions=["vertical","none"],isTextareaResizePropType=e=>"string"==typeof e&&textareaResizeOptions.includes(e),validateResizeTextarea=(e,t)=>{watchValidator(e,"_resize",isTextareaResizePropType,new Set(textareaResizeOptions),t,{defaultValue:"vertical"})},TextAreaFc=e=>{const{class:t,msg:n,touched:a,readonly:o,disabled:i,required:l,ariaDescribedBy:r,hideLabel:s,label:d}=e,c=__rest(e,["class","msg","touched","readonly","disabled","required","ariaDescribedBy","hideLabel","label"]),u={"kol-textarea--disabled":Boolean(i),"kol-textarea--required":Boolean(l),"kol-textarea--touched":Boolean(a),"kol-textarea--readonly":Boolean(o),[`kol-textarea--${getMsgType(n)}`]:isMsgDefinedAndInputTouched(n,a)},m=Object.assign(Object.assign({class:clsx("kol-textarea",u,t),required:l,disabled:i,readonly:o},getDefaultProps({ariaDescribedBy:r,hideLabel:s,label:d})),c);return h("textarea",Object.assign({},m))};function getTextAreaProps(e,t){var n;const a=[...getRenderStates(e).ariaDescribedBy,...null!==(n=t.ariaDescribedBy)&&void 0!==n?n:[]],o=Object.assign(Object.assign({id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,accessKey:e._accessKey,disabled:e._disabled,name:e._name,rows:e._rows,readonly:e._readOnly,required:e._required,placeholder:e._placeholder,touched:e._touched,msg:e._msg},t),{ariaDescribedBy:a});return"_maxLength"in e&&"_maxLengthBehavior"in e&&"hard"===e._maxLengthBehavior&&(o.maxLength=e._maxLength),"_shortKey"in e&&(o["aria-keyshortcuts"]=e._shortKey),o}const TextAreaStateWrapper=e=>{var{state:t}=e,n=__rest(e,["state"]);return h(TextAreaFc,Object.assign({},getTextAreaProps(t,n)))};class TextareaController extends InputIconController{constructor(e,t,n){super(e,t,n),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=e}validateHasCounter(e){validateHasCounter(this.component,e)}validateMaxLengthBehavior(e){validateMaxLengthBehavior(this.component,e)}validateMaxLength(e){validateMaxLength(this.component,e,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePlaceholder(e){validatePlaceholder(this.component,e)}validateReadOnly(e){validateReadOnly(this.component,e)}validateResize(e){validateResizeTextarea(this.component,e)}validateRequired(e){validateRequired(this.component,e)}validateRows(e){validateRows(this.component,e)}validateSpellCheck(e){validateSpellCheck(this.component,e)}validateValue(e){watchString(this.component,"_value",e,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(){super.componentWillLoad(),this.validateHasCounter(this.component._hasCounter),this.validateMaxLengthBehavior(this.component._maxLengthBehavior),this.validateMaxLength(this.component._maxLength),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateResize(this.component._resize),this.validateRows(this.component._rows),this.validateSpellCheck(this.component._spellCheck),this.validateValue(this.component._value)}}const defaultStyleCss='@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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .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=1775135018085"); /* IE9*/\n src: url("kolicons.eot?t=1775135018085#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775135018085") format("woff2"), url("kolicons.woff?t=1775135018085") format("woff"), url("kolicons.ttf?t=1775135018085") format("truetype"), url("kolicons.svg?t=1775135018085#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-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--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text:not(:has(> [name]))::after,\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: "*"/"";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\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-textarea {\n width: 100%;\n }\n .kol-textarea:focus {\n outline: none;\n }\n}',increaseTextareaHeight=e=>{e.style.overflow="hidden";const t=e.rows,n=e.clientHeight/t;e.rows=1;const a=Math.round(e.scrollHeight/n);return e.rows=t,a},KolTextarea$1=proxyCustomElement(class extends HTMLElement{async getValue(){var e;return null===(e=this.textareaRef)||void 0===e?void 0:e.value}async focus(){return delegateFocus(this.host,()=>setFocus(this.textareaRef))}async click(){return delegateClick(this.host,async()=>setClick(this.textareaRef))}getFormFieldProps(){return{state:this.state,class:clsx("kol-form-field-textarea",{"kol-form-field--has-value":this.state._hasValue,"kol-form-field--has-counter":this.controller.hasSoftCharacterLimit()||this.controller.hasCounter()}),tooltipAlign:this._tooltipAlign,alert:this.showAsAlert()}}getTextAreaProps(){const e="number"==typeof this.state._maxLength?[`${this.state._id}-character-limit-hint`]:void 0;return Object.assign(Object.assign({ref:this.setTextareaRef,state:this.state,style:{resize:this.state._resize},ariaDescribedBy:e},this.controller.onFacade),{onInput:this.onInput,onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return h(FormFieldStateWrapper,Object.assign({key:"c5d6274603a8eb8f181a1fa740c922aa6979ff45"},this.getFormFieldProps()),h(InputContainerStateWrapperFc,{key:"427fec5fde0c9a6757da521ad6ab1fe4c408d2b9",state:this.state},h(TextAreaStateWrapper,Object.assign({key:"96be1d2f6d44bbece662a5c79aeaa03ece0c5232"},this.getTextAreaProps()))))}constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.setTextareaRef=e=>{this.textareaRef=e},this._adjustHeight=!1,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._hasCounter=!1,this._maxLengthBehavior="hard",this._readOnly=!1,this._resize="vertical",this._required=!1,this._tooltipAlign="top",this._touched=!1,this.state={_adjustHeight:!1,_currentLength:0,_currentLengthDebounced:0,_hasValue:!1,_hideMsg:!1,_id:`id-${nonce()}`,_label:"",_resize:"vertical"},this.inputHasFocus=!1,this.onInput=e=>{this.textareaRef instanceof HTMLTextAreaElement&&(this._value=this.textareaRef.value,this.state._adjustHeight&&(this._rows=increaseTextareaHeight(this.textareaRef)),this.controller.onFacade.onInput(e))},this.controller=new TextareaController(this,"textarea",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateAdjustHeight(e){this.controller.validateAdjustHeight(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHasCounter(e){this.controller.validateHasCounter(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateLabel(e){this.controller.validateLabel(e)}validateMaxLength(e){this.controller.validateMaxLength(e)}validateMaxLengthBehavior(e){this.controller.validateMaxLengthBehavior(e)}validateMsg(e){this.controller.validateMsg(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validatePlaceholder(e){this.controller.validatePlaceholder(e)}validateReadOnly(e){this.controller.validateReadOnly(e)}validateResize(e){this.controller.validateResize(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSpellCheck(e){this.controller.validateSpellCheck(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentDidLoad(){setTimeout(()=>{var e;!0===this._adjustHeight&&this.textareaRef?this._rows=(null===(e=this.state)||void 0===e?void 0:e._rows)&&this.state._rows>increaseTextareaHeight(this.textareaRef)?this.state._rows:increaseTextareaHeight(this.textareaRef):this._rows||(this._rows=1)})}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener(e=>this.state._hasValue=!!e)}get host(){return this}static get watchers(){return{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}}static get style(){return{default:defaultStyleCss}}},[289,"kol-textarea",{_accessKey:[1,"_access-key"],_adjustHeight:[4,"_adjust-height"],_disabled:[4],_hideMsg:[4,"_hide-msg"],_hideLabel:[4,"_hide-label"],_hint:[1],_icons:[1],_label:[1],_maxLength:[2,"_max-length"],_hasCounter:[4,"_has-counter"],_maxLengthBehavior:[1,"_max-length-behavior"],_msg:[1],_name:[1],_on:[16],_placeholder:[1],_readOnly:[4,"_read-only"],_resize:[1],_required:[4],_rows:[1026],_shortKey:[1,"_short-key"],_spellCheck:[4,"_spell-check"],_syncValueBySelector:[1,"_sync-value-by-selector"],_tooltipAlign:[1,"_tooltip-align"],_touched:[1540],_value:[1537],state:[32],inputHasFocus:[32],getValue:[64],focus:[64],click:[64]},void 0,{_accessKey:["validateAccessKey"],_adjustHeight:["validateAdjustHeight"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hasCounter:["validateHasCounter"],_hint:["validateHint"],_icons:["validateIcons"],_label:["validateLabel"],_maxLength:["validateMaxLength"],_maxLengthBehavior:["validateMaxLengthBehavior"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_placeholder:["validatePlaceholder"],_readOnly:["validateReadOnly"],_resize:["validateResize"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_spellCheck:["validateSpellCheck"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-textarea"].forEach(e=>{if("kol-textarea"===e)customElements.get(e)||customElements.define(e,KolTextarea$1)})}const KolTextarea=KolTextarea$1,defineCustomElement=defineCustomElement$1;export{KolTextarea,defineCustomElement};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h,proxyCustomElement,HTMLElement,Host}from"@stencil/core/internal/client";import{t as translate}from"./i18n.js";import{n as nonce}from"./dev.utils.js";import{p as KolButtonTag}from"./component-names.js";import{K as KolAlertFc}from"./Alert.js";import"./variant-quote.js";import"./component2.js";import"./common.js";import{_ as __rest}from"./tslib.es6.js";import{c as clsx}from"./clsx.js";const ToastItemFc=n=>{var{status:t,toast:e,onClose:o}=n,i=__rest(n,["status","toast","onClose"]);const{type:a,label:s,description:l,variant:r}=e;return h("div",{class:clsx("kol-toast-item",`kol-toast-item--${t}`)},h(KolAlertFc,{class:"kol-toast-item__alert",alert:!0,label:s,level:0,hasCloser:!0,type:a,variant:r||"card",onCloserClick:o},h("div",Object.assign({},i),l)))},defaultStyleCss='@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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .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=1775124354743"); /* IE9*/\n src: url("kolicons.eot?t=1775124354743#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775124354743") format("woff2"), url("kolicons.woff?t=1775124354743") format("woff"), url("kolicons.ttf?t=1775124354743") format("truetype"), url("kolicons.svg?t=1775124354743#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 :host {\n display: flex;\n position: fixed;\n z-index: 200;\n max-width: 90vw;\n flex-direction: column;\n }\n .kol-toast-container__close-all {\n align-self: flex-end;\n }\n}',TRANSITION_TIMEOUT=300,KolToastContainer$1=proxyCustomElement(class extends HTMLElement{constructor(n){super(),!1!==n&&this.__registerHost(),this.__attachShadow(),this.state={_toastStates:[]},this.translateToastCloseAll=translate("kol-toast-close-all"),this.knownRenderFunctions=new Set}async enqueue(n){const t={toast:Object.assign(Object.assign({},n),{variant:"card"}),status:"adding",id:`toast-${nonce()}`};return this.state=Object.assign(Object.assign({},this.state),{_toastStates:[t,...this.state._toastStates]}),setTimeout(()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map(n=>n.id===t.id&&"removing"!==n.status?Object.assign(Object.assign({},n),{status:"settled"}):n)})},300),()=>{this.handleClose(t)}}handleClose(n){this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map(t=>(t.id===n.id&&(t.status="removing"),t))}),setTimeout(()=>{var t,e;this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter(t=>t.id!==n.id)}),null===(e=(t=n.toast).onClose)||void 0===e||e.call(t)},300)}async closeAll(n=!1){if(n)this.state=Object.assign(Object.assign({},this.state),{_toastStates:[]});else{const n=[...this.state._toastStates];this.state=Object.assign(Object.assign({},this.state),{_toastStates:n.map(n=>Object.assign(Object.assign({},n),{status:"removing"}))}),setTimeout(()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter(t=>n.every(n=>n.id!==t.id))}),n.forEach(n=>{var t,e;null===(e=(t=n.toast).onClose)||void 0===e||e.call(t)})},300)}}handleToastRef(n,t){t&&"function"==typeof n.toast.render&&!this.knownRenderFunctions.has(n.toast.render)&&(this.knownRenderFunctions.add(n.toast.render),n.toast.render(t,{close:()=>this.handleClose(n)}))}render(){return h(Host,{key:"8f8256c2e4a929fcef039c3b88058b7aae6df105",class:"kol-toast-container"},this.state._toastStates.length>1&&h(KolButtonTag,{key:"1a72d21da9d3cbd5a65cb6a9c220d37a8e237da8",_label:this.translateToastCloseAll,class:"kol-toast-container__button-close-all",_on:{onClick:()=>{this.closeAll()}}}),this.state._toastStates.map(n=>h(ToastItemFc,{key:n.id,onClose:()=>this.handleClose(n),ref:t=>this.handleToastRef(n,t),toast:n.toast,status:n.status})))}static get style(){return{default:defaultStyleCss}}},[289,"kol-toast-container",{state:[32],enqueue:[64],closeAll:[64]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-toast-container"].forEach(n=>{if("kol-toast-container"===n)customElements.get(n)||customElements.define(n,KolToastContainer$1)})}const KolToastContainer=KolToastContainer$1,defineCustomElement=defineCustomElement$1;export{KolToastContainer,defineCustomElement};
|
|
4
|
+
import{h,proxyCustomElement,HTMLElement,Host}from"@stencil/core/internal/client";import{t as translate}from"./i18n.js";import{n as nonce}from"./dev.utils.js";import{p as KolButtonTag}from"./component-names.js";import{K as KolAlertFc}from"./Alert.js";import"./variant-quote.js";import"./component2.js";import"./common.js";import{_ as __rest}from"./tslib.es6.js";import{c as clsx}from"./clsx.js";const ToastItemFc=n=>{var{status:t,toast:e,onClose:o}=n,i=__rest(n,["status","toast","onClose"]);const{type:a,label:s,description:l,variant:r}=e;return h("div",{class:clsx("kol-toast-item",`kol-toast-item--${t}`)},h(KolAlertFc,{class:"kol-toast-item__alert",alert:!0,label:s,level:0,hasCloser:!0,type:a,variant:r||"card",onCloserClick:o},h("div",Object.assign({},i),l)))},defaultStyleCss='@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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .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=1775135018085"); /* IE9*/\n src: url("kolicons.eot?t=1775135018085#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775135018085") format("woff2"), url("kolicons.woff?t=1775135018085") format("woff"), url("kolicons.ttf?t=1775135018085") format("truetype"), url("kolicons.svg?t=1775135018085#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 :host {\n display: flex;\n position: fixed;\n z-index: 200;\n max-width: 90vw;\n flex-direction: column;\n }\n .kol-toast-container__close-all {\n align-self: flex-end;\n }\n}',TRANSITION_TIMEOUT=300,KolToastContainer$1=proxyCustomElement(class extends HTMLElement{constructor(n){super(),!1!==n&&this.__registerHost(),this.__attachShadow(),this.state={_toastStates:[]},this.translateToastCloseAll=translate("kol-toast-close-all"),this.knownRenderFunctions=new Set}async enqueue(n){const t={toast:Object.assign(Object.assign({},n),{variant:"card"}),status:"adding",id:`toast-${nonce()}`};return this.state=Object.assign(Object.assign({},this.state),{_toastStates:[t,...this.state._toastStates]}),setTimeout(()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map(n=>n.id===t.id&&"removing"!==n.status?Object.assign(Object.assign({},n),{status:"settled"}):n)})},300),()=>{this.handleClose(t)}}handleClose(n){this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.map(t=>(t.id===n.id&&(t.status="removing"),t))}),setTimeout(()=>{var t,e;this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter(t=>t.id!==n.id)}),null===(e=(t=n.toast).onClose)||void 0===e||e.call(t)},300)}async closeAll(n=!1){if(n)this.state=Object.assign(Object.assign({},this.state),{_toastStates:[]});else{const n=[...this.state._toastStates];this.state=Object.assign(Object.assign({},this.state),{_toastStates:n.map(n=>Object.assign(Object.assign({},n),{status:"removing"}))}),setTimeout(()=>{this.state=Object.assign(Object.assign({},this.state),{_toastStates:this.state._toastStates.filter(t=>n.every(n=>n.id!==t.id))}),n.forEach(n=>{var t,e;null===(e=(t=n.toast).onClose)||void 0===e||e.call(t)})},300)}}handleToastRef(n,t){t&&"function"==typeof n.toast.render&&!this.knownRenderFunctions.has(n.toast.render)&&(this.knownRenderFunctions.add(n.toast.render),n.toast.render(t,{close:()=>this.handleClose(n)}))}render(){return h(Host,{key:"8f8256c2e4a929fcef039c3b88058b7aae6df105",class:"kol-toast-container"},this.state._toastStates.length>1&&h(KolButtonTag,{key:"1a72d21da9d3cbd5a65cb6a9c220d37a8e237da8",_label:this.translateToastCloseAll,class:"kol-toast-container__button-close-all",_on:{onClick:()=>{this.closeAll()}}}),this.state._toastStates.map(n=>h(ToastItemFc,{key:n.id,onClose:()=>this.handleClose(n),ref:t=>this.handleToastRef(n,t),toast:n.toast,status:n.status})))}static get style(){return{default:defaultStyleCss}}},[289,"kol-toast-container",{state:[32],enqueue:[64],closeAll:[64]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-toast-container"].forEach(n=>{if("kol-toast-container"===n)customElements.get(n)||customElements.define(n,KolToastContainer$1)})}const KolToastContainer=KolToastContainer$1,defineCustomElement=defineCustomElement$1;export{KolToastContainer,defineCustomElement};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{_ as __rest}from"./tslib.es6.js";import{c as KolLinkWcTag,b as KolButtonWcTag}from"./component-names.js";import{R as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,s as setState}from"./common.js";import{v as validateLabel}from"./label.js";import{K as KeyboardKey}from"./keyboard.js";import{v as validateOrientation}from"./orientation.js";import{d as delegateClick,s as setClick}from"./element-click.js";import{d as delegateFocus,s as setFocus}from"./element-focus.js";const validateToolbarItems=(n,e)=>{emptyStringByArrayHandler(e,()=>{objectObjectHandler(e,()=>{void 0===e&&(e=[]);try{e=parseJson(e)}catch(n){}Array.isArray(e)&&e.every(n=>"object"==typeof n&&null!==n)&&setState(n,"_items",e)})})},defaultStyleCss='@charset "UTF-8";\n/* forward the rem function */\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .hastooltip {\n z-index: 900 !important;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1775124354743"); /* IE9*/\n src: url("kolicons.eot?t=1775124354743#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775124354743") format("woff2"), url("kolicons.woff?t=1775124354743") format("woff"), url("kolicons.ttf?t=1775124354743") format("truetype"), url("kolicons.svg?t=1775124354743#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 :host {\n display: inline-block;\n }\n .kol-link {\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-link::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-link__text {\n flex: 1 0 100%;\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-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n .kol-toolbar--orientation-vertical {\n flex-direction: column;\n align-items: stretch;\n }\n .kol-toolbar--orientation-vertical .kol-span {\n align-items: flex-start;\n }\n .kol-toolbar:focus-within {\n outline: 1px solid;\n outline-offset: 2px;\n }\n}',KolToolbar$1=proxyCustomElement(class extends HTMLElement{constructor(n){super(),!1!==n&&this.__registerHost(),this.__attachShadow(),this.state={_label:"",_items:[]},this.currentIndex=0,this.indexToElement=new Map,this.renderItem=(n,e)=>{const t=this.normalizeItem(n),o=e!==this.currentIndex||(null==t?void 0:t._disabled)?-1:0,i={key:e,class:"button normal kol-toolbar__item",_tabIndex:o,_variant:"normal"},l=n=>{n&&this.indexToElement.set(e,n)};return"link"===t.type?h(KolLinkWcTag,Object.assign({},i,t,{ref:l})):h(KolButtonWcTag,Object.assign({},i,t,{ref:l}))}}async focus(){const n=this.indexToElement.get(this.currentIndex);if(n)return delegateFocus(this.host,()=>setFocus(n))}async click(){const n=this.indexToElement.get(this.currentIndex);if(n)return delegateClick(this.host,async()=>setClick(n))}normalizeItem(n){const{_icons:e,_disabled:t}=n,o=__rest(n,["_icons","_disabled"]);return Object.assign(Object.assign({},o),{_icons:e,_disabled:t})}render(){return h("div",{key:"8f62f1ec70dee0ef9b019813a7a53a762d265ba8",class:`kol-toolbar kol-toolbar--orientation-${this.state._orientation}`,role:"toolbar","aria-label":this.state._label},this.state._items.map(this.renderItem))}validateLabel(n){validateLabel(this,n)}validateItems(n){validateToolbarItems(this,n),this.indexToElement.clear(),this.setFirstEnabledItemIndex()}validateOrientation(n){validateOrientation(this,n)}getCurrentToolbarItem(n){return"number"==typeof n?this.indexToElement.get(n):void 0}setFirstEnabledItemIndex(){var n;this.currentIndex=null===(n=this.state._items)||void 0===n?void 0:n.findIndex(n=>!n._disabled)}handleKeyDown(n){var e,t,o,i;const l=n.code;if(![KeyboardKey.ArrowUp,KeyboardKey.ArrowDown,KeyboardKey.ArrowRight,KeyboardKey.ArrowLeft].includes(l))return;n.preventDefault();const a=(null!==(t=null===(e=this._items)||void 0===e?void 0:e.length)&&void 0!==t?t:0)-1;if(a<0)return;const r=this.currentIndex;let s=r;switch(l){case KeyboardKey.ArrowUp:case KeyboardKey.ArrowLeft:s=r>0?r-1:a;break;case KeyboardKey.ArrowDown:case KeyboardKey.ArrowRight:s=r<a?r+1:0}if(r===s)return;if(null===(i=null===(o=this.state._items)||void 0===o?void 0:o[s])||void 0===i?void 0:i._disabled)return;this.currentIndex=s;const c=this.getCurrentToolbarItem(s);this.host&&(null==c||c.focus())}handleBlur(n){n.target===this.host&&this.setFirstEnabledItemIndex()}componentWillLoad(){this.validateLabel(this._label),this.validateItems(this._items),this.validateOrientation(this._orientation),this.setFirstEnabledItemIndex()}get host(){return this}static get watchers(){return{_label:["validateLabel"],_items:["validateItems"],_orientation:["validateOrientation"]}}static get style(){return{default:defaultStyleCss}}},[289,"kol-toolbar",{_label:[1],_items:[16],_orientation:[1],state:[32],currentIndex:[32],focus:[64],click:[64]},[[0,"keydown","handleKeyDown"],[2,"blur","handleBlur"]],{_label:["validateLabel"],_items:["validateItems"],_orientation:["validateOrientation"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-toolbar"].forEach(n=>{if("kol-toolbar"===n)customElements.get(n)||customElements.define(n,KolToolbar$1)})}const KolToolbar=KolToolbar$1,defineCustomElement=defineCustomElement$1;export{KolToolbar,defineCustomElement};
|
|
4
|
+
import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{_ as __rest}from"./tslib.es6.js";import{c as KolLinkWcTag,b as KolButtonWcTag}from"./component-names.js";import{R as emptyStringByArrayHandler,o as objectObjectHandler,p as parseJson,s as setState}from"./common.js";import{v as validateLabel}from"./label.js";import{K as KeyboardKey}from"./keyboard.js";import{v as validateOrientation}from"./orientation.js";import{d as delegateClick,s as setClick}from"./element-click.js";import{d as delegateFocus,s as setFocus}from"./element-focus.js";const validateToolbarItems=(n,e)=>{emptyStringByArrayHandler(e,()=>{objectObjectHandler(e,()=>{void 0===e&&(e=[]);try{e=parseJson(e)}catch(n){}Array.isArray(e)&&e.every(n=>"object"==typeof n&&null!==n)&&setState(n,"_items",e)})})},defaultStyleCss='@charset "UTF-8";\n/* forward the rem function */\n/*\n* This file defines the layer order for all CSS layers used in KoliBri.\n* The order is important as it determines the cascade priority.\n*\n* Layer order (lowest to highest priority):\n* 1. kol-a11y - Accessibility defaults and requirements\n* 2. kol-global - Global component styles and resets\n* 3. kol-component - Component-specific styles\n* 4. kol-theme-global - Theme-specific global styles\n* 5. kol-theme-component - Theme-specific component styles\n*/\n@layer kol-a11y, kol-global, kol-component, kol-theme-global, kol-theme-component;\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-a11y {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .hastooltip {\n z-index: 900 !important;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1775135018085"); /* IE9*/\n src: url("kolicons.eot?t=1775135018085#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775135018085") format("woff2"), url("kolicons.woff?t=1775135018085") format("woff"), url("kolicons.ttf?t=1775135018085") format("truetype"), url("kolicons.svg?t=1775135018085#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 :host {\n display: inline-block;\n }\n .kol-link {\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-link::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: "";\n }\n .kol-link__text {\n flex: 1 0 100%;\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-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n .kol-toolbar--orientation-vertical {\n flex-direction: column;\n align-items: stretch;\n }\n .kol-toolbar--orientation-vertical .kol-span {\n align-items: flex-start;\n }\n .kol-toolbar:focus-within {\n outline: 1px solid;\n outline-offset: 2px;\n }\n}',KolToolbar$1=proxyCustomElement(class extends HTMLElement{constructor(n){super(),!1!==n&&this.__registerHost(),this.__attachShadow(),this.state={_label:"",_items:[]},this.currentIndex=0,this.indexToElement=new Map,this.renderItem=(n,e)=>{const t=this.normalizeItem(n),o=e!==this.currentIndex||(null==t?void 0:t._disabled)?-1:0,i={key:e,class:"button normal kol-toolbar__item",_tabIndex:o,_variant:"normal"},l=n=>{n&&this.indexToElement.set(e,n)};return"link"===t.type?h(KolLinkWcTag,Object.assign({},i,t,{ref:l})):h(KolButtonWcTag,Object.assign({},i,t,{ref:l}))}}async focus(){const n=this.indexToElement.get(this.currentIndex);if(n)return delegateFocus(this.host,()=>setFocus(n))}async click(){const n=this.indexToElement.get(this.currentIndex);if(n)return delegateClick(this.host,async()=>setClick(n))}normalizeItem(n){const{_icons:e,_disabled:t}=n,o=__rest(n,["_icons","_disabled"]);return Object.assign(Object.assign({},o),{_icons:e,_disabled:t})}render(){return h("div",{key:"8f62f1ec70dee0ef9b019813a7a53a762d265ba8",class:`kol-toolbar kol-toolbar--orientation-${this.state._orientation}`,role:"toolbar","aria-label":this.state._label},this.state._items.map(this.renderItem))}validateLabel(n){validateLabel(this,n)}validateItems(n){validateToolbarItems(this,n),this.indexToElement.clear(),this.setFirstEnabledItemIndex()}validateOrientation(n){validateOrientation(this,n)}getCurrentToolbarItem(n){return"number"==typeof n?this.indexToElement.get(n):void 0}setFirstEnabledItemIndex(){var n;this.currentIndex=null===(n=this.state._items)||void 0===n?void 0:n.findIndex(n=>!n._disabled)}handleKeyDown(n){var e,t,o,i;const l=n.code;if(![KeyboardKey.ArrowUp,KeyboardKey.ArrowDown,KeyboardKey.ArrowRight,KeyboardKey.ArrowLeft].includes(l))return;n.preventDefault();const a=(null!==(t=null===(e=this._items)||void 0===e?void 0:e.length)&&void 0!==t?t:0)-1;if(a<0)return;const r=this.currentIndex;let s=r;switch(l){case KeyboardKey.ArrowUp:case KeyboardKey.ArrowLeft:s=r>0?r-1:a;break;case KeyboardKey.ArrowDown:case KeyboardKey.ArrowRight:s=r<a?r+1:0}if(r===s)return;if(null===(i=null===(o=this.state._items)||void 0===o?void 0:o[s])||void 0===i?void 0:i._disabled)return;this.currentIndex=s;const c=this.getCurrentToolbarItem(s);this.host&&(null==c||c.focus())}handleBlur(n){n.target===this.host&&this.setFirstEnabledItemIndex()}componentWillLoad(){this.validateLabel(this._label),this.validateItems(this._items),this.validateOrientation(this._orientation),this.setFirstEnabledItemIndex()}get host(){return this}static get watchers(){return{_label:["validateLabel"],_items:["validateItems"],_orientation:["validateOrientation"]}}static get style(){return{default:defaultStyleCss}}},[289,"kol-toolbar",{_label:[1],_items:[16],_orientation:[1],state:[32],currentIndex:[32],focus:[64],click:[64]},[[0,"keydown","handleKeyDown"],[2,"blur","handleBlur"]],{_label:["validateLabel"],_items:["validateItems"],_orientation:["validateOrientation"]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-toolbar"].forEach(n=>{if("kol-toolbar"===n)customElements.get(n)||customElements.define(n,KolToolbar$1)})}const KolToolbar=KolToolbar$1,defineCustomElement=defineCustomElement$1;export{KolToolbar,defineCustomElement};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{r as KolTreeItemWcTag}from"./component-names.js";const defaultStyleCss='/* 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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .hastooltip {\n z-index: 900 !important;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1775124354743"); /* IE9*/\n src: url("kolicons.eot?t=1775124354743#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775124354743") format("woff2"), url("kolicons.woff?t=1775124354743") format("woff"), url("kolicons.ttf?t=1775124354743") format("truetype"), url("kolicons.svg?t=1775124354743#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-tree-item__link .kol-link {\n display: inline-flex;\n min-height: var(--a11y-min-size);\n align-items: center;\n text-decoration: none;\n }\n .kol-tree-item__link-inner {\n display: flex;\n align-items: center;\n }\n .kol-tree-item__children {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n .kol-tree-item .kol-span {\n place-items: unset;\n }\n .kol-tree-item__toggle-button, .kol-tree-item__toggle-button-placeholder {\n display: inline-flex;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n }\n .kol-tree-item__text {\n text-decoration: underline;\n }\n}',KolTreeItem$1=proxyCustomElement(class extends HTMLElement{constructor(n){super(),!1!==n&&this.__registerHost(),this.__attachShadow()}async focus(){var n;return Promise.resolve(null===(n=this.element)||void 0===n?void 0:n.focus())}async expand(){var n;return Promise.resolve(null===(n=this.element)||void 0===n?void 0:n.expand())}async collapse(){var n;return Promise.resolve(null===(n=this.element)||void 0===n?void 0:n.collapse())}async isOpen(){var n,e;return null!==(e=await(null===(n=this.element)||void 0===n?void 0:n.isOpen()))&&void 0!==e&&e}render(){return h(KolTreeItemWcTag,{key:"dfba03fe182e5d389ce9ec791e50295a7c2cea5f",_active:this._active,_label:this._label,_open:this._open,_href:this._href,ref:n=>this.element=n},h("slot",{key:"223f505a9c7f9919219ba04cf81a4507820dc176"}))}static get style(){return{default:defaultStyleCss}}},[289,"kol-tree-item",{_active:[4],_label:[1],_open:[4],_href:[1],focus:[64],expand:[64],collapse:[64],isOpen:[64]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-tree-item"].forEach(n=>{if("kol-tree-item"===n)customElements.get(n)||customElements.define(n,KolTreeItem$1)})}const KolTreeItem=KolTreeItem$1,defineCustomElement=defineCustomElement$1;export{KolTreeItem,defineCustomElement};
|
|
4
|
+
import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{r as KolTreeItemWcTag}from"./component-names.js";const defaultStyleCss='/* 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 opacity: 0.5;\n outline: none;\n cursor: not-allowed;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n .hastooltip {\n z-index: 900 !important;\n }\n}\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1775135018085"); /* IE9*/\n src: url("kolicons.eot?t=1775135018085#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1775135018085") format("woff2"), url("kolicons.woff?t=1775135018085") format("woff"), url("kolicons.ttf?t=1775135018085") format("truetype"), url("kolicons.svg?t=1775135018085#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-tree-item__link .kol-link {\n display: inline-flex;\n min-height: var(--a11y-min-size);\n align-items: center;\n text-decoration: none;\n }\n .kol-tree-item__link-inner {\n display: flex;\n align-items: center;\n }\n .kol-tree-item__children {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n .kol-tree-item .kol-span {\n place-items: unset;\n }\n .kol-tree-item__toggle-button, .kol-tree-item__toggle-button-placeholder {\n display: inline-flex;\n min-width: var(--a11y-min-size);\n min-height: var(--a11y-min-size);\n align-items: center;\n justify-content: center;\n }\n .kol-tree-item__text {\n text-decoration: underline;\n }\n}',KolTreeItem$1=proxyCustomElement(class extends HTMLElement{constructor(n){super(),!1!==n&&this.__registerHost(),this.__attachShadow()}async focus(){var n;return Promise.resolve(null===(n=this.element)||void 0===n?void 0:n.focus())}async expand(){var n;return Promise.resolve(null===(n=this.element)||void 0===n?void 0:n.expand())}async collapse(){var n;return Promise.resolve(null===(n=this.element)||void 0===n?void 0:n.collapse())}async isOpen(){var n,e;return null!==(e=await(null===(n=this.element)||void 0===n?void 0:n.isOpen()))&&void 0!==e&&e}render(){return h(KolTreeItemWcTag,{key:"dfba03fe182e5d389ce9ec791e50295a7c2cea5f",_active:this._active,_label:this._label,_open:this._open,_href:this._href,ref:n=>this.element=n},h("slot",{key:"223f505a9c7f9919219ba04cf81a4507820dc176"}))}static get style(){return{default:defaultStyleCss}}},[289,"kol-tree-item",{_active:[4],_label:[1],_open:[4],_href:[1],focus:[64],expand:[64],collapse:[64],isOpen:[64]}]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["kol-tree-item"].forEach(n=>{if("kol-tree-item"===n)customElements.get(n)||customElements.define(n,KolTreeItem$1)})}const KolTreeItem=KolTreeItem$1,defineCustomElement=defineCustomElement$1;export{KolTreeItem,defineCustomElement};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{_ as __rest}from"./tslib.es6-CxX45GIN.js";import{h,F as Fragment}from"./index-
|
|
4
|
+
import{_ as __rest}from"./tslib.es6-CxX45GIN.js";import{h,F as Fragment}from"./index-G8af0_gG.js";import{c as clsx}from"./clsx-COFh-Vc8.js";import{b as KolButtonWcTag}from"./component-names-Dy77vq43.js";import{t as translate}from"./i18n-BVaUp6qp.js";import{b as bem}from"./bem-registry-Bux_TllX.js";import{I as IconFC}from"./component-D3oJtEcp.js";import{K as KolHeadingFc}from"./Heading-D3N3WLAQ.js";const alertBem$1=bem.forBlock("kol-alert"),BEM_CLASS_ALERT__ICON=alertBem$1("icon"),ALERT_ICON_CONFIG={error:{label:translate("kol-error"),icon:"kolicon-alert-error"},info:{label:translate("kol-info"),icon:"kolicon-alert-info"},warning:{label:translate("kol-warning"),icon:"kolicon-alert-warning"},success:{label:translate("kol-success"),icon:"kolicon-alert-success"},default:{label:translate("kol-message"),icon:"kolicon-alert-info"}},AlertIcon=({type:e="default"})=>{const l=ALERT_ICON_CONFIG[e||"default"];return h(Fragment,null,h("span",{class:"visually-hidden"},l.label),h(IconFC,{class:BEM_CLASS_ALERT__ICON,label:"",icons:l.icon}))},alertBem=bem.forBlock("kol-alert"),BEM_CLASS_ALERT__CLOSER=alertBem("closer"),BEM_CLASS_ALERT__CONTENT=alertBem("content"),vibrateOnError=()=>{if("undefined"==typeof navigator||"function"!=typeof navigator.vibrate)return;const e=navigator.userActivation;if(((null==e?void 0:e.isActive)||(null==e?void 0:e.hasBeenActive))&&matchMedia("(any-pointer: coarse)").matches)try{navigator.vibrate([100,75,100,75,100])}catch(e){}},KolAlertFc=(e,l)=>{const{class:a={},alert:t=!1,hasCloser:o=!1,label:r,level:n=0,type:s="default",variant:i="msg",onAlertTimeout:c,onCloserClick:_}=e,m=__rest(e,["class","alert","hasCloser","label","level","type","variant","onAlertTimeout","onCloserClick"]),d=translate("kol-close-alert");t&&(vibrateOnError(),setTimeout(()=>{null==c||c()},1e4));const b=alertBem({hasCloser:!!o,[`type-${s}`]:!0,[`variant-${i}`]:!0}),C=alertBem("heading",{[`h${n}`]:!0}),v=Object.assign({class:clsx(a,b)},m);return h("div",Object.assign({role:t?"alert":void 0},v,{"data-testid":"alert"}),h("div",{class:"kol-alert__container"},h(AlertIcon,{label:r,type:s}),h("div",{class:"kol-alert__container-content"},r&&h(KolHeadingFc,{class:C,level:n,id:"heading"},r),"msg"===i&&h("span",{class:BEM_CLASS_ALERT__CONTENT,"aria-describedby":r?"heading":void 0},l)),o&&h(KolButtonWcTag,{class:BEM_CLASS_ALERT__CLOSER+" kol-close-button","data-testid":"alert-close-button",_ariaDescription:(null==r?void 0:r.trim())||"",_hideLabel:!0,_icons:{left:{icon:"kolicon-cross"}},_label:d,_on:{onClick:_},_tooltipAlign:"left"})),"card"===i&&h("div",{class:BEM_CLASS_ALERT__CONTENT,"aria-describedby":r?"heading":void 0},l))};export{KolAlertFc as K};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert-
|
|
1
|
+
{"version":3,"file":"Alert-Ccw-DwxA.js","sources":["src/functional-components/AlertIcon/AlertIcon.tsx","src/functional-components/Alert/Alert.tsx"],"sourcesContent":["import { Fragment, h, type FunctionalComponent as FC } from '@stencil/core';\nimport { translate } from '../../i18n';\nimport { IconFC } from '../../internal/functional-components/icon/component';\nimport type { AlertType } from '../../schema';\nimport { bem } from '../../schema/bem-registry';\n\nconst alertBem = bem.forBlock('kol-alert');\nconst BEM_CLASS_ALERT__ICON = alertBem('icon');\n\n/**\n * The icon uses a visually-hidden span instead of an aria-label because the Alert might be referenced as content for aria-describedby.\n * In this scenario, Firefox with NVDA does not properly read the aria-label, so the visually-hidden span ensures correct screen reader behavior.\n * @see https://github.com/public-ui/kolibri/issues/7119\n */\nconst ALERT_ICON_CONFIG: Record<AlertType | 'default', { label: string; icon: string }> = {\n\terror: {\n\t\tlabel: translate('kol-error'),\n\t\ticon: 'kolicon-alert-error',\n\t},\n\tinfo: {\n\t\tlabel: translate('kol-info'),\n\t\ticon: 'kolicon-alert-info',\n\t},\n\twarning: {\n\t\tlabel: translate('kol-warning'),\n\t\ticon: 'kolicon-alert-warning',\n\t},\n\tsuccess: {\n\t\tlabel: translate('kol-success'),\n\t\ticon: 'kolicon-alert-success',\n\t},\n\tdefault: {\n\t\tlabel: translate('kol-message'),\n\t\ticon: 'kolicon-alert-info',\n\t},\n};\n\nconst AlertIcon: FC<{ label?: string; type?: AlertType }> = ({ type = 'default' }) => {\n\tconst config = ALERT_ICON_CONFIG[type || 'default'];\n\treturn (\n\t\t<>\n\t\t\t<span class=\"visually-hidden\">{config.label}</span>\n\t\t\t<IconFC class={BEM_CLASS_ALERT__ICON} label=\"\" icons={config.icon} />\n\t\t</>\n\t);\n};\n\nexport default AlertIcon;\n","import { h, type FunctionalComponent as FC } from '@stencil/core';\nimport { type JSXBase } from '@stencil/core/internal';\nimport clsx from '../../utils/clsx';\n\nimport { KolButtonWcTag } from '../../core/component-names';\nimport { translate } from '../../i18n';\nimport { type InternalAlertProps } from '../../schema';\nimport { bem } from '../../schema/bem-registry';\nimport AlertIcon from '../AlertIcon';\nimport KolHeadingFc from '../Heading';\n\nconst alertBem = bem.forBlock('kol-alert');\nconst BEM_CLASS_ALERT__CLOSER = alertBem('closer');\nconst BEM_CLASS_ALERT__CONTENT = alertBem('content');\n\nexport type KolAlertFcProps = JSXBase.HTMLAttributes<HTMLDivElement> &\n\tPartial<Omit<InternalAlertProps, 'on'>> & {\n\t\tonCloserClick?: () => void;\n\t\tonAlertTimeout?: () => void;\n\t};\n\n/**\n * - https://developer.mozilla.org/de/docs/Web/API/Navigator/vibrate\n * - https://googlechrome.github.io/samples/vibration/\n * - Ongoing discussion: https://github.com/public-ui/kolibri/issues/7191\n * @todo Move side-effect out of render-function to avoid multiple incarnations.\n */\nconst vibrateOnError = (): void => {\n\tif (typeof navigator === 'undefined' || typeof navigator.vibrate !== 'function') {\n\t\treturn;\n\t}\n\tconst ua = navigator.userActivation;\n\tconst hasGesture = ua?.isActive || ua?.hasBeenActive;\n\tif (!hasGesture) {\n\t\treturn;\n\t}\n\tif (!matchMedia('(any-pointer: coarse)').matches) {\n\t\treturn;\n\t}\n\ttry {\n\t\tnavigator.vibrate([100, 75, 100, 75, 100]);\n\t} catch {\n\t\t/* no-op */\n\t}\n};\n\nconst KolAlertFc: FC<KolAlertFcProps> = (props, children) => {\n\tconst {\n\t\tclass: classNames = {},\n\t\talert = false,\n\t\thasCloser = false,\n\t\tlabel,\n\t\tlevel = 0,\n\t\ttype = 'default',\n\t\tvariant = 'msg',\n\t\tonAlertTimeout,\n\t\tonCloserClick,\n\t\t...other\n\t} = props;\n\n\tconst translateCloseAlert = translate('kol-close-alert');\n\n\tif (alert) {\n\t\tvibrateOnError();\n\n\t\tsetTimeout(() => {\n\t\t\tonAlertTimeout?.();\n\t\t}, 10000);\n\t}\n\n\t/**\n\t * Define the dynamic BEM class names for the alert component.\n\t */\n\tconst BEM_CLASS_ROOT = alertBem({\n\t\thasCloser: !!hasCloser,\n\t\t[`type-${type}`]: true,\n\t\t[`variant-${variant}`]: true,\n\t});\n\tconst BEM_CLASS__HEADING = alertBem('heading', {\n\t\t[`h${level}`]: true,\n\t});\n\n\tconst rootProps: Partial<JSXBase.HTMLAttributes<HTMLDivElement>> = {\n\t\tclass: clsx(classNames, BEM_CLASS_ROOT),\n\t\t...other,\n\t};\n\n\treturn (\n\t\t<div role={alert ? 'alert' : undefined} {...rootProps} data-testid=\"alert\">\n\t\t\t<div class=\"kol-alert__container\">\n\t\t\t\t<AlertIcon label={label} type={type} />\n\t\t\t\t<div class=\"kol-alert__container-content\">\n\t\t\t\t\t{label && (\n\t\t\t\t\t\t<KolHeadingFc class={BEM_CLASS__HEADING} level={level} id=\"heading\">\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</KolHeadingFc>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'msg' && (\n\t\t\t\t\t\t<span class={BEM_CLASS_ALERT__CONTENT} aria-describedby={label ? 'heading' : undefined}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t{hasCloser && (\n\t\t\t\t\t<KolButtonWcTag\n\t\t\t\t\t\tclass={BEM_CLASS_ALERT__CLOSER + ' kol-close-button'}\n\t\t\t\t\t\tdata-testid=\"alert-close-button\"\n\t\t\t\t\t\t_ariaDescription={label?.trim() || ''}\n\t\t\t\t\t\t_hideLabel\n\t\t\t\t\t\t_icons={{\n\t\t\t\t\t\t\tleft: {\n\t\t\t\t\t\t\t\ticon: 'kolicon-cross',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t_label={translateCloseAlert}\n\t\t\t\t\t\t_on={{ onClick: onCloserClick }}\n\t\t\t\t\t\t_tooltipAlign=\"left\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{variant === 'card' && (\n\t\t\t\t<div class={BEM_CLASS_ALERT__CONTENT} aria-describedby={label ? 'heading' : undefined}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default KolAlertFc;\n"],"names":["alertBem"],"mappings":";;;;;;;;;;;;AAMA,MAAMA,UAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC;AAC1C,MAAM,qBAAqB,GAAGA,UAAQ,CAAC,MAAM,CAAC;AAO9C,MAAM,iBAAiB,GAAmE;AACzF,IAAA,KAAK,EAAE;AACN,QAAA,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC;AAC7B,QAAA,IAAI,EAAE,qBAAqB;AAC3B,KAAA;AACD,IAAA,IAAI,EAAE;AACL,QAAA,KAAK,EAAE,SAAS,CAAC,UAAU,CAAC;AAC5B,QAAA,IAAI,EAAE,oBAAoB;AAC1B,KAAA;AACD,IAAA,OAAO,EAAE;AACR,QAAA,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC;AAC/B,QAAA,IAAI,EAAE,uBAAuB;AAC7B,KAAA;AACD,IAAA,OAAO,EAAE;AACR,QAAA,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC;AAC/B,QAAA,IAAI,EAAE,uBAAuB;AAC7B,KAAA;AACD,IAAA,OAAO,EAAE;AACR,QAAA,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC;AAC/B,QAAA,IAAI,EAAE,oBAAoB;AAC1B,KAAA;CACD;AAED,MAAM,SAAS,GAA6C,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,KAAI;IACpF,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,IAAI,SAAS,CAAC;IACnD,QACC,CAAA,CAAA,QAAA,EAAA,IAAA,EACC,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,iBAAiB,IAAE,MAAM,CAAC,KAAK,CAAQ,EACnD,CAAA,CAAC,MAAM,EAAC,EAAA,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,EAAE,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAI,CAAA,CACnE;AAEL,CAAC;;AClCD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC;AAC1C,MAAM,uBAAuB,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAClD,MAAM,wBAAwB,GAAG,QAAQ,CAAC,SAAS,CAAC;AAcpD,MAAM,cAAc,GAAG,MAAW;AACjC,IAAA,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,OAAO,SAAS,CAAC,OAAO,KAAK,UAAU,EAAE;QAChF;;AAED,IAAA,MAAM,EAAE,GAAG,SAAS,CAAC,cAAc;IACnC,MAAM,UAAU,GAAG,CAAA,EAAE,KAAF,IAAA,IAAA,EAAE,uBAAF,EAAE,CAAE,QAAQ,MAAI,EAAE,aAAF,EAAE,KAAA,MAAA,GAAA,MAAA,GAAF,EAAE,CAAE,aAAa,CAAA;IACpD,IAAI,CAAC,UAAU,EAAE;QAChB;;IAED,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC,OAAO,EAAE;QACjD;;AAED,IAAA,IAAI;AACH,QAAA,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;;IACzC,OAAA,EAAA,EAAM;;AAGT,CAAC;AAED,MAAM,UAAU,GAAwB,CAAC,KAAK,EAAE,QAAQ,KAAI;AAC3D,IAAA,MAAM,EACL,KAAK,EAAE,UAAU,GAAG,EAAE,EACtB,KAAK,GAAG,KAAK,EACb,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,KAAK,GAAG,CAAC,EACT,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,KAAK,EACf,cAAc,EACd,aAAa,EAEV,GAAA,KAAK,EADL,KAAK,GAAA,MAAA,CACL,KAAK,EAXH,CAAA,OAAA,EAAA,OAAA,EAAA,WAAA,EAAA,OAAA,EAAA,OAAA,EAAA,MAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,eAAA,CAWL,CAAQ;AAET,IAAA,MAAM,mBAAmB,GAAG,SAAS,CAAC,iBAAiB,CAAC;IAExD,IAAI,KAAK,EAAE;AACV,QAAA,cAAc,EAAE;QAEhB,UAAU,CAAC,MAAK;AACf,YAAA,cAAc,KAAd,IAAA,IAAA,cAAc,KAAd,MAAA,GAAA,MAAA,GAAA,cAAc,EAAI;SAClB,EAAE,KAAK,CAAC;;IAMV,MAAM,cAAc,GAAG,QAAQ,CAAC;QAC/B,SAAS,EAAE,CAAC,CAAC,SAAS;AACtB,QAAA,CAAC,CAAQ,KAAA,EAAA,IAAI,CAAE,CAAA,GAAG,IAAI;AACtB,QAAA,CAAC,CAAW,QAAA,EAAA,OAAO,CAAE,CAAA,GAAG,IAAI;AAC5B,KAAA,CAAC;AACF,IAAA,MAAM,kBAAkB,GAAG,QAAQ,CAAC,SAAS,EAAE;AAC9C,QAAA,CAAC,CAAI,CAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AACnB,KAAA,CAAC;AAEF,IAAA,MAAM,SAAS,GAAA,MAAA,CAAA,MAAA,CAAA,EACd,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EACpC,EAAA,KAAK,CACR;AAED,IAAA,QACC,CAAK,CAAA,KAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,EAAM,EAAA,SAAS,mBAAc,OAAO,EAAA,CAAA,EACzE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,sBAAsB,EAAA,EAChC,CAAC,CAAA,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAI,CAAA,EACvC,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,8BAA8B,EAAA,EACvC,KAAK,KACL,CAAA,CAAC,YAAY,EAAC,EAAA,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAC,SAAS,EACjE,EAAA,KAAK,CACQ,CACf,EACA,OAAO,KAAK,KAAK,KACjB,YAAM,KAAK,EAAE,wBAAwB,EAAA,kBAAA,EAAoB,KAAK,GAAG,SAAS,GAAG,SAAS,EACpF,EAAA,QAAQ,CACH,CACP,CACI,EACL,SAAS,KACT,CAAC,CAAA,cAAc,EACd,EAAA,KAAK,EAAE,uBAAuB,GAAG,mBAAmB,EACxC,aAAA,EAAA,oBAAoB,EAChC,gBAAgB,EAAE,CAAA,KAAK,KAAL,IAAA,IAAA,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,IAAI,EAAE,KAAI,EAAE,EACrC,UAAU,EAAA,IAAA,EACV,MAAM,EAAE;AACP,YAAA,IAAI,EAAE;AACL,gBAAA,IAAI,EAAE,eAAe;AACrB,aAAA;SACD,EACD,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,EAC/B,aAAa,EAAC,MAAM,EAAA,CACnB,CACF,CACI,EACL,OAAO,KAAK,MAAM,KAClB,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,wBAAwB,EAAoB,kBAAA,EAAA,KAAK,GAAG,SAAS,GAAG,SAAS,EAAA,EACnF,QAAQ,CACJ,CACN,CACI;AAER;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{_ as __rest}from"./tslib.es6-CxX45GIN.js";import{h}from"./index-
|
|
4
|
+
import{_ as __rest}from"./tslib.es6-CxX45GIN.js";import{h}from"./index-G8af0_gG.js";import{b as KolButtonWcTag}from"./component-names-Dy77vq43.js";import{c as clsx}from"./clsx-COFh-Vc8.js";import{K as KolHeadingFc}from"./Heading-D3N3WLAQ.js";const KolCollapsibleFc=(l,o)=>{const{id:s,class:i,label:a,level:e=1,disabled:n,open:c,onClick:r,HeadingProps:d={},HeadingButtonProps:t={},ContentProps:p={}}=l,_=__rest(l,["id","class","label","level","disabled","open","onClick","HeadingProps","HeadingButtonProps","ContentProps"]),b=c?"kolicon-chevron-down":"kolicon-chevron-right";return h("div",Object.assign({id:s,class:clsx("collapsible",{"collapsible--disabled":!0===n,"collapsible--open":!0===c},i)},_),h(KolHeadingFc,{ref:null==d?void 0:d.ref,level:e,class:clsx("collapsible__heading",null==d?void 0:d.class)},h(KolButtonWcTag,{class:clsx("collapsible__heading-button",null==t?void 0:t.class),ref:null==t?void 0:t.ref,slot:"expert",_ariaControls:`${s}-control`,_ariaExpanded:c,_disabled:n,_icons:(null==t?void 0:t._icons)||`${b}`,_label:a,_on:{onClick:r}})),h("div",{class:clsx("collapsible__wrapper",null==p?void 0:p.wrapperClass)},h("div",{class:clsx("collapsible__wrapper-animation",null==p?void 0:p.animationClass)},h("div",{"aria-hidden":!1===c?"true":void 0,class:clsx("collapsible__content",null==p?void 0:p.class),id:`${s}-control`},o))))};export{KolCollapsibleFc as K};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collapsible-
|
|
1
|
+
{"version":3,"file":"Collapsible-C8qbIZUD.js","sources":["src/functional-components/Collapsible/Collapsible.tsx"],"sourcesContent":["import type { FunctionalComponent as FC } from '@stencil/core';\nimport { h } from '@stencil/core';\nimport type { JSXBase } from '@stencil/core/internal';\nimport { KolButtonWcTag } from '../../core/component-names';\nimport type { EventValueOrEventCallback, HeadingLevel, IconsPropType, StencilUnknown } from '../../schema';\nimport clsx from '../../utils/clsx';\nimport KolHeadingFc from '../Heading';\n\ntype ClassType =\n\t| string\n\t| {\n\t\t\t[className: string]: boolean;\n\t };\n\nexport type CollapsibleProps = Omit<JSXBase.HTMLAttributes<HTMLElement>, 'id' | 'onClick'> & {\n\tid: string;\n\topen?: boolean;\n\tdisabled?: boolean;\n\tlevel?: HeadingLevel;\n\tlabel: string;\n\tonClick?: EventValueOrEventCallback<MouseEvent, StencilUnknown>;\n\n\tHeadingProps?: {\n\t\tref?: ((elm?: HTMLElement | undefined) => void) | undefined;\n\t\tclass?: ClassType;\n\t};\n\n\tHeadingButtonProps?: {\n\t\tref?: ((elm?: HTMLKolButtonWcElement | undefined) => void) | undefined;\n\t\tclass?: ClassType;\n\t\t_icons?: IconsPropType;\n\t};\n\n\tContentProps?: {\n\t\tclass?: ClassType;\n\t\tanimationClass?: ClassType;\n\t\twrapperClass?: ClassType;\n\t};\n};\n\nconst KolCollapsibleFc: FC<CollapsibleProps> = (props, children) => {\n\tconst { id, class: classNames, label, level = 1, disabled, open, onClick, HeadingProps = {}, HeadingButtonProps = {}, ContentProps = {}, ...other } = props;\n\tconst icon = open ? 'kolicon-chevron-down' : 'kolicon-chevron-right';\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclass={clsx(\n\t\t\t\t'collapsible',\n\t\t\t\t{\n\t\t\t\t\t'collapsible--disabled': disabled === true,\n\t\t\t\t\t'collapsible--open': open === true,\n\t\t\t\t},\n\t\t\t\tclassNames,\n\t\t\t)}\n\t\t\t{...other}\n\t\t>\n\t\t\t<KolHeadingFc ref={HeadingProps?.ref} level={level} class={clsx('collapsible__heading', HeadingProps?.class)}>\n\t\t\t\t<KolButtonWcTag\n\t\t\t\t\tclass={clsx('collapsible__heading-button', HeadingButtonProps?.class)}\n\t\t\t\t\tref={HeadingButtonProps?.ref}\n\t\t\t\t\tslot=\"expert\"\n\t\t\t\t\t_ariaControls={`${id}-control`}\n\t\t\t\t\t_ariaExpanded={open}\n\t\t\t\t\t_disabled={disabled}\n\t\t\t\t\t_icons={HeadingButtonProps?._icons || `${icon}`}\n\t\t\t\t\t_label={label}\n\t\t\t\t\t_on={{ onClick }}\n\t\t\t\t></KolButtonWcTag>\n\t\t\t</KolHeadingFc>\n\t\t\t<div class={clsx('collapsible__wrapper', ContentProps?.wrapperClass)}>\n\t\t\t\t<div class={clsx('collapsible__wrapper-animation', ContentProps?.animationClass)}>\n\t\t\t\t\t<div aria-hidden={open === false ? 'true' : undefined} class={clsx('collapsible__content', ContentProps?.class)} id={`${id}-control`}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default KolCollapsibleFc;\n"],"names":[],"mappings":";;;;;;;;;AAwCA,MAAM,gBAAgB,GAAyB,CAAC,KAAK,EAAE,QAAQ,KAAI;AAClE,IAAA,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,GAAG,EAAE,EAAE,kBAAkB,GAAG,EAAE,EAAE,YAAY,GAAG,EAAE,EAAe,GAAA,KAAK,EAAf,KAAK,GAAA,MAAA,CAAK,KAAK,EAArJ,CAAA,IAAA,EAAA,OAAA,EAAA,OAAA,EAAA,OAAA,EAAA,UAAA,EAAA,MAAA,EAAA,SAAA,EAAA,cAAA,EAAA,oBAAA,EAAA,cAAA,CAA6I,CAAQ;IAC3J,MAAM,IAAI,GAAG,IAAI,GAAG,sBAAsB,GAAG,uBAAuB;AAEpE,IAAA,QACC,CACC,CAAA,KAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,IAAI,CACV,aAAa,EACb;YACC,uBAAuB,EAAE,QAAQ,KAAK,IAAI;YAC1C,mBAAmB,EAAE,IAAI,KAAK,IAAI;AAClC,SAAA,EACD,UAAU,CACV,EAAA,EACG,KAAK,CAAA,EAET,CAAA,CAAC,YAAY,EAAA,EAAC,GAAG,EAAE,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,KAAK,CAAC,EAAA,EAC3G,CAAA,CAAC,cAAc,EAAA,EACd,KAAK,EAAE,IAAI,CAAC,6BAA6B,EAAE,kBAAkB,KAAlB,IAAA,IAAA,kBAAkB,KAAlB,MAAA,GAAA,MAAA,GAAA,kBAAkB,CAAE,KAAK,CAAC,EACrE,GAAG,EAAE,kBAAkB,KAAlB,IAAA,IAAA,kBAAkB,uBAAlB,kBAAkB,CAAE,GAAG,EAC5B,IAAI,EAAC,QAAQ,EACb,aAAa,EAAE,CAAA,EAAG,EAAE,CAAA,QAAA,CAAU,EAC9B,aAAa,EAAE,IAAI,EACnB,SAAS,EAAE,QAAQ,EACnB,MAAM,EAAE,CAAA,kBAAkB,KAAA,IAAA,IAAlB,kBAAkB,KAAlB,MAAA,GAAA,MAAA,GAAA,kBAAkB,CAAE,MAAM,KAAI,CAAA,EAAG,IAAI,CAAE,CAAA,EAC/C,MAAM,EAAE,KAAK,EACb,GAAG,EAAE,EAAE,OAAO,EAAE,GACC,CACJ,EACf,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,YAAY,CAAC,EAAA,EACnE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,IAAI,CAAC,gCAAgC,EAAE,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,cAAc,CAAC,EAAA,EAC/E,CAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAkB,IAAI,KAAK,KAAK,GAAG,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,KAAZ,IAAA,IAAA,YAAY,uBAAZ,YAAY,CAAE,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAA,QAAA,CAAU,IAClI,QAAQ,CACJ,CACD,CACD,CACD;AAER;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
import{h}from"./index-
|
|
4
|
+
import{h}from"./index-G8af0_gG.js";import{c as clsx}from"./clsx-COFh-Vc8.js";const CustomSuggestionsOptionFc=({disabled:o,index:s,ref:e,selected:n,onClick:t,onMouseOver:i,onFocus:u,onKeyDown:l,option:r,searchTerm:c})=>h("li",{id:`option-${s}`,key:`-${s}`,ref:e,"data-index":s,tabIndex:-1,role:"option","aria-selected":n?"true":void 0,"aria-disabled":o?"true":void 0,onClick:t,onMouseOver:i,onFocus:u,class:clsx("kol-custom-suggestions-option",{"kol-custom-suggestions-option--disabled":o}),onKeyDown:l},h("span",null,((o,s)=>{if(!(null==s?void 0:s.trim()))return o;const e=new RegExp(`(${s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return o.split(e).map((o,s)=>s%2==1?h("mark",null,o):o)})(String(r),c||""))),CustomSuggestionsOptionsGroupFc=({blockSuggestionMouseOver:o,onKeyDown:s,style:e,hidden:n},t)=>h("ul",{role:"listbox",style:e,class:clsx("kol-custom-suggestions-options-group",{"kol-custom-suggestions-options-group--cursor-hidden":o,"kol-custom-suggestions-options-group--open":!n}),hidden:n,onKeyDown:s},t);export{CustomSuggestionsOptionsGroupFc as C,CustomSuggestionsOptionFc as a};
|