@duetds/components 4.35.3 → 4.36.1
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 +517 -15
- 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 +8 -3
- package/lib/cjs/duet-caption_4.cjs.entry.js +2 -2
- package/lib/cjs/duet-card.cjs.entry.js +3 -3
- 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 +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +3 -3
- 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-5cc92935.js → focus-utils-dfd718e8.js} +1 -1
- package/lib/cjs/{index-f863de47.js → index-4f342f1c.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/cjs/{token-utils-05bd23b4.js → token-utils-f402e205.js} +9 -6
- 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-collapsible/duet-collapsible.js +2 -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/components/duet-tab-group/duet-tab-group.js +5 -1
- 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/collection/utils/token-utils.js +33 -6
- package/lib/custom-elements-bundle/index.d.ts +12 -0
- package/lib/custom-elements-bundle/index.js +482 -16
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-4dee11c0.system.entry.js → p-0366552b.system.entry.js} +1 -1
- package/lib/duet/{p-c999b0a0.entry.js → p-03cf3ebf.entry.js} +1 -1
- package/lib/duet/{p-89b641c1.system.entry.js → p-05e2c680.system.entry.js} +1 -1
- package/lib/duet/{p-20770074.system.entry.js → p-061835f3.system.entry.js} +1 -1
- package/lib/duet/p-063fe96d.entry.js +4 -0
- package/lib/duet/{p-04db8923.system.entry.js → p-12941aef.system.entry.js} +2 -2
- package/lib/duet/{p-112ae31f.system.entry.js → p-164a7037.system.entry.js} +1 -1
- package/lib/duet/{p-5a5c0f82.entry.js → p-1a95aeb6.entry.js} +1 -1
- package/lib/duet/{p-719aa1cf.entry.js → p-1c4721a1.entry.js} +1 -1
- package/lib/duet/{p-999bd008.entry.js → p-1db7a35b.entry.js} +1 -1
- package/lib/duet/{p-a31b1d0c.entry.js → p-20cdb787.entry.js} +1 -1
- package/lib/duet/{p-e228c0a0.system.entry.js → p-210d739c.system.entry.js} +1 -1
- package/lib/duet/{p-4429cdb2.system.entry.js → p-211b4485.system.entry.js} +1 -1
- package/lib/duet/{p-e80b0c03.system.entry.js → p-22baf1f8.system.entry.js} +1 -1
- package/lib/duet/{p-3ae153aa.entry.js → p-2361986e.entry.js} +1 -1
- package/lib/duet/{p-4ca7a496.entry.js → p-24b9e806.entry.js} +1 -1
- package/lib/duet/{p-fc1e77a4.system.entry.js → p-286d2ad2.system.entry.js} +1 -1
- package/lib/duet/{p-f0732de0.entry.js → p-29255af8.entry.js} +1 -1
- package/lib/duet/p-2eeacf1a.entry.js +4 -0
- package/lib/duet/p-3547d108.entry.js +4 -0
- package/lib/duet/{p-264d0b24.system.entry.js → p-3900577d.system.entry.js} +1 -1
- package/lib/duet/p-396f1bdc.entry.js +4 -0
- package/lib/duet/{p-9bc2e0b8.system.entry.js → p-3bb702e3.system.entry.js} +2 -2
- package/lib/duet/{p-706eeb09.entry.js → p-3c3536be.entry.js} +1 -1
- package/lib/duet/{p-c5eddafe.entry.js → p-3d1b0105.entry.js} +1 -1
- package/lib/duet/{p-7582675a.entry.js → p-46ae601a.entry.js} +1 -1
- package/lib/duet/{p-b4869f24.system.entry.js → p-493c6d2f.system.entry.js} +1 -1
- package/lib/duet/p-4e2532c7.system.js +4 -0
- package/lib/duet/{p-756b56a6.system.entry.js → p-4fdbc6ff.system.entry.js} +1 -1
- package/lib/duet/{p-4da5cb97.entry.js → p-5376a9db.entry.js} +1 -1
- package/lib/duet/{p-9170b4c4.entry.js → p-562ae946.entry.js} +1 -1
- package/lib/duet/{p-d7daa7ef.entry.js → p-5b546064.entry.js} +1 -1
- package/lib/duet/{p-a4503985.entry.js → p-5d9affcd.entry.js} +1 -1
- package/lib/duet/{p-a0b7cb61.system.entry.js → p-615bfc61.system.entry.js} +1 -1
- package/lib/duet/{p-ef895424.system.entry.js → p-635dacce.system.entry.js} +1 -1
- package/lib/duet/{p-07e793a6.system.entry.js → p-65c418f7.system.entry.js} +2 -2
- package/lib/duet/{p-1d3f88a6.entry.js → p-740b5609.entry.js} +1 -1
- package/lib/duet/p-74780bca.system.js +4 -0
- package/lib/duet/{p-c8c7bc80.system.entry.js → p-79b9e7ef.system.entry.js} +1 -1
- package/lib/duet/{p-90f4de78.system.entry.js → p-7a32ceb3.system.entry.js} +1 -1
- package/lib/duet/{p-a04f385f.entry.js → p-7b55f33e.entry.js} +1 -1
- package/lib/duet/p-7e0e2209.system.entry.js +4 -0
- package/lib/duet/{p-d7c1efc6.entry.js → p-7f0e360d.entry.js} +1 -1
- package/lib/duet/p-81867417.system.js +4 -0
- package/lib/duet/p-83452e8f.entry.js +4 -0
- package/lib/duet/{p-02ab802f.entry.js → p-85100e09.entry.js} +1 -1
- package/lib/duet/p-898f30a5.js +4 -0
- package/lib/duet/p-89e42127.system.entry.js +4 -0
- package/lib/duet/{p-02eab9d4.system.entry.js → p-8c53bc24.system.entry.js} +1 -1
- package/lib/duet/{p-7f9cbd19.system.entry.js → p-946f34b4.system.entry.js} +1 -1
- package/lib/duet/{p-c43d44b5.entry.js → p-9ce0e625.entry.js} +1 -1
- package/lib/duet/{p-ec90489b.system.entry.js → p-9df321b3.system.entry.js} +1 -1
- package/lib/duet/{p-09f9d630.system.entry.js → p-a3d7951c.system.entry.js} +1 -1
- package/lib/duet/p-a619dff3.system.js +4 -0
- package/lib/duet/{p-b17db623.system.js → p-ad3dad04.system.js} +1 -1
- package/lib/duet/{p-31f570f2.entry.js → p-ae14591e.entry.js} +1 -1
- package/lib/duet/p-b25d3769.js +4 -0
- package/lib/duet/{p-b15511a2.entry.js → p-b6dd0933.entry.js} +1 -1
- package/lib/duet/{p-3c29aa52.entry.js → p-bf192d9f.entry.js} +1 -1
- package/lib/duet/{p-a644a5f9.entry.js → p-c18080ad.entry.js} +1 -1
- package/lib/duet/{p-8a682c91.entry.js → p-c2d32103.entry.js} +1 -1
- package/lib/duet/p-c514010b.system.entry.js +4 -0
- package/lib/duet/{p-b095e76c.system.entry.js → p-c52f4de0.system.entry.js} +1 -1
- package/lib/duet/{p-32385f42.system.entry.js → p-c6df2ea8.system.entry.js} +1 -1
- package/lib/duet/{p-9fc5f201.system.entry.js → p-c76a68aa.system.entry.js} +1 -1
- package/lib/duet/{p-6486519a.system.entry.js → p-c7fa7dcc.system.entry.js} +1 -1
- package/lib/duet/{p-3f1bfd32.entry.js → p-c8ec3b99.entry.js} +1 -1
- package/lib/duet/{p-5451cadc.system.entry.js → p-ca0ee655.system.entry.js} +1 -1
- package/lib/duet/p-cb445018.js +4 -0
- package/lib/duet/p-d12b3d21.system.entry.js +4 -0
- package/lib/duet/{p-4d7840ac.system.js → p-d21f19cc.system.js} +1 -1
- package/lib/duet/{p-da11a633.entry.js → p-d24c6bc1.entry.js} +1 -1
- package/lib/duet/{p-587a09a9.system.entry.js → p-d945a4b0.system.entry.js} +1 -1
- package/lib/duet/{p-eda12bb9.system.entry.js → p-d9716aec.system.entry.js} +1 -1
- package/lib/duet/p-dcaecb5e.js +4 -0
- package/lib/duet/{p-5c785f54.system.entry.js → p-ded33218.system.entry.js} +1 -1
- package/lib/duet/{p-1a3ae51a.entry.js → p-e35d8543.entry.js} +1 -1
- package/lib/duet/{p-bb79460f.system.entry.js → p-e47daca7.system.entry.js} +1 -1
- package/lib/duet/{p-d054d313.system.entry.js → p-e5ce7aad.system.entry.js} +1 -1
- package/lib/duet/p-e6a69eb8.js +4 -0
- package/lib/duet/{p-5af7b3cb.system.entry.js → p-e7b53f4f.system.entry.js} +1 -1
- package/lib/duet/{p-3629c104.system.entry.js → p-e7dd8a15.system.entry.js} +1 -1
- package/lib/duet/{p-54c57aed.system.entry.js → p-e8303364.system.entry.js} +1 -1
- package/lib/duet/{p-856e0c17.entry.js → p-e8e35258.entry.js} +1 -1
- package/lib/duet/{p-fcb1e479.system.entry.js → p-eb892975.system.entry.js} +1 -1
- package/lib/duet/{p-6ef7cbec.entry.js → p-ebc56043.entry.js} +1 -1
- package/lib/duet/{p-618cb809.entry.js → p-ef275410.entry.js} +1 -1
- package/lib/duet/p-ef4962e8.entry.js +4 -0
- package/lib/duet/{p-46e93e09.entry.js → p-f6da56c8.entry.js} +1 -1
- package/lib/duet/{p-01450526.entry.js → p-fae71c1f.entry.js} +1 -1
- package/lib/duet/{p-c0c14e42.entry.js → p-fd2211ab.entry.js} +1 -1
- package/lib/duet/{p-ff759fb3.entry.js → p-ff21f3c2.entry.js} +1 -1
- package/lib/duet/{p-b60ec55f.system.entry.js → p-ffb5fb75.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 +8 -3
- package/lib/esm/duet-caption_4.entry.js +2 -2
- package/lib/esm/duet-card.entry.js +3 -3
- 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 +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +3 -3
- 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-386eaef9.js → focus-utils-d4e80e1e.js} +1 -1
- package/lib/esm/{index-a22a5200.js → index-4a5e7664.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/{token-utils-75f78ca4.js → token-utils-e9a69acf.js} +9 -6
- 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 +2 -2
- 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-d4e80e1e.js +4 -0
- package/lib/esm-es5/{index-a22a5200.js → index-4a5e7664.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/esm-es5/token-utils-e9a69acf.js +4 -0
- package/lib/html.html-data.json +5166 -0
- 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-collapsible/duet-collapsible.d.ts +1 -0
- 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/duet-tab-group/duet-tab-group.d.ts +4 -0
- package/lib/types/components.d.ts +188 -2
- package/lib/types/utils/keyboard-utils.d.ts +4 -0
- package/lib/types/utils/token-utils.d.ts +2 -0
- package/package.json +5 -5
- package/lib/duet/p-04f9f1bf.js +0 -4
- package/lib/duet/p-2a8c607e.entry.js +0 -4
- package/lib/duet/p-3c2ab6eb.js +0 -4
- package/lib/duet/p-4ce0bc2c.entry.js +0 -4
- package/lib/duet/p-50b4fb2c.js +0 -4
- package/lib/duet/p-52d7ffa5.entry.js +0 -4
- package/lib/duet/p-5846949a.system.entry.js +0 -4
- package/lib/duet/p-5c73e005.entry.js +0 -4
- package/lib/duet/p-7464e383.system.entry.js +0 -4
- package/lib/duet/p-89cc645f.entry.js +0 -4
- package/lib/duet/p-9fa468bc.system.entry.js +0 -4
- package/lib/duet/p-a16a58c1.system.js +0 -4
- package/lib/duet/p-ad3a1685.system.js +0 -4
- package/lib/duet/p-bb12b972.system.js +0 -4
- package/lib/duet/p-c1731f1a.js +0 -4
- package/lib/esm-es5/focus-utils-386eaef9.js +0 -4
- package/lib/esm-es5/keyboard-utils-584cedd7.js +0 -4
- package/lib/esm-es5/token-utils-75f78ca4.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-4a5e7664.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-4a5e7664.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-4a5e7664.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-4a5e7664.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-4a5e7664.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}";
|
|
@@ -282,7 +282,7 @@ let DuetTabGroup = class {
|
|
|
282
282
|
};
|
|
283
283
|
this.renderTab = () => {
|
|
284
284
|
const renderedTabs = this.tabs.map((element, index) => {
|
|
285
|
-
return (h("button", { role: "tab", id: this.getButtonId(index), "aria-controls": this.getTabId(index), "aria-selected": element.selected ? "true" : "false", "aria-description": this.getAccessibleDescription(index), part: `${this.identifier}-button`, type: "button", class: {
|
|
285
|
+
return (h("button", { role: "tab", id: this.getButtonId(index), "aria-controls": this.getTabId(index), "aria-selected": element.selected ? "true" : "false", "aria-description": this.getAccessibleDescription(index), part: `${this.identifier}-button ${element.selected ? `${this.identifier}-button--selected` : ""}`, type: "button", class: {
|
|
286
286
|
"duet-p-0": this.padding === "none",
|
|
287
287
|
"duet-tab-button": true,
|
|
288
288
|
selected: element.selected,
|
|
@@ -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-4a5e7664.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-4a5e7664.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-4a5e7664.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-4a5e7664.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-4a5e7664.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-4a5e7664.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';
|