@duetds/components 4.30.0 → 4.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hydrate/index.js +1481 -434
- package/lib/cjs/{dom-e89ebf90.js → dom-c850c8d7.js} +1 -1
- package/lib/cjs/duet-alert.cjs.entry.js +4 -2
- package/lib/cjs/duet-badge.cjs.entry.js +2 -2
- package/lib/cjs/duet-button_2.cjs.entry.js +6 -5
- package/lib/cjs/duet-caption_4.cjs.entry.js +21 -15
- package/lib/cjs/duet-card.cjs.entry.js +6 -6
- package/lib/cjs/duet-checkbox.cjs.entry.js +2 -2
- package/lib/cjs/duet-choice_2.cjs.entry.js +56 -25
- package/lib/cjs/duet-collapsible.cjs.entry.js +5 -2
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +23 -13
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table-button_3.cjs.entry.js +232 -0
- package/lib/cjs/{duet-table.cjs.entry.js → duet-editable-table_3.cjs.entry.js} +206 -2
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +4 -4
- package/lib/cjs/duet-grid_2.cjs.entry.js +52 -4
- package/lib/cjs/duet-header_2.cjs.entry.js +26 -10
- package/lib/cjs/duet-hero.cjs.entry.js +6 -6
- package/lib/cjs/duet-icon.cjs.entry.js +6 -14
- package/lib/cjs/duet-input_2.cjs.entry.js +7 -7
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-modal.cjs.entry.js +8 -7
- package/lib/cjs/duet-notification_2.cjs.entry.js +6 -5
- package/lib/cjs/duet-number-input.cjs.entry.js +36 -15
- package/lib/cjs/duet-progress.cjs.entry.js +75 -0
- package/lib/cjs/duet-radio_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-range-slider.cjs.entry.js +2 -2
- package/lib/cjs/duet-select.cjs.entry.js +6 -6
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-tab_2.cjs.entry.js +12 -6
- package/lib/cjs/duet-textarea.cjs.entry.js +5 -5
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +21 -10
- package/lib/cjs/duet-tray.cjs.entry.js +21 -10
- package/lib/cjs/duet-upload.cjs.entry.js +403 -180
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +4 -4
- package/lib/cjs/{focus-utils-7605778f.js → focus-utils-a7a1fb8b.js} +1 -1
- package/lib/cjs/{index-0c949193.js → index-b724d698.js} +88 -77
- package/lib/cjs/js-utils-33a9dbe3.js +16 -0
- package/lib/cjs/{language-utils-70d6a9a4.js → language-utils-aa282901.js} +28 -9
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/{shadow-css-0c8c175b.js → shadow-css-e3edeed1.js} +9 -10
- package/lib/cjs/{string-utils-a6de43d8.js → string-utils-267e3dbb.js} +7 -0
- package/lib/cjs/{token-utils-13e5d13e.js → token-utils-63a9c8dc.js} +1 -1
- package/lib/cjs/{tokens.module-53b3bd92.js → tokens.module-6b2df1c2.js} +2 -0
- package/lib/cjs/{watch-options-3877c082.js → watch-options-d88afac0.js} +29 -6
- package/lib/collection/collection-manifest.json +15 -8
- package/lib/collection/components/duet-alert/duet-alert.js +12 -6
- package/lib/collection/components/duet-badge/duet-badge.css +1 -0
- package/lib/collection/components/duet-button/duet-button.js +17 -15
- package/lib/collection/components/duet-card/duet-card.css +30 -7
- package/lib/collection/components/duet-card/duet-card.js +4 -3
- package/lib/collection/components/duet-checkbox/duet-checkbox.css +1 -1
- package/lib/collection/components/duet-choice/duet-choice.css +16 -3
- package/lib/collection/components/duet-choice/duet-choice.js +123 -36
- package/lib/collection/components/duet-choice-group/duet-choice-group.css +1 -0
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +4 -4
- package/lib/collection/components/duet-date-picker/duet-date-picker.css +1 -1
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +78 -43
- package/lib/collection/components/duet-editable-table/duet-editable-table-button.css +32 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +218 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-item.css +36 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +203 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +13 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table.css +16 -0
- package/lib/collection/components/duet-editable-table/duet-editable-table.js +348 -0
- package/lib/collection/components/duet-footer/duet-footer.js +17 -15
- package/lib/collection/components/duet-grid/duet-grid.js +57 -6
- package/lib/collection/components/duet-grid-item/duet-grid-item.js +4 -4
- package/lib/collection/components/duet-header/duet-header.js +60 -35
- package/lib/collection/components/duet-heading/duet-heading.css +4 -0
- package/lib/collection/components/duet-heading/duet-heading.js +7 -6
- package/lib/collection/components/duet-hero/duet-hero.js +20 -15
- package/lib/collection/components/duet-icon/duet-icon.js +2 -6
- package/lib/collection/components/duet-icon/icon-utils.js +5 -8
- package/lib/collection/components/duet-input/duet-input.css +15 -0
- package/lib/collection/components/duet-input/duet-input.js +4 -4
- package/lib/collection/components/duet-label/duet-label.css +2 -0
- package/lib/collection/components/duet-link/duet-link.js +18 -19
- package/lib/collection/components/duet-logo/duet-logo.js +4 -4
- package/lib/collection/components/duet-modal/duet-modal.js +22 -17
- package/lib/collection/components/duet-notification/duet-notification.js +8 -8
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +20 -15
- package/lib/collection/components/duet-number-input/duet-number-input.js +153 -29
- package/lib/collection/components/duet-paragraph/duet-paragraph.css +6 -0
- package/lib/collection/components/duet-paragraph/duet-paragraph.js +34 -3
- package/lib/collection/components/duet-progress/duet-progress.css +103 -0
- package/lib/collection/components/duet-progress/duet-progress.js +240 -0
- package/lib/collection/components/duet-radio/duet-radio.js +6 -6
- package/lib/collection/components/duet-select/duet-select.css +15 -0
- package/lib/collection/components/duet-select/duet-select.js +3 -3
- package/lib/collection/components/duet-step/duet-step.js +8 -8
- package/lib/collection/components/duet-tab-group/duet-tab-group.css +2 -2
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +43 -12
- package/lib/collection/components/duet-textarea/duet-textarea.css +19 -0
- package/lib/collection/components/duet-textarea/duet-textarea.js +5 -4
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +82 -20
- package/lib/collection/components/duet-tray/duet-tray.js +79 -17
- package/lib/collection/components/duet-upload/duet-upload-aria-status.js +217 -0
- package/lib/collection/components/duet-upload/duet-upload-editable-item-error.js +16 -0
- package/lib/collection/components/duet-upload/duet-upload-editable-item-inprogres.js +8 -0
- package/lib/collection/components/duet-upload/duet-upload-editable-item-success.js +30 -0
- package/lib/collection/components/duet-upload/duet-upload.css +17 -86
- package/lib/collection/components/duet-upload/duet-upload.js +551 -153
- package/lib/collection/components/duet-upload/errorcodes.utils.js +16 -4
- package/lib/collection/components/duet-upload/xhr.helpers.js +2 -6
- package/lib/collection/utils/fixture-utils.js +7 -5
- package/lib/collection/utils/js-utils.js +12 -0
- package/lib/collection/utils/language-utils.js +26 -9
- package/lib/collection/utils/string-utils.js +6 -0
- package/lib/collection/utils/watch-options.js +35 -6
- package/lib/custom-elements-bundle/index.d.ts +30 -0
- package/lib/custom-elements-bundle/index.js +1603 -721
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-4a7911fd.entry.js → p-00735436.entry.js} +1 -1
- package/lib/duet/p-060d79be.entry.js +4 -0
- package/lib/duet/p-0d22396e.system.js +16 -0
- package/lib/duet/p-10deead0.system.js +4 -0
- package/lib/duet/p-1208c84f.entry.js +4 -0
- package/lib/duet/p-12721178.js +4 -0
- package/lib/duet/p-155ef581.system.entry.js +4 -0
- package/lib/duet/p-16c48c5d.entry.js +4 -0
- package/lib/duet/p-1797df7b.system.entry.js +4 -0
- package/lib/duet/p-1a08fc22.system.entry.js +4 -0
- package/lib/duet/{p-d1817efe.system.entry.js → p-237e47b4.system.entry.js} +1 -1
- package/lib/duet/p-2443bdca.system.entry.js +4 -0
- package/lib/duet/p-263bc9cd.system.entry.js +4 -0
- package/lib/duet/p-2764f081.js +4 -0
- package/lib/duet/p-27d80cef.system.entry.js +4 -0
- package/lib/duet/p-28e02c08.entry.js +4 -0
- package/lib/duet/{p-f81d8534.entry.js → p-2bb1460c.entry.js} +1 -1
- package/lib/duet/p-33c58756.entry.js +4 -0
- package/lib/duet/{p-bd9a7d8f.js → p-35a3794e.js} +0 -0
- package/lib/duet/{p-bbc229d8.system.entry.js → p-374fb7e6.system.entry.js} +1 -1
- package/lib/duet/p-387823af.system.entry.js +4 -0
- package/lib/duet/p-3af5d66f.entry.js +4 -0
- package/lib/duet/{p-322d1c38.js → p-3c1971d8.js} +1 -1
- package/lib/duet/{p-7e108b7e.entry.js → p-4607af59.entry.js} +1 -1
- package/lib/duet/p-48d1eb1f.system.entry.js +4 -0
- package/lib/duet/p-4a87e9ab.system.entry.js +4 -0
- package/lib/duet/{p-031c2cd8.system.entry.js → p-4b6ebe40.system.entry.js} +1 -1
- package/lib/duet/p-4e28da18.system.entry.js +4 -0
- package/lib/duet/p-548d484e.js +4 -0
- package/lib/duet/p-5826523b.entry.js +4 -0
- package/lib/duet/{p-ce1374a4.system.entry.js → p-58750bae.system.entry.js} +1 -1
- package/lib/duet/p-597d99c7.entry.js +4 -0
- package/lib/duet/p-5ea0cd19.entry.js +4 -0
- package/lib/duet/p-63d5bf73.system.entry.js +4 -0
- package/lib/duet/p-67d9a9a9.system.entry.js +4 -0
- package/lib/duet/p-6a19b5ec.entry.js +4 -0
- package/lib/duet/p-6cc3be76.system.entry.js +4 -0
- package/lib/duet/p-6e363557.system.js +4 -0
- package/lib/duet/p-6e6e76db.system.entry.js +4 -0
- package/lib/duet/p-70fafc98.system.js +4 -0
- package/lib/duet/p-7368b14e.system.entry.js +4 -0
- package/lib/duet/p-751542a0.system.entry.js +4 -0
- package/lib/duet/p-794659ac.entry.js +4 -0
- package/lib/duet/p-7e8d5bb9.system.entry.js +4 -0
- package/lib/duet/p-7fee0d23.system.entry.js +4 -0
- package/lib/duet/p-81867417.system.js +4 -0
- package/lib/duet/p-86daec1c.entry.js +4 -0
- package/lib/duet/{p-4265de16.system.entry.js → p-8b5ca0e7.system.entry.js} +1 -1
- package/lib/duet/{p-66dde4d2.entry.js → p-8cb7416d.entry.js} +1 -1
- package/lib/duet/p-8f826843.system.entry.js +4 -0
- package/lib/duet/p-94169303.entry.js +4 -0
- package/lib/duet/{p-36007600.entry.js → p-9481e312.entry.js} +1 -1
- package/lib/duet/{p-f82709ba.entry.js → p-984576c9.entry.js} +1 -1
- package/lib/duet/p-986779fb.js +4 -0
- package/lib/duet/p-987edcd0.js +15 -0
- package/lib/duet/{p-35e45c19.system.js → p-9a945278.system.js} +1 -1
- package/lib/duet/p-9d73343a.entry.js +4 -0
- package/lib/duet/{p-e26116e0.system.entry.js → p-9dca5c22.system.entry.js} +1 -1
- package/lib/duet/p-a207b008.entry.js +4 -0
- package/lib/duet/p-a5b9c192.system.entry.js +4 -0
- package/lib/duet/p-a6a84ec6.entry.js +4 -0
- package/lib/duet/{p-2d2c45f9.entry.js → p-a890da72.entry.js} +1 -1
- package/lib/duet/p-a9859a82.entry.js +4 -0
- package/lib/duet/p-aba68b7b.entry.js +4 -0
- package/lib/duet/p-acc57c77.entry.js +4 -0
- package/lib/duet/{p-2826f987.js → p-ad07f399.js} +1 -1
- package/lib/duet/p-aee24388.system.entry.js +4 -0
- package/lib/duet/p-aef1b720.system.entry.js +4 -0
- package/lib/duet/{p-62806bb6.system.entry.js → p-af41d894.system.entry.js} +1 -1
- package/lib/duet/p-b25d3769.js +4 -0
- package/lib/duet/{p-dee41056.system.entry.js → p-b32224fe.system.entry.js} +1 -1
- package/lib/duet/p-b3744481.entry.js +4 -0
- package/lib/duet/{p-de2be65b.system.js → p-b42d81c3.system.js} +1 -1
- package/lib/duet/{p-27d538f7.system.entry.js → p-b4e87f02.system.entry.js} +1 -1
- package/lib/duet/{p-f71f12ed.entry.js → p-bf93a991.entry.js} +1 -1
- package/lib/duet/{p-fd98468a.system.js → p-c18a599e.system.js} +0 -0
- package/lib/duet/p-c2e77278.entry.js +4 -0
- package/lib/duet/p-c34329f3.entry.js +4 -0
- package/lib/duet/{p-59a07cf9.entry.js → p-c36b4da0.entry.js} +1 -1
- package/lib/duet/{p-a321a98c.entry.js → p-cdd70b93.entry.js} +1 -1
- package/lib/duet/p-d1c19f04.system.entry.js +4 -0
- package/lib/duet/{p-f71e337e.system.entry.js → p-d3a3c3c7.system.entry.js} +1 -1
- package/lib/duet/{p-345ea4f2.system.entry.js → p-d4118b6e.system.entry.js} +1 -1
- package/lib/duet/{p-3dc9d15d.system.entry.js → p-d744d188.system.entry.js} +1 -1
- package/lib/duet/p-ddb6344c.system.js +4 -0
- package/lib/duet/p-de07c7d7.entry.js +4 -0
- package/lib/duet/p-dfe79666.system.entry.js +4 -0
- package/lib/duet/p-e12f2b8b.system.js +4 -0
- package/lib/duet/p-e2a44156.js +4 -0
- package/lib/duet/p-e76b722f.entry.js +4 -0
- package/lib/duet/p-e964d062.entry.js +4 -0
- package/lib/duet/p-eb55ccd2.system.js +4 -0
- package/lib/duet/p-f0a4b68d.system.entry.js +4 -0
- package/lib/duet/p-f364eb96.entry.js +4 -0
- package/lib/duet/{p-a88df408.entry.js → p-f8ce39fb.entry.js} +1 -1
- package/lib/esm/{dom-21034390.js → dom-58cd15f6.js} +1 -1
- package/lib/esm/duet-alert.entry.js +4 -2
- package/lib/esm/duet-badge.entry.js +2 -2
- package/lib/esm/duet-button_2.entry.js +6 -5
- package/lib/esm/duet-caption_4.entry.js +21 -15
- package/lib/esm/duet-card.entry.js +6 -6
- package/lib/esm/duet-checkbox.entry.js +2 -2
- package/lib/esm/duet-choice_2.entry.js +57 -26
- package/lib/esm/duet-collapsible.entry.js +5 -2
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +23 -13
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table-button_3.entry.js +226 -0
- package/lib/esm/{duet-table.entry.js → duet-editable-table_3.entry.js} +205 -3
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +4 -4
- package/lib/esm/duet-grid_2.entry.js +52 -4
- package/lib/esm/duet-header_2.entry.js +26 -10
- package/lib/esm/duet-hero.entry.js +6 -6
- package/lib/esm/duet-icon.entry.js +6 -14
- package/lib/esm/duet-input_2.entry.js +7 -7
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +2 -2
- package/lib/esm/duet-modal.entry.js +8 -7
- package/lib/esm/duet-notification_2.entry.js +6 -5
- package/lib/esm/duet-number-input.entry.js +36 -15
- package/lib/esm/duet-progress.entry.js +71 -0
- package/lib/esm/duet-radio_2.entry.js +2 -2
- package/lib/esm/duet-range-slider.entry.js +2 -2
- package/lib/esm/duet-select.entry.js +6 -6
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-tab_2.entry.js +12 -6
- package/lib/esm/duet-textarea.entry.js +5 -5
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +21 -10
- package/lib/esm/duet-tray.entry.js +21 -10
- package/lib/esm/duet-upload.entry.js +403 -180
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +4 -4
- package/lib/esm/{focus-utils-0b12f0df.js → focus-utils-1fe0dcd0.js} +1 -1
- package/lib/esm/{index-f70ddc7f.js → index-84d97bd1.js} +88 -78
- package/lib/esm/js-utils-b69f17df.js +14 -0
- package/lib/esm/{language-utils-ab9c3afc.js → language-utils-344d894c.js} +28 -10
- package/lib/esm/loader.js +3 -3
- package/lib/esm/{shadow-css-31e2d504.js → shadow-css-7c726abb.js} +9 -10
- package/lib/esm/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +7 -1
- package/lib/esm/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
- package/lib/esm/{tokens.module-edb66c04.js → tokens.module-49cbf963.js} +3 -1
- package/lib/esm/watch-options-dd55bce8.js +57 -0
- package/lib/esm-es5/{dom-21034390.js → dom-58cd15f6.js} +0 -0
- 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-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +2 -2
- 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_3.entry.js +4 -0
- package/lib/esm-es5/duet-editable-table_3.entry.js +4 -0
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/lib/esm-es5/duet-progress.entry.js +4 -0
- 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-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-tab_2.entry.js +2 -2
- 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.entry.js +2 -2
- 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-0b12f0df.js → focus-utils-1fe0dcd0.js} +1 -1
- package/lib/esm-es5/index-84d97bd1.js +4 -0
- package/lib/esm-es5/js-utils-b69f17df.js +4 -0
- package/lib/esm-es5/language-utils-344d894c.js +4 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/shadow-css-7c726abb.js +15 -0
- package/lib/esm-es5/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +1 -1
- package/lib/esm-es5/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
- package/lib/esm-es5/tokens.module-49cbf963.js +4 -0
- package/lib/esm-es5/watch-options-dd55bce8.js +4 -0
- package/lib/types/components/duet-alert/duet-alert.d.ts +2 -1
- package/lib/types/components/duet-button/duet-button.d.ts +1 -1
- package/lib/types/components/duet-choice/duet-choice.d.ts +24 -5
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +15 -9
- package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +72 -0
- package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +72 -0
- package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +7 -0
- package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +84 -0
- package/lib/types/components/duet-footer/duet-footer.d.ts +1 -1
- package/lib/types/components/duet-grid/duet-grid.d.ts +16 -2
- package/lib/types/components/duet-header/duet-header.d.ts +21 -5
- package/lib/types/components/duet-heading/duet-heading.d.ts +2 -2
- package/lib/types/components/duet-hero/duet-hero.d.ts +3 -3
- package/lib/types/components/duet-icon/duet-icon.d.ts +1 -1
- package/lib/types/components/duet-link/duet-link.d.ts +2 -3
- package/lib/types/components/duet-modal/duet-modal.d.ts +3 -3
- package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +3 -3
- package/lib/types/components/duet-number-input/duet-number-input.d.ts +21 -0
- package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +9 -1
- package/lib/types/components/duet-progress/duet-progress.d.ts +64 -0
- package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +6 -0
- package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +11 -0
- package/lib/types/components/duet-tray/duet-tray.d.ts +11 -0
- package/lib/types/components/duet-upload/duet-upload-aria-status.d.ts +49 -0
- package/lib/types/components/duet-upload/duet-upload-editable-item-error.d.ts +7 -0
- package/lib/types/components/duet-upload/duet-upload-editable-item-inprogres.d.ts +7 -0
- package/lib/types/components/duet-upload/duet-upload-editable-item-success.d.ts +8 -0
- package/lib/types/components/duet-upload/duet-upload.d.ts +94 -25
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +1 -0
- package/lib/types/components/duet-upload/xhr.helpers.d.ts +7 -1
- package/lib/types/components.d.ts +611 -79
- package/lib/types/utils/js-utils.d.ts +1 -0
- package/lib/types/utils/language-utils.d.ts +8 -3
- package/lib/types/utils/string-utils.d.ts +1 -0
- package/lib/types/utils/watch-options.d.ts +2 -0
- package/package.json +19 -15
- package/hydrate/package.json +0 -6
- package/lib/cjs/duet-fieldset.cjs.entry.js +0 -62
- package/lib/collection/components/duet-upload/duet-upload-file-list.js +0 -49
- package/lib/duet/p-0733c303.system.entry.js +0 -4
- package/lib/duet/p-095060cc.js +0 -4
- package/lib/duet/p-156864a1.system.entry.js +0 -4
- package/lib/duet/p-15c15c6a.js +0 -15
- package/lib/duet/p-1911dfe7.system.entry.js +0 -4
- package/lib/duet/p-1c41525a.entry.js +0 -4
- package/lib/duet/p-1cfe38b1.system.entry.js +0 -4
- package/lib/duet/p-2834a302.entry.js +0 -4
- package/lib/duet/p-28a3d38f.system.entry.js +0 -4
- package/lib/duet/p-2a1a9f9f.entry.js +0 -4
- package/lib/duet/p-2a4d7c5b.system.entry.js +0 -4
- package/lib/duet/p-3eb36e3d.entry.js +0 -4
- package/lib/duet/p-4095dba5.entry.js +0 -4
- package/lib/duet/p-418b2ce7.system.js +0 -4
- package/lib/duet/p-4289b543.entry.js +0 -4
- package/lib/duet/p-43e39d98.system.js +0 -4
- package/lib/duet/p-46a3ae43.system.js +0 -4
- package/lib/duet/p-4a38cf9d.entry.js +0 -4
- package/lib/duet/p-4be8e814.entry.js +0 -4
- package/lib/duet/p-4dcea8fb.system.entry.js +0 -4
- package/lib/duet/p-591b2137.entry.js +0 -4
- package/lib/duet/p-5c5bdb06.system.entry.js +0 -4
- package/lib/duet/p-5f70e318.entry.js +0 -4
- package/lib/duet/p-62c294d6.system.entry.js +0 -4
- package/lib/duet/p-6a356ab1.system.js +0 -4
- package/lib/duet/p-6c2729da.js +0 -4
- package/lib/duet/p-6f107847.system.entry.js +0 -4
- package/lib/duet/p-77a5fe4c.system.js +0 -4
- package/lib/duet/p-7809e78b.system.entry.js +0 -4
- package/lib/duet/p-7a36d76f.system.entry.js +0 -4
- package/lib/duet/p-7ee52f58.entry.js +0 -4
- package/lib/duet/p-884693f1.entry.js +0 -4
- package/lib/duet/p-89db3b94.entry.js +0 -4
- package/lib/duet/p-8cfce39e.system.entry.js +0 -4
- package/lib/duet/p-8ffe1461.system.entry.js +0 -4
- package/lib/duet/p-9381c2d4.entry.js +0 -4
- package/lib/duet/p-9a450c9a.entry.js +0 -4
- package/lib/duet/p-9a89ec39.js +0 -4
- package/lib/duet/p-9bbfe606.system.entry.js +0 -4
- package/lib/duet/p-a6096b05.system.entry.js +0 -4
- package/lib/duet/p-a89d5d7c.entry.js +0 -4
- package/lib/duet/p-b07055fd.system.entry.js +0 -4
- package/lib/duet/p-b4374f0e.entry.js +0 -4
- package/lib/duet/p-b456d684.system.entry.js +0 -4
- package/lib/duet/p-bd18c93f.js +0 -4
- package/lib/duet/p-bddb1c15.system.entry.js +0 -4
- package/lib/duet/p-c0b95b58.entry.js +0 -4
- package/lib/duet/p-c3688975.entry.js +0 -4
- package/lib/duet/p-c4d183e6.entry.js +0 -4
- package/lib/duet/p-c9303f9a.entry.js +0 -4
- package/lib/duet/p-cd4e8ccf.js +0 -4
- package/lib/duet/p-ceb75b35.system.entry.js +0 -4
- package/lib/duet/p-cf243bcb.system.entry.js +0 -4
- package/lib/duet/p-d37c8a05.system.js +0 -4
- package/lib/duet/p-d989af11.entry.js +0 -4
- package/lib/duet/p-e58ca7af.system.js +0 -16
- package/lib/duet/p-e6128d82.system.entry.js +0 -4
- package/lib/duet/p-e86cdc17.entry.js +0 -4
- package/lib/duet/p-eadb29c7.entry.js +0 -4
- package/lib/duet/p-f30b14d6.system.entry.js +0 -4
- package/lib/duet/p-f79f8da1.entry.js +0 -4
- package/lib/duet/p-fc397e03.system.entry.js +0 -4
- package/lib/esm/duet-fieldset.entry.js +0 -58
- package/lib/esm/watch-options-de55ea78.js +0 -35
- package/lib/esm-es5/duet-fieldset.entry.js +0 -4
- package/lib/esm-es5/duet-table.entry.js +0 -4
- package/lib/esm-es5/index-f70ddc7f.js +0 -4
- package/lib/esm-es5/language-utils-ab9c3afc.js +0 -4
- package/lib/esm-es5/shadow-css-31e2d504.js +0 -15
- package/lib/esm-es5/tokens.module-edb66c04.js +0 -4
- package/lib/esm-es5/watch-options-de55ea78.js +0 -4
- package/lib/html.html-data.json +0 -4556
- package/lib/types/components/duet-upload/duet-upload-file-list.d.ts +0 -9
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
4
|
const NAMESPACE = 'duet';
|
|
5
|
+
const Env = /* duet */ {"cdnURILocal":"http://0.0.0.0:3334","cdnURIProd":"https://cdn.duetds.com/api","duetIconVersion":"2.2.3"};
|
|
5
6
|
|
|
6
7
|
let scopeId;
|
|
7
8
|
let contentRef;
|
|
@@ -13,6 +14,8 @@ let isSvgMode = false;
|
|
|
13
14
|
let queuePending = false;
|
|
14
15
|
const win = typeof window !== 'undefined' ? window : {};
|
|
15
16
|
const doc = win.document || { head: {} };
|
|
17
|
+
const H = (win.HTMLElement || class {
|
|
18
|
+
});
|
|
16
19
|
const plt = {
|
|
17
20
|
$flags$: 0,
|
|
18
21
|
$resourcesUrl$: '',
|
|
@@ -391,7 +394,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
391
394
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
392
395
|
if (memberName === 'list') {
|
|
393
396
|
isProp = false;
|
|
394
|
-
// tslint:disable-next-line: triple-equals
|
|
395
397
|
}
|
|
396
398
|
else if (oldValue == null || elm[memberName] != n) {
|
|
397
399
|
elm[memberName] = n;
|
|
@@ -1321,14 +1323,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1321
1323
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1322
1324
|
plt.jmp(() => {
|
|
1323
1325
|
const propName = attrNameToPropName.get(attrName);
|
|
1324
|
-
// In a
|
|
1326
|
+
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1325
1327
|
// in the case where an attribute was set inline.
|
|
1326
1328
|
// ```html
|
|
1327
1329
|
// <my-component some-attribute="some-value"></my-component>
|
|
1328
1330
|
// ```
|
|
1329
1331
|
//
|
|
1330
|
-
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1331
|
-
// changes it before it has been upgraded as shown below:
|
|
1332
|
+
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1333
|
+
// programmatically changes it before it has been upgraded as shown below:
|
|
1332
1334
|
//
|
|
1333
1335
|
// ```html
|
|
1334
1336
|
// <!-- this component has _not_ been upgraded yet -->
|
|
@@ -1338,13 +1340,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1338
1340
|
// el = document.querySelector("#test");
|
|
1339
1341
|
// el.someAttribute = "another-value";
|
|
1340
1342
|
// // upgrade component
|
|
1341
|
-
//
|
|
1343
|
+
// customElements.define('my-component', MyComponent);
|
|
1342
1344
|
// </script>
|
|
1343
1345
|
// ```
|
|
1344
1346
|
// In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1345
1347
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1346
1348
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1347
|
-
// the connectedCallback attempts to unshadow it will use "some-value" as the
|
|
1349
|
+
// the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
|
|
1348
1350
|
//
|
|
1349
1351
|
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
|
|
1350
1352
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
@@ -1358,6 +1360,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1358
1360
|
newValue = this[propName];
|
|
1359
1361
|
delete this[propName];
|
|
1360
1362
|
}
|
|
1363
|
+
else if (prototype.hasOwnProperty(propName) &&
|
|
1364
|
+
typeof this[propName] === 'number' &&
|
|
1365
|
+
this[propName] == newValue) {
|
|
1366
|
+
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
|
|
1367
|
+
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
|
|
1368
|
+
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1369
|
+
return;
|
|
1370
|
+
}
|
|
1361
1371
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1362
1372
|
});
|
|
1363
1373
|
};
|
|
@@ -1407,7 +1417,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1407
1417
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1408
1418
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1409
1419
|
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
1410
|
-
// this is the
|
|
1420
|
+
// this is the initial load and this component it has an ancestor component
|
|
1411
1421
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1412
1422
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
1413
1423
|
// this will get fired off when the ancestor component
|
|
@@ -1535,18 +1545,23 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1535
1545
|
originalDisconnectedCallback.call(this);
|
|
1536
1546
|
}
|
|
1537
1547
|
},
|
|
1548
|
+
__attachShadow() {
|
|
1549
|
+
if (supportsShadow) {
|
|
1550
|
+
{
|
|
1551
|
+
this.attachShadow({
|
|
1552
|
+
mode: 'open',
|
|
1553
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
else {
|
|
1558
|
+
this.shadowRoot = this;
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1538
1561
|
});
|
|
1539
1562
|
Cstr.is = cmpMeta.$tagName$;
|
|
1540
1563
|
return proxyComponent(Cstr, cmpMeta);
|
|
1541
1564
|
};
|
|
1542
|
-
const attachShadow = (el) => {
|
|
1543
|
-
if (supportsShadow) {
|
|
1544
|
-
el.attachShadow({ mode: 'open' });
|
|
1545
|
-
}
|
|
1546
|
-
else {
|
|
1547
|
-
el.shadowRoot = el;
|
|
1548
|
-
}
|
|
1549
|
-
};
|
|
1550
1565
|
const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
|
|
1551
1566
|
const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
1552
1567
|
const Fragment = (_, children) => children;
|
|
@@ -1644,6 +1659,51 @@ const appGlobalScript = () => {
|
|
|
1644
1659
|
|
|
1645
1660
|
const globalScripts = appGlobalScript;
|
|
1646
1661
|
|
|
1662
|
+
function isObject(maybeObj) {
|
|
1663
|
+
return Object.prototype.toString.call(maybeObj) === "[object Object]";
|
|
1664
|
+
}
|
|
1665
|
+
const parsePossibleJSON = (maybeJSON) => {
|
|
1666
|
+
if (Array.isArray(maybeJSON) || isObject(maybeJSON)) {
|
|
1667
|
+
return maybeJSON;
|
|
1668
|
+
}
|
|
1669
|
+
if (typeof maybeJSON === "string") {
|
|
1670
|
+
try {
|
|
1671
|
+
return JSON.parse(maybeJSON);
|
|
1672
|
+
}
|
|
1673
|
+
catch (e) {
|
|
1674
|
+
console.warn(e);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
// undefined is not a type in JSON,
|
|
1678
|
+
// so we use it here to signal invalid input
|
|
1679
|
+
return undefined;
|
|
1680
|
+
};
|
|
1681
|
+
/**
|
|
1682
|
+
* Format string, via simplistic sprintf equivalent
|
|
1683
|
+
* @example String.format('{0} is super, but {1} is best! {{0}}', 'Duet', 'Coffee'); -> "Duet is super, but Coffee ist best! {0}"
|
|
1684
|
+
*
|
|
1685
|
+
*/
|
|
1686
|
+
// @ts-ignore
|
|
1687
|
+
if (!String.format) {
|
|
1688
|
+
// @ts-ignore
|
|
1689
|
+
String.format = function (format) {
|
|
1690
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
1691
|
+
return format.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
|
|
1692
|
+
return curlyBrack == "{{" ? "{" : curlyBrack == "}}" ? "}" : args[index];
|
|
1693
|
+
});
|
|
1694
|
+
};
|
|
1695
|
+
}
|
|
1696
|
+
const MATCH_DISALLOWED_CHARS = /[^a-z0-9áéíóúñüöäå \.,_-]/gim;
|
|
1697
|
+
function sanitizeString$1(string) {
|
|
1698
|
+
return string.replace(MATCH_DISALLOWED_CHARS, "").trim();
|
|
1699
|
+
}
|
|
1700
|
+
const convertHtmlQuotes = string => {
|
|
1701
|
+
if (typeof string === "string") {
|
|
1702
|
+
return string.replace(/"/g, '"').replace(/'/g, '"');
|
|
1703
|
+
}
|
|
1704
|
+
return string;
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1647
1707
|
const localeLookUpTable = {
|
|
1648
1708
|
fi: "fi-FI",
|
|
1649
1709
|
en: "en-GB",
|
|
@@ -1658,13 +1718,13 @@ const localeMonetarySignifierLookUpTable = {
|
|
|
1658
1718
|
};
|
|
1659
1719
|
const defLanguageArray = ["fi", "en", "sv"];
|
|
1660
1720
|
const defaultLanguage = "fi";
|
|
1661
|
-
const
|
|
1662
|
-
? document.documentElement.lang.toLowerCase()
|
|
1663
|
-
|
|
1721
|
+
const getCurrentLanguage = () => {
|
|
1722
|
+
return document.documentElement.lang ? document.documentElement.lang.toLowerCase() : defaultLanguage;
|
|
1723
|
+
};
|
|
1664
1724
|
const isOfTypeLanguage = (keyInput) => {
|
|
1665
1725
|
return defLanguageArray.includes(keyInput);
|
|
1666
1726
|
};
|
|
1667
|
-
const checkForLanguage = (languageString =
|
|
1727
|
+
const checkForLanguage = (languageString = getCurrentLanguage()) => {
|
|
1668
1728
|
if (isOfTypeLanguage(languageString)) {
|
|
1669
1729
|
return languageString;
|
|
1670
1730
|
}
|
|
@@ -1678,7 +1738,7 @@ const checkForLanguage = (languageString = currentLanguage) => {
|
|
|
1678
1738
|
* @param {string} lang=fi - "fi" | "sv" | "en"
|
|
1679
1739
|
* @default {string} "fi"
|
|
1680
1740
|
*/
|
|
1681
|
-
const getLanguage = (languageString =
|
|
1741
|
+
const getLanguage = (languageString = getCurrentLanguage()) => checkForLanguage(languageString);
|
|
1682
1742
|
/**
|
|
1683
1743
|
* Returns the current language and locale
|
|
1684
1744
|
* If language is not fi|sv|en it will default to "fi"
|
|
@@ -1696,21 +1756,37 @@ const getLocale = (lang) => {
|
|
|
1696
1756
|
}
|
|
1697
1757
|
throw new Error(`Locale for "${lang}" not found`);
|
|
1698
1758
|
};
|
|
1759
|
+
/**
|
|
1760
|
+
* Takes any json object that is passed and/or htmlencoded and converts it to proper json
|
|
1761
|
+
*/
|
|
1762
|
+
const sanitizeString = (string) => {
|
|
1763
|
+
const argIsString = typeof string === "string";
|
|
1764
|
+
if (argIsString) {
|
|
1765
|
+
try {
|
|
1766
|
+
return JSON.parse(convertHtmlQuotes(string));
|
|
1767
|
+
}
|
|
1768
|
+
catch (e) {
|
|
1769
|
+
console.log("sanitizeString received a string, that didnt parse to json object", string, e);
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
return string;
|
|
1773
|
+
};
|
|
1699
1774
|
/**
|
|
1700
1775
|
* Returns the current string / object from a given translation object
|
|
1701
1776
|
* If language is not fi|sv|en it will default to "fi"
|
|
1702
1777
|
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
1703
|
-
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"}
|
|
1778
|
+
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"} | string will get JSON.parsed
|
|
1704
1779
|
* @param {boolean} languageOverride = false - in case you want to override the actual language set in html tag
|
|
1705
1780
|
* @default {object} {locale: "fi-FI", money: "€"}
|
|
1706
|
-
* @returns {(string|Object)} given example contains {fi:"something"} and
|
|
1781
|
+
* @returns {(string|Object)} given example contains {fi:"something"} and language===fi this will return "something"
|
|
1707
1782
|
*/
|
|
1708
1783
|
const getLocaleString = (langObject, languageOverride) => {
|
|
1784
|
+
const obj = sanitizeString(langObject);
|
|
1709
1785
|
if (languageOverride) {
|
|
1710
|
-
return
|
|
1786
|
+
return obj[checkForLanguage(languageOverride)];
|
|
1711
1787
|
}
|
|
1712
1788
|
else {
|
|
1713
|
-
return
|
|
1789
|
+
return obj[getLanguage()];
|
|
1714
1790
|
}
|
|
1715
1791
|
};
|
|
1716
1792
|
|
|
@@ -1722,11 +1798,11 @@ const inheritGlobalTheme = (component) => {
|
|
|
1722
1798
|
|
|
1723
1799
|
const duetAlertCss = "*,*::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:block;width:100%;max-height:999px;border-radius:4px;transition:opacity 300ms ease, visibility 300ms ease, transform 300ms ease, max-height 300ms ease}:host(:focus){outline:0}:host(.user-is-tabbing:focus){border-radius:4px;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing.duet-theme-turva:focus){box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}:host(.duet-alert-is-dismissed){max-height:0;visibility:hidden;opacity:0;transform:scale(0.98)}:host(.duet-alert-is-dismissed) .duet-alert{margin:0 !important}.duet-alert{margin-bottom:16px !important;position:relative;width:100%;padding:16px;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;color:#00294d;background:#f2f8fb;border:1px solid #0077b3;border-radius:4px;transition:margin 100ms 300ms ease}.duet-alert.duet-p-0{padding:0 !important}.duet-alert.duet-m-0{margin:0 !important}.duet-alert.duet-theme-turva{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;background:#f3f4f5;border-color:#171c3a}.duet-alert.warning{background:#fffbf4;border-color:#f7b228}.duet-alert.warning.duet-theme-turva{background:#fffaf3;border-color:#faa40f}.duet-alert.danger{background:#fdf4f7;border-color:#de2362}.duet-alert.danger.duet-theme-turva{background:#fdf4f3;border-color:#e02a0d}.duet-alert.success{background:#f2f9f7;border-color:#00875a}.duet-alert.success.duet-theme-turva{background:#f3f9f6;border-color:#08874e}.duet-alert-dismiss{position:absolute;top:2px;right:2px}.duet-alert-container{display:inline-flex;align-items:center;justify-content:center;width:100%;margin:0 auto !important}.duet-alert-container span{width:100%}.duet-alert-has-icon .duet-alert-container{margin-top:2px !important}.duet-alert-icon{display:inline-block;align-self:center;width:20px;min-width:20px;height:20px;margin:0 16px 0 0 !important}.duet-alert-icon duet-icon{width:20px;height:20px}.duet-alert-is-dismissible{padding:16px 48px 16px 16px;text-align:left}.duet-alert-is-dismissible .duet-alert-container{text-align:left}";
|
|
1724
1800
|
|
|
1725
|
-
let DuetAlert$1 = class extends
|
|
1801
|
+
let DuetAlert$1 = class extends H {
|
|
1726
1802
|
constructor() {
|
|
1727
1803
|
super();
|
|
1728
1804
|
this.__registerHost();
|
|
1729
|
-
|
|
1805
|
+
this.__attachShadow();
|
|
1730
1806
|
this.duetDismiss = createEvent$2(this, "duetDismiss", 7);
|
|
1731
1807
|
/**
|
|
1732
1808
|
* Theme of the card.
|
|
@@ -1740,6 +1816,7 @@ let DuetAlert$1 = class extends HTMLElement {
|
|
|
1740
1816
|
/**
|
|
1741
1817
|
* Property to change languageDefaults on the component.
|
|
1742
1818
|
* normally you would handle these strings on an application level and override @accessibleLabel when needed
|
|
1819
|
+
* @default {fi: "Sulje viesti", sv: "Stäng meddelandet", en: "Close the message"}
|
|
1743
1820
|
*/
|
|
1744
1821
|
this.accessibleLabelDefaults = {
|
|
1745
1822
|
fi: "Sulje viesti",
|
|
@@ -1819,13 +1896,13 @@ let DuetAlert$1 = class extends HTMLElement {
|
|
|
1819
1896
|
static get style() { return duetAlertCss; }
|
|
1820
1897
|
};
|
|
1821
1898
|
|
|
1822
|
-
const duetBadgeCss = "*,*::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;margin-right:4px !important;margin-bottom:2px !important;display:inline-block;width:auto;vertical-align:middle}:host:last-child,:host:last-of-type{margin-right:0 !important}:host(.duet-m-0){margin:0 !important}.duet-badge{width:100%;padding:4.4444444444px 12px 5.4444444444px;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.75rem;font-style:normal;font-weight:600;line-height:1.25;color:#00294d;text-align:center;vertical-align:middle;background:#e6f1f7;border-radius:20rem}.duet-badge.duet-p-0{padding:0 !important}.duet-badge.duet-m-0{margin:0 !important}.duet-badge.duet-theme-turva{padding:5.4444444444px 12px 4.4444444444px;font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-weight:700;color:#171c3a;background:#e8e8eb}.duet-badge.warning{background:#fef3df}.duet-badge.warning.duet-theme-turva{background:#fef1db}.duet-badge.danger{background:#fce9ef}.duet-badge.danger.duet-theme-turva{background:#fceae7}.duet-badge.success{background:#e6f3ef}.duet-badge.success.duet-theme-turva{background:#e6f3ed}";
|
|
1899
|
+
const duetBadgeCss = "*,*::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;margin-right:4px !important;margin-bottom:2px !important;display:inline-block;width:auto;vertical-align:middle}:host:last-child,:host:last-of-type{margin-right:0 !important}:host(.duet-m-0){margin:0 !important}.duet-badge{width:100%;padding:4.4444444444px 12px 5.4444444444px;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.75rem;font-style:normal;font-weight:600;line-height:1.25;color:#00294d;text-align:center;word-break:break-word;vertical-align:middle;background:#e6f1f7;border-radius:20rem}.duet-badge.duet-p-0{padding:0 !important}.duet-badge.duet-m-0{margin:0 !important}.duet-badge.duet-theme-turva{padding:5.4444444444px 12px 4.4444444444px;font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-weight:700;color:#171c3a;background:#e8e8eb}.duet-badge.warning{background:#fef3df}.duet-badge.warning.duet-theme-turva{background:#fef1db}.duet-badge.danger{background:#fce9ef}.duet-badge.danger.duet-theme-turva{background:#fceae7}.duet-badge.success{background:#e6f3ef}.duet-badge.success.duet-theme-turva{background:#e6f3ed}";
|
|
1823
1900
|
|
|
1824
|
-
let DuetBadge$1 = class extends
|
|
1901
|
+
let DuetBadge$1 = class extends H {
|
|
1825
1902
|
constructor() {
|
|
1826
1903
|
super();
|
|
1827
1904
|
this.__registerHost();
|
|
1828
|
-
|
|
1905
|
+
this.__attachShadow();
|
|
1829
1906
|
/**
|
|
1830
1907
|
* Theme of the badge.
|
|
1831
1908
|
*/
|
|
@@ -1980,6 +2057,7 @@ const sizeTappableSquare = "48px";
|
|
|
1980
2057
|
const sizeIconXSmall = "16px";
|
|
1981
2058
|
const sizeIconXxxSmall = "7px";
|
|
1982
2059
|
const sizeButtonBorder = "2px";
|
|
2060
|
+
const sizeButtonTinyBorder = "1px";
|
|
1983
2061
|
const sizeIconMedium = "24px";
|
|
1984
2062
|
const sizeIconSmall = "20px";
|
|
1985
2063
|
const opacity85 = "0.85";
|
|
@@ -2129,6 +2207,7 @@ const tokens$2 = /*#__PURE__*/Object.freeze({
|
|
|
2129
2207
|
sizeIconXSmall: sizeIconXSmall,
|
|
2130
2208
|
sizeIconXxxSmall: sizeIconXxxSmall,
|
|
2131
2209
|
sizeButtonBorder: sizeButtonBorder,
|
|
2210
|
+
sizeButtonTinyBorder: sizeButtonTinyBorder,
|
|
2132
2211
|
sizeIconMedium: sizeIconMedium,
|
|
2133
2212
|
sizeIconSmall: sizeIconSmall,
|
|
2134
2213
|
opacity85: opacity85,
|
|
@@ -2186,11 +2265,11 @@ function getColorByName(name) {
|
|
|
2186
2265
|
|
|
2187
2266
|
const duetButtonCss = "*,*::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;margin-right:8px !important;margin-bottom:12px !important;position:relative;z-index:1;display:inline-flex;width:auto;max-width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}:host:last-child,:host:last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){:host{width:100%}}:host(.duet-small){margin-right:2px !important;margin-bottom:8px !important}:host(.duet-small):last-child,:host(.duet-small):last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){:host(.duet-small){width:auto}}:host(.duet-expand){width:100% !important}:host(.duet-m-0){margin:0 !important}:host(.duet-fixed){width:auto !important}:host(:last-child){margin-right:0 !important}.duet-button-container{position:relative;width:100%}.duet-button{padding:14px 27px 15px !important;-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:block;width:100%;min-width:8rem;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:600;font-variant-numeric:tabular-nums;-webkit-hyphens:auto;hyphens:auto;line-height:1.1;color:#0077b3 !important;text-align:center;text-decoration:none;cursor:pointer;background:transparent;border-style:solid;border-width:2px;border-radius:20rem;transition:background-color 300ms ease, color 300ms ease, border 300ms ease, box-shadow 300ms ease}.duet-button.duet-p-0{padding:0 !important}.duet-button.duet-m-0{margin:0 !important}.duet-button.duet-button-is-small:not(.duet-button-icon-only){padding:9px 19px 10px !important;min-width:5.3333333333rem;font-size:0.875rem}.duet-button.duet-button-is-small:not(.duet-button-icon-only).icon{padding-left:48px !important}.duet-button.duet-button-is-small:not(.duet-button-icon-only).icon-right{padding-right:48px !important;padding-left:20px !important}.duet-theme-turva .duet-button{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#c60c30 !important}.duet-button .duet-button-contents{position:relative;display:inline-block;margin:0 auto;pointer-events:none}.duet-button.duet-no-wrap{white-space:nowrap}.duet-button.icon{padding-left:52px !important}.duet-button.icon-right{padding-right:52px !important;padding-left:28px !important}.duet-button svg{width:100%;min-width:100%;fill:currentColor}.duet-button .duet-button-icon{position:absolute;top:50%;left:-28px;display:flex;align-items:center;justify-content:center;width:16px;height:16px;margin:0 !important;transform:translateY(-50%)}.duet-button .duet-button-icon duet-icon{width:16px;height:16px}.duet-button .duet-button-icon.right{right:-28px;left:auto}.duet-button .duet-button-icon.large{left:-32px;width:20px;height:20px}.duet-button .duet-button-icon.large duet-icon{width:20px;height:20px}.duet-button .duet-button-icon.large.right{right:-32px;left:auto}.duet-button .duet-button-icon.medium-small{left:-16px;width:10px;height:10px;padding-top:1px}.duet-button .duet-button-icon.medium-small duet-icon{width:10px;height:10px}.duet-button .duet-button-icon.medium-small.right{right:-16px;left:auto}.duet-button .duet-button-icon.small{left:-16px;width:7px;height:7px}.duet-button .duet-button-icon.small duet-icon{width:7px;height:7px}.duet-button .duet-button-icon.small.right{right:-16px;left:auto}.duet-button:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-button:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-button:active{opacity:0.75;transition:none}.duet-button.default{border-color:#e1e3e6}.duet-theme-turva .duet-button.default{color:#c60c30 !important;border-color:#e4e4e6}.duet-button.default:hover{border-color:#0077b3}.duet-theme-turva .duet-button.default:hover{border-color:#c60c30}.duet-button.default.duet-button-negative{background-color:white}.duet-theme-turva .duet-button.default.duet-button-negative{background-color:#e4e4e6 !important}.duet-button.default.duet-button-negative:hover{color:#0077b3 !important;border-color:#0077b3}.duet-theme-turva .duet-button.default.duet-button-negative:hover{color:#c60c30 !important;border-color:#c60c30}.duet-button.primary{color:white !important;background:#0077b3;border-color:#0077b3}.duet-theme-turva .duet-button.primary{color:white !important;background:#c60c30;border-color:#c60c30}.duet-button.primary:hover{background:#005f8f;border-color:#005f8f;box-shadow:0 4px 20px rgba(34, 34, 34, 0.1)}.duet-theme-turva .duet-button.primary:hover{background:#940925;border-color:#940925}.duet-button.primary:focus{outline:0;box-shadow:0 0 0 1px white, 0 0 0 4px rgba(0, 119, 179, 0.75)}.duet-theme-turva .duet-button.primary:focus{box-shadow:0 0 0 1px white, 0 0 0 4px rgba(23, 28, 58, 0.7)}.duet-button.secondary{color:#00294d !important;background:transparent;border-color:#00294d}.duet-theme-turva .duet-button.secondary{color:#171c3a !important;border-color:#171c3a}.duet-button.secondary:hover{color:#0077b3 !important;border-color:#0077b3}.duet-theme-turva .duet-button.secondary:hover{color:#c60c30 !important;border-color:#c60c30}.duet-button.secondary.duet-button-negative{color:#e1e3e6 !important;border-color:white}.duet-theme-turva .duet-button.secondary.duet-button-negative{color:#e4e4e6 !important}.duet-button.secondary.duet-button-negative:hover{color:#0077b3 !important;border-color:#0077b3}.duet-theme-turva .duet-button.secondary.duet-button-negative:hover{color:#c60c30 !important;border-color:#c60c30}.duet-button.negative{color:#00294d !important;background:white;border-color:white}.duet-theme-turva .duet-button.negative{color:#171c3a !important}.duet-button.negative:hover{color:white !important;background:transparent;border-color:white}.duet-button.negative:focus{outline:0;box-shadow:0 0 0 1px #00294d, 0 0 0 4px rgba(255, 255, 255, 0.7)}.duet-theme-turva .duet-button.negative:focus{box-shadow:0 0 0 1px #171c3a, 0 0 0 4px rgba(255, 255, 255, 0.7)}.duet-button.destructive{color:#de2362 !important;background:white;border-color:#de2362}.duet-theme-turva .duet-button.destructive{color:#e02a0d !important;background:white;border-color:#e02a0d}.duet-button.destructive:hover{color:white !important;background:#b21c4e;border-color:#b21c4e}.duet-theme-turva .duet-button.destructive:hover{color:white !important;background:#b3220a;border-color:#b3220a}.duet-button.plain{min-width:48px;padding-right:0 !important;padding-left:0 !important;line-height:1.5;text-align:left;background:transparent;border:0;border-color:transparent;border-radius:4px}.duet-theme-turva .duet-button.plain{color:#c60c30 !important;background:transparent;border-color:transparent}.duet-button.plain.icon{padding-left:20px !important}.duet-button.plain.icon.icon-right{padding-right:20px !important;padding-left:0 !important}.duet-button.plain.icon.medium{padding-left:24px !important}.duet-button.plain.icon.medium.icon-right{padding-right:24px !important;padding-left:0 !important}.duet-button.plain.icon.large{padding-left:30px !important}.duet-button.plain.icon.large.icon-right{padding-right:30px !important;padding-left:0 !important}.duet-button.plain .duet-button-icon.left{left:-16.6666666667px !important}.duet-button.plain .duet-button-icon.left.medium{left:-24px !important}.duet-button.plain .duet-button-icon.left.large{left:-30px !important}.duet-button.plain .duet-button-icon.right{right:-16.6666666667px !important}.duet-button.plain .duet-button-icon.right.medium{right:-24px !important}.duet-button.plain .duet-button-icon.right.large{right:-30px !important}.duet-button.plain[disabled]{color:#657787 !important;background:transparent !important;border-color:transparent !important}.duet-theme-turva .duet-button.plain[disabled]{color:transparent !important;background:transparent !important;border-color:#e4e4e6 !important}.duet-button.plain:hover{color:#004d80 !important;background:transparent !important}.duet-theme-turva .duet-button.plain:hover{color:#940925 !important}.duet-button.plain.duet-button-negative{color:white !important}.duet-theme-turva .duet-button.plain.duet-button-negative{color:#e4e4e6 !important}.duet-button.plain.duet-button-negative:hover{color:#0077b3 !important}.duet-theme-turva .duet-button.plain.duet-button-negative:hover{color:#c60c30 !important}.duet-button.duet-button-icon-only{min-width:48px;min-height:48px;padding:0 !important}.duet-button.duet-button-icon-only .duet-button-contents{position:static}.duet-button.duet-button-icon-only .duet-button-icon.left.large,.duet-button.duet-button-icon-only .duet-button-icon.left.medium,.duet-button.duet-button-icon-only .duet-button-icon.left.small{position:absolute;top:50% !important;left:50% !important;padding:0;margin:0;transform:translateX(-50%) translateY(-50%)}.duet-button[disabled],.duet-button[disabled]:hover,.duet-button.duet-button-negative[disabled],.duet-button.duet-button-negative[disabled]:hover{color:#657787 !important;background:#e1e3e6 !important;border-color:#e1e3e6 !important;box-shadow:none !important}.duet-theme-turva .duet-button[disabled],.duet-theme-turva .duet-button[disabled]:hover,.duet-theme-turva .duet-button.duet-button-negative [disabled],.duet-theme-turva .duet-button.duet-button-negative [disabled]:hover{color:#747475 !important;background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-button-is-loading.primary{color:white}.duet-button-is-loading.default{color:#0077b3}.duet-button-is-loading.default.duet-theme-turva{color:#c60c30}.duet-button-is-loading .duet-button-contents{visibility:hidden;opacity:0}";
|
|
2188
2267
|
|
|
2189
|
-
let DuetButton$1 = class extends
|
|
2268
|
+
let DuetButton$1 = class extends H {
|
|
2190
2269
|
constructor() {
|
|
2191
2270
|
super();
|
|
2192
2271
|
this.__registerHost();
|
|
2193
|
-
|
|
2272
|
+
this.__attachShadow();
|
|
2194
2273
|
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
2195
2274
|
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
2196
2275
|
/**
|
|
@@ -2258,7 +2337,7 @@ let DuetButton$1 = class extends HTMLElement {
|
|
|
2258
2337
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
2259
2338
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
2260
2339
|
*/
|
|
2261
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
2340
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
2262
2341
|
/**
|
|
2263
2342
|
* Icon to display to the left of the button content.
|
|
2264
2343
|
* This is ignored/overridden when button is used as an external link.
|
|
@@ -2421,11 +2500,11 @@ let DuetButton$1 = class extends HTMLElement {
|
|
|
2421
2500
|
|
|
2422
2501
|
const duetCaptionCss = ":host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:16px !important;display:flex;flex:0 0 100%;width:100%;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.5;color:#657787;vertical-align:top}:host.duet-p-0{padding:0 !important}:host.duet-m-0{margin:0 !important}:host(.duet-caption-small){font-size:0.875rem;line-height:1.25}:host(.duet-theme-turva){font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#747475}:host(.duet-caption-selected){color:#0077b3}:host(.duet-caption-selected.duet-theme-turva){color:#171c3a}:host(.duet-m-0){margin:0 !important}";
|
|
2423
2502
|
|
|
2424
|
-
let DuetCaption$1 = class extends
|
|
2503
|
+
let DuetCaption$1 = class extends H {
|
|
2425
2504
|
constructor() {
|
|
2426
2505
|
super();
|
|
2427
2506
|
this.__registerHost();
|
|
2428
|
-
|
|
2507
|
+
this.__attachShadow();
|
|
2429
2508
|
/**
|
|
2430
2509
|
* Theme of the caption.
|
|
2431
2510
|
*/
|
|
@@ -2485,52 +2564,13 @@ const isQuestionKey = (e) => e.key === "?";
|
|
|
2485
2564
|
const isEnterKey = (e) => e.key === "Enter" || e.keyCode === 13;
|
|
2486
2565
|
const isKeyboardClick = (e) => isEnterKey(e) || isSpaceKey(e);
|
|
2487
2566
|
|
|
2488
|
-
|
|
2489
|
-
return Object.prototype.toString.call(maybeObj) === "[object Object]";
|
|
2490
|
-
}
|
|
2491
|
-
const parsePossibleJSON = (maybeJSON) => {
|
|
2492
|
-
if (Array.isArray(maybeJSON) || isObject(maybeJSON)) {
|
|
2493
|
-
return maybeJSON;
|
|
2494
|
-
}
|
|
2495
|
-
if (typeof maybeJSON === "string") {
|
|
2496
|
-
try {
|
|
2497
|
-
return JSON.parse(maybeJSON);
|
|
2498
|
-
}
|
|
2499
|
-
catch (e) {
|
|
2500
|
-
console.warn(e);
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
// undefined is not a type in JSON,
|
|
2504
|
-
// so we use it here to signal invalid input
|
|
2505
|
-
return undefined;
|
|
2506
|
-
};
|
|
2507
|
-
/**
|
|
2508
|
-
* Format string, via simplistic sprintf equivalent
|
|
2509
|
-
* @example String.format('{0} is super, but {1} is best! {{0}}', 'Duet', 'Coffee'); -> "Duet is super, but Coffee ist best! {0}"
|
|
2510
|
-
*
|
|
2511
|
-
*/
|
|
2512
|
-
// @ts-ignore
|
|
2513
|
-
if (!String.format) {
|
|
2514
|
-
// @ts-ignore
|
|
2515
|
-
String.format = function (format) {
|
|
2516
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
2517
|
-
return format.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
|
|
2518
|
-
return curlyBrack == "{{" ? "{" : curlyBrack == "}}" ? "}" : args[index];
|
|
2519
|
-
});
|
|
2520
|
-
};
|
|
2521
|
-
}
|
|
2522
|
-
const MATCH_DISALLOWED_CHARS = /[^a-z0-9áéíóúñüöäå \.,_-]/gim;
|
|
2523
|
-
function sanitizeString(string) {
|
|
2524
|
-
return string.replace(MATCH_DISALLOWED_CHARS, "").trim();
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
const duetCardCss = "*,*::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;margin-bottom:20px !important;display:flex;width:100%;vertical-align:top}:host(.duet-card-info){margin-bottom:16px !important}:host(.duet-m-0){margin:0 !important}.duet-card{padding:20px !important;position:relative;display:block;width:100%;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-style:normal;font-weight:400;line-height:1.5;color:#00294d;text-decoration:none;border-radius:4px;box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}.duet-card.duet-p-0{padding:0 !important}.duet-card.duet-m-0{margin:0 !important}.duet-card:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-card:focus,.duet-card:focus.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}@media (min-width: 36em){.duet-card{padding:28px !important}}.duet-card.duet-theme-turva{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;box-shadow:0 2px 6px 0 rgba(117, 117, 117, 0.13), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}@media (min-width: 36em){.duet-card.x-small{padding:20px !important}}@media (min-width: 36em){.duet-card.medium{padding:28px !important}}@media (min-width: 48em){.duet-card.medium{padding:36px !important}}@media (min-width: 36em){.duet-card.large{padding:36px !important}}@media (min-width: 48em){.duet-card.large{padding:48px !important}}@media (min-width: 36em){.duet-card.x-large{padding:48px !important}}@media (min-width: 48em){.duet-card.x-large{padding:72px !important}}.duet-card.duet-card-collapsed{padding-bottom:0 !important}@media (min-width: 36em){.duet-card.duet-card-collapsed{padding-bottom:0 !important}}.duet-card.info{background:rgba(0, 80, 128, 0.04) !important;box-shadow:none}.duet-card.info.duet-theme-turva{background:rgba(23, 28, 58, 0.035) !important}.duet-card.plain{box-shadow:none}.duet-card.plain:not(.duet-card-has-bg){background:transparent !important}.duet-card-heading-grid{display:flex;align-items:center}.duet-card-heading-grid .expand{flex:1}.duet-card-heading-text{overflow:hidden;text-overflow:ellipsis}.duet-card-secondary-heading{font-size:1rem;font-weight:600}.duet-card-heading{position:relative;display:block;padding:16px 20px;margin:-20px -20px 20px;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:1.25rem;font-weight:800;color:#00294d;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #e1e3e6}@media (min-width: 36em){.duet-card-heading{padding:15px 28px 16px !important;margin:-28px -28px 20px}}.duet-card-heading[role=button]{-webkit-user-select:none;user-select:none;cursor:pointer;border-radius:4px;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;appearance:none}.duet-card-heading[role=button]:focus{outline:0}:host(.user-is-tabbing) .duet-card-heading[role=button]:focus{border-radius:4px;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-card-heading[role=button]:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-card-collapsed .duet-card-heading{margin-bottom:0 !important;border-bottom:0 !important}.duet-theme-turva .duet-card-heading{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:#e4e4e6}@media (min-width: 36em){.x-small .duet-card-heading{padding:10px 20px 11px !important;margin:-20px -20px 20px}}@media (min-width: 48em){.x-small .duet-card-heading{padding:10px 20px 11px !important;margin:-20px -20px 20px}}.medium .duet-card-heading{margin:-20px -20px 20px}@media (min-width: 36em){.medium .duet-card-heading{padding:15px 28px 16px !important;margin:-28px -28px 20px}}@media (min-width: 48em){.medium .duet-card-heading{padding:19px 36px 20px !important;margin:-36px -36px 28px}}.large .duet-card-heading{margin:-20px -20px 20px}@media (min-width: 36em){.large .duet-card-heading{padding:19px 36px 20px !important;margin:-36px -36px 28px}}@media (min-width: 48em){.large .duet-card-heading{padding:26px 48px 27px !important;margin:-48px -48px 36px}}.x-large .duet-card-heading{margin:-20px -20px 20px}@media (min-width: 36em){.x-large .duet-card-heading{padding:26px 48px 27px !important;margin:-48px -48px 36px}}@media (min-width: 48em){.x-large .duet-card-heading{padding:39px 72px 40px !important;margin:-72px -72px 48px}}.none .duet-card-heading{padding:0 0 20px !important;margin:0 0 20px}.duet-card-footer{padding:20px;margin:20px -20px -20px;font-size:0.875rem;line-height:1.25;background:#f5f8fa;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.duet-theme-turva .duet-card-footer{background:#f5f5f7}@media (min-width: 36em){.duet-card-footer{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){.duet-card-footer{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 36em){.x-small .duet-card-footer{padding:15px 28px 16px !important;padding-left:20px !important;margin:20px -20px -20px}}@media (min-width: 36em){.medium .duet-card-footer{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){.medium .duet-card-footer{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 36em){.large .duet-card-footer{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 48em){.large .duet-card-footer{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 36em){.x-large .duet-card-footer{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 48em){.x-large .duet-card-footer{padding:39px 72px 40px !important;margin:48px -72px -72px}}.none .duet-card-footer{padding:12px 0 !important;margin:20px 0 0}.duet-card-content{width:100%}.duet-card-collapsed .duet-card-content{display:none}.duet-card-caret{transition:300ms ease}[aria-expanded=false] .duet-card-caret{transform:rotate(-180deg)}.duet-card-image-mask{position:relative;width:calc(100% + 40px);margin:-20px 0 20px -20px;overflow:hidden;border-top-left-radius:4px;border-top-right-radius:4px}@media (min-width: 36em){.small .duet-card-image-mask{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 36em){.medium .duet-card-image-mask{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 48em){.medium .duet-card-image-mask{width:calc(100% + 72px);margin:-36px 0 28px -36px}}@media (min-width: 36em){.large .duet-card-image-mask{width:calc(100% + 72px);margin:-36px 0 36px -36px}}@media (min-width: 48em){.large .duet-card-image-mask{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 36em){.x-large .duet-card-image-mask{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 48em){.x-large .duet-card-image-mask{width:calc(100% + 144px);margin:-72px 0 36px -72px}}.none .duet-card-image-mask{width:100%;margin:0 0 20px}.duet-card-image{display:block;width:102%;min-width:1px;max-width:102%;height:auto;min-height:1px;margin-left:-1%;transition:transform 300ms ease;transform:scale(1.0001)}a.duet-card{transition:box-shadow 300ms ease, background-position 300ms ease}a.duet-card:hover{box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07), 0 2px 10px 0 rgba(0, 41, 77, 0.1)}a.duet-card:hover .duet-card-image{transform:scale(1.024)}.duet-theme-turva a.duet-card:hover{box-shadow:0 2px 6px 0 rgba(117, 117, 117, 0.13), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07), 0 2px 10px 0 rgba(117, 117, 117, 0.15)}a.duet-card:active{transition:none;transform:translateY(1px)}";
|
|
2567
|
+
const duetCardCss = "*,*::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;margin-bottom:20px !important;display:flex;width:100%;vertical-align:top}:host(.duet-card-info){margin-bottom:16px !important}:host(.duet-m-0){margin:0 !important}.duet-card{padding:20px !important;position:relative;display:block;width:100%;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-style:normal;font-weight:400;line-height:1.5;color:#00294d;text-decoration:none;border-radius:4px;box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}.duet-card.duet-p-0{padding:0 !important}.duet-card.duet-m-0{margin:0 !important}.duet-card:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-card:focus,.duet-card:focus.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}@media (min-width: 36em){.duet-card{padding:28px !important}}.duet-card.duet-theme-turva{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;box-shadow:0 2px 6px 0 rgba(117, 117, 117, 0.13), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}@media (min-width: 36em){.duet-card.x-small{padding:20px !important}}@media (min-width: 36em){.duet-card.medium{padding:28px !important}}@media (min-width: 48em){.duet-card.medium{padding:36px !important}}@media (min-width: 36em){.duet-card.large{padding:36px !important}}@media (min-width: 48em){.duet-card.large{padding:48px !important}}@media (min-width: 36em){.duet-card.x-large{padding:48px !important}}@media (min-width: 48em){.duet-card.x-large{padding:72px !important}}.duet-card.duet-card-collapsed{padding-bottom:0 !important}@media (min-width: 36em){.duet-card.duet-card-collapsed{padding-bottom:0 !important}}.duet-card.info{background:rgba(0, 80, 128, 0.04) !important;box-shadow:none}.duet-card.info.duet-theme-turva{background:rgba(23, 28, 58, 0.035) !important}.duet-card.plain{box-shadow:none}.duet-card.plain:not(.duet-card-has-bg){background:transparent !important}.duet-card-heading-grid{display:flex;flex-direction:row}.duet-card-icon{align-self:center}.duet-card-heading-text{flex:1;word-break:break-word}.duet-card-secondary-heading{font-size:1rem;font-weight:600;word-break:break-word}.duet-card-secondary-heading--inline{display:block;flex:1;align-self:flex-start;line-height:1.875;text-align:right}@media (max-width: 22.5em){.duet-card-secondary-heading--inline{display:none}}.duet-card-secondary-heading--new-line{display:none}@media (max-width: 22.5em){.duet-card-secondary-heading--new-line{display:block}}.duet-card-heading{position:relative;display:block;padding:16px 20px;margin:-20px -20px 20px;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:1.25rem;font-weight:800;color:#00294d;border-bottom:1px solid #e1e3e6}@media (min-width: 36em){.duet-card-heading{padding:15px 28px 16px !important;margin:-28px -28px 20px}}.duet-card-heading[role=button]{-webkit-user-select:none;user-select:none;cursor:pointer;border-radius:4px;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;appearance:none}.duet-card-heading[role=button]:focus{outline:0}:host(.user-is-tabbing) .duet-card-heading[role=button]:focus{border-radius:4px;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-card-heading[role=button]:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-card-collapsed .duet-card-heading{margin-bottom:0 !important;border-bottom:0 !important}.duet-theme-turva .duet-card-heading{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:#e4e4e6}@media (min-width: 36em){.x-small .duet-card-heading{padding:10px 20px 11px !important;margin:-20px -20px 20px}}@media (min-width: 48em){.x-small .duet-card-heading{padding:10px 20px 11px !important;margin:-20px -20px 20px}}.medium .duet-card-heading{margin:-20px -20px 20px}@media (min-width: 36em){.medium .duet-card-heading{padding:15px 28px 16px !important;margin:-28px -28px 20px}}@media (min-width: 48em){.medium .duet-card-heading{padding:19px 36px 20px !important;margin:-36px -36px 28px}}.large .duet-card-heading{margin:-20px -20px 20px}@media (min-width: 36em){.large .duet-card-heading{padding:19px 36px 20px !important;margin:-36px -36px 28px}}@media (min-width: 48em){.large .duet-card-heading{padding:26px 48px 27px !important;margin:-48px -48px 36px}}.x-large .duet-card-heading{margin:-20px -20px 20px}@media (min-width: 36em){.x-large .duet-card-heading{padding:26px 48px 27px !important;margin:-48px -48px 36px}}@media (min-width: 48em){.x-large .duet-card-heading{padding:39px 72px 40px !important;margin:-72px -72px 48px}}.none .duet-card-heading{padding:0 0 20px !important;margin:0 0 20px}.duet-card-footer{padding:20px;margin:20px -20px -20px;font-size:0.875rem;line-height:1.25;background:#f5f8fa;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.duet-theme-turva .duet-card-footer{background:#f5f5f7}@media (min-width: 36em){.duet-card-footer{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){.duet-card-footer{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 36em){.x-small .duet-card-footer{padding:15px 28px 16px !important;padding-left:20px !important;margin:20px -20px -20px}}@media (min-width: 36em){.medium .duet-card-footer{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){.medium .duet-card-footer{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 36em){.large .duet-card-footer{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 48em){.large .duet-card-footer{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 36em){.x-large .duet-card-footer{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 48em){.x-large .duet-card-footer{padding:39px 72px 40px !important;margin:48px -72px -72px}}.none .duet-card-footer{padding:12px 0 !important;margin:20px 0 0}.duet-card-content{width:100%}.duet-card-collapsed .duet-card-content{display:none}.duet-card-caret{position:relative;top:6px;align-self:flex-start;transition:300ms ease}[aria-expanded=false] .duet-card-caret{transform:rotate(-180deg)}.duet-card-image-mask{position:relative;width:calc(100% + 40px);margin:-20px 0 20px -20px;overflow:hidden;border-top-left-radius:4px;border-top-right-radius:4px}@media (min-width: 36em){.small .duet-card-image-mask{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 36em){.medium .duet-card-image-mask{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 48em){.medium .duet-card-image-mask{width:calc(100% + 72px);margin:-36px 0 28px -36px}}@media (min-width: 36em){.large .duet-card-image-mask{width:calc(100% + 72px);margin:-36px 0 36px -36px}}@media (min-width: 48em){.large .duet-card-image-mask{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 36em){.x-large .duet-card-image-mask{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 48em){.x-large .duet-card-image-mask{width:calc(100% + 144px);margin:-72px 0 36px -72px}}.none .duet-card-image-mask{width:100%;margin:0 0 20px}.duet-card-image{display:block;width:102%;min-width:1px;max-width:102%;height:auto;min-height:1px;margin-left:-1%;transition:transform 300ms ease;transform:scale(1.0001)}a.duet-card{transition:box-shadow 300ms ease, background-position 300ms ease}a.duet-card:hover{box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07), 0 2px 10px 0 rgba(0, 41, 77, 0.1)}a.duet-card:hover .duet-card-image{transform:scale(1.024)}.duet-theme-turva a.duet-card:hover{box-shadow:0 2px 6px 0 rgba(117, 117, 117, 0.13), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07), 0 2px 10px 0 rgba(117, 117, 117, 0.15)}a.duet-card:active{transition:none;transform:translateY(1px)}";
|
|
2528
2568
|
|
|
2529
|
-
let DuetCard$1 = class extends
|
|
2569
|
+
let DuetCard$1 = class extends H {
|
|
2530
2570
|
constructor() {
|
|
2531
2571
|
super();
|
|
2532
2572
|
this.__registerHost();
|
|
2533
|
-
|
|
2573
|
+
this.__attachShadow();
|
|
2534
2574
|
this.duetToggle = createEvent$2(this, "duetToggle", 7);
|
|
2535
2575
|
this.cardId = createID("DuetCard");
|
|
2536
2576
|
/**
|
|
@@ -2607,7 +2647,7 @@ let DuetCard$1 = class extends HTMLElement {
|
|
|
2607
2647
|
this.hasFooter = !!this.element.querySelector("[slot='footer']");
|
|
2608
2648
|
}
|
|
2609
2649
|
renderHeading() {
|
|
2610
|
-
const HeadingTag = sanitizeString(this.headingLevel);
|
|
2650
|
+
const HeadingTag = sanitizeString$1(this.headingLevel);
|
|
2611
2651
|
const headingProps = this.collapsible
|
|
2612
2652
|
? {
|
|
2613
2653
|
role: "button",
|
|
@@ -2618,7 +2658,7 @@ let DuetCard$1 = class extends HTMLElement {
|
|
|
2618
2658
|
onKeyDown: this.handleKeyDown,
|
|
2619
2659
|
}
|
|
2620
2660
|
: {};
|
|
2621
|
-
return (h$1(HeadingTag, Object.assign({ class: "duet-card-heading" }, headingProps), h$1("div", { class: "duet-card-heading-grid" }, this.icon && (h$1(Fragment, null, h$1("duet-icon", { class: "duet-card-icon", name: this.icon, size: "medium", margin: "none", color: "currentColor" }), h$1("duet-spacer", { direction: "horizontal", size: "small" }))), h$1("div", { class: "
|
|
2661
|
+
return (h$1(HeadingTag, Object.assign({ class: "duet-card-heading" }, headingProps), h$1("div", { class: "duet-card-heading-grid" }, this.icon && (h$1(Fragment, null, h$1("duet-icon", { class: "duet-card-icon", name: this.icon, size: "medium", margin: "none", color: "currentColor" }), h$1("duet-spacer", { direction: "horizontal", size: "small" }))), h$1("div", { class: "duet-card-heading-text" }, this.heading), this.secondaryHeading && (h$1(Fragment, null, h$1("duet-spacer", { direction: "horizontal", size: "small" }), h$1("div", { class: "duet-card-secondary-heading duet-card-secondary-heading--inline" }, this.secondaryHeading))), this.collapsible && (h$1(Fragment, null, h$1("duet-spacer", { direction: "horizontal", size: "small" }), h$1("duet-icon", { class: "duet-card-caret", icon: actionArrowUp.svg, size: "small", margin: "none", color: "currentColor" })))), this.secondaryHeading && (h$1("div", { class: "duet-card-secondary-heading duet-card-secondary-heading--new-line" }, this.secondaryHeading))));
|
|
2622
2662
|
}
|
|
2623
2663
|
/**
|
|
2624
2664
|
* Sets focus on the specified `duet-card`. Use this method instead of the global
|
|
@@ -2656,9 +2696,9 @@ let DuetCard$1 = class extends HTMLElement {
|
|
|
2656
2696
|
static get style() { return duetCardCss; }
|
|
2657
2697
|
};
|
|
2658
2698
|
|
|
2659
|
-
const duetCheckboxCss = "*.sc-duet-checkbox,*.sc-duet-checkbox::after,*.sc-duet-checkbox::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-checkbox-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:8px !important;margin-bottom:12px !important;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-checkbox-h:last-child,.sc-duet-checkbox-h:last-of-type{margin-right:0 !important}.sc-duet-checkbox-h:last-
|
|
2699
|
+
const duetCheckboxCss = "*.sc-duet-checkbox,*.sc-duet-checkbox::after,*.sc-duet-checkbox::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-checkbox-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:8px !important;margin-bottom:12px !important;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-checkbox-h:last-child,.sc-duet-checkbox-h:last-of-type{margin-right:0 !important}.sc-duet-checkbox-h:last-child:not(:only-child){margin-bottom:0 !important}.duet-m-0.sc-duet-checkbox-h{margin:0 !important}.duet-label.sc-duet-checkbox{position:relative;z-index:100;display:inline;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.5;color:#00294d;vertical-align:top;cursor:pointer;background:transparent;transition:300ms ease}.duet-theme-turva.sc-duet-checkbox .duet-label.sc-duet-checkbox{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}.duet-label.sc-duet-checkbox span.sc-duet-checkbox{display:inline-block;width:calc(100% - 32px);font-size:1rem;font-weight:400;vertical-align:top}.duet-checkbox-container.sc-duet-checkbox{position:relative;width:100%;height:100%}.duet-checkbox.sc-duet-checkbox{padding:14px !important;position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;cursor:pointer;opacity:0}.duet-checkbox.sc-duet-checkbox+label.sc-duet-checkbox::before{z-index:100;display:inline-block;width:20px;height:20px;margin:2px 10px 1px 1px;vertical-align:top;content:\"\";background:white;border:1px solid #00294d;border-radius:4px}.duet-theme-turva.sc-duet-checkbox .duet-checkbox.sc-duet-checkbox+label.sc-duet-checkbox::before{border-color:#171c3a}.duet-checkbox.sc-duet-checkbox:checked+label.sc-duet-checkbox::before{background:#00294d;border:1px solid #00294d}.duet-theme-turva.sc-duet-checkbox .duet-checkbox.sc-duet-checkbox:checked+label.sc-duet-checkbox::before{background:#171c3a;border-color:#171c3a}.duet-checkbox.sc-duet-checkbox:focus+label.sc-duet-checkbox::before{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva.sc-duet-checkbox .duet-checkbox.sc-duet-checkbox:focus+label.sc-duet-checkbox::before{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-checkbox.sc-duet-checkbox+label.sc-duet-checkbox{position:static}.duet-checkbox.sc-duet-checkbox:checked+label.sc-duet-checkbox::after{position:absolute;top:6px;left:5px;z-index:200;width:12px;height:12px;pointer-events:none;content:\"\";background:transparent url(\"data:image/svg+xml,%3Csvg%20fill%3D%27white%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20d%3D%27M23.374.287a1.5%2C1.5%2C0%2C0%2C0-2.093.345L7.246%2C20.2%2C2.561%2C15.511A1.5%2C1.5%2C0%2C1%2C0%2C.439%2C17.632l5.935%2C5.934a1.525%2C1.525%2C0%2C0%2C0%2C2.279-.186l15.066-21A1.5%2C1.5%2C0%2C0%2C0%2C23.374.287Z%27%20%2F%3E%3C%2Fsvg%3E\") no-repeat 0 0;background-size:100% auto}.duet-checkbox[disabled].sc-duet-checkbox{cursor:default}.duet-checkbox[disabled].sc-duet-checkbox+label.sc-duet-checkbox{color:#657787}.duet-theme-turva.sc-duet-checkbox .duet-checkbox[disabled].sc-duet-checkbox+label.sc-duet-checkbox{color:#747475}.duet-checkbox[disabled].sc-duet-checkbox+label.sc-duet-checkbox::before{border-color:#cfd2d4}.duet-theme-turva.sc-duet-checkbox .duet-checkbox[disabled].sc-duet-checkbox+label.sc-duet-checkbox::before{border-color:#cfcfd1}.duet-checkbox[disabled].sc-duet-checkbox:checked+label.sc-duet-checkbox::before{background:#657787;border:1px solid #657787}.duet-theme-turva.sc-duet-checkbox .duet-checkbox[disabled].sc-duet-checkbox:checked+label.sc-duet-checkbox::before{background:#747475;border-color:#747475}.duet-label-hidden.sc-duet-checkbox .duet-label.sc-duet-checkbox span.sc-duet-checkbox{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
2660
2700
|
|
|
2661
|
-
let DuetCheckbox$1 = class extends
|
|
2701
|
+
let DuetCheckbox$1 = class extends H {
|
|
2662
2702
|
constructor() {
|
|
2663
2703
|
super();
|
|
2664
2704
|
this.__registerHost();
|
|
@@ -2764,18 +2804,165 @@ let DuetCheckbox$1 = class extends HTMLElement {
|
|
|
2764
2804
|
|
|
2765
2805
|
var messagingInfo={"title":"messaging-info","tags":"messaging info information circle","svg":"<svg fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\"><path d=\"M13.5 17.25A2.252 2.252 0 0 1 11.25 15v-3.75h-.75a.75.75 0 0 1 0-1.5h.75c.827 0 1.5.673 1.5 1.5V15c0 .414.336.75.75.75h.75a.75.75 0 0 1 0 1.5z\"/><circle cx=\"11.625\" cy=\"7.125\" r=\"1.125\"/><path d=\"M12 24C5.383 24 0 18.617 0 12S5.383 0 12 0s12 5.383 12 12-5.383 12-12 12zm0-22.5C6.21 1.5 1.5 6.21 1.5 12S6.21 22.5 12 22.5 22.5 17.79 22.5 12 17.79 1.5 12 1.5z\"/></svg>"};
|
|
2766
2806
|
|
|
2767
|
-
const duetChoiceCss = "*.sc-duet-choice,*.sc-duet-choice::after,*.sc-duet-choice::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-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;flex-direction:column;width:auto;max-width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-choice-h:last-child,.sc-duet-choice-h:last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){.sc-duet-choice-h{width:100%}}.duet-expand.sc-duet-choice-h{width:100% !important}.duet-m-0.sc-duet-choice-h{margin:0 !important}.duet-fixed.sc-duet-choice-h{width:auto !important}.vertical.sc-duet-choice-h{margin-right:0 !important}.horizontal.sc-duet-choice-h{margin-bottom:0 !important}@media (min-width: 48em){.horizontal-responsive.sc-duet-choice-h{margin-bottom:0 !important;margin-right:16px !important}.horizontal-responsive.sc-duet-choice-h:last-child,.horizontal-responsive.sc-duet-choice-h:last-of-type{margin-right:0 !important}}.sc-duet-choice-h:last-child:not(:only-child){margin-right:0 !important}.duet-choice-card.sc-duet-choice{position:relative;display:block;width:100%;min-width:8rem;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;-webkit-hyphens:auto;hyphens:auto;line-height:1.1;color:#00294d !important;text-align:left;background:white;border-width:2px}.duet-choice-card.duet-p-0.sc-duet-choice{padding:0 !important}.duet-choice-card.duet-m-0.sc-duet-choice{margin:0 !important}.duet-theme-turva.sc-duet-choice .duet-choice-card.sc-duet-choice{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 !important}.duet-choice-card-flextainer.sc-duet-choice{display:flex}.duet-choice-label.sc-duet-choice{-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:block;width:100%;padding:20px 48px 20px 16px;font-size:1rem;font-weight:600;text-decoration:none;cursor:pointer;border:2px solid #e1e3e6;border-radius:4px;transition:background-color 150ms ease}.has-info.sc-duet-choice .duet-choice-label.sc-duet-choice{padding-right:110px;border-top-right-radius:0;border-bottom-right-radius:0}.info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom-right-radius:0;border-bottom-left-radius:0}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#909599}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#909599}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#747475}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-choice-label.sc-duet-choice:active{opacity:0.75;transition:none !important}.has-icon.sc-duet-choice .duet-choice-label.sc-duet-choice{padding-left:48px}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#0077b3 !important;background:#f3f9fc;border-color:#0077b3 !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#0077b3}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#171c3a !important;background:#f5f5f7;border-color:#171c3a !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#c60c30}.checked.collapsible.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom:0 !important;border-bottom-right-radius:0;border-bottom-left-radius:0}input.sc-duet-choice:focus{outline:0}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3)}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2)}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#e1e3e6 !important}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#657787 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#747475 !important;background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#747475 !important}.checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e1e3e6 !important;border-color:#e1e3e6 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-checkmark-container.sc-duet-choice{position:absolute;top:17.7777777778px;right:16px;width:20px;height:20px;border:1px solid #909599;border-radius:4px;transition:border 300ms ease}.duet-theme-turva.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#747475}.checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#0077b3;border-color:#0077b3;transition:none}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#171c3a;border-color:#171c3a !important}.duet-checkmark-container.duet-checkmark-radio.sc-duet-choice{border-radius:50%}[disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfcfd1 !important}.checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfcfd1 !important}.duet-checkmark.sc-duet-choice{position:absolute;top:10px;left:3px;width:5.3333333333px;height:11.8518518519px;border-top:2px solid white;border-right:2px solid white;opacity:1;transform:scaleX(-1) rotate(135deg) translateZ(0);transform-origin:left top;animation-name:duet-checkmark;animation-duration:600ms;animation-timing-function:ease-out;animation-fill-mode:forwards}@keyframes duet-checkmark{0%{width:0;height:0;opacity:1}20%{width:5.3333333333px;height:0;opacity:1}40%,100%{width:5.3333333333px;height:11.8518518519px;opacity:1}}.duet-choice-card-icon.sc-duet-choice{position:absolute;top:50%;left:16px;transform:translateY(-50%)}.duet-choice-card-icon.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-card-info.sc-duet-choice,.duet-choice-card-collapsible.sc-duet-choice{padding:28px !important;position:relative;z-index:200;display:none;width:100%;font-weight:400;color:#00294d;border:2px solid #e1e3e6;border-top:0;border-radius:0 0 4px 4px}.duet-theme-turva.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.duet-theme-turva.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{color:#171c3a;border-color:#171c3a}.checked.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.checked.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{display:block}.duet-choice-card-info-expanded.sc-duet-choice,.duet-choice-card-collapsible-expanded.sc-duet-choice{display:block}.duet-choice-card-collapsible.sc-duet-choice{background:white;border:2px solid #0077b3;border-top:0}.duet-choice-card-collapsible.duet-theme-turva.sc-duet-choice{background:white;border-color:#171c3a}.duet-choice-card-collapsible-disabled.sc-duet-choice{background:#f5f8fa;border-color:#e1e3e6}.duet-choice-card-collapsible-disabled.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-card-info.sc-duet-choice{font-size:0.875rem;line-height:1.5;background:#f5f8fa;transition:150ms ease-out}.duet-choice-card-info.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-info-toggle.sc-duet-choice{display:flex;flex-shrink:0;justify-content:center;width:57.6px;padding-top:18px;cursor:pointer;background:white;border:2px solid #e1e3e6;border-left:0 none;border-top-right-radius:4px;border-bottom-right-radius:4px;-webkit-appearance:none;appearance:none}.duet-choice-info-toggle[aria-expanded=true].sc-duet-choice{background:#f5f8fa;border-bottom:0;border-bottom-right-radius:0}.duet-choice-info-toggle[disabled].sc-duet-choice{pointer-events:none;background:#f5f8fa !important;border-color:#e1e3e6 !important}.duet-choice-info-toggle[disabled].sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#909599 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice{background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#747475 !important}.duet-choice-info-toggle.sc-duet-choice:focus{outline:none}.user-is-tabbing.sc-duet-choice-h .duet-choice-info-toggle.sc-duet-choice:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-choice-info-toggle.sc-duet-choice{border-left-color:#909599}.checked.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice{border-left-color:#0077b3 !important}.duet-choice-info-toggle.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#0077b3}.duet-theme-turva.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#c60c30}.duet-choice-input.sc-duet-choice{position:absolute !important;width:100%;height:100%;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);color:transparent}";
|
|
2807
|
+
const isComplexType = (o) => {
|
|
2808
|
+
// https://jsperf.com/typeof-fn-object/5
|
|
2809
|
+
o = typeof o;
|
|
2810
|
+
return o === 'object' || o === 'function';
|
|
2811
|
+
};
|
|
2812
|
+
/**
|
|
2813
|
+
* Production h() function based on Preact by
|
|
2814
|
+
* Jason Miller (@developit)
|
|
2815
|
+
* Licensed under the MIT License
|
|
2816
|
+
* https://github.com/developit/preact/blob/master/LICENSE
|
|
2817
|
+
*
|
|
2818
|
+
* Modified for Stencil's compiler and vdom
|
|
2819
|
+
*/
|
|
2820
|
+
// const stack: any[] = [];
|
|
2821
|
+
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
2822
|
+
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
2823
|
+
const h = (nodeName, vnodeData, ...children) => {
|
|
2824
|
+
let child = null;
|
|
2825
|
+
let key = null;
|
|
2826
|
+
let slotName = null;
|
|
2827
|
+
let simple = false;
|
|
2828
|
+
let lastSimple = false;
|
|
2829
|
+
let vNodeChildren = [];
|
|
2830
|
+
const walk = (c) => {
|
|
2831
|
+
for (let i = 0; i < c.length; i++) {
|
|
2832
|
+
child = c[i];
|
|
2833
|
+
if (Array.isArray(child)) {
|
|
2834
|
+
walk(child);
|
|
2835
|
+
}
|
|
2836
|
+
else if (child != null && typeof child !== 'boolean') {
|
|
2837
|
+
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
2838
|
+
child = String(child);
|
|
2839
|
+
}
|
|
2840
|
+
if (simple && lastSimple) {
|
|
2841
|
+
// If the previous child was simple (string), we merge both
|
|
2842
|
+
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
2843
|
+
}
|
|
2844
|
+
else {
|
|
2845
|
+
// Append a new vNode, if it's text, we create a text vNode
|
|
2846
|
+
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
2847
|
+
}
|
|
2848
|
+
lastSimple = simple;
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
};
|
|
2852
|
+
walk(children);
|
|
2853
|
+
if (vnodeData) {
|
|
2854
|
+
// normalize class / classname attributes
|
|
2855
|
+
if (vnodeData.key) {
|
|
2856
|
+
key = vnodeData.key;
|
|
2857
|
+
}
|
|
2858
|
+
if (vnodeData.name) {
|
|
2859
|
+
slotName = vnodeData.name;
|
|
2860
|
+
}
|
|
2861
|
+
{
|
|
2862
|
+
const classData = vnodeData.className || vnodeData.class;
|
|
2863
|
+
if (classData) {
|
|
2864
|
+
vnodeData.class =
|
|
2865
|
+
typeof classData !== 'object'
|
|
2866
|
+
? classData
|
|
2867
|
+
: Object.keys(classData)
|
|
2868
|
+
.filter((k) => classData[k])
|
|
2869
|
+
.join(' ');
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
if (typeof nodeName === 'function') {
|
|
2874
|
+
// nodeName is a functional component
|
|
2875
|
+
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
2876
|
+
}
|
|
2877
|
+
const vnode = newVNode(nodeName, null);
|
|
2878
|
+
vnode.$attrs$ = vnodeData;
|
|
2879
|
+
if (vNodeChildren.length > 0) {
|
|
2880
|
+
vnode.$children$ = vNodeChildren;
|
|
2881
|
+
}
|
|
2882
|
+
{
|
|
2883
|
+
vnode.$key$ = key;
|
|
2884
|
+
}
|
|
2885
|
+
{
|
|
2886
|
+
vnode.$name$ = slotName;
|
|
2887
|
+
}
|
|
2888
|
+
return vnode;
|
|
2889
|
+
};
|
|
2890
|
+
const newVNode = (tag, text) => {
|
|
2891
|
+
const vnode = {
|
|
2892
|
+
$flags$: 0,
|
|
2893
|
+
$tag$: tag,
|
|
2894
|
+
$text$: text,
|
|
2895
|
+
$elm$: null,
|
|
2896
|
+
$children$: null,
|
|
2897
|
+
};
|
|
2898
|
+
{
|
|
2899
|
+
vnode.$attrs$ = null;
|
|
2900
|
+
}
|
|
2901
|
+
{
|
|
2902
|
+
vnode.$key$ = null;
|
|
2903
|
+
}
|
|
2904
|
+
{
|
|
2905
|
+
vnode.$name$ = null;
|
|
2906
|
+
}
|
|
2907
|
+
return vnode;
|
|
2908
|
+
};
|
|
2909
|
+
const vdomFnUtils = {
|
|
2910
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
2911
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
2912
|
+
};
|
|
2913
|
+
const convertToPublic = (node) => ({
|
|
2914
|
+
vattrs: node.$attrs$,
|
|
2915
|
+
vchildren: node.$children$,
|
|
2916
|
+
vkey: node.$key$,
|
|
2917
|
+
vname: node.$name$,
|
|
2918
|
+
vtag: node.$tag$,
|
|
2919
|
+
vtext: node.$text$,
|
|
2920
|
+
});
|
|
2921
|
+
const convertToPrivate = (node) => {
|
|
2922
|
+
if (typeof node.vtag === 'function') {
|
|
2923
|
+
const vnodeData = Object.assign({}, node.vattrs);
|
|
2924
|
+
if (node.vkey) {
|
|
2925
|
+
vnodeData.key = node.vkey;
|
|
2926
|
+
}
|
|
2927
|
+
if (node.vname) {
|
|
2928
|
+
vnodeData.name = node.vname;
|
|
2929
|
+
}
|
|
2930
|
+
return h(node.vtag, vnodeData, ...(node.vchildren || []));
|
|
2931
|
+
}
|
|
2932
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
2933
|
+
vnode.$attrs$ = node.vattrs;
|
|
2934
|
+
vnode.$children$ = node.vchildren;
|
|
2935
|
+
vnode.$key$ = node.vkey;
|
|
2936
|
+
vnode.$name$ = node.vname;
|
|
2937
|
+
return vnode;
|
|
2938
|
+
};
|
|
2939
|
+
|
|
2940
|
+
const focusElement = (element) => {
|
|
2941
|
+
if ("setFocus" in element) {
|
|
2942
|
+
element.setFocus();
|
|
2943
|
+
}
|
|
2944
|
+
else {
|
|
2945
|
+
element.focus();
|
|
2946
|
+
}
|
|
2947
|
+
};
|
|
2948
|
+
const FocusGuard = ({ moveFocusTo }) => {
|
|
2949
|
+
return h("div", { class: "duet-focus-guard", "aria-hidden": "true", tabIndex: 0, onFocus: () => focusElement(moveFocusTo) });
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
const duetChoiceCss = "*.sc-duet-choice,*.sc-duet-choice::after,*.sc-duet-choice::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-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;flex-direction:column;width:auto;max-width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-choice-h:last-child,.sc-duet-choice-h:last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){.sc-duet-choice-h{width:100%}}.duet-expand.sc-duet-choice-h{width:100% !important}.duet-m-0.sc-duet-choice-h{margin:0 !important}.duet-fixed.sc-duet-choice-h{width:auto !important}.vertical.sc-duet-choice-h{margin-right:0 !important}.horizontal.sc-duet-choice-h{margin-bottom:0 !important}@media (min-width: 48em){.horizontal-responsive.sc-duet-choice-h{margin-bottom:0 !important;margin-right:16px !important}.horizontal-responsive.sc-duet-choice-h:last-child,.horizontal-responsive.sc-duet-choice-h:last-of-type{margin-right:0 !important}}.sc-duet-choice-h:last-child:not(:only-child){margin-right:0 !important}.duet-choice-card.sc-duet-choice{position:relative;display:block;width:100%;min-width:8rem;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;-webkit-hyphens:auto;hyphens:auto;line-height:1.1;color:#00294d !important;text-align:left;background:white;border-width:2px}.duet-choice-card.duet-p-0.sc-duet-choice{padding:0 !important}.duet-choice-card.duet-m-0.sc-duet-choice{margin:0 !important}.duet-theme-turva.sc-duet-choice .duet-choice-card.sc-duet-choice{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 !important}.duet-choice-card-flextainer.sc-duet-choice{display:flex}.duet-choice-label.sc-duet-choice{-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:block;width:100%;padding:20px 48px 20px 16px;font-size:1rem;font-weight:600;text-decoration:none;cursor:pointer;border:2px solid #e1e3e6;border-radius:4px;transition:background-color 150ms ease}.has-info.sc-duet-choice .duet-choice-label.sc-duet-choice{padding-right:110px;border-top-right-radius:0;border-bottom-right-radius:0}.info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom-right-radius:0;border-bottom-left-radius:0}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#909599}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#909599}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#747475}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-choice-label.sc-duet-choice:active{opacity:0.75;transition:none !important}.has-icon.sc-duet-choice .duet-choice-label.sc-duet-choice{padding-left:48px}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#0077b3 !important;background:#f3f9fc;border-color:#0077b3 !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#0077b3}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#171c3a !important;background:#f5f5f7;border-color:#171c3a !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#c60c30}.checked.collapsible.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom:0 !important;border-bottom-right-radius:0;border-bottom-left-radius:0}input.sc-duet-choice:focus{outline:0}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3)}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2)}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#e1e3e6 !important}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#657787 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#747475 !important;background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#747475 !important}.checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e1e3e6 !important;border-color:#e1e3e6 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-checkmark-container.sc-duet-choice{position:absolute;top:17.7777777778px;right:16px;width:20px;height:20px;border:1px solid #909599;border-radius:4px;transition:border 300ms ease}.duet-theme-turva.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#747475}.checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#0077b3;border-color:#0077b3;transition:none}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#171c3a;border-color:#171c3a !important}.duet-checkmark-container.duet-checkmark-radio.sc-duet-choice{border-radius:50%}[disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfcfd1 !important}.checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfcfd1 !important}.duet-checkmark.sc-duet-choice{position:absolute;top:10px;left:3px;width:5.3333333333px;height:11.8518518519px;border-top:2px solid white;border-right:2px solid white;opacity:1;transform:scaleX(-1) rotate(135deg) translateZ(0);transform-origin:left top;animation-name:duet-checkmark;animation-duration:600ms;animation-timing-function:ease-out;animation-fill-mode:forwards}@keyframes duet-checkmark{0%{width:0;height:0;opacity:1}20%{width:5.3333333333px;height:0;opacity:1}40%,100%{width:5.3333333333px;height:11.8518518519px;opacity:1}}.duet-choice-card-icon.sc-duet-choice{position:absolute;top:50%;left:16px;transform:translateY(-50%)}.duet-choice-card-icon.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-section-hidden.sc-duet-choice{display:none}.duet-choice-card-info.duet-choice-card-collapsed.sc-duet-choice,.duet-choice-card-collapsed.duet-choice-card-collapsible.sc-duet-choice{position:relative;width:auto;padding:0 !important;background:unset !important;border:0;border-radius:0}.duet-choice-card-info.sc-duet-choice,.duet-choice-card-collapsible.sc-duet-choice{padding:28px !important;position:relative;z-index:200;width:100%;font-weight:400;color:#00294d;border:2px solid #e1e3e6;border-top:0;border-radius:0 0 4px 4px}.duet-theme-turva.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.duet-theme-turva.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{color:#171c3a;border-color:#171c3a}.checked.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.checked.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{display:block}.duet-choice-card-info-expanded.sc-duet-choice,.duet-choice-card-collapsible-expanded.sc-duet-choice{display:block}.duet-choice-card-collapsible.sc-duet-choice{background:white;border:2px solid #0077b3;border-top:0}.duet-choice-card-collapsible.duet-theme-turva.sc-duet-choice{background:white;border-color:#171c3a}.duet-choice-card-collapsible-disabled.sc-duet-choice{background:#f5f8fa;border-color:#e1e3e6}.duet-choice-card-collapsible-disabled.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-card-info.sc-duet-choice{font-size:0.875rem;line-height:1.5;background:#f5f8fa;transition:150ms ease-out}.duet-choice-card-info.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-info-toggle.sc-duet-choice{display:flex;flex-shrink:0;justify-content:center;width:57.6px;padding-top:18px;cursor:pointer;background:white;border:2px solid #e1e3e6;border-left:0 none;border-top-right-radius:4px;border-bottom-right-radius:4px;-webkit-appearance:none;appearance:none}.duet-choice-info-toggle[aria-expanded=true].sc-duet-choice{background:#f5f8fa;border-bottom:0;border-bottom-right-radius:0}.duet-choice-info-toggle[disabled].sc-duet-choice{pointer-events:none;background:#f5f8fa !important;border-color:#e1e3e6 !important}.duet-choice-info-toggle[disabled].sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#909599 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice{background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#747475 !important}.duet-choice-info-toggle.sc-duet-choice:focus{outline:none}.user-is-tabbing.sc-duet-choice-h .duet-choice-info-toggle.sc-duet-choice:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-choice-info-toggle.sc-duet-choice{border-left-color:#909599}.checked.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice{border-left-color:#0077b3 !important}.duet-choice-info-toggle.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#0077b3}.duet-theme-turva.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#c60c30}.duet-choice-input.sc-duet-choice{position:absolute !important;width:auto;height:auto;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);color:transparent}";
|
|
2768
2953
|
|
|
2769
|
-
let DuetChoice$1 = class extends
|
|
2954
|
+
let DuetChoice$1 = class extends H {
|
|
2770
2955
|
constructor() {
|
|
2771
2956
|
super();
|
|
2772
2957
|
this.__registerHost();
|
|
2773
2958
|
this.duetChange = createEvent$2(this, "duetChange", 7);
|
|
2774
2959
|
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
2775
2960
|
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
2961
|
+
this.hasHeader = false;
|
|
2776
2962
|
this.choiceId = createID("DuetChoice");
|
|
2777
|
-
this.
|
|
2778
|
-
this.
|
|
2963
|
+
this.expandId = createID("DuetChoiceExpand");
|
|
2964
|
+
this.headerId = createID("DuetChoiceHeader");
|
|
2965
|
+
this.infoButtonId = createID("DuetChoiceInfoButton");
|
|
2779
2966
|
/**
|
|
2780
2967
|
* State() variables
|
|
2781
2968
|
* Inlined decorator, alphabetical order.
|
|
@@ -2853,6 +3040,24 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2853
3040
|
* browser from displaying its own validation errors.
|
|
2854
3041
|
*/
|
|
2855
3042
|
this.required = false;
|
|
3043
|
+
/**
|
|
3044
|
+
* Placeholder defaults
|
|
3045
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
3046
|
+
*/
|
|
3047
|
+
this.infoLabelDefaults = {
|
|
3048
|
+
fi: "Lisätietoja",
|
|
3049
|
+
en: "More information about",
|
|
3050
|
+
sv: "Mera information om",
|
|
3051
|
+
};
|
|
3052
|
+
/**
|
|
3053
|
+
* Hint text to display before the user types into the date picker input.
|
|
3054
|
+
* @default {
|
|
3055
|
+
* fi: "Lisätietoja",
|
|
3056
|
+
* en: "More information about",
|
|
3057
|
+
* sv: "Mera information om",
|
|
3058
|
+
* }
|
|
3059
|
+
*/
|
|
3060
|
+
this.infoLabel = getLocaleString(this.infoLabelDefaults, getLanguage());
|
|
2856
3061
|
this.onMouseEnter = () => {
|
|
2857
3062
|
this.isHovering = true;
|
|
2858
3063
|
};
|
|
@@ -2860,7 +3065,6 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2860
3065
|
this.isHovering = false;
|
|
2861
3066
|
};
|
|
2862
3067
|
this.onClick = (ev) => {
|
|
2863
|
-
this.setFocus();
|
|
2864
3068
|
this.toggleChecked(ev);
|
|
2865
3069
|
};
|
|
2866
3070
|
this.handleKeyDown = (ev) => {
|
|
@@ -2868,7 +3072,7 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2868
3072
|
this.toggleChecked(ev);
|
|
2869
3073
|
}
|
|
2870
3074
|
if (isQuestionKey(ev) && this.hasInfo) {
|
|
2871
|
-
this.toggleInfo(
|
|
3075
|
+
this.toggleInfo();
|
|
2872
3076
|
}
|
|
2873
3077
|
};
|
|
2874
3078
|
this.onChange = () => {
|
|
@@ -2902,8 +3106,6 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2902
3106
|
if (this.disabled || this.groupDisabled) {
|
|
2903
3107
|
return;
|
|
2904
3108
|
}
|
|
2905
|
-
ev.stopPropagation();
|
|
2906
|
-
ev.preventDefault();
|
|
2907
3109
|
this.isInfoOpen = false;
|
|
2908
3110
|
// if it's a radio button and it's already checked
|
|
2909
3111
|
// we shouldn't fire an event, so exit early
|
|
@@ -2917,10 +3119,10 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2917
3119
|
value: this.value,
|
|
2918
3120
|
component: "duet-choice",
|
|
2919
3121
|
});
|
|
2920
|
-
};
|
|
2921
|
-
this.toggleInfo = ev => {
|
|
2922
|
-
ev.stopPropagation();
|
|
2923
3122
|
ev.preventDefault();
|
|
3123
|
+
ev.stopPropagation();
|
|
3124
|
+
};
|
|
3125
|
+
this.toggleInfo = () => {
|
|
2924
3126
|
this.isInfoOpen = !this.isInfoOpen;
|
|
2925
3127
|
};
|
|
2926
3128
|
}
|
|
@@ -2930,6 +3132,7 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2930
3132
|
componentWillLoad() {
|
|
2931
3133
|
inheritGlobalTheme(this);
|
|
2932
3134
|
this.hasInfo = !!this.element.querySelector("[slot='info']");
|
|
3135
|
+
this.hasHeader = !!this.element.querySelector('[slot="header"]');
|
|
2933
3136
|
this.hasAdditional = !!this.element.querySelector("[slot='additional']");
|
|
2934
3137
|
}
|
|
2935
3138
|
/**
|
|
@@ -2943,15 +3146,18 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2943
3146
|
// @ts-ignore
|
|
2944
3147
|
const isTargetContainedInHost = this.element.contains(ev === null || ev === void 0 ? void 0 : ev.relatedTarget) || false;
|
|
2945
3148
|
if (!isTargetContainedInHost) {
|
|
2946
|
-
this.toggleInfo(
|
|
3149
|
+
this.toggleInfo();
|
|
2947
3150
|
}
|
|
2948
3151
|
}
|
|
2949
3152
|
}
|
|
2950
3153
|
handleHostKeyDown() {
|
|
2951
3154
|
this.isKeyDown = true;
|
|
2952
3155
|
}
|
|
2953
|
-
handleHostKeyUp() {
|
|
3156
|
+
handleHostKeyUp(ev) {
|
|
2954
3157
|
this.isKeyDown = false;
|
|
3158
|
+
if (isEscapeKey(ev) && this.isInfoOpen) {
|
|
3159
|
+
this.toggleInfo();
|
|
3160
|
+
}
|
|
2955
3161
|
}
|
|
2956
3162
|
/**
|
|
2957
3163
|
* Sets focus on the specified `duet-choice`. Use this method instead of the global
|
|
@@ -2964,11 +3170,13 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2964
3170
|
if (this.accessibleDescribedBy) {
|
|
2965
3171
|
return this.accessibleDescribedBy;
|
|
2966
3172
|
}
|
|
2967
|
-
if (this.collapsible) {
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
3173
|
+
if (this.collapsible || this.hasInfo) {
|
|
3174
|
+
if (this.hasHeader) {
|
|
3175
|
+
return this.headerId;
|
|
3176
|
+
}
|
|
3177
|
+
else {
|
|
3178
|
+
return this.expandId;
|
|
3179
|
+
}
|
|
2972
3180
|
}
|
|
2973
3181
|
return null;
|
|
2974
3182
|
}
|
|
@@ -2977,6 +3185,7 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2977
3185
|
return {
|
|
2978
3186
|
"duet-choice-card-info": true,
|
|
2979
3187
|
"duet-choice-card-info-expanded": this.isInfoOpen,
|
|
3188
|
+
"duet-choice-card-collapsed": !this.isInfoOpen,
|
|
2980
3189
|
"duet-theme-turva": this.theme === "turva",
|
|
2981
3190
|
};
|
|
2982
3191
|
}
|
|
@@ -2984,6 +3193,7 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2984
3193
|
return {
|
|
2985
3194
|
"duet-choice-card-collapsible": true,
|
|
2986
3195
|
"duet-choice-card-collapsible-expanded": this.checked,
|
|
3196
|
+
"duet-choice-card-collapsed": !this.checked,
|
|
2987
3197
|
"duet-choice-card-collapsible-disabled": this.disabled || this.groupDisabled ? true : false,
|
|
2988
3198
|
"duet-theme-turva": this.theme === "turva",
|
|
2989
3199
|
};
|
|
@@ -2998,6 +3208,7 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
2998
3208
|
*/
|
|
2999
3209
|
render() {
|
|
3000
3210
|
const identifier = this.identifier || this.choiceId;
|
|
3211
|
+
console.log(this.element);
|
|
3001
3212
|
return (h$1(Host, { class: {
|
|
3002
3213
|
horizontal: this.groupDirection === "horizontal" && !this.groupResponsive,
|
|
3003
3214
|
"horizontal-responsive": this.groupDirection === "horizontal" && this.groupResponsive,
|
|
@@ -3015,28 +3226,53 @@ let DuetChoice$1 = class extends HTMLElement {
|
|
|
3015
3226
|
info: this.isInfoOpen,
|
|
3016
3227
|
collapsible: this.collapsible,
|
|
3017
3228
|
"duet-p-0": this.padding === "none",
|
|
3018
|
-
} }, h$1("input", {
|
|
3229
|
+
} }, h$1("input", { class: "duet-choice-input", type: this.type, onFocus: this.onFocus, onBlur: this.onBlur, onChange: this.onChange, disabled: this.disabled || this.groupDisabled, required: this.required, id: identifier, name: this.name, value: this.value, checked: this.checked, "aria-controls": this.accessibleControls, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.getAriaDescribedby(), onKeyDown: this.handleKeyDown, ref: input => (this.nativeInput = input) }), h$1("label", { htmlFor: identifier, class: { "duet-choice-label": true, "no-hover": this.isHovering }, onClick: this.onClick }, this.icon && (h$1("div", { class: "duet-choice-card-icon" }, h$1("duet-icon", { margin: "none", size: "small", name: this.icon, color: "currentColor" }))), this.label, this.caption && (h$1("div", null, h$1("duet-spacer", { size: "xx-small" }), h$1("duet-caption", { margin: "none", selected: this.checked }, this.caption))), this.hasAdditional && (h$1("div", null, h$1("duet-spacer", { size: "xx-small" }), h$1("slot", { name: "additional" }))), h$1("div", { class: { "duet-checkmark-container": true, "duet-checkmark-radio": this.type === "radio" } }, this.checked && h$1("div", { class: "duet-checkmark" })))), this.hasInfo && !this.collapsible && (h$1("button", { ref: button => (this.infoButtonEl = button), id: this.infoButtonId, class: {
|
|
3019
3230
|
"duet-choice-info-toggle": true,
|
|
3020
3231
|
"duet-theme-turva": this.theme === "turva",
|
|
3021
|
-
}, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onClick: this.toggleInfo, disabled: this.disabled || this.groupDisabled, "aria-expanded": this.isInfoOpen ? "true" : "false", "aria-controls": this.
|
|
3232
|
+
}, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onClick: this.toggleInfo, disabled: this.disabled || this.groupDisabled, "aria-expanded": this.isInfoOpen ? "true" : "false", "aria-label": `${this.infoLabel} ${this.label}`, "aria-controls": this.expandId, "aria-flowto": this.expandId, tabindex: this.type === "radio" && !this.checked ? "-1" : "0", type: "button" }, h$1("duet-visually-hidden", { "aria-hidden": !this.isBlurred ? "true" : "false" }, this.accessibleLabelInfoButton), h$1("div", { class: "duet-choice-info-icon" }, h$1("duet-icon", { icon: messagingInfo.svg, margin: "none", size: "small", color: "currentColor" }))))), this.collapsible || this.hasInfo ? (h$1("div", { class: this.getClassNames(), id: this.expandId }, h$1("span", { class: {
|
|
3233
|
+
"duet-choice-section-visible": this.collapsible ? this.checked : this.isInfoOpen,
|
|
3234
|
+
"duet-choice-section-hidden": this.collapsible ? !this.checked : !this.isInfoOpen,
|
|
3235
|
+
} }, h$1("span", { id: this.headerId }, h$1("slot", { name: "header" })), this.hasInfo ? (h$1("span", null, h$1("span", { "aria-relevant": "all", "aria-atomic": "true", "aria-live": this.isInfoOpen ? "polite" : "off" }, h$1("slot", { name: "info" })), h$1("slot", null))) : (h$1("span", null, h$1("slot", null)))), this.isInfoOpen && h$1(FocusGuard, { moveFocusTo: this.infoButtonEl }))) : null));
|
|
3022
3236
|
}
|
|
3023
3237
|
get element() { return this; }
|
|
3024
3238
|
static get style() { return duetChoiceCss; }
|
|
3025
3239
|
};
|
|
3026
3240
|
|
|
3027
|
-
const
|
|
3241
|
+
const watchFor = (containerEl, tagName, onChange, changeHandler, options = {
|
|
3242
|
+
childList: true,
|
|
3243
|
+
subtree: true,
|
|
3244
|
+
}) => {
|
|
3028
3245
|
let mutation;
|
|
3029
3246
|
if (typeof MutationObserver !== "undefined") {
|
|
3030
3247
|
mutation = new MutationObserver(mutationList => {
|
|
3031
|
-
onChange(
|
|
3032
|
-
});
|
|
3033
|
-
mutation.observe(containerEl, {
|
|
3034
|
-
childList: true,
|
|
3035
|
-
subtree: true,
|
|
3248
|
+
onChange(changeHandler(mutationList, tagName));
|
|
3036
3249
|
});
|
|
3250
|
+
mutation.observe(containerEl, options);
|
|
3037
3251
|
}
|
|
3038
3252
|
return mutation;
|
|
3039
3253
|
};
|
|
3254
|
+
const watchForOptions = (containerEl, tagName, onChange) => {
|
|
3255
|
+
return watchFor(containerEl, tagName, onChange, getSelectedOption);
|
|
3256
|
+
};
|
|
3257
|
+
const watchForElement = (containerEl, tagName, onChange) => {
|
|
3258
|
+
return watchFor(containerEl, tagName, onChange, getElementItem, {
|
|
3259
|
+
childList: true,
|
|
3260
|
+
subtree: true,
|
|
3261
|
+
});
|
|
3262
|
+
};
|
|
3263
|
+
const getElementItem = (mutationList) => {
|
|
3264
|
+
let addedNode = false;
|
|
3265
|
+
let removedNode = false;
|
|
3266
|
+
mutationList.forEach(mut => {
|
|
3267
|
+
if (mut.addedNodes.length) {
|
|
3268
|
+
addedNode = true;
|
|
3269
|
+
}
|
|
3270
|
+
if (mut.removedNodes.length) {
|
|
3271
|
+
removedNode = true;
|
|
3272
|
+
}
|
|
3273
|
+
});
|
|
3274
|
+
return { addedNode, removedNode, mutationList };
|
|
3275
|
+
};
|
|
3040
3276
|
const getSelectedOption = (mutationList, tagName) => {
|
|
3041
3277
|
let newOption;
|
|
3042
3278
|
mutationList.forEach(mut => {
|
|
@@ -3055,9 +3291,9 @@ const findCheckedOption = (el, tagName) => {
|
|
|
3055
3291
|
return options.find((o) => o.checked === true);
|
|
3056
3292
|
};
|
|
3057
3293
|
|
|
3058
|
-
const duetChoiceGroupCss = "*.sc-duet-choice-group,*.sc-duet-choice-group::after,*.sc-duet-choice-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:flex}}.horizontal.sc-duet-choice-group-h .duet-choice-group.duet-no-stacking.sc-duet-choice-group{display:flex}.duet-choice-group.sc-duet-choice-group{position:relative;width:100%;margin-bottom:-12px}";
|
|
3294
|
+
const duetChoiceGroupCss = "*.sc-duet-choice-group,*.sc-duet-choice-group::after,*.sc-duet-choice-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:flex;margin-bottom:0}}.horizontal.sc-duet-choice-group-h .duet-choice-group.duet-no-stacking.sc-duet-choice-group{display:flex}.duet-choice-group.sc-duet-choice-group{position:relative;width:100%;margin-bottom:-12px}";
|
|
3059
3295
|
|
|
3060
|
-
let DuetChoiceGroup$1 = class extends
|
|
3296
|
+
let DuetChoiceGroup$1 = class extends H {
|
|
3061
3297
|
constructor() {
|
|
3062
3298
|
super();
|
|
3063
3299
|
this.__registerHost();
|
|
@@ -3088,11 +3324,11 @@ let DuetChoiceGroup$1 = class extends HTMLElement {
|
|
|
3088
3324
|
/**
|
|
3089
3325
|
* Additional caption to show inside the label of the choice group.
|
|
3090
3326
|
*/
|
|
3091
|
-
this.caption =
|
|
3327
|
+
this.caption = undefined;
|
|
3092
3328
|
/**
|
|
3093
3329
|
* Tooltip to display next to the label of the choice group.
|
|
3094
3330
|
*/
|
|
3095
|
-
this.tooltip =
|
|
3331
|
+
this.tooltip = undefined;
|
|
3096
3332
|
/**
|
|
3097
3333
|
* With direction setting you can force the tooltip to always open towards left
|
|
3098
3334
|
* or right instead of automatically determining the direction.
|
|
@@ -3323,6 +3559,7 @@ const size_tappable_square = "48px";
|
|
|
3323
3559
|
const size_icon_x_small = "16px";
|
|
3324
3560
|
const size_icon_xxx_small = "7px";
|
|
3325
3561
|
const size_button_border = "2px";
|
|
3562
|
+
const size_button_tiny_border = "1px";
|
|
3326
3563
|
const size_icon_medium = "24px";
|
|
3327
3564
|
const size_icon_small = "20px";
|
|
3328
3565
|
const opacity_85 = "0.85";
|
|
@@ -3470,6 +3707,7 @@ const tokens = {
|
|
|
3470
3707
|
size_icon_x_small: size_icon_x_small,
|
|
3471
3708
|
size_icon_xxx_small: size_icon_xxx_small,
|
|
3472
3709
|
size_button_border: size_button_border,
|
|
3710
|
+
size_button_tiny_border: size_button_tiny_border,
|
|
3473
3711
|
size_icon_medium: size_icon_medium,
|
|
3474
3712
|
size_icon_small: size_icon_small,
|
|
3475
3713
|
opacity_85: opacity_85,
|
|
@@ -3620,6 +3858,7 @@ const tokens$1 = /*#__PURE__*/Object.freeze({
|
|
|
3620
3858
|
size_icon_x_small: size_icon_x_small,
|
|
3621
3859
|
size_icon_xxx_small: size_icon_xxx_small,
|
|
3622
3860
|
size_button_border: size_button_border,
|
|
3861
|
+
size_button_tiny_border: size_button_tiny_border,
|
|
3623
3862
|
size_icon_medium: size_icon_medium,
|
|
3624
3863
|
size_icon_small: size_icon_small,
|
|
3625
3864
|
opacity_85: opacity_85,
|
|
@@ -3656,11 +3895,11 @@ const tokens$1 = /*#__PURE__*/Object.freeze({
|
|
|
3656
3895
|
|
|
3657
3896
|
const duetCollapsibleCss = "*,*::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;margin-bottom:16px !important;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:1rem;font-weight:600;line-height:1.5;color:#00294d}:host(.duet-theme-turva){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}:host(.duet-m-0){margin:0 !important}.duet-collapsible-content{display:none;padding-left:18px;margin-top:8px;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;-webkit-hyphens:auto;hyphens:auto;line-height:1.5;color:#00294d}@media (max-width: 35.9375em){.duet-collapsible-content{font-size:0.875rem}}.duet-collapsible-content.duet-theme-turva{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}:host([open]) .duet-collapsible-content{display:block}.duet-collapsible-heading{-webkit-user-select:none;user-select:none;display:flex;align-items:center;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:600;line-height:1.5;color:#00294d;cursor:pointer;border-radius:4px}.duet-collapsible-heading.duet-collapsible-normal-weight{font-weight:400}.duet-collapsible-heading.duet-theme-turva{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}.duet-collapsible-heading .duet-collapsible-heading-content{flex:1}.duet-collapsible-heading:focus{outline:0}:host(.user-is-tabbing) .duet-collapsible-heading:focus{border-radius:4px;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing.duet-theme-turva) .duet-collapsible-heading:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-collapsible-heading-icon{margin-right:8px !important;display:flex;align-items:center;justify-content:center;color:#00294d;transition:transform 300ms ease}.duet-collapsible-heading-icon:last-child,.duet-collapsible-heading-icon:last-of-type{margin-right:0 !important}[aria-expanded=true] .duet-collapsible-heading-icon{transform:rotate(180deg)}";
|
|
3658
3897
|
|
|
3659
|
-
let DuetCollapsible$1 = class extends
|
|
3898
|
+
let DuetCollapsible$1 = class extends H {
|
|
3660
3899
|
constructor() {
|
|
3661
3900
|
super();
|
|
3662
3901
|
this.__registerHost();
|
|
3663
|
-
|
|
3902
|
+
this.__attachShadow();
|
|
3664
3903
|
this.duetToggle = createEvent$2(this, "duetToggle", 7);
|
|
3665
3904
|
this.id = createID("DuetCollapsible");
|
|
3666
3905
|
/**
|
|
@@ -3771,7 +4010,7 @@ let DuetCollapsible$1 = class extends HTMLElement {
|
|
|
3771
4010
|
* Always the last one in the class.
|
|
3772
4011
|
*/
|
|
3773
4012
|
render() {
|
|
3774
|
-
const HeadingTagName = this.headingLevel ? sanitizeString(this.headingLevel) : "div";
|
|
4013
|
+
const HeadingTagName = this.headingLevel ? sanitizeString$1(this.headingLevel) : "div";
|
|
3775
4014
|
return (h$1(Host, { class: { "duet-m-0": this.margin === "none" } }, h$1(HeadingTagName, { class: {
|
|
3776
4015
|
"duet-collapsible-heading": true,
|
|
3777
4016
|
"duet-theme-turva": this.theme === "turva",
|
|
@@ -3784,11 +4023,11 @@ let DuetCollapsible$1 = class extends HTMLElement {
|
|
|
3784
4023
|
|
|
3785
4024
|
const duetCookieConsentCss = "*,*::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;position:fixed;right:0;bottom:0;left:0;z-index:950;display:block;width:100%;box-shadow:0 2px 20px 0 rgba(0, 0, 0, 0.2)}@media (min-width: 48em){:host{right:28px;bottom:28px;left:auto;width:25rem}}:host(:focus){outline:0}:host(.user-is-tabbing:focus){border-radius:4px;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing.duet-theme-turva:focus){box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-cookie-consent{padding:20px;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;color:white !important;background-color:rgba(0, 21, 39, 0.9)}@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none){.duet-cookie-consent{background:rgba(0, 21, 39, 0.8);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}}.duet-cookie-consent.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";background-color:rgba(12, 14, 29, 0.9)}@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none){.duet-cookie-consent.duet-theme-turva{background:rgba(12, 14, 29, 0.8)}}@media (min-width: 48em){.duet-cookie-consent{padding:20px;border-radius:4px}}.duet-cookie-consent-content{display:flex;align-items:center;max-width:1110px;margin:0 auto}.duet-cookie-consent-content .expand{flex:1}::slotted(a){font-weight:600;color:white !important;text-decoration:underline;white-space:nowrap}::slotted(a[target=_blank]){padding-right:16px;background:url(\"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjZmZmIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjUgMmExLjUgMS41IDAgMDEuMTQgM0gzLjc1Yy0uMzggMC0uNy4yOC0uNzQuNjVsLS4wMS4xdjE0LjVjMCAuMzguMjguNy42NS43NGwuMS4wMWgxNC41Yy4zOCAwIC43LS4yOC43NC0uNjVsLjAxLS4xdi02Ljg5YTEuNSAxLjUgMCAwMTMgMHY2Ljg5QTMuNzUgMy43NSAwIDAxMTguMjUgMjRIMy43NUEzLjc1IDMuNzUgMCAwMTAgMjAuMjVWNS43NUEzLjc1IDMuNzUgMCAwMTMuNzUgMnptMTItMmMuNzggMCAxLjQyLjYgMS41IDEuMzZWNy41YTEuNSAxLjUgMCAwMS0zIC4xNFY1LjEybC01LjQ0IDUuNDRhMS41IDEuNSAwIDAxLTIuMjItMmwuMS0uMTJMMTguODggM0gxNi41QTEuNSAxLjUgMCAwMTE1IDEuNjRWMS41YzAtLjc4LjYtMS40MiAxLjM2LTEuNWguMTR6Ii8+PC9zdmc+\") no-repeat right 50%;background-size:12px 10px}::slotted(a:focus){outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva ::slotted(a:focus){outline:0;box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}";
|
|
3786
4025
|
|
|
3787
|
-
let DuetCookieConsent$1 = class extends
|
|
4026
|
+
let DuetCookieConsent$1 = class extends H {
|
|
3788
4027
|
constructor() {
|
|
3789
4028
|
super();
|
|
3790
4029
|
this.__registerHost();
|
|
3791
|
-
|
|
4030
|
+
this.__attachShadow();
|
|
3792
4031
|
this.duetCookieConsent = createEvent$2(this, "duetCookieConsent", 7);
|
|
3793
4032
|
/**
|
|
3794
4033
|
* Adds accessible label for the cookie consent ok button.
|
|
@@ -3820,151 +4059,6 @@ let DuetCookieConsent$1 = class extends HTMLElement {
|
|
|
3820
4059
|
static get style() { return duetCookieConsentCss; }
|
|
3821
4060
|
};
|
|
3822
4061
|
|
|
3823
|
-
const isComplexType = (o) => {
|
|
3824
|
-
// https://jsperf.com/typeof-fn-object/5
|
|
3825
|
-
o = typeof o;
|
|
3826
|
-
return o === 'object' || o === 'function';
|
|
3827
|
-
};
|
|
3828
|
-
/**
|
|
3829
|
-
* Production h() function based on Preact by
|
|
3830
|
-
* Jason Miller (@developit)
|
|
3831
|
-
* Licensed under the MIT License
|
|
3832
|
-
* https://github.com/developit/preact/blob/master/LICENSE
|
|
3833
|
-
*
|
|
3834
|
-
* Modified for Stencil's compiler and vdom
|
|
3835
|
-
*/
|
|
3836
|
-
// const stack: any[] = [];
|
|
3837
|
-
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
3838
|
-
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
3839
|
-
const h = (nodeName, vnodeData, ...children) => {
|
|
3840
|
-
let child = null;
|
|
3841
|
-
let key = null;
|
|
3842
|
-
let slotName = null;
|
|
3843
|
-
let simple = false;
|
|
3844
|
-
let lastSimple = false;
|
|
3845
|
-
let vNodeChildren = [];
|
|
3846
|
-
const walk = (c) => {
|
|
3847
|
-
for (let i = 0; i < c.length; i++) {
|
|
3848
|
-
child = c[i];
|
|
3849
|
-
if (Array.isArray(child)) {
|
|
3850
|
-
walk(child);
|
|
3851
|
-
}
|
|
3852
|
-
else if (child != null && typeof child !== 'boolean') {
|
|
3853
|
-
if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
|
3854
|
-
child = String(child);
|
|
3855
|
-
}
|
|
3856
|
-
if (simple && lastSimple) {
|
|
3857
|
-
// If the previous child was simple (string), we merge both
|
|
3858
|
-
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
3859
|
-
}
|
|
3860
|
-
else {
|
|
3861
|
-
// Append a new vNode, if it's text, we create a text vNode
|
|
3862
|
-
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
3863
|
-
}
|
|
3864
|
-
lastSimple = simple;
|
|
3865
|
-
}
|
|
3866
|
-
}
|
|
3867
|
-
};
|
|
3868
|
-
walk(children);
|
|
3869
|
-
if (vnodeData) {
|
|
3870
|
-
// normalize class / classname attributes
|
|
3871
|
-
if (vnodeData.key) {
|
|
3872
|
-
key = vnodeData.key;
|
|
3873
|
-
}
|
|
3874
|
-
if (vnodeData.name) {
|
|
3875
|
-
slotName = vnodeData.name;
|
|
3876
|
-
}
|
|
3877
|
-
{
|
|
3878
|
-
const classData = vnodeData.className || vnodeData.class;
|
|
3879
|
-
if (classData) {
|
|
3880
|
-
vnodeData.class =
|
|
3881
|
-
typeof classData !== 'object'
|
|
3882
|
-
? classData
|
|
3883
|
-
: Object.keys(classData)
|
|
3884
|
-
.filter((k) => classData[k])
|
|
3885
|
-
.join(' ');
|
|
3886
|
-
}
|
|
3887
|
-
}
|
|
3888
|
-
}
|
|
3889
|
-
if (typeof nodeName === 'function') {
|
|
3890
|
-
// nodeName is a functional component
|
|
3891
|
-
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
3892
|
-
}
|
|
3893
|
-
const vnode = newVNode(nodeName, null);
|
|
3894
|
-
vnode.$attrs$ = vnodeData;
|
|
3895
|
-
if (vNodeChildren.length > 0) {
|
|
3896
|
-
vnode.$children$ = vNodeChildren;
|
|
3897
|
-
}
|
|
3898
|
-
{
|
|
3899
|
-
vnode.$key$ = key;
|
|
3900
|
-
}
|
|
3901
|
-
{
|
|
3902
|
-
vnode.$name$ = slotName;
|
|
3903
|
-
}
|
|
3904
|
-
return vnode;
|
|
3905
|
-
};
|
|
3906
|
-
const newVNode = (tag, text) => {
|
|
3907
|
-
const vnode = {
|
|
3908
|
-
$flags$: 0,
|
|
3909
|
-
$tag$: tag,
|
|
3910
|
-
$text$: text,
|
|
3911
|
-
$elm$: null,
|
|
3912
|
-
$children$: null,
|
|
3913
|
-
};
|
|
3914
|
-
{
|
|
3915
|
-
vnode.$attrs$ = null;
|
|
3916
|
-
}
|
|
3917
|
-
{
|
|
3918
|
-
vnode.$key$ = null;
|
|
3919
|
-
}
|
|
3920
|
-
{
|
|
3921
|
-
vnode.$name$ = null;
|
|
3922
|
-
}
|
|
3923
|
-
return vnode;
|
|
3924
|
-
};
|
|
3925
|
-
const vdomFnUtils = {
|
|
3926
|
-
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
3927
|
-
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
3928
|
-
};
|
|
3929
|
-
const convertToPublic = (node) => ({
|
|
3930
|
-
vattrs: node.$attrs$,
|
|
3931
|
-
vchildren: node.$children$,
|
|
3932
|
-
vkey: node.$key$,
|
|
3933
|
-
vname: node.$name$,
|
|
3934
|
-
vtag: node.$tag$,
|
|
3935
|
-
vtext: node.$text$,
|
|
3936
|
-
});
|
|
3937
|
-
const convertToPrivate = (node) => {
|
|
3938
|
-
if (typeof node.vtag === 'function') {
|
|
3939
|
-
const vnodeData = Object.assign({}, node.vattrs);
|
|
3940
|
-
if (node.vkey) {
|
|
3941
|
-
vnodeData.key = node.vkey;
|
|
3942
|
-
}
|
|
3943
|
-
if (node.vname) {
|
|
3944
|
-
vnodeData.name = node.vname;
|
|
3945
|
-
}
|
|
3946
|
-
return h(node.vtag, vnodeData, ...(node.vchildren || []));
|
|
3947
|
-
}
|
|
3948
|
-
const vnode = newVNode(node.vtag, node.vtext);
|
|
3949
|
-
vnode.$attrs$ = node.vattrs;
|
|
3950
|
-
vnode.$children$ = node.vchildren;
|
|
3951
|
-
vnode.$key$ = node.vkey;
|
|
3952
|
-
vnode.$name$ = node.vname;
|
|
3953
|
-
return vnode;
|
|
3954
|
-
};
|
|
3955
|
-
|
|
3956
|
-
const focusElement = (element) => {
|
|
3957
|
-
if ("setFocus" in element) {
|
|
3958
|
-
element.setFocus();
|
|
3959
|
-
}
|
|
3960
|
-
else {
|
|
3961
|
-
element.focus();
|
|
3962
|
-
}
|
|
3963
|
-
};
|
|
3964
|
-
const FocusGuard = ({ moveFocusTo }) => {
|
|
3965
|
-
return h("div", { class: "duet-focus-guard", "aria-hidden": "true", tabIndex: 0, onFocus: () => focusElement(moveFocusTo) });
|
|
3966
|
-
};
|
|
3967
|
-
|
|
3968
4062
|
const formatOptionsShort = { day: "numeric", month: "long" };
|
|
3969
4063
|
const formatOptionsLong = { day: "numeric", month: "long", year: "numeric" };
|
|
3970
4064
|
const i18n$2 = {
|
|
@@ -4355,9 +4449,9 @@ const DatePickerMonth = ({ selectedDate, focusedDate, labelledById, theme, langu
|
|
|
4355
4449
|
} }))))))))));
|
|
4356
4450
|
};
|
|
4357
4451
|
|
|
4358
|
-
const duetDatePickerCss = "*.sc-duet-date-picker,*.sc-duet-date-picker::after,*.sc-duet-date-picker::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-date-picker-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;position:relative;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:bottom}.sc-duet-date-picker-h:last-child,.sc-duet-date-picker-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-date-picker-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-date-picker-h{width:100% !important}.duet-m-0.sc-duet-date-picker-h{margin:0 !important}.duet-date.sc-duet-date-picker{position:relative;width:100%}.duet-date.sc-duet-date-picker button.sc-duet-date-picker,.duet-date-dialog.sc-duet-date-picker button.sc-duet-date-picker{max-width:initial !important;min-height:initial !important;padding:0 !important;margin:0 !important;transition:initial}.duet-date-button.sc-duet-date-picker{-webkit-user-select:none;user-select:none;position:absolute;top:1px;right:1px;z-index:200;display:flex;align-items:center;justify-content:center;width:48px;height:calc(100% - 2px);color:#00294d;cursor:pointer;background:transparent !important;border-left:1px solid #cfd2d4 !important;border-radius:0 4px 4px 0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker{color:#171c3a;border-color:#cfcfd1}.duet-date-button.sc-duet-date-picker::before{position:absolute;top:0;left:-6px;width:6px;height:100%;content:\"\";background:linear-gradient(to left, rgba(207, 210, 212, 0.2) 0%, rgba(207, 210, 212, 0.2) 1px, rgba(207, 210, 212, 0.1) 1px, rgba(207, 210, 212, 0) 100%)}.duet-date-button.sc-duet-date-picker:disabled{pointer-events:none;cursor:default;background:#f5f8fa !important;border:0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:disabled{background:#f5f5f7 !important}.duet-date-button.sc-duet-date-picker:disabled::before{display:none}.duet-date-button.sc-duet-date-picker:disabled duet-icon.sc-duet-date-picker{opacity:0.4}.duet-date-button.sc-duet-date-picker duet-icon.sc-duet-date-picker{transform:translateY(-1px)}.duet-date-button.sc-duet-date-picker:active duet-icon.sc-duet-date-picker{transform:translateY(0)}.duet-date-button.sc-duet-date-picker:focus{color:#0077b3;border-color:transparent;outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:focus{color:#171c3a;box-shadow:0 0 0 2px #171c3a}.duet-date-dialog.sc-duet-date-picker{position:absolute;top:100%;left:0;z-index:900;display:flex;width:100%;visibility:hidden;opacity:0;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right}@media (min-width: 36em){.duet-date-dialog.left.sc-duet-date-picker{right:0;left:auto;width:auto}}@media (max-width: 35.9375em){.duet-date-dialog.sc-duet-date-picker{position:fixed;top:0;right:0;bottom:0;background:rgba(0, 41, 77, 0.75);transition:opacity 400ms ease, visibility 400ms ease;transform:translateZ(0);transform-origin:bottom center}.duet-date-dialog.duet-theme-turva.sc-duet-date-picker{background:rgba(23, 28, 58, 0.75)}}.duet-date-dialog.active.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:scale(1.0001) translateZ(0) translateY(0)}@media (min-width: 36em){.duet-date-dialog.error.sc-duet-date-picker{top:calc(100% - 28px);margin-top:4px}}.duet-date-dialog-wrapper.sc-duet-date-picker{position:relative;z-index:600;width:100%;min-width:290px;max-width:310px;padding:16px 16px 20px;margin-top:8px;margin-left:auto;background:white;border:1px solid #e1e3e6;border-radius:4px;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);transform:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{border-color:#e4e4e6}@media (max-width: 35.9375em){.duet-date-dialog-wrapper.sc-duet-date-picker{position:absolute;bottom:0;left:0;z-index:900;max-width:none;min-height:25em;padding:0 8% 20px;margin:0;visibility:hidden;border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;opacity:0;transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;transform:translateZ(0) translateY(100%)}.active.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:translateZ(0) translateY(0)}}.duet-date-table.sc-duet-date-picker{width:100%;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;color:#00294d;text-align:center;border-spacing:0;border-collapse:collapse}.duet-date-table.duet-theme-turva.sc-duet-date-picker{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}.duet-date-table.sc-duet-date-picker th.sc-duet-date-picker{padding-bottom:8px;font-size:0.75rem;font-weight:600;line-height:1.25;text-decoration:none;text-transform:uppercase;letter-spacing:1px}.duet-date-table.sc-duet-date-picker .duet-date-table-cell.sc-duet-date-picker{text-align:center}.duet-date-table-button.sc-duet-date-picker{position:relative;z-index:100;display:inline-block !important;width:36.9230769231px !important;height:36.9230769231px !important;min-height:initial !important;padding:0 !important;margin:0 !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:0.875rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.25 !important;color:#00294d !important;text-align:center;vertical-align:initial !important;cursor:pointer;background:transparent !important;border-radius:50% !important;transition:initial !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;color:#171c3a !important}.duet-date-table-button.sc-duet-date-picker:hover{background:#e6f2f8 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:hover{background:#f9e6ea !important}.duet-date-table-button.today.sc-duet-date-picker{z-index:200;color:#004d80 !important;background:#f3f9fc !important;box-shadow:0 0 0 1px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.today.sc-duet-date-picker{color:#940925 !important;background:#fcf3f4 !important;box-shadow:0 0 0 1px #c60c30 !important}.duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#0077b3 !important;outline:0}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#c60c30 !important}.duet-date-table-button.sc-duet-date-picker:active{z-index:200;color:white !important;background:#0077b3 !important;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:active{color:white !important;background:#c60c30 !important;box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.sc-duet-date-picker:focus{z-index:200;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.disabled.sc-duet-date-picker{color:#909599 !important;cursor:default;background:transparent !important;box-shadow:none !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.disabled.sc-duet-date-picker{color:#747475 !important;background:transparent !important;box-shadow:none !important}.duet-date-table-button.outside.sc-duet-date-picker{color:#909599 !important;pointer-events:none;cursor:default;background:#f5f8fa !important;box-shadow:none;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.outside.sc-duet-date-picker{color:#747475;background:#f5f5f7;box-shadow:none}.duet-date-dialog-header.sc-duet-date-picker{margin-bottom:16px !important;display:flex;align-items:center;justify-content:space-between;width:100%}.duet-date-dialog-buttons.sc-duet-date-picker{white-space:nowrap}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{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.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{color:#171c3a;background:#f5f5f7}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker duet-icon.sc-duet-date-picker{display:block}@media (max-width: 35.9375em){.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{width:40px;height:40px}}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9ecee !important}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9e9eb !important}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#dddfe1;box-shadow:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#ddddde}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#909599;cursor:default;background:#f5f8fa;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#747475;background:#f5f5f7}.duet-date-dialog-select.sc-duet-date-picker{position:relative;display:inline-flex;margin-top:4px}.duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{position:relative;z-index:1;display:flex;align-items:center;width:100%;padding:0 8px;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:1.25rem;font-weight:600;line-height:1.25;color:#00294d;pointer-events:none;border-radius:4px}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{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}.duet-date-dialog-select.sc-duet-date-picker span.sc-duet-date-picker{margin-right:4px}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;font-size:1rem;cursor:pointer;opacity:0}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-mobile-header.sc-duet-date-picker{position:relative;display:flex;align-items:center;justify-content:space-between;width:120%;padding:12px 20px;margin-bottom:20px;margin-left:-10%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #cfd2d4}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker{position:absolute;top:-8px;right:-8px;width:auto;padding:0;margin:0;overflow:visible;border:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-mobile-header.sc-duet-date-picker{border-color:#cfcfd1}.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:inline-block;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:none}}.duet-date-picker-close.sc-duet-date-picker{display:flex;align-items:center;justify-content:center;width:24px;height:24px !important;padding:0 !important;color:#00294d !important;cursor:pointer;background:#f5f8fa !important;border-radius:50%;-webkit-appearance:none;appearance:none}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker{opacity:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f8fa !important}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:focus{outline:none;box-shadow:0 0 0 2px #0077b3}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker:focus{opacity:1}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}";
|
|
4452
|
+
const duetDatePickerCss = "*.sc-duet-date-picker,*.sc-duet-date-picker::after,*.sc-duet-date-picker::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-date-picker-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;position:relative;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:top}.sc-duet-date-picker-h:last-child,.sc-duet-date-picker-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-date-picker-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-date-picker-h{width:100% !important}.duet-m-0.sc-duet-date-picker-h{margin:0 !important}.duet-date.sc-duet-date-picker{position:relative;width:100%}.duet-date.sc-duet-date-picker button.sc-duet-date-picker,.duet-date-dialog.sc-duet-date-picker button.sc-duet-date-picker{max-width:initial !important;min-height:initial !important;padding:0 !important;margin:0 !important;transition:initial}.duet-date-button.sc-duet-date-picker{-webkit-user-select:none;user-select:none;position:absolute;top:1px;right:1px;z-index:200;display:flex;align-items:center;justify-content:center;width:48px;height:calc(100% - 2px);color:#00294d;cursor:pointer;background:transparent !important;border-left:1px solid #cfd2d4 !important;border-radius:0 4px 4px 0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker{color:#171c3a;border-color:#cfcfd1}.duet-date-button.sc-duet-date-picker::before{position:absolute;top:0;left:-6px;width:6px;height:100%;content:\"\";background:linear-gradient(to left, rgba(207, 210, 212, 0.2) 0%, rgba(207, 210, 212, 0.2) 1px, rgba(207, 210, 212, 0.1) 1px, rgba(207, 210, 212, 0) 100%)}.duet-date-button.sc-duet-date-picker:disabled{pointer-events:none;cursor:default;background:#f5f8fa !important;border:0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:disabled{background:#f5f5f7 !important}.duet-date-button.sc-duet-date-picker:disabled::before{display:none}.duet-date-button.sc-duet-date-picker:disabled duet-icon.sc-duet-date-picker{opacity:0.4}.duet-date-button.sc-duet-date-picker duet-icon.sc-duet-date-picker{transform:translateY(-1px)}.duet-date-button.sc-duet-date-picker:active duet-icon.sc-duet-date-picker{transform:translateY(0)}.duet-date-button.sc-duet-date-picker:focus{color:#0077b3;border-color:transparent;outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:focus{color:#171c3a;box-shadow:0 0 0 2px #171c3a}.duet-date-dialog.sc-duet-date-picker{position:absolute;top:100%;left:0;z-index:900;display:flex;width:100%;visibility:hidden;opacity:0;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right}@media (min-width: 36em){.duet-date-dialog.left.sc-duet-date-picker{right:0;left:auto;width:auto}}@media (max-width: 35.9375em){.duet-date-dialog.sc-duet-date-picker{position:fixed;top:0;right:0;bottom:0;background:rgba(0, 41, 77, 0.75);transition:opacity 400ms ease, visibility 400ms ease;transform:translateZ(0);transform-origin:bottom center}.duet-date-dialog.duet-theme-turva.sc-duet-date-picker{background:rgba(23, 28, 58, 0.75)}}.duet-date-dialog.active.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:scale(1.0001) translateZ(0) translateY(0)}@media (min-width: 36em){.duet-date-dialog.error.sc-duet-date-picker{top:calc(100% - 28px);margin-top:4px}}.duet-date-dialog-wrapper.sc-duet-date-picker{position:relative;z-index:600;width:100%;min-width:290px;max-width:310px;padding:16px 16px 20px;margin-top:8px;margin-left:auto;background:white;border:1px solid #e1e3e6;border-radius:4px;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);transform:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{border-color:#e4e4e6}@media (max-width: 35.9375em){.duet-date-dialog-wrapper.sc-duet-date-picker{position:absolute;bottom:0;left:0;z-index:900;max-width:none;min-height:25em;padding:0 8% 20px;margin:0;visibility:hidden;border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;opacity:0;transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;transform:translateZ(0) translateY(100%)}.active.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:translateZ(0) translateY(0)}}.duet-date-table.sc-duet-date-picker{width:100%;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;color:#00294d;text-align:center;border-spacing:0;border-collapse:collapse}.duet-date-table.duet-theme-turva.sc-duet-date-picker{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}.duet-date-table.sc-duet-date-picker th.sc-duet-date-picker{padding-bottom:8px;font-size:0.75rem;font-weight:600;line-height:1.25;text-decoration:none;text-transform:uppercase;letter-spacing:1px}.duet-date-table.sc-duet-date-picker .duet-date-table-cell.sc-duet-date-picker{text-align:center}.duet-date-table-button.sc-duet-date-picker{position:relative;z-index:100;display:inline-block !important;width:36.9230769231px !important;height:36.9230769231px !important;min-height:initial !important;padding:0 !important;margin:0 !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:0.875rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.25 !important;color:#00294d !important;text-align:center;vertical-align:initial !important;cursor:pointer;background:transparent !important;border-radius:50% !important;transition:initial !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;color:#171c3a !important}.duet-date-table-button.sc-duet-date-picker:hover{background:#e6f2f8 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:hover{background:#f9e6ea !important}.duet-date-table-button.today.sc-duet-date-picker{z-index:200;color:#004d80 !important;background:#f3f9fc !important;box-shadow:0 0 0 1px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.today.sc-duet-date-picker{color:#940925 !important;background:#fcf3f4 !important;box-shadow:0 0 0 1px #c60c30 !important}.duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#0077b3 !important;outline:0}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#c60c30 !important}.duet-date-table-button.sc-duet-date-picker:active{z-index:200;color:white !important;background:#0077b3 !important;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:active{color:white !important;background:#c60c30 !important;box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.sc-duet-date-picker:focus{z-index:200;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.disabled.sc-duet-date-picker{color:#909599 !important;cursor:default;background:transparent !important;box-shadow:none !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.disabled.sc-duet-date-picker{color:#747475 !important;background:transparent !important;box-shadow:none !important}.duet-date-table-button.outside.sc-duet-date-picker{color:#909599 !important;pointer-events:none;cursor:default;background:#f5f8fa !important;box-shadow:none;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.outside.sc-duet-date-picker{color:#747475;background:#f5f5f7;box-shadow:none}.duet-date-dialog-header.sc-duet-date-picker{margin-bottom:16px !important;display:flex;align-items:center;justify-content:space-between;width:100%}.duet-date-dialog-buttons.sc-duet-date-picker{white-space:nowrap}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{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.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{color:#171c3a;background:#f5f5f7}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker duet-icon.sc-duet-date-picker{display:block}@media (max-width: 35.9375em){.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{width:40px;height:40px}}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9ecee !important}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9e9eb !important}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#dddfe1;box-shadow:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#ddddde}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#909599;cursor:default;background:#f5f8fa;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#747475;background:#f5f5f7}.duet-date-dialog-select.sc-duet-date-picker{position:relative;display:inline-flex;margin-top:4px}.duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{position:relative;z-index:1;display:flex;align-items:center;width:100%;padding:0 8px;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:1.25rem;font-weight:600;line-height:1.25;color:#00294d;pointer-events:none;border-radius:4px}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{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}.duet-date-dialog-select.sc-duet-date-picker span.sc-duet-date-picker{margin-right:4px}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;font-size:1rem;cursor:pointer;opacity:0}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-mobile-header.sc-duet-date-picker{position:relative;display:flex;align-items:center;justify-content:space-between;width:120%;padding:12px 20px;margin-bottom:20px;margin-left:-10%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #cfd2d4}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker{position:absolute;top:-8px;right:-8px;width:auto;padding:0;margin:0;overflow:visible;border:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-mobile-header.sc-duet-date-picker{border-color:#cfcfd1}.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:inline-block;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:none}}.duet-date-picker-close.sc-duet-date-picker{display:flex;align-items:center;justify-content:center;width:24px;height:24px !important;padding:0 !important;color:#00294d !important;cursor:pointer;background:#f5f8fa !important;border-radius:50%;-webkit-appearance:none;appearance:none}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker{opacity:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f8fa !important}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:focus{outline:none;box-shadow:0 0 0 2px #0077b3}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker:focus{opacity:1}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}";
|
|
4359
4453
|
|
|
4360
|
-
let DuetDatePicker$1 = class extends
|
|
4454
|
+
let DuetDatePicker$1 = class extends H {
|
|
4361
4455
|
constructor() {
|
|
4362
4456
|
super();
|
|
4363
4457
|
this.__registerHost();
|
|
@@ -4397,11 +4491,27 @@ let DuetDatePicker$1 = class extends HTMLElement {
|
|
|
4397
4491
|
* Controls the margin of the component.
|
|
4398
4492
|
*/
|
|
4399
4493
|
this.margin = "auto";
|
|
4494
|
+
/**
|
|
4495
|
+
* The currently active language. This setting changes the month/year/day.
|
|
4496
|
+
* names and button labels as well as all screen reader labels.
|
|
4497
|
+
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing.
|
|
4498
|
+
* @default "fi"
|
|
4499
|
+
*/
|
|
4500
|
+
this.language = getLanguage();
|
|
4501
|
+
/**
|
|
4502
|
+
* Placeholder defaults.
|
|
4503
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
4504
|
+
*/
|
|
4505
|
+
this.placeholderDefaults = {
|
|
4506
|
+
fi: "pp.kk.vvvv",
|
|
4507
|
+
en: "dd.mm.yyyy",
|
|
4508
|
+
sv: "dd.mm.åååå",
|
|
4509
|
+
};
|
|
4400
4510
|
/**
|
|
4401
4511
|
* Hint text to display before the user types into the date picker input.
|
|
4402
4512
|
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
4403
4513
|
*/
|
|
4404
|
-
this.placeholder = getLocaleString(
|
|
4514
|
+
this.placeholder = getLocaleString(this.placeholderDefaults, this.language);
|
|
4405
4515
|
/**
|
|
4406
4516
|
* If form input field has a placeholder text, and user types anything (causing the text to dissapear),
|
|
4407
4517
|
* settings this to true will "echo" it into the caption slot - this option will be false by default for the next few versions, but will eventually be true by default (scheduled for 4.30.0)
|
|
@@ -4412,13 +4522,6 @@ let DuetDatePicker$1 = class extends HTMLElement {
|
|
|
4412
4522
|
* interact with the input, and conveys its inactive state to assistive technologies.
|
|
4413
4523
|
*/
|
|
4414
4524
|
this.disabled = false;
|
|
4415
|
-
/**
|
|
4416
|
-
* The currently active language. This setting changes the month/year/day
|
|
4417
|
-
* names and button labels as well as all screen reader labels.
|
|
4418
|
-
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing
|
|
4419
|
-
* @default "fi"
|
|
4420
|
-
*/
|
|
4421
|
-
this.language = getLanguage();
|
|
4422
4525
|
/**
|
|
4423
4526
|
* Display the date picker input in error state along with an error message.
|
|
4424
4527
|
*/
|
|
@@ -4459,7 +4562,7 @@ let DuetDatePicker$1 = class extends HTMLElement {
|
|
|
4459
4562
|
*/
|
|
4460
4563
|
this.min = "";
|
|
4461
4564
|
/**
|
|
4462
|
-
* Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD
|
|
4565
|
+
* Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.
|
|
4463
4566
|
* This setting can be used alone or together with the min property.
|
|
4464
4567
|
*/
|
|
4465
4568
|
this.max = "";
|
|
@@ -4680,125 +4783,413 @@ let DuetDatePicker$1 = class extends HTMLElement {
|
|
|
4680
4783
|
valid: !(valueMissing || badInput || rangeUnderflow || rangeOverflow),
|
|
4681
4784
|
};
|
|
4682
4785
|
}
|
|
4683
|
-
setValue(date) {
|
|
4684
|
-
const newValue = printISODate(date);
|
|
4685
|
-
if (newValue === this.value) {
|
|
4686
|
-
return;
|
|
4687
|
-
}
|
|
4688
|
-
this.value = newValue;
|
|
4689
|
-
this.duetChange.emit({
|
|
4690
|
-
component: "duet-date-picker",
|
|
4691
|
-
value: this.value,
|
|
4692
|
-
valueAsDate: date,
|
|
4693
|
-
});
|
|
4786
|
+
setValue(date) {
|
|
4787
|
+
const newValue = printISODate(date);
|
|
4788
|
+
if (newValue === this.value) {
|
|
4789
|
+
return;
|
|
4790
|
+
}
|
|
4791
|
+
this.value = newValue;
|
|
4792
|
+
this.duetChange.emit({
|
|
4793
|
+
component: "duet-date-picker",
|
|
4794
|
+
value: this.value,
|
|
4795
|
+
valueAsDate: date,
|
|
4796
|
+
});
|
|
4797
|
+
}
|
|
4798
|
+
handleDocumentClick(e) {
|
|
4799
|
+
if (!this.open) {
|
|
4800
|
+
return;
|
|
4801
|
+
}
|
|
4802
|
+
// the dialog and the button aren't considered clicks outside.
|
|
4803
|
+
// dialog for obvious reasons, but the button needs to be skipped
|
|
4804
|
+
// so that two things are possible:
|
|
4805
|
+
//
|
|
4806
|
+
// a) clicking again on the button when dialog is open should close the modal.
|
|
4807
|
+
// without skipping the button here, we would see a click outside
|
|
4808
|
+
// _and_ a click on the button, so the `open` state goes
|
|
4809
|
+
// open -> close (click outside) -> open (click button)
|
|
4810
|
+
//
|
|
4811
|
+
// b) clicking another date picker's button should close the current calendar
|
|
4812
|
+
// and open the new one. this means we can't stopPropagation() on the button itself
|
|
4813
|
+
const isClickOutside = e
|
|
4814
|
+
.composedPath()
|
|
4815
|
+
.every(node => node !== this.dialogWrapperNode && node !== this.datePickerButton);
|
|
4816
|
+
if (isClickOutside) {
|
|
4817
|
+
this.hide(false);
|
|
4818
|
+
}
|
|
4819
|
+
}
|
|
4820
|
+
/**
|
|
4821
|
+
* render() function
|
|
4822
|
+
* Always the last one in the class.
|
|
4823
|
+
*/
|
|
4824
|
+
render() {
|
|
4825
|
+
const valueAsDate = parseISODate(this.value);
|
|
4826
|
+
const selectedYear = (valueAsDate || this.focusedDay).getFullYear();
|
|
4827
|
+
const focusedMonth = this.focusedDay.getMonth();
|
|
4828
|
+
const focusedYear = this.focusedDay.getFullYear();
|
|
4829
|
+
const text = i18n$2[this.language];
|
|
4830
|
+
const minDate = parseISODate(this.min);
|
|
4831
|
+
const maxDate = parseISODate(this.max);
|
|
4832
|
+
const prevMonthDisabled = minDate != null && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear;
|
|
4833
|
+
const nextMonthDisabled = maxDate != null && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear;
|
|
4834
|
+
let minYear = selectedYear - 10;
|
|
4835
|
+
let maxYear = selectedYear + 10;
|
|
4836
|
+
if (minDate) {
|
|
4837
|
+
minYear = Math.max(minYear, minDate.getFullYear());
|
|
4838
|
+
}
|
|
4839
|
+
if (maxDate) {
|
|
4840
|
+
maxYear = Math.min(maxYear, maxDate.getFullYear());
|
|
4841
|
+
}
|
|
4842
|
+
return (h$1(Host, { class: { "duet-expand": this.expand, "duet-m-0": this.margin === "none" } }, h$1("div", { class: "duet-date" }, h$1(DatePickerInput, { value: this.value, valueAsDate: valueAsDate, formattedValue: this.inputValue, language: this.language, onInput: this.handleInputChange, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.toggleOpen, name: this.name, disabled: this.disabled, error: this.error, role: this.role, required: this.required, theme: this.theme, tooltip: this.tooltip, tooltipDirection: this.tooltipDirection, labelHidden: this.labelHidden, placeholder: this.placeholder, inputLabel: this.label, identifier: this.identifier, buttonRef: element => (this.datePickerButton = element), inputRef: element => (this.datePickerInput = element), accessibleActiveDescendant: this.accessibleActiveDescendant, accessibleControls: this.accessibleControls, accessibleOwns: this.accessibleOwns, accessibleDescribedBy: this.accessibleDescribedBy, echoPlaceholder: this.echoPlaceholder, caption: this.caption })), h$1("div", { class: {
|
|
4843
|
+
"duet-theme-turva": this.theme === "turva",
|
|
4844
|
+
"duet-date-dialog": true,
|
|
4845
|
+
left: this.direction === "left",
|
|
4846
|
+
error: !!this.error,
|
|
4847
|
+
active: this.open,
|
|
4848
|
+
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchMove: this.handleTouchMove, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h$1(FocusGuard, { moveFocusTo: this.focusedDayNode }), h$1("div", { class: "duet-date-dialog-wrapper", onKeyDown: this.handleEscKey, ref: element => (this.dialogWrapperNode = element) }, h$1("duet-visually-hidden", { "aria-live": "polite" }, text.keyboardInstruction), h$1("div", { class: "duet-date-dialog-mobile-header" }, h$1("duet-label", { margin: "none" }, this.label), h$1("button", { class: "duet-date-picker-close", ref: element => (this.closeButtonNode = element), onClick: () => this.hide(), type: "button" }, h$1("duet-icon", { name: "navigation-close-small", margin: "none", color: "currentColor", size: "xx-small" }), h$1("duet-visually-hidden", null, text.closeLabel))), h$1("div", { class: "duet-date-dialog-header" }, h$1("div", { class: "duet-date-dialog-dropdowns" }, h$1("duet-visually-hidden", null, h$1("h2", { id: this.dialogLabelId, "aria-live": "polite", "aria-atomic": "true" }, text.monthLabels[focusedMonth], " ", this.focusedDay.getFullYear())), h$1("duet-visually-hidden", null, h$1("label", { htmlFor: this.monthSelectId }, text.monthSelectLabel)), h$1("div", { class: "duet-date-dialog-select" }, h$1("select", { id: this.monthSelectId, class: "duet-date-month-select", ref: element => (this.monthSelectNode = element), onChange: this.handleMonthSelect }, text.monthLabels.map((month, i) => (h$1("option", { key: month, value: i, selected: i === focusedMonth, disabled: !inRange(new Date(focusedYear, i, 1), minDate ? startOfMonth(minDate) : null, maxDate ? endOfMonth(maxDate) : null) }, month)))), h$1("div", { class: "duet-date-dialog-select-label", "aria-hidden": "true" }, h$1("span", null, text.monthLabelsShort[focusedMonth]), h$1("duet-icon", { name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xxx-small" }))), h$1("duet-visually-hidden", null, h$1("label", { htmlFor: this.yearSelectId }, text.yearSelectLabel)), h$1("div", { class: "duet-date-dialog-select" }, h$1("select", { id: this.yearSelectId, class: "duet-date-year-select", onChange: this.handleYearSelect }, range(minYear, maxYear).map(year => (h$1("option", { key: year, selected: year === focusedYear }, year)))), h$1("div", { class: "duet-date-dialog-select-label", "aria-hidden": "true" }, h$1("span", null, this.focusedDay.getFullYear()), h$1("duet-icon", { name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xxx-small" })))), h$1("div", { class: "duet-date-dialog-buttons" }, h$1("button", { class: "duet-date-dialog-prev", onClick: this.handlePreviousMonthClick, disabled: prevMonthDisabled, type: "button" }, h$1("duet-icon", { name: "action-arrow-left-small", color: "currentColor", margin: "none", size: "xx-small" }), h$1("duet-visually-hidden", null, text.prevMonthLabel)), h$1("button", { class: "duet-date-dialog-next", onClick: this.handleNextMonthClick, disabled: nextMonthDisabled, type: "button" }, h$1("duet-icon", { name: "action-arrow-right-small", color: "currentColor", margin: "none", size: "xx-small" }), h$1("duet-visually-hidden", null, text.nextMonthLabel)))), h$1(DatePickerMonth, { selectedDate: valueAsDate, focusedDate: this.focusedDay, onDateSelect: this.handleDaySelect, onKeyboardNavigation: this.handleKeyboardNavigation, labelledById: this.dialogLabelId, language: this.language, theme: this.theme, min: minDate, max: maxDate, focusedDayRef: element => (this.focusedDayNode = element), onFocusEnter: this.enableActiveFocus, onFocusExit: this.disableActiveFocus })), h$1(FocusGuard, { moveFocusTo: this.closeButtonNode }))));
|
|
4849
|
+
}
|
|
4850
|
+
get element() { return this; }
|
|
4851
|
+
static get watchers() { return {
|
|
4852
|
+
"min": ["updateValidity"],
|
|
4853
|
+
"max": ["updateValidity"],
|
|
4854
|
+
"value": ["updateValidity", "updateInternalValue"],
|
|
4855
|
+
"required": ["updateValidity"]
|
|
4856
|
+
}; }
|
|
4857
|
+
static get style() { return duetDatePickerCss; }
|
|
4858
|
+
};
|
|
4859
|
+
|
|
4860
|
+
const duetDividerCss = "*,*::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:block;width:100%}.duet-divider{-webkit-user-select:none;user-select:none;display:block;width:100%;height:1px;margin-top:36px !important;margin-bottom:28px;background:#e1e3e6}.duet-divider.duet-p-0{padding:0 !important}.duet-divider.duet-m-0{margin:0 !important}.duet-divider.duet-m-s{margin-bottom:16px !important;margin-top:0 !important}.duet-divider.duet-theme-turva{background:#e4e4e6}";
|
|
4861
|
+
|
|
4862
|
+
let DuetDivider$1 = class extends H {
|
|
4863
|
+
constructor() {
|
|
4864
|
+
super();
|
|
4865
|
+
this.__registerHost();
|
|
4866
|
+
this.__attachShadow();
|
|
4867
|
+
/**
|
|
4868
|
+
* Theme of the divider.
|
|
4869
|
+
*/
|
|
4870
|
+
this.theme = "";
|
|
4871
|
+
/**
|
|
4872
|
+
* Controls the margin of the component.
|
|
4873
|
+
*/
|
|
4874
|
+
this.margin = "auto";
|
|
4875
|
+
}
|
|
4876
|
+
/**
|
|
4877
|
+
* Component lifecycle events.
|
|
4878
|
+
*/
|
|
4879
|
+
componentWillLoad() {
|
|
4880
|
+
inheritGlobalTheme(this);
|
|
4881
|
+
}
|
|
4882
|
+
/**
|
|
4883
|
+
* render() function
|
|
4884
|
+
* Always the last one in the class.
|
|
4885
|
+
*/
|
|
4886
|
+
render() {
|
|
4887
|
+
return (h$1("div", { class: {
|
|
4888
|
+
"duet-m-0": this.margin === "none",
|
|
4889
|
+
"duet-m-s": this.margin === "small",
|
|
4890
|
+
"duet-divider": true,
|
|
4891
|
+
"duet-theme-turva": this.theme === "turva",
|
|
4892
|
+
} }));
|
|
4893
|
+
}
|
|
4894
|
+
get element() { return this; }
|
|
4895
|
+
static get style() { return duetDividerCss; }
|
|
4896
|
+
};
|
|
4897
|
+
|
|
4898
|
+
const debounce = (func, timeout = 50) => {
|
|
4899
|
+
let timer;
|
|
4900
|
+
return (...args) => {
|
|
4901
|
+
clearTimeout(timer);
|
|
4902
|
+
timer = setTimeout(() => {
|
|
4903
|
+
func.apply(undefined, args);
|
|
4904
|
+
}, timeout);
|
|
4905
|
+
};
|
|
4906
|
+
};
|
|
4907
|
+
|
|
4908
|
+
const duetEditableTableCss = "duet-editable-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-header tr .duet-editable-table-header-hidden{padding:0 !important;font-size:0;border-bottom:0}";
|
|
4909
|
+
|
|
4910
|
+
let DuetEditableTable$1 = class extends H {
|
|
4911
|
+
constructor() {
|
|
4912
|
+
super();
|
|
4913
|
+
this.__registerHost();
|
|
4914
|
+
this.__attachShadow();
|
|
4915
|
+
/**
|
|
4916
|
+
* State() variables
|
|
4917
|
+
* @internal
|
|
4918
|
+
*/
|
|
4919
|
+
this.tick = Date.now();
|
|
4920
|
+
/**
|
|
4921
|
+
* Map of items that contain list of things.
|
|
4922
|
+
*/
|
|
4923
|
+
this.items = new Map();
|
|
4924
|
+
/**
|
|
4925
|
+
* Array of internationalized defaults for the default groups labels.
|
|
4926
|
+
*/
|
|
4927
|
+
this.groupsLabelDefaults = {
|
|
4928
|
+
fi: "Kaikki",
|
|
4929
|
+
en: "All items",
|
|
4930
|
+
sv: "Alla objekt",
|
|
4931
|
+
};
|
|
4932
|
+
/**
|
|
4933
|
+
* Array of internationalized defaults for the default action labels.
|
|
4934
|
+
*/
|
|
4935
|
+
this.actionLabelDefaults = {
|
|
4936
|
+
fi: "Toiminnot",
|
|
4937
|
+
en: "Actions",
|
|
4938
|
+
sv: "Handlingar",
|
|
4939
|
+
};
|
|
4940
|
+
/**
|
|
4941
|
+
* Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
|
|
4942
|
+
* @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
|
|
4943
|
+
* @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
|
|
4944
|
+
*/
|
|
4945
|
+
this.groups = [
|
|
4946
|
+
{ id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
|
|
4947
|
+
];
|
|
4948
|
+
/**
|
|
4949
|
+
* Array of actions that are mapped via the map variable to the various groups defined in group.
|
|
4950
|
+
* @default undefined
|
|
4951
|
+
* @example [{
|
|
4952
|
+
variation: "default",
|
|
4953
|
+
icon: "action-edit-2",
|
|
4954
|
+
id: "edit",
|
|
4955
|
+
map: ["success"],
|
|
4956
|
+
label: {
|
|
4957
|
+
fi: " Label",
|
|
4958
|
+
en: " Label",
|
|
4959
|
+
sv: " Label",
|
|
4960
|
+
}
|
|
4961
|
+
}]
|
|
4962
|
+
*/
|
|
4963
|
+
this.actions = undefined;
|
|
4964
|
+
/**
|
|
4965
|
+
* Shows or hides the table labels.
|
|
4966
|
+
*/
|
|
4967
|
+
this.hideGroups = false;
|
|
4968
|
+
/**
|
|
4969
|
+
* Exposes the aria role for optimizing accessibility.
|
|
4970
|
+
*/
|
|
4971
|
+
this.accessibleRole = undefined;
|
|
4972
|
+
/**
|
|
4973
|
+
* Private methods.
|
|
4974
|
+
*/
|
|
4975
|
+
this.kick = debounce(() => {
|
|
4976
|
+
this.tick = Date.now();
|
|
4977
|
+
}, 100); // will trigger re-render
|
|
4978
|
+
this.filterMap = needle => {
|
|
4979
|
+
if (needle === "all") {
|
|
4980
|
+
return Array.from(this.items);
|
|
4981
|
+
}
|
|
4982
|
+
return Array.from(this.items).filter(item => needle === item[1].group);
|
|
4983
|
+
};
|
|
4984
|
+
}
|
|
4985
|
+
/**
|
|
4986
|
+
* Component lifecycle events.
|
|
4987
|
+
*/
|
|
4988
|
+
componentWillLoad() {
|
|
4989
|
+
if (typeof this.groups === "string") {
|
|
4990
|
+
this.internalGroupArray = sanitizeString(this.groups);
|
|
4991
|
+
}
|
|
4992
|
+
else {
|
|
4993
|
+
this.internalGroupArray = this.groups;
|
|
4994
|
+
}
|
|
4995
|
+
if (typeof this.actions === "string") {
|
|
4996
|
+
this.internalActionsArray = sanitizeString(this.actions);
|
|
4997
|
+
}
|
|
4998
|
+
else {
|
|
4999
|
+
this.internalActionsArray = this.actions;
|
|
5000
|
+
}
|
|
5001
|
+
inheritGlobalTheme(this);
|
|
5002
|
+
}
|
|
5003
|
+
/**
|
|
5004
|
+
* Method to force an update of a tabular data array.
|
|
5005
|
+
* when called the method will rerender the entire tabular structure.
|
|
5006
|
+
*/
|
|
5007
|
+
async updateTable(passedItems = undefined) {
|
|
5008
|
+
this.items = new Map(passedItems || this.items);
|
|
5009
|
+
this.kick();
|
|
5010
|
+
}
|
|
5011
|
+
render() {
|
|
5012
|
+
return (h$1(Host, { class: {
|
|
5013
|
+
"duet-theme-turva": this.theme === "turva",
|
|
5014
|
+
} }, this.internalGroupArray.map(group => {
|
|
5015
|
+
const currentGroup = this.filterMap(group.id);
|
|
5016
|
+
if (!currentGroup.length) {
|
|
5017
|
+
return;
|
|
5018
|
+
}
|
|
5019
|
+
return (h$1("duet-table", { variation: "plain", breakpoint: "none", role: "", margin: this.hideGroups ? "none" : "auto" }, h$1("table", { class: "duet-editable-table", "aria-role": this.accessibleRole }, h$1("thead", { class: "duet-editable-table-header" }, h$1("tr", null, h$1("th", { class: {
|
|
5020
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
5021
|
+
} }, !this.hideGroups ? (getLocaleString(group.label)) : (h$1("duet-visually-hidden", null, getLocaleString(group.label)))), h$1("th", { class: {
|
|
5022
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
5023
|
+
} }, h$1("duet-visually-hidden", null, group.actionLabel
|
|
5024
|
+
? getLocaleString(group.actionLabel)
|
|
5025
|
+
: getLocaleString(this.actionLabelDefaults))))), h$1("tbody", null, currentGroup.map(dataAsArray => {
|
|
5026
|
+
const [key, value] = dataAsArray;
|
|
5027
|
+
return (h$1("duet-editable-table-item", { keyName: key, data: Object.assign({}, value), groupId: group.id, part: group.id, actions: this.internalActionsArray }));
|
|
5028
|
+
})))));
|
|
5029
|
+
})));
|
|
5030
|
+
}
|
|
5031
|
+
get element() { return this; }
|
|
5032
|
+
static get style() { return duetEditableTableCss; }
|
|
5033
|
+
};
|
|
5034
|
+
|
|
5035
|
+
const duetEditableTableButtonCss = "*.sc-duet-editable-table-button,*.sc-duet-editable-table-button::after,*.sc-duet-editable-table-button::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button{display:flex;align-content:space-between;justify-content:center;min-width:32px;max-width:32px;height:100%;min-height:32px;max-height:32px;padding:0;margin:0;cursor:pointer !important;background-color:transparent;border:1px solid;border-radius:50%}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button duet-icon.sc-duet-editable-table-button{align-self:center}";
|
|
5036
|
+
|
|
5037
|
+
let DuetEditableTableButton$1 = class extends H {
|
|
5038
|
+
constructor() {
|
|
5039
|
+
super();
|
|
5040
|
+
this.__registerHost();
|
|
5041
|
+
this.duetEditableItemAction = createEvent$2(this, "duetEditableItemAction", 7);
|
|
5042
|
+
this.isHovering = false;
|
|
5043
|
+
/**
|
|
5044
|
+
* Theme of the empty state component.
|
|
5045
|
+
*/
|
|
5046
|
+
this.theme = "";
|
|
5047
|
+
/**
|
|
5048
|
+
* action items passed from host component
|
|
5049
|
+
* @internal
|
|
5050
|
+
*/
|
|
5051
|
+
this.actions = undefined;
|
|
5052
|
+
/**
|
|
5053
|
+
* uid that gets passed along when the action is emitted
|
|
5054
|
+
* @internal
|
|
5055
|
+
*/
|
|
5056
|
+
this.uid = "";
|
|
5057
|
+
/**
|
|
5058
|
+
* group associated with action
|
|
5059
|
+
* @internal
|
|
5060
|
+
*/
|
|
5061
|
+
this.group = "";
|
|
5062
|
+
/**
|
|
5063
|
+
* key of the item in the map
|
|
5064
|
+
* @internal
|
|
5065
|
+
*/
|
|
5066
|
+
this.keyName = "";
|
|
5067
|
+
this.onMouseEnter = () => {
|
|
5068
|
+
this.isHovering = true;
|
|
5069
|
+
};
|
|
5070
|
+
this.onMouseLeave = () => {
|
|
5071
|
+
this.isHovering = false;
|
|
5072
|
+
};
|
|
5073
|
+
}
|
|
5074
|
+
/**
|
|
5075
|
+
/**
|
|
5076
|
+
* Component lifecycle events.
|
|
5077
|
+
*/
|
|
5078
|
+
componentWillLoad() {
|
|
5079
|
+
inheritGlobalTheme(this);
|
|
4694
5080
|
}
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
// b) clicking another date picker's button should close the current calendar
|
|
4709
|
-
// and open the new one. this means we can't stopPropagation() on the button itself
|
|
4710
|
-
const isClickOutside = e
|
|
4711
|
-
.composedPath()
|
|
4712
|
-
.every(node => node !== this.dialogWrapperNode && node !== this.datePickerButton);
|
|
4713
|
-
if (isClickOutside) {
|
|
4714
|
-
this.hide(false);
|
|
4715
|
-
}
|
|
5081
|
+
/**
|
|
5082
|
+
/**
|
|
5083
|
+
* private functions
|
|
5084
|
+
*/
|
|
5085
|
+
emitActionEvent(ev) {
|
|
5086
|
+
this.duetEditableItemAction.emit({
|
|
5087
|
+
originalEvent: ev,
|
|
5088
|
+
uid: this.uid,
|
|
5089
|
+
group: this.group,
|
|
5090
|
+
action: this.actions.id,
|
|
5091
|
+
keyName: this.keyName,
|
|
5092
|
+
component: "duet-editable-table-item",
|
|
5093
|
+
});
|
|
4716
5094
|
}
|
|
4717
5095
|
/**
|
|
4718
5096
|
* render() function
|
|
4719
5097
|
* Always the last one in the class.
|
|
4720
5098
|
*/
|
|
4721
5099
|
render() {
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
const minDate = parseISODate(this.min);
|
|
4728
|
-
const maxDate = parseISODate(this.max);
|
|
4729
|
-
const prevMonthDisabled = minDate != null && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear;
|
|
4730
|
-
const nextMonthDisabled = maxDate != null && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear;
|
|
4731
|
-
let minYear = selectedYear - 10;
|
|
4732
|
-
let maxYear = selectedYear + 10;
|
|
4733
|
-
if (minDate) {
|
|
4734
|
-
minYear = Math.max(minYear, minDate.getFullYear());
|
|
4735
|
-
}
|
|
4736
|
-
if (maxDate) {
|
|
4737
|
-
maxYear = Math.min(maxYear, maxDate.getFullYear());
|
|
4738
|
-
}
|
|
4739
|
-
return (h$1(Host, { class: { "duet-expand": this.expand, "duet-m-0": this.margin === "none" } }, h$1("div", { class: "duet-date" }, h$1(DatePickerInput, { value: this.value, valueAsDate: valueAsDate, formattedValue: this.inputValue, language: this.language, onInput: this.handleInputChange, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.toggleOpen, name: this.name, disabled: this.disabled, error: this.error, role: this.role, required: this.required, theme: this.theme, tooltip: this.tooltip, tooltipDirection: this.tooltipDirection, labelHidden: this.labelHidden, placeholder: this.placeholder, inputLabel: this.label, identifier: this.identifier, buttonRef: element => (this.datePickerButton = element), inputRef: element => (this.datePickerInput = element), accessibleActiveDescendant: this.accessibleActiveDescendant, accessibleControls: this.accessibleControls, accessibleOwns: this.accessibleOwns, accessibleDescribedBy: this.accessibleDescribedBy, echoPlaceholder: this.echoPlaceholder, caption: this.caption })), h$1("div", { class: {
|
|
4740
|
-
"duet-theme-turva": this.theme === "turva",
|
|
4741
|
-
"duet-date-dialog": true,
|
|
4742
|
-
left: this.direction === "left",
|
|
4743
|
-
error: !!this.error,
|
|
4744
|
-
active: this.open,
|
|
4745
|
-
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchMove: this.handleTouchMove, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h$1(FocusGuard, { moveFocusTo: this.focusedDayNode }), h$1("div", { class: "duet-date-dialog-wrapper", onKeyDown: this.handleEscKey, ref: element => (this.dialogWrapperNode = element) }, h$1("duet-visually-hidden", { "aria-live": "polite" }, text.keyboardInstruction), h$1("div", { class: "duet-date-dialog-mobile-header" }, h$1("duet-label", { margin: "none" }, this.label), h$1("button", { class: "duet-date-picker-close", ref: element => (this.closeButtonNode = element), onClick: () => this.hide(), type: "button" }, h$1("duet-icon", { name: "navigation-close-small", margin: "none", color: "currentColor", size: "xx-small" }), h$1("duet-visually-hidden", null, text.closeLabel))), h$1("div", { class: "duet-date-dialog-header" }, h$1("div", { class: "duet-date-dialog-dropdowns" }, h$1("duet-visually-hidden", null, h$1("h2", { id: this.dialogLabelId, "aria-live": "polite", "aria-atomic": "true" }, text.monthLabels[focusedMonth], " ", this.focusedDay.getFullYear())), h$1("duet-visually-hidden", null, h$1("label", { htmlFor: this.monthSelectId }, text.monthSelectLabel)), h$1("div", { class: "duet-date-dialog-select" }, h$1("select", { id: this.monthSelectId, class: "duet-date-month-select", ref: element => (this.monthSelectNode = element), onChange: this.handleMonthSelect }, text.monthLabels.map((month, i) => (h$1("option", { key: month, value: i, selected: i === focusedMonth, disabled: !inRange(new Date(focusedYear, i, 1), minDate ? startOfMonth(minDate) : null, maxDate ? endOfMonth(maxDate) : null) }, month)))), h$1("div", { class: "duet-date-dialog-select-label", "aria-hidden": "true" }, h$1("span", null, text.monthLabelsShort[focusedMonth]), h$1("duet-icon", { name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xxx-small" }))), h$1("duet-visually-hidden", null, h$1("label", { htmlFor: this.yearSelectId }, text.yearSelectLabel)), h$1("div", { class: "duet-date-dialog-select" }, h$1("select", { id: this.yearSelectId, class: "duet-date-year-select", onChange: this.handleYearSelect }, range(minYear, maxYear).map(year => (h$1("option", { key: year, selected: year === focusedYear }, year)))), h$1("div", { class: "duet-date-dialog-select-label", "aria-hidden": "true" }, h$1("span", null, this.focusedDay.getFullYear()), h$1("duet-icon", { name: "action-arrow-down-small", color: "currentColor", margin: "none", size: "xxx-small" })))), h$1("div", { class: "duet-date-dialog-buttons" }, h$1("button", { class: "duet-date-dialog-prev", onClick: this.handlePreviousMonthClick, disabled: prevMonthDisabled, type: "button" }, h$1("duet-icon", { name: "action-arrow-left-small", color: "currentColor", margin: "none", size: "xx-small" }), h$1("duet-visually-hidden", null, text.prevMonthLabel)), h$1("button", { class: "duet-date-dialog-next", onClick: this.handleNextMonthClick, disabled: nextMonthDisabled, type: "button" }, h$1("duet-icon", { name: "action-arrow-right-small", color: "currentColor", margin: "none", size: "xx-small" }), h$1("duet-visually-hidden", null, text.nextMonthLabel)))), h$1(DatePickerMonth, { selectedDate: valueAsDate, focusedDate: this.focusedDay, onDateSelect: this.handleDaySelect, onKeyboardNavigation: this.handleKeyboardNavigation, labelledById: this.dialogLabelId, language: this.language, theme: this.theme, min: minDate, max: maxDate, focusedDayRef: element => (this.focusedDayNode = element), onFocusEnter: this.enableActiveFocus, onFocusExit: this.disableActiveFocus })), h$1(FocusGuard, { moveFocusTo: this.closeButtonNode }))));
|
|
5100
|
+
return (h$1("button", { style: {
|
|
5101
|
+
"border-color": this.isHovering
|
|
5102
|
+
? getColorByName(this.actions.color_hover)
|
|
5103
|
+
: getColorByName(this.actions.color),
|
|
5104
|
+
}, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, role: "menuitem", class: "duet-editable-table-actions-items-button", "aria-label": this.actions.label ? getLocaleString(this.actions.label) : undefined, onClick: ev => this.emitActionEvent(ev) }, h$1("duet-icon", { class: "duet-editable-table-actions-items-icon", size: "x-small", name: this.actions.icon, color: this.isHovering ? this.actions.color_hover : this.actions.color, margin: "none" })));
|
|
4746
5105
|
}
|
|
4747
|
-
get
|
|
4748
|
-
static get
|
|
4749
|
-
"min": ["updateValidity"],
|
|
4750
|
-
"max": ["updateValidity"],
|
|
4751
|
-
"value": ["updateValidity", "updateInternalValue"],
|
|
4752
|
-
"required": ["updateValidity"]
|
|
4753
|
-
}; }
|
|
4754
|
-
static get style() { return duetDatePickerCss; }
|
|
5106
|
+
get el() { return this; }
|
|
5107
|
+
static get style() { return duetEditableTableButtonCss; }
|
|
4755
5108
|
};
|
|
4756
5109
|
|
|
4757
|
-
|
|
5110
|
+
//simple functional component that renders the data in the table
|
|
5111
|
+
const TableData = ({ data, groupId }, _children) => {
|
|
5112
|
+
if (typeof data === "string") {
|
|
5113
|
+
return h("td", { innerHTML: data, class: "duet-editable-table-content", part: `${groupId}content` });
|
|
5114
|
+
}
|
|
5115
|
+
else {
|
|
5116
|
+
return (h("td", { class: "duet-editable-table-content", part: `${groupId}content` }, data));
|
|
5117
|
+
}
|
|
5118
|
+
};
|
|
4758
5119
|
|
|
4759
|
-
|
|
5120
|
+
const duetEditableTableItemCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{display:table-row;height:32px}.duet-editable-table-content,.duet-editable-table-actions{height:32px;padding:12px 0;vertical-align:middle;break-word:break-all;border-bottom:1px solid #e1e3e6}.duet-editable-table-actions-items{display:flex;justify-content:flex-end}.duet-editable-table-actions-items duet-editable-table-button{padding-left:8px}.duet-editable-table .editable-item-small{font-size:0.75rem;font-weight:400}";
|
|
5121
|
+
|
|
5122
|
+
let DuetEditableTableItem$1 = class extends H {
|
|
4760
5123
|
constructor() {
|
|
4761
5124
|
super();
|
|
4762
5125
|
this.__registerHost();
|
|
4763
|
-
|
|
5126
|
+
this.__attachShadow();
|
|
5127
|
+
this.duetEditableItemAction = createEvent$2(this, "duetEditableItemAction", 7);
|
|
5128
|
+
this.isHovering = false;
|
|
4764
5129
|
/**
|
|
4765
|
-
* Theme of the
|
|
5130
|
+
* Theme of the empty state component.
|
|
4766
5131
|
*/
|
|
4767
5132
|
this.theme = "";
|
|
4768
5133
|
/**
|
|
4769
|
-
*
|
|
5134
|
+
* Actions that can be performed on the element
|
|
4770
5135
|
*/
|
|
4771
|
-
this.
|
|
5136
|
+
this.actions = undefined;
|
|
5137
|
+
/**
|
|
5138
|
+
* GroupId used to pierce the shadowdom - gets concatenated with "content & actions" and used as part="groupIDcontent/actions" to pierce the content/Action item
|
|
5139
|
+
* @internal
|
|
5140
|
+
*/
|
|
5141
|
+
this.groupId = "";
|
|
5142
|
+
/**
|
|
5143
|
+
* Key used to identify item, when running actions
|
|
5144
|
+
*/
|
|
5145
|
+
this.keyName = "";
|
|
5146
|
+
/**
|
|
5147
|
+
* Object of data itemsused to render the entire row
|
|
5148
|
+
*/
|
|
5149
|
+
this.data = undefined;
|
|
5150
|
+
}
|
|
5151
|
+
watchPropHandler(_newValue, _oldValue) {
|
|
5152
|
+
// console.log("The new value of activated is: ", _newValue)
|
|
4772
5153
|
}
|
|
4773
5154
|
/**
|
|
5155
|
+
/**
|
|
4774
5156
|
* Component lifecycle events.
|
|
4775
5157
|
*/
|
|
4776
5158
|
componentWillLoad() {
|
|
4777
5159
|
inheritGlobalTheme(this);
|
|
4778
5160
|
}
|
|
5161
|
+
/**
|
|
5162
|
+
/**
|
|
5163
|
+
* private functions
|
|
5164
|
+
*/
|
|
4779
5165
|
/**
|
|
4780
5166
|
* render() function
|
|
4781
5167
|
* Always the last one in the class.
|
|
4782
5168
|
*/
|
|
4783
5169
|
render() {
|
|
4784
|
-
return (h$1("div", { class: {
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
}
|
|
5170
|
+
return (h$1(Host, { role: "row" }, h$1(TableData, { data: this.data.item, groupId: this.groupId }), h$1("td", { class: "duet-editable-table-actions" }, h$1("div", { class: "duet-editable-table-actions-items", part: `${this.groupId}actions` }, this.actions.map(result => {
|
|
5171
|
+
const { map = undefined } = result;
|
|
5172
|
+
// if map has been specified, only show the current action if groupID matches the map array
|
|
5173
|
+
if (map && !map.includes(this.groupId)) {
|
|
5174
|
+
return;
|
|
5175
|
+
}
|
|
5176
|
+
return (h$1("duet-editable-table-button", { keyName: this.keyName, group: this.data.group, uid: this.data.uid, actions: result, theme: this.theme }));
|
|
5177
|
+
})))));
|
|
4790
5178
|
}
|
|
4791
|
-
get
|
|
4792
|
-
static get
|
|
5179
|
+
get el() { return this; }
|
|
5180
|
+
static get watchers() { return {
|
|
5181
|
+
"data": ["watchPropHandler"]
|
|
5182
|
+
}; }
|
|
5183
|
+
static get style() { return duetEditableTableItemCss; }
|
|
4793
5184
|
};
|
|
4794
5185
|
|
|
4795
5186
|
const duetEmptyStateCss = "*,*::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:block;width:100%;height:100%}.duet-empty-state{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;width:100%;height:100%;padding:48px;color:#00294d;text-align:center;background:#f5f8fa;border-radius:4px}.duet-empty-state.duet-theme-turva{color:#171c3a;background:#f5f5f7}";
|
|
4796
5187
|
|
|
4797
|
-
let DuetEmptyState$1 = class extends
|
|
5188
|
+
let DuetEmptyState$1 = class extends H {
|
|
4798
5189
|
constructor() {
|
|
4799
5190
|
super();
|
|
4800
5191
|
this.__registerHost();
|
|
4801
|
-
|
|
5192
|
+
this.__attachShadow();
|
|
4802
5193
|
/**
|
|
4803
5194
|
* Theme of the empty state component.
|
|
4804
5195
|
*/
|
|
@@ -4834,11 +5225,11 @@ let DuetEmptyState$1 = class extends HTMLElement {
|
|
|
4834
5225
|
|
|
4835
5226
|
const duetFieldsetCss = "*,*::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;margin-bottom:12px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}fieldset{border:0}legend{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-legend-wrapper{position:relative;display:block;width:100%;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:600;line-height:1.5;color:#00294d;text-align:left;background:transparent}.duet-theme-turva .duet-legend-wrapper{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}.duet-fieldset-label{margin-bottom:12px !important;margin-top:8px}.duet-legend-has-caption .duet-fieldset-label{margin-bottom:6px !important}.duet-legend-has-tooltip .duet-fieldset-label{padding-right:36px}@media (min-width: 48em){.duet-legend-has-tooltip .duet-fieldset-label{margin-bottom:3px !important;padding-right:0}}@media (min-width: 48em){.duet-legend-has-tooltip.duet-legend-has-caption .duet-fieldset-label{margin-bottom:-3px !important}}.duet-fieldset-caption{margin-bottom:12px !important}.duet-fieldset-help{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:#de2362;border-radius:4px}.duet-fieldset-help span{display:block;margin-top:12px}.duet-theme-turva .duet-fieldset-help{color:#e02a0d}::slotted(duet-tooltip){position:absolute;top:4px;right:0}@media (min-width: 48em){::slotted(duet-tooltip){position:relative;right:auto}}.duet-legend-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
4836
5227
|
|
|
4837
|
-
let DuetFieldset$1 = class extends
|
|
5228
|
+
let DuetFieldset$1 = class extends H {
|
|
4838
5229
|
constructor() {
|
|
4839
5230
|
super();
|
|
4840
5231
|
this.__registerHost();
|
|
4841
|
-
|
|
5232
|
+
this.__attachShadow();
|
|
4842
5233
|
this.errorId = createID("DuetError");
|
|
4843
5234
|
this.labelId = createID("DuetLabel");
|
|
4844
5235
|
this.hasTooltip = false;
|
|
@@ -4902,11 +5293,11 @@ const createEvent$1 = (ev, data) => ({
|
|
|
4902
5293
|
data,
|
|
4903
5294
|
originalEvent: ev,
|
|
4904
5295
|
});
|
|
4905
|
-
let DuetFooter$1 = class extends
|
|
5296
|
+
let DuetFooter$1 = class extends H {
|
|
4906
5297
|
constructor() {
|
|
4907
5298
|
super();
|
|
4908
5299
|
this.__registerHost();
|
|
4909
|
-
|
|
5300
|
+
this.__attachShadow();
|
|
4910
5301
|
this.duetChange = createEvent$2(this, "duetChange", 3);
|
|
4911
5302
|
this.duetLogoClick = createEvent$2(this, "duetLogoClick", 7);
|
|
4912
5303
|
this.duetMenuClick = createEvent$2(this, "duetMenuClick", 7);
|
|
@@ -4951,7 +5342,7 @@ let DuetFooter$1 = class extends HTMLElement {
|
|
|
4951
5342
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
4952
5343
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
4953
5344
|
*/
|
|
4954
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
5345
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults, this.language);
|
|
4955
5346
|
/**
|
|
4956
5347
|
* Component event handling.
|
|
4957
5348
|
*/
|
|
@@ -5023,10 +5414,11 @@ const duetGridCss = ".sc-duet-grid-h{box-sizing:border-box;padding:0;margin:0;ba
|
|
|
5023
5414
|
function isGridItem(element) {
|
|
5024
5415
|
return element.tagName.toLowerCase() === "duet-grid-item";
|
|
5025
5416
|
}
|
|
5026
|
-
let DuetGrid$1 = class extends
|
|
5417
|
+
let DuetGrid$1 = class extends H {
|
|
5027
5418
|
constructor() {
|
|
5028
5419
|
super();
|
|
5029
5420
|
this.__registerHost();
|
|
5421
|
+
this.distributeFormElement = false;
|
|
5030
5422
|
/**
|
|
5031
5423
|
* Enable or disable the automatic responsive behaviour of the grid component.
|
|
5032
5424
|
* Setting this option to "true" makes sure that contents are stacked vertically
|
|
@@ -5043,7 +5435,9 @@ let DuetGrid$1 = class extends HTMLElement {
|
|
|
5043
5435
|
*/
|
|
5044
5436
|
this.direction = "horizontal";
|
|
5045
5437
|
/**
|
|
5046
|
-
* Adjusts the vertical alignment of the grid items
|
|
5438
|
+
* Adjusts the vertical alignment of the grid items, if set to "form_distribute"
|
|
5439
|
+
* the grid will try to calculate correct paddings for any duet-input fields inside duet-grid-items,
|
|
5440
|
+
* so that they align even when displaying errors.
|
|
5047
5441
|
*/
|
|
5048
5442
|
this.alignment = "top";
|
|
5049
5443
|
/**
|
|
@@ -5055,14 +5449,34 @@ let DuetGrid$1 = class extends HTMLElement {
|
|
|
5055
5449
|
*/
|
|
5056
5450
|
this.mobile = "";
|
|
5057
5451
|
}
|
|
5452
|
+
/**
|
|
5453
|
+
* Private functions
|
|
5454
|
+
*/
|
|
5455
|
+
/**
|
|
5456
|
+
* Returns the element height including margins
|
|
5457
|
+
* @param element - element
|
|
5458
|
+
* @returns {number}
|
|
5459
|
+
*/
|
|
5460
|
+
outerHeight(element) {
|
|
5461
|
+
const height = element.offsetHeight, style = window.getComputedStyle(element);
|
|
5462
|
+
return ["top", "bottom"]
|
|
5463
|
+
.map(side => parseInt(style[`margin-${side}`]))
|
|
5464
|
+
.reduce((total, side) => total + side, height);
|
|
5465
|
+
}
|
|
5058
5466
|
/**
|
|
5059
5467
|
* Component lifecycle events.
|
|
5060
5468
|
*/
|
|
5061
5469
|
async connectedCallback() {
|
|
5062
5470
|
const el = this.element;
|
|
5471
|
+
this.distributeFormElement = this.alignment === "form_distribute";
|
|
5063
5472
|
this.mutationO = watchForOptions(el, "duet-grid-item", () => {
|
|
5064
5473
|
this.updateGridItems();
|
|
5065
5474
|
});
|
|
5475
|
+
if (this.distributeFormElement) {
|
|
5476
|
+
this.mutation1 = watchForElement(el, "duet-input", () => {
|
|
5477
|
+
this.updateGridItemsWithInputFields();
|
|
5478
|
+
});
|
|
5479
|
+
}
|
|
5066
5480
|
this.updateGridItems();
|
|
5067
5481
|
}
|
|
5068
5482
|
disconnectedCallback() {
|
|
@@ -5070,6 +5484,10 @@ let DuetGrid$1 = class extends HTMLElement {
|
|
|
5070
5484
|
this.mutationO.disconnect();
|
|
5071
5485
|
this.mutationO = undefined;
|
|
5072
5486
|
}
|
|
5487
|
+
if (this.mutation1) {
|
|
5488
|
+
this.mutation1.disconnect();
|
|
5489
|
+
this.mutation1 = undefined;
|
|
5490
|
+
}
|
|
5073
5491
|
}
|
|
5074
5492
|
/**
|
|
5075
5493
|
* Local methods
|
|
@@ -5081,6 +5499,27 @@ let DuetGrid$1 = class extends HTMLElement {
|
|
|
5081
5499
|
item.breakpoint = this.breakpoint;
|
|
5082
5500
|
});
|
|
5083
5501
|
}
|
|
5502
|
+
async updateGridItemsWithInputFields() {
|
|
5503
|
+
const items = Array.from(this.element.children).filter(isGridItem);
|
|
5504
|
+
let maxHeight = 0;
|
|
5505
|
+
const sizes = [];
|
|
5506
|
+
items.forEach(item => {
|
|
5507
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
5508
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
5509
|
+
sizes.push(height);
|
|
5510
|
+
});
|
|
5511
|
+
maxHeight = Math.max(...sizes);
|
|
5512
|
+
items.forEach(item => {
|
|
5513
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
5514
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
5515
|
+
if (height < maxHeight) {
|
|
5516
|
+
item.setAttribute("style", `padding-bottom: ${maxHeight - height}px;`);
|
|
5517
|
+
}
|
|
5518
|
+
else if (height === maxHeight) {
|
|
5519
|
+
item.setAttribute("style", `padding-bottom: 0px;`);
|
|
5520
|
+
}
|
|
5521
|
+
});
|
|
5522
|
+
}
|
|
5084
5523
|
/**
|
|
5085
5524
|
* render() function
|
|
5086
5525
|
* Always the last one in the class.
|
|
@@ -5090,7 +5529,7 @@ let DuetGrid$1 = class extends HTMLElement {
|
|
|
5090
5529
|
"duet-grid": true,
|
|
5091
5530
|
"duet-no-stacking": !this.responsive,
|
|
5092
5531
|
"duet-grid-align-top": this.alignment === "top",
|
|
5093
|
-
"duet-grid-align-bottom": this.alignment === "bottom",
|
|
5532
|
+
"duet-grid-align-bottom": this.alignment === "bottom" || this.alignment === "form_distribute",
|
|
5094
5533
|
"duet-grid-align-center": this.alignment === "center",
|
|
5095
5534
|
"duet-grid-align-stretch": this.alignment === "stretch",
|
|
5096
5535
|
"duet-grid-align-baseline": this.alignment === "baseline",
|
|
@@ -5120,7 +5559,7 @@ let DuetGrid$1 = class extends HTMLElement {
|
|
|
5120
5559
|
|
|
5121
5560
|
const duetGridItemCss = ".sc-duet-grid-item-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:16px !important;min-width:0;max-width:100%;flex:0 0 auto;padding-right:8px;padding-left:8px;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-style:normal;font-weight:400;line-height:1.5;color:#00294d}.sc-duet-grid-item-h:first-child,.sc-duet-grid-item-h:first-of-type{padding-left:0}.sc-duet-grid-item-h:last-child,.sc-duet-grid-item-h:last-of-type{padding-right:0}@media (max-width: 35.9375em){.duet-grid-item-responsive.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important;padding-right:0;padding-left:0}}@media screen and (max-width: 47.9375em){.duet-grid-item-br-medium.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important}}@media screen and (max-width: 47.9375em){.duet-grid-item-responsive.duet-grid-item-br-medium.sc-duet-grid-item-h{padding-right:0;padding-left:0}}@media screen and (max-width: 64em){.duet-grid-item-br-x-large.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important}}@media screen and (max-width: 64em){.duet-grid-item-responsive.duet-grid-item-br-x-large.sc-duet-grid-item-h{padding-right:0;padding-left:0}}.duet-grid-item-fill.sc-duet-grid-item-h{flex:1 1 auto;width:100%}.duet-theme-turva.sc-duet-grid-item-h{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}.duet-m-0.sc-duet-grid-item-h{padding:0 !important;margin:0 !important}";
|
|
5122
5561
|
|
|
5123
|
-
let DuetGridItem$1 = class extends
|
|
5562
|
+
let DuetGridItem$1 = class extends H {
|
|
5124
5563
|
constructor() {
|
|
5125
5564
|
super();
|
|
5126
5565
|
this.__registerHost();
|
|
@@ -5373,11 +5812,11 @@ const createEvent = (ev, data) => ({
|
|
|
5373
5812
|
data,
|
|
5374
5813
|
originalEvent: ev,
|
|
5375
5814
|
});
|
|
5376
|
-
let DuetHeader$1 = class extends
|
|
5815
|
+
let DuetHeader$1 = class extends H {
|
|
5377
5816
|
constructor() {
|
|
5378
5817
|
super();
|
|
5379
5818
|
this.__registerHost();
|
|
5380
|
-
|
|
5819
|
+
this.__attachShadow();
|
|
5381
5820
|
this.duetChange = createEvent$2(this, "duetChange", 3);
|
|
5382
5821
|
this.duetSessionClick = createEvent$2(this, "duetSessionClick", 7);
|
|
5383
5822
|
this.duetUserClick = createEvent$2(this, "duetUserClick", 7);
|
|
@@ -5414,10 +5853,26 @@ let DuetHeader$1 = class extends HTMLElement {
|
|
|
5414
5853
|
*/
|
|
5415
5854
|
this.language = getLanguage();
|
|
5416
5855
|
/**
|
|
5417
|
-
*
|
|
5418
|
-
*
|
|
5856
|
+
* Default strings for accessibleI18nLabels
|
|
5857
|
+
* @default {
|
|
5858
|
+
fi: {
|
|
5859
|
+
skipLabel: "Siirry pääsisältöön",
|
|
5860
|
+
changeLanguage: "Vaihda kieltä",
|
|
5861
|
+
activeLanguage: "Suomi valittuna",
|
|
5862
|
+
},
|
|
5863
|
+
sv: {
|
|
5864
|
+
skipLabel: "Hoppa till huvudinnehåll",
|
|
5865
|
+
changeLanguage: "Ändra Språk",
|
|
5866
|
+
activeLanguage: "Svenska valt",
|
|
5867
|
+
},
|
|
5868
|
+
en: {
|
|
5869
|
+
skipLabel: "Skip to main content",
|
|
5870
|
+
changeLanguage: "Change language",
|
|
5871
|
+
activeLanguage: "English selected",
|
|
5872
|
+
},
|
|
5873
|
+
}
|
|
5419
5874
|
*/
|
|
5420
|
-
this.
|
|
5875
|
+
this.accessibleI18nLabelsDefaults = {
|
|
5421
5876
|
fi: {
|
|
5422
5877
|
skipLabel: "Siirry pääsisältöön",
|
|
5423
5878
|
changeLanguage: "Vaihda kieltä",
|
|
@@ -5454,7 +5909,7 @@ let DuetHeader$1 = class extends HTMLElement {
|
|
|
5454
5909
|
},
|
|
5455
5910
|
}
|
|
5456
5911
|
*/
|
|
5457
|
-
this.accessibleI18nLabels = getLocaleString(this.
|
|
5912
|
+
this.accessibleI18nLabels = getLocaleString(this.accessibleI18nLabelsDefaults);
|
|
5458
5913
|
/**
|
|
5459
5914
|
* Property to change accessibleLabelExternal defaults on the component.
|
|
5460
5915
|
* normally you would handle these strings on an application level and override @accessibleLabelExternal when needed
|
|
@@ -5470,7 +5925,7 @@ let DuetHeader$1 = class extends HTMLElement {
|
|
|
5470
5925
|
* Property to change accessibleLabel defaults on the component.
|
|
5471
5926
|
* normally you would handle these strings on an application level and override @accessibleLabel when needed
|
|
5472
5927
|
*/
|
|
5473
|
-
this.
|
|
5928
|
+
this.accessibleLabelDefaults = {
|
|
5474
5929
|
fi: "Valikko",
|
|
5475
5930
|
sv: "Meny",
|
|
5476
5931
|
en: "Menu",
|
|
@@ -5484,7 +5939,7 @@ let DuetHeader$1 = class extends HTMLElement {
|
|
|
5484
5939
|
en: "Menu",
|
|
5485
5940
|
}
|
|
5486
5941
|
*/
|
|
5487
|
-
this.accessibleLabel = getLocaleString(this.
|
|
5942
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefaults);
|
|
5488
5943
|
/**
|
|
5489
5944
|
* URL that the logo link points to.
|
|
5490
5945
|
*/
|
|
@@ -5763,13 +6218,13 @@ let DuetHeader$1 = class extends HTMLElement {
|
|
|
5763
6218
|
static get style() { return duetHeaderCss; }
|
|
5764
6219
|
};
|
|
5765
6220
|
|
|
5766
|
-
const duetHeadingCss = "*,*::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;position:relative;display:block;width:100%}.duet-heading{margin-bottom:16px !important;width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:normal;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.25;color:#00294d;text-decoration:none;letter-spacing:-0.01rem}@media (min-width: 36em){.duet-heading{margin-bottom:20px !important}}.duet-heading.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:italic;font-weight:700;color:#171c3a}.duet-heading.duet-heading-border{padding-bottom:20px;border-bottom:1px solid #e1e3e6}.duet-heading.duet-heading-hyphenate{-webkit-hyphens:auto;hyphens:auto}.duet-heading.h0{font-size:9.4vw}.duet-heading.h0.duet-p-0{padding:0 !important}.duet-heading.h0.duet-m-0{margin:0 !important}@media (max-width: 31.914893617rem){.duet-heading.h0{font-size:3rem}}@media (min-width: 47.8723404255rem){.duet-heading.h0{font-size:4.5rem}}@media (max-width: 22.5em){.duet-heading.h0{font-size:2.25rem}}.duet-heading.h1{font-size:7vw}.duet-heading.h1.duet-p-0{padding:0 !important}.duet-heading.h1.duet-m-0{margin:0 !important}@media (max-width: 32.1428571429rem){.duet-heading.h1{font-size:2.25rem}}@media (min-width: 42.8571428571rem){.duet-heading.h1{font-size:3rem}}@media (max-width: 22.5em){.duet-heading.h1{font-size:1.5rem}}.duet-heading.h2{font-size:5.8vw}.duet-heading.h2.duet-p-0{padding:0 !important}.duet-heading.h2.duet-m-0{margin:0 !important}@media (max-width: 25.8620689655rem){.duet-heading.h2{font-size:1.5rem}}@media (min-width: 38.7931034483rem){.duet-heading.h2{font-size:2.25rem}}@media (max-width: 22.5em){.duet-heading.h2{font-size:1.375rem}}.duet-heading.h3{margin-bottom:12px !important;font-size:4.2vw}.duet-heading.h3.duet-p-0{padding:0 !important}.duet-heading.h3.duet-m-0{margin:0 !important}@media (max-width: 29.7619047619rem){.duet-heading.h3{font-size:1.25rem}}@media (min-width: 35.7142857143rem){.duet-heading.h3{font-size:1.5rem}}.duet-heading.h3.duet-theme-turva{font-style:normal}.duet-heading.h3.duet-heading-border{padding-bottom:20px}.duet-heading.h4{margin-bottom:8px !important;font-size:4vw;letter-spacing:0}.duet-heading.h4.duet-p-0{padding:0 !important}.duet-heading.h4.duet-m-0{margin:0 !important}@media (max-width: 27.5rem){.duet-heading.h4{font-size:1.1rem}}@media (min-width: 31.25rem){.duet-heading.h4{font-size:1.25rem}}.duet-heading.h4.duet-theme-turva{font-style:normal;font-weight:700}.duet-heading.h4.duet-heading-border{padding-bottom:20px}.duet-heading.h5{margin-bottom:8px !important;font-size:4vw;font-weight:600;letter-spacing:0}.duet-heading.h5.duet-p-0{padding:0 !important}.duet-heading.h5.duet-m-0{margin:0 !important}@media (max-width: 27.5rem){.duet-heading.h5{font-size:1.1rem}}@media (min-width: 28.4090909091rem){.duet-heading.h5{font-size:1.1363636364rem}}.duet-heading.h5.duet-theme-turva{font-style:normal;font-weight:700}.duet-heading.h5.duet-heading-border{padding-bottom:16px}.duet-heading.h6{margin-bottom:8px !important;font-size:1rem;font-weight:600;letter-spacing:0}.duet-heading.h6.duet-p-0{padding:0 !important}.duet-heading.h6.duet-m-0{margin:0 !important}.duet-heading.h6.duet-theme-turva{font-style:normal;font-weight:700}.duet-heading.h6.duet-heading-border{padding-bottom:16px}.duet-heading.duet-semibold,.duet-heading.duet-theme-turva.duet-semibold{font-style:normal !important;font-weight:600 !important}";
|
|
6221
|
+
const duetHeadingCss = "*,*::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;position:relative;display:block;width:100%}.duet-heading{margin-bottom:16px !important;width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:normal;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.25;color:#00294d;text-decoration:none;letter-spacing:-0.01rem;word-break:break-word}@media (min-width: 36em){.duet-heading{margin-bottom:20px !important}}.duet-heading.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:italic;font-weight:700;color:#171c3a}.duet-heading.duet-heading-border{padding-bottom:20px;border-bottom:1px solid #e1e3e6}.duet-heading.duet-heading-border.duet-heading-border-solid{border-bottom-color:#657787}.duet-heading.duet-heading-hyphenate{-webkit-hyphens:auto;hyphens:auto}.duet-heading.h0{font-size:9.4vw}.duet-heading.h0.duet-p-0{padding:0 !important}.duet-heading.h0.duet-m-0{margin:0 !important}@media (max-width: 31.914893617rem){.duet-heading.h0{font-size:3rem}}@media (min-width: 47.8723404255rem){.duet-heading.h0{font-size:4.5rem}}@media (max-width: 22.5em){.duet-heading.h0{font-size:2.25rem}}.duet-heading.h1{font-size:7vw}.duet-heading.h1.duet-p-0{padding:0 !important}.duet-heading.h1.duet-m-0{margin:0 !important}@media (max-width: 32.1428571429rem){.duet-heading.h1{font-size:2.25rem}}@media (min-width: 42.8571428571rem){.duet-heading.h1{font-size:3rem}}@media (max-width: 22.5em){.duet-heading.h1{font-size:1.5rem}}.duet-heading.h2{font-size:5.8vw}.duet-heading.h2.duet-p-0{padding:0 !important}.duet-heading.h2.duet-m-0{margin:0 !important}@media (max-width: 25.8620689655rem){.duet-heading.h2{font-size:1.5rem}}@media (min-width: 38.7931034483rem){.duet-heading.h2{font-size:2.25rem}}@media (max-width: 22.5em){.duet-heading.h2{font-size:1.375rem}}.duet-heading.h3{margin-bottom:12px !important;font-size:4.2vw}.duet-heading.h3.duet-p-0{padding:0 !important}.duet-heading.h3.duet-m-0{margin:0 !important}@media (max-width: 29.7619047619rem){.duet-heading.h3{font-size:1.25rem}}@media (min-width: 35.7142857143rem){.duet-heading.h3{font-size:1.5rem}}.duet-heading.h3.duet-theme-turva{font-style:normal}.duet-heading.h3.duet-heading-border{padding-bottom:20px}.duet-heading.h4{margin-bottom:8px !important;font-size:4vw;letter-spacing:0}.duet-heading.h4.duet-p-0{padding:0 !important}.duet-heading.h4.duet-m-0{margin:0 !important}@media (max-width: 27.5rem){.duet-heading.h4{font-size:1.1rem}}@media (min-width: 31.25rem){.duet-heading.h4{font-size:1.25rem}}.duet-heading.h4.duet-theme-turva{font-style:normal;font-weight:700}.duet-heading.h4.duet-heading-border{padding-bottom:20px}.duet-heading.h5{margin-bottom:8px !important;font-size:4vw;font-weight:600;letter-spacing:0}.duet-heading.h5.duet-p-0{padding:0 !important}.duet-heading.h5.duet-m-0{margin:0 !important}@media (max-width: 27.5rem){.duet-heading.h5{font-size:1.1rem}}@media (min-width: 28.4090909091rem){.duet-heading.h5{font-size:1.1363636364rem}}.duet-heading.h5.duet-theme-turva{font-style:normal;font-weight:700}.duet-heading.h5.duet-heading-border{padding-bottom:16px}.duet-heading.h6{margin-bottom:8px !important;font-size:1rem;font-weight:600;letter-spacing:0}.duet-heading.h6.duet-p-0{padding:0 !important}.duet-heading.h6.duet-m-0{margin:0 !important}.duet-heading.h6.duet-theme-turva{font-style:normal;font-weight:700}.duet-heading.h6.duet-heading-border{padding-bottom:16px}.duet-heading.duet-semibold,.duet-heading.duet-theme-turva.duet-semibold{font-style:normal !important;font-weight:600 !important}";
|
|
5767
6222
|
|
|
5768
|
-
let DuetHeading$1 = class extends
|
|
6223
|
+
let DuetHeading$1 = class extends H {
|
|
5769
6224
|
constructor() {
|
|
5770
6225
|
super();
|
|
5771
6226
|
this.__registerHost();
|
|
5772
|
-
|
|
6227
|
+
this.__attachShadow();
|
|
5773
6228
|
/**
|
|
5774
6229
|
* The actual heading level used in the HTML markup.
|
|
5775
6230
|
*/
|
|
@@ -5779,7 +6234,7 @@ let DuetHeading$1 = class extends HTMLElement {
|
|
|
5779
6234
|
*/
|
|
5780
6235
|
this.margin = "auto";
|
|
5781
6236
|
/**
|
|
5782
|
-
* Enable or disable the border underneath the heading
|
|
6237
|
+
* Enable or disable the border underneath the heading, solid will darken the border
|
|
5783
6238
|
*/
|
|
5784
6239
|
this.border = false;
|
|
5785
6240
|
/**
|
|
@@ -5812,11 +6267,12 @@ let DuetHeading$1 = class extends HTMLElement {
|
|
|
5812
6267
|
* Always the last one in the class.
|
|
5813
6268
|
*/
|
|
5814
6269
|
render() {
|
|
5815
|
-
const TagName = sanitizeString(this.level);
|
|
6270
|
+
const TagName = sanitizeString$1(this.level);
|
|
5816
6271
|
const color = getColorByName(this.color);
|
|
5817
6272
|
return (h$1(TagName, { class: {
|
|
5818
6273
|
"duet-heading": true,
|
|
5819
|
-
"duet-heading-border": this.border,
|
|
6274
|
+
"duet-heading-border": this.border !== false,
|
|
6275
|
+
"duet-heading-border-solid": this.border === "solid",
|
|
5820
6276
|
"duet-semibold": this.weight === "semibold",
|
|
5821
6277
|
"duet-heading-hyphenate": this.hyphenate,
|
|
5822
6278
|
"duet-m-0": this.margin === "none",
|
|
@@ -5830,11 +6286,11 @@ let DuetHeading$1 = class extends HTMLElement {
|
|
|
5830
6286
|
|
|
5831
6287
|
const duetHeroCss = "*,*::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:block;width:100%}.duet-hero{position:relative;display:block;width:100%;padding:48px 28px;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-style:normal;font-weight:400;line-height:1.5;text-decoration:none;text-shadow:none;text-transform:none;background:#00294d}.duet-hero.duet-p-0{padding:0 !important}.duet-hero.duet-m-0{margin:0 !important}.duet-hero.duet-hero-text-center{text-align:center !important}.duet-hero.duet-hero-light{padding-bottom:0 !important}@media (min-width: 62em){.duet-hero.duet-hero-light{padding-bottom:28px !important}}.duet-hero.duet-hero-with-image{padding-bottom:20px !important;margin-bottom:-36px}@media (min-width: 48em){.duet-hero.duet-hero-with-image{padding-bottom:28px !important}}@media (min-width: 62em){.duet-hero.duet-hero-with-image{padding-bottom:36px !important;margin-bottom:-20px}}.duet-hero.duet-hero-light,.duet-hero.duet-hero-with-image{color:#00294d;background-color:white;background-image:linear-gradient(#f3f9fc, #f9fcfe)}.duet-hero.duet-hero-light::before,.duet-hero.duet-hero-with-image::before{position:absolute;top:100%;left:0;z-index:-1;width:100%;height:400px;content:\"\";background-image:linear-gradient(#f9fcfe, white)}.duet-hero.duet-hero-light.duet-theme-turva,.duet-hero.duet-hero-with-image.duet-theme-turva{color:#171c3a;background-image:linear-gradient(#f5f5f7, #fafafb)}.duet-hero.duet-hero-light.duet-theme-turva::before,.duet-hero.duet-hero-with-image.duet-theme-turva::before{background-image:linear-gradient(#fafafb, white)}.duet-hero.duet-hero-gray{color:#00294d;background:#f5f8fa}.duet-hero.duet-hero-gray.duet-theme-turva{background:#f5f5f7}@media (min-width: 62em){.duet-hero.duet-hero-gray .duet-hero-text{display:inline-block;vertical-align:top}.duet-hero.duet-hero-gray .duet-hero-icon+.duet-hero-text{margin-left:28px}}@media (min-width: 62em){.duet-hero.duet-hero-gray-with-actions{padding-bottom:65.4545454545px}}@media (min-width: 62em){.duet-hero.duet-hero-gray-with-back{padding-top:72px}}.duet-hero.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";background:#c60c30}@media (min-width: 62em){.duet-hero{min-height:290px;padding:111.6px 56px;overflow:visible}}.duet-hero-icon{display:inline-block;vertical-align:top}@media (min-width: 62em){.duet-hero-icon{margin-top:-8px}}@media (min-width: 62em){.duet-hero-heading{margin-top:12px}}@media (min-width: 62em){.duet-hero-heading-has-pre{margin-top:0}}.duet-hero-wrapper{position:relative;width:100%;max-width:1110px;margin:0 auto;text-align:center}.duet-hero-left-align .duet-hero-wrapper{text-align:left}.duet-hero-with-image .duet-hero-wrapper{position:static}@media (min-width: 62em){.duet-hero-wrapper{text-align:left}}.duet-hero-text{max-width:50rem;margin:0 auto}.duet-hero-text-center .duet-hero-text{text-align:center !important}@media (min-width: 48em){.duet-hero-text{width:80%}.duet-hero-left-align .duet-hero-text{margin:0}}@media (min-width: 62em){.duet-hero-text{width:52%;max-width:none;margin-top:-10px;margin-left:0}.duet-hero-text-center .duet-hero-text{margin-left:auto}}.duet-hero:not(.duet-hero-with-image) .duet-hero-image{width:100%;max-width:400px;height:0;padding-bottom:50%;margin:28px auto 0;background-repeat:no-repeat;background-position:50% 50%;background-size:contain}@media (min-width: 36em){.duet-hero:not(.duet-hero-with-image) .duet-hero-image{padding-bottom:40%}}@media (min-width: 48em){.duet-hero:not(.duet-hero-with-image) .duet-hero-image{max-width:420px;padding-bottom:34%}.duet-hero-light .duet-hero:not(.duet-hero-with-image) .duet-hero-image{max-width:540px}}@media (min-width: 62em){.duet-hero:not(.duet-hero-with-image) .duet-hero-image{position:absolute;top:50%;right:0;padding-bottom:30%;margin:0;transform:translateY(-50%)}.duet-hero-light .duet-hero:not(.duet-hero-with-image) .duet-hero-image{right:-60px;padding-bottom:26%}.duet-hero-gray .duet-hero:not(.duet-hero-with-image) .duet-hero-image{right:-34px;padding-bottom:20%}}@media (min-width: 62em){.duet-hero-gray:not(.duet-hero-with-image) .duet-hero-image{right:-34px;padding-bottom:20%}}.duet-hero-image-wrapper{position:relative;width:80%;height:0;padding-bottom:80%;margin:-30px auto 36px;overflow:hidden;border-radius:28%;box-shadow:0 0 20px rgba(255, 255, 255, 0.5);transform:rotate(10deg)}.duet-theme-turva .duet-hero-image-wrapper{padding-bottom:68%;border-radius:44% 47% 38% 54%;transform:none}@media screen and (min-width: 440px){.duet-hero-image-wrapper{width:300px;padding-bottom:300px}.duet-theme-turva .duet-hero-image-wrapper{width:80%;padding-bottom:68%}}@media (min-width: 62em){.duet-hero-image-wrapper{position:absolute;top:-60px;right:-50px;width:470px;padding-bottom:470px;margin:0}.duet-theme-turva .duet-hero-image-wrapper{top:-40px;right:-80px;width:536px;padding-bottom:470px}}@media (min-width: 76.25em){.duet-hero-image-wrapper{top:-70px;right:-60px;width:600px;padding-bottom:600px}.duet-theme-turva .duet-hero-image-wrapper{top:-70px;right:-60px;width:650px;padding-bottom:600px}}@media screen and (min-width: 1450px){.duet-hero-image-wrapper{top:-70px;right:25px}.duet-theme-turva .duet-hero-image-wrapper{right:0}}.duet-hero-image-wrapper .duet-hero-image{position:absolute;top:-5%;left:-5%;width:110%;height:110%;background-repeat:no-repeat;background-position:50% 50%;background-size:cover;transform:rotate(-10deg)}.duet-theme-turva .duet-hero-image-wrapper .duet-hero-image{top:0;left:0;width:100%;height:100%;transform:none}.duet-hero-image-mask{position:relative;margin:-48px auto 0;overflow:hidden}@media (min-width: 62em){.duet-hero-image-mask{position:absolute;top:0;right:0;width:470px;height:460px;margin:0}}@media (min-width: 76.25em){.duet-hero-image-mask{width:650px;height:580px}}@media screen and (min-width: 1450px){.duet-hero-image-mask{right:50%;transform:translateX(110%)}.duet-theme-turva .duet-hero-image-mask{transform:translateX(108%)}}duet-heading+duet-button{margin-top:12px !important}.duet-hero-links{width:calc(100% + 56px);margin-top:48px;margin-left:-28px}.duet-hero-minimal .duet-hero-links{margin-top:28px}@media (min-width: 36em){.duet-hero-links{margin-top:72px}.duet-hero-minimal .duet-hero-links{margin-top:28px}}@media (min-width: 62em){.duet-hero-links{width:auto;margin:36px 0 0}.duet-hero-minimal .duet-hero-links{margin-top:28px}}.duet-hero-link{display:flex;align-items:center;width:100%;padding:16px 16px 8px;font-weight:600;-webkit-hyphens:auto;hyphens:auto;line-height:1.25;color:#0077b3;text-align:left;text-decoration:none;border-bottom:1px solid #e1e3e6;transition:background-color 300ms ease}.duet-hero-link:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-hero-link:focus,.duet-hero-link:focus.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-hero-link:hover,.duet-hero-link:hover .duet-hero-action-arrow{color:#004d80 !important;background:transparent !important}.duet-theme-turva .duet-hero-link:hover,.duet-theme-turva .duet-hero-link:hover .duet-hero-action-arrow{color:#940925 !important}.duet-theme-turva .duet-hero-link{color:#c60c30}@media (min-width: 36em){.duet-hero-link{padding:16px 16px 16px 28px}}@media (min-width: 62em){.duet-hero-link{display:inline-flex;width:auto;max-width:350px;padding:0;margin:0 28px 16px 0;border:0;border-radius:4px}}.duet-hero-link:hover{background:rgba(0, 0, 0, 0.02)}@media (min-width: 62em){.duet-hero-link:hover{background:transparent}}.duet-hero-link:first-of-type{border-top:1px solid #e1e3e6}@media (min-width: 62em){.duet-hero-link:first-of-type{margin-top:0;border:0}}.duet-hero-link:last-of-type{margin-bottom:-48px}@media (min-width: 62em){.duet-hero-link:last-of-type{margin-right:0;margin-bottom:0}}.duet-hero-link span{margin-top:-8px}@media (min-width: 36em){.duet-hero-link span{margin:0}}.duet-hero-action-icon{margin-right:8px}@media (min-width: 36em){.duet-hero-action-icon{margin-right:12px}}.duet-hero-action-arrow{margin:0 0 0 8px;color:#0077b3}@media (max-width: 35.9375em){.duet-hero-action-arrow{margin-top:-9px}}.duet-theme-turva .duet-hero-action-arrow{color:#c60c30}.duet-hero-back{margin-bottom:28px !important;display:flex;align-items:center;justify-content:center}.duet-hero-left-align .duet-hero-back{align-items:self-start;justify-content:flex-start}@media (min-width: 36em){.duet-hero-back{margin-bottom:36px !important}.duet-hero-minimal .duet-hero-back{margin-bottom:28px !important}}@media (min-width: 62em){.duet-hero-back{display:block}}.duet-hero-pre{display:inline-block;width:auto;margin-right:8px}.duet-hero-pre+duet-heading{margin-top:0 !important}";
|
|
5832
6288
|
|
|
5833
|
-
let DuetHero$1 = class extends
|
|
6289
|
+
let DuetHero$1 = class extends H {
|
|
5834
6290
|
constructor() {
|
|
5835
6291
|
super();
|
|
5836
6292
|
this.__registerHost();
|
|
5837
|
-
|
|
6293
|
+
this.__attachShadow();
|
|
5838
6294
|
this.duetClick = createEvent$2(this, "duetClick", 7);
|
|
5839
6295
|
this.duetAnalytics = createEvent$2(this, "duetAnalytics", 7);
|
|
5840
6296
|
/**
|
|
@@ -5899,15 +6355,15 @@ let DuetHero$1 = class extends HTMLElement {
|
|
|
5899
6355
|
*/
|
|
5900
6356
|
this.language = getLanguage();
|
|
5901
6357
|
/**
|
|
5902
|
-
*
|
|
5903
|
-
*
|
|
6358
|
+
* Defaults for accessibleLabelExternal
|
|
6359
|
+
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
5904
6360
|
*/
|
|
5905
6361
|
this.accessibleLabelExternalDefaults = DuetStringsExternalDefaults;
|
|
5906
6362
|
/**
|
|
5907
6363
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
5908
6364
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
5909
6365
|
*/
|
|
5910
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
6366
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
5911
6367
|
/**
|
|
5912
6368
|
* URL that the button links to.
|
|
5913
6369
|
*/
|
|
@@ -6073,16 +6529,8 @@ const isValid = (elm) => {
|
|
|
6073
6529
|
};
|
|
6074
6530
|
const buildIconUrl = (iconName) => {
|
|
6075
6531
|
// under normal operations the Icons should always be loaded from the CDN
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
const localURI = `http://localhost:3334/icons/lib/assets/${iconName}.svg`;
|
|
6079
|
-
const host = window.location.hostname;
|
|
6080
|
-
const re = /(localhost|loca\.lt|127\.0\.0\.1|0\.0\.0\.0)/i;
|
|
6081
|
-
if (host.match(re)) {
|
|
6082
|
-
return localURI;
|
|
6083
|
-
}
|
|
6084
|
-
else {
|
|
6085
|
-
return cdnURI;
|
|
6532
|
+
{
|
|
6533
|
+
return `${Env.cdnURIProd}/icons/${Env.duetIconVersion}/lib/assets/${iconName}.svg`;
|
|
6086
6534
|
}
|
|
6087
6535
|
};
|
|
6088
6536
|
const iconCache = {};
|
|
@@ -6117,11 +6565,11 @@ function fetchIconByUrl(url) {
|
|
|
6117
6565
|
|
|
6118
6566
|
const duetIconCss = "*,*::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;margin-bottom:16px !important;display:inline-block;width:auto;max-width:100%;color:inherit;-webkit-tap-highlight-color:transparent}@media (max-width: 35.9375em){:host(.duet-icon-has-outline){margin-bottom:0 !important}}@media (max-width: 35.9375em){:host(.duet-icon-has-background){margin-bottom:0 !important}}:host(.duet-m-0){margin:0 !important}@media (max-width: 35.9375em){:host(.duet-m-0){margin:0 !important}}.duet-icon{-webkit-user-select:none;user-select:none;width:100%;height:100%;transform-origin:top center}.duet-icon.duet-icon-has-outline{padding:12px;border-style:solid;border-width:1px;border-radius:50%}@media (max-width: 35.9375em){.duet-icon.duet-icon-has-outline{outline:1px solid transparent;transform:scale(0.8)}}.duet-icon.duet-icon-has-background{padding:16px;color:white;border-radius:50%}@media (max-width: 35.9375em){.duet-icon.duet-icon-has-background{outline:1px solid transparent;transform:scale(0.8)}}.duet-icon.duet-icon-has-background.duet-theme-turva,.duet-icon.duet-icon-has-background.duet-theme-default{color:white}.duet-icon.duet-icon-has-background.xxx-small .duet-icon-svg,.duet-icon.duet-icon-has-outline.xxx-small .duet-icon-svg{width:10px;height:10px}.duet-icon.duet-icon-has-background.xx-small .duet-icon-svg,.duet-icon.duet-icon-has-outline.xx-small .duet-icon-svg{width:16px;height:16px}@media (max-width: 35.9375em){.duet-icon.duet-icon-not-responsive{transform:scale(1) !important}}.duet-icon.duet-theme-default{color:#0077b3}.duet-icon.duet-theme-turva{color:#c60c30}.duet-icon.auto .duet-icon-svg{width:100%;height:100%}.duet-icon.xxx-small .duet-icon-svg{width:7px;height:7px}.duet-icon.duet-icon-has-background.xxx-small{padding:6px}.duet-icon.duet-icon-has-outline.xxx-small{padding:4px}.duet-icon.xx-small .duet-icon-svg{width:10px;height:10px}.duet-icon.duet-icon-has-background.xx-small{padding:8px}.duet-icon.duet-icon-has-outline.xx-small{padding:7px}.duet-icon.x-small .duet-icon-svg{width:16px;height:16px}.duet-icon.duet-icon-has-outline.x-small{padding:10px}.duet-icon.duet-icon-has-background.x-small{padding:12px}.duet-icon.small .duet-icon-svg{width:20px;height:20px}.duet-icon.duet-icon-has-background.small{padding:14px}.duet-icon.large .duet-icon-svg{width:30px;height:30px}.duet-icon.x-large .duet-icon-svg{width:36px;height:36px}.duet-icon.xx-large .duet-icon-svg{width:48px;height:48px}.duet-icon.xxx-large .duet-icon-svg{width:48px;height:48px}@media (min-width: 48em){.duet-icon.xxx-large .duet-icon-svg{width:72px;height:72px}}.duet-icon .duet-icon-svg{display:block;width:24px;min-width:100%;height:24px;font-size:0}.duet-icon svg{width:100%;min-width:100%;fill:currentColor}";
|
|
6119
6567
|
|
|
6120
|
-
let DuetIcon$1 = class extends
|
|
6568
|
+
let DuetIcon$1 = class extends H {
|
|
6121
6569
|
constructor() {
|
|
6122
6570
|
super();
|
|
6123
6571
|
this.__registerHost();
|
|
6124
|
-
|
|
6572
|
+
this.__attachShadow();
|
|
6125
6573
|
/**
|
|
6126
6574
|
* Theme of the icon. This setting will be overridden when you set the color
|
|
6127
6575
|
* property
|
|
@@ -6173,7 +6621,7 @@ let DuetIcon$1 = class extends HTMLElement {
|
|
|
6173
6621
|
if (this.src && this.icon) {
|
|
6174
6622
|
console.warn("[DUET COMPONENTS]: <duet-icon> should have either have src or icon attributes, but not both. icon attribute will take precedence", "icon:", this.icon, "src:", this.src);
|
|
6175
6623
|
}
|
|
6176
|
-
this.loadIcon();
|
|
6624
|
+
return this.loadIcon();
|
|
6177
6625
|
}
|
|
6178
6626
|
async loadIcon() {
|
|
6179
6627
|
// static icon known at build-time, so we can set it synchronously
|
|
@@ -6277,13 +6725,13 @@ function cleanValue(input, regex) {
|
|
|
6277
6725
|
return newValue;
|
|
6278
6726
|
}
|
|
6279
6727
|
|
|
6280
|
-
const duetInputCss = "*.sc-duet-input,*.sc-duet-input::after,*.sc-duet-input::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-input-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%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:bottom}.sc-duet-input-h:last-child,.sc-duet-input-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-input-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-input-h{width:100% !important}.duet-m-0.sc-duet-input-h{margin:0 !important}duet-tooltip.sc-duet-input{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-input{position:relative;top:4px;right:auto}}duet-caption.sc-duet-input:not(:last-of-type){margin-bottom:0}.duet-input-icon.sc-duet-input{position:absolute;top:50%;right:16px;z-index:200;width:20px;height:20px;font-size:0;line-height:normal;color:#00294d;pointer-events:none;transform:translateY(-50%)}.duet-theme-turva.sc-duet-input .duet-input-icon.sc-duet-input{color:#171c3a}.duet-input-container.sc-duet-input{position:relative;width:100%;height:100%}.duet-input.sc-duet-input{position:relative;z-index:100;display:block !important;width:100% !important;min-width:8rem;max-width:initial !important;height:auto !important;padding:12px 14px !important;margin:initial !important;margin-bottom:initial !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 !important;font-variant-numeric:tabular-nums;line-height:1.5 !important;color:#00294d !important;cursor:initial !important;background:white !important;background-clip:initial !important;border:1px solid #909599 !important;border-radius:4px !important;box-shadow:initial !important;transition:box-shadow 150ms ease, border 150ms ease !important}.duet-input.is-number.sc-duet-input{padding-right:112px !important}.duet-input.is-date.sc-duet-input{padding-right:64px !important}.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#de2362 !important}.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#e02a0d !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#e02a0d !important}.has-icon.sc-duet-input .duet-input.sc-duet-input{padding-right:48px !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input{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 !important;border-color:#747475 !important}.duet-input.sc-duet-input::-ms-clear{display:none}.duet-input.sc-duet-input::-webkit-contacts-auto-fill-button{display:none !important}.duet-input.sc-duet-input::-webkit-input-placeholder{color:#657787;opacity:1 !important;transition:color 300ms ease}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-webkit-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfcfd1}.duet-input.sc-duet-input::-moz-placeholder{color:#657787;opacity:1 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-moz-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfcfd1}.duet-input.sc-duet-input:-ms-input-placeholder{color:#657787}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:-ms-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfcfd1}.duet-input[disabled].sc-duet-input{color:#00294d !important;cursor:text !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-input .duet-input[disabled].sc-duet-input{color:#171c3a !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important;-webkit-text-fill-color:#171c3a !important}.duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #909599 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #747475 !important}.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus{border-color:#0077b3 !important;outline:0;box-shadow:0 0 0 1px #0077b3 !important;transition:none}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus{border-color:#171c3a !important;box-shadow:0 0 0 1px #171c3a !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#171c3a}.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#0077b3}.duet-input[type=search].sc-duet-input:not(:placeholder-shown):focus+.duet-input-icon.sc-duet-input{display:none}.duet-input.sc-duet-input:not(:focus):not(:hover):invalid{box-shadow:none !important}.duet-input[type=number].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=number].sc-duet-input::-webkit-outer-spin-button,.duet-input[type=time].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=time].sc-duet-input::-webkit-outer-spin-button{display:none;margin:0;-webkit-appearance:none}.duet-input.sc-duet-input::-webkit-search-cancel-button{margin-right:-28px}.duet-input-help.sc-duet-input{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-input-help.sc-duet-input span.sc-duet-input{display:block;margin-top:8px}.duet-theme-turva.sc-duet-input .duet-input-help.sc-duet-input{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#747475}.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#e02a0d}.duet-label-hidden.sc-duet-input duet-label.sc-duet-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-input-relative.sc-duet-input{position:relative;width:100%}";
|
|
6728
|
+
const duetInputCss = "*.sc-duet-input,*.sc-duet-input::after,*.sc-duet-input::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-input-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%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:bottom}.sc-duet-input-h:last-child,.sc-duet-input-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-input-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-input-h{width:100% !important}.duet-m-0.sc-duet-input-h{margin:0 !important}duet-tooltip.sc-duet-input{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-input{position:relative;top:4px;right:auto}}duet-caption.sc-duet-input:not(:last-of-type){margin-bottom:0}.duet-input-placeholder.sc-duet-input{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-input-icon.sc-duet-input{position:absolute;top:50%;right:16px;z-index:200;width:20px;height:20px;font-size:0;line-height:normal;color:#00294d;pointer-events:none;transform:translateY(-50%)}.duet-theme-turva.sc-duet-input .duet-input-icon.sc-duet-input{color:#171c3a}.duet-input-container.sc-duet-input{position:relative;width:100%;height:100%}.duet-input.sc-duet-input{position:relative;z-index:100;display:block !important;width:100% !important;min-width:8rem;max-width:initial !important;height:auto !important;padding:12px 14px !important;margin:initial !important;margin-bottom:initial !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 !important;font-variant-numeric:tabular-nums;line-height:1.5 !important;color:#00294d !important;cursor:initial !important;background:white !important;background-clip:initial !important;border:1px solid #909599 !important;border-radius:4px !important;box-shadow:initial !important;transition:box-shadow 150ms ease, border 150ms ease !important}.duet-input.is-number.sc-duet-input{padding-right:112px !important}.duet-input.is-date.sc-duet-input{padding-right:64px !important}.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#de2362 !important}.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#e02a0d !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#e02a0d !important}.has-icon.sc-duet-input .duet-input.sc-duet-input{padding-right:48px !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input{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 !important;border-color:#747475 !important}.duet-input.sc-duet-input::-ms-clear{display:none}.duet-input.sc-duet-input::-webkit-contacts-auto-fill-button{display:none !important}.duet-input.sc-duet-input::-webkit-input-placeholder{color:#657787;opacity:1 !important;transition:color 300ms ease}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-webkit-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfcfd1}.duet-input.sc-duet-input::-moz-placeholder{color:#657787;opacity:1 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-moz-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfcfd1}.duet-input.sc-duet-input:-ms-input-placeholder{color:#657787}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:-ms-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfcfd1}.duet-input[disabled].sc-duet-input{color:#00294d !important;cursor:text !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-input .duet-input[disabled].sc-duet-input{color:#171c3a !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important;-webkit-text-fill-color:#171c3a !important}.duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #909599 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #747475 !important}.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus{border-color:#0077b3 !important;outline:0;box-shadow:0 0 0 1px #0077b3 !important;transition:none}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus{border-color:#171c3a !important;box-shadow:0 0 0 1px #171c3a !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#171c3a}.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#0077b3}.duet-input[type=search].sc-duet-input:not(:placeholder-shown):focus+.duet-input-icon.sc-duet-input{display:none}.duet-input.sc-duet-input:not(:focus):not(:hover):invalid{box-shadow:none !important}.duet-input[type=number].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=number].sc-duet-input::-webkit-outer-spin-button,.duet-input[type=time].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=time].sc-duet-input::-webkit-outer-spin-button{display:none;margin:0;-webkit-appearance:none}.duet-input.sc-duet-input::-webkit-search-cancel-button{margin-right:-28px}.duet-input-help.sc-duet-input{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-input-help.sc-duet-input span.sc-duet-input{display:block;margin-top:8px}.duet-theme-turva.sc-duet-input .duet-input-help.sc-duet-input{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#747475}.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#e02a0d}.duet-label-hidden.sc-duet-input duet-label.sc-duet-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-input-relative.sc-duet-input{position:relative;width:100%}";
|
|
6281
6729
|
|
|
6282
6730
|
const icons = {
|
|
6283
6731
|
search: formSearch,
|
|
6284
6732
|
email: formEmail,
|
|
6285
6733
|
};
|
|
6286
|
-
let DuetInput$1 = class extends
|
|
6734
|
+
let DuetInput$1 = class extends H {
|
|
6287
6735
|
constructor() {
|
|
6288
6736
|
super();
|
|
6289
6737
|
this.__registerHost();
|
|
@@ -6418,7 +6866,7 @@ let DuetInput$1 = class extends HTMLElement {
|
|
|
6418
6866
|
// (in webkit based browsers settings value trigger cursor position and will set it to EndOfText)
|
|
6419
6867
|
restoreCursor();
|
|
6420
6868
|
}
|
|
6421
|
-
this.isCaptionVisible = !!
|
|
6869
|
+
this.isCaptionVisible = !!this.caption;
|
|
6422
6870
|
const emitEvent = () => this.duetChange.emit({
|
|
6423
6871
|
value: this.value,
|
|
6424
6872
|
component: "duet-input",
|
|
@@ -6437,7 +6885,7 @@ let DuetInput$1 = class extends HTMLElement {
|
|
|
6437
6885
|
componentWillLoad() {
|
|
6438
6886
|
inheritGlobalTheme(this);
|
|
6439
6887
|
this.disallowedPatternChange();
|
|
6440
|
-
this.isCaptionVisible = !!
|
|
6888
|
+
this.isCaptionVisible = !!this.caption;
|
|
6441
6889
|
}
|
|
6442
6890
|
/**
|
|
6443
6891
|
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
@@ -6472,12 +6920,12 @@ let DuetInput$1 = class extends HTMLElement {
|
|
|
6472
6920
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
6473
6921
|
"has-icon": !!this.icon || (this.type !== "text" && this.type !== "tel" && this.type !== "password"),
|
|
6474
6922
|
"has-error": !!this.error,
|
|
6475
|
-
} }, h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, margin: this.isCaptionVisible ? "small" : "auto", id: this.labelId, for: identifier }, this.label), this.tooltip && (h$1("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (h$1("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), this.placeholder && this.echoPlaceholder && this.value && (h$1("duet-caption", { id: this.topCaptionPlaceholderId,
|
|
6923
|
+
} }, h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, margin: this.isCaptionVisible ? "small" : "auto", id: this.labelId, for: identifier }, this.label), this.tooltip && (h$1("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (h$1("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), h$1("div", { class: "duet-input-relative" }, this.placeholder && this.echoPlaceholder && this.value && (h$1("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-input-placeholder", margin: "none", size: "small" }, this.placeholder)), h$1("input", Object.assign({ ref: input => (this.nativeInput = input), onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, type: this.type, class: {
|
|
6476
6924
|
"duet-input": true,
|
|
6477
6925
|
disabled: this.disabled,
|
|
6478
6926
|
"is-number": this.component === "number",
|
|
6479
6927
|
"is-date": this.component === "date",
|
|
6480
|
-
}, value: this.value, disabled: this.disabled, "aria-invalid": this.error ? "true" : "false", "aria-labelledby": `${this.labelId} ${this.errorId}`, "aria-controls": this.accessibleControls, "aria-autocomplete": this.accessibleAutocomplete, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": `${this.isCaptionVisible ? this.topCaptionId : ""} ${this.accessibleDescribedBy}`, placeholder: this.placeholder, spellcheck: "false", minlength: this.minlength, maxlength: this.maxlength, autocomplete: this.autoComplete, required: this.required, role: this.role, name: this.name, id: identifier }, inputProps)), !this.icon && this.type !== "text" && this.type !== "tel" && this.type !== "password" && (h$1("div", { class: "duet-input-icon" }, h$1("duet-icon", { margin: "none", size: "small", icon: icons[this.type].svg, color: "currentColor" }))), this.icon && (h$1("div", { class: "duet-input-icon" }, h$1("duet-icon", { margin: "none", size: "small", name: this.icon, color: "currentColor" }))), h$1("slot", null)), h$1("span", { class: "duet-input-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h$1("span",
|
|
6928
|
+
}, value: this.value, disabled: this.disabled, "aria-invalid": this.error ? "true" : "false", "aria-labelledby": `${this.labelId} ${this.errorId}`, "aria-controls": this.accessibleControls, "aria-autocomplete": this.accessibleAutocomplete, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": `${this.isCaptionVisible ? this.topCaptionId : ""} ${this.accessibleDescribedBy}`, placeholder: this.placeholder, spellcheck: "false", minlength: this.minlength, maxlength: this.maxlength, autocomplete: this.autoComplete, required: this.required, role: this.role, name: this.name, id: identifier }, inputProps)), !this.icon && this.type !== "text" && this.type !== "tel" && this.type !== "password" && (h$1("div", { class: "duet-input-icon" }, h$1("duet-icon", { margin: "none", size: "small", icon: icons[this.type].svg, color: "currentColor" }))), this.icon && (h$1("div", { class: "duet-input-icon" }, h$1("duet-icon", { margin: "none", size: "small", name: this.icon, color: "currentColor" }))), h$1("slot", null)), h$1("span", { class: "duet-input-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h$1("span", { class: "duet-input-error" }, this.error)))));
|
|
6481
6929
|
}
|
|
6482
6930
|
get element() { return this; }
|
|
6483
6931
|
static get watchers() { return {
|
|
@@ -6487,9 +6935,9 @@ let DuetInput$1 = class extends HTMLElement {
|
|
|
6487
6935
|
static get style() { return duetInputCss; }
|
|
6488
6936
|
};
|
|
6489
6937
|
|
|
6490
|
-
const duetLabelCss = "*.sc-duet-label,*.sc-duet-label::after,*.sc-duet-label::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-label-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;position:relative;z-index:100;display:inline-flex;width:auto;margin-top:8px !important;line-height:1.25;cursor:default}.duet-p-0.sc-duet-label-h{padding:0 !important}.duet-m-0.sc-duet-label-h{margin:0 !important}.duet-m-0.sc-duet-label-h{margin-bottom:0 !important}.duet-small-margin.sc-duet-label-h{margin-top:8px !important;margin-bottom:4px !important}.duet-has-tooltip.sc-duet-label-h{padding-right:48px}@media (min-width: 48em){.duet-has-tooltip.sc-duet-label-h{padding-right:0}}label.sc-duet-label{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;font-weight:600 !important;line-height:1.25;color:#00294d;text-align:left}label.sc-duet-label span.sc-duet-label{font-size:1rem;font-weight:600 !important}.duet-label-small.sc-duet-label-h label.sc-duet-label{font-size:0.875rem}.duet-label-small.sc-duet-label-h label.sc-duet-label span.sc-duet-label{font-size:0.875rem}.duet-theme-turva.sc-duet-label-h label.sc-duet-label{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}";
|
|
6938
|
+
const duetLabelCss = "*.sc-duet-label,*.sc-duet-label::after,*.sc-duet-label::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-label-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;position:relative;z-index:100;display:inline-flex;width:auto;margin-top:8px !important;line-height:1.25;cursor:default}.duet-p-0.sc-duet-label-h{padding:0 !important}.duet-m-0.sc-duet-label-h{margin:0 !important}.duet-m-0.sc-duet-label-h{margin-bottom:0 !important}.duet-small-margin.sc-duet-label-h{margin-top:8px !important;margin-bottom:4px !important}.duet-has-tooltip.sc-duet-label-h{padding-right:48px}@media (min-width: 48em){.duet-has-tooltip.sc-duet-label-h{padding-right:0}}label.sc-duet-label{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;font-weight:600 !important;line-height:1.25;color:#00294d;text-align:left;word-break:break-word}label.sc-duet-label span.sc-duet-label{font-size:1rem;font-weight:600 !important;word-break:break-word}.duet-label-small.sc-duet-label-h label.sc-duet-label{font-size:0.875rem}.duet-label-small.sc-duet-label-h label.sc-duet-label span.sc-duet-label{font-size:0.875rem}.duet-theme-turva.sc-duet-label-h label.sc-duet-label{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}";
|
|
6491
6939
|
|
|
6492
|
-
let DuetLabel$1 = class extends
|
|
6940
|
+
let DuetLabel$1 = class extends H {
|
|
6493
6941
|
constructor() {
|
|
6494
6942
|
super();
|
|
6495
6943
|
this.__registerHost();
|
|
@@ -6535,11 +6983,11 @@ function isInternetExplorer() {
|
|
|
6535
6983
|
|
|
6536
6984
|
const duetLayoutCss = "*,*::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:block;flex:1 0 auto;width:100%}:host(.duet-middle){display:flex}:host(.duet-middle) .duet-layout{padding:36px 28px !important}@media (min-width: 36em){:host(.duet-middle) .duet-layout{padding:48px 36px !important}}@media (min-width: 62em){:host(.duet-middle) .duet-layout{padding:56px !important}}:host(.duet-ie){height:100%}:host(.duet-middle.duet-ie){height:auto}.duet-layout{position:relative;padding:0 16px;margin:48px auto 36px}@media (min-width: 36em){.duet-layout{margin-top:72px}}.duet-layout.duet-layout-has-top{margin-top:0}.duet-layout.duet-m-0{margin-top:0 !important;margin-bottom:0 !important}.duet-layout.duet-center{display:flex;align-items:center;justify-content:center;width:100%;max-width:888px}@media (min-width: 36em){.duet-layout.duet-center{padding:0 48px}}@media (min-width: 48em){.duet-layout.duet-center{padding:0 72px}}@media (min-width: 62em){.duet-layout.duet-center{width:100%}}@media (min-width: 36em){.duet-layout{padding:0 28px}}@media (min-width: 62em){.duet-layout{display:flex;flex-direction:row;padding:0 56px;margin-bottom:48px}}@media (min-width: 76.25em){.duet-layout{max-width:1110px;padding:0}}.duet-main,.duet-sidebar,.duet-layout-top,.duet-layout-bottom{display:block;width:100%}.duet-layout-top{position:relative;display:block;width:100%;margin:72px auto 0}.duet-layout-top.duet-m-0{margin-top:0 !important;margin-bottom:0 !important}.duet-layout-top .duet-layout-top-wrapper{padding:0 20px;margin:0 auto}@media (min-width: 36em){.duet-layout-top .duet-layout-top-wrapper{padding:0 28px}}@media (min-width: 62em){.duet-layout-top .duet-layout-top-wrapper{padding:0 56px}}@media (min-width: 76.25em){.duet-layout-top .duet-layout-top-wrapper{max-width:1110px;padding:0}}.duet-center .duet-layout-top-wrapper{max-width:888px}@media (min-width: 36em){.duet-center .duet-layout-top-wrapper{padding:0 48px}}@media (min-width: 48em){.duet-center .duet-layout-top-wrapper{padding:0 72px}}@media (min-width: 62em){.duet-main{min-width:600px;margin:0 auto}.has-sidebar .duet-main{max-width:734px;margin-right:20px}}@media (min-width: 62em){.duet-sidebar{min-width:256px;max-width:356px}}@media (min-width: 62em){.duet-sidebar-container{width:auto;max-width:356px}}@media (min-width: 62em){.duet-sidebar-container.has-tabs{margin-top:89px}}@media (min-width: 62em){.duet-sidebar-container.sticky{position:sticky}.duet-sidebar-container.sticky.with-links{top:calc(3rem + 20px)}.duet-sidebar-container.sticky.without-links{top:calc(4rem + 20px)}}";
|
|
6537
6985
|
|
|
6538
|
-
let DuetLayout$1 = class extends
|
|
6986
|
+
let DuetLayout$1 = class extends H {
|
|
6539
6987
|
constructor() {
|
|
6540
6988
|
super();
|
|
6541
6989
|
this.__registerHost();
|
|
6542
|
-
|
|
6990
|
+
this.__attachShadow();
|
|
6543
6991
|
/**
|
|
6544
6992
|
* Own Properties.
|
|
6545
6993
|
*/
|
|
@@ -6612,11 +7060,11 @@ let DuetLayout$1 = class extends HTMLElement {
|
|
|
6612
7060
|
|
|
6613
7061
|
const duetLinkCss = "*,*::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}.duet-link{display:inline;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:normal;font-weight:400;color:#0077b3;text-decoration:underline;border-radius:4px;transition:300ms ease}.duet-link:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-link:focus,.duet-link:focus.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-link.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#c60c30}.duet-link:hover{color:#004d80;text-decoration:none}.duet-link:hover.duet-theme-turva{color:#940925}.duet-link:active{opacity:0.75;transition:none}.duet-link-external{margin-left:4px}";
|
|
6614
7062
|
|
|
6615
|
-
let DuetLink$1 = class extends
|
|
7063
|
+
let DuetLink$1 = class extends H {
|
|
6616
7064
|
constructor() {
|
|
6617
7065
|
super();
|
|
6618
7066
|
this.__registerHost();
|
|
6619
|
-
|
|
7067
|
+
this.__attachShadow();
|
|
6620
7068
|
/**
|
|
6621
7069
|
* The currently active language. This setting changes the external link
|
|
6622
7070
|
* accessible label to match the chosen language.
|
|
@@ -6625,8 +7073,7 @@ let DuetLink$1 = class extends HTMLElement {
|
|
|
6625
7073
|
*/
|
|
6626
7074
|
this.language = getLanguage();
|
|
6627
7075
|
/**
|
|
6628
|
-
*
|
|
6629
|
-
* normally you would handle these strings on an application level and override @accessibleLabelExternal when needed
|
|
7076
|
+
* Defaults for accessibleLabelExternal
|
|
6630
7077
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
6631
7078
|
*/
|
|
6632
7079
|
this.accessibleLabelExternalDefaults = DuetStringsExternalDefaults;
|
|
@@ -6634,7 +7081,7 @@ let DuetLink$1 = class extends HTMLElement {
|
|
|
6634
7081
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
6635
7082
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
6636
7083
|
*/
|
|
6637
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
7084
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
6638
7085
|
/**
|
|
6639
7086
|
* Theme of the button.
|
|
6640
7087
|
*/
|
|
@@ -6670,7 +7117,7 @@ let DuetLink$1 = class extends HTMLElement {
|
|
|
6670
7117
|
"duet-link": true,
|
|
6671
7118
|
"duet-link-is-external": this.external,
|
|
6672
7119
|
"duet-theme-turva": this.theme === "turva",
|
|
6673
|
-
}, target: this.external ? "_blank" : "_self", "aria-label": this.accessibleLabel, id: this.identifier, ref: el => (this.nativeLink = el) }, h$1("slot", null), this.external && (h$1(Fragment, null, h$1("duet-visually-hidden", null,
|
|
7120
|
+
}, target: this.external ? "_blank" : "_self", "aria-label": this.accessibleLabel, id: this.identifier, ref: el => (this.nativeLink = el) }, h$1("slot", null), this.external && (h$1(Fragment, null, h$1("duet-visually-hidden", null, this.accessibleLabelExternal), h$1("span", { class: "duet-link-external" }, h$1("duet-icon", { icon: actionNewWindowSmall.svg, size: "xx-small", margin: "none", color: "currentColor" })))))));
|
|
6674
7121
|
}
|
|
6675
7122
|
static get delegatesFocus() { return true; }
|
|
6676
7123
|
static get style() { return duetLinkCss; }
|
|
@@ -6678,11 +7125,11 @@ let DuetLink$1 = class extends HTMLElement {
|
|
|
6678
7125
|
|
|
6679
7126
|
const duetListCss = "*,*::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:block;width:100%}.duet-list-component{margin-bottom:16px !important;width:100%}.duet-list-component.duet-p-0{padding:0 !important}.duet-list-component.duet-m-0{margin:0 !important}";
|
|
6680
7127
|
|
|
6681
|
-
let DuetList$1 = class extends
|
|
7128
|
+
let DuetList$1 = class extends H {
|
|
6682
7129
|
constructor() {
|
|
6683
7130
|
super();
|
|
6684
7131
|
this.__registerHost();
|
|
6685
|
-
|
|
7132
|
+
this.__attachShadow();
|
|
6686
7133
|
/**
|
|
6687
7134
|
* Theme of the list.
|
|
6688
7135
|
*/
|
|
@@ -6782,11 +7229,11 @@ let DuetList$1 = class extends HTMLElement {
|
|
|
6782
7229
|
|
|
6783
7230
|
const duetListItemCss = "*,*::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:flex;flex-flow:row;width:100%;overflow:visible;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-style:normal;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.25;color:#00294d}@media (max-width: 35.9375em){:host{flex-wrap:wrap}}:host dt,:host dd{-webkit-hyphens:auto;hyphens:auto;text-align:left;word-break:break-all;word-break:break-word;margin-inline-start:0}@media (max-width: 35.9375em){:host dt,:host dd{flex:inherit;flex-basis:100% !important;width:100%;padding-bottom:4px !important}}:host dt{padding:16px !important;font-weight:600}@media (max-width: 35.9375em){:host dt{padding-bottom:4px !important}}.duet-theme-turva :host dt{font-weight:700}:host dd{padding:16px !important;margin-left:auto;text-align:left}@media (max-width: 35.9375em){:host dd{padding-top:0 !important}}:host(:not(.duet-list-striped)) dt{padding:8px !important;padding-left:0 !important}@media (max-width: 35.9375em){:host(:not(.duet-list-striped)) dt{padding-bottom:4px !important}}:host(:not(.duet-list-striped)) dd{padding:8px !important;padding-left:0 !important}@media (max-width: 35.9375em){:host(:not(.duet-list-striped)) dd{padding-top:0 !important}}:host(.duet-theme-turva){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}:host(.duet-list-striped:nth-child(odd)) dt,:host(.duet-list-striped:nth-child(odd)) dd{background:#f5f8fa}:host(.duet-list-striped.duet-theme-turva:nth-child(odd)) dt,:host(.duet-list-striped.duet-theme-turva:nth-child(odd)) dd{background:#f5f5f7}:host(.duet-list-width-30) dt{flex-basis:33%}:host(.duet-list-width-30) dd{flex-basis:67%}:host(.duet-list-width-50) dt{flex-basis:47%}:host(.duet-list-width-50) dd{flex-basis:53%}:host(.duet-list-width-70) dt{flex-basis:65%}:host(.duet-list-width-70) dd{flex-basis:35%}:host(.duet-p-0) dt,:host(.duet-p-0) dd{padding-top:0 !important;padding-bottom:4px !important}@media (max-width: 35.9375em){:host(.duet-list-mobile-center) dt,:host(.duet-list-mobile-center) dd{text-align:center}}@media (max-width: 61.9375em){:host(.duet-list-breakpoint-large){flex-wrap:wrap}:host(.duet-list-breakpoint-large) dt,:host(.duet-list-breakpoint-large) dd{flex:inherit;flex-basis:100% !important;width:100%;padding-bottom:4px !important}:host(.duet-list-breakpoint-large) dd{padding-top:0 !important}}:host(.duet-list-breakpoint-large.duet-list-striped) dd{padding-bottom:16px !important}@media (max-width: 61.9375em){:host(.duet-list-breakpoint-large.duet-list-mobile-center) dt,:host(.duet-list-breakpoint-large.duet-list-mobile-center) dd{text-align:center !important}}";
|
|
6784
7231
|
|
|
6785
|
-
let DuetListItem$1 = class extends
|
|
7232
|
+
let DuetListItem$1 = class extends H {
|
|
6786
7233
|
constructor() {
|
|
6787
7234
|
super();
|
|
6788
7235
|
this.__registerHost();
|
|
6789
|
-
|
|
7236
|
+
this.__attachShadow();
|
|
6790
7237
|
}
|
|
6791
7238
|
/**
|
|
6792
7239
|
* render() function
|
|
@@ -6827,11 +7274,11 @@ const DefaultLogo = ({ inverse, logoId, language }) => {
|
|
|
6827
7274
|
const { title, path, viewBox } = i18n[language];
|
|
6828
7275
|
return (h$1("svg", { role: "img", xmlns: "http://www.w3.org/2000/svg", fill: logoColor, "aria-labelledby": logoId, viewBox: viewBox }, h$1("title", { id: logoId }, title), h$1("path", { d: path })));
|
|
6829
7276
|
};
|
|
6830
|
-
let DuetLogo$1 = class extends
|
|
7277
|
+
let DuetLogo$1 = class extends H {
|
|
6831
7278
|
constructor() {
|
|
6832
7279
|
super();
|
|
6833
7280
|
this.__registerHost();
|
|
6834
|
-
|
|
7281
|
+
this.__attachShadow();
|
|
6835
7282
|
/**
|
|
6836
7283
|
* Own Properties.
|
|
6837
7284
|
*/
|
|
@@ -6902,11 +7349,11 @@ const duetModalCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margi
|
|
|
6902
7349
|
// iOS has otherwise problems moving the focus from modal back to the original element.
|
|
6903
7350
|
// This issue is similar to what we’ve seen in Duet Date Picker + iOS VoiceOver.
|
|
6904
7351
|
const TRANSITION_MS = 600;
|
|
6905
|
-
let DuetModal$1 = class extends
|
|
7352
|
+
let DuetModal$1 = class extends H {
|
|
6906
7353
|
constructor() {
|
|
6907
7354
|
super();
|
|
6908
7355
|
this.__registerHost();
|
|
6909
|
-
|
|
7356
|
+
this.__attachShadow();
|
|
6910
7357
|
this.duetOpen = createEvent$2(this, "duetOpen", 7);
|
|
6911
7358
|
this.duetClose = createEvent$2(this, "duetClose", 7);
|
|
6912
7359
|
this.duetBeforeClose = createEvent$2(this, "duetBeforeClose", 7);
|
|
@@ -6945,10 +7392,10 @@ let DuetModal$1 = class extends HTMLElement {
|
|
|
6945
7392
|
*/
|
|
6946
7393
|
this.language = getLanguage();
|
|
6947
7394
|
/**
|
|
6948
|
-
*
|
|
6949
|
-
*
|
|
7395
|
+
* Defaults for accessibleCloseLabel
|
|
7396
|
+
* @default {fi: "Sulje ikkuna", sv: "Stäng fönstret", en: "Close the dialog", }
|
|
6950
7397
|
*/
|
|
6951
|
-
this.
|
|
7398
|
+
this.accessibleCloseLabelDefaults = {
|
|
6952
7399
|
fi: "Sulje ikkuna",
|
|
6953
7400
|
sv: "Stäng fönstret",
|
|
6954
7401
|
en: "Close the dialog",
|
|
@@ -6959,7 +7406,7 @@ let DuetModal$1 = class extends HTMLElement {
|
|
|
6959
7406
|
* Swedish translation for this property is “Stäng fönstret”.
|
|
6960
7407
|
* @default {fi: "Sulje ikkuna", sv: "Stäng fönstret", en: "Close the dialog", }
|
|
6961
7408
|
*/
|
|
6962
|
-
this.accessibleCloseLabel = getLocaleString(this.
|
|
7409
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefaults, this.language);
|
|
6963
7410
|
/**
|
|
6964
7411
|
* Size of the modal window.
|
|
6965
7412
|
*/
|
|
@@ -7125,11 +7572,11 @@ let DuetModal$1 = class extends HTMLElement {
|
|
|
7125
7572
|
|
|
7126
7573
|
const duetNotificationCss = "*,*::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:block;width:100%}.duet-notification{display:block;padding:16px;color:#00294d;cursor:pointer;border-bottom:1px solid #e1e3e6;transition:300ms ease}:host(:last-of-type) .duet-notification{border-bottom:0}.duet-notification.duet-theme-turva{color:#171c3a;border-bottom-color:#e4e4e6}.duet-notification.duet-notification-highlight{font-weight:600;background:#f3f9fc}.duet-notification.duet-notification-highlight.duet-theme-turva{background:#fcf3f4}@media (min-width: 62em){.duet-notification:hover{background:#f3f9fc}.duet-notification:hover.duet-theme-turva{background:#fcf3f4}}.duet-notification a{text-decoration:none}.duet-notification a:focus{outline:0}:host(.user-is-tabbing) .duet-notification:focus-within{z-index:1;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-notification:focus-within.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-notification-container{position:relative;display:flex}.duet-notification-badge-container{position:relative;width:16px}.duet-notification-badge{position:absolute;top:6px;left:-2px;width:8px;height:8px;background:#0077b3;border-radius:50%}.duet-theme-turva .duet-notification-badge{background:#c60c30}.duet-notification-content{flex:1}.duet-notification-date{position:absolute;top:2px;right:0;width:96px;font-size:0.75rem;font-weight:600;line-height:1.25;color:#657787;text-align:right;text-transform:uppercase}@media (max-width: 35.9375em){.duet-notification-date{width:auto}}.duet-theme-turva .duet-notification-date{color:#444445}::slotted(duet-heading){padding-right:80px !important}::slotted(duet-paragraph){margin-bottom:2px !important}";
|
|
7127
7574
|
|
|
7128
|
-
let DuetNotification$1 = class extends
|
|
7575
|
+
let DuetNotification$1 = class extends H {
|
|
7129
7576
|
constructor() {
|
|
7130
7577
|
super();
|
|
7131
7578
|
this.__registerHost();
|
|
7132
|
-
|
|
7579
|
+
this.__attachShadow();
|
|
7133
7580
|
/**
|
|
7134
7581
|
* The currently active language.
|
|
7135
7582
|
* Used for announcing unread notifications to screen readers.
|
|
@@ -7200,11 +7647,11 @@ let DuetNotification$1 = class extends HTMLElement {
|
|
|
7200
7647
|
const duetNotificationDrawerCss = "*,*::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:block;width:100%}.duet-drawer{position:relative}@media (min-width: 62em){.duet-drawer{display:inline-block}}.duet-drawer-toggle{position:relative;display:flex;align-items:center;width:100%;height:48px;padding:0 20px;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:48px;color:#00294d;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-bottom:1px solid #e1e3e6;border-radius:0;-webkit-appearance:none;appearance:none}@media (min-width: 62em){.duet-drawer-toggle{z-index:200;width:auto;max-width:200px;padding:0 30px 0 12px;overflow:hidden;font-size:0.875rem;line-height:4rem;background-color:white;border:0;border-radius:4px;transition:border 300ms ease}}.duet-theme-turva .duet-drawer-toggle{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:#e4e4e6}.duet-drawer-toggle:active{opacity:0.75}.duet-drawer-toggle:focus{outline:0}:host(.user-is-tabbing) .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-drawer-toggle:hover{color:#004d80}.duet-theme-turva .duet-drawer-toggle:hover{color:#444445}.duet-drawer-toggle::after{display:none !important}@media (min-width: 62em){.duet-drawer-toggle::after{position:absolute;top:auto;bottom:0;left:0;display:block !important;width:100%;height:3px;content:\"\";background:#0077b3;transition:300ms ease;transform:translateY(3px)}.duet-theme-turva .duet-drawer-toggle::after{background:#c60c30}}.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{color:#004d80;border-bottom:1px solid #f5f8fa;border-radius:0}.duet-theme-turva .duet-drawer-toggle[aria-expanded=true],.duet-theme-turva .duet-drawer-toggle[aria-expanded=true]:hover{color:#444445;border-color:#f5f5f7}@media (min-width: 62em){.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{border:0}.duet-drawer-toggle[aria-expanded=true]::after,.duet-drawer-toggle[aria-expanded=true]:hover::after{left:0;width:100%;transform:translateY(0)}}.duet-drawer-icon{position:relative;display:inline-flex;min-width:12px;margin-right:12px;font-size:0;line-height:normal;vertical-align:baseline}@media (min-width: 62em){.duet-drawer-icon{margin-right:8px}}.duet-drawer-label{line-height:1}.duet-drawer-caret{position:absolute;top:50%;right:20px;display:flex;width:10px;height:10px;margin-left:8px;line-height:normal;pointer-events:none;transition:300ms ease;transform:translateY(-50%);transform-origin:50% 50%}@media (min-width: 62em){.duet-drawer-caret{right:16px;width:7px;height:7px}}.duet-drawer-caret duet-icon{width:10px}.duet-drawer-toggle[aria-expanded=true] .duet-drawer-caret{transform:translateY(-50%) rotate(180deg)}.duet-drawer-badge{position:absolute;top:0;right:0;display:inline-block;width:6px;height:6px;background:#f7b228;border-radius:50%;box-shadow:0 0 0 1px #c18b1f}.duet-theme-turva .duet-drawer-badge{background:#faa40f}.duet-drawer-content{display:none;background-color:#f5f8fa;border-bottom:1px solid #e1e3e6}.duet-drawer-content:focus{outline:0}.duet-theme-turva .duet-drawer-content{background-color:#f5f5f7;border-color:#e1e3e6}@media (min-width: 62em){.duet-drawer-content{position:absolute;top:100%;z-index:600;display:block;width:450px;max-height:420px;padding-left:0;overflow-y:auto;visibility:hidden;background-color:white;border:1px solid #e1e3e6;border-radius:4px;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);opacity:0;transition:300ms ease;transform:scale(0.95) translateZ(0) translateY(-10px);transform-origin:50% 0;scrollbar-width:none}.duet-drawer-content::-webkit-scrollbar{display:none}.duet-theme-turva .duet-drawer-content{background-color:white}.duet-drawer-content.duet-drawer-left{right:0}.duet-drawer-content.duet-drawer-right{left:0}}.duet-drawer-content.duet-drawer-open{display:block}@media (min-width: 62em){.duet-drawer-content.duet-drawer-open{visibility:visible;opacity:1;transform:scale(1) translateZ(0) translateY(0)}}";
|
|
7201
7648
|
|
|
7202
7649
|
const ESC_KEY = 27;
|
|
7203
|
-
let DuetNotificationDrawer$1 = class extends
|
|
7650
|
+
let DuetNotificationDrawer$1 = class extends H {
|
|
7204
7651
|
constructor() {
|
|
7205
7652
|
super();
|
|
7206
7653
|
this.__registerHost();
|
|
7207
|
-
|
|
7654
|
+
this.__attachShadow();
|
|
7208
7655
|
/**
|
|
7209
7656
|
* State() variables
|
|
7210
7657
|
* Inlined decorator, alphabetical order.
|
|
@@ -7224,8 +7671,8 @@ let DuetNotificationDrawer$1 = class extends HTMLElement {
|
|
|
7224
7671
|
*/
|
|
7225
7672
|
this.language = getLanguage();
|
|
7226
7673
|
/**
|
|
7227
|
-
*
|
|
7228
|
-
*
|
|
7674
|
+
* Defaults for accessibleLabelNotifications
|
|
7675
|
+
* @default {en: "No notifications", fi: "Ei ilmoituksia", sv: "Inga notifikationer"}
|
|
7229
7676
|
*/
|
|
7230
7677
|
this.accessibleLabelNotificationsDefaults = {
|
|
7231
7678
|
en: "No notifications",
|
|
@@ -7236,7 +7683,7 @@ let DuetNotificationDrawer$1 = class extends HTMLElement {
|
|
|
7236
7683
|
* Adds accessible label for tooltip that is shown for notifications
|
|
7237
7684
|
* @default {en: "No notifications", fi: "Ei ilmoituksia", sv: "Inga notifikationer"}
|
|
7238
7685
|
*/
|
|
7239
|
-
this.accessibleLabelNotifications = getLocaleString(this.accessibleLabelNotificationsDefaults
|
|
7686
|
+
this.accessibleLabelNotifications = getLocaleString(this.accessibleLabelNotificationsDefaults);
|
|
7240
7687
|
/**
|
|
7241
7688
|
* Show a badge that indicates something has changed.
|
|
7242
7689
|
*/
|
|
@@ -7364,7 +7811,7 @@ const clamp = (val, min, max) => Math.min(Math.max(val, min), max);
|
|
|
7364
7811
|
|
|
7365
7812
|
const duetNumberInputCss = "*.sc-duet-number-input,*.sc-duet-number-input::after,*.sc-duet-number-input::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-number-input-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%;min-width:calc(33.333% - 8px);max-width:100%;line-height:1.25;text-align:left;vertical-align:bottom}.sc-duet-number-input-h:last-child,.sc-duet-number-input-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-number-input-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-number-input-h{width:100% !important}.duet-m-0.sc-duet-number-input-h{margin:0 !important}.duet-number-container.sc-duet-number-input{position:relative;width:100%}.duet-number-buttons.sc-duet-number-input{-webkit-user-select:none;user-select:none;position:absolute;top:1px;right:1px;z-index:200;width:96px;height:calc(100% - 2px)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input{position:relative;display:inline-flex;align-items:center;justify-content:center;width:50%;height:100%;text-align:center;cursor:pointer;background:transparent;-webkit-appearance:none;appearance:none}.duet-number-buttons.sc-duet-number-input .duet-number-button[aria-disabled=true].sc-duet-number-input,.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:disabled{pointer-events:none}.duet-number-buttons.sc-duet-number-input .duet-number-button[aria-disabled=true].sc-duet-number-input duet-icon.sc-duet-number-input,.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:disabled duet-icon.sc-duet-number-input{opacity:0.4}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:active duet-icon.sc-duet-number-input{transform:translateY(1px)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{outline:0}.user-is-tabbing.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{z-index:2;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva .user-is-tabbing.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{box-shadow:0 0 0 2px #171c3a}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type{border-left:1px solid #cfd2d4}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type::before{position:absolute;top:0;left:-6px;width:6px;height:100%;content:\"\";background:linear-gradient(to left, rgba(207, 210, 212, 0.2) 0%, rgba(207, 210, 212, 0.2) 1px, rgba(207, 210, 212, 0.1) 1px, rgba(207, 210, 212, 0) 100%)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type{border-top-right-radius:4px;border-bottom-right-radius:4px}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type::before{position:absolute;top:20%;left:0;width:1px;height:60%;content:\"\";background:#e1e3e6}.duet-theme-turva.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type::before{background:linear-gradient(to left, rgba(207, 207, 209, 0.2) 0%, rgba(207, 207, 209, 0.2) 1px, rgba(207, 207, 209, 0.1) 1px, rgba(207, 207, 209, 0) 100%)}.duet-theme-turva.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type::before{background:#e4e4e6}";
|
|
7366
7813
|
|
|
7367
|
-
let DuetNumberInput$1 = class extends
|
|
7814
|
+
let DuetNumberInput$1 = class extends H {
|
|
7368
7815
|
constructor() {
|
|
7369
7816
|
super();
|
|
7370
7817
|
this.__registerHost();
|
|
@@ -7389,37 +7836,52 @@ let DuetNumberInput$1 = class extends HTMLElement {
|
|
|
7389
7836
|
*/
|
|
7390
7837
|
this.unit = getLocale(this.language).money;
|
|
7391
7838
|
/**
|
|
7392
|
-
*
|
|
7393
|
-
* The string {current} is replaced with the current amount.
|
|
7839
|
+
* Defaults for accessibleLive
|
|
7394
7840
|
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
7395
7841
|
*/
|
|
7396
|
-
this.
|
|
7842
|
+
this.accessibleLiveDefaults = {
|
|
7397
7843
|
fi: "{current} euroa valittuna",
|
|
7398
7844
|
en: "{current} euros selected",
|
|
7399
7845
|
sv: "{current} euro valt",
|
|
7400
|
-
}
|
|
7846
|
+
};
|
|
7847
|
+
/**
|
|
7848
|
+
* Format of message used to announce current amount when switching between amounts.
|
|
7849
|
+
* The string {current} is replaced with the current amount.
|
|
7850
|
+
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
7851
|
+
*/
|
|
7852
|
+
this.accessibleLive = getLocaleString(this.accessibleLiveDefaults, this.language);
|
|
7401
7853
|
/**
|
|
7402
7854
|
* Disables the aria-live messaging used internally in this component. This could be useful when you want to use custom aria-live messages instead.
|
|
7403
7855
|
*/
|
|
7404
7856
|
this.accessibleLiveEnabled = true;
|
|
7405
7857
|
/**
|
|
7406
|
-
*
|
|
7858
|
+
* Defaults for accessibleAdd
|
|
7407
7859
|
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
7408
7860
|
*/
|
|
7409
|
-
this.
|
|
7861
|
+
this.accessibleAddDefaults = {
|
|
7410
7862
|
fi: "Lisää summaan",
|
|
7411
7863
|
en: "Add to the amount",
|
|
7412
7864
|
sv: "Lägg till beloppet",
|
|
7413
|
-
}
|
|
7865
|
+
};
|
|
7414
7866
|
/**
|
|
7415
|
-
* Accessible label for the
|
|
7867
|
+
* Accessible label for the add button that is read for screen reader users.
|
|
7868
|
+
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
7869
|
+
*/
|
|
7870
|
+
this.accessibleAdd = getLocaleString(this.accessibleAddDefaults, this.language);
|
|
7871
|
+
/**
|
|
7872
|
+
* Defaults for accessibleSubtract
|
|
7416
7873
|
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
7417
7874
|
*/
|
|
7418
|
-
this.
|
|
7875
|
+
this.accessibleSubtractDefaults = {
|
|
7419
7876
|
fi: "Vähennä summasta",
|
|
7420
7877
|
en: "Subtract from the amount",
|
|
7421
7878
|
sv: "Dra från beloppet",
|
|
7422
|
-
}
|
|
7879
|
+
};
|
|
7880
|
+
/**
|
|
7881
|
+
* Accessible label for the subtract button that is read for screen reader users.
|
|
7882
|
+
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
7883
|
+
*/
|
|
7884
|
+
this.accessibleSubtract = getLocaleString(this.accessibleSubtractDefaults, this.language);
|
|
7423
7885
|
/**
|
|
7424
7886
|
* Theme of the input.
|
|
7425
7887
|
*/
|
|
@@ -7437,14 +7899,19 @@ let DuetNumberInput$1 = class extends HTMLElement {
|
|
|
7437
7899
|
*/
|
|
7438
7900
|
this.min = 0;
|
|
7439
7901
|
/**
|
|
7440
|
-
*
|
|
7902
|
+
* Defaults for Label
|
|
7441
7903
|
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
7442
7904
|
*/
|
|
7443
|
-
this.
|
|
7905
|
+
this.labelDefaults = {
|
|
7444
7906
|
fi: "Nimilappu",
|
|
7445
7907
|
en: "Label",
|
|
7446
7908
|
sv: "Etikett",
|
|
7447
|
-
}
|
|
7909
|
+
};
|
|
7910
|
+
/**
|
|
7911
|
+
* Label for the number input.
|
|
7912
|
+
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
7913
|
+
*/
|
|
7914
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
7448
7915
|
/**
|
|
7449
7916
|
* Visually hide the label, but still show it to screen readers.
|
|
7450
7917
|
*/
|
|
@@ -7673,34 +8140,101 @@ let DuetNumberInput$1 = class extends HTMLElement {
|
|
|
7673
8140
|
static get style() { return duetNumberInputCss; }
|
|
7674
8141
|
};
|
|
7675
8142
|
|
|
7676
|
-
const duetParagraphCss = "*,*::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;position:relative;display:block;width:100%}.duet-paragraph{margin-bottom:16px !important;display:block;width:100%;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-style:normal;font-weight:400;font-variant-numeric:tabular-nums;-webkit-hyphens:auto;hyphens:auto;line-height:1.5;color:#00294d}.duet-paragraph.duet-p-0{padding:0 !important}.duet-paragraph.duet-m-0{margin:0 !important}.duet-paragraph.duet-theme-turva{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}.duet-paragraph.duet-paragraph-small{font-size:0.875rem}.duet-paragraph.duet-m-0{margin:0 !important}.duet-paragraph.intro{font-size:2.7vw;margin-bottom:28px !important;-webkit-hyphens:inherit;hyphens:inherit}@media (max-width: 37.037037037rem){.duet-paragraph.intro{font-size:1rem}}@media (min-width: 46.2962962963rem){.duet-paragraph.intro{font-size:1.25rem}}.duet-paragraph.intro.duet-m-0{margin:0 !important}::slotted(a){font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:normal;font-weight:400;color:#0077b3;text-decoration:underline;transition:300ms ease}::slotted(a).duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#c60c30}::slotted(a):hover{color:#004d80;text-decoration:none}::slotted(a):hover.duet-theme-turva{color:#940925}::slotted(a):active{opacity:0.75;transition:none}";
|
|
8143
|
+
const duetParagraphCss = "*,*::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;position:relative;display:block;width:100%}.duet-paragraph{margin-bottom:16px !important;display:block;width:100%;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-style:normal;font-weight:400;font-variant-numeric:tabular-nums;-webkit-hyphens:auto;hyphens:auto;line-height:1.5;color:#00294d}.duet-paragraph.duet-p-0{padding:0 !important}.duet-paragraph.duet-m-0{margin:0 !important}.duet-paragraph.duet-theme-turva{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}.duet-paragraph.duet-paragraph-small{font-size:0.875rem}.duet-paragraph.duet-paragraph-semi-bold{font-weight:600}.duet-paragraph.duet-paragraph-bold{font-weight:700}.duet-paragraph.duet-m-0{margin:0 !important}.duet-paragraph.intro{font-size:2.7vw;margin-bottom:28px !important;-webkit-hyphens:inherit;hyphens:inherit}@media (max-width: 37.037037037rem){.duet-paragraph.intro{font-size:1rem}}@media (min-width: 46.2962962963rem){.duet-paragraph.intro{font-size:1.25rem}}.duet-paragraph.intro.duet-m-0{margin:0 !important}::slotted(a){font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:normal;font-weight:400;color:#0077b3;text-decoration:underline;transition:300ms ease}::slotted(a).duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#c60c30}::slotted(a):hover{color:#004d80;text-decoration:none}::slotted(a):hover.duet-theme-turva{color:#940925}::slotted(a):active{opacity:0.75;transition:none}";
|
|
8144
|
+
|
|
8145
|
+
let DuetParagraph$1 = class extends H {
|
|
8146
|
+
constructor() {
|
|
8147
|
+
super();
|
|
8148
|
+
this.__registerHost();
|
|
8149
|
+
this.__attachShadow();
|
|
8150
|
+
/**
|
|
8151
|
+
* Theme of the paragraph.
|
|
8152
|
+
*/
|
|
8153
|
+
this.theme = "";
|
|
8154
|
+
/**
|
|
8155
|
+
* Controls the margin of the component.
|
|
8156
|
+
*/
|
|
8157
|
+
this.margin = "auto";
|
|
8158
|
+
/**
|
|
8159
|
+
* Controls the size of the paragraph.
|
|
8160
|
+
*/
|
|
8161
|
+
this.size = "medium";
|
|
8162
|
+
/**
|
|
8163
|
+
* Controls the Font-Weight of the paragraph.
|
|
8164
|
+
*/
|
|
8165
|
+
this.weight = undefined;
|
|
8166
|
+
/**
|
|
8167
|
+
* Style variation of the paragraph.
|
|
8168
|
+
*/
|
|
8169
|
+
this.variation = "default";
|
|
8170
|
+
/**
|
|
8171
|
+
* Custom color to be used for text, as a design token entered in camelCase or kebab-case.
|
|
8172
|
+
* Example: "color-primary".
|
|
8173
|
+
*/
|
|
8174
|
+
this.color = "";
|
|
8175
|
+
}
|
|
8176
|
+
/**
|
|
8177
|
+
* Component lifecycle events.
|
|
8178
|
+
*/
|
|
8179
|
+
componentWillLoad() {
|
|
8180
|
+
inheritGlobalTheme(this);
|
|
8181
|
+
}
|
|
8182
|
+
/**
|
|
8183
|
+
* render() function
|
|
8184
|
+
* Always the last one in the class.
|
|
8185
|
+
*/
|
|
8186
|
+
render() {
|
|
8187
|
+
const color = getColorByName(this.color);
|
|
8188
|
+
return (h$1("p", { class: {
|
|
8189
|
+
"duet-paragraph": true,
|
|
8190
|
+
"duet-paragraph-small": this.size === "small",
|
|
8191
|
+
"duet-paragraph-semi-bold": this.weight === "semi-bold",
|
|
8192
|
+
"duet-paragraph-bold": this.weight === "bold",
|
|
8193
|
+
"duet-m-0": this.margin === "none",
|
|
8194
|
+
[this.variation]: true,
|
|
8195
|
+
"duet-theme-turva": this.theme === "turva",
|
|
8196
|
+
}, style: { color }, part: "duet-paragraph" }, h$1("slot", null)));
|
|
8197
|
+
}
|
|
8198
|
+
get element() { return this; }
|
|
8199
|
+
static get style() { return duetParagraphCss; }
|
|
8200
|
+
};
|
|
8201
|
+
|
|
8202
|
+
const duetProgressCss = "*,*::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;width:100%;height:inherit}.duet-progress{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%;min-height:1px;}.duet-progress .progress-bar{position:relative;display:block;width:100%;height:inherit;min-height:1px;background-color:#f3f9fc;border-radius:0;box-shadow:none}.duet-theme-turva .duet-progress .progress-bar{background-color:#fcf3f4}.duet-progress .progress-bar>span{display:block;height:inherit;text-indent:-9999px;background-color:#0077b3;border-radius:0}.duet-theme-turva .duet-progress .progress-bar>span{background-color:#c60c30}.duet-progress progress[value]{display:flex;width:100%;height:inherit;min-height:1px;color:#0077b3;border:0 none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.duet-theme-turva .duet-progress progress[value]{color:#c60c30}.duet-progress progress[value]::-webkit-progress-bar{background-color:#f3f9fc;border-radius:0}.duet-theme-turva .duet-progress progress[value]::-webkit-progress-bar{background-color:#fcf3f4}.duet-progress progress[value]::-webkit-progress-value{background-color:#0077b3;background-size:35px 20px, 100% 100%, 100% 100%;border-radius:0;-webkit-animation:animate-stripes 5s linear infinite;animation:animate-stripes 5s linear infinite}.duet-theme-turva .duet-progress progress[value]::-webkit-progress-value{background-color:#c60c30}.duet-progress progress[value] ::-moz-progress-bar{background-color:#f3f9fc}.duet-theme-turva .duet-progress progress[value] ::-moz-progress-bar{background-color:#fcf3f4}";
|
|
7677
8203
|
|
|
7678
|
-
let
|
|
8204
|
+
let DuetProgress$1 = class extends H {
|
|
7679
8205
|
constructor() {
|
|
7680
8206
|
super();
|
|
7681
8207
|
this.__registerHost();
|
|
7682
|
-
attachShadow(this);
|
|
7683
8208
|
/**
|
|
7684
|
-
*
|
|
8209
|
+
* Own Properties
|
|
8210
|
+
*/
|
|
8211
|
+
this.progressId = createID("DuetProgress");
|
|
8212
|
+
this.progressLabelId = createID("DuetProgressLabel");
|
|
8213
|
+
/**
|
|
8214
|
+
* Defaults for accessibleLabel
|
|
7685
8215
|
*/
|
|
7686
|
-
this.
|
|
8216
|
+
this.accessibleLabelUploadDefaults = {
|
|
8217
|
+
fi: ["lähetys valmis", "lähetys käynnissä"],
|
|
8218
|
+
sv: ["Uppladdningen är klar", "Uppladdning pågår"],
|
|
8219
|
+
en: ["upload completed", "upload in progress"],
|
|
8220
|
+
};
|
|
7687
8221
|
/**
|
|
7688
|
-
*
|
|
8222
|
+
* Adds accessible label for upload in progress and upload complete states
|
|
8223
|
+
* @default {fi: ["lähetys valmis", "lähetys käynnissä"],sv: ["Uppladdningen är klar", "Uppladdning pågår"], en: ["completed", "in progress"]}
|
|
7689
8224
|
*/
|
|
7690
|
-
this.
|
|
8225
|
+
this.accessibleLabelUpload = getLocaleString(this.accessibleLabelUploadDefaults);
|
|
7691
8226
|
/**
|
|
7692
|
-
*
|
|
8227
|
+
* Progress of the bar, a value from 0-100
|
|
7693
8228
|
*/
|
|
7694
|
-
this.
|
|
8229
|
+
this.progress = 0;
|
|
7695
8230
|
/**
|
|
7696
|
-
*
|
|
8231
|
+
* Height of progressbar
|
|
7697
8232
|
*/
|
|
7698
|
-
this.
|
|
8233
|
+
this.height = "10px";
|
|
7699
8234
|
/**
|
|
7700
|
-
*
|
|
7701
|
-
* Example: "color-primary".
|
|
8235
|
+
* Theme of the input.
|
|
7702
8236
|
*/
|
|
7703
|
-
this.
|
|
8237
|
+
this.theme = "";
|
|
7704
8238
|
}
|
|
7705
8239
|
/**
|
|
7706
8240
|
* Component lifecycle events.
|
|
@@ -7713,22 +8247,23 @@ let DuetParagraph$1 = class extends HTMLElement {
|
|
|
7713
8247
|
* Always the last one in the class.
|
|
7714
8248
|
*/
|
|
7715
8249
|
render() {
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
"duet-
|
|
7720
|
-
"duet-
|
|
7721
|
-
|
|
8250
|
+
return (h$1(Host, null, h$1("div", { "aria-live": this.accessibleLabel ? "polite" : "off", "aria-hidden": this.accessibleLabel ? "false" : "true", "aria-atomic": "true", style: {
|
|
8251
|
+
height: this.height,
|
|
8252
|
+
}, id: this.progressId, class: {
|
|
8253
|
+
"duet-progress": true,
|
|
8254
|
+
"duet-progress-done": this.progress === 100,
|
|
8255
|
+
"duet-progress-start": this.progress === 0,
|
|
8256
|
+
"duet-progress-inprogress": this.progress < 99 && this.progress !== 0,
|
|
7722
8257
|
"duet-theme-turva": this.theme === "turva",
|
|
7723
|
-
},
|
|
8258
|
+
} }, h$1("duet-visually-hidden", null, h$1("label", { htmlFor: this.progressLabelId }, this.progress !== 0 && (h$1("span", null, this.accessibleLabel, ", ", this.accessibleLabelUpload[this.progress < 99 ? 1 : 0])))), this.caption && (h$1("div", { class: "duet-progress-caption" }, h$1("span", null, this.caption))), h$1("progress", { id: this.progressLabelId, "aria-describedby": this.accessibleDescribedBy, role: "progressbar", value: this.progress, max: "100", "aria-valuemin": "0", "aria-valuemax": "100" }, h$1("div", { class: "progress-bar" }, h$1("span", { style: { width: `${this.progress}%;` } }, "Progress: ", this.progress, "%"))))));
|
|
7724
8259
|
}
|
|
7725
8260
|
get element() { return this; }
|
|
7726
|
-
static get style() { return
|
|
8261
|
+
static get style() { return duetProgressCss; }
|
|
7727
8262
|
};
|
|
7728
8263
|
|
|
7729
8264
|
const duetRadioCss = "*.sc-duet-radio,*.sc-duet-radio::after,*.sc-duet-radio::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-radio-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:28px !important;margin-bottom:12px !important;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-radio-h:last-child,.sc-duet-radio-h:last-of-type{margin-right:0 !important}.vertical.sc-duet-radio-h{margin-right:0 !important}.horizontal.sc-duet-radio-h{margin-bottom:0 !important;width:auto}.horizontal.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}@media (min-width: 48em){.horizontal-responsive.sc-duet-radio-h{margin-right:28px !important;margin-bottom:0 !important;width:auto}.horizontal-responsive.sc-duet-radio-h:last-child,.horizontal-responsive.sc-duet-radio-h:last-of-type{margin-right:0 !important}.horizontal-responsive.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}}.duet-m-0.sc-duet-radio-h{margin:0 !important}.sc-duet-radio-h:last-child:not(:only-child){margin-right:0 !important;margin-bottom:0 !important}.duet-label.sc-duet-radio{position:relative;z-index:100;display:flex;width:100%;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.5;color:#00294d;cursor:pointer;background:transparent}.duet-theme-turva.sc-duet-radio .duet-label.sc-duet-radio{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}.duet-label.sc-duet-radio span.sc-duet-radio{flex-grow:1;font-size:1rem}.duet-label-hidden.sc-duet-radio .duet-label.sc-duet-radio{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-radio-container.sc-duet-radio{position:relative;width:100%;height:100%}.duet-radio.sc-duet-radio{padding:14px !important;position:absolute;top:0;left:0;z-index:200;width:100%;height:100%;cursor:pointer;opacity:0}.duet-radio.sc-duet-radio+label.sc-duet-radio::before{z-index:100;flex-shrink:0;width:20px;height:20px;margin:2px 10px 1px 1px;content:\"\";background:white;border:1px solid #00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio+label.sc-duet-radio::before{border-color:#171c3a}.duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{position:absolute;top:6px;left:5px;z-index:200;flex-shrink:0;width:12px;height:12px;content:\"\";background:#00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{background:#171c3a}.duet-radio[disabled].sc-duet-radio{cursor:default}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#747475}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfd2d4}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfcfd1}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::before{border:1px solid #657787}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#747475;border-color:#747475}";
|
|
7730
8265
|
|
|
7731
|
-
let DuetRadio$1 = class extends
|
|
8266
|
+
let DuetRadio$1 = class extends H {
|
|
7732
8267
|
constructor() {
|
|
7733
8268
|
super();
|
|
7734
8269
|
this.__registerHost();
|
|
@@ -7835,7 +8370,7 @@ let DuetRadio$1 = class extends HTMLElement {
|
|
|
7835
8370
|
|
|
7836
8371
|
const duetRadioGroupCss = "*.sc-duet-radio-group,*.sc-duet-radio-group::after,*.sc-duet-radio-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-radio-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-radio-group-h .duet-radio-group.sc-duet-radio-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-radio-group-h .duet-radio-group.sc-duet-radio-group{display:flex}}.horizontal.sc-duet-radio-group-h .duet-radio-group.duet-no-stacking.sc-duet-radio-group{display:flex}.deut-radio-group.sc-duet-radio-group{width:100%}";
|
|
7837
8372
|
|
|
7838
|
-
let DuetRadioGroup$1 = class extends
|
|
8373
|
+
let DuetRadioGroup$1 = class extends H {
|
|
7839
8374
|
constructor() {
|
|
7840
8375
|
super();
|
|
7841
8376
|
this.__registerHost();
|
|
@@ -7993,7 +8528,7 @@ const colors = {
|
|
|
7993
8528
|
inactive: colorGray,
|
|
7994
8529
|
},
|
|
7995
8530
|
};
|
|
7996
|
-
let DuetRangeSlider$1 = class extends
|
|
8531
|
+
let DuetRangeSlider$1 = class extends H {
|
|
7997
8532
|
constructor() {
|
|
7998
8533
|
super();
|
|
7999
8534
|
this.__registerHost();
|
|
@@ -8136,7 +8671,7 @@ let DuetRangeSlider$1 = class extends HTMLElement {
|
|
|
8136
8671
|
static get style() { return duetRangeSliderCss; }
|
|
8137
8672
|
};
|
|
8138
8673
|
|
|
8139
|
-
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-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}";
|
|
8674
|
+
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}";
|
|
8140
8675
|
|
|
8141
8676
|
function isOptionGroup(item) {
|
|
8142
8677
|
return "options" in item;
|
|
@@ -8152,7 +8687,7 @@ function findOptionByValue(items, value) {
|
|
|
8152
8687
|
}
|
|
8153
8688
|
}
|
|
8154
8689
|
}
|
|
8155
|
-
let DuetSelect$1 = class extends
|
|
8690
|
+
let DuetSelect$1 = class extends H {
|
|
8156
8691
|
constructor() {
|
|
8157
8692
|
super();
|
|
8158
8693
|
this.__registerHost();
|
|
@@ -8259,14 +8794,14 @@ let DuetSelect$1 = class extends HTMLElement {
|
|
|
8259
8794
|
if (this.nativeSelect) {
|
|
8260
8795
|
this.nativeSelect.value = this.value;
|
|
8261
8796
|
}
|
|
8262
|
-
this.isCaptionVisible = !!
|
|
8797
|
+
this.isCaptionVisible = !!this.caption;
|
|
8263
8798
|
}
|
|
8264
8799
|
/**
|
|
8265
8800
|
* Component lifecycle events.
|
|
8266
8801
|
*/
|
|
8267
8802
|
componentWillLoad() {
|
|
8268
8803
|
inheritGlobalTheme(this);
|
|
8269
|
-
this.isCaptionVisible = !!
|
|
8804
|
+
this.isCaptionVisible = !!this.caption;
|
|
8270
8805
|
this.refresh();
|
|
8271
8806
|
}
|
|
8272
8807
|
/**
|
|
@@ -8309,7 +8844,7 @@ let DuetSelect$1 = class extends HTMLElement {
|
|
|
8309
8844
|
"duet-theme-turva": this.theme === "turva",
|
|
8310
8845
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
8311
8846
|
"has-error": !!this.error,
|
|
8312
|
-
} }, h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, id: this.labelId, for: identifier }, this.label), this.tooltip && (h$1("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (h$1("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), this.placeholder && this.echoPlaceholder && this.value && (h$1("duet-caption", { id: this.topCaptionPlaceholderId, size: "small" }, this.placeholder)), h$1("
|
|
8847
|
+
} }, h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, id: this.labelId, for: identifier }, this.label), this.tooltip && (h$1("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (h$1("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), h$1("div", { class: "duet-select-wrapper" }, this.placeholder && this.echoPlaceholder && this.value && (h$1("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-select-placeholder", size: "small" }, this.placeholder)), h$1("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$1("option", { disabled: true, selected: true, value: "" }, this.placeholder)), !this.processedItems ? (h$1("option", null, "Virhe valintoja ladattaessa. P\u00E4ivit\u00E4 sivu ja kokeile uusiksi.")) : (this.processedItems.map(item => {
|
|
8313
8848
|
return isOptionGroup(item) ? this.renderOptionGroup(item) : this.renderOption(item);
|
|
8314
8849
|
}))), h$1("div", { class: "duet-select", "aria-hidden": "true" }, h$1("span", { key: this.value }, this.getSelectedItemLabel()), h$1("svg", { role: "img", class: "duet-select-icon", fill: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h$1("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" })))), h$1("span", { class: "duet-select-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h$1("span", null, this.error)))));
|
|
8315
8850
|
}
|
|
@@ -8323,11 +8858,11 @@ let DuetSelect$1 = class extends HTMLElement {
|
|
|
8323
8858
|
|
|
8324
8859
|
const duetSpacerCss = ":host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;position:relative;display:block;width:12px;min-width:12px;height:12px}@media (min-width: 36em){:host{width:16px;min-width:16px;height:16px}}:host(.duet-spacer-horizontal){display:inline-block;height:100% !important}:host(.duet-spacer-horizontal.xx-small){width:4px;min-width:4px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.xx-small){width:4px;min-width:4px}}:host(.duet-spacer-horizontal.x-small){width:4px;min-width:4px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.x-small){width:8px;min-width:8px}}:host(.duet-spacer-horizontal.small){width:8px;min-width:8px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.small){width:12px;min-width:12px}}:host(.duet-spacer-horizontal.medium){height:100%}:host(.duet-spacer-horizontal.large){width:16px;min-width:16px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.large){width:20px;min-width:20px}}:host(.duet-spacer-horizontal.x-large){width:20px;min-width:20px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.x-large){width:28px;min-width:28px}}:host(.duet-spacer-horizontal.xx-large){width:28px;min-width:28px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.xx-large){width:36px;min-width:36px}}:host(.duet-spacer-horizontal.xxx-large){width:36px;min-width:36px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.xxx-large){width:48px;min-width:48px}}:host(.duet-spacer-horizontal.xxxx-large){width:48px;min-width:48px;height:100%}@media (min-width: 36em){:host(.duet-spacer-horizontal.xxxx-large){width:72px;min-width:72px}}:host(.duet-spacer-vertical.xx-small){width:100%;height:4px;min-height:4px}:host(.duet-spacer-vertical.x-small){width:100%;height:4px;min-height:4px}@media (min-width: 36em){:host(.duet-spacer-vertical.x-small){height:8px;min-height:8px}}:host(.duet-spacer-vertical.small){width:100%;height:8px;min-height:8px}@media (min-width: 36em){:host(.duet-spacer-vertical.small){height:12px;min-height:12px}}:host(.duet-spacer-vertical.medium){width:100%}:host(.duet-spacer-vertical.large){width:100%;height:16px;min-height:16px}@media (min-width: 36em){:host(.duet-spacer-vertical.large){height:20px;min-height:20px}}:host(.duet-spacer-vertical.x-large){width:100%;height:20px;min-height:20px}@media (min-width: 36em){:host(.duet-spacer-vertical.x-large){height:28px;min-height:28px}}:host(.duet-spacer-vertical.xx-large){width:100%;height:28px;min-height:28px}@media (min-width: 36em){:host(.duet-spacer-vertical.xx-large){height:36px;min-height:36px}}:host(.duet-spacer-vertical.xxx-large){width:100%;height:36px;min-height:36px}@media (min-width: 36em){:host(.duet-spacer-vertical.xxx-large){height:48px;min-height:48px}}:host(.duet-spacer-vertical.xxxx-large){width:100%;height:48px;min-height:48px}@media (min-width: 36em){:host(.duet-spacer-vertical.xxxx-large){height:72px;min-height:72px}}:host(.duet-spacer-xx-small){display:none}@media (max-width: 22.5em){:host(.duet-spacer-xx-small){display:block}}:host(.duet-spacer-x-small){display:none}@media (max-width: 35.9375em){:host(.duet-spacer-x-small){display:block}}:host(.duet-spacer-small){display:none}@media (min-width: 36em){:host(.duet-spacer-small){display:block}}:host(.duet-spacer-medium){display:none}@media (min-width: 48em){:host(.duet-spacer-medium){display:block}}:host(.duet-spacer-large){display:none}@media (min-width: 62em){:host(.duet-spacer-large){display:block}}:host(.duet-spacer-x-large){display:none}@media (min-width: 64.0625em){:host(.duet-spacer-x-large){display:block}}:host(.duet-spacer-xx-large){display:none}@media (min-width: 76.25em){:host(.duet-spacer-xx-large){display:block}}";
|
|
8325
8860
|
|
|
8326
|
-
let DuetSpacer$1 = class extends
|
|
8861
|
+
let DuetSpacer$1 = class extends H {
|
|
8327
8862
|
constructor() {
|
|
8328
8863
|
super();
|
|
8329
8864
|
this.__registerHost();
|
|
8330
|
-
|
|
8865
|
+
this.__attachShadow();
|
|
8331
8866
|
/**
|
|
8332
8867
|
* Size variation of the spacer. Can be any of the spacing tokens.
|
|
8333
8868
|
*/
|
|
@@ -8365,11 +8900,11 @@ let DuetSpacer$1 = class extends HTMLElement {
|
|
|
8365
8900
|
|
|
8366
8901
|
const duetSpinnerCss = ":host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;position:absolute;top:50%;left:50%;z-index:800;max-width:100%}:host(.duet-theme-default) .duet-spinner{color:#0077b3 !important}:host(.duet-theme-turva) .duet-spinner{color:#c60c30 !important}:host(.duet-custom-color){color:inherit}*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-spinner{-webkit-user-select:none;user-select:none;position:absolute;top:50%;left:50%;z-index:800;width:24px;height:24px;color:#0077b3;border:2px solid transparent;border-left:2px solid currentColor;border-radius:50%;transform:translateZ(0) translateX(-50%) translateY(-50%);transform-origin:0% 0%;animation:duetRotate 0.6s linear infinite}.duet-spinner::after{position:absolute;top:50%;left:50%;z-index:200;box-sizing:content-box;width:100%;height:100%;overflow:hidden;content:\"\";border:2px solid currentColor;border-radius:50%;opacity:0.3;transform:translateZ(0) translateX(-50%) translateY(-50%);transform-origin:0% 0%}.duet-spinner.medium{width:36px;height:36px;border-width:4px}.duet-spinner.medium::after{border-width:4px}.duet-spinner.large{width:72px;height:72px;border-width:8px}.duet-spinner.large::after{border-width:8px}@keyframes duetRotate{0%{transform:translateZ(0) rotate(0deg) translateX(-50%) translateY(-50%)}100%{transform:translateZ(0) rotate(360deg) translateX(-50%) translateY(-50%)}}";
|
|
8367
8902
|
|
|
8368
|
-
let DuetSpinner$1 = class extends
|
|
8903
|
+
let DuetSpinner$1 = class extends H {
|
|
8369
8904
|
constructor() {
|
|
8370
8905
|
super();
|
|
8371
8906
|
this.__registerHost();
|
|
8372
|
-
|
|
8907
|
+
this.__attachShadow();
|
|
8373
8908
|
/**
|
|
8374
8909
|
* Color of the spinner, as a design token entered in camelCase or kebab-case.
|
|
8375
8910
|
* Example: "color-primary". This property can also be set to "currentColor"
|
|
@@ -8416,7 +8951,7 @@ var actionEdit2={"title":"action-edit-2","tags":"action edit 2 pen pencil","svg"
|
|
|
8416
8951
|
|
|
8417
8952
|
const duetStepCss = "*.sc-duet-step,*.sc-duet-step::after,*.sc-duet-step::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-step-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block}.duet-step.sc-duet-step{padding:20px !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:600;background:white;box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}.duet-step.duet-theme-turva.sc-duet-step{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";box-shadow:0 2px 6px 0 rgba(117, 117, 117, 0.13), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}.duet-step.rounded-top.sc-duet-step{border-top-left-radius:4px;border-top-right-radius:4px}.duet-step.rounded-bottom.sc-duet-step{margin-bottom:20px !important;border-bottom-right-radius:4px;border-bottom-left-radius:4px}@media (min-width: 36em){.duet-step.rounded-bottom.sc-duet-step{margin-bottom:0 !important}}@media (min-width: 36em){.duet-step.sc-duet-step{padding:0 20px 0 0 !important;margin:0 !important;font-size:1.25rem;box-shadow:none !important}}.duet-step-heading.sc-duet-step{display:flex;align-items:center;border-radius:4px}.duet-step-heading[aria-disabled=false].sc-duet-step{cursor:pointer}.duet-step-heading.sc-duet-step:focus{outline:0}.duet-step-heading.sc-duet-step:active{opacity:0.75}.user-is-tabbing.sc-duet-step-h .duet-step-heading.sc-duet-step:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.user-is-tabbing.sc-duet-step-h .duet-theme-turva.sc-duet-step .duet-step-heading.sc-duet-step:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.is-complete.sc-duet-step .duet-step-heading.sc-duet-step:hover .duet-step-counter.sc-duet-step,.is-disabled.sc-duet-step .duet-step-heading.sc-duet-step:hover .duet-step-counter.sc-duet-step{background-color:#005f8f}.duet-theme-turva.is-complete.sc-duet-step .duet-step-heading.sc-duet-step:hover .duet-step-counter.sc-duet-step,.duet-theme-turva.is-disabled.sc-duet-step .duet-step-heading.sc-duet-step:hover .duet-step-counter.sc-duet-step{background-color:#9e0a26}.is-current.sc-duet-step .duet-step-heading.sc-duet-step{margin-bottom:20px}@media (min-width: 36em){.duet-step-heading.sc-duet-step{margin-top:8px;margin-bottom:8px !important}.sc-duet-step-h:first-of-type .duet-step-heading.sc-duet-step{margin-top:0}.sc-duet-step-h:last-of-type .duet-step-heading.sc-duet-step{margin-bottom:0 !important}}.duet-step-counter.sc-duet-step{-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;width:30px;height:30px;line-height:30px;color:white;text-align:center;border-radius:50%;transition:background-color 300ms ease}@media (min-width: 36em){.duet-step-counter.sc-duet-step{width:40px;height:40px;line-height:40px}}.is-complete.sc-duet-step .duet-step-counter.sc-duet-step,.is-current.sc-duet-step .duet-step-counter.sc-duet-step,.is-disabled.sc-duet-step .duet-step-counter.sc-duet-step{background-color:#0077b3}.duet-theme-turva.is-complete.sc-duet-step .duet-step-counter.sc-duet-step,.duet-theme-turva.is-current.sc-duet-step .duet-step-counter.sc-duet-step,.duet-theme-turva.is-disabled.sc-duet-step .duet-step-counter.sc-duet-step{background-color:#c60c30}.is-incomplete.sc-duet-step .duet-step-counter.sc-duet-step{background-color:#657787}.duet-theme-turva.is-incomplete.sc-duet-step .duet-step-counter.sc-duet-step{background-color:#747475}.duet-step-icon.sc-duet-step{display:flex;align-items:center;justify-content:center;width:16px;height:16px}@media (min-width: 36em){.duet-step-icon.sc-duet-step{width:20px;height:20px}}.duet-step-icon.sc-duet-step duet-icon.sc-duet-step{width:16px;height:16px}@media (min-width: 36em){.duet-step-icon.sc-duet-step duet-icon.sc-duet-step{width:20px;height:20px}}@media (min-width: 36em){.duet-step-content-wrapper.sc-duet-step{min-height:20px;padding-left:40px;margin-left:19px;border-left:2px solid #e1e3e6}.duet-theme-turva.sc-duet-step .duet-step-content-wrapper.sc-duet-step{border-color:#e4e4e6}.sc-duet-step-h:last-of-type .duet-step-content-wrapper.sc-duet-step{min-height:0;border:transparent}}.duet-step-content.sc-duet-step{display:none;padding-bottom:16px}@media (min-width: 36em){.duet-step-content.sc-duet-step{padding-bottom:28px}}.is-current.sc-duet-step .duet-step-content.sc-duet-step{display:block}.duet-step-heading-slot.sc-duet-step{display:none;margin-top:2px}@media (min-width: 48em){.duet-step-heading-slot.sc-duet-step{display:block}}";
|
|
8418
8953
|
|
|
8419
|
-
let DuetStep$1 = class extends
|
|
8954
|
+
let DuetStep$1 = class extends H {
|
|
8420
8955
|
constructor() {
|
|
8421
8956
|
super();
|
|
8422
8957
|
this.__registerHost();
|
|
@@ -8524,11 +9059,11 @@ function groupBy(prop, items) {
|
|
|
8524
9059
|
|
|
8525
9060
|
const duetStepperCss = ":host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}.duet-stepper{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}@media (min-width: 36em){.duet-stepper{padding:28px !important;padding-top:36px !important;padding-bottom:36px !important;background:white;border-radius:4px;box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}}";
|
|
8526
9061
|
|
|
8527
|
-
let DuetStepper$1 = class extends
|
|
9062
|
+
let DuetStepper$1 = class extends H {
|
|
8528
9063
|
constructor() {
|
|
8529
9064
|
super();
|
|
8530
9065
|
this.__registerHost();
|
|
8531
|
-
|
|
9066
|
+
this.__attachShadow();
|
|
8532
9067
|
this.duetStepChange = createEvent$2(this, "duetStepChange", 7);
|
|
8533
9068
|
/**
|
|
8534
9069
|
* Theme of the component.
|
|
@@ -8641,7 +9176,7 @@ let DuetStepper$1 = class extends HTMLElement {
|
|
|
8641
9176
|
|
|
8642
9177
|
const duetTabCss = ".sc-duet-tab-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-tab.sc-duet-tab{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:none;width:100%}.duet-tab.selected.sc-duet-tab{display:block}";
|
|
8643
9178
|
|
|
8644
|
-
let DuetTab$1 = class extends
|
|
9179
|
+
let DuetTab$1 = class extends H {
|
|
8645
9180
|
constructor() {
|
|
8646
9181
|
super();
|
|
8647
9182
|
this.__registerHost();
|
|
@@ -8658,9 +9193,9 @@ let DuetTab$1 = class extends HTMLElement {
|
|
|
8658
9193
|
static get style() { return duetTabCss; }
|
|
8659
9194
|
};
|
|
8660
9195
|
|
|
8661
|
-
const duetTabGroupCss = "*.sc-duet-tab-group,*.sc-duet-tab-group::after,*.sc-duet-tab-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-tab-group-h{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;display:block;width:100%}.duet-tab-group-tabs.sc-duet-tab-group{margin-bottom:28px !important;display:block;width:100%;max-width:100%;padding-top:2px;list-style:none}.duet-tab-group-tabs.duet-m-0.sc-duet-tab-group{margin:0 !important}.duet-tab-group-tabs.duet-tab-group-hidden.sc-duet-tab-group{display:none}@media (min-width: 36em){.duet-tab-group-tabs.duet-tab-group-hidden.sc-duet-tab-group{display:block}}.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-group-tabs.sc-duet-tab-group{border-bottom:1px solid #e1e3e6}.duet-theme-turva.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-group-tabs.sc-duet-tab-group{border-bottom-color:#e4e4e6 !important}@media (min-width: 36em){duet-select.sc-duet-tab-group{display:none !important}}.duet-tab-button.sc-duet-tab-group{-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:block;width:100%;padding:20px;margin-top:-2px;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:600;line-height:1.1;color:#00294d !important;text-align:left;text-decoration:none;cursor:pointer;background:white;border:2px solid #e1e3e6;border-style:solid;border-radius:0;transition:150ms ease}.duet-tab-button.duet-p-0.sc-duet-tab-group{padding:0 !important}.duet-tab-button.duet-m-0.sc-duet-tab-group{margin:0 !important}.duet-theme-turva.sc-duet-tab-group .duet-tab-button.sc-duet-tab-group{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 !important;border-color:#e4e4e6}.duet-tab-button.duet-p-0.sc-duet-tab-group{padding:0 !important}@media (min-width: 36em){.duet-tab-button.sc-duet-tab-group{display:inline-block;width:auto;margin-left:-2px;border-right:2px solid #e1e3e6;border-radius:0}}.duet-tab-button.sc-duet-tab-group:hover{z-index:200;border-color:#909599}.duet-theme-turva.sc-duet-tab-group .duet-tab-button.sc-duet-tab-group:hover{border-color:#747475 !important}.duet-tab-button.sc-duet-tab-group:active{opacity:0.75;transition:none}.duet-tab-button.selected.sc-duet-tab-group{z-index:201;color:white !important;background:#00294d;border-color:#00294d;outline:0;box-shadow:none !important}.duet-theme-turva.sc-duet-tab-group .duet-tab-button.selected.sc-duet-tab-group{color:white !important;background-color:#
|
|
9196
|
+
const duetTabGroupCss = "*.sc-duet-tab-group,*.sc-duet-tab-group::after,*.sc-duet-tab-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-tab-group-h{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;display:block;width:100%}.duet-tab-group-tabs.sc-duet-tab-group{margin-bottom:28px !important;display:block;width:100%;max-width:100%;padding-top:2px;list-style:none}.duet-tab-group-tabs.duet-m-0.sc-duet-tab-group{margin:0 !important}.duet-tab-group-tabs.duet-tab-group-hidden.sc-duet-tab-group{display:none}@media (min-width: 36em){.duet-tab-group-tabs.duet-tab-group-hidden.sc-duet-tab-group{display:block}}.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-group-tabs.sc-duet-tab-group{border-bottom:1px solid #e1e3e6}.duet-theme-turva.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-group-tabs.sc-duet-tab-group{border-bottom-color:#e4e4e6 !important}@media (min-width: 36em){duet-select.sc-duet-tab-group{display:none !important}}.duet-tab-button.sc-duet-tab-group{-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:block;width:100%;padding:20px;margin-top:-2px;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:600;line-height:1.1;color:#00294d !important;text-align:left;text-decoration:none;cursor:pointer;background:white;border:2px solid #e1e3e6;border-style:solid;border-radius:0;transition:150ms ease}.duet-tab-button.duet-p-0.sc-duet-tab-group{padding:0 !important}.duet-tab-button.duet-m-0.sc-duet-tab-group{margin:0 !important}.duet-theme-turva.sc-duet-tab-group .duet-tab-button.sc-duet-tab-group{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 !important;border-color:#e4e4e6}.duet-tab-button.duet-p-0.sc-duet-tab-group{padding:0 !important}@media (min-width: 36em){.duet-tab-button.sc-duet-tab-group{display:inline-block;width:auto;margin-left:-2px;border-right:2px solid #e1e3e6;border-radius:0}}.duet-tab-button.sc-duet-tab-group:hover{z-index:200;border-color:#909599}.duet-theme-turva.sc-duet-tab-group .duet-tab-button.sc-duet-tab-group:hover{border-color:#747475 !important}.duet-tab-button.sc-duet-tab-group:active{opacity:0.75;transition:none}.duet-tab-button.selected.sc-duet-tab-group{z-index:201;color:white !important;background:#00294d;border-color:#00294d;outline:0;box-shadow:none !important}.duet-theme-turva.sc-duet-tab-group .duet-tab-button.selected.sc-duet-tab-group{color:white !important;background-color:#171c3a;border-color:#171c3a !important}.duet-tab-button.sc-duet-tab-group:focus{z-index:200;outline:0}.user-is-tabbing.sc-duet-tab-group-h .duet-tab-button.sc-duet-tab-group:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3 !important}.user-is-tabbing.sc-duet-tab-group-h .duet-theme-turva.sc-duet-tab-group .duet-tab-button.sc-duet-tab-group:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a !important}.duet-tab-button.sc-duet-tab-group:first-child{border-top-left-radius:4px;border-top-right-radius:4px}@media (min-width: 36em){.duet-tab-button.sc-duet-tab-group:first-child{border-top-right-radius:0;border-bottom-left-radius:4px}}.duet-tab-button.sc-duet-tab-group:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}@media (min-width: 36em){.duet-tab-button.sc-duet-tab-group:last-child{border-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}}.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-button.sc-duet-tab-group{display:inline-block;width:auto;padding-right:0;padding-left:0;border:0;border-radius:0;transition:none}.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-button.sc-duet-tab-group+.duet-tab-button.sc-duet-tab-group{margin-left:36px}.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-button.selected.sc-duet-tab-group{color:#0077b3 !important;background:white;border-bottom:3px solid #0077b3}.duet-theme-turva.duet-tab-variation-plain.sc-duet-tab-group .duet-tab-button.selected.sc-duet-tab-group{color:#c60c30 !important;border-bottom-color:#c60c30 !important}.duet-tab-group-content.sc-duet-tab-group{position:relative;width:100%;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.5;color:#00294d;text-align:left}.duet-theme-turva.sc-duet-tab-group .duet-tab-group-content.sc-duet-tab-group{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}";
|
|
8662
9197
|
|
|
8663
|
-
let DuetTabGroup$1 = class extends
|
|
9198
|
+
let DuetTabGroup$1 = class extends H {
|
|
8664
9199
|
constructor() {
|
|
8665
9200
|
super();
|
|
8666
9201
|
this.__registerHost();
|
|
@@ -8689,14 +9224,19 @@ let DuetTabGroup$1 = class extends HTMLElement {
|
|
|
8689
9224
|
*/
|
|
8690
9225
|
this.language = getLanguage();
|
|
8691
9226
|
/**
|
|
8692
|
-
*
|
|
9227
|
+
* Defaults for Label
|
|
8693
9228
|
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
8694
9229
|
*/
|
|
8695
|
-
this.
|
|
9230
|
+
this.labelDefaults = {
|
|
8696
9231
|
fi: "Valitse",
|
|
8697
9232
|
en: "Choose",
|
|
8698
9233
|
sv: "Välj",
|
|
8699
|
-
}
|
|
9234
|
+
};
|
|
9235
|
+
/**
|
|
9236
|
+
* Label for the select element which gets shown on mobile.
|
|
9237
|
+
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
9238
|
+
*/
|
|
9239
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
8700
9240
|
/**
|
|
8701
9241
|
* Determines whether the label for the select element shown on mobile is visually hidden.
|
|
8702
9242
|
*/
|
|
@@ -8854,7 +9394,7 @@ const stickyTopValues = {
|
|
|
8854
9394
|
"with-links": parseFloat(sizeNavigation) * 16,
|
|
8855
9395
|
"without-links": parseFloat(sizeHeader) * 16,
|
|
8856
9396
|
};
|
|
8857
|
-
let DuetTable$1 = class extends
|
|
9397
|
+
let DuetTable$1 = class extends H {
|
|
8858
9398
|
constructor() {
|
|
8859
9399
|
super();
|
|
8860
9400
|
this.__registerHost();
|
|
@@ -8954,7 +9494,7 @@ let DuetTable$1 = class extends HTMLElement {
|
|
|
8954
9494
|
static get style() { return duetTableCss; }
|
|
8955
9495
|
};
|
|
8956
9496
|
|
|
8957
|
-
const duetTextareaCss = "*.sc-duet-textarea,*.sc-duet-textarea::after,*.sc-duet-textarea::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-textarea-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:block;width:100%;max-width:100%;text-align:left}.sc-duet-textarea-h:last-child,.sc-duet-textarea-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-textarea-h{width:calc(50% - 16px - 3px)}.duet-expand.sc-duet-textarea-h{width:100% !important}}.duet-m-0.sc-duet-textarea-h{margin:0 !important}duet-tooltip.sc-duet-textarea{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-textarea{position:relative;top:4px;right:auto}}.duet-textarea-container.sc-duet-textarea{position:relative;width:100%;height:100%}.duet-textarea-container.sc-duet-textarea .duet-input-top-caption.sc-duet-textarea{display:none}.duet-textarea-container.duet-input-top-caption-shown.sc-duet-textarea .duet-input-top-caption.sc-duet-textarea{display:flex !important}.duet-textarea.sc-duet-textarea{padding:15px !important;position:relative;z-index:100;display:block;width:100%;min-width:8rem;min-height:160px;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.25;color:#00294d;resize:vertical;background:white;border:1px solid #909599;border-radius:4px;transition:150ms ease}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea{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}.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea{border-color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea{border-color:#e02a0d !important}.duet-textarea.sc-duet-textarea::-webkit-input-placeholder{color:#657787;opacity:1 !important;transition:color 300ms ease}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea::-webkit-input-placeholder{color:#747475}.duet-textarea.sc-duet-textarea:focus::-webkit-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus::-webkit-input-placeholder{color:#cfcfd1}.duet-textarea.sc-duet-textarea::-moz-placeholder{color:#657787;opacity:1 !important}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea::-moz-placeholder{color:#747475}.duet-textarea.sc-duet-textarea:focus::-moz-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus::-moz-placeholder{color:#cfcfd1}.duet-textarea.sc-duet-textarea:-ms-input-placeholder{color:#657787}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:-ms-input-placeholder{color:#747475}.duet-textarea.sc-duet-textarea:focus:-ms-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus:-ms-input-placeholder{color:#cfcfd1}.duet-textarea[disabled].sc-duet-textarea{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#f5f8fa !important}.duet-theme-turva.sc-duet-textarea .duet-textarea[disabled].sc-duet-textarea{color:#747475 !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important}.duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #909599}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #747475}.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #e02a0d}.duet-textarea.sc-duet-textarea:focus{border-color:#0077b3;outline:0;box-shadow:0 0 0 1px #0077b3;transition:none}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus{border-color:#171c3a;box-shadow:0 0 0 1px #171c3a}.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus{box-shadow:0 0 0 1px #e02a0d}.duet-textarea.sc-duet-textarea:not(:focus):not(:hover):invalid{box-shadow:none}.duet-textarea-help.sc-duet-textarea{font-size:0.875rem;line-height:1.25}.duet-textarea-help.sc-duet-textarea span.sc-duet-textarea{display:block;margin-top:8px}.has-error.sc-duet-textarea .duet-textarea-help.sc-duet-textarea{color:#de2362}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea-help.sc-duet-textarea{color:#e02a0d}.duet-label-hidden.sc-duet-textarea duet-label.sc-duet-textarea{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-character-count.sc-duet-textarea{display:block;margin:8px 0 0 auto}";
|
|
9497
|
+
const duetTextareaCss = "*.sc-duet-textarea,*.sc-duet-textarea::after,*.sc-duet-textarea::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-textarea-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:block;width:100%;max-width:100%;text-align:left}.sc-duet-textarea-h:last-child,.sc-duet-textarea-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-textarea-h{width:calc(50% - 16px - 3px)}.duet-expand.sc-duet-textarea-h{width:100% !important}}.duet-m-0.sc-duet-textarea-h{margin:0 !important}duet-tooltip.sc-duet-textarea{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-textarea{position:relative;top:4px;right:auto}}.duet-textarea-container.sc-duet-textarea{position:relative;width:100%;height:100%}.duet-textarea-container.sc-duet-textarea .duet-input-top-caption.sc-duet-textarea{display:none}.duet-textarea-container.duet-input-top-caption-shown.sc-duet-textarea .duet-input-top-caption.sc-duet-textarea{display:flex !important}.duet-textarea-wrapper.sc-duet-textarea{position:relative}.duet-textarea-placeholder.sc-duet-textarea{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-textarea.sc-duet-textarea{padding:15px !important;position:relative;z-index:100;display:block;width:100%;min-width:8rem;min-height:160px;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.25;color:#00294d;resize:vertical;background:white;border:1px solid #909599;border-radius:4px;transition:150ms ease}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea{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}.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea{border-color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea{border-color:#e02a0d !important}.duet-textarea.sc-duet-textarea::-webkit-input-placeholder{color:#657787;opacity:1 !important;transition:color 300ms ease}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea::-webkit-input-placeholder{color:#747475}.duet-textarea.sc-duet-textarea:focus::-webkit-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus::-webkit-input-placeholder{color:#cfcfd1}.duet-textarea.sc-duet-textarea::-moz-placeholder{color:#657787;opacity:1 !important}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea::-moz-placeholder{color:#747475}.duet-textarea.sc-duet-textarea:focus::-moz-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus::-moz-placeholder{color:#cfcfd1}.duet-textarea.sc-duet-textarea:-ms-input-placeholder{color:#657787}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:-ms-input-placeholder{color:#747475}.duet-textarea.sc-duet-textarea:focus:-ms-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus:-ms-input-placeholder{color:#cfcfd1}.duet-textarea[disabled].sc-duet-textarea{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#f5f8fa !important}.duet-theme-turva.sc-duet-textarea .duet-textarea[disabled].sc-duet-textarea{color:#747475 !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important}.duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #909599}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #747475}.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:hover:not(:disabled){box-shadow:0 0 0 1px #e02a0d}.duet-textarea.sc-duet-textarea:focus{border-color:#0077b3;outline:0;box-shadow:0 0 0 1px #0077b3;transition:none}.duet-theme-turva.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus{border-color:#171c3a;box-shadow:0 0 0 1px #171c3a}.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea.sc-duet-textarea:focus{box-shadow:0 0 0 1px #e02a0d}.duet-textarea.sc-duet-textarea:not(:focus):not(:hover):invalid{box-shadow:none}.duet-textarea-help.sc-duet-textarea{font-size:0.875rem;line-height:1.25}.duet-textarea-help.sc-duet-textarea span.sc-duet-textarea{display:block;margin-top:8px}.has-error.sc-duet-textarea .duet-textarea-help.sc-duet-textarea{color:#de2362}.duet-theme-turva.has-error.sc-duet-textarea .duet-textarea-help.sc-duet-textarea{color:#e02a0d}.duet-label-hidden.sc-duet-textarea duet-label.sc-duet-textarea{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-character-count.sc-duet-textarea{display:block;margin:8px 0 0 auto}";
|
|
8958
9498
|
|
|
8959
9499
|
const CharacterCount = ({ value, maxlength, label, theme }) => {
|
|
8960
9500
|
if (maxlength == null) {
|
|
@@ -8965,7 +9505,7 @@ const CharacterCount = ({ value, maxlength, label, theme }) => {
|
|
|
8965
9505
|
const isApproachingLimit = remainder / maxlength <= 0.1; // <= 10% chars remaining
|
|
8966
9506
|
return (h$1("div", { class: "duet-character-count" }, h$1("duet-caption", { margin: "none", theme: theme, size: "small" }, h$1("duet-visually-hidden", { "aria-live": "polite", "aria-atomic": "true", class: "duet-textarea-counter-remaining" }, isApproachingLimit && `${remainder} ${label}`), h$1("span", { "aria-hidden": "true" }, length, "/", maxlength))));
|
|
8967
9507
|
};
|
|
8968
|
-
let DuetTextarea$1 = class extends
|
|
9508
|
+
let DuetTextarea$1 = class extends H {
|
|
8969
9509
|
constructor() {
|
|
8970
9510
|
super();
|
|
8971
9511
|
this.__registerHost();
|
|
@@ -9056,7 +9596,7 @@ let DuetTextarea$1 = class extends HTMLElement {
|
|
|
9056
9596
|
cleanValue(this.nativeInput, this.disallowPatternRegex);
|
|
9057
9597
|
}
|
|
9058
9598
|
this.value = this.nativeInput.value;
|
|
9059
|
-
this.isCaptionVisible = !!
|
|
9599
|
+
this.isCaptionVisible = !!this.caption;
|
|
9060
9600
|
this.duetInput.emit({
|
|
9061
9601
|
originalEvent: ev,
|
|
9062
9602
|
value: this.value,
|
|
@@ -9095,7 +9635,7 @@ let DuetTextarea$1 = class extends HTMLElement {
|
|
|
9095
9635
|
componentWillLoad() {
|
|
9096
9636
|
inheritGlobalTheme(this);
|
|
9097
9637
|
this.disallowedPatternChange();
|
|
9098
|
-
this.isCaptionVisible = !!
|
|
9638
|
+
this.isCaptionVisible = !!this.caption;
|
|
9099
9639
|
if (this.counter && this.maxlength == null) {
|
|
9100
9640
|
console.warn("[DUET WARNING]: counter will only take effect if maxlength is set");
|
|
9101
9641
|
}
|
|
@@ -9129,7 +9669,7 @@ let DuetTextarea$1 = class extends HTMLElement {
|
|
|
9129
9669
|
"duet-label-hidden": this.labelHidden,
|
|
9130
9670
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
9131
9671
|
"has-error": !!this.error,
|
|
9132
|
-
} }, h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, margin: this.isCaptionVisible ? "small" : "auto", id: this.labelId, for: identifier }, this.label), this.tooltip && (h$1("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (h$1("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), this.placeholder && this.echoPlaceholder && this.value && (h$1("duet-caption", { id: this.topCaptionPlaceholderId, size: "small" }, this.placeholder)), h$1("textarea", { onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus, ref: input => (this.nativeInput = input), class: { "duet-textarea": true, disabled: this.disabled }, value: this.value, disabled: this.disabled, "aria-labelledby": `${this.labelId} ${this.errorId}`, "aria-controls": this.accessibleControls, "aria-autocomplete": this.accessibleAutocomplete, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": `${this.isCaptionVisible ? this.topCaptionId : ""} ${this.accessibleDescribedBy}`, placeholder: this.placeholder, spellcheck: "false", required: this.required, minlength: this.minlength, maxlength: this.maxlength, role: this.role, name: this.name, id: identifier }), h$1("duet-grid", { alignment: "stretch" }, h$1("duet-grid-item", { margin: "none", fill: true }, h$1("div", { class: "duet-textarea-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h$1("span", null, this.error))), h$1("duet-grid-item", { margin: "none", class: "duet-character-count-caption" }, this.counter && (h$1(CharacterCount, { theme: this.theme, value: this.value, maxlength: this.maxlength, label: this.counterLabel })))))));
|
|
9672
|
+
} }, h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, margin: this.isCaptionVisible ? "small" : "auto", id: this.labelId, for: identifier }, this.label), this.tooltip && (h$1("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (h$1("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), h$1("div", { class: "duet-textarea-wrapper" }, this.placeholder && this.echoPlaceholder && this.value && (h$1("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-textarea-placeholder", size: "small" }, this.placeholder)), h$1("textarea", { onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus, ref: input => (this.nativeInput = input), class: { "duet-textarea": true, disabled: this.disabled }, value: this.value, disabled: this.disabled, "aria-labelledby": `${this.labelId} ${this.errorId}`, "aria-controls": this.accessibleControls, "aria-autocomplete": this.accessibleAutocomplete, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": `${this.isCaptionVisible ? this.topCaptionId : ""} ${this.accessibleDescribedBy}`, placeholder: this.placeholder, spellcheck: "false", required: this.required, minlength: this.minlength, maxlength: this.maxlength, role: this.role, name: this.name, id: identifier })), h$1("duet-grid", { alignment: "stretch" }, h$1("duet-grid-item", { margin: "none", fill: true }, h$1("div", { class: "duet-textarea-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h$1("span", null, this.error))), h$1("duet-grid-item", { margin: "none", class: "duet-character-count-caption" }, this.counter && (h$1(CharacterCount, { theme: this.theme, value: this.value, maxlength: this.maxlength, label: this.counterLabel })))))));
|
|
9133
9673
|
}
|
|
9134
9674
|
get element() { return this; }
|
|
9135
9675
|
static get watchers() { return {
|
|
@@ -9140,7 +9680,7 @@ let DuetTextarea$1 = class extends HTMLElement {
|
|
|
9140
9680
|
|
|
9141
9681
|
const duetToggleCss = "*.sc-duet-toggle,*.sc-duet-toggle::after,*.sc-duet-toggle::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-toggle-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:8px !important;margin-bottom:12px !important;-webkit-user-select:none;user-select:none;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-toggle-h:last-child,.sc-duet-toggle-h:last-of-type{margin-right:0 !important}.duet-m-0.sc-duet-toggle-h{margin:0 !important}duet-label.sc-duet-toggle{display:block !important;width:100% !important}.duet-switch.sc-duet-toggle{position:relative;display:block;width:48px;height:28px}.duet-switch.sc-duet-toggle input.sc-duet-toggle{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-switch.sc-duet-toggle input.sc-duet-toggle:checked+.duet-slider.sc-duet-toggle{background-color:#0077b3;box-shadow:none}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:checked+.duet-slider.sc-duet-toggle{background-color:#c60c30}.duet-switch.sc-duet-toggle input.sc-duet-toggle:checked+.duet-slider.sc-duet-toggle::before{background-color:white;box-shadow:none;transform:translateX(20px)}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled+.duet-slider.sc-duet-toggle{cursor:default}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle{box-shadow:inset 0 0 0 1px #cfd2d4}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle{box-shadow:inset 0 0 0 1px #cfcfd1}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle::before{background:#cfd2d4}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle::before{background:#cfcfd1}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:checked+.duet-slider.sc-duet-toggle{background:#cfd2d4}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:checked+.duet-slider.sc-duet-toggle{background:#cfcfd1}.user-is-tabbing.sc-duet-toggle-h .duet-switch.sc-duet-toggle input.sc-duet-toggle:focus+.duet-slider.sc-duet-toggle{box-shadow:0 0 0 1px white, 0 0 0 3px rgba(0, 119, 179, 0.75)}.user-is-tabbing.sc-duet-toggle-h .duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:focus+.duet-slider.sc-duet-toggle{box-shadow:0 0 0 1px white, 0 0 0 3px #171c3a}.duet-slider.sc-duet-toggle{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer;background-color:white;border-radius:20px;box-shadow:inset 0 0 0 1px #00294d;transition:background-color 300ms ease}.duet-theme-turva.sc-duet-toggle .duet-slider.sc-duet-toggle{box-shadow:inset 0 0 0 1px #171c3a}.duet-slider.sc-duet-toggle::before{position:absolute;bottom:4px;left:4px;width:20px;height:20px;content:\"\";background-color:#00294d;border-radius:50%;transition:300ms ease}.duet-theme-turva.sc-duet-toggle .duet-slider.sc-duet-toggle::before{background-color:#171c3a}";
|
|
9142
9682
|
|
|
9143
|
-
let DuetToggle$1 = class extends
|
|
9683
|
+
let DuetToggle$1 = class extends H {
|
|
9144
9684
|
constructor() {
|
|
9145
9685
|
super();
|
|
9146
9686
|
this.__registerHost();
|
|
@@ -9229,11 +9769,11 @@ let DuetToggle$1 = class extends HTMLElement {
|
|
|
9229
9769
|
|
|
9230
9770
|
const duetTooltipCss = "*,*::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;position:relative;z-index:200;display:inline-flex;width:auto;margin-top:-16px !important;margin-left:-3px !important;-webkit-tap-highlight-color:transparent}.duet-tooltip{position:absolute;right:-21px;bottom:100%;z-index:950;display:block;width:282px;min-height:48px;max-height:340px;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:#00294d;visibility:hidden;background:white;border:1px solid #e1e3e6;border-radius:4px;box-shadow:0 2px 10px 0 rgba(0, 41, 77, 0.07);opacity:0;transition:300ms ease;transform:scale(0.9) translateZ(0) translateY(20px);transform-origin:100% 100%}.duet-tooltip.duet-theme-turva{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:#e4e4e6;box-shadow:0 2px 10px 0 rgba(117, 117, 117, 0.13)}.duet-tooltip::after{position:absolute;right:22px;bottom:-20px;z-index:200;width:0;height:0;content:\"\";border:10px solid transparent;border-top:10px solid white}.duet-tooltip::before{position:absolute;right:21px;bottom:-22px;z-index:100;width:0;height:0;content:\"\";border:11px solid transparent;border-top:11px solid #e1e3e6}.duet-theme-turva .duet-tooltip::before{border-top:11px solid #e4e4e6}.duet-tooltip.duet-tooltip-down{top:100%;bottom:auto;transform:scale(0.9) translateZ(0) translateY(-20px);transform-origin:100% 0}.duet-tooltip.duet-tooltip-down::after{top:-20px;bottom:auto;border:10px solid transparent;border-bottom:10px solid white}.duet-tooltip.duet-tooltip-down::before{top:-22px;bottom:auto;border:11px solid transparent;border-bottom:11px solid #e1e3e6}.duet-theme-turva .duet-tooltip.duet-tooltip-down::before{border-bottom:11px solid #e4e4e6}.duet-tooltip.duet-tooltip-left{right:-21px !important;transform-origin:100% 100% !important}.duet-tooltip.duet-tooltip-left::after{right:22px !important;transform:none !important}.duet-tooltip.duet-tooltip-left::before{right:21px !important;transform:none !important}.duet-tooltip.duet-tooltip-right{right:auto !important;left:-9px !important;transform-origin:100% 100% !important}.duet-tooltip.duet-tooltip-right::after{right:auto !important;left:22px !important;transform:none !important}.duet-tooltip.duet-tooltip-right::before{right:auto !important;left:21px !important;transform:none !important}.duet-tooltip.duet-tooltip-has-label{right:auto !important;left:0;width:282px !important;transform-origin:0 0 !important}.duet-tooltip.duet-tooltip-has-label::after{right:auto !important;left:1px !important;transform:none !important}.duet-tooltip.duet-tooltip-has-label::before{right:auto !important;left:0 !important;transform:none !important}.duet-tooltip.duet-tooltip-active{visibility:visible;opacity:1;transition-property:transform, opacity;transform:scale(1.0001) translateZ(0) translateY(-8px)}.duet-tooltip.duet-tooltip-active.duet-tooltip-down{transform:scale(1.0001) translateZ(0) translateY(8px)}.duet-tooltip-button{z-index:100;display:inline-block;align-items:center;justify-content:center;min-width:48px;height:48px;padding:0 !important;margin-right:-12px;line-height:normal !important;color:#0077b3;white-space:nowrap;cursor:pointer;background:transparent !important;border-radius:4px}.duet-tooltip-button.duet-theme-turva{color:#c60c30}.duet-tooltip-button:hover{color:#004d80}.duet-tooltip-button:hover.duet-theme-turva{color:#940925}.duet-tooltip-button:focus{background:transparent !important;outline:0}:host(.user-is-tabbing) .duet-tooltip-button:focus{background:transparent !important;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3 !important}:host(.user-is-tabbing) .duet-tooltip-button.duet-theme-turva:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a !important}.duet-tooltip-button svg{width:20px;height:20px;pointer-events:none}.duet-tooltip-button-has-label{margin-right:0}.duet-tooltip-scrollable{padding:20px !important;width:100%;max-height:250px;padding-right:25px !important;overflow-y:auto;-webkit-hyphens:auto;hyphens:auto;border-radius:4px;-webkit-overflow-scrolling:touch}.duet-tooltip-scrollable:focus{outline:none}:host(.user-is-tabbing) .duet-tooltip-scrollable:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-tooltip-scrollable:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-tooltip-scrollable::-webkit-scrollbar{width:4px}.duet-tooltip-scrollable::-webkit-scrollbar-track{border-radius:4px}.duet-tooltip-scrollable::-webkit-scrollbar-thumb{background:#e1e3e6;border-radius:4px}.duet-theme-turva .duet-tooltip-scrollable::-webkit-scrollbar-thumb{background:#e4e4e6}.duet-tooltip-label{position:relative;z-index:100;display:inline-block;max-width:calc(100% - 30px);margin-left:12px !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:600;line-height:1.25;text-align:left;white-space:normal;vertical-align:top}.duet-theme-turva .duet-tooltip-label{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}.duet-tooltip-close{position:absolute;top:8px;right:8px;display:flex;align-items:center;justify-content:center;width:17px;height:17px;min-height:0 !important;padding:0 !important;margin:0 !important;line-height:normal;color:#00294d;cursor:pointer;background:#f5f8fa;border-radius:50%;-webkit-appearance:none;appearance:none}.duet-tooltip-close:focus{outline:none;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva .duet-tooltip-close:focus{color:#171c3a;box-shadow:0 0 0 2px #171c3a}@media (min-width: 48em){.duet-tooltip.duet-mq-medium{right:-148px;width:320px;transform-origin:50% 100%}.duet-tooltip.duet-mq-medium::after{right:50%;transform:translateX(50%)}.duet-tooltip.duet-mq-medium::before{right:50%;transform:translateX(50%)}.duet-tooltip.duet-mq-medium.duet-tooltip-down{transform-origin:50% 0}}@media (min-width: 62em){.duet-tooltip.duet-mq-large{right:-148px;width:320px;transform-origin:50% 100%}.duet-tooltip.duet-mq-large::after{right:50%;transform:translateX(50%)}.duet-tooltip.duet-mq-large::before{right:50%;transform:translateX(50%)}.duet-tooltip.duet-mq-large.duet-tooltip-down{transform-origin:50% 0}}";
|
|
9231
9771
|
|
|
9232
|
-
let DuetTooltip$1 = class extends
|
|
9772
|
+
let DuetTooltip$1 = class extends H {
|
|
9233
9773
|
constructor() {
|
|
9234
9774
|
super();
|
|
9235
9775
|
this.__registerHost();
|
|
9236
|
-
|
|
9776
|
+
this.__attachShadow();
|
|
9237
9777
|
/**
|
|
9238
9778
|
* Own Properties.
|
|
9239
9779
|
*/
|
|
@@ -9256,25 +9796,35 @@ let DuetTooltip$1 = class extends HTMLElement {
|
|
|
9256
9796
|
*/
|
|
9257
9797
|
this.language = getLanguage();
|
|
9258
9798
|
/**
|
|
9259
|
-
*
|
|
9260
|
-
* readers. This property is always required to create an accessible interface!
|
|
9799
|
+
* Default language strings for the accessibleLabel
|
|
9261
9800
|
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
9262
9801
|
*/
|
|
9263
|
-
this.
|
|
9802
|
+
this.accessibleLabelDefault = {
|
|
9264
9803
|
fi: "Näytä lisätietoja",
|
|
9265
9804
|
en: "Show more information",
|
|
9266
9805
|
sv: "Visa mer tilläggsuppgifter",
|
|
9267
|
-
}
|
|
9806
|
+
};
|
|
9268
9807
|
/**
|
|
9269
|
-
* Adds accessible label for the
|
|
9270
|
-
* readers. This property is always required to create an
|
|
9808
|
+
* Adds accessible label for the info icon that is only shown for screen
|
|
9809
|
+
* readers. This property is always required to create an accessible interface!
|
|
9810
|
+
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
9811
|
+
*/
|
|
9812
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefault, this.language);
|
|
9813
|
+
/**
|
|
9814
|
+
* Default language strings for the accessibleCloseLabel
|
|
9271
9815
|
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
9272
9816
|
*/
|
|
9273
|
-
this.
|
|
9817
|
+
this.accessibleCloseLabelDefault = {
|
|
9274
9818
|
fi: "Sulje lisätiedot",
|
|
9275
9819
|
en: "Close details",
|
|
9276
9820
|
sv: "Stäng tilläggsuppgifter",
|
|
9277
|
-
}
|
|
9821
|
+
};
|
|
9822
|
+
/**
|
|
9823
|
+
* Adds accessible label for the close icon that is only shown for screen
|
|
9824
|
+
* readers. This property is always required to create an accessibly interface!
|
|
9825
|
+
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
9826
|
+
*/
|
|
9827
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefault, this.language);
|
|
9278
9828
|
/**
|
|
9279
9829
|
* Label of the tooltip. If used, replaces the accessibleLabel option.
|
|
9280
9830
|
*/
|
|
@@ -9446,11 +9996,11 @@ let DuetTooltip$1 = class extends HTMLElement {
|
|
|
9446
9996
|
const duetTrayCss = "*,*::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:block;width:100%}.duet-tray{position:fixed;top:4rem;right:0;left:0;z-index:399;display:flex;flex-direction:column;max-height:calc(100% - 8rem);padding:16px 20px 16px 24px;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.5;color:#00294d;visibility:hidden;background:#f3f9fc;border-bottom:1px solid #e1e3e6;box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07);opacity:0;transition:opacity 600ms ease, visibility 600ms ease, transform 600ms ease;transform:translateY(-4rem)}@media (min-width: 62em){.duet-tray{padding:16px 36px}}@media (min-width: 106.25em){.duet-tray{padding:16px 52px 16px 60px}}.duet-tray:focus{outline:0}:host(.user-is-tabbing) .duet-tray:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-tray.duet-theme-turva:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-tray.duet-theme-turva{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;background:#f5f5f7;border-color:#e4e4e6}.duet-tray.duet-tray-is-active{visibility:visible;opacity:1;transform:translateY(0)}.duet-tray.duet-tray-is-hidden{visibility:hidden;opacity:0;transform:translateY(-4rem)}@media (min-width: 62em){.duet-tray.duet-tray-is-responsive{display:none !important}}.duet-tray.duet-tray-is-expandable{padding-right:66px}@media (min-width: 62em){.duet-tray.duet-tray-is-expandable{padding-right:78px}}@media (min-width: 106.25em){.duet-tray.duet-tray-is-expandable{padding-right:94px}}.duet-tray-expandable{position:relative;z-index:100;width:calc(100% + 46px);max-height:0;overflow-y:auto;visibility:hidden;opacity:0;transition:opacity 600ms ease, visibility 600ms ease, max-height 600ms ease;scrollbar-width:none}.duet-tray-expandable::-webkit-scrollbar{display:none}.duet-tray-expandable.active{max-height:500px;visibility:visible;opacity:1}.duet-tray-expandable-content{width:100%;margin-top:16px;border-top:1px solid #e1e3e6}.duet-theme-turva .duet-tray-expandable-content{border-color:#e4e4e6}.duet-tray-button{-webkit-user-select:none;user-select:none;padding:20px !important;position:absolute;top:-2px;right:0;z-index:200;color:#00294d;text-align:center;cursor:pointer;border-radius:4px;transition:transform 300ms ease;-webkit-tap-highlight-color:transparent}@media (min-width: 62em){.duet-tray-button{margin-right:16px}}@media (min-width: 106.25em){.duet-tray-button{margin-right:36px}}.duet-theme-turva .duet-tray-button{color:#171c3a}.duet-tray-button.duet-tray-is-expanded{transform:rotate(-180deg)}.duet-tray-button:focus{outline:0}:host(.user-is-tabbing) .duet-tray-button:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-tray-button:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-tray-button:active{box-shadow:none;opacity:0.75}";
|
|
9447
9997
|
|
|
9448
9998
|
const topOffset = parseFloat(sizeHeader) * 2 * 16; // convert rem -> px
|
|
9449
|
-
let DuetTray$1 = class extends
|
|
9999
|
+
let DuetTray$1 = class extends H {
|
|
9450
10000
|
constructor() {
|
|
9451
10001
|
super();
|
|
9452
10002
|
this.__registerHost();
|
|
9453
|
-
|
|
10003
|
+
this.__attachShadow();
|
|
9454
10004
|
/**
|
|
9455
10005
|
* Own Properties.
|
|
9456
10006
|
*/
|
|
@@ -9469,25 +10019,35 @@ let DuetTray$1 = class extends HTMLElement {
|
|
|
9469
10019
|
*/
|
|
9470
10020
|
this.language = getLanguage();
|
|
9471
10021
|
/**
|
|
9472
|
-
*
|
|
9473
|
-
* close toggle. Not visible for normal users.
|
|
10022
|
+
* Defaults for accessibleCloseLabel
|
|
9474
10023
|
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
9475
10024
|
*/
|
|
9476
|
-
this.
|
|
10025
|
+
this.accessibleCloseLabelDefaults = {
|
|
9477
10026
|
fi: "Sulje",
|
|
9478
10027
|
en: "Close",
|
|
9479
10028
|
sv: "Stäng",
|
|
9480
|
-
}
|
|
10029
|
+
};
|
|
9481
10030
|
/**
|
|
9482
10031
|
* Accessible label that is shown for screen reader users in the expandable
|
|
9483
|
-
*
|
|
10032
|
+
* close toggle. Not visible for normal users.
|
|
10033
|
+
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
10034
|
+
*/
|
|
10035
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefaults, this.language);
|
|
10036
|
+
/**
|
|
10037
|
+
* Defaults for accessibleOpenLabel
|
|
9484
10038
|
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
9485
10039
|
*/
|
|
9486
|
-
this.
|
|
10040
|
+
this.accessibleOpenLabelDefaults = {
|
|
9487
10041
|
fi: "Avaa",
|
|
9488
10042
|
en: "Open",
|
|
9489
10043
|
sv: "Öppna",
|
|
9490
|
-
}
|
|
10044
|
+
};
|
|
10045
|
+
/**
|
|
10046
|
+
* Accessible label that is shown for screen reader users in the expandable
|
|
10047
|
+
* open toggle. Not visible for normal users.
|
|
10048
|
+
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
10049
|
+
*/
|
|
10050
|
+
this.accessibleOpenLabel = getLocaleString(this.accessibleOpenLabelDefaults, this.language);
|
|
9491
10051
|
/**
|
|
9492
10052
|
* Theme of the info panel.
|
|
9493
10053
|
*/
|
|
@@ -9558,178 +10118,122 @@ let DuetTray$1 = class extends HTMLElement {
|
|
|
9558
10118
|
static get style() { return duetTrayCss; }
|
|
9559
10119
|
};
|
|
9560
10120
|
|
|
9561
|
-
const
|
|
9562
|
-
if (bytes === 0) {
|
|
9563
|
-
return "0 Bytes";
|
|
9564
|
-
}
|
|
9565
|
-
const k = 1024;
|
|
9566
|
-
const dm = decimals < 0 ? 0 : decimals;
|
|
9567
|
-
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
9568
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
9569
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
9570
|
-
};
|
|
9571
|
-
|
|
9572
|
-
const DuetUploadFileList = ({ data, onDelete, onCancel, getError }) => {
|
|
9573
|
-
if (data.invalid.length === 0 && data.valid.length === 0) {
|
|
9574
|
-
return;
|
|
9575
|
-
}
|
|
9576
|
-
return (h("ol", { class: "duet-upload-filelist" },
|
|
9577
|
-
data.valid.length !== 0 && (h("li", null,
|
|
9578
|
-
h("duet-visually-hidden", null, "Files"),
|
|
9579
|
-
h("ul", null, data.valid.length !== 0 &&
|
|
9580
|
-
data.valid.map(e => (h("li", { class: "duet-upload-file" },
|
|
9581
|
-
h("div", { class: "duet-upload-file-container" },
|
|
9582
|
-
h("div", { class: "duet-upload-file-link" }, e.url ? (h("duet-button", { variation: "plain", icon: "messaging-attachment", url: e.url },
|
|
9583
|
-
e.item.name,
|
|
9584
|
-
" (",
|
|
9585
|
-
formatBytes(e.item.size),
|
|
9586
|
-
")")) : (`${e.item.name} (${formatBytes(e.item.size)})`)),
|
|
9587
|
-
h("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
9588
|
-
e.progress < 100 && (h("li", { role: "none" },
|
|
9589
|
-
h("duet-button", { role: "menuitem", variation: "plain", icon: "messaging-declined", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onCancel(e.item.name, ev) }))),
|
|
9590
|
-
e.progress === 100 && (h("li", { role: "none" },
|
|
9591
|
-
h("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))),
|
|
9592
|
-
e.progress < 100 && (h("div", { class: "duet-upload-file-progress" },
|
|
9593
|
-
h("progress", { value: e.progress, max: "100" },
|
|
9594
|
-
h("div", { class: "progress-bar" },
|
|
9595
|
-
h("span", { style: { width: `${e.progress}%;` } },
|
|
9596
|
-
"Progress: ",
|
|
9597
|
-
e.progress,
|
|
9598
|
-
"%"))))))))))),
|
|
9599
|
-
data.invalid.length !== 0 && (h("li", null,
|
|
9600
|
-
h("duet-visually-hidden", null, "Files with Errors"),
|
|
9601
|
-
h("ul", null, data.invalid.map(e => {
|
|
9602
|
-
return (h("li", { class: "duet-upload-file duet-upload-file-errors" },
|
|
9603
|
-
h("div", { class: "duet-upload-file-container" },
|
|
9604
|
-
h("div", { class: "duet-upload-file-link duet-upload-file-link-error" },
|
|
9605
|
-
h("div", null,
|
|
9606
|
-
e.item.name,
|
|
9607
|
-
" (",
|
|
9608
|
-
formatBytes(e.item.size),
|
|
9609
|
-
")"),
|
|
9610
|
-
h("div", { "data-error-type": e.error.type, "data-error-message": e.error.system_message }, getError(e.error.type))),
|
|
9611
|
-
h("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
9612
|
-
h("li", { role: "none" },
|
|
9613
|
-
h("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))));
|
|
9614
|
-
}))))));
|
|
9615
|
-
};
|
|
9616
|
-
|
|
9617
|
-
const errorcodes = [
|
|
10121
|
+
const errorCodes = [
|
|
9618
10122
|
{
|
|
9619
10123
|
type: "default",
|
|
9620
10124
|
system_message: "unknown error",
|
|
9621
10125
|
message: {
|
|
9622
|
-
fi: "",
|
|
9623
|
-
sv: "",
|
|
9624
|
-
en: "An unknown error occured, please try again"
|
|
10126
|
+
fi: "Tapahtui tuntematon virhe, ole hyvä ja yritä uudelleen.",
|
|
10127
|
+
sv: "Ett okänt fel uppstod, försök igen.",
|
|
10128
|
+
en: "An unknown error occured, please try again."
|
|
9625
10129
|
}
|
|
9626
10130
|
},
|
|
9627
10131
|
{
|
|
9628
10132
|
type: "400",
|
|
9629
10133
|
system_message: "Bad Request: The server could not understand the request due to invalid syntax.",
|
|
9630
10134
|
message: {
|
|
9631
|
-
fi: "",
|
|
9632
|
-
sv: "",
|
|
9633
|
-
en: "The server rejected your file"
|
|
10135
|
+
fi: "Tiedostoa ei hyväksytty.",
|
|
10136
|
+
sv: "Servern avvisade din fil.",
|
|
10137
|
+
en: "The server rejected your file."
|
|
9634
10138
|
}
|
|
9635
10139
|
},
|
|
9636
10140
|
{
|
|
9637
10141
|
type: "401",
|
|
9638
|
-
system_message: "Not Authenticated: The client must authenticate itself to get the requested response
|
|
10142
|
+
system_message: "Not Authenticated: The client must authenticate itself to get the requested response...",
|
|
9639
10143
|
message: {
|
|
9640
|
-
fi: "",
|
|
9641
|
-
sv: "",
|
|
9642
|
-
en: "You need to be logged in to upload files"
|
|
10144
|
+
fi: "Vain kirjautunut käyttäjä voi lähettää tiedostoja.",
|
|
10145
|
+
sv: "Du måste vara inloggad för att ladda upp filer.",
|
|
10146
|
+
en: "You need to be logged in to upload files."
|
|
9643
10147
|
}
|
|
9644
10148
|
},
|
|
9645
10149
|
{
|
|
9646
10150
|
type: "403",
|
|
9647
|
-
system_message: "No Access: The client does not have access rights to the content
|
|
10151
|
+
system_message: "No Access: The client does not have access rights to the content.",
|
|
9648
10152
|
message: {
|
|
9649
|
-
fi: "",
|
|
9650
|
-
sv: "",
|
|
9651
|
-
en: "You do not have the correct access rights to upload files"
|
|
10153
|
+
fi: "Ei oikeuksia lähettää tiedostoja.",
|
|
10154
|
+
sv: "Du har inte rätt åtkomsträttigheter för att ladda upp filer.",
|
|
10155
|
+
en: "You do not have the correct access rights to upload files."
|
|
9652
10156
|
}
|
|
9653
10157
|
},
|
|
9654
10158
|
{
|
|
9655
10159
|
type: "413",
|
|
9656
10160
|
system_message: "Payload too large",
|
|
9657
10161
|
message: {
|
|
9658
|
-
fi: "",
|
|
9659
|
-
sv: "",
|
|
9660
|
-
en: "The file was to large for the server to handle"
|
|
10162
|
+
fi: "Tiedosto oli liian vastaanotettavaksi.",
|
|
10163
|
+
sv: "Filen var för stor för servern att hantera.",
|
|
10164
|
+
en: "The file was to large for the server to handle."
|
|
9661
10165
|
}
|
|
9662
10166
|
},
|
|
9663
10167
|
{
|
|
9664
10168
|
type: "415",
|
|
9665
10169
|
system_message: "Unsupported media type",
|
|
9666
10170
|
message: {
|
|
9667
|
-
fi: "",
|
|
9668
|
-
sv: "",
|
|
9669
|
-
en: "The server rejected the file because it had the wrong type"
|
|
10171
|
+
fi: "Tiedoston tyyppi oli väärä.",
|
|
10172
|
+
sv: "Servern avvisade filen eftersom den hade fel typ.",
|
|
10173
|
+
en: "The server rejected the file because it had the wrong type."
|
|
9670
10174
|
}
|
|
9671
10175
|
},
|
|
9672
10176
|
{
|
|
9673
10177
|
type: "429",
|
|
9674
10178
|
system_message: "Too many request from same address",
|
|
9675
10179
|
message: {
|
|
9676
|
-
fi: "",
|
|
9677
|
-
sv: "",
|
|
9678
|
-
en: "The server has received to many request from you, please try again later"
|
|
10180
|
+
fi: "Liian monta yritystä, ole hyvä ja yritä myöhemmin uudelleen.",
|
|
10181
|
+
sv: "Servern har fått många förfrågningar från dig, försök igen senare.",
|
|
10182
|
+
en: "The server has received to many request from you, please try again later."
|
|
9679
10183
|
}
|
|
9680
10184
|
},
|
|
9681
10185
|
{
|
|
9682
10186
|
type: "500",
|
|
9683
10187
|
system_message: "Internal Server Error",
|
|
9684
10188
|
message: {
|
|
9685
|
-
fi: "",
|
|
9686
|
-
sv: "",
|
|
9687
|
-
en: "The server reported an unknown error and the upload failed"
|
|
10189
|
+
fi: "Palvelin ilmoitti tuntemattomasta virheestä ja lataus epäonnistui.",
|
|
10190
|
+
sv: "Servern rapporterade ett okänt fel och uppladdningen misslyckades.",
|
|
10191
|
+
en: "The server reported an unknown error and the upload failed."
|
|
9688
10192
|
}
|
|
9689
10193
|
},
|
|
9690
10194
|
{
|
|
9691
10195
|
type: "duet-upload-100",
|
|
9692
10196
|
system_message: "File extension not allowed",
|
|
9693
10197
|
message: {
|
|
9694
|
-
fi: "",
|
|
9695
|
-
sv: "",
|
|
9696
|
-
en: "You cannot upload files with that extension"
|
|
10198
|
+
fi: "Tiedoston tyyppi ei ole sallittu.",
|
|
10199
|
+
sv: "Du kan inte ladda upp filer av den type.",
|
|
10200
|
+
en: "You cannot upload files with that extension."
|
|
9697
10201
|
}
|
|
9698
10202
|
},
|
|
9699
10203
|
{
|
|
9700
10204
|
type: "duet-upload-001",
|
|
9701
10205
|
system_message: "File transfer failed",
|
|
9702
10206
|
message: {
|
|
9703
|
-
fi: "",
|
|
9704
|
-
sv: "",
|
|
9705
|
-
en: "Your connection to the server was interrupted, try again"
|
|
10207
|
+
fi: "Tiedoston lähetys keskeytyi, ole hyvä ja yritä uudelleen.",
|
|
10208
|
+
sv: "Din anslutning till servern avbröts, försök igen.",
|
|
10209
|
+
en: "Your connection to the server was interrupted, try again."
|
|
9706
10210
|
}
|
|
9707
10211
|
},
|
|
9708
10212
|
{
|
|
9709
10213
|
type: "duet-upload-101",
|
|
9710
10214
|
system_message: "File mimetype not allowed",
|
|
9711
10215
|
message: {
|
|
9712
|
-
fi: "",
|
|
9713
|
-
sv: "",
|
|
9714
|
-
en: "You cannot upload files of that type"
|
|
10216
|
+
fi: "Tiedoston tyyppi ei ole sallittu.",
|
|
10217
|
+
sv: "Du kan inte ladda upp filer av den typ.",
|
|
10218
|
+
en: "You cannot upload files of that type."
|
|
9715
10219
|
}
|
|
9716
10220
|
},
|
|
9717
10221
|
{
|
|
9718
10222
|
type: "duet-upload-201",
|
|
9719
10223
|
system_message: "File is too large",
|
|
9720
10224
|
message: {
|
|
9721
|
-
fi: "",
|
|
9722
|
-
sv: "",
|
|
9723
|
-
en: "The file is larger than permitted"
|
|
10225
|
+
fi: "Tiedosto on liian iso.",
|
|
10226
|
+
sv: "Filen är större än tillåtet.",
|
|
10227
|
+
en: "The file is larger than permitted."
|
|
9724
10228
|
}
|
|
9725
10229
|
},
|
|
9726
10230
|
{
|
|
9727
10231
|
type: "duet-upload-202",
|
|
9728
10232
|
system_message: "The combined size of all files is too large",
|
|
9729
10233
|
message: {
|
|
9730
|
-
fi: "",
|
|
9731
|
-
sv: "",
|
|
9732
|
-
en: "You have reached the maximum combined filesize"
|
|
10234
|
+
fi: "Tiedostojen yhteenlaskettu koko on liian iso.",
|
|
10235
|
+
sv: "Du har nått den maximala kombinerade filstorleken.",
|
|
10236
|
+
en: "You have reached the maximum combined filesize."
|
|
9733
10237
|
}
|
|
9734
10238
|
},
|
|
9735
10239
|
{
|
|
@@ -9737,7 +10241,7 @@ const errorcodes = [
|
|
|
9737
10241
|
system_message: "The maximum file limit has been reached",
|
|
9738
10242
|
message: {
|
|
9739
10243
|
fi: "Liitteiden maksimimäärä saavutettu.",
|
|
9740
|
-
sv: "",
|
|
10244
|
+
sv: "Maximalt antal bilagor har uppnåtts.",
|
|
9741
10245
|
en: "Maximum number of attachments reached."
|
|
9742
10246
|
}
|
|
9743
10247
|
}
|
|
@@ -9749,16 +10253,81 @@ const getError = (code) => {
|
|
|
9749
10253
|
system_message: undefined,
|
|
9750
10254
|
message: undefined,
|
|
9751
10255
|
};
|
|
9752
|
-
error =
|
|
9753
|
-
|
|
10256
|
+
error = errorCodes.filter(errorItem => {
|
|
10257
|
+
// the == is intentional we may be comparing numbers to strings - and that is ok here
|
|
10258
|
+
return errorItem.type == code;
|
|
9754
10259
|
})[0];
|
|
9755
10260
|
if (!error) {
|
|
9756
|
-
error =
|
|
10261
|
+
error = errorCodes.filter(errorItem => {
|
|
9757
10262
|
return errorItem.type === "default";
|
|
9758
10263
|
})[0];
|
|
9759
10264
|
}
|
|
9760
10265
|
return error;
|
|
9761
10266
|
};
|
|
10267
|
+
const getI18nError = (errorCode) => {
|
|
10268
|
+
const errorFromJson = getError(errorCode);
|
|
10269
|
+
const i18String = getLocaleString(errorFromJson.message);
|
|
10270
|
+
if (i18String === "" || !i18String) {
|
|
10271
|
+
return errorFromJson.system_message;
|
|
10272
|
+
}
|
|
10273
|
+
else {
|
|
10274
|
+
return i18String;
|
|
10275
|
+
}
|
|
10276
|
+
};
|
|
10277
|
+
|
|
10278
|
+
const ErrorItem = ({ data }) => {
|
|
10279
|
+
const { item, error } = data;
|
|
10280
|
+
const { name } = item;
|
|
10281
|
+
const { type } = error;
|
|
10282
|
+
return (h("span", { class: "duet-upload-item-error", role: "status" },
|
|
10283
|
+
h("duet-paragraph", { class: "duet-upload-item-name", color: "danger", margin: "none", weight: "semi-bold" },
|
|
10284
|
+
h("duet-icon", { margin: "none", size: "xx-small", name: "messaging-attachment" }),
|
|
10285
|
+
" ",
|
|
10286
|
+
name),
|
|
10287
|
+
h("duet-paragraph", { class: "duet-upload-item-error-label", size: "small", margin: "none", color: "danger" }, getI18nError(type))));
|
|
10288
|
+
};
|
|
10289
|
+
|
|
10290
|
+
const ProgressItem = ({ progress, name }) => (h("span", null,
|
|
10291
|
+
h("duet-paragraph", { color: "secondary", margin: "none", size: "small" }, name),
|
|
10292
|
+
h("duet-spacer", { size: "xx-small" }),
|
|
10293
|
+
h("duet-progress", { progress: Math.ceil(progress), "aria-hidden": true })));
|
|
10294
|
+
|
|
10295
|
+
const formatBytes = (bytes, decimals = 2) => {
|
|
10296
|
+
if (bytes === 0) {
|
|
10297
|
+
return "0 Bytes";
|
|
10298
|
+
}
|
|
10299
|
+
const k = 1024;
|
|
10300
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
10301
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
10302
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
10303
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
10304
|
+
};
|
|
10305
|
+
|
|
10306
|
+
const SuccessItem = ({ data, showLinks }) => {
|
|
10307
|
+
const { item, size, uploaded, url, meta } = data;
|
|
10308
|
+
const { name } = item;
|
|
10309
|
+
const ContentName = (h("span", { class: "duet-upload-item-name" },
|
|
10310
|
+
h("duet-icon", { margin: "none", size: "xx-small", name: "messaging-attachment" }),
|
|
10311
|
+
h("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
10312
|
+
name));
|
|
10313
|
+
const SizeText = (h("span", { class: "duet-upload-item-size", style: { fontSize: "14px", fontWeight: "400" } },
|
|
10314
|
+
"(",
|
|
10315
|
+
formatBytes(size),
|
|
10316
|
+
")"));
|
|
10317
|
+
const FilenameLine = uploaded && url && showLinks ? (h("duet-paragraph", { color: "secondary", margin: "none", weight: "semi-bold" },
|
|
10318
|
+
h("duet-link", { url: url, external: true }, ContentName),
|
|
10319
|
+
h("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
10320
|
+
SizeText)) : (h("duet-paragraph", { color: "secondary", margin: "none", weight: "semi-bold" },
|
|
10321
|
+
ContentName,
|
|
10322
|
+
h("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
10323
|
+
SizeText));
|
|
10324
|
+
const Badges = meta && meta.badges ? (h("span", null,
|
|
10325
|
+
h("duet-spacer", { size: "xx-small" }),
|
|
10326
|
+
meta.badges.map(badgeText => (h("duet-badge", { color: "primary" }, badgeText))))) : undefined;
|
|
10327
|
+
return (h("span", { class: "duet-upload-item-success" },
|
|
10328
|
+
h("div", null, FilenameLine),
|
|
10329
|
+
Badges));
|
|
10330
|
+
};
|
|
9762
10331
|
|
|
9763
10332
|
const validateFileExtension = (name, allowedExtensions) => {
|
|
9764
10333
|
if (!allowedExtensions) {
|
|
@@ -9849,12 +10418,8 @@ const validateTotalAmountIsAboveMax = (filelist, maxFiles) => {
|
|
|
9849
10418
|
return false;
|
|
9850
10419
|
};
|
|
9851
10420
|
|
|
9852
|
-
const makeXhrRequest = (payload, options, onFailure, onSuccess, onProgress) => {
|
|
9853
|
-
const { type, xhr, uri, argument, headers } =
|
|
9854
|
-
type: "POST",
|
|
9855
|
-
argument: null,
|
|
9856
|
-
headers: null,
|
|
9857
|
-
}, options);
|
|
10421
|
+
const makeXhrRequest = ({ payload, options, onFailure, onSuccess, onProgress }) => {
|
|
10422
|
+
const { type = "POST", xhr, uri, argument = null, headers = null } = options;
|
|
9858
10423
|
xhr.open(type, `${uri}${argument || ""}`, true);
|
|
9859
10424
|
const { data, name } = payload;
|
|
9860
10425
|
// headers must be added after open
|
|
@@ -9881,13 +10446,13 @@ const makeXhrRequest = (payload, options, onFailure, onSuccess, onProgress) => {
|
|
|
9881
10446
|
return xhr;
|
|
9882
10447
|
};
|
|
9883
10448
|
|
|
9884
|
-
const duetUploadCss = "*,*::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}:
|
|
10449
|
+
const duetUploadCss = "*,*::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}::slotted([slot=header]){margin-bottom:16px}::slotted([slot=fileheader]){margin:16px 0 0 0}::slotted([slot=filefooter]){margin-top:16px}.duet-upload{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-upload-item-size{font-size:0.75rem;font-weight:400}.duet-upload-filelist{margin-bottom:25px}.duet-upload-filelist-empty{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:#f5f8fa}";
|
|
9885
10450
|
|
|
9886
|
-
let DuetUpload$1 = class extends
|
|
10451
|
+
let DuetUpload$1 = class extends H {
|
|
9887
10452
|
constructor() {
|
|
9888
10453
|
super();
|
|
9889
10454
|
this.__registerHost();
|
|
9890
|
-
|
|
10455
|
+
this.__attachShadow();
|
|
9891
10456
|
this.duetChange = createEvent$2(this, "duetChange", 3);
|
|
9892
10457
|
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
9893
10458
|
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
@@ -9903,9 +10468,19 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
9903
10468
|
this.buttonId = createID("DuetButton");
|
|
9904
10469
|
this.labelId = createID("DuetLabel");
|
|
9905
10470
|
this.uploadId = createID("DuetUpload");
|
|
10471
|
+
this.editableTableId = createID("DuetEditableTable");
|
|
9906
10472
|
this.filesInProgress = new Map();
|
|
9907
10473
|
this.fileMaxReached = false;
|
|
9908
10474
|
this.bytesMaxReached = false;
|
|
10475
|
+
//region Internally exposed properties
|
|
10476
|
+
/**
|
|
10477
|
+
* Properties
|
|
10478
|
+
*/
|
|
10479
|
+
this.DefaultGroups = {
|
|
10480
|
+
inprogress: "inprogress",
|
|
10481
|
+
success: "success",
|
|
10482
|
+
failure: "failure",
|
|
10483
|
+
};
|
|
9909
10484
|
/**
|
|
9910
10485
|
* State() variables
|
|
9911
10486
|
*/
|
|
@@ -9915,9 +10490,91 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
9915
10490
|
* it will be up to you to handle the upload and return progress information to the upload-component
|
|
9916
10491
|
*/
|
|
9917
10492
|
this.external = false;
|
|
10493
|
+
/**
|
|
10494
|
+
* If set the upload component will not display an upload button, you will have to create on yourself
|
|
10495
|
+
* and call the exposed methods startUpload
|
|
10496
|
+
*/
|
|
10497
|
+
this.hideButton = false;
|
|
10498
|
+
/**
|
|
10499
|
+
* Default actions added to all files
|
|
10500
|
+
*/
|
|
10501
|
+
this.actions = [
|
|
10502
|
+
{
|
|
10503
|
+
icon: "action-delete",
|
|
10504
|
+
color: "color-danger",
|
|
10505
|
+
color_hover: "category-home",
|
|
10506
|
+
id: "delete",
|
|
10507
|
+
map: ["success", "failure"],
|
|
10508
|
+
label: {
|
|
10509
|
+
fi: "Poista tiedosto",
|
|
10510
|
+
en: "Poista tiedosto",
|
|
10511
|
+
sv: "Ta bort filen",
|
|
10512
|
+
},
|
|
10513
|
+
},
|
|
10514
|
+
{
|
|
10515
|
+
icon: "navigation-close",
|
|
10516
|
+
color: "primary",
|
|
10517
|
+
color_hover: "category-home",
|
|
10518
|
+
id: "cancel",
|
|
10519
|
+
map: ["inprogress"],
|
|
10520
|
+
label: {
|
|
10521
|
+
fi: "Keskeytä lähetys",
|
|
10522
|
+
en: "Cancel the upload",
|
|
10523
|
+
sv: "Stop överföringen",
|
|
10524
|
+
},
|
|
10525
|
+
},
|
|
10526
|
+
];
|
|
10527
|
+
/**
|
|
10528
|
+
* If enabled the filelist will create links on successfully uploaded items,
|
|
10529
|
+
* this requires the server can respond with link URIs in the correct format
|
|
10530
|
+
*/
|
|
10531
|
+
this.showLinks = false;
|
|
10532
|
+
/**
|
|
10533
|
+
* Property to change the aria upload progress text read aloud by screenreaders
|
|
10534
|
+
* @default {
|
|
10535
|
+
fi: "Lisää liite",
|
|
10536
|
+
sv: "Lägg till en bilaga",
|
|
10537
|
+
en: "Choose files",
|
|
10538
|
+
}
|
|
10539
|
+
*/
|
|
10540
|
+
this.statusLabelDefaults = {
|
|
10541
|
+
fi: {
|
|
10542
|
+
inProgress: "Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",
|
|
10543
|
+
inProgressWithErrors: "Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",
|
|
10544
|
+
done: "Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",
|
|
10545
|
+
doneWithErrors: "Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",
|
|
10546
|
+
files: "tiedostot",
|
|
10547
|
+
file: "tiedosto",
|
|
10548
|
+
},
|
|
10549
|
+
sv: {
|
|
10550
|
+
inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
10551
|
+
inProgressWithErrors: "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
|
|
10552
|
+
done: "Alla {filesTotal} har lagts till",
|
|
10553
|
+
doneWithErrors: "Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
|
|
10554
|
+
files: "filer",
|
|
10555
|
+
file: "fil",
|
|
10556
|
+
},
|
|
10557
|
+
en: {
|
|
10558
|
+
inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
10559
|
+
inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
|
|
10560
|
+
done: "All {filesTotal} added successfully",
|
|
10561
|
+
doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
|
|
10562
|
+
files: "tiedostoa",
|
|
10563
|
+
file: "tiedosto",
|
|
10564
|
+
},
|
|
10565
|
+
};
|
|
10566
|
+
/**
|
|
10567
|
+
* Strings used for the status aria-label
|
|
10568
|
+
*/
|
|
10569
|
+
this.statusMessageLabel = getLocaleString(this.statusLabelDefaults);
|
|
9918
10570
|
/**
|
|
9919
10571
|
* Property to change descriptionDefaults defaults on the component.
|
|
9920
10572
|
* normally you would handle these strings on an application level and override @label when needed
|
|
10573
|
+
* @default {
|
|
10574
|
+
fi: "Lisää liite",
|
|
10575
|
+
sv: "Lägg till en bilaga",
|
|
10576
|
+
en: "Add an attachment",
|
|
10577
|
+
}
|
|
9921
10578
|
*/
|
|
9922
10579
|
this.buttonLabelDefaults = {
|
|
9923
10580
|
fi: "Lisää liite",
|
|
@@ -9953,6 +10610,10 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
9953
10610
|
* browser from displaying its own validation errors.
|
|
9954
10611
|
*/
|
|
9955
10612
|
this.required = false;
|
|
10613
|
+
/**
|
|
10614
|
+
* Visually hides the groups labels in the editable table list used to display the list of files
|
|
10615
|
+
*/
|
|
10616
|
+
this.hideGroups = false;
|
|
9956
10617
|
/**
|
|
9957
10618
|
* Map of string that contain list of uploaded files.
|
|
9958
10619
|
*/
|
|
@@ -9964,6 +10625,7 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
9964
10625
|
/**
|
|
9965
10626
|
* Property to change labelDefaults defaults on the component.
|
|
9966
10627
|
* normally you would handle these strings on an application level and override @label when needed
|
|
10628
|
+
* @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
|
|
9967
10629
|
*/
|
|
9968
10630
|
this.labelDefaults = {
|
|
9969
10631
|
fi: "Lisää liite",
|
|
@@ -9978,6 +10640,11 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
9978
10640
|
/**
|
|
9979
10641
|
* Property to change descriptionDefaults defaults on the component.
|
|
9980
10642
|
* normally you would handle these strings on an application level and override @label when needed
|
|
10643
|
+
* @default {
|
|
10644
|
+
fi: "Voit liittää {filetypes}-muotoisia tiedostoja sekä yleisimpiä videotiedostoja. Voit lähettää {maxbytes} verran tiedostoja yhdellä kertaa, ja lisätä enintään {maxfiles} liitettä kerrallaan.",
|
|
10645
|
+
sv: "Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer åt gången och lägga till upp till {maxfiles} bilagor åt gången.",
|
|
10646
|
+
en: "You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time.",
|
|
10647
|
+
}
|
|
9981
10648
|
*/
|
|
9982
10649
|
this.descriptionDefaults = {
|
|
9983
10650
|
fi: "Voit liittää {filetypes}-muotoisia tiedostoja sekä yleisimpiä videotiedostoja. Voit lähettää {maxbytes} verran tiedostoja yhdellä kertaa, ja lisätä enintään {maxfiles} liitettä kerrallaan.",
|
|
@@ -9986,12 +10653,20 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
9986
10653
|
};
|
|
9987
10654
|
/**
|
|
9988
10655
|
* Description for the upload component.
|
|
9989
|
-
* @default
|
|
10656
|
+
* @default {
|
|
10657
|
+
fi: "Voit liittää {filetypes}-muotoisia tiedostoja sekä yleisimpiä videotiedostoja. Voit lähettää {maxbytes} verran tiedostoja yhdellä kertaa, ja lisätä enintään {maxfiles} liitettä kerrallaan.",
|
|
10658
|
+
sv: "Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer åt gången och lägga till upp till {maxfiles} bilagor åt gången.",
|
|
10659
|
+
en: "You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time.",
|
|
10660
|
+
}
|
|
9990
10661
|
*/
|
|
9991
10662
|
this.description = getLocaleString(this.descriptionDefaults);
|
|
9992
10663
|
/**
|
|
9993
10664
|
* Defaults for the filelist's empty state.
|
|
9994
|
-
* @default {
|
|
10665
|
+
* @default {
|
|
10666
|
+
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
10667
|
+
sv: "Inga filer har lagts till ännu.",
|
|
10668
|
+
en: "No files added yet.",
|
|
10669
|
+
}
|
|
9995
10670
|
*/
|
|
9996
10671
|
this.fileListEmptyDefaults = {
|
|
9997
10672
|
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
@@ -10007,21 +10682,6 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10007
10682
|
* Display the input in error state along with an error message.
|
|
10008
10683
|
*/
|
|
10009
10684
|
this.error = "";
|
|
10010
|
-
/**
|
|
10011
|
-
* Visually hide the label, but still show it to screen readers.
|
|
10012
|
-
*/
|
|
10013
|
-
this.labelHidden = false;
|
|
10014
|
-
/**
|
|
10015
|
-
* if set, allows capture of media from user camera / microphone
|
|
10016
|
-
* The capture attribute value is a string that specifies which camera to use for capture
|
|
10017
|
-
* of image or video data, if the accept attribute indicates that the input should be of
|
|
10018
|
-
* one of those types. A value of user indicates that the user-facing camera and/or
|
|
10019
|
-
* microphone should be used. A value of environment specifies that the outward-facing
|
|
10020
|
-
* camera and/or microphone should be used. If this attribute is missing, the user agent
|
|
10021
|
-
* is free to decide on its own what to do. If the requested facing mode isn't available,
|
|
10022
|
-
* the user agent may fall back to its preferred default mode.
|
|
10023
|
-
*/
|
|
10024
|
-
this.capture = undefined;
|
|
10025
10685
|
/**
|
|
10026
10686
|
* Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded.
|
|
10027
10687
|
*/
|
|
@@ -10053,10 +10713,94 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10053
10713
|
* by default this is off, setting this to true will limit the users choices to what has been explicitly set
|
|
10054
10714
|
*/
|
|
10055
10715
|
this.limitSelection = false;
|
|
10716
|
+
//region Private functions
|
|
10056
10717
|
/**
|
|
10057
10718
|
* Private functions
|
|
10058
10719
|
*/
|
|
10059
|
-
this.
|
|
10720
|
+
this.listenForActionEvents = () => {
|
|
10721
|
+
this.element.addEventListener("duetEditableItemAction", (e) => {
|
|
10722
|
+
const detail = e.detail;
|
|
10723
|
+
const { action, keyName, originalEvent } = detail;
|
|
10724
|
+
switch (action) {
|
|
10725
|
+
case "delete":
|
|
10726
|
+
this.onDelete(keyName, originalEvent);
|
|
10727
|
+
break;
|
|
10728
|
+
case "cancel":
|
|
10729
|
+
this.onCancel(keyName, originalEvent);
|
|
10730
|
+
break;
|
|
10731
|
+
// code block
|
|
10732
|
+
}
|
|
10733
|
+
});
|
|
10734
|
+
};
|
|
10735
|
+
this.verifyValidity = () => {
|
|
10736
|
+
const { invalid, valid } = this.getFilesAsArray();
|
|
10737
|
+
const oldValid = this.valid;
|
|
10738
|
+
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
10739
|
+
if (this.valid !== oldValid) {
|
|
10740
|
+
this.duetState.emit({
|
|
10741
|
+
originalEvent: undefined,
|
|
10742
|
+
data: { valid: this.valid, from: "componentWillRender" },
|
|
10743
|
+
component: "duet-upload",
|
|
10744
|
+
});
|
|
10745
|
+
}
|
|
10746
|
+
};
|
|
10747
|
+
this.getGroupFromItemData = (item) => {
|
|
10748
|
+
if (item.valid && item.progress === 100) {
|
|
10749
|
+
// if the item has a group, move the file to that group instead
|
|
10750
|
+
// of into the standard success group
|
|
10751
|
+
if (item.group) {
|
|
10752
|
+
return item.group;
|
|
10753
|
+
}
|
|
10754
|
+
return this.DefaultGroups.success;
|
|
10755
|
+
}
|
|
10756
|
+
else if (item.progress > 0 && item.progress !== 100) {
|
|
10757
|
+
return this.DefaultGroups.inprogress;
|
|
10758
|
+
}
|
|
10759
|
+
else if (!item.valid) {
|
|
10760
|
+
return this.DefaultGroups.failure;
|
|
10761
|
+
}
|
|
10762
|
+
else if (item.group) {
|
|
10763
|
+
return item.group;
|
|
10764
|
+
}
|
|
10765
|
+
else {
|
|
10766
|
+
return "none";
|
|
10767
|
+
}
|
|
10768
|
+
};
|
|
10769
|
+
this.getItemHTMLFromItemData = (data, group) => {
|
|
10770
|
+
if (group === this.DefaultGroups.success) {
|
|
10771
|
+
return h$1(SuccessItem, { data: data, showLinks: this.showLinks });
|
|
10772
|
+
}
|
|
10773
|
+
else if (group === this.DefaultGroups.inprogress) {
|
|
10774
|
+
return h$1(ProgressItem, { progress: data.progress, name: data.item.name });
|
|
10775
|
+
}
|
|
10776
|
+
else if (group === this.DefaultGroups.failure) {
|
|
10777
|
+
return h$1(ErrorItem, { data: data });
|
|
10778
|
+
}
|
|
10779
|
+
else if (data.group) {
|
|
10780
|
+
return data.html;
|
|
10781
|
+
}
|
|
10782
|
+
else {
|
|
10783
|
+
return "none";
|
|
10784
|
+
}
|
|
10785
|
+
};
|
|
10786
|
+
this.convertToDuetEditableTableItems = () => {
|
|
10787
|
+
// we're always recreating the map - in order to force an update down stream.
|
|
10788
|
+
const itemData = new Map();
|
|
10789
|
+
//walk the files Map and convert to DuetEditableTableItemData
|
|
10790
|
+
this.files.forEach((data, key, _originalMap) => {
|
|
10791
|
+
const group = this.getGroupFromItemData(data);
|
|
10792
|
+
const item = this.getItemHTMLFromItemData(data, group);
|
|
10793
|
+
itemData.set(key, {
|
|
10794
|
+
uid: data.uid,
|
|
10795
|
+
item,
|
|
10796
|
+
group,
|
|
10797
|
+
});
|
|
10798
|
+
});
|
|
10799
|
+
return itemData;
|
|
10800
|
+
};
|
|
10801
|
+
this.kick = debounce(() => {
|
|
10802
|
+
this.tick = Date.now();
|
|
10803
|
+
}, 30); // will trigger re-render
|
|
10060
10804
|
this.genHashName = () => Date.now().toString(36) + Math.random();
|
|
10061
10805
|
this.updateValueInMap = (item, key, value, kick = true) => {
|
|
10062
10806
|
const fileItem = this.files.get(item);
|
|
@@ -10067,10 +10811,14 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10067
10811
|
}
|
|
10068
10812
|
};
|
|
10069
10813
|
this.updateProgress = (ev, name) => {
|
|
10070
|
-
|
|
10071
|
-
|
|
10814
|
+
console.log(this.filesInProgress.size);
|
|
10815
|
+
const updateProgressHelper = percentComplete => {
|
|
10072
10816
|
this.updateValueInMap(name, "progress", percentComplete);
|
|
10073
10817
|
this.onProgress(name, percentComplete, ev);
|
|
10818
|
+
};
|
|
10819
|
+
if (ev.lengthComputable) {
|
|
10820
|
+
const percentComplete = (ev.loaded / ev.total) * 100;
|
|
10821
|
+
updateProgressHelper(percentComplete);
|
|
10074
10822
|
}
|
|
10075
10823
|
else {
|
|
10076
10824
|
console.log("cant read progress");
|
|
@@ -10109,16 +10857,17 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10109
10857
|
*/
|
|
10110
10858
|
this.nativeInput.value = "";
|
|
10111
10859
|
};
|
|
10112
|
-
this.
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
}
|
|
10860
|
+
this.startUpload = async (ev, metaData = undefined) => {
|
|
10861
|
+
await this.setFocus();
|
|
10862
|
+
this.metaData = metaData;
|
|
10863
|
+
this.nativeInput.click();
|
|
10864
|
+
this.onUpload(ev, metaData);
|
|
10865
|
+
ev.stopPropagation();
|
|
10866
|
+
ev.preventDefault();
|
|
10867
|
+
return;
|
|
10121
10868
|
};
|
|
10869
|
+
//endregion
|
|
10870
|
+
//region Eventlisteners for the XHR requests
|
|
10122
10871
|
/**
|
|
10123
10872
|
* Eventlisteners for the XHR requests
|
|
10124
10873
|
*/
|
|
@@ -10128,6 +10877,7 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10128
10877
|
};
|
|
10129
10878
|
this.transferDone = (xhr, name, status) => {
|
|
10130
10879
|
this.updateValueInMap(name, "status", status, false);
|
|
10880
|
+
this.updateValueInMap(name, "uploaded", true, false);
|
|
10131
10881
|
try {
|
|
10132
10882
|
const response = JSON.parse(xhr.response);
|
|
10133
10883
|
this.updateValueInMap(name, "url", response.url);
|
|
@@ -10141,12 +10891,13 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10141
10891
|
this.transferDoneWithFailure = (xhr, name, status) => {
|
|
10142
10892
|
try {
|
|
10143
10893
|
const { error } = JSON.parse(xhr.response);
|
|
10144
|
-
this.updateValueInMap(name, "error", { message: error.message, type: error.type });
|
|
10894
|
+
this.updateValueInMap(name, "error", { message: error.message, type: error.type }, false);
|
|
10145
10895
|
}
|
|
10146
10896
|
catch (e) {
|
|
10147
10897
|
console.error("Server did not respond with expected response error:{message: string, type: int}");
|
|
10148
|
-
this.updateValueInMap(name, "error", { type: status });
|
|
10898
|
+
this.updateValueInMap(name, "error", { type: status }, false);
|
|
10149
10899
|
}
|
|
10900
|
+
this.updateValueInMap(name, "valid", false, true);
|
|
10150
10901
|
};
|
|
10151
10902
|
this.transferFailed = name => {
|
|
10152
10903
|
this.updateValueInMap(name, "error", getError("duet-upload-001"));
|
|
@@ -10177,15 +10928,15 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10177
10928
|
this.files.delete(key);
|
|
10178
10929
|
this.validateTotals();
|
|
10179
10930
|
this.kick();
|
|
10180
|
-
if (!this.external) {
|
|
10181
|
-
this.makeXHRDeleteRequest(deletedItem);
|
|
10182
|
-
}
|
|
10183
|
-
this.resetFormFields();
|
|
10184
10931
|
this.duetDelete.emit({
|
|
10185
10932
|
originalEvent: ev,
|
|
10186
10933
|
data: { deletion: deletedItem },
|
|
10187
10934
|
component: "duet-upload",
|
|
10188
10935
|
});
|
|
10936
|
+
if (!this.external) {
|
|
10937
|
+
this.makeXHRDeleteRequest(deletedItem);
|
|
10938
|
+
}
|
|
10939
|
+
this.resetFormFields();
|
|
10189
10940
|
};
|
|
10190
10941
|
this.onCancel = (key, ev) => {
|
|
10191
10942
|
const cancelledItem = this.files.get(key);
|
|
@@ -10204,9 +10955,10 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10204
10955
|
component: "duet-upload",
|
|
10205
10956
|
});
|
|
10206
10957
|
};
|
|
10207
|
-
this.onUpload = (ev) => {
|
|
10958
|
+
this.onUpload = (ev, metaData) => {
|
|
10208
10959
|
this.duetUpload.emit({
|
|
10209
10960
|
originalEvent: ev,
|
|
10961
|
+
metaData,
|
|
10210
10962
|
component: "duet-upload",
|
|
10211
10963
|
});
|
|
10212
10964
|
};
|
|
@@ -10238,37 +10990,26 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10238
10990
|
data: { files: this.files },
|
|
10239
10991
|
});
|
|
10240
10992
|
};
|
|
10241
|
-
this.startUpload = async (ev) => {
|
|
10242
|
-
await this.setFocus();
|
|
10243
|
-
this.nativeInput.click();
|
|
10244
|
-
this.onUpload(ev);
|
|
10245
|
-
ev.stopPropagation();
|
|
10246
|
-
ev.preventDefault();
|
|
10247
|
-
};
|
|
10248
10993
|
}
|
|
10249
10994
|
watchValidHandler(newValue, oldValue) {
|
|
10250
10995
|
if (newValue !== oldValue) {
|
|
10251
10996
|
this.kick();
|
|
10252
10997
|
}
|
|
10253
10998
|
}
|
|
10999
|
+
//endregion
|
|
10254
11000
|
/**
|
|
10255
11001
|
* Component lifecycle events.
|
|
10256
11002
|
*/
|
|
10257
11003
|
componentWillLoad() {
|
|
10258
11004
|
inheritGlobalTheme(this);
|
|
11005
|
+
this.listenForActionEvents();
|
|
10259
11006
|
}
|
|
10260
11007
|
componentWillRender() {
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
10264
|
-
if (this.valid !== oldValid) {
|
|
10265
|
-
this.duetState.emit({
|
|
10266
|
-
originalEvent: undefined,
|
|
10267
|
-
data: { valid: this.valid, from: "componentWillRender" },
|
|
10268
|
-
component: "duet-upload",
|
|
10269
|
-
});
|
|
10270
|
-
}
|
|
11008
|
+
// listen to the events from the component
|
|
11009
|
+
this.verifyValidity();
|
|
10271
11010
|
}
|
|
11011
|
+
//endregion
|
|
11012
|
+
//region XHR requests
|
|
10272
11013
|
/**
|
|
10273
11014
|
* XHR request utilities
|
|
10274
11015
|
*/
|
|
@@ -10287,23 +11028,37 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10287
11028
|
xhr.upload.addEventListener("abort", () => {
|
|
10288
11029
|
this.transferCanceled(name);
|
|
10289
11030
|
});
|
|
10290
|
-
return makeXhrRequest({
|
|
11031
|
+
return makeXhrRequest({
|
|
11032
|
+
payload: { data, name },
|
|
11033
|
+
options: { type: "POST", uri: this.uri, xhr, argument: null, headers: null },
|
|
11034
|
+
onFailure: this.transferDoneWithFailure,
|
|
11035
|
+
onSuccess: this.transferDone,
|
|
11036
|
+
onProgress: this.trackProgress,
|
|
11037
|
+
});
|
|
10291
11038
|
}
|
|
10292
11039
|
makeXHRDeleteRequest(data) {
|
|
10293
11040
|
const { uid, item } = data;
|
|
10294
11041
|
const xhr = new XMLHttpRequest();
|
|
10295
11042
|
// don't present server issues to user on deletes, just remove them from the visible list
|
|
10296
|
-
return makeXhrRequest({
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
11043
|
+
return makeXhrRequest({
|
|
11044
|
+
payload: { data: null, name },
|
|
11045
|
+
options: {
|
|
11046
|
+
type: "DELETE",
|
|
11047
|
+
xhr,
|
|
11048
|
+
uri: this.uri,
|
|
11049
|
+
arguments: `?key=${uid}&name=${item.name}`,
|
|
11050
|
+
headers: {
|
|
11051
|
+
"x-fileuid": uid,
|
|
11052
|
+
"x-filename": item.name,
|
|
11053
|
+
},
|
|
10304
11054
|
},
|
|
10305
|
-
|
|
11055
|
+
onFailure: this.transferDoneWithFailure,
|
|
11056
|
+
onSuccess: this.transferDone,
|
|
11057
|
+
onProgress: this.trackProgress,
|
|
11058
|
+
});
|
|
10306
11059
|
}
|
|
11060
|
+
//endregion
|
|
11061
|
+
//region EventHandlers
|
|
10307
11062
|
/**
|
|
10308
11063
|
* Component event handling.
|
|
10309
11064
|
*/
|
|
@@ -10312,7 +11067,7 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10312
11067
|
const selectedFiles = Array.from((_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.files);
|
|
10313
11068
|
// FileList is a nice array like structure but
|
|
10314
11069
|
// to ensure uniqueness of files we use a mapping structure and
|
|
10315
|
-
// key to the name (makes it easier to delete)
|
|
11070
|
+
// key to the name (makes it easier to delete as well)
|
|
10316
11071
|
if (selectedFiles) {
|
|
10317
11072
|
for (const item of selectedFiles) {
|
|
10318
11073
|
const { valid, errorMessage, errorType, errorSystem } = validateFile(item, {
|
|
@@ -10325,6 +11080,8 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10325
11080
|
uid,
|
|
10326
11081
|
item: item,
|
|
10327
11082
|
size: item.size,
|
|
11083
|
+
meta: this.metaData,
|
|
11084
|
+
uploaded: false,
|
|
10328
11085
|
valid,
|
|
10329
11086
|
error: {
|
|
10330
11087
|
type: valid ? undefined : errorType,
|
|
@@ -10353,8 +11110,14 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10353
11110
|
data.append("file", item);
|
|
10354
11111
|
data.append("uid", uid);
|
|
10355
11112
|
data.append("name", item.name);
|
|
10356
|
-
data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size }));
|
|
10357
|
-
|
|
11113
|
+
data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size, meta: fileListItem.meta }));
|
|
11114
|
+
try {
|
|
11115
|
+
fileListItem.xhr = await this.makeXHRPostRequest(data);
|
|
11116
|
+
}
|
|
11117
|
+
catch (e) {
|
|
11118
|
+
// in case one of the global maxes have been reached, invalidate the file
|
|
11119
|
+
this.updateValueInMap(item.name, "valid", false, false);
|
|
11120
|
+
}
|
|
10358
11121
|
}
|
|
10359
11122
|
// kick the stat to force update
|
|
10360
11123
|
this.kick();
|
|
@@ -10362,12 +11125,15 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10362
11125
|
}
|
|
10363
11126
|
// reset the form, so that a user may upload a file again (with the same name)
|
|
10364
11127
|
this.resetFormFields();
|
|
11128
|
+
// reset the internal metaData state
|
|
11129
|
+
this.metaData = undefined;
|
|
10365
11130
|
this.duetChange.emit({
|
|
10366
11131
|
originalEvent: ev,
|
|
10367
11132
|
data: { files: this.files },
|
|
10368
11133
|
component: "duet-upload",
|
|
10369
11134
|
});
|
|
10370
11135
|
}
|
|
11136
|
+
//endregion
|
|
10371
11137
|
/**
|
|
10372
11138
|
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
10373
11139
|
* `input.focus()`.
|
|
@@ -10378,6 +11144,15 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10378
11144
|
}
|
|
10379
11145
|
return;
|
|
10380
11146
|
}
|
|
11147
|
+
/**
|
|
11148
|
+
* Method for invoking the upload sequence
|
|
11149
|
+
*/
|
|
11150
|
+
async upload(metaData = undefined) {
|
|
11151
|
+
await this.setFocus();
|
|
11152
|
+
this.metaData = metaData;
|
|
11153
|
+
this.nativeInput.click();
|
|
11154
|
+
return;
|
|
11155
|
+
}
|
|
10381
11156
|
/**
|
|
10382
11157
|
* Get list of files, divided in errors and valid sections
|
|
10383
11158
|
*/
|
|
@@ -10387,6 +11162,12 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10387
11162
|
}
|
|
10388
11163
|
return this.getFilesAsArray();
|
|
10389
11164
|
}
|
|
11165
|
+
/**
|
|
11166
|
+
* Convenience method for updating a of an item in the files attribute
|
|
11167
|
+
*/
|
|
11168
|
+
async updateValue(item, key, value) {
|
|
11169
|
+
this.updateValueInMap(item, key, value);
|
|
11170
|
+
}
|
|
10390
11171
|
/**
|
|
10391
11172
|
* render() function
|
|
10392
11173
|
* Always the last one in the class.
|
|
@@ -10396,13 +11177,13 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10396
11177
|
let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
|
|
10397
11178
|
caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
|
|
10398
11179
|
caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
|
|
10399
|
-
return (h$1(Host, { class: { "duet-m-0": this.margin === "none" } }, h$1("duet-fieldset", { label: this.label, caption: caption }, h$1("slot", { name: "header" }), h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
|
|
11180
|
+
return (h$1(Host, { class: { "duet-m-0": this.margin === "none" } }, h$1("duet-fieldset", { label: this.label, caption: caption }, h$1("slot", { name: "header" }), !this.files.size && (h$1("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
|
|
10400
11181
|
"duet-upload-filelist-empty": !this.files.size,
|
|
10401
11182
|
"duet-upload-filelist": true,
|
|
10402
11183
|
"duet-upload-filelist-filled": this.files.size,
|
|
10403
|
-
}, id: this.labelId, for: identifier },
|
|
11184
|
+
}, id: this.labelId, for: identifier }, this.fileListEmpty)), !!this.files.size && h$1("slot", { name: "fileheader" }), !!this.files.size && (h$1("duet-upload-aria-status", { invalid: this.getFilesAsArray().invalid.length, valid: this.getFilesAsArray().valid.length, inprogress: this.filesInProgress.size, total: this.files.size, statusMessageLabel: this.statusMessageLabel })), !!this.files.size && (h$1("duet-editable-table", { "aria-live": "polite", "aria-relevant": "removals", accessibleRole: "log", id: this.editableTableId, groups: this.groups, actions: this.actions, hideGroups: this.hideGroups, items: this.convertToDuetEditableTableItems() })), !!this.files.size && h$1("slot", { name: "filefooter" }), h$1("duet-spacer", { size: "large" }), !this.hideButton && (h$1("duet-button", { id: this.buttonId, onClick: this.startUpload, "accessible-controls": identifier, disabled: this.fileMaxReached, "accessible-label": this.accessibleButtonLabel, "accessible-owns": identifier, size: "small", variation: "secondary", fixed: true, icon: "action-add-circle" }, this.buttonLabel)), h$1("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (h$1("duet-alert", null, this.fileMaxReached && getI18nError("duet-upload-301"), this.bytesMaxReached && getI18nError("duet-upload-202"))), h$1("duet-spacer", { size: "medium" }), h$1("duet-visually-hidden", null, h$1("input", { ref: input => {
|
|
10404
11185
|
this.nativeInput = input;
|
|
10405
|
-
}, accept: this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
11186
|
+
}, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
10406
11187
|
"duet-upload": true,
|
|
10407
11188
|
}, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
|
|
10408
11189
|
}
|
|
@@ -10413,13 +11194,105 @@ let DuetUpload$1 = class extends HTMLElement {
|
|
|
10413
11194
|
static get style() { return duetUploadCss; }
|
|
10414
11195
|
};
|
|
10415
11196
|
|
|
11197
|
+
let DuetUploadAriaStatus$1 = class extends H {
|
|
11198
|
+
constructor() {
|
|
11199
|
+
super();
|
|
11200
|
+
this.__registerHost();
|
|
11201
|
+
this.__attachShadow();
|
|
11202
|
+
/**
|
|
11203
|
+
* State() variables
|
|
11204
|
+
*/
|
|
11205
|
+
this.statusMessage = null;
|
|
11206
|
+
/**
|
|
11207
|
+
* State() variables
|
|
11208
|
+
*/
|
|
11209
|
+
this.statusMessageLabel = null;
|
|
11210
|
+
/**
|
|
11211
|
+
* Adds accessible label that is read aloud
|
|
11212
|
+
*/
|
|
11213
|
+
this.accessibleAriaLive = "polite";
|
|
11214
|
+
/**
|
|
11215
|
+
* valid file amount
|
|
11216
|
+
*/
|
|
11217
|
+
this.valid = undefined;
|
|
11218
|
+
/**
|
|
11219
|
+
* total files
|
|
11220
|
+
*/
|
|
11221
|
+
this.total = undefined;
|
|
11222
|
+
/**
|
|
11223
|
+
* invalid file amount
|
|
11224
|
+
*/
|
|
11225
|
+
this.invalid = undefined;
|
|
11226
|
+
/**
|
|
11227
|
+
* valid file amount
|
|
11228
|
+
*/
|
|
11229
|
+
this.inprogress = undefined;
|
|
11230
|
+
/**
|
|
11231
|
+
* Component lifecycle events.
|
|
11232
|
+
*/
|
|
11233
|
+
this.replacePlaceHolders = (statusString) => {
|
|
11234
|
+
const addFiles = (amount) => {
|
|
11235
|
+
return amount > 1 ? `${amount} ${this.statusMessageLabel.files}` : `${amount} ${this.statusMessageLabel.file}`;
|
|
11236
|
+
};
|
|
11237
|
+
return statusString
|
|
11238
|
+
.replace("{filesUploaded}", addFiles(this.valid))
|
|
11239
|
+
.replace("{filesInProgress}", addFiles(this.inprogress))
|
|
11240
|
+
.replace("{filesTotal}", addFiles(this.total))
|
|
11241
|
+
.replace("{filesWithErrors}", addFiles(this.invalid));
|
|
11242
|
+
};
|
|
11243
|
+
this.getStatusMessage = () => {
|
|
11244
|
+
const { done, inProgress, doneWithErrors, inProgressWithErrors } = this.statusMessageLabel;
|
|
11245
|
+
const hasErrors = this.invalid > 0;
|
|
11246
|
+
const isInProgress = this.inprogress > 0;
|
|
11247
|
+
const isInProgressWithErrors = this.inprogress > 0 && hasErrors;
|
|
11248
|
+
const isDone = this.valid === this.total && !isInProgress && !hasErrors;
|
|
11249
|
+
const isDoneWithErrors = this.valid + this.invalid === this.total && !isInProgress;
|
|
11250
|
+
if (isDone) {
|
|
11251
|
+
this.statusMessage = this.replacePlaceHolders(done);
|
|
11252
|
+
return;
|
|
11253
|
+
}
|
|
11254
|
+
else if (isInProgressWithErrors) {
|
|
11255
|
+
this.statusMessage = this.replacePlaceHolders(inProgressWithErrors);
|
|
11256
|
+
return;
|
|
11257
|
+
}
|
|
11258
|
+
else if (isInProgress) {
|
|
11259
|
+
this.statusMessage = this.replacePlaceHolders(inProgress);
|
|
11260
|
+
return;
|
|
11261
|
+
}
|
|
11262
|
+
else if (isDoneWithErrors) {
|
|
11263
|
+
this.statusMessage = this.replacePlaceHolders(doneWithErrors);
|
|
11264
|
+
return;
|
|
11265
|
+
}
|
|
11266
|
+
return;
|
|
11267
|
+
};
|
|
11268
|
+
}
|
|
11269
|
+
watchHandler(newValue, oldValue) {
|
|
11270
|
+
if (newValue !== oldValue) {
|
|
11271
|
+
this.getStatusMessage();
|
|
11272
|
+
}
|
|
11273
|
+
}
|
|
11274
|
+
/**
|
|
11275
|
+
* render() function
|
|
11276
|
+
* Always the last one in the class.
|
|
11277
|
+
*/
|
|
11278
|
+
render() {
|
|
11279
|
+
return (h$1(Host, { role: "status", "aria-live": "assertive", "aria-atomic": "true", "aria-relevant": "all" }, h$1("duet-visually-hidden", null, this.statusMessage)));
|
|
11280
|
+
}
|
|
11281
|
+
static get watchers() { return {
|
|
11282
|
+
"valid": ["watchHandler"],
|
|
11283
|
+
"invalid": ["watchHandler"],
|
|
11284
|
+
"inprogress": ["watchHandler"],
|
|
11285
|
+
"total": ["watchHandler"]
|
|
11286
|
+
}; }
|
|
11287
|
+
};
|
|
11288
|
+
|
|
10416
11289
|
const duetVisuallyHiddenCss = ":host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}";
|
|
10417
11290
|
|
|
10418
|
-
let DuetVisuallyHidden$1 = class extends
|
|
11291
|
+
let DuetVisuallyHidden$1 = class extends H {
|
|
10419
11292
|
constructor() {
|
|
10420
11293
|
super();
|
|
10421
11294
|
this.__registerHost();
|
|
10422
|
-
|
|
11295
|
+
this.__attachShadow();
|
|
10423
11296
|
}
|
|
10424
11297
|
/**
|
|
10425
11298
|
* render() function
|
|
@@ -10432,39 +11305,43 @@ let DuetVisuallyHidden$1 = class extends HTMLElement {
|
|
|
10432
11305
|
};
|
|
10433
11306
|
|
|
10434
11307
|
globalScripts();
|
|
10435
|
-
const DuetAlert = /*@__PURE__*/proxyCustomElement(DuetAlert$1, [1,"duet-alert",{"theme":[1025],"accessibleLabelDefaults":[
|
|
11308
|
+
const DuetAlert = /*@__PURE__*/proxyCustomElement(DuetAlert$1, [1,"duet-alert",{"theme":[1025],"accessibleLabelDefaults":[1,"accessible-label-default"],"accessibleLabel":[1,"accessible-label"],"announcements":[4],"icon":[1],"autoDismiss":[2,"auto-dismiss"],"margin":[1],"padding":[1],"variation":[1],"dismissible":[4],"isDismissed":[32],"timeoutID":[32]}]);
|
|
10436
11309
|
const DuetBadge = /*@__PURE__*/proxyCustomElement(DuetBadge$1, [1,"duet-badge",{"theme":[1025],"variation":[1],"margin":[1]}]);
|
|
10437
|
-
const DuetButton = /*@__PURE__*/proxyCustomElement(DuetButton$1, [1,"duet-button",{"accessibleLabel":[1,"accessible-label"],"accessibleControls":[1,"accessible-controls"],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleExpanded":[4,"accessible-expanded"],"accessiblePressed":[4,"accessible-pressed"],"loading":[4],"variation":[1],"negative":[4],"theme":[1025],"margin":[1],"padding":[1],"wrapping":[1],"expand":[4],"fixed":[4],"disabled":[516],"name":[1],"value":[1],"identifier":[1],"submit":[516],"external":[4],"language":[1],"accessibleLabelExternalDefaults":[
|
|
11310
|
+
const DuetButton = /*@__PURE__*/proxyCustomElement(DuetButton$1, [1,"duet-button",{"accessibleLabel":[1,"accessible-label"],"accessibleControls":[1,"accessible-controls"],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleExpanded":[4,"accessible-expanded"],"accessiblePressed":[4,"accessible-pressed"],"loading":[4],"variation":[1],"negative":[4],"theme":[1025],"margin":[1],"padding":[1],"wrapping":[1],"expand":[4],"fixed":[4],"disabled":[516],"name":[1],"value":[1],"identifier":[1],"submit":[516],"external":[4],"language":[1],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"icon":[1],"color":[1],"iconRight":[4,"icon-right"],"iconSize":[1,"icon-size"],"size":[1],"iconOnly":[4,"icon-only"],"url":[513]}]);
|
|
10438
11311
|
const DuetCaption = /*@__PURE__*/proxyCustomElement(DuetCaption$1, [1,"duet-caption",{"theme":[1025],"margin":[1],"selected":[4],"size":[1]}]);
|
|
10439
11312
|
const DuetCard = /*@__PURE__*/proxyCustomElement(DuetCard$1, [1,"duet-card",{"accessibleLabel":[1,"accessible-label"],"heading":[1],"secondaryHeading":[1,"secondary-heading"],"variation":[1],"collapsible":[4],"open":[1540],"headingLevel":[1,"heading-level"],"icon":[1],"image":[1],"background":[1],"padding":[1],"margin":[1],"theme":[1025],"url":[1]}]);
|
|
10440
11313
|
const DuetCheckbox = /*@__PURE__*/proxyCustomElement(DuetCheckbox$1, [2,"duet-checkbox",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"margin":[1],"accessibleControls":[1,"accessible-controls"],"accessibleIndex":[1,"accessible-index"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"required":[4],"theme":[1025],"disabled":[516],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"role":[1],"checked":[1540],"value":[1537]}]);
|
|
10441
|
-
const DuetChoice = /*@__PURE__*/proxyCustomElement(DuetChoice$1, [6,"duet-choice",{"theme":[1025],"label":[1],"accessibleLabelInfoButtonDefaults":[
|
|
11314
|
+
const DuetChoice = /*@__PURE__*/proxyCustomElement(DuetChoice$1, [6,"duet-choice",{"theme":[1025],"label":[1],"accessibleLabelInfoButtonDefaults":[1,"accessible-label-info-default"],"accessibleLabelInfoButton":[1,"accessible-label-info-button"],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"caption":[1],"value":[1537],"type":[513],"name":[1],"checked":[1540],"collapsible":[4],"margin":[1],"icon":[1],"expand":[4],"padding":[1],"identifier":[1],"groupDirection":[1,"group-direction"],"groupDisabled":[4,"group-disabled"],"groupResponsive":[4,"group-responsive"],"disabled":[516],"required":[4],"infoLabelDefaults":[1,"accessible-label-info-default"],"infoLabel":[1,"info-label"],"isHovering":[32],"isInfoOpen":[32],"isBlurred":[32]},[[2,"blur","handleHostBlur"],[2,"keydown","handleHostKeyDown"],[2,"keyup","handleHostKeyUp"]]]);
|
|
10442
11315
|
const DuetChoiceGroup = /*@__PURE__*/proxyCustomElement(DuetChoiceGroup$1, [6,"duet-choice-group",{"direction":[1],"margin":[1],"theme":[1025],"error":[1],"name":[1],"label":[1],"labelHidden":[4,"label-hidden"],"caption":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"responsive":[4],"value":[1537],"disabled":[4]}]);
|
|
10443
11316
|
const DuetCollapsible = /*@__PURE__*/proxyCustomElement(DuetCollapsible$1, [1,"duet-collapsible",{"theme":[1025],"heading":[1],"headingWeight":[1,"heading-weight"],"headingSize":[1,"heading-size"],"headingLevel":[1,"heading-level"],"margin":[1],"open":[1540]}]);
|
|
10444
11317
|
const DuetCookieConsent = /*@__PURE__*/proxyCustomElement(DuetCookieConsent$1, [1,"duet-cookie-consent",{"accessibleLabel":[1,"accessible-label"],"theme":[1025]}]);
|
|
10445
|
-
const DuetDatePicker = /*@__PURE__*/proxyCustomElement(DuetDatePicker$1, [2,"duet-date-picker",{"theme":[1025],"expand":[4],"name":[1],"identifier":[1],"label":[1],"caption":[1],"margin":[1],"placeholder":[1],"echoPlaceholder":[1540,"echo-placeholder"],"disabled":[516],"
|
|
11318
|
+
const DuetDatePicker = /*@__PURE__*/proxyCustomElement(DuetDatePicker$1, [2,"duet-date-picker",{"theme":[1025],"expand":[4],"name":[1],"identifier":[1],"label":[1],"caption":[1],"margin":[1],"language":[1],"placeholderDefaults":[1,"placeholder-default"],"placeholder":[1],"echoPlaceholder":[1540,"echo-placeholder"],"disabled":[516],"error":[1],"labelHidden":[4,"label-hidden"],"role":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"required":[4],"direction":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"value":[1537],"min":[1],"max":[1],"validity":[1040],"open":[32],"focusedDay":[32],"inputValue":[32]},[[4,"click","handleDocumentClick"]]]);
|
|
10446
11319
|
const DuetDivider = /*@__PURE__*/proxyCustomElement(DuetDivider$1, [1,"duet-divider",{"theme":[1025],"margin":[1]}]);
|
|
11320
|
+
const DuetEditableTable = /*@__PURE__*/proxyCustomElement(DuetEditableTable$1, [1,"duet-editable-table",{"items":[1040],"groupsLabelDefaults":[16],"actionLabelDefaults":[16],"groups":[1],"actions":[1],"hideGroups":[4,"hide-table-labels"],"accessibleRole":[1,"accessible-role"],"theme":[1025],"tick":[32]}]);
|
|
11321
|
+
const DuetEditableTableButton = /*@__PURE__*/proxyCustomElement(DuetEditableTableButton$1, [2,"duet-editable-table-button",{"theme":[1025],"actions":[16],"uid":[1],"group":[1],"keyName":[1,"key-name"],"isHovering":[32]}]);
|
|
11322
|
+
const DuetEditableTableItem = /*@__PURE__*/proxyCustomElement(DuetEditableTableItem$1, [1,"duet-editable-table-item",{"theme":[1025],"actions":[16],"groupId":[1,"group-id"],"keyName":[1,"key-name"],"data":[1040],"isHovering":[32]}]);
|
|
10447
11323
|
const DuetEmptyState = /*@__PURE__*/proxyCustomElement(DuetEmptyState$1, [1,"duet-empty-state",{"theme":[1025],"icon":[1],"size":[1]}]);
|
|
10448
11324
|
const DuetFieldset = /*@__PURE__*/proxyCustomElement(DuetFieldset$1, [1,"duet-fieldset",{"theme":[1025],"margin":[1],"caption":[1],"label":[1],"error":[1],"labelHidden":[4,"label-hidden"],"hasTooltip":[32]}]);
|
|
10449
|
-
const DuetFooter = /*@__PURE__*/proxyCustomElement(DuetFooter$1, [1,"duet-footer",{"theme":[1025],"variation":[1],"margin":[1],"logoHref":[1,"logo-href"],"language":[1025],"items":[8],"accessibleLabelExternalDefaults":[
|
|
10450
|
-
const DuetGrid = /*@__PURE__*/proxyCustomElement(DuetGrid$1, [2,"duet-grid",{"responsive":[4],"breakpoint":[1],"direction":[1],"alignment":[1],"distribution":[1],"mobile":[1]}]);
|
|
11325
|
+
const DuetFooter = /*@__PURE__*/proxyCustomElement(DuetFooter$1, [1,"duet-footer",{"theme":[1025],"variation":[1],"margin":[1],"logoHref":[1,"logo-href"],"language":[1025],"items":[8],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"menu":[8],"processedItems":[32],"processedMenu":[32]}]);
|
|
11326
|
+
const DuetGrid = /*@__PURE__*/proxyCustomElement(DuetGrid$1, [2,"duet-grid",{"responsive":[4],"breakpoint":[1],"direction":[1],"alignment":[1],"distribution":[1],"mobile":[1],"distributeFormElement":[32]}]);
|
|
10451
11327
|
const DuetGridItem = /*@__PURE__*/proxyCustomElement(DuetGridItem$1, [2,"duet-grid-item",{"fill":[4],"maxWidth":[1,"max-width"],"minWidth":[1,"min-width"],"theme":[1025],"margin":[1],"responsive":[4],"breakpoint":[1]}]);
|
|
10452
|
-
const DuetHeader = /*@__PURE__*/proxyCustomElement(DuetHeader$1, [1,"duet-header",{"theme":[1025],"language":[1025],"
|
|
10453
|
-
const DuetHeading = /*@__PURE__*/proxyCustomElement(DuetHeading$1, [1,"duet-heading",{"level":[513],"margin":[1],"visualLevel":[1,"visual-level"],"border":[
|
|
10454
|
-
const DuetHero = /*@__PURE__*/proxyCustomElement(DuetHero$1, [1,"duet-hero",{"theme":[1025],"heading":[1],"preHeading":[1,"pre-heading"],"level":[1],"description":[1],"icon":[1],"iconSize":[1,"icon-size"],"iconRight":[4,"icon-right"],"categoryIcon":[1,"category-icon"],"categoryIconColor":[1,"category-icon-color"],"buttonLabel":[1,"button-label"],"language":[1025],"accessibleLabelExternalDefaults":[
|
|
11328
|
+
const DuetHeader = /*@__PURE__*/proxyCustomElement(DuetHeader$1, [1,"duet-header",{"theme":[1025],"language":[1025],"accessibleI18nLabelsDefaults":[1,"accessible-labels-default"],"accessibleI18nLabels":[16],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"accessibleLabelDefaults":[1,"accessible-label-default"],"accessibleLabel":[1,"accessible-label"],"user":[8],"logoHref":[1,"logo-href"],"currentHref":[1025,"current-href"],"skipToId":[1,"skip-to-id"],"items":[8],"region":[1],"session":[8],"back":[8],"contact":[1],"contactItems":[8,"contact-items"],"languageItems":[8,"language-items"],"isContactOpen":[32],"isLanguageOpen":[32],"isSlideOutOpen":[32],"processedItems":[32],"processedLanguageItems":[32],"processedContactItems":[32],"processedSession":[32],"processedUser":[32],"processedBack":[32]},[[8,"keyup","handleKeyUp"],[8,"keydown","handleKeyDown"],[4,"focus","handleDocumentClick"],[4,"click","handleDocumentClick"]]]);
|
|
11329
|
+
const DuetHeading = /*@__PURE__*/proxyCustomElement(DuetHeading$1, [1,"duet-heading",{"level":[513],"margin":[1],"visualLevel":[1,"visual-level"],"border":[8],"weight":[1],"color":[1],"theme":[1025],"hyphenate":[4]}]);
|
|
11330
|
+
const DuetHero = /*@__PURE__*/proxyCustomElement(DuetHero$1, [1,"duet-hero",{"theme":[1025],"heading":[1],"preHeading":[1,"pre-heading"],"level":[1],"description":[1],"icon":[1],"iconSize":[1,"icon-size"],"iconRight":[4,"icon-right"],"categoryIcon":[1,"category-icon"],"categoryIconColor":[1,"category-icon-color"],"buttonLabel":[1,"button-label"],"language":[1025],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"buttonUrl":[1,"button-url"],"buttonId":[1,"button-id"],"buttonData":[16],"textCenter":[4,"text-center"],"leftAlign":[4,"left-align"],"image":[1],"variation":[1],"back":[8],"listItems":[8,"list-items"],"actions":[8],"processedListItems":[32],"processedActions":[32],"processedBack":[32]}]);
|
|
10455
11331
|
const DuetIcon = /*@__PURE__*/proxyCustomElement(DuetIcon$1, [1,"duet-icon",{"theme":[1025],"icon":[1],"src":[1],"name":[1],"margin":[1],"responsive":[4],"color":[513],"background":[1],"size":[1],"outline":[1],"svgContent":[32]}]);
|
|
10456
11332
|
const DuetInput = /*@__PURE__*/proxyCustomElement(DuetInput$1, [6,"duet-input",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleAutocomplete":[1,"accessible-autocomplete"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"debounce":[2],"caption":[1],"echoPlaceholder":[4,"echo-placeholder"],"theme":[1025],"expand":[4],"disabled":[516],"identifier":[1],"margin":[1],"required":[4],"type":[1],"label":[1],"error":[1],"labelHidden":[4,"label-hidden"],"numericKeyboard":[4,"numeric-keyboard"],"name":[1],"pattern":[1],"maxlength":[2],"minlength":[2],"placeholder":[1],"component":[1],"role":[1],"icon":[1],"autoComplete":[1,"auto-complete"],"disallowPattern":[1,"disallow-pattern"],"value":[1025],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"]}]);
|
|
10457
11333
|
const DuetLabel = /*@__PURE__*/proxyCustomElement(DuetLabel$1, [6,"duet-label",{"theme":[1025],"for":[1],"margin":[1],"size":[1]}]);
|
|
10458
11334
|
const DuetLayout = /*@__PURE__*/proxyCustomElement(DuetLayout$1, [1,"duet-layout",{"sticky":[4],"margin":[1],"stickyDistance":[1,"sticky-distance"],"center":[4],"tabs":[4],"middle":[4]}]);
|
|
10459
|
-
const DuetLink = /*@__PURE__*/proxyCustomElement(DuetLink$1, [17,"duet-link",{"accessibleLabel":[1,"accessible-label"],"language":[1025],"accessibleLabelExternalDefaults":[
|
|
11335
|
+
const DuetLink = /*@__PURE__*/proxyCustomElement(DuetLink$1, [17,"duet-link",{"accessibleLabel":[1,"accessible-label"],"language":[1025],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"identifier":[1],"theme":[1025],"url":[513],"external":[4]}]);
|
|
10460
11336
|
const DuetList = /*@__PURE__*/proxyCustomElement(DuetList$1, [1,"duet-list",{"theme":[1025],"margin":[1],"padding":[1],"mobile":[1],"breakpoint":[1],"variation":[1],"labelWidth":[1,"label-width"]}]);
|
|
10461
11337
|
const DuetListItem = /*@__PURE__*/proxyCustomElement(DuetListItem$1, [1,"duet-list-item"]);
|
|
10462
11338
|
const DuetLogo = /*@__PURE__*/proxyCustomElement(DuetLogo$1, [1,"duet-logo",{"theme":[1025],"margin":[1],"inverse":[4],"size":[1],"href":[1537],"language":[1537]}]);
|
|
10463
|
-
const DuetModal = /*@__PURE__*/proxyCustomElement(DuetModal$1, [1,"duet-modal",{"language":[1025],"
|
|
11339
|
+
const DuetModal = /*@__PURE__*/proxyCustomElement(DuetModal$1, [1,"duet-modal",{"language":[1025],"accessibleCloseLabelDefaults":[1,"accessible-close-label-default"],"accessibleCloseLabel":[1,"accessible-close-label"],"size":[1],"gutterSize":[1,"gutter-size"],"theme":[1025],"heading":[1],"headingLevel":[1,"heading-level"],"icon":[1],"color":[1],"active":[1540],"open":[32]},[[8,"keyup","handleKeyUp"]]]);
|
|
10464
11340
|
const DuetNotification = /*@__PURE__*/proxyCustomElement(DuetNotification$1, [1,"duet-notification",{"language":[1],"accessibleLabelUnreadDefaults":[16],"accessibleLabelUnread":[1,"accessible-label-unread"],"url":[1],"date":[1],"highlight":[4],"external":[4],"theme":[1025]}]);
|
|
10465
|
-
const DuetNotificationDrawer = /*@__PURE__*/proxyCustomElement(DuetNotificationDrawer$1, [1,"duet-notification-drawer",{"icon":[1],"label":[1],"language":[1],"accessibleLabelNotificationsDefaults":[
|
|
10466
|
-
const DuetNumberInput = /*@__PURE__*/proxyCustomElement(DuetNumberInput$1, [2,"duet-number-input",{"language":[1025],"locale":[1],"unit":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleLive":[1,"accessible-live"],"accessibleLiveEnabled":[4,"accessible-live-enabled"],"accessibleAdd":[1,"accessible-add"],"accessibleSubtract":[1,"accessible-subtract"],"theme":[1025],"margin":[1],"expand":[4],"identifier":[1],"min":[2],"label":[1],"labelHidden":[4,"label-hidden"],"max":[2],"name":[1],"error":[1],"tooltip":[1],"step":[2],"rounding":[4],"role":[1],"disabled":[516],"required":[4],"value":[1025],"focusedValue":[32]}]);
|
|
10467
|
-
const DuetParagraph = /*@__PURE__*/proxyCustomElement(DuetParagraph$1, [1,"duet-paragraph",{"theme":[1025],"margin":[1],"size":[1],"variation":[1],"color":[1]}]);
|
|
11341
|
+
const DuetNotificationDrawer = /*@__PURE__*/proxyCustomElement(DuetNotificationDrawer$1, [1,"duet-notification-drawer",{"icon":[1],"label":[1],"language":[1],"accessibleLabelNotificationsDefaults":[1,"accessible-label-notification-default"],"accessibleLabelNotifications":[1,"accessible-label-notifications"],"badge":[4],"theme":[1025],"direction":[1],"isOpen":[32],"hasNotifications":[32]},[[6,"focus","handleClickFocusOutside"],[6,"click","handleClickFocusOutside"]]]);
|
|
11342
|
+
const DuetNumberInput = /*@__PURE__*/proxyCustomElement(DuetNumberInput$1, [2,"duet-number-input",{"language":[1025],"locale":[1],"unit":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleLiveDefaults":[1,"accessible-live-default"],"accessibleLive":[1,"accessible-live"],"accessibleLiveEnabled":[4,"accessible-live-enabled"],"accessibleAddDefaults":[1,"accessible-add-default"],"accessibleAdd":[1,"accessible-add"],"accessibleSubtractDefaults":[1,"accessible-subtract-defaults"],"accessibleSubtract":[1,"accessible-subtract"],"theme":[1025],"margin":[1],"expand":[4],"identifier":[1],"min":[2],"labelDefaults":[1,"label-default"],"label":[1],"labelHidden":[4,"label-hidden"],"max":[2],"name":[1],"error":[1],"tooltip":[1],"step":[2],"rounding":[4],"role":[1],"disabled":[516],"required":[4],"value":[1025],"focusedValue":[32]}]);
|
|
11343
|
+
const DuetParagraph = /*@__PURE__*/proxyCustomElement(DuetParagraph$1, [1,"duet-paragraph",{"theme":[1025],"margin":[1],"size":[1],"weight":[1],"variation":[1],"color":[1]}]);
|
|
11344
|
+
const DuetProgress = /*@__PURE__*/proxyCustomElement(DuetProgress$1, [0,"duet-progress",{"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleLabel":[1,"accessible-label"],"accessibleLabelUploadDefaults":[1,"accessible-label-upload-defaults"],"accessibleLabelUpload":[1,"accessible-label-upload"],"progress":[1538],"caption":[1],"height":[1],"theme":[1025]}]);
|
|
10468
11345
|
const DuetRadio = /*@__PURE__*/proxyCustomElement(DuetRadio$1, [2,"duet-radio",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleIndex":[1,"accessible-index"],"margin":[1],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"theme":[1025],"disabled":[516],"required":[4],"blockEvents":[4,"block-events"],"identifier":[1],"label":[1],"name":[1],"role":[1],"groupDisabled":[4,"group-disabled"],"groupDirection":[1,"group-direction"],"groupResponsive":[4,"group-responsive"],"checked":[1540],"value":[1537]}]);
|
|
10469
11346
|
const DuetRadioGroup = /*@__PURE__*/proxyCustomElement(DuetRadioGroup$1, [6,"duet-radio-group",{"direction":[1],"margin":[1],"theme":[1025],"error":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"name":[1],"label":[1],"labelHidden":[4,"label-hidden"],"caption":[1],"responsive":[4],"value":[1537],"disabled":[4]}]);
|
|
10470
11347
|
const DuetRangeSlider = /*@__PURE__*/proxyCustomElement(DuetRangeSlider$1, [2,"duet-range-slider",{"theme":[1025],"margin":[1],"expand":[4],"identifier":[1],"name":[1],"required":[4],"disabled":[516],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"min":[2],"label":[1],"labelHidden":[4,"label-hidden"],"unit":[1],"max":[2],"step":[2],"locale":[1],"value":[1026],"debounce":[2]}]);
|
|
@@ -10474,13 +11351,14 @@ const DuetSpinner = /*@__PURE__*/proxyCustomElement(DuetSpinner$1, [1,"duet-spin
|
|
|
10474
11351
|
const DuetStep = /*@__PURE__*/proxyCustomElement(DuetStep$1, [6,"duet-step",{"theme":[1025],"heading":[1],"headingLevel":[1,"heading-level"],"stepIndex":[2,"step-index"],"state":[1],"roundedTop":[4,"rounded-top"],"roundedBottom":[4,"rounded-bottom"]}]);
|
|
10475
11352
|
const DuetStepper = /*@__PURE__*/proxyCustomElement(DuetStepper$1, [1,"duet-stepper",{"theme":[1025],"accessibleLive":[1,"accessible-live"],"margin":[1],"backDisabled":[4,"back-disabled"],"selected":[514]},[[0,"duetStepClick","onDuetStepClick"]]]);
|
|
10476
11353
|
const DuetTab = /*@__PURE__*/proxyCustomElement(DuetTab$1, [6,"duet-tab",{"label":[513],"selected":[516]}]);
|
|
10477
|
-
const DuetTabGroup = /*@__PURE__*/proxyCustomElement(DuetTabGroup$1, [6,"duet-tab-group",{"theme":[1025],"variation":[1],"language":[1025],"label":[1],"labelHidden":[4,"label-hidden"],"margin":[1],"padding":[1],"tabs":[32],"selected":[32]}]);
|
|
11354
|
+
const DuetTabGroup = /*@__PURE__*/proxyCustomElement(DuetTabGroup$1, [6,"duet-tab-group",{"theme":[1025],"variation":[1],"language":[1025],"labelDefaults":[1,"label-default"],"label":[1],"labelHidden":[4,"label-hidden"],"margin":[1],"padding":[1],"tabs":[32],"selected":[32]}]);
|
|
10478
11355
|
const DuetTable = /*@__PURE__*/proxyCustomElement(DuetTable$1, [4,"duet-table",{"theme":[1025],"margin":[1],"variation":[1],"sticky":[4],"stickyDistance":[1,"sticky-distance"],"breakpoint":[1],"matchesBreakpoint":[32]}]);
|
|
10479
11356
|
const DuetTextarea = /*@__PURE__*/proxyCustomElement(DuetTextarea$1, [2,"duet-textarea",{"margin":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleAutocomplete":[1,"accessible-autocomplete"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"theme":[1025],"expand":[4],"disabled":[516],"identifier":[1],"required":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"placeholder":[1],"caption":[1],"echoPlaceholder":[4,"echo-placeholder"],"maxlength":[2],"minlength":[2],"error":[1],"role":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"value":[1025],"disallowPattern":[1,"disallow-pattern"],"counter":[4],"counterLabel":[1,"counter-label"]}]);
|
|
10480
11357
|
const DuetToggle = /*@__PURE__*/proxyCustomElement(DuetToggle$1, [2,"duet-toggle",{"theme":[1025],"margin":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"label":[1],"required":[4],"disabled":[516],"checked":[1540],"value":[1537],"identifier":[1],"name":[1],"role":[1]}]);
|
|
10481
|
-
const DuetTooltip = /*@__PURE__*/proxyCustomElement(DuetTooltip$1, [1,"duet-tooltip",{"theme":[1025],"language":[1025],"accessibleLabel":[1,"accessible-label"],"accessibleInputLabel":[1,"accessible-input-label"],"accessibleCloseLabel":[1,"accessible-close-label"],"label":[1],"breakpoint":[1],"direction":[1],"positionVertical":[513,"position-vertical"],"positionHorizontal":[513,"position-horizontal"],"active":[1540],"openDown":[32]},[[9,"scroll","onScroll"],[4,"click","handleDocumentClick"]]]);
|
|
10482
|
-
const DuetTray = /*@__PURE__*/proxyCustomElement(DuetTray$1, [1,"duet-tray",{"language":[1025],"accessibleCloseLabel":[1,"accessible-close-label"],"accessibleOpenLabel":[1,"accessible-open-label"],"theme":[1025],"active":[516],"autoHide":[4,"auto-hide"],"responsive":[4],"expanded":[32],"hiddenState":[32]},[[9,"scroll","getFrame"],[16,"click","handleBodyClick"]]]);
|
|
10483
|
-
const DuetUpload = /*@__PURE__*/proxyCustomElement(DuetUpload$1, [1,"duet-upload",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"external":[4],"uri":[1],"caption":[1],"
|
|
11358
|
+
const DuetTooltip = /*@__PURE__*/proxyCustomElement(DuetTooltip$1, [1,"duet-tooltip",{"theme":[1025],"language":[1025],"accessibleLabelDefault":[1,"accessible-label-default"],"accessibleLabel":[1,"accessible-label"],"accessibleInputLabel":[1,"accessible-input-label"],"accessibleCloseLabelDefault":[1,"accessible-close-label-default"],"accessibleCloseLabel":[1,"accessible-close-label"],"label":[1],"breakpoint":[1],"direction":[1],"positionVertical":[513,"position-vertical"],"positionHorizontal":[513,"position-horizontal"],"active":[1540],"openDown":[32]},[[9,"scroll","onScroll"],[4,"click","handleDocumentClick"]]]);
|
|
11359
|
+
const DuetTray = /*@__PURE__*/proxyCustomElement(DuetTray$1, [1,"duet-tray",{"language":[1025],"accessibleCloseLabelDefaults":[1,"accessible-close-label-default"],"accessibleCloseLabel":[1,"accessible-close-label"],"accessibleOpenLabelDefaults":[1,"accessible-open-label-default"],"accessibleOpenLabel":[1,"accessible-open-label"],"theme":[1025],"active":[516],"autoHide":[4,"auto-hide"],"responsive":[4],"expanded":[32],"hiddenState":[32]},[[9,"scroll","getFrame"],[16,"click","handleBodyClick"]]]);
|
|
11360
|
+
const DuetUpload = /*@__PURE__*/proxyCustomElement(DuetUpload$1, [1,"duet-upload",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"external":[4],"hideButton":[4,"hide-upload-button"],"actions":[1],"uri":[1],"showLinks":[4,"show-links"],"caption":[1],"statusLabelDefaults":[1,"status-label-default"],"statusMessageLabel":[16],"buttonLabelDefaults":[1,"button-label-default"],"buttonLabel":[1,"button-label"],"accessibleButtonLabel":[1,"accessible-button-label"],"theme":[1025],"disabled":[516],"identifier":[1],"margin":[1],"required":[4],"groups":[1],"hideGroups":[4,"hide-table-labels"],"files":[1040],"valid":[1540],"labelDefaults":[1,"label-default"],"label":[1],"descriptionDefaults":[1,"description-default"],"description":[1],"fileListEmptyDefaults":[1,"list-empty-default"],"fileListEmpty":[1,"file-list-empty"],"error":[1],"name":[1],"maxBytes":[2,"max-bytes"],"maxBytesTotal":[2,"max-bytes-total"],"maxFiles":[2,"max-files"],"allowedExtensions":[1,"allowed-extensions"],"allowedMimetypes":[1,"allowed-mimetypes"],"multiple":[4],"limitSelection":[4,"limit-selection"],"value":[1025],"tick":[32]}]);
|
|
11361
|
+
const DuetUploadAriaStatus = /*@__PURE__*/proxyCustomElement(DuetUploadAriaStatus$1, [1,"duet-upload-aria-status",{"statusMessageLabel":[16],"accessibleAriaLive":[1,"accessible-aria-live"],"valid":[2],"total":[2],"invalid":[2],"inprogress":[2],"statusMessage":[32]}]);
|
|
10484
11362
|
const DuetVisuallyHidden = /*@__PURE__*/proxyCustomElement(DuetVisuallyHidden$1, [1,"duet-visually-hidden"]);
|
|
10485
11363
|
const defineCustomElements = (opts) => {
|
|
10486
11364
|
if (typeof customElements !== 'undefined') {
|
|
@@ -10497,6 +11375,9 @@ const defineCustomElements = (opts) => {
|
|
|
10497
11375
|
DuetCookieConsent,
|
|
10498
11376
|
DuetDatePicker,
|
|
10499
11377
|
DuetDivider,
|
|
11378
|
+
DuetEditableTable,
|
|
11379
|
+
DuetEditableTableButton,
|
|
11380
|
+
DuetEditableTableItem,
|
|
10500
11381
|
DuetEmptyState,
|
|
10501
11382
|
DuetFieldset,
|
|
10502
11383
|
DuetFooter,
|
|
@@ -10518,6 +11399,7 @@ const defineCustomElements = (opts) => {
|
|
|
10518
11399
|
DuetNotificationDrawer,
|
|
10519
11400
|
DuetNumberInput,
|
|
10520
11401
|
DuetParagraph,
|
|
11402
|
+
DuetProgress,
|
|
10521
11403
|
DuetRadio,
|
|
10522
11404
|
DuetRadioGroup,
|
|
10523
11405
|
DuetRangeSlider,
|
|
@@ -10534,6 +11416,7 @@ const defineCustomElements = (opts) => {
|
|
|
10534
11416
|
DuetTooltip,
|
|
10535
11417
|
DuetTray,
|
|
10536
11418
|
DuetUpload,
|
|
11419
|
+
DuetUploadAriaStatus,
|
|
10537
11420
|
DuetVisuallyHidden
|
|
10538
11421
|
].forEach(cmp => {
|
|
10539
11422
|
if (!customElements.get(cmp.is)) {
|
|
@@ -10544,7 +11427,7 @@ const defineCustomElements = (opts) => {
|
|
|
10544
11427
|
};
|
|
10545
11428
|
|
|
10546
11429
|
/*
|
|
10547
|
-
Stencil Client Platform v2.
|
|
11430
|
+
Stencil Client Platform v2.11.0 | MIT Licensed | https://stenciljs.com
|
|
10548
11431
|
*/
|
|
10549
11432
|
/**
|
|
10550
11433
|
* @license
|
|
@@ -10612,6 +11495,7 @@ const extractCommentsWithHash = (input) => {
|
|
|
10612
11495
|
};
|
|
10613
11496
|
const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
|
10614
11497
|
const _curlyRe = /([{}])/g;
|
|
11498
|
+
const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
|
|
10615
11499
|
const OPEN_CURLY = '{';
|
|
10616
11500
|
const CLOSE_CURLY = '}';
|
|
10617
11501
|
const BLOCK_PLACEHOLDER = '%BLOCK%';
|
|
@@ -10764,17 +11648,18 @@ const selectorNeedsScoping = (selector, scopeSelector) => {
|
|
|
10764
11648
|
const re = makeScopeMatcher(scopeSelector);
|
|
10765
11649
|
return !re.test(selector);
|
|
10766
11650
|
};
|
|
11651
|
+
const injectScopingSelector = (selector, scopingSelector) => {
|
|
11652
|
+
return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
|
|
11653
|
+
return before + scopingSelector + colon + after;
|
|
11654
|
+
});
|
|
11655
|
+
};
|
|
10767
11656
|
const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
|
|
10768
11657
|
// In Android browser, the lastIndex is not reset when the regex is used in String.replace()
|
|
10769
11658
|
_polyfillHostRe.lastIndex = 0;
|
|
10770
11659
|
if (_polyfillHostRe.test(selector)) {
|
|
10771
11660
|
const replaceBy = `.${hostSelector}`;
|
|
10772
11661
|
return selector
|
|
10773
|
-
.replace(_polyfillHostNoCombinatorRe, (_, selector) =>
|
|
10774
|
-
return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
|
|
10775
|
-
return before + replaceBy + colon + after;
|
|
10776
|
-
});
|
|
10777
|
-
})
|
|
11662
|
+
.replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
|
|
10778
11663
|
.replace(_polyfillHostRe, replaceBy + ' ');
|
|
10779
11664
|
}
|
|
10780
11665
|
return scopeSelector + ' ' + selector;
|
|
@@ -10795,10 +11680,7 @@ const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
|
|
|
10795
11680
|
// remove :host since it should be unnecessary
|
|
10796
11681
|
const t = p.replace(_polyfillHostRe, '');
|
|
10797
11682
|
if (t.length > 0) {
|
|
10798
|
-
|
|
10799
|
-
if (matches) {
|
|
10800
|
-
scopedP = matches[1] + className + matches[2] + matches[3];
|
|
10801
|
-
}
|
|
11683
|
+
scopedP = injectScopingSelector(t, className);
|
|
10802
11684
|
}
|
|
10803
11685
|
}
|
|
10804
11686
|
return scopedP;
|
|
@@ -10936,4 +11818,4 @@ const shadowCss = /*#__PURE__*/Object.freeze({
|
|
|
10936
11818
|
scopeCss: scopeCss
|
|
10937
11819
|
});
|
|
10938
11820
|
|
|
10939
|
-
export { DuetAlert, DuetBadge, DuetButton, DuetCaption, DuetCard, DuetCheckbox, DuetChoice, DuetChoiceGroup, DuetCollapsible, DuetCookieConsent, DuetDatePicker, DuetDivider, DuetEmptyState, DuetFieldset, DuetFooter, DuetGrid, DuetGridItem, DuetHeader, DuetHeading, DuetHero, DuetIcon, DuetInput, DuetLabel, DuetLayout, DuetLink, DuetList, DuetListItem, DuetLogo, DuetModal, DuetNotification, DuetNotificationDrawer, DuetNumberInput, DuetParagraph, DuetRadio, DuetRadioGroup, DuetRangeSlider, DuetSelect, DuetSpacer, DuetSpinner, DuetStep, DuetStepper, DuetTab, DuetTabGroup, DuetTable, DuetTextarea, DuetToggle, DuetTooltip, DuetTray, DuetUpload, DuetVisuallyHidden, defineCustomElements, setAssetPath, setPlatformOptions };
|
|
11821
|
+
export { DuetAlert, DuetBadge, DuetButton, DuetCaption, DuetCard, DuetCheckbox, DuetChoice, DuetChoiceGroup, DuetCollapsible, DuetCookieConsent, DuetDatePicker, DuetDivider, DuetEditableTable, DuetEditableTableButton, DuetEditableTableItem, DuetEmptyState, DuetFieldset, DuetFooter, DuetGrid, DuetGridItem, DuetHeader, DuetHeading, DuetHero, DuetIcon, DuetInput, DuetLabel, DuetLayout, DuetLink, DuetList, DuetListItem, DuetLogo, DuetModal, DuetNotification, DuetNotificationDrawer, DuetNumberInput, DuetParagraph, DuetProgress, DuetRadio, DuetRadioGroup, DuetRangeSlider, DuetSelect, DuetSpacer, DuetSpinner, DuetStep, DuetStepper, DuetTab, DuetTabGroup, DuetTable, DuetTextarea, DuetToggle, DuetTooltip, DuetTray, DuetUpload, DuetUploadAriaStatus, DuetVisuallyHidden, defineCustomElements, setAssetPath, setPlatformOptions };
|