@duetds/components 4.35.2 → 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-15cc3af9.js → focus-utils-675b1aa3.js} +1 -1
- package/lib/cjs/{index-a38f3df3.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-f1803ec3.system.entry.js → p-0349b691.system.entry.js} +1 -1
- package/lib/duet/{p-97353a7f.system.entry.js → p-0769de2b.system.entry.js} +1 -1
- package/lib/duet/{p-15a42b87.entry.js → p-09920da9.entry.js} +1 -1
- package/lib/duet/{p-c9020872.entry.js → p-1aeb418c.entry.js} +1 -1
- package/lib/duet/{p-e7056ea5.system.entry.js → p-1afe9641.system.entry.js} +1 -1
- package/lib/duet/p-1b56e483.system.entry.js +4 -0
- package/lib/duet/{p-0d6c3d07.entry.js → p-1c1c9705.entry.js} +1 -1
- package/lib/duet/p-21cd146b.system.entry.js +4 -0
- package/lib/duet/{p-e9ca4ae1.system.entry.js → p-22e6615d.system.entry.js} +2 -2
- package/lib/duet/{p-ed981e8d.system.entry.js → p-28a22555.system.entry.js} +1 -1
- package/lib/duet/p-298a9ffc.system.js +4 -0
- package/lib/duet/{p-3bd812df.entry.js → p-2a9345a7.entry.js} +1 -1
- package/lib/duet/{p-5f24e161.system.entry.js → p-314b64b4.system.entry.js} +1 -1
- package/lib/duet/{p-8acdabb5.system.entry.js → p-363abf26.system.entry.js} +1 -1
- package/lib/duet/{p-a53a8675.entry.js → p-3c13a041.entry.js} +1 -1
- package/lib/duet/{p-7e2a2e30.system.entry.js → p-40360b4a.system.entry.js} +1 -1
- package/lib/duet/{p-acf24fcd.system.entry.js → p-44a3794d.system.entry.js} +1 -1
- package/lib/duet/{p-1b98f91c.entry.js → p-4b688aea.entry.js} +1 -1
- package/lib/duet/{p-8edd126b.system.entry.js → p-4f32cc18.system.entry.js} +1 -1
- package/lib/duet/{p-3081f8a5.system.entry.js → p-59480299.system.entry.js} +1 -1
- package/lib/duet/{p-d2edeb9a.system.entry.js → p-5e410fa9.system.entry.js} +1 -1
- package/lib/duet/{p-3dbeddf5.entry.js → p-5f4362b4.entry.js} +1 -1
- package/lib/duet/{p-9a47c28a.entry.js → p-663aec3a.entry.js} +1 -1
- package/lib/duet/{p-d9da705b.entry.js → p-6aa8d848.entry.js} +1 -1
- package/lib/duet/p-6da8743f.system.entry.js +4 -0
- package/lib/duet/{p-0d15892b.entry.js → p-6df7b78c.entry.js} +1 -1
- package/lib/duet/{p-49820427.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-ef7560b6.entry.js → p-7730d2b8.entry.js} +1 -1
- package/lib/duet/{p-3e578cc5.system.entry.js → p-78779ba1.system.entry.js} +1 -1
- package/lib/duet/{p-67b22acc.system.entry.js → p-78aa974b.system.entry.js} +1 -1
- package/lib/duet/p-7e2c06d0.js +4 -0
- package/lib/duet/{p-30783ea4.entry.js → p-7f1cbb7d.entry.js} +1 -1
- package/lib/duet/{p-3baf5b41.system.entry.js → p-80aa512a.system.entry.js} +1 -1
- package/lib/duet/p-81867417.system.js +4 -0
- package/lib/duet/{p-94b4ec76.entry.js → p-818cd527.entry.js} +1 -1
- package/lib/duet/{p-632186a9.system.entry.js → p-84940fc4.system.entry.js} +1 -1
- package/lib/duet/{p-ac01755b.system.entry.js → p-84a9fbf4.system.entry.js} +1 -1
- package/lib/duet/{p-4accc70c.system.js → p-85d9b1b0.system.js} +1 -1
- package/lib/duet/{p-4d7abe27.system.entry.js → p-8706664b.system.entry.js} +1 -1
- package/lib/duet/{p-d6563133.system.entry.js → p-878c1c83.system.entry.js} +1 -1
- package/lib/duet/p-898f30a5.js +4 -0
- package/lib/duet/{p-2056e3eb.entry.js → p-8a768d0b.entry.js} +1 -1
- package/lib/duet/{p-4c3961a5.entry.js → p-8b8c2ef4.entry.js} +1 -1
- package/lib/duet/p-8c0fd5de.js +4 -0
- package/lib/duet/{p-d04561dc.system.js → p-8db453bf.system.js} +1 -1
- package/lib/duet/{p-38128fc3.entry.js → p-8f56fd3f.entry.js} +1 -1
- package/lib/duet/{p-04e3b06b.entry.js → p-8fa952df.entry.js} +1 -1
- package/lib/duet/{p-e9064858.entry.js → p-90799d0a.entry.js} +1 -1
- package/lib/duet/{p-9b0c78de.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-29e59e77.entry.js → p-995f20fc.entry.js} +1 -1
- package/lib/duet/{p-83261c61.entry.js → p-99a112e4.entry.js} +1 -1
- package/lib/duet/{p-573921ca.entry.js → p-9ead1c59.entry.js} +1 -1
- package/lib/duet/{p-889193e8.entry.js → p-a0f979a4.entry.js} +1 -1
- package/lib/duet/{p-ce40057c.entry.js → p-a154a0c0.entry.js} +1 -1
- package/lib/duet/{p-9dd65758.system.entry.js → p-a2db8ff2.system.entry.js} +1 -1
- package/lib/duet/{p-7641054f.entry.js → p-a75776f5.entry.js} +1 -1
- package/lib/duet/{p-18441899.system.entry.js → p-a8f707d4.system.entry.js} +2 -2
- package/lib/duet/{p-5af271ce.system.entry.js → p-aa5abb52.system.entry.js} +1 -1
- package/lib/duet/p-abcbdef5.entry.js +4 -0
- package/lib/duet/{p-c0fa8865.entry.js → p-ac44ab7a.entry.js} +1 -1
- package/lib/duet/{p-0deee587.system.entry.js → p-ad06c91d.system.entry.js} +1 -1
- package/lib/duet/{p-54d296d9.system.entry.js → p-ad8a49a3.system.entry.js} +1 -1
- package/lib/duet/p-ae82d8e7.entry.js +4 -0
- package/lib/duet/{p-fa5a028c.entry.js → p-aebf6700.entry.js} +1 -1
- package/lib/duet/{p-a73609b4.system.entry.js → p-b11f2fcd.system.entry.js} +1 -1
- package/lib/duet/p-b25d3769.js +4 -0
- package/lib/duet/{p-0ea49de8.entry.js → p-b42066e0.entry.js} +1 -1
- package/lib/duet/{p-69c4ff6f.entry.js → p-b5aaf161.entry.js} +1 -1
- package/lib/duet/{p-bf859d7b.entry.js → p-b6b58d31.entry.js} +1 -1
- package/lib/duet/{p-e701e364.entry.js → p-bd602c98.entry.js} +1 -1
- package/lib/duet/{p-7142b886.entry.js → p-bf25e52a.entry.js} +1 -1
- package/lib/duet/{p-70cf255e.system.entry.js → p-c0a24b5e.system.entry.js} +1 -1
- package/lib/duet/{p-27b953e4.system.entry.js → p-c167a5aa.system.entry.js} +1 -1
- package/lib/duet/{p-f261a666.system.entry.js → p-c5db93a7.system.entry.js} +1 -1
- package/lib/duet/{p-b80d80dc.system.entry.js → p-c61ace58.system.entry.js} +1 -1
- package/lib/duet/{p-2c8bd5a2.system.entry.js → p-d32b240d.system.entry.js} +1 -1
- package/lib/duet/{p-b692b4a4.system.entry.js → p-d444e178.system.entry.js} +1 -1
- package/lib/duet/{p-3b244de7.entry.js → p-daede773.entry.js} +1 -1
- package/lib/duet/{p-41b4bad1.entry.js → p-dda7f098.entry.js} +1 -1
- package/lib/duet/{p-13e81854.entry.js → p-e584ce1d.entry.js} +1 -1
- package/lib/duet/{p-114a20f1.system.entry.js → p-e67fc1ed.system.entry.js} +1 -1
- package/lib/duet/{p-6b3a14c2.entry.js → p-e9ca7e01.entry.js} +1 -1
- package/lib/duet/{p-b1ae4d5b.system.entry.js → p-ea124391.system.entry.js} +2 -2
- package/lib/duet/{p-e3c66ce5.system.entry.js → p-f993e4c3.system.entry.js} +1 -1
- package/lib/duet/{p-d158b9ca.system.entry.js → p-fb55e381.system.entry.js} +1 -1
- package/lib/duet/{p-7d019a4d.entry.js → p-fc02d8e9.entry.js} +1 -1
- package/lib/duet/{p-d3432b68.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-d3cd655b.js → focus-utils-bd3c1702.js} +1 -1
- package/lib/esm/{index-eb374972.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-eb374972.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-04f9f1bf.js +0 -4
- package/lib/duet/p-0bc3239b.entry.js +0 -4
- package/lib/duet/p-35ff635e.system.js +0 -4
- package/lib/duet/p-875bd99c.js +0 -4
- package/lib/duet/p-aed2a35e.system.entry.js +0 -4
- package/lib/duet/p-b2985c8e.system.entry.js +0 -4
- package/lib/duet/p-bb12b972.system.js +0 -4
- package/lib/duet/p-bcf94afd.js +0 -4
- package/lib/duet/p-be872079.entry.js +0 -4
- package/lib/duet/p-c479f3be.system.entry.js +0 -4
- package/lib/duet/p-c99e23d2.entry.js +0 -4
- package/lib/esm-es5/focus-utils-d3cd655b.js +0 -4
- package/lib/esm-es5/keyboard-utils-584cedd7.js +0 -4
- package/lib/html.html-data.json +0 -5056
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
|
+
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
|
+
const createId = require('./create-id-c3b984b1.js');
|
|
10
|
+
const jsUtils = require('./js-utils-33a9dbe3.js');
|
|
11
|
+
const keyboardUtils = require('./keyboard-utils-898cfe14.js');
|
|
12
|
+
const languageUtils = require('./language-utils-aa282901.js');
|
|
13
|
+
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
14
|
+
require('./string-utils-267e3dbb.js');
|
|
15
|
+
|
|
16
|
+
const shouldDisplayNavigation = (visibleItems, total, take) => {
|
|
17
|
+
if (visibleItems * 2 > total / take) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
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}";
|
|
24
|
+
|
|
25
|
+
let DuetPagination = class {
|
|
26
|
+
constructor(hostRef) {
|
|
27
|
+
index.registerInstance(this, hostRef);
|
|
28
|
+
this.duetPageChange = index.createEvent(this, "duetPageChange", 3);
|
|
29
|
+
this.listId = createId.createID("duet-pagination-list");
|
|
30
|
+
this.numbersStore = "";
|
|
31
|
+
/**
|
|
32
|
+
* State() variables
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
this.totalPages = 10;
|
|
36
|
+
/**
|
|
37
|
+
* State() variables
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
this.internalSectionIndex = 0;
|
|
41
|
+
/**
|
|
42
|
+
* Theme of the pagination.
|
|
43
|
+
*/
|
|
44
|
+
this.theme = "";
|
|
45
|
+
/**
|
|
46
|
+
* Characters to use for the jump buttons.
|
|
47
|
+
*/
|
|
48
|
+
this.jumpString = "...";
|
|
49
|
+
/**
|
|
50
|
+
* Default pagination labels
|
|
51
|
+
*/
|
|
52
|
+
this.ariaLabelsDefaults = {
|
|
53
|
+
en: {
|
|
54
|
+
next_page: "Next page",
|
|
55
|
+
previous_page: "Previous page",
|
|
56
|
+
first_page: "First page",
|
|
57
|
+
last_page: "Last page",
|
|
58
|
+
jump_to: "Jump to page",
|
|
59
|
+
go_to: "Go to page",
|
|
60
|
+
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",
|
|
61
|
+
pagination_label: "Pagination, choose a number to jump to a page",
|
|
62
|
+
prev_section: "Show previous {0} page numbers, screen reader user should use arrowkeys to navigate",
|
|
63
|
+
next_section: "Show next {0} page numbers, screen reader user should use arrowkeys to navigate",
|
|
64
|
+
},
|
|
65
|
+
fi: {
|
|
66
|
+
next_page: "Seuraava sivu",
|
|
67
|
+
previous_page: "Edellinen sivu",
|
|
68
|
+
first_page: "Ensimmäinen sivu",
|
|
69
|
+
last_page: "Viimeinen sivu",
|
|
70
|
+
jump_to: "Siirry sivulle",
|
|
71
|
+
go_to: "Siirry sivulle",
|
|
72
|
+
description: "Voit käyttää nuolinäppäimiä sivunumeron valitsemiseen, tai kirjoittaa sivunumeron, jos tämä elementti on aktiivinen, siirtymään sivulle",
|
|
73
|
+
pagination_label: "Sivutus, valitse sivunumero siirtyäksesi sivulle",
|
|
74
|
+
prev_section: "Näytä edelliset {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",
|
|
75
|
+
next_section: "Näytä seuraavat {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",
|
|
76
|
+
},
|
|
77
|
+
sv: {
|
|
78
|
+
next_page: "Nästa sida",
|
|
79
|
+
previous_page: "Föregående sida",
|
|
80
|
+
first_page: "Första sidan",
|
|
81
|
+
last_page: "Sista sidan",
|
|
82
|
+
jump_to: "Hoppa till sida",
|
|
83
|
+
go_to: "Hoppa till sida",
|
|
84
|
+
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",
|
|
85
|
+
pagination_label: "Sidutning, välj en siffra för att hoppa till en sida",
|
|
86
|
+
prev_section: "Visa föregående {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",
|
|
87
|
+
next_section: "Visa nästa {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Default pagination labels
|
|
92
|
+
*/
|
|
93
|
+
this.ariaLabels = languageUtils.getLocaleString(this.ariaLabelsDefaults);
|
|
94
|
+
/**
|
|
95
|
+
* The size of the take, when paginating.
|
|
96
|
+
*/
|
|
97
|
+
this.take = 5;
|
|
98
|
+
/**
|
|
99
|
+
* Amount of visible page numbers to show
|
|
100
|
+
*/
|
|
101
|
+
this.visibleItems = 5;
|
|
102
|
+
/**
|
|
103
|
+
* The total size of the paginating data
|
|
104
|
+
*/
|
|
105
|
+
this.total = 1000;
|
|
106
|
+
/**
|
|
107
|
+
* Used to indicate which dom element with ID this element controls
|
|
108
|
+
*/
|
|
109
|
+
this.ariaControls = "";
|
|
110
|
+
/**
|
|
111
|
+
* The current page
|
|
112
|
+
*/
|
|
113
|
+
this.current = 1;
|
|
114
|
+
/**
|
|
115
|
+
* Private methods.
|
|
116
|
+
*/
|
|
117
|
+
// called from the watcher and used to make sure any changed to current also updates the internal section index
|
|
118
|
+
this.actionChain = async (after, before) => {
|
|
119
|
+
if (after === 0) {
|
|
120
|
+
this.current = 1;
|
|
121
|
+
}
|
|
122
|
+
else if (before !== after) {
|
|
123
|
+
const calculatedSectionIndex = Math.ceil(after / this.visibleItems) - 1;
|
|
124
|
+
if (calculatedSectionIndex !== this.internalSectionIndex) {
|
|
125
|
+
this.internalSectionIndex = calculatedSectionIndex;
|
|
126
|
+
await this.setFocus();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
//helper to emit relevant page events
|
|
131
|
+
this.emitPageEvent = jsUtils.debounce((ev, passedPage) => {
|
|
132
|
+
const page = Number(passedPage || this.current);
|
|
133
|
+
this.duetPageChange.emit({
|
|
134
|
+
component: "duet-pagination",
|
|
135
|
+
from: page * this.take,
|
|
136
|
+
to: page * this.take + this.take,
|
|
137
|
+
current: page,
|
|
138
|
+
take: this.take,
|
|
139
|
+
type: "page",
|
|
140
|
+
originalEvent: ev,
|
|
141
|
+
});
|
|
142
|
+
}, 500);
|
|
143
|
+
// this will return the entered number, or the current page if the user presses enter
|
|
144
|
+
this.getEnteredNumber = jsUtils.debounce(ev => {
|
|
145
|
+
this.emitPageEvent(ev, this.numbersStore);
|
|
146
|
+
this.current = Number(this.numbersStore);
|
|
147
|
+
this.numbersStore = "";
|
|
148
|
+
this.duetPageChange.emit({
|
|
149
|
+
component: "duet-pagination",
|
|
150
|
+
from: this.current * this.take,
|
|
151
|
+
to: this.current * this.take + this.take,
|
|
152
|
+
current: this.current,
|
|
153
|
+
take: this.take,
|
|
154
|
+
type: "jump",
|
|
155
|
+
originalEvent: ev,
|
|
156
|
+
});
|
|
157
|
+
}, 500);
|
|
158
|
+
}
|
|
159
|
+
watchStateHandler(newValue, oldValue) {
|
|
160
|
+
this.actionChain(newValue, oldValue);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Component lifecycle events.
|
|
164
|
+
*/
|
|
165
|
+
componentWillLoad() {
|
|
166
|
+
// 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
|
|
167
|
+
this.internalSectionIndex = Math.ceil(this.current / this.visibleItems) - 1;
|
|
168
|
+
this.calculatePageTake();
|
|
169
|
+
themeableComponent.inheritGlobalTheme(this);
|
|
170
|
+
}
|
|
171
|
+
componentWillRender() {
|
|
172
|
+
if (this.internalSectionIndex !== 0 && this.internalSectionIndex !== this.totalPages) {
|
|
173
|
+
this.calculatePageTake();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
componentDidRender() {
|
|
177
|
+
this.setFocus();
|
|
178
|
+
}
|
|
179
|
+
//get totalpages from visible and total
|
|
180
|
+
calculatePageTake() {
|
|
181
|
+
this.totalPages = Math.ceil(this.total / this.take);
|
|
182
|
+
}
|
|
183
|
+
//set update current when mouse click on page number
|
|
184
|
+
async onMouseHandler(e, dir) {
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
e.stopPropagation();
|
|
187
|
+
this.current = this.current + dir;
|
|
188
|
+
}
|
|
189
|
+
//handle a11y keyboard navigation events
|
|
190
|
+
async onKeyboardDown(e) {
|
|
191
|
+
let next = this.current;
|
|
192
|
+
// handle a11y based keyboard navigation for left/right/up/down
|
|
193
|
+
if (keyboardUtils.isArrowLeftKey(e) || keyboardUtils.isArrowUpKey(e)) {
|
|
194
|
+
next--;
|
|
195
|
+
}
|
|
196
|
+
if (keyboardUtils.isArrowRightKey(e) || keyboardUtils.isArrowDownKey(e)) {
|
|
197
|
+
next++;
|
|
198
|
+
}
|
|
199
|
+
if (keyboardUtils.isArrowKey(e)) {
|
|
200
|
+
if (next <= this.totalPages) {
|
|
201
|
+
this.current = next;
|
|
202
|
+
this.emitPageEvent(e);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
//handle the jump feature, where numbers can be entered
|
|
206
|
+
if (keyboardUtils.isNumber(e) && this.shouldDisplayNavigation()) {
|
|
207
|
+
this.numbersStore = this.numbersStore + e.key;
|
|
208
|
+
if (Number(this.numbersStore) > this.totalPages) {
|
|
209
|
+
this.numbersStore = this.totalPages + "";
|
|
210
|
+
}
|
|
211
|
+
this.getEnteredNumber(e);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// utility to set focus on active button
|
|
215
|
+
async setFocus() {
|
|
216
|
+
const currentDomElement = this.nativeNav.querySelector(`li.duet-pagination-item-is-active duet-button`);
|
|
217
|
+
currentDomElement && (await currentDomElement.setFocus());
|
|
218
|
+
}
|
|
219
|
+
//handles click on page numbers
|
|
220
|
+
pageClickHandler(e) {
|
|
221
|
+
e.preventDefault();
|
|
222
|
+
const clickedId = Number(e.target.getAttribute("data-id"));
|
|
223
|
+
this.current = clickedId;
|
|
224
|
+
this.emitPageEvent({}, clickedId);
|
|
225
|
+
}
|
|
226
|
+
//handles click on the next section buttons
|
|
227
|
+
sectionClickHandler(e, direction) {
|
|
228
|
+
e.preventDefault();
|
|
229
|
+
let next = this.internalSectionIndex + direction;
|
|
230
|
+
if (next >= this.totalPages / this.take) {
|
|
231
|
+
next = this.totalPages / this.take - 1;
|
|
232
|
+
}
|
|
233
|
+
const newSection = next;
|
|
234
|
+
this.internalSectionIndex = newSection >= 0 ? newSection : 0;
|
|
235
|
+
}
|
|
236
|
+
//handles click on the jump (1)button
|
|
237
|
+
jumpToStart(e) {
|
|
238
|
+
e.preventDefault();
|
|
239
|
+
this.internalSectionIndex = 0;
|
|
240
|
+
this.current = 1;
|
|
241
|
+
}
|
|
242
|
+
//handles click on the jump (total) button
|
|
243
|
+
jumpToEnd(e) {
|
|
244
|
+
e.preventDefault();
|
|
245
|
+
this.internalSectionIndex = this.totalPages / this.take - 1;
|
|
246
|
+
this.current = this.totalPages;
|
|
247
|
+
}
|
|
248
|
+
// render the individual page numbers
|
|
249
|
+
renderPageNumbers() {
|
|
250
|
+
const items = [];
|
|
251
|
+
let i = this.internalSectionIndex * this.visibleItems;
|
|
252
|
+
do {
|
|
253
|
+
i++;
|
|
254
|
+
if (i > this.totalPages) {
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
items.push(index.h("li", { class: {
|
|
258
|
+
"duet-pagination-item": true,
|
|
259
|
+
"duet-pagination-item-is-active": i === this.current,
|
|
260
|
+
}, role: "menuitem" }, index.h("duet-button", { class: {
|
|
261
|
+
"duet-pagination-link": true,
|
|
262
|
+
}, 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) }, index.h("div", { class: "duet-pagination-page-number", "aria-hidden": true }, i))));
|
|
263
|
+
} while (i < this.visibleItems + this.internalSectionIndex * this.visibleItems);
|
|
264
|
+
return items;
|
|
265
|
+
}
|
|
266
|
+
shouldDisplayNavigation() {
|
|
267
|
+
return shouldDisplayNavigation(this.visibleItems, this.total, this.take);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* render() function
|
|
271
|
+
* Always the last one in the class.
|
|
272
|
+
*/
|
|
273
|
+
render() {
|
|
274
|
+
return (index.h(index.Host, { onKeyDown: e => this.onKeyboardDown(e) }, index.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 !== "" && (index.h("div", { "aria-live": "assertive", "aria-relevant": "text", class: "duet-pagination-overlay", "aria-label": `${this.ariaLabels.jump_to} ${this.numbersStore}`, part: "navigation-overlay" }, index.h("duet-badge", null, "jump to page : ", this.numbersStore))), index.h("ol", { id: this.listId, class: {
|
|
275
|
+
"duet-pagination": true,
|
|
276
|
+
"duet-pagination-is-dimmed": this.numbersStore !== "",
|
|
277
|
+
}, role: "menubar", "aria-label": this.ariaLabels.pagination_label, "aria-description": this.ariaLabels.description }, index.h("li", { class: {
|
|
278
|
+
"duet-pagination-page-button": true,
|
|
279
|
+
"duet-pagination-button-first": true,
|
|
280
|
+
}, role: "menuitem", part: "navigation-arrow" }, index.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 }, index.h("duet-icon", { name: "action-arrow-left-small", color: "currentColor", margin: "none", size: "xx-small" }))), this.internalSectionIndex !== 0 && this.shouldDisplayNavigation() && (index.h(index.Fragment, null, index.h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-jump" }, index.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) }, index.h("div", { class: "duet-pagination-page-number" }, "1"))), index.h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-section" }, index.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) }, index.h("div", { class: "duet-pagination-page-number", "aria-hidden": "true" }, "..."))))), this.renderPageNumbers(), this.internalSectionIndex !== this.totalPages / this.visibleItems - 1 && this.shouldDisplayNavigation() && (index.h(index.Fragment, null, index.h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-section" }, index.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) }, index.h("div", { class: "duet-pagination-page-number", "aria-hidden": "true" }, "..."))), index.h("li", { class: "duet-pagination-item", role: "menuitem", part: "navigation-jump" }, index.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) }, index.h("div", { class: "duet-pagination-page-number" }, this.totalPages))))), index.h("li", { class: {
|
|
281
|
+
"duet-pagination-page-button": true,
|
|
282
|
+
"duet-pagination-button-last": true,
|
|
283
|
+
}, role: "menuitem", part: "navigation-arrow" }, index.h("button", { disabled: this.current === this.totalPages &&
|
|
284
|
+
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) }, index.h("duet-icon", { name: "action-arrow-right-small", color: "currentColor", margin: "none", size: "xx-small" })))))));
|
|
285
|
+
}
|
|
286
|
+
get element() { return index.getElement(this); }
|
|
287
|
+
static get watchers() { return {
|
|
288
|
+
"current": ["watchStateHandler"]
|
|
289
|
+
}; }
|
|
290
|
+
};
|
|
291
|
+
DuetPagination.style = duetPaginationCss;
|
|
292
|
+
|
|
293
|
+
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}";
|
|
294
|
+
|
|
295
|
+
let DuetRangeStepper = class {
|
|
296
|
+
constructor(hostRef) {
|
|
297
|
+
index.registerInstance(this, hostRef);
|
|
298
|
+
this.duetRangeStepUpdate = index.createEvent(this, "duetRangeStepUpdate", 7);
|
|
299
|
+
this.leftBn = createId.createID("duetRangeStepper-left");
|
|
300
|
+
this.rightBn = createId.createID("duetRangeStepper-right");
|
|
301
|
+
/**
|
|
302
|
+
* Theme of the component.
|
|
303
|
+
*/
|
|
304
|
+
this.theme = "";
|
|
305
|
+
/**
|
|
306
|
+
* Start value
|
|
307
|
+
* @default 1
|
|
308
|
+
*/
|
|
309
|
+
this.stepIndex = 1;
|
|
310
|
+
/**
|
|
311
|
+
* How big is the step
|
|
312
|
+
* @default 99
|
|
313
|
+
*/
|
|
314
|
+
this.stepSize = 50;
|
|
315
|
+
/**
|
|
316
|
+
* Total of
|
|
317
|
+
* @default undefined
|
|
318
|
+
*/
|
|
319
|
+
this.total = 1000;
|
|
320
|
+
/**
|
|
321
|
+
* Default range stepper labels
|
|
322
|
+
*/
|
|
323
|
+
this.ariaLabelsDefaults = {
|
|
324
|
+
en: {
|
|
325
|
+
next_increment: "Next range increment",
|
|
326
|
+
previous_increment: "Previous range increment",
|
|
327
|
+
x_of_y: "{0}–{1} of {2}",
|
|
328
|
+
},
|
|
329
|
+
fi: {
|
|
330
|
+
next_increment: "Seuraava välillä",
|
|
331
|
+
previous_increment: "Edellinen välillä",
|
|
332
|
+
x_of_y: "{0}–{1} / {2}",
|
|
333
|
+
},
|
|
334
|
+
sv: {
|
|
335
|
+
next_increment: "Nästa intervall",
|
|
336
|
+
previous_increment: "Föregående intervall",
|
|
337
|
+
x_of_y: "{0}–{1} av {2}",
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* Default pagination labels
|
|
342
|
+
*/
|
|
343
|
+
this.ariaLabels = languageUtils.getLocaleString(this.ariaLabelsDefaults);
|
|
344
|
+
/**
|
|
345
|
+
* Used to indicate which dom element with ID this element controls
|
|
346
|
+
*/
|
|
347
|
+
this.ariaControls = "";
|
|
348
|
+
this.handleClick = (e, direction) => {
|
|
349
|
+
e.preventDefault();
|
|
350
|
+
this.increment(direction);
|
|
351
|
+
this.handleStepClick(e);
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
watchStateHandler(newValue) {
|
|
355
|
+
if (newValue === 1) {
|
|
356
|
+
this.leftBnRef.setAttribute("disabled", "");
|
|
357
|
+
this.rightBnRef.focus();
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.leftBnRef.removeAttribute("disabled");
|
|
361
|
+
}
|
|
362
|
+
if (newValue === this.total / this.stepSize) {
|
|
363
|
+
this.rightBnRef.setAttribute("disabled", "");
|
|
364
|
+
this.leftBnRef.focus();
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
this.rightBnRef.removeAttribute("disabled");
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
handleStepClick(e) {
|
|
371
|
+
this.duetRangeStepUpdate.emit({
|
|
372
|
+
originalEvent: e,
|
|
373
|
+
component: "duet-range-stepper",
|
|
374
|
+
from: this.stepIndex * this.stepSize - this.stepSize,
|
|
375
|
+
to: this.stepIndex * this.stepSize,
|
|
376
|
+
index: this.stepIndex,
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
componentWillLoad() {
|
|
380
|
+
themeableComponent.inheritGlobalTheme(this);
|
|
381
|
+
}
|
|
382
|
+
componentDidLoad() {
|
|
383
|
+
this.watchStateHandler(this.stepIndex);
|
|
384
|
+
}
|
|
385
|
+
increment(direction) {
|
|
386
|
+
const newIndex = this.stepIndex + direction;
|
|
387
|
+
if (newIndex <= 0) {
|
|
388
|
+
this.stepIndex = 1;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
if (newIndex * this.stepSize <= this.total) {
|
|
392
|
+
this.stepIndex = newIndex;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
generateStepSize() {
|
|
397
|
+
// this function uses this.stepIndex and this.range to generate a range of number like 1-100
|
|
398
|
+
// this is used to generate the step size
|
|
399
|
+
let start = (this.stepIndex - 1) * this.stepSize;
|
|
400
|
+
//easy fix for starting position
|
|
401
|
+
if (start === 0) {
|
|
402
|
+
start = 1;
|
|
403
|
+
}
|
|
404
|
+
const end = this.stepIndex * this.stepSize;
|
|
405
|
+
return this.ariaLabels.x_of_y
|
|
406
|
+
.replace("{0}", String(start))
|
|
407
|
+
.replace("{1}", String(end))
|
|
408
|
+
.replace("{2}", String(this.total));
|
|
409
|
+
}
|
|
410
|
+
//handle a11y keyboard navigation events
|
|
411
|
+
async onKeyboardDown(e) {
|
|
412
|
+
// handle a11y based keyboard navigation for left/right/up/down
|
|
413
|
+
let next = this.stepIndex;
|
|
414
|
+
let dir = 1;
|
|
415
|
+
if (keyboardUtils.isArrowLeftKey(e) || keyboardUtils.isArrowUpKey(e) || keyboardUtils.isMinusKey(e)) {
|
|
416
|
+
next--;
|
|
417
|
+
dir = -1;
|
|
418
|
+
this.leftBnRef.focus();
|
|
419
|
+
}
|
|
420
|
+
if (keyboardUtils.isArrowRightKey(e) || keyboardUtils.isArrowDownKey(e) || keyboardUtils.isPlusKey(e)) {
|
|
421
|
+
next++;
|
|
422
|
+
dir = 1;
|
|
423
|
+
}
|
|
424
|
+
if (keyboardUtils.isArrowKey(e)) {
|
|
425
|
+
if (next > 0 && next * this.stepSize <= this.total) {
|
|
426
|
+
this.handleClick(e, dir);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* render() function
|
|
432
|
+
* Always the last one in the class.
|
|
433
|
+
*/
|
|
434
|
+
render() {
|
|
435
|
+
return (index.h("div", { class: {
|
|
436
|
+
"duet-range-stepper": true,
|
|
437
|
+
"duet-theme-turva": this.theme === "turva",
|
|
438
|
+
}, onKeyDown: e => this.onKeyboardDown(e), "aria-controls": this.ariaControls }, index.h("span", { class: "duet-range-step-counter", part: "range-numbers" }, this.generateStepSize()), index.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" }, index.h("duet-icon", { name: "action-arrow-left-small", color: "currentColor", margin: "none", size: "xx-small" })), index.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" }, index.h("duet-icon", { name: "action-arrow-right-small", color: "currentColor", margin: "none", size: "xx-small" }))));
|
|
439
|
+
}
|
|
440
|
+
get element() { return index.getElement(this); }
|
|
441
|
+
static get watchers() { return {
|
|
442
|
+
"stepIndex": ["watchStateHandler"]
|
|
443
|
+
}; }
|
|
444
|
+
};
|
|
445
|
+
DuetRangeStepper.style = duetRangeStepperCss;
|
|
446
|
+
|
|
447
|
+
exports.duet_pagination = DuetPagination;
|
|
448
|
+
exports.duet_range_stepper = DuetRangeStepper;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const createId = require('./create-id-c3b984b1.js');
|
|
10
10
|
const languageUtils = require('./language-utils-aa282901.js');
|
|
11
11
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const createId = require('./create-id-c3b984b1.js');
|
|
10
10
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
11
11
|
const watchOptions = require('./watch-options-d88afac0.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const tokens_module = require('./tokens.module-6b2df1c2.js');
|
|
10
10
|
const createId = require('./create-id-c3b984b1.js');
|
|
11
11
|
const isInternetExplorer = require('./is-internet-explorer-91361c56.js');
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
10
10
|
const languageUtils = require('./language-utils-aa282901.js');
|
|
11
11
|
const createId = require('./create-id-c3b984b1.js');
|
|
12
|
-
const keyboardUtils = require('./keyboard-utils-
|
|
12
|
+
const keyboardUtils = require('./keyboard-utils-898cfe14.js');
|
|
13
13
|
require('./string-utils-267e3dbb.js');
|
|
14
14
|
|
|
15
15
|
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}";
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const createId = require('./create-id-c3b984b1.js');
|
|
10
10
|
const stringUtils = require('./string-utils-267e3dbb.js');
|
|
11
11
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
12
12
|
|
|
13
|
-
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}";
|
|
13
|
+
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}";
|
|
14
14
|
|
|
15
15
|
function isOptionGroup(item) {
|
|
16
16
|
return "options" in item;
|
|
@@ -45,6 +45,10 @@ let DuetSelect = class {
|
|
|
45
45
|
* Inlined decorator, alphabetical order.
|
|
46
46
|
*/
|
|
47
47
|
this.processedItems = null;
|
|
48
|
+
/**
|
|
49
|
+
* Variation of dropdown. -tiny is used for small numbers / tiny option ranges.
|
|
50
|
+
*/
|
|
51
|
+
this.variation = "default";
|
|
48
52
|
/**
|
|
49
53
|
* Controls the margin of the component.
|
|
50
54
|
*/
|
|
@@ -176,15 +180,23 @@ let DuetSelect = class {
|
|
|
176
180
|
*/
|
|
177
181
|
render() {
|
|
178
182
|
const identifier = this.identifier || this.selectId;
|
|
179
|
-
return (index.h(index.Host, { onClick: this.onClick, class: {
|
|
183
|
+
return (index.h(index.Host, { onClick: this.onClick, class: {
|
|
184
|
+
"duet-m-0": this.margin === "none",
|
|
185
|
+
"duet-expand": this.expand,
|
|
186
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
187
|
+
} }, index.h("div", { class: {
|
|
180
188
|
"duet-select-container": true,
|
|
181
189
|
"duet-label-hidden": this.labelHidden,
|
|
182
190
|
"duet-theme-turva": this.theme === "turva",
|
|
191
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
183
192
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
184
193
|
"has-error": !!this.error,
|
|
185
194
|
} }, index.h("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, id: this.labelId, for: identifier }, this.label), this.tooltip && (index.h("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (index.h("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), index.h("div", { class: "duet-select-wrapper" }, this.placeholder && this.echoPlaceholder && this.value && (index.h("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-select-placeholder", size: "small" }, this.placeholder)), index.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 && (index.h("option", { disabled: true, selected: true, value: "" }, this.placeholder)), !this.processedItems ? (index.h("option", null, "Virhe valintoja ladattaessa. P\u00E4ivit\u00E4 sivu ja kokeile uusiksi.")) : (this.processedItems.map(item => {
|
|
186
195
|
return isOptionGroup(item) ? this.renderOptionGroup(item) : this.renderOption(item);
|
|
187
|
-
}))), index.h("div", { class:
|
|
196
|
+
}))), index.h("div", { class: {
|
|
197
|
+
"duet-select": true,
|
|
198
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
199
|
+
}, "aria-hidden": "true" }, index.h("span", { key: this.value }, this.getSelectedItemLabel()), this.variation !== "tiny" && (index.h("svg", { role: "img", class: "duet-select-icon", fill: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.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" && (index.h("duet-icon", { name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xx-small" })))), index.h("span", { class: "duet-select-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && index.h("span", null, this.error)))));
|
|
188
200
|
}
|
|
189
201
|
get element() { return index.getElement(this); }
|
|
190
202
|
static get watchers() { return {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const createId = require('./create-id-c3b984b1.js');
|
|
10
|
-
const keyboardUtils = require('./keyboard-utils-
|
|
10
|
+
const keyboardUtils = require('./keyboard-utils-898cfe14.js');
|
|
11
11
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
12
12
|
|
|
13
13
|
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>"};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const createId = require('./create-id-c3b984b1.js');
|
|
10
10
|
const inputUtils = require('./input-utils-f3e3854c.js');
|
|
11
11
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const createId = require('./create-id-c3b984b1.js');
|
|
10
10
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const createId = require('./create-id-c3b984b1.js');
|
|
10
10
|
const languageUtils = require('./language-utils-aa282901.js');
|
|
11
11
|
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-58eb8f67.js');
|
|
9
9
|
const tokens_module = require('./tokens.module-6b2df1c2.js');
|
|
10
10
|
const createId = require('./create-id-c3b984b1.js');
|
|
11
11
|
const languageUtils = require('./language-utils-aa282901.js');
|