@duetds/components 4.35.4 → 4.36.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/hydrate/index.js +501 -7
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +7 -2
- package/lib/cjs/duet-caption_4.cjs.entry.js +1 -1
- package/lib/cjs/duet-card.cjs.entry.js +2 -2
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +2 -2
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table-button.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table_4.cjs.entry.js +4 -13
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +1 -1
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +1 -1
- package/lib/cjs/duet-input_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +3 -3
- package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-number-input.cjs.entry.js +2 -2
- package/lib/cjs/duet-pagination_2.cjs.entry.js +448 -0
- package/lib/cjs/duet-progress.cjs.entry.js +1 -1
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +2 -2
- package/lib/cjs/duet-select.cjs.entry.js +16 -4
- package/lib/cjs/duet-step_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
- package/lib/cjs/duet-tray.cjs.entry.js +1 -1
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-eb8c5b20.js → focus-utils-675b1aa3.js} +1 -1
- package/lib/cjs/{index-6ae8090f.js → index-58eb8f67.js} +4 -1
- package/lib/cjs/js-utils-33a9dbe3.js +16 -0
- package/lib/cjs/{keyboard-utils-b4e3d1d3.js → keyboard-utils-898cfe14.js} +8 -0
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/collection/collection-manifest.json +8 -0
- package/lib/collection/components/duet-button/duet-button.css +3 -0
- package/lib/collection/components/duet-button/duet-button.js +27 -0
- package/lib/collection/components/duet-card/duet-card.js +1 -1
- package/lib/collection/components/duet-pagination/duet-pagination-utils.js +9 -0
- package/lib/collection/components/duet-pagination/duet-pagination.css +120 -0
- package/lib/collection/components/duet-pagination/duet-pagination.js +511 -0
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.css +100 -0
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +342 -0
- package/lib/collection/components/duet-select/duet-select.css +26 -0
- package/lib/collection/components/duet-select/duet-select.js +39 -4
- package/lib/collection/utils/fixture-utils.js +0 -4
- package/lib/collection/utils/keyboard-utils.js +4 -0
- package/lib/collection/utils/test-utils.js +2 -1
- package/lib/custom-elements-bundle/index.d.ts +12 -0
- package/lib/custom-elements-bundle/index.js +471 -8
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-94a2da86.system.entry.js → p-0349b691.system.entry.js} +1 -1
- package/lib/duet/{p-824d2360.system.entry.js → p-0769de2b.system.entry.js} +1 -1
- package/lib/duet/{p-0169d57e.entry.js → p-09920da9.entry.js} +1 -1
- package/lib/duet/{p-c122428f.entry.js → p-1aeb418c.entry.js} +1 -1
- package/lib/duet/{p-d5a4b17f.system.entry.js → p-1afe9641.system.entry.js} +1 -1
- package/lib/duet/p-1b56e483.system.entry.js +4 -0
- package/lib/duet/{p-5e895b06.entry.js → p-1c1c9705.entry.js} +1 -1
- package/lib/duet/p-21cd146b.system.entry.js +4 -0
- package/lib/duet/{p-4a60b131.system.entry.js → p-22e6615d.system.entry.js} +1 -1
- package/lib/duet/{p-f98fca13.system.entry.js → p-28a22555.system.entry.js} +1 -1
- package/lib/duet/p-298a9ffc.system.js +4 -0
- package/lib/duet/{p-8367a2d1.entry.js → p-2a9345a7.entry.js} +1 -1
- package/lib/duet/{p-61198eee.system.entry.js → p-314b64b4.system.entry.js} +1 -1
- package/lib/duet/{p-66bf27b9.system.entry.js → p-363abf26.system.entry.js} +1 -1
- package/lib/duet/{p-b3a2a1e8.entry.js → p-3c13a041.entry.js} +1 -1
- package/lib/duet/{p-ea30becb.system.entry.js → p-40360b4a.system.entry.js} +1 -1
- package/lib/duet/{p-9077cd24.system.entry.js → p-44a3794d.system.entry.js} +1 -1
- package/lib/duet/{p-753098ec.entry.js → p-4b688aea.entry.js} +1 -1
- package/lib/duet/{p-2bfe8b50.system.entry.js → p-4f32cc18.system.entry.js} +1 -1
- package/lib/duet/{p-caab828f.system.entry.js → p-59480299.system.entry.js} +1 -1
- package/lib/duet/{p-6cff80cb.system.entry.js → p-5e410fa9.system.entry.js} +1 -1
- package/lib/duet/{p-de5c3a36.entry.js → p-5f4362b4.entry.js} +1 -1
- package/lib/duet/{p-e3229d0d.entry.js → p-663aec3a.entry.js} +1 -1
- package/lib/duet/{p-a39a0a45.entry.js → p-6aa8d848.entry.js} +1 -1
- package/lib/duet/p-6da8743f.system.entry.js +4 -0
- package/lib/duet/{p-731444f6.entry.js → p-6df7b78c.entry.js} +1 -1
- package/lib/duet/{p-4a931c6c.system.entry.js → p-6e6e1b77.system.entry.js} +1 -1
- package/lib/duet/p-72ce134a.entry.js +4 -0
- package/lib/duet/p-74780bca.system.js +4 -0
- package/lib/duet/{p-c3d552d5.entry.js → p-7730d2b8.entry.js} +1 -1
- package/lib/duet/{p-b72ed5ef.system.entry.js → p-78779ba1.system.entry.js} +1 -1
- package/lib/duet/{p-c63e49e2.system.entry.js → p-78aa974b.system.entry.js} +1 -1
- package/lib/duet/p-7e2c06d0.js +4 -0
- package/lib/duet/{p-503f1286.entry.js → p-7f1cbb7d.entry.js} +1 -1
- package/lib/duet/{p-ec2aea5f.system.entry.js → p-80aa512a.system.entry.js} +1 -1
- package/lib/duet/p-81867417.system.js +4 -0
- package/lib/duet/{p-dfd96467.entry.js → p-818cd527.entry.js} +1 -1
- package/lib/duet/{p-bc6794bc.system.entry.js → p-84940fc4.system.entry.js} +1 -1
- package/lib/duet/{p-44fe8367.system.entry.js → p-84a9fbf4.system.entry.js} +1 -1
- package/lib/duet/{p-3025a411.system.js → p-85d9b1b0.system.js} +1 -1
- package/lib/duet/{p-253fd12a.system.entry.js → p-8706664b.system.entry.js} +1 -1
- package/lib/duet/{p-03a5fe42.system.entry.js → p-878c1c83.system.entry.js} +1 -1
- package/lib/duet/p-898f30a5.js +4 -0
- package/lib/duet/{p-f51f8554.entry.js → p-8a768d0b.entry.js} +1 -1
- package/lib/duet/{p-e4e99da0.entry.js → p-8b8c2ef4.entry.js} +1 -1
- package/lib/duet/p-8c0fd5de.js +4 -0
- package/lib/duet/{p-7b451394.system.js → p-8db453bf.system.js} +1 -1
- package/lib/duet/{p-a926b44b.entry.js → p-8f56fd3f.entry.js} +1 -1
- package/lib/duet/{p-477c2e5c.entry.js → p-8fa952df.entry.js} +1 -1
- package/lib/duet/{p-17f85b90.entry.js → p-90799d0a.entry.js} +1 -1
- package/lib/duet/{p-a0deb526.entry.js → p-9358e24b.entry.js} +1 -1
- package/lib/duet/p-95f71b43.system.entry.js +4 -0
- package/lib/duet/p-9782946f.entry.js +4 -0
- package/lib/duet/{p-01679b51.entry.js → p-995f20fc.entry.js} +1 -1
- package/lib/duet/{p-412f58cf.entry.js → p-99a112e4.entry.js} +1 -1
- package/lib/duet/{p-76fa8882.entry.js → p-9ead1c59.entry.js} +1 -1
- package/lib/duet/{p-efd978ee.entry.js → p-a0f979a4.entry.js} +1 -1
- package/lib/duet/{p-ee598605.entry.js → p-a154a0c0.entry.js} +1 -1
- package/lib/duet/{p-fc35b926.system.entry.js → p-a2db8ff2.system.entry.js} +1 -1
- package/lib/duet/{p-04304e51.entry.js → p-a75776f5.entry.js} +1 -1
- package/lib/duet/{p-e682d701.system.entry.js → p-a8f707d4.system.entry.js} +2 -2
- package/lib/duet/{p-c1b34a78.system.entry.js → p-aa5abb52.system.entry.js} +1 -1
- package/lib/duet/p-abcbdef5.entry.js +4 -0
- package/lib/duet/{p-fb98ac5a.entry.js → p-ac44ab7a.entry.js} +1 -1
- package/lib/duet/{p-5630828a.system.entry.js → p-ad06c91d.system.entry.js} +1 -1
- package/lib/duet/{p-6b24111b.system.entry.js → p-ad8a49a3.system.entry.js} +1 -1
- package/lib/duet/p-ae82d8e7.entry.js +4 -0
- package/lib/duet/{p-99262d61.entry.js → p-aebf6700.entry.js} +1 -1
- package/lib/duet/{p-01f3fbd4.system.entry.js → p-b11f2fcd.system.entry.js} +1 -1
- package/lib/duet/p-b25d3769.js +4 -0
- package/lib/duet/{p-bba528b5.entry.js → p-b42066e0.entry.js} +1 -1
- package/lib/duet/{p-40a76f20.entry.js → p-b5aaf161.entry.js} +1 -1
- package/lib/duet/{p-a69667c7.entry.js → p-b6b58d31.entry.js} +1 -1
- package/lib/duet/{p-55fff1fe.entry.js → p-bd602c98.entry.js} +1 -1
- package/lib/duet/{p-7cdb8bfa.entry.js → p-bf25e52a.entry.js} +1 -1
- package/lib/duet/{p-873e4c51.system.entry.js → p-c0a24b5e.system.entry.js} +1 -1
- package/lib/duet/{p-2395f96e.system.entry.js → p-c167a5aa.system.entry.js} +1 -1
- package/lib/duet/{p-0f185a8a.system.entry.js → p-c5db93a7.system.entry.js} +1 -1
- package/lib/duet/{p-da1f6193.system.entry.js → p-c61ace58.system.entry.js} +1 -1
- package/lib/duet/{p-a212f672.system.entry.js → p-d32b240d.system.entry.js} +1 -1
- package/lib/duet/{p-2c85e001.system.entry.js → p-d444e178.system.entry.js} +1 -1
- package/lib/duet/{p-e8ce8394.entry.js → p-daede773.entry.js} +1 -1
- package/lib/duet/{p-8ea92cc5.entry.js → p-dda7f098.entry.js} +1 -1
- package/lib/duet/{p-7fd62541.entry.js → p-e584ce1d.entry.js} +1 -1
- package/lib/duet/{p-9690681b.system.entry.js → p-e67fc1ed.system.entry.js} +1 -1
- package/lib/duet/{p-73b5248d.entry.js → p-e9ca7e01.entry.js} +1 -1
- package/lib/duet/{p-4ea864dd.system.entry.js → p-ea124391.system.entry.js} +1 -1
- package/lib/duet/{p-8973aa31.system.entry.js → p-f993e4c3.system.entry.js} +1 -1
- package/lib/duet/{p-24b4eefb.system.entry.js → p-fb55e381.system.entry.js} +1 -1
- package/lib/duet/{p-e6349dd2.entry.js → p-fc02d8e9.entry.js} +1 -1
- package/lib/duet/{p-4d8cd455.system.entry.js → p-fd561872.system.entry.js} +1 -1
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-breadcrumb.entry.js +1 -1
- package/lib/esm/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +7 -2
- package/lib/esm/duet-caption_4.entry.js +1 -1
- package/lib/esm/duet-card.entry.js +2 -2
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +3 -3
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +2 -2
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table-button.entry.js +1 -1
- package/lib/esm/duet-editable-table_4.entry.js +2 -11
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +1 -1
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +2 -2
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +1 -1
- package/lib/esm/duet-input_2.entry.js +1 -1
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +3 -3
- package/lib/esm/duet-notification_2.entry.js +1 -1
- package/lib/esm/duet-number-input.entry.js +2 -2
- package/lib/esm/duet-pagination_2.entry.js +443 -0
- package/lib/esm/duet-progress.entry.js +1 -1
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +1 -1
- package/lib/esm/duet-scrollable_3.entry.js +2 -2
- package/lib/esm/duet-select.entry.js +16 -4
- package/lib/esm/duet-step_2.entry.js +2 -2
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +1 -1
- package/lib/esm/duet-tray.entry.js +1 -1
- package/lib/esm/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-6db957a7.js → focus-utils-bd3c1702.js} +1 -1
- package/lib/esm/{index-828dfb4e.js → index-49b2d31a.js} +4 -1
- package/lib/esm/js-utils-b69f17df.js +14 -0
- package/lib/esm/{keyboard-utils-584cedd7.js → keyboard-utils-6eb55cd5.js} +5 -1
- package/lib/esm/loader.js +2 -2
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table-button.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table_4.entry.js +2 -2
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +1 -1
- package/lib/esm-es5/duet-pagination_2.entry.js +4 -0
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +2 -2
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/focus-utils-bd3c1702.js +4 -0
- package/lib/esm-es5/{index-828dfb4e.js → index-49b2d31a.js} +1 -1
- package/lib/esm-es5/js-utils-b69f17df.js +4 -0
- package/lib/esm-es5/keyboard-utils-6eb55cd5.js +4 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/types/components/duet-button/duet-button.d.ts +5 -0
- package/lib/types/components/duet-card/duet-card.d.ts +1 -1
- package/lib/types/components/duet-pagination/duet-pagination-utils.d.ts +1 -0
- package/lib/types/components/duet-pagination/duet-pagination.d.ts +100 -0
- package/lib/types/components/duet-range-stepper/duet-range-stepper.d.ts +70 -0
- package/lib/types/components/duet-select/duet-select.d.ts +5 -0
- package/lib/types/components.d.ts +188 -2
- package/lib/types/utils/keyboard-utils.d.ts +4 -0
- package/package.json +5 -5
- package/lib/duet/p-0427e1a5.entry.js +0 -4
- package/lib/duet/p-04f9f1bf.js +0 -4
- package/lib/duet/p-0f91d386.system.entry.js +0 -4
- package/lib/duet/p-227e5196.js +0 -4
- package/lib/duet/p-2545734a.entry.js +0 -4
- package/lib/duet/p-2b8316ee.system.entry.js +0 -4
- package/lib/duet/p-68ecdc4f.system.entry.js +0 -4
- package/lib/duet/p-853cd059.js +0 -4
- package/lib/duet/p-b0c16ee5.entry.js +0 -4
- package/lib/duet/p-bb12b972.system.js +0 -4
- package/lib/duet/p-ef3fc3f3.system.js +0 -4
- package/lib/esm-es5/focus-utils-6db957a7.js +0 -4
- package/lib/esm-es5/keyboard-utils-584cedd7.js +0 -4
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
|
+
import { c as createID } from './create-id-981107da.js';
|
|
6
|
+
import { d as debounce } from './js-utils-b69f17df.js';
|
|
7
|
+
import { j as isArrowKey, k as isNumber, d as isArrowLeftKey, b as isArrowUpKey, a as isArrowRightKey, c as isArrowDownKey, l as isMinusKey, m as isPlusKey } from './keyboard-utils-6eb55cd5.js';
|
|
8
|
+
import { g as getLocaleString } from './language-utils-344d894c.js';
|
|
9
|
+
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
10
|
+
import './string-utils-2f1793b8.js';
|
|
11
|
+
|
|
12
|
+
const shouldDisplayNavigation = (visibleItems, total, take) => {
|
|
13
|
+
if (visibleItems * 2 > total / take) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const duetPaginationCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-pagination-nav{position:relative}.duet-pagination,.duet-pagination li{display:flex;flex-wrap:wrap;gap:0.1rem;align-items:center}.duet-pagination-item-is-active .duet-pagination-page-number{border-bottom-color:inherit;border-bottom-style:solid;border-bottom-width:2px}.duet-pagination duet-button{width:30px;min-width:36px;font-weight:600;text-decoration:none;border-left-width:0}.duet-pagination-overlay{position:absolute;top:1rem;z-index:300;width:100%;text-align:center}.duet-pagination.duet-pagination-is-dimmed{opacity:0.5}.duet-pagination-page-button{white-space:nowrap}.duet-pagination-page-button button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:auto !important;padding:0 !important;margin:0 0 0 8px !important;color:#00294d;cursor:pointer;background:#f5f8fa;border-radius:50%;transition:background-color 300ms ease !important}.duet-theme-turva .duet-pagination-page-button button{color:#171c3a;background:#f5f5f7}.duet-pagination-page-button button duet-icon{display:block}@media (max-width: 35.9375em){.duet-pagination-page-button button{width:40px;height:40px}}.duet-pagination-page-button button:not(:disabled):hover{background:#e9ecee !important}.duet-theme-turva .duet-pagination-page-button button:not(:disabled):hover{background:#e9e9eb !important}.duet-pagination-page-button button:focus{outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva .duet-pagination-page-button button:focus{box-shadow:0 0 0 2px #171c3a}.duet-pagination-page-button button:active:focus{background:#dddfe1;box-shadow:none}.duet-theme-turva .duet-pagination-page-button button:active:focus{background:#ddddde}.duet-pagination-page-button button:disabled{color:#909599;cursor:default;background:#f5f8fa;opacity:0.75}.duet-theme-turva .duet-pagination-page-button button:disabled{color:#747475;background:#f5f5f7}";
|
|
20
|
+
|
|
21
|
+
let DuetPagination = class {
|
|
22
|
+
constructor(hostRef) {
|
|
23
|
+
registerInstance(this, hostRef);
|
|
24
|
+
this.duetPageChange = createEvent(this, "duetPageChange", 3);
|
|
25
|
+
this.listId = createID("duet-pagination-list");
|
|
26
|
+
this.numbersStore = "";
|
|
27
|
+
/**
|
|
28
|
+
* State() variables
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
this.totalPages = 10;
|
|
32
|
+
/**
|
|
33
|
+
* State() variables
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
this.internalSectionIndex = 0;
|
|
37
|
+
/**
|
|
38
|
+
* Theme of the pagination.
|
|
39
|
+
*/
|
|
40
|
+
this.theme = "";
|
|
41
|
+
/**
|
|
42
|
+
* Characters to use for the jump buttons.
|
|
43
|
+
*/
|
|
44
|
+
this.jumpString = "...";
|
|
45
|
+
/**
|
|
46
|
+
* Default pagination labels
|
|
47
|
+
*/
|
|
48
|
+
this.ariaLabelsDefaults = {
|
|
49
|
+
en: {
|
|
50
|
+
next_page: "Next page",
|
|
51
|
+
previous_page: "Previous page",
|
|
52
|
+
first_page: "First page",
|
|
53
|
+
last_page: "Last page",
|
|
54
|
+
jump_to: "Jump to page",
|
|
55
|
+
go_to: "Go to page",
|
|
56
|
+
description: "You may use arrow keys to select page number, or enter a page number when this element is in focus to jump to a page",
|
|
57
|
+
pagination_label: "Pagination, choose a number to jump to a page",
|
|
58
|
+
prev_section: "Show previous {0} page numbers, screen reader user should use arrowkeys to navigate",
|
|
59
|
+
next_section: "Show next {0} page numbers, screen reader user should use arrowkeys to navigate",
|
|
60
|
+
},
|
|
61
|
+
fi: {
|
|
62
|
+
next_page: "Seuraava sivu",
|
|
63
|
+
previous_page: "Edellinen sivu",
|
|
64
|
+
first_page: "Ensimmäinen sivu",
|
|
65
|
+
last_page: "Viimeinen sivu",
|
|
66
|
+
jump_to: "Siirry sivulle",
|
|
67
|
+
go_to: "Siirry sivulle",
|
|
68
|
+
description: "Voit käyttää nuolinäppäimiä sivunumeron valitsemiseen, tai kirjoittaa sivunumeron, jos tämä elementti on aktiivinen, siirtymään sivulle",
|
|
69
|
+
pagination_label: "Sivutus, valitse sivunumero siirtyäksesi sivulle",
|
|
70
|
+
prev_section: "Näytä edelliset {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",
|
|
71
|
+
next_section: "Näytä seuraavat {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",
|
|
72
|
+
},
|
|
73
|
+
sv: {
|
|
74
|
+
next_page: "Nästa sida",
|
|
75
|
+
previous_page: "Föregående sida",
|
|
76
|
+
first_page: "Första sidan",
|
|
77
|
+
last_page: "Sista sidan",
|
|
78
|
+
jump_to: "Hoppa till sida",
|
|
79
|
+
go_to: "Hoppa till sida",
|
|
80
|
+
description: "Du kan använda piltangenterna för att välja sida, eller skriva in sida när elementet är i fokus för att hoppa till en sida",
|
|
81
|
+
pagination_label: "Sidutning, välj en siffra för att hoppa till en sida",
|
|
82
|
+
prev_section: "Visa föregående {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",
|
|
83
|
+
next_section: "Visa nästa {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Default pagination labels
|
|
88
|
+
*/
|
|
89
|
+
this.ariaLabels = getLocaleString(this.ariaLabelsDefaults);
|
|
90
|
+
/**
|
|
91
|
+
* The size of the take, when paginating.
|
|
92
|
+
*/
|
|
93
|
+
this.take = 5;
|
|
94
|
+
/**
|
|
95
|
+
* Amount of visible page numbers to show
|
|
96
|
+
*/
|
|
97
|
+
this.visibleItems = 5;
|
|
98
|
+
/**
|
|
99
|
+
* The total size of the paginating data
|
|
100
|
+
*/
|
|
101
|
+
this.total = 1000;
|
|
102
|
+
/**
|
|
103
|
+
* Used to indicate which dom element with ID this element controls
|
|
104
|
+
*/
|
|
105
|
+
this.ariaControls = "";
|
|
106
|
+
/**
|
|
107
|
+
* The current page
|
|
108
|
+
*/
|
|
109
|
+
this.current = 1;
|
|
110
|
+
/**
|
|
111
|
+
* Private methods.
|
|
112
|
+
*/
|
|
113
|
+
// called from the watcher and used to make sure any changed to current also updates the internal section index
|
|
114
|
+
this.actionChain = async (after, before) => {
|
|
115
|
+
if (after === 0) {
|
|
116
|
+
this.current = 1;
|
|
117
|
+
}
|
|
118
|
+
else if (before !== after) {
|
|
119
|
+
const calculatedSectionIndex = Math.ceil(after / this.visibleItems) - 1;
|
|
120
|
+
if (calculatedSectionIndex !== this.internalSectionIndex) {
|
|
121
|
+
this.internalSectionIndex = calculatedSectionIndex;
|
|
122
|
+
await this.setFocus();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
//helper to emit relevant page events
|
|
127
|
+
this.emitPageEvent = debounce((ev, passedPage) => {
|
|
128
|
+
const page = Number(passedPage || this.current);
|
|
129
|
+
this.duetPageChange.emit({
|
|
130
|
+
component: "duet-pagination",
|
|
131
|
+
from: page * this.take,
|
|
132
|
+
to: page * this.take + this.take,
|
|
133
|
+
current: page,
|
|
134
|
+
take: this.take,
|
|
135
|
+
type: "page",
|
|
136
|
+
originalEvent: ev,
|
|
137
|
+
});
|
|
138
|
+
}, 500);
|
|
139
|
+
// this will return the entered number, or the current page if the user presses enter
|
|
140
|
+
this.getEnteredNumber = debounce(ev => {
|
|
141
|
+
this.emitPageEvent(ev, this.numbersStore);
|
|
142
|
+
this.current = Number(this.numbersStore);
|
|
143
|
+
this.numbersStore = "";
|
|
144
|
+
this.duetPageChange.emit({
|
|
145
|
+
component: "duet-pagination",
|
|
146
|
+
from: this.current * this.take,
|
|
147
|
+
to: this.current * this.take + this.take,
|
|
148
|
+
current: this.current,
|
|
149
|
+
take: this.take,
|
|
150
|
+
type: "jump",
|
|
151
|
+
originalEvent: ev,
|
|
152
|
+
});
|
|
153
|
+
}, 500);
|
|
154
|
+
}
|
|
155
|
+
watchStateHandler(newValue, oldValue) {
|
|
156
|
+
this.actionChain(newValue, oldValue);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Component lifecycle events.
|
|
160
|
+
*/
|
|
161
|
+
componentWillLoad() {
|
|
162
|
+
// we want to keep the internal current index in sync with the current prop, but take advantage of the multiple with 0 for the first iteration
|
|
163
|
+
this.internalSectionIndex = Math.ceil(this.current / this.visibleItems) - 1;
|
|
164
|
+
this.calculatePageTake();
|
|
165
|
+
inheritGlobalTheme(this);
|
|
166
|
+
}
|
|
167
|
+
componentWillRender() {
|
|
168
|
+
if (this.internalSectionIndex !== 0 && this.internalSectionIndex !== this.totalPages) {
|
|
169
|
+
this.calculatePageTake();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
componentDidRender() {
|
|
173
|
+
this.setFocus();
|
|
174
|
+
}
|
|
175
|
+
//get totalpages from visible and total
|
|
176
|
+
calculatePageTake() {
|
|
177
|
+
this.totalPages = Math.ceil(this.total / this.take);
|
|
178
|
+
}
|
|
179
|
+
//set update current when mouse click on page number
|
|
180
|
+
async onMouseHandler(e, dir) {
|
|
181
|
+
e.preventDefault();
|
|
182
|
+
e.stopPropagation();
|
|
183
|
+
this.current = this.current + dir;
|
|
184
|
+
}
|
|
185
|
+
//handle a11y keyboard navigation events
|
|
186
|
+
async onKeyboardDown(e) {
|
|
187
|
+
let next = this.current;
|
|
188
|
+
// handle a11y based keyboard navigation for left/right/up/down
|
|
189
|
+
if (isArrowLeftKey(e) || isArrowUpKey(e)) {
|
|
190
|
+
next--;
|
|
191
|
+
}
|
|
192
|
+
if (isArrowRightKey(e) || isArrowDownKey(e)) {
|
|
193
|
+
next++;
|
|
194
|
+
}
|
|
195
|
+
if (isArrowKey(e)) {
|
|
196
|
+
if (next <= this.totalPages) {
|
|
197
|
+
this.current = next;
|
|
198
|
+
this.emitPageEvent(e);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
//handle the jump feature, where numbers can be entered
|
|
202
|
+
if (isNumber(e) && this.shouldDisplayNavigation()) {
|
|
203
|
+
this.numbersStore = this.numbersStore + e.key;
|
|
204
|
+
if (Number(this.numbersStore) > this.totalPages) {
|
|
205
|
+
this.numbersStore = this.totalPages + "";
|
|
206
|
+
}
|
|
207
|
+
this.getEnteredNumber(e);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// utility to set focus on active button
|
|
211
|
+
async setFocus() {
|
|
212
|
+
const currentDomElement = this.nativeNav.querySelector(`li.duet-pagination-item-is-active duet-button`);
|
|
213
|
+
currentDomElement && (await currentDomElement.setFocus());
|
|
214
|
+
}
|
|
215
|
+
//handles click on page numbers
|
|
216
|
+
pageClickHandler(e) {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
const clickedId = Number(e.target.getAttribute("data-id"));
|
|
219
|
+
this.current = clickedId;
|
|
220
|
+
this.emitPageEvent({}, clickedId);
|
|
221
|
+
}
|
|
222
|
+
//handles click on the next section buttons
|
|
223
|
+
sectionClickHandler(e, direction) {
|
|
224
|
+
e.preventDefault();
|
|
225
|
+
let next = this.internalSectionIndex + direction;
|
|
226
|
+
if (next >= this.totalPages / this.take) {
|
|
227
|
+
next = this.totalPages / this.take - 1;
|
|
228
|
+
}
|
|
229
|
+
const newSection = next;
|
|
230
|
+
this.internalSectionIndex = newSection >= 0 ? newSection : 0;
|
|
231
|
+
}
|
|
232
|
+
//handles click on the jump (1)button
|
|
233
|
+
jumpToStart(e) {
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
this.internalSectionIndex = 0;
|
|
236
|
+
this.current = 1;
|
|
237
|
+
}
|
|
238
|
+
//handles click on the jump (total) button
|
|
239
|
+
jumpToEnd(e) {
|
|
240
|
+
e.preventDefault();
|
|
241
|
+
this.internalSectionIndex = this.totalPages / this.take - 1;
|
|
242
|
+
this.current = this.totalPages;
|
|
243
|
+
}
|
|
244
|
+
// render the individual page numbers
|
|
245
|
+
renderPageNumbers() {
|
|
246
|
+
const items = [];
|
|
247
|
+
let i = this.internalSectionIndex * this.visibleItems;
|
|
248
|
+
do {
|
|
249
|
+
i++;
|
|
250
|
+
if (i > this.totalPages) {
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
items.push(h("li", { class: {
|
|
254
|
+
"duet-pagination-item": true,
|
|
255
|
+
"duet-pagination-item-is-active": i === this.current,
|
|
256
|
+
}, role: "menuitem" }, h("duet-button", { class: {
|
|
257
|
+
"duet-pagination-link": true,
|
|
258
|
+
}, color: i !== this.current ? "secondary" : "primary", "data-id": i, "center-text": true, variation: "plain", margin: "none", accessibleLabel: `${this.ariaLabels.go_to} ${i}`, onClick: e => this.pageClickHandler(e) }, h("div", { class: "duet-pagination-page-number", "aria-hidden": true }, i))));
|
|
259
|
+
} while (i < this.visibleItems + this.internalSectionIndex * this.visibleItems);
|
|
260
|
+
return items;
|
|
261
|
+
}
|
|
262
|
+
shouldDisplayNavigation() {
|
|
263
|
+
return shouldDisplayNavigation(this.visibleItems, this.total, this.take);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* render() function
|
|
267
|
+
* Always the last one in the class.
|
|
268
|
+
*/
|
|
269
|
+
render() {
|
|
270
|
+
return (h(Host, { onKeyDown: e => this.onKeyboardDown(e) }, h("nav", { role: "navigation", class: "duet-pagination-nav", "aria-labelledby": this.listId, "aria-describedby": this.listId, ref: el => (this.nativeNav = el), "aria-controls": this.ariaControls }, this.numbersStore !== "" && (h("div", { "aria-live": "assertive", "aria-relevant": "text", class: "duet-pagination-overlay", "aria-label": `${this.ariaLabels.jump_to} ${this.numbersStore}`, part: "navigation-overlay" }, h("duet-badge", null, "jump to page : ", this.numbersStore))), h("ol", { id: this.listId, class: {
|
|
271
|
+
"duet-pagination": true,
|
|
272
|
+
"duet-pagination-is-dimmed": this.numbersStore !== "",
|
|
273
|
+
}, role: "menubar", "aria-label": this.ariaLabels.pagination_label, "aria-description": this.ariaLabels.description }, h("li", { class: {
|
|
274
|
+
"duet-pagination-page-button": true,
|
|
275
|
+
"duet-pagination-button-first": true,
|
|
276
|
+
}, role: "menuitem", part: "navigation-arrow" }, h("button", { disabled: this.internalSectionIndex === 0 && this.current <= 1, "data-direction": "back", class: "duet-date-dialog-prev", type: "button", onClick: e => this.onMouseHandler(e, -1), "aria-label": this.ariaLabels.previous_page }, h("duet-icon", { name: "action-arrow-left-small", color: "currentColor", margin: "none", size: "xx-small" }))), this.internalSectionIndex !== 0 && this.shouldDisplayNavigation() && (h(Fragment, null, h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-jump" }, h("duet-button", { class: "duet-pagination-link", "center-text": "true", variation: "plain", color: "secondary", margin: "none", accessibleLabel: this.ariaLabels.first_page, onClick: e => this.jumpToStart(e) }, h("div", { class: "duet-pagination-page-number" }, "1"))), h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-section" }, h("duet-button", { class: "duet-pagination-link", "center-text": "true", color: "secondary", variation: "plain", margin: "none", accessibleLabel: this.ariaLabels.prev_section.replace("{0}", `${this.visibleItems}`), onClick: e => this.sectionClickHandler(e, -1) }, h("div", { class: "duet-pagination-page-number", "aria-hidden": "true" }, "..."))))), this.renderPageNumbers(), this.internalSectionIndex !== this.totalPages / this.visibleItems - 1 && this.shouldDisplayNavigation() && (h(Fragment, null, h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-section" }, h("duet-button", { class: "duet-pagination-link", "center-text": "true", color: "secondary", variation: "plain", margin: "none", accessibleLabel: this.ariaLabels.next_section.replace("{0}", `${this.visibleItems}`), onClick: e => this.sectionClickHandler(e, 1) }, h("div", { class: "duet-pagination-page-number", "aria-hidden": "true" }, "..."))), h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-jump" }, h("duet-button", { class: "duet-pagination-link", "center-text": "true", color: "secondary", variation: "plain", margin: "none", accessibleLabel: this.ariaLabels.last_page, onClick: e => this.jumpToEnd(e) }, h("div", { class: "duet-pagination-page-number" }, this.totalPages))))), h("li", { class: {
|
|
277
|
+
"duet-pagination-page-button": true,
|
|
278
|
+
"duet-pagination-button-last": true,
|
|
279
|
+
}, role: "menuitem", part: "navigation-arrow" }, h("button", { disabled: this.current === this.totalPages &&
|
|
280
|
+
this.internalSectionIndex === Math.ceil(this.totalPages / this.visibleItems) - 1, class: "duet-date-dialog-next", type: "button", "aria-label": this.ariaLabels.next_page, onClick: e => this.onMouseHandler(e, 1) }, h("duet-icon", { name: "action-arrow-right-small", color: "currentColor", margin: "none", size: "xx-small" })))))));
|
|
281
|
+
}
|
|
282
|
+
get element() { return getElement(this); }
|
|
283
|
+
static get watchers() { return {
|
|
284
|
+
"current": ["watchStateHandler"]
|
|
285
|
+
}; }
|
|
286
|
+
};
|
|
287
|
+
DuetPagination.style = duetPaginationCss;
|
|
288
|
+
|
|
289
|
+
const duetRangeStepperCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-range-stepper{display:flex;flex-wrap:wrap;gap:0;align-items:baseline;justify-content:center;min-width:30px;min-height:30px;font-weight:600;text-decoration:none;border-left-width:0}.duet-range-stepper{white-space:nowrap}.duet-range-stepper button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:auto !important;padding:0 !important;margin:0 0 0 8px !important;color:#00294d;cursor:pointer;background:#f5f8fa;border-radius:50%;transition:background-color 300ms ease !important}.duet-theme-turva .duet-range-stepper button{color:#171c3a;background:#f5f5f7}.duet-range-stepper button duet-icon{display:block}@media (max-width: 35.9375em){.duet-range-stepper button{width:40px;height:40px}}.duet-range-stepper button:not(:disabled):hover{background:#e9ecee !important}.duet-theme-turva .duet-range-stepper button:not(:disabled):hover{background:#e9e9eb !important}.duet-range-stepper button:focus{outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva .duet-range-stepper button:focus{box-shadow:0 0 0 2px #171c3a}.duet-range-stepper button:active:focus{background:#dddfe1;box-shadow:none}.duet-theme-turva .duet-range-stepper button:active:focus{background:#ddddde}.duet-range-stepper button:disabled{color:#909599;cursor:default;background:#f5f8fa;opacity:0.75}.duet-theme-turva .duet-range-stepper button:disabled{color:#747475;background:#f5f5f7}";
|
|
290
|
+
|
|
291
|
+
let DuetRangeStepper = class {
|
|
292
|
+
constructor(hostRef) {
|
|
293
|
+
registerInstance(this, hostRef);
|
|
294
|
+
this.duetRangeStepUpdate = createEvent(this, "duetRangeStepUpdate", 7);
|
|
295
|
+
this.leftBn = createID("duetRangeStepper-left");
|
|
296
|
+
this.rightBn = createID("duetRangeStepper-right");
|
|
297
|
+
/**
|
|
298
|
+
* Theme of the component.
|
|
299
|
+
*/
|
|
300
|
+
this.theme = "";
|
|
301
|
+
/**
|
|
302
|
+
* Start value
|
|
303
|
+
* @default 1
|
|
304
|
+
*/
|
|
305
|
+
this.stepIndex = 1;
|
|
306
|
+
/**
|
|
307
|
+
* How big is the step
|
|
308
|
+
* @default 99
|
|
309
|
+
*/
|
|
310
|
+
this.stepSize = 50;
|
|
311
|
+
/**
|
|
312
|
+
* Total of
|
|
313
|
+
* @default undefined
|
|
314
|
+
*/
|
|
315
|
+
this.total = 1000;
|
|
316
|
+
/**
|
|
317
|
+
* Default range stepper labels
|
|
318
|
+
*/
|
|
319
|
+
this.ariaLabelsDefaults = {
|
|
320
|
+
en: {
|
|
321
|
+
next_increment: "Next range increment",
|
|
322
|
+
previous_increment: "Previous range increment",
|
|
323
|
+
x_of_y: "{0}–{1} of {2}",
|
|
324
|
+
},
|
|
325
|
+
fi: {
|
|
326
|
+
next_increment: "Seuraava välillä",
|
|
327
|
+
previous_increment: "Edellinen välillä",
|
|
328
|
+
x_of_y: "{0}–{1} / {2}",
|
|
329
|
+
},
|
|
330
|
+
sv: {
|
|
331
|
+
next_increment: "Nästa intervall",
|
|
332
|
+
previous_increment: "Föregående intervall",
|
|
333
|
+
x_of_y: "{0}–{1} av {2}",
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Default pagination labels
|
|
338
|
+
*/
|
|
339
|
+
this.ariaLabels = getLocaleString(this.ariaLabelsDefaults);
|
|
340
|
+
/**
|
|
341
|
+
* Used to indicate which dom element with ID this element controls
|
|
342
|
+
*/
|
|
343
|
+
this.ariaControls = "";
|
|
344
|
+
this.handleClick = (e, direction) => {
|
|
345
|
+
e.preventDefault();
|
|
346
|
+
this.increment(direction);
|
|
347
|
+
this.handleStepClick(e);
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
watchStateHandler(newValue) {
|
|
351
|
+
if (newValue === 1) {
|
|
352
|
+
this.leftBnRef.setAttribute("disabled", "");
|
|
353
|
+
this.rightBnRef.focus();
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
this.leftBnRef.removeAttribute("disabled");
|
|
357
|
+
}
|
|
358
|
+
if (newValue === this.total / this.stepSize) {
|
|
359
|
+
this.rightBnRef.setAttribute("disabled", "");
|
|
360
|
+
this.leftBnRef.focus();
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
this.rightBnRef.removeAttribute("disabled");
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
handleStepClick(e) {
|
|
367
|
+
this.duetRangeStepUpdate.emit({
|
|
368
|
+
originalEvent: e,
|
|
369
|
+
component: "duet-range-stepper",
|
|
370
|
+
from: this.stepIndex * this.stepSize - this.stepSize,
|
|
371
|
+
to: this.stepIndex * this.stepSize,
|
|
372
|
+
index: this.stepIndex,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
componentWillLoad() {
|
|
376
|
+
inheritGlobalTheme(this);
|
|
377
|
+
}
|
|
378
|
+
componentDidLoad() {
|
|
379
|
+
this.watchStateHandler(this.stepIndex);
|
|
380
|
+
}
|
|
381
|
+
increment(direction) {
|
|
382
|
+
const newIndex = this.stepIndex + direction;
|
|
383
|
+
if (newIndex <= 0) {
|
|
384
|
+
this.stepIndex = 1;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
if (newIndex * this.stepSize <= this.total) {
|
|
388
|
+
this.stepIndex = newIndex;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
generateStepSize() {
|
|
393
|
+
// this function uses this.stepIndex and this.range to generate a range of number like 1-100
|
|
394
|
+
// this is used to generate the step size
|
|
395
|
+
let start = (this.stepIndex - 1) * this.stepSize;
|
|
396
|
+
//easy fix for starting position
|
|
397
|
+
if (start === 0) {
|
|
398
|
+
start = 1;
|
|
399
|
+
}
|
|
400
|
+
const end = this.stepIndex * this.stepSize;
|
|
401
|
+
return this.ariaLabels.x_of_y
|
|
402
|
+
.replace("{0}", String(start))
|
|
403
|
+
.replace("{1}", String(end))
|
|
404
|
+
.replace("{2}", String(this.total));
|
|
405
|
+
}
|
|
406
|
+
//handle a11y keyboard navigation events
|
|
407
|
+
async onKeyboardDown(e) {
|
|
408
|
+
// handle a11y based keyboard navigation for left/right/up/down
|
|
409
|
+
let next = this.stepIndex;
|
|
410
|
+
let dir = 1;
|
|
411
|
+
if (isArrowLeftKey(e) || isArrowUpKey(e) || isMinusKey(e)) {
|
|
412
|
+
next--;
|
|
413
|
+
dir = -1;
|
|
414
|
+
this.leftBnRef.focus();
|
|
415
|
+
}
|
|
416
|
+
if (isArrowRightKey(e) || isArrowDownKey(e) || isPlusKey(e)) {
|
|
417
|
+
next++;
|
|
418
|
+
dir = 1;
|
|
419
|
+
}
|
|
420
|
+
if (isArrowKey(e)) {
|
|
421
|
+
if (next > 0 && next * this.stepSize <= this.total) {
|
|
422
|
+
this.handleClick(e, dir);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* render() function
|
|
428
|
+
* Always the last one in the class.
|
|
429
|
+
*/
|
|
430
|
+
render() {
|
|
431
|
+
return (h("div", { class: {
|
|
432
|
+
"duet-range-stepper": true,
|
|
433
|
+
"duet-theme-turva": this.theme === "turva",
|
|
434
|
+
}, onKeyDown: e => this.onKeyboardDown(e), "aria-controls": this.ariaControls }, h("span", { class: "duet-range-step-counter", part: "range-numbers" }, this.generateStepSize()), h("button", { class: "duet-range-step-button duet-range-step-minus", type: "button", onClick: e => this.handleClick(e, -1), id: this.leftBn, "aria-label": this.ariaLabels.previous_increment, ref: el => (this.leftBnRef = el), part: "navigation-arrow" }, h("duet-icon", { name: "action-arrow-left-small", color: "currentColor", margin: "none", size: "xx-small" })), h("button", { class: "duet-range-step-button duet-range-step-plus", type: "button", onClick: e => this.handleClick(e, 1), "aria-label": this.ariaLabels.next_increment, id: this.rightBn, ref: el => (this.rightBnRef = el), part: "navigation-arrow" }, h("duet-icon", { name: "action-arrow-right-small", color: "currentColor", margin: "none", size: "xx-small" }))));
|
|
435
|
+
}
|
|
436
|
+
get element() { return getElement(this); }
|
|
437
|
+
static get watchers() { return {
|
|
438
|
+
"stepIndex": ["watchStateHandler"]
|
|
439
|
+
}; }
|
|
440
|
+
};
|
|
441
|
+
DuetRangeStepper.style = duetRangeStepperCss;
|
|
442
|
+
|
|
443
|
+
export { DuetPagination as duet_pagination, DuetRangeStepper as duet_range_stepper };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { c as createID } from './create-id-981107da.js';
|
|
6
6
|
import { g as getLocaleString } from './language-utils-344d894c.js';
|
|
7
7
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { c as createID } from './create-id-981107da.js';
|
|
6
6
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
7
7
|
import { f as findCheckedOption, w as watchForOptions } from './watch-options-dd55bce8.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { c as colorPrimaryTurva, a as colorGrayTurva, b as colorPrimary, d as colorGray } from './tokens.module-49cbf963.js';
|
|
6
6
|
import { c as createID } from './create-id-981107da.js';
|
|
7
7
|
import { i as isInternetExplorer } from './is-internet-explorer-62b3bdbd.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
4
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-49b2d31a.js';
|
|
5
5
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
6
6
|
import { g as getLocaleString, a as getLanguage } from './language-utils-344d894c.js';
|
|
7
7
|
import { c as createID } from './create-id-981107da.js';
|
|
8
|
-
import { d as isArrowLeftKey, b as isArrowUpKey, a as isArrowRightKey, c as isArrowDownKey } from './keyboard-utils-
|
|
8
|
+
import { d as isArrowLeftKey, b as isArrowUpKey, a as isArrowRightKey, c as isArrowDownKey } from './keyboard-utils-6eb55cd5.js';
|
|
9
9
|
import './string-utils-2f1793b8.js';
|
|
10
10
|
|
|
11
11
|
const duetScrollableCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent}:host{position:relative !important}:host .duet-scrollable-items{display:flex}:host .duet-scrollable-items .duet-scrollable-button{position:relative;flex:0 0 auto;flex-basis:40px;padding:10px;cursor:pointer}:host .duet-scrollable-items .duet-scrollable-button:active{transform:scale(0.8)}:host .duet-scrollable-items .duet-scrollable-button--left{left:-12px}:host .duet-scrollable-items .duet-scrollable-button--right{right:-12px}:host .duet-scrollable-items .duet-scrollable-button--occluded{display:none}:host .duet-scrollable-items .duet-scrollable-list{display:flex;flex-wrap:nowrap;gap:20px;padding-top:2px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scroll-snap-type:x mandatory;scroll-behavior:smooth;scroll-margin:0 20px;-ms-overflow-style:-ms-autohiding-scrollbar;-webkit-overflow-scrolling:touch;}:host .duet-scrollable-items .duet-scrollable-list::-webkit-scrollbar{display:none}::slotted(*){scroll-snap-align:center;margin-left:0;-webkit-transition:-webkit-transform 0.2s ease-in-out;transition:-webkit-transform 0.2s ease-in-out;transition:transform 0.2s ease-in-out;transition:transform 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out}";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { c as createID } from './create-id-981107da.js';
|
|
6
6
|
import { p as parsePossibleJSON } from './string-utils-2f1793b8.js';
|
|
7
7
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
8
8
|
|
|
9
|
-
const duetSelectCss = "@charset \"UTF-8\";*.sc-duet-select,*.sc-duet-select::after,*.sc-duet-select::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-select-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;width:100%;max-width:100%;vertical-align:bottom}.sc-duet-select-h:last-child,.sc-duet-select-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-select-h{width:calc(50% - 16px - 3px)}.duet-expand.sc-duet-select-h{width:100% !important}}.duet-m-0.sc-duet-select-h{margin:0 !important}duet-tooltip.sc-duet-select{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-select{position:relative;top:4px;right:auto}}.duet-select-placeholder.sc-duet-select{position:absolute;top:-9px;left:9px;z-index:200;display:block;width:auto;max-width:60%;padding:0 0.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:white}.duet-select-container.sc-duet-select{position:relative;width:100%}.duet-select-wrapper.sc-duet-select{position:relative;width:100%;padding:15px 14px !important;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;line-height:1.25}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}.duet-select-wrapper.sc-duet-select::after{content:\" \"}.duet-select-wrapper.sc-duet-select select.sc-duet-select{position:absolute;top:0;right:0;bottom:0;left:0;z-index:200;width:100%;height:100%;padding:0;margin:0;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;cursor:pointer;border:0;outline:none;opacity:0}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}.duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{border-color:#909599;box-shadow:0 0 0 1px #909599}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{border-color:#747475;box-shadow:0 0 0 1px #747475}.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #e02a0d}.duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{border-color:#0077b3;outline:0;box-shadow:0 0 0 1px #0077b3;transition:none}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{border-color:#171c3a;box-shadow:0 0 0 1px #171c3a}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#171c3a}.duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#0077b3}.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #e02a0d}.duet-select-wrapper.sc-duet-select select[disabled].sc-duet-select{cursor:default !important}.duet-select-wrapper.sc-duet-select select[disabled].sc-duet-select+.duet-select.sc-duet-select{color:#00294d !important;cursor:default !important;background:#f5f8fa !important;border-color:#f5f8fa !important;box-shadow:none !important;opacity:1 !important;-webkit-text-fill-color:#00294d !important}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select[disabled].sc-duet-select+.duet-select.sc-duet-select{color:#171c3a !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important;-webkit-text-fill-color:#171c3a !important}.duet-select.sc-duet-select{position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;display:block;width:100%;min-width:8rem;padding:12px 14px !important;padding-right:48px !important;overflow:hidden;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.5;color:#00294d;text-align:left;text-overflow:ellipsis;white-space:nowrap;background:white;border:1px solid #909599;border-radius:4px;transition:150ms ease}.has-error.sc-duet-select .duet-select.sc-duet-select{border-color:#de2362 !important}.has-error.sc-duet-select .duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-select .duet-select.sc-duet-select{border-color:#e02a0d !important}.duet-theme-turva.has-error.sc-duet-select .duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#e02a0d !important}.duet-theme-turva.sc-duet-select .duet-select.sc-duet-select{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a;border-color:#747475}.duet-select.sc-duet-select svg.sc-duet-select{position:absolute;top:50%;right:16px;z-index:200;width:20px;height:20px;color:#00294d;pointer-events:none;transform:translateY(-50%)}.duet-theme-turva.sc-duet-select .duet-select.sc-duet-select svg.sc-duet-select{color:#171c3a}.duet-select-help.sc-duet-select{display:block;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:0.875rem;font-weight:400;line-height:1.25;color:#657787;border-radius:4px}.duet-select-help.sc-duet-select span.sc-duet-select{display:block;margin-top:8px}.duet-theme-turva.sc-duet-select .duet-select-help.sc-duet-select{color:#747475}.has-error.sc-duet-select .duet-select-help.sc-duet-select{color:#de2362}.duet-theme-turva.has-error.sc-duet-select .duet-select-help.sc-duet-select{color:#e02a0d}.duet-label-hidden.sc-duet-select duet-label.sc-duet-select{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
9
|
+
const duetSelectCss = "@charset \"UTF-8\";*.sc-duet-select,*.sc-duet-select::after,*.sc-duet-select::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-select-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;width:100%;max-width:100%;vertical-align:bottom}.sc-duet-select-h:last-child,.sc-duet-select-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-select-h{width:calc(50% - 16px - 3px)}.duet-expand.sc-duet-select-h{width:100% !important}}.duet-select-variation-tiny.sc-duet-select-h{position:relative;top:-2px;width:72px;margin:0 !important;vertical-align:baseline}.duet-m-0.sc-duet-select-h{margin:0 !important}duet-tooltip.sc-duet-select{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-select{position:relative;top:4px;right:auto}}.duet-select-placeholder.sc-duet-select{position:absolute;top:-9px;left:9px;z-index:200;display:block;width:auto;max-width:60%;padding:0 0.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:white}.duet-select-container.sc-duet-select{position:relative;width:100%}.duet-select-container.duet-select-variation-tiny.sc-duet-select{width:72px}.duet-select-wrapper.sc-duet-select{position:relative;width:100%;padding:15px 14px !important;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;line-height:1.25}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}.duet-select-variation-tiny.sc-duet-select .duet-select-wrapper.sc-duet-select{width:81px;padding:0 !important}.duet-select-wrapper.sc-duet-select::after{content:\" \"}.duet-select-wrapper.sc-duet-select select.sc-duet-select{position:absolute;top:0;right:0;bottom:0;left:0;z-index:200;width:100%;height:100%;padding:0;margin:0;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;cursor:pointer;border:0;outline:none;opacity:0}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}.duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{border-color:#909599;box-shadow:0 0 0 1px #909599}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{border-color:#747475;box-shadow:0 0 0 1px #747475}.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:hover+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #e02a0d}.duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{border-color:#0077b3;outline:0;box-shadow:0 0 0 1px #0077b3;transition:none}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{border-color:#171c3a;box-shadow:0 0 0 1px #171c3a}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#171c3a}.duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#0077b3}.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-select .duet-select-wrapper.sc-duet-select select.sc-duet-select:focus+.duet-select.sc-duet-select{box-shadow:0 0 0 1px #e02a0d}.duet-select-wrapper.sc-duet-select select[disabled].sc-duet-select{cursor:default !important}.duet-select-wrapper.sc-duet-select select[disabled].sc-duet-select+.duet-select.sc-duet-select{color:#00294d !important;cursor:default !important;background:#f5f8fa !important;border-color:#f5f8fa !important;box-shadow:none !important;opacity:1 !important;-webkit-text-fill-color:#00294d !important}.duet-theme-turva.sc-duet-select .duet-select-wrapper.sc-duet-select select[disabled].sc-duet-select+.duet-select.sc-duet-select{color:#171c3a !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important;-webkit-text-fill-color:#171c3a !important}.duet-select.sc-duet-select{position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;display:block;width:100%;min-width:8rem;padding:12px 14px !important;padding-right:48px !important;overflow:hidden;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.5;color:#00294d;text-align:left;text-overflow:ellipsis;white-space:nowrap;background:white;border:1px solid #909599;border-radius:4px;transition:150ms ease}.has-error.sc-duet-select .duet-select.sc-duet-select{border-color:#de2362 !important}.has-error.sc-duet-select .duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-select .duet-select.sc-duet-select{border-color:#e02a0d !important}.duet-theme-turva.has-error.sc-duet-select .duet-select.sc-duet-select .duet-select-icon.sc-duet-select{color:#e02a0d !important}.duet-theme-turva.sc-duet-select .duet-select.sc-duet-select{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a;border-color:#747475}.duet-select.sc-duet-select svg.sc-duet-select{position:absolute;top:50%;right:16px;z-index:200;width:20px;height:20px;color:#00294d;pointer-events:none;transform:translateY(-50%)}.duet-theme-turva.sc-duet-select .duet-select.sc-duet-select svg.sc-duet-select{color:#171c3a}.duet-select-variation-tiny.sc-duet-select .duet-select.sc-duet-select{width:72px;min-width:inherit;padding:0 !important;margin-bottom:-4px;overflow:visible;font-weight:600;text-align:center}.duet-select-variation-tiny.sc-duet-select .duet-select.sc-duet-select duet-icon.sc-duet-select{padding-left:10px}.duet-select-help.sc-duet-select{display:block;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:0.875rem;font-weight:400;line-height:1.25;color:#657787;border-radius:4px}.duet-select-help.sc-duet-select span.sc-duet-select{display:block;margin-top:8px}.duet-theme-turva.sc-duet-select .duet-select-help.sc-duet-select{color:#747475}.has-error.sc-duet-select .duet-select-help.sc-duet-select{color:#de2362}.duet-theme-turva.has-error.sc-duet-select .duet-select-help.sc-duet-select{color:#e02a0d}.duet-label-hidden.sc-duet-select duet-label.sc-duet-select{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
10
10
|
|
|
11
11
|
function isOptionGroup(item) {
|
|
12
12
|
return "options" in item;
|
|
@@ -41,6 +41,10 @@ let DuetSelect = class {
|
|
|
41
41
|
* Inlined decorator, alphabetical order.
|
|
42
42
|
*/
|
|
43
43
|
this.processedItems = null;
|
|
44
|
+
/**
|
|
45
|
+
* Variation of dropdown. -tiny is used for small numbers / tiny option ranges.
|
|
46
|
+
*/
|
|
47
|
+
this.variation = "default";
|
|
44
48
|
/**
|
|
45
49
|
* Controls the margin of the component.
|
|
46
50
|
*/
|
|
@@ -172,15 +176,23 @@ let DuetSelect = class {
|
|
|
172
176
|
*/
|
|
173
177
|
render() {
|
|
174
178
|
const identifier = this.identifier || this.selectId;
|
|
175
|
-
return (h(Host, { onClick: this.onClick, class: {
|
|
179
|
+
return (h(Host, { onClick: this.onClick, class: {
|
|
180
|
+
"duet-m-0": this.margin === "none",
|
|
181
|
+
"duet-expand": this.expand,
|
|
182
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
183
|
+
} }, h("div", { class: {
|
|
176
184
|
"duet-select-container": true,
|
|
177
185
|
"duet-label-hidden": this.labelHidden,
|
|
178
186
|
"duet-theme-turva": this.theme === "turva",
|
|
187
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
179
188
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
180
189
|
"has-error": !!this.error,
|
|
181
190
|
} }, h("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, id: this.labelId, for: identifier }, this.label), this.tooltip && (h("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (h("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), h("div", { class: "duet-select-wrapper" }, this.placeholder && this.echoPlaceholder && this.value && (h("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-select-placeholder", size: "small" }, this.placeholder)), h("select", { ref: select => (this.nativeSelect = select), disabled: this.disabled, name: this.name, id: identifier, role: this.role, "aria-labelledby": `${this.labelId} ${this.errorId}`, "aria-controls": this.accessibleControls, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, onFocus: this.onFocus, onBlur: this.onBlur, onChange: this.onChange, required: this.required, "aria-describedby": this.accessibleDescribedBy }, this.placeholder && (h("option", { disabled: true, selected: true, value: "" }, this.placeholder)), !this.processedItems ? (h("option", null, "Virhe valintoja ladattaessa. P\u00E4ivit\u00E4 sivu ja kokeile uusiksi.")) : (this.processedItems.map(item => {
|
|
182
191
|
return isOptionGroup(item) ? this.renderOptionGroup(item) : this.renderOption(item);
|
|
183
|
-
}))), h("div", { class:
|
|
192
|
+
}))), h("div", { class: {
|
|
193
|
+
"duet-select": true,
|
|
194
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
195
|
+
}, "aria-hidden": "true" }, h("span", { key: this.value }, this.getSelectedItemLabel()), this.variation !== "tiny" && (h("svg", { role: "img", class: "duet-select-icon", fill: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "m12 18.999c-.4 0-.776-.156-1.059-.438l-10.721-10.72c-.142-.142-.22-.33-.22-.531 0-.2.078-.389.22-.53.142-.142.33-.22.53-.22s.389.078.53.22l10.72 10.719 10.72-10.719c.142-.142.33-.22.53-.22s.389.078.53.22c.142.142.22.33.22.53s-.078.389-.22.53l-10.72 10.72c-.282.283-.659.439-1.06.439z" }))), this.variation === "tiny" && (h("duet-icon", { name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xx-small" })))), h("span", { class: "duet-select-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h("span", null, this.error)))));
|
|
184
196
|
}
|
|
185
197
|
get element() { return getElement(this); }
|
|
186
198
|
static get watchers() { return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-49b2d31a.js';
|
|
5
5
|
import { c as createID } from './create-id-981107da.js';
|
|
6
|
-
import { i as isKeyboardClick } from './keyboard-utils-
|
|
6
|
+
import { i as isKeyboardClick } from './keyboard-utils-6eb55cd5.js';
|
|
7
7
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
8
8
|
|
|
9
9
|
var actionEdit2={"title":"action-edit-2","tags":"action edit 2 pen pencil","svg":"<svg fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\"><path d=\"M.748 24a.755.755 0 0 1-.531-.22.754.754 0 0 1-.196-.716l1.77-6.905a.84.84 0 0 1 .045-.121.73.73 0 0 1 .151-.223L16.513 1.289A4.355 4.355 0 0 1 19.611 0c1.178 0 2.277.454 3.106 1.279l.029.029a4.367 4.367 0 0 1 1.251 3.121 4.356 4.356 0 0 1-1.32 3.087L8.183 22.01a.735.735 0 0 1-.231.154.784.784 0 0 1-.111.042L.933 23.978A.773.773 0 0 1 .748 24zm1.041-1.791 4.41-1.131-3.281-3.275zm5.868-1.795 13.02-13.02-4.074-4.074L3.58 16.344zM21.736 6.332a2.893 2.893 0 0 0-.059-3.972l-.02-.02a2.872 2.872 0 0 0-2.037-.84v-.375l-.001.375a2.873 2.873 0 0 0-1.954.762z\"/></svg>"};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { c as createID } from './create-id-981107da.js';
|
|
6
6
|
import { c as cleanValue } from './input-utils-f4cafee1.js';
|
|
7
7
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { c as createID } from './create-id-981107da.js';
|
|
6
6
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { c as createID } from './create-id-981107da.js';
|
|
6
6
|
import { a as getLanguage, g as getLocaleString } from './language-utils-344d894c.js';
|
|
7
7
|
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, h, F as Fragment, g as getElement } from './index-
|
|
4
|
+
import { r as registerInstance, h, F as Fragment, g as getElement } from './index-49b2d31a.js';
|
|
5
5
|
import { s as sizeHeader } from './tokens.module-49cbf963.js';
|
|
6
6
|
import { c as createID } from './create-id-981107da.js';
|
|
7
7
|
import { a as getLanguage, g as getLocaleString } from './language-utils-344d894c.js';
|