@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
package/hydrate/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
/*!
|
|
9
|
-
Stencil Mock Doc v2.
|
|
9
|
+
Stencil Mock Doc v2.11.0 | MIT Licensed | https://stenciljs.com
|
|
10
10
|
*/
|
|
11
11
|
const CONTENT_REF_ID = 'r';
|
|
12
12
|
const ORG_LOCATION_ID = 'o';
|
|
@@ -4702,6 +4702,7 @@ function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResu
|
|
|
4702
4702
|
|
|
4703
4703
|
const NAMESPACE = 'duet';
|
|
4704
4704
|
const BUILD = /* duet */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: false, cssAnnotations: true, cssVarShim: false, devTools: false, disconnectedCallback: true, dynamicImportShim: false, element: false, event: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, safari10: false, scoped: true, scriptDataOpts: false, shadowDelegatesFocus: true, shadowDom: true, shadowDomShim: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
4705
|
+
const Env = /* duet */ {"cdnURILocal":"http://0.0.0.0:3334","cdnURIProd":"https://cdn.duetds.com/api","duetIconVersion":"2.2.3"};
|
|
4705
4706
|
|
|
4706
4707
|
const TAB_KEY = 9;
|
|
4707
4708
|
var appGlobalScript = () => {
|
|
@@ -5321,7 +5322,8 @@ const callRender = (e, t, o) => {
|
|
|
5321
5322
|
s.attributeChangedCallback = function(e, t, n) {
|
|
5322
5323
|
plt.jmp((() => {
|
|
5323
5324
|
const t = o.get(e);
|
|
5324
|
-
this.hasOwnProperty(t)
|
|
5325
|
+
if (this.hasOwnProperty(t)) n = this[t], delete this[t]; else if (s.hasOwnProperty(t) && "number" == typeof this[t] && this[t] == n) return;
|
|
5326
|
+
this[t] = (null !== n || "boolean" != typeof this[t]) && n;
|
|
5325
5327
|
}));
|
|
5326
5328
|
}, e.observedAttributes = n.filter((([e, t]) => 15 & t[0])).map((([e, n]) => {
|
|
5327
5329
|
const s = n[1] || e;
|
|
@@ -5538,6 +5540,51 @@ const cmpModules = new Map, getModule = e => {
|
|
|
5538
5540
|
isTesting: !1
|
|
5539
5541
|
}, styles = new Map;
|
|
5540
5542
|
|
|
5543
|
+
function isObject(maybeObj) {
|
|
5544
|
+
return Object.prototype.toString.call(maybeObj) === "[object Object]";
|
|
5545
|
+
}
|
|
5546
|
+
const parsePossibleJSON = (maybeJSON) => {
|
|
5547
|
+
if (Array.isArray(maybeJSON) || isObject(maybeJSON)) {
|
|
5548
|
+
return maybeJSON;
|
|
5549
|
+
}
|
|
5550
|
+
if (typeof maybeJSON === "string") {
|
|
5551
|
+
try {
|
|
5552
|
+
return JSON.parse(maybeJSON);
|
|
5553
|
+
}
|
|
5554
|
+
catch (e) {
|
|
5555
|
+
console.warn(e);
|
|
5556
|
+
}
|
|
5557
|
+
}
|
|
5558
|
+
// undefined is not a type in JSON,
|
|
5559
|
+
// so we use it here to signal invalid input
|
|
5560
|
+
return undefined;
|
|
5561
|
+
};
|
|
5562
|
+
/**
|
|
5563
|
+
* Format string, via simplistic sprintf equivalent
|
|
5564
|
+
* @example String.format('{0} is super, but {1} is best! {{0}}', 'Duet', 'Coffee'); -> "Duet is super, but Coffee ist best! {0}"
|
|
5565
|
+
*
|
|
5566
|
+
*/
|
|
5567
|
+
// @ts-ignore
|
|
5568
|
+
if (!String.format) {
|
|
5569
|
+
// @ts-ignore
|
|
5570
|
+
String.format = function (format) {
|
|
5571
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
5572
|
+
return format.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
|
|
5573
|
+
return curlyBrack == "{{" ? "{" : curlyBrack == "}}" ? "}" : args[index];
|
|
5574
|
+
});
|
|
5575
|
+
};
|
|
5576
|
+
}
|
|
5577
|
+
const MATCH_DISALLOWED_CHARS = /[^a-z0-9áéíóúñüöäå \.,_-]/gim;
|
|
5578
|
+
function sanitizeString$1(string) {
|
|
5579
|
+
return string.replace(MATCH_DISALLOWED_CHARS, "").trim();
|
|
5580
|
+
}
|
|
5581
|
+
const convertHtmlQuotes = string => {
|
|
5582
|
+
if (typeof string === "string") {
|
|
5583
|
+
return string.replace(/"/g, '"').replace(/'/g, '"');
|
|
5584
|
+
}
|
|
5585
|
+
return string;
|
|
5586
|
+
};
|
|
5587
|
+
|
|
5541
5588
|
const localeLookUpTable = {
|
|
5542
5589
|
fi: "fi-FI",
|
|
5543
5590
|
en: "en-GB",
|
|
@@ -5552,13 +5599,13 @@ const localeMonetarySignifierLookUpTable = {
|
|
|
5552
5599
|
};
|
|
5553
5600
|
const defLanguageArray = ["fi", "en", "sv"];
|
|
5554
5601
|
const defaultLanguage = "fi";
|
|
5555
|
-
const
|
|
5556
|
-
? document.documentElement.lang.toLowerCase()
|
|
5557
|
-
|
|
5602
|
+
const getCurrentLanguage = () => {
|
|
5603
|
+
return document.documentElement.lang ? document.documentElement.lang.toLowerCase() : defaultLanguage;
|
|
5604
|
+
};
|
|
5558
5605
|
const isOfTypeLanguage = (keyInput) => {
|
|
5559
5606
|
return defLanguageArray.includes(keyInput);
|
|
5560
5607
|
};
|
|
5561
|
-
const checkForLanguage = (languageString =
|
|
5608
|
+
const checkForLanguage = (languageString = getCurrentLanguage()) => {
|
|
5562
5609
|
if (isOfTypeLanguage(languageString)) {
|
|
5563
5610
|
return languageString;
|
|
5564
5611
|
}
|
|
@@ -5572,7 +5619,7 @@ const checkForLanguage = (languageString = currentLanguage) => {
|
|
|
5572
5619
|
* @param {string} lang=fi - "fi" | "sv" | "en"
|
|
5573
5620
|
* @default {string} "fi"
|
|
5574
5621
|
*/
|
|
5575
|
-
const getLanguage = (languageString =
|
|
5622
|
+
const getLanguage = (languageString = getCurrentLanguage()) => checkForLanguage(languageString);
|
|
5576
5623
|
/**
|
|
5577
5624
|
* Returns the current language and locale
|
|
5578
5625
|
* If language is not fi|sv|en it will default to "fi"
|
|
@@ -5590,21 +5637,37 @@ const getLocale = (lang) => {
|
|
|
5590
5637
|
}
|
|
5591
5638
|
throw new Error(`Locale for "${lang}" not found`);
|
|
5592
5639
|
};
|
|
5640
|
+
/**
|
|
5641
|
+
* Takes any json object that is passed and/or htmlencoded and converts it to proper json
|
|
5642
|
+
*/
|
|
5643
|
+
const sanitizeString = (string) => {
|
|
5644
|
+
const argIsString = typeof string === "string";
|
|
5645
|
+
if (argIsString) {
|
|
5646
|
+
try {
|
|
5647
|
+
return JSON.parse(convertHtmlQuotes(string));
|
|
5648
|
+
}
|
|
5649
|
+
catch (e) {
|
|
5650
|
+
console.log("sanitizeString received a string, that didnt parse to json object", string, e);
|
|
5651
|
+
}
|
|
5652
|
+
}
|
|
5653
|
+
return string;
|
|
5654
|
+
};
|
|
5593
5655
|
/**
|
|
5594
5656
|
* Returns the current string / object from a given translation object
|
|
5595
5657
|
* If language is not fi|sv|en it will default to "fi"
|
|
5596
5658
|
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
5597
|
-
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"}
|
|
5659
|
+
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"} | string will get JSON.parsed
|
|
5598
5660
|
* @param {boolean} languageOverride = false - in case you want to override the actual language set in html tag
|
|
5599
5661
|
* @default {object} {locale: "fi-FI", money: "€"}
|
|
5600
|
-
* @returns {(string|Object)} given example contains {fi:"something"} and
|
|
5662
|
+
* @returns {(string|Object)} given example contains {fi:"something"} and language===fi this will return "something"
|
|
5601
5663
|
*/
|
|
5602
5664
|
const getLocaleString = (langObject, languageOverride) => {
|
|
5665
|
+
const obj = sanitizeString(langObject);
|
|
5603
5666
|
if (languageOverride) {
|
|
5604
|
-
return
|
|
5667
|
+
return obj[checkForLanguage(languageOverride)];
|
|
5605
5668
|
}
|
|
5606
5669
|
else {
|
|
5607
|
-
return
|
|
5670
|
+
return obj[getLanguage()];
|
|
5608
5671
|
}
|
|
5609
5672
|
};
|
|
5610
5673
|
|
|
@@ -5632,6 +5695,7 @@ class DuetAlert {
|
|
|
5632
5695
|
/**
|
|
5633
5696
|
* Property to change languageDefaults on the component.
|
|
5634
5697
|
* normally you would handle these strings on an application level and override @accessibleLabel when needed
|
|
5698
|
+
* @default {fi: "Sulje viesti", sv: "Stäng meddelandet", en: "Close the message"}
|
|
5635
5699
|
*/
|
|
5636
5700
|
this.accessibleLabelDefaults = {
|
|
5637
5701
|
fi: "Sulje viesti",
|
|
@@ -5714,7 +5778,7 @@ class DuetAlert {
|
|
|
5714
5778
|
"$tagName$": "duet-alert",
|
|
5715
5779
|
"$members$": {
|
|
5716
5780
|
"theme": [1025],
|
|
5717
|
-
"accessibleLabelDefaults": [
|
|
5781
|
+
"accessibleLabelDefaults": [1, "accessible-label-default"],
|
|
5718
5782
|
"accessibleLabel": [1, "accessible-label"],
|
|
5719
5783
|
"announcements": [4],
|
|
5720
5784
|
"icon": [1],
|
|
@@ -5732,7 +5796,7 @@ class DuetAlert {
|
|
|
5732
5796
|
}; }
|
|
5733
5797
|
}
|
|
5734
5798
|
|
|
5735
|
-
const duetBadgeCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-badge,*.sc-duet-badge::after,*.sc-duet-badge::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-badge-h{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*/.sc-duet-badge-h:last-child,.sc-duet-badge-h:last-of-type{margin-right:0 !important}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-badge-h{margin:0 !important}/*!@.duet-badge*/.duet-badge.sc-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*/.duet-badge.duet-p-0.sc-duet-badge{padding:0 !important}/*!@.duet-badge.duet-m-0*/.duet-badge.duet-m-0.sc-duet-badge{margin:0 !important}/*!@.duet-badge.duet-theme-turva*/.duet-badge.duet-theme-turva.sc-duet-badge{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*/.duet-badge.warning.sc-duet-badge{background:#fef3df}/*!@.duet-badge.warning.duet-theme-turva*/.duet-badge.warning.duet-theme-turva.sc-duet-badge{background:#fef1db}/*!@.duet-badge.danger*/.duet-badge.danger.sc-duet-badge{background:#fce9ef}/*!@.duet-badge.danger.duet-theme-turva*/.duet-badge.danger.duet-theme-turva.sc-duet-badge{background:#fceae7}/*!@.duet-badge.success*/.duet-badge.success.sc-duet-badge{background:#e6f3ef}/*!@.duet-badge.success.duet-theme-turva*/.duet-badge.success.duet-theme-turva.sc-duet-badge{background:#e6f3ed}";
|
|
5799
|
+
const duetBadgeCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-badge,*.sc-duet-badge::after,*.sc-duet-badge::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-badge-h{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*/.sc-duet-badge-h:last-child,.sc-duet-badge-h:last-of-type{margin-right:0 !important}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-badge-h{margin:0 !important}/*!@.duet-badge*/.duet-badge.sc-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*/.duet-badge.duet-p-0.sc-duet-badge{padding:0 !important}/*!@.duet-badge.duet-m-0*/.duet-badge.duet-m-0.sc-duet-badge{margin:0 !important}/*!@.duet-badge.duet-theme-turva*/.duet-badge.duet-theme-turva.sc-duet-badge{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*/.duet-badge.warning.sc-duet-badge{background:#fef3df}/*!@.duet-badge.warning.duet-theme-turva*/.duet-badge.warning.duet-theme-turva.sc-duet-badge{background:#fef1db}/*!@.duet-badge.danger*/.duet-badge.danger.sc-duet-badge{background:#fce9ef}/*!@.duet-badge.danger.duet-theme-turva*/.duet-badge.danger.duet-theme-turva.sc-duet-badge{background:#fceae7}/*!@.duet-badge.success*/.duet-badge.success.sc-duet-badge{background:#e6f3ef}/*!@.duet-badge.success.duet-theme-turva*/.duet-badge.success.duet-theme-turva.sc-duet-badge{background:#e6f3ed}";
|
|
5736
5800
|
|
|
5737
5801
|
class DuetBadge {
|
|
5738
5802
|
constructor(hostRef) {
|
|
@@ -5903,6 +5967,7 @@ const sizeTappableSquare = "48px";
|
|
|
5903
5967
|
const sizeIconXSmall = "16px";
|
|
5904
5968
|
const sizeIconXxxSmall = "7px";
|
|
5905
5969
|
const sizeButtonBorder = "2px";
|
|
5970
|
+
const sizeButtonTinyBorder = "1px";
|
|
5906
5971
|
const sizeIconMedium = "24px";
|
|
5907
5972
|
const sizeIconSmall = "20px";
|
|
5908
5973
|
const opacity85 = "0.85";
|
|
@@ -6052,6 +6117,7 @@ var tokens$2 = /*#__PURE__*/Object.freeze({
|
|
|
6052
6117
|
sizeIconXSmall: sizeIconXSmall,
|
|
6053
6118
|
sizeIconXxxSmall: sizeIconXxxSmall,
|
|
6054
6119
|
sizeButtonBorder: sizeButtonBorder,
|
|
6120
|
+
sizeButtonTinyBorder: sizeButtonTinyBorder,
|
|
6055
6121
|
sizeIconMedium: sizeIconMedium,
|
|
6056
6122
|
sizeIconSmall: sizeIconSmall,
|
|
6057
6123
|
opacity85: opacity85,
|
|
@@ -6179,7 +6245,7 @@ class DuetButton {
|
|
|
6179
6245
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
6180
6246
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
6181
6247
|
*/
|
|
6182
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
6248
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
6183
6249
|
/**
|
|
6184
6250
|
* Icon to display to the left of the button content.
|
|
6185
6251
|
* This is ignored/overridden when button is used as an external link.
|
|
@@ -6365,7 +6431,7 @@ class DuetButton {
|
|
|
6365
6431
|
"submit": [516],
|
|
6366
6432
|
"external": [4],
|
|
6367
6433
|
"language": [1],
|
|
6368
|
-
"accessibleLabelExternalDefaults": [
|
|
6434
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
6369
6435
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
6370
6436
|
"icon": [1],
|
|
6371
6437
|
"color": [1],
|
|
@@ -6459,46 +6525,7 @@ const isQuestionKey = (e) => e.key === "?";
|
|
|
6459
6525
|
const isEnterKey = (e) => e.key === "Enter" || e.keyCode === 13;
|
|
6460
6526
|
const isKeyboardClick = (e) => isEnterKey(e) || isSpaceKey(e);
|
|
6461
6527
|
|
|
6462
|
-
function isObject(maybeObj) {
|
|
6463
|
-
return Object.prototype.toString.call(maybeObj) === "[object Object]";
|
|
6464
|
-
}
|
|
6465
|
-
const parsePossibleJSON = (maybeJSON) => {
|
|
6466
|
-
if (Array.isArray(maybeJSON) || isObject(maybeJSON)) {
|
|
6467
|
-
return maybeJSON;
|
|
6468
|
-
}
|
|
6469
|
-
if (typeof maybeJSON === "string") {
|
|
6470
|
-
try {
|
|
6471
|
-
return JSON.parse(maybeJSON);
|
|
6472
|
-
}
|
|
6473
|
-
catch (e) {
|
|
6474
|
-
console.warn(e);
|
|
6475
|
-
}
|
|
6476
|
-
}
|
|
6477
|
-
// undefined is not a type in JSON,
|
|
6478
|
-
// so we use it here to signal invalid input
|
|
6479
|
-
return undefined;
|
|
6480
|
-
};
|
|
6481
|
-
/**
|
|
6482
|
-
* Format string, via simplistic sprintf equivalent
|
|
6483
|
-
* @example String.format('{0} is super, but {1} is best! {{0}}', 'Duet', 'Coffee'); -> "Duet is super, but Coffee ist best! {0}"
|
|
6484
|
-
*
|
|
6485
|
-
*/
|
|
6486
|
-
// @ts-ignore
|
|
6487
|
-
if (!String.format) {
|
|
6488
|
-
// @ts-ignore
|
|
6489
|
-
String.format = function (format) {
|
|
6490
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
6491
|
-
return format.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
|
|
6492
|
-
return curlyBrack == "{{" ? "{" : curlyBrack == "}}" ? "}" : args[index];
|
|
6493
|
-
});
|
|
6494
|
-
};
|
|
6495
|
-
}
|
|
6496
|
-
const MATCH_DISALLOWED_CHARS = /[^a-z0-9áéíóúñüöäå \.,_-]/gim;
|
|
6497
|
-
function sanitizeString(string) {
|
|
6498
|
-
return string.replace(MATCH_DISALLOWED_CHARS, "").trim();
|
|
6499
|
-
}
|
|
6500
|
-
|
|
6501
|
-
const duetCardCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-card,*.sc-duet-card::after,*.sc-duet-card::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-card-h{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)*/.duet-card-info.sc-duet-card-h{margin-bottom:16px !important}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-card-h{margin:0 !important}/*!@.duet-card*/.duet-card.sc-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*/.duet-card.duet-p-0.sc-duet-card{padding:0 !important}/*!@.duet-card.duet-m-0*/.duet-card.duet-m-0.sc-duet-card{margin:0 !important}/*!@.duet-card:focus*/.duet-card.sc-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*/.duet-theme-turva.sc-duet-card .duet-card.sc-duet-card:focus,.duet-card.sc-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*/.duet-card.sc-duet-card{padding:28px !important}}/*!@.duet-card.duet-theme-turva*/.duet-card.duet-theme-turva.sc-duet-card{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*/.duet-card.x-small.sc-duet-card{padding:20px !important}}@media (min-width: 36em){/*!@.duet-card.medium*/.duet-card.medium.sc-duet-card{padding:28px !important}}@media (min-width: 48em){/*!@.duet-card.medium*/.duet-card.medium.sc-duet-card{padding:36px !important}}@media (min-width: 36em){/*!@.duet-card.large*/.duet-card.large.sc-duet-card{padding:36px !important}}@media (min-width: 48em){/*!@.duet-card.large*/.duet-card.large.sc-duet-card{padding:48px !important}}@media (min-width: 36em){/*!@.duet-card.x-large*/.duet-card.x-large.sc-duet-card{padding:48px !important}}@media (min-width: 48em){/*!@.duet-card.x-large*/.duet-card.x-large.sc-duet-card{padding:72px !important}}/*!@.duet-card.duet-card-collapsed*/.duet-card.duet-card-collapsed.sc-duet-card{padding-bottom:0 !important}@media (min-width: 36em){/*!@.duet-card.duet-card-collapsed*/.duet-card.duet-card-collapsed.sc-duet-card{padding-bottom:0 !important}}/*!@.duet-card.info*/.duet-card.info.sc-duet-card{background:rgba(0, 80, 128, 0.04) !important;box-shadow:none}/*!@.duet-card.info.duet-theme-turva*/.duet-card.info.duet-theme-turva.sc-duet-card{background:rgba(23, 28, 58, 0.035) !important}/*!@.duet-card.plain*/.duet-card.plain.sc-duet-card{box-shadow:none}/*!@.duet-card.plain:not(.duet-card-has-bg)*/.duet-card.plain.sc-duet-card:not(.duet-card-has-bg){background:transparent !important}/*!@.duet-card-heading-grid*/.duet-card-heading-grid.sc-duet-card{display:flex;align-items:center}/*!@.duet-card-heading-grid .expand*/.duet-card-heading-grid.sc-duet-card .expand.sc-duet-card{flex:1}/*!@.duet-card-heading-text*/.duet-card-heading-text.sc-duet-card{overflow:hidden;text-overflow:ellipsis}/*!@.duet-card-secondary-heading*/.duet-card-secondary-heading.sc-duet-card{font-size:1rem;font-weight:600}/*!@.duet-card-heading*/.duet-card-heading.sc-duet-card{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*/.duet-card-heading.sc-duet-card{padding:15px 28px 16px !important;margin:-28px -28px 20px}}/*!@.duet-card-heading[role=button]*/.duet-card-heading[role=button].sc-duet-card{-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*/.duet-card-heading[role=button].sc-duet-card:focus{outline:0}/*!@:host(.user-is-tabbing) .duet-card-heading[role=button]:focus*/.user-is-tabbing.sc-duet-card-h .duet-card-heading[role=button].sc-duet-card: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*/.user-is-tabbing.sc-duet-card-h .duet-theme-turva.sc-duet-card .duet-card-heading[role=button].sc-duet-card:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}/*!@.duet-card-collapsed .duet-card-heading*/.duet-card-collapsed.sc-duet-card .duet-card-heading.sc-duet-card{margin-bottom:0 !important;border-bottom:0 !important}/*!@.duet-theme-turva .duet-card-heading*/.duet-theme-turva.sc-duet-card .duet-card-heading.sc-duet-card{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*/.x-small.sc-duet-card .duet-card-heading.sc-duet-card{padding:10px 20px 11px !important;margin:-20px -20px 20px}}@media (min-width: 48em){/*!@.x-small .duet-card-heading*/.x-small.sc-duet-card .duet-card-heading.sc-duet-card{padding:10px 20px 11px !important;margin:-20px -20px 20px}}/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{padding:15px 28px 16px !important;margin:-28px -28px 20px}}@media (min-width: 48em){/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{padding:19px 36px 20px !important;margin:-36px -36px 28px}}/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{padding:19px 36px 20px !important;margin:-36px -36px 28px}}@media (min-width: 48em){/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{padding:26px 48px 27px !important;margin:-48px -48px 36px}}/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{padding:26px 48px 27px !important;margin:-48px -48px 36px}}@media (min-width: 48em){/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{padding:39px 72px 40px !important;margin:-72px -72px 48px}}/*!@.none .duet-card-heading*/.none.sc-duet-card .duet-card-heading.sc-duet-card{padding:0 0 20px !important;margin:0 0 20px}/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{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*/.duet-theme-turva.sc-duet-card .duet-card-footer.sc-duet-card{background:#f5f5f7}@media (min-width: 36em){/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 36em){/*!@.x-small .duet-card-footer*/.x-small.sc-duet-card .duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;padding-left:20px !important;margin:20px -20px -20px}}@media (min-width: 36em){/*!@.medium .duet-card-footer*/.medium.sc-duet-card .duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){/*!@.medium .duet-card-footer*/.medium.sc-duet-card .duet-card-footer.sc-duet-card{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 36em){/*!@.large .duet-card-footer*/.large.sc-duet-card .duet-card-footer.sc-duet-card{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 48em){/*!@.large .duet-card-footer*/.large.sc-duet-card .duet-card-footer.sc-duet-card{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 36em){/*!@.x-large .duet-card-footer*/.x-large.sc-duet-card .duet-card-footer.sc-duet-card{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 48em){/*!@.x-large .duet-card-footer*/.x-large.sc-duet-card .duet-card-footer.sc-duet-card{padding:39px 72px 40px !important;margin:48px -72px -72px}}/*!@.none .duet-card-footer*/.none.sc-duet-card .duet-card-footer.sc-duet-card{padding:12px 0 !important;margin:20px 0 0}/*!@.duet-card-content*/.duet-card-content.sc-duet-card{width:100%}/*!@.duet-card-collapsed .duet-card-content*/.duet-card-collapsed.sc-duet-card .duet-card-content.sc-duet-card{display:none}/*!@.duet-card-caret*/.duet-card-caret.sc-duet-card{transition:300ms ease}/*!@[aria-expanded=false] .duet-card-caret*/[aria-expanded=false].sc-duet-card .duet-card-caret.sc-duet-card{transform:rotate(-180deg)}/*!@.duet-card-image-mask*/.duet-card-image-mask.sc-duet-card{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*/.small.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 36em){/*!@.medium .duet-card-image-mask*/.medium.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 48em){/*!@.medium .duet-card-image-mask*/.medium.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 72px);margin:-36px 0 28px -36px}}@media (min-width: 36em){/*!@.large .duet-card-image-mask*/.large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 72px);margin:-36px 0 36px -36px}}@media (min-width: 48em){/*!@.large .duet-card-image-mask*/.large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 36em){/*!@.x-large .duet-card-image-mask*/.x-large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 48em){/*!@.x-large .duet-card-image-mask*/.x-large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 144px);margin:-72px 0 36px -72px}}/*!@.none .duet-card-image-mask*/.none.sc-duet-card .duet-card-image-mask.sc-duet-card{width:100%;margin:0 0 20px}/*!@.duet-card-image*/.duet-card-image.sc-duet-card{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*/a.duet-card.sc-duet-card{transition:box-shadow 300ms ease, background-position 300ms ease}/*!@a.duet-card:hover*/a.duet-card.sc-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*/a.duet-card.sc-duet-card:hover .duet-card-image.sc-duet-card{transform:scale(1.024)}/*!@.duet-theme-turva a.duet-card:hover*/.duet-theme-turva.sc-duet-card a.duet-card.sc-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*/a.duet-card.sc-duet-card:active{transition:none;transform:translateY(1px)}";
|
|
6528
|
+
const duetCardCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-card,*.sc-duet-card::after,*.sc-duet-card::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-card-h{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)*/.duet-card-info.sc-duet-card-h{margin-bottom:16px !important}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-card-h{margin:0 !important}/*!@.duet-card*/.duet-card.sc-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*/.duet-card.duet-p-0.sc-duet-card{padding:0 !important}/*!@.duet-card.duet-m-0*/.duet-card.duet-m-0.sc-duet-card{margin:0 !important}/*!@.duet-card:focus*/.duet-card.sc-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*/.duet-theme-turva.sc-duet-card .duet-card.sc-duet-card:focus,.duet-card.sc-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*/.duet-card.sc-duet-card{padding:28px !important}}/*!@.duet-card.duet-theme-turva*/.duet-card.duet-theme-turva.sc-duet-card{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*/.duet-card.x-small.sc-duet-card{padding:20px !important}}@media (min-width: 36em){/*!@.duet-card.medium*/.duet-card.medium.sc-duet-card{padding:28px !important}}@media (min-width: 48em){/*!@.duet-card.medium*/.duet-card.medium.sc-duet-card{padding:36px !important}}@media (min-width: 36em){/*!@.duet-card.large*/.duet-card.large.sc-duet-card{padding:36px !important}}@media (min-width: 48em){/*!@.duet-card.large*/.duet-card.large.sc-duet-card{padding:48px !important}}@media (min-width: 36em){/*!@.duet-card.x-large*/.duet-card.x-large.sc-duet-card{padding:48px !important}}@media (min-width: 48em){/*!@.duet-card.x-large*/.duet-card.x-large.sc-duet-card{padding:72px !important}}/*!@.duet-card.duet-card-collapsed*/.duet-card.duet-card-collapsed.sc-duet-card{padding-bottom:0 !important}@media (min-width: 36em){/*!@.duet-card.duet-card-collapsed*/.duet-card.duet-card-collapsed.sc-duet-card{padding-bottom:0 !important}}/*!@.duet-card.info*/.duet-card.info.sc-duet-card{background:rgba(0, 80, 128, 0.04) !important;box-shadow:none}/*!@.duet-card.info.duet-theme-turva*/.duet-card.info.duet-theme-turva.sc-duet-card{background:rgba(23, 28, 58, 0.035) !important}/*!@.duet-card.plain*/.duet-card.plain.sc-duet-card{box-shadow:none}/*!@.duet-card.plain:not(.duet-card-has-bg)*/.duet-card.plain.sc-duet-card:not(.duet-card-has-bg){background:transparent !important}/*!@.duet-card-heading-grid*/.duet-card-heading-grid.sc-duet-card{display:flex;flex-direction:row}/*!@.duet-card-icon*/.duet-card-icon.sc-duet-card{align-self:center}/*!@.duet-card-heading-text*/.duet-card-heading-text.sc-duet-card{flex:1;word-break:break-word}/*!@.duet-card-secondary-heading*/.duet-card-secondary-heading.sc-duet-card{font-size:1rem;font-weight:600;word-break:break-word}/*!@.duet-card-secondary-heading--inline*/.duet-card-secondary-heading--inline.sc-duet-card{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*/.duet-card-secondary-heading--inline.sc-duet-card{display:none}}/*!@.duet-card-secondary-heading--new-line*/.duet-card-secondary-heading--new-line.sc-duet-card{display:none}@media (max-width: 22.5em){/*!@.duet-card-secondary-heading--new-line*/.duet-card-secondary-heading--new-line.sc-duet-card{display:block}}/*!@.duet-card-heading*/.duet-card-heading.sc-duet-card{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*/.duet-card-heading.sc-duet-card{padding:15px 28px 16px !important;margin:-28px -28px 20px}}/*!@.duet-card-heading[role=button]*/.duet-card-heading[role=button].sc-duet-card{-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*/.duet-card-heading[role=button].sc-duet-card:focus{outline:0}/*!@:host(.user-is-tabbing) .duet-card-heading[role=button]:focus*/.user-is-tabbing.sc-duet-card-h .duet-card-heading[role=button].sc-duet-card: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*/.user-is-tabbing.sc-duet-card-h .duet-theme-turva.sc-duet-card .duet-card-heading[role=button].sc-duet-card:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}/*!@.duet-card-collapsed .duet-card-heading*/.duet-card-collapsed.sc-duet-card .duet-card-heading.sc-duet-card{margin-bottom:0 !important;border-bottom:0 !important}/*!@.duet-theme-turva .duet-card-heading*/.duet-theme-turva.sc-duet-card .duet-card-heading.sc-duet-card{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*/.x-small.sc-duet-card .duet-card-heading.sc-duet-card{padding:10px 20px 11px !important;margin:-20px -20px 20px}}@media (min-width: 48em){/*!@.x-small .duet-card-heading*/.x-small.sc-duet-card .duet-card-heading.sc-duet-card{padding:10px 20px 11px !important;margin:-20px -20px 20px}}/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{padding:15px 28px 16px !important;margin:-28px -28px 20px}}@media (min-width: 48em){/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{padding:19px 36px 20px !important;margin:-36px -36px 28px}}/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{padding:19px 36px 20px !important;margin:-36px -36px 28px}}@media (min-width: 48em){/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{padding:26px 48px 27px !important;margin:-48px -48px 36px}}/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{padding:26px 48px 27px !important;margin:-48px -48px 36px}}@media (min-width: 48em){/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{padding:39px 72px 40px !important;margin:-72px -72px 48px}}/*!@.none .duet-card-heading*/.none.sc-duet-card .duet-card-heading.sc-duet-card{padding:0 0 20px !important;margin:0 0 20px}/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{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*/.duet-theme-turva.sc-duet-card .duet-card-footer.sc-duet-card{background:#f5f5f7}@media (min-width: 36em){/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 36em){/*!@.x-small .duet-card-footer*/.x-small.sc-duet-card .duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;padding-left:20px !important;margin:20px -20px -20px}}@media (min-width: 36em){/*!@.medium .duet-card-footer*/.medium.sc-duet-card .duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){/*!@.medium .duet-card-footer*/.medium.sc-duet-card .duet-card-footer.sc-duet-card{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 36em){/*!@.large .duet-card-footer*/.large.sc-duet-card .duet-card-footer.sc-duet-card{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 48em){/*!@.large .duet-card-footer*/.large.sc-duet-card .duet-card-footer.sc-duet-card{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 36em){/*!@.x-large .duet-card-footer*/.x-large.sc-duet-card .duet-card-footer.sc-duet-card{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 48em){/*!@.x-large .duet-card-footer*/.x-large.sc-duet-card .duet-card-footer.sc-duet-card{padding:39px 72px 40px !important;margin:48px -72px -72px}}/*!@.none .duet-card-footer*/.none.sc-duet-card .duet-card-footer.sc-duet-card{padding:12px 0 !important;margin:20px 0 0}/*!@.duet-card-content*/.duet-card-content.sc-duet-card{width:100%}/*!@.duet-card-collapsed .duet-card-content*/.duet-card-collapsed.sc-duet-card .duet-card-content.sc-duet-card{display:none}/*!@.duet-card-caret*/.duet-card-caret.sc-duet-card{position:relative;top:6px;align-self:flex-start;transition:300ms ease}/*!@[aria-expanded=false] .duet-card-caret*/[aria-expanded=false].sc-duet-card .duet-card-caret.sc-duet-card{transform:rotate(-180deg)}/*!@.duet-card-image-mask*/.duet-card-image-mask.sc-duet-card{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*/.small.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 36em){/*!@.medium .duet-card-image-mask*/.medium.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 48em){/*!@.medium .duet-card-image-mask*/.medium.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 72px);margin:-36px 0 28px -36px}}@media (min-width: 36em){/*!@.large .duet-card-image-mask*/.large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 72px);margin:-36px 0 36px -36px}}@media (min-width: 48em){/*!@.large .duet-card-image-mask*/.large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 36em){/*!@.x-large .duet-card-image-mask*/.x-large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 48em){/*!@.x-large .duet-card-image-mask*/.x-large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 144px);margin:-72px 0 36px -72px}}/*!@.none .duet-card-image-mask*/.none.sc-duet-card .duet-card-image-mask.sc-duet-card{width:100%;margin:0 0 20px}/*!@.duet-card-image*/.duet-card-image.sc-duet-card{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*/a.duet-card.sc-duet-card{transition:box-shadow 300ms ease, background-position 300ms ease}/*!@a.duet-card:hover*/a.duet-card.sc-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*/a.duet-card.sc-duet-card:hover .duet-card-image.sc-duet-card{transform:scale(1.024)}/*!@.duet-theme-turva a.duet-card:hover*/.duet-theme-turva.sc-duet-card a.duet-card.sc-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*/a.duet-card.sc-duet-card:active{transition:none;transform:translateY(1px)}";
|
|
6502
6529
|
|
|
6503
6530
|
/**
|
|
6504
6531
|
* @slot unnamed default slot - The component’s primary content. All child nodes that do not have a slot attribute defined are inserted into this primary slot.
|
|
@@ -6583,7 +6610,7 @@ class DuetCard {
|
|
|
6583
6610
|
this.hasFooter = !!this.element.querySelector("[slot='footer']");
|
|
6584
6611
|
}
|
|
6585
6612
|
renderHeading() {
|
|
6586
|
-
const HeadingTag = sanitizeString(this.headingLevel);
|
|
6613
|
+
const HeadingTag = sanitizeString$1(this.headingLevel);
|
|
6587
6614
|
const headingProps = this.collapsible
|
|
6588
6615
|
? {
|
|
6589
6616
|
role: "button",
|
|
@@ -6594,7 +6621,7 @@ class DuetCard {
|
|
|
6594
6621
|
onKeyDown: this.handleKeyDown,
|
|
6595
6622
|
}
|
|
6596
6623
|
: {};
|
|
6597
|
-
return (hAsync(HeadingTag, Object.assign({ class: "duet-card-heading" }, headingProps), hAsync("div", { class: "duet-card-heading-grid" }, this.icon && (hAsync(Fragment, null, hAsync("duet-icon", { class: "duet-card-icon", name: this.icon, size: "medium", margin: "none", color: "currentColor" }), hAsync("duet-spacer", { direction: "horizontal", size: "small" }))), hAsync("div", { class: "
|
|
6624
|
+
return (hAsync(HeadingTag, Object.assign({ class: "duet-card-heading" }, headingProps), hAsync("div", { class: "duet-card-heading-grid" }, this.icon && (hAsync(Fragment, null, hAsync("duet-icon", { class: "duet-card-icon", name: this.icon, size: "medium", margin: "none", color: "currentColor" }), hAsync("duet-spacer", { direction: "horizontal", size: "small" }))), hAsync("div", { class: "duet-card-heading-text" }, this.heading), this.secondaryHeading && (hAsync(Fragment, null, hAsync("duet-spacer", { direction: "horizontal", size: "small" }), hAsync("div", { class: "duet-card-secondary-heading duet-card-secondary-heading--inline" }, this.secondaryHeading))), this.collapsible && (hAsync(Fragment, null, hAsync("duet-spacer", { direction: "horizontal", size: "small" }), hAsync("duet-icon", { class: "duet-card-caret", icon: actionArrowUp.svg, size: "small", margin: "none", color: "currentColor" })))), this.secondaryHeading && (hAsync("div", { class: "duet-card-secondary-heading duet-card-secondary-heading--new-line" }, this.secondaryHeading))));
|
|
6598
6625
|
}
|
|
6599
6626
|
/**
|
|
6600
6627
|
* Sets focus on the specified `duet-card`. Use this method instead of the global
|
|
@@ -6656,7 +6683,7 @@ class DuetCard {
|
|
|
6656
6683
|
}; }
|
|
6657
6684
|
}
|
|
6658
6685
|
|
|
6659
|
-
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-
|
|
6686
|
+
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}";
|
|
6660
6687
|
|
|
6661
6688
|
class DuetCheckbox {
|
|
6662
6689
|
constructor(hostRef) {
|
|
@@ -6789,11 +6816,24 @@ class DuetCheckbox {
|
|
|
6789
6816
|
|
|
6790
6817
|
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>"};
|
|
6791
6818
|
|
|
6792
|
-
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}";
|
|
6819
|
+
const focusElement = (element) => {
|
|
6820
|
+
if ("setFocus" in element) {
|
|
6821
|
+
element.setFocus();
|
|
6822
|
+
}
|
|
6823
|
+
else {
|
|
6824
|
+
element.focus();
|
|
6825
|
+
}
|
|
6826
|
+
};
|
|
6827
|
+
const FocusGuard = ({ moveFocusTo }) => {
|
|
6828
|
+
return hAsync("div", { class: "duet-focus-guard", "aria-hidden": "true", tabIndex: 0, onFocus: () => focusElement(moveFocusTo) });
|
|
6829
|
+
};
|
|
6830
|
+
|
|
6831
|
+
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}";
|
|
6793
6832
|
|
|
6794
6833
|
/**
|
|
6795
6834
|
* @slot unnamed default slot - The component’s primary content. All child nodes that do not have a slot attribute defined are inserted into this primary slot.
|
|
6796
6835
|
* @slot info - Info content. Anything inserted into this slot is displayed in a collapsible info box.
|
|
6836
|
+
* @slot collapsible_header - header that is only added to collapsible element, this header should be used when the components collapsible area contains additional interactive elements (such as form items) and should be user for a short description of the content below it, it is mandatory for good accessibility to use this - and aria-decribe-by will point to it. If you use the collapsible area with simple text - describe-by will point to this area
|
|
6797
6837
|
* @slot additional - Additional content. Anything inserted into this slot is displayed as additional content under the label and caption
|
|
6798
6838
|
*/
|
|
6799
6839
|
class DuetChoice {
|
|
@@ -6802,9 +6842,11 @@ class DuetChoice {
|
|
|
6802
6842
|
this.duetChange = createEvent$2(this, "duetChange", 7);
|
|
6803
6843
|
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
6804
6844
|
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
6845
|
+
this.hasHeader = false;
|
|
6805
6846
|
this.choiceId = createID("DuetChoice");
|
|
6806
|
-
this.
|
|
6807
|
-
this.
|
|
6847
|
+
this.expandId = createID("DuetChoiceExpand");
|
|
6848
|
+
this.headerId = createID("DuetChoiceHeader");
|
|
6849
|
+
this.infoButtonId = createID("DuetChoiceInfoButton");
|
|
6808
6850
|
/**
|
|
6809
6851
|
* State() variables
|
|
6810
6852
|
* Inlined decorator, alphabetical order.
|
|
@@ -6882,6 +6924,24 @@ class DuetChoice {
|
|
|
6882
6924
|
* browser from displaying its own validation errors.
|
|
6883
6925
|
*/
|
|
6884
6926
|
this.required = false;
|
|
6927
|
+
/**
|
|
6928
|
+
* Placeholder defaults
|
|
6929
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
6930
|
+
*/
|
|
6931
|
+
this.infoLabelDefaults = {
|
|
6932
|
+
fi: "Lisätietoja",
|
|
6933
|
+
en: "More information about",
|
|
6934
|
+
sv: "Mera information om",
|
|
6935
|
+
};
|
|
6936
|
+
/**
|
|
6937
|
+
* Hint text to display before the user types into the date picker input.
|
|
6938
|
+
* @default {
|
|
6939
|
+
* fi: "Lisätietoja",
|
|
6940
|
+
* en: "More information about",
|
|
6941
|
+
* sv: "Mera information om",
|
|
6942
|
+
* }
|
|
6943
|
+
*/
|
|
6944
|
+
this.infoLabel = getLocaleString(this.infoLabelDefaults, getLanguage());
|
|
6885
6945
|
this.onMouseEnter = () => {
|
|
6886
6946
|
this.isHovering = true;
|
|
6887
6947
|
};
|
|
@@ -6889,7 +6949,6 @@ class DuetChoice {
|
|
|
6889
6949
|
this.isHovering = false;
|
|
6890
6950
|
};
|
|
6891
6951
|
this.onClick = (ev) => {
|
|
6892
|
-
this.setFocus();
|
|
6893
6952
|
this.toggleChecked(ev);
|
|
6894
6953
|
};
|
|
6895
6954
|
this.handleKeyDown = (ev) => {
|
|
@@ -6897,7 +6956,7 @@ class DuetChoice {
|
|
|
6897
6956
|
this.toggleChecked(ev);
|
|
6898
6957
|
}
|
|
6899
6958
|
if (isQuestionKey(ev) && this.hasInfo) {
|
|
6900
|
-
this.toggleInfo(
|
|
6959
|
+
this.toggleInfo();
|
|
6901
6960
|
}
|
|
6902
6961
|
};
|
|
6903
6962
|
this.onChange = () => {
|
|
@@ -6931,8 +6990,6 @@ class DuetChoice {
|
|
|
6931
6990
|
if (this.disabled || this.groupDisabled) {
|
|
6932
6991
|
return;
|
|
6933
6992
|
}
|
|
6934
|
-
ev.stopPropagation();
|
|
6935
|
-
ev.preventDefault();
|
|
6936
6993
|
this.isInfoOpen = false;
|
|
6937
6994
|
// if it's a radio button and it's already checked
|
|
6938
6995
|
// we shouldn't fire an event, so exit early
|
|
@@ -6946,10 +7003,10 @@ class DuetChoice {
|
|
|
6946
7003
|
value: this.value,
|
|
6947
7004
|
component: "duet-choice",
|
|
6948
7005
|
});
|
|
6949
|
-
};
|
|
6950
|
-
this.toggleInfo = ev => {
|
|
6951
|
-
ev.stopPropagation();
|
|
6952
7006
|
ev.preventDefault();
|
|
7007
|
+
ev.stopPropagation();
|
|
7008
|
+
};
|
|
7009
|
+
this.toggleInfo = () => {
|
|
6953
7010
|
this.isInfoOpen = !this.isInfoOpen;
|
|
6954
7011
|
};
|
|
6955
7012
|
}
|
|
@@ -6959,6 +7016,7 @@ class DuetChoice {
|
|
|
6959
7016
|
componentWillLoad() {
|
|
6960
7017
|
inheritGlobalTheme(this);
|
|
6961
7018
|
this.hasInfo = !!this.element.querySelector("[slot='info']");
|
|
7019
|
+
this.hasHeader = !!this.element.querySelector('[slot="header"]');
|
|
6962
7020
|
this.hasAdditional = !!this.element.querySelector("[slot='additional']");
|
|
6963
7021
|
}
|
|
6964
7022
|
/**
|
|
@@ -6972,15 +7030,18 @@ class DuetChoice {
|
|
|
6972
7030
|
// @ts-ignore
|
|
6973
7031
|
const isTargetContainedInHost = this.element.contains(ev === null || ev === void 0 ? void 0 : ev.relatedTarget) || false;
|
|
6974
7032
|
if (!isTargetContainedInHost) {
|
|
6975
|
-
this.toggleInfo(
|
|
7033
|
+
this.toggleInfo();
|
|
6976
7034
|
}
|
|
6977
7035
|
}
|
|
6978
7036
|
}
|
|
6979
7037
|
handleHostKeyDown() {
|
|
6980
7038
|
this.isKeyDown = true;
|
|
6981
7039
|
}
|
|
6982
|
-
handleHostKeyUp() {
|
|
7040
|
+
handleHostKeyUp(ev) {
|
|
6983
7041
|
this.isKeyDown = false;
|
|
7042
|
+
if (isEscapeKey(ev) && this.isInfoOpen) {
|
|
7043
|
+
this.toggleInfo();
|
|
7044
|
+
}
|
|
6984
7045
|
}
|
|
6985
7046
|
/**
|
|
6986
7047
|
* Sets focus on the specified `duet-choice`. Use this method instead of the global
|
|
@@ -6993,11 +7054,13 @@ class DuetChoice {
|
|
|
6993
7054
|
if (this.accessibleDescribedBy) {
|
|
6994
7055
|
return this.accessibleDescribedBy;
|
|
6995
7056
|
}
|
|
6996
|
-
if (this.collapsible) {
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7057
|
+
if (this.collapsible || this.hasInfo) {
|
|
7058
|
+
if (this.hasHeader) {
|
|
7059
|
+
return this.headerId;
|
|
7060
|
+
}
|
|
7061
|
+
else {
|
|
7062
|
+
return this.expandId;
|
|
7063
|
+
}
|
|
7001
7064
|
}
|
|
7002
7065
|
return null;
|
|
7003
7066
|
}
|
|
@@ -7006,6 +7069,7 @@ class DuetChoice {
|
|
|
7006
7069
|
return {
|
|
7007
7070
|
"duet-choice-card-info": true,
|
|
7008
7071
|
"duet-choice-card-info-expanded": this.isInfoOpen,
|
|
7072
|
+
"duet-choice-card-collapsed": !this.isInfoOpen,
|
|
7009
7073
|
"duet-theme-turva": this.theme === "turva",
|
|
7010
7074
|
};
|
|
7011
7075
|
}
|
|
@@ -7013,6 +7077,7 @@ class DuetChoice {
|
|
|
7013
7077
|
return {
|
|
7014
7078
|
"duet-choice-card-collapsible": true,
|
|
7015
7079
|
"duet-choice-card-collapsible-expanded": this.checked,
|
|
7080
|
+
"duet-choice-card-collapsed": !this.checked,
|
|
7016
7081
|
"duet-choice-card-collapsible-disabled": this.disabled || this.groupDisabled ? true : false,
|
|
7017
7082
|
"duet-theme-turva": this.theme === "turva",
|
|
7018
7083
|
};
|
|
@@ -7027,6 +7092,7 @@ class DuetChoice {
|
|
|
7027
7092
|
*/
|
|
7028
7093
|
render() {
|
|
7029
7094
|
const identifier = this.identifier || this.choiceId;
|
|
7095
|
+
console.log(this.element);
|
|
7030
7096
|
return (hAsync(Host, { class: {
|
|
7031
7097
|
horizontal: this.groupDirection === "horizontal" && !this.groupResponsive,
|
|
7032
7098
|
"horizontal-responsive": this.groupDirection === "horizontal" && this.groupResponsive,
|
|
@@ -7044,10 +7110,13 @@ class DuetChoice {
|
|
|
7044
7110
|
info: this.isInfoOpen,
|
|
7045
7111
|
collapsible: this.collapsible,
|
|
7046
7112
|
"duet-p-0": this.padding === "none",
|
|
7047
|
-
} }, hAsync("input", {
|
|
7113
|
+
} }, hAsync("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) }), hAsync("label", { htmlFor: identifier, class: { "duet-choice-label": true, "no-hover": this.isHovering }, onClick: this.onClick }, this.icon && (hAsync("div", { class: "duet-choice-card-icon" }, hAsync("duet-icon", { margin: "none", size: "small", name: this.icon, color: "currentColor" }))), this.label, this.caption && (hAsync("div", null, hAsync("duet-spacer", { size: "xx-small" }), hAsync("duet-caption", { margin: "none", selected: this.checked }, this.caption))), this.hasAdditional && (hAsync("div", null, hAsync("duet-spacer", { size: "xx-small" }), hAsync("slot", { name: "additional" }))), hAsync("div", { class: { "duet-checkmark-container": true, "duet-checkmark-radio": this.type === "radio" } }, this.checked && hAsync("div", { class: "duet-checkmark" })))), this.hasInfo && !this.collapsible && (hAsync("button", { ref: button => (this.infoButtonEl = button), id: this.infoButtonId, class: {
|
|
7048
7114
|
"duet-choice-info-toggle": true,
|
|
7049
7115
|
"duet-theme-turva": this.theme === "turva",
|
|
7050
|
-
}, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onClick: this.toggleInfo, disabled: this.disabled || this.groupDisabled, "aria-expanded": this.isInfoOpen ? "true" : "false", "aria-controls": this.
|
|
7116
|
+
}, 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" }, hAsync("duet-visually-hidden", { "aria-hidden": !this.isBlurred ? "true" : "false" }, this.accessibleLabelInfoButton), hAsync("div", { class: "duet-choice-info-icon" }, hAsync("duet-icon", { icon: messagingInfo.svg, margin: "none", size: "small", color: "currentColor" }))))), this.collapsible || this.hasInfo ? (hAsync("div", { class: this.getClassNames(), id: this.expandId }, hAsync("span", { class: {
|
|
7117
|
+
"duet-choice-section-visible": this.collapsible ? this.checked : this.isInfoOpen,
|
|
7118
|
+
"duet-choice-section-hidden": this.collapsible ? !this.checked : !this.isInfoOpen,
|
|
7119
|
+
} }, hAsync("span", { id: this.headerId }, hAsync("slot", { name: "header" })), this.hasInfo ? (hAsync("span", null, hAsync("span", { "aria-relevant": "all", "aria-atomic": "true", "aria-live": this.isInfoOpen ? "polite" : "off" }, hAsync("slot", { name: "info" })), hAsync("slot", null))) : (hAsync("span", null, hAsync("slot", null)))), this.isInfoOpen && hAsync(FocusGuard, { moveFocusTo: this.infoButtonEl }))) : null));
|
|
7051
7120
|
}
|
|
7052
7121
|
get element() { return getElement(this); }
|
|
7053
7122
|
static get style() { return duetChoiceCss; }
|
|
@@ -7057,7 +7126,7 @@ class DuetChoice {
|
|
|
7057
7126
|
"$members$": {
|
|
7058
7127
|
"theme": [1025],
|
|
7059
7128
|
"label": [1],
|
|
7060
|
-
"accessibleLabelInfoButtonDefaults": [
|
|
7129
|
+
"accessibleLabelInfoButtonDefaults": [1, "accessible-label-info-default"],
|
|
7061
7130
|
"accessibleLabelInfoButton": [1, "accessible-label-info-button"],
|
|
7062
7131
|
"accessibleActiveDescendant": [1, "accessible-active-descendant"],
|
|
7063
7132
|
"accessibleControls": [1, "accessible-controls"],
|
|
@@ -7079,6 +7148,8 @@ class DuetChoice {
|
|
|
7079
7148
|
"groupResponsive": [4, "group-responsive"],
|
|
7080
7149
|
"disabled": [516],
|
|
7081
7150
|
"required": [4],
|
|
7151
|
+
"infoLabelDefaults": [1, "accessible-label-info-default"],
|
|
7152
|
+
"infoLabel": [1, "info-label"],
|
|
7082
7153
|
"isHovering": [32],
|
|
7083
7154
|
"isInfoOpen": [32],
|
|
7084
7155
|
"isBlurred": [32],
|
|
@@ -7090,19 +7161,41 @@ class DuetChoice {
|
|
|
7090
7161
|
}; }
|
|
7091
7162
|
}
|
|
7092
7163
|
|
|
7093
|
-
const
|
|
7164
|
+
const watchFor = (containerEl, tagName, onChange, changeHandler, options = {
|
|
7165
|
+
childList: true,
|
|
7166
|
+
subtree: true,
|
|
7167
|
+
}) => {
|
|
7094
7168
|
let mutation;
|
|
7095
7169
|
if (typeof MutationObserver !== "undefined") {
|
|
7096
7170
|
mutation = new MutationObserver(mutationList => {
|
|
7097
|
-
onChange(
|
|
7098
|
-
});
|
|
7099
|
-
mutation.observe(containerEl, {
|
|
7100
|
-
childList: true,
|
|
7101
|
-
subtree: true,
|
|
7171
|
+
onChange(changeHandler(mutationList, tagName));
|
|
7102
7172
|
});
|
|
7173
|
+
mutation.observe(containerEl, options);
|
|
7103
7174
|
}
|
|
7104
7175
|
return mutation;
|
|
7105
7176
|
};
|
|
7177
|
+
const watchForOptions = (containerEl, tagName, onChange) => {
|
|
7178
|
+
return watchFor(containerEl, tagName, onChange, getSelectedOption);
|
|
7179
|
+
};
|
|
7180
|
+
const watchForElement = (containerEl, tagName, onChange) => {
|
|
7181
|
+
return watchFor(containerEl, tagName, onChange, getElementItem, {
|
|
7182
|
+
childList: true,
|
|
7183
|
+
subtree: true,
|
|
7184
|
+
});
|
|
7185
|
+
};
|
|
7186
|
+
const getElementItem = (mutationList) => {
|
|
7187
|
+
let addedNode = false;
|
|
7188
|
+
let removedNode = false;
|
|
7189
|
+
mutationList.forEach(mut => {
|
|
7190
|
+
if (mut.addedNodes.length) {
|
|
7191
|
+
addedNode = true;
|
|
7192
|
+
}
|
|
7193
|
+
if (mut.removedNodes.length) {
|
|
7194
|
+
removedNode = true;
|
|
7195
|
+
}
|
|
7196
|
+
});
|
|
7197
|
+
return { addedNode, removedNode, mutationList };
|
|
7198
|
+
};
|
|
7106
7199
|
const getSelectedOption = (mutationList, tagName) => {
|
|
7107
7200
|
let newOption;
|
|
7108
7201
|
mutationList.forEach(mut => {
|
|
@@ -7121,7 +7214,7 @@ const findCheckedOption = (el, tagName) => {
|
|
|
7121
7214
|
return options.find((o) => o.checked === true);
|
|
7122
7215
|
};
|
|
7123
7216
|
|
|
7124
|
-
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}";
|
|
7217
|
+
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}";
|
|
7125
7218
|
|
|
7126
7219
|
class DuetChoiceGroup {
|
|
7127
7220
|
constructor(hostRef) {
|
|
@@ -7153,11 +7246,11 @@ class DuetChoiceGroup {
|
|
|
7153
7246
|
/**
|
|
7154
7247
|
* Additional caption to show inside the label of the choice group.
|
|
7155
7248
|
*/
|
|
7156
|
-
this.caption =
|
|
7249
|
+
this.caption = undefined;
|
|
7157
7250
|
/**
|
|
7158
7251
|
* Tooltip to display next to the label of the choice group.
|
|
7159
7252
|
*/
|
|
7160
|
-
this.tooltip =
|
|
7253
|
+
this.tooltip = undefined;
|
|
7161
7254
|
/**
|
|
7162
7255
|
* With direction setting you can force the tooltip to always open towards left
|
|
7163
7256
|
* or right instead of automatically determining the direction.
|
|
@@ -7410,6 +7503,7 @@ const size_tappable_square = "48px";
|
|
|
7410
7503
|
const size_icon_x_small = "16px";
|
|
7411
7504
|
const size_icon_xxx_small = "7px";
|
|
7412
7505
|
const size_button_border = "2px";
|
|
7506
|
+
const size_button_tiny_border = "1px";
|
|
7413
7507
|
const size_icon_medium = "24px";
|
|
7414
7508
|
const size_icon_small = "20px";
|
|
7415
7509
|
const opacity_85 = "0.85";
|
|
@@ -7557,6 +7651,7 @@ var tokens = {
|
|
|
7557
7651
|
size_icon_x_small: size_icon_x_small,
|
|
7558
7652
|
size_icon_xxx_small: size_icon_xxx_small,
|
|
7559
7653
|
size_button_border: size_button_border,
|
|
7654
|
+
size_button_tiny_border: size_button_tiny_border,
|
|
7560
7655
|
size_icon_medium: size_icon_medium,
|
|
7561
7656
|
size_icon_small: size_icon_small,
|
|
7562
7657
|
opacity_85: opacity_85,
|
|
@@ -7707,6 +7802,7 @@ var tokens$1 = /*#__PURE__*/Object.freeze({
|
|
|
7707
7802
|
size_icon_x_small: size_icon_x_small,
|
|
7708
7803
|
size_icon_xxx_small: size_icon_xxx_small,
|
|
7709
7804
|
size_button_border: size_button_border,
|
|
7805
|
+
size_button_tiny_border: size_button_tiny_border,
|
|
7710
7806
|
size_icon_medium: size_icon_medium,
|
|
7711
7807
|
size_icon_small: size_icon_small,
|
|
7712
7808
|
opacity_85: opacity_85,
|
|
@@ -7856,7 +7952,7 @@ class DuetCollapsible {
|
|
|
7856
7952
|
* Always the last one in the class.
|
|
7857
7953
|
*/
|
|
7858
7954
|
render() {
|
|
7859
|
-
const HeadingTagName = this.headingLevel ? sanitizeString(this.headingLevel) : "div";
|
|
7955
|
+
const HeadingTagName = this.headingLevel ? sanitizeString$1(this.headingLevel) : "div";
|
|
7860
7956
|
return (hAsync(Host, { class: { "duet-m-0": this.margin === "none" } }, hAsync(HeadingTagName, { class: {
|
|
7861
7957
|
"duet-collapsible-heading": true,
|
|
7862
7958
|
"duet-theme-turva": this.theme === "turva",
|
|
@@ -7931,18 +8027,6 @@ class DuetCookieConsent {
|
|
|
7931
8027
|
}; }
|
|
7932
8028
|
}
|
|
7933
8029
|
|
|
7934
|
-
const focusElement = (element) => {
|
|
7935
|
-
if ("setFocus" in element) {
|
|
7936
|
-
element.setFocus();
|
|
7937
|
-
}
|
|
7938
|
-
else {
|
|
7939
|
-
element.focus();
|
|
7940
|
-
}
|
|
7941
|
-
};
|
|
7942
|
-
const FocusGuard = ({ moveFocusTo }) => {
|
|
7943
|
-
return hAsync("div", { class: "duet-focus-guard", "aria-hidden": "true", tabIndex: 0, onFocus: () => focusElement(moveFocusTo) });
|
|
7944
|
-
};
|
|
7945
|
-
|
|
7946
8030
|
const formatOptionsShort = { day: "numeric", month: "long" };
|
|
7947
8031
|
const formatOptionsLong = { day: "numeric", month: "long", year: "numeric" };
|
|
7948
8032
|
const i18n$2 = {
|
|
@@ -8333,7 +8417,7 @@ const DatePickerMonth = ({ selectedDate, focusedDate, labelledById, theme, langu
|
|
|
8333
8417
|
} }))))))))));
|
|
8334
8418
|
};
|
|
8335
8419
|
|
|
8336
|
-
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}";
|
|
8420
|
+
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}";
|
|
8337
8421
|
|
|
8338
8422
|
class DuetDatePicker {
|
|
8339
8423
|
constructor(hostRef) {
|
|
@@ -8374,11 +8458,27 @@ class DuetDatePicker {
|
|
|
8374
8458
|
* Controls the margin of the component.
|
|
8375
8459
|
*/
|
|
8376
8460
|
this.margin = "auto";
|
|
8461
|
+
/**
|
|
8462
|
+
* The currently active language. This setting changes the month/year/day.
|
|
8463
|
+
* names and button labels as well as all screen reader labels.
|
|
8464
|
+
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing.
|
|
8465
|
+
* @default "fi"
|
|
8466
|
+
*/
|
|
8467
|
+
this.language = getLanguage();
|
|
8468
|
+
/**
|
|
8469
|
+
* Placeholder defaults.
|
|
8470
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
8471
|
+
*/
|
|
8472
|
+
this.placeholderDefaults = {
|
|
8473
|
+
fi: "pp.kk.vvvv",
|
|
8474
|
+
en: "dd.mm.yyyy",
|
|
8475
|
+
sv: "dd.mm.åååå",
|
|
8476
|
+
};
|
|
8377
8477
|
/**
|
|
8378
8478
|
* Hint text to display before the user types into the date picker input.
|
|
8379
8479
|
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
8380
8480
|
*/
|
|
8381
|
-
this.placeholder = getLocaleString(
|
|
8481
|
+
this.placeholder = getLocaleString(this.placeholderDefaults, this.language);
|
|
8382
8482
|
/**
|
|
8383
8483
|
* If form input field has a placeholder text, and user types anything (causing the text to dissapear),
|
|
8384
8484
|
* 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)
|
|
@@ -8389,13 +8489,6 @@ class DuetDatePicker {
|
|
|
8389
8489
|
* interact with the input, and conveys its inactive state to assistive technologies.
|
|
8390
8490
|
*/
|
|
8391
8491
|
this.disabled = false;
|
|
8392
|
-
/**
|
|
8393
|
-
* The currently active language. This setting changes the month/year/day
|
|
8394
|
-
* names and button labels as well as all screen reader labels.
|
|
8395
|
-
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing
|
|
8396
|
-
* @default "fi"
|
|
8397
|
-
*/
|
|
8398
|
-
this.language = getLanguage();
|
|
8399
8492
|
/**
|
|
8400
8493
|
* Display the date picker input in error state along with an error message.
|
|
8401
8494
|
*/
|
|
@@ -8436,7 +8529,7 @@ class DuetDatePicker {
|
|
|
8436
8529
|
*/
|
|
8437
8530
|
this.min = "";
|
|
8438
8531
|
/**
|
|
8439
|
-
* Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD
|
|
8532
|
+
* Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.
|
|
8440
8533
|
* This setting can be used alone or together with the min property.
|
|
8441
8534
|
*/
|
|
8442
8535
|
this.max = "";
|
|
@@ -8740,10 +8833,11 @@ class DuetDatePicker {
|
|
|
8740
8833
|
"label": [1],
|
|
8741
8834
|
"caption": [1],
|
|
8742
8835
|
"margin": [1],
|
|
8836
|
+
"language": [1],
|
|
8837
|
+
"placeholderDefaults": [1, "placeholder-default"],
|
|
8743
8838
|
"placeholder": [1],
|
|
8744
8839
|
"echoPlaceholder": [1540, "echo-placeholder"],
|
|
8745
8840
|
"disabled": [516],
|
|
8746
|
-
"language": [1],
|
|
8747
8841
|
"error": [1],
|
|
8748
8842
|
"labelHidden": [4, "label-hidden"],
|
|
8749
8843
|
"role": [1],
|
|
@@ -8819,49 +8913,153 @@ class DuetDivider {
|
|
|
8819
8913
|
}; }
|
|
8820
8914
|
}
|
|
8821
8915
|
|
|
8822
|
-
const
|
|
8916
|
+
const debounce = (func, timeout = 50) => {
|
|
8917
|
+
let timer;
|
|
8918
|
+
return (...args) => {
|
|
8919
|
+
clearTimeout(timer);
|
|
8920
|
+
timer = setTimeout(() => {
|
|
8921
|
+
func.apply(undefined, args);
|
|
8922
|
+
}, timeout);
|
|
8923
|
+
};
|
|
8924
|
+
};
|
|
8823
8925
|
|
|
8824
|
-
|
|
8926
|
+
const duetEditableTableCss = "/*!@duet-editable-table*/duet-editable-table.sc-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*/.duet-editable-table-header.sc-duet-editable-table tr.sc-duet-editable-table .duet-editable-table-header-hidden.sc-duet-editable-table{padding:0 !important;font-size:0;border-bottom:0}";
|
|
8927
|
+
|
|
8928
|
+
class DuetEditableTable {
|
|
8825
8929
|
constructor(hostRef) {
|
|
8826
8930
|
registerInstance(this, hostRef);
|
|
8827
8931
|
/**
|
|
8828
|
-
*
|
|
8932
|
+
* State() variables
|
|
8933
|
+
* @internal
|
|
8829
8934
|
*/
|
|
8830
|
-
this.
|
|
8935
|
+
this.tick = Date.now();
|
|
8831
8936
|
/**
|
|
8832
|
-
*
|
|
8937
|
+
* Map of items that contain list of things.
|
|
8833
8938
|
*/
|
|
8834
|
-
this.
|
|
8939
|
+
this.items = new Map();
|
|
8835
8940
|
/**
|
|
8836
|
-
*
|
|
8941
|
+
* Array of internationalized defaults for the default groups labels.
|
|
8837
8942
|
*/
|
|
8838
|
-
this.
|
|
8943
|
+
this.groupsLabelDefaults = {
|
|
8944
|
+
fi: "Kaikki",
|
|
8945
|
+
en: "All items",
|
|
8946
|
+
sv: "Alla objekt",
|
|
8947
|
+
};
|
|
8948
|
+
/**
|
|
8949
|
+
* Array of internationalized defaults for the default action labels.
|
|
8950
|
+
*/
|
|
8951
|
+
this.actionLabelDefaults = {
|
|
8952
|
+
fi: "Toiminnot",
|
|
8953
|
+
en: "Actions",
|
|
8954
|
+
sv: "Handlingar",
|
|
8955
|
+
};
|
|
8956
|
+
/**
|
|
8957
|
+
* Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
|
|
8958
|
+
* @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
|
|
8959
|
+
* @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
|
|
8960
|
+
*/
|
|
8961
|
+
this.groups = [
|
|
8962
|
+
{ id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
|
|
8963
|
+
];
|
|
8964
|
+
/**
|
|
8965
|
+
* Array of actions that are mapped via the map variable to the various groups defined in group.
|
|
8966
|
+
* @default undefined
|
|
8967
|
+
* @example [{
|
|
8968
|
+
variation: "default",
|
|
8969
|
+
icon: "action-edit-2",
|
|
8970
|
+
id: "edit",
|
|
8971
|
+
map: ["success"],
|
|
8972
|
+
label: {
|
|
8973
|
+
fi: " Label",
|
|
8974
|
+
en: " Label",
|
|
8975
|
+
sv: " Label",
|
|
8976
|
+
}
|
|
8977
|
+
}]
|
|
8978
|
+
*/
|
|
8979
|
+
this.actions = undefined;
|
|
8980
|
+
/**
|
|
8981
|
+
* Shows or hides the table labels.
|
|
8982
|
+
*/
|
|
8983
|
+
this.hideGroups = false;
|
|
8984
|
+
/**
|
|
8985
|
+
* Exposes the aria role for optimizing accessibility.
|
|
8986
|
+
*/
|
|
8987
|
+
this.accessibleRole = undefined;
|
|
8988
|
+
/**
|
|
8989
|
+
* Private methods.
|
|
8990
|
+
*/
|
|
8991
|
+
this.kick = debounce(() => {
|
|
8992
|
+
this.tick = Date.now();
|
|
8993
|
+
}, 100); // will trigger re-render
|
|
8994
|
+
this.filterMap = needle => {
|
|
8995
|
+
if (needle === "all") {
|
|
8996
|
+
return Array.from(this.items);
|
|
8997
|
+
}
|
|
8998
|
+
return Array.from(this.items).filter(item => needle === item[1].group);
|
|
8999
|
+
};
|
|
8839
9000
|
}
|
|
8840
9001
|
/**
|
|
8841
9002
|
* Component lifecycle events.
|
|
8842
9003
|
*/
|
|
8843
9004
|
componentWillLoad() {
|
|
9005
|
+
if (typeof this.groups === "string") {
|
|
9006
|
+
this.internalGroupArray = sanitizeString(this.groups);
|
|
9007
|
+
}
|
|
9008
|
+
else {
|
|
9009
|
+
this.internalGroupArray = this.groups;
|
|
9010
|
+
}
|
|
9011
|
+
if (typeof this.actions === "string") {
|
|
9012
|
+
this.internalActionsArray = sanitizeString(this.actions);
|
|
9013
|
+
}
|
|
9014
|
+
else {
|
|
9015
|
+
this.internalActionsArray = this.actions;
|
|
9016
|
+
}
|
|
8844
9017
|
inheritGlobalTheme(this);
|
|
8845
9018
|
}
|
|
8846
9019
|
/**
|
|
8847
|
-
*
|
|
8848
|
-
*
|
|
9020
|
+
* Method to force an update of a tabular data array.
|
|
9021
|
+
* when called the method will rerender the entire tabular structure.
|
|
8849
9022
|
*/
|
|
9023
|
+
async updateTable(passedItems = undefined) {
|
|
9024
|
+
this.items = new Map(passedItems || this.items);
|
|
9025
|
+
this.kick();
|
|
9026
|
+
}
|
|
8850
9027
|
render() {
|
|
8851
|
-
return (hAsync(Host,
|
|
8852
|
-
"duet-empty-state": true,
|
|
9028
|
+
return (hAsync(Host, { class: {
|
|
8853
9029
|
"duet-theme-turva": this.theme === "turva",
|
|
8854
|
-
|
|
8855
|
-
|
|
9030
|
+
} }, this.internalGroupArray.map(group => {
|
|
9031
|
+
const currentGroup = this.filterMap(group.id);
|
|
9032
|
+
if (!currentGroup.length) {
|
|
9033
|
+
return;
|
|
9034
|
+
}
|
|
9035
|
+
return (hAsync("duet-table", { variation: "plain", breakpoint: "none", role: "", margin: this.hideGroups ? "none" : "auto" }, hAsync("table", { class: "duet-editable-table", "aria-role": this.accessibleRole }, hAsync("thead", { class: "duet-editable-table-header" }, hAsync("tr", null, hAsync("th", { class: {
|
|
9036
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
9037
|
+
} }, !this.hideGroups ? (getLocaleString(group.label)) : (hAsync("duet-visually-hidden", null, getLocaleString(group.label)))), hAsync("th", { class: {
|
|
9038
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
9039
|
+
} }, hAsync("duet-visually-hidden", null, group.actionLabel
|
|
9040
|
+
? getLocaleString(group.actionLabel)
|
|
9041
|
+
: getLocaleString(this.actionLabelDefaults))))), hAsync("tbody", null, currentGroup.map(dataAsArray => {
|
|
9042
|
+
const [key, value] = dataAsArray;
|
|
9043
|
+
return (hAsync("duet-editable-table-item", { keyName: key, data: Object.assign({}, value), groupId: group.id, part: group.id, actions: this.internalActionsArray }));
|
|
9044
|
+
})))));
|
|
9045
|
+
})));
|
|
8856
9046
|
}
|
|
8857
|
-
|
|
9047
|
+
get element() { return getElement(this); }
|
|
9048
|
+
static get style() { return duetEditableTableCss; }
|
|
8858
9049
|
static get cmpMeta() { return {
|
|
8859
9050
|
"$flags$": 9,
|
|
8860
|
-
"$tagName$": "duet-
|
|
9051
|
+
"$tagName$": "duet-editable-table",
|
|
8861
9052
|
"$members$": {
|
|
9053
|
+
"items": [1040],
|
|
9054
|
+
"groupsLabelDefaults": [16],
|
|
9055
|
+
"actionLabelDefaults": [16],
|
|
9056
|
+
"groups": [1],
|
|
9057
|
+
"actions": [1],
|
|
9058
|
+
"hideGroups": [4, "hide-table-labels"],
|
|
9059
|
+
"accessibleRole": [1, "accessible-role"],
|
|
8862
9060
|
"theme": [1025],
|
|
8863
|
-
"
|
|
8864
|
-
"
|
|
9061
|
+
"tick": [32],
|
|
9062
|
+
"updateTable": [64]
|
|
8865
9063
|
},
|
|
8866
9064
|
"$listeners$": undefined,
|
|
8867
9065
|
"$lazyBundleId$": "-",
|
|
@@ -8869,49 +9067,277 @@ class DuetEmptyState {
|
|
|
8869
9067
|
}; }
|
|
8870
9068
|
}
|
|
8871
9069
|
|
|
8872
|
-
const
|
|
9070
|
+
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}";
|
|
8873
9071
|
|
|
8874
|
-
|
|
8875
|
-
* @slot unnamed default slot - The component’s primary content. All child nodes that do not have a slot attribute defined are inserted into this primary slot.
|
|
8876
|
-
* @slot tooltip - Use to place a tooltip alongside the fieldset label.
|
|
8877
|
-
*/
|
|
8878
|
-
class DuetFieldset {
|
|
9072
|
+
class DuetEditableTableButton {
|
|
8879
9073
|
constructor(hostRef) {
|
|
8880
9074
|
registerInstance(this, hostRef);
|
|
8881
|
-
this.
|
|
8882
|
-
this.
|
|
8883
|
-
this.hasTooltip = false;
|
|
9075
|
+
this.duetEditableItemAction = createEvent$2(this, "duetEditableItemAction", 7);
|
|
9076
|
+
this.isHovering = false;
|
|
8884
9077
|
/**
|
|
8885
|
-
* Theme of the
|
|
9078
|
+
* Theme of the empty state component.
|
|
8886
9079
|
*/
|
|
8887
9080
|
this.theme = "";
|
|
8888
9081
|
/**
|
|
8889
|
-
*
|
|
9082
|
+
* action items passed from host component
|
|
9083
|
+
* @internal
|
|
8890
9084
|
*/
|
|
8891
|
-
this.
|
|
9085
|
+
this.actions = undefined;
|
|
8892
9086
|
/**
|
|
8893
|
-
*
|
|
9087
|
+
* uid that gets passed along when the action is emitted
|
|
9088
|
+
* @internal
|
|
8894
9089
|
*/
|
|
8895
|
-
this.
|
|
8896
|
-
|
|
8897
|
-
|
|
9090
|
+
this.uid = "";
|
|
9091
|
+
/**
|
|
9092
|
+
* group associated with action
|
|
9093
|
+
* @internal
|
|
9094
|
+
*/
|
|
9095
|
+
this.group = "";
|
|
9096
|
+
/**
|
|
9097
|
+
* key of the item in the map
|
|
9098
|
+
* @internal
|
|
9099
|
+
*/
|
|
9100
|
+
this.keyName = "";
|
|
9101
|
+
this.onMouseEnter = () => {
|
|
9102
|
+
this.isHovering = true;
|
|
9103
|
+
};
|
|
9104
|
+
this.onMouseLeave = () => {
|
|
9105
|
+
this.isHovering = false;
|
|
8898
9106
|
};
|
|
8899
9107
|
}
|
|
8900
9108
|
/**
|
|
9109
|
+
/**
|
|
8901
9110
|
* Component lifecycle events.
|
|
8902
9111
|
*/
|
|
8903
9112
|
componentWillLoad() {
|
|
8904
9113
|
inheritGlobalTheme(this);
|
|
8905
|
-
|
|
9114
|
+
}
|
|
9115
|
+
/**
|
|
9116
|
+
/**
|
|
9117
|
+
* private functions
|
|
9118
|
+
*/
|
|
9119
|
+
emitActionEvent(ev) {
|
|
9120
|
+
this.duetEditableItemAction.emit({
|
|
9121
|
+
originalEvent: ev,
|
|
9122
|
+
uid: this.uid,
|
|
9123
|
+
group: this.group,
|
|
9124
|
+
action: this.actions.id,
|
|
9125
|
+
keyName: this.keyName,
|
|
9126
|
+
component: "duet-editable-table-item",
|
|
9127
|
+
});
|
|
8906
9128
|
}
|
|
8907
9129
|
/**
|
|
8908
9130
|
* render() function
|
|
8909
9131
|
* Always the last one in the class.
|
|
8910
9132
|
*/
|
|
8911
9133
|
render() {
|
|
8912
|
-
return (hAsync(
|
|
8913
|
-
"
|
|
8914
|
-
|
|
9134
|
+
return (hAsync("button", { style: {
|
|
9135
|
+
"border-color": this.isHovering
|
|
9136
|
+
? getColorByName(this.actions.color_hover)
|
|
9137
|
+
: getColorByName(this.actions.color),
|
|
9138
|
+
}, 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) }, hAsync("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" })));
|
|
9139
|
+
}
|
|
9140
|
+
get el() { return getElement(this); }
|
|
9141
|
+
static get style() { return duetEditableTableButtonCss; }
|
|
9142
|
+
static get cmpMeta() { return {
|
|
9143
|
+
"$flags$": 2,
|
|
9144
|
+
"$tagName$": "duet-editable-table-button",
|
|
9145
|
+
"$members$": {
|
|
9146
|
+
"theme": [1025],
|
|
9147
|
+
"actions": [16],
|
|
9148
|
+
"uid": [1],
|
|
9149
|
+
"group": [1],
|
|
9150
|
+
"keyName": [1, "key-name"],
|
|
9151
|
+
"isHovering": [32]
|
|
9152
|
+
},
|
|
9153
|
+
"$listeners$": undefined,
|
|
9154
|
+
"$lazyBundleId$": "-",
|
|
9155
|
+
"$attrsToReflect$": []
|
|
9156
|
+
}; }
|
|
9157
|
+
}
|
|
9158
|
+
|
|
9159
|
+
//simple functional component that renders the data in the table
|
|
9160
|
+
const TableData = ({ data, groupId }, _children) => {
|
|
9161
|
+
if (typeof data === "string") {
|
|
9162
|
+
return hAsync("td", { innerHTML: data, class: "duet-editable-table-content", part: `${groupId}content` });
|
|
9163
|
+
}
|
|
9164
|
+
else {
|
|
9165
|
+
return (hAsync("td", { class: "duet-editable-table-content", part: `${groupId}content` }, data));
|
|
9166
|
+
}
|
|
9167
|
+
};
|
|
9168
|
+
|
|
9169
|
+
const duetEditableTableItemCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-editable-table-item,*.sc-duet-editable-table-item::after,*.sc-duet-editable-table-item::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-editable-table-item-h{display:table-row;height:32px}/*!@.duet-editable-table-content, .duet-editable-table-actions*/.duet-editable-table-content.sc-duet-editable-table-item,.duet-editable-table-actions.sc-duet-editable-table-item{height:32px;padding:12px 0;vertical-align:middle;break-word:break-all;border-bottom:1px solid #e1e3e6}/*!@.duet-editable-table-actions-items*/.duet-editable-table-actions-items.sc-duet-editable-table-item{display:flex;justify-content:flex-end}/*!@.duet-editable-table-actions-items duet-editable-table-button*/.duet-editable-table-actions-items.sc-duet-editable-table-item duet-editable-table-button.sc-duet-editable-table-item{padding-left:8px}/*!@.duet-editable-table .editable-item-small*/.duet-editable-table.sc-duet-editable-table-item .editable-item-small.sc-duet-editable-table-item{font-size:0.75rem;font-weight:400}";
|
|
9170
|
+
|
|
9171
|
+
class DuetEditableTableItem {
|
|
9172
|
+
constructor(hostRef) {
|
|
9173
|
+
registerInstance(this, hostRef);
|
|
9174
|
+
this.duetEditableItemAction = createEvent$2(this, "duetEditableItemAction", 7);
|
|
9175
|
+
this.isHovering = false;
|
|
9176
|
+
/**
|
|
9177
|
+
* Theme of the empty state component.
|
|
9178
|
+
*/
|
|
9179
|
+
this.theme = "";
|
|
9180
|
+
/**
|
|
9181
|
+
* Actions that can be performed on the element
|
|
9182
|
+
*/
|
|
9183
|
+
this.actions = undefined;
|
|
9184
|
+
/**
|
|
9185
|
+
* GroupId used to pierce the shadowdom - gets concatenated with "content & actions" and used as part="groupIDcontent/actions" to pierce the content/Action item
|
|
9186
|
+
* @internal
|
|
9187
|
+
*/
|
|
9188
|
+
this.groupId = "";
|
|
9189
|
+
/**
|
|
9190
|
+
* Key used to identify item, when running actions
|
|
9191
|
+
*/
|
|
9192
|
+
this.keyName = "";
|
|
9193
|
+
/**
|
|
9194
|
+
* Object of data itemsused to render the entire row
|
|
9195
|
+
*/
|
|
9196
|
+
this.data = undefined;
|
|
9197
|
+
}
|
|
9198
|
+
watchPropHandler(_newValue, _oldValue) {
|
|
9199
|
+
// console.log("The new value of activated is: ", _newValue)
|
|
9200
|
+
}
|
|
9201
|
+
/**
|
|
9202
|
+
/**
|
|
9203
|
+
* Component lifecycle events.
|
|
9204
|
+
*/
|
|
9205
|
+
componentWillLoad() {
|
|
9206
|
+
inheritGlobalTheme(this);
|
|
9207
|
+
}
|
|
9208
|
+
/**
|
|
9209
|
+
/**
|
|
9210
|
+
* private functions
|
|
9211
|
+
*/
|
|
9212
|
+
/**
|
|
9213
|
+
* render() function
|
|
9214
|
+
* Always the last one in the class.
|
|
9215
|
+
*/
|
|
9216
|
+
render() {
|
|
9217
|
+
return (hAsync(Host, { role: "row" }, hAsync(TableData, { data: this.data.item, groupId: this.groupId }), hAsync("td", { class: "duet-editable-table-actions" }, hAsync("div", { class: "duet-editable-table-actions-items", part: `${this.groupId}actions` }, this.actions.map(result => {
|
|
9218
|
+
const { map = undefined } = result;
|
|
9219
|
+
// if map has been specified, only show the current action if groupID matches the map array
|
|
9220
|
+
if (map && !map.includes(this.groupId)) {
|
|
9221
|
+
return;
|
|
9222
|
+
}
|
|
9223
|
+
return (hAsync("duet-editable-table-button", { keyName: this.keyName, group: this.data.group, uid: this.data.uid, actions: result, theme: this.theme }));
|
|
9224
|
+
})))));
|
|
9225
|
+
}
|
|
9226
|
+
get el() { return getElement(this); }
|
|
9227
|
+
static get watchers() { return {
|
|
9228
|
+
"data": ["watchPropHandler"]
|
|
9229
|
+
}; }
|
|
9230
|
+
static get style() { return duetEditableTableItemCss; }
|
|
9231
|
+
static get cmpMeta() { return {
|
|
9232
|
+
"$flags$": 9,
|
|
9233
|
+
"$tagName$": "duet-editable-table-item",
|
|
9234
|
+
"$members$": {
|
|
9235
|
+
"theme": [1025],
|
|
9236
|
+
"actions": [16],
|
|
9237
|
+
"groupId": [1, "group-id"],
|
|
9238
|
+
"keyName": [1, "key-name"],
|
|
9239
|
+
"data": [1040],
|
|
9240
|
+
"isHovering": [32]
|
|
9241
|
+
},
|
|
9242
|
+
"$listeners$": undefined,
|
|
9243
|
+
"$lazyBundleId$": "-",
|
|
9244
|
+
"$attrsToReflect$": []
|
|
9245
|
+
}; }
|
|
9246
|
+
}
|
|
9247
|
+
|
|
9248
|
+
const duetEmptyStateCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-empty-state,*.sc-duet-empty-state::after,*.sc-duet-empty-state::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-empty-state-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%;height:100%}/*!@.duet-empty-state*/.duet-empty-state.sc-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*/.duet-empty-state.duet-theme-turva.sc-duet-empty-state{color:#171c3a;background:#f5f5f7}";
|
|
9249
|
+
|
|
9250
|
+
class DuetEmptyState {
|
|
9251
|
+
constructor(hostRef) {
|
|
9252
|
+
registerInstance(this, hostRef);
|
|
9253
|
+
/**
|
|
9254
|
+
* Theme of the empty state component.
|
|
9255
|
+
*/
|
|
9256
|
+
this.theme = "";
|
|
9257
|
+
/**
|
|
9258
|
+
* Icon shown in the empty state component.
|
|
9259
|
+
*/
|
|
9260
|
+
this.icon = "messaging-question";
|
|
9261
|
+
/**
|
|
9262
|
+
* The size of the empty state message.
|
|
9263
|
+
*/
|
|
9264
|
+
this.size = "medium";
|
|
9265
|
+
}
|
|
9266
|
+
/**
|
|
9267
|
+
* Component lifecycle events.
|
|
9268
|
+
*/
|
|
9269
|
+
componentWillLoad() {
|
|
9270
|
+
inheritGlobalTheme(this);
|
|
9271
|
+
}
|
|
9272
|
+
/**
|
|
9273
|
+
* render() function
|
|
9274
|
+
* Always the last one in the class.
|
|
9275
|
+
*/
|
|
9276
|
+
render() {
|
|
9277
|
+
return (hAsync(Host, null, hAsync("div", { class: {
|
|
9278
|
+
"duet-empty-state": true,
|
|
9279
|
+
"duet-theme-turva": this.theme === "turva",
|
|
9280
|
+
"duet-is-small": this.size === "small",
|
|
9281
|
+
} }, hAsync("duet-icon", { color: "currentColor", name: this.icon, size: this.size === "small" ? "large" : "x-large" }), hAsync("div", null, hAsync("slot", null)))));
|
|
9282
|
+
}
|
|
9283
|
+
static get style() { return duetEmptyStateCss; }
|
|
9284
|
+
static get cmpMeta() { return {
|
|
9285
|
+
"$flags$": 9,
|
|
9286
|
+
"$tagName$": "duet-empty-state",
|
|
9287
|
+
"$members$": {
|
|
9288
|
+
"theme": [1025],
|
|
9289
|
+
"icon": [1],
|
|
9290
|
+
"size": [1]
|
|
9291
|
+
},
|
|
9292
|
+
"$listeners$": undefined,
|
|
9293
|
+
"$lazyBundleId$": "-",
|
|
9294
|
+
"$attrsToReflect$": []
|
|
9295
|
+
}; }
|
|
9296
|
+
}
|
|
9297
|
+
|
|
9298
|
+
const duetFieldsetCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-fieldset,*.sc-duet-fieldset::after,*.sc-duet-fieldset::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-fieldset-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;display:block;width:100%}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-fieldset-h{margin:0 !important}/*!@fieldset*/fieldset.sc-duet-fieldset{border:0}/*!@legend*/legend.sc-duet-fieldset{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*/.duet-legend-wrapper.sc-duet-fieldset{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*/.duet-theme-turva.sc-duet-fieldset .duet-legend-wrapper.sc-duet-fieldset{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*/.duet-fieldset-label.sc-duet-fieldset{margin-bottom:12px !important;margin-top:8px}/*!@.duet-legend-has-caption .duet-fieldset-label*/.duet-legend-has-caption.sc-duet-fieldset .duet-fieldset-label.sc-duet-fieldset{margin-bottom:6px !important}/*!@.duet-legend-has-tooltip .duet-fieldset-label*/.duet-legend-has-tooltip.sc-duet-fieldset .duet-fieldset-label.sc-duet-fieldset{padding-right:36px}@media (min-width: 48em){/*!@.duet-legend-has-tooltip .duet-fieldset-label*/.duet-legend-has-tooltip.sc-duet-fieldset .duet-fieldset-label.sc-duet-fieldset{margin-bottom:3px !important;padding-right:0}}@media (min-width: 48em){/*!@.duet-legend-has-tooltip.duet-legend-has-caption .duet-fieldset-label*/.duet-legend-has-tooltip.duet-legend-has-caption.sc-duet-fieldset .duet-fieldset-label.sc-duet-fieldset{margin-bottom:-3px !important}}/*!@.duet-fieldset-caption*/.duet-fieldset-caption.sc-duet-fieldset{margin-bottom:12px !important}/*!@.duet-fieldset-help*/.duet-fieldset-help.sc-duet-fieldset{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*/.duet-fieldset-help.sc-duet-fieldset span.sc-duet-fieldset{display:block;margin-top:12px}/*!@.duet-theme-turva .duet-fieldset-help*/.duet-theme-turva.sc-duet-fieldset .duet-fieldset-help.sc-duet-fieldset{color:#e02a0d}/*!@::slotted(duet-tooltip)*/.sc-duet-fieldset-s>duet-tooltip{position:absolute;top:4px;right:0}@media (min-width: 48em){/*!@::slotted(duet-tooltip)*/.sc-duet-fieldset-s>duet-tooltip{position:relative;right:auto}}/*!@.duet-legend-hidden*/.duet-legend-hidden.sc-duet-fieldset{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
9299
|
+
|
|
9300
|
+
/**
|
|
9301
|
+
* @slot unnamed default slot - The component’s primary content. All child nodes that do not have a slot attribute defined are inserted into this primary slot.
|
|
9302
|
+
* @slot tooltip - Use to place a tooltip alongside the fieldset label.
|
|
9303
|
+
*/
|
|
9304
|
+
class DuetFieldset {
|
|
9305
|
+
constructor(hostRef) {
|
|
9306
|
+
registerInstance(this, hostRef);
|
|
9307
|
+
this.errorId = createID("DuetError");
|
|
9308
|
+
this.labelId = createID("DuetLabel");
|
|
9309
|
+
this.hasTooltip = false;
|
|
9310
|
+
/**
|
|
9311
|
+
* Theme of the fieldset.
|
|
9312
|
+
*/
|
|
9313
|
+
this.theme = "";
|
|
9314
|
+
/**
|
|
9315
|
+
* Controls the margin of the component.
|
|
9316
|
+
*/
|
|
9317
|
+
this.margin = "auto";
|
|
9318
|
+
/**
|
|
9319
|
+
* Visually hide the label, but still show it to screen readers.
|
|
9320
|
+
*/
|
|
9321
|
+
this.labelHidden = false;
|
|
9322
|
+
this.checkHasTooltip = () => {
|
|
9323
|
+
this.hasTooltip = !!this.element.querySelector("[slot='tooltip']");
|
|
9324
|
+
};
|
|
9325
|
+
}
|
|
9326
|
+
/**
|
|
9327
|
+
* Component lifecycle events.
|
|
9328
|
+
*/
|
|
9329
|
+
componentWillLoad() {
|
|
9330
|
+
inheritGlobalTheme(this);
|
|
9331
|
+
this.checkHasTooltip();
|
|
9332
|
+
}
|
|
9333
|
+
/**
|
|
9334
|
+
* render() function
|
|
9335
|
+
* Always the last one in the class.
|
|
9336
|
+
*/
|
|
9337
|
+
render() {
|
|
9338
|
+
return (hAsync(Host, { class: { "duet-m-0": this.margin === "none" } }, hAsync("fieldset", { "aria-labelledby": `${this.labelId} ${this.errorId}`, class: {
|
|
9339
|
+
"duet-fieldset": true,
|
|
9340
|
+
"duet-theme-turva": this.theme === "turva",
|
|
8915
9341
|
} }, hAsync("legend", { id: this.labelId }, hAsync("span", null, this.label), this.caption && hAsync("span", null, this.caption)), hAsync("div", { class: {
|
|
8916
9342
|
"duet-legend-wrapper": true,
|
|
8917
9343
|
"duet-legend-has-caption": !!this.caption,
|
|
@@ -9004,7 +9430,7 @@ class DuetFooter {
|
|
|
9004
9430
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
9005
9431
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
9006
9432
|
*/
|
|
9007
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
9433
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults, this.language);
|
|
9008
9434
|
/**
|
|
9009
9435
|
* Component event handling.
|
|
9010
9436
|
*/
|
|
@@ -9079,7 +9505,7 @@ class DuetFooter {
|
|
|
9079
9505
|
"logoHref": [1, "logo-href"],
|
|
9080
9506
|
"language": [1025],
|
|
9081
9507
|
"items": [8],
|
|
9082
|
-
"accessibleLabelExternalDefaults": [
|
|
9508
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
9083
9509
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
9084
9510
|
"menu": [8],
|
|
9085
9511
|
"processedItems": [32],
|
|
@@ -9099,6 +9525,7 @@ function isGridItem(element) {
|
|
|
9099
9525
|
class DuetGrid {
|
|
9100
9526
|
constructor(hostRef) {
|
|
9101
9527
|
registerInstance(this, hostRef);
|
|
9528
|
+
this.distributeFormElement = false;
|
|
9102
9529
|
/**
|
|
9103
9530
|
* Enable or disable the automatic responsive behaviour of the grid component.
|
|
9104
9531
|
* Setting this option to "true" makes sure that contents are stacked vertically
|
|
@@ -9115,7 +9542,9 @@ class DuetGrid {
|
|
|
9115
9542
|
*/
|
|
9116
9543
|
this.direction = "horizontal";
|
|
9117
9544
|
/**
|
|
9118
|
-
* Adjusts the vertical alignment of the grid items
|
|
9545
|
+
* Adjusts the vertical alignment of the grid items, if set to "form_distribute"
|
|
9546
|
+
* the grid will try to calculate correct paddings for any duet-input fields inside duet-grid-items,
|
|
9547
|
+
* so that they align even when displaying errors.
|
|
9119
9548
|
*/
|
|
9120
9549
|
this.alignment = "top";
|
|
9121
9550
|
/**
|
|
@@ -9127,14 +9556,34 @@ class DuetGrid {
|
|
|
9127
9556
|
*/
|
|
9128
9557
|
this.mobile = "";
|
|
9129
9558
|
}
|
|
9559
|
+
/**
|
|
9560
|
+
* Private functions
|
|
9561
|
+
*/
|
|
9562
|
+
/**
|
|
9563
|
+
* Returns the element height including margins
|
|
9564
|
+
* @param element - element
|
|
9565
|
+
* @returns {number}
|
|
9566
|
+
*/
|
|
9567
|
+
outerHeight(element) {
|
|
9568
|
+
const height = element.offsetHeight, style = window.getComputedStyle(element);
|
|
9569
|
+
return ["top", "bottom"]
|
|
9570
|
+
.map(side => parseInt(style[`margin-${side}`]))
|
|
9571
|
+
.reduce((total, side) => total + side, height);
|
|
9572
|
+
}
|
|
9130
9573
|
/**
|
|
9131
9574
|
* Component lifecycle events.
|
|
9132
9575
|
*/
|
|
9133
9576
|
async connectedCallback() {
|
|
9134
9577
|
const el = this.element;
|
|
9578
|
+
this.distributeFormElement = this.alignment === "form_distribute";
|
|
9135
9579
|
this.mutationO = watchForOptions(el, "duet-grid-item", () => {
|
|
9136
9580
|
this.updateGridItems();
|
|
9137
9581
|
});
|
|
9582
|
+
if (this.distributeFormElement) {
|
|
9583
|
+
this.mutation1 = watchForElement(el, "duet-input", () => {
|
|
9584
|
+
this.updateGridItemsWithInputFields();
|
|
9585
|
+
});
|
|
9586
|
+
}
|
|
9138
9587
|
this.updateGridItems();
|
|
9139
9588
|
}
|
|
9140
9589
|
disconnectedCallback() {
|
|
@@ -9142,6 +9591,10 @@ class DuetGrid {
|
|
|
9142
9591
|
this.mutationO.disconnect();
|
|
9143
9592
|
this.mutationO = undefined;
|
|
9144
9593
|
}
|
|
9594
|
+
if (this.mutation1) {
|
|
9595
|
+
this.mutation1.disconnect();
|
|
9596
|
+
this.mutation1 = undefined;
|
|
9597
|
+
}
|
|
9145
9598
|
}
|
|
9146
9599
|
/**
|
|
9147
9600
|
* Local methods
|
|
@@ -9153,6 +9606,27 @@ class DuetGrid {
|
|
|
9153
9606
|
item.breakpoint = this.breakpoint;
|
|
9154
9607
|
});
|
|
9155
9608
|
}
|
|
9609
|
+
async updateGridItemsWithInputFields() {
|
|
9610
|
+
const items = Array.from(this.element.children).filter(isGridItem);
|
|
9611
|
+
let maxHeight = 0;
|
|
9612
|
+
const sizes = [];
|
|
9613
|
+
items.forEach(item => {
|
|
9614
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
9615
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
9616
|
+
sizes.push(height);
|
|
9617
|
+
});
|
|
9618
|
+
maxHeight = Math.max(...sizes);
|
|
9619
|
+
items.forEach(item => {
|
|
9620
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
9621
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
9622
|
+
if (height < maxHeight) {
|
|
9623
|
+
item.setAttribute("style", `padding-bottom: ${maxHeight - height}px;`);
|
|
9624
|
+
}
|
|
9625
|
+
else if (height === maxHeight) {
|
|
9626
|
+
item.setAttribute("style", `padding-bottom: 0px;`);
|
|
9627
|
+
}
|
|
9628
|
+
});
|
|
9629
|
+
}
|
|
9156
9630
|
/**
|
|
9157
9631
|
* render() function
|
|
9158
9632
|
* Always the last one in the class.
|
|
@@ -9162,7 +9636,7 @@ class DuetGrid {
|
|
|
9162
9636
|
"duet-grid": true,
|
|
9163
9637
|
"duet-no-stacking": !this.responsive,
|
|
9164
9638
|
"duet-grid-align-top": this.alignment === "top",
|
|
9165
|
-
"duet-grid-align-bottom": this.alignment === "bottom",
|
|
9639
|
+
"duet-grid-align-bottom": this.alignment === "bottom" || this.alignment === "form_distribute",
|
|
9166
9640
|
"duet-grid-align-center": this.alignment === "center",
|
|
9167
9641
|
"duet-grid-align-stretch": this.alignment === "stretch",
|
|
9168
9642
|
"duet-grid-align-baseline": this.alignment === "baseline",
|
|
@@ -9197,7 +9671,8 @@ class DuetGrid {
|
|
|
9197
9671
|
"direction": [1],
|
|
9198
9672
|
"alignment": [1],
|
|
9199
9673
|
"distribution": [1],
|
|
9200
|
-
"mobile": [1]
|
|
9674
|
+
"mobile": [1],
|
|
9675
|
+
"distributeFormElement": [32]
|
|
9201
9676
|
},
|
|
9202
9677
|
"$listeners$": undefined,
|
|
9203
9678
|
"$lazyBundleId$": "-",
|
|
@@ -9518,10 +9993,26 @@ class DuetHeader {
|
|
|
9518
9993
|
*/
|
|
9519
9994
|
this.language = getLanguage();
|
|
9520
9995
|
/**
|
|
9521
|
-
*
|
|
9522
|
-
*
|
|
9996
|
+
* Default strings for accessibleI18nLabels
|
|
9997
|
+
* @default {
|
|
9998
|
+
fi: {
|
|
9999
|
+
skipLabel: "Siirry pääsisältöön",
|
|
10000
|
+
changeLanguage: "Vaihda kieltä",
|
|
10001
|
+
activeLanguage: "Suomi valittuna",
|
|
10002
|
+
},
|
|
10003
|
+
sv: {
|
|
10004
|
+
skipLabel: "Hoppa till huvudinnehåll",
|
|
10005
|
+
changeLanguage: "Ändra Språk",
|
|
10006
|
+
activeLanguage: "Svenska valt",
|
|
10007
|
+
},
|
|
10008
|
+
en: {
|
|
10009
|
+
skipLabel: "Skip to main content",
|
|
10010
|
+
changeLanguage: "Change language",
|
|
10011
|
+
activeLanguage: "English selected",
|
|
10012
|
+
},
|
|
10013
|
+
}
|
|
9523
10014
|
*/
|
|
9524
|
-
this.
|
|
10015
|
+
this.accessibleI18nLabelsDefaults = {
|
|
9525
10016
|
fi: {
|
|
9526
10017
|
skipLabel: "Siirry pääsisältöön",
|
|
9527
10018
|
changeLanguage: "Vaihda kieltä",
|
|
@@ -9558,7 +10049,7 @@ class DuetHeader {
|
|
|
9558
10049
|
},
|
|
9559
10050
|
}
|
|
9560
10051
|
*/
|
|
9561
|
-
this.accessibleI18nLabels = getLocaleString(this.
|
|
10052
|
+
this.accessibleI18nLabels = getLocaleString(this.accessibleI18nLabelsDefaults);
|
|
9562
10053
|
/**
|
|
9563
10054
|
* Property to change accessibleLabelExternal defaults on the component.
|
|
9564
10055
|
* normally you would handle these strings on an application level and override @accessibleLabelExternal when needed
|
|
@@ -9574,7 +10065,7 @@ class DuetHeader {
|
|
|
9574
10065
|
* Property to change accessibleLabel defaults on the component.
|
|
9575
10066
|
* normally you would handle these strings on an application level and override @accessibleLabel when needed
|
|
9576
10067
|
*/
|
|
9577
|
-
this.
|
|
10068
|
+
this.accessibleLabelDefaults = {
|
|
9578
10069
|
fi: "Valikko",
|
|
9579
10070
|
sv: "Meny",
|
|
9580
10071
|
en: "Menu",
|
|
@@ -9588,7 +10079,7 @@ class DuetHeader {
|
|
|
9588
10079
|
en: "Menu",
|
|
9589
10080
|
}
|
|
9590
10081
|
*/
|
|
9591
|
-
this.accessibleLabel = getLocaleString(this.
|
|
10082
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefaults);
|
|
9592
10083
|
/**
|
|
9593
10084
|
* URL that the logo link points to.
|
|
9594
10085
|
*/
|
|
@@ -9871,11 +10362,11 @@ class DuetHeader {
|
|
|
9871
10362
|
"$members$": {
|
|
9872
10363
|
"theme": [1025],
|
|
9873
10364
|
"language": [1025],
|
|
9874
|
-
"
|
|
10365
|
+
"accessibleI18nLabelsDefaults": [1, "accessible-labels-default"],
|
|
9875
10366
|
"accessibleI18nLabels": [16],
|
|
9876
|
-
"accessibleLabelExternalDefaults": [
|
|
10367
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
9877
10368
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
9878
|
-
"
|
|
10369
|
+
"accessibleLabelDefaults": [1, "accessible-label-default"],
|
|
9879
10370
|
"accessibleLabel": [1, "accessible-label"],
|
|
9880
10371
|
"user": [8],
|
|
9881
10372
|
"logoHref": [1, "logo-href"],
|
|
@@ -9906,7 +10397,7 @@ class DuetHeader {
|
|
|
9906
10397
|
}; }
|
|
9907
10398
|
}
|
|
9908
10399
|
|
|
9909
|
-
const duetHeadingCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-heading,*.sc-duet-heading::after,*.sc-duet-heading::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-heading-h{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*/.duet-heading.sc-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*/.duet-heading.sc-duet-heading{margin-bottom:20px !important}}/*!@.duet-heading.duet-theme-turva*/.duet-heading.duet-theme-turva.sc-duet-heading{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*/.duet-heading.duet-heading-border.sc-duet-heading{padding-bottom:20px;border-bottom:1px solid #e1e3e6}/*!@.duet-heading.duet-heading-hyphenate*/.duet-heading.duet-heading-hyphenate.sc-duet-heading{-webkit-hyphens:auto;hyphens:auto}/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:9.4vw}/*!@.duet-heading.h0.duet-p-0*/.duet-heading.h0.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h0.duet-m-0*/.duet-heading.h0.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 31.914893617rem){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:3rem}}@media (min-width: 47.8723404255rem){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:4.5rem}}@media (max-width: 22.5em){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:2.25rem}}/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:7vw}/*!@.duet-heading.h1.duet-p-0*/.duet-heading.h1.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h1.duet-m-0*/.duet-heading.h1.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 32.1428571429rem){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:2.25rem}}@media (min-width: 42.8571428571rem){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:3rem}}@media (max-width: 22.5em){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:1.5rem}}/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:5.8vw}/*!@.duet-heading.h2.duet-p-0*/.duet-heading.h2.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h2.duet-m-0*/.duet-heading.h2.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 25.8620689655rem){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:1.5rem}}@media (min-width: 38.7931034483rem){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:2.25rem}}@media (max-width: 22.5em){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:1.375rem}}/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{margin-bottom:12px !important;font-size:4.2vw}/*!@.duet-heading.h3.duet-p-0*/.duet-heading.h3.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h3.duet-m-0*/.duet-heading.h3.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 29.7619047619rem){/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{font-size:1.25rem}}@media (min-width: 35.7142857143rem){/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{font-size:1.5rem}}/*!@.duet-heading.h3.duet-theme-turva*/.duet-heading.h3.duet-theme-turva.sc-duet-heading{font-style:normal}/*!@.duet-heading.h3.duet-heading-border*/.duet-heading.h3.duet-heading-border.sc-duet-heading{padding-bottom:20px}/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{margin-bottom:8px !important;font-size:4vw;letter-spacing:0}/*!@.duet-heading.h4.duet-p-0*/.duet-heading.h4.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h4.duet-m-0*/.duet-heading.h4.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 27.5rem){/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{font-size:1.1rem}}@media (min-width: 31.25rem){/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{font-size:1.25rem}}/*!@.duet-heading.h4.duet-theme-turva*/.duet-heading.h4.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h4.duet-heading-border*/.duet-heading.h4.duet-heading-border.sc-duet-heading{padding-bottom:20px}/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{margin-bottom:8px !important;font-size:4vw;font-weight:600;letter-spacing:0}/*!@.duet-heading.h5.duet-p-0*/.duet-heading.h5.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h5.duet-m-0*/.duet-heading.h5.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 27.5rem){/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{font-size:1.1rem}}@media (min-width: 28.4090909091rem){/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{font-size:1.1363636364rem}}/*!@.duet-heading.h5.duet-theme-turva*/.duet-heading.h5.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h5.duet-heading-border*/.duet-heading.h5.duet-heading-border.sc-duet-heading{padding-bottom:16px}/*!@.duet-heading.h6*/.duet-heading.h6.sc-duet-heading{margin-bottom:8px !important;font-size:1rem;font-weight:600;letter-spacing:0}/*!@.duet-heading.h6.duet-p-0*/.duet-heading.h6.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h6.duet-m-0*/.duet-heading.h6.duet-m-0.sc-duet-heading{margin:0 !important}/*!@.duet-heading.h6.duet-theme-turva*/.duet-heading.h6.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h6.duet-heading-border*/.duet-heading.h6.duet-heading-border.sc-duet-heading{padding-bottom:16px}/*!@.duet-heading.duet-semibold, .duet-heading.duet-theme-turva.duet-semibold*/.duet-heading.duet-semibold.sc-duet-heading,.duet-heading.duet-theme-turva.duet-semibold.sc-duet-heading{font-style:normal !important;font-weight:600 !important}";
|
|
10400
|
+
const duetHeadingCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-heading,*.sc-duet-heading::after,*.sc-duet-heading::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-heading-h{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*/.duet-heading.sc-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*/.duet-heading.sc-duet-heading{margin-bottom:20px !important}}/*!@.duet-heading.duet-theme-turva*/.duet-heading.duet-theme-turva.sc-duet-heading{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*/.duet-heading.duet-heading-border.sc-duet-heading{padding-bottom:20px;border-bottom:1px solid #e1e3e6}/*!@.duet-heading.duet-heading-border.duet-heading-border-solid*/.duet-heading.duet-heading-border.duet-heading-border-solid.sc-duet-heading{border-bottom-color:#657787}/*!@.duet-heading.duet-heading-hyphenate*/.duet-heading.duet-heading-hyphenate.sc-duet-heading{-webkit-hyphens:auto;hyphens:auto}/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:9.4vw}/*!@.duet-heading.h0.duet-p-0*/.duet-heading.h0.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h0.duet-m-0*/.duet-heading.h0.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 31.914893617rem){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:3rem}}@media (min-width: 47.8723404255rem){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:4.5rem}}@media (max-width: 22.5em){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:2.25rem}}/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:7vw}/*!@.duet-heading.h1.duet-p-0*/.duet-heading.h1.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h1.duet-m-0*/.duet-heading.h1.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 32.1428571429rem){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:2.25rem}}@media (min-width: 42.8571428571rem){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:3rem}}@media (max-width: 22.5em){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:1.5rem}}/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:5.8vw}/*!@.duet-heading.h2.duet-p-0*/.duet-heading.h2.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h2.duet-m-0*/.duet-heading.h2.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 25.8620689655rem){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:1.5rem}}@media (min-width: 38.7931034483rem){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:2.25rem}}@media (max-width: 22.5em){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:1.375rem}}/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{margin-bottom:12px !important;font-size:4.2vw}/*!@.duet-heading.h3.duet-p-0*/.duet-heading.h3.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h3.duet-m-0*/.duet-heading.h3.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 29.7619047619rem){/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{font-size:1.25rem}}@media (min-width: 35.7142857143rem){/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{font-size:1.5rem}}/*!@.duet-heading.h3.duet-theme-turva*/.duet-heading.h3.duet-theme-turva.sc-duet-heading{font-style:normal}/*!@.duet-heading.h3.duet-heading-border*/.duet-heading.h3.duet-heading-border.sc-duet-heading{padding-bottom:20px}/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{margin-bottom:8px !important;font-size:4vw;letter-spacing:0}/*!@.duet-heading.h4.duet-p-0*/.duet-heading.h4.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h4.duet-m-0*/.duet-heading.h4.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 27.5rem){/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{font-size:1.1rem}}@media (min-width: 31.25rem){/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{font-size:1.25rem}}/*!@.duet-heading.h4.duet-theme-turva*/.duet-heading.h4.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h4.duet-heading-border*/.duet-heading.h4.duet-heading-border.sc-duet-heading{padding-bottom:20px}/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{margin-bottom:8px !important;font-size:4vw;font-weight:600;letter-spacing:0}/*!@.duet-heading.h5.duet-p-0*/.duet-heading.h5.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h5.duet-m-0*/.duet-heading.h5.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 27.5rem){/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{font-size:1.1rem}}@media (min-width: 28.4090909091rem){/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{font-size:1.1363636364rem}}/*!@.duet-heading.h5.duet-theme-turva*/.duet-heading.h5.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h5.duet-heading-border*/.duet-heading.h5.duet-heading-border.sc-duet-heading{padding-bottom:16px}/*!@.duet-heading.h6*/.duet-heading.h6.sc-duet-heading{margin-bottom:8px !important;font-size:1rem;font-weight:600;letter-spacing:0}/*!@.duet-heading.h6.duet-p-0*/.duet-heading.h6.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h6.duet-m-0*/.duet-heading.h6.duet-m-0.sc-duet-heading{margin:0 !important}/*!@.duet-heading.h6.duet-theme-turva*/.duet-heading.h6.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h6.duet-heading-border*/.duet-heading.h6.duet-heading-border.sc-duet-heading{padding-bottom:16px}/*!@.duet-heading.duet-semibold, .duet-heading.duet-theme-turva.duet-semibold*/.duet-heading.duet-semibold.sc-duet-heading,.duet-heading.duet-theme-turva.duet-semibold.sc-duet-heading{font-style:normal !important;font-weight:600 !important}";
|
|
9910
10401
|
|
|
9911
10402
|
class DuetHeading {
|
|
9912
10403
|
constructor(hostRef) {
|
|
@@ -9920,7 +10411,7 @@ class DuetHeading {
|
|
|
9920
10411
|
*/
|
|
9921
10412
|
this.margin = "auto";
|
|
9922
10413
|
/**
|
|
9923
|
-
* Enable or disable the border underneath the heading
|
|
10414
|
+
* Enable or disable the border underneath the heading, solid will darken the border
|
|
9924
10415
|
*/
|
|
9925
10416
|
this.border = false;
|
|
9926
10417
|
/**
|
|
@@ -9953,11 +10444,12 @@ class DuetHeading {
|
|
|
9953
10444
|
* Always the last one in the class.
|
|
9954
10445
|
*/
|
|
9955
10446
|
render() {
|
|
9956
|
-
const TagName = sanitizeString(this.level);
|
|
10447
|
+
const TagName = sanitizeString$1(this.level);
|
|
9957
10448
|
const color = getColorByName(this.color);
|
|
9958
10449
|
return (hAsync(TagName, { class: {
|
|
9959
10450
|
"duet-heading": true,
|
|
9960
|
-
"duet-heading-border": this.border,
|
|
10451
|
+
"duet-heading-border": this.border !== false,
|
|
10452
|
+
"duet-heading-border-solid": this.border === "solid",
|
|
9961
10453
|
"duet-semibold": this.weight === "semibold",
|
|
9962
10454
|
"duet-heading-hyphenate": this.hyphenate,
|
|
9963
10455
|
"duet-m-0": this.margin === "none",
|
|
@@ -9974,7 +10466,7 @@ class DuetHeading {
|
|
|
9974
10466
|
"level": [513],
|
|
9975
10467
|
"margin": [1],
|
|
9976
10468
|
"visualLevel": [1, "visual-level"],
|
|
9977
|
-
"border": [
|
|
10469
|
+
"border": [8],
|
|
9978
10470
|
"weight": [1],
|
|
9979
10471
|
"color": [1],
|
|
9980
10472
|
"theme": [1025],
|
|
@@ -10059,15 +10551,15 @@ class DuetHero {
|
|
|
10059
10551
|
*/
|
|
10060
10552
|
this.language = getLanguage();
|
|
10061
10553
|
/**
|
|
10062
|
-
*
|
|
10063
|
-
*
|
|
10554
|
+
* Defaults for accessibleLabelExternal
|
|
10555
|
+
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10064
10556
|
*/
|
|
10065
10557
|
this.accessibleLabelExternalDefaults = DuetStringsExternalDefaults;
|
|
10066
10558
|
/**
|
|
10067
10559
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
10068
10560
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10069
10561
|
*/
|
|
10070
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
10562
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
10071
10563
|
/**
|
|
10072
10564
|
* URL that the button links to.
|
|
10073
10565
|
*/
|
|
@@ -10211,7 +10703,7 @@ class DuetHero {
|
|
|
10211
10703
|
"categoryIconColor": [1, "category-icon-color"],
|
|
10212
10704
|
"buttonLabel": [1, "button-label"],
|
|
10213
10705
|
"language": [1025],
|
|
10214
|
-
"accessibleLabelExternalDefaults": [
|
|
10706
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
10215
10707
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
10216
10708
|
"buttonUrl": [1, "button-url"],
|
|
10217
10709
|
"buttonId": [1, "button-id"],
|
|
@@ -10233,6 +10725,76 @@ class DuetHero {
|
|
|
10233
10725
|
}; }
|
|
10234
10726
|
}
|
|
10235
10727
|
|
|
10728
|
+
const cleanupSvg = (svgContent) => {
|
|
10729
|
+
if (typeof document === "undefined" || !svgContent) {
|
|
10730
|
+
return;
|
|
10731
|
+
}
|
|
10732
|
+
const div = document.createElement("div");
|
|
10733
|
+
div.innerHTML = svgContent;
|
|
10734
|
+
// setup this way to ensure it works on our buddy IE
|
|
10735
|
+
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
|
10736
|
+
const child = div.childNodes[i];
|
|
10737
|
+
if (child.nodeName.toLowerCase() !== "svg") {
|
|
10738
|
+
div.removeChild(div.childNodes[i]);
|
|
10739
|
+
}
|
|
10740
|
+
}
|
|
10741
|
+
return div.firstElementChild;
|
|
10742
|
+
};
|
|
10743
|
+
const isValid = (elm) => {
|
|
10744
|
+
if (elm.nodeName.toLowerCase() === "script") {
|
|
10745
|
+
return false;
|
|
10746
|
+
}
|
|
10747
|
+
for (let i = 0; i < elm.attributes.length; i++) {
|
|
10748
|
+
const attribute = elm.attributes[i];
|
|
10749
|
+
if (attribute.name.toLowerCase().indexOf("on") === 0) {
|
|
10750
|
+
return false;
|
|
10751
|
+
}
|
|
10752
|
+
}
|
|
10753
|
+
if (elm.children) {
|
|
10754
|
+
for (let i = 0; i < elm.children.length; i++) {
|
|
10755
|
+
if (!isValid(elm.children[i])) {
|
|
10756
|
+
return false;
|
|
10757
|
+
}
|
|
10758
|
+
}
|
|
10759
|
+
}
|
|
10760
|
+
return true;
|
|
10761
|
+
};
|
|
10762
|
+
const buildIconUrl = (iconName) => {
|
|
10763
|
+
// under normal operations the Icons should always be loaded from the CDN
|
|
10764
|
+
{
|
|
10765
|
+
return `${Env.cdnURIProd}/icons/${Env.duetIconVersion}/lib/assets/${iconName}.svg`;
|
|
10766
|
+
}
|
|
10767
|
+
};
|
|
10768
|
+
const iconCache = {};
|
|
10769
|
+
function fetchIconByUrl(url) {
|
|
10770
|
+
if (iconCache[url]) {
|
|
10771
|
+
return iconCache[url];
|
|
10772
|
+
}
|
|
10773
|
+
// we create a function that covers all the fetching, cleanup, validation etc,
|
|
10774
|
+
// this way we can perform that work just once, and then return the same promise in future.
|
|
10775
|
+
async function doFetch() {
|
|
10776
|
+
const res = await fetch(url);
|
|
10777
|
+
if (!res.ok) {
|
|
10778
|
+
throw new Error(`SVG request failed: ${res.status} ${res.statusText}`);
|
|
10779
|
+
}
|
|
10780
|
+
const responseText = await res.text();
|
|
10781
|
+
const svgElement = cleanupSvg(responseText);
|
|
10782
|
+
if (!isValid(svgElement)) {
|
|
10783
|
+
throw new Error("SVG validation failed");
|
|
10784
|
+
}
|
|
10785
|
+
// OuterHTML does not unfortunately work here with IE11
|
|
10786
|
+
// was previously: resolve(svgElement.outerHTML)
|
|
10787
|
+
const div = document.createElement("div");
|
|
10788
|
+
div.appendChild(svgElement);
|
|
10789
|
+
return div.innerHTML;
|
|
10790
|
+
}
|
|
10791
|
+
// we do not `await` the fetch, as we only care about initiating the work,
|
|
10792
|
+
// it's the responsibility of the calling code to wait for the response.
|
|
10793
|
+
const req = doFetch();
|
|
10794
|
+
// cache for the repeat requests
|
|
10795
|
+
return (iconCache[url] = req);
|
|
10796
|
+
}
|
|
10797
|
+
|
|
10236
10798
|
const duetIconCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-icon,*.sc-duet-icon::after,*.sc-duet-icon::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-icon-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;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)*/.duet-icon-has-outline.sc-duet-icon-h{margin-bottom:0 !important}}@media (max-width: 35.9375em){/*!@:host(.duet-icon-has-background)*/.duet-icon-has-background.sc-duet-icon-h{margin-bottom:0 !important}}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-icon-h{margin:0 !important}@media (max-width: 35.9375em){/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-icon-h{margin:0 !important}}/*!@.duet-icon*/.duet-icon.sc-duet-icon{-webkit-user-select:none;user-select:none;width:100%;height:100%;transform-origin:top center}/*!@.duet-icon.duet-icon-has-outline*/.duet-icon.duet-icon-has-outline.sc-duet-icon{padding:12px;border-style:solid;border-width:1px;border-radius:50%}@media (max-width: 35.9375em){/*!@.duet-icon.duet-icon-has-outline*/.duet-icon.duet-icon-has-outline.sc-duet-icon{outline:1px solid transparent;transform:scale(0.8)}}/*!@.duet-icon.duet-icon-has-background*/.duet-icon.duet-icon-has-background.sc-duet-icon{padding:16px;color:white;border-radius:50%}@media (max-width: 35.9375em){/*!@.duet-icon.duet-icon-has-background*/.duet-icon.duet-icon-has-background.sc-duet-icon{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*/.duet-icon.duet-icon-has-background.duet-theme-turva.sc-duet-icon,.duet-icon.duet-icon-has-background.duet-theme-default.sc-duet-icon{color:white}/*!@.duet-icon.duet-icon-has-background.xxx-small .duet-icon-svg, .duet-icon.duet-icon-has-outline.xxx-small .duet-icon-svg*/.duet-icon.duet-icon-has-background.xxx-small.sc-duet-icon .duet-icon-svg.sc-duet-icon,.duet-icon.duet-icon-has-outline.xxx-small.sc-duet-icon .duet-icon-svg.sc-duet-icon{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*/.duet-icon.duet-icon-has-background.xx-small.sc-duet-icon .duet-icon-svg.sc-duet-icon,.duet-icon.duet-icon-has-outline.xx-small.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:16px;height:16px}@media (max-width: 35.9375em){/*!@.duet-icon.duet-icon-not-responsive*/.duet-icon.duet-icon-not-responsive.sc-duet-icon{transform:scale(1) !important}}/*!@.duet-icon.duet-theme-default*/.duet-icon.duet-theme-default.sc-duet-icon{color:#0077b3}/*!@.duet-icon.duet-theme-turva*/.duet-icon.duet-theme-turva.sc-duet-icon{color:#c60c30}/*!@.duet-icon.auto .duet-icon-svg*/.duet-icon.auto.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:100%;height:100%}/*!@.duet-icon.xxx-small .duet-icon-svg*/.duet-icon.xxx-small.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:7px;height:7px}/*!@.duet-icon.duet-icon-has-background.xxx-small*/.duet-icon.duet-icon-has-background.xxx-small.sc-duet-icon{padding:6px}/*!@.duet-icon.duet-icon-has-outline.xxx-small*/.duet-icon.duet-icon-has-outline.xxx-small.sc-duet-icon{padding:4px}/*!@.duet-icon.xx-small .duet-icon-svg*/.duet-icon.xx-small.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:10px;height:10px}/*!@.duet-icon.duet-icon-has-background.xx-small*/.duet-icon.duet-icon-has-background.xx-small.sc-duet-icon{padding:8px}/*!@.duet-icon.duet-icon-has-outline.xx-small*/.duet-icon.duet-icon-has-outline.xx-small.sc-duet-icon{padding:7px}/*!@.duet-icon.x-small .duet-icon-svg*/.duet-icon.x-small.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:16px;height:16px}/*!@.duet-icon.duet-icon-has-outline.x-small*/.duet-icon.duet-icon-has-outline.x-small.sc-duet-icon{padding:10px}/*!@.duet-icon.duet-icon-has-background.x-small*/.duet-icon.duet-icon-has-background.x-small.sc-duet-icon{padding:12px}/*!@.duet-icon.small .duet-icon-svg*/.duet-icon.small.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:20px;height:20px}/*!@.duet-icon.duet-icon-has-background.small*/.duet-icon.duet-icon-has-background.small.sc-duet-icon{padding:14px}/*!@.duet-icon.large .duet-icon-svg*/.duet-icon.large.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:30px;height:30px}/*!@.duet-icon.x-large .duet-icon-svg*/.duet-icon.x-large.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:36px;height:36px}/*!@.duet-icon.xx-large .duet-icon-svg*/.duet-icon.xx-large.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:48px;height:48px}/*!@.duet-icon.xxx-large .duet-icon-svg*/.duet-icon.xxx-large.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:48px;height:48px}@media (min-width: 48em){/*!@.duet-icon.xxx-large .duet-icon-svg*/.duet-icon.xxx-large.sc-duet-icon .duet-icon-svg.sc-duet-icon{width:72px;height:72px}}/*!@.duet-icon .duet-icon-svg*/.duet-icon.sc-duet-icon .duet-icon-svg.sc-duet-icon{display:block;width:24px;min-width:100%;height:24px;font-size:0}/*!@.duet-icon svg*/.duet-icon.sc-duet-icon svg.sc-duet-icon{width:100%;min-width:100%;fill:currentColor}";
|
|
10237
10799
|
|
|
10238
10800
|
class DuetIcon {
|
|
@@ -10289,7 +10851,7 @@ class DuetIcon {
|
|
|
10289
10851
|
if (this.src && this.icon) {
|
|
10290
10852
|
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);
|
|
10291
10853
|
}
|
|
10292
|
-
this.loadIcon();
|
|
10854
|
+
return this.loadIcon();
|
|
10293
10855
|
}
|
|
10294
10856
|
async loadIcon() {
|
|
10295
10857
|
// static icon known at build-time, so we can set it synchronously
|
|
@@ -10297,9 +10859,13 @@ class DuetIcon {
|
|
|
10297
10859
|
this.svgContent = this.icon;
|
|
10298
10860
|
return;
|
|
10299
10861
|
}
|
|
10300
|
-
//
|
|
10301
|
-
|
|
10302
|
-
|
|
10862
|
+
// dynamically load icon from url
|
|
10863
|
+
const src = this.src ? this.src : buildIconUrl(this.name);
|
|
10864
|
+
try {
|
|
10865
|
+
this.svgContent = await fetchIconByUrl(src);
|
|
10866
|
+
}
|
|
10867
|
+
catch (e) {
|
|
10868
|
+
console.warn(`[DUET COMPONENTS]: <duet-icon> could not load SVG from URL: ${src}.`, e);
|
|
10303
10869
|
}
|
|
10304
10870
|
}
|
|
10305
10871
|
/**
|
|
@@ -10409,7 +10975,7 @@ function cleanValue(input, regex) {
|
|
|
10409
10975
|
return newValue;
|
|
10410
10976
|
}
|
|
10411
10977
|
|
|
10412
|
-
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%}";
|
|
10978
|
+
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%}";
|
|
10413
10979
|
|
|
10414
10980
|
const icons = {
|
|
10415
10981
|
search: formSearch,
|
|
@@ -10549,7 +11115,7 @@ class DuetInput {
|
|
|
10549
11115
|
// (in webkit based browsers settings value trigger cursor position and will set it to EndOfText)
|
|
10550
11116
|
restoreCursor();
|
|
10551
11117
|
}
|
|
10552
|
-
this.isCaptionVisible = !!
|
|
11118
|
+
this.isCaptionVisible = !!this.caption;
|
|
10553
11119
|
const emitEvent = () => this.duetChange.emit({
|
|
10554
11120
|
value: this.value,
|
|
10555
11121
|
component: "duet-input",
|
|
@@ -10568,7 +11134,7 @@ class DuetInput {
|
|
|
10568
11134
|
componentWillLoad() {
|
|
10569
11135
|
inheritGlobalTheme(this);
|
|
10570
11136
|
this.disallowedPatternChange();
|
|
10571
|
-
this.isCaptionVisible = !!
|
|
11137
|
+
this.isCaptionVisible = !!this.caption;
|
|
10572
11138
|
}
|
|
10573
11139
|
/**
|
|
10574
11140
|
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
@@ -10603,12 +11169,12 @@ class DuetInput {
|
|
|
10603
11169
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
10604
11170
|
"has-icon": !!this.icon || (this.type !== "text" && this.type !== "tel" && this.type !== "password"),
|
|
10605
11171
|
"has-error": !!this.error,
|
|
10606
|
-
} }, hAsync("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 && (hAsync("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (hAsync("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), this.placeholder && this.echoPlaceholder && this.value && (hAsync("duet-caption", { id: this.topCaptionPlaceholderId,
|
|
11172
|
+
} }, hAsync("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 && (hAsync("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (hAsync("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), hAsync("div", { class: "duet-input-relative" }, this.placeholder && this.echoPlaceholder && this.value && (hAsync("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-input-placeholder", margin: "none", size: "small" }, this.placeholder)), hAsync("input", Object.assign({ ref: input => (this.nativeInput = input), onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, type: this.type, class: {
|
|
10607
11173
|
"duet-input": true,
|
|
10608
11174
|
disabled: this.disabled,
|
|
10609
11175
|
"is-number": this.component === "number",
|
|
10610
11176
|
"is-date": this.component === "date",
|
|
10611
|
-
}, 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" && (hAsync("div", { class: "duet-input-icon" }, hAsync("duet-icon", { margin: "none", size: "small", icon: icons[this.type].svg, color: "currentColor" }))), this.icon && (hAsync("div", { class: "duet-input-icon" }, hAsync("duet-icon", { margin: "none", size: "small", name: this.icon, color: "currentColor" }))), hAsync("slot", null)), hAsync("span", { class: "duet-input-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && hAsync("span",
|
|
11177
|
+
}, 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" && (hAsync("div", { class: "duet-input-icon" }, hAsync("duet-icon", { margin: "none", size: "small", icon: icons[this.type].svg, color: "currentColor" }))), this.icon && (hAsync("div", { class: "duet-input-icon" }, hAsync("duet-icon", { margin: "none", size: "small", name: this.icon, color: "currentColor" }))), hAsync("slot", null)), hAsync("span", { class: "duet-input-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && hAsync("span", { class: "duet-input-error" }, this.error)))));
|
|
10612
11178
|
}
|
|
10613
11179
|
get element() { return getElement(this); }
|
|
10614
11180
|
static get watchers() { return {
|
|
@@ -10660,7 +11226,7 @@ class DuetInput {
|
|
|
10660
11226
|
}; }
|
|
10661
11227
|
}
|
|
10662
11228
|
|
|
10663
|
-
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}";
|
|
11229
|
+
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}";
|
|
10664
11230
|
|
|
10665
11231
|
class DuetLabel {
|
|
10666
11232
|
constructor(hostRef) {
|
|
@@ -10826,8 +11392,7 @@ class DuetLink {
|
|
|
10826
11392
|
*/
|
|
10827
11393
|
this.language = getLanguage();
|
|
10828
11394
|
/**
|
|
10829
|
-
*
|
|
10830
|
-
* normally you would handle these strings on an application level and override @accessibleLabelExternal when needed
|
|
11395
|
+
* Defaults for accessibleLabelExternal
|
|
10831
11396
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10832
11397
|
*/
|
|
10833
11398
|
this.accessibleLabelExternalDefaults = DuetStringsExternalDefaults;
|
|
@@ -10835,7 +11400,7 @@ class DuetLink {
|
|
|
10835
11400
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
10836
11401
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10837
11402
|
*/
|
|
10838
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
11403
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
10839
11404
|
/**
|
|
10840
11405
|
* Theme of the button.
|
|
10841
11406
|
*/
|
|
@@ -10881,7 +11446,7 @@ class DuetLink {
|
|
|
10881
11446
|
"$members$": {
|
|
10882
11447
|
"accessibleLabel": [1, "accessible-label"],
|
|
10883
11448
|
"language": [1025],
|
|
10884
|
-
"accessibleLabelExternalDefaults": [
|
|
11449
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
10885
11450
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
10886
11451
|
"identifier": [1],
|
|
10887
11452
|
"theme": [1025],
|
|
@@ -11203,10 +11768,10 @@ class DuetModal {
|
|
|
11203
11768
|
*/
|
|
11204
11769
|
this.language = getLanguage();
|
|
11205
11770
|
/**
|
|
11206
|
-
*
|
|
11207
|
-
*
|
|
11771
|
+
* Defaults for accessibleCloseLabel
|
|
11772
|
+
* @default {fi: "Sulje ikkuna", sv: "Stäng fönstret", en: "Close the dialog", }
|
|
11208
11773
|
*/
|
|
11209
|
-
this.
|
|
11774
|
+
this.accessibleCloseLabelDefaults = {
|
|
11210
11775
|
fi: "Sulje ikkuna",
|
|
11211
11776
|
sv: "Stäng fönstret",
|
|
11212
11777
|
en: "Close the dialog",
|
|
@@ -11217,7 +11782,7 @@ class DuetModal {
|
|
|
11217
11782
|
* Swedish translation for this property is “Stäng fönstret”.
|
|
11218
11783
|
* @default {fi: "Sulje ikkuna", sv: "Stäng fönstret", en: "Close the dialog", }
|
|
11219
11784
|
*/
|
|
11220
|
-
this.accessibleCloseLabel = getLocaleString(this.
|
|
11785
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefaults, this.language);
|
|
11221
11786
|
/**
|
|
11222
11787
|
* Size of the modal window.
|
|
11223
11788
|
*/
|
|
@@ -11384,7 +11949,7 @@ class DuetModal {
|
|
|
11384
11949
|
"$tagName$": "duet-modal",
|
|
11385
11950
|
"$members$": {
|
|
11386
11951
|
"language": [1025],
|
|
11387
|
-
"
|
|
11952
|
+
"accessibleCloseLabelDefaults": [1, "accessible-close-label-default"],
|
|
11388
11953
|
"accessibleCloseLabel": [1, "accessible-close-label"],
|
|
11389
11954
|
"size": [1],
|
|
11390
11955
|
"gutterSize": [1, "gutter-size"],
|
|
@@ -11519,8 +12084,8 @@ class DuetNotificationDrawer {
|
|
|
11519
12084
|
*/
|
|
11520
12085
|
this.language = getLanguage();
|
|
11521
12086
|
/**
|
|
11522
|
-
*
|
|
11523
|
-
*
|
|
12087
|
+
* Defaults for accessibleLabelNotifications
|
|
12088
|
+
* @default {en: "No notifications", fi: "Ei ilmoituksia", sv: "Inga notifikationer"}
|
|
11524
12089
|
*/
|
|
11525
12090
|
this.accessibleLabelNotificationsDefaults = {
|
|
11526
12091
|
en: "No notifications",
|
|
@@ -11531,7 +12096,7 @@ class DuetNotificationDrawer {
|
|
|
11531
12096
|
* Adds accessible label for tooltip that is shown for notifications
|
|
11532
12097
|
* @default {en: "No notifications", fi: "Ei ilmoituksia", sv: "Inga notifikationer"}
|
|
11533
12098
|
*/
|
|
11534
|
-
this.accessibleLabelNotifications = getLocaleString(this.accessibleLabelNotificationsDefaults
|
|
12099
|
+
this.accessibleLabelNotifications = getLocaleString(this.accessibleLabelNotificationsDefaults);
|
|
11535
12100
|
/**
|
|
11536
12101
|
* Show a badge that indicates something has changed.
|
|
11537
12102
|
*/
|
|
@@ -11634,7 +12199,7 @@ class DuetNotificationDrawer {
|
|
|
11634
12199
|
"icon": [1],
|
|
11635
12200
|
"label": [1],
|
|
11636
12201
|
"language": [1],
|
|
11637
|
-
"accessibleLabelNotificationsDefaults": [
|
|
12202
|
+
"accessibleLabelNotificationsDefaults": [1, "accessible-label-notification-default"],
|
|
11638
12203
|
"accessibleLabelNotifications": [1, "accessible-label-notifications"],
|
|
11639
12204
|
"badge": [4],
|
|
11640
12205
|
"theme": [1025],
|
|
@@ -11705,37 +12270,52 @@ class DuetNumberInput {
|
|
|
11705
12270
|
*/
|
|
11706
12271
|
this.unit = getLocale(this.language).money;
|
|
11707
12272
|
/**
|
|
11708
|
-
*
|
|
11709
|
-
* The string {current} is replaced with the current amount.
|
|
12273
|
+
* Defaults for accessibleLive
|
|
11710
12274
|
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
11711
12275
|
*/
|
|
11712
|
-
this.
|
|
12276
|
+
this.accessibleLiveDefaults = {
|
|
11713
12277
|
fi: "{current} euroa valittuna",
|
|
11714
12278
|
en: "{current} euros selected",
|
|
11715
12279
|
sv: "{current} euro valt",
|
|
11716
|
-
}
|
|
12280
|
+
};
|
|
12281
|
+
/**
|
|
12282
|
+
* Format of message used to announce current amount when switching between amounts.
|
|
12283
|
+
* The string {current} is replaced with the current amount.
|
|
12284
|
+
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
12285
|
+
*/
|
|
12286
|
+
this.accessibleLive = getLocaleString(this.accessibleLiveDefaults, this.language);
|
|
11717
12287
|
/**
|
|
11718
12288
|
* Disables the aria-live messaging used internally in this component. This could be useful when you want to use custom aria-live messages instead.
|
|
11719
12289
|
*/
|
|
11720
12290
|
this.accessibleLiveEnabled = true;
|
|
11721
12291
|
/**
|
|
11722
|
-
*
|
|
12292
|
+
* Defaults for accessibleAdd
|
|
11723
12293
|
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
11724
12294
|
*/
|
|
11725
|
-
this.
|
|
12295
|
+
this.accessibleAddDefaults = {
|
|
11726
12296
|
fi: "Lisää summaan",
|
|
11727
12297
|
en: "Add to the amount",
|
|
11728
12298
|
sv: "Lägg till beloppet",
|
|
11729
|
-
}
|
|
12299
|
+
};
|
|
11730
12300
|
/**
|
|
11731
|
-
* Accessible label for the
|
|
12301
|
+
* Accessible label for the add button that is read for screen reader users.
|
|
12302
|
+
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
12303
|
+
*/
|
|
12304
|
+
this.accessibleAdd = getLocaleString(this.accessibleAddDefaults, this.language);
|
|
12305
|
+
/**
|
|
12306
|
+
* Defaults for accessibleSubtract
|
|
11732
12307
|
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
11733
12308
|
*/
|
|
11734
|
-
this.
|
|
12309
|
+
this.accessibleSubtractDefaults = {
|
|
11735
12310
|
fi: "Vähennä summasta",
|
|
11736
12311
|
en: "Subtract from the amount",
|
|
11737
12312
|
sv: "Dra från beloppet",
|
|
11738
|
-
}
|
|
12313
|
+
};
|
|
12314
|
+
/**
|
|
12315
|
+
* Accessible label for the subtract button that is read for screen reader users.
|
|
12316
|
+
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
12317
|
+
*/
|
|
12318
|
+
this.accessibleSubtract = getLocaleString(this.accessibleSubtractDefaults, this.language);
|
|
11739
12319
|
/**
|
|
11740
12320
|
* Theme of the input.
|
|
11741
12321
|
*/
|
|
@@ -11753,14 +12333,19 @@ class DuetNumberInput {
|
|
|
11753
12333
|
*/
|
|
11754
12334
|
this.min = 0;
|
|
11755
12335
|
/**
|
|
11756
|
-
*
|
|
12336
|
+
* Defaults for Label
|
|
11757
12337
|
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
11758
12338
|
*/
|
|
11759
|
-
this.
|
|
12339
|
+
this.labelDefaults = {
|
|
11760
12340
|
fi: "Nimilappu",
|
|
11761
12341
|
en: "Label",
|
|
11762
12342
|
sv: "Etikett",
|
|
11763
|
-
}
|
|
12343
|
+
};
|
|
12344
|
+
/**
|
|
12345
|
+
* Label for the number input.
|
|
12346
|
+
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
12347
|
+
*/
|
|
12348
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
11764
12349
|
/**
|
|
11765
12350
|
* Visually hide the label, but still show it to screen readers.
|
|
11766
12351
|
*/
|
|
@@ -11998,15 +12583,19 @@ class DuetNumberInput {
|
|
|
11998
12583
|
"accessibleControls": [1, "accessible-controls"],
|
|
11999
12584
|
"accessibleOwns": [1, "accessible-owns"],
|
|
12000
12585
|
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
12586
|
+
"accessibleLiveDefaults": [1, "accessible-live-default"],
|
|
12001
12587
|
"accessibleLive": [1, "accessible-live"],
|
|
12002
12588
|
"accessibleLiveEnabled": [4, "accessible-live-enabled"],
|
|
12589
|
+
"accessibleAddDefaults": [1, "accessible-add-default"],
|
|
12003
12590
|
"accessibleAdd": [1, "accessible-add"],
|
|
12591
|
+
"accessibleSubtractDefaults": [1, "accessible-subtract-defaults"],
|
|
12004
12592
|
"accessibleSubtract": [1, "accessible-subtract"],
|
|
12005
12593
|
"theme": [1025],
|
|
12006
12594
|
"margin": [1],
|
|
12007
12595
|
"expand": [4],
|
|
12008
12596
|
"identifier": [1],
|
|
12009
12597
|
"min": [2],
|
|
12598
|
+
"labelDefaults": [1, "label-default"],
|
|
12010
12599
|
"label": [1],
|
|
12011
12600
|
"labelHidden": [4, "label-hidden"],
|
|
12012
12601
|
"max": [2],
|
|
@@ -12028,13 +12617,16 @@ class DuetNumberInput {
|
|
|
12028
12617
|
}; }
|
|
12029
12618
|
}
|
|
12030
12619
|
|
|
12031
|
-
const duetParagraphCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-paragraph,*.sc-duet-paragraph::after,*.sc-duet-paragraph::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-paragraph-h{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*/.duet-paragraph.sc-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*/.duet-paragraph.duet-p-0.sc-duet-paragraph{padding:0 !important}/*!@.duet-paragraph.duet-m-0*/.duet-paragraph.duet-m-0.sc-duet-paragraph{margin:0 !important}/*!@.duet-paragraph.duet-theme-turva*/.duet-paragraph.duet-theme-turva.sc-duet-paragraph{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*/.duet-paragraph.duet-paragraph-small.sc-duet-paragraph{font-size:0.875rem}/*!@.duet-paragraph.duet-m-0*/.duet-paragraph.duet-m-0.sc-duet-paragraph{margin:0 !important}/*!@.duet-paragraph.intro*/.duet-paragraph.intro.sc-duet-paragraph{font-size:2.7vw;margin-bottom:28px !important;-webkit-hyphens:inherit;hyphens:inherit}@media (max-width: 37.037037037rem){/*!@.duet-paragraph.intro*/.duet-paragraph.intro.sc-duet-paragraph{font-size:1rem}}@media (min-width: 46.2962962963rem){/*!@.duet-paragraph.intro*/.duet-paragraph.intro.sc-duet-paragraph{font-size:1.25rem}}/*!@.duet-paragraph.intro.duet-m-0*/.duet-paragraph.intro.duet-m-0.sc-duet-paragraph{margin:0 !important}/*!@::slotted(a)*/.sc-duet-paragraph-s>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*/.sc-duet-paragraph-s>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*/.sc-duet-paragraph-s>a:hover{color:#004d80;text-decoration:none}/*!@::slotted(a):hover.duet-theme-turva*/.sc-duet-paragraph-s>a:hover.duet-theme-turva{color:#940925}/*!@::slotted(a):active*/.sc-duet-paragraph-s>a:active{opacity:0.75;transition:none}";
|
|
12620
|
+
const duetParagraphCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-paragraph,*.sc-duet-paragraph::after,*.sc-duet-paragraph::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-paragraph-h{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*/.duet-paragraph.sc-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*/.duet-paragraph.duet-p-0.sc-duet-paragraph{padding:0 !important}/*!@.duet-paragraph.duet-m-0*/.duet-paragraph.duet-m-0.sc-duet-paragraph{margin:0 !important}/*!@.duet-paragraph.duet-theme-turva*/.duet-paragraph.duet-theme-turva.sc-duet-paragraph{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*/.duet-paragraph.duet-paragraph-small.sc-duet-paragraph{font-size:0.875rem}/*!@.duet-paragraph.duet-paragraph-semi-bold*/.duet-paragraph.duet-paragraph-semi-bold.sc-duet-paragraph{font-weight:600}/*!@.duet-paragraph.duet-paragraph-bold*/.duet-paragraph.duet-paragraph-bold.sc-duet-paragraph{font-weight:700}/*!@.duet-paragraph.duet-m-0*/.duet-paragraph.duet-m-0.sc-duet-paragraph{margin:0 !important}/*!@.duet-paragraph.intro*/.duet-paragraph.intro.sc-duet-paragraph{font-size:2.7vw;margin-bottom:28px !important;-webkit-hyphens:inherit;hyphens:inherit}@media (max-width: 37.037037037rem){/*!@.duet-paragraph.intro*/.duet-paragraph.intro.sc-duet-paragraph{font-size:1rem}}@media (min-width: 46.2962962963rem){/*!@.duet-paragraph.intro*/.duet-paragraph.intro.sc-duet-paragraph{font-size:1.25rem}}/*!@.duet-paragraph.intro.duet-m-0*/.duet-paragraph.intro.duet-m-0.sc-duet-paragraph{margin:0 !important}/*!@::slotted(a)*/.sc-duet-paragraph-s>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*/.sc-duet-paragraph-s>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*/.sc-duet-paragraph-s>a:hover{color:#004d80;text-decoration:none}/*!@::slotted(a):hover.duet-theme-turva*/.sc-duet-paragraph-s>a:hover.duet-theme-turva{color:#940925}/*!@::slotted(a):active*/.sc-duet-paragraph-s>a:active{opacity:0.75;transition:none}";
|
|
12032
12621
|
|
|
12622
|
+
/**
|
|
12623
|
+
* @part duet-paragraph - piercing selector for styling the paragraph
|
|
12624
|
+
*/
|
|
12033
12625
|
class DuetParagraph {
|
|
12034
12626
|
constructor(hostRef) {
|
|
12035
12627
|
registerInstance(this, hostRef);
|
|
12036
12628
|
/**
|
|
12037
|
-
* Theme of the
|
|
12629
|
+
* Theme of the paragraph.
|
|
12038
12630
|
*/
|
|
12039
12631
|
this.theme = "";
|
|
12040
12632
|
/**
|
|
@@ -12045,6 +12637,10 @@ class DuetParagraph {
|
|
|
12045
12637
|
* Controls the size of the paragraph.
|
|
12046
12638
|
*/
|
|
12047
12639
|
this.size = "medium";
|
|
12640
|
+
/**
|
|
12641
|
+
* Controls the Font-Weight of the paragraph.
|
|
12642
|
+
*/
|
|
12643
|
+
this.weight = undefined;
|
|
12048
12644
|
/**
|
|
12049
12645
|
* Style variation of the paragraph.
|
|
12050
12646
|
*/
|
|
@@ -12070,26 +12666,107 @@ class DuetParagraph {
|
|
|
12070
12666
|
return (hAsync("p", { class: {
|
|
12071
12667
|
"duet-paragraph": true,
|
|
12072
12668
|
"duet-paragraph-small": this.size === "small",
|
|
12669
|
+
"duet-paragraph-semi-bold": this.weight === "semi-bold",
|
|
12670
|
+
"duet-paragraph-bold": this.weight === "bold",
|
|
12073
12671
|
"duet-m-0": this.margin === "none",
|
|
12074
12672
|
[this.variation]: true,
|
|
12075
12673
|
"duet-theme-turva": this.theme === "turva",
|
|
12076
|
-
}, style: { color } }, hAsync("slot", null)));
|
|
12674
|
+
}, style: { color }, part: "duet-paragraph" }, hAsync("slot", null)));
|
|
12675
|
+
}
|
|
12676
|
+
get element() { return getElement(this); }
|
|
12677
|
+
static get style() { return duetParagraphCss; }
|
|
12678
|
+
static get cmpMeta() { return {
|
|
12679
|
+
"$flags$": 9,
|
|
12680
|
+
"$tagName$": "duet-paragraph",
|
|
12681
|
+
"$members$": {
|
|
12682
|
+
"theme": [1025],
|
|
12683
|
+
"margin": [1],
|
|
12684
|
+
"size": [1],
|
|
12685
|
+
"weight": [1],
|
|
12686
|
+
"variation": [1],
|
|
12687
|
+
"color": [1]
|
|
12688
|
+
},
|
|
12689
|
+
"$listeners$": undefined,
|
|
12690
|
+
"$lazyBundleId$": "-",
|
|
12691
|
+
"$attrsToReflect$": []
|
|
12692
|
+
}; }
|
|
12693
|
+
}
|
|
12694
|
+
|
|
12695
|
+
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}";
|
|
12696
|
+
|
|
12697
|
+
class DuetProgress {
|
|
12698
|
+
constructor(hostRef) {
|
|
12699
|
+
registerInstance(this, hostRef);
|
|
12700
|
+
/**
|
|
12701
|
+
* Own Properties
|
|
12702
|
+
*/
|
|
12703
|
+
this.progressId = createID("DuetProgress");
|
|
12704
|
+
this.progressLabelId = createID("DuetProgressLabel");
|
|
12705
|
+
/**
|
|
12706
|
+
* Defaults for accessibleLabel
|
|
12707
|
+
*/
|
|
12708
|
+
this.accessibleLabelUploadDefaults = {
|
|
12709
|
+
fi: ["lähetys valmis", "lähetys käynnissä"],
|
|
12710
|
+
sv: ["Uppladdningen är klar", "Uppladdning pågår"],
|
|
12711
|
+
en: ["upload completed", "upload in progress"],
|
|
12712
|
+
};
|
|
12713
|
+
/**
|
|
12714
|
+
* Adds accessible label for upload in progress and upload complete states
|
|
12715
|
+
* @default {fi: ["lähetys valmis", "lähetys käynnissä"],sv: ["Uppladdningen är klar", "Uppladdning pågår"], en: ["completed", "in progress"]}
|
|
12716
|
+
*/
|
|
12717
|
+
this.accessibleLabelUpload = getLocaleString(this.accessibleLabelUploadDefaults);
|
|
12718
|
+
/**
|
|
12719
|
+
* Progress of the bar, a value from 0-100
|
|
12720
|
+
*/
|
|
12721
|
+
this.progress = 0;
|
|
12722
|
+
/**
|
|
12723
|
+
* Height of progressbar
|
|
12724
|
+
*/
|
|
12725
|
+
this.height = "10px";
|
|
12726
|
+
/**
|
|
12727
|
+
* Theme of the input.
|
|
12728
|
+
*/
|
|
12729
|
+
this.theme = "";
|
|
12730
|
+
}
|
|
12731
|
+
/**
|
|
12732
|
+
* Component lifecycle events.
|
|
12733
|
+
*/
|
|
12734
|
+
componentWillLoad() {
|
|
12735
|
+
inheritGlobalTheme(this);
|
|
12736
|
+
}
|
|
12737
|
+
/**
|
|
12738
|
+
* render() function
|
|
12739
|
+
* Always the last one in the class.
|
|
12740
|
+
*/
|
|
12741
|
+
render() {
|
|
12742
|
+
return (hAsync(Host, null, hAsync("div", { "aria-live": this.accessibleLabel ? "polite" : "off", "aria-hidden": this.accessibleLabel ? "false" : "true", "aria-atomic": "true", style: {
|
|
12743
|
+
height: this.height,
|
|
12744
|
+
}, id: this.progressId, class: {
|
|
12745
|
+
"duet-progress": true,
|
|
12746
|
+
"duet-progress-done": this.progress === 100,
|
|
12747
|
+
"duet-progress-start": this.progress === 0,
|
|
12748
|
+
"duet-progress-inprogress": this.progress < 99 && this.progress !== 0,
|
|
12749
|
+
"duet-theme-turva": this.theme === "turva",
|
|
12750
|
+
} }, hAsync("duet-visually-hidden", null, hAsync("label", { htmlFor: this.progressLabelId }, this.progress !== 0 && (hAsync("span", null, this.accessibleLabel, ", ", this.accessibleLabelUpload[this.progress < 99 ? 1 : 0])))), this.caption && (hAsync("div", { class: "duet-progress-caption" }, hAsync("span", null, this.caption))), hAsync("progress", { id: this.progressLabelId, "aria-describedby": this.accessibleDescribedBy, role: "progressbar", value: this.progress, max: "100", "aria-valuemin": "0", "aria-valuemax": "100" }, hAsync("div", { class: "progress-bar" }, hAsync("span", { style: { width: `${this.progress}%;` } }, "Progress: ", this.progress, "%"))))));
|
|
12077
12751
|
}
|
|
12078
12752
|
get element() { return getElement(this); }
|
|
12079
|
-
static get style() { return
|
|
12753
|
+
static get style() { return duetProgressCss; }
|
|
12080
12754
|
static get cmpMeta() { return {
|
|
12081
|
-
"$flags$":
|
|
12082
|
-
"$tagName$": "duet-
|
|
12755
|
+
"$flags$": 0,
|
|
12756
|
+
"$tagName$": "duet-progress",
|
|
12083
12757
|
"$members$": {
|
|
12084
|
-
"
|
|
12085
|
-
"
|
|
12086
|
-
"
|
|
12087
|
-
"
|
|
12088
|
-
"
|
|
12758
|
+
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
12759
|
+
"accessibleLabel": [1, "accessible-label"],
|
|
12760
|
+
"accessibleLabelUploadDefaults": [1, "accessible-label-upload-defaults"],
|
|
12761
|
+
"accessibleLabelUpload": [1, "accessible-label-upload"],
|
|
12762
|
+
"progress": [1538],
|
|
12763
|
+
"caption": [1],
|
|
12764
|
+
"height": [1],
|
|
12765
|
+
"theme": [1025]
|
|
12089
12766
|
},
|
|
12090
12767
|
"$listeners$": undefined,
|
|
12091
12768
|
"$lazyBundleId$": "-",
|
|
12092
|
-
"$attrsToReflect$": []
|
|
12769
|
+
"$attrsToReflect$": [["progress", "progress"]]
|
|
12093
12770
|
}; }
|
|
12094
12771
|
}
|
|
12095
12772
|
|
|
@@ -12581,7 +13258,7 @@ class DuetRangeSlider {
|
|
|
12581
13258
|
}; }
|
|
12582
13259
|
}
|
|
12583
13260
|
|
|
12584
|
-
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}";
|
|
13261
|
+
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}";
|
|
12585
13262
|
|
|
12586
13263
|
function isOptionGroup(item) {
|
|
12587
13264
|
return "options" in item;
|
|
@@ -12703,14 +13380,14 @@ class DuetSelect {
|
|
|
12703
13380
|
if (this.nativeSelect) {
|
|
12704
13381
|
this.nativeSelect.value = this.value;
|
|
12705
13382
|
}
|
|
12706
|
-
this.isCaptionVisible = !!
|
|
13383
|
+
this.isCaptionVisible = !!this.caption;
|
|
12707
13384
|
}
|
|
12708
13385
|
/**
|
|
12709
13386
|
* Component lifecycle events.
|
|
12710
13387
|
*/
|
|
12711
13388
|
componentWillLoad() {
|
|
12712
13389
|
inheritGlobalTheme(this);
|
|
12713
|
-
this.isCaptionVisible = !!
|
|
13390
|
+
this.isCaptionVisible = !!this.caption;
|
|
12714
13391
|
this.refresh();
|
|
12715
13392
|
}
|
|
12716
13393
|
/**
|
|
@@ -12753,7 +13430,7 @@ class DuetSelect {
|
|
|
12753
13430
|
"duet-theme-turva": this.theme === "turva",
|
|
12754
13431
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
12755
13432
|
"has-error": !!this.error,
|
|
12756
|
-
} }, hAsync("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, id: this.labelId, for: identifier }, this.label), this.tooltip && (hAsync("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (hAsync("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), this.placeholder && this.echoPlaceholder && this.value && (hAsync("duet-caption", { id: this.topCaptionPlaceholderId, size: "small" }, this.placeholder)), hAsync("
|
|
13433
|
+
} }, hAsync("duet-label", { theme: this.theme === "turva" ? "turva" : "default", class: { "duet-has-tooltip": !!this.tooltip }, id: this.labelId, for: identifier }, this.label), this.tooltip && (hAsync("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (hAsync("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), hAsync("div", { class: "duet-select-wrapper" }, this.placeholder && this.echoPlaceholder && this.value && (hAsync("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-select-placeholder", size: "small" }, this.placeholder)), hAsync("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 && (hAsync("option", { disabled: true, selected: true, value: "" }, this.placeholder)), !this.processedItems ? (hAsync("option", null, "Virhe valintoja ladattaessa. P\u00E4ivit\u00E4 sivu ja kokeile uusiksi.")) : (this.processedItems.map(item => {
|
|
12757
13434
|
return isOptionGroup(item) ? this.renderOptionGroup(item) : this.renderOption(item);
|
|
12758
13435
|
}))), hAsync("div", { class: "duet-select", "aria-hidden": "true" }, hAsync("span", { key: this.value }, this.getSelectedItemLabel()), hAsync("svg", { role: "img", class: "duet-select-icon", fill: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, hAsync("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" })))), hAsync("span", { class: "duet-select-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && hAsync("span", null, this.error)))));
|
|
12759
13436
|
}
|
|
@@ -13186,7 +13863,7 @@ class DuetTab {
|
|
|
13186
13863
|
}; }
|
|
13187
13864
|
}
|
|
13188
13865
|
|
|
13189
|
-
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:#
|
|
13866
|
+
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}";
|
|
13190
13867
|
|
|
13191
13868
|
class DuetTabGroup {
|
|
13192
13869
|
constructor(hostRef) {
|
|
@@ -13216,14 +13893,19 @@ class DuetTabGroup {
|
|
|
13216
13893
|
*/
|
|
13217
13894
|
this.language = getLanguage();
|
|
13218
13895
|
/**
|
|
13219
|
-
*
|
|
13896
|
+
* Defaults for Label
|
|
13220
13897
|
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
13221
13898
|
*/
|
|
13222
|
-
this.
|
|
13899
|
+
this.labelDefaults = {
|
|
13223
13900
|
fi: "Valitse",
|
|
13224
13901
|
en: "Choose",
|
|
13225
13902
|
sv: "Välj",
|
|
13226
|
-
}
|
|
13903
|
+
};
|
|
13904
|
+
/**
|
|
13905
|
+
* Label for the select element which gets shown on mobile.
|
|
13906
|
+
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
13907
|
+
*/
|
|
13908
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
13227
13909
|
/**
|
|
13228
13910
|
* Determines whether the label for the select element shown on mobile is visually hidden.
|
|
13229
13911
|
*/
|
|
@@ -13365,6 +14047,7 @@ class DuetTabGroup {
|
|
|
13365
14047
|
"theme": [1025],
|
|
13366
14048
|
"variation": [1],
|
|
13367
14049
|
"language": [1025],
|
|
14050
|
+
"labelDefaults": [1, "label-default"],
|
|
13368
14051
|
"label": [1],
|
|
13369
14052
|
"labelHidden": [4, "label-hidden"],
|
|
13370
14053
|
"margin": [1],
|
|
@@ -13508,7 +14191,7 @@ class DuetTable {
|
|
|
13508
14191
|
}; }
|
|
13509
14192
|
}
|
|
13510
14193
|
|
|
13511
|
-
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}";
|
|
14194
|
+
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}";
|
|
13512
14195
|
|
|
13513
14196
|
const CharacterCount = ({ value, maxlength, label, theme }) => {
|
|
13514
14197
|
if (maxlength == null) {
|
|
@@ -13609,7 +14292,7 @@ class DuetTextarea {
|
|
|
13609
14292
|
cleanValue(this.nativeInput, this.disallowPatternRegex);
|
|
13610
14293
|
}
|
|
13611
14294
|
this.value = this.nativeInput.value;
|
|
13612
|
-
this.isCaptionVisible = !!
|
|
14295
|
+
this.isCaptionVisible = !!this.caption;
|
|
13613
14296
|
this.duetInput.emit({
|
|
13614
14297
|
originalEvent: ev,
|
|
13615
14298
|
value: this.value,
|
|
@@ -13648,7 +14331,7 @@ class DuetTextarea {
|
|
|
13648
14331
|
componentWillLoad() {
|
|
13649
14332
|
inheritGlobalTheme(this);
|
|
13650
14333
|
this.disallowedPatternChange();
|
|
13651
|
-
this.isCaptionVisible = !!
|
|
14334
|
+
this.isCaptionVisible = !!this.caption;
|
|
13652
14335
|
if (this.counter && this.maxlength == null) {
|
|
13653
14336
|
console.warn("[DUET WARNING]: counter will only take effect if maxlength is set");
|
|
13654
14337
|
}
|
|
@@ -13682,7 +14365,7 @@ class DuetTextarea {
|
|
|
13682
14365
|
"duet-label-hidden": this.labelHidden,
|
|
13683
14366
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
13684
14367
|
"has-error": !!this.error,
|
|
13685
|
-
} }, hAsync("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 && (hAsync("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (hAsync("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), this.placeholder && this.echoPlaceholder && this.value && (hAsync("duet-caption", { id: this.topCaptionPlaceholderId, size: "small" }, this.placeholder)), hAsync("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 }), hAsync("duet-grid", { alignment: "stretch" }, hAsync("duet-grid-item", { margin: "none", fill: true }, hAsync("div", { class: "duet-textarea-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && hAsync("span", null, this.error))), hAsync("duet-grid-item", { margin: "none", class: "duet-character-count-caption" }, this.counter && (hAsync(CharacterCount, { theme: this.theme, value: this.value, maxlength: this.maxlength, label: this.counterLabel })))))));
|
|
14368
|
+
} }, hAsync("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 && (hAsync("duet-tooltip", { direction: this.tooltipDirection, accessibleInputLabel: this.label }, this.tooltip)), this.caption && (hAsync("duet-caption", { id: this.topCaptionId, size: "medium" }, this.caption)), hAsync("div", { class: "duet-textarea-wrapper" }, this.placeholder && this.echoPlaceholder && this.value && (hAsync("duet-caption", { id: this.topCaptionPlaceholderId, class: "duet-textarea-placeholder", size: "small" }, this.placeholder)), hAsync("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 })), hAsync("duet-grid", { alignment: "stretch" }, hAsync("duet-grid-item", { margin: "none", fill: true }, hAsync("div", { class: "duet-textarea-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && hAsync("span", null, this.error))), hAsync("duet-grid-item", { margin: "none", class: "duet-character-count-caption" }, this.counter && (hAsync(CharacterCount, { theme: this.theme, value: this.value, maxlength: this.maxlength, label: this.counterLabel })))))));
|
|
13686
14369
|
}
|
|
13687
14370
|
get element() { return getElement(this); }
|
|
13688
14371
|
static get watchers() { return {
|
|
@@ -13867,25 +14550,35 @@ class DuetTooltip {
|
|
|
13867
14550
|
*/
|
|
13868
14551
|
this.language = getLanguage();
|
|
13869
14552
|
/**
|
|
13870
|
-
*
|
|
13871
|
-
* readers. This property is always required to create an accessible interface!
|
|
14553
|
+
* Default language strings for the accessibleLabel
|
|
13872
14554
|
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
13873
14555
|
*/
|
|
13874
|
-
this.
|
|
14556
|
+
this.accessibleLabelDefault = {
|
|
13875
14557
|
fi: "Näytä lisätietoja",
|
|
13876
14558
|
en: "Show more information",
|
|
13877
14559
|
sv: "Visa mer tilläggsuppgifter",
|
|
13878
|
-
}
|
|
14560
|
+
};
|
|
13879
14561
|
/**
|
|
13880
|
-
* Adds accessible label for the
|
|
13881
|
-
* readers. This property is always required to create an
|
|
14562
|
+
* Adds accessible label for the info icon that is only shown for screen
|
|
14563
|
+
* readers. This property is always required to create an accessible interface!
|
|
14564
|
+
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
14565
|
+
*/
|
|
14566
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefault, this.language);
|
|
14567
|
+
/**
|
|
14568
|
+
* Default language strings for the accessibleCloseLabel
|
|
13882
14569
|
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
13883
14570
|
*/
|
|
13884
|
-
this.
|
|
14571
|
+
this.accessibleCloseLabelDefault = {
|
|
13885
14572
|
fi: "Sulje lisätiedot",
|
|
13886
14573
|
en: "Close details",
|
|
13887
14574
|
sv: "Stäng tilläggsuppgifter",
|
|
13888
|
-
}
|
|
14575
|
+
};
|
|
14576
|
+
/**
|
|
14577
|
+
* Adds accessible label for the close icon that is only shown for screen
|
|
14578
|
+
* readers. This property is always required to create an accessibly interface!
|
|
14579
|
+
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
14580
|
+
*/
|
|
14581
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefault, this.language);
|
|
13889
14582
|
/**
|
|
13890
14583
|
* Label of the tooltip. If used, replaces the accessibleLabel option.
|
|
13891
14584
|
*/
|
|
@@ -14058,8 +14751,10 @@ class DuetTooltip {
|
|
|
14058
14751
|
"$members$": {
|
|
14059
14752
|
"theme": [1025],
|
|
14060
14753
|
"language": [1025],
|
|
14754
|
+
"accessibleLabelDefault": [1, "accessible-label-default"],
|
|
14061
14755
|
"accessibleLabel": [1, "accessible-label"],
|
|
14062
14756
|
"accessibleInputLabel": [1, "accessible-input-label"],
|
|
14757
|
+
"accessibleCloseLabelDefault": [1, "accessible-close-label-default"],
|
|
14063
14758
|
"accessibleCloseLabel": [1, "accessible-close-label"],
|
|
14064
14759
|
"label": [1],
|
|
14065
14760
|
"breakpoint": [1],
|
|
@@ -14103,25 +14798,35 @@ class DuetTray {
|
|
|
14103
14798
|
*/
|
|
14104
14799
|
this.language = getLanguage();
|
|
14105
14800
|
/**
|
|
14106
|
-
*
|
|
14107
|
-
* close toggle. Not visible for normal users.
|
|
14801
|
+
* Defaults for accessibleCloseLabel
|
|
14108
14802
|
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
14109
14803
|
*/
|
|
14110
|
-
this.
|
|
14804
|
+
this.accessibleCloseLabelDefaults = {
|
|
14111
14805
|
fi: "Sulje",
|
|
14112
14806
|
en: "Close",
|
|
14113
14807
|
sv: "Stäng",
|
|
14114
|
-
}
|
|
14808
|
+
};
|
|
14115
14809
|
/**
|
|
14116
14810
|
* Accessible label that is shown for screen reader users in the expandable
|
|
14117
|
-
*
|
|
14811
|
+
* close toggle. Not visible for normal users.
|
|
14812
|
+
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
14813
|
+
*/
|
|
14814
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefaults, this.language);
|
|
14815
|
+
/**
|
|
14816
|
+
* Defaults for accessibleOpenLabel
|
|
14118
14817
|
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
14119
14818
|
*/
|
|
14120
|
-
this.
|
|
14819
|
+
this.accessibleOpenLabelDefaults = {
|
|
14121
14820
|
fi: "Avaa",
|
|
14122
14821
|
en: "Open",
|
|
14123
14822
|
sv: "Öppna",
|
|
14124
|
-
}
|
|
14823
|
+
};
|
|
14824
|
+
/**
|
|
14825
|
+
* Accessible label that is shown for screen reader users in the expandable
|
|
14826
|
+
* open toggle. Not visible for normal users.
|
|
14827
|
+
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
14828
|
+
*/
|
|
14829
|
+
this.accessibleOpenLabel = getLocaleString(this.accessibleOpenLabelDefaults, this.language);
|
|
14125
14830
|
/**
|
|
14126
14831
|
* Theme of the info panel.
|
|
14127
14832
|
*/
|
|
@@ -14195,7 +14900,9 @@ class DuetTray {
|
|
|
14195
14900
|
"$tagName$": "duet-tray",
|
|
14196
14901
|
"$members$": {
|
|
14197
14902
|
"language": [1025],
|
|
14903
|
+
"accessibleCloseLabelDefaults": [1, "accessible-close-label-default"],
|
|
14198
14904
|
"accessibleCloseLabel": [1, "accessible-close-label"],
|
|
14905
|
+
"accessibleOpenLabelDefaults": [1, "accessible-open-label-default"],
|
|
14199
14906
|
"accessibleOpenLabel": [1, "accessible-open-label"],
|
|
14200
14907
|
"theme": [1025],
|
|
14201
14908
|
"active": [516],
|
|
@@ -14210,178 +14917,122 @@ class DuetTray {
|
|
|
14210
14917
|
}; }
|
|
14211
14918
|
}
|
|
14212
14919
|
|
|
14213
|
-
|
|
14214
|
-
if (bytes === 0) {
|
|
14215
|
-
return "0 Bytes";
|
|
14216
|
-
}
|
|
14217
|
-
const k = 1024;
|
|
14218
|
-
const dm = decimals < 0 ? 0 : decimals;
|
|
14219
|
-
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
14220
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
14221
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
14222
|
-
};
|
|
14223
|
-
|
|
14224
|
-
const DuetUploadFileList = ({ data, onDelete, onCancel, getError }) => {
|
|
14225
|
-
if (data.invalid.length === 0 && data.valid.length === 0) {
|
|
14226
|
-
return;
|
|
14227
|
-
}
|
|
14228
|
-
return (hAsync("ol", { class: "duet-upload-filelist" },
|
|
14229
|
-
data.valid.length !== 0 && (hAsync("li", null,
|
|
14230
|
-
hAsync("duet-visually-hidden", null, "Files"),
|
|
14231
|
-
hAsync("ul", null, data.valid.length !== 0 &&
|
|
14232
|
-
data.valid.map(e => (hAsync("li", { class: "duet-upload-file" },
|
|
14233
|
-
hAsync("div", { class: "duet-upload-file-container" },
|
|
14234
|
-
hAsync("div", { class: "duet-upload-file-link" }, e.url ? (hAsync("duet-button", { variation: "plain", icon: "messaging-attachment", url: e.url },
|
|
14235
|
-
e.item.name,
|
|
14236
|
-
" (",
|
|
14237
|
-
formatBytes(e.item.size),
|
|
14238
|
-
")")) : (`${e.item.name} (${formatBytes(e.item.size)})`)),
|
|
14239
|
-
hAsync("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
14240
|
-
e.progress < 100 && (hAsync("li", { role: "none" },
|
|
14241
|
-
hAsync("duet-button", { role: "menuitem", variation: "plain", icon: "messaging-declined", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onCancel(e.item.name, ev) }))),
|
|
14242
|
-
e.progress === 100 && (hAsync("li", { role: "none" },
|
|
14243
|
-
hAsync("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))),
|
|
14244
|
-
e.progress < 100 && (hAsync("div", { class: "duet-upload-file-progress" },
|
|
14245
|
-
hAsync("progress", { value: e.progress, max: "100" },
|
|
14246
|
-
hAsync("div", { class: "progress-bar" },
|
|
14247
|
-
hAsync("span", { style: { width: `${e.progress}%;` } },
|
|
14248
|
-
"Progress: ",
|
|
14249
|
-
e.progress,
|
|
14250
|
-
"%"))))))))))),
|
|
14251
|
-
data.invalid.length !== 0 && (hAsync("li", null,
|
|
14252
|
-
hAsync("duet-visually-hidden", null, "Files with Errors"),
|
|
14253
|
-
hAsync("ul", null, data.invalid.map(e => {
|
|
14254
|
-
return (hAsync("li", { class: "duet-upload-file duet-upload-file-errors" },
|
|
14255
|
-
hAsync("div", { class: "duet-upload-file-container" },
|
|
14256
|
-
hAsync("div", { class: "duet-upload-file-link duet-upload-file-link-error" },
|
|
14257
|
-
hAsync("div", null,
|
|
14258
|
-
e.item.name,
|
|
14259
|
-
" (",
|
|
14260
|
-
formatBytes(e.item.size),
|
|
14261
|
-
")"),
|
|
14262
|
-
hAsync("div", { "data-error-type": e.error.type, "data-error-message": e.error.system_message }, getError(e.error.type))),
|
|
14263
|
-
hAsync("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
14264
|
-
hAsync("li", { role: "none" },
|
|
14265
|
-
hAsync("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))));
|
|
14266
|
-
}))))));
|
|
14267
|
-
};
|
|
14268
|
-
|
|
14269
|
-
var errorcodes = [
|
|
14920
|
+
var errorCodes = [
|
|
14270
14921
|
{
|
|
14271
14922
|
type: "default",
|
|
14272
14923
|
system_message: "unknown error",
|
|
14273
14924
|
message: {
|
|
14274
|
-
fi: "",
|
|
14275
|
-
sv: "",
|
|
14276
|
-
en: "An unknown error occured, please try again"
|
|
14925
|
+
fi: "Tapahtui tuntematon virhe, ole hyvä ja yritä uudelleen.",
|
|
14926
|
+
sv: "Ett okänt fel uppstod, försök igen.",
|
|
14927
|
+
en: "An unknown error occured, please try again."
|
|
14277
14928
|
}
|
|
14278
14929
|
},
|
|
14279
14930
|
{
|
|
14280
14931
|
type: "400",
|
|
14281
14932
|
system_message: "Bad Request: The server could not understand the request due to invalid syntax.",
|
|
14282
14933
|
message: {
|
|
14283
|
-
fi: "",
|
|
14284
|
-
sv: "",
|
|
14285
|
-
en: "The server rejected your file"
|
|
14934
|
+
fi: "Tiedostoa ei hyväksytty.",
|
|
14935
|
+
sv: "Servern avvisade din fil.",
|
|
14936
|
+
en: "The server rejected your file."
|
|
14286
14937
|
}
|
|
14287
14938
|
},
|
|
14288
14939
|
{
|
|
14289
14940
|
type: "401",
|
|
14290
|
-
system_message: "Not Authenticated: The client must authenticate itself to get the requested response
|
|
14941
|
+
system_message: "Not Authenticated: The client must authenticate itself to get the requested response...",
|
|
14291
14942
|
message: {
|
|
14292
|
-
fi: "",
|
|
14293
|
-
sv: "",
|
|
14294
|
-
en: "You need to be logged in to upload files"
|
|
14943
|
+
fi: "Vain kirjautunut käyttäjä voi lähettää tiedostoja.",
|
|
14944
|
+
sv: "Du måste vara inloggad för att ladda upp filer.",
|
|
14945
|
+
en: "You need to be logged in to upload files."
|
|
14295
14946
|
}
|
|
14296
14947
|
},
|
|
14297
14948
|
{
|
|
14298
14949
|
type: "403",
|
|
14299
|
-
system_message: "No Access: The client does not have access rights to the content
|
|
14950
|
+
system_message: "No Access: The client does not have access rights to the content.",
|
|
14300
14951
|
message: {
|
|
14301
|
-
fi: "",
|
|
14302
|
-
sv: "",
|
|
14303
|
-
en: "You do not have the correct access rights to upload files"
|
|
14952
|
+
fi: "Ei oikeuksia lähettää tiedostoja.",
|
|
14953
|
+
sv: "Du har inte rätt åtkomsträttigheter för att ladda upp filer.",
|
|
14954
|
+
en: "You do not have the correct access rights to upload files."
|
|
14304
14955
|
}
|
|
14305
14956
|
},
|
|
14306
14957
|
{
|
|
14307
14958
|
type: "413",
|
|
14308
14959
|
system_message: "Payload too large",
|
|
14309
14960
|
message: {
|
|
14310
|
-
fi: "",
|
|
14311
|
-
sv: "",
|
|
14312
|
-
en: "The file was to large for the server to handle"
|
|
14961
|
+
fi: "Tiedosto oli liian vastaanotettavaksi.",
|
|
14962
|
+
sv: "Filen var för stor för servern att hantera.",
|
|
14963
|
+
en: "The file was to large for the server to handle."
|
|
14313
14964
|
}
|
|
14314
14965
|
},
|
|
14315
14966
|
{
|
|
14316
14967
|
type: "415",
|
|
14317
14968
|
system_message: "Unsupported media type",
|
|
14318
14969
|
message: {
|
|
14319
|
-
fi: "",
|
|
14320
|
-
sv: "",
|
|
14321
|
-
en: "The server rejected the file because it had the wrong type"
|
|
14970
|
+
fi: "Tiedoston tyyppi oli väärä.",
|
|
14971
|
+
sv: "Servern avvisade filen eftersom den hade fel typ.",
|
|
14972
|
+
en: "The server rejected the file because it had the wrong type."
|
|
14322
14973
|
}
|
|
14323
14974
|
},
|
|
14324
14975
|
{
|
|
14325
14976
|
type: "429",
|
|
14326
14977
|
system_message: "Too many request from same address",
|
|
14327
14978
|
message: {
|
|
14328
|
-
fi: "",
|
|
14329
|
-
sv: "",
|
|
14330
|
-
en: "The server has received to many request from you, please try again later"
|
|
14979
|
+
fi: "Liian monta yritystä, ole hyvä ja yritä myöhemmin uudelleen.",
|
|
14980
|
+
sv: "Servern har fått många förfrågningar från dig, försök igen senare.",
|
|
14981
|
+
en: "The server has received to many request from you, please try again later."
|
|
14331
14982
|
}
|
|
14332
14983
|
},
|
|
14333
14984
|
{
|
|
14334
14985
|
type: "500",
|
|
14335
14986
|
system_message: "Internal Server Error",
|
|
14336
14987
|
message: {
|
|
14337
|
-
fi: "",
|
|
14338
|
-
sv: "",
|
|
14339
|
-
en: "The server reported an unknown error and the upload failed"
|
|
14988
|
+
fi: "Palvelin ilmoitti tuntemattomasta virheestä ja lataus epäonnistui.",
|
|
14989
|
+
sv: "Servern rapporterade ett okänt fel och uppladdningen misslyckades.",
|
|
14990
|
+
en: "The server reported an unknown error and the upload failed."
|
|
14340
14991
|
}
|
|
14341
14992
|
},
|
|
14342
14993
|
{
|
|
14343
14994
|
type: "duet-upload-100",
|
|
14344
14995
|
system_message: "File extension not allowed",
|
|
14345
14996
|
message: {
|
|
14346
|
-
fi: "",
|
|
14347
|
-
sv: "",
|
|
14348
|
-
en: "You cannot upload files with that extension"
|
|
14997
|
+
fi: "Tiedoston tyyppi ei ole sallittu.",
|
|
14998
|
+
sv: "Du kan inte ladda upp filer av den type.",
|
|
14999
|
+
en: "You cannot upload files with that extension."
|
|
14349
15000
|
}
|
|
14350
15001
|
},
|
|
14351
15002
|
{
|
|
14352
15003
|
type: "duet-upload-001",
|
|
14353
15004
|
system_message: "File transfer failed",
|
|
14354
15005
|
message: {
|
|
14355
|
-
fi: "",
|
|
14356
|
-
sv: "",
|
|
14357
|
-
en: "Your connection to the server was interrupted, try again"
|
|
15006
|
+
fi: "Tiedoston lähetys keskeytyi, ole hyvä ja yritä uudelleen.",
|
|
15007
|
+
sv: "Din anslutning till servern avbröts, försök igen.",
|
|
15008
|
+
en: "Your connection to the server was interrupted, try again."
|
|
14358
15009
|
}
|
|
14359
15010
|
},
|
|
14360
15011
|
{
|
|
14361
15012
|
type: "duet-upload-101",
|
|
14362
15013
|
system_message: "File mimetype not allowed",
|
|
14363
15014
|
message: {
|
|
14364
|
-
fi: "",
|
|
14365
|
-
sv: "",
|
|
14366
|
-
en: "You cannot upload files of that type"
|
|
15015
|
+
fi: "Tiedoston tyyppi ei ole sallittu.",
|
|
15016
|
+
sv: "Du kan inte ladda upp filer av den typ.",
|
|
15017
|
+
en: "You cannot upload files of that type."
|
|
14367
15018
|
}
|
|
14368
15019
|
},
|
|
14369
15020
|
{
|
|
14370
15021
|
type: "duet-upload-201",
|
|
14371
15022
|
system_message: "File is too large",
|
|
14372
15023
|
message: {
|
|
14373
|
-
fi: "",
|
|
14374
|
-
sv: "",
|
|
14375
|
-
en: "The file is larger than permitted"
|
|
15024
|
+
fi: "Tiedosto on liian iso.",
|
|
15025
|
+
sv: "Filen är större än tillåtet.",
|
|
15026
|
+
en: "The file is larger than permitted."
|
|
14376
15027
|
}
|
|
14377
15028
|
},
|
|
14378
15029
|
{
|
|
14379
15030
|
type: "duet-upload-202",
|
|
14380
15031
|
system_message: "The combined size of all files is too large",
|
|
14381
15032
|
message: {
|
|
14382
|
-
fi: "",
|
|
14383
|
-
sv: "",
|
|
14384
|
-
en: "You have reached the maximum combined filesize"
|
|
15033
|
+
fi: "Tiedostojen yhteenlaskettu koko on liian iso.",
|
|
15034
|
+
sv: "Du har nått den maximala kombinerade filstorleken.",
|
|
15035
|
+
en: "You have reached the maximum combined filesize."
|
|
14385
15036
|
}
|
|
14386
15037
|
},
|
|
14387
15038
|
{
|
|
@@ -14389,7 +15040,7 @@ var errorcodes = [
|
|
|
14389
15040
|
system_message: "The maximum file limit has been reached",
|
|
14390
15041
|
message: {
|
|
14391
15042
|
fi: "Liitteiden maksimimäärä saavutettu.",
|
|
14392
|
-
sv: "",
|
|
15043
|
+
sv: "Maximalt antal bilagor har uppnåtts.",
|
|
14393
15044
|
en: "Maximum number of attachments reached."
|
|
14394
15045
|
}
|
|
14395
15046
|
}
|
|
@@ -14401,16 +15052,81 @@ const getError = (code) => {
|
|
|
14401
15052
|
system_message: undefined,
|
|
14402
15053
|
message: undefined,
|
|
14403
15054
|
};
|
|
14404
|
-
error =
|
|
14405
|
-
|
|
15055
|
+
error = errorCodes.filter(errorItem => {
|
|
15056
|
+
// the == is intentional we may be comparing numbers to strings - and that is ok here
|
|
15057
|
+
return errorItem.type == code;
|
|
14406
15058
|
})[0];
|
|
14407
15059
|
if (!error) {
|
|
14408
|
-
error =
|
|
15060
|
+
error = errorCodes.filter(errorItem => {
|
|
14409
15061
|
return errorItem.type === "default";
|
|
14410
15062
|
})[0];
|
|
14411
15063
|
}
|
|
14412
15064
|
return error;
|
|
14413
15065
|
};
|
|
15066
|
+
const getI18nError = (errorCode) => {
|
|
15067
|
+
const errorFromJson = getError(errorCode);
|
|
15068
|
+
const i18String = getLocaleString(errorFromJson.message);
|
|
15069
|
+
if (i18String === "" || !i18String) {
|
|
15070
|
+
return errorFromJson.system_message;
|
|
15071
|
+
}
|
|
15072
|
+
else {
|
|
15073
|
+
return i18String;
|
|
15074
|
+
}
|
|
15075
|
+
};
|
|
15076
|
+
|
|
15077
|
+
const ErrorItem = ({ data }) => {
|
|
15078
|
+
const { item, error } = data;
|
|
15079
|
+
const { name } = item;
|
|
15080
|
+
const { type } = error;
|
|
15081
|
+
return (hAsync("span", { class: "duet-upload-item-error", role: "status" },
|
|
15082
|
+
hAsync("duet-paragraph", { class: "duet-upload-item-name", color: "danger", margin: "none", weight: "semi-bold" },
|
|
15083
|
+
hAsync("duet-icon", { margin: "none", size: "xx-small", name: "messaging-attachment" }),
|
|
15084
|
+
" ",
|
|
15085
|
+
name),
|
|
15086
|
+
hAsync("duet-paragraph", { class: "duet-upload-item-error-label", size: "small", margin: "none", color: "danger" }, getI18nError(type))));
|
|
15087
|
+
};
|
|
15088
|
+
|
|
15089
|
+
const ProgressItem = ({ progress, name }) => (hAsync("span", null,
|
|
15090
|
+
hAsync("duet-paragraph", { color: "secondary", margin: "none", size: "small" }, name),
|
|
15091
|
+
hAsync("duet-spacer", { size: "xx-small" }),
|
|
15092
|
+
hAsync("duet-progress", { progress: Math.ceil(progress), "aria-hidden": true })));
|
|
15093
|
+
|
|
15094
|
+
const formatBytes = (bytes, decimals = 2) => {
|
|
15095
|
+
if (bytes === 0) {
|
|
15096
|
+
return "0 Bytes";
|
|
15097
|
+
}
|
|
15098
|
+
const k = 1024;
|
|
15099
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
15100
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
15101
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
15102
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
15103
|
+
};
|
|
15104
|
+
|
|
15105
|
+
const SuccessItem = ({ data, showLinks }) => {
|
|
15106
|
+
const { item, size, uploaded, url, meta } = data;
|
|
15107
|
+
const { name } = item;
|
|
15108
|
+
const ContentName = (hAsync("span", { class: "duet-upload-item-name" },
|
|
15109
|
+
hAsync("duet-icon", { margin: "none", size: "xx-small", name: "messaging-attachment" }),
|
|
15110
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
15111
|
+
name));
|
|
15112
|
+
const SizeText = (hAsync("span", { class: "duet-upload-item-size", style: { fontSize: "14px", fontWeight: "400" } },
|
|
15113
|
+
"(",
|
|
15114
|
+
formatBytes(size),
|
|
15115
|
+
")"));
|
|
15116
|
+
const FilenameLine = uploaded && url && showLinks ? (hAsync("duet-paragraph", { color: "secondary", margin: "none", weight: "semi-bold" },
|
|
15117
|
+
hAsync("duet-link", { url: url, external: true }, ContentName),
|
|
15118
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
15119
|
+
SizeText)) : (hAsync("duet-paragraph", { color: "secondary", margin: "none", weight: "semi-bold" },
|
|
15120
|
+
ContentName,
|
|
15121
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
15122
|
+
SizeText));
|
|
15123
|
+
const Badges = meta && meta.badges ? (hAsync("span", null,
|
|
15124
|
+
hAsync("duet-spacer", { size: "xx-small" }),
|
|
15125
|
+
meta.badges.map(badgeText => (hAsync("duet-badge", { color: "primary" }, badgeText))))) : undefined;
|
|
15126
|
+
return (hAsync("span", { class: "duet-upload-item-success" },
|
|
15127
|
+
hAsync("div", null, FilenameLine),
|
|
15128
|
+
Badges));
|
|
15129
|
+
};
|
|
14414
15130
|
|
|
14415
15131
|
const validateFileExtension = (name, allowedExtensions) => {
|
|
14416
15132
|
if (!allowedExtensions) {
|
|
@@ -14501,12 +15217,8 @@ const validateTotalAmountIsAboveMax = (filelist, maxFiles) => {
|
|
|
14501
15217
|
return false;
|
|
14502
15218
|
};
|
|
14503
15219
|
|
|
14504
|
-
const makeXhrRequest = (payload, options, onFailure, onSuccess, onProgress) => {
|
|
14505
|
-
const { type, xhr, uri, argument, headers } =
|
|
14506
|
-
type: "POST",
|
|
14507
|
-
argument: null,
|
|
14508
|
-
headers: null,
|
|
14509
|
-
}, options);
|
|
15220
|
+
const makeXhrRequest = ({ payload, options, onFailure, onSuccess, onProgress }) => {
|
|
15221
|
+
const { type = "POST", xhr, uri, argument = null, headers = null } = options;
|
|
14510
15222
|
xhr.open(type, `${uri}${argument || ""}`, true);
|
|
14511
15223
|
const { data, name } = payload;
|
|
14512
15224
|
// headers must be added after open
|
|
@@ -14533,12 +15245,13 @@ const makeXhrRequest = (payload, options, onFailure, onSuccess, onProgress) => {
|
|
|
14533
15245
|
return xhr;
|
|
14534
15246
|
};
|
|
14535
15247
|
|
|
14536
|
-
const duetUploadCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-upload,*.sc-duet-upload::after,*.sc-duet-upload::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-upload-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}
|
|
15248
|
+
const duetUploadCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-upload,*.sc-duet-upload::after,*.sc-duet-upload::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-upload-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@::slotted([slot=header])*/.sc-duet-upload-s>[slot=header]{margin-bottom:16px}/*!@::slotted([slot=fileheader])*/.sc-duet-upload-s>[slot=fileheader]{margin:16px 0 0 0}/*!@::slotted([slot=filefooter])*/.sc-duet-upload-s>[slot=filefooter]{margin-top:16px}/*!@.duet-upload*/.duet-upload.sc-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*/.duet-upload-item-size.sc-duet-upload{font-size:0.75rem;font-weight:400}/*!@.duet-upload-filelist*/.duet-upload-filelist.sc-duet-upload{margin-bottom:25px}/*!@.duet-upload-filelist-empty*/.duet-upload-filelist-empty.sc-duet-upload{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:#f5f8fa}";
|
|
14537
15249
|
|
|
14538
15250
|
/**
|
|
14539
15251
|
* @slot header - named slot - to place content after description / caption
|
|
14540
|
-
* @slot fileheader - named slot - to place content above filelist (only displayed when filelist contains items)
|
|
14541
|
-
* @slot
|
|
15252
|
+
* @slot fileheader - named slot - to place content above "filelist" (only displayed when "filelist" contains items)
|
|
15253
|
+
* @slot filelist - named slot - should always contain a configurable duet-editable-table or a component that exposes the same functionality
|
|
15254
|
+
* @slot filefooter - named slot - to place content below "filelist" (only displayed when "filelist" contains items)
|
|
14542
15255
|
*/
|
|
14543
15256
|
class DuetUpload {
|
|
14544
15257
|
constructor(hostRef) {
|
|
@@ -14558,9 +15271,19 @@ class DuetUpload {
|
|
|
14558
15271
|
this.buttonId = createID("DuetButton");
|
|
14559
15272
|
this.labelId = createID("DuetLabel");
|
|
14560
15273
|
this.uploadId = createID("DuetUpload");
|
|
15274
|
+
this.editableTableId = createID("DuetEditableTable");
|
|
14561
15275
|
this.filesInProgress = new Map();
|
|
14562
15276
|
this.fileMaxReached = false;
|
|
14563
15277
|
this.bytesMaxReached = false;
|
|
15278
|
+
//region Internally exposed properties
|
|
15279
|
+
/**
|
|
15280
|
+
* Properties
|
|
15281
|
+
*/
|
|
15282
|
+
this.DefaultGroups = {
|
|
15283
|
+
inprogress: "inprogress",
|
|
15284
|
+
success: "success",
|
|
15285
|
+
failure: "failure",
|
|
15286
|
+
};
|
|
14564
15287
|
/**
|
|
14565
15288
|
* State() variables
|
|
14566
15289
|
*/
|
|
@@ -14570,9 +15293,91 @@ class DuetUpload {
|
|
|
14570
15293
|
* it will be up to you to handle the upload and return progress information to the upload-component
|
|
14571
15294
|
*/
|
|
14572
15295
|
this.external = false;
|
|
15296
|
+
/**
|
|
15297
|
+
* If set the upload component will not display an upload button, you will have to create on yourself
|
|
15298
|
+
* and call the exposed methods startUpload
|
|
15299
|
+
*/
|
|
15300
|
+
this.hideButton = false;
|
|
15301
|
+
/**
|
|
15302
|
+
* Default actions added to all files
|
|
15303
|
+
*/
|
|
15304
|
+
this.actions = [
|
|
15305
|
+
{
|
|
15306
|
+
icon: "action-delete",
|
|
15307
|
+
color: "color-danger",
|
|
15308
|
+
color_hover: "category-home",
|
|
15309
|
+
id: "delete",
|
|
15310
|
+
map: ["success", "failure"],
|
|
15311
|
+
label: {
|
|
15312
|
+
fi: "Poista tiedosto",
|
|
15313
|
+
en: "Poista tiedosto",
|
|
15314
|
+
sv: "Ta bort filen",
|
|
15315
|
+
},
|
|
15316
|
+
},
|
|
15317
|
+
{
|
|
15318
|
+
icon: "navigation-close",
|
|
15319
|
+
color: "primary",
|
|
15320
|
+
color_hover: "category-home",
|
|
15321
|
+
id: "cancel",
|
|
15322
|
+
map: ["inprogress"],
|
|
15323
|
+
label: {
|
|
15324
|
+
fi: "Keskeytä lähetys",
|
|
15325
|
+
en: "Cancel the upload",
|
|
15326
|
+
sv: "Stop överföringen",
|
|
15327
|
+
},
|
|
15328
|
+
},
|
|
15329
|
+
];
|
|
15330
|
+
/**
|
|
15331
|
+
* If enabled the filelist will create links on successfully uploaded items,
|
|
15332
|
+
* this requires the server can respond with link URIs in the correct format
|
|
15333
|
+
*/
|
|
15334
|
+
this.showLinks = false;
|
|
15335
|
+
/**
|
|
15336
|
+
* Property to change the aria upload progress text read aloud by screenreaders
|
|
15337
|
+
* @default {
|
|
15338
|
+
fi: "Lisää liite",
|
|
15339
|
+
sv: "Lägg till en bilaga",
|
|
15340
|
+
en: "Choose files",
|
|
15341
|
+
}
|
|
15342
|
+
*/
|
|
15343
|
+
this.statusLabelDefaults = {
|
|
15344
|
+
fi: {
|
|
15345
|
+
inProgress: "Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",
|
|
15346
|
+
inProgressWithErrors: "Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",
|
|
15347
|
+
done: "Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",
|
|
15348
|
+
doneWithErrors: "Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",
|
|
15349
|
+
files: "tiedostot",
|
|
15350
|
+
file: "tiedosto",
|
|
15351
|
+
},
|
|
15352
|
+
sv: {
|
|
15353
|
+
inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
15354
|
+
inProgressWithErrors: "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
|
|
15355
|
+
done: "Alla {filesTotal} har lagts till",
|
|
15356
|
+
doneWithErrors: "Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
|
|
15357
|
+
files: "filer",
|
|
15358
|
+
file: "fil",
|
|
15359
|
+
},
|
|
15360
|
+
en: {
|
|
15361
|
+
inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
15362
|
+
inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
|
|
15363
|
+
done: "All {filesTotal} added successfully",
|
|
15364
|
+
doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
|
|
15365
|
+
files: "tiedostoa",
|
|
15366
|
+
file: "tiedosto",
|
|
15367
|
+
},
|
|
15368
|
+
};
|
|
15369
|
+
/**
|
|
15370
|
+
* Strings used for the status aria-label
|
|
15371
|
+
*/
|
|
15372
|
+
this.statusMessageLabel = getLocaleString(this.statusLabelDefaults);
|
|
14573
15373
|
/**
|
|
14574
15374
|
* Property to change descriptionDefaults defaults on the component.
|
|
14575
15375
|
* normally you would handle these strings on an application level and override @label when needed
|
|
15376
|
+
* @default {
|
|
15377
|
+
fi: "Lisää liite",
|
|
15378
|
+
sv: "Lägg till en bilaga",
|
|
15379
|
+
en: "Add an attachment",
|
|
15380
|
+
}
|
|
14576
15381
|
*/
|
|
14577
15382
|
this.buttonLabelDefaults = {
|
|
14578
15383
|
fi: "Lisää liite",
|
|
@@ -14608,6 +15413,10 @@ class DuetUpload {
|
|
|
14608
15413
|
* browser from displaying its own validation errors.
|
|
14609
15414
|
*/
|
|
14610
15415
|
this.required = false;
|
|
15416
|
+
/**
|
|
15417
|
+
* Visually hides the groups labels in the editable table list used to display the list of files
|
|
15418
|
+
*/
|
|
15419
|
+
this.hideGroups = false;
|
|
14611
15420
|
/**
|
|
14612
15421
|
* Map of string that contain list of uploaded files.
|
|
14613
15422
|
*/
|
|
@@ -14619,6 +15428,7 @@ class DuetUpload {
|
|
|
14619
15428
|
/**
|
|
14620
15429
|
* Property to change labelDefaults defaults on the component.
|
|
14621
15430
|
* normally you would handle these strings on an application level and override @label when needed
|
|
15431
|
+
* @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
|
|
14622
15432
|
*/
|
|
14623
15433
|
this.labelDefaults = {
|
|
14624
15434
|
fi: "Lisää liite",
|
|
@@ -14633,6 +15443,11 @@ class DuetUpload {
|
|
|
14633
15443
|
/**
|
|
14634
15444
|
* Property to change descriptionDefaults defaults on the component.
|
|
14635
15445
|
* normally you would handle these strings on an application level and override @label when needed
|
|
15446
|
+
* @default {
|
|
15447
|
+
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.",
|
|
15448
|
+
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.",
|
|
15449
|
+
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.",
|
|
15450
|
+
}
|
|
14636
15451
|
*/
|
|
14637
15452
|
this.descriptionDefaults = {
|
|
14638
15453
|
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.",
|
|
@@ -14641,12 +15456,20 @@ class DuetUpload {
|
|
|
14641
15456
|
};
|
|
14642
15457
|
/**
|
|
14643
15458
|
* Description for the upload component.
|
|
14644
|
-
* @default
|
|
15459
|
+
* @default {
|
|
15460
|
+
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.",
|
|
15461
|
+
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.",
|
|
15462
|
+
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.",
|
|
15463
|
+
}
|
|
14645
15464
|
*/
|
|
14646
15465
|
this.description = getLocaleString(this.descriptionDefaults);
|
|
14647
15466
|
/**
|
|
14648
15467
|
* Defaults for the filelist's empty state.
|
|
14649
|
-
* @default {
|
|
15468
|
+
* @default {
|
|
15469
|
+
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
15470
|
+
sv: "Inga filer har lagts till ännu.",
|
|
15471
|
+
en: "No files added yet.",
|
|
15472
|
+
}
|
|
14650
15473
|
*/
|
|
14651
15474
|
this.fileListEmptyDefaults = {
|
|
14652
15475
|
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
@@ -14662,21 +15485,6 @@ class DuetUpload {
|
|
|
14662
15485
|
* Display the input in error state along with an error message.
|
|
14663
15486
|
*/
|
|
14664
15487
|
this.error = "";
|
|
14665
|
-
/**
|
|
14666
|
-
* Visually hide the label, but still show it to screen readers.
|
|
14667
|
-
*/
|
|
14668
|
-
this.labelHidden = false;
|
|
14669
|
-
/**
|
|
14670
|
-
* if set, allows capture of media from user camera / microphone
|
|
14671
|
-
* The capture attribute value is a string that specifies which camera to use for capture
|
|
14672
|
-
* of image or video data, if the accept attribute indicates that the input should be of
|
|
14673
|
-
* one of those types. A value of user indicates that the user-facing camera and/or
|
|
14674
|
-
* microphone should be used. A value of environment specifies that the outward-facing
|
|
14675
|
-
* camera and/or microphone should be used. If this attribute is missing, the user agent
|
|
14676
|
-
* is free to decide on its own what to do. If the requested facing mode isn't available,
|
|
14677
|
-
* the user agent may fall back to its preferred default mode.
|
|
14678
|
-
*/
|
|
14679
|
-
this.capture = undefined;
|
|
14680
15488
|
/**
|
|
14681
15489
|
* Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded.
|
|
14682
15490
|
*/
|
|
@@ -14708,10 +15516,94 @@ class DuetUpload {
|
|
|
14708
15516
|
* by default this is off, setting this to true will limit the users choices to what has been explicitly set
|
|
14709
15517
|
*/
|
|
14710
15518
|
this.limitSelection = false;
|
|
15519
|
+
//region Private functions
|
|
14711
15520
|
/**
|
|
14712
15521
|
* Private functions
|
|
14713
15522
|
*/
|
|
14714
|
-
this.
|
|
15523
|
+
this.listenForActionEvents = () => {
|
|
15524
|
+
this.element.addEventListener("duetEditableItemAction", (e) => {
|
|
15525
|
+
const detail = e.detail;
|
|
15526
|
+
const { action, keyName, originalEvent } = detail;
|
|
15527
|
+
switch (action) {
|
|
15528
|
+
case "delete":
|
|
15529
|
+
this.onDelete(keyName, originalEvent);
|
|
15530
|
+
break;
|
|
15531
|
+
case "cancel":
|
|
15532
|
+
this.onCancel(keyName, originalEvent);
|
|
15533
|
+
break;
|
|
15534
|
+
// code block
|
|
15535
|
+
}
|
|
15536
|
+
});
|
|
15537
|
+
};
|
|
15538
|
+
this.verifyValidity = () => {
|
|
15539
|
+
const { invalid, valid } = this.getFilesAsArray();
|
|
15540
|
+
const oldValid = this.valid;
|
|
15541
|
+
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
15542
|
+
if (this.valid !== oldValid) {
|
|
15543
|
+
this.duetState.emit({
|
|
15544
|
+
originalEvent: undefined,
|
|
15545
|
+
data: { valid: this.valid, from: "componentWillRender" },
|
|
15546
|
+
component: "duet-upload",
|
|
15547
|
+
});
|
|
15548
|
+
}
|
|
15549
|
+
};
|
|
15550
|
+
this.getGroupFromItemData = (item) => {
|
|
15551
|
+
if (item.valid && item.progress === 100) {
|
|
15552
|
+
// if the item has a group, move the file to that group instead
|
|
15553
|
+
// of into the standard success group
|
|
15554
|
+
if (item.group) {
|
|
15555
|
+
return item.group;
|
|
15556
|
+
}
|
|
15557
|
+
return this.DefaultGroups.success;
|
|
15558
|
+
}
|
|
15559
|
+
else if (item.progress > 0 && item.progress !== 100) {
|
|
15560
|
+
return this.DefaultGroups.inprogress;
|
|
15561
|
+
}
|
|
15562
|
+
else if (!item.valid) {
|
|
15563
|
+
return this.DefaultGroups.failure;
|
|
15564
|
+
}
|
|
15565
|
+
else if (item.group) {
|
|
15566
|
+
return item.group;
|
|
15567
|
+
}
|
|
15568
|
+
else {
|
|
15569
|
+
return "none";
|
|
15570
|
+
}
|
|
15571
|
+
};
|
|
15572
|
+
this.getItemHTMLFromItemData = (data, group) => {
|
|
15573
|
+
if (group === this.DefaultGroups.success) {
|
|
15574
|
+
return hAsync(SuccessItem, { data: data, showLinks: this.showLinks });
|
|
15575
|
+
}
|
|
15576
|
+
else if (group === this.DefaultGroups.inprogress) {
|
|
15577
|
+
return hAsync(ProgressItem, { progress: data.progress, name: data.item.name });
|
|
15578
|
+
}
|
|
15579
|
+
else if (group === this.DefaultGroups.failure) {
|
|
15580
|
+
return hAsync(ErrorItem, { data: data });
|
|
15581
|
+
}
|
|
15582
|
+
else if (data.group) {
|
|
15583
|
+
return data.html;
|
|
15584
|
+
}
|
|
15585
|
+
else {
|
|
15586
|
+
return "none";
|
|
15587
|
+
}
|
|
15588
|
+
};
|
|
15589
|
+
this.convertToDuetEditableTableItems = () => {
|
|
15590
|
+
// we're always recreating the map - in order to force an update down stream.
|
|
15591
|
+
const itemData = new Map();
|
|
15592
|
+
//walk the files Map and convert to DuetEditableTableItemData
|
|
15593
|
+
this.files.forEach((data, key, _originalMap) => {
|
|
15594
|
+
const group = this.getGroupFromItemData(data);
|
|
15595
|
+
const item = this.getItemHTMLFromItemData(data, group);
|
|
15596
|
+
itemData.set(key, {
|
|
15597
|
+
uid: data.uid,
|
|
15598
|
+
item,
|
|
15599
|
+
group,
|
|
15600
|
+
});
|
|
15601
|
+
});
|
|
15602
|
+
return itemData;
|
|
15603
|
+
};
|
|
15604
|
+
this.kick = debounce(() => {
|
|
15605
|
+
this.tick = Date.now();
|
|
15606
|
+
}, 30); // will trigger re-render
|
|
14715
15607
|
this.genHashName = () => Date.now().toString(36) + Math.random();
|
|
14716
15608
|
this.updateValueInMap = (item, key, value, kick = true) => {
|
|
14717
15609
|
const fileItem = this.files.get(item);
|
|
@@ -14722,10 +15614,14 @@ class DuetUpload {
|
|
|
14722
15614
|
}
|
|
14723
15615
|
};
|
|
14724
15616
|
this.updateProgress = (ev, name) => {
|
|
14725
|
-
|
|
14726
|
-
|
|
15617
|
+
console.log(this.filesInProgress.size);
|
|
15618
|
+
const updateProgressHelper = percentComplete => {
|
|
14727
15619
|
this.updateValueInMap(name, "progress", percentComplete);
|
|
14728
15620
|
this.onProgress(name, percentComplete, ev);
|
|
15621
|
+
};
|
|
15622
|
+
if (ev.lengthComputable) {
|
|
15623
|
+
const percentComplete = (ev.loaded / ev.total) * 100;
|
|
15624
|
+
updateProgressHelper(percentComplete);
|
|
14729
15625
|
}
|
|
14730
15626
|
else {
|
|
14731
15627
|
console.log("cant read progress");
|
|
@@ -14764,16 +15660,17 @@ class DuetUpload {
|
|
|
14764
15660
|
*/
|
|
14765
15661
|
this.nativeInput.value = "";
|
|
14766
15662
|
};
|
|
14767
|
-
this.
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
|
|
14773
|
-
|
|
14774
|
-
|
|
14775
|
-
}
|
|
15663
|
+
this.startUpload = async (ev, metaData = undefined) => {
|
|
15664
|
+
await this.setFocus();
|
|
15665
|
+
this.metaData = metaData;
|
|
15666
|
+
this.nativeInput.click();
|
|
15667
|
+
this.onUpload(ev, metaData);
|
|
15668
|
+
ev.stopPropagation();
|
|
15669
|
+
ev.preventDefault();
|
|
15670
|
+
return;
|
|
14776
15671
|
};
|
|
15672
|
+
//endregion
|
|
15673
|
+
//region Eventlisteners for the XHR requests
|
|
14777
15674
|
/**
|
|
14778
15675
|
* Eventlisteners for the XHR requests
|
|
14779
15676
|
*/
|
|
@@ -14783,6 +15680,7 @@ class DuetUpload {
|
|
|
14783
15680
|
};
|
|
14784
15681
|
this.transferDone = (xhr, name, status) => {
|
|
14785
15682
|
this.updateValueInMap(name, "status", status, false);
|
|
15683
|
+
this.updateValueInMap(name, "uploaded", true, false);
|
|
14786
15684
|
try {
|
|
14787
15685
|
const response = JSON.parse(xhr.response);
|
|
14788
15686
|
this.updateValueInMap(name, "url", response.url);
|
|
@@ -14796,12 +15694,13 @@ class DuetUpload {
|
|
|
14796
15694
|
this.transferDoneWithFailure = (xhr, name, status) => {
|
|
14797
15695
|
try {
|
|
14798
15696
|
const { error } = JSON.parse(xhr.response);
|
|
14799
|
-
this.updateValueInMap(name, "error", { message: error.message, type: error.type });
|
|
15697
|
+
this.updateValueInMap(name, "error", { message: error.message, type: error.type }, false);
|
|
14800
15698
|
}
|
|
14801
15699
|
catch (e) {
|
|
14802
15700
|
console.error("Server did not respond with expected response error:{message: string, type: int}");
|
|
14803
|
-
this.updateValueInMap(name, "error", { type: status });
|
|
15701
|
+
this.updateValueInMap(name, "error", { type: status }, false);
|
|
14804
15702
|
}
|
|
15703
|
+
this.updateValueInMap(name, "valid", false, true);
|
|
14805
15704
|
};
|
|
14806
15705
|
this.transferFailed = name => {
|
|
14807
15706
|
this.updateValueInMap(name, "error", getError("duet-upload-001"));
|
|
@@ -14832,15 +15731,15 @@ class DuetUpload {
|
|
|
14832
15731
|
this.files.delete(key);
|
|
14833
15732
|
this.validateTotals();
|
|
14834
15733
|
this.kick();
|
|
14835
|
-
if (!this.external) {
|
|
14836
|
-
this.makeXHRDeleteRequest(deletedItem);
|
|
14837
|
-
}
|
|
14838
|
-
this.resetFormFields();
|
|
14839
15734
|
this.duetDelete.emit({
|
|
14840
15735
|
originalEvent: ev,
|
|
14841
15736
|
data: { deletion: deletedItem },
|
|
14842
15737
|
component: "duet-upload",
|
|
14843
15738
|
});
|
|
15739
|
+
if (!this.external) {
|
|
15740
|
+
this.makeXHRDeleteRequest(deletedItem);
|
|
15741
|
+
}
|
|
15742
|
+
this.resetFormFields();
|
|
14844
15743
|
};
|
|
14845
15744
|
this.onCancel = (key, ev) => {
|
|
14846
15745
|
const cancelledItem = this.files.get(key);
|
|
@@ -14859,9 +15758,10 @@ class DuetUpload {
|
|
|
14859
15758
|
component: "duet-upload",
|
|
14860
15759
|
});
|
|
14861
15760
|
};
|
|
14862
|
-
this.onUpload = (ev) => {
|
|
15761
|
+
this.onUpload = (ev, metaData) => {
|
|
14863
15762
|
this.duetUpload.emit({
|
|
14864
15763
|
originalEvent: ev,
|
|
15764
|
+
metaData,
|
|
14865
15765
|
component: "duet-upload",
|
|
14866
15766
|
});
|
|
14867
15767
|
};
|
|
@@ -14893,37 +15793,26 @@ class DuetUpload {
|
|
|
14893
15793
|
data: { files: this.files },
|
|
14894
15794
|
});
|
|
14895
15795
|
};
|
|
14896
|
-
this.startUpload = async (ev) => {
|
|
14897
|
-
await this.setFocus();
|
|
14898
|
-
this.nativeInput.click();
|
|
14899
|
-
this.onUpload(ev);
|
|
14900
|
-
ev.stopPropagation();
|
|
14901
|
-
ev.preventDefault();
|
|
14902
|
-
};
|
|
14903
15796
|
}
|
|
14904
15797
|
watchValidHandler(newValue, oldValue) {
|
|
14905
15798
|
if (newValue !== oldValue) {
|
|
14906
15799
|
this.kick();
|
|
14907
15800
|
}
|
|
14908
15801
|
}
|
|
15802
|
+
//endregion
|
|
14909
15803
|
/**
|
|
14910
15804
|
* Component lifecycle events.
|
|
14911
15805
|
*/
|
|
14912
15806
|
componentWillLoad() {
|
|
14913
15807
|
inheritGlobalTheme(this);
|
|
15808
|
+
this.listenForActionEvents();
|
|
14914
15809
|
}
|
|
14915
15810
|
componentWillRender() {
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
14919
|
-
if (this.valid !== oldValid) {
|
|
14920
|
-
this.duetState.emit({
|
|
14921
|
-
originalEvent: undefined,
|
|
14922
|
-
data: { valid: this.valid, from: "componentWillRender" },
|
|
14923
|
-
component: "duet-upload",
|
|
14924
|
-
});
|
|
14925
|
-
}
|
|
15811
|
+
// listen to the events from the component
|
|
15812
|
+
this.verifyValidity();
|
|
14926
15813
|
}
|
|
15814
|
+
//endregion
|
|
15815
|
+
//region XHR requests
|
|
14927
15816
|
/**
|
|
14928
15817
|
* XHR request utilities
|
|
14929
15818
|
*/
|
|
@@ -14942,23 +15831,37 @@ class DuetUpload {
|
|
|
14942
15831
|
xhr.upload.addEventListener("abort", () => {
|
|
14943
15832
|
this.transferCanceled(name);
|
|
14944
15833
|
});
|
|
14945
|
-
return makeXhrRequest({
|
|
15834
|
+
return makeXhrRequest({
|
|
15835
|
+
payload: { data, name },
|
|
15836
|
+
options: { type: "POST", uri: this.uri, xhr, argument: null, headers: null },
|
|
15837
|
+
onFailure: this.transferDoneWithFailure,
|
|
15838
|
+
onSuccess: this.transferDone,
|
|
15839
|
+
onProgress: this.trackProgress,
|
|
15840
|
+
});
|
|
14946
15841
|
}
|
|
14947
15842
|
makeXHRDeleteRequest(data) {
|
|
14948
15843
|
const { uid, item } = data;
|
|
14949
15844
|
const xhr = new XMLHttpRequest();
|
|
14950
15845
|
// don't present server issues to user on deletes, just remove them from the visible list
|
|
14951
|
-
return makeXhrRequest({
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
-
|
|
14958
|
-
|
|
15846
|
+
return makeXhrRequest({
|
|
15847
|
+
payload: { data: null, name },
|
|
15848
|
+
options: {
|
|
15849
|
+
type: "DELETE",
|
|
15850
|
+
xhr,
|
|
15851
|
+
uri: this.uri,
|
|
15852
|
+
arguments: `?key=${uid}&name=${item.name}`,
|
|
15853
|
+
headers: {
|
|
15854
|
+
"x-fileuid": uid,
|
|
15855
|
+
"x-filename": item.name,
|
|
15856
|
+
},
|
|
14959
15857
|
},
|
|
14960
|
-
|
|
15858
|
+
onFailure: this.transferDoneWithFailure,
|
|
15859
|
+
onSuccess: this.transferDone,
|
|
15860
|
+
onProgress: this.trackProgress,
|
|
15861
|
+
});
|
|
14961
15862
|
}
|
|
15863
|
+
//endregion
|
|
15864
|
+
//region EventHandlers
|
|
14962
15865
|
/**
|
|
14963
15866
|
* Component event handling.
|
|
14964
15867
|
*/
|
|
@@ -14967,7 +15870,7 @@ class DuetUpload {
|
|
|
14967
15870
|
const selectedFiles = Array.from((_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.files);
|
|
14968
15871
|
// FileList is a nice array like structure but
|
|
14969
15872
|
// to ensure uniqueness of files we use a mapping structure and
|
|
14970
|
-
// key to the name (makes it easier to delete)
|
|
15873
|
+
// key to the name (makes it easier to delete as well)
|
|
14971
15874
|
if (selectedFiles) {
|
|
14972
15875
|
for (const item of selectedFiles) {
|
|
14973
15876
|
const { valid, errorMessage, errorType, errorSystem } = validateFile(item, {
|
|
@@ -14980,6 +15883,8 @@ class DuetUpload {
|
|
|
14980
15883
|
uid,
|
|
14981
15884
|
item: item,
|
|
14982
15885
|
size: item.size,
|
|
15886
|
+
meta: this.metaData,
|
|
15887
|
+
uploaded: false,
|
|
14983
15888
|
valid,
|
|
14984
15889
|
error: {
|
|
14985
15890
|
type: valid ? undefined : errorType,
|
|
@@ -15008,8 +15913,14 @@ class DuetUpload {
|
|
|
15008
15913
|
data.append("file", item);
|
|
15009
15914
|
data.append("uid", uid);
|
|
15010
15915
|
data.append("name", item.name);
|
|
15011
|
-
data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size }));
|
|
15012
|
-
|
|
15916
|
+
data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size, meta: fileListItem.meta }));
|
|
15917
|
+
try {
|
|
15918
|
+
fileListItem.xhr = await this.makeXHRPostRequest(data);
|
|
15919
|
+
}
|
|
15920
|
+
catch (e) {
|
|
15921
|
+
// in case one of the global maxes have been reached, invalidate the file
|
|
15922
|
+
this.updateValueInMap(item.name, "valid", false, false);
|
|
15923
|
+
}
|
|
15013
15924
|
}
|
|
15014
15925
|
// kick the stat to force update
|
|
15015
15926
|
this.kick();
|
|
@@ -15017,12 +15928,15 @@ class DuetUpload {
|
|
|
15017
15928
|
}
|
|
15018
15929
|
// reset the form, so that a user may upload a file again (with the same name)
|
|
15019
15930
|
this.resetFormFields();
|
|
15931
|
+
// reset the internal metaData state
|
|
15932
|
+
this.metaData = undefined;
|
|
15020
15933
|
this.duetChange.emit({
|
|
15021
15934
|
originalEvent: ev,
|
|
15022
15935
|
data: { files: this.files },
|
|
15023
15936
|
component: "duet-upload",
|
|
15024
15937
|
});
|
|
15025
15938
|
}
|
|
15939
|
+
//endregion
|
|
15026
15940
|
/**
|
|
15027
15941
|
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
15028
15942
|
* `input.focus()`.
|
|
@@ -15033,6 +15947,15 @@ class DuetUpload {
|
|
|
15033
15947
|
}
|
|
15034
15948
|
return;
|
|
15035
15949
|
}
|
|
15950
|
+
/**
|
|
15951
|
+
* Method for invoking the upload sequence
|
|
15952
|
+
*/
|
|
15953
|
+
async upload(metaData = undefined) {
|
|
15954
|
+
await this.setFocus();
|
|
15955
|
+
this.metaData = metaData;
|
|
15956
|
+
this.nativeInput.click();
|
|
15957
|
+
return;
|
|
15958
|
+
}
|
|
15036
15959
|
/**
|
|
15037
15960
|
* Get list of files, divided in errors and valid sections
|
|
15038
15961
|
*/
|
|
@@ -15042,6 +15965,12 @@ class DuetUpload {
|
|
|
15042
15965
|
}
|
|
15043
15966
|
return this.getFilesAsArray();
|
|
15044
15967
|
}
|
|
15968
|
+
/**
|
|
15969
|
+
* Convenience method for updating a of an item in the files attribute
|
|
15970
|
+
*/
|
|
15971
|
+
async updateValue(item, key, value) {
|
|
15972
|
+
this.updateValueInMap(item, key, value);
|
|
15973
|
+
}
|
|
15045
15974
|
/**
|
|
15046
15975
|
* render() function
|
|
15047
15976
|
* Always the last one in the class.
|
|
@@ -15051,13 +15980,13 @@ class DuetUpload {
|
|
|
15051
15980
|
let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
|
|
15052
15981
|
caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
|
|
15053
15982
|
caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
|
|
15054
|
-
return (hAsync(Host, { class: { "duet-m-0": this.margin === "none" } }, hAsync("duet-fieldset", { label: this.label, caption: caption }, hAsync("slot", { name: "header" }), hAsync("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
|
|
15983
|
+
return (hAsync(Host, { class: { "duet-m-0": this.margin === "none" } }, hAsync("duet-fieldset", { label: this.label, caption: caption }, hAsync("slot", { name: "header" }), !this.files.size && (hAsync("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
|
|
15055
15984
|
"duet-upload-filelist-empty": !this.files.size,
|
|
15056
15985
|
"duet-upload-filelist": true,
|
|
15057
15986
|
"duet-upload-filelist-filled": this.files.size,
|
|
15058
|
-
}, id: this.labelId, for: identifier },
|
|
15987
|
+
}, id: this.labelId, for: identifier }, this.fileListEmpty)), !!this.files.size && hAsync("slot", { name: "fileheader" }), !!this.files.size && (hAsync("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 && (hAsync("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 && hAsync("slot", { name: "filefooter" }), hAsync("duet-spacer", { size: "large" }), !this.hideButton && (hAsync("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)), hAsync("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (hAsync("duet-alert", null, this.fileMaxReached && getI18nError("duet-upload-301"), this.bytesMaxReached && getI18nError("duet-upload-202"))), hAsync("duet-spacer", { size: "medium" }), hAsync("duet-visually-hidden", null, hAsync("input", { ref: input => {
|
|
15059
15988
|
this.nativeInput = input;
|
|
15060
|
-
}, accept: this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
15989
|
+
}, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
15061
15990
|
"duet-upload": true,
|
|
15062
15991
|
}, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
|
|
15063
15992
|
}
|
|
@@ -15075,9 +16004,14 @@ class DuetUpload {
|
|
|
15075
16004
|
"accessibleControls": [1, "accessible-controls"],
|
|
15076
16005
|
"accessibleOwns": [1, "accessible-owns"],
|
|
15077
16006
|
"external": [4],
|
|
16007
|
+
"hideButton": [4, "hide-upload-button"],
|
|
16008
|
+
"actions": [1],
|
|
15078
16009
|
"uri": [1],
|
|
16010
|
+
"showLinks": [4, "show-links"],
|
|
15079
16011
|
"caption": [1],
|
|
15080
|
-
"
|
|
16012
|
+
"statusLabelDefaults": [1, "status-label-default"],
|
|
16013
|
+
"statusMessageLabel": [16],
|
|
16014
|
+
"buttonLabelDefaults": [1, "button-label-default"],
|
|
15081
16015
|
"buttonLabel": [1, "button-label"],
|
|
15082
16016
|
"accessibleButtonLabel": [1, "accessible-button-label"],
|
|
15083
16017
|
"theme": [1025],
|
|
@@ -15085,18 +16019,18 @@ class DuetUpload {
|
|
|
15085
16019
|
"identifier": [1],
|
|
15086
16020
|
"margin": [1],
|
|
15087
16021
|
"required": [4],
|
|
16022
|
+
"groups": [1],
|
|
16023
|
+
"hideGroups": [4, "hide-table-labels"],
|
|
15088
16024
|
"files": [1040],
|
|
15089
16025
|
"valid": [1540],
|
|
15090
|
-
"labelDefaults": [
|
|
16026
|
+
"labelDefaults": [1, "label-default"],
|
|
15091
16027
|
"label": [1],
|
|
15092
|
-
"descriptionDefaults": [
|
|
16028
|
+
"descriptionDefaults": [1, "description-default"],
|
|
15093
16029
|
"description": [1],
|
|
15094
|
-
"fileListEmptyDefaults": [
|
|
16030
|
+
"fileListEmptyDefaults": [1, "list-empty-default"],
|
|
15095
16031
|
"fileListEmpty": [1, "file-list-empty"],
|
|
15096
16032
|
"error": [1],
|
|
15097
|
-
"labelHidden": [4, "label-hidden"],
|
|
15098
16033
|
"name": [1],
|
|
15099
|
-
"capture": [8],
|
|
15100
16034
|
"maxBytes": [2, "max-bytes"],
|
|
15101
16035
|
"maxBytesTotal": [2, "max-bytes-total"],
|
|
15102
16036
|
"maxFiles": [2, "max-files"],
|
|
@@ -15107,7 +16041,9 @@ class DuetUpload {
|
|
|
15107
16041
|
"value": [1025],
|
|
15108
16042
|
"tick": [32],
|
|
15109
16043
|
"setFocus": [64],
|
|
15110
|
-
"
|
|
16044
|
+
"upload": [64],
|
|
16045
|
+
"getFiles": [64],
|
|
16046
|
+
"updateValue": [64]
|
|
15111
16047
|
},
|
|
15112
16048
|
"$listeners$": undefined,
|
|
15113
16049
|
"$lazyBundleId$": "-",
|
|
@@ -15115,6 +16051,112 @@ class DuetUpload {
|
|
|
15115
16051
|
}; }
|
|
15116
16052
|
}
|
|
15117
16053
|
|
|
16054
|
+
class DuetUploadAriaStatus {
|
|
16055
|
+
constructor(hostRef) {
|
|
16056
|
+
registerInstance(this, hostRef);
|
|
16057
|
+
/**
|
|
16058
|
+
* State() variables
|
|
16059
|
+
*/
|
|
16060
|
+
this.statusMessage = null;
|
|
16061
|
+
/**
|
|
16062
|
+
* State() variables
|
|
16063
|
+
*/
|
|
16064
|
+
this.statusMessageLabel = null;
|
|
16065
|
+
/**
|
|
16066
|
+
* Adds accessible label that is read aloud
|
|
16067
|
+
*/
|
|
16068
|
+
this.accessibleAriaLive = "polite";
|
|
16069
|
+
/**
|
|
16070
|
+
* valid file amount
|
|
16071
|
+
*/
|
|
16072
|
+
this.valid = undefined;
|
|
16073
|
+
/**
|
|
16074
|
+
* total files
|
|
16075
|
+
*/
|
|
16076
|
+
this.total = undefined;
|
|
16077
|
+
/**
|
|
16078
|
+
* invalid file amount
|
|
16079
|
+
*/
|
|
16080
|
+
this.invalid = undefined;
|
|
16081
|
+
/**
|
|
16082
|
+
* valid file amount
|
|
16083
|
+
*/
|
|
16084
|
+
this.inprogress = undefined;
|
|
16085
|
+
/**
|
|
16086
|
+
* Component lifecycle events.
|
|
16087
|
+
*/
|
|
16088
|
+
this.replacePlaceHolders = (statusString) => {
|
|
16089
|
+
const addFiles = (amount) => {
|
|
16090
|
+
return amount > 1 ? `${amount} ${this.statusMessageLabel.files}` : `${amount} ${this.statusMessageLabel.file}`;
|
|
16091
|
+
};
|
|
16092
|
+
return statusString
|
|
16093
|
+
.replace("{filesUploaded}", addFiles(this.valid))
|
|
16094
|
+
.replace("{filesInProgress}", addFiles(this.inprogress))
|
|
16095
|
+
.replace("{filesTotal}", addFiles(this.total))
|
|
16096
|
+
.replace("{filesWithErrors}", addFiles(this.invalid));
|
|
16097
|
+
};
|
|
16098
|
+
this.getStatusMessage = () => {
|
|
16099
|
+
const { done, inProgress, doneWithErrors, inProgressWithErrors } = this.statusMessageLabel;
|
|
16100
|
+
const hasErrors = this.invalid > 0;
|
|
16101
|
+
const isInProgress = this.inprogress > 0;
|
|
16102
|
+
const isInProgressWithErrors = this.inprogress > 0 && hasErrors;
|
|
16103
|
+
const isDone = this.valid === this.total && !isInProgress && !hasErrors;
|
|
16104
|
+
const isDoneWithErrors = this.valid + this.invalid === this.total && !isInProgress;
|
|
16105
|
+
if (isDone) {
|
|
16106
|
+
this.statusMessage = this.replacePlaceHolders(done);
|
|
16107
|
+
return;
|
|
16108
|
+
}
|
|
16109
|
+
else if (isInProgressWithErrors) {
|
|
16110
|
+
this.statusMessage = this.replacePlaceHolders(inProgressWithErrors);
|
|
16111
|
+
return;
|
|
16112
|
+
}
|
|
16113
|
+
else if (isInProgress) {
|
|
16114
|
+
this.statusMessage = this.replacePlaceHolders(inProgress);
|
|
16115
|
+
return;
|
|
16116
|
+
}
|
|
16117
|
+
else if (isDoneWithErrors) {
|
|
16118
|
+
this.statusMessage = this.replacePlaceHolders(doneWithErrors);
|
|
16119
|
+
return;
|
|
16120
|
+
}
|
|
16121
|
+
return;
|
|
16122
|
+
};
|
|
16123
|
+
}
|
|
16124
|
+
watchHandler(newValue, oldValue) {
|
|
16125
|
+
if (newValue !== oldValue) {
|
|
16126
|
+
this.getStatusMessage();
|
|
16127
|
+
}
|
|
16128
|
+
}
|
|
16129
|
+
/**
|
|
16130
|
+
* render() function
|
|
16131
|
+
* Always the last one in the class.
|
|
16132
|
+
*/
|
|
16133
|
+
render() {
|
|
16134
|
+
return (hAsync(Host, { role: "status", "aria-live": "assertive", "aria-atomic": "true", "aria-relevant": "all" }, hAsync("duet-visually-hidden", null, this.statusMessage)));
|
|
16135
|
+
}
|
|
16136
|
+
static get watchers() { return {
|
|
16137
|
+
"valid": ["watchHandler"],
|
|
16138
|
+
"invalid": ["watchHandler"],
|
|
16139
|
+
"inprogress": ["watchHandler"],
|
|
16140
|
+
"total": ["watchHandler"]
|
|
16141
|
+
}; }
|
|
16142
|
+
static get cmpMeta() { return {
|
|
16143
|
+
"$flags$": 9,
|
|
16144
|
+
"$tagName$": "duet-upload-aria-status",
|
|
16145
|
+
"$members$": {
|
|
16146
|
+
"statusMessageLabel": [16],
|
|
16147
|
+
"accessibleAriaLive": [1, "accessible-aria-live"],
|
|
16148
|
+
"valid": [2],
|
|
16149
|
+
"total": [2],
|
|
16150
|
+
"invalid": [2],
|
|
16151
|
+
"inprogress": [2],
|
|
16152
|
+
"statusMessage": [32]
|
|
16153
|
+
},
|
|
16154
|
+
"$listeners$": undefined,
|
|
16155
|
+
"$lazyBundleId$": "-",
|
|
16156
|
+
"$attrsToReflect$": []
|
|
16157
|
+
}; }
|
|
16158
|
+
}
|
|
16159
|
+
|
|
15118
16160
|
const duetVisuallyHiddenCss = "/*!@:host*/.sc-duet-visually-hidden-h{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}";
|
|
15119
16161
|
|
|
15120
16162
|
class DuetVisuallyHidden {
|
|
@@ -15152,6 +16194,9 @@ registerComponents([
|
|
|
15152
16194
|
DuetCookieConsent,
|
|
15153
16195
|
DuetDatePicker,
|
|
15154
16196
|
DuetDivider,
|
|
16197
|
+
DuetEditableTable,
|
|
16198
|
+
DuetEditableTableButton,
|
|
16199
|
+
DuetEditableTableItem,
|
|
15155
16200
|
DuetEmptyState,
|
|
15156
16201
|
DuetFieldset,
|
|
15157
16202
|
DuetFooter,
|
|
@@ -15173,6 +16218,7 @@ registerComponents([
|
|
|
15173
16218
|
DuetNotificationDrawer,
|
|
15174
16219
|
DuetNumberInput,
|
|
15175
16220
|
DuetParagraph,
|
|
16221
|
+
DuetProgress,
|
|
15176
16222
|
DuetRadio,
|
|
15177
16223
|
DuetRadioGroup,
|
|
15178
16224
|
DuetRangeSlider,
|
|
@@ -15189,6 +16235,7 @@ registerComponents([
|
|
|
15189
16235
|
DuetTooltip,
|
|
15190
16236
|
DuetTray,
|
|
15191
16237
|
DuetUpload,
|
|
16238
|
+
DuetUploadAriaStatus,
|
|
15192
16239
|
DuetVisuallyHidden,
|
|
15193
16240
|
]);
|
|
15194
16241
|
|