@duetds/components 4.31.0 → 4.33.2
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 +1895 -77
- package/lib/cjs/{dom-e89ebf90.js → dom-c850c8d7.js} +1 -1
- package/lib/cjs/duet-alert.cjs.entry.js +2 -2
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +4 -4
- package/lib/cjs/duet-caption_4.cjs.entry.js +17 -10
- package/lib/cjs/duet-card.cjs.entry.js +5 -5
- package/lib/cjs/duet-checkbox.cjs.entry.js +2 -2
- package/lib/cjs/duet-choice_2.cjs.entry.js +53 -24
- package/lib/cjs/duet-collapsible.cjs.entry.js +4 -449
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +7 -7
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table-button.cjs.entry.js +89 -0
- package/lib/cjs/duet-editable-table_4.cjs.entry.js +1445 -0
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +2 -2
- package/lib/cjs/duet-grid_2.cjs.entry.js +69 -4
- package/lib/cjs/duet-header_2.cjs.entry.js +3 -3
- package/lib/cjs/duet-hero.cjs.entry.js +2 -2
- package/lib/cjs/duet-icon.cjs.entry.js +5 -13
- package/lib/cjs/duet-input_2.cjs.entry.js +6 -6
- 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 +3 -3
- package/lib/cjs/duet-notification_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-number-input.cjs.entry.js +2 -2
- 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 +5 -5
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-tab_2.cjs.entry.js +3 -3
- 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 +2 -2
- package/lib/cjs/duet-tray.cjs.entry.js +3 -3
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +100 -0
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +4 -4
- package/lib/cjs/{focus-utils-bd331feb.js → focus-utils-27c696bb.js} +1 -1
- package/lib/cjs/{index-113c2add.js → index-18b0f43a.js} +91 -77
- package/lib/cjs/{language-utils-48b8860b.js → language-utils-aa282901.js} +6 -2
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/{shadow-css-0c8c175b.js → shadow-css-e3edeed1.js} +9 -10
- package/lib/cjs/{token-utils-13e5d13e.js → token-utils-63a9c8dc.js} +1 -1
- package/lib/cjs/tokens-8596cece.js +459 -0
- 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 +17 -3
- package/lib/collection/components/duet-alert/duet-alert.js +4 -4
- package/lib/collection/components/duet-button/duet-button.js +10 -10
- package/lib/collection/components/duet-card/duet-card.css +20 -0
- package/lib/collection/components/duet-card/duet-card.js +4 -1
- 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 +117 -33
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +4 -4
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +16 -16
- 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 +10 -10
- package/lib/collection/components/duet-grid/duet-grid.js +74 -6
- package/lib/collection/components/duet-grid-item/duet-grid-item.js +4 -4
- package/lib/collection/components/duet-header/duet-header.js +16 -16
- package/lib/collection/components/duet-heading/duet-heading.css +3 -0
- package/lib/collection/components/duet-heading/duet-heading.js +7 -6
- package/lib/collection/components/duet-hero/duet-hero.js +8 -8
- 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-link/duet-link.js +8 -8
- package/lib/collection/components/duet-logo/duet-logo.js +4 -4
- package/lib/collection/components/duet-modal/duet-modal.js +8 -8
- package/lib/collection/components/duet-notification/duet-notification.js +8 -8
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +8 -8
- package/lib/collection/components/duet-number-input/duet-number-input.js +20 -20
- 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 +10 -10
- 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 +14 -14
- package/lib/collection/components/duet-tray/duet-tray.js +12 -12
- package/lib/collection/components/duet-upload/duet-upload.css +64 -0
- package/lib/collection/components/duet-upload/duet-upload.js +1863 -0
- package/lib/collection/components/duet-upload/errorcodes.utils.js +32 -0
- package/lib/collection/components/duet-upload/mock.helpers.js +91 -0
- package/lib/collection/components/duet-upload/upload-editable-item-error.js +16 -0
- package/lib/collection/components/duet-upload/upload-editable-item-inprogres.js +8 -0
- package/lib/collection/components/duet-upload/upload-editable-item-success.js +30 -0
- package/lib/collection/components/duet-upload/upload-validators.js +93 -0
- package/lib/collection/components/duet-upload/upload.helpers.js +13 -0
- package/lib/collection/components/duet-upload/xhr.helpers.js +30 -0
- package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +217 -0
- package/lib/collection/utils/js-utils.js +12 -0
- package/lib/collection/utils/language-utils.js +6 -3
- package/lib/collection/utils/watch-options.js +35 -6
- package/lib/custom-elements-bundle/index.d.ts +36 -0
- package/lib/custom-elements-bundle/index.js +2014 -322
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-60ab57d4.entry.js → p-042ec8b1.entry.js} +1 -1
- package/lib/duet/{p-bcae23fc.system.entry.js → p-0435b54a.system.entry.js} +1 -1
- package/lib/duet/{p-dc85d2a4.entry.js → p-04b3e682.entry.js} +1 -1
- package/lib/duet/p-0ac2e60d.system.entry.js +4 -0
- package/lib/duet/p-0d22396e.system.js +16 -0
- package/lib/duet/p-1082d9f2.system.entry.js +4 -0
- package/lib/duet/p-12721178.js +4 -0
- package/lib/duet/{p-7d080785.system.entry.js → p-12fc4849.system.entry.js} +1 -1
- package/lib/duet/{p-c4737f88.entry.js → p-15fae689.entry.js} +1 -1
- package/lib/duet/p-1ad58142.entry.js +4 -0
- package/lib/duet/{p-c5f10483.system.entry.js → p-1c7d7cdd.system.entry.js} +1 -1
- package/lib/duet/p-1cf8dbc7.system.js +4 -0
- package/lib/duet/p-1dcbd837.system.entry.js +4 -0
- package/lib/duet/{p-fdecaf46.entry.js → p-1ecddc1d.entry.js} +1 -1
- package/lib/duet/p-2764f081.js +4 -0
- package/lib/duet/p-2b4bd1b2.system.entry.js +4 -0
- package/lib/duet/p-2d8e0faa.system.entry.js +4 -0
- package/lib/duet/{p-453955cc.system.entry.js → p-33538e90.system.entry.js} +1 -1
- package/lib/duet/{p-b1b8e510.entry.js → p-3364cfd2.entry.js} +1 -1
- package/lib/duet/p-350cea4e.system.entry.js +4 -0
- package/lib/duet/{p-bd9a7d8f.js → p-35a3794e.js} +0 -0
- package/lib/duet/p-39e9d638.entry.js +4 -0
- package/lib/duet/{p-1e7222c2.entry.js → p-3a7e519e.entry.js} +1 -1
- package/lib/duet/{p-9ce1baab.system.entry.js → p-3bcf2054.system.entry.js} +1 -1
- package/lib/duet/{p-322d1c38.js → p-3c1971d8.js} +1 -1
- package/lib/duet/{p-ef45cfe9.system.entry.js → p-3cad13af.system.entry.js} +1 -1
- package/lib/duet/p-408e8cdb.system.js +4 -0
- package/lib/duet/p-4a14da52.entry.js +4 -0
- package/lib/duet/{p-f96c4093.system.entry.js → p-4e17a6cb.system.entry.js} +1 -1
- package/lib/duet/{p-fbd83d67.entry.js → p-50b796eb.entry.js} +1 -1
- package/lib/duet/{p-22f56356.system.entry.js → p-5727cd82.system.entry.js} +1 -1
- package/lib/duet/{p-9c94be45.entry.js → p-582f3a2c.entry.js} +1 -1
- package/lib/duet/{p-e39471b6.entry.js → p-5b9621e2.entry.js} +1 -1
- package/lib/duet/{p-3e1ef509.system.entry.js → p-5f79eff8.system.entry.js} +1 -1
- package/lib/duet/{p-95626e7e.system.entry.js → p-60e721aa.system.entry.js} +1 -1
- package/lib/duet/{p-b03a46b6.entry.js → p-60ef3d05.entry.js} +1 -1
- package/lib/duet/{p-57ea2576.system.js → p-61fc3872.system.js} +1 -1
- package/lib/duet/{p-1cd7177f.entry.js → p-637df820.entry.js} +1 -1
- package/lib/duet/{p-07263910.system.entry.js → p-6402041d.system.entry.js} +1 -1
- package/lib/duet/p-64c0aa2a.entry.js +4 -0
- package/lib/duet/{p-28b67b94.entry.js → p-65451003.entry.js} +1 -1
- package/lib/duet/{p-1bfbc988.entry.js → p-659d6cb7.entry.js} +1 -1
- package/lib/duet/{p-91fa68a5.js → p-66fdebc5.js} +1 -1
- package/lib/duet/p-6708db8a.entry.js +4 -0
- package/lib/duet/{p-e08b8909.entry.js → p-68635a1c.entry.js} +1 -1
- package/lib/duet/p-6e363557.system.js +4 -0
- package/lib/duet/p-70fafc98.system.js +4 -0
- package/lib/duet/p-720a36f2.entry.js +4 -0
- package/lib/duet/{p-f53c8019.entry.js → p-72629304.entry.js} +1 -1
- package/lib/duet/p-75a104e3.entry.js +4 -0
- package/lib/duet/{p-02ad46a0.system.entry.js → p-75e5d4d1.system.entry.js} +1 -1
- package/lib/duet/{p-33cf6ed1.entry.js → p-7ab0bad8.entry.js} +1 -1
- package/lib/duet/{p-e834c8d5.system.entry.js → p-7ceaf4ef.system.entry.js} +1 -1
- package/lib/duet/{p-a1d12e94.system.entry.js → p-7f8cce41.system.entry.js} +1 -1
- package/lib/duet/{p-6d2da245.entry.js → p-7fed7f57.entry.js} +1 -1
- package/lib/duet/p-8143f3de.js +4 -0
- package/lib/duet/p-8c2f14d8.system.entry.js +4 -0
- package/lib/duet/{p-4670a654.entry.js → p-8c730326.entry.js} +1 -1
- package/lib/duet/{p-de093c16.entry.js → p-9125ed25.entry.js} +1 -1
- package/lib/duet/p-933c2774.system.entry.js +4 -0
- package/lib/duet/{p-b7e50cfa.entry.js → p-9584411c.entry.js} +1 -1
- package/lib/duet/p-987edcd0.js +15 -0
- package/lib/duet/p-9930e52e.entry.js +4 -0
- package/lib/duet/p-9a09ac2b.system.entry.js +4 -0
- package/lib/duet/{p-64109493.entry.js → p-a09ddd8f.entry.js} +1 -1
- package/lib/duet/{p-504dbf8f.system.entry.js → p-a2b2fa13.system.entry.js} +1 -1
- package/lib/duet/{p-2826f987.js → p-ad07f399.js} +1 -1
- package/lib/duet/{p-605bc214.system.entry.js → p-b1ad7a52.system.entry.js} +1 -1
- package/lib/duet/{p-f0b1850a.system.entry.js → p-b5dc29b8.system.entry.js} +1 -1
- package/lib/duet/p-ba6214be.entry.js +4 -0
- package/lib/duet/{p-92d38668.system.entry.js → p-be349a3d.system.entry.js} +1 -1
- package/lib/duet/{p-56e172f5.system.entry.js → p-c0f3f60f.system.entry.js} +1 -1
- package/lib/duet/{p-fd98468a.system.js → p-c18a599e.system.js} +0 -0
- package/lib/duet/p-c3c95a34.system.entry.js +4 -0
- package/lib/duet/{p-d4b4bfa6.entry.js → p-c506017d.entry.js} +1 -1
- package/lib/duet/p-c74cecf2.system.entry.js +4 -0
- package/lib/duet/p-c9a11360.entry.js +4 -0
- package/lib/duet/p-cd21755b.entry.js +4 -0
- package/lib/duet/p-cd597d62.system.entry.js +4 -0
- package/lib/duet/p-cff461b6.entry.js +4 -0
- package/lib/duet/{p-7b6db837.system.entry.js → p-d0fb19f7.system.entry.js} +1 -1
- package/lib/duet/{p-69a5dc6b.entry.js → p-d1dfa30e.entry.js} +1 -1
- package/lib/duet/{p-1cec5a70.system.entry.js → p-d4e706ac.system.entry.js} +1 -1
- package/lib/duet/{p-8cb47a70.system.entry.js → p-d5e2bb48.system.entry.js} +1 -1
- package/lib/duet/p-dd79932a.entry.js +4 -0
- package/lib/duet/p-dd9b8fcb.system.entry.js +4 -0
- package/lib/duet/p-ddb6344c.system.js +4 -0
- package/lib/duet/{p-47645ea8.system.entry.js → p-de43620d.system.entry.js} +1 -1
- package/lib/duet/p-e038da47.system.entry.js +4 -0
- package/lib/duet/p-eb55ccd2.system.js +4 -0
- package/lib/duet/p-ebc4e334.js +4 -0
- package/lib/duet/{p-5fc7e1f7.system.entry.js → p-f37ffb6f.system.entry.js} +1 -1
- package/lib/duet/p-f8744611.entry.js +4 -0
- package/lib/duet/p-fa99eaa4.system.js +4 -0
- package/lib/duet/{p-746655ba.entry.js → p-fd00b025.entry.js} +1 -1
- package/lib/esm/{dom-21034390.js → dom-58cd15f6.js} +1 -1
- package/lib/esm/duet-alert.entry.js +2 -2
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +4 -4
- package/lib/esm/duet-caption_4.entry.js +17 -10
- package/lib/esm/duet-card.entry.js +5 -5
- package/lib/esm/duet-checkbox.entry.js +2 -2
- package/lib/esm/duet-choice_2.entry.js +54 -25
- package/lib/esm/duet-collapsible.entry.js +3 -448
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +7 -7
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table-button.entry.js +85 -0
- package/lib/esm/duet-editable-table_4.entry.js +1438 -0
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +2 -2
- package/lib/esm/duet-grid_2.entry.js +69 -4
- package/lib/esm/duet-header_2.entry.js +3 -3
- package/lib/esm/duet-hero.entry.js +2 -2
- package/lib/esm/duet-icon.entry.js +5 -13
- package/lib/esm/duet-input_2.entry.js +6 -6
- 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 +3 -3
- package/lib/esm/duet-notification_2.entry.js +2 -2
- package/lib/esm/duet-number-input.entry.js +2 -2
- 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 +5 -5
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-tab_2.entry.js +3 -3
- 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 +2 -2
- package/lib/esm/duet-tray.entry.js +3 -3
- package/lib/esm/duet-upload-aria-status.entry.js +96 -0
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +4 -4
- package/lib/esm/{focus-utils-1995e5a9.js → focus-utils-c1fa24c4.js} +1 -1
- package/lib/esm/{index-6e246691.js → index-05e43a37.js} +91 -78
- package/lib/esm/{language-utils-d5c38f65.js → language-utils-344d894c.js} +6 -3
- package/lib/esm/loader.js +3 -3
- package/lib/esm/{shadow-css-31e2d504.js → shadow-css-7c726abb.js} +9 -10
- package/lib/esm/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
- package/lib/esm/tokens-e110dc89.js +453 -0
- 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 +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +2 -2
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table-button.entry.js +4 -0
- package/lib/esm-es5/duet-editable-table_4.entry.js +4 -0
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +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 +1 -1
- 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-aria-status.entry.js +4 -0
- 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-1995e5a9.js → focus-utils-c1fa24c4.js} +1 -1
- package/lib/esm-es5/index-05e43a37.js +4 -0
- package/lib/esm-es5/{language-utils-d5c38f65.js → language-utils-344d894c.js} +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/shadow-css-7c726abb.js +15 -0
- package/lib/esm-es5/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
- package/lib/esm-es5/tokens-e110dc89.js +4 -0
- package/lib/esm-es5/tokens.module-49cbf963.js +4 -0
- package/lib/esm-es5/watch-options-dd55bce8.js +4 -0
- package/lib/html.html-data.json +427 -10
- package/lib/types/components/duet-choice/duet-choice.d.ts +23 -4
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +5 -5
- 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-grid/duet-grid.d.ts +17 -2
- package/lib/types/components/duet-heading/duet-heading.d.ts +2 -2
- 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-upload/duet-upload.d.ts +404 -0
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +8 -0
- package/lib/types/components/duet-upload/mock.helpers.d.ts +2 -0
- package/lib/types/components/duet-upload/upload-editable-item-error.d.ts +7 -0
- package/lib/types/components/duet-upload/upload-editable-item-inprogres.d.ts +7 -0
- package/lib/types/components/duet-upload/upload-editable-item-success.d.ts +8 -0
- package/lib/types/components/duet-upload/upload-validators.d.ts +12 -0
- package/lib/types/components/duet-upload/upload.helpers.d.ts +1 -0
- package/lib/types/components/duet-upload/xhr.helpers.d.ts +18 -0
- package/lib/types/components/duet-upload-aria-status/duet-upload-aria-status.d.ts +49 -0
- package/lib/types/components.d.ts +791 -21
- package/lib/types/utils/js-utils.d.ts +1 -0
- package/lib/types/utils/language-utils.d.ts +5 -1
- package/lib/types/utils/watch-options.d.ts +2 -0
- package/package.json +6 -6
- package/lib/cjs/duet-table.cjs.entry.js +0 -132
- package/lib/duet/p-0058512b.js +0 -4
- package/lib/duet/p-0224db45.entry.js +0 -4
- package/lib/duet/p-15c15c6a.js +0 -15
- package/lib/duet/p-202bbd70.entry.js +0 -4
- package/lib/duet/p-33426ddc.entry.js +0 -4
- package/lib/duet/p-3d3f773d.system.entry.js +0 -4
- package/lib/duet/p-3f78a826.system.js +0 -4
- package/lib/duet/p-418b2ce7.system.js +0 -4
- package/lib/duet/p-43e39d98.system.js +0 -4
- package/lib/duet/p-44ffb960.entry.js +0 -4
- package/lib/duet/p-5230ee3c.system.entry.js +0 -4
- package/lib/duet/p-5aa0d34d.entry.js +0 -4
- package/lib/duet/p-6a230911.system.entry.js +0 -4
- package/lib/duet/p-6a356ab1.system.js +0 -4
- package/lib/duet/p-6a760b8a.entry.js +0 -4
- package/lib/duet/p-712e7dde.system.entry.js +0 -4
- package/lib/duet/p-82dc2e0b.entry.js +0 -4
- package/lib/duet/p-8c8e82aa.system.js +0 -4
- package/lib/duet/p-8c980350.system.entry.js +0 -4
- package/lib/duet/p-8f03c3eb.entry.js +0 -4
- package/lib/duet/p-96808a2e.system.entry.js +0 -4
- package/lib/duet/p-96c103b2.system.entry.js +0 -4
- package/lib/duet/p-9a89ec39.js +0 -4
- package/lib/duet/p-9ff25646.entry.js +0 -4
- package/lib/duet/p-b694cbf5.system.js +0 -4
- package/lib/duet/p-b82927b0.system.entry.js +0 -4
- package/lib/duet/p-ba205dca.entry.js +0 -4
- package/lib/duet/p-be19c57b.system.entry.js +0 -4
- package/lib/duet/p-c5beceed.js +0 -4
- package/lib/duet/p-d35fd913.system.entry.js +0 -4
- package/lib/duet/p-d7623eb8.system.entry.js +0 -4
- package/lib/duet/p-de842863.entry.js +0 -4
- package/lib/duet/p-e58ca7af.system.js +0 -16
- package/lib/esm/duet-table.entry.js +0 -128
- package/lib/esm/watch-options-de55ea78.js +0 -35
- package/lib/esm-es5/duet-table.entry.js +0 -4
- package/lib/esm-es5/index-6e246691.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/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';
|
|
@@ -4701,7 +4701,7 @@ function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResu
|
|
|
4701
4701
|
|
|
4702
4702
|
|
|
4703
4703
|
const NAMESPACE = 'duet';
|
|
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:
|
|
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
4705
|
|
|
4706
4706
|
const TAB_KEY = 9;
|
|
4707
4707
|
var appGlobalScript = () => {
|
|
@@ -5170,7 +5170,8 @@ const createElm = (e, t, o, n) => {
|
|
|
5170
5170
|
const n = createTime("scheduleUpdate", e.$cmpMeta$.$tagName$), s = e.$lazyInstance$ ;
|
|
5171
5171
|
let l;
|
|
5172
5172
|
return t ? ((e.$flags$ |= 256, e.$queuedListeners$ && (e.$queuedListeners$.map((([e, t]) => safeCall(s, e, t))),
|
|
5173
|
-
e.$queuedListeners$ = null)), (l = safeCall(s, "componentWillLoad"))) : (BUILD.cmpWillUpdate ),
|
|
5173
|
+
e.$queuedListeners$ = null)), (l = safeCall(s, "componentWillLoad"))) : (BUILD.cmpWillUpdate ), (l = then(l, (() => safeCall(s, "componentWillRender")))),
|
|
5174
|
+
n(), then(l, (() => updateComponent(e, s, t)));
|
|
5174
5175
|
}, updateComponent = async (e, t, o) => {
|
|
5175
5176
|
const n = e.$hostElement$, s = createTime("update", e.$cmpMeta$.$tagName$), l = n["s-rc"];
|
|
5176
5177
|
o && attachStyles(e);
|
|
@@ -5320,7 +5321,8 @@ const callRender = (e, t, o) => {
|
|
|
5320
5321
|
s.attributeChangedCallback = function(e, t, n) {
|
|
5321
5322
|
plt.jmp((() => {
|
|
5322
5323
|
const t = o.get(e);
|
|
5323
|
-
this.hasOwnProperty(t)
|
|
5324
|
+
if (this.hasOwnProperty(t)) n = this[t], delete this[t]; else if (s.hasOwnProperty(t) && "number" == typeof this[t] && this[t] == n) return;
|
|
5325
|
+
this[t] = (null !== n || "boolean" != typeof this[t]) && n;
|
|
5324
5326
|
}));
|
|
5325
5327
|
}, e.observedAttributes = n.filter((([e, t]) => 15 & t[0])).map((([e, n]) => {
|
|
5326
5328
|
const s = n[1] || e;
|
|
@@ -5634,6 +5636,9 @@ const getLocale = (lang) => {
|
|
|
5634
5636
|
}
|
|
5635
5637
|
throw new Error(`Locale for "${lang}" not found`);
|
|
5636
5638
|
};
|
|
5639
|
+
/**
|
|
5640
|
+
* Takes any json object that is passed and/or htmlencoded and converts it to proper json
|
|
5641
|
+
*/
|
|
5637
5642
|
const sanitizeString = (string) => {
|
|
5638
5643
|
const argIsString = typeof string === "string";
|
|
5639
5644
|
if (argIsString) {
|
|
@@ -5641,7 +5646,7 @@ const sanitizeString = (string) => {
|
|
|
5641
5646
|
return JSON.parse(convertHtmlQuotes(string));
|
|
5642
5647
|
}
|
|
5643
5648
|
catch (e) {
|
|
5644
|
-
console.log("
|
|
5649
|
+
console.log("sanitizeString received a string, that didnt parse to json object", string, e);
|
|
5645
5650
|
}
|
|
5646
5651
|
}
|
|
5647
5652
|
return string;
|
|
@@ -5653,7 +5658,7 @@ const sanitizeString = (string) => {
|
|
|
5653
5658
|
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"} | string will get JSON.parsed
|
|
5654
5659
|
* @param {boolean} languageOverride = false - in case you want to override the actual language set in html tag
|
|
5655
5660
|
* @default {object} {locale: "fi-FI", money: "€"}
|
|
5656
|
-
* @returns {(string|Object)} given example contains {fi:"something"} and
|
|
5661
|
+
* @returns {(string|Object)} given example contains {fi:"something"} and language===fi this will return "something"
|
|
5657
5662
|
*/
|
|
5658
5663
|
const getLocaleString = (langObject, languageOverride) => {
|
|
5659
5664
|
const obj = sanitizeString(langObject);
|
|
@@ -5961,6 +5966,7 @@ const sizeTappableSquare = "48px";
|
|
|
5961
5966
|
const sizeIconXSmall = "16px";
|
|
5962
5967
|
const sizeIconXxxSmall = "7px";
|
|
5963
5968
|
const sizeButtonBorder = "2px";
|
|
5969
|
+
const sizeButtonTinyBorder = "1px";
|
|
5964
5970
|
const sizeIconMedium = "24px";
|
|
5965
5971
|
const sizeIconSmall = "20px";
|
|
5966
5972
|
const opacity85 = "0.85";
|
|
@@ -6110,6 +6116,7 @@ var tokens$2 = /*#__PURE__*/Object.freeze({
|
|
|
6110
6116
|
sizeIconXSmall: sizeIconXSmall,
|
|
6111
6117
|
sizeIconXxxSmall: sizeIconXxxSmall,
|
|
6112
6118
|
sizeButtonBorder: sizeButtonBorder,
|
|
6119
|
+
sizeButtonTinyBorder: sizeButtonTinyBorder,
|
|
6113
6120
|
sizeIconMedium: sizeIconMedium,
|
|
6114
6121
|
sizeIconSmall: sizeIconSmall,
|
|
6115
6122
|
opacity85: opacity85,
|
|
@@ -6517,7 +6524,7 @@ const isQuestionKey = (e) => e.key === "?";
|
|
|
6517
6524
|
const isEnterKey = (e) => e.key === "Enter" || e.keyCode === 13;
|
|
6518
6525
|
const isKeyboardClick = (e) => isEnterKey(e) || isSpaceKey(e);
|
|
6519
6526
|
|
|
6520
|
-
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-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)}";
|
|
6527
|
+
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)}";
|
|
6521
6528
|
|
|
6522
6529
|
/**
|
|
6523
6530
|
* @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.
|
|
@@ -6613,7 +6620,7 @@ class DuetCard {
|
|
|
6613
6620
|
onKeyDown: this.handleKeyDown,
|
|
6614
6621
|
}
|
|
6615
6622
|
: {};
|
|
6616
|
-
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.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" }, this.secondaryHeading)));
|
|
6623
|
+
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))));
|
|
6617
6624
|
}
|
|
6618
6625
|
/**
|
|
6619
6626
|
* Sets focus on the specified `duet-card`. Use this method instead of the global
|
|
@@ -6675,7 +6682,7 @@ class DuetCard {
|
|
|
6675
6682
|
}; }
|
|
6676
6683
|
}
|
|
6677
6684
|
|
|
6678
|
-
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-
|
|
6685
|
+
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}";
|
|
6679
6686
|
|
|
6680
6687
|
class DuetCheckbox {
|
|
6681
6688
|
constructor(hostRef) {
|
|
@@ -6808,11 +6815,24 @@ class DuetCheckbox {
|
|
|
6808
6815
|
|
|
6809
6816
|
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>"};
|
|
6810
6817
|
|
|
6811
|
-
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}";
|
|
6818
|
+
const focusElement = (element) => {
|
|
6819
|
+
if ("setFocus" in element) {
|
|
6820
|
+
element.setFocus();
|
|
6821
|
+
}
|
|
6822
|
+
else {
|
|
6823
|
+
element.focus();
|
|
6824
|
+
}
|
|
6825
|
+
};
|
|
6826
|
+
const FocusGuard = ({ moveFocusTo }) => {
|
|
6827
|
+
return hAsync("div", { class: "duet-focus-guard", "aria-hidden": "true", tabIndex: 0, onFocus: () => focusElement(moveFocusTo) });
|
|
6828
|
+
};
|
|
6829
|
+
|
|
6830
|
+
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}";
|
|
6812
6831
|
|
|
6813
6832
|
/**
|
|
6814
6833
|
* @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.
|
|
6815
6834
|
* @slot info - Info content. Anything inserted into this slot is displayed in a collapsible info box.
|
|
6835
|
+
* @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
|
|
6816
6836
|
* @slot additional - Additional content. Anything inserted into this slot is displayed as additional content under the label and caption
|
|
6817
6837
|
*/
|
|
6818
6838
|
class DuetChoice {
|
|
@@ -6821,9 +6841,11 @@ class DuetChoice {
|
|
|
6821
6841
|
this.duetChange = createEvent$2(this, "duetChange", 7);
|
|
6822
6842
|
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
6823
6843
|
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
6844
|
+
this.hasHeader = false;
|
|
6824
6845
|
this.choiceId = createID("DuetChoice");
|
|
6825
|
-
this.
|
|
6826
|
-
this.
|
|
6846
|
+
this.expandId = createID("DuetChoiceExpand");
|
|
6847
|
+
this.headerId = createID("DuetChoiceHeader");
|
|
6848
|
+
this.infoButtonId = createID("DuetChoiceInfoButton");
|
|
6827
6849
|
/**
|
|
6828
6850
|
* State() variables
|
|
6829
6851
|
* Inlined decorator, alphabetical order.
|
|
@@ -6901,6 +6923,24 @@ class DuetChoice {
|
|
|
6901
6923
|
* browser from displaying its own validation errors.
|
|
6902
6924
|
*/
|
|
6903
6925
|
this.required = false;
|
|
6926
|
+
/**
|
|
6927
|
+
* Placeholder defaults
|
|
6928
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
6929
|
+
*/
|
|
6930
|
+
this.infoLabelDefaults = {
|
|
6931
|
+
fi: "Lisätietoja",
|
|
6932
|
+
en: "More information about",
|
|
6933
|
+
sv: "Mera information om",
|
|
6934
|
+
};
|
|
6935
|
+
/**
|
|
6936
|
+
* Hint text to display before the user types into the date picker input.
|
|
6937
|
+
* @default {
|
|
6938
|
+
* fi: "Lisätietoja",
|
|
6939
|
+
* en: "More information about",
|
|
6940
|
+
* sv: "Mera information om",
|
|
6941
|
+
* }
|
|
6942
|
+
*/
|
|
6943
|
+
this.infoLabel = getLocaleString(this.infoLabelDefaults, getLanguage());
|
|
6904
6944
|
this.onMouseEnter = () => {
|
|
6905
6945
|
this.isHovering = true;
|
|
6906
6946
|
};
|
|
@@ -6908,7 +6948,6 @@ class DuetChoice {
|
|
|
6908
6948
|
this.isHovering = false;
|
|
6909
6949
|
};
|
|
6910
6950
|
this.onClick = (ev) => {
|
|
6911
|
-
this.setFocus();
|
|
6912
6951
|
this.toggleChecked(ev);
|
|
6913
6952
|
};
|
|
6914
6953
|
this.handleKeyDown = (ev) => {
|
|
@@ -6916,7 +6955,7 @@ class DuetChoice {
|
|
|
6916
6955
|
this.toggleChecked(ev);
|
|
6917
6956
|
}
|
|
6918
6957
|
if (isQuestionKey(ev) && this.hasInfo) {
|
|
6919
|
-
this.toggleInfo(
|
|
6958
|
+
this.toggleInfo();
|
|
6920
6959
|
}
|
|
6921
6960
|
};
|
|
6922
6961
|
this.onChange = () => {
|
|
@@ -6950,8 +6989,6 @@ class DuetChoice {
|
|
|
6950
6989
|
if (this.disabled || this.groupDisabled) {
|
|
6951
6990
|
return;
|
|
6952
6991
|
}
|
|
6953
|
-
ev.stopPropagation();
|
|
6954
|
-
ev.preventDefault();
|
|
6955
6992
|
this.isInfoOpen = false;
|
|
6956
6993
|
// if it's a radio button and it's already checked
|
|
6957
6994
|
// we shouldn't fire an event, so exit early
|
|
@@ -6965,10 +7002,10 @@ class DuetChoice {
|
|
|
6965
7002
|
value: this.value,
|
|
6966
7003
|
component: "duet-choice",
|
|
6967
7004
|
});
|
|
6968
|
-
};
|
|
6969
|
-
this.toggleInfo = ev => {
|
|
6970
|
-
ev.stopPropagation();
|
|
6971
7005
|
ev.preventDefault();
|
|
7006
|
+
ev.stopPropagation();
|
|
7007
|
+
};
|
|
7008
|
+
this.toggleInfo = () => {
|
|
6972
7009
|
this.isInfoOpen = !this.isInfoOpen;
|
|
6973
7010
|
};
|
|
6974
7011
|
}
|
|
@@ -6978,6 +7015,7 @@ class DuetChoice {
|
|
|
6978
7015
|
componentWillLoad() {
|
|
6979
7016
|
inheritGlobalTheme(this);
|
|
6980
7017
|
this.hasInfo = !!this.element.querySelector("[slot='info']");
|
|
7018
|
+
this.hasHeader = !!this.element.querySelector('[slot="header"]');
|
|
6981
7019
|
this.hasAdditional = !!this.element.querySelector("[slot='additional']");
|
|
6982
7020
|
}
|
|
6983
7021
|
/**
|
|
@@ -6991,15 +7029,18 @@ class DuetChoice {
|
|
|
6991
7029
|
// @ts-ignore
|
|
6992
7030
|
const isTargetContainedInHost = this.element.contains(ev === null || ev === void 0 ? void 0 : ev.relatedTarget) || false;
|
|
6993
7031
|
if (!isTargetContainedInHost) {
|
|
6994
|
-
this.toggleInfo(
|
|
7032
|
+
this.toggleInfo();
|
|
6995
7033
|
}
|
|
6996
7034
|
}
|
|
6997
7035
|
}
|
|
6998
7036
|
handleHostKeyDown() {
|
|
6999
7037
|
this.isKeyDown = true;
|
|
7000
7038
|
}
|
|
7001
|
-
handleHostKeyUp() {
|
|
7039
|
+
handleHostKeyUp(ev) {
|
|
7002
7040
|
this.isKeyDown = false;
|
|
7041
|
+
if (isEscapeKey(ev) && this.isInfoOpen) {
|
|
7042
|
+
this.toggleInfo();
|
|
7043
|
+
}
|
|
7003
7044
|
}
|
|
7004
7045
|
/**
|
|
7005
7046
|
* Sets focus on the specified `duet-choice`. Use this method instead of the global
|
|
@@ -7012,11 +7053,13 @@ class DuetChoice {
|
|
|
7012
7053
|
if (this.accessibleDescribedBy) {
|
|
7013
7054
|
return this.accessibleDescribedBy;
|
|
7014
7055
|
}
|
|
7015
|
-
if (this.collapsible) {
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7056
|
+
if (this.collapsible || this.hasInfo) {
|
|
7057
|
+
if (this.hasHeader) {
|
|
7058
|
+
return this.headerId;
|
|
7059
|
+
}
|
|
7060
|
+
else {
|
|
7061
|
+
return this.expandId;
|
|
7062
|
+
}
|
|
7020
7063
|
}
|
|
7021
7064
|
return null;
|
|
7022
7065
|
}
|
|
@@ -7025,6 +7068,7 @@ class DuetChoice {
|
|
|
7025
7068
|
return {
|
|
7026
7069
|
"duet-choice-card-info": true,
|
|
7027
7070
|
"duet-choice-card-info-expanded": this.isInfoOpen,
|
|
7071
|
+
"duet-choice-card-collapsed": !this.isInfoOpen,
|
|
7028
7072
|
"duet-theme-turva": this.theme === "turva",
|
|
7029
7073
|
};
|
|
7030
7074
|
}
|
|
@@ -7032,6 +7076,7 @@ class DuetChoice {
|
|
|
7032
7076
|
return {
|
|
7033
7077
|
"duet-choice-card-collapsible": true,
|
|
7034
7078
|
"duet-choice-card-collapsible-expanded": this.checked,
|
|
7079
|
+
"duet-choice-card-collapsed": !this.checked,
|
|
7035
7080
|
"duet-choice-card-collapsible-disabled": this.disabled || this.groupDisabled ? true : false,
|
|
7036
7081
|
"duet-theme-turva": this.theme === "turva",
|
|
7037
7082
|
};
|
|
@@ -7063,10 +7108,13 @@ class DuetChoice {
|
|
|
7063
7108
|
info: this.isInfoOpen,
|
|
7064
7109
|
collapsible: this.collapsible,
|
|
7065
7110
|
"duet-p-0": this.padding === "none",
|
|
7066
|
-
} }, hAsync("input", {
|
|
7111
|
+
} }, 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: {
|
|
7067
7112
|
"duet-choice-info-toggle": true,
|
|
7068
7113
|
"duet-theme-turva": this.theme === "turva",
|
|
7069
|
-
}, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onClick: this.toggleInfo, disabled: this.disabled || this.groupDisabled, "aria-expanded": this.isInfoOpen ? "true" : "false", "aria-controls": this.
|
|
7114
|
+
}, 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: {
|
|
7115
|
+
"duet-choice-section-visible": this.collapsible ? this.checked : this.isInfoOpen,
|
|
7116
|
+
"duet-choice-section-hidden": this.collapsible ? !this.checked : !this.isInfoOpen,
|
|
7117
|
+
} }, 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));
|
|
7070
7118
|
}
|
|
7071
7119
|
get element() { return getElement(this); }
|
|
7072
7120
|
static get style() { return duetChoiceCss; }
|
|
@@ -7098,6 +7146,8 @@ class DuetChoice {
|
|
|
7098
7146
|
"groupResponsive": [4, "group-responsive"],
|
|
7099
7147
|
"disabled": [516],
|
|
7100
7148
|
"required": [4],
|
|
7149
|
+
"infoLabelDefaults": [1, "accessible-label-info-default"],
|
|
7150
|
+
"infoLabel": [1, "info-label"],
|
|
7101
7151
|
"isHovering": [32],
|
|
7102
7152
|
"isInfoOpen": [32],
|
|
7103
7153
|
"isBlurred": [32],
|
|
@@ -7109,19 +7159,41 @@ class DuetChoice {
|
|
|
7109
7159
|
}; }
|
|
7110
7160
|
}
|
|
7111
7161
|
|
|
7112
|
-
const
|
|
7162
|
+
const watchFor = (containerEl, tagName, onChange, changeHandler, options = {
|
|
7163
|
+
childList: true,
|
|
7164
|
+
subtree: true,
|
|
7165
|
+
}) => {
|
|
7113
7166
|
let mutation;
|
|
7114
7167
|
if (typeof MutationObserver !== "undefined") {
|
|
7115
7168
|
mutation = new MutationObserver(mutationList => {
|
|
7116
|
-
onChange(
|
|
7117
|
-
});
|
|
7118
|
-
mutation.observe(containerEl, {
|
|
7119
|
-
childList: true,
|
|
7120
|
-
subtree: true,
|
|
7169
|
+
onChange(changeHandler(mutationList, tagName));
|
|
7121
7170
|
});
|
|
7171
|
+
mutation.observe(containerEl, options);
|
|
7122
7172
|
}
|
|
7123
7173
|
return mutation;
|
|
7124
7174
|
};
|
|
7175
|
+
const watchForOptions = (containerEl, tagName, onChange) => {
|
|
7176
|
+
return watchFor(containerEl, tagName, onChange, getSelectedOption);
|
|
7177
|
+
};
|
|
7178
|
+
const watchForElement = (containerEl, tagName, onChange) => {
|
|
7179
|
+
return watchFor(containerEl, tagName, onChange, getElementItem, {
|
|
7180
|
+
childList: true,
|
|
7181
|
+
subtree: true,
|
|
7182
|
+
});
|
|
7183
|
+
};
|
|
7184
|
+
const getElementItem = (mutationList) => {
|
|
7185
|
+
let addedNode = false;
|
|
7186
|
+
let removedNode = false;
|
|
7187
|
+
mutationList.forEach(mut => {
|
|
7188
|
+
if (mut.addedNodes.length) {
|
|
7189
|
+
addedNode = true;
|
|
7190
|
+
}
|
|
7191
|
+
if (mut.removedNodes.length) {
|
|
7192
|
+
removedNode = true;
|
|
7193
|
+
}
|
|
7194
|
+
});
|
|
7195
|
+
return { addedNode, removedNode, mutationList };
|
|
7196
|
+
};
|
|
7125
7197
|
const getSelectedOption = (mutationList, tagName) => {
|
|
7126
7198
|
let newOption;
|
|
7127
7199
|
mutationList.forEach(mut => {
|
|
@@ -7172,11 +7244,11 @@ class DuetChoiceGroup {
|
|
|
7172
7244
|
/**
|
|
7173
7245
|
* Additional caption to show inside the label of the choice group.
|
|
7174
7246
|
*/
|
|
7175
|
-
this.caption =
|
|
7247
|
+
this.caption = undefined;
|
|
7176
7248
|
/**
|
|
7177
7249
|
* Tooltip to display next to the label of the choice group.
|
|
7178
7250
|
*/
|
|
7179
|
-
this.tooltip =
|
|
7251
|
+
this.tooltip = undefined;
|
|
7180
7252
|
/**
|
|
7181
7253
|
* With direction setting you can force the tooltip to always open towards left
|
|
7182
7254
|
* or right instead of automatically determining the direction.
|
|
@@ -7429,6 +7501,7 @@ const size_tappable_square = "48px";
|
|
|
7429
7501
|
const size_icon_x_small = "16px";
|
|
7430
7502
|
const size_icon_xxx_small = "7px";
|
|
7431
7503
|
const size_button_border = "2px";
|
|
7504
|
+
const size_button_tiny_border = "1px";
|
|
7432
7505
|
const size_icon_medium = "24px";
|
|
7433
7506
|
const size_icon_small = "20px";
|
|
7434
7507
|
const opacity_85 = "0.85";
|
|
@@ -7576,6 +7649,7 @@ var tokens = {
|
|
|
7576
7649
|
size_icon_x_small: size_icon_x_small,
|
|
7577
7650
|
size_icon_xxx_small: size_icon_xxx_small,
|
|
7578
7651
|
size_button_border: size_button_border,
|
|
7652
|
+
size_button_tiny_border: size_button_tiny_border,
|
|
7579
7653
|
size_icon_medium: size_icon_medium,
|
|
7580
7654
|
size_icon_small: size_icon_small,
|
|
7581
7655
|
opacity_85: opacity_85,
|
|
@@ -7726,6 +7800,7 @@ var tokens$1 = /*#__PURE__*/Object.freeze({
|
|
|
7726
7800
|
size_icon_x_small: size_icon_x_small,
|
|
7727
7801
|
size_icon_xxx_small: size_icon_xxx_small,
|
|
7728
7802
|
size_button_border: size_button_border,
|
|
7803
|
+
size_button_tiny_border: size_button_tiny_border,
|
|
7729
7804
|
size_icon_medium: size_icon_medium,
|
|
7730
7805
|
size_icon_small: size_icon_small,
|
|
7731
7806
|
opacity_85: opacity_85,
|
|
@@ -7950,18 +8025,6 @@ class DuetCookieConsent {
|
|
|
7950
8025
|
}; }
|
|
7951
8026
|
}
|
|
7952
8027
|
|
|
7953
|
-
const focusElement = (element) => {
|
|
7954
|
-
if ("setFocus" in element) {
|
|
7955
|
-
element.setFocus();
|
|
7956
|
-
}
|
|
7957
|
-
else {
|
|
7958
|
-
element.focus();
|
|
7959
|
-
}
|
|
7960
|
-
};
|
|
7961
|
-
const FocusGuard = ({ moveFocusTo }) => {
|
|
7962
|
-
return hAsync("div", { class: "duet-focus-guard", "aria-hidden": "true", tabIndex: 0, onFocus: () => focusElement(moveFocusTo) });
|
|
7963
|
-
};
|
|
7964
|
-
|
|
7965
8028
|
const formatOptionsShort = { day: "numeric", month: "long" };
|
|
7966
8029
|
const formatOptionsLong = { day: "numeric", month: "long", year: "numeric" };
|
|
7967
8030
|
const i18n$2 = {
|
|
@@ -8394,14 +8457,14 @@ class DuetDatePicker {
|
|
|
8394
8457
|
*/
|
|
8395
8458
|
this.margin = "auto";
|
|
8396
8459
|
/**
|
|
8397
|
-
* The currently active language. This setting changes the month/year/day
|
|
8460
|
+
* The currently active language. This setting changes the month/year/day.
|
|
8398
8461
|
* names and button labels as well as all screen reader labels.
|
|
8399
|
-
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing
|
|
8462
|
+
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing.
|
|
8400
8463
|
* @default "fi"
|
|
8401
8464
|
*/
|
|
8402
8465
|
this.language = getLanguage();
|
|
8403
8466
|
/**
|
|
8404
|
-
* Placeholder defaults
|
|
8467
|
+
* Placeholder defaults.
|
|
8405
8468
|
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
8406
8469
|
*/
|
|
8407
8470
|
this.placeholderDefaults = {
|
|
@@ -8464,7 +8527,7 @@ class DuetDatePicker {
|
|
|
8464
8527
|
*/
|
|
8465
8528
|
this.min = "";
|
|
8466
8529
|
/**
|
|
8467
|
-
* Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD
|
|
8530
|
+
* Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.
|
|
8468
8531
|
* This setting can be used alone or together with the min property.
|
|
8469
8532
|
*/
|
|
8470
8533
|
this.max = "";
|
|
@@ -8848,6 +8911,338 @@ class DuetDivider {
|
|
|
8848
8911
|
}; }
|
|
8849
8912
|
}
|
|
8850
8913
|
|
|
8914
|
+
const debounce = (func, timeout = 50) => {
|
|
8915
|
+
let timer;
|
|
8916
|
+
return (...args) => {
|
|
8917
|
+
clearTimeout(timer);
|
|
8918
|
+
timer = setTimeout(() => {
|
|
8919
|
+
func.apply(undefined, args);
|
|
8920
|
+
}, timeout);
|
|
8921
|
+
};
|
|
8922
|
+
};
|
|
8923
|
+
|
|
8924
|
+
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}";
|
|
8925
|
+
|
|
8926
|
+
class DuetEditableTable {
|
|
8927
|
+
constructor(hostRef) {
|
|
8928
|
+
registerInstance(this, hostRef);
|
|
8929
|
+
/**
|
|
8930
|
+
* State() variables
|
|
8931
|
+
* @internal
|
|
8932
|
+
*/
|
|
8933
|
+
this.tick = Date.now();
|
|
8934
|
+
/**
|
|
8935
|
+
* Map of items that contain list of things.
|
|
8936
|
+
*/
|
|
8937
|
+
this.items = new Map();
|
|
8938
|
+
/**
|
|
8939
|
+
* Array of internationalized defaults for the default groups labels.
|
|
8940
|
+
*/
|
|
8941
|
+
this.groupsLabelDefaults = {
|
|
8942
|
+
fi: "Kaikki",
|
|
8943
|
+
en: "All items",
|
|
8944
|
+
sv: "Alla objekt",
|
|
8945
|
+
};
|
|
8946
|
+
/**
|
|
8947
|
+
* Array of internationalized defaults for the default action labels.
|
|
8948
|
+
*/
|
|
8949
|
+
this.actionLabelDefaults = {
|
|
8950
|
+
fi: "Toiminnot",
|
|
8951
|
+
en: "Actions",
|
|
8952
|
+
sv: "Handlingar",
|
|
8953
|
+
};
|
|
8954
|
+
/**
|
|
8955
|
+
* Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
|
|
8956
|
+
* @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
|
|
8957
|
+
* @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
|
|
8958
|
+
*/
|
|
8959
|
+
this.groups = [
|
|
8960
|
+
{ id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
|
|
8961
|
+
];
|
|
8962
|
+
/**
|
|
8963
|
+
* Array of actions that are mapped via the map variable to the various groups defined in group.
|
|
8964
|
+
* @default undefined
|
|
8965
|
+
* @example [{
|
|
8966
|
+
variation: "default",
|
|
8967
|
+
icon: "action-edit-2",
|
|
8968
|
+
id: "edit",
|
|
8969
|
+
map: ["success"],
|
|
8970
|
+
label: {
|
|
8971
|
+
fi: " Label",
|
|
8972
|
+
en: " Label",
|
|
8973
|
+
sv: " Label",
|
|
8974
|
+
}
|
|
8975
|
+
}]
|
|
8976
|
+
*/
|
|
8977
|
+
this.actions = undefined;
|
|
8978
|
+
/**
|
|
8979
|
+
* Shows or hides the table labels.
|
|
8980
|
+
*/
|
|
8981
|
+
this.hideGroups = false;
|
|
8982
|
+
/**
|
|
8983
|
+
* Exposes the aria role for optimizing accessibility.
|
|
8984
|
+
*/
|
|
8985
|
+
this.accessibleRole = undefined;
|
|
8986
|
+
/**
|
|
8987
|
+
* Private methods.
|
|
8988
|
+
*/
|
|
8989
|
+
this.kick = debounce(() => {
|
|
8990
|
+
this.tick = Date.now();
|
|
8991
|
+
}, 100); // will trigger re-render
|
|
8992
|
+
this.filterMap = needle => {
|
|
8993
|
+
if (needle === "all") {
|
|
8994
|
+
return Array.from(this.items);
|
|
8995
|
+
}
|
|
8996
|
+
return Array.from(this.items).filter(item => needle === item[1].group);
|
|
8997
|
+
};
|
|
8998
|
+
}
|
|
8999
|
+
/**
|
|
9000
|
+
* Component lifecycle events.
|
|
9001
|
+
*/
|
|
9002
|
+
componentWillLoad() {
|
|
9003
|
+
if (typeof this.groups === "string") {
|
|
9004
|
+
this.internalGroupArray = sanitizeString(this.groups);
|
|
9005
|
+
}
|
|
9006
|
+
else {
|
|
9007
|
+
this.internalGroupArray = this.groups;
|
|
9008
|
+
}
|
|
9009
|
+
if (typeof this.actions === "string") {
|
|
9010
|
+
this.internalActionsArray = sanitizeString(this.actions);
|
|
9011
|
+
}
|
|
9012
|
+
else {
|
|
9013
|
+
this.internalActionsArray = this.actions;
|
|
9014
|
+
}
|
|
9015
|
+
inheritGlobalTheme(this);
|
|
9016
|
+
}
|
|
9017
|
+
/**
|
|
9018
|
+
* Method to force an update of a tabular data array.
|
|
9019
|
+
* when called the method will rerender the entire tabular structure.
|
|
9020
|
+
*/
|
|
9021
|
+
async updateTable(passedItems = undefined) {
|
|
9022
|
+
this.items = new Map(passedItems || this.items);
|
|
9023
|
+
this.kick();
|
|
9024
|
+
}
|
|
9025
|
+
render() {
|
|
9026
|
+
return (hAsync(Host, { class: {
|
|
9027
|
+
"duet-theme-turva": this.theme === "turva",
|
|
9028
|
+
} }, this.internalGroupArray.map(group => {
|
|
9029
|
+
const currentGroup = this.filterMap(group.id);
|
|
9030
|
+
if (!currentGroup.length) {
|
|
9031
|
+
return;
|
|
9032
|
+
}
|
|
9033
|
+
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: {
|
|
9034
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
9035
|
+
} }, !this.hideGroups ? (getLocaleString(group.label)) : (hAsync("duet-visually-hidden", null, getLocaleString(group.label)))), hAsync("th", { class: {
|
|
9036
|
+
"duet-editable-table-header-hidden": this.hideGroups,
|
|
9037
|
+
} }, hAsync("duet-visually-hidden", null, group.actionLabel
|
|
9038
|
+
? getLocaleString(group.actionLabel)
|
|
9039
|
+
: getLocaleString(this.actionLabelDefaults))))), hAsync("tbody", null, currentGroup.map(dataAsArray => {
|
|
9040
|
+
const [key, value] = dataAsArray;
|
|
9041
|
+
return (hAsync("duet-editable-table-item", { keyName: key, data: Object.assign({}, value), groupId: group.id, part: group.id, actions: this.internalActionsArray }));
|
|
9042
|
+
})))));
|
|
9043
|
+
})));
|
|
9044
|
+
}
|
|
9045
|
+
get element() { return getElement(this); }
|
|
9046
|
+
static get style() { return duetEditableTableCss; }
|
|
9047
|
+
static get cmpMeta() { return {
|
|
9048
|
+
"$flags$": 9,
|
|
9049
|
+
"$tagName$": "duet-editable-table",
|
|
9050
|
+
"$members$": {
|
|
9051
|
+
"items": [1040],
|
|
9052
|
+
"groupsLabelDefaults": [16],
|
|
9053
|
+
"actionLabelDefaults": [16],
|
|
9054
|
+
"groups": [1],
|
|
9055
|
+
"actions": [1],
|
|
9056
|
+
"hideGroups": [4, "hide-table-labels"],
|
|
9057
|
+
"accessibleRole": [1, "accessible-role"],
|
|
9058
|
+
"theme": [1025],
|
|
9059
|
+
"tick": [32],
|
|
9060
|
+
"updateTable": [64]
|
|
9061
|
+
},
|
|
9062
|
+
"$listeners$": undefined,
|
|
9063
|
+
"$lazyBundleId$": "-",
|
|
9064
|
+
"$attrsToReflect$": []
|
|
9065
|
+
}; }
|
|
9066
|
+
}
|
|
9067
|
+
|
|
9068
|
+
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}";
|
|
9069
|
+
|
|
9070
|
+
class DuetEditableTableButton {
|
|
9071
|
+
constructor(hostRef) {
|
|
9072
|
+
registerInstance(this, hostRef);
|
|
9073
|
+
this.duetEditableItemAction = createEvent$2(this, "duetEditableItemAction", 7);
|
|
9074
|
+
this.isHovering = false;
|
|
9075
|
+
/**
|
|
9076
|
+
* Theme of the empty state component.
|
|
9077
|
+
*/
|
|
9078
|
+
this.theme = "";
|
|
9079
|
+
/**
|
|
9080
|
+
* action items passed from host component
|
|
9081
|
+
* @internal
|
|
9082
|
+
*/
|
|
9083
|
+
this.actions = undefined;
|
|
9084
|
+
/**
|
|
9085
|
+
* uid that gets passed along when the action is emitted
|
|
9086
|
+
* @internal
|
|
9087
|
+
*/
|
|
9088
|
+
this.uid = "";
|
|
9089
|
+
/**
|
|
9090
|
+
* group associated with action
|
|
9091
|
+
* @internal
|
|
9092
|
+
*/
|
|
9093
|
+
this.group = "";
|
|
9094
|
+
/**
|
|
9095
|
+
* key of the item in the map
|
|
9096
|
+
* @internal
|
|
9097
|
+
*/
|
|
9098
|
+
this.keyName = "";
|
|
9099
|
+
this.onMouseEnter = () => {
|
|
9100
|
+
this.isHovering = true;
|
|
9101
|
+
};
|
|
9102
|
+
this.onMouseLeave = () => {
|
|
9103
|
+
this.isHovering = false;
|
|
9104
|
+
};
|
|
9105
|
+
}
|
|
9106
|
+
/**
|
|
9107
|
+
/**
|
|
9108
|
+
* Component lifecycle events.
|
|
9109
|
+
*/
|
|
9110
|
+
componentWillLoad() {
|
|
9111
|
+
inheritGlobalTheme(this);
|
|
9112
|
+
}
|
|
9113
|
+
/**
|
|
9114
|
+
/**
|
|
9115
|
+
* private functions
|
|
9116
|
+
*/
|
|
9117
|
+
emitActionEvent(ev) {
|
|
9118
|
+
this.duetEditableItemAction.emit({
|
|
9119
|
+
originalEvent: ev,
|
|
9120
|
+
uid: this.uid,
|
|
9121
|
+
group: this.group,
|
|
9122
|
+
action: this.actions.id,
|
|
9123
|
+
keyName: this.keyName,
|
|
9124
|
+
component: "duet-editable-table-item",
|
|
9125
|
+
});
|
|
9126
|
+
}
|
|
9127
|
+
/**
|
|
9128
|
+
* render() function
|
|
9129
|
+
* Always the last one in the class.
|
|
9130
|
+
*/
|
|
9131
|
+
render() {
|
|
9132
|
+
return (hAsync("button", { style: {
|
|
9133
|
+
"border-color": this.isHovering
|
|
9134
|
+
? getColorByName(this.actions.color_hover)
|
|
9135
|
+
: getColorByName(this.actions.color),
|
|
9136
|
+
}, 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" })));
|
|
9137
|
+
}
|
|
9138
|
+
get el() { return getElement(this); }
|
|
9139
|
+
static get style() { return duetEditableTableButtonCss; }
|
|
9140
|
+
static get cmpMeta() { return {
|
|
9141
|
+
"$flags$": 2,
|
|
9142
|
+
"$tagName$": "duet-editable-table-button",
|
|
9143
|
+
"$members$": {
|
|
9144
|
+
"theme": [1025],
|
|
9145
|
+
"actions": [16],
|
|
9146
|
+
"uid": [1],
|
|
9147
|
+
"group": [1],
|
|
9148
|
+
"keyName": [1, "key-name"],
|
|
9149
|
+
"isHovering": [32]
|
|
9150
|
+
},
|
|
9151
|
+
"$listeners$": undefined,
|
|
9152
|
+
"$lazyBundleId$": "-",
|
|
9153
|
+
"$attrsToReflect$": []
|
|
9154
|
+
}; }
|
|
9155
|
+
}
|
|
9156
|
+
|
|
9157
|
+
//simple functional component that renders the data in the table
|
|
9158
|
+
const TableData = ({ data, groupId }, _children) => {
|
|
9159
|
+
if (typeof data === "string") {
|
|
9160
|
+
return hAsync("td", { innerHTML: data, class: "duet-editable-table-content", part: `${groupId}content` });
|
|
9161
|
+
}
|
|
9162
|
+
else {
|
|
9163
|
+
return (hAsync("td", { class: "duet-editable-table-content", part: `${groupId}content` }, data));
|
|
9164
|
+
}
|
|
9165
|
+
};
|
|
9166
|
+
|
|
9167
|
+
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}";
|
|
9168
|
+
|
|
9169
|
+
class DuetEditableTableItem {
|
|
9170
|
+
constructor(hostRef) {
|
|
9171
|
+
registerInstance(this, hostRef);
|
|
9172
|
+
this.duetEditableItemAction = createEvent$2(this, "duetEditableItemAction", 7);
|
|
9173
|
+
this.isHovering = false;
|
|
9174
|
+
/**
|
|
9175
|
+
* Theme of the empty state component.
|
|
9176
|
+
*/
|
|
9177
|
+
this.theme = "";
|
|
9178
|
+
/**
|
|
9179
|
+
* Actions that can be performed on the element
|
|
9180
|
+
*/
|
|
9181
|
+
this.actions = undefined;
|
|
9182
|
+
/**
|
|
9183
|
+
* GroupId used to pierce the shadowdom - gets concatenated with "content & actions" and used as part="groupIDcontent/actions" to pierce the content/Action item
|
|
9184
|
+
* @internal
|
|
9185
|
+
*/
|
|
9186
|
+
this.groupId = "";
|
|
9187
|
+
/**
|
|
9188
|
+
* Key used to identify item, when running actions
|
|
9189
|
+
*/
|
|
9190
|
+
this.keyName = "";
|
|
9191
|
+
/**
|
|
9192
|
+
* Object of data itemsused to render the entire row
|
|
9193
|
+
*/
|
|
9194
|
+
this.data = undefined;
|
|
9195
|
+
}
|
|
9196
|
+
watchPropHandler(_newValue, _oldValue) {
|
|
9197
|
+
// console.log("The new value of activated is: ", _newValue)
|
|
9198
|
+
}
|
|
9199
|
+
/**
|
|
9200
|
+
/**
|
|
9201
|
+
* Component lifecycle events.
|
|
9202
|
+
*/
|
|
9203
|
+
componentWillLoad() {
|
|
9204
|
+
inheritGlobalTheme(this);
|
|
9205
|
+
}
|
|
9206
|
+
/**
|
|
9207
|
+
/**
|
|
9208
|
+
* private functions
|
|
9209
|
+
*/
|
|
9210
|
+
/**
|
|
9211
|
+
* render() function
|
|
9212
|
+
* Always the last one in the class.
|
|
9213
|
+
*/
|
|
9214
|
+
render() {
|
|
9215
|
+
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 => {
|
|
9216
|
+
const { map = undefined } = result;
|
|
9217
|
+
// if map has been specified, only show the current action if groupID matches the map array
|
|
9218
|
+
if (map && !map.includes(this.groupId)) {
|
|
9219
|
+
return;
|
|
9220
|
+
}
|
|
9221
|
+
return (hAsync("duet-editable-table-button", { keyName: this.keyName, group: this.data.group, uid: this.data.uid, actions: result, theme: this.theme }));
|
|
9222
|
+
})))));
|
|
9223
|
+
}
|
|
9224
|
+
get el() { return getElement(this); }
|
|
9225
|
+
static get watchers() { return {
|
|
9226
|
+
"data": ["watchPropHandler"]
|
|
9227
|
+
}; }
|
|
9228
|
+
static get style() { return duetEditableTableItemCss; }
|
|
9229
|
+
static get cmpMeta() { return {
|
|
9230
|
+
"$flags$": 9,
|
|
9231
|
+
"$tagName$": "duet-editable-table-item",
|
|
9232
|
+
"$members$": {
|
|
9233
|
+
"theme": [1025],
|
|
9234
|
+
"actions": [16],
|
|
9235
|
+
"groupId": [1, "group-id"],
|
|
9236
|
+
"keyName": [1, "key-name"],
|
|
9237
|
+
"data": [1040],
|
|
9238
|
+
"isHovering": [32]
|
|
9239
|
+
},
|
|
9240
|
+
"$listeners$": undefined,
|
|
9241
|
+
"$lazyBundleId$": "-",
|
|
9242
|
+
"$attrsToReflect$": []
|
|
9243
|
+
}; }
|
|
9244
|
+
}
|
|
9245
|
+
|
|
8851
9246
|
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}";
|
|
8852
9247
|
|
|
8853
9248
|
class DuetEmptyState {
|
|
@@ -9128,6 +9523,12 @@ function isGridItem(element) {
|
|
|
9128
9523
|
class DuetGrid {
|
|
9129
9524
|
constructor(hostRef) {
|
|
9130
9525
|
registerInstance(this, hostRef);
|
|
9526
|
+
this.mql = [
|
|
9527
|
+
window.matchMedia(media_query_large.replace(/'/g, "")),
|
|
9528
|
+
window.matchMedia(media_query_medium.replace(/'/g, "")),
|
|
9529
|
+
window.matchMedia(media_query_small.replace(/'/g, "")),
|
|
9530
|
+
];
|
|
9531
|
+
this.distributeFormElement = false;
|
|
9131
9532
|
/**
|
|
9132
9533
|
* Enable or disable the automatic responsive behaviour of the grid component.
|
|
9133
9534
|
* Setting this option to "true" makes sure that contents are stacked vertically
|
|
@@ -9144,7 +9545,9 @@ class DuetGrid {
|
|
|
9144
9545
|
*/
|
|
9145
9546
|
this.direction = "horizontal";
|
|
9146
9547
|
/**
|
|
9147
|
-
* Adjusts the vertical alignment of the grid items
|
|
9548
|
+
* Adjusts the vertical alignment of the grid items, if set to "form_distribute"
|
|
9549
|
+
* the grid will try to calculate correct paddings for any duet-input fields inside duet-grid-items,
|
|
9550
|
+
* so that they align even when displaying errors.
|
|
9148
9551
|
*/
|
|
9149
9552
|
this.alignment = "top";
|
|
9150
9553
|
/**
|
|
@@ -9156,14 +9559,39 @@ class DuetGrid {
|
|
|
9156
9559
|
*/
|
|
9157
9560
|
this.mobile = "";
|
|
9158
9561
|
}
|
|
9562
|
+
/**
|
|
9563
|
+
* Private functions
|
|
9564
|
+
*/
|
|
9565
|
+
/**
|
|
9566
|
+
* Returns the element height including margins
|
|
9567
|
+
* @param element - element
|
|
9568
|
+
* @returns {number}
|
|
9569
|
+
*/
|
|
9570
|
+
outerHeight(element) {
|
|
9571
|
+
const height = element.offsetHeight, style = window.getComputedStyle(element);
|
|
9572
|
+
return ["top", "bottom"]
|
|
9573
|
+
.map(side => parseInt(style[`margin-${side}`]))
|
|
9574
|
+
.reduce((total, side) => total + side, height);
|
|
9575
|
+
}
|
|
9159
9576
|
/**
|
|
9160
9577
|
* Component lifecycle events.
|
|
9161
9578
|
*/
|
|
9162
9579
|
async connectedCallback() {
|
|
9163
9580
|
const el = this.element;
|
|
9581
|
+
this.distributeFormElement = this.alignment === "form_distribute";
|
|
9164
9582
|
this.mutationO = watchForOptions(el, "duet-grid-item", () => {
|
|
9165
9583
|
this.updateGridItems();
|
|
9166
9584
|
});
|
|
9585
|
+
// the next two functions are used to watch for changes in the grid items, and are process intensive - so only run when needed
|
|
9586
|
+
if (this.distributeFormElement) {
|
|
9587
|
+
this.mutation1 = watchForElement(el, "duet-input", () => {
|
|
9588
|
+
this.updateGridItemsWithInputFields();
|
|
9589
|
+
});
|
|
9590
|
+
// listen for potential mediaquery changes and reset layout
|
|
9591
|
+
for (let i = 0; i < this.mql.length; i++) {
|
|
9592
|
+
this.mql[i].addEventListener("change", this.updateGridItemsWithInputFields.bind(this));
|
|
9593
|
+
}
|
|
9594
|
+
}
|
|
9167
9595
|
this.updateGridItems();
|
|
9168
9596
|
}
|
|
9169
9597
|
disconnectedCallback() {
|
|
@@ -9171,6 +9599,14 @@ class DuetGrid {
|
|
|
9171
9599
|
this.mutationO.disconnect();
|
|
9172
9600
|
this.mutationO = undefined;
|
|
9173
9601
|
}
|
|
9602
|
+
if (this.mutation1) {
|
|
9603
|
+
this.mutation1.disconnect();
|
|
9604
|
+
this.mutation1 = undefined;
|
|
9605
|
+
}
|
|
9606
|
+
// listen for potential mediaquery changes and reset layout
|
|
9607
|
+
for (let i = 0; i < this.mql.length; i++) {
|
|
9608
|
+
this.mql[i].removeEventListener("change", this.updateGridItemsWithInputFields.bind(this));
|
|
9609
|
+
}
|
|
9174
9610
|
}
|
|
9175
9611
|
/**
|
|
9176
9612
|
* Local methods
|
|
@@ -9182,6 +9618,29 @@ class DuetGrid {
|
|
|
9182
9618
|
item.breakpoint = this.breakpoint;
|
|
9183
9619
|
});
|
|
9184
9620
|
}
|
|
9621
|
+
async updateGridItemsWithInputFields() {
|
|
9622
|
+
const items = Array.from(this.element.children).filter(isGridItem);
|
|
9623
|
+
// if layout changes to columns instead of row, remove all padding
|
|
9624
|
+
const hasColumnLayout = window ? window.getComputedStyle(this.element).flexDirection === "column" : false;
|
|
9625
|
+
let maxHeight = 0;
|
|
9626
|
+
const sizes = [];
|
|
9627
|
+
items.forEach(item => {
|
|
9628
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
9629
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
9630
|
+
sizes.push(height);
|
|
9631
|
+
});
|
|
9632
|
+
maxHeight = Math.max(...sizes);
|
|
9633
|
+
items.forEach(item => {
|
|
9634
|
+
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
9635
|
+
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
9636
|
+
if (height < maxHeight && !hasColumnLayout) {
|
|
9637
|
+
item.setAttribute("style", `padding-bottom: ${maxHeight - height}px;`);
|
|
9638
|
+
}
|
|
9639
|
+
else if (height === maxHeight || hasColumnLayout) {
|
|
9640
|
+
item.setAttribute("style", `padding-bottom: 0px;`);
|
|
9641
|
+
}
|
|
9642
|
+
});
|
|
9643
|
+
}
|
|
9185
9644
|
/**
|
|
9186
9645
|
* render() function
|
|
9187
9646
|
* Always the last one in the class.
|
|
@@ -9191,7 +9650,7 @@ class DuetGrid {
|
|
|
9191
9650
|
"duet-grid": true,
|
|
9192
9651
|
"duet-no-stacking": !this.responsive,
|
|
9193
9652
|
"duet-grid-align-top": this.alignment === "top",
|
|
9194
|
-
"duet-grid-align-bottom": this.alignment === "bottom",
|
|
9653
|
+
"duet-grid-align-bottom": this.alignment === "bottom" || this.alignment === "form_distribute",
|
|
9195
9654
|
"duet-grid-align-center": this.alignment === "center",
|
|
9196
9655
|
"duet-grid-align-stretch": this.alignment === "stretch",
|
|
9197
9656
|
"duet-grid-align-baseline": this.alignment === "baseline",
|
|
@@ -9226,7 +9685,8 @@ class DuetGrid {
|
|
|
9226
9685
|
"direction": [1],
|
|
9227
9686
|
"alignment": [1],
|
|
9228
9687
|
"distribution": [1],
|
|
9229
|
-
"mobile": [1]
|
|
9688
|
+
"mobile": [1],
|
|
9689
|
+
"distributeFormElement": [32]
|
|
9230
9690
|
},
|
|
9231
9691
|
"$listeners$": undefined,
|
|
9232
9692
|
"$lazyBundleId$": "-",
|
|
@@ -9951,7 +10411,7 @@ class DuetHeader {
|
|
|
9951
10411
|
}; }
|
|
9952
10412
|
}
|
|
9953
10413
|
|
|
9954
|
-
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-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}";
|
|
10414
|
+
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}";
|
|
9955
10415
|
|
|
9956
10416
|
class DuetHeading {
|
|
9957
10417
|
constructor(hostRef) {
|
|
@@ -9965,7 +10425,7 @@ class DuetHeading {
|
|
|
9965
10425
|
*/
|
|
9966
10426
|
this.margin = "auto";
|
|
9967
10427
|
/**
|
|
9968
|
-
* Enable or disable the border underneath the heading
|
|
10428
|
+
* Enable or disable the border underneath the heading, solid will darken the border
|
|
9969
10429
|
*/
|
|
9970
10430
|
this.border = false;
|
|
9971
10431
|
/**
|
|
@@ -10002,7 +10462,8 @@ class DuetHeading {
|
|
|
10002
10462
|
const color = getColorByName(this.color);
|
|
10003
10463
|
return (hAsync(TagName, { class: {
|
|
10004
10464
|
"duet-heading": true,
|
|
10005
|
-
"duet-heading-border": this.border,
|
|
10465
|
+
"duet-heading-border": this.border !== false,
|
|
10466
|
+
"duet-heading-border-solid": this.border === "solid",
|
|
10006
10467
|
"duet-semibold": this.weight === "semibold",
|
|
10007
10468
|
"duet-heading-hyphenate": this.hyphenate,
|
|
10008
10469
|
"duet-m-0": this.margin === "none",
|
|
@@ -10019,7 +10480,7 @@ class DuetHeading {
|
|
|
10019
10480
|
"level": [513],
|
|
10020
10481
|
"margin": [1],
|
|
10021
10482
|
"visualLevel": [1, "visual-level"],
|
|
10022
|
-
"border": [
|
|
10483
|
+
"border": [8],
|
|
10023
10484
|
"weight": [1],
|
|
10024
10485
|
"color": [1],
|
|
10025
10486
|
"theme": [1025],
|
|
@@ -10454,7 +10915,7 @@ function cleanValue(input, regex) {
|
|
|
10454
10915
|
return newValue;
|
|
10455
10916
|
}
|
|
10456
10917
|
|
|
10457
|
-
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%}";
|
|
10918
|
+
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%}";
|
|
10458
10919
|
|
|
10459
10920
|
const icons = {
|
|
10460
10921
|
search: formSearch,
|
|
@@ -10594,7 +11055,7 @@ class DuetInput {
|
|
|
10594
11055
|
// (in webkit based browsers settings value trigger cursor position and will set it to EndOfText)
|
|
10595
11056
|
restoreCursor();
|
|
10596
11057
|
}
|
|
10597
|
-
this.isCaptionVisible = !!
|
|
11058
|
+
this.isCaptionVisible = !!this.caption;
|
|
10598
11059
|
const emitEvent = () => this.duetChange.emit({
|
|
10599
11060
|
value: this.value,
|
|
10600
11061
|
component: "duet-input",
|
|
@@ -10613,7 +11074,7 @@ class DuetInput {
|
|
|
10613
11074
|
componentWillLoad() {
|
|
10614
11075
|
inheritGlobalTheme(this);
|
|
10615
11076
|
this.disallowedPatternChange();
|
|
10616
|
-
this.isCaptionVisible = !!
|
|
11077
|
+
this.isCaptionVisible = !!this.caption;
|
|
10617
11078
|
}
|
|
10618
11079
|
/**
|
|
10619
11080
|
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
@@ -10648,12 +11109,12 @@ class DuetInput {
|
|
|
10648
11109
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
10649
11110
|
"has-icon": !!this.icon || (this.type !== "text" && this.type !== "tel" && this.type !== "password"),
|
|
10650
11111
|
"has-error": !!this.error,
|
|
10651
|
-
} }, 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,
|
|
11112
|
+
} }, 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: {
|
|
10652
11113
|
"duet-input": true,
|
|
10653
11114
|
disabled: this.disabled,
|
|
10654
11115
|
"is-number": this.component === "number",
|
|
10655
11116
|
"is-date": this.component === "date",
|
|
10656
|
-
}, 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",
|
|
11117
|
+
}, 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)))));
|
|
10657
11118
|
}
|
|
10658
11119
|
get element() { return getElement(this); }
|
|
10659
11120
|
static get watchers() { return {
|
|
@@ -12096,13 +12557,16 @@ class DuetNumberInput {
|
|
|
12096
12557
|
}; }
|
|
12097
12558
|
}
|
|
12098
12559
|
|
|
12099
|
-
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}";
|
|
12560
|
+
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}";
|
|
12100
12561
|
|
|
12562
|
+
/**
|
|
12563
|
+
* @part duet-paragraph - piercing selector for styling the paragraph
|
|
12564
|
+
*/
|
|
12101
12565
|
class DuetParagraph {
|
|
12102
12566
|
constructor(hostRef) {
|
|
12103
12567
|
registerInstance(this, hostRef);
|
|
12104
12568
|
/**
|
|
12105
|
-
* Theme of the
|
|
12569
|
+
* Theme of the paragraph.
|
|
12106
12570
|
*/
|
|
12107
12571
|
this.theme = "";
|
|
12108
12572
|
/**
|
|
@@ -12114,7 +12578,11 @@ class DuetParagraph {
|
|
|
12114
12578
|
*/
|
|
12115
12579
|
this.size = "medium";
|
|
12116
12580
|
/**
|
|
12117
|
-
*
|
|
12581
|
+
* Controls the Font-Weight of the paragraph.
|
|
12582
|
+
*/
|
|
12583
|
+
this.weight = undefined;
|
|
12584
|
+
/**
|
|
12585
|
+
* Style variation of the paragraph.
|
|
12118
12586
|
*/
|
|
12119
12587
|
this.variation = "default";
|
|
12120
12588
|
/**
|
|
@@ -12138,10 +12606,12 @@ class DuetParagraph {
|
|
|
12138
12606
|
return (hAsync("p", { class: {
|
|
12139
12607
|
"duet-paragraph": true,
|
|
12140
12608
|
"duet-paragraph-small": this.size === "small",
|
|
12609
|
+
"duet-paragraph-semi-bold": this.weight === "semi-bold",
|
|
12610
|
+
"duet-paragraph-bold": this.weight === "bold",
|
|
12141
12611
|
"duet-m-0": this.margin === "none",
|
|
12142
12612
|
[this.variation]: true,
|
|
12143
12613
|
"duet-theme-turva": this.theme === "turva",
|
|
12144
|
-
}, style: { color } }, hAsync("slot", null)));
|
|
12614
|
+
}, style: { color }, part: "duet-paragraph" }, hAsync("slot", null)));
|
|
12145
12615
|
}
|
|
12146
12616
|
get element() { return getElement(this); }
|
|
12147
12617
|
static get style() { return duetParagraphCss; }
|
|
@@ -12152,6 +12622,7 @@ class DuetParagraph {
|
|
|
12152
12622
|
"theme": [1025],
|
|
12153
12623
|
"margin": [1],
|
|
12154
12624
|
"size": [1],
|
|
12625
|
+
"weight": [1],
|
|
12155
12626
|
"variation": [1],
|
|
12156
12627
|
"color": [1]
|
|
12157
12628
|
},
|
|
@@ -12161,6 +12632,84 @@ class DuetParagraph {
|
|
|
12161
12632
|
}; }
|
|
12162
12633
|
}
|
|
12163
12634
|
|
|
12635
|
+
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}";
|
|
12636
|
+
|
|
12637
|
+
class DuetProgress {
|
|
12638
|
+
constructor(hostRef) {
|
|
12639
|
+
registerInstance(this, hostRef);
|
|
12640
|
+
/**
|
|
12641
|
+
* Own Properties
|
|
12642
|
+
*/
|
|
12643
|
+
this.progressId = createID("DuetProgress");
|
|
12644
|
+
this.progressLabelId = createID("DuetProgressLabel");
|
|
12645
|
+
/**
|
|
12646
|
+
* Defaults for accessibleLabel
|
|
12647
|
+
*/
|
|
12648
|
+
this.accessibleLabelUploadDefaults = {
|
|
12649
|
+
fi: ["lähetys valmis", "lähetys käynnissä"],
|
|
12650
|
+
sv: ["Uppladdningen är klar", "Uppladdning pågår"],
|
|
12651
|
+
en: ["upload completed", "upload in progress"],
|
|
12652
|
+
};
|
|
12653
|
+
/**
|
|
12654
|
+
* Adds accessible label for upload in progress and upload complete states
|
|
12655
|
+
* @default {fi: ["lähetys valmis", "lähetys käynnissä"],sv: ["Uppladdningen är klar", "Uppladdning pågår"], en: ["completed", "in progress"]}
|
|
12656
|
+
*/
|
|
12657
|
+
this.accessibleLabelUpload = getLocaleString(this.accessibleLabelUploadDefaults);
|
|
12658
|
+
/**
|
|
12659
|
+
* Progress of the bar, a value from 0-100
|
|
12660
|
+
*/
|
|
12661
|
+
this.progress = 0;
|
|
12662
|
+
/**
|
|
12663
|
+
* Height of progressbar
|
|
12664
|
+
*/
|
|
12665
|
+
this.height = "10px";
|
|
12666
|
+
/**
|
|
12667
|
+
* Theme of the input.
|
|
12668
|
+
*/
|
|
12669
|
+
this.theme = "";
|
|
12670
|
+
}
|
|
12671
|
+
/**
|
|
12672
|
+
* Component lifecycle events.
|
|
12673
|
+
*/
|
|
12674
|
+
componentWillLoad() {
|
|
12675
|
+
inheritGlobalTheme(this);
|
|
12676
|
+
}
|
|
12677
|
+
/**
|
|
12678
|
+
* render() function
|
|
12679
|
+
* Always the last one in the class.
|
|
12680
|
+
*/
|
|
12681
|
+
render() {
|
|
12682
|
+
return (hAsync(Host, null, hAsync("div", { "aria-live": this.accessibleLabel ? "polite" : "off", "aria-hidden": this.accessibleLabel ? "false" : "true", "aria-atomic": "true", style: {
|
|
12683
|
+
height: this.height,
|
|
12684
|
+
}, id: this.progressId, class: {
|
|
12685
|
+
"duet-progress": true,
|
|
12686
|
+
"duet-progress-done": this.progress === 100,
|
|
12687
|
+
"duet-progress-start": this.progress === 0,
|
|
12688
|
+
"duet-progress-inprogress": this.progress < 99 && this.progress !== 0,
|
|
12689
|
+
"duet-theme-turva": this.theme === "turva",
|
|
12690
|
+
} }, 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, "%"))))));
|
|
12691
|
+
}
|
|
12692
|
+
get element() { return getElement(this); }
|
|
12693
|
+
static get style() { return duetProgressCss; }
|
|
12694
|
+
static get cmpMeta() { return {
|
|
12695
|
+
"$flags$": 0,
|
|
12696
|
+
"$tagName$": "duet-progress",
|
|
12697
|
+
"$members$": {
|
|
12698
|
+
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
12699
|
+
"accessibleLabel": [1, "accessible-label"],
|
|
12700
|
+
"accessibleLabelUploadDefaults": [1, "accessible-label-upload-defaults"],
|
|
12701
|
+
"accessibleLabelUpload": [1, "accessible-label-upload"],
|
|
12702
|
+
"progress": [1538],
|
|
12703
|
+
"caption": [1],
|
|
12704
|
+
"height": [1],
|
|
12705
|
+
"theme": [1025]
|
|
12706
|
+
},
|
|
12707
|
+
"$listeners$": undefined,
|
|
12708
|
+
"$lazyBundleId$": "-",
|
|
12709
|
+
"$attrsToReflect$": [["progress", "progress"]]
|
|
12710
|
+
}; }
|
|
12711
|
+
}
|
|
12712
|
+
|
|
12164
12713
|
const duetRadioCss = "*.sc-duet-radio,*.sc-duet-radio::after,*.sc-duet-radio::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-radio-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:28px !important;margin-bottom:12px !important;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-radio-h:last-child,.sc-duet-radio-h:last-of-type{margin-right:0 !important}.vertical.sc-duet-radio-h{margin-right:0 !important}.horizontal.sc-duet-radio-h{margin-bottom:0 !important;width:auto}.horizontal.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}@media (min-width: 48em){.horizontal-responsive.sc-duet-radio-h{margin-right:28px !important;margin-bottom:0 !important;width:auto}.horizontal-responsive.sc-duet-radio-h:last-child,.horizontal-responsive.sc-duet-radio-h:last-of-type{margin-right:0 !important}.horizontal-responsive.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}}.duet-m-0.sc-duet-radio-h{margin:0 !important}.sc-duet-radio-h:last-child:not(:only-child){margin-right:0 !important;margin-bottom:0 !important}.duet-label.sc-duet-radio{position:relative;z-index:100;display:flex;width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;line-height:1.5;color:#00294d;cursor:pointer;background:transparent}.duet-theme-turva.sc-duet-radio .duet-label.sc-duet-radio{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}.duet-label.sc-duet-radio span.sc-duet-radio{flex-grow:1;font-size:1rem}.duet-label-hidden.sc-duet-radio .duet-label.sc-duet-radio{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-radio-container.sc-duet-radio{position:relative;width:100%;height:100%}.duet-radio.sc-duet-radio{padding:14px !important;position:absolute;top:0;left:0;z-index:200;width:100%;height:100%;cursor:pointer;opacity:0}.duet-radio.sc-duet-radio+label.sc-duet-radio::before{z-index:100;flex-shrink:0;width:20px;height:20px;margin:2px 10px 1px 1px;content:\"\";background:white;border:1px solid #00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio+label.sc-duet-radio::before{border-color:#171c3a}.duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{position:absolute;top:6px;left:5px;z-index:200;flex-shrink:0;width:12px;height:12px;content:\"\";background:#00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{background:#171c3a}.duet-radio[disabled].sc-duet-radio{cursor:default}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#747475}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfd2d4}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfcfd1}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::before{border:1px solid #657787}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#747475;border-color:#747475}";
|
|
12165
12714
|
|
|
12166
12715
|
class DuetRadio {
|
|
@@ -12649,7 +13198,7 @@ class DuetRangeSlider {
|
|
|
12649
13198
|
}; }
|
|
12650
13199
|
}
|
|
12651
13200
|
|
|
12652
|
-
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}";
|
|
13201
|
+
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}";
|
|
12653
13202
|
|
|
12654
13203
|
function isOptionGroup(item) {
|
|
12655
13204
|
return "options" in item;
|
|
@@ -12771,14 +13320,14 @@ class DuetSelect {
|
|
|
12771
13320
|
if (this.nativeSelect) {
|
|
12772
13321
|
this.nativeSelect.value = this.value;
|
|
12773
13322
|
}
|
|
12774
|
-
this.isCaptionVisible = !!
|
|
13323
|
+
this.isCaptionVisible = !!this.caption;
|
|
12775
13324
|
}
|
|
12776
13325
|
/**
|
|
12777
13326
|
* Component lifecycle events.
|
|
12778
13327
|
*/
|
|
12779
13328
|
componentWillLoad() {
|
|
12780
13329
|
inheritGlobalTheme(this);
|
|
12781
|
-
this.isCaptionVisible = !!
|
|
13330
|
+
this.isCaptionVisible = !!this.caption;
|
|
12782
13331
|
this.refresh();
|
|
12783
13332
|
}
|
|
12784
13333
|
/**
|
|
@@ -12821,7 +13370,7 @@ class DuetSelect {
|
|
|
12821
13370
|
"duet-theme-turva": this.theme === "turva",
|
|
12822
13371
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
12823
13372
|
"has-error": !!this.error,
|
|
12824
|
-
} }, 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("
|
|
13373
|
+
} }, 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 => {
|
|
12825
13374
|
return isOptionGroup(item) ? this.renderOptionGroup(item) : this.renderOption(item);
|
|
12826
13375
|
}))), 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)))));
|
|
12827
13376
|
}
|
|
@@ -13254,7 +13803,7 @@ class DuetTab {
|
|
|
13254
13803
|
}; }
|
|
13255
13804
|
}
|
|
13256
13805
|
|
|
13257
|
-
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:#
|
|
13806
|
+
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}";
|
|
13258
13807
|
|
|
13259
13808
|
class DuetTabGroup {
|
|
13260
13809
|
constructor(hostRef) {
|
|
@@ -13582,7 +14131,7 @@ class DuetTable {
|
|
|
13582
14131
|
}; }
|
|
13583
14132
|
}
|
|
13584
14133
|
|
|
13585
|
-
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}";
|
|
14134
|
+
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}";
|
|
13586
14135
|
|
|
13587
14136
|
const CharacterCount = ({ value, maxlength, label, theme }) => {
|
|
13588
14137
|
if (maxlength == null) {
|
|
@@ -13683,7 +14232,7 @@ class DuetTextarea {
|
|
|
13683
14232
|
cleanValue(this.nativeInput, this.disallowPatternRegex);
|
|
13684
14233
|
}
|
|
13685
14234
|
this.value = this.nativeInput.value;
|
|
13686
|
-
this.isCaptionVisible = !!
|
|
14235
|
+
this.isCaptionVisible = !!this.caption;
|
|
13687
14236
|
this.duetInput.emit({
|
|
13688
14237
|
originalEvent: ev,
|
|
13689
14238
|
value: this.value,
|
|
@@ -13722,7 +14271,7 @@ class DuetTextarea {
|
|
|
13722
14271
|
componentWillLoad() {
|
|
13723
14272
|
inheritGlobalTheme(this);
|
|
13724
14273
|
this.disallowedPatternChange();
|
|
13725
|
-
this.isCaptionVisible = !!
|
|
14274
|
+
this.isCaptionVisible = !!this.caption;
|
|
13726
14275
|
if (this.counter && this.maxlength == null) {
|
|
13727
14276
|
console.warn("[DUET WARNING]: counter will only take effect if maxlength is set");
|
|
13728
14277
|
}
|
|
@@ -13756,7 +14305,7 @@ class DuetTextarea {
|
|
|
13756
14305
|
"duet-label-hidden": this.labelHidden,
|
|
13757
14306
|
"duet-input-top-caption-shown": this.isCaptionVisible,
|
|
13758
14307
|
"has-error": !!this.error,
|
|
13759
|
-
} }, 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 })))))));
|
|
14308
|
+
} }, 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 })))))));
|
|
13760
14309
|
}
|
|
13761
14310
|
get element() { return getElement(this); }
|
|
13762
14311
|
static get watchers() { return {
|
|
@@ -14308,6 +14857,1269 @@ class DuetTray {
|
|
|
14308
14857
|
}; }
|
|
14309
14858
|
}
|
|
14310
14859
|
|
|
14860
|
+
var errorCodes = [
|
|
14861
|
+
{
|
|
14862
|
+
type: "default",
|
|
14863
|
+
system_message: "unknown error",
|
|
14864
|
+
message: {
|
|
14865
|
+
fi: "Tapahtui tuntematon virhe, ole hyvä ja yritä uudelleen.",
|
|
14866
|
+
sv: "Ett okänt fel uppstod, försök igen.",
|
|
14867
|
+
en: "An unknown error occured, please try again."
|
|
14868
|
+
}
|
|
14869
|
+
},
|
|
14870
|
+
{
|
|
14871
|
+
type: "400",
|
|
14872
|
+
system_message: "Bad Request: The server could not understand the request due to invalid syntax.",
|
|
14873
|
+
message: {
|
|
14874
|
+
fi: "Tiedostoa ei hyväksytty.",
|
|
14875
|
+
sv: "Servern avvisade din fil.",
|
|
14876
|
+
en: "The server rejected your file."
|
|
14877
|
+
}
|
|
14878
|
+
},
|
|
14879
|
+
{
|
|
14880
|
+
type: "401",
|
|
14881
|
+
system_message: "Not Authenticated: The client must authenticate itself to get the requested response...",
|
|
14882
|
+
message: {
|
|
14883
|
+
fi: "Vain kirjautunut käyttäjä voi lähettää tiedostoja.",
|
|
14884
|
+
sv: "Du måste vara inloggad för att ladda upp filer.",
|
|
14885
|
+
en: "You need to be logged in to upload files."
|
|
14886
|
+
}
|
|
14887
|
+
},
|
|
14888
|
+
{
|
|
14889
|
+
type: "403",
|
|
14890
|
+
system_message: "No Access: The client does not have access rights to the content.",
|
|
14891
|
+
message: {
|
|
14892
|
+
fi: "Ei oikeuksia lähettää tiedostoja.",
|
|
14893
|
+
sv: "Du har inte rätt åtkomsträttigheter för att ladda upp filer.",
|
|
14894
|
+
en: "You do not have the correct access rights to upload files."
|
|
14895
|
+
}
|
|
14896
|
+
},
|
|
14897
|
+
{
|
|
14898
|
+
type: "413",
|
|
14899
|
+
system_message: "Payload too large",
|
|
14900
|
+
message: {
|
|
14901
|
+
fi: "Tiedosto oli liian vastaanotettavaksi.",
|
|
14902
|
+
sv: "Filen var för stor för servern att hantera.",
|
|
14903
|
+
en: "The file was to large for the server to handle."
|
|
14904
|
+
}
|
|
14905
|
+
},
|
|
14906
|
+
{
|
|
14907
|
+
type: "415",
|
|
14908
|
+
system_message: "Unsupported media type",
|
|
14909
|
+
message: {
|
|
14910
|
+
fi: "Tiedoston tyyppi oli väärä.",
|
|
14911
|
+
sv: "Servern avvisade filen eftersom den hade fel typ.",
|
|
14912
|
+
en: "The server rejected the file because it had the wrong type."
|
|
14913
|
+
}
|
|
14914
|
+
},
|
|
14915
|
+
{
|
|
14916
|
+
type: "429",
|
|
14917
|
+
system_message: "Too many request from same address",
|
|
14918
|
+
message: {
|
|
14919
|
+
fi: "Liian monta yritystä, ole hyvä ja yritä myöhemmin uudelleen.",
|
|
14920
|
+
sv: "Servern har fått många förfrågningar från dig, försök igen senare.",
|
|
14921
|
+
en: "The server has received to many request from you, please try again later."
|
|
14922
|
+
}
|
|
14923
|
+
},
|
|
14924
|
+
{
|
|
14925
|
+
type: "500",
|
|
14926
|
+
system_message: "Internal Server Error",
|
|
14927
|
+
message: {
|
|
14928
|
+
fi: "Palvelin ilmoitti tuntemattomasta virheestä ja lataus epäonnistui.",
|
|
14929
|
+
sv: "Servern rapporterade ett okänt fel och uppladdningen misslyckades.",
|
|
14930
|
+
en: "The server reported an unknown error and the upload failed."
|
|
14931
|
+
}
|
|
14932
|
+
},
|
|
14933
|
+
{
|
|
14934
|
+
type: "duet-upload-100",
|
|
14935
|
+
system_message: "File extension not allowed",
|
|
14936
|
+
message: {
|
|
14937
|
+
fi: "Tiedoston tyyppi ei ole sallittu.",
|
|
14938
|
+
sv: "Du kan inte ladda upp filer av den type.",
|
|
14939
|
+
en: "You cannot upload files with that extension."
|
|
14940
|
+
}
|
|
14941
|
+
},
|
|
14942
|
+
{
|
|
14943
|
+
type: "duet-upload-001",
|
|
14944
|
+
system_message: "File transfer failed",
|
|
14945
|
+
message: {
|
|
14946
|
+
fi: "Tiedoston lähetys keskeytyi, ole hyvä ja yritä uudelleen.",
|
|
14947
|
+
sv: "Din anslutning till servern avbröts, försök igen.",
|
|
14948
|
+
en: "Your connection to the server was interrupted, try again."
|
|
14949
|
+
}
|
|
14950
|
+
},
|
|
14951
|
+
{
|
|
14952
|
+
type: "duet-upload-101",
|
|
14953
|
+
system_message: "File mimetype not allowed",
|
|
14954
|
+
message: {
|
|
14955
|
+
fi: "Tiedoston tyyppi ei ole sallittu.",
|
|
14956
|
+
sv: "Du kan inte ladda upp filer av den typ.",
|
|
14957
|
+
en: "You cannot upload files of that type."
|
|
14958
|
+
}
|
|
14959
|
+
},
|
|
14960
|
+
{
|
|
14961
|
+
type: "duet-upload-201",
|
|
14962
|
+
system_message: "File is too large",
|
|
14963
|
+
message: {
|
|
14964
|
+
fi: "Tiedosto on liian iso.",
|
|
14965
|
+
sv: "Filen är större än tillåtet.",
|
|
14966
|
+
en: "The file is larger than permitted."
|
|
14967
|
+
}
|
|
14968
|
+
},
|
|
14969
|
+
{
|
|
14970
|
+
type: "duet-upload-202",
|
|
14971
|
+
system_message: "The combined size of all files is too large",
|
|
14972
|
+
message: {
|
|
14973
|
+
fi: "Tiedostojen yhteenlaskettu koko on liian iso.",
|
|
14974
|
+
sv: "Du har nått den maximala kombinerade filstorleken.",
|
|
14975
|
+
en: "You have reached the maximum combined filesize."
|
|
14976
|
+
}
|
|
14977
|
+
},
|
|
14978
|
+
{
|
|
14979
|
+
type: "duet-upload-301",
|
|
14980
|
+
system_message: "The maximum file limit has been reached",
|
|
14981
|
+
message: {
|
|
14982
|
+
fi: "Liitteiden maksimimäärä saavutettu.",
|
|
14983
|
+
sv: "Maximalt antal bilagor har uppnåtts.",
|
|
14984
|
+
en: "Maximum number of attachments reached."
|
|
14985
|
+
}
|
|
14986
|
+
}
|
|
14987
|
+
];
|
|
14988
|
+
|
|
14989
|
+
const getError = (code) => {
|
|
14990
|
+
let error = {
|
|
14991
|
+
type: undefined,
|
|
14992
|
+
system_message: undefined,
|
|
14993
|
+
message: undefined,
|
|
14994
|
+
};
|
|
14995
|
+
error = errorCodes.filter(errorItem => {
|
|
14996
|
+
// the == is intentional we may be comparing numbers to strings - and that is ok here
|
|
14997
|
+
return errorItem.type == code;
|
|
14998
|
+
})[0];
|
|
14999
|
+
if (!error) {
|
|
15000
|
+
error = errorCodes.filter(errorItem => {
|
|
15001
|
+
return errorItem.type === "default";
|
|
15002
|
+
})[0];
|
|
15003
|
+
}
|
|
15004
|
+
return error;
|
|
15005
|
+
};
|
|
15006
|
+
const getI18nError = (errorCode) => {
|
|
15007
|
+
const errorFromJson = getError(errorCode);
|
|
15008
|
+
const i18String = getLocaleString(errorFromJson.message);
|
|
15009
|
+
if (i18String === "" || !i18String) {
|
|
15010
|
+
return errorFromJson.system_message;
|
|
15011
|
+
}
|
|
15012
|
+
else {
|
|
15013
|
+
return i18String;
|
|
15014
|
+
}
|
|
15015
|
+
};
|
|
15016
|
+
|
|
15017
|
+
const ErrorItem = ({ data }) => {
|
|
15018
|
+
const { item, error } = data;
|
|
15019
|
+
const { name } = item;
|
|
15020
|
+
const { type } = error;
|
|
15021
|
+
return (hAsync("span", { class: "duet-upload-item-error", role: "status" },
|
|
15022
|
+
hAsync("duet-paragraph", { class: "duet-upload-item-name", color: "danger", margin: "none", weight: "semi-bold" },
|
|
15023
|
+
hAsync("duet-icon", { margin: "none", size: "xx-small", name: "messaging-attachment" }),
|
|
15024
|
+
" ",
|
|
15025
|
+
name),
|
|
15026
|
+
hAsync("duet-paragraph", { class: "duet-upload-item-error-label", size: "small", margin: "none", color: "danger" }, getI18nError(type))));
|
|
15027
|
+
};
|
|
15028
|
+
|
|
15029
|
+
const ProgressItem = ({ progress, name }) => (hAsync("span", null,
|
|
15030
|
+
hAsync("duet-paragraph", { color: "secondary", margin: "none", size: "small" }, name),
|
|
15031
|
+
hAsync("duet-spacer", { size: "xx-small" }),
|
|
15032
|
+
hAsync("duet-progress", { progress: Math.ceil(progress), "aria-hidden": true })));
|
|
15033
|
+
|
|
15034
|
+
const formatBytes = (bytes, decimals = 2) => {
|
|
15035
|
+
if (bytes === 0) {
|
|
15036
|
+
return "0 Bytes";
|
|
15037
|
+
}
|
|
15038
|
+
const k = 1024;
|
|
15039
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
15040
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
15041
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
15042
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
15043
|
+
};
|
|
15044
|
+
|
|
15045
|
+
const SuccessItem = ({ data, showLinks }) => {
|
|
15046
|
+
const { item, size, uploaded, url, meta } = data;
|
|
15047
|
+
const { name } = item;
|
|
15048
|
+
const ContentName = (hAsync("span", { class: "duet-upload-item-name" },
|
|
15049
|
+
hAsync("duet-icon", { margin: "none", size: "xx-small", name: "messaging-attachment" }),
|
|
15050
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
15051
|
+
name));
|
|
15052
|
+
const SizeText = (hAsync("span", { class: "duet-upload-item-size", style: { fontSize: "14px", fontWeight: "400" } },
|
|
15053
|
+
"(",
|
|
15054
|
+
formatBytes(size),
|
|
15055
|
+
")"));
|
|
15056
|
+
const FilenameLine = uploaded && url && showLinks ? (hAsync("duet-paragraph", { color: "secondary", margin: "none", weight: "semi-bold" },
|
|
15057
|
+
hAsync("duet-link", { url: url, external: true }, ContentName),
|
|
15058
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
15059
|
+
SizeText)) : (hAsync("duet-paragraph", { color: "secondary", margin: "none", weight: "semi-bold" },
|
|
15060
|
+
ContentName,
|
|
15061
|
+
hAsync("duet-spacer", { size: "xx-small", direction: "horizontal" }),
|
|
15062
|
+
SizeText));
|
|
15063
|
+
const Badges = meta && meta.badges ? (hAsync("span", null,
|
|
15064
|
+
hAsync("duet-spacer", { size: "xx-small" }),
|
|
15065
|
+
meta.badges.map(badgeText => (hAsync("duet-badge", { color: "primary" }, badgeText))))) : undefined;
|
|
15066
|
+
return (hAsync("span", { class: "duet-upload-item-success" },
|
|
15067
|
+
hAsync("div", null, FilenameLine),
|
|
15068
|
+
Badges));
|
|
15069
|
+
};
|
|
15070
|
+
|
|
15071
|
+
const validateFileExtension = (name, allowedExtensions) => {
|
|
15072
|
+
if (!allowedExtensions) {
|
|
15073
|
+
return true;
|
|
15074
|
+
}
|
|
15075
|
+
const ext = name.split(".");
|
|
15076
|
+
const validExtension = allowedExtensions.split(",");
|
|
15077
|
+
const extension = ext[ext.length - 1];
|
|
15078
|
+
return validExtension.includes(extension);
|
|
15079
|
+
};
|
|
15080
|
+
const validateFileMime = (type, allowedMimetypes) => {
|
|
15081
|
+
if (!allowedMimetypes || !type) {
|
|
15082
|
+
return true;
|
|
15083
|
+
}
|
|
15084
|
+
const validMimeTypes = allowedMimetypes.split(",");
|
|
15085
|
+
let valid = false;
|
|
15086
|
+
validMimeTypes.forEach(mimeType => {
|
|
15087
|
+
const allowedTypes = mimeType.split("/");
|
|
15088
|
+
const fileType = type.split("/");
|
|
15089
|
+
if (allowedTypes[0] === fileType[0] && (allowedTypes[1] === fileType[1] || allowedTypes[1] === "*")) {
|
|
15090
|
+
valid = true;
|
|
15091
|
+
}
|
|
15092
|
+
});
|
|
15093
|
+
return valid;
|
|
15094
|
+
};
|
|
15095
|
+
const validateFileSize = (size, maxBytes) => {
|
|
15096
|
+
if (!maxBytes || !size) {
|
|
15097
|
+
return true;
|
|
15098
|
+
}
|
|
15099
|
+
return maxBytes >= size;
|
|
15100
|
+
};
|
|
15101
|
+
const validateFile = (item, validators) => {
|
|
15102
|
+
const { allowedMimetypes, allowedExtensions, maxBytes } = validators;
|
|
15103
|
+
let valid = false;
|
|
15104
|
+
let errorMessage = getError("default");
|
|
15105
|
+
if (item) {
|
|
15106
|
+
const { name, type, size } = item;
|
|
15107
|
+
const mime = validateFileMime(type, allowedMimetypes);
|
|
15108
|
+
const ext = validateFileExtension(name, allowedExtensions);
|
|
15109
|
+
const bytes = validateFileSize(size, maxBytes);
|
|
15110
|
+
if (!mime) {
|
|
15111
|
+
errorMessage = getError("duet-upload-101");
|
|
15112
|
+
}
|
|
15113
|
+
if (!ext) {
|
|
15114
|
+
errorMessage = getError("duet-upload-100");
|
|
15115
|
+
}
|
|
15116
|
+
if (!bytes) {
|
|
15117
|
+
errorMessage = getError("duet-upload-201");
|
|
15118
|
+
}
|
|
15119
|
+
valid = mime && ext && bytes;
|
|
15120
|
+
}
|
|
15121
|
+
else {
|
|
15122
|
+
valid = false;
|
|
15123
|
+
}
|
|
15124
|
+
return {
|
|
15125
|
+
valid,
|
|
15126
|
+
errorMessage: valid ? undefined : getLocaleString(errorMessage.message),
|
|
15127
|
+
errorSystem: valid ? undefined : errorMessage.system_message,
|
|
15128
|
+
errorType: valid ? undefined : errorMessage.type,
|
|
15129
|
+
};
|
|
15130
|
+
};
|
|
15131
|
+
const validateTotalSizeIsAboveMax = (filelist, maxTotalBytes) => {
|
|
15132
|
+
let total = 0;
|
|
15133
|
+
if (maxTotalBytes) {
|
|
15134
|
+
filelist.forEach(item => {
|
|
15135
|
+
if (item.valid && item.size) {
|
|
15136
|
+
total += item.size;
|
|
15137
|
+
}
|
|
15138
|
+
});
|
|
15139
|
+
if (total < maxTotalBytes) {
|
|
15140
|
+
return true;
|
|
15141
|
+
}
|
|
15142
|
+
}
|
|
15143
|
+
return false;
|
|
15144
|
+
};
|
|
15145
|
+
const validateTotalAmountIsAboveMax = (filelist, maxFiles) => {
|
|
15146
|
+
let total = 0;
|
|
15147
|
+
if (maxFiles) {
|
|
15148
|
+
filelist.forEach(item => {
|
|
15149
|
+
if (item.valid) {
|
|
15150
|
+
total++;
|
|
15151
|
+
}
|
|
15152
|
+
});
|
|
15153
|
+
if (total > maxFiles) {
|
|
15154
|
+
return true;
|
|
15155
|
+
}
|
|
15156
|
+
}
|
|
15157
|
+
return false;
|
|
15158
|
+
};
|
|
15159
|
+
|
|
15160
|
+
const makeXhrRequest = ({ payload, options, onFailure, onSuccess, onProgress }) => {
|
|
15161
|
+
const { type = "POST", xhr, uri, argument = null, headers = null } = options;
|
|
15162
|
+
xhr.open(type, `${uri}${argument || ""}`, true);
|
|
15163
|
+
const { data, name } = payload;
|
|
15164
|
+
// headers must be added after open
|
|
15165
|
+
if (headers) {
|
|
15166
|
+
Object.keys(headers).forEach(key => {
|
|
15167
|
+
xhr.setRequestHeader(key, headers[key]);
|
|
15168
|
+
});
|
|
15169
|
+
}
|
|
15170
|
+
if (type === "POST") {
|
|
15171
|
+
xhr.onreadystatechange = () => {
|
|
15172
|
+
// Call a function when the state changes.
|
|
15173
|
+
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status >= 200 && xhr.status < 300) {
|
|
15174
|
+
// Request finished without errors
|
|
15175
|
+
onSuccess(xhr, name, xhr.status);
|
|
15176
|
+
}
|
|
15177
|
+
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status >= 300 && xhr.status < 999) {
|
|
15178
|
+
// Request finished with errors
|
|
15179
|
+
onFailure(xhr, name, xhr.status);
|
|
15180
|
+
}
|
|
15181
|
+
};
|
|
15182
|
+
onProgress(name);
|
|
15183
|
+
}
|
|
15184
|
+
xhr.send(data);
|
|
15185
|
+
return xhr;
|
|
15186
|
+
};
|
|
15187
|
+
|
|
15188
|
+
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}";
|
|
15189
|
+
|
|
15190
|
+
/**
|
|
15191
|
+
* @slot header - named slot - to place content after description / caption
|
|
15192
|
+
* @slot fileheader - named slot - to place content above "filelist" (only displayed when "filelist" contains items)
|
|
15193
|
+
* @slot filefooter - named slot - to place content below "filelist" (only displayed when "filelist" contains items)
|
|
15194
|
+
*/
|
|
15195
|
+
class DuetUpload {
|
|
15196
|
+
constructor(hostRef) {
|
|
15197
|
+
registerInstance(this, hostRef);
|
|
15198
|
+
this.duetChange = createEvent$2(this, "duetChange", 3);
|
|
15199
|
+
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
15200
|
+
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
15201
|
+
this.duetDone = createEvent$2(this, "duetDone", 3);
|
|
15202
|
+
this.duetState = createEvent$2(this, "duetState", 3);
|
|
15203
|
+
this.duetDelete = createEvent$2(this, "duetDelete", 3);
|
|
15204
|
+
this.duetCancel = createEvent$2(this, "duetCancel", 3);
|
|
15205
|
+
this.duetProgress = createEvent$2(this, "duetProgress", 3);
|
|
15206
|
+
this.duetUpload = createEvent$2(this, "duetUpload", 3);
|
|
15207
|
+
/**
|
|
15208
|
+
* Own Properties
|
|
15209
|
+
*/
|
|
15210
|
+
this.buttonId = createID("DuetButton");
|
|
15211
|
+
this.labelId = createID("DuetLabel");
|
|
15212
|
+
this.uploadId = createID("DuetUpload");
|
|
15213
|
+
this.editableTableId = createID("DuetEditableTable");
|
|
15214
|
+
this.filesInProgress = new Map();
|
|
15215
|
+
this.fileMaxReached = false;
|
|
15216
|
+
this.bytesMaxReached = false;
|
|
15217
|
+
this.internalStatusMessageLabel = undefined;
|
|
15218
|
+
/**
|
|
15219
|
+
* Properties
|
|
15220
|
+
*/
|
|
15221
|
+
this.DefaultGroups = {
|
|
15222
|
+
inprogress: "inprogress",
|
|
15223
|
+
success: "success",
|
|
15224
|
+
failure: "failure",
|
|
15225
|
+
};
|
|
15226
|
+
/**
|
|
15227
|
+
* State() variables
|
|
15228
|
+
*/
|
|
15229
|
+
this.tick = Date.now();
|
|
15230
|
+
/**
|
|
15231
|
+
* If external is set to true, the upload component will not actually upload the files, but only keep states
|
|
15232
|
+
* it will be up to you to handle the upload and return progress information to the upload-component
|
|
15233
|
+
*/
|
|
15234
|
+
this.external = false;
|
|
15235
|
+
/**
|
|
15236
|
+
* If set the upload component will not display an upload button, you will have to create one yourself
|
|
15237
|
+
* and call the exposed method startUpload
|
|
15238
|
+
*/
|
|
15239
|
+
this.hideButton = false;
|
|
15240
|
+
/**
|
|
15241
|
+
* Default actions added to the internally used duet-editable-table
|
|
15242
|
+
*/
|
|
15243
|
+
this.actions = [
|
|
15244
|
+
{
|
|
15245
|
+
icon: "action-delete",
|
|
15246
|
+
color: "color-danger",
|
|
15247
|
+
color_hover: "category-home",
|
|
15248
|
+
id: "delete",
|
|
15249
|
+
map: ["success", "failure"],
|
|
15250
|
+
label: {
|
|
15251
|
+
fi: "Poista tiedosto",
|
|
15252
|
+
en: "Poista tiedosto",
|
|
15253
|
+
sv: "Ta bort filen",
|
|
15254
|
+
},
|
|
15255
|
+
},
|
|
15256
|
+
{
|
|
15257
|
+
icon: "navigation-close",
|
|
15258
|
+
color: "primary",
|
|
15259
|
+
color_hover: "category-home",
|
|
15260
|
+
id: "cancel",
|
|
15261
|
+
map: ["inprogress"],
|
|
15262
|
+
label: {
|
|
15263
|
+
fi: "Keskeytä lähetys",
|
|
15264
|
+
en: "Cancel the upload",
|
|
15265
|
+
sv: "Stop överföringen",
|
|
15266
|
+
},
|
|
15267
|
+
},
|
|
15268
|
+
];
|
|
15269
|
+
/**
|
|
15270
|
+
* If enabled the editable-table will display links on successfully uploaded items,
|
|
15271
|
+
* this requires the server can respond with link URIs in the correct format
|
|
15272
|
+
* and that the files are accessible to the user
|
|
15273
|
+
*/
|
|
15274
|
+
this.showLinks = false;
|
|
15275
|
+
/**
|
|
15276
|
+
* Property to change the aria upload progress text read aloud by screenreaders
|
|
15277
|
+
* @default {
|
|
15278
|
+
* fi: {
|
|
15279
|
+
* inProgress: "Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",
|
|
15280
|
+
* inProgressWithErrors:
|
|
15281
|
+
* "Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",
|
|
15282
|
+
* done: "Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",
|
|
15283
|
+
* doneWithErrors:
|
|
15284
|
+
* "Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",
|
|
15285
|
+
* files: "tiedostot",
|
|
15286
|
+
* file: "tiedosto",
|
|
15287
|
+
* },
|
|
15288
|
+
* sv: {
|
|
15289
|
+
* inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
15290
|
+
* inProgressWithErrors:
|
|
15291
|
+
* "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
|
|
15292
|
+
* done: "Alla {filesTotal} har lagts till",
|
|
15293
|
+
* doneWithErrors: "Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
|
|
15294
|
+
* files: "filer",
|
|
15295
|
+
* file: "fil",
|
|
15296
|
+
* },
|
|
15297
|
+
* en: {
|
|
15298
|
+
* inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
15299
|
+
* inProgressWithErrors:
|
|
15300
|
+
* "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
|
|
15301
|
+
* done: "All {filesTotal} added successfully",
|
|
15302
|
+
* doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
|
|
15303
|
+
* files: "tiedostoa",
|
|
15304
|
+
* file: "tiedosto",
|
|
15305
|
+
* },
|
|
15306
|
+
* }
|
|
15307
|
+
*/
|
|
15308
|
+
this.statusLabelDefaults = {
|
|
15309
|
+
fi: {
|
|
15310
|
+
inProgress: "Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",
|
|
15311
|
+
inProgressWithErrors: "Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",
|
|
15312
|
+
done: "Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",
|
|
15313
|
+
doneWithErrors: "Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",
|
|
15314
|
+
files: "tiedostot",
|
|
15315
|
+
file: "tiedosto",
|
|
15316
|
+
},
|
|
15317
|
+
sv: {
|
|
15318
|
+
inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
15319
|
+
inProgressWithErrors: "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
|
|
15320
|
+
done: "Alla {filesTotal} har lagts till",
|
|
15321
|
+
doneWithErrors: "Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
|
|
15322
|
+
files: "filer",
|
|
15323
|
+
file: "fil",
|
|
15324
|
+
},
|
|
15325
|
+
en: {
|
|
15326
|
+
inProgress: "Adding {filesUploaded} of {filesTotal}",
|
|
15327
|
+
inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
|
|
15328
|
+
done: "All {filesTotal} added successfully",
|
|
15329
|
+
doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
|
|
15330
|
+
files: "tiedostoa",
|
|
15331
|
+
file: "tiedosto",
|
|
15332
|
+
},
|
|
15333
|
+
};
|
|
15334
|
+
/**
|
|
15335
|
+
* Strings used for the status aria-label
|
|
15336
|
+
*/
|
|
15337
|
+
this.statusMessageLabel = getLocaleString(this.statusLabelDefaults);
|
|
15338
|
+
/**
|
|
15339
|
+
* Property to change button label defaults on the component.
|
|
15340
|
+
* @default {
|
|
15341
|
+
fi: "Lisää liite",
|
|
15342
|
+
sv: "Lägg till en bilaga",
|
|
15343
|
+
en: "Add an attachment",
|
|
15344
|
+
}
|
|
15345
|
+
*/
|
|
15346
|
+
this.buttonLabelDefaults = {
|
|
15347
|
+
fi: "Lisää liite",
|
|
15348
|
+
sv: "Lägg till en bilaga",
|
|
15349
|
+
en: "Add an attachment",
|
|
15350
|
+
};
|
|
15351
|
+
/**
|
|
15352
|
+
* Label of button
|
|
15353
|
+
* @default { fi: "Lisää liite", sv: "Lägg till en bilaga", en: "Add an attachment" }
|
|
15354
|
+
*/
|
|
15355
|
+
this.buttonLabel = getLocaleString(this.buttonLabelDefaults);
|
|
15356
|
+
/**
|
|
15357
|
+
* accessible aria-Label of button
|
|
15358
|
+
*/
|
|
15359
|
+
this.accessibleButtonLabel = undefined;
|
|
15360
|
+
/**
|
|
15361
|
+
* Theme of the input.
|
|
15362
|
+
*/
|
|
15363
|
+
this.theme = "";
|
|
15364
|
+
/**
|
|
15365
|
+
* Makes the input component disabled. This prevents users from being able to
|
|
15366
|
+
* interact with the upload component, and conveys its inactive state to assistive technologies.
|
|
15367
|
+
*/
|
|
15368
|
+
this.disabled = false;
|
|
15369
|
+
/**
|
|
15370
|
+
* Controls the margin of the component.
|
|
15371
|
+
*/
|
|
15372
|
+
this.margin = "auto";
|
|
15373
|
+
/**
|
|
15374
|
+
* Set whether the input is required or not. Please note that this is necessary for
|
|
15375
|
+
* accessible inputs when the user is required to fill them. When using this property
|
|
15376
|
+
* you need to also set “novalidate” attribute to your form element to prevent
|
|
15377
|
+
* browser from displaying its own validation errors.
|
|
15378
|
+
*/
|
|
15379
|
+
this.required = false;
|
|
15380
|
+
/**
|
|
15381
|
+
* Visually hides the groups labels in the editable table list used to display the list of files
|
|
15382
|
+
*/
|
|
15383
|
+
this.hideGroups = false;
|
|
15384
|
+
/**
|
|
15385
|
+
* Map of string that contain list of uploaded files.
|
|
15386
|
+
*/
|
|
15387
|
+
this.files = new Map();
|
|
15388
|
+
/**
|
|
15389
|
+
* Property to read if the internally used editable-table contains errors or not
|
|
15390
|
+
*/
|
|
15391
|
+
this.valid = !this.required;
|
|
15392
|
+
/**
|
|
15393
|
+
* Property to change labelDefaults defaults on the component.
|
|
15394
|
+
* normally you would handle these strings on an application level and override @label when needed
|
|
15395
|
+
* @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
|
|
15396
|
+
*/
|
|
15397
|
+
this.labelDefaults = {
|
|
15398
|
+
fi: "Lisää liite",
|
|
15399
|
+
sv: "Lägg till en bilaga",
|
|
15400
|
+
en: "Add attachments",
|
|
15401
|
+
};
|
|
15402
|
+
/**
|
|
15403
|
+
* Label for the input.
|
|
15404
|
+
* @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
|
|
15405
|
+
*/
|
|
15406
|
+
this.label = getLocaleString(this.labelDefaults);
|
|
15407
|
+
/**
|
|
15408
|
+
* Property to change descriptionDefaults defaults on the component.
|
|
15409
|
+
* @default {
|
|
15410
|
+
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.",
|
|
15411
|
+
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.",
|
|
15412
|
+
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.",
|
|
15413
|
+
}
|
|
15414
|
+
*/
|
|
15415
|
+
this.descriptionDefaults = {
|
|
15416
|
+
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.",
|
|
15417
|
+
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.",
|
|
15418
|
+
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.",
|
|
15419
|
+
};
|
|
15420
|
+
/**
|
|
15421
|
+
* Description for the upload component.
|
|
15422
|
+
* @default {
|
|
15423
|
+
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.",
|
|
15424
|
+
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.",
|
|
15425
|
+
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.",
|
|
15426
|
+
}
|
|
15427
|
+
*/
|
|
15428
|
+
this.description = getLocaleString(this.descriptionDefaults);
|
|
15429
|
+
/**
|
|
15430
|
+
* Defaults for the filelist's empty state.
|
|
15431
|
+
* @default {
|
|
15432
|
+
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
15433
|
+
sv: "Inga filer har lagts till ännu.",
|
|
15434
|
+
en: "No files added yet.",
|
|
15435
|
+
}
|
|
15436
|
+
*/
|
|
15437
|
+
this.fileListEmptyDefaults = {
|
|
15438
|
+
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
15439
|
+
sv: "Inga filer har lagts till ännu.",
|
|
15440
|
+
en: "No files added yet.",
|
|
15441
|
+
};
|
|
15442
|
+
/**
|
|
15443
|
+
* Label for the filelist's empty state.
|
|
15444
|
+
* @default { fi: "Ei vielä lisättyjä tiedostoja.",sv: "Inga filer har lagts till ännu.",en: "No files added yet."}
|
|
15445
|
+
*/
|
|
15446
|
+
this.fileListEmpty = getLocaleString(this.fileListEmptyDefaults);
|
|
15447
|
+
/**
|
|
15448
|
+
* Display the input in error state along with an error message.
|
|
15449
|
+
*/
|
|
15450
|
+
this.error = "";
|
|
15451
|
+
/**
|
|
15452
|
+
* Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded.
|
|
15453
|
+
*/
|
|
15454
|
+
this.maxBytes = 200000000;
|
|
15455
|
+
/**
|
|
15456
|
+
* Use maxBytesTotal to specify the maximum size in Bytes of All files combined that can be uploaded.
|
|
15457
|
+
*/
|
|
15458
|
+
this.maxBytesTotal = undefined;
|
|
15459
|
+
/**
|
|
15460
|
+
* Use maxFiles to specify the maximum amount of files that can be uploaded
|
|
15461
|
+
*/
|
|
15462
|
+
this.maxFiles = 99;
|
|
15463
|
+
/**
|
|
15464
|
+
* A string of commaseperated file type values that are allowed
|
|
15465
|
+
* @example: .pdf,.doc,.docx
|
|
15466
|
+
*/
|
|
15467
|
+
this.allowedExtensions = "all";
|
|
15468
|
+
/**
|
|
15469
|
+
* A string of commaseperated mime type values that are allowed
|
|
15470
|
+
* @example: image/*,application/msword,
|
|
15471
|
+
*/
|
|
15472
|
+
this.allowedMimetypes = "*";
|
|
15473
|
+
/**
|
|
15474
|
+
* Use multiple to allow the user to select multiple files when uploading
|
|
15475
|
+
*/
|
|
15476
|
+
this.multiple = true;
|
|
15477
|
+
/**
|
|
15478
|
+
* Use limitSelection to enforce the value in allowedExtension & allowedMimetypes when selecting files,
|
|
15479
|
+
* by default this is off, setting this to true will limit the users choices to what has been explicitly set
|
|
15480
|
+
*/
|
|
15481
|
+
this.limitSelection = false;
|
|
15482
|
+
/**
|
|
15483
|
+
* Private functions
|
|
15484
|
+
*/
|
|
15485
|
+
this.listenForActionEvents = () => {
|
|
15486
|
+
this.element.addEventListener("duetEditableItemAction", (e) => {
|
|
15487
|
+
const detail = e.detail;
|
|
15488
|
+
const { action, keyName, originalEvent } = detail;
|
|
15489
|
+
switch (action) {
|
|
15490
|
+
case "delete":
|
|
15491
|
+
this.onDelete(keyName, originalEvent);
|
|
15492
|
+
break;
|
|
15493
|
+
case "cancel":
|
|
15494
|
+
this.onCancel(keyName, originalEvent);
|
|
15495
|
+
break;
|
|
15496
|
+
// code block
|
|
15497
|
+
}
|
|
15498
|
+
});
|
|
15499
|
+
};
|
|
15500
|
+
this.verifyValidity = () => {
|
|
15501
|
+
const { invalid, valid } = this.getFilesAsArray();
|
|
15502
|
+
const oldValid = this.valid;
|
|
15503
|
+
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
15504
|
+
if (this.valid !== oldValid) {
|
|
15505
|
+
this.duetState.emit({
|
|
15506
|
+
originalEvent: undefined,
|
|
15507
|
+
data: { valid: this.valid, from: "componentWillRender" },
|
|
15508
|
+
component: "duet-upload",
|
|
15509
|
+
});
|
|
15510
|
+
}
|
|
15511
|
+
};
|
|
15512
|
+
this.getGroupFromItemData = (item) => {
|
|
15513
|
+
if (item.valid && item.progress === 100) {
|
|
15514
|
+
// if the item has a group, move the file to that group instead
|
|
15515
|
+
// of into the standard success group
|
|
15516
|
+
if (item.group) {
|
|
15517
|
+
return item.group;
|
|
15518
|
+
}
|
|
15519
|
+
return this.DefaultGroups.success;
|
|
15520
|
+
}
|
|
15521
|
+
else if (item.progress > 0 && item.progress !== 100) {
|
|
15522
|
+
return this.DefaultGroups.inprogress;
|
|
15523
|
+
}
|
|
15524
|
+
else if (!item.valid) {
|
|
15525
|
+
return this.DefaultGroups.failure;
|
|
15526
|
+
}
|
|
15527
|
+
else if (item.group) {
|
|
15528
|
+
return item.group;
|
|
15529
|
+
}
|
|
15530
|
+
else {
|
|
15531
|
+
return "none";
|
|
15532
|
+
}
|
|
15533
|
+
};
|
|
15534
|
+
this.getItemHTMLFromItemData = (data, group) => {
|
|
15535
|
+
if (group === this.DefaultGroups.success) {
|
|
15536
|
+
return hAsync(SuccessItem, { data: data, showLinks: this.showLinks });
|
|
15537
|
+
}
|
|
15538
|
+
else if (group === this.DefaultGroups.inprogress) {
|
|
15539
|
+
return hAsync(ProgressItem, { progress: data.progress, name: data.item.name });
|
|
15540
|
+
}
|
|
15541
|
+
else if (group === this.DefaultGroups.failure) {
|
|
15542
|
+
return hAsync(ErrorItem, { data: data });
|
|
15543
|
+
}
|
|
15544
|
+
else if (data.group) {
|
|
15545
|
+
return data.html;
|
|
15546
|
+
}
|
|
15547
|
+
else {
|
|
15548
|
+
return "none";
|
|
15549
|
+
}
|
|
15550
|
+
};
|
|
15551
|
+
this.convertToDuetEditableTableItems = () => {
|
|
15552
|
+
// we're always recreating the map - in order to force an update down stream.
|
|
15553
|
+
const itemData = new Map();
|
|
15554
|
+
//walk the files Map and convert to DuetEditableTableItemData
|
|
15555
|
+
this.files.forEach((data, key, _originalMap) => {
|
|
15556
|
+
const group = this.getGroupFromItemData(data);
|
|
15557
|
+
const item = this.getItemHTMLFromItemData(data, group);
|
|
15558
|
+
itemData.set(key, {
|
|
15559
|
+
uid: data.uid,
|
|
15560
|
+
item,
|
|
15561
|
+
group,
|
|
15562
|
+
});
|
|
15563
|
+
});
|
|
15564
|
+
return itemData;
|
|
15565
|
+
};
|
|
15566
|
+
this.kick = debounce(() => {
|
|
15567
|
+
this.tick = Date.now();
|
|
15568
|
+
}, 30); // will trigger re-render
|
|
15569
|
+
this.genHashName = () => Date.now().toString(36) + Math.random();
|
|
15570
|
+
this.updateValueInMap = (item, key, value, kick = true) => {
|
|
15571
|
+
const fileItem = this.files.get(item);
|
|
15572
|
+
fileItem[key] = value;
|
|
15573
|
+
this.files.set(item, fileItem);
|
|
15574
|
+
if (kick) {
|
|
15575
|
+
this.kick();
|
|
15576
|
+
}
|
|
15577
|
+
};
|
|
15578
|
+
this.updateProgress = (ev, name) => {
|
|
15579
|
+
const updateProgressHelper = percentComplete => {
|
|
15580
|
+
this.updateValueInMap(name, "progress", percentComplete);
|
|
15581
|
+
this.onProgress(name, percentComplete, ev);
|
|
15582
|
+
};
|
|
15583
|
+
if (ev.lengthComputable) {
|
|
15584
|
+
const percentComplete = (ev.loaded / ev.total) * 100;
|
|
15585
|
+
updateProgressHelper(percentComplete);
|
|
15586
|
+
}
|
|
15587
|
+
else {
|
|
15588
|
+
console.log("cant read progress");
|
|
15589
|
+
}
|
|
15590
|
+
};
|
|
15591
|
+
this.trackProgress = (name, remove = false) => {
|
|
15592
|
+
if (remove) {
|
|
15593
|
+
this.filesInProgress.delete(name);
|
|
15594
|
+
}
|
|
15595
|
+
else {
|
|
15596
|
+
this.filesInProgress.set(name, "inprogress");
|
|
15597
|
+
}
|
|
15598
|
+
if (this.filesInProgress.size === 0) {
|
|
15599
|
+
this.onDone();
|
|
15600
|
+
}
|
|
15601
|
+
};
|
|
15602
|
+
this.getFilesAsArray = () => {
|
|
15603
|
+
const filesInQueue = [];
|
|
15604
|
+
const filesInError = [];
|
|
15605
|
+
this.files.forEach(value => {
|
|
15606
|
+
if (value.valid && !value.deleted) {
|
|
15607
|
+
filesInQueue.push(value);
|
|
15608
|
+
}
|
|
15609
|
+
else if (!value.valid && !value.deleted) {
|
|
15610
|
+
filesInError.push(value);
|
|
15611
|
+
}
|
|
15612
|
+
});
|
|
15613
|
+
return { valid: filesInQueue, invalid: filesInError };
|
|
15614
|
+
};
|
|
15615
|
+
this.resetFormFields = () => {
|
|
15616
|
+
/**
|
|
15617
|
+
* You cannot modify a FileList, nor remove single items from it
|
|
15618
|
+
* This completely removes all items in the FileList
|
|
15619
|
+
* We reset the form fields to always be able to re-upload files
|
|
15620
|
+
* and because we handle all uploads and states internally in the component (not relying on native form elements)
|
|
15621
|
+
*/
|
|
15622
|
+
/* TODO: it may be a good idea to just update the list so that this always matches what is in the files map,
|
|
15623
|
+
* TODO: this would remove the capability of Re-uploading, unless we can catch and remove the user file from the form filelist before the upload is canceled by the browser
|
|
15624
|
+
* TODO: but for now we'll just reset the form fields
|
|
15625
|
+
*/
|
|
15626
|
+
this.nativeInput.value = "";
|
|
15627
|
+
};
|
|
15628
|
+
this.startUpload = async (ev, metaData = undefined) => {
|
|
15629
|
+
await this.setFocus();
|
|
15630
|
+
this.metaData = metaData;
|
|
15631
|
+
this.nativeInput.click();
|
|
15632
|
+
this.onUpload(ev, metaData);
|
|
15633
|
+
ev.stopPropagation();
|
|
15634
|
+
ev.preventDefault();
|
|
15635
|
+
return;
|
|
15636
|
+
};
|
|
15637
|
+
/**
|
|
15638
|
+
* Eventlisteners for the XHR requests
|
|
15639
|
+
*/
|
|
15640
|
+
this.transferComplete = name => {
|
|
15641
|
+
this.updateValueInMap(name, "progress", 100, false);
|
|
15642
|
+
this.trackProgress(name, true);
|
|
15643
|
+
};
|
|
15644
|
+
this.transferDone = (xhr, name, status) => {
|
|
15645
|
+
this.updateValueInMap(name, "status", status, false);
|
|
15646
|
+
this.updateValueInMap(name, "uploaded", true, false);
|
|
15647
|
+
try {
|
|
15648
|
+
const response = JSON.parse(xhr.response);
|
|
15649
|
+
this.updateValueInMap(name, "url", response.url);
|
|
15650
|
+
}
|
|
15651
|
+
catch (e) {
|
|
15652
|
+
this.updateValueInMap(name, "url", null);
|
|
15653
|
+
console.error("Server did not respond with expected response {url: string}");
|
|
15654
|
+
}
|
|
15655
|
+
return;
|
|
15656
|
+
};
|
|
15657
|
+
this.transferDoneWithFailure = (xhr, name, status) => {
|
|
15658
|
+
try {
|
|
15659
|
+
const { error } = JSON.parse(xhr.response);
|
|
15660
|
+
this.updateValueInMap(name, "error", { message: error.message, type: error.type }, false);
|
|
15661
|
+
}
|
|
15662
|
+
catch (e) {
|
|
15663
|
+
console.error("Server did not respond with expected response error:{message: string, type: int}");
|
|
15664
|
+
this.updateValueInMap(name, "error", { type: status }, false);
|
|
15665
|
+
}
|
|
15666
|
+
this.updateValueInMap(name, "valid", false, true);
|
|
15667
|
+
};
|
|
15668
|
+
this.transferFailed = name => {
|
|
15669
|
+
this.updateValueInMap(name, "error", getError("duet-upload-001"));
|
|
15670
|
+
};
|
|
15671
|
+
this.transferCanceled = name => {
|
|
15672
|
+
this.files.delete(name);
|
|
15673
|
+
this.validateTotals(name);
|
|
15674
|
+
this.kick();
|
|
15675
|
+
};
|
|
15676
|
+
this.validateTotals = (name) => {
|
|
15677
|
+
const isTotalSizeOverMaxSize = validateTotalSizeIsAboveMax(this.files, this.maxBytesTotal);
|
|
15678
|
+
const isTotalFileAmountAboveMax = validateTotalAmountIsAboveMax(this.files, this.maxFiles);
|
|
15679
|
+
if (isTotalSizeOverMaxSize && name) {
|
|
15680
|
+
this.updateValueInMap(name, "error", getError("duet-upload-202"), false);
|
|
15681
|
+
}
|
|
15682
|
+
if (isTotalFileAmountAboveMax && name) {
|
|
15683
|
+
this.updateValueInMap(name, "error", getError("duet-upload-301"), false);
|
|
15684
|
+
}
|
|
15685
|
+
this.bytesMaxReached = isTotalSizeOverMaxSize;
|
|
15686
|
+
this.fileMaxReached = isTotalFileAmountAboveMax;
|
|
15687
|
+
return {
|
|
15688
|
+
bytesMaxReached: isTotalSizeOverMaxSize,
|
|
15689
|
+
fileMaxReached: isTotalFileAmountAboveMax,
|
|
15690
|
+
};
|
|
15691
|
+
};
|
|
15692
|
+
this.onDelete = (key, ev) => {
|
|
15693
|
+
const deletedItem = this.files.get(key);
|
|
15694
|
+
this.files.delete(key);
|
|
15695
|
+
this.validateTotals();
|
|
15696
|
+
this.kick();
|
|
15697
|
+
this.duetDelete.emit({
|
|
15698
|
+
originalEvent: ev,
|
|
15699
|
+
data: { deletion: deletedItem },
|
|
15700
|
+
component: "duet-upload",
|
|
15701
|
+
});
|
|
15702
|
+
if (!this.external) {
|
|
15703
|
+
this.makeXHRDeleteRequest(deletedItem);
|
|
15704
|
+
}
|
|
15705
|
+
this.resetFormFields();
|
|
15706
|
+
};
|
|
15707
|
+
this.onCancel = (key, ev) => {
|
|
15708
|
+
const cancelledItem = this.files.get(key);
|
|
15709
|
+
this.files.delete(key);
|
|
15710
|
+
if (!this.external) {
|
|
15711
|
+
const { xhr } = cancelledItem;
|
|
15712
|
+
xhr.abort();
|
|
15713
|
+
}
|
|
15714
|
+
else {
|
|
15715
|
+
this.kick();
|
|
15716
|
+
}
|
|
15717
|
+
this.resetFormFields();
|
|
15718
|
+
this.duetCancel.emit({
|
|
15719
|
+
originalEvent: ev,
|
|
15720
|
+
data: { cancelled: cancelledItem },
|
|
15721
|
+
component: "duet-upload",
|
|
15722
|
+
});
|
|
15723
|
+
};
|
|
15724
|
+
this.onUpload = (ev, metaData) => {
|
|
15725
|
+
this.duetUpload.emit({
|
|
15726
|
+
originalEvent: ev,
|
|
15727
|
+
metaData,
|
|
15728
|
+
component: "duet-upload",
|
|
15729
|
+
});
|
|
15730
|
+
};
|
|
15731
|
+
this.onBlur = (ev) => {
|
|
15732
|
+
this.duetBlur.emit({
|
|
15733
|
+
originalEvent: ev,
|
|
15734
|
+
component: "duet-upload",
|
|
15735
|
+
});
|
|
15736
|
+
};
|
|
15737
|
+
this.onProgress = (key, percentComplete, ev) => {
|
|
15738
|
+
this.duetChange.emit({
|
|
15739
|
+
originalEvent: ev,
|
|
15740
|
+
data: {
|
|
15741
|
+
key,
|
|
15742
|
+
percentComplete,
|
|
15743
|
+
},
|
|
15744
|
+
component: "duet-upload",
|
|
15745
|
+
});
|
|
15746
|
+
};
|
|
15747
|
+
this.onFocus = (ev) => {
|
|
15748
|
+
this.duetFocus.emit({
|
|
15749
|
+
originalEvent: ev,
|
|
15750
|
+
component: "duet-upload",
|
|
15751
|
+
});
|
|
15752
|
+
};
|
|
15753
|
+
this.onDone = () => {
|
|
15754
|
+
this.duetDone.emit({
|
|
15755
|
+
component: "duet-upload",
|
|
15756
|
+
data: { files: this.files },
|
|
15757
|
+
});
|
|
15758
|
+
};
|
|
15759
|
+
}
|
|
15760
|
+
watchValidHandler(newValue, oldValue) {
|
|
15761
|
+
if (newValue !== oldValue) {
|
|
15762
|
+
this.kick();
|
|
15763
|
+
}
|
|
15764
|
+
}
|
|
15765
|
+
/**
|
|
15766
|
+
* Component lifecycle events.
|
|
15767
|
+
*/
|
|
15768
|
+
componentWillLoad() {
|
|
15769
|
+
if (typeof this.statusMessageLabel === "string") {
|
|
15770
|
+
this.internalStatusMessageLabel = sanitizeString(this.groups);
|
|
15771
|
+
}
|
|
15772
|
+
else {
|
|
15773
|
+
this.internalStatusMessageLabel = this.statusMessageLabel;
|
|
15774
|
+
}
|
|
15775
|
+
inheritGlobalTheme(this);
|
|
15776
|
+
this.listenForActionEvents();
|
|
15777
|
+
}
|
|
15778
|
+
componentWillRender() {
|
|
15779
|
+
// listen to the events from the component
|
|
15780
|
+
this.verifyValidity();
|
|
15781
|
+
}
|
|
15782
|
+
/**
|
|
15783
|
+
* XHR request utilities
|
|
15784
|
+
*/
|
|
15785
|
+
makeXHRPostRequest(data) {
|
|
15786
|
+
const xhr = new XMLHttpRequest();
|
|
15787
|
+
const name = data.get("name");
|
|
15788
|
+
xhr.upload.addEventListener("progress", ev => {
|
|
15789
|
+
this.updateProgress(ev, name);
|
|
15790
|
+
});
|
|
15791
|
+
xhr.upload.addEventListener("load", () => {
|
|
15792
|
+
this.transferComplete(name);
|
|
15793
|
+
});
|
|
15794
|
+
xhr.upload.addEventListener("error", () => {
|
|
15795
|
+
this.transferFailed(name);
|
|
15796
|
+
});
|
|
15797
|
+
xhr.upload.addEventListener("abort", () => {
|
|
15798
|
+
this.transferCanceled(name);
|
|
15799
|
+
});
|
|
15800
|
+
return makeXhrRequest({
|
|
15801
|
+
payload: { data, name },
|
|
15802
|
+
options: { type: "POST", uri: this.uri, xhr, argument: null, headers: null },
|
|
15803
|
+
onFailure: this.transferDoneWithFailure,
|
|
15804
|
+
onSuccess: this.transferDone,
|
|
15805
|
+
onProgress: this.trackProgress,
|
|
15806
|
+
});
|
|
15807
|
+
}
|
|
15808
|
+
makeXHRDeleteRequest(data) {
|
|
15809
|
+
const { uid, item } = data;
|
|
15810
|
+
const xhr = new XMLHttpRequest();
|
|
15811
|
+
// don't present server issues to user on deletes, just remove them from the visible list
|
|
15812
|
+
return makeXhrRequest({
|
|
15813
|
+
payload: { data: null, name },
|
|
15814
|
+
options: {
|
|
15815
|
+
type: "DELETE",
|
|
15816
|
+
xhr,
|
|
15817
|
+
uri: this.uri,
|
|
15818
|
+
arguments: `?key=${uid}&name=${item.name}`,
|
|
15819
|
+
headers: {
|
|
15820
|
+
"x-fileuid": uid,
|
|
15821
|
+
"x-filename": item.name,
|
|
15822
|
+
},
|
|
15823
|
+
},
|
|
15824
|
+
onFailure: this.transferDoneWithFailure,
|
|
15825
|
+
onSuccess: this.transferDone,
|
|
15826
|
+
onProgress: this.trackProgress,
|
|
15827
|
+
});
|
|
15828
|
+
}
|
|
15829
|
+
/**
|
|
15830
|
+
* Component event handling.
|
|
15831
|
+
*/
|
|
15832
|
+
async onChange(ev) {
|
|
15833
|
+
var _a;
|
|
15834
|
+
const selectedFiles = Array.from((_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.files);
|
|
15835
|
+
// FileList is a nice array like structure but
|
|
15836
|
+
// to ensure uniqueness of files we use a mapping structure and
|
|
15837
|
+
// key to the name (makes it easier to delete as well)
|
|
15838
|
+
if (selectedFiles) {
|
|
15839
|
+
for (const item of selectedFiles) {
|
|
15840
|
+
const { valid, errorMessage, errorType, errorSystem } = validateFile(item, {
|
|
15841
|
+
maxBytes: this.maxBytes,
|
|
15842
|
+
allowedExtensions: this.allowedExtensions,
|
|
15843
|
+
allowedMimetypes: this.allowedMimetypes,
|
|
15844
|
+
});
|
|
15845
|
+
const uid = this.genHashName();
|
|
15846
|
+
const fileListItem = {
|
|
15847
|
+
uid,
|
|
15848
|
+
item: item,
|
|
15849
|
+
size: item.size,
|
|
15850
|
+
meta: this.metaData,
|
|
15851
|
+
uploaded: false,
|
|
15852
|
+
valid,
|
|
15853
|
+
error: {
|
|
15854
|
+
type: valid ? undefined : errorType,
|
|
15855
|
+
message: valid ? undefined : errorMessage,
|
|
15856
|
+
system_message: valid ? undefined : errorSystem,
|
|
15857
|
+
},
|
|
15858
|
+
progress: 0,
|
|
15859
|
+
deleted: false,
|
|
15860
|
+
xhr: false,
|
|
15861
|
+
url: false,
|
|
15862
|
+
};
|
|
15863
|
+
this.files.set(item.name, fileListItem);
|
|
15864
|
+
// validate that we haven't hit any maxfiles or maxbytes limits before we upload
|
|
15865
|
+
const { bytesMaxReached, fileMaxReached } = this.validateTotals(item.name);
|
|
15866
|
+
if (bytesMaxReached) {
|
|
15867
|
+
// in case one of the global maxes have been reached, invalidate the file
|
|
15868
|
+
this.updateValueInMap(item.name, "valid", false, false);
|
|
15869
|
+
}
|
|
15870
|
+
else if (fileMaxReached) {
|
|
15871
|
+
// in case one of the global maxes have been reached, invalidate the file
|
|
15872
|
+
this.updateValueInMap(item.name, "valid", false, false);
|
|
15873
|
+
}
|
|
15874
|
+
else if (valid && !this.external) {
|
|
15875
|
+
// if all is well AND external file upload handling has not been set, start upload
|
|
15876
|
+
const data = new FormData();
|
|
15877
|
+
data.append("file", item);
|
|
15878
|
+
data.append("uid", uid);
|
|
15879
|
+
data.append("name", item.name);
|
|
15880
|
+
data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size, meta: fileListItem.meta }));
|
|
15881
|
+
try {
|
|
15882
|
+
fileListItem.xhr = await this.makeXHRPostRequest(data);
|
|
15883
|
+
}
|
|
15884
|
+
catch (e) {
|
|
15885
|
+
// in case one of the global maxes have been reached, invalidate the file
|
|
15886
|
+
this.updateValueInMap(item.name, "valid", false, false);
|
|
15887
|
+
}
|
|
15888
|
+
}
|
|
15889
|
+
// kick the stat to force update
|
|
15890
|
+
this.kick();
|
|
15891
|
+
}
|
|
15892
|
+
}
|
|
15893
|
+
// reset the form, so that a user may upload a file again (with the same name)
|
|
15894
|
+
this.resetFormFields();
|
|
15895
|
+
// reset the internal metaData state
|
|
15896
|
+
this.metaData = undefined;
|
|
15897
|
+
this.duetChange.emit({
|
|
15898
|
+
originalEvent: ev,
|
|
15899
|
+
data: { files: this.files },
|
|
15900
|
+
component: "duet-upload",
|
|
15901
|
+
});
|
|
15902
|
+
}
|
|
15903
|
+
/**
|
|
15904
|
+
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
15905
|
+
* `input.focus()`.
|
|
15906
|
+
*/
|
|
15907
|
+
async setFocus(options) {
|
|
15908
|
+
if (this.nativeInput) {
|
|
15909
|
+
this.nativeInput.focus(options);
|
|
15910
|
+
}
|
|
15911
|
+
return;
|
|
15912
|
+
}
|
|
15913
|
+
/**
|
|
15914
|
+
* Method for invoking the upload sequence
|
|
15915
|
+
*/
|
|
15916
|
+
async upload(metaData = undefined) {
|
|
15917
|
+
await this.setFocus();
|
|
15918
|
+
this.metaData = metaData;
|
|
15919
|
+
this.nativeInput.click();
|
|
15920
|
+
return;
|
|
15921
|
+
}
|
|
15922
|
+
/**
|
|
15923
|
+
* Get list of files, divided in errors and valid sections
|
|
15924
|
+
*/
|
|
15925
|
+
async getFiles() {
|
|
15926
|
+
if (!this.files || this.files.size === 0) {
|
|
15927
|
+
return false;
|
|
15928
|
+
}
|
|
15929
|
+
return this.getFilesAsArray();
|
|
15930
|
+
}
|
|
15931
|
+
/**
|
|
15932
|
+
* Convenience method for updating the value of a key:value inside an item in the files attribute
|
|
15933
|
+
*/
|
|
15934
|
+
async updateValue(item, key, value) {
|
|
15935
|
+
this.updateValueInMap(item, key, value);
|
|
15936
|
+
}
|
|
15937
|
+
/**
|
|
15938
|
+
* render() function
|
|
15939
|
+
* Always the last one in the class.
|
|
15940
|
+
*/
|
|
15941
|
+
render() {
|
|
15942
|
+
const identifier = this.identifier || this.uploadId;
|
|
15943
|
+
let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
|
|
15944
|
+
caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
|
|
15945
|
+
caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
|
|
15946
|
+
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: {
|
|
15947
|
+
"duet-upload-filelist-empty": !this.files.size,
|
|
15948
|
+
"duet-upload-filelist": true,
|
|
15949
|
+
"duet-upload-filelist-filled": this.files.size,
|
|
15950
|
+
}, 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.internalStatusMessageLabel })), !!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 => {
|
|
15951
|
+
this.nativeInput = input;
|
|
15952
|
+
}, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
15953
|
+
"duet-upload": true,
|
|
15954
|
+
}, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
|
|
15955
|
+
}
|
|
15956
|
+
get element() { return getElement(this); }
|
|
15957
|
+
static get watchers() { return {
|
|
15958
|
+
"valid": ["watchValidHandler"]
|
|
15959
|
+
}; }
|
|
15960
|
+
static get style() { return duetUploadCss; }
|
|
15961
|
+
static get cmpMeta() { return {
|
|
15962
|
+
"$flags$": 9,
|
|
15963
|
+
"$tagName$": "duet-upload",
|
|
15964
|
+
"$members$": {
|
|
15965
|
+
"accessibleActiveDescendant": [1, "accessible-active-descendant"],
|
|
15966
|
+
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
15967
|
+
"accessibleControls": [1, "accessible-controls"],
|
|
15968
|
+
"accessibleOwns": [1, "accessible-owns"],
|
|
15969
|
+
"external": [4],
|
|
15970
|
+
"hideButton": [4, "hide-upload-button"],
|
|
15971
|
+
"actions": [1],
|
|
15972
|
+
"uri": [1],
|
|
15973
|
+
"showLinks": [4, "show-links"],
|
|
15974
|
+
"caption": [1],
|
|
15975
|
+
"statusLabelDefaults": [1, "status-label-default"],
|
|
15976
|
+
"statusMessageLabel": [1, "status-message-label"],
|
|
15977
|
+
"buttonLabelDefaults": [1, "button-label-default"],
|
|
15978
|
+
"buttonLabel": [1, "button-label"],
|
|
15979
|
+
"accessibleButtonLabel": [1, "accessible-button-label"],
|
|
15980
|
+
"theme": [1025],
|
|
15981
|
+
"disabled": [516],
|
|
15982
|
+
"identifier": [1],
|
|
15983
|
+
"margin": [1],
|
|
15984
|
+
"required": [4],
|
|
15985
|
+
"groups": [1],
|
|
15986
|
+
"hideGroups": [4, "hide-table-labels"],
|
|
15987
|
+
"files": [1040],
|
|
15988
|
+
"valid": [1540],
|
|
15989
|
+
"labelDefaults": [1, "label-default"],
|
|
15990
|
+
"label": [1],
|
|
15991
|
+
"descriptionDefaults": [1, "description-default"],
|
|
15992
|
+
"description": [1],
|
|
15993
|
+
"fileListEmptyDefaults": [1, "list-empty-default"],
|
|
15994
|
+
"fileListEmpty": [1, "file-list-empty"],
|
|
15995
|
+
"error": [1],
|
|
15996
|
+
"name": [1],
|
|
15997
|
+
"maxBytes": [2, "max-bytes"],
|
|
15998
|
+
"maxBytesTotal": [2, "max-bytes-total"],
|
|
15999
|
+
"maxFiles": [2, "max-files"],
|
|
16000
|
+
"allowedExtensions": [1, "allowed-extensions"],
|
|
16001
|
+
"allowedMimetypes": [1, "allowed-mimetypes"],
|
|
16002
|
+
"multiple": [4],
|
|
16003
|
+
"limitSelection": [4, "limit-selection"],
|
|
16004
|
+
"value": [1025],
|
|
16005
|
+
"tick": [32],
|
|
16006
|
+
"setFocus": [64],
|
|
16007
|
+
"upload": [64],
|
|
16008
|
+
"getFiles": [64],
|
|
16009
|
+
"updateValue": [64]
|
|
16010
|
+
},
|
|
16011
|
+
"$listeners$": undefined,
|
|
16012
|
+
"$lazyBundleId$": "-",
|
|
16013
|
+
"$attrsToReflect$": [["disabled", "disabled"], ["valid", "valid"]]
|
|
16014
|
+
}; }
|
|
16015
|
+
}
|
|
16016
|
+
|
|
16017
|
+
class DuetUploadAriaStatus {
|
|
16018
|
+
constructor(hostRef) {
|
|
16019
|
+
registerInstance(this, hostRef);
|
|
16020
|
+
/**
|
|
16021
|
+
* State() variables
|
|
16022
|
+
*/
|
|
16023
|
+
this.statusMessage = null;
|
|
16024
|
+
/**
|
|
16025
|
+
* Status labels used in the component
|
|
16026
|
+
*/
|
|
16027
|
+
this.statusMessageLabel = null;
|
|
16028
|
+
/**
|
|
16029
|
+
* Adds accessible label that is read aloud
|
|
16030
|
+
*/
|
|
16031
|
+
this.accessibleAriaLive = "polite";
|
|
16032
|
+
/**
|
|
16033
|
+
* valid file amount
|
|
16034
|
+
*/
|
|
16035
|
+
this.valid = undefined;
|
|
16036
|
+
/**
|
|
16037
|
+
* total files
|
|
16038
|
+
*/
|
|
16039
|
+
this.total = undefined;
|
|
16040
|
+
/**
|
|
16041
|
+
* invalid file amount
|
|
16042
|
+
*/
|
|
16043
|
+
this.invalid = undefined;
|
|
16044
|
+
/**
|
|
16045
|
+
* valid file amount
|
|
16046
|
+
*/
|
|
16047
|
+
this.inprogress = undefined;
|
|
16048
|
+
/**
|
|
16049
|
+
* Private functions
|
|
16050
|
+
*/
|
|
16051
|
+
this.replacePlaceHolders = (statusString) => {
|
|
16052
|
+
const addFiles = (amount) => {
|
|
16053
|
+
return amount > 1 ? `${amount} ${this.statusMessageLabel.files}` : `${amount} ${this.statusMessageLabel.file}`;
|
|
16054
|
+
};
|
|
16055
|
+
return statusString
|
|
16056
|
+
.replace("{filesUploaded}", addFiles(this.valid))
|
|
16057
|
+
.replace("{filesInProgress}", addFiles(this.inprogress))
|
|
16058
|
+
.replace("{filesTotal}", addFiles(this.total))
|
|
16059
|
+
.replace("{filesWithErrors}", addFiles(this.invalid));
|
|
16060
|
+
};
|
|
16061
|
+
this.getStatusMessage = () => {
|
|
16062
|
+
const { done, inProgress, doneWithErrors, inProgressWithErrors } = this.statusMessageLabel;
|
|
16063
|
+
const hasErrors = this.invalid > 0;
|
|
16064
|
+
const isInProgress = this.inprogress > 0;
|
|
16065
|
+
const isInProgressWithErrors = this.inprogress > 0 && hasErrors;
|
|
16066
|
+
const isDone = this.valid === this.total && !isInProgress && !hasErrors;
|
|
16067
|
+
const isDoneWithErrors = this.valid + this.invalid === this.total && !isInProgress;
|
|
16068
|
+
if (isDone) {
|
|
16069
|
+
this.statusMessage = this.replacePlaceHolders(done);
|
|
16070
|
+
return;
|
|
16071
|
+
}
|
|
16072
|
+
else if (isInProgressWithErrors) {
|
|
16073
|
+
this.statusMessage = this.replacePlaceHolders(inProgressWithErrors);
|
|
16074
|
+
return;
|
|
16075
|
+
}
|
|
16076
|
+
else if (isInProgress) {
|
|
16077
|
+
this.statusMessage = this.replacePlaceHolders(inProgress);
|
|
16078
|
+
return;
|
|
16079
|
+
}
|
|
16080
|
+
else if (isDoneWithErrors) {
|
|
16081
|
+
this.statusMessage = this.replacePlaceHolders(doneWithErrors);
|
|
16082
|
+
return;
|
|
16083
|
+
}
|
|
16084
|
+
return;
|
|
16085
|
+
};
|
|
16086
|
+
}
|
|
16087
|
+
watchHandler(newValue, oldValue) {
|
|
16088
|
+
if (newValue !== oldValue) {
|
|
16089
|
+
this.getStatusMessage();
|
|
16090
|
+
}
|
|
16091
|
+
}
|
|
16092
|
+
/**
|
|
16093
|
+
* render() function
|
|
16094
|
+
* Always the last one in the class.
|
|
16095
|
+
*/
|
|
16096
|
+
render() {
|
|
16097
|
+
return (hAsync(Host, { role: "status", "aria-live": "assertive", "aria-atomic": "true", "aria-relevant": "all" }, hAsync("duet-visually-hidden", null, this.statusMessage)));
|
|
16098
|
+
}
|
|
16099
|
+
static get watchers() { return {
|
|
16100
|
+
"valid": ["watchHandler"],
|
|
16101
|
+
"invalid": ["watchHandler"],
|
|
16102
|
+
"inprogress": ["watchHandler"],
|
|
16103
|
+
"total": ["watchHandler"]
|
|
16104
|
+
}; }
|
|
16105
|
+
static get cmpMeta() { return {
|
|
16106
|
+
"$flags$": 9,
|
|
16107
|
+
"$tagName$": "duet-upload-aria-status",
|
|
16108
|
+
"$members$": {
|
|
16109
|
+
"statusMessageLabel": [16],
|
|
16110
|
+
"accessibleAriaLive": [1, "accessible-aria-live"],
|
|
16111
|
+
"valid": [2],
|
|
16112
|
+
"total": [2],
|
|
16113
|
+
"invalid": [2],
|
|
16114
|
+
"inprogress": [2],
|
|
16115
|
+
"statusMessage": [32]
|
|
16116
|
+
},
|
|
16117
|
+
"$listeners$": undefined,
|
|
16118
|
+
"$lazyBundleId$": "-",
|
|
16119
|
+
"$attrsToReflect$": []
|
|
16120
|
+
}; }
|
|
16121
|
+
}
|
|
16122
|
+
|
|
14311
16123
|
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}";
|
|
14312
16124
|
|
|
14313
16125
|
class DuetVisuallyHidden {
|
|
@@ -14345,6 +16157,9 @@ registerComponents([
|
|
|
14345
16157
|
DuetCookieConsent,
|
|
14346
16158
|
DuetDatePicker,
|
|
14347
16159
|
DuetDivider,
|
|
16160
|
+
DuetEditableTable,
|
|
16161
|
+
DuetEditableTableButton,
|
|
16162
|
+
DuetEditableTableItem,
|
|
14348
16163
|
DuetEmptyState,
|
|
14349
16164
|
DuetFieldset,
|
|
14350
16165
|
DuetFooter,
|
|
@@ -14366,6 +16181,7 @@ registerComponents([
|
|
|
14366
16181
|
DuetNotificationDrawer,
|
|
14367
16182
|
DuetNumberInput,
|
|
14368
16183
|
DuetParagraph,
|
|
16184
|
+
DuetProgress,
|
|
14369
16185
|
DuetRadio,
|
|
14370
16186
|
DuetRadioGroup,
|
|
14371
16187
|
DuetRangeSlider,
|
|
@@ -14381,6 +16197,8 @@ registerComponents([
|
|
|
14381
16197
|
DuetToggle,
|
|
14382
16198
|
DuetTooltip,
|
|
14383
16199
|
DuetTray,
|
|
16200
|
+
DuetUpload,
|
|
16201
|
+
DuetUploadAriaStatus,
|
|
14384
16202
|
DuetVisuallyHidden,
|
|
14385
16203
|
]);
|
|
14386
16204
|
|