@public-ui/components 3.0.1 → 3.0.2-1e1d8522b9f6826d286c64e7859e0ac6d14b13a9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -8
- package/custom-elements.json +149 -1
- package/dist/cjs/Alert-95d222c3.js +4 -0
- package/dist/cjs/Alert-95d222c3.js.map +1 -0
- package/dist/cjs/{Collapsible-5aa541cb.js → Collapsible-27685355.js} +1 -1
- package/dist/cjs/{Collapsible-5aa541cb.js.map → Collapsible-27685355.js.map} +1 -1
- package/dist/cjs/CustomSuggestionsOptionsGroup-faff6757.js +4 -0
- package/dist/cjs/CustomSuggestionsOptionsGroup-faff6757.js.map +1 -0
- package/dist/cjs/{FieldControlStateWrapper-18976ee0.js → FieldControlStateWrapper-1f9f63c3.js} +1 -1
- package/dist/cjs/{FieldControlStateWrapper-18976ee0.js.map → FieldControlStateWrapper-1f9f63c3.js.map} +1 -1
- package/dist/cjs/{Heading-90ce384c.js → Heading-9f8e6122.js} +1 -1
- package/dist/cjs/{Heading-90ce384c.js.map → Heading-9f8e6122.js.map} +1 -1
- package/dist/cjs/Icon-363ceed6.js +4 -0
- package/dist/cjs/{Icon-add098ba.js.map → Icon-363ceed6.js.map} +1 -1
- package/dist/cjs/{Input-4af8f547.js → Input-2cae1c79.js} +1 -1
- package/dist/cjs/{Input-4af8f547.js.map → Input-2cae1c79.js.map} +1 -1
- package/dist/cjs/{InputStateWrapper-587d58dd.js → InputStateWrapper-e5f8a125.js} +1 -1
- package/dist/cjs/{InputStateWrapper-587d58dd.js.map → InputStateWrapper-e5f8a125.js.map} +1 -1
- package/dist/cjs/{InternalUnderlinedBadgeText-63e8b102.js → InternalUnderlinedBadgeText-fae7644a.js} +1 -1
- package/dist/cjs/{InternalUnderlinedBadgeText-63e8b102.js.map → InternalUnderlinedBadgeText-fae7644a.js.map} +1 -1
- package/dist/cjs/{Span-cd26b541.js → Span-e67cc75c.js} +1 -1
- package/dist/cjs/{Span-cd26b541.js.map → Span-e67cc75c.js.map} +1 -1
- package/dist/cjs/align-floating-elements-8ddb8593.js +4 -0
- package/dist/cjs/align-floating-elements-8ddb8593.js.map +1 -0
- package/dist/cjs/{app-globals-81f95eac.js → app-globals-9ceafddc.js} +1 -1
- package/dist/cjs/{app-globals-81f95eac.js.map → app-globals-9ceafddc.js.map} +1 -1
- package/dist/cjs/{associated.controller-03ae298d.js → associated.controller-7b651bde.js} +1 -1
- package/dist/cjs/{associated.controller-03ae298d.js.map → associated.controller-7b651bde.js.map} +1 -1
- package/dist/cjs/{bootstrap-e11bb4f7.js → bootstrap-0ea93cf5.js} +1 -1
- package/dist/cjs/{bootstrap-e11bb4f7.js.map → bootstrap-0ea93cf5.js.map} +1 -1
- package/dist/cjs/component-names-1cb5b7ce.js +4 -0
- package/dist/cjs/component-names-1cb5b7ce.js.map +1 -0
- package/dist/cjs/{controller-ead08764.js → controller-2ac6da6b.js} +1 -1
- package/dist/cjs/{controller-ead08764.js.map → controller-2ac6da6b.js.map} +1 -1
- package/dist/cjs/{controller-61f2f5b4.js → controller-58d062d3.js} +1 -1
- package/dist/cjs/{controller-61f2f5b4.js.map → controller-58d062d3.js.map} +1 -1
- package/dist/cjs/{controller-cb68b652.js → controller-75a14bc0.js} +1 -1
- package/dist/cjs/{controller-cb68b652.js.map → controller-75a14bc0.js.map} +1 -1
- package/dist/cjs/{controller-b2da8abe.js → controller-e1671afc.js} +1 -1
- package/dist/cjs/{controller-b2da8abe.js.map → controller-e1671afc.js.map} +1 -1
- package/dist/cjs/{controller-icon-429a5f31.js → controller-icon-570b1854.js} +1 -1
- package/dist/cjs/{controller-icon-429a5f31.js.map → controller-icon-570b1854.js.map} +1 -1
- package/dist/cjs/{dev.utils-6759aaf5.js → dev.utils-dcfea774.js} +1 -1
- package/dist/cjs/{dev.utils-6759aaf5.js.map → dev.utils-dcfea774.js.map} +1 -1
- package/dist/cjs/{devtools-3485dda6.js → devtools-65916bdb.js} +1 -1
- package/dist/cjs/{devtools-3485dda6.js.map → devtools-65916bdb.js.map} +1 -1
- package/dist/cjs/{getRenderStates-8372d842.js → getRenderStates-d82906ff.js} +1 -1
- package/dist/cjs/{getRenderStates-8372d842.js.map → getRenderStates-d82906ff.js.map} +1 -1
- package/dist/cjs/index-77bc3aef.js +4 -0
- package/dist/cjs/index-77bc3aef.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
- package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kol-alert-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-alert-wc.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-alert.cjs.entry.js +1 -1
- package/dist/cjs/kol-avatar-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-avatar.cjs.entry.js +1 -1
- package/dist/cjs/kol-badge.cjs.entry.js +1 -1
- package/dist/cjs/kol-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/kol-button-link.cjs.entry.js +1 -1
- package/dist/cjs/kol-button-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-button-wc.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-button.cjs.entry.js +1 -1
- package/dist/cjs/kol-card-wc.cjs.entry.js +4 -0
- package/dist/cjs/kol-card-wc.cjs.entry.js.map +1 -0
- package/dist/cjs/kol-card.cjs.entry.js +1 -1
- package/dist/cjs/kol-card.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-combobox.cjs.entry.js +1 -1
- package/dist/cjs/kol-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-details.cjs.entry.js +1 -1
- package/dist/cjs/kol-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kol-drawer.cjs.entry.js.map +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-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-image.cjs.entry.js +1 -1
- package/dist/cjs/kol-image.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
- package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
- package/dist/cjs/kol-link-button.cjs.entry.js +1 -1
- package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-link.cjs.entry.js +1 -1
- package/dist/cjs/kol-modal.cjs.entry.js +1 -1
- package/dist/cjs/kol-nav.cjs.entry.js +1 -1
- package/dist/cjs/kol-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-pagination-wc.cjs.entry.js +4 -0
- package/dist/cjs/kol-pagination-wc.cjs.entry.js.map +1 -0
- package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
- package/dist/cjs/kol-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-popover-button-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-popover-button-wc.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-popover-button.cjs.entry.js +1 -1
- package/dist/cjs/kol-popover-button.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-popover-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-progress.cjs.entry.js +1 -1
- package/dist/cjs/kol-quote.cjs.entry.js +1 -1
- package/dist/cjs/kol-select.cjs.entry.js +1 -1
- package/dist/cjs/kol-single-select.cjs.entry.js +1 -1
- package/dist/cjs/kol-single-select.cjs.entry.js.map +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-split-button.cjs.entry.js.map +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-stateful.cjs.entry.js.map +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-table-stateless.cjs.entry.js.map +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-tooltip-wc.cjs.entry.js.map +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/Alert.js +1 -1
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/CustomSuggestionsOptionsGroup.js +1 -1
- package/dist/components/CustomSuggestionsOptionsGroup.js.map +1 -1
- package/dist/components/align-floating-elements.js +1 -1
- package/dist/components/align-floating-elements.js.map +1 -1
- package/dist/components/component-names.js +1 -1
- package/dist/components/component-names.js.map +1 -1
- package/dist/components/kol-alert-wc.js +1 -1
- package/dist/components/kol-alert-wc.js.map +1 -1
- package/dist/components/kol-button-wc.js +1 -1
- package/dist/components/kol-button-wc.js.map +1 -1
- package/dist/components/kol-card-wc.d.ts +11 -0
- package/dist/components/kol-card-wc.js +4 -0
- package/dist/components/kol-card-wc.js.map +1 -0
- package/dist/components/kol-card.js +1 -1
- package/dist/components/kol-card.js.map +1 -1
- package/dist/components/kol-combobox.js +1 -1
- package/dist/components/kol-combobox.js.map +1 -1
- package/dist/components/kol-details.js +1 -1
- package/dist/components/kol-drawer.js +1 -1
- package/dist/components/kol-drawer.js.map +1 -1
- package/dist/components/kol-form.js +1 -1
- package/dist/components/kol-heading.js +1 -1
- package/dist/components/kol-icon.js +1 -1
- package/dist/components/kol-icon.js.map +1 -1
- package/dist/components/kol-image.js +1 -1
- package/dist/components/kol-image.js.map +1 -1
- package/dist/components/kol-input-checkbox.js +1 -1
- package/dist/components/kol-input-color.js +1 -1
- package/dist/components/kol-input-date.js +1 -1
- package/dist/components/kol-input-email.js +1 -1
- package/dist/components/kol-input-file.js +1 -1
- package/dist/components/kol-input-number.js +1 -1
- package/dist/components/kol-input-password.js +1 -1
- package/dist/components/kol-input-radio.js +1 -1
- package/dist/components/kol-input-range.js +1 -1
- package/dist/components/kol-input-text.js +1 -1
- package/dist/components/kol-kolibri.js +1 -1
- package/dist/components/kol-link-button.js +1 -1
- package/dist/components/kol-link-wc.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-nav.js.map +1 -1
- package/dist/components/kol-pagination-wc.d.ts +11 -0
- package/dist/components/kol-pagination-wc.js +4 -0
- package/dist/components/kol-pagination-wc.js.map +1 -0
- package/dist/components/kol-pagination.js +1 -1
- package/dist/components/kol-pagination.js.map +1 -1
- package/dist/components/kol-popover-button-wc.js +1 -1
- package/dist/components/kol-popover-button-wc.js.map +1 -1
- package/dist/components/kol-popover-button.js +1 -1
- package/dist/components/kol-popover-button.js.map +1 -1
- package/dist/components/kol-popover-wc.js +1 -1
- package/dist/components/kol-progress.js +1 -1
- package/dist/components/kol-quote.js +1 -1
- package/dist/components/kol-select.js +1 -1
- package/dist/components/kol-single-select.js +1 -1
- package/dist/components/kol-single-select.js.map +1 -1
- package/dist/components/kol-skip-nav.js +1 -1
- package/dist/components/kol-spin.js +1 -1
- package/dist/components/kol-split-button.js +1 -1
- package/dist/components/kol-split-button.js.map +1 -1
- package/dist/components/kol-table-settings-wc.js +1 -1
- package/dist/components/kol-table-stateful.js +1 -1
- package/dist/components/kol-table-stateful.js.map +1 -1
- package/dist/components/kol-table-stateless-wc.js +1 -1
- package/dist/components/kol-table-stateless.js +1 -1
- package/dist/components/kol-table-stateless.js.map +1 -1
- package/dist/components/kol-tabs.js +1 -1
- package/dist/components/kol-textarea.js +1 -1
- package/dist/components/kol-toast-container.js +1 -1
- package/dist/components/kol-toolbar.js +1 -1
- package/dist/components/kol-tooltip-wc.js +1 -1
- package/dist/components/kol-tooltip-wc.js.map +1 -1
- package/dist/components/kol-tree-item-wc.js +1 -1
- package/dist/components/kol-tree-item.js +1 -1
- package/dist/components/kol-tree-wc.js +1 -1
- package/dist/components/kol-tree.js +1 -1
- package/dist/components/kol-version.js +1 -1
- package/dist/esm/Alert-e58cf301.js +4 -0
- package/dist/esm/Alert-e58cf301.js.map +1 -0
- package/dist/esm/{Collapsible-af548d40.js → Collapsible-556bd10b.js} +1 -1
- package/dist/esm/{Collapsible-af548d40.js.map → Collapsible-556bd10b.js.map} +1 -1
- package/dist/esm/CustomSuggestionsOptionsGroup-72c6ff70.js +4 -0
- package/dist/esm/CustomSuggestionsOptionsGroup-72c6ff70.js.map +1 -0
- package/dist/esm/{FieldControlStateWrapper-7dba1400.js → FieldControlStateWrapper-0cd044eb.js} +1 -1
- package/dist/esm/{FieldControlStateWrapper-7dba1400.js.map → FieldControlStateWrapper-0cd044eb.js.map} +1 -1
- package/dist/esm/{Heading-733c8dda.js → Heading-dcf25cb6.js} +1 -1
- package/dist/esm/{Heading-733c8dda.js.map → Heading-dcf25cb6.js.map} +1 -1
- package/dist/esm/Icon-cd576310.js +4 -0
- package/dist/esm/{Icon-446dff9e.js.map → Icon-cd576310.js.map} +1 -1
- package/dist/esm/{Input-8502a991.js → Input-673592ef.js} +1 -1
- package/dist/esm/{Input-8502a991.js.map → Input-673592ef.js.map} +1 -1
- package/dist/esm/{InputStateWrapper-9b8419a8.js → InputStateWrapper-c166c7ed.js} +1 -1
- package/dist/esm/{InputStateWrapper-9b8419a8.js.map → InputStateWrapper-c166c7ed.js.map} +1 -1
- package/dist/esm/InternalUnderlinedBadgeText-2223c9c3.js +4 -0
- package/dist/esm/{InternalUnderlinedBadgeText-781ef373.js.map → InternalUnderlinedBadgeText-2223c9c3.js.map} +1 -1
- package/dist/esm/{Span-d15a3ea1.js → Span-0d93e5fa.js} +1 -1
- package/dist/esm/{Span-d15a3ea1.js.map → Span-0d93e5fa.js.map} +1 -1
- package/dist/esm/align-floating-elements-9459ccc3.js +4 -0
- package/dist/esm/align-floating-elements-9459ccc3.js.map +1 -0
- package/dist/esm/{app-globals-081a982f.js → app-globals-4a4a31c2.js} +1 -1
- package/dist/esm/{app-globals-081a982f.js.map → app-globals-4a4a31c2.js.map} +1 -1
- package/dist/esm/{associated.controller-92af2554.js → associated.controller-4237c28d.js} +1 -1
- package/dist/esm/{associated.controller-92af2554.js.map → associated.controller-4237c28d.js.map} +1 -1
- package/dist/esm/{bootstrap-93c7a706.js → bootstrap-53ed580c.js} +1 -1
- package/dist/esm/{bootstrap-93c7a706.js.map → bootstrap-53ed580c.js.map} +1 -1
- package/dist/esm/component-names-0657b355.js +4 -0
- package/dist/esm/component-names-0657b355.js.map +1 -0
- package/dist/esm/{controller-91a4c3ba.js → controller-235b6c3b.js} +1 -1
- package/dist/esm/{controller-91a4c3ba.js.map → controller-235b6c3b.js.map} +1 -1
- package/dist/esm/{controller-912bda08.js → controller-31137f06.js} +1 -1
- package/dist/esm/{controller-912bda08.js.map → controller-31137f06.js.map} +1 -1
- package/dist/esm/{controller-f5a335ce.js → controller-c152770e.js} +1 -1
- package/dist/esm/{controller-f5a335ce.js.map → controller-c152770e.js.map} +1 -1
- package/dist/esm/{controller-ce246aad.js → controller-d70d121a.js} +1 -1
- package/dist/esm/{controller-ce246aad.js.map → controller-d70d121a.js.map} +1 -1
- package/dist/esm/{controller-icon-de12de48.js → controller-icon-14c213a2.js} +1 -1
- package/dist/esm/{controller-icon-de12de48.js.map → controller-icon-14c213a2.js.map} +1 -1
- package/dist/esm/{dev.utils-cb61837d.js → dev.utils-300c83a4.js} +1 -1
- package/dist/esm/{dev.utils-cb61837d.js.map → dev.utils-300c83a4.js.map} +1 -1
- package/dist/esm/{devtools-90d0e710.js → devtools-ca41eeaf.js} +1 -1
- package/dist/esm/{devtools-90d0e710.js.map → devtools-ca41eeaf.js.map} +1 -1
- package/dist/esm/{getRenderStates-c4b5c6cb.js → getRenderStates-d5b07576.js} +1 -1
- package/dist/esm/{getRenderStates-c4b5c6cb.js.map → getRenderStates-d5b07576.js.map} +1 -1
- package/dist/esm/index-aa2635d0.js +4 -0
- package/dist/esm/index-aa2635d0.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/kol-abbr.entry.js +1 -1
- package/dist/esm/kol-accordion.entry.js +1 -1
- package/dist/esm/kol-alert-wc.entry.js +1 -1
- package/dist/esm/kol-alert-wc.entry.js.map +1 -1
- package/dist/esm/kol-alert.entry.js +1 -1
- package/dist/esm/kol-avatar-wc.entry.js +1 -1
- package/dist/esm/kol-avatar.entry.js +1 -1
- package/dist/esm/kol-badge.entry.js +1 -1
- package/dist/esm/kol-breadcrumb.entry.js +1 -1
- package/dist/esm/kol-button-link.entry.js +1 -1
- package/dist/esm/kol-button-wc.entry.js +1 -1
- package/dist/esm/kol-button-wc.entry.js.map +1 -1
- package/dist/esm/kol-button.entry.js +1 -1
- package/dist/esm/kol-card-wc.entry.js +4 -0
- package/dist/esm/kol-card-wc.entry.js.map +1 -0
- package/dist/esm/kol-card.entry.js +1 -1
- package/dist/esm/kol-card.entry.js.map +1 -1
- package/dist/esm/kol-combobox.entry.js +1 -1
- package/dist/esm/kol-combobox.entry.js.map +1 -1
- package/dist/esm/kol-details.entry.js +1 -1
- package/dist/esm/kol-drawer.entry.js +1 -1
- package/dist/esm/kol-drawer.entry.js.map +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-icon.entry.js.map +1 -1
- package/dist/esm/kol-image.entry.js +1 -1
- package/dist/esm/kol-image.entry.js.map +1 -1
- package/dist/esm/kol-input-checkbox.entry.js +1 -1
- package/dist/esm/kol-input-color.entry.js +1 -1
- package/dist/esm/kol-input-date.entry.js +1 -1
- package/dist/esm/kol-input-email.entry.js +1 -1
- package/dist/esm/kol-input-file.entry.js +1 -1
- package/dist/esm/kol-input-number.entry.js +1 -1
- package/dist/esm/kol-input-password.entry.js +1 -1
- package/dist/esm/kol-input-radio.entry.js +1 -1
- package/dist/esm/kol-input-range.entry.js +1 -1
- package/dist/esm/kol-input-text.entry.js +1 -1
- package/dist/esm/kol-kolibri.entry.js +1 -1
- package/dist/esm/kol-link-button.entry.js +1 -1
- package/dist/esm/kol-link-wc.entry.js +1 -1
- package/dist/esm/kol-link.entry.js +1 -1
- package/dist/esm/kol-modal.entry.js +1 -1
- package/dist/esm/kol-nav.entry.js +1 -1
- package/dist/esm/kol-nav.entry.js.map +1 -1
- package/dist/esm/kol-pagination-wc.entry.js +4 -0
- package/dist/esm/kol-pagination-wc.entry.js.map +1 -0
- package/dist/esm/kol-pagination.entry.js +1 -1
- package/dist/esm/kol-pagination.entry.js.map +1 -1
- package/dist/esm/kol-popover-button-wc.entry.js +1 -1
- package/dist/esm/kol-popover-button-wc.entry.js.map +1 -1
- package/dist/esm/kol-popover-button.entry.js +1 -1
- package/dist/esm/kol-popover-button.entry.js.map +1 -1
- package/dist/esm/kol-popover-wc.entry.js +1 -1
- package/dist/esm/kol-progress.entry.js +1 -1
- package/dist/esm/kol-quote.entry.js +1 -1
- package/dist/esm/kol-select.entry.js +1 -1
- package/dist/esm/kol-single-select.entry.js +1 -1
- package/dist/esm/kol-single-select.entry.js.map +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-split-button.entry.js.map +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-stateful.entry.js.map +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-table-stateless.entry.js.map +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-tooltip-wc.entry.js.map +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-e58cf301.js +4 -0
- package/dist/kolibri/Alert-e58cf301.js.map +1 -0
- package/dist/kolibri/{Collapsible-af548d40.js → Collapsible-556bd10b.js} +1 -1
- package/dist/kolibri/CustomSuggestionsOptionsGroup-72c6ff70.js +4 -0
- package/dist/kolibri/CustomSuggestionsOptionsGroup-72c6ff70.js.map +1 -0
- package/dist/kolibri/{FieldControlStateWrapper-7dba1400.js → FieldControlStateWrapper-0cd044eb.js} +1 -1
- package/dist/kolibri/{Heading-733c8dda.js → Heading-dcf25cb6.js} +1 -1
- package/dist/kolibri/Icon-cd576310.js +4 -0
- package/dist/kolibri/Input-673592ef.js +4 -0
- package/dist/kolibri/{InputStateWrapper-9b8419a8.js → InputStateWrapper-c166c7ed.js} +1 -1
- package/dist/kolibri/InternalUnderlinedBadgeText-2223c9c3.js +4 -0
- package/dist/kolibri/Span-0d93e5fa.js +4 -0
- package/dist/kolibri/{Span-d15a3ea1.js.map → Span-0d93e5fa.js.map} +1 -1
- package/dist/kolibri/align-floating-elements-9459ccc3.js +4 -0
- package/dist/kolibri/align-floating-elements-9459ccc3.js.map +1 -0
- package/dist/kolibri/app-globals-4a4a31c2.js +4 -0
- package/dist/kolibri/{associated.controller-92af2554.js → associated.controller-4237c28d.js} +1 -1
- package/dist/kolibri/{bootstrap-93c7a706.js → bootstrap-53ed580c.js} +1 -1
- package/dist/kolibri/component-names-0657b355.js +4 -0
- package/dist/kolibri/component-names-0657b355.js.map +1 -0
- package/dist/kolibri/{controller-91a4c3ba.js → controller-235b6c3b.js} +1 -1
- package/dist/kolibri/{controller-912bda08.js → controller-31137f06.js} +1 -1
- package/dist/kolibri/{controller-f5a335ce.js → controller-c152770e.js} +1 -1
- package/dist/kolibri/{controller-ce246aad.js → controller-d70d121a.js} +1 -1
- package/dist/kolibri/{controller-icon-de12de48.js → controller-icon-14c213a2.js} +1 -1
- package/dist/kolibri/{dev.utils-cb61837d.js → dev.utils-300c83a4.js} +1 -1
- package/dist/kolibri/{devtools-90d0e710.js → devtools-ca41eeaf.js} +1 -1
- package/dist/kolibri/{getRenderStates-c4b5c6cb.js → getRenderStates-d5b07576.js} +1 -1
- package/dist/kolibri/{index-1ed13705.js → index-aa2635d0.js} +1 -1
- package/dist/kolibri/index-aa2635d0.js.map +1 -0
- package/dist/kolibri/index.esm.js +1 -1
- package/dist/kolibri/kol-abbr.entry.js +1 -1
- package/dist/kolibri/kol-accordion.entry.js +1 -1
- package/dist/kolibri/kol-alert-wc.entry.js +1 -1
- package/dist/kolibri/kol-alert-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-alert.entry.js +1 -1
- package/dist/kolibri/kol-avatar-wc.entry.js +1 -1
- package/dist/kolibri/kol-avatar.entry.js +1 -1
- package/dist/kolibri/kol-badge.entry.js +1 -1
- package/dist/kolibri/kol-breadcrumb.entry.js +1 -1
- package/dist/kolibri/kol-button-link.entry.js +1 -1
- package/dist/kolibri/kol-button-wc.entry.js +1 -1
- package/dist/kolibri/kol-button-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-button.entry.js +1 -1
- package/dist/kolibri/kol-card-wc.entry.js +4 -0
- package/dist/kolibri/kol-card-wc.entry.js.map +1 -0
- package/dist/kolibri/kol-card.entry.js +1 -1
- package/dist/kolibri/kol-card.entry.js.map +1 -1
- package/dist/kolibri/kol-combobox.entry.js +1 -1
- package/dist/kolibri/kol-combobox.entry.js.map +1 -1
- package/dist/kolibri/kol-details.entry.js +1 -1
- package/dist/kolibri/kol-drawer.entry.js +1 -1
- package/dist/kolibri/kol-drawer.entry.js.map +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-icon.entry.js.map +1 -1
- package/dist/kolibri/kol-image.entry.js +1 -1
- package/dist/kolibri/kol-image.entry.js.map +1 -1
- package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
- package/dist/kolibri/kol-input-checkbox.entry.js.map +1 -1
- package/dist/kolibri/kol-input-color.entry.js +1 -1
- package/dist/kolibri/kol-input-date.entry.js +1 -1
- package/dist/kolibri/kol-input-email.entry.js +1 -1
- package/dist/kolibri/kol-input-file.entry.js +1 -1
- package/dist/kolibri/kol-input-number.entry.js +1 -1
- package/dist/kolibri/kol-input-password.entry.js +1 -1
- package/dist/kolibri/kol-input-radio.entry.js +1 -1
- package/dist/kolibri/kol-input-range.entry.js +1 -1
- package/dist/kolibri/kol-input-text.entry.js +1 -1
- package/dist/kolibri/kol-kolibri.entry.js +1 -1
- package/dist/kolibri/kol-link-button.entry.js +1 -1
- package/dist/kolibri/kol-link-wc.entry.js +1 -1
- package/dist/kolibri/kol-link.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-nav.entry.js.map +1 -1
- package/dist/kolibri/kol-pagination-wc.entry.js +4 -0
- package/dist/kolibri/kol-pagination-wc.entry.js.map +1 -0
- package/dist/kolibri/kol-pagination.entry.js +1 -1
- package/dist/kolibri/kol-pagination.entry.js.map +1 -1
- package/dist/kolibri/kol-popover-button-wc.entry.js +1 -1
- package/dist/kolibri/kol-popover-button-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-popover-button.entry.js +1 -1
- package/dist/kolibri/kol-popover-button.entry.js.map +1 -1
- package/dist/kolibri/kol-popover-wc.entry.js +1 -1
- package/dist/kolibri/kol-progress.entry.js +1 -1
- package/dist/kolibri/kol-quote.entry.js +1 -1
- package/dist/kolibri/kol-select.entry.js +1 -1
- package/dist/kolibri/kol-single-select.entry.js +1 -1
- package/dist/kolibri/kol-single-select.entry.js.map +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-split-button.entry.js.map +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-stateful.entry.js.map +1 -1
- package/dist/kolibri/kol-table-stateless-wc.entry.js +1 -1
- package/dist/kolibri/kol-table-stateless-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-table-stateless.entry.js +1 -1
- package/dist/kolibri/kol-table-stateless.entry.js.map +1 -1
- package/dist/kolibri/kol-tabs.entry.js +1 -1
- package/dist/kolibri/kol-textarea.entry.js +1 -1
- package/dist/kolibri/kol-toast-container.entry.js +1 -1
- package/dist/kolibri/kol-toolbar.entry.js +1 -1
- package/dist/kolibri/kol-tooltip-wc.entry.js +1 -1
- package/dist/kolibri/kol-tooltip-wc.entry.js.map +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/kolibri.esm.js.map +1 -1
- package/dist/kolibri/test-component.entry.js +1 -1
- package/dist/types/components/button/component.d.ts +1 -2
- package/dist/types/components/card/component.d.ts +19 -0
- package/dist/types/components/card/shadow.d.ts +2 -12
- package/dist/types/components/drawer/shadow.d.ts +3 -1
- package/dist/types/components/pagination/component.d.ts +46 -0
- package/dist/types/components/pagination/shadow.d.ts +2 -32
- package/dist/types/components/split-button/shadow.d.ts +11 -4
- package/dist/types/components/tooltip/component.d.ts +5 -5
- package/dist/types/components.d.ts +190 -8
- package/dist/types/core/component-names.d.ts +2 -0
- package/dist/types/functional-components/CustomSuggestionsOption/CustomSuggestionsOption.d.ts +1 -0
- package/dist/types/schema/components/drawer.d.ts +3 -3
- package/dist/types/schema/components/image.d.ts +5 -16
- package/dist/types/schema/props/alt.d.ts +7 -0
- package/dist/types/schema/props/image-sizes.d.ts +7 -0
- package/dist/types/schema/props/image-srcset.d.ts +7 -0
- package/dist/types/schema/props/index.d.ts +1 -1
- package/dist/types/schema/props/loading.d.ts +3 -0
- package/doc/card.md +1 -1
- package/doc/components.md +4 -4
- package/doc/drawer.md +7 -6
- package/doc/pagination.md +1 -1
- package/doc/split-button.md +41 -18
- package/package.json +5 -1
- package/postinstall.js +38 -0
- package/vscode-custom-data.json +100 -0
- package/dist/cjs/Alert-22627abf.js +0 -4
- package/dist/cjs/Alert-22627abf.js.map +0 -1
- package/dist/cjs/CustomSuggestionsOptionsGroup-421dca3c.js +0 -4
- package/dist/cjs/CustomSuggestionsOptionsGroup-421dca3c.js.map +0 -1
- package/dist/cjs/Icon-add098ba.js +0 -4
- package/dist/cjs/align-floating-elements-7e50809a.js +0 -4
- package/dist/cjs/align-floating-elements-7e50809a.js.map +0 -1
- package/dist/cjs/component-names-82c4d68d.js +0 -4
- package/dist/cjs/component-names-82c4d68d.js.map +0 -1
- package/dist/cjs/index-a40019ac.js +0 -4
- package/dist/cjs/index-a40019ac.js.map +0 -1
- package/dist/esm/Alert-112aec59.js +0 -4
- package/dist/esm/Alert-112aec59.js.map +0 -1
- package/dist/esm/CustomSuggestionsOptionsGroup-dcff90e4.js +0 -4
- package/dist/esm/CustomSuggestionsOptionsGroup-dcff90e4.js.map +0 -1
- package/dist/esm/Icon-446dff9e.js +0 -4
- package/dist/esm/InternalUnderlinedBadgeText-781ef373.js +0 -4
- package/dist/esm/align-floating-elements-526ce555.js +0 -4
- package/dist/esm/align-floating-elements-526ce555.js.map +0 -1
- package/dist/esm/component-names-7924d82a.js +0 -4
- package/dist/esm/component-names-7924d82a.js.map +0 -1
- package/dist/esm/index-1ed13705.js +0 -4
- package/dist/esm/index-1ed13705.js.map +0 -1
- package/dist/kolibri/Alert-112aec59.js +0 -4
- package/dist/kolibri/Alert-112aec59.js.map +0 -1
- package/dist/kolibri/CustomSuggestionsOptionsGroup-dcff90e4.js +0 -4
- package/dist/kolibri/CustomSuggestionsOptionsGroup-dcff90e4.js.map +0 -1
- package/dist/kolibri/Icon-446dff9e.js +0 -4
- package/dist/kolibri/Input-8502a991.js +0 -4
- package/dist/kolibri/InternalUnderlinedBadgeText-781ef373.js +0 -4
- package/dist/kolibri/Span-d15a3ea1.js +0 -4
- package/dist/kolibri/align-floating-elements-526ce555.js +0 -4
- package/dist/kolibri/align-floating-elements-526ce555.js.map +0 -1
- package/dist/kolibri/app-globals-081a982f.js +0 -4
- package/dist/kolibri/component-names-7924d82a.js +0 -4
- package/dist/kolibri/component-names-7924d82a.js.map +0 -1
- package/dist/kolibri/index-1ed13705.js.map +0 -1
- /package/dist/kolibri/{Collapsible-af548d40.js.map → Collapsible-556bd10b.js.map} +0 -0
- /package/dist/kolibri/{FieldControlStateWrapper-7dba1400.js.map → FieldControlStateWrapper-0cd044eb.js.map} +0 -0
- /package/dist/kolibri/{Heading-733c8dda.js.map → Heading-dcf25cb6.js.map} +0 -0
- /package/dist/kolibri/{Icon-446dff9e.js.map → Icon-cd576310.js.map} +0 -0
- /package/dist/kolibri/{Input-8502a991.js.map → Input-673592ef.js.map} +0 -0
- /package/dist/kolibri/{InputStateWrapper-9b8419a8.js.map → InputStateWrapper-c166c7ed.js.map} +0 -0
- /package/dist/kolibri/{InternalUnderlinedBadgeText-781ef373.js.map → InternalUnderlinedBadgeText-2223c9c3.js.map} +0 -0
- /package/dist/kolibri/{app-globals-081a982f.js.map → app-globals-4a4a31c2.js.map} +0 -0
- /package/dist/kolibri/{associated.controller-92af2554.js.map → associated.controller-4237c28d.js.map} +0 -0
- /package/dist/kolibri/{bootstrap-93c7a706.js.map → bootstrap-53ed580c.js.map} +0 -0
- /package/dist/kolibri/{controller-91a4c3ba.js.map → controller-235b6c3b.js.map} +0 -0
- /package/dist/kolibri/{controller-912bda08.js.map → controller-31137f06.js.map} +0 -0
- /package/dist/kolibri/{controller-f5a335ce.js.map → controller-c152770e.js.map} +0 -0
- /package/dist/kolibri/{controller-ce246aad.js.map → controller-d70d121a.js.map} +0 -0
- /package/dist/kolibri/{controller-icon-de12de48.js.map → controller-icon-14c213a2.js.map} +0 -0
- /package/dist/kolibri/{dev.utils-cb61837d.js.map → dev.utils-300c83a4.js.map} +0 -0
- /package/dist/kolibri/{devtools-90d0e710.js.map → devtools-ca41eeaf.js.map} +0 -0
- /package/dist/kolibri/{getRenderStates-c4b5c6cb.js.map → getRenderStates-d5b07576.js.map} +0 -0
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as n,h as e}from"./index-
|
4
|
+
import{r as n,h as e}from"./index-aa2635d0.js";import{j as t}from"./component-names-0657b355.js";const i="@charset \"UTF-8\";\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n :host {\n display: inline-block;\n }\n .kol-button {\n font-style: calc(16rem / var(--kolibri-root-font-size, 16));\n display: inline-flex;\n place-items: center;\n text-align: center;\n text-decoration-line: none;\n }\n .kol-button::before {\n /* Render zero-width character as first element to set the baseline correctly. */\n content: \"\";\n }\n .kol-button__text {\n margin: auto;\n width: 100%;\n }\n}\n@layer kol-component {\n .kol-popover-button__button {\n display: inline-block;\n }\n .kol-popover-button__popover {\n border: 0;\n margin: 0;\n padding: 0;\n }\n}",o=i,a=class{constructor(e){n(this,e),this._accessKey=void 0,this._ariaControls=void 0,this._ariaDescription=void 0,this._ariaSelected=void 0,this._customClass=void 0,this._disabled=!1,this._hideLabel=!1,this._icons=void 0,this._id=void 0,this._label=void 0,this._name=void 0,this._on=void 0,this._popoverAlign="bottom",this._role=void 0,this._shortKey=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._type="button",this._value=void 0,this._variant="normal"}async hidePopover(){var n;null===(n=this.ref)||void 0===n||n.hidePopover()}render(){return e(t,{key:"0a44e73709e339e865b30179bf6fb9ae3c43450e",ref:n=>this.ref=n,_accessKey:this._accessKey,_ariaControls:this._ariaControls,_ariaDescription:this._ariaDescription,_ariaSelected:this._ariaSelected,_customClass:this._customClass,_disabled:this._disabled,_hideLabel:this._hideLabel,_icons:this._icons,_id:this._id,_label:this._label,_name:this._name,_on:this._on,_popoverAlign:this._popoverAlign,_role:this._role,_shortKey:this._shortKey,_syncValueBySelector:this._syncValueBySelector,_tabIndex:this._tabIndex,_tooltipAlign:this._tooltipAlign,_type:this._type,_value:this._value,_variant:this._variant},e("slot",{key:"d23b56ded35b20e1449d1cff05b6ad8bafb02a0b",name:"expert",slot:"expert"}),e("slot",{key:"70ec7287f91d0333c2849a3a2deb259d13a19d09"}))}};a.style={default:o};export{a as kol_popover_button};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["defaultStyleCss","KolPopoverButtonDefaultStyle0","KolPopoverButton","hidePopover","_a","this","ref","render","h","KolPopoverButtonWcTag","key","element","_accessKey","_ariaControls","_ariaDescription","_ariaSelected","_customClass","_disabled","_hideLabel","_icons","_id","_label","_name","_on","_popoverAlign","_role","_shortKey","_syncValueBySelector","_tabIndex","_tooltipAlign","_type","_value","_variant","name","slot"],"sources":["src/components/popover-button/style.scss?tag=kol-popover-button&mode=default&encapsulation=shadow","src/components/popover-button/shadow.tsx"],"sourcesContent":["@use '../../styles/global' as *;\n@use '../@shared/kol-button-mixin' as *;\n@use '../@shared/kol-popover-button-mixin' as *;\n@use '../tooltip/style' as *;\n\n@include kol-button-styles('kol-button');\n@include kol-popover-button-styles;\n","import type { JSX } from '@stencil/core';\nimport { Component, h, Method, Prop } from '@stencil/core';\nimport { KolPopoverButtonWcTag } from '../../core/component-names';\nimport type { PopoverButtonProps } from '../../schema/components/popover-button';\nimport type {\n\tAccessKeyPropType,\n\tAlternativeButtonLinkRolePropType,\n\tAriaDescriptionPropType,\n\tButtonCallbacksPropType,\n\tButtonTypePropType,\n\tButtonVariantPropType,\n\tCustomClassPropType,\n\tIconsPropType,\n\tLabelWithExpertSlotPropType,\n\tPopoverAlignPropType,\n\tShortKeyPropType,\n\tStencilUnknown,\n\tSyncValueBySelectorPropType,\n\tTooltipAlignPropType,\n} from '../../schema';\n\n/**\n * @slot - The popover content.\n */\n@Component({\n\ttag: 'kol-popover-button',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolPopoverButton implements PopoverButtonProps {\n\tprivate ref?: HTMLKolPopoverButtonWcElement;\n\n\t/**\n\t * Hides the popover programmatically by forwarding the call to the web component.\n\t */\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async hidePopover() {\n\t\tvoid this.ref?.hidePopover();\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<KolPopoverButtonWcTag\n\t\t\t\tref={(element) => (this.ref = element)}\n\t\t\t\t_accessKey={this._accessKey}\n\t\t\t\t_ariaControls={this._ariaControls}\n\t\t\t\t_ariaDescription={this._ariaDescription}\n\t\t\t\t_ariaSelected={this._ariaSelected}\n\t\t\t\t_customClass={this._customClass}\n\t\t\t\t_disabled={this._disabled}\n\t\t\t\t_hideLabel={this._hideLabel}\n\t\t\t\t_icons={this._icons}\n\t\t\t\t_id={this._id}\n\t\t\t\t_label={this._label}\n\t\t\t\t_name={this._name}\n\t\t\t\t_on={this._on}\n\t\t\t\t_popoverAlign={this._popoverAlign}\n\t\t\t\t_role={this._role}\n\t\t\t\t_shortKey={this._shortKey}\n\t\t\t\t_syncValueBySelector={this._syncValueBySelector}\n\t\t\t\t_tabIndex={this._tabIndex}\n\t\t\t\t_tooltipAlign={this._tooltipAlign}\n\t\t\t\t_type={this._type}\n\t\t\t\t_value={this._value}\n\t\t\t\t_variant={this._variant}\n\t\t\t>\n\t\t\t\t<slot name=\"expert\" slot=\"expert\"></slot>\n\t\t\t\t<slot />\n\t\t\t</KolPopoverButtonWcTag>\n\t\t);\n\t}\n\n\t/**\n\t * Defines which key combination can be used to trigger or focus the interactive element of the component.\n\t */\n\t@Prop() public _accessKey?: AccessKeyPropType;\n\n\t/**\n\t * Defines which elements are controlled by this component. (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls)\n\t */\n\t@Prop() public _ariaControls?: string;\n\n\t/**\n\t * Defines the value for the aria-description attribute.\n\t */\n\t@Prop() public _ariaDescription?: AriaDescriptionPropType;\n\n\t/**\n\t * Defines whether the interactive element of the component is selected (e.g. role=tab). (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected)\n\t */\n\t@Prop() public _ariaSelected?: boolean;\n\n\t/**\n\t * Defines the custom class attribute if _variant=\"custom\" is set.\n\t */\n\t@Prop() public _customClass?: CustomClassPropType;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Hides the caption by default and displays the caption text with a tooltip when the\n\t * interactive element is focused or the mouse is over it.\n\t * @TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Defines the icon classnames (e.g. `_icons=\"fa-solid fa-user\"`).\n\t */\n\t@Prop() public _icons?: IconsPropType;\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id?: string;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to `false` to enable the expert slot.\n\t */\n\t@Prop() public _label!: LabelWithExpertSlotPropType;\n\n\t/**\n\t * Defines the technical name of an input field.\n\t */\n\t@Prop() public _name?: string;\n\n\t/**\n\t * Defines the callback functions for button events.\n\t */\n\t@Prop() public _on?: ButtonCallbacksPropType<StencilUnknown>;\n\n\t/**\n\t * Defines where to show the Popover preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _popoverAlign?: PopoverAlignPropType = 'bottom';\n\n\t/**\n\t * Defines the role of the components primary element.\n\t */\n\t@Prop() public _role?: AlternativeButtonLinkRolePropType;\n\n\t/**\n\t * Adds a visual short key hint to the component.\n\t */\n\t@Prop() public _shortKey?: ShortKeyPropType;\n\n\t/**\n\t * Selector for synchronizing the value with another input element.\n\t * @internal\n\t */\n\t@Prop() public _syncValueBySelector?: SyncValueBySelectorPropType;\n\n\t/**\n\t * Defines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)\n\t */\n\t@Prop() public _tabIndex?: number;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Defines either the type of the component or of the components interactive element.\n\t */\n\t@Prop() public _type?: ButtonTypePropType = 'button';\n\n\t/**\n\t * Defines the value that the button emits on click.\n\t */\n\t@Prop() public _value?: StencilUnknown;\n\n\t/**\n\t * Defines which variant should be used for presentation.\n\t */\n\t@Prop() public _variant?: ButtonVariantPropType = 'normal';\n}\n"],"mappings":";;;iGAAA,MAAMA,EAAkB
|
1
|
+
{"version":3,"names":["defaultStyleCss","KolPopoverButtonDefaultStyle0","KolPopoverButton","hidePopover","_a","this","ref","render","h","KolPopoverButtonWcTag","key","element","_accessKey","_ariaControls","_ariaDescription","_ariaSelected","_customClass","_disabled","_hideLabel","_icons","_id","_label","_name","_on","_popoverAlign","_role","_shortKey","_syncValueBySelector","_tabIndex","_tooltipAlign","_type","_value","_variant","name","slot"],"sources":["src/components/popover-button/style.scss?tag=kol-popover-button&mode=default&encapsulation=shadow","src/components/popover-button/shadow.tsx"],"sourcesContent":["@use '../../styles/global' as *;\n@use '../@shared/kol-button-mixin' as *;\n@use '../@shared/kol-popover-button-mixin' as *;\n@use '../tooltip/style' as *;\n\n@include kol-button-styles('kol-button');\n@include kol-popover-button-styles;\n","import type { JSX } from '@stencil/core';\nimport { Component, h, Method, Prop } from '@stencil/core';\nimport { KolPopoverButtonWcTag } from '../../core/component-names';\nimport type { PopoverButtonProps } from '../../schema/components/popover-button';\nimport type {\n\tAccessKeyPropType,\n\tAlternativeButtonLinkRolePropType,\n\tAriaDescriptionPropType,\n\tButtonCallbacksPropType,\n\tButtonTypePropType,\n\tButtonVariantPropType,\n\tCustomClassPropType,\n\tIconsPropType,\n\tLabelWithExpertSlotPropType,\n\tPopoverAlignPropType,\n\tShortKeyPropType,\n\tStencilUnknown,\n\tSyncValueBySelectorPropType,\n\tTooltipAlignPropType,\n} from '../../schema';\n\n/**\n * @slot - The popover content.\n */\n@Component({\n\ttag: 'kol-popover-button',\n\tstyleUrls: {\n\t\tdefault: './style.scss',\n\t},\n\tshadow: true,\n})\nexport class KolPopoverButton implements PopoverButtonProps {\n\tprivate ref?: HTMLKolPopoverButtonWcElement;\n\n\t/**\n\t * Hides the popover programmatically by forwarding the call to the web component.\n\t */\n\t@Method()\n\t// eslint-disable-next-line @typescript-eslint/require-await\n\tpublic async hidePopover() {\n\t\tvoid this.ref?.hidePopover();\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<KolPopoverButtonWcTag\n\t\t\t\tref={(element) => (this.ref = element)}\n\t\t\t\t_accessKey={this._accessKey}\n\t\t\t\t_ariaControls={this._ariaControls}\n\t\t\t\t_ariaDescription={this._ariaDescription}\n\t\t\t\t_ariaSelected={this._ariaSelected}\n\t\t\t\t_customClass={this._customClass}\n\t\t\t\t_disabled={this._disabled}\n\t\t\t\t_hideLabel={this._hideLabel}\n\t\t\t\t_icons={this._icons}\n\t\t\t\t_id={this._id}\n\t\t\t\t_label={this._label}\n\t\t\t\t_name={this._name}\n\t\t\t\t_on={this._on}\n\t\t\t\t_popoverAlign={this._popoverAlign}\n\t\t\t\t_role={this._role}\n\t\t\t\t_shortKey={this._shortKey}\n\t\t\t\t_syncValueBySelector={this._syncValueBySelector}\n\t\t\t\t_tabIndex={this._tabIndex}\n\t\t\t\t_tooltipAlign={this._tooltipAlign}\n\t\t\t\t_type={this._type}\n\t\t\t\t_value={this._value}\n\t\t\t\t_variant={this._variant}\n\t\t\t>\n\t\t\t\t<slot name=\"expert\" slot=\"expert\"></slot>\n\t\t\t\t<slot />\n\t\t\t</KolPopoverButtonWcTag>\n\t\t);\n\t}\n\n\t/**\n\t * Defines which key combination can be used to trigger or focus the interactive element of the component.\n\t */\n\t@Prop() public _accessKey?: AccessKeyPropType;\n\n\t/**\n\t * Defines which elements are controlled by this component. (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls)\n\t */\n\t@Prop() public _ariaControls?: string;\n\n\t/**\n\t * Defines the value for the aria-description attribute.\n\t */\n\t@Prop() public _ariaDescription?: AriaDescriptionPropType;\n\n\t/**\n\t * Defines whether the interactive element of the component is selected (e.g. role=tab). (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected)\n\t */\n\t@Prop() public _ariaSelected?: boolean;\n\n\t/**\n\t * Defines the custom class attribute if _variant=\"custom\" is set.\n\t */\n\t@Prop() public _customClass?: CustomClassPropType;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Hides the caption by default and displays the caption text with a tooltip when the\n\t * interactive element is focused or the mouse is over it.\n\t * @TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Defines the icon classnames (e.g. `_icons=\"fa-solid fa-user\"`).\n\t */\n\t@Prop() public _icons?: IconsPropType;\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id?: string;\n\n\t/**\n\t * Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to `false` to enable the expert slot.\n\t */\n\t@Prop() public _label!: LabelWithExpertSlotPropType;\n\n\t/**\n\t * Defines the technical name of an input field.\n\t */\n\t@Prop() public _name?: string;\n\n\t/**\n\t * Defines the callback functions for button events.\n\t */\n\t@Prop() public _on?: ButtonCallbacksPropType<StencilUnknown>;\n\n\t/**\n\t * Defines where to show the Popover preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _popoverAlign?: PopoverAlignPropType = 'bottom';\n\n\t/**\n\t * Defines the role of the components primary element.\n\t */\n\t@Prop() public _role?: AlternativeButtonLinkRolePropType;\n\n\t/**\n\t * Adds a visual short key hint to the component.\n\t */\n\t@Prop() public _shortKey?: ShortKeyPropType;\n\n\t/**\n\t * Selector for synchronizing the value with another input element.\n\t * @internal\n\t */\n\t@Prop() public _syncValueBySelector?: SyncValueBySelectorPropType;\n\n\t/**\n\t * Defines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)\n\t */\n\t@Prop() public _tabIndex?: number;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Defines either the type of the component or of the components interactive element.\n\t */\n\t@Prop() public _type?: ButtonTypePropType = 'button';\n\n\t/**\n\t * Defines the value that the button emits on click.\n\t */\n\t@Prop() public _value?: StencilUnknown;\n\n\t/**\n\t * Defines which variant should be used for presentation.\n\t */\n\t@Prop() public _variant?: ButtonVariantPropType = 'normal';\n}\n"],"mappings":";;;iGAAA,MAAMA,EAAkB,k2LACxB,MAAAC,EAAeD,E,MC8BFE,EAAgB,M,wLAwES,M,gBAOC,M,0HA8BgB,S,8HA0BA,M,WAKV,S,oCAUM,Q,CA9I3C,iBAAMC,G,YACPC,EAAAC,KAAKC,OAAG,MAAAF,SAAA,SAAAA,EAAED,c,CAGT,MAAAI,GACN,OACCC,EAACC,EAAqB,CAAAC,IAAA,2CACrBJ,IAAMK,GAAaN,KAAKC,IAAMK,EAC9BC,WAAYP,KAAKO,WACjBC,cAAeR,KAAKQ,cACpBC,iBAAkBT,KAAKS,iBACvBC,cAAeV,KAAKU,cACpBC,aAAcX,KAAKW,aACnBC,UAAWZ,KAAKY,UAChBC,WAAYb,KAAKa,WACjBC,OAAQd,KAAKc,OACbC,IAAKf,KAAKe,IACVC,OAAQhB,KAAKgB,OACbC,MAAOjB,KAAKiB,MACZC,IAAKlB,KAAKkB,IACVC,cAAenB,KAAKmB,cACpBC,MAAOpB,KAAKoB,MACZC,UAAWrB,KAAKqB,UAChBC,qBAAsBtB,KAAKsB,qBAC3BC,UAAWvB,KAAKuB,UAChBC,cAAexB,KAAKwB,cACpBC,MAAOzB,KAAKyB,MACZC,OAAQ1B,KAAK0B,OACbC,SAAU3B,KAAK2B,UAEfxB,EAAA,QAAAE,IAAA,2CAAMuB,KAAK,SAASC,KAAK,WACzB1B,EAAA,QAAAE,IAAA,6C","ignoreList":[]}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as i,h as s,H as t}from"./index-
|
4
|
+
import{r as i,h as s,H as t}from"./index-aa2635d0.js";import{w as e,g as o}from"./index-ebe5a881.js";import{a}from"./align-floating-elements-9459ccc3.js";import{c as h}from"./clsx-09a06a12.js";import{d as l,K as r}from"./events-bad0a075.js";import{v as n}from"./align-d2572387.js";import{v as c}from"./show-fabfe6d7.js";const d=(t,s)=>{e(t,"_on",(e=>"object"==typeof e&&null!==e),new Set(["PopoverCallbacksPropType {Events.onClose}"]),s)},v=class{constructor(e){i(this,e),this.hidePopoverByEscape=e=>{"Escape"===e.key&&this.hidePopover(e)},this.hidePopoverByClickOutside=e=>{this.host&&!this.host.contains(e.target)&&this.hidePopover(e)},this.catchHostAndTriggerElement=e=>{e&&(this.host=e,this.triggerElement=e.previousElementSibling)},this.catchPopoverElement=e=>{this.popoverElement=e},this.catchArrowElement=e=>{this.arrowElement=e},this._align="top",this._on=void 0,this._show=!1,this.state={_align:"top",_on:{},_show:!1,_visible:!1}}async showPopover(){this.addListenersToBody(),this.triggerElement&&this.popoverElement&&(await a({align:this._align,referenceElement:this.triggerElement,arrowElement:this.arrowElement,floatingElement:this.popoverElement}),this.state=Object.assign(Object.assign({},this.state),{_visible:!0}))}hidePopover(e){var t,s,o;this.state=Object.assign(Object.assign({},this.state),{_visible:!1}),this._show=!1,null===(t=this.triggerElement)||void 0===t||t.focus(),this.removeListenersToBody(),null===(o=null===(s=this.state._on)||void 0===s?void 0:s.onClose)||void 0===o||o.call(s,e),this.host&&l(this.host,r.close)}addListenersToBody(){var e;const t=o().body;t.addEventListener("keyup",this.hidePopoverByEscape),t.addEventListener("click",this.hidePopoverByClickOutside),null===(e=document.scrollingElement)||void 0===e||e.addEventListener("scroll",(()=>{this.showPopover()}),{passive:!0})}removeListenersToBody(){var e;const t=o().body;t.removeEventListener("keyup",this.hidePopoverByEscape),t.removeEventListener("click",this.hidePopoverByClickOutside),null===(e=document.scrollingElement)||void 0===e||e.removeEventListener("scroll",(()=>{this.showPopover()}))}render(){return s(t,{key:"53179ace5c0dfabbe1dd00ba8ddfe453ef55ccd5",ref:this.catchHostAndTriggerElement,class:"kol-popover"},s("div",{key:"f42aafe81aaa0a09526b4e9923a96133ee81c5d2",class:h("kol-popover__content",{"kol-popover__content--visible":this.state._visible}),ref:this.catchPopoverElement,hidden:!this.state._show},s("div",{key:"25719436c820c214a2e3c0fac47449f842c4f68c",class:h("kol-popover__arrow",`kol-popover__arrow--${this.state._align}`),ref:this.catchArrowElement}),s("slot",{key:"fff04758761fb36389c6698b17730b604981ca66"})))}validateAlign(e){n(this,e)}validateOn(e){d(this,e)}validateShow(e){c(this,e),e&&this.showPopover()}componentWillLoad(){this.validateAlign(this._align),this.validateShow(this._show)}static get watchers(){return{_align:["validateAlign"],_on:["validateOn"],_show:["validateShow"]}}};export{v as kol_popover_wc};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as e,h as n}from"./index-1ed13705.js";import{E as t,B as r,w as s,J as i}from"./index-ebe5a881.js";import{v as o}from"./label-bf9966d0.js";const a="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-progress__bar {\n display: grid;\n grid-template-columns: 1fr auto;\n grid-template-areas: \"LABEL LABEL LABEL\" \"BAR VALUE UNIT\";\n align-items: center;\n column-gap: 0.05rem;\n }\n .kol-progress__bar-label {\n grid-column-end: 2;\n grid-area: LABEL;\n }\n .kol-progress__bar svg {\n grid-area: BAR;\n }\n .kol-progress__bar-value {\n grid-area: VALUE;\n text-align: right;\n }\n .kol-progress__bar-unit {\n grid-area: UNIT;\n }\n .kol-progress__bar-border {\n fill: transparent;\n stroke: black;\n }\n .kol-progress__bar-background {\n fill: lightgray;\n stroke: white;\n }\n .kol-progress__bar-progress {\n fill: #0075ff;\n stroke: transparent;\n }\n @media (prefers-reduced-motion: no-preference) {\n .kol-progress__bar-progress {\n transition: 250ms ease-in-out 50ms;\n }\n }\n .kol-progress__cycle {\n display: grid;\n grid-template-columns: auto;\n grid-template-areas: \"ALL\";\n justify-items: center;\n align-content: center;\n }\n .kol-progress__cycle > * {\n grid-area: ALL;\n }\n .kol-progress__cycle-text {\n text-align: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n font-size: x-small;\n }\n .kol-progress__cycle-text * {\n background-color: white;\n }\n .kol-progress__cycle-background {\n fill: transparent;\n stroke: lightgray;\n }\n .kol-progress__cycle-border {\n fill: transparent;\n stroke: black;\n }\n .kol-progress__cycle-whitespace {\n fill: transparent;\n stroke: white;\n }\n .kol-progress__cycle-progress {\n fill: transparent;\n stroke: #0075ff;\n transform-origin: 50% 50%;\n transform: rotate(-90deg);\n }\n @media (prefers-reduced-motion: no-preference) {\n .kol-progress__cycle-progress {\n transition: 250ms ease-in-out 50ms;\n }\n }\n}",l=a,c=Object.keys(i),d=({state:e})=>n("svg",{width:"100",viewBox:"0 0 120 120",xmlns:"http://www.w3.org/2000/svg"},n("circle",{class:"kol-progress__cycle-background",cx:"60",cy:"60",r:"54.5",fill:"currentColor",stroke:"currentColor","stroke-width":"8"}),n("circle",{class:"kol-progress__cycle-whitespace",cx:"60",cy:"60",r:"59",fill:"currentColor",stroke:"currentColor","stroke-width":"3"}),n("circle",{class:"kol-progress__cycle-border",cx:"60",cy:"60",r:"59",fill:"currentColor",stroke:"currentColor","stroke-width":"1"}),n("circle",{class:"kol-progress__cycle-whitespace",cx:"60",cy:"60",r:"51",fill:"currentColor",stroke:"currentColor","stroke-width":"1"}),n("circle",{class:"kol-progress__cycle-border",cx:"60",cy:"60",r:"50",fill:"currentColor",stroke:"currentColor","stroke-width":"1"}),n("circle",{class:"kol-progress__cycle-progress",fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-dasharray":`${Math.round(e._value/e._max*342)}px 342px`,"stroke-width":"6",cx:"60",cy:"60",r:"54.5"})),h=({state:e})=>{const t=e._value/e._max*100;return n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"12",overflow:"visible"},n("rect",{class:"kol-progress__bar-background",x:"1",y:"1",height:"11",rx:"5",fill:"currentColor",stroke:"currentColor","stroke-width":"3",style:{width:"100%"}}),n("rect",{class:"kol-progress__bar-border",x:"1",y:"1",height:"11",rx:"5",fill:"currentColor",stroke:"currentColor","stroke-width":"1",style:{width:"100%"}}),n("rect",{class:"kol-progress__bar-progress",x:"3",y:"3",height:"7",rx:"3.5",fill:"currentColor",stroke:"currentColor","stroke-width":"3",style:{width:`calc(${t}% - 4px)`}}))},p=e=>{switch(e._variant){case"cycle":return n(d,{state:e});case"bar":return n(h,{state:e});default:throw new Error(`Progress variant ${e._variant} not implemented.`)}},b=class{constructor(t){e(this,t),this._label=void 0,this._max=void 0,this._unit="%",this._value=void 0,this._variant=void 0,this.state={_max:100,_unit:"%",_value:0,_variant:"bar",_liveValue:0}}render(){const e="%"===this.state._unit,t=e?`${Math.round(this.state._liveValue/this.state._max*100)}`:this.state._liveValue,a=e?Math.round(this.state._value/this.state._max*100):this.state._value;return n("div",{key:"a3cb72fa70f83e640758aa2a9a9b05f3144586d1",class:"kol-progress"},n("div",{key:"3f9f7a83fa9fe5f0e01ab96051b0f058afeb6ba0","aria-hidden":"true",class:{"kol-progress__cycle":"cycle"===this.state._variant,"kol-progress__bar":"bar"===this.state._variant}},"bar"===this.state._variant&&this.state._label&&n("div",{key:"e53ad6ee7ff680988179e7b57208cb0361783d31",class:"kol-progress__bar-label"},this.state._label),p(this.state),"cycle"===this.state._variant&&n("div",{key:"ea204d7f0d0ee5e31bc2069f024b43c0d2284169",class:"kol-progress__cycle-text"},this.state._label&&n("div",{key:"f583eb8c55ebd0cb7c2fb3a09783756443db3d2b",class:"kol-progress__cycle-label"},this.state._label),n("div",{key:"1346b894f81071541519512ce1abb20ded13591a",class:"kol-progress__cycle-value"},`${a} ${this.state._unit}`)),"bar"===this.state._variant&&n("div",{key:"36594c75a4ea3d61a62570a9409fd037fdd30b94",class:"kol-progress__bar-value",style:{width:`${`${(e?100:this.state._max)+1}`.length}ch`}},a),"bar"===this.state._variant&&n("div",{key:"65e88af3902b2c8b6c30f2a54f8feb66009463bd",class:"kol-progress__bar-unit"},this.state._unit)),n("progress",{key:"2297eabe4c35dd762224c91138439f6024b6ddf4",class:"visually-hidden","aria-busy":this.state._value<this.state._max?"true":"false",max:this.state._max,value:this.state._value}),n("span",{key:"46f34a72036af783e44740c48611671576c29cc9","aria-live":"polite","aria-relevant":"removals text",class:"visually-hidden"},e?`${t} %`:`${t} von ${this.state._max} ${this.state._unit}`))}validateLabel(e){o(this,e)}validateMax(e){"number"!=typeof e&&(e=100),t(this,"_max",e,{required:!0})}validateUnit(e){r(this,"_unit",e)}validateValue(e){"number"!=typeof e&&(e=0),t(this,"_value",e,{required:!0})}validateVariant(e){s(this,"_variant",(e=>"string"==typeof e&&c.includes(e)),new Set(c),e)}componentWillLoad(){this.validateLabel(this._label),this.validateMax(this._max),this.validateUnit(this._unit),this.validateValue(this._value),this.validateVariant(this._variant),this.state=Object.assign(Object.assign({},this.state),{_liveValue:this.state._value}),this.interval=setInterval((()=>{this.state._liveValue!==this.state._value&&(this.state=Object.assign(Object.assign({},this.state),{_liveValue:this.state._value}))}),5e3)}disconnectedCallback(){clearInterval(this.interval)}static get watchers(){return{_label:["validateLabel"],_max:["validateMax"],_unit:["validateUnit"],_value:["validateValue"],_variant:["validateVariant"]}}};b.style={default:l};export{b as kol_progress};
|
4
|
+
import{r as e,h as n}from"./index-aa2635d0.js";import{E as t,B as r,w as s,J as i}from"./index-ebe5a881.js";import{v as o}from"./label-bf9966d0.js";const a="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-progress__bar {\n display: grid;\n grid-template-columns: 1fr auto;\n grid-template-areas: \"LABEL LABEL LABEL\" \"BAR VALUE UNIT\";\n align-items: center;\n column-gap: 0.05rem;\n }\n .kol-progress__bar-label {\n grid-column-end: 2;\n grid-area: LABEL;\n }\n .kol-progress__bar svg {\n grid-area: BAR;\n }\n .kol-progress__bar-value {\n grid-area: VALUE;\n text-align: right;\n }\n .kol-progress__bar-unit {\n grid-area: UNIT;\n }\n .kol-progress__bar-border {\n fill: transparent;\n stroke: black;\n }\n .kol-progress__bar-background {\n fill: lightgray;\n stroke: white;\n }\n .kol-progress__bar-progress {\n fill: #0075ff;\n stroke: transparent;\n }\n @media (prefers-reduced-motion: no-preference) {\n .kol-progress__bar-progress {\n transition: 250ms ease-in-out 50ms;\n }\n }\n .kol-progress__cycle {\n display: grid;\n grid-template-columns: auto;\n grid-template-areas: \"ALL\";\n justify-items: center;\n align-content: center;\n }\n .kol-progress__cycle > * {\n grid-area: ALL;\n }\n .kol-progress__cycle-text {\n text-align: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n font-size: x-small;\n }\n .kol-progress__cycle-text * {\n background-color: white;\n }\n .kol-progress__cycle-background {\n fill: transparent;\n stroke: lightgray;\n }\n .kol-progress__cycle-border {\n fill: transparent;\n stroke: black;\n }\n .kol-progress__cycle-whitespace {\n fill: transparent;\n stroke: white;\n }\n .kol-progress__cycle-progress {\n fill: transparent;\n stroke: #0075ff;\n transform-origin: 50% 50%;\n transform: rotate(-90deg);\n }\n @media (prefers-reduced-motion: no-preference) {\n .kol-progress__cycle-progress {\n transition: 250ms ease-in-out 50ms;\n }\n }\n}",l=a,c=Object.keys(i),d=({state:e})=>n("svg",{width:"100",viewBox:"0 0 120 120",xmlns:"http://www.w3.org/2000/svg"},n("circle",{class:"kol-progress__cycle-background",cx:"60",cy:"60",r:"54.5",fill:"currentColor",stroke:"currentColor","stroke-width":"8"}),n("circle",{class:"kol-progress__cycle-whitespace",cx:"60",cy:"60",r:"59",fill:"currentColor",stroke:"currentColor","stroke-width":"3"}),n("circle",{class:"kol-progress__cycle-border",cx:"60",cy:"60",r:"59",fill:"currentColor",stroke:"currentColor","stroke-width":"1"}),n("circle",{class:"kol-progress__cycle-whitespace",cx:"60",cy:"60",r:"51",fill:"currentColor",stroke:"currentColor","stroke-width":"1"}),n("circle",{class:"kol-progress__cycle-border",cx:"60",cy:"60",r:"50",fill:"currentColor",stroke:"currentColor","stroke-width":"1"}),n("circle",{class:"kol-progress__cycle-progress",fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-dasharray":`${Math.round(e._value/e._max*342)}px 342px`,"stroke-width":"6",cx:"60",cy:"60",r:"54.5"})),h=({state:e})=>{const t=e._value/e._max*100;return n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"12",overflow:"visible"},n("rect",{class:"kol-progress__bar-background",x:"1",y:"1",height:"11",rx:"5",fill:"currentColor",stroke:"currentColor","stroke-width":"3",style:{width:"100%"}}),n("rect",{class:"kol-progress__bar-border",x:"1",y:"1",height:"11",rx:"5",fill:"currentColor",stroke:"currentColor","stroke-width":"1",style:{width:"100%"}}),n("rect",{class:"kol-progress__bar-progress",x:"3",y:"3",height:"7",rx:"3.5",fill:"currentColor",stroke:"currentColor","stroke-width":"3",style:{width:`calc(${t}% - 4px)`}}))},b=e=>{switch(e._variant){case"cycle":return n(d,{state:e});case"bar":return n(h,{state:e});default:throw new Error(`Progress variant ${e._variant} not implemented.`)}},p=class{constructor(t){e(this,t),this._label=void 0,this._max=void 0,this._unit="%",this._value=void 0,this._variant=void 0,this.state={_max:100,_unit:"%",_value:0,_variant:"bar",_liveValue:0}}render(){const e="%"===this.state._unit,t=e?`${Math.round(this.state._liveValue/this.state._max*100)}`:this.state._liveValue,a=e?Math.round(this.state._value/this.state._max*100):this.state._value;return n("div",{key:"a35e0a18d0d9d0ddfcb60c7070b8817b15dc6b02",class:"kol-progress"},n("div",{key:"b7d93e63b0b24b4c90270cf2146383d5d53da12e","aria-hidden":"true",class:{"kol-progress__cycle":"cycle"===this.state._variant,"kol-progress__bar":"bar"===this.state._variant}},"bar"===this.state._variant&&this.state._label&&n("div",{key:"d65cb999768ed9fe454c11fd33d0db66a703e36b",class:"kol-progress__bar-label"},this.state._label),b(this.state),"cycle"===this.state._variant&&n("div",{key:"d139c7865e25d12ba07196c7e1390c96f17a66e4",class:"kol-progress__cycle-text"},this.state._label&&n("div",{key:"c237b28a0bf6deb6c9bb2015736e96cfc5473970",class:"kol-progress__cycle-label"},this.state._label),n("div",{key:"3dc597353662501ef7020ba624501cb456b2b143",class:"kol-progress__cycle-value"},`${a} ${this.state._unit}`)),"bar"===this.state._variant&&n("div",{key:"37969ac3628bb005ebb1c3fec527f45455c54618",class:"kol-progress__bar-value",style:{width:`${`${(e?100:this.state._max)+1}`.length}ch`}},a),"bar"===this.state._variant&&n("div",{key:"bbc423be302c352f409b979411d5dfe0e1282bd0",class:"kol-progress__bar-unit"},this.state._unit)),n("progress",{key:"e5f65b8ec5590ac3a94ae601133bb1f16006292d",class:"visually-hidden","aria-busy":this.state._value<this.state._max?"true":"false",max:this.state._max,value:this.state._value}),n("span",{key:"7644977090f8e7f8ff747769590f1081753f7ef1","aria-live":"polite","aria-relevant":"removals text",class:"visually-hidden"},e?`${t} %`:`${t} von ${this.state._max} ${this.state._unit}`))}validateLabel(e){o(this,e)}validateMax(e){"number"!=typeof e&&(e=100),t(this,"_max",e,{required:!0})}validateUnit(e){r(this,"_unit",e)}validateValue(e){"number"!=typeof e&&(e=0),t(this,"_value",e,{required:!0})}validateVariant(e){s(this,"_variant",(e=>"string"==typeof e&&c.includes(e)),new Set(c),e)}componentWillLoad(){this.validateLabel(this._label),this.validateMax(this._max),this.validateUnit(this._unit),this.validateValue(this._value),this.validateVariant(this._variant),this.state=Object.assign(Object.assign({},this.state),{_liveValue:this.state._value}),this.interval=setInterval((()=>{this.state._liveValue!==this.state._value&&(this.state=Object.assign(Object.assign({},this.state),{_liveValue:this.state._value}))}),5e3)}disconnectedCallback(){clearInterval(this.interval)}static get watchers(){return{_label:["validateLabel"],_max:["validateMax"],_unit:["validateUnit"],_value:["validateValue"],_variant:["validateVariant"]}}};p.style={default:l};export{p as kol_progress};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as n,h as e}from"./index-
|
4
|
+
import{r as n,h as e}from"./index-aa2635d0.js";import{B as t,w as i,m as o}from"./index-ebe5a881.js";import{k as a}from"./component-names-0657b355.js";import{c as l}from"./clsx-09a06a12.js";import{v as s}from"./label-bf9966d0.js";const r=["block","inline"],d="@charset \"UTF-8\";\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n .kol-quote {\n display: inline;\n margin: 0;\n padding: 0;\n }\n .kol-quote__cite::before {\n content: \"—\";\n }\n .kol-quote--block .kol-quote__cite::before {\n padding-right: 0.5em;\n }\n .kol-quote--inline .kol-quote__cite::before {\n padding: 0.5em;\n }\n .kol-quote--block .kol-quote__figcaption {\n display: inline;\n margin: 0;\n padding: 0;\n }\n .kol-quote__blockquote::before {\n content: open-quote;\n }\n .kol-quote__blockquote::after {\n content: close-quote;\n }\n}",h=d,c=class{constructor(e){n(this,e),this._label=void 0,this._href=void 0,this._quote=void 0,this._variant="inline",this.state={_href:"",_quote:"",_variant:"inline"}}validateLabel(e){s(this,e)}validateHref(e){t(this,"_href",e,{required:!0})}validateQuote(e){t(this,"_quote",e,{required:!0})}validateVariant(e){i(this,"_variant",(e=>"string"==typeof e&&r.includes(e)),new Set(r),e)}componentWillLoad(){this.validateHref(this._href),this.validateLabel(this._label),this.validateQuote(this._quote),this.validateVariant(this._variant)}render(){const n=o(this.state._quote);return e("figure",{key:"e68968696617503220e774f6b0a11c6c7f256582",class:l("kol-quote",`kol-quote--${this.state._variant}`)},"block"===this.state._variant?e("blockquote",{class:"kol-quote__blockquote",cite:this.state._href},this.state._quote,e("span",{"aria-hidden":n?void 0:"true",hidden:!n},e("slot",{name:"expert"}))):e("q",{class:"kol-quote__quote",cite:this.state._href},this.state._quote,e("span",{"aria-hidden":n?void 0:"true",hidden:!n},e("slot",{name:"expert"}))),"string"==typeof this.state._label&&this.state._label.length>0&&e("figcaption",{key:"918f5c9884c03b3275473276624f4585490a2069",class:"kol-quote__figcaption"},e("cite",{key:"609c527c94b38135a0fb2af474f39b61ce69bc74",class:"kol-quote__cite"},e(a,{key:"ade63d54115b41bfaa130c054023b0004e49dda5",_href:this.state._href,_label:this.state._label,_target:"_blank"}))))}static get watchers(){return{_label:["validateLabel"],_href:["validateHref"],_quote:["validateQuote"],_variant:["validateVariant"]}}};c.style={default:h};export{c as kol_quote};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{h as e,F as n,r as t,g as i}from"./index-1ed13705.js";import{c as o}from"./clsx-09a06a12.js";import{n as a}from"./dev.utils-cb61837d.js";import{i as s,z as l}from"./index-ebe5a881.js";import{I as r,a as d}from"./controller-icon-de12de48.js";import{f as c,v as h}from"./controller-ce246aad.js";import{v as u}from"./rows-225b4f43.js";import{p}from"./controller-91a4c3ba.js";import{e as f,c as m,g as b,a as v,F as k}from"./getRenderStates-c4b5c6cb.js";import{_ as y}from"./tslib.es6-1173d062.js";import"./component-names-7924d82a.js";import"./Icon-446dff9e.js";import"./InternalUnderlinedBadgeText-781ef373.js";import"./isArray-7a60fa7f.js";import"./isObject-ffcbbb76.js";import"./icons-a9c52ed8.js";import"./orientation-409d844a.js";import"./label-bf9966d0.js";import"./events-bad0a075.js";import"./associated.controller-92af2554.js";import"./bootstrap-93c7a706.js";import"./i18n-45224cc3.js";import"./access-and-short-key-f743a5c4.js";import"./tooltip-align-465a8590.js";import"./align-d2572387.js";import"./hide-label-8b3a8709.js";import"./Alert-112aec59.js";import"./i18n-260f0fe9.js";import"./bem-e4c3a2e6.js";import"./browser-f629a56a.js";import"./Heading-733c8dda.js";class _ extends r{constructor(e,t,n){super(e,t,n),this.keyOptionMap=new Map,this.getOptionByKey=e=>this.keyOptionMap.get(e),this.isValueInOptions=(e,t)=>void 0!==t.find((t=>"string"==typeof t.value?t.value===e:!!Array.isArray(t.options)&&this.isValueInOptions(e,t.options))),this.filterValuesInOptions=(e,t)=>e.filter((e=>void 0!==this.isValueInOptions(e,t))),this.afterPatchOptions=(e,t,n,i)=>{"_value"===i&&this.setFormAssociatedValue(e)},this.beforePatchOptions=(e,t)=>{const n=t.has("_options")?t.get("_options"):this.component.state._options;if(Array.isArray(n)&&n.length>0){this.keyOptionMap.clear(),c(this.keyOptionMap,n);const e=t.has("_value")?t.get("_value"):this.component.state._value,i=this.filterValuesInOptions(Array.isArray(e)&&e.length>0?e:[],n);!1===this.component._multiple&&0===i.length?t.set("_value",[n[0].value]):Array.isArray(e)&&i.length<e.length&&t.set("_value",i)}},this.component=e}validateOptions(e){h(this.component,e,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateMultiple(e){s(this.component,"_multiple",e,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(e){s(this.component,"_required",e)}validateRows(e){u(this.component,e)}validateValue(e){l(this.component,"_value",(()=>!0),e,void 0,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateMultiple(this.component._multiple),this.validateRequired(this.component._required),this.validateRows(this.component._rows),this.validateValue(this.component._value)}}const g=t=>{var{baseClassName:n="kol-select",class:i,index:a,selectedValue:l,selected:s,value:r,label:d,disabled:c}=t,h=y(t,["baseClassName","class","index","selectedValue","selected","value","label","disabled"]);void 0===l?l=[]:Array.isArray(l)||(l=[l]);const p=s||l.includes(r);return e("option",Object.assign({class:o(`${n}__option`,{[`${n}__option--selected`]:p,[`${n}__option--disabled`]:c},i),selected:p,disabled:c,value:a},h),d)},w=({baseClassName:t,preKey:i,options:a,disabled:l,value:s,OptionProps:r={},OptionGroupProps:d={}})=>(null==a?void 0:a.length)?e(n,null,a.map(((n,c)=>{const h=[i,`-${c}`].join("");if("options"in n){if(!a.length)return null;const{label:i}=n,c=y(n,["label"]);return e("optgroup",Object.assign({class:o(`${t}__optgroup`,{[`${t}__optgroup--disabled`]:l}),key:h},d,{label:null==i?void 0:i.toString(),disabled:l}),e(w,Object.assign({baseClassName:t,OptionGroupProps:d,OptionProps:r,value:s,preKey:h},c)))}return"value"in n?e(g,Object.assign({key:h,baseClassName:t},r,{index:h,selectedValue:s},n)):null}))):null,j=t=>{const{class:n,msg:i,touched:a,disabled:l,required:s,options:r,value:d,OptionProps:c,OptionGroupProps:h,ariaDescribedBy:p,hideLabel:u,label:b}=t,v=y(t,["class","msg","touched","disabled","required","options","value","OptionProps","OptionGroupProps","ariaDescribedBy","hideLabel","label"]),_=m(i,a),g={"kol-select--disabled":Boolean(l),"kol-select--required":Boolean(s),"kol-select--touched":Boolean(a),[`kol-select--${(null==i?void 0:i.type)||"error"}`]:_},k=Object.assign(Object.assign({class:o("kol-select",g,n),required:s,disabled:l},f({ariaDescribedBy:p,hideLabel:u,label:b})),v);return e("select",Object.assign({},k),e(w,{baseClassName:"kol-select",options:r,value:d,OptionGroupProps:h,OptionProps:c}))};function x(e){const{ariaDescribedBy:t}=b(e);return{id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,options:e._options,accessKey:e._accessKey,disabled:e._disabled,name:e._name,ariaDescribedBy:t,size:e._rows,multiple:e._multiple,required:e._required,touched:e._touched,msg:v(e._msg)}}const O=t=>{var{state:n}=t,i=y(t,["state"]);return e(j,Object.assign({},x(n),i))},z='@charset "UTF-8";\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type=\'checkbox\'], [type=\'radio\'], [type=\'range\']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: "*";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: "*";\n }\n}\n@layer kol-component {\n .kol-input-container {\n align-items: center;\n background-color: white;\n display: grid;\n grid-template-columns: 1fr;\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n width: 100%;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n}\n@layer kol-component {\n .kol-select {\n width: 100%;\n /* needed hack for vertical alignment */\n }\n .kol-select:not(:disabled) {\n cursor: pointer;\n }\n .kol-select:not([multiple], [size]) {\n height: 2.75em;\n }\n .kol-select:focus {\n outline: none;\n }\n .kol-select__option:checked::before {\n content: "✓ ";\n }\n .kol-select[multiple] option {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 2) 0.5em;\n }\n}',P=z,A=class{async getValue(){return this.state._value}async kolFocus(){var e;null===(e=this.selectRef)||void 0===e||e.focus()}getFormFieldProps(){return{state:this.state,class:o("kol-form-field-select",{"kol-form-field--has-value":this.state._hasValue}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.selectRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getSelectProps(){return Object.assign(Object.assign({ref:this.catchRef,state:this.state},this.controller.onFacade),{onInput:this.onInput.bind(this),onChange:this.onChange.bind(this),onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return e(k,Object.assign({key:"33fdf8081753ace8e90195030f777e43ef56c5d7"},this.getFormFieldProps()),e(d,{key:"b1327b307a05097e79510f2bb35d89af3af94308",state:this.state},e("form",{key:"fef09038fe3d111706c872a0ca6dbd241edf00ba",onSubmit:e=>{e.preventDefault(),p({form:this.host,ref:this.selectRef})}},e("input",{key:"40e415c9a229f1b4112fb3475544db56db565872",type:"submit",hidden:!0}),e(O,Object.assign({key:"0882b17318c52bd1a34785a8e14d00c98dddcacc"},this.getSelectProps())))))}constructor(e){t(this,e),this.catchRef=e=>{this.selectRef=e},this._accessKey=void 0,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._multiple=!1,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._rows=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_hasValue:!1,_hideMsg:!1,_id:`id-${a()}`,_label:"",_multiple:!1,_options:[],_value:[]},this.inputHasFocus=!1,this.controller=new _(this,"select",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateId(e){this.controller.validateId(e)}validateLabel(e){this.controller.validateLabel(e)}validateMsg(e){this.controller.validateMsg(e)}validateMultiple(e){this.controller.validateMultiple(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validateOptions(e){this.controller.validateOptions(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTabIndex(e){this.controller.validateTabIndex(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener((e=>this.state._hasValue=!!e))}onInput(e){var t;this._value=Array.from((null===(t=this.selectRef)||void 0===t?void 0:t.options)||[]).filter((e=>!0===e.selected)).map((e=>{var t;return null===(t=this.controller.getOptionByKey(e.value))||void 0===t?void 0:t.value})),this.controller.onFacade.onInput(e,!0,this._value)}onChange(e){this.controller.onFacade.onChange(e,this._value)}get host(){return i(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_multiple:["validateMultiple"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}};A.style={default:P};export{A as kol_select};
|
4
|
+
import{h as e,F as n,r as t,g as i}from"./index-aa2635d0.js";import{c as o}from"./clsx-09a06a12.js";import{n as a}from"./dev.utils-300c83a4.js";import{i as s,z as l}from"./index-ebe5a881.js";import{I as r,a as d}from"./controller-icon-14c213a2.js";import{f as c,v as h}from"./controller-d70d121a.js";import{v as u}from"./rows-225b4f43.js";import{p}from"./controller-235b6c3b.js";import{e as f,c as m,g as b,a as v,F as k}from"./getRenderStates-d5b07576.js";import{_ as y}from"./tslib.es6-1173d062.js";import"./component-names-0657b355.js";import"./Icon-cd576310.js";import"./InternalUnderlinedBadgeText-2223c9c3.js";import"./isArray-7a60fa7f.js";import"./isObject-ffcbbb76.js";import"./icons-a9c52ed8.js";import"./orientation-409d844a.js";import"./label-bf9966d0.js";import"./events-bad0a075.js";import"./associated.controller-4237c28d.js";import"./bootstrap-53ed580c.js";import"./i18n-45224cc3.js";import"./access-and-short-key-f743a5c4.js";import"./tooltip-align-465a8590.js";import"./align-d2572387.js";import"./hide-label-8b3a8709.js";import"./Alert-e58cf301.js";import"./i18n-260f0fe9.js";import"./bem-e4c3a2e6.js";import"./browser-f629a56a.js";import"./Heading-dcf25cb6.js";class _ extends r{constructor(e,t,n){super(e,t,n),this.keyOptionMap=new Map,this.getOptionByKey=e=>this.keyOptionMap.get(e),this.isValueInOptions=(e,t)=>void 0!==t.find((t=>"string"==typeof t.value?t.value===e:!!Array.isArray(t.options)&&this.isValueInOptions(e,t.options))),this.filterValuesInOptions=(e,t)=>e.filter((e=>void 0!==this.isValueInOptions(e,t))),this.afterPatchOptions=(e,t,n,i)=>{"_value"===i&&this.setFormAssociatedValue(e)},this.beforePatchOptions=(e,t)=>{const n=t.has("_options")?t.get("_options"):this.component.state._options;if(Array.isArray(n)&&n.length>0){this.keyOptionMap.clear(),c(this.keyOptionMap,n);const e=t.has("_value")?t.get("_value"):this.component.state._value,i=this.filterValuesInOptions(Array.isArray(e)&&e.length>0?e:[],n);!1===this.component._multiple&&0===i.length?t.set("_value",[n[0].value]):Array.isArray(e)&&i.length<e.length&&t.set("_value",i)}},this.component=e}validateOptions(e){h(this.component,e,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateMultiple(e){s(this.component,"_multiple",e,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(e){s(this.component,"_required",e)}validateRows(e){u(this.component,e)}validateValue(e){l(this.component,"_value",(()=>!0),e,void 0,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateMultiple(this.component._multiple),this.validateRequired(this.component._required),this.validateRows(this.component._rows),this.validateValue(this.component._value)}}const g=t=>{var{baseClassName:n="kol-select",class:i,index:a,selectedValue:l,selected:s,value:r,label:d,disabled:c}=t,h=y(t,["baseClassName","class","index","selectedValue","selected","value","label","disabled"]);void 0===l?l=[]:Array.isArray(l)||(l=[l]);const p=s||l.includes(r);return e("option",Object.assign({class:o(`${n}__option`,{[`${n}__option--selected`]:p,[`${n}__option--disabled`]:c},i),selected:p,disabled:c,value:a},h),d)},w=({baseClassName:t,preKey:i,options:a,disabled:l,value:s,OptionProps:r={},OptionGroupProps:d={}})=>(null==a?void 0:a.length)?e(n,null,a.map(((n,c)=>{const h=[i,`-${c}`].join("");if("options"in n){if(!a.length)return null;const{label:i}=n,c=y(n,["label"]);return e("optgroup",Object.assign({class:o(`${t}__optgroup`,{[`${t}__optgroup--disabled`]:l}),key:h},d,{label:null==i?void 0:i.toString(),disabled:l}),e(w,Object.assign({baseClassName:t,OptionGroupProps:d,OptionProps:r,value:s,preKey:h},c)))}return"value"in n?e(g,Object.assign({key:h,baseClassName:t},r,{index:h,selectedValue:s},n)):null}))):null,j=t=>{const{class:n,msg:i,touched:a,disabled:l,required:s,options:r,value:d,OptionProps:c,OptionGroupProps:h,ariaDescribedBy:p,hideLabel:u,label:b}=t,v=y(t,["class","msg","touched","disabled","required","options","value","OptionProps","OptionGroupProps","ariaDescribedBy","hideLabel","label"]),_=m(i,a),g={"kol-select--disabled":Boolean(l),"kol-select--required":Boolean(s),"kol-select--touched":Boolean(a),[`kol-select--${(null==i?void 0:i.type)||"error"}`]:_},k=Object.assign(Object.assign({class:o("kol-select",g,n),required:s,disabled:l},f({ariaDescribedBy:p,hideLabel:u,label:b})),v);return e("select",Object.assign({},k),e(w,{baseClassName:"kol-select",options:r,value:d,OptionGroupProps:h,OptionProps:c}))};function x(e){const{ariaDescribedBy:t}=b(e);return{id:e._id,hideLabel:e._hideLabel,label:e._label,value:e._value,options:e._options,accessKey:e._accessKey,disabled:e._disabled,name:e._name,ariaDescribedBy:t,size:e._rows,multiple:e._multiple,required:e._required,touched:e._touched,msg:v(e._msg)}}const O=t=>{var{state:n}=t,i=y(t,["state"]);return e(j,Object.assign({},x(n),i))},z='@charset "UTF-8";\n/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type=\'checkbox\'], [type=\'radio\'], [type=\'range\']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: "*";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: "*";\n }\n}\n@layer kol-component {\n .kol-input-container {\n align-items: center;\n background-color: white;\n display: grid;\n grid-template-columns: 1fr;\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n width: 100%;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n}\n@layer kol-component {\n .kol-select {\n width: 100%;\n /* needed hack for vertical alignment */\n }\n .kol-select:not(:disabled) {\n cursor: pointer;\n }\n .kol-select:not([multiple], [size]) {\n height: 2.75em;\n }\n .kol-select:focus {\n outline: none;\n }\n .kol-select__option:checked::before {\n content: "✓ ";\n }\n .kol-select[multiple] option {\n padding: calc((var(--a11y-min-size) - (16rem / var(--kolibri-root-font-size, 16))) / 2) 0.5em;\n }\n}',P=z,A=class{async getValue(){return this.state._value}async kolFocus(){var e;null===(e=this.selectRef)||void 0===e||e.focus()}getFormFieldProps(){return{state:this.state,class:o("kol-form-field-select",{"kol-form-field--has-value":this.state._hasValue}),tooltipAlign:this._tooltipAlign,onClick:()=>{var e;return null===(e=this.selectRef)||void 0===e?void 0:e.focus()},alert:this.showAsAlert()}}getSelectProps(){return Object.assign(Object.assign({ref:this.catchRef,state:this.state},this.controller.onFacade),{onInput:this.onInput.bind(this),onChange:this.onChange.bind(this),onFocus:e=>{this.controller.onFacade.onFocus(e),this.inputHasFocus=!0},onBlur:e=>{this.controller.onFacade.onBlur(e),this.inputHasFocus=!1}})}render(){return e(k,Object.assign({key:"bc7ee077bca2efc065987ce71be494bc78712b0a"},this.getFormFieldProps()),e(d,{key:"2bde683bfdf19e78a6aa6d980925aa6d6b06ce20",state:this.state},e("form",{key:"582987d654fa36f36a292d2cde2ca57190fc20bd",onSubmit:e=>{e.preventDefault(),p({form:this.host,ref:this.selectRef})}},e("input",{key:"0de3d2fffb493d7f5e71f0442578236b54a37ba2",type:"submit",hidden:!0}),e(O,Object.assign({key:"eff29e3d817ccfee364b7452c46a38e5162bd905"},this.getSelectProps())))))}constructor(e){t(this,e),this.catchRef=e=>{this.selectRef=e},this._accessKey=void 0,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._multiple=!1,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._rows=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_hasValue:!1,_hideMsg:!1,_id:`id-${a()}`,_label:"",_multiple:!1,_options:[],_value:[]},this.inputHasFocus=!1,this.controller=new _(this,"select",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validateAccessKey(e){this.controller.validateAccessKey(e)}validateDisabled(e){this.controller.validateDisabled(e)}validateHideMsg(e){this.controller.validateHideMsg(e)}validateHideLabel(e){this.controller.validateHideLabel(e)}validateHint(e){this.controller.validateHint(e)}validateIcons(e){this.controller.validateIcons(e)}validateId(e){this.controller.validateId(e)}validateLabel(e){this.controller.validateLabel(e)}validateMsg(e){this.controller.validateMsg(e)}validateMultiple(e){this.controller.validateMultiple(e)}validateName(e){this.controller.validateName(e)}validateOn(e){this.controller.validateOn(e)}validateOptions(e){this.controller.validateOptions(e)}validateRequired(e){this.controller.validateRequired(e)}validateRows(e){this.controller.validateRows(e)}validateShortKey(e){this.controller.validateShortKey(e)}validateSyncValueBySelector(e){this.controller.validateSyncValueBySelector(e)}validateTabIndex(e){this.controller.validateTabIndex(e)}validateTouched(e){this.controller.validateTouched(e)}validateValue(e){this.controller.validateValue(e)}componentWillLoad(){this._touched=!0===this._touched,this.controller.componentWillLoad(),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener((e=>this.state._hasValue=!!e))}onInput(e){var t;this._value=Array.from((null===(t=this.selectRef)||void 0===t?void 0:t.options)||[]).filter((e=>!0===e.selected)).map((e=>{var t;return null===(t=this.controller.getOptionByKey(e.value))||void 0===t?void 0:t.value})),this.controller.onFacade.onInput(e,!0,this._value)}onChange(e){this.controller.onFacade.onChange(e,this._value)}get host(){return i(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_multiple:["validateMultiple"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_rows:["validateRows"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}};A.style={default:P};export{A as kol_select};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{h as t,r as e,g as i}from"./index-1ed13705.js";import{c as n}from"./clsx-09a06a12.js";import{e as s}from"./component-names-7924d82a.js";import{F as o}from"./getRenderStates-c4b5c6cb.js";import{I as a,a as l}from"./controller-icon-de12de48.js";import{I as r}from"./InputStateWrapper-9b8419a8.js";import{g as h,C as d,a as c,b as u}from"./CustomSuggestionsOptionsGroup-dcff90e4.js";import{t as f}from"./i18n-260f0fe9.js";import{n as p}from"./dev.utils-cb61837d.js";import{i as m,w as b,B as v,E as g}from"./index-ebe5a881.js";import{f as k,b as y}from"./controller-ce246aad.js";import"./events-bad0a075.js";import"./associated.controller-92af2554.js";import"./bootstrap-93c7a706.js";import"./i18n-45224cc3.js";import"./access-and-short-key-f743a5c4.js";import"./tooltip-align-465a8590.js";import"./align-d2572387.js";import"./hide-label-8b3a8709.js";import"./label-bf9966d0.js";import"./tslib.es6-1173d062.js";import"./Alert-112aec59.js";import"./bem-e4c3a2e6.js";import"./browser-f629a56a.js";import"./Heading-733c8dda.js";import"./InternalUnderlinedBadgeText-781ef373.js";import"./isArray-7a60fa7f.js";import"./Icon-446dff9e.js";import"./isObject-ffcbbb76.js";import"./icons-a9c52ed8.js";import"./Input-8502a991.js";import"./orientation-409d844a.js";class _ extends a{constructor(t,e,n){super(t,e,n),this.keyOptionMap=new Map,this.afterPatchOptions=(t,e,n,i)=>{"_value"===i&&this.setFormAssociatedValue(t)},this.beforePatchOptions=(t,e)=>{const n=e.has("_options")?e.get("_options"):this.component.state._options;Array.isArray(n)&&n.length>0&&(this.keyOptionMap.clear(),k(this.keyOptionMap,n))},this.component=t}validateOptions(t){y(this.component,t,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(t){m(this.component,"_required",t)}validateValue(t){b(this.component,"_value",(t=>void 0!==t),new Set(["KoliBriUnknown"]),t)}validatePlaceholder(t){v(this.component,"_placeholder",t)}validateHideClearButton(t){m(this.component,"_hideClearButton",t)}validateRows(t){g(this.component,"_rows",t)}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateRequired(this.component._required),this.validateValue(this.component._value),this.validatePlaceholder(this.component._placeholder),this.validateHideClearButton(this.component._hideClearButton),this.validateRows(this.component._rows)}}const w="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-custom-suggestions-option {\n cursor: pointer;\n white-space: normal;\n overflow-wrap: break-word;\n word-wrap: break-word;\n line-height: 1.5;\n }\n .kol-custom-suggestions-options-group--cursor-hidden .kol-custom-suggestions-option {\n cursor: none !important;\n }\n}\n@layer kol-component {\n .kol-custom-suggestions-options-group {\n display: block;\n position: absolute;\n list-style-type: none;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n overflow-x: hidden;\n z-index: 2;\n background-color: white;\n max-height: calc(250rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-custom-suggestions-toggle {\n align-items: center;\n display: flex;\n height: var(--a11y-min-size);\n width: var(--a11y-min-size);\n }\n .kol-custom-suggestions-toggle:not(:disabled) {\n cursor: pointer;\n }\n}\n@layer kol-component {\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: \"*\";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n .kol-input-container {\n align-items: center;\n background-color: white;\n display: grid;\n grid-template-columns: 1fr;\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n width: 100%;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n}\n@layer kol-component {\n .kol-input {\n min-width: var(--a11y-min-size);\n width: 100%;\n }\n .kol-input:focus {\n outline: none;\n }\n}\n@layer kol-component {\n .kol-single-select__delete {\n cursor: pointer;\n }\n .kol-single-select__delete--disabled {\n cursor: not-allowed;\n }\n .kol-single-select__no-results-message {\n cursor: default;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: calc(50rem / var(--kolibri-root-font-size, 16));\n }\n .kol-single-select .kol-custom-suggestions-options-group {\n max-height: calc((40rem / var(--kolibri-root-font-size, 16)) * var(--visible-options, 5) + (2rem / var(--kolibri-root-font-size, 16))) !important;\n }\n}",x=w,j=class{async getValue(){return this._value}async kolFocus(){var t;null===(t=this.refInput)||void 0===t||t.focus()}onBlur(){var t;Array.isArray(this.state._options)&&this.state._options.length>0&&!this.state._options.some((t=>t.label===this._inputValue))&&(this._inputValue=null===(t=this.state._options.find((t=>t.value===this._value)))||void 0===t?void 0:t.label,this._filteredOptions=[...this.state._options]),this._isOpen=!1,this._hasOpened=!1}clearSelection(){if(!this.state._disabled){const t=null;this._focusedOptionIndex=-1,this._value=t,this._inputValue="",this._filteredOptions=[...this.state._options],this.controller.onFacade.onInput(new CustomEvent("input",{bubbles:!0,detail:{name:this.state._name,value:t}}),!0,t),this.controller.onFacade.onChange(new CustomEvent("change",{bubbles:!0,detail:{name:this.state._name,value:t}}),t)}}selectOption(t){this._value=t.value,this._inputValue=t.label,this.controller.onFacade.onInput(new CustomEvent("input",{bubbles:!0,detail:{name:this.state._name,value:t.value}}),!1,t.value),this.controller.onFacade.onChange(new CustomEvent("change",{bubbles:!0,detail:{name:this.state._name,value:t.value}}),t.value),this._filteredOptions=[...this.state._options],this.controller.setFormAssociatedValue(this._value)}onInput(t){const e=t.target;this._inputValue=e.value,this._isOpen=!0,this.setFilteredOptionsByQuery(e.value),this._focusedOptionIndex=-1}handleKeyDownDropdown(t){1===t.key.length&&/[a-z0-9]/i.test(t.key)&&(t.preventDefault(),this._isOpen=!0,this.focusSuggestionStartingWith(t.key))}setFilteredOptionsByQuery(t){""===(null==t?void 0:t.trim())?this._filteredOptions=[...this.state._options]:Array.isArray(this.state._options)&&this.state._options.length>0&&t.length>0&&(this._filteredOptions=this.state._options.filter((e=>{var n,i;return null===(i=null===(n=e.label)||void 0===n?void 0:n.toLowerCase())||void 0===i?void 0:i.includes(null==t?void 0:t.toLowerCase())})))}moveFocus(t){if(!this._filteredOptions)return;let e=this._focusedOptionIndex+t;e>=this._filteredOptions.length&&(e=0),e<0&&(e=this._filteredOptions.length-1),this._focusedOptionIndex=e,this.focusOption(this._focusedOptionIndex)}focusOption(t){if(this.refOptions){const e=this.refOptions[t];null==e||e.focus()}}focusSuggestionStartingWith(t){const e=t.toLowerCase(),n=Array.isArray(this._filteredOptions)&&this._filteredOptions.findIndex((t=>t.label.toLowerCase().startsWith(e)));"number"==typeof n&&(this._focusedOptionIndex=n,this.focusOption(n))}getFormFieldProps(){return{state:this.state,class:"kol-single-select",tooltipAlign:this._tooltipAlign,onClick:()=>{var t;return null===(t=this.refInput)||void 0===t?void 0:t.focus()},alert:this.showAsAlert()}}getInputProps(){const{ariaDescribedBy:t}=h(this.state);return Object.assign(Object.assign({"aria-activedescendant":this._isOpen&&this._focusedOptionIndex>=0?`option-${this._focusedOptionIndex}`:void 0,"aria-autocomplete":"both","aria-controls":"listbox","aria-describedby":t.length>0?t.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,accessKey:this.state._accessKey,autocapitalize:"off",autocorrect:"off",class:"kol-single-select__input",disabled:this.state._disabled,name:this.state._name,placeholder:this.state._placeholder,ref:this.catchRef,required:this.state._required,state:this.state,type:"text",value:this._inputValue},this.controller.onFacade),{onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onInput:this.onInput.bind(this),onFocus:t=>{this.controller.onFacade.onFocus(t),this.inputHasFocus=!0},onBlur:t=>{this.controller.onFacade.onBlur(t),this.inputHasFocus=!1}})}render(){var e;return t(o,Object.assign({key:"3be581bedba65017d37af23aa15b99adff79ec0f"},this.getFormFieldProps()),t(l,{key:"0937db03f4b6c2fc3b91a87e3bcca079014a93a6",state:this.state},t("div",{key:"3ad19c192be283728807ac6bd34d90643baeff51",class:"kol-single-select__group"},t(r,Object.assign({key:"52672442da47bf366871b9c5922e54023d5ed984"},this.getInputProps())),this._inputValue&&!this.state._hideClearButton&&t(s,{key:"275fe6ab7720074988ea09ca7173c805e41137a7",_icons:"codicon codicon-close","data-testid":"single-select-delete",_label:f("kol-delete-selection"),onClick:()=>{var t;this.clearSelection(),null===(t=this.refInput)||void 0===t||t.focus()},class:n("kol-single-select__delete",{"kol-single-select__delete--disabled":this.state._disabled})}),t(d,{key:"68ac00c8eed96090dabfad30bf19914127f4320c",onClick:this.toggleListbox.bind(this),disabled:this.state._disabled})),this._isOpen&&!(!0===this.state._disabled)&&t(c,{key:"e4278a4999682a51ffa6d2c188e8f5ce432e3317",blockSuggestionMouseOver:this.blockSuggestionMouseOver,onKeyDown:this.handleKeyDownDropdown.bind(this),style:{"--visible-options":`${null!==(e=this._rows)&&void 0!==e?e:5}`}},Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0?this._filteredOptions.map(((e,n)=>t(u,{index:n,option:e.label,ref:t=>{t&&(this.refOptions[n]=t)},selected:this._value===e.value,onClick:t=>{var n;this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),this._isOpen=!1,this._hasOpened=!1},onMouseOver:()=>{this.blockSuggestionMouseOver||(this._focusedOptionIndex=n,this.focusOption(n))},onFocus:()=>{this._focusedOptionIndex=n,this.focusOption(n)},onKeyDown:t=>{var n;"Enter"!==t.key&&"NumpadEnter"!==t.key||(this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),t.preventDefault())}}))):t("li",{class:"kol-single-select__no-results-message"},f("kol-no-results-message")," "))))}handleFocusOut(){setTimeout((()=>{var t;(null===(t=this.host)||void 0===t?void 0:t.contains(document.activeElement))||this.onBlur()}),0)}handleWindowBlur(){this.onBlur()}handleKeyDown(t){var e,n;const i=(e,n)=>{var i;t.preventDefault(),void 0!==e&&(this._isOpen=e,e||null===(i=this.refInput)||void 0===i||i.focus()),null==n||n()};switch(t.key){case"Down":case"ArrowDown":this.blockSuggestionMouseOver=!0,i(!0,(()=>this.moveFocus(1)));break;case"Up":case"ArrowUp":this.blockSuggestionMouseOver=!0,i(!0,(()=>this.moveFocus(-1)));break;case"Tab":this._isOpen&&(this._isOpen=!this._isOpen,null===(e=this.refInput)||void 0===e||e.focus());break;case"Esc":case"Escape":this._hasOpened=!1,this._isOpen=!1,i(!1);break;case" ":this._isOpen?Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0&&(this.selectOption(this._filteredOptions[this._focusedOptionIndex]),null===(n=this.refInput)||void 0===n||n.focus(),i(!1)):this.toggleListbox(t);break;case"NumpadEnter":case"Enter":this.toggleListbox(t),this._hasOpened=!1,this._isOpen=!1;break;case"Home":this.blockSuggestionMouseOver=!0,i(void 0,(()=>{this._isOpen&&(this._focusedOptionIndex=0,this.focusOption(this._focusedOptionIndex))}));break;case"End":this.blockSuggestionMouseOver=!0,i(void 0,(()=>{this._isOpen&&(this._focusedOptionIndex=this._filteredOptions?this._filteredOptions.length-1:0,this.focusOption(this._focusedOptionIndex))}));break;case"PageUp":this.blockSuggestionMouseOver=!0,i(void 0,(()=>this._isOpen&&this.moveFocus(-10)));break;case"PageDown":this.blockSuggestionMouseOver=!0,i(void 0,(()=>this._isOpen&&this.moveFocus(10)))}}constructor(t){e(this,t),this.refOptions=[],this.catchRef=t=>{this.refInput=t},this.toggleListbox=t=>{var e;if(null==t||t.preventDefault(),!this.state._disabled&&!this._hasOpened){this._isOpen=!0,this._hasOpened=!0,null===(e=this.refInput)||void 0===e||e.focus();const t=Array.isArray(this._filteredOptions)?this._filteredOptions.findIndex((t=>t.label===this._inputValue)):-1;this._focusedOptionIndex=t>=0?t:-1,this.focusOption(this._focusedOptionIndex)}},this._focusedOptionIndex=-1,this._isOpen=!1,this._filteredOptions=[],this._inputValue="",this.blockSuggestionMouseOver=!1,this._hasOpened=!1,this._accessKey=void 0,this._placeholder=void 0,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._syncValueBySelector=void 0,this._tooltipAlign="top",this._touched=!1,this._value=null,this._hideClearButton=!1,this._rows=void 0,this.state={_hideMsg:!1,_id:`id-${p()}`,_label:"",_options:[],_hideClearButton:!1},this.inputHasFocus=!1,this.controller=new _(this,"single-select",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validatePlaceholder(t){this.controller.validatePlaceholder(t)}validateAccessKey(t){this.controller.validateAccessKey(t)}validateDisabled(t){this.controller.validateDisabled(t)}validateHideMsg(t){this.controller.validateHideMsg(t)}validateHideLabel(t){this.controller.validateHideLabel(t)}validateHint(t){this.controller.validateHint(t)}validateIcons(t){this.controller.validateIcons(t)}validateId(t){this.controller.validateId(t)}validateLabel(t){this.controller.validateLabel(t)}validateMsg(t){this.controller.validateMsg(t)}validateName(t){this.controller.validateName(t)}validateOn(t){this.controller.validateOn(t)}validateOptions(t){this.controller.validateOptions(t),this._filteredOptions=t,this.updateInputValue(this._value)}validateRequired(t){this.controller.validateRequired(t)}validateShortKey(t){this.controller.validateShortKey(t)}validateSyncValueBySelector(t){this.controller.validateSyncValueBySelector(t)}validateTouched(t){this.controller.validateTouched(t)}validateValue(t){this.controller.validateValue(t),this.oldValue=t,this.updateInputValue(t)}validateHideClearButton(t){this.controller.validateHideClearButton(t)}validateRows(t){this.controller.validateRows(t)}handleMouseEvent(){this.blockSuggestionMouseOver=!1}updateInputValue(t){if(Array.isArray(this._options)){const e=this._options.find((e=>e.value===t));this._inputValue=e?String(e.label):""}}componentWillLoad(){this.refOptions=[],this._touched=!0===this._touched,this.controller.componentWillLoad(),this.oldValue=this._value,this._filteredOptions=this.state._options,this.updateInputValue(this._value)}onChange(t){var e,n;this.oldValue!==(null===(e=this.refInput)||void 0===e?void 0:e.value)&&(this.oldValue=null===(n=this.refInput)||void 0===n?void 0:n.value),this._isOpen||this.controller.onFacade.onChange(t,this._value)}onClick(t){this.toggleListbox(t),this.controller.onFacade.onClick(t)}static get delegatesFocus(){return!0}get host(){return i(this)}static get watchers(){return{_placeholder:["validatePlaceholder"],_accessKey:["validateAccessKey"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"],"_hideClearButton ":["validateHideClearButton"],_rows:["validateRows"]}}};j.style={default:x};export{j as kol_single_select};
|
4
|
+
import{h as t,r as e,g as i}from"./index-aa2635d0.js";import{c as n}from"./clsx-09a06a12.js";import{e as s}from"./component-names-0657b355.js";import{F as o}from"./getRenderStates-d5b07576.js";import{I as a,a as l}from"./controller-icon-14c213a2.js";import{I as r}from"./InputStateWrapper-c166c7ed.js";import{g as h,C as d,a as c,b as u}from"./CustomSuggestionsOptionsGroup-72c6ff70.js";import{t as f}from"./i18n-260f0fe9.js";import{n as p}from"./dev.utils-300c83a4.js";import{i as m,w as b,B as v,E as g}from"./index-ebe5a881.js";import{f as k,b as y}from"./controller-d70d121a.js";import"./events-bad0a075.js";import"./associated.controller-4237c28d.js";import"./bootstrap-53ed580c.js";import"./i18n-45224cc3.js";import"./access-and-short-key-f743a5c4.js";import"./tooltip-align-465a8590.js";import"./align-d2572387.js";import"./hide-label-8b3a8709.js";import"./label-bf9966d0.js";import"./tslib.es6-1173d062.js";import"./Alert-e58cf301.js";import"./bem-e4c3a2e6.js";import"./browser-f629a56a.js";import"./Heading-dcf25cb6.js";import"./InternalUnderlinedBadgeText-2223c9c3.js";import"./isArray-7a60fa7f.js";import"./Icon-cd576310.js";import"./isObject-ffcbbb76.js";import"./icons-a9c52ed8.js";import"./Input-673592ef.js";import"./orientation-409d844a.js";class _ extends a{constructor(t,e,n){super(t,e,n),this.keyOptionMap=new Map,this.afterPatchOptions=(t,e,n,i)=>{"_value"===i&&this.setFormAssociatedValue(t)},this.beforePatchOptions=(t,e)=>{const n=e.has("_options")?e.get("_options"):this.component.state._options;Array.isArray(n)&&n.length>0&&(this.keyOptionMap.clear(),k(this.keyOptionMap,n))},this.component=t}validateOptions(t){y(this.component,t,{hooks:{afterPatch:this.afterPatchOptions,beforePatch:this.beforePatchOptions}})}validateRequired(t){m(this.component,"_required",t)}validateValue(t){b(this.component,"_value",(t=>void 0!==t),new Set(["KoliBriUnknown"]),t)}validatePlaceholder(t){v(this.component,"_placeholder",t)}validateHideClearButton(t){m(this.component,"_hideClearButton",t)}validateRows(t){g(this.component,"_rows",t)}componentWillLoad(){super.componentWillLoad(),this.validateOptions(this.component._options),this.validateRequired(this.component._required),this.validateValue(this.component._value),this.validatePlaceholder(this.component._placeholder),this.validateHideClearButton(this.component._hideClearButton),this.validateRows(this.component._rows)}}const w="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n :host {\n /*\n * Minimum size of interactive elements.\n */\n --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));\n /*\n * No element should be used without a background and font color whose contrast ratio has\n * not been checked. By initially setting the background color to white and the font color\n * to black, the contrast ratio is ensured and explicit adjustment is forced.\n */\n background-color: white;\n color: black;\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 * 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 * This rule enables the word dividing for all texts. That is important for high zoom levels.\n */\n word-break: break-word;\n /*\n * Word spacing is required for all texts.\n */\n word-spacing: inherit;\n }\n /*\n * All interactive elements should have a minimum size of rem(44).\n */\n /* input:not([type='checkbox'], [type='radio'], [type='range']), */\n /* option, */\n /* select, */\n /* textarea, */\n [role=button],\n button:not([role=link]),\n .kol-input .input {\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n }\n /*\n * Some interactive elements should not inherit the font-family and font-size.\n */\n a,\n button,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n input,\n option,\n select,\n textarea {\n /*\n * All elements should inherit the font family from his parent element.\n */\n font-family: inherit;\n /*\n * All elements should inherit the font size from his parent element.\n */\n font-size: inherit;\n }\n}\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 clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\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 border: none;\n margin: 0;\n padding: 0;\n width: 100%;\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 background-color: lightgray;\n color: black;\n }\n}\n@layer kol-global {\n :host {\n font-size: rem(16);\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 }\n * {\n /*\n * We prefer to box-sizing: border-box for all elements.\n */\n box-sizing: border-box;\n }\n .kol-span {\n /* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n display: grid;\n place-items: center;\n /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n }\n .kol-span__container {\n display: flex;\n place-items: center;\n }\n a,\n button {\n cursor: pointer;\n }\n .kol-span .kol-span__label--hide-label .kol-span__label {\n display: none;\n }\n /* Reset browser agent style. */\n button:disabled {\n color: unset;\n }\n .disabled label,\n .disabled:focus-within label,\n [aria-disabled=true],\n [aria-disabled=true]:focus,\n [disabled],\n [disabled]:focus {\n cursor: not-allowed;\n opacity: 0.5;\n outline: none;\n }\n [aria-disabled=true]:focus .kol-span,\n [disabled]:focus .kol-span {\n outline: none !important;\n }\n}\n@layer kol-component {\n :host {\n display: block;\n }\n}\n@layer kol-component {\n .kol-tooltip {\n display: contents;\n }\n .kol-tooltip__floating {\n animation-duration: 0.25s;\n animation-iteration-count: 1;\n animation-name: fadeInOpacity;\n animation-timing-function: ease-in;\n display: none;\n position: fixed;\n visibility: hidden;\n /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */\n top: 0;\n left: 0;\n max-width: 90vw;\n max-height: 90vh;\n /* Can be used to specify the tooltip-width from the outside. Unset by default. */\n width: var(--kol-tooltip-width);\n }\n .kol-tooltip__arrow {\n background-color: #fff;\n color: #000;\n height: calc(10rem / var(--kolibri-root-font-size, 16));\n position: absolute;\n transform: rotate(45deg);\n width: calc(10rem / var(--kolibri-root-font-size, 16));\n z-index: 999;\n }\n .kol-tooltip__content {\n background-color: #fff;\n color: #000;\n position: relative;\n z-index: 1000;\n }\n @keyframes fadeInOpacity {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n@layer kol-component {\n .kol-alert {\n display: grid;\n }\n .kol-alert__container {\n place-items: center;\n display: flex;\n }\n .kol-alert__container-content {\n flex-grow: 1;\n }\n .kol-alert__closer {\n /* Visible with forced colors */\n outline: transparent solid calc(1rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-custom-suggestions-option {\n cursor: pointer;\n white-space: normal;\n overflow-wrap: break-word;\n word-wrap: break-word;\n line-height: 1.5;\n }\n .kol-custom-suggestions-options-group--cursor-hidden .kol-custom-suggestions-option {\n cursor: none !important;\n }\n}\n@layer kol-component {\n .kol-custom-suggestions-options-group {\n display: block;\n position: absolute;\n list-style-type: none;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n overflow-x: hidden;\n z-index: 2;\n background-color: white;\n max-height: calc(250rem / var(--kolibri-root-font-size, 16));\n }\n}\n@layer kol-component {\n .kol-custom-suggestions-toggle {\n align-items: center;\n display: flex;\n height: var(--a11y-min-size);\n width: var(--a11y-min-size);\n }\n .kol-custom-suggestions-toggle:not(:disabled) {\n cursor: pointer;\n }\n}\n@layer kol-component {\n .kol-form-field {\n display: grid;\n }\n .kol-form-field:not(.kol-form-field--disabled) .kol-form-field__label {\n cursor: pointer;\n }\n .kol-form-field--disabled .kol-form-field__label {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__label-text::after {\n content: \"*\";\n }\n .kol-form-field--disabled .kol-form-field__hint {\n opacity: 0.5;\n }\n .kol-form-field--required .kol-form-field__tooltip .span-label::after {\n content: \"*\";\n }\n}\n@layer kol-component {\n .kol-input-container {\n align-items: center;\n background-color: white;\n display: grid;\n grid-template-columns: 1fr;\n min-height: var(--a11y-min-size);\n min-width: var(--a11y-min-size);\n width: 100%;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start) {\n grid-template-columns: auto 1fr;\n }\n .kol-input-container:has(> .kol-input-container__adornment--end) {\n grid-template-columns: 1fr auto;\n }\n .kol-input-container:has(> .kol-input-container__adornment--start):has(> .kol-input-container__adornment--end) {\n grid-template-columns: auto 1fr auto;\n }\n .kol-input-container__container {\n position: relative;\n }\n .kol-input-container__adornment {\n display: flex;\n align-items: center;\n }\n .kol-input-container__adornment .kol-icon {\n display: grid;\n height: var(--a11y-min-size);\n place-items: center;\n }\n}\n@layer kol-component {\n .kol-input {\n min-width: var(--a11y-min-size);\n width: 100%;\n }\n .kol-input:focus {\n outline: none;\n }\n}\n@layer kol-component {\n .kol-single-select__delete {\n cursor: pointer;\n }\n .kol-single-select__delete--disabled {\n cursor: not-allowed;\n }\n .kol-single-select__no-results-message {\n cursor: default;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: calc(50rem / var(--kolibri-root-font-size, 16));\n }\n .kol-single-select .kol-custom-suggestions-options-group {\n max-height: calc((40rem / var(--kolibri-root-font-size, 16)) * var(--visible-options, 5) + (2rem / var(--kolibri-root-font-size, 16))) !important;\n }\n}",x=w,j=class{async getValue(){return this._value}async kolFocus(){var t;null===(t=this.refInput)||void 0===t||t.focus()}onBlur(){var t;Array.isArray(this.state._options)&&this.state._options.length>0&&!this.state._options.some((t=>t.label===this._inputValue))&&(this._inputValue=null===(t=this.state._options.find((t=>t.value===this._value)))||void 0===t?void 0:t.label,this._filteredOptions=[...this.state._options]),this._isOpen=!1,this._hasOpened=!1}clearSelection(){if(!this.state._disabled){const t=null;this._focusedOptionIndex=-1,this._value=t,this._inputValue="",this._filteredOptions=[...this.state._options],this.controller.onFacade.onInput(new CustomEvent("input",{bubbles:!0,detail:{name:this.state._name,value:t}}),!0,t),this.controller.onFacade.onChange(new CustomEvent("change",{bubbles:!0,detail:{name:this.state._name,value:t}}),t)}}selectOption(t){this._value=t.value,this._inputValue=t.label,this.controller.onFacade.onInput(new CustomEvent("input",{bubbles:!0,detail:{name:this.state._name,value:t.value}}),!1,t.value),this.controller.onFacade.onChange(new CustomEvent("change",{bubbles:!0,detail:{name:this.state._name,value:t.value}}),t.value),this._filteredOptions=[...this.state._options],this.controller.setFormAssociatedValue(this._value)}onInput(t){const e=t.target;this._inputValue=e.value,this._isOpen=!0,this.setFilteredOptionsByQuery(e.value),this._focusedOptionIndex=-1}handleKeyDownDropdown(t){1===t.key.length&&/[a-z0-9]/i.test(t.key)&&(t.preventDefault(),this._isOpen=!0,this.focusSuggestionStartingWith(t.key))}setFilteredOptionsByQuery(t){""===(null==t?void 0:t.trim())?this._filteredOptions=[...this.state._options]:Array.isArray(this.state._options)&&this.state._options.length>0&&t.length>0&&(this._filteredOptions=this.state._options.filter((e=>{var n,i;return null===(i=null===(n=e.label)||void 0===n?void 0:n.toLowerCase())||void 0===i?void 0:i.includes(null==t?void 0:t.toLowerCase())})))}moveFocus(t){if(!this._filteredOptions)return;let e=this._focusedOptionIndex+t;e>=this._filteredOptions.length&&(e=0),e<0&&(e=this._filteredOptions.length-1),this._focusedOptionIndex=e,this.focusOption(this._focusedOptionIndex)}focusOption(t){if(this.refOptions){const e=this.refOptions[t];null==e||e.focus()}}focusSuggestionStartingWith(t){const e=t.toLowerCase(),n=Array.isArray(this._filteredOptions)&&this._filteredOptions.findIndex((t=>t.label.toLowerCase().startsWith(e)));"number"==typeof n&&(this._focusedOptionIndex=n,this.focusOption(n))}getFormFieldProps(){return{state:this.state,class:"kol-single-select",tooltipAlign:this._tooltipAlign,onClick:()=>{var t;return null===(t=this.refInput)||void 0===t?void 0:t.focus()},alert:this.showAsAlert()}}getInputProps(){const{ariaDescribedBy:t}=h(this.state);return Object.assign(Object.assign({"aria-activedescendant":this._isOpen&&this._focusedOptionIndex>=0?`option-${this._focusedOptionIndex}`:void 0,"aria-autocomplete":"both","aria-controls":"listbox","aria-describedby":t.length>0?t.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,accessKey:this.state._accessKey,autocapitalize:"off",autocorrect:"off",class:"kol-single-select__input",disabled:this.state._disabled,name:this.state._name,placeholder:this.state._placeholder,ref:this.catchRef,required:this.state._required,state:this.state,type:"text",value:this._inputValue},this.controller.onFacade),{onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onInput:this.onInput.bind(this),onFocus:t=>{this.controller.onFacade.onFocus(t),this.inputHasFocus=!0},onBlur:t=>{this.controller.onFacade.onBlur(t),this.inputHasFocus=!1}})}render(){var e;return t(o,Object.assign({key:"8fe1e0ddbc6f0e5cca5bf40d7561d6ffbaa9d86a"},this.getFormFieldProps()),t(l,{key:"5ddad77ea681aa06e508a083a3ef8ecc546d9d2f",state:this.state},t("div",{key:"3d8be2eb2a7edea1210bcebf8da7f9ce98979ae5",class:"kol-single-select__group"},t(r,Object.assign({key:"3fd99d2c4903aa8e60ec5b154681b4364c4c2327"},this.getInputProps())),this._inputValue&&!this.state._hideClearButton&&t(s,{key:"bcf7c708fd90ec9ec5acbd830c868a9325a1ab22",_icons:"codicon codicon-close","data-testid":"single-select-delete",_label:f("kol-delete-selection"),onClick:()=>{var t;this.clearSelection(),null===(t=this.refInput)||void 0===t||t.focus()},class:n("kol-single-select__delete",{"kol-single-select__delete--disabled":this.state._disabled})}),t(d,{key:"5cea8492ff96ca7922169ddc1d1638c18520e858",onClick:this.toggleListbox.bind(this),disabled:this.state._disabled})),this._isOpen&&!(!0===this.state._disabled)&&t(c,{key:"4dbd45fc3dbcff650c1775b93f60d0e692f87c3f",blockSuggestionMouseOver:this.blockSuggestionMouseOver,onKeyDown:this.handleKeyDownDropdown.bind(this),style:{"--visible-options":`${null!==(e=this._rows)&&void 0!==e?e:5}`}},Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0?this._filteredOptions.map(((e,n)=>t(u,{index:n,option:e.label,searchTerm:this._inputValue,ref:t=>{t&&(this.refOptions[n]=t)},selected:this._value===e.value,onClick:t=>{var n;this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),this._isOpen=!1,this._hasOpened=!1},onMouseOver:()=>{this.blockSuggestionMouseOver||(this._focusedOptionIndex=n,this.focusOption(n))},onFocus:()=>{this._focusedOptionIndex=n,this.focusOption(n)},onKeyDown:t=>{var n;"Enter"!==t.key&&"NumpadEnter"!==t.key||(this.selectOption(e),null===(n=this.refInput)||void 0===n||n.focus(),this.toggleListbox(t),t.preventDefault())}}))):t("li",{class:"kol-single-select__no-results-message"},f("kol-no-results-message")," "))))}handleFocusOut(){setTimeout((()=>{var t;(null===(t=this.host)||void 0===t?void 0:t.contains(document.activeElement))||this.onBlur()}),0)}handleWindowBlur(){this.onBlur()}handleKeyDown(t){var e,n;const i=(e,n)=>{var i;t.preventDefault(),void 0!==e&&(this._isOpen=e,e||null===(i=this.refInput)||void 0===i||i.focus()),null==n||n()};switch(t.key){case"Down":case"ArrowDown":this.blockSuggestionMouseOver=!0,i(!0,(()=>this.moveFocus(1)));break;case"Up":case"ArrowUp":this.blockSuggestionMouseOver=!0,i(!0,(()=>this.moveFocus(-1)));break;case"Tab":this._isOpen&&(this._isOpen=!this._isOpen,null===(e=this.refInput)||void 0===e||e.focus());break;case"Esc":case"Escape":this._hasOpened=!1,this._isOpen=!1,i(!1);break;case" ":this._isOpen?Array.isArray(this._filteredOptions)&&this._filteredOptions.length>0&&(this.selectOption(this._filteredOptions[this._focusedOptionIndex]),null===(n=this.refInput)||void 0===n||n.focus(),i(!1)):this.toggleListbox(t);break;case"NumpadEnter":case"Enter":this.toggleListbox(t),this._hasOpened=!1,this._isOpen=!1;break;case"Home":this.blockSuggestionMouseOver=!0,i(void 0,(()=>{this._isOpen&&(this._focusedOptionIndex=0,this.focusOption(this._focusedOptionIndex))}));break;case"End":this.blockSuggestionMouseOver=!0,i(void 0,(()=>{this._isOpen&&(this._focusedOptionIndex=this._filteredOptions?this._filteredOptions.length-1:0,this.focusOption(this._focusedOptionIndex))}));break;case"PageUp":this.blockSuggestionMouseOver=!0,i(void 0,(()=>this._isOpen&&this.moveFocus(-10)));break;case"PageDown":this.blockSuggestionMouseOver=!0,i(void 0,(()=>this._isOpen&&this.moveFocus(10)))}}constructor(t){e(this,t),this.refOptions=[],this.catchRef=t=>{this.refInput=t},this.toggleListbox=t=>{var e;if(null==t||t.preventDefault(),!this.state._disabled&&!this._hasOpened){this._isOpen=!0,this._hasOpened=!0,null===(e=this.refInput)||void 0===e||e.focus();const t=Array.isArray(this._filteredOptions)?this._filteredOptions.findIndex((t=>t.label===this._inputValue)):-1;this._focusedOptionIndex=t>=0?t:-1,this.focusOption(this._focusedOptionIndex)}},this._focusedOptionIndex=-1,this._isOpen=!1,this._filteredOptions=[],this._inputValue="",this.blockSuggestionMouseOver=!1,this._hasOpened=!1,this._accessKey=void 0,this._placeholder=void 0,this._disabled=!1,this._hideMsg=!1,this._hideLabel=!1,this._hint="",this._icons=void 0,this._id=void 0,this._label=void 0,this._msg=void 0,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._shortKey=void 0,this._syncValueBySelector=void 0,this._tooltipAlign="top",this._touched=!1,this._value=null,this._hideClearButton=!1,this._rows=void 0,this.state={_hideMsg:!1,_id:`id-${p()}`,_label:"",_options:[],_hideClearButton:!1},this.inputHasFocus=!1,this.controller=new _(this,"single-select",this.host)}showAsAlert(){return Boolean(this.state._touched)&&!this.inputHasFocus}validatePlaceholder(t){this.controller.validatePlaceholder(t)}validateAccessKey(t){this.controller.validateAccessKey(t)}validateDisabled(t){this.controller.validateDisabled(t)}validateHideMsg(t){this.controller.validateHideMsg(t)}validateHideLabel(t){this.controller.validateHideLabel(t)}validateHint(t){this.controller.validateHint(t)}validateIcons(t){this.controller.validateIcons(t)}validateId(t){this.controller.validateId(t)}validateLabel(t){this.controller.validateLabel(t)}validateMsg(t){this.controller.validateMsg(t)}validateName(t){this.controller.validateName(t)}validateOn(t){this.controller.validateOn(t)}validateOptions(t){this.controller.validateOptions(t),this._filteredOptions=t,this.updateInputValue(this._value)}validateRequired(t){this.controller.validateRequired(t)}validateShortKey(t){this.controller.validateShortKey(t)}validateSyncValueBySelector(t){this.controller.validateSyncValueBySelector(t)}validateTouched(t){this.controller.validateTouched(t)}validateValue(t){this.controller.validateValue(t),this.oldValue=t,this.updateInputValue(t)}validateHideClearButton(t){this.controller.validateHideClearButton(t)}validateRows(t){this.controller.validateRows(t)}handleMouseEvent(){this.blockSuggestionMouseOver=!1}updateInputValue(t){if(Array.isArray(this._options)){const e=this._options.find((e=>e.value===t));this._inputValue=e?String(e.label):""}}componentWillLoad(){this.refOptions=[],this._touched=!0===this._touched,this.controller.componentWillLoad(),this.oldValue=this._value,this._filteredOptions=this.state._options,this.updateInputValue(this._value)}onChange(t){var e,n;this.oldValue!==(null===(e=this.refInput)||void 0===e?void 0:e.value)&&(this.oldValue=null===(n=this.refInput)||void 0===n?void 0:n.value),this._isOpen||this.controller.onFacade.onChange(t,this._value)}onClick(t){this.toggleListbox(t),this.controller.onFacade.onClick(t)}static get delegatesFocus(){return!0}get host(){return i(this)}static get watchers(){return{_placeholder:["validatePlaceholder"],_accessKey:["validateAccessKey"],_disabled:["validateDisabled"],_hideMsg:["validateHideMsg"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_msg:["validateMsg"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_shortKey:["validateShortKey"],_syncValueBySelector:["validateSyncValueBySelector"],_touched:["validateTouched"],_value:["validateValue"],"_hideClearButton ":["validateHideClearButton"],_rows:["validateRows"]}}};j.style={default:x};export{j as kol_single_select};
|