@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,100 @@
|
|
|
1
|
+
*,
|
|
2
|
+
*::after,
|
|
3
|
+
*::before {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
padding: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
background: transparent;
|
|
8
|
+
border: 0;
|
|
9
|
+
-moz-appearance: none;
|
|
10
|
+
-webkit-appearance: none;
|
|
11
|
+
appearance: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
padding: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
background: transparent;
|
|
19
|
+
border: 0;
|
|
20
|
+
-moz-appearance: none;
|
|
21
|
+
-webkit-appearance: none;
|
|
22
|
+
appearance: none;
|
|
23
|
+
display: inline-block;
|
|
24
|
+
margin: 0 auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.duet-range-stepper {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
gap: 0;
|
|
31
|
+
align-items: baseline;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
min-width: 30px;
|
|
34
|
+
min-height: 30px;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
border-left-width: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.duet-range-stepper {
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
}
|
|
43
|
+
.duet-range-stepper button {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
width: 32px;
|
|
48
|
+
height: 32px;
|
|
49
|
+
min-height: auto !important;
|
|
50
|
+
padding: 0 !important;
|
|
51
|
+
margin: 0 0 0 8px !important;
|
|
52
|
+
color: #00294d;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
background: #f5f8fa;
|
|
55
|
+
border-radius: 50%;
|
|
56
|
+
transition: background-color 300ms ease !important;
|
|
57
|
+
}
|
|
58
|
+
.duet-theme-turva .duet-range-stepper button {
|
|
59
|
+
color: #171c3a;
|
|
60
|
+
background: #f5f5f7;
|
|
61
|
+
}
|
|
62
|
+
.duet-range-stepper button duet-icon {
|
|
63
|
+
display: block;
|
|
64
|
+
}
|
|
65
|
+
@media (max-width: 35.9375em) {
|
|
66
|
+
.duet-range-stepper button {
|
|
67
|
+
width: 40px;
|
|
68
|
+
height: 40px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
.duet-range-stepper button:not(:disabled):hover {
|
|
72
|
+
background: #e9ecee !important;
|
|
73
|
+
}
|
|
74
|
+
.duet-theme-turva .duet-range-stepper button:not(:disabled):hover {
|
|
75
|
+
background: #e9e9eb !important;
|
|
76
|
+
}
|
|
77
|
+
.duet-range-stepper button:focus {
|
|
78
|
+
outline: 0;
|
|
79
|
+
box-shadow: 0 0 0 2px #0077b3;
|
|
80
|
+
}
|
|
81
|
+
.duet-theme-turva .duet-range-stepper button:focus {
|
|
82
|
+
box-shadow: 0 0 0 2px #171c3a;
|
|
83
|
+
}
|
|
84
|
+
.duet-range-stepper button:active:focus {
|
|
85
|
+
background: #dddfe1;
|
|
86
|
+
box-shadow: none;
|
|
87
|
+
}
|
|
88
|
+
.duet-theme-turva .duet-range-stepper button:active:focus {
|
|
89
|
+
background: #ddddde;
|
|
90
|
+
}
|
|
91
|
+
.duet-range-stepper button:disabled {
|
|
92
|
+
color: #909599;
|
|
93
|
+
cursor: default;
|
|
94
|
+
background: #f5f8fa;
|
|
95
|
+
opacity: 0.75;
|
|
96
|
+
}
|
|
97
|
+
.duet-theme-turva .duet-range-stepper button:disabled {
|
|
98
|
+
color: #747475;
|
|
99
|
+
background: #f5f5f7;
|
|
100
|
+
}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { Component, Element, Event, h, Prop, Watch } from "@stencil/core";
|
|
5
|
+
import { createID } from "../../utils/create-id";
|
|
6
|
+
import { isArrowDownKey, isArrowKey, isArrowLeftKey, isArrowRightKey, isArrowUpKey, isMinusKey, isPlusKey, } from "../../utils/keyboard-utils";
|
|
7
|
+
import { getLocaleString } from "../../utils/language-utils";
|
|
8
|
+
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
9
|
+
export class DuetRangeStepper {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.leftBn = createID("duetRangeStepper-left");
|
|
12
|
+
this.rightBn = createID("duetRangeStepper-right");
|
|
13
|
+
/**
|
|
14
|
+
* Theme of the component.
|
|
15
|
+
*/
|
|
16
|
+
this.theme = "";
|
|
17
|
+
/**
|
|
18
|
+
* Start value
|
|
19
|
+
* @default 1
|
|
20
|
+
*/
|
|
21
|
+
this.stepIndex = 1;
|
|
22
|
+
/**
|
|
23
|
+
* How big is the step
|
|
24
|
+
* @default 99
|
|
25
|
+
*/
|
|
26
|
+
this.stepSize = 50;
|
|
27
|
+
/**
|
|
28
|
+
* Total of
|
|
29
|
+
* @default undefined
|
|
30
|
+
*/
|
|
31
|
+
this.total = 1000;
|
|
32
|
+
/**
|
|
33
|
+
* Default range stepper labels
|
|
34
|
+
*/
|
|
35
|
+
this.ariaLabelsDefaults = {
|
|
36
|
+
en: {
|
|
37
|
+
next_increment: "Next range increment",
|
|
38
|
+
previous_increment: "Previous range increment",
|
|
39
|
+
x_of_y: "{0}–{1} of {2}",
|
|
40
|
+
},
|
|
41
|
+
fi: {
|
|
42
|
+
next_increment: "Seuraava välillä",
|
|
43
|
+
previous_increment: "Edellinen välillä",
|
|
44
|
+
x_of_y: "{0}–{1} / {2}",
|
|
45
|
+
},
|
|
46
|
+
sv: {
|
|
47
|
+
next_increment: "Nästa intervall",
|
|
48
|
+
previous_increment: "Föregående intervall",
|
|
49
|
+
x_of_y: "{0}–{1} av {2}",
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Default pagination labels
|
|
54
|
+
*/
|
|
55
|
+
this.ariaLabels = getLocaleString(this.ariaLabelsDefaults);
|
|
56
|
+
/**
|
|
57
|
+
* Used to indicate which dom element with ID this element controls
|
|
58
|
+
*/
|
|
59
|
+
this.ariaControls = "";
|
|
60
|
+
this.handleClick = (e, direction) => {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
this.increment(direction);
|
|
63
|
+
this.handleStepClick(e);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
watchStateHandler(newValue) {
|
|
67
|
+
if (newValue === 1) {
|
|
68
|
+
this.leftBnRef.setAttribute("disabled", "");
|
|
69
|
+
this.rightBnRef.focus();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.leftBnRef.removeAttribute("disabled");
|
|
73
|
+
}
|
|
74
|
+
if (newValue === this.total / this.stepSize) {
|
|
75
|
+
this.rightBnRef.setAttribute("disabled", "");
|
|
76
|
+
this.leftBnRef.focus();
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.rightBnRef.removeAttribute("disabled");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
handleStepClick(e) {
|
|
83
|
+
this.duetRangeStepUpdate.emit({
|
|
84
|
+
originalEvent: e,
|
|
85
|
+
component: "duet-range-stepper",
|
|
86
|
+
from: this.stepIndex * this.stepSize - this.stepSize,
|
|
87
|
+
to: this.stepIndex * this.stepSize,
|
|
88
|
+
index: this.stepIndex,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
componentWillLoad() {
|
|
92
|
+
inheritGlobalTheme(this);
|
|
93
|
+
}
|
|
94
|
+
componentDidLoad() {
|
|
95
|
+
this.watchStateHandler(this.stepIndex);
|
|
96
|
+
}
|
|
97
|
+
increment(direction) {
|
|
98
|
+
const newIndex = this.stepIndex + direction;
|
|
99
|
+
if (newIndex <= 0) {
|
|
100
|
+
this.stepIndex = 1;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
if (newIndex * this.stepSize <= this.total) {
|
|
104
|
+
this.stepIndex = newIndex;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
generateStepSize() {
|
|
111
|
+
// this function uses this.stepIndex and this.range to generate a range of number like 1-100
|
|
112
|
+
// this is used to generate the step size
|
|
113
|
+
let start = (this.stepIndex - 1) * this.stepSize;
|
|
114
|
+
//easy fix for starting position
|
|
115
|
+
if (start === 0) {
|
|
116
|
+
start = 1;
|
|
117
|
+
}
|
|
118
|
+
const end = this.stepIndex * this.stepSize;
|
|
119
|
+
return this.ariaLabels.x_of_y
|
|
120
|
+
.replace("{0}", String(start))
|
|
121
|
+
.replace("{1}", String(end))
|
|
122
|
+
.replace("{2}", String(this.total));
|
|
123
|
+
}
|
|
124
|
+
//handle a11y keyboard navigation events
|
|
125
|
+
async onKeyboardDown(e) {
|
|
126
|
+
// handle a11y based keyboard navigation for left/right/up/down
|
|
127
|
+
let next = this.stepIndex;
|
|
128
|
+
let dir = 1;
|
|
129
|
+
if (isArrowLeftKey(e) || isArrowUpKey(e) || isMinusKey(e)) {
|
|
130
|
+
next--;
|
|
131
|
+
dir = -1;
|
|
132
|
+
this.leftBnRef.focus();
|
|
133
|
+
}
|
|
134
|
+
if (isArrowRightKey(e) || isArrowDownKey(e) || isPlusKey(e)) {
|
|
135
|
+
next++;
|
|
136
|
+
dir = 1;
|
|
137
|
+
}
|
|
138
|
+
if (isArrowKey(e)) {
|
|
139
|
+
if (next > 0 && next * this.stepSize <= this.total) {
|
|
140
|
+
this.handleClick(e, dir);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
//await this.stepperRef.focus()
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* render() function
|
|
149
|
+
* Always the last one in the class.
|
|
150
|
+
*/
|
|
151
|
+
render() {
|
|
152
|
+
return (h("div", { class: {
|
|
153
|
+
"duet-range-stepper": true,
|
|
154
|
+
"duet-theme-turva": this.theme === "turva",
|
|
155
|
+
}, onKeyDown: e => this.onKeyboardDown(e), "aria-controls": this.ariaControls },
|
|
156
|
+
h("span", { class: "duet-range-step-counter", part: "range-numbers" }, this.generateStepSize()),
|
|
157
|
+
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" },
|
|
158
|
+
h("duet-icon", { name: "action-arrow-left-small", color: "currentColor", margin: "none", size: "xx-small" })),
|
|
159
|
+
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" },
|
|
160
|
+
h("duet-icon", { name: "action-arrow-right-small", color: "currentColor", margin: "none", size: "xx-small" }))));
|
|
161
|
+
}
|
|
162
|
+
static get is() { return "duet-range-stepper"; }
|
|
163
|
+
static get encapsulation() { return "shadow"; }
|
|
164
|
+
static get originalStyleUrls() { return {
|
|
165
|
+
"$": ["duet-range-stepper.scss"]
|
|
166
|
+
}; }
|
|
167
|
+
static get styleUrls() { return {
|
|
168
|
+
"$": ["duet-range-stepper.css"]
|
|
169
|
+
}; }
|
|
170
|
+
static get properties() { return {
|
|
171
|
+
"theme": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"mutable": true,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "DuetTheme",
|
|
176
|
+
"resolved": "\"\" | \"default\" | \"turva\"",
|
|
177
|
+
"references": {
|
|
178
|
+
"DuetTheme": {
|
|
179
|
+
"location": "import",
|
|
180
|
+
"path": "../../common-types"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": false,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": "Theme of the component."
|
|
189
|
+
},
|
|
190
|
+
"attribute": "theme",
|
|
191
|
+
"reflect": false,
|
|
192
|
+
"defaultValue": "\"\""
|
|
193
|
+
},
|
|
194
|
+
"stepIndex": {
|
|
195
|
+
"type": "number",
|
|
196
|
+
"mutable": true,
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "number",
|
|
199
|
+
"resolved": "number",
|
|
200
|
+
"references": {}
|
|
201
|
+
},
|
|
202
|
+
"required": false,
|
|
203
|
+
"optional": false,
|
|
204
|
+
"docs": {
|
|
205
|
+
"tags": [{
|
|
206
|
+
"name": "default",
|
|
207
|
+
"text": "1"
|
|
208
|
+
}],
|
|
209
|
+
"text": "Start value"
|
|
210
|
+
},
|
|
211
|
+
"attribute": "step-index",
|
|
212
|
+
"reflect": false,
|
|
213
|
+
"defaultValue": "1"
|
|
214
|
+
},
|
|
215
|
+
"stepSize": {
|
|
216
|
+
"type": "number",
|
|
217
|
+
"mutable": false,
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "number",
|
|
220
|
+
"resolved": "number",
|
|
221
|
+
"references": {}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": false,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [{
|
|
227
|
+
"name": "default",
|
|
228
|
+
"text": "99"
|
|
229
|
+
}],
|
|
230
|
+
"text": "How big is the step"
|
|
231
|
+
},
|
|
232
|
+
"attribute": "step-size",
|
|
233
|
+
"reflect": false,
|
|
234
|
+
"defaultValue": "50"
|
|
235
|
+
},
|
|
236
|
+
"total": {
|
|
237
|
+
"type": "number",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "number",
|
|
241
|
+
"resolved": "number",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [{
|
|
248
|
+
"name": "default",
|
|
249
|
+
"text": "undefined"
|
|
250
|
+
}],
|
|
251
|
+
"text": "Total of"
|
|
252
|
+
},
|
|
253
|
+
"attribute": "total",
|
|
254
|
+
"reflect": false,
|
|
255
|
+
"defaultValue": "1000"
|
|
256
|
+
},
|
|
257
|
+
"ariaLabelsDefaults": {
|
|
258
|
+
"type": "unknown",
|
|
259
|
+
"mutable": false,
|
|
260
|
+
"complexType": {
|
|
261
|
+
"original": "DuetLangObject",
|
|
262
|
+
"resolved": "DuetLangObject",
|
|
263
|
+
"references": {
|
|
264
|
+
"DuetLangObject": {
|
|
265
|
+
"location": "import",
|
|
266
|
+
"path": "../../utils/language-utils"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"required": false,
|
|
271
|
+
"optional": false,
|
|
272
|
+
"docs": {
|
|
273
|
+
"tags": [],
|
|
274
|
+
"text": "Default range stepper labels"
|
|
275
|
+
},
|
|
276
|
+
"defaultValue": "{\n en: {\n next_increment: \"Next range increment\",\n previous_increment: \"Previous range increment\",\n x_of_y: \"{0}\u2013{1} of {2}\",\n },\n fi: {\n next_increment: \"Seuraava v\u00E4lill\u00E4\",\n previous_increment: \"Edellinen v\u00E4lill\u00E4\",\n x_of_y: \"{0}\u2013{1} / {2}\",\n },\n sv: {\n next_increment: \"N\u00E4sta intervall\",\n previous_increment: \"F\u00F6reg\u00E5ende intervall\",\n x_of_y: \"{0}\u2013{1} av {2}\",\n },\n }"
|
|
277
|
+
},
|
|
278
|
+
"ariaLabels": {
|
|
279
|
+
"type": "unknown",
|
|
280
|
+
"mutable": false,
|
|
281
|
+
"complexType": {
|
|
282
|
+
"original": "Record<string, string>",
|
|
283
|
+
"resolved": "{ [x: string]: string; }",
|
|
284
|
+
"references": {
|
|
285
|
+
"Record": {
|
|
286
|
+
"location": "global"
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": "Default pagination labels"
|
|
295
|
+
},
|
|
296
|
+
"defaultValue": "getLocaleString(\n this.ariaLabelsDefaults\n )"
|
|
297
|
+
},
|
|
298
|
+
"ariaControls": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"mutable": false,
|
|
301
|
+
"complexType": {
|
|
302
|
+
"original": "string",
|
|
303
|
+
"resolved": "string",
|
|
304
|
+
"references": {}
|
|
305
|
+
},
|
|
306
|
+
"required": false,
|
|
307
|
+
"optional": false,
|
|
308
|
+
"docs": {
|
|
309
|
+
"tags": [],
|
|
310
|
+
"text": "Used to indicate which dom element with ID this element controls"
|
|
311
|
+
},
|
|
312
|
+
"attribute": "accessible-controls",
|
|
313
|
+
"reflect": false,
|
|
314
|
+
"defaultValue": "\"\""
|
|
315
|
+
}
|
|
316
|
+
}; }
|
|
317
|
+
static get events() { return [{
|
|
318
|
+
"method": "duetRangeStepUpdate",
|
|
319
|
+
"name": "duetRangeStepUpdate",
|
|
320
|
+
"bubbles": true,
|
|
321
|
+
"cancelable": true,
|
|
322
|
+
"composed": true,
|
|
323
|
+
"docs": {
|
|
324
|
+
"tags": [],
|
|
325
|
+
"text": "Event emitted when the step heading is clicked."
|
|
326
|
+
},
|
|
327
|
+
"complexType": {
|
|
328
|
+
"original": "DuetRangeStepperUpdateEvent",
|
|
329
|
+
"resolved": "{ originalEvent: MouseEvent | KeyboardEvent; component: \"duet-range-stepper\"; from: number; to: number; index: number; }",
|
|
330
|
+
"references": {
|
|
331
|
+
"DuetRangeStepperUpdateEvent": {
|
|
332
|
+
"location": "local"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}]; }
|
|
337
|
+
static get elementRef() { return "element"; }
|
|
338
|
+
static get watchers() { return [{
|
|
339
|
+
"propName": "stepIndex",
|
|
340
|
+
"methodName": "watchStateHandler"
|
|
341
|
+
}]; }
|
|
342
|
+
}
|
|
@@ -39,6 +39,13 @@
|
|
|
39
39
|
width: 100% !important;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
:host.duet-select-variation-tiny {
|
|
43
|
+
position: relative;
|
|
44
|
+
top: -2px;
|
|
45
|
+
width: 72px;
|
|
46
|
+
margin: 0 !important;
|
|
47
|
+
vertical-align: baseline;
|
|
48
|
+
}
|
|
42
49
|
|
|
43
50
|
:host(.duet-m-0) {
|
|
44
51
|
margin: 0 !important;
|
|
@@ -76,6 +83,9 @@ duet-tooltip {
|
|
|
76
83
|
position: relative;
|
|
77
84
|
width: 100%;
|
|
78
85
|
}
|
|
86
|
+
.duet-select-container.duet-select-variation-tiny {
|
|
87
|
+
width: 72px;
|
|
88
|
+
}
|
|
79
89
|
|
|
80
90
|
.duet-select-wrapper {
|
|
81
91
|
position: relative;
|
|
@@ -89,6 +99,10 @@ duet-tooltip {
|
|
|
89
99
|
.duet-theme-turva .duet-select-wrapper {
|
|
90
100
|
font-family: "turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
91
101
|
}
|
|
102
|
+
.duet-select-variation-tiny .duet-select-wrapper {
|
|
103
|
+
width: 81px;
|
|
104
|
+
padding: 0 !important;
|
|
105
|
+
}
|
|
92
106
|
.duet-select-wrapper::after {
|
|
93
107
|
content: " ";
|
|
94
108
|
}
|
|
@@ -226,6 +240,18 @@ duet-tooltip {
|
|
|
226
240
|
.duet-theme-turva .duet-select svg {
|
|
227
241
|
color: #171c3a;
|
|
228
242
|
}
|
|
243
|
+
.duet-select-variation-tiny .duet-select {
|
|
244
|
+
width: 72px;
|
|
245
|
+
min-width: inherit;
|
|
246
|
+
padding: 0 !important;
|
|
247
|
+
margin-bottom: -4px;
|
|
248
|
+
overflow: visible;
|
|
249
|
+
font-weight: 600;
|
|
250
|
+
text-align: center;
|
|
251
|
+
}
|
|
252
|
+
.duet-select-variation-tiny .duet-select duet-icon {
|
|
253
|
+
padding-left: 10px;
|
|
254
|
+
}
|
|
229
255
|
|
|
230
256
|
.duet-select-help {
|
|
231
257
|
display: block;
|
|
@@ -34,6 +34,10 @@ export class DuetSelect {
|
|
|
34
34
|
* Inlined decorator, alphabetical order.
|
|
35
35
|
*/
|
|
36
36
|
this.processedItems = null;
|
|
37
|
+
/**
|
|
38
|
+
* Variation of dropdown. -tiny is used for small numbers / tiny option ranges.
|
|
39
|
+
*/
|
|
40
|
+
this.variation = "default";
|
|
37
41
|
/**
|
|
38
42
|
* Controls the margin of the component.
|
|
39
43
|
*/
|
|
@@ -165,11 +169,16 @@ export class DuetSelect {
|
|
|
165
169
|
*/
|
|
166
170
|
render() {
|
|
167
171
|
const identifier = this.identifier || this.selectId;
|
|
168
|
-
return (h(Host, { onClick: this.onClick, class: {
|
|
172
|
+
return (h(Host, { onClick: this.onClick, class: {
|
|
173
|
+
"duet-m-0": this.margin === "none",
|
|
174
|
+
"duet-expand": this.expand,
|
|
175
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
176
|
+
} },
|
|
169
177
|
h("div", { class: {
|
|
170
178
|
"duet-select-container": true,
|
|
171
179
|
"duet-label-hidden": this.labelHidden,
|
|
172
180
|
"duet-theme-turva": this.theme === "turva",
|
|
181
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
173
182
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
174
183
|
"has-error": !!this.error,
|
|
175
184
|
} },
|
|
@@ -183,10 +192,14 @@ export class DuetSelect {
|
|
|
183
192
|
!this.processedItems ? (h("option", null, "Virhe valintoja ladattaessa. P\u00E4ivit\u00E4 sivu ja kokeile uusiksi.")) : (this.processedItems.map(item => {
|
|
184
193
|
return isOptionGroup(item) ? this.renderOptionGroup(item) : this.renderOption(item);
|
|
185
194
|
}))),
|
|
186
|
-
h("div", { class:
|
|
195
|
+
h("div", { class: {
|
|
196
|
+
"duet-select": true,
|
|
197
|
+
"duet-select-variation-tiny": this.variation === "tiny",
|
|
198
|
+
}, "aria-hidden": "true" },
|
|
187
199
|
h("span", { key: this.value }, this.getSelectedItemLabel()),
|
|
188
|
-
h("svg", { role: "img", class: "duet-select-icon", fill: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
189
|
-
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" })))
|
|
200
|
+
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" },
|
|
201
|
+
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" }))),
|
|
202
|
+
this.variation === "tiny" && (h("duet-icon", { name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xx-small" })))),
|
|
190
203
|
h("span", { class: "duet-select-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h("span", null, this.error)))));
|
|
191
204
|
}
|
|
192
205
|
static get is() { return "duet-select"; }
|
|
@@ -198,6 +211,28 @@ export class DuetSelect {
|
|
|
198
211
|
"$": ["duet-select.css"]
|
|
199
212
|
}; }
|
|
200
213
|
static get properties() { return {
|
|
214
|
+
"variation": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"mutable": false,
|
|
217
|
+
"complexType": {
|
|
218
|
+
"original": "DuetSelectVariation",
|
|
219
|
+
"resolved": "\"default\" | \"tiny\"",
|
|
220
|
+
"references": {
|
|
221
|
+
"DuetSelectVariation": {
|
|
222
|
+
"location": "local"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"required": false,
|
|
227
|
+
"optional": false,
|
|
228
|
+
"docs": {
|
|
229
|
+
"tags": [],
|
|
230
|
+
"text": "Variation of dropdown. -tiny is used for small numbers / tiny option ranges."
|
|
231
|
+
},
|
|
232
|
+
"attribute": "variation",
|
|
233
|
+
"reflect": false,
|
|
234
|
+
"defaultValue": "\"default\""
|
|
235
|
+
},
|
|
201
236
|
"accessibleActiveDescendant": {
|
|
202
237
|
"type": "string",
|
|
203
238
|
"mutable": false,
|
|
@@ -6,6 +6,10 @@ import { createID } from "../../utils/create-id";
|
|
|
6
6
|
import { isArrowDownKey, isArrowLeftKey, isArrowRightKey, isArrowUpKey } from "../../utils/keyboard-utils";
|
|
7
7
|
import { getLanguage, getLocaleString } from "../../utils/language-utils";
|
|
8
8
|
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
9
|
+
/**
|
|
10
|
+
* @part ${identifier}-button - piercing selector for styling tab buttons
|
|
11
|
+
* @part ${identifier}-button--selected - piercing selector for styling selected tab button
|
|
12
|
+
*/
|
|
9
13
|
export class DuetTabGroup {
|
|
10
14
|
constructor() {
|
|
11
15
|
this.id = createID("DuetTabGroup");
|
|
@@ -88,7 +92,7 @@ export class DuetTabGroup {
|
|
|
88
92
|
};
|
|
89
93
|
this.renderTab = () => {
|
|
90
94
|
const renderedTabs = this.tabs.map((element, index) => {
|
|
91
|
-
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: {
|
|
95
|
+
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: {
|
|
92
96
|
"duet-p-0": this.padding === "none",
|
|
93
97
|
"duet-tab-button": true,
|
|
94
98
|
selected: element.selected,
|
|
@@ -99,14 +99,10 @@ export const fixtureTests = (componentFixtures, minHeight) => {
|
|
|
99
99
|
const html = componentFixtures.fixtures[fixtureName];
|
|
100
100
|
it(`${fixtureName} renders correctly with Turva theme`, async () => {
|
|
101
101
|
const page = await createPage(htmlFragment(html, "turva", minHeight));
|
|
102
|
-
// Configure the navigation timeout
|
|
103
|
-
await page.setDefaultNavigationTimeout(0);
|
|
104
102
|
expect(await page.screenshot()).toMatchImageSnapshot();
|
|
105
103
|
});
|
|
106
104
|
it(`${fixtureName} renders correctly with Lahitapiola theme`, async () => {
|
|
107
105
|
const page = await createPage(htmlFragment(html, "default", minHeight));
|
|
108
|
-
// Configure the navigation timeout
|
|
109
|
-
await page.setDefaultNavigationTimeout(0);
|
|
110
106
|
expect(await page.screenshot()).toMatchImageSnapshot();
|
|
111
107
|
});
|
|
112
108
|
});
|
|
@@ -5,10 +5,14 @@ export const isArrowLeftKey = (e) => e.keyCode === 37;
|
|
|
5
5
|
export const isArrowUpKey = (e) => e.keyCode === 38;
|
|
6
6
|
export const isArrowRightKey = (e) => e.keyCode === 39;
|
|
7
7
|
export const isArrowDownKey = (e) => e.keyCode === 40;
|
|
8
|
+
export const isArrowKey = (e) => isArrowDownKey(e) || isArrowRightKey(e) || isArrowUpKey(e) || isArrowLeftKey(e);
|
|
8
9
|
export const isEscapeKey = (e) => e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
|
|
9
10
|
export const isTabKey = (e) => e.key === "Tab" || e.keyCode === 9;
|
|
10
11
|
export const isBackspaceKey = (e) => e.keyCode === 8;
|
|
11
12
|
export const isSpaceKey = (e) => e.key === "Space" || e.keyCode === 32;
|
|
13
|
+
export const isPlusKey = (e) => e.key === "+" || e.keyCode === 43;
|
|
14
|
+
export const isMinusKey = (e) => e.key === "-" || e.keyCode === 45;
|
|
12
15
|
export const isQuestionKey = (e) => e.key === "?";
|
|
13
16
|
export const isEnterKey = (e) => e.key === "Enter" || e.keyCode === 13;
|
|
14
17
|
export const isKeyboardClick = (e) => isEnterKey(e) || isSpaceKey(e);
|
|
18
|
+
export const isNumber = (e) => (e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105);
|
|
@@ -7,7 +7,8 @@ export async function createPage(optionsOrHtml) {
|
|
|
7
7
|
const page = (await newE2EPage());
|
|
8
8
|
const viewport = Object.assign({ height: page.viewport().height }, { width: options.viewportWidth });
|
|
9
9
|
await page.setViewport(viewport);
|
|
10
|
-
await page.
|
|
10
|
+
await page.setDefaultNavigationTimeout(0);
|
|
11
|
+
await page.setContent(options.html, { waitUntil: "networkidle2" });
|
|
11
12
|
await page.waitForTimeout(250);
|
|
12
13
|
await page.evaluateHandle(() => document.fonts.ready);
|
|
13
14
|
// monkey patch screenshot function to add some extra features
|
|
@@ -35,12 +35,15 @@ export function getTheme(theme = "") {
|
|
|
35
35
|
}
|
|
36
36
|
return "";
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function capitalizeFirstLetter(string) {
|
|
39
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
function hasType(t, str = "") {
|
|
42
|
+
return str.indexOf(capitalizeFirstLetter(t)) === 0 || str.indexOf(t) === 0;
|
|
43
|
+
}
|
|
44
|
+
function addPrefix(prefix, str = "") {
|
|
45
|
+
if (str && !isDashCase(str) && !hasType(prefix, str)) {
|
|
46
|
+
return `${prefix}${capitalize(str)}`;
|
|
44
47
|
}
|
|
45
48
|
return str;
|
|
46
49
|
}
|
|
@@ -70,9 +73,33 @@ export function convertToColorName(name = "", theme = "") {
|
|
|
70
73
|
if (dash) {
|
|
71
74
|
colorResolution = camelize(colorResolution);
|
|
72
75
|
}
|
|
73
|
-
colorResolution =
|
|
76
|
+
colorResolution = addPrefix("color", colorResolution);
|
|
74
77
|
colorResolution = addTheme(colorResolution, theme);
|
|
75
78
|
// takes care of the case where colorPrimaryDark ends up with ColorPrimaryDark
|
|
76
79
|
colorResolution = lowerCaseFirst(colorResolution);
|
|
77
80
|
return colorResolution;
|
|
78
81
|
}
|
|
82
|
+
function getTokenByName(prefix, name) {
|
|
83
|
+
if (!name) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
let tokenResolution = name;
|
|
87
|
+
const dash = isDashCase(name);
|
|
88
|
+
if (dash) {
|
|
89
|
+
tokenResolution = camelize(tokenResolution);
|
|
90
|
+
}
|
|
91
|
+
tokenResolution = addPrefix(prefix, tokenResolution);
|
|
92
|
+
tokenResolution = lowerCaseFirst(tokenResolution);
|
|
93
|
+
try {
|
|
94
|
+
return tokens[tokenResolution];
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export function getFontSizeByName(name) {
|
|
101
|
+
return getTokenByName("fontSize", name);
|
|
102
|
+
}
|
|
103
|
+
export function getFontWeightByName(name) {
|
|
104
|
+
return getTokenByName("fontWeight", name);
|
|
105
|
+
}
|