@duetds/components 4.30.1 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hydrate/index.js +230 -1038
- package/lib/cjs/duet-alert.cjs.entry.js +4 -2
- package/lib/cjs/duet-badge.cjs.entry.js +2 -2
- package/lib/cjs/duet-button_2.cjs.entry.js +4 -3
- package/lib/cjs/duet-caption_4.cjs.entry.js +7 -8
- package/lib/cjs/duet-card.cjs.entry.js +4 -4
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +4 -3
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +22 -12
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- 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 +4 -4
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +25 -9
- package/lib/cjs/duet-hero.cjs.entry.js +6 -6
- package/lib/cjs/duet-icon.cjs.entry.js +3 -3
- package/lib/cjs/duet-input_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +8 -7
- package/lib/cjs/duet-notification_2.cjs.entry.js +6 -5
- package/lib/cjs/duet-number-input.cjs.entry.js +36 -15
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +2 -2
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-tab_2.cjs.entry.js +11 -5
- package/lib/cjs/duet-table.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +21 -10
- package/lib/cjs/duet-tray.cjs.entry.js +20 -9
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-7605778f.js → focus-utils-bd331feb.js} +1 -1
- package/lib/cjs/{index-0c949193.js → index-113c2add.js} +0 -3
- package/lib/cjs/{language-utils-70d6a9a4.js → language-utils-48b8860b.js} +23 -8
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/cjs/{string-utils-a6de43d8.js → string-utils-267e3dbb.js} +7 -0
- package/lib/collection/collection-manifest.json +0 -6
- package/lib/collection/components/duet-alert/duet-alert.js +10 -4
- package/lib/collection/components/duet-badge/duet-badge.css +1 -0
- package/lib/collection/components/duet-button/duet-button.js +7 -5
- package/lib/collection/components/duet-card/duet-card.css +10 -7
- package/lib/collection/components/duet-card/duet-card.js +3 -5
- package/lib/collection/components/duet-choice/duet-choice.js +5 -3
- package/lib/collection/components/duet-choice-group/duet-choice-group.css +1 -0
- package/lib/collection/components/duet-date-picker/duet-date-picker.css +1 -1
- package/lib/collection/components/duet-date-picker/duet-date-picker.js +73 -38
- package/lib/collection/components/duet-footer/duet-footer.js +7 -5
- package/lib/collection/components/duet-header/duet-header.js +46 -21
- package/lib/collection/components/duet-heading/duet-heading.css +1 -0
- package/lib/collection/components/duet-hero/duet-hero.js +14 -9
- package/lib/collection/components/duet-icon/icon-utils.js +1 -1
- package/lib/collection/components/duet-label/duet-label.css +2 -0
- package/lib/collection/components/duet-link/duet-link.js +10 -11
- package/lib/collection/components/duet-modal/duet-modal.js +16 -11
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +14 -9
- package/lib/collection/components/duet-number-input/duet-number-input.js +141 -17
- package/lib/collection/components/duet-tab-group/duet-tab-group.js +35 -4
- package/lib/collection/components/duet-tooltip/duet-tooltip.js +72 -10
- package/lib/collection/components/duet-tray/duet-tray.js +71 -9
- package/lib/collection/utils/fixture-utils.js +7 -5
- package/lib/collection/utils/language-utils.js +22 -8
- package/lib/collection/utils/string-utils.js +6 -0
- package/lib/custom-elements-bundle/index.d.ts +0 -6
- package/lib/custom-elements-bundle/index.js +224 -995
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/p-0058512b.js +4 -0
- package/lib/duet/p-0224db45.entry.js +4 -0
- package/lib/duet/{p-345ea4f2.system.entry.js → p-02ad46a0.system.entry.js} +1 -1
- package/lib/duet/{p-62806bb6.system.entry.js → p-07263910.system.entry.js} +1 -1
- package/lib/duet/{p-f82709ba.entry.js → p-1bfbc988.entry.js} +1 -1
- package/lib/duet/p-1cd7177f.entry.js +4 -0
- package/lib/duet/p-1cec5a70.system.entry.js +4 -0
- package/lib/duet/p-1e7222c2.entry.js +4 -0
- package/lib/duet/{p-c0b95b58.entry.js → p-202bbd70.entry.js} +1 -1
- package/lib/duet/{p-d1817efe.system.entry.js → p-22f56356.system.entry.js} +1 -1
- package/lib/duet/{p-f81d8534.entry.js → p-28b67b94.entry.js} +1 -1
- package/lib/duet/{p-b4374f0e.entry.js → p-33426ddc.entry.js} +1 -1
- package/lib/duet/p-33cf6ed1.entry.js +4 -0
- package/lib/duet/p-3d3f773d.system.entry.js +4 -0
- package/lib/duet/p-3e1ef509.system.entry.js +4 -0
- package/lib/duet/p-3f78a826.system.js +4 -0
- package/lib/duet/{p-2a1a9f9f.entry.js → p-44ffb960.entry.js} +1 -1
- package/lib/duet/{p-dee41056.system.entry.js → p-453955cc.system.entry.js} +1 -1
- package/lib/duet/{p-66dde4d2.entry.js → p-4670a654.entry.js} +1 -1
- package/lib/duet/p-47645ea8.system.entry.js +4 -0
- package/lib/duet/p-504dbf8f.system.entry.js +4 -0
- package/lib/duet/{p-62c294d6.system.entry.js → p-5230ee3c.system.entry.js} +1 -1
- package/lib/duet/{p-bbc229d8.system.entry.js → p-56e172f5.system.entry.js} +1 -1
- package/lib/duet/{p-de2be65b.system.js → p-57ea2576.system.js} +1 -1
- package/lib/duet/p-5aa0d34d.entry.js +4 -0
- package/lib/duet/p-5fc7e1f7.system.entry.js +4 -0
- package/lib/duet/{p-3dc9d15d.system.entry.js → p-605bc214.system.entry.js} +1 -1
- package/lib/duet/{p-4a7911fd.entry.js → p-60ab57d4.entry.js} +1 -1
- package/lib/duet/p-64109493.entry.js +4 -0
- package/lib/duet/{p-7e108b7e.entry.js → p-69a5dc6b.entry.js} +1 -1
- package/lib/duet/{p-8cfce39e.system.entry.js → p-6a230911.system.entry.js} +1 -1
- package/lib/duet/p-6a760b8a.entry.js +4 -0
- package/lib/duet/{p-c9303f9a.entry.js → p-6d2da245.entry.js} +1 -1
- package/lib/duet/{p-ceb75b35.system.entry.js → p-712e7dde.system.entry.js} +1 -1
- package/lib/duet/{p-f71f12ed.entry.js → p-746655ba.entry.js} +1 -1
- package/lib/duet/p-7b6db837.system.entry.js +4 -0
- package/lib/duet/p-7d080785.system.entry.js +4 -0
- package/lib/duet/{p-4095dba5.entry.js → p-82dc2e0b.entry.js} +1 -1
- package/lib/duet/p-8c8e82aa.system.js +4 -0
- package/lib/duet/{p-fc397e03.system.entry.js → p-8c980350.system.entry.js} +1 -1
- package/lib/duet/{p-1cfe38b1.system.entry.js → p-8cb47a70.system.entry.js} +1 -1
- package/lib/duet/{p-7ee52f58.entry.js → p-8f03c3eb.entry.js} +1 -1
- package/lib/duet/p-91fa68a5.js +4 -0
- package/lib/duet/{p-e26116e0.system.entry.js → p-92d38668.system.entry.js} +1 -1
- package/lib/duet/p-95626e7e.system.entry.js +4 -0
- package/lib/duet/p-96808a2e.system.entry.js +4 -0
- package/lib/duet/{p-8ffe1461.system.entry.js → p-96c103b2.system.entry.js} +1 -1
- package/lib/duet/p-986779fb.js +4 -0
- package/lib/duet/{p-35e45c19.system.js → p-9a945278.system.js} +1 -1
- package/lib/duet/{p-2d2c45f9.entry.js → p-9c94be45.entry.js} +1 -1
- package/lib/duet/p-9ce1baab.system.entry.js +4 -0
- package/lib/duet/p-9ff25646.entry.js +4 -0
- package/lib/duet/p-a1d12e94.system.entry.js +4 -0
- package/lib/duet/p-b03a46b6.entry.js +4 -0
- package/lib/duet/{p-a88df408.entry.js → p-b1b8e510.entry.js} +1 -1
- package/lib/duet/p-b694cbf5.system.js +4 -0
- package/lib/duet/p-b7e50cfa.entry.js +4 -0
- package/lib/duet/p-b82927b0.system.entry.js +4 -0
- package/lib/duet/{p-c3688975.entry.js → p-ba205dca.entry.js} +1 -1
- package/lib/duet/{p-f71e337e.system.entry.js → p-bcae23fc.system.entry.js} +1 -1
- package/lib/duet/{p-5c5bdb06.system.entry.js → p-be19c57b.system.entry.js} +1 -1
- package/lib/duet/{p-a321a98c.entry.js → p-c4737f88.entry.js} +1 -1
- package/lib/duet/p-c5beceed.js +4 -0
- package/lib/duet/{p-27d538f7.system.entry.js → p-c5f10483.system.entry.js} +1 -1
- package/lib/duet/{p-a6096b05.system.entry.js → p-d35fd913.system.entry.js} +1 -1
- package/lib/duet/p-d4b4bfa6.entry.js +4 -0
- package/lib/duet/p-d7623eb8.system.entry.js +4 -0
- package/lib/duet/{p-36007600.entry.js → p-dc85d2a4.entry.js} +1 -1
- package/lib/duet/p-de093c16.entry.js +4 -0
- package/lib/duet/p-de842863.entry.js +4 -0
- package/lib/duet/{p-59a07cf9.entry.js → p-e08b8909.entry.js} +1 -1
- package/lib/duet/p-e39471b6.entry.js +4 -0
- package/lib/duet/p-e834c8d5.system.entry.js +4 -0
- package/lib/duet/{p-ce1374a4.system.entry.js → p-ef45cfe9.system.entry.js} +1 -1
- package/lib/duet/{p-031c2cd8.system.entry.js → p-f0b1850a.system.entry.js} +1 -1
- package/lib/duet/p-f53c8019.entry.js +4 -0
- package/lib/duet/{p-4265de16.system.entry.js → p-f96c4093.system.entry.js} +1 -1
- package/lib/duet/p-fbd83d67.entry.js +4 -0
- package/lib/duet/{p-1c41525a.entry.js → p-fdecaf46.entry.js} +1 -1
- package/lib/esm/duet-alert.entry.js +4 -2
- package/lib/esm/duet-badge.entry.js +2 -2
- package/lib/esm/duet-button_2.entry.js +4 -3
- package/lib/esm/duet-caption_4.entry.js +7 -8
- package/lib/esm/duet-card.entry.js +4 -4
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +4 -3
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +22 -12
- package/lib/esm/duet-divider_2.entry.js +1 -1
- 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 +4 -4
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +25 -9
- package/lib/esm/duet-hero.entry.js +6 -6
- package/lib/esm/duet-icon.entry.js +3 -3
- package/lib/esm/duet-input_2.entry.js +2 -2
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +8 -7
- package/lib/esm/duet-notification_2.entry.js +6 -5
- package/lib/esm/duet-number-input.entry.js +36 -15
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +2 -2
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-tab_2.entry.js +11 -5
- package/lib/esm/duet-table.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +21 -10
- package/lib/esm/duet-tray.entry.js +20 -9
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-0b12f0df.js → focus-utils-1995e5a9.js} +1 -1
- package/lib/esm/{index-f70ddc7f.js → index-6e246691.js} +0 -3
- package/lib/esm/{language-utils-ab9c3afc.js → language-utils-d5c38f65.js} +23 -8
- package/lib/esm/loader.js +2 -2
- package/lib/esm/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +7 -1
- 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 +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +2 -2
- 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 +1 -1
- package/lib/esm-es5/duet-table.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/focus-utils-1995e5a9.js +4 -0
- package/lib/esm-es5/{index-f70ddc7f.js → index-6e246691.js} +1 -1
- package/lib/esm-es5/language-utils-d5c38f65.js +4 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +1 -1
- package/lib/html.html-data.json +4489 -0
- package/lib/types/components/duet-alert/duet-alert.d.ts +2 -1
- package/lib/types/components/duet-button/duet-button.d.ts +1 -1
- package/lib/types/components/duet-choice/duet-choice.d.ts +1 -1
- package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +13 -7
- package/lib/types/components/duet-footer/duet-footer.d.ts +1 -1
- package/lib/types/components/duet-header/duet-header.d.ts +21 -5
- package/lib/types/components/duet-hero/duet-hero.d.ts +3 -3
- package/lib/types/components/duet-link/duet-link.d.ts +2 -3
- package/lib/types/components/duet-modal/duet-modal.d.ts +3 -3
- package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +3 -3
- package/lib/types/components/duet-number-input/duet-number-input.d.ts +21 -0
- package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +6 -0
- package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +11 -0
- package/lib/types/components/duet-tray/duet-tray.d.ts +11 -0
- package/lib/types/components.d.ts +146 -384
- package/lib/types/utils/language-utils.d.ts +3 -2
- package/lib/types/utils/string-utils.d.ts +1 -0
- package/package.json +18 -14
- package/lib/cjs/duet-upload.cjs.entry.js +0 -866
- package/lib/collection/components/duet-upload/duet-upload-file-list.js +0 -49
- package/lib/collection/components/duet-upload/duet-upload-validators.js +0 -93
- package/lib/collection/components/duet-upload/duet-upload.css +0 -133
- package/lib/collection/components/duet-upload/duet-upload.js +0 -1440
- package/lib/collection/components/duet-upload/errorcodes.utils.js +0 -20
- package/lib/collection/components/duet-upload/mock.helpers.js +0 -91
- package/lib/collection/components/duet-upload/upload.helpers.js +0 -13
- package/lib/collection/components/duet-upload/xhr.helpers.js +0 -34
- package/lib/duet/p-0733c303.system.entry.js +0 -4
- package/lib/duet/p-095060cc.js +0 -4
- package/lib/duet/p-156864a1.system.entry.js +0 -4
- package/lib/duet/p-1911dfe7.system.entry.js +0 -4
- package/lib/duet/p-2834a302.entry.js +0 -4
- package/lib/duet/p-28a3d38f.system.entry.js +0 -4
- package/lib/duet/p-2a4d7c5b.system.entry.js +0 -4
- package/lib/duet/p-4289b543.entry.js +0 -4
- package/lib/duet/p-46a3ae43.system.js +0 -4
- package/lib/duet/p-4a38cf9d.entry.js +0 -4
- package/lib/duet/p-4be8e814.entry.js +0 -4
- package/lib/duet/p-591b2137.entry.js +0 -4
- package/lib/duet/p-5f70e318.entry.js +0 -4
- package/lib/duet/p-6c2729da.js +0 -4
- package/lib/duet/p-6f107847.system.entry.js +0 -4
- package/lib/duet/p-77a5fe4c.system.js +0 -4
- package/lib/duet/p-7809e78b.system.entry.js +0 -4
- package/lib/duet/p-7a36d76f.system.entry.js +0 -4
- package/lib/duet/p-884693f1.entry.js +0 -4
- package/lib/duet/p-8977b722.entry.js +0 -4
- package/lib/duet/p-89db3b94.entry.js +0 -4
- package/lib/duet/p-9381c2d4.entry.js +0 -4
- package/lib/duet/p-9a450c9a.entry.js +0 -4
- package/lib/duet/p-9bbfe606.system.entry.js +0 -4
- package/lib/duet/p-a0a066cb.system.entry.js +0 -4
- package/lib/duet/p-a89d5d7c.entry.js +0 -4
- package/lib/duet/p-b07055fd.system.entry.js +0 -4
- package/lib/duet/p-b456d684.system.entry.js +0 -4
- package/lib/duet/p-bd18c93f.js +0 -4
- package/lib/duet/p-bddb1c15.system.entry.js +0 -4
- package/lib/duet/p-c4d183e6.entry.js +0 -4
- package/lib/duet/p-cd4e8ccf.js +0 -4
- package/lib/duet/p-cf243bcb.system.entry.js +0 -4
- package/lib/duet/p-d37c8a05.system.js +0 -4
- package/lib/duet/p-d989af11.entry.js +0 -4
- package/lib/duet/p-e6128d82.system.entry.js +0 -4
- package/lib/duet/p-e86cdc17.entry.js +0 -4
- package/lib/duet/p-eadb29c7.entry.js +0 -4
- package/lib/duet/p-f30b14d6.system.entry.js +0 -4
- package/lib/duet/p-f79f8da1.entry.js +0 -4
- package/lib/esm/duet-upload.entry.js +0 -862
- package/lib/esm-es5/duet-upload.entry.js +0 -4
- package/lib/esm-es5/focus-utils-0b12f0df.js +0 -4
- package/lib/esm-es5/language-utils-ab9c3afc.js +0 -4
- package/lib/types/components/duet-upload/duet-upload-file-list.d.ts +0 -9
- package/lib/types/components/duet-upload/duet-upload-validators.d.ts +0 -12
- package/lib/types/components/duet-upload/duet-upload.d.ts +0 -311
- package/lib/types/components/duet-upload/errorcodes.utils.d.ts +0 -7
- package/lib/types/components/duet-upload/mock.helpers.d.ts +0 -2
- package/lib/types/components/duet-upload/upload.helpers.d.ts +0 -1
- package/lib/types/components/duet-upload/xhr.helpers.d.ts +0 -12
package/hydrate/index.js
CHANGED
|
@@ -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: false, 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,8 +5170,7 @@ 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 ), (
|
|
5174
|
-
n(), then(l, (() => updateComponent(e, s, t)));
|
|
5173
|
+
e.$queuedListeners$ = null)), (l = safeCall(s, "componentWillLoad"))) : (BUILD.cmpWillUpdate ), n(), then(l, (() => updateComponent(e, s, t)));
|
|
5175
5174
|
}, updateComponent = async (e, t, o) => {
|
|
5176
5175
|
const n = e.$hostElement$, s = createTime("update", e.$cmpMeta$.$tagName$), l = n["s-rc"];
|
|
5177
5176
|
o && attachStyles(e);
|
|
@@ -5538,6 +5537,51 @@ const cmpModules = new Map, getModule = e => {
|
|
|
5538
5537
|
isTesting: !1
|
|
5539
5538
|
}, styles = new Map;
|
|
5540
5539
|
|
|
5540
|
+
function isObject(maybeObj) {
|
|
5541
|
+
return Object.prototype.toString.call(maybeObj) === "[object Object]";
|
|
5542
|
+
}
|
|
5543
|
+
const parsePossibleJSON = (maybeJSON) => {
|
|
5544
|
+
if (Array.isArray(maybeJSON) || isObject(maybeJSON)) {
|
|
5545
|
+
return maybeJSON;
|
|
5546
|
+
}
|
|
5547
|
+
if (typeof maybeJSON === "string") {
|
|
5548
|
+
try {
|
|
5549
|
+
return JSON.parse(maybeJSON);
|
|
5550
|
+
}
|
|
5551
|
+
catch (e) {
|
|
5552
|
+
console.warn(e);
|
|
5553
|
+
}
|
|
5554
|
+
}
|
|
5555
|
+
// undefined is not a type in JSON,
|
|
5556
|
+
// so we use it here to signal invalid input
|
|
5557
|
+
return undefined;
|
|
5558
|
+
};
|
|
5559
|
+
/**
|
|
5560
|
+
* Format string, via simplistic sprintf equivalent
|
|
5561
|
+
* @example String.format('{0} is super, but {1} is best! {{0}}', 'Duet', 'Coffee'); -> "Duet is super, but Coffee ist best! {0}"
|
|
5562
|
+
*
|
|
5563
|
+
*/
|
|
5564
|
+
// @ts-ignore
|
|
5565
|
+
if (!String.format) {
|
|
5566
|
+
// @ts-ignore
|
|
5567
|
+
String.format = function (format) {
|
|
5568
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
5569
|
+
return format.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
|
|
5570
|
+
return curlyBrack == "{{" ? "{" : curlyBrack == "}}" ? "}" : args[index];
|
|
5571
|
+
});
|
|
5572
|
+
};
|
|
5573
|
+
}
|
|
5574
|
+
const MATCH_DISALLOWED_CHARS = /[^a-z0-9áéíóúñüöäå \.,_-]/gim;
|
|
5575
|
+
function sanitizeString$1(string) {
|
|
5576
|
+
return string.replace(MATCH_DISALLOWED_CHARS, "").trim();
|
|
5577
|
+
}
|
|
5578
|
+
const convertHtmlQuotes = string => {
|
|
5579
|
+
if (typeof string === "string") {
|
|
5580
|
+
return string.replace(/"/g, '"').replace(/'/g, '"');
|
|
5581
|
+
}
|
|
5582
|
+
return string;
|
|
5583
|
+
};
|
|
5584
|
+
|
|
5541
5585
|
const localeLookUpTable = {
|
|
5542
5586
|
fi: "fi-FI",
|
|
5543
5587
|
en: "en-GB",
|
|
@@ -5552,13 +5596,13 @@ const localeMonetarySignifierLookUpTable = {
|
|
|
5552
5596
|
};
|
|
5553
5597
|
const defLanguageArray = ["fi", "en", "sv"];
|
|
5554
5598
|
const defaultLanguage = "fi";
|
|
5555
|
-
const
|
|
5556
|
-
? document.documentElement.lang.toLowerCase()
|
|
5557
|
-
|
|
5599
|
+
const getCurrentLanguage = () => {
|
|
5600
|
+
return document.documentElement.lang ? document.documentElement.lang.toLowerCase() : defaultLanguage;
|
|
5601
|
+
};
|
|
5558
5602
|
const isOfTypeLanguage = (keyInput) => {
|
|
5559
5603
|
return defLanguageArray.includes(keyInput);
|
|
5560
5604
|
};
|
|
5561
|
-
const checkForLanguage = (languageString =
|
|
5605
|
+
const checkForLanguage = (languageString = getCurrentLanguage()) => {
|
|
5562
5606
|
if (isOfTypeLanguage(languageString)) {
|
|
5563
5607
|
return languageString;
|
|
5564
5608
|
}
|
|
@@ -5572,7 +5616,7 @@ const checkForLanguage = (languageString = currentLanguage) => {
|
|
|
5572
5616
|
* @param {string} lang=fi - "fi" | "sv" | "en"
|
|
5573
5617
|
* @default {string} "fi"
|
|
5574
5618
|
*/
|
|
5575
|
-
const getLanguage = (languageString =
|
|
5619
|
+
const getLanguage = (languageString = getCurrentLanguage()) => checkForLanguage(languageString);
|
|
5576
5620
|
/**
|
|
5577
5621
|
* Returns the current language and locale
|
|
5578
5622
|
* If language is not fi|sv|en it will default to "fi"
|
|
@@ -5590,21 +5634,34 @@ const getLocale = (lang) => {
|
|
|
5590
5634
|
}
|
|
5591
5635
|
throw new Error(`Locale for "${lang}" not found`);
|
|
5592
5636
|
};
|
|
5637
|
+
const sanitizeString = (string) => {
|
|
5638
|
+
const argIsString = typeof string === "string";
|
|
5639
|
+
if (argIsString) {
|
|
5640
|
+
try {
|
|
5641
|
+
return JSON.parse(convertHtmlQuotes(string));
|
|
5642
|
+
}
|
|
5643
|
+
catch (e) {
|
|
5644
|
+
console.log("getLocaleString received a string, that didnt parse to json object", string, e);
|
|
5645
|
+
}
|
|
5646
|
+
}
|
|
5647
|
+
return string;
|
|
5648
|
+
};
|
|
5593
5649
|
/**
|
|
5594
5650
|
* Returns the current string / object from a given translation object
|
|
5595
5651
|
* If language is not fi|sv|en it will default to "fi"
|
|
5596
5652
|
* special case where lang can be ALSO be "us" in addition to other types - if user decides to override local language
|
|
5597
|
-
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"}
|
|
5653
|
+
* @param {object} langObject - {fi: "finnish", sv: "swedish", en: "english"} | string will get JSON.parsed
|
|
5598
5654
|
* @param {boolean} languageOverride = false - in case you want to override the actual language set in html tag
|
|
5599
5655
|
* @default {object} {locale: "fi-FI", money: "€"}
|
|
5600
5656
|
* @returns {(string|Object)} given example contains {fi:"something"} and langua===fi this will return "something"
|
|
5601
5657
|
*/
|
|
5602
5658
|
const getLocaleString = (langObject, languageOverride) => {
|
|
5659
|
+
const obj = sanitizeString(langObject);
|
|
5603
5660
|
if (languageOverride) {
|
|
5604
|
-
return
|
|
5661
|
+
return obj[checkForLanguage(languageOverride)];
|
|
5605
5662
|
}
|
|
5606
5663
|
else {
|
|
5607
|
-
return
|
|
5664
|
+
return obj[getLanguage()];
|
|
5608
5665
|
}
|
|
5609
5666
|
};
|
|
5610
5667
|
|
|
@@ -5632,6 +5689,7 @@ class DuetAlert {
|
|
|
5632
5689
|
/**
|
|
5633
5690
|
* Property to change languageDefaults on the component.
|
|
5634
5691
|
* normally you would handle these strings on an application level and override @accessibleLabel when needed
|
|
5692
|
+
* @default {fi: "Sulje viesti", sv: "Stäng meddelandet", en: "Close the message"}
|
|
5635
5693
|
*/
|
|
5636
5694
|
this.accessibleLabelDefaults = {
|
|
5637
5695
|
fi: "Sulje viesti",
|
|
@@ -5714,7 +5772,7 @@ class DuetAlert {
|
|
|
5714
5772
|
"$tagName$": "duet-alert",
|
|
5715
5773
|
"$members$": {
|
|
5716
5774
|
"theme": [1025],
|
|
5717
|
-
"accessibleLabelDefaults": [
|
|
5775
|
+
"accessibleLabelDefaults": [1, "accessible-label-default"],
|
|
5718
5776
|
"accessibleLabel": [1, "accessible-label"],
|
|
5719
5777
|
"announcements": [4],
|
|
5720
5778
|
"icon": [1],
|
|
@@ -5732,7 +5790,7 @@ class DuetAlert {
|
|
|
5732
5790
|
}; }
|
|
5733
5791
|
}
|
|
5734
5792
|
|
|
5735
|
-
const duetBadgeCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-badge,*.sc-duet-badge::after,*.sc-duet-badge::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-badge-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:4px !important;margin-bottom:2px !important;display:inline-block;width:auto;vertical-align:middle}/*!@:host:last-child, :host:last-of-type*/.sc-duet-badge-h:last-child,.sc-duet-badge-h:last-of-type{margin-right:0 !important}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-badge-h{margin:0 !important}/*!@.duet-badge*/.duet-badge.sc-duet-badge{width:100%;padding:4.4444444444px 12px 5.4444444444px;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:0.75rem;font-style:normal;font-weight:600;line-height:1.25;color:#00294d;text-align:center;vertical-align:middle;background:#e6f1f7;border-radius:20rem}/*!@.duet-badge.duet-p-0*/.duet-badge.duet-p-0.sc-duet-badge{padding:0 !important}/*!@.duet-badge.duet-m-0*/.duet-badge.duet-m-0.sc-duet-badge{margin:0 !important}/*!@.duet-badge.duet-theme-turva*/.duet-badge.duet-theme-turva.sc-duet-badge{padding:5.4444444444px 12px 4.4444444444px;font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-weight:700;color:#171c3a;background:#e8e8eb}/*!@.duet-badge.warning*/.duet-badge.warning.sc-duet-badge{background:#fef3df}/*!@.duet-badge.warning.duet-theme-turva*/.duet-badge.warning.duet-theme-turva.sc-duet-badge{background:#fef1db}/*!@.duet-badge.danger*/.duet-badge.danger.sc-duet-badge{background:#fce9ef}/*!@.duet-badge.danger.duet-theme-turva*/.duet-badge.danger.duet-theme-turva.sc-duet-badge{background:#fceae7}/*!@.duet-badge.success*/.duet-badge.success.sc-duet-badge{background:#e6f3ef}/*!@.duet-badge.success.duet-theme-turva*/.duet-badge.success.duet-theme-turva.sc-duet-badge{background:#e6f3ed}";
|
|
5793
|
+
const duetBadgeCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-badge,*.sc-duet-badge::after,*.sc-duet-badge::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-badge-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:4px !important;margin-bottom:2px !important;display:inline-block;width:auto;vertical-align:middle}/*!@:host:last-child, :host:last-of-type*/.sc-duet-badge-h:last-child,.sc-duet-badge-h:last-of-type{margin-right:0 !important}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-badge-h{margin:0 !important}/*!@.duet-badge*/.duet-badge.sc-duet-badge{width:100%;padding:4.4444444444px 12px 5.4444444444px;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:0.75rem;font-style:normal;font-weight:600;line-height:1.25;color:#00294d;text-align:center;word-break:break-word;vertical-align:middle;background:#e6f1f7;border-radius:20rem}/*!@.duet-badge.duet-p-0*/.duet-badge.duet-p-0.sc-duet-badge{padding:0 !important}/*!@.duet-badge.duet-m-0*/.duet-badge.duet-m-0.sc-duet-badge{margin:0 !important}/*!@.duet-badge.duet-theme-turva*/.duet-badge.duet-theme-turva.sc-duet-badge{padding:5.4444444444px 12px 4.4444444444px;font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-weight:700;color:#171c3a;background:#e8e8eb}/*!@.duet-badge.warning*/.duet-badge.warning.sc-duet-badge{background:#fef3df}/*!@.duet-badge.warning.duet-theme-turva*/.duet-badge.warning.duet-theme-turva.sc-duet-badge{background:#fef1db}/*!@.duet-badge.danger*/.duet-badge.danger.sc-duet-badge{background:#fce9ef}/*!@.duet-badge.danger.duet-theme-turva*/.duet-badge.danger.duet-theme-turva.sc-duet-badge{background:#fceae7}/*!@.duet-badge.success*/.duet-badge.success.sc-duet-badge{background:#e6f3ef}/*!@.duet-badge.success.duet-theme-turva*/.duet-badge.success.duet-theme-turva.sc-duet-badge{background:#e6f3ed}";
|
|
5736
5794
|
|
|
5737
5795
|
class DuetBadge {
|
|
5738
5796
|
constructor(hostRef) {
|
|
@@ -6179,7 +6237,7 @@ class DuetButton {
|
|
|
6179
6237
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
6180
6238
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
6181
6239
|
*/
|
|
6182
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
6240
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
6183
6241
|
/**
|
|
6184
6242
|
* Icon to display to the left of the button content.
|
|
6185
6243
|
* This is ignored/overridden when button is used as an external link.
|
|
@@ -6365,7 +6423,7 @@ class DuetButton {
|
|
|
6365
6423
|
"submit": [516],
|
|
6366
6424
|
"external": [4],
|
|
6367
6425
|
"language": [1],
|
|
6368
|
-
"accessibleLabelExternalDefaults": [
|
|
6426
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
6369
6427
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
6370
6428
|
"icon": [1],
|
|
6371
6429
|
"color": [1],
|
|
@@ -6459,46 +6517,7 @@ const isQuestionKey = (e) => e.key === "?";
|
|
|
6459
6517
|
const isEnterKey = (e) => e.key === "Enter" || e.keyCode === 13;
|
|
6460
6518
|
const isKeyboardClick = (e) => isEnterKey(e) || isSpaceKey(e);
|
|
6461
6519
|
|
|
6462
|
-
function isObject(maybeObj) {
|
|
6463
|
-
return Object.prototype.toString.call(maybeObj) === "[object Object]";
|
|
6464
|
-
}
|
|
6465
|
-
const parsePossibleJSON = (maybeJSON) => {
|
|
6466
|
-
if (Array.isArray(maybeJSON) || isObject(maybeJSON)) {
|
|
6467
|
-
return maybeJSON;
|
|
6468
|
-
}
|
|
6469
|
-
if (typeof maybeJSON === "string") {
|
|
6470
|
-
try {
|
|
6471
|
-
return JSON.parse(maybeJSON);
|
|
6472
|
-
}
|
|
6473
|
-
catch (e) {
|
|
6474
|
-
console.warn(e);
|
|
6475
|
-
}
|
|
6476
|
-
}
|
|
6477
|
-
// undefined is not a type in JSON,
|
|
6478
|
-
// so we use it here to signal invalid input
|
|
6479
|
-
return undefined;
|
|
6480
|
-
};
|
|
6481
|
-
/**
|
|
6482
|
-
* Format string, via simplistic sprintf equivalent
|
|
6483
|
-
* @example String.format('{0} is super, but {1} is best! {{0}}', 'Duet', 'Coffee'); -> "Duet is super, but Coffee ist best! {0}"
|
|
6484
|
-
*
|
|
6485
|
-
*/
|
|
6486
|
-
// @ts-ignore
|
|
6487
|
-
if (!String.format) {
|
|
6488
|
-
// @ts-ignore
|
|
6489
|
-
String.format = function (format) {
|
|
6490
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
6491
|
-
return format.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
|
|
6492
|
-
return curlyBrack == "{{" ? "{" : curlyBrack == "}}" ? "}" : args[index];
|
|
6493
|
-
});
|
|
6494
|
-
};
|
|
6495
|
-
}
|
|
6496
|
-
const MATCH_DISALLOWED_CHARS = /[^a-z0-9áéíóúñüöäå \.,_-]/gim;
|
|
6497
|
-
function sanitizeString(string) {
|
|
6498
|
-
return string.replace(MATCH_DISALLOWED_CHARS, "").trim();
|
|
6499
|
-
}
|
|
6500
|
-
|
|
6501
|
-
const duetCardCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-card,*.sc-duet-card::after,*.sc-duet-card::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-card-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:flex;width:100%;vertical-align:top}/*!@:host(.duet-card-info)*/.duet-card-info.sc-duet-card-h{margin-bottom:16px !important}/*!@:host(.duet-m-0)*/.duet-m-0.sc-duet-card-h{margin:0 !important}/*!@.duet-card*/.duet-card.sc-duet-card{padding:20px !important;position:relative;display:block;width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-style:normal;font-weight:400;line-height:1.5;color:#00294d;text-decoration:none;border-radius:4px;box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}/*!@.duet-card.duet-p-0*/.duet-card.duet-p-0.sc-duet-card{padding:0 !important}/*!@.duet-card.duet-m-0*/.duet-card.duet-m-0.sc-duet-card{margin:0 !important}/*!@.duet-card:focus*/.duet-card.sc-duet-card:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}/*!@.duet-theme-turva .duet-card:focus, .duet-card:focus.duet-theme-turva*/.duet-theme-turva.sc-duet-card .duet-card.sc-duet-card:focus,.duet-card.sc-duet-card:focus.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}@media (min-width: 36em){/*!@.duet-card*/.duet-card.sc-duet-card{padding:28px !important}}/*!@.duet-card.duet-theme-turva*/.duet-card.duet-theme-turva.sc-duet-card{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a;box-shadow:0 2px 6px 0 rgba(117, 117, 117, 0.13), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07)}@media (min-width: 36em){/*!@.duet-card.x-small*/.duet-card.x-small.sc-duet-card{padding:20px !important}}@media (min-width: 36em){/*!@.duet-card.medium*/.duet-card.medium.sc-duet-card{padding:28px !important}}@media (min-width: 48em){/*!@.duet-card.medium*/.duet-card.medium.sc-duet-card{padding:36px !important}}@media (min-width: 36em){/*!@.duet-card.large*/.duet-card.large.sc-duet-card{padding:36px !important}}@media (min-width: 48em){/*!@.duet-card.large*/.duet-card.large.sc-duet-card{padding:48px !important}}@media (min-width: 36em){/*!@.duet-card.x-large*/.duet-card.x-large.sc-duet-card{padding:48px !important}}@media (min-width: 48em){/*!@.duet-card.x-large*/.duet-card.x-large.sc-duet-card{padding:72px !important}}/*!@.duet-card.duet-card-collapsed*/.duet-card.duet-card-collapsed.sc-duet-card{padding-bottom:0 !important}@media (min-width: 36em){/*!@.duet-card.duet-card-collapsed*/.duet-card.duet-card-collapsed.sc-duet-card{padding-bottom:0 !important}}/*!@.duet-card.info*/.duet-card.info.sc-duet-card{background:rgba(0, 80, 128, 0.04) !important;box-shadow:none}/*!@.duet-card.info.duet-theme-turva*/.duet-card.info.duet-theme-turva.sc-duet-card{background:rgba(23, 28, 58, 0.035) !important}/*!@.duet-card.plain*/.duet-card.plain.sc-duet-card{box-shadow:none}/*!@.duet-card.plain:not(.duet-card-has-bg)*/.duet-card.plain.sc-duet-card:not(.duet-card-has-bg){background:transparent !important}/*!@.duet-card-heading-grid*/.duet-card-heading-grid.sc-duet-card{display:flex;align-items:center}/*!@.duet-card-heading-grid .expand*/.duet-card-heading-grid.sc-duet-card .expand.sc-duet-card{flex:1}/*!@.duet-card-heading-text*/.duet-card-heading-text.sc-duet-card{overflow:hidden;text-overflow:ellipsis}/*!@.duet-card-secondary-heading*/.duet-card-secondary-heading.sc-duet-card{font-size:1rem;font-weight:600}/*!@.duet-card-heading*/.duet-card-heading.sc-duet-card{position:relative;display:block;padding:16px 20px;margin:-20px -20px 20px;overflow:hidden;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1.25rem;font-weight:800;color:#00294d;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #e1e3e6}@media (min-width: 36em){/*!@.duet-card-heading*/.duet-card-heading.sc-duet-card{padding:15px 28px 16px !important;margin:-28px -28px 20px}}/*!@.duet-card-heading[role=button]*/.duet-card-heading[role=button].sc-duet-card{-webkit-user-select:none;user-select:none;cursor:pointer;border-radius:4px;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;appearance:none}/*!@.duet-card-heading[role=button]:focus*/.duet-card-heading[role=button].sc-duet-card:focus{outline:0}/*!@:host(.user-is-tabbing) .duet-card-heading[role=button]:focus*/.user-is-tabbing.sc-duet-card-h .duet-card-heading[role=button].sc-duet-card:focus{border-radius:4px;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}/*!@:host(.user-is-tabbing) .duet-theme-turva .duet-card-heading[role=button]:focus*/.user-is-tabbing.sc-duet-card-h .duet-theme-turva.sc-duet-card .duet-card-heading[role=button].sc-duet-card:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}/*!@.duet-card-collapsed .duet-card-heading*/.duet-card-collapsed.sc-duet-card .duet-card-heading.sc-duet-card{margin-bottom:0 !important;border-bottom:0 !important}/*!@.duet-theme-turva .duet-card-heading*/.duet-theme-turva.sc-duet-card .duet-card-heading.sc-duet-card{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a;border-color:#e4e4e6}@media (min-width: 36em){/*!@.x-small .duet-card-heading*/.x-small.sc-duet-card .duet-card-heading.sc-duet-card{padding:10px 20px 11px !important;margin:-20px -20px 20px}}@media (min-width: 48em){/*!@.x-small .duet-card-heading*/.x-small.sc-duet-card .duet-card-heading.sc-duet-card{padding:10px 20px 11px !important;margin:-20px -20px 20px}}/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{padding:15px 28px 16px !important;margin:-28px -28px 20px}}@media (min-width: 48em){/*!@.medium .duet-card-heading*/.medium.sc-duet-card .duet-card-heading.sc-duet-card{padding:19px 36px 20px !important;margin:-36px -36px 28px}}/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{padding:19px 36px 20px !important;margin:-36px -36px 28px}}@media (min-width: 48em){/*!@.large .duet-card-heading*/.large.sc-duet-card .duet-card-heading.sc-duet-card{padding:26px 48px 27px !important;margin:-48px -48px 36px}}/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{margin:-20px -20px 20px}@media (min-width: 36em){/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{padding:26px 48px 27px !important;margin:-48px -48px 36px}}@media (min-width: 48em){/*!@.x-large .duet-card-heading*/.x-large.sc-duet-card .duet-card-heading.sc-duet-card{padding:39px 72px 40px !important;margin:-72px -72px 48px}}/*!@.none .duet-card-heading*/.none.sc-duet-card .duet-card-heading.sc-duet-card{padding:0 0 20px !important;margin:0 0 20px}/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{padding:20px;margin:20px -20px -20px;font-size:0.875rem;line-height:1.25;background:#f5f8fa;border-bottom-right-radius:4px;border-bottom-left-radius:4px}/*!@.duet-theme-turva .duet-card-footer*/.duet-theme-turva.sc-duet-card .duet-card-footer.sc-duet-card{background:#f5f5f7}@media (min-width: 36em){/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){/*!@.duet-card-footer*/.duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 36em){/*!@.x-small .duet-card-footer*/.x-small.sc-duet-card .duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;padding-left:20px !important;margin:20px -20px -20px}}@media (min-width: 36em){/*!@.medium .duet-card-footer*/.medium.sc-duet-card .duet-card-footer.sc-duet-card{padding:15px 28px 16px !important;margin:20px -28px -28px}}@media (min-width: 48em){/*!@.medium .duet-card-footer*/.medium.sc-duet-card .duet-card-footer.sc-duet-card{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 36em){/*!@.large .duet-card-footer*/.large.sc-duet-card .duet-card-footer.sc-duet-card{padding:19px 36px 20px !important;margin:28px -36px -36px}}@media (min-width: 48em){/*!@.large .duet-card-footer*/.large.sc-duet-card .duet-card-footer.sc-duet-card{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 36em){/*!@.x-large .duet-card-footer*/.x-large.sc-duet-card .duet-card-footer.sc-duet-card{padding:26px 48px 27px !important;margin:36px -48px -48px}}@media (min-width: 48em){/*!@.x-large .duet-card-footer*/.x-large.sc-duet-card .duet-card-footer.sc-duet-card{padding:39px 72px 40px !important;margin:48px -72px -72px}}/*!@.none .duet-card-footer*/.none.sc-duet-card .duet-card-footer.sc-duet-card{padding:12px 0 !important;margin:20px 0 0}/*!@.duet-card-content*/.duet-card-content.sc-duet-card{width:100%}/*!@.duet-card-collapsed .duet-card-content*/.duet-card-collapsed.sc-duet-card .duet-card-content.sc-duet-card{display:none}/*!@.duet-card-caret*/.duet-card-caret.sc-duet-card{transition:300ms ease}/*!@[aria-expanded=false] .duet-card-caret*/[aria-expanded=false].sc-duet-card .duet-card-caret.sc-duet-card{transform:rotate(-180deg)}/*!@.duet-card-image-mask*/.duet-card-image-mask.sc-duet-card{position:relative;width:calc(100% + 40px);margin:-20px 0 20px -20px;overflow:hidden;border-top-left-radius:4px;border-top-right-radius:4px}@media (min-width: 36em){/*!@.small .duet-card-image-mask*/.small.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 36em){/*!@.medium .duet-card-image-mask*/.medium.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 56px);margin:-28px 0 28px -28px}}@media (min-width: 48em){/*!@.medium .duet-card-image-mask*/.medium.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 72px);margin:-36px 0 28px -36px}}@media (min-width: 36em){/*!@.large .duet-card-image-mask*/.large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 72px);margin:-36px 0 36px -36px}}@media (min-width: 48em){/*!@.large .duet-card-image-mask*/.large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 36em){/*!@.x-large .duet-card-image-mask*/.x-large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 96px);margin:-48px 0 36px -48px}}@media (min-width: 48em){/*!@.x-large .duet-card-image-mask*/.x-large.sc-duet-card .duet-card-image-mask.sc-duet-card{width:calc(100% + 144px);margin:-72px 0 36px -72px}}/*!@.none .duet-card-image-mask*/.none.sc-duet-card .duet-card-image-mask.sc-duet-card{width:100%;margin:0 0 20px}/*!@.duet-card-image*/.duet-card-image.sc-duet-card{display:block;width:102%;min-width:1px;max-width:102%;height:auto;min-height:1px;margin-left:-1%;transition:transform 300ms ease;transform:scale(1.0001)}/*!@a.duet-card*/a.duet-card.sc-duet-card{transition:box-shadow 300ms ease, background-position 300ms ease}/*!@a.duet-card:hover*/a.duet-card.sc-duet-card:hover{box-shadow:0 2px 6px 0 rgba(0, 41, 77, 0.07), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07), 0 2px 10px 0 rgba(0, 41, 77, 0.1)}/*!@a.duet-card:hover .duet-card-image*/a.duet-card.sc-duet-card:hover .duet-card-image.sc-duet-card{transform:scale(1.024)}/*!@.duet-theme-turva a.duet-card:hover*/.duet-theme-turva.sc-duet-card a.duet-card.sc-duet-card:hover{box-shadow:0 2px 6px 0 rgba(117, 117, 117, 0.13), 0 -1px 0 0 rgba(0, 0, 0, 0.09), -1px 0 0 0 rgba(0, 0, 0, 0.07), 1px 0 0 0 rgba(0, 0, 0, 0.07), 0 1px 0 0 rgba(0, 0, 0, 0.07), 0 2px 10px 0 rgba(117, 117, 117, 0.15)}/*!@a.duet-card:active*/a.duet-card.sc-duet-card:active{transition:none;transform:translateY(1px)}";
|
|
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)}";
|
|
6502
6521
|
|
|
6503
6522
|
/**
|
|
6504
6523
|
* @slot unnamed default slot - The component’s primary content. All child nodes that do not have a slot attribute defined are inserted into this primary slot.
|
|
@@ -6583,7 +6602,7 @@ class DuetCard {
|
|
|
6583
6602
|
this.hasFooter = !!this.element.querySelector("[slot='footer']");
|
|
6584
6603
|
}
|
|
6585
6604
|
renderHeading() {
|
|
6586
|
-
const HeadingTag = sanitizeString(this.headingLevel);
|
|
6605
|
+
const HeadingTag = sanitizeString$1(this.headingLevel);
|
|
6587
6606
|
const headingProps = this.collapsible
|
|
6588
6607
|
? {
|
|
6589
6608
|
role: "button",
|
|
@@ -6594,7 +6613,7 @@ class DuetCard {
|
|
|
6594
6613
|
onKeyDown: this.handleKeyDown,
|
|
6595
6614
|
}
|
|
6596
6615
|
: {};
|
|
6597
|
-
return (hAsync(HeadingTag, Object.assign({ class: "duet-card-heading" }, headingProps), hAsync("div", { class: "duet-card-heading-grid" }, this.icon && (hAsync(Fragment, null, hAsync("duet-icon", { class: "duet-card-icon", name: this.icon, size: "medium", margin: "none", color: "currentColor" }), hAsync("duet-spacer", { direction: "horizontal", size: "small" }))), hAsync("div", { class: "
|
|
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)));
|
|
6598
6617
|
}
|
|
6599
6618
|
/**
|
|
6600
6619
|
* Sets focus on the specified `duet-card`. Use this method instead of the global
|
|
@@ -7057,7 +7076,7 @@ class DuetChoice {
|
|
|
7057
7076
|
"$members$": {
|
|
7058
7077
|
"theme": [1025],
|
|
7059
7078
|
"label": [1],
|
|
7060
|
-
"accessibleLabelInfoButtonDefaults": [
|
|
7079
|
+
"accessibleLabelInfoButtonDefaults": [1, "accessible-label-info-default"],
|
|
7061
7080
|
"accessibleLabelInfoButton": [1, "accessible-label-info-button"],
|
|
7062
7081
|
"accessibleActiveDescendant": [1, "accessible-active-descendant"],
|
|
7063
7082
|
"accessibleControls": [1, "accessible-controls"],
|
|
@@ -7121,7 +7140,7 @@ const findCheckedOption = (el, tagName) => {
|
|
|
7121
7140
|
return options.find((o) => o.checked === true);
|
|
7122
7141
|
};
|
|
7123
7142
|
|
|
7124
|
-
const duetChoiceGroupCss = "*.sc-duet-choice-group,*.sc-duet-choice-group::after,*.sc-duet-choice-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:flex}}.horizontal.sc-duet-choice-group-h .duet-choice-group.duet-no-stacking.sc-duet-choice-group{display:flex}.duet-choice-group.sc-duet-choice-group{position:relative;width:100%;margin-bottom:-12px}";
|
|
7143
|
+
const duetChoiceGroupCss = "*.sc-duet-choice-group,*.sc-duet-choice-group::after,*.sc-duet-choice-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:flex;margin-bottom:0}}.horizontal.sc-duet-choice-group-h .duet-choice-group.duet-no-stacking.sc-duet-choice-group{display:flex}.duet-choice-group.sc-duet-choice-group{position:relative;width:100%;margin-bottom:-12px}";
|
|
7125
7144
|
|
|
7126
7145
|
class DuetChoiceGroup {
|
|
7127
7146
|
constructor(hostRef) {
|
|
@@ -7856,7 +7875,7 @@ class DuetCollapsible {
|
|
|
7856
7875
|
* Always the last one in the class.
|
|
7857
7876
|
*/
|
|
7858
7877
|
render() {
|
|
7859
|
-
const HeadingTagName = this.headingLevel ? sanitizeString(this.headingLevel) : "div";
|
|
7878
|
+
const HeadingTagName = this.headingLevel ? sanitizeString$1(this.headingLevel) : "div";
|
|
7860
7879
|
return (hAsync(Host, { class: { "duet-m-0": this.margin === "none" } }, hAsync(HeadingTagName, { class: {
|
|
7861
7880
|
"duet-collapsible-heading": true,
|
|
7862
7881
|
"duet-theme-turva": this.theme === "turva",
|
|
@@ -8333,7 +8352,7 @@ const DatePickerMonth = ({ selectedDate, focusedDate, labelledById, theme, langu
|
|
|
8333
8352
|
} }))))))))));
|
|
8334
8353
|
};
|
|
8335
8354
|
|
|
8336
|
-
const duetDatePickerCss = "*.sc-duet-date-picker,*.sc-duet-date-picker::after,*.sc-duet-date-picker::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-date-picker-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;position:relative;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:bottom}.sc-duet-date-picker-h:last-child,.sc-duet-date-picker-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-date-picker-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-date-picker-h{width:100% !important}.duet-m-0.sc-duet-date-picker-h{margin:0 !important}.duet-date.sc-duet-date-picker{position:relative;width:100%}.duet-date.sc-duet-date-picker button.sc-duet-date-picker,.duet-date-dialog.sc-duet-date-picker button.sc-duet-date-picker{max-width:initial !important;min-height:initial !important;padding:0 !important;margin:0 !important;transition:initial}.duet-date-button.sc-duet-date-picker{-webkit-user-select:none;user-select:none;position:absolute;top:1px;right:1px;z-index:200;display:flex;align-items:center;justify-content:center;width:48px;height:calc(100% - 2px);color:#00294d;cursor:pointer;background:transparent !important;border-left:1px solid #cfd2d4 !important;border-radius:0 4px 4px 0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker{color:#171c3a;border-color:#cfcfd1}.duet-date-button.sc-duet-date-picker::before{position:absolute;top:0;left:-6px;width:6px;height:100%;content:\"\";background:linear-gradient(to left, rgba(207, 210, 212, 0.2) 0%, rgba(207, 210, 212, 0.2) 1px, rgba(207, 210, 212, 0.1) 1px, rgba(207, 210, 212, 0) 100%)}.duet-date-button.sc-duet-date-picker:disabled{pointer-events:none;cursor:default;background:#f5f8fa !important;border:0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:disabled{background:#f5f5f7 !important}.duet-date-button.sc-duet-date-picker:disabled::before{display:none}.duet-date-button.sc-duet-date-picker:disabled duet-icon.sc-duet-date-picker{opacity:0.4}.duet-date-button.sc-duet-date-picker duet-icon.sc-duet-date-picker{transform:translateY(-1px)}.duet-date-button.sc-duet-date-picker:active duet-icon.sc-duet-date-picker{transform:translateY(0)}.duet-date-button.sc-duet-date-picker:focus{color:#0077b3;border-color:transparent;outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:focus{color:#171c3a;box-shadow:0 0 0 2px #171c3a}.duet-date-dialog.sc-duet-date-picker{position:absolute;top:100%;left:0;z-index:900;display:flex;width:100%;visibility:hidden;opacity:0;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right}@media (min-width: 36em){.duet-date-dialog.left.sc-duet-date-picker{right:0;left:auto;width:auto}}@media (max-width: 35.9375em){.duet-date-dialog.sc-duet-date-picker{position:fixed;top:0;right:0;bottom:0;background:rgba(0, 41, 77, 0.75);transition:opacity 400ms ease, visibility 400ms ease;transform:translateZ(0);transform-origin:bottom center}.duet-date-dialog.duet-theme-turva.sc-duet-date-picker{background:rgba(23, 28, 58, 0.75)}}.duet-date-dialog.active.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:scale(1.0001) translateZ(0) translateY(0)}@media (min-width: 36em){.duet-date-dialog.error.sc-duet-date-picker{top:calc(100% - 28px);margin-top:4px}}.duet-date-dialog-wrapper.sc-duet-date-picker{position:relative;z-index:600;width:100%;min-width:290px;max-width:310px;padding:16px 16px 20px;margin-top:8px;margin-left:auto;background:white;border:1px solid #e1e3e6;border-radius:4px;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);transform:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{border-color:#e4e4e6}@media (max-width: 35.9375em){.duet-date-dialog-wrapper.sc-duet-date-picker{position:absolute;bottom:0;left:0;z-index:900;max-width:none;min-height:25em;padding:0 8% 20px;margin:0;visibility:hidden;border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;opacity:0;transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;transform:translateZ(0) translateY(100%)}.active.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:translateZ(0) translateY(0)}}.duet-date-table.sc-duet-date-picker{width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;line-height:1.25;color:#00294d;text-align:center;border-spacing:0;border-collapse:collapse}.duet-date-table.duet-theme-turva.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}.duet-date-table.sc-duet-date-picker th.sc-duet-date-picker{padding-bottom:8px;font-size:0.75rem;font-weight:600;line-height:1.25;text-decoration:none;text-transform:uppercase;letter-spacing:1px}.duet-date-table.sc-duet-date-picker .duet-date-table-cell.sc-duet-date-picker{text-align:center}.duet-date-table-button.sc-duet-date-picker{position:relative;z-index:100;display:inline-block !important;width:36.9230769231px !important;height:36.9230769231px !important;min-height:initial !important;padding:0 !important;margin:0 !important;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:0.875rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.25 !important;color:#00294d !important;text-align:center;vertical-align:initial !important;cursor:pointer;background:transparent !important;border-radius:50% !important;transition:initial !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;color:#171c3a !important}.duet-date-table-button.sc-duet-date-picker:hover{background:#e6f2f8 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:hover{background:#f9e6ea !important}.duet-date-table-button.today.sc-duet-date-picker{z-index:200;color:#004d80 !important;background:#f3f9fc !important;box-shadow:0 0 0 1px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.today.sc-duet-date-picker{color:#940925 !important;background:#fcf3f4 !important;box-shadow:0 0 0 1px #c60c30 !important}.duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#0077b3 !important;outline:0}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#c60c30 !important}.duet-date-table-button.sc-duet-date-picker:active{z-index:200;color:white !important;background:#0077b3 !important;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:active{color:white !important;background:#c60c30 !important;box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.sc-duet-date-picker:focus{z-index:200;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.disabled.sc-duet-date-picker{color:#909599 !important;cursor:default;background:transparent !important;box-shadow:none !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.disabled.sc-duet-date-picker{color:#747475 !important;background:transparent !important;box-shadow:none !important}.duet-date-table-button.outside.sc-duet-date-picker{color:#909599 !important;pointer-events:none;cursor:default;background:#f5f8fa !important;box-shadow:none;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.outside.sc-duet-date-picker{color:#747475;background:#f5f5f7;box-shadow:none}.duet-date-dialog-header.sc-duet-date-picker{margin-bottom:16px !important;display:flex;align-items:center;justify-content:space-between;width:100%}.duet-date-dialog-buttons.sc-duet-date-picker{white-space:nowrap}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:auto !important;padding:0 !important;margin:0 0 0 8px !important;color:#00294d;cursor:pointer;background:#f5f8fa;border-radius:50%;transition:background-color 300ms ease !important}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{color:#171c3a;background:#f5f5f7}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker duet-icon.sc-duet-date-picker{display:block}@media (max-width: 35.9375em){.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{width:40px;height:40px}}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9ecee !important}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9e9eb !important}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#dddfe1;box-shadow:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#ddddde}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#909599;cursor:default;background:#f5f8fa;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#747475;background:#f5f5f7}.duet-date-dialog-select.sc-duet-date-picker{position:relative;display:inline-flex;margin-top:4px}.duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{position:relative;z-index:1;display:flex;align-items:center;width:100%;padding:0 8px;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1.25rem;font-weight:600;line-height:1.25;color:#00294d;pointer-events:none;border-radius:4px}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}.duet-date-dialog-select.sc-duet-date-picker span.sc-duet-date-picker{margin-right:4px}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;font-size:1rem;cursor:pointer;opacity:0}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-mobile-header.sc-duet-date-picker{position:relative;display:flex;align-items:center;justify-content:space-between;width:120%;padding:12px 20px;margin-bottom:20px;margin-left:-10%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #cfd2d4}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker{position:absolute;top:-8px;right:-8px;width:auto;padding:0;margin:0;overflow:visible;border:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-mobile-header.sc-duet-date-picker{border-color:#cfcfd1}.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:inline-block;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:none}}.duet-date-picker-close.sc-duet-date-picker{display:flex;align-items:center;justify-content:center;width:24px;height:24px !important;padding:0 !important;color:#00294d !important;cursor:pointer;background:#f5f8fa !important;border-radius:50%;-webkit-appearance:none;appearance:none}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker{opacity:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f8fa !important}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:focus{outline:none;box-shadow:0 0 0 2px #0077b3}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker:focus{opacity:1}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}";
|
|
8355
|
+
const duetDatePickerCss = "*.sc-duet-date-picker,*.sc-duet-date-picker::after,*.sc-duet-date-picker::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-date-picker-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;position:relative;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:top}.sc-duet-date-picker-h:last-child,.sc-duet-date-picker-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-date-picker-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-date-picker-h{width:100% !important}.duet-m-0.sc-duet-date-picker-h{margin:0 !important}.duet-date.sc-duet-date-picker{position:relative;width:100%}.duet-date.sc-duet-date-picker button.sc-duet-date-picker,.duet-date-dialog.sc-duet-date-picker button.sc-duet-date-picker{max-width:initial !important;min-height:initial !important;padding:0 !important;margin:0 !important;transition:initial}.duet-date-button.sc-duet-date-picker{-webkit-user-select:none;user-select:none;position:absolute;top:1px;right:1px;z-index:200;display:flex;align-items:center;justify-content:center;width:48px;height:calc(100% - 2px);color:#00294d;cursor:pointer;background:transparent !important;border-left:1px solid #cfd2d4 !important;border-radius:0 4px 4px 0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker{color:#171c3a;border-color:#cfcfd1}.duet-date-button.sc-duet-date-picker::before{position:absolute;top:0;left:-6px;width:6px;height:100%;content:\"\";background:linear-gradient(to left, rgba(207, 210, 212, 0.2) 0%, rgba(207, 210, 212, 0.2) 1px, rgba(207, 210, 212, 0.1) 1px, rgba(207, 210, 212, 0) 100%)}.duet-date-button.sc-duet-date-picker:disabled{pointer-events:none;cursor:default;background:#f5f8fa !important;border:0 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:disabled{background:#f5f5f7 !important}.duet-date-button.sc-duet-date-picker:disabled::before{display:none}.duet-date-button.sc-duet-date-picker:disabled duet-icon.sc-duet-date-picker{opacity:0.4}.duet-date-button.sc-duet-date-picker duet-icon.sc-duet-date-picker{transform:translateY(-1px)}.duet-date-button.sc-duet-date-picker:active duet-icon.sc-duet-date-picker{transform:translateY(0)}.duet-date-button.sc-duet-date-picker:focus{color:#0077b3;border-color:transparent;outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-button.sc-duet-date-picker:focus{color:#171c3a;box-shadow:0 0 0 2px #171c3a}.duet-date-dialog.sc-duet-date-picker{position:absolute;top:100%;left:0;z-index:900;display:flex;width:100%;visibility:hidden;opacity:0;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right}@media (min-width: 36em){.duet-date-dialog.left.sc-duet-date-picker{right:0;left:auto;width:auto}}@media (max-width: 35.9375em){.duet-date-dialog.sc-duet-date-picker{position:fixed;top:0;right:0;bottom:0;background:rgba(0, 41, 77, 0.75);transition:opacity 400ms ease, visibility 400ms ease;transform:translateZ(0);transform-origin:bottom center}.duet-date-dialog.duet-theme-turva.sc-duet-date-picker{background:rgba(23, 28, 58, 0.75)}}.duet-date-dialog.active.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:scale(1.0001) translateZ(0) translateY(0)}@media (min-width: 36em){.duet-date-dialog.error.sc-duet-date-picker{top:calc(100% - 28px);margin-top:4px}}.duet-date-dialog-wrapper.sc-duet-date-picker{position:relative;z-index:600;width:100%;min-width:290px;max-width:310px;padding:16px 16px 20px;margin-top:8px;margin-left:auto;background:white;border:1px solid #e1e3e6;border-radius:4px;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);transform:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{border-color:#e4e4e6}@media (max-width: 35.9375em){.duet-date-dialog-wrapper.sc-duet-date-picker{position:absolute;bottom:0;left:0;z-index:900;max-width:none;min-height:25em;padding:0 8% 20px;margin:0;visibility:hidden;border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;opacity:0;transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;transform:translateZ(0) translateY(100%)}.active.sc-duet-date-picker .duet-date-dialog-wrapper.sc-duet-date-picker{visibility:visible;opacity:1;transition-property:transform, opacity;transform:translateZ(0) translateY(0)}}.duet-date-table.sc-duet-date-picker{width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:400;line-height:1.25;color:#00294d;text-align:center;border-spacing:0;border-collapse:collapse}.duet-date-table.duet-theme-turva.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}.duet-date-table.sc-duet-date-picker th.sc-duet-date-picker{padding-bottom:8px;font-size:0.75rem;font-weight:600;line-height:1.25;text-decoration:none;text-transform:uppercase;letter-spacing:1px}.duet-date-table.sc-duet-date-picker .duet-date-table-cell.sc-duet-date-picker{text-align:center}.duet-date-table-button.sc-duet-date-picker{position:relative;z-index:100;display:inline-block !important;width:36.9230769231px !important;height:36.9230769231px !important;min-height:initial !important;padding:0 !important;margin:0 !important;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:0.875rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.25 !important;color:#00294d !important;text-align:center;vertical-align:initial !important;cursor:pointer;background:transparent !important;border-radius:50% !important;transition:initial !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;color:#171c3a !important}.duet-date-table-button.sc-duet-date-picker:hover{background:#e6f2f8 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:hover{background:#f9e6ea !important}.duet-date-table-button.today.sc-duet-date-picker{z-index:200;color:#004d80 !important;background:#f3f9fc !important;box-shadow:0 0 0 1px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.today.sc-duet-date-picker{color:#940925 !important;background:#fcf3f4 !important;box-shadow:0 0 0 1px #c60c30 !important}.duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#0077b3 !important;outline:0}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button[aria-pressed=true].sc-duet-date-picker,.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{color:white !important;background:#c60c30 !important}.duet-date-table-button.sc-duet-date-picker:active{z-index:200;color:white !important;background:#0077b3 !important;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:active{color:white !important;background:#c60c30 !important;box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.sc-duet-date-picker:focus{z-index:200;box-shadow:0 0 5px #0077b3 !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.sc-duet-date-picker:focus{box-shadow:0 0 5px #c60c30 !important}.duet-date-table-button.disabled.sc-duet-date-picker{color:#909599 !important;cursor:default;background:transparent !important;box-shadow:none !important}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.disabled.sc-duet-date-picker{color:#747475 !important;background:transparent !important;box-shadow:none !important}.duet-date-table-button.outside.sc-duet-date-picker{color:#909599 !important;pointer-events:none;cursor:default;background:#f5f8fa !important;box-shadow:none;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-table-button.outside.sc-duet-date-picker{color:#747475;background:#f5f5f7;box-shadow:none}.duet-date-dialog-header.sc-duet-date-picker{margin-bottom:16px !important;display:flex;align-items:center;justify-content:space-between;width:100%}.duet-date-dialog-buttons.sc-duet-date-picker{white-space:nowrap}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:auto !important;padding:0 !important;margin:0 0 0 8px !important;color:#00294d;cursor:pointer;background:#f5f8fa;border-radius:50%;transition:background-color 300ms ease !important}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{color:#171c3a;background:#f5f5f7}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker duet-icon.sc-duet-date-picker{display:block}@media (max-width: 35.9375em){.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker{width:40px;height:40px}}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9ecee !important}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:not(:disabled):hover{background:#e9e9eb !important}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{outline:0;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#dddfe1;box-shadow:none}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:active:focus{background:#ddddde}.duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#909599;cursor:default;background:#f5f8fa;opacity:0.75}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-buttons.sc-duet-date-picker button.sc-duet-date-picker:disabled{color:#747475;background:#f5f5f7}.duet-date-dialog-select.sc-duet-date-picker{position:relative;display:inline-flex;margin-top:4px}.duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{position:relative;z-index:1;display:flex;align-items:center;width:100%;padding:0 8px;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1.25rem;font-weight:600;line-height:1.25;color:#00294d;pointer-events:none;border-radius:4px}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker .duet-date-dialog-select-label.sc-duet-date-picker{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}.duet-date-dialog-select.sc-duet-date-picker span.sc-duet-date-picker{margin-right:4px}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;font-size:1rem;cursor:pointer;opacity:0}.duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #0077b3}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-select.sc-duet-date-picker select.sc-duet-date-picker:focus+.duet-date-dialog-select-label.sc-duet-date-picker{box-shadow:0 0 0 2px #171c3a}.duet-date-dialog-mobile-header.sc-duet-date-picker{position:relative;display:flex;align-items:center;justify-content:space-between;width:120%;padding:12px 20px;margin-bottom:20px;margin-left:-10%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #cfd2d4}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker{position:absolute;top:-8px;right:-8px;width:auto;padding:0;margin:0;overflow:visible;border:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-dialog-mobile-header.sc-duet-date-picker{border-color:#cfcfd1}.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:inline-block;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.duet-date-dialog-mobile-header.sc-duet-date-picker duet-label.sc-duet-date-picker{display:none}}.duet-date-picker-close.sc-duet-date-picker{display:flex;align-items:center;justify-content:center;width:24px;height:24px !important;padding:0 !important;color:#00294d !important;cursor:pointer;background:#f5f8fa !important;border-radius:50%;-webkit-appearance:none;appearance:none}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker{opacity:0}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f8fa !important}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:hover{background:#f5f5f7 !important}.duet-date-picker-close.sc-duet-date-picker:focus{outline:none;box-shadow:0 0 0 2px #0077b3}@media (min-width: 36em){.duet-date-picker-close.sc-duet-date-picker:focus{opacity:1}}.duet-theme-turva.sc-duet-date-picker .duet-date-picker-close.sc-duet-date-picker:focus{box-shadow:0 0 0 2px #171c3a}";
|
|
8337
8356
|
|
|
8338
8357
|
class DuetDatePicker {
|
|
8339
8358
|
constructor(hostRef) {
|
|
@@ -8374,11 +8393,27 @@ class DuetDatePicker {
|
|
|
8374
8393
|
* Controls the margin of the component.
|
|
8375
8394
|
*/
|
|
8376
8395
|
this.margin = "auto";
|
|
8396
|
+
/**
|
|
8397
|
+
* The currently active language. This setting changes the month/year/day
|
|
8398
|
+
* 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
|
|
8400
|
+
* @default "fi"
|
|
8401
|
+
*/
|
|
8402
|
+
this.language = getLanguage();
|
|
8403
|
+
/**
|
|
8404
|
+
* Placeholder defaults
|
|
8405
|
+
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
8406
|
+
*/
|
|
8407
|
+
this.placeholderDefaults = {
|
|
8408
|
+
fi: "pp.kk.vvvv",
|
|
8409
|
+
en: "dd.mm.yyyy",
|
|
8410
|
+
sv: "dd.mm.åååå",
|
|
8411
|
+
};
|
|
8377
8412
|
/**
|
|
8378
8413
|
* Hint text to display before the user types into the date picker input.
|
|
8379
8414
|
* @default { fi: "pp.kk.vvvv", en: "dd.mm.yyyy", sv: "dd.mm.åååå" }
|
|
8380
8415
|
*/
|
|
8381
|
-
this.placeholder = getLocaleString(
|
|
8416
|
+
this.placeholder = getLocaleString(this.placeholderDefaults, this.language);
|
|
8382
8417
|
/**
|
|
8383
8418
|
* If form input field has a placeholder text, and user types anything (causing the text to dissapear),
|
|
8384
8419
|
* settings this to true will "echo" it into the caption slot - this option will be false by default for the next few versions, but will eventually be true by default (scheduled for 4.30.0)
|
|
@@ -8389,13 +8424,6 @@ class DuetDatePicker {
|
|
|
8389
8424
|
* interact with the input, and conveys its inactive state to assistive technologies.
|
|
8390
8425
|
*/
|
|
8391
8426
|
this.disabled = false;
|
|
8392
|
-
/**
|
|
8393
|
-
* The currently active language. This setting changes the month/year/day
|
|
8394
|
-
* names and button labels as well as all screen reader labels.
|
|
8395
|
-
* @deprecated this is now handled via the html lang tag, and is no longer used - kept to avoid breaking changes and ease unit testing
|
|
8396
|
-
* @default "fi"
|
|
8397
|
-
*/
|
|
8398
|
-
this.language = getLanguage();
|
|
8399
8427
|
/**
|
|
8400
8428
|
* Display the date picker input in error state along with an error message.
|
|
8401
8429
|
*/
|
|
@@ -8740,10 +8768,11 @@ class DuetDatePicker {
|
|
|
8740
8768
|
"label": [1],
|
|
8741
8769
|
"caption": [1],
|
|
8742
8770
|
"margin": [1],
|
|
8771
|
+
"language": [1],
|
|
8772
|
+
"placeholderDefaults": [1, "placeholder-default"],
|
|
8743
8773
|
"placeholder": [1],
|
|
8744
8774
|
"echoPlaceholder": [1540, "echo-placeholder"],
|
|
8745
8775
|
"disabled": [516],
|
|
8746
|
-
"language": [1],
|
|
8747
8776
|
"error": [1],
|
|
8748
8777
|
"labelHidden": [4, "label-hidden"],
|
|
8749
8778
|
"role": [1],
|
|
@@ -9004,7 +9033,7 @@ class DuetFooter {
|
|
|
9004
9033
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
9005
9034
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
9006
9035
|
*/
|
|
9007
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
9036
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults, this.language);
|
|
9008
9037
|
/**
|
|
9009
9038
|
* Component event handling.
|
|
9010
9039
|
*/
|
|
@@ -9079,7 +9108,7 @@ class DuetFooter {
|
|
|
9079
9108
|
"logoHref": [1, "logo-href"],
|
|
9080
9109
|
"language": [1025],
|
|
9081
9110
|
"items": [8],
|
|
9082
|
-
"accessibleLabelExternalDefaults": [
|
|
9111
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
9083
9112
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
9084
9113
|
"menu": [8],
|
|
9085
9114
|
"processedItems": [32],
|
|
@@ -9518,10 +9547,26 @@ class DuetHeader {
|
|
|
9518
9547
|
*/
|
|
9519
9548
|
this.language = getLanguage();
|
|
9520
9549
|
/**
|
|
9521
|
-
*
|
|
9522
|
-
*
|
|
9550
|
+
* Default strings for accessibleI18nLabels
|
|
9551
|
+
* @default {
|
|
9552
|
+
fi: {
|
|
9553
|
+
skipLabel: "Siirry pääsisältöön",
|
|
9554
|
+
changeLanguage: "Vaihda kieltä",
|
|
9555
|
+
activeLanguage: "Suomi valittuna",
|
|
9556
|
+
},
|
|
9557
|
+
sv: {
|
|
9558
|
+
skipLabel: "Hoppa till huvudinnehåll",
|
|
9559
|
+
changeLanguage: "Ändra Språk",
|
|
9560
|
+
activeLanguage: "Svenska valt",
|
|
9561
|
+
},
|
|
9562
|
+
en: {
|
|
9563
|
+
skipLabel: "Skip to main content",
|
|
9564
|
+
changeLanguage: "Change language",
|
|
9565
|
+
activeLanguage: "English selected",
|
|
9566
|
+
},
|
|
9567
|
+
}
|
|
9523
9568
|
*/
|
|
9524
|
-
this.
|
|
9569
|
+
this.accessibleI18nLabelsDefaults = {
|
|
9525
9570
|
fi: {
|
|
9526
9571
|
skipLabel: "Siirry pääsisältöön",
|
|
9527
9572
|
changeLanguage: "Vaihda kieltä",
|
|
@@ -9558,7 +9603,7 @@ class DuetHeader {
|
|
|
9558
9603
|
},
|
|
9559
9604
|
}
|
|
9560
9605
|
*/
|
|
9561
|
-
this.accessibleI18nLabels = getLocaleString(this.
|
|
9606
|
+
this.accessibleI18nLabels = getLocaleString(this.accessibleI18nLabelsDefaults);
|
|
9562
9607
|
/**
|
|
9563
9608
|
* Property to change accessibleLabelExternal defaults on the component.
|
|
9564
9609
|
* normally you would handle these strings on an application level and override @accessibleLabelExternal when needed
|
|
@@ -9574,7 +9619,7 @@ class DuetHeader {
|
|
|
9574
9619
|
* Property to change accessibleLabel defaults on the component.
|
|
9575
9620
|
* normally you would handle these strings on an application level and override @accessibleLabel when needed
|
|
9576
9621
|
*/
|
|
9577
|
-
this.
|
|
9622
|
+
this.accessibleLabelDefaults = {
|
|
9578
9623
|
fi: "Valikko",
|
|
9579
9624
|
sv: "Meny",
|
|
9580
9625
|
en: "Menu",
|
|
@@ -9588,7 +9633,7 @@ class DuetHeader {
|
|
|
9588
9633
|
en: "Menu",
|
|
9589
9634
|
}
|
|
9590
9635
|
*/
|
|
9591
|
-
this.accessibleLabel = getLocaleString(this.
|
|
9636
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefaults);
|
|
9592
9637
|
/**
|
|
9593
9638
|
* URL that the logo link points to.
|
|
9594
9639
|
*/
|
|
@@ -9871,11 +9916,11 @@ class DuetHeader {
|
|
|
9871
9916
|
"$members$": {
|
|
9872
9917
|
"theme": [1025],
|
|
9873
9918
|
"language": [1025],
|
|
9874
|
-
"
|
|
9919
|
+
"accessibleI18nLabelsDefaults": [1, "accessible-labels-default"],
|
|
9875
9920
|
"accessibleI18nLabels": [16],
|
|
9876
|
-
"accessibleLabelExternalDefaults": [
|
|
9921
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
9877
9922
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
9878
|
-
"
|
|
9923
|
+
"accessibleLabelDefaults": [1, "accessible-label-default"],
|
|
9879
9924
|
"accessibleLabel": [1, "accessible-label"],
|
|
9880
9925
|
"user": [8],
|
|
9881
9926
|
"logoHref": [1, "logo-href"],
|
|
@@ -9906,7 +9951,7 @@ class DuetHeader {
|
|
|
9906
9951
|
}; }
|
|
9907
9952
|
}
|
|
9908
9953
|
|
|
9909
|
-
const duetHeadingCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-heading,*.sc-duet-heading::after,*.sc-duet-heading::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-heading-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;position:relative;display:block;width:100%}/*!@.duet-heading*/.duet-heading.sc-duet-heading{margin-bottom:16px !important;width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:normal;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.25;color:#00294d;text-decoration:none;letter-spacing:-0.01rem}@media (min-width: 36em){/*!@.duet-heading*/.duet-heading.sc-duet-heading{margin-bottom:20px !important}}/*!@.duet-heading.duet-theme-turva*/.duet-heading.duet-theme-turva.sc-duet-heading{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-style:italic;font-weight:700;color:#171c3a}/*!@.duet-heading.duet-heading-border*/.duet-heading.duet-heading-border.sc-duet-heading{padding-bottom:20px;border-bottom:1px solid #e1e3e6}/*!@.duet-heading.duet-heading-hyphenate*/.duet-heading.duet-heading-hyphenate.sc-duet-heading{-webkit-hyphens:auto;hyphens:auto}/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:9.4vw}/*!@.duet-heading.h0.duet-p-0*/.duet-heading.h0.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h0.duet-m-0*/.duet-heading.h0.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 31.914893617rem){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:3rem}}@media (min-width: 47.8723404255rem){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:4.5rem}}@media (max-width: 22.5em){/*!@.duet-heading.h0*/.duet-heading.h0.sc-duet-heading{font-size:2.25rem}}/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:7vw}/*!@.duet-heading.h1.duet-p-0*/.duet-heading.h1.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h1.duet-m-0*/.duet-heading.h1.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 32.1428571429rem){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:2.25rem}}@media (min-width: 42.8571428571rem){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:3rem}}@media (max-width: 22.5em){/*!@.duet-heading.h1*/.duet-heading.h1.sc-duet-heading{font-size:1.5rem}}/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:5.8vw}/*!@.duet-heading.h2.duet-p-0*/.duet-heading.h2.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h2.duet-m-0*/.duet-heading.h2.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 25.8620689655rem){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:1.5rem}}@media (min-width: 38.7931034483rem){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:2.25rem}}@media (max-width: 22.5em){/*!@.duet-heading.h2*/.duet-heading.h2.sc-duet-heading{font-size:1.375rem}}/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{margin-bottom:12px !important;font-size:4.2vw}/*!@.duet-heading.h3.duet-p-0*/.duet-heading.h3.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h3.duet-m-0*/.duet-heading.h3.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 29.7619047619rem){/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{font-size:1.25rem}}@media (min-width: 35.7142857143rem){/*!@.duet-heading.h3*/.duet-heading.h3.sc-duet-heading{font-size:1.5rem}}/*!@.duet-heading.h3.duet-theme-turva*/.duet-heading.h3.duet-theme-turva.sc-duet-heading{font-style:normal}/*!@.duet-heading.h3.duet-heading-border*/.duet-heading.h3.duet-heading-border.sc-duet-heading{padding-bottom:20px}/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{margin-bottom:8px !important;font-size:4vw;letter-spacing:0}/*!@.duet-heading.h4.duet-p-0*/.duet-heading.h4.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h4.duet-m-0*/.duet-heading.h4.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 27.5rem){/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{font-size:1.1rem}}@media (min-width: 31.25rem){/*!@.duet-heading.h4*/.duet-heading.h4.sc-duet-heading{font-size:1.25rem}}/*!@.duet-heading.h4.duet-theme-turva*/.duet-heading.h4.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h4.duet-heading-border*/.duet-heading.h4.duet-heading-border.sc-duet-heading{padding-bottom:20px}/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{margin-bottom:8px !important;font-size:4vw;font-weight:600;letter-spacing:0}/*!@.duet-heading.h5.duet-p-0*/.duet-heading.h5.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h5.duet-m-0*/.duet-heading.h5.duet-m-0.sc-duet-heading{margin:0 !important}@media (max-width: 27.5rem){/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{font-size:1.1rem}}@media (min-width: 28.4090909091rem){/*!@.duet-heading.h5*/.duet-heading.h5.sc-duet-heading{font-size:1.1363636364rem}}/*!@.duet-heading.h5.duet-theme-turva*/.duet-heading.h5.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h5.duet-heading-border*/.duet-heading.h5.duet-heading-border.sc-duet-heading{padding-bottom:16px}/*!@.duet-heading.h6*/.duet-heading.h6.sc-duet-heading{margin-bottom:8px !important;font-size:1rem;font-weight:600;letter-spacing:0}/*!@.duet-heading.h6.duet-p-0*/.duet-heading.h6.duet-p-0.sc-duet-heading{padding:0 !important}/*!@.duet-heading.h6.duet-m-0*/.duet-heading.h6.duet-m-0.sc-duet-heading{margin:0 !important}/*!@.duet-heading.h6.duet-theme-turva*/.duet-heading.h6.duet-theme-turva.sc-duet-heading{font-style:normal;font-weight:700}/*!@.duet-heading.h6.duet-heading-border*/.duet-heading.h6.duet-heading-border.sc-duet-heading{padding-bottom:16px}/*!@.duet-heading.duet-semibold, .duet-heading.duet-theme-turva.duet-semibold*/.duet-heading.duet-semibold.sc-duet-heading,.duet-heading.duet-theme-turva.duet-semibold.sc-duet-heading{font-style:normal !important;font-weight:600 !important}";
|
|
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}";
|
|
9910
9955
|
|
|
9911
9956
|
class DuetHeading {
|
|
9912
9957
|
constructor(hostRef) {
|
|
@@ -9953,7 +9998,7 @@ class DuetHeading {
|
|
|
9953
9998
|
* Always the last one in the class.
|
|
9954
9999
|
*/
|
|
9955
10000
|
render() {
|
|
9956
|
-
const TagName = sanitizeString(this.level);
|
|
10001
|
+
const TagName = sanitizeString$1(this.level);
|
|
9957
10002
|
const color = getColorByName(this.color);
|
|
9958
10003
|
return (hAsync(TagName, { class: {
|
|
9959
10004
|
"duet-heading": true,
|
|
@@ -10059,15 +10104,15 @@ class DuetHero {
|
|
|
10059
10104
|
*/
|
|
10060
10105
|
this.language = getLanguage();
|
|
10061
10106
|
/**
|
|
10062
|
-
*
|
|
10063
|
-
*
|
|
10107
|
+
* Defaults for accessibleLabelExternal
|
|
10108
|
+
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10064
10109
|
*/
|
|
10065
10110
|
this.accessibleLabelExternalDefaults = DuetStringsExternalDefaults;
|
|
10066
10111
|
/**
|
|
10067
10112
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
10068
10113
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10069
10114
|
*/
|
|
10070
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
10115
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
10071
10116
|
/**
|
|
10072
10117
|
* URL that the button links to.
|
|
10073
10118
|
*/
|
|
@@ -10211,7 +10256,7 @@ class DuetHero {
|
|
|
10211
10256
|
"categoryIconColor": [1, "category-icon-color"],
|
|
10212
10257
|
"buttonLabel": [1, "button-label"],
|
|
10213
10258
|
"language": [1025],
|
|
10214
|
-
"accessibleLabelExternalDefaults": [
|
|
10259
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
10215
10260
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
10216
10261
|
"buttonUrl": [1, "button-url"],
|
|
10217
10262
|
"buttonId": [1, "button-id"],
|
|
@@ -10660,7 +10705,7 @@ class DuetInput {
|
|
|
10660
10705
|
}; }
|
|
10661
10706
|
}
|
|
10662
10707
|
|
|
10663
|
-
const duetLabelCss = "*.sc-duet-label,*.sc-duet-label::after,*.sc-duet-label::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-label-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;position:relative;z-index:100;display:inline-flex;width:auto;margin-top:8px !important;line-height:1.25;cursor:default}.duet-p-0.sc-duet-label-h{padding:0 !important}.duet-m-0.sc-duet-label-h{margin:0 !important}.duet-m-0.sc-duet-label-h{margin-bottom:0 !important}.duet-small-margin.sc-duet-label-h{margin-top:8px !important;margin-bottom:4px !important}.duet-has-tooltip.sc-duet-label-h{padding-right:48px}@media (min-width: 48em){.duet-has-tooltip.sc-duet-label-h{padding-right:0}}label.sc-duet-label{margin:0;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:600 !important;line-height:1.25;color:#00294d;text-align:left}label.sc-duet-label span.sc-duet-label{font-size:1rem;font-weight:600 !important}.duet-label-small.sc-duet-label-h label.sc-duet-label{font-size:0.875rem}.duet-label-small.sc-duet-label-h label.sc-duet-label span.sc-duet-label{font-size:0.875rem}.duet-theme-turva.sc-duet-label-h label.sc-duet-label{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}";
|
|
10708
|
+
const duetLabelCss = "*.sc-duet-label,*.sc-duet-label::after,*.sc-duet-label::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-label-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;position:relative;z-index:100;display:inline-flex;width:auto;margin-top:8px !important;line-height:1.25;cursor:default}.duet-p-0.sc-duet-label-h{padding:0 !important}.duet-m-0.sc-duet-label-h{margin:0 !important}.duet-m-0.sc-duet-label-h{margin-bottom:0 !important}.duet-small-margin.sc-duet-label-h{margin-top:8px !important;margin-bottom:4px !important}.duet-has-tooltip.sc-duet-label-h{padding-right:48px}@media (min-width: 48em){.duet-has-tooltip.sc-duet-label-h{padding-right:0}}label.sc-duet-label{margin:0;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:600 !important;line-height:1.25;color:#00294d;text-align:left;word-break:break-word}label.sc-duet-label span.sc-duet-label{font-size:1rem;font-weight:600 !important;word-break:break-word}.duet-label-small.sc-duet-label-h label.sc-duet-label{font-size:0.875rem}.duet-label-small.sc-duet-label-h label.sc-duet-label span.sc-duet-label{font-size:0.875rem}.duet-theme-turva.sc-duet-label-h label.sc-duet-label{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}";
|
|
10664
10709
|
|
|
10665
10710
|
class DuetLabel {
|
|
10666
10711
|
constructor(hostRef) {
|
|
@@ -10826,8 +10871,7 @@ class DuetLink {
|
|
|
10826
10871
|
*/
|
|
10827
10872
|
this.language = getLanguage();
|
|
10828
10873
|
/**
|
|
10829
|
-
*
|
|
10830
|
-
* normally you would handle these strings on an application level and override @accessibleLabelExternal when needed
|
|
10874
|
+
* Defaults for accessibleLabelExternal
|
|
10831
10875
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10832
10876
|
*/
|
|
10833
10877
|
this.accessibleLabelExternalDefaults = DuetStringsExternalDefaults;
|
|
@@ -10835,7 +10879,7 @@ class DuetLink {
|
|
|
10835
10879
|
* Adds accessible label for tooltip that is shown in external link (url & external have both been set)
|
|
10836
10880
|
* @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
|
|
10837
10881
|
*/
|
|
10838
|
-
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults
|
|
10882
|
+
this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
|
|
10839
10883
|
/**
|
|
10840
10884
|
* Theme of the button.
|
|
10841
10885
|
*/
|
|
@@ -10881,7 +10925,7 @@ class DuetLink {
|
|
|
10881
10925
|
"$members$": {
|
|
10882
10926
|
"accessibleLabel": [1, "accessible-label"],
|
|
10883
10927
|
"language": [1025],
|
|
10884
|
-
"accessibleLabelExternalDefaults": [
|
|
10928
|
+
"accessibleLabelExternalDefaults": [1, "accessible-label-external-default"],
|
|
10885
10929
|
"accessibleLabelExternal": [1, "accessible-label-external"],
|
|
10886
10930
|
"identifier": [1],
|
|
10887
10931
|
"theme": [1025],
|
|
@@ -11203,10 +11247,10 @@ class DuetModal {
|
|
|
11203
11247
|
*/
|
|
11204
11248
|
this.language = getLanguage();
|
|
11205
11249
|
/**
|
|
11206
|
-
*
|
|
11207
|
-
*
|
|
11250
|
+
* Defaults for accessibleCloseLabel
|
|
11251
|
+
* @default {fi: "Sulje ikkuna", sv: "Stäng fönstret", en: "Close the dialog", }
|
|
11208
11252
|
*/
|
|
11209
|
-
this.
|
|
11253
|
+
this.accessibleCloseLabelDefaults = {
|
|
11210
11254
|
fi: "Sulje ikkuna",
|
|
11211
11255
|
sv: "Stäng fönstret",
|
|
11212
11256
|
en: "Close the dialog",
|
|
@@ -11217,7 +11261,7 @@ class DuetModal {
|
|
|
11217
11261
|
* Swedish translation for this property is “Stäng fönstret”.
|
|
11218
11262
|
* @default {fi: "Sulje ikkuna", sv: "Stäng fönstret", en: "Close the dialog", }
|
|
11219
11263
|
*/
|
|
11220
|
-
this.accessibleCloseLabel = getLocaleString(this.
|
|
11264
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefaults, this.language);
|
|
11221
11265
|
/**
|
|
11222
11266
|
* Size of the modal window.
|
|
11223
11267
|
*/
|
|
@@ -11384,7 +11428,7 @@ class DuetModal {
|
|
|
11384
11428
|
"$tagName$": "duet-modal",
|
|
11385
11429
|
"$members$": {
|
|
11386
11430
|
"language": [1025],
|
|
11387
|
-
"
|
|
11431
|
+
"accessibleCloseLabelDefaults": [1, "accessible-close-label-default"],
|
|
11388
11432
|
"accessibleCloseLabel": [1, "accessible-close-label"],
|
|
11389
11433
|
"size": [1],
|
|
11390
11434
|
"gutterSize": [1, "gutter-size"],
|
|
@@ -11519,8 +11563,8 @@ class DuetNotificationDrawer {
|
|
|
11519
11563
|
*/
|
|
11520
11564
|
this.language = getLanguage();
|
|
11521
11565
|
/**
|
|
11522
|
-
*
|
|
11523
|
-
*
|
|
11566
|
+
* Defaults for accessibleLabelNotifications
|
|
11567
|
+
* @default {en: "No notifications", fi: "Ei ilmoituksia", sv: "Inga notifikationer"}
|
|
11524
11568
|
*/
|
|
11525
11569
|
this.accessibleLabelNotificationsDefaults = {
|
|
11526
11570
|
en: "No notifications",
|
|
@@ -11531,7 +11575,7 @@ class DuetNotificationDrawer {
|
|
|
11531
11575
|
* Adds accessible label for tooltip that is shown for notifications
|
|
11532
11576
|
* @default {en: "No notifications", fi: "Ei ilmoituksia", sv: "Inga notifikationer"}
|
|
11533
11577
|
*/
|
|
11534
|
-
this.accessibleLabelNotifications = getLocaleString(this.accessibleLabelNotificationsDefaults
|
|
11578
|
+
this.accessibleLabelNotifications = getLocaleString(this.accessibleLabelNotificationsDefaults);
|
|
11535
11579
|
/**
|
|
11536
11580
|
* Show a badge that indicates something has changed.
|
|
11537
11581
|
*/
|
|
@@ -11634,7 +11678,7 @@ class DuetNotificationDrawer {
|
|
|
11634
11678
|
"icon": [1],
|
|
11635
11679
|
"label": [1],
|
|
11636
11680
|
"language": [1],
|
|
11637
|
-
"accessibleLabelNotificationsDefaults": [
|
|
11681
|
+
"accessibleLabelNotificationsDefaults": [1, "accessible-label-notification-default"],
|
|
11638
11682
|
"accessibleLabelNotifications": [1, "accessible-label-notifications"],
|
|
11639
11683
|
"badge": [4],
|
|
11640
11684
|
"theme": [1025],
|
|
@@ -11705,37 +11749,52 @@ class DuetNumberInput {
|
|
|
11705
11749
|
*/
|
|
11706
11750
|
this.unit = getLocale(this.language).money;
|
|
11707
11751
|
/**
|
|
11708
|
-
*
|
|
11709
|
-
* The string {current} is replaced with the current amount.
|
|
11752
|
+
* Defaults for accessibleLive
|
|
11710
11753
|
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
11711
11754
|
*/
|
|
11712
|
-
this.
|
|
11755
|
+
this.accessibleLiveDefaults = {
|
|
11713
11756
|
fi: "{current} euroa valittuna",
|
|
11714
11757
|
en: "{current} euros selected",
|
|
11715
11758
|
sv: "{current} euro valt",
|
|
11716
|
-
}
|
|
11759
|
+
};
|
|
11760
|
+
/**
|
|
11761
|
+
* Format of message used to announce current amount when switching between amounts.
|
|
11762
|
+
* The string {current} is replaced with the current amount.
|
|
11763
|
+
* @default {fi: "{current} euroa valittuna", en: "{current} euros selected", sv: "{current} valda euro"}
|
|
11764
|
+
*/
|
|
11765
|
+
this.accessibleLive = getLocaleString(this.accessibleLiveDefaults, this.language);
|
|
11717
11766
|
/**
|
|
11718
11767
|
* Disables the aria-live messaging used internally in this component. This could be useful when you want to use custom aria-live messages instead.
|
|
11719
11768
|
*/
|
|
11720
11769
|
this.accessibleLiveEnabled = true;
|
|
11721
11770
|
/**
|
|
11722
|
-
*
|
|
11771
|
+
* Defaults for accessibleAdd
|
|
11723
11772
|
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
11724
11773
|
*/
|
|
11725
|
-
this.
|
|
11774
|
+
this.accessibleAddDefaults = {
|
|
11726
11775
|
fi: "Lisää summaan",
|
|
11727
11776
|
en: "Add to the amount",
|
|
11728
11777
|
sv: "Lägg till beloppet",
|
|
11729
|
-
}
|
|
11778
|
+
};
|
|
11730
11779
|
/**
|
|
11731
|
-
* Accessible label for the
|
|
11780
|
+
* Accessible label for the add button that is read for screen reader users.
|
|
11781
|
+
* @default {fi: "Lisää summaan", en: "Add to the amount", sv: "Lägg till beloppet"}
|
|
11782
|
+
*/
|
|
11783
|
+
this.accessibleAdd = getLocaleString(this.accessibleAddDefaults, this.language);
|
|
11784
|
+
/**
|
|
11785
|
+
* Defaults for accessibleSubtract
|
|
11732
11786
|
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
11733
11787
|
*/
|
|
11734
|
-
this.
|
|
11788
|
+
this.accessibleSubtractDefaults = {
|
|
11735
11789
|
fi: "Vähennä summasta",
|
|
11736
11790
|
en: "Subtract from the amount",
|
|
11737
11791
|
sv: "Dra från beloppet",
|
|
11738
|
-
}
|
|
11792
|
+
};
|
|
11793
|
+
/**
|
|
11794
|
+
* Accessible label for the subtract button that is read for screen reader users.
|
|
11795
|
+
* @default {fi: "Vähennä summasta", en: "Subtract from the amount", sv: "Dra från beloppet"}
|
|
11796
|
+
*/
|
|
11797
|
+
this.accessibleSubtract = getLocaleString(this.accessibleSubtractDefaults, this.language);
|
|
11739
11798
|
/**
|
|
11740
11799
|
* Theme of the input.
|
|
11741
11800
|
*/
|
|
@@ -11753,14 +11812,19 @@ class DuetNumberInput {
|
|
|
11753
11812
|
*/
|
|
11754
11813
|
this.min = 0;
|
|
11755
11814
|
/**
|
|
11756
|
-
*
|
|
11815
|
+
* Defaults for Label
|
|
11757
11816
|
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
11758
11817
|
*/
|
|
11759
|
-
this.
|
|
11818
|
+
this.labelDefaults = {
|
|
11760
11819
|
fi: "Nimilappu",
|
|
11761
11820
|
en: "Label",
|
|
11762
11821
|
sv: "Etikett",
|
|
11763
|
-
}
|
|
11822
|
+
};
|
|
11823
|
+
/**
|
|
11824
|
+
* Label for the number input.
|
|
11825
|
+
* @default {fi: "Etiketti", en: "Label", sv: "Märka"}
|
|
11826
|
+
*/
|
|
11827
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
11764
11828
|
/**
|
|
11765
11829
|
* Visually hide the label, but still show it to screen readers.
|
|
11766
11830
|
*/
|
|
@@ -11998,15 +12062,19 @@ class DuetNumberInput {
|
|
|
11998
12062
|
"accessibleControls": [1, "accessible-controls"],
|
|
11999
12063
|
"accessibleOwns": [1, "accessible-owns"],
|
|
12000
12064
|
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
12065
|
+
"accessibleLiveDefaults": [1, "accessible-live-default"],
|
|
12001
12066
|
"accessibleLive": [1, "accessible-live"],
|
|
12002
12067
|
"accessibleLiveEnabled": [4, "accessible-live-enabled"],
|
|
12068
|
+
"accessibleAddDefaults": [1, "accessible-add-default"],
|
|
12003
12069
|
"accessibleAdd": [1, "accessible-add"],
|
|
12070
|
+
"accessibleSubtractDefaults": [1, "accessible-subtract-defaults"],
|
|
12004
12071
|
"accessibleSubtract": [1, "accessible-subtract"],
|
|
12005
12072
|
"theme": [1025],
|
|
12006
12073
|
"margin": [1],
|
|
12007
12074
|
"expand": [4],
|
|
12008
12075
|
"identifier": [1],
|
|
12009
12076
|
"min": [2],
|
|
12077
|
+
"labelDefaults": [1, "label-default"],
|
|
12010
12078
|
"label": [1],
|
|
12011
12079
|
"labelHidden": [4, "label-hidden"],
|
|
12012
12080
|
"max": [2],
|
|
@@ -13216,14 +13284,19 @@ class DuetTabGroup {
|
|
|
13216
13284
|
*/
|
|
13217
13285
|
this.language = getLanguage();
|
|
13218
13286
|
/**
|
|
13219
|
-
*
|
|
13287
|
+
* Defaults for Label
|
|
13220
13288
|
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
13221
13289
|
*/
|
|
13222
|
-
this.
|
|
13290
|
+
this.labelDefaults = {
|
|
13223
13291
|
fi: "Valitse",
|
|
13224
13292
|
en: "Choose",
|
|
13225
13293
|
sv: "Välj",
|
|
13226
|
-
}
|
|
13294
|
+
};
|
|
13295
|
+
/**
|
|
13296
|
+
* Label for the select element which gets shown on mobile.
|
|
13297
|
+
* @default {fi: "Valitse", en: "Choose", sv: "Välja"}
|
|
13298
|
+
*/
|
|
13299
|
+
this.label = getLocaleString(this.labelDefaults, this.language);
|
|
13227
13300
|
/**
|
|
13228
13301
|
* Determines whether the label for the select element shown on mobile is visually hidden.
|
|
13229
13302
|
*/
|
|
@@ -13365,6 +13438,7 @@ class DuetTabGroup {
|
|
|
13365
13438
|
"theme": [1025],
|
|
13366
13439
|
"variation": [1],
|
|
13367
13440
|
"language": [1025],
|
|
13441
|
+
"labelDefaults": [1, "label-default"],
|
|
13368
13442
|
"label": [1],
|
|
13369
13443
|
"labelHidden": [4, "label-hidden"],
|
|
13370
13444
|
"margin": [1],
|
|
@@ -13867,25 +13941,35 @@ class DuetTooltip {
|
|
|
13867
13941
|
*/
|
|
13868
13942
|
this.language = getLanguage();
|
|
13869
13943
|
/**
|
|
13870
|
-
*
|
|
13871
|
-
* readers. This property is always required to create an accessible interface!
|
|
13944
|
+
* Default language strings for the accessibleLabel
|
|
13872
13945
|
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
13873
13946
|
*/
|
|
13874
|
-
this.
|
|
13947
|
+
this.accessibleLabelDefault = {
|
|
13875
13948
|
fi: "Näytä lisätietoja",
|
|
13876
13949
|
en: "Show more information",
|
|
13877
13950
|
sv: "Visa mer tilläggsuppgifter",
|
|
13878
|
-
}
|
|
13951
|
+
};
|
|
13879
13952
|
/**
|
|
13880
|
-
* Adds accessible label for the
|
|
13881
|
-
* readers. This property is always required to create an
|
|
13953
|
+
* Adds accessible label for the info icon that is only shown for screen
|
|
13954
|
+
* readers. This property is always required to create an accessible interface!
|
|
13955
|
+
* @default {fi: "Näytä lisätietoja", en: "See more information", sv: "Se mer information"}
|
|
13956
|
+
*/
|
|
13957
|
+
this.accessibleLabel = getLocaleString(this.accessibleLabelDefault, this.language);
|
|
13958
|
+
/**
|
|
13959
|
+
* Default language strings for the accessibleCloseLabel
|
|
13882
13960
|
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
13883
13961
|
*/
|
|
13884
|
-
this.
|
|
13962
|
+
this.accessibleCloseLabelDefault = {
|
|
13885
13963
|
fi: "Sulje lisätiedot",
|
|
13886
13964
|
en: "Close details",
|
|
13887
13965
|
sv: "Stäng tilläggsuppgifter",
|
|
13888
|
-
}
|
|
13966
|
+
};
|
|
13967
|
+
/**
|
|
13968
|
+
* Adds accessible label for the close icon that is only shown for screen
|
|
13969
|
+
* readers. This property is always required to create an accessibly interface!
|
|
13970
|
+
* @default {fi: "Sulje lisätiedot", en: "Close details", sv: "Stäng detaljer"}
|
|
13971
|
+
*/
|
|
13972
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefault, this.language);
|
|
13889
13973
|
/**
|
|
13890
13974
|
* Label of the tooltip. If used, replaces the accessibleLabel option.
|
|
13891
13975
|
*/
|
|
@@ -14058,8 +14142,10 @@ class DuetTooltip {
|
|
|
14058
14142
|
"$members$": {
|
|
14059
14143
|
"theme": [1025],
|
|
14060
14144
|
"language": [1025],
|
|
14145
|
+
"accessibleLabelDefault": [1, "accessible-label-default"],
|
|
14061
14146
|
"accessibleLabel": [1, "accessible-label"],
|
|
14062
14147
|
"accessibleInputLabel": [1, "accessible-input-label"],
|
|
14148
|
+
"accessibleCloseLabelDefault": [1, "accessible-close-label-default"],
|
|
14063
14149
|
"accessibleCloseLabel": [1, "accessible-close-label"],
|
|
14064
14150
|
"label": [1],
|
|
14065
14151
|
"breakpoint": [1],
|
|
@@ -14103,25 +14189,35 @@ class DuetTray {
|
|
|
14103
14189
|
*/
|
|
14104
14190
|
this.language = getLanguage();
|
|
14105
14191
|
/**
|
|
14106
|
-
*
|
|
14107
|
-
* close toggle. Not visible for normal users.
|
|
14192
|
+
* Defaults for accessibleCloseLabel
|
|
14108
14193
|
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
14109
14194
|
*/
|
|
14110
|
-
this.
|
|
14195
|
+
this.accessibleCloseLabelDefaults = {
|
|
14111
14196
|
fi: "Sulje",
|
|
14112
14197
|
en: "Close",
|
|
14113
14198
|
sv: "Stäng",
|
|
14114
|
-
}
|
|
14199
|
+
};
|
|
14115
14200
|
/**
|
|
14116
14201
|
* Accessible label that is shown for screen reader users in the expandable
|
|
14117
|
-
*
|
|
14202
|
+
* close toggle. Not visible for normal users.
|
|
14203
|
+
* @default {fi: "Sulje", en: "Close", sv: "Stänga"}
|
|
14204
|
+
*/
|
|
14205
|
+
this.accessibleCloseLabel = getLocaleString(this.accessibleCloseLabelDefaults, this.language);
|
|
14206
|
+
/**
|
|
14207
|
+
* Defaults for accessibleOpenLabel
|
|
14118
14208
|
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
14119
14209
|
*/
|
|
14120
|
-
this.
|
|
14210
|
+
this.accessibleOpenLabelDefaults = {
|
|
14121
14211
|
fi: "Avaa",
|
|
14122
14212
|
en: "Open",
|
|
14123
14213
|
sv: "Öppna",
|
|
14124
|
-
}
|
|
14214
|
+
};
|
|
14215
|
+
/**
|
|
14216
|
+
* Accessible label that is shown for screen reader users in the expandable
|
|
14217
|
+
* open toggle. Not visible for normal users.
|
|
14218
|
+
* @default {fi: "Avaa", en: "Open", sv: "Öppen"}
|
|
14219
|
+
*/
|
|
14220
|
+
this.accessibleOpenLabel = getLocaleString(this.accessibleOpenLabelDefaults, this.language);
|
|
14125
14221
|
/**
|
|
14126
14222
|
* Theme of the info panel.
|
|
14127
14223
|
*/
|
|
@@ -14195,7 +14291,9 @@ class DuetTray {
|
|
|
14195
14291
|
"$tagName$": "duet-tray",
|
|
14196
14292
|
"$members$": {
|
|
14197
14293
|
"language": [1025],
|
|
14294
|
+
"accessibleCloseLabelDefaults": [1, "accessible-close-label-default"],
|
|
14198
14295
|
"accessibleCloseLabel": [1, "accessible-close-label"],
|
|
14296
|
+
"accessibleOpenLabelDefaults": [1, "accessible-open-label-default"],
|
|
14199
14297
|
"accessibleOpenLabel": [1, "accessible-open-label"],
|
|
14200
14298
|
"theme": [1025],
|
|
14201
14299
|
"active": [516],
|
|
@@ -14210,911 +14308,6 @@ class DuetTray {
|
|
|
14210
14308
|
}; }
|
|
14211
14309
|
}
|
|
14212
14310
|
|
|
14213
|
-
const formatBytes = (bytes, decimals = 2) => {
|
|
14214
|
-
if (bytes === 0) {
|
|
14215
|
-
return "0 Bytes";
|
|
14216
|
-
}
|
|
14217
|
-
const k = 1024;
|
|
14218
|
-
const dm = decimals < 0 ? 0 : decimals;
|
|
14219
|
-
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
14220
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
14221
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
14222
|
-
};
|
|
14223
|
-
|
|
14224
|
-
const DuetUploadFileList = ({ data, onDelete, onCancel, getError }) => {
|
|
14225
|
-
if (data.invalid.length === 0 && data.valid.length === 0) {
|
|
14226
|
-
return;
|
|
14227
|
-
}
|
|
14228
|
-
return (hAsync("ol", { class: "duet-upload-filelist" },
|
|
14229
|
-
data.valid.length !== 0 && (hAsync("li", null,
|
|
14230
|
-
hAsync("duet-visually-hidden", null, "Files"),
|
|
14231
|
-
hAsync("ul", null, data.valid.length !== 0 &&
|
|
14232
|
-
data.valid.map(e => (hAsync("li", { class: "duet-upload-file" },
|
|
14233
|
-
hAsync("div", { class: "duet-upload-file-container" },
|
|
14234
|
-
hAsync("div", { class: "duet-upload-file-link" }, e.url ? (hAsync("duet-button", { variation: "plain", icon: "messaging-attachment", url: e.url },
|
|
14235
|
-
e.item.name,
|
|
14236
|
-
" (",
|
|
14237
|
-
formatBytes(e.item.size),
|
|
14238
|
-
")")) : (`${e.item.name} (${formatBytes(e.item.size)})`)),
|
|
14239
|
-
hAsync("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
14240
|
-
e.progress < 100 && (hAsync("li", { role: "none" },
|
|
14241
|
-
hAsync("duet-button", { role: "menuitem", variation: "plain", icon: "messaging-declined", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onCancel(e.item.name, ev) }))),
|
|
14242
|
-
e.progress === 100 && (hAsync("li", { role: "none" },
|
|
14243
|
-
hAsync("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))),
|
|
14244
|
-
e.progress < 100 && (hAsync("div", { class: "duet-upload-file-progress" },
|
|
14245
|
-
hAsync("progress", { value: e.progress, max: "100" },
|
|
14246
|
-
hAsync("div", { class: "progress-bar" },
|
|
14247
|
-
hAsync("span", { style: { width: `${e.progress}%;` } },
|
|
14248
|
-
"Progress: ",
|
|
14249
|
-
e.progress,
|
|
14250
|
-
"%"))))))))))),
|
|
14251
|
-
data.invalid.length !== 0 && (hAsync("li", null,
|
|
14252
|
-
hAsync("duet-visually-hidden", null, "Files with Errors"),
|
|
14253
|
-
hAsync("ul", null, data.invalid.map(e => {
|
|
14254
|
-
return (hAsync("li", { class: "duet-upload-file duet-upload-file-errors" },
|
|
14255
|
-
hAsync("div", { class: "duet-upload-file-container" },
|
|
14256
|
-
hAsync("div", { class: "duet-upload-file-link duet-upload-file-link-error" },
|
|
14257
|
-
hAsync("div", null,
|
|
14258
|
-
e.item.name,
|
|
14259
|
-
" (",
|
|
14260
|
-
formatBytes(e.item.size),
|
|
14261
|
-
")"),
|
|
14262
|
-
hAsync("div", { "data-error-type": e.error.type, "data-error-message": e.error.system_message }, getError(e.error.type))),
|
|
14263
|
-
hAsync("ul", { class: "duet-upload-file-actions", role: "menubar", "aria-label": "file actions" },
|
|
14264
|
-
hAsync("li", { role: "none" },
|
|
14265
|
-
hAsync("duet-button", { role: "menuitem", variation: "destructive", icon: "action-delete", "icon-only": true, "icon-size": "large", margin: "none", onClick: ev => onDelete(e.item.name, ev) }))))));
|
|
14266
|
-
}))))));
|
|
14267
|
-
};
|
|
14268
|
-
|
|
14269
|
-
var errorcodes = [
|
|
14270
|
-
{
|
|
14271
|
-
type: "default",
|
|
14272
|
-
system_message: "unknown error",
|
|
14273
|
-
message: {
|
|
14274
|
-
fi: "",
|
|
14275
|
-
sv: "",
|
|
14276
|
-
en: "An unknown error occured, please try again"
|
|
14277
|
-
}
|
|
14278
|
-
},
|
|
14279
|
-
{
|
|
14280
|
-
type: "400",
|
|
14281
|
-
system_message: "Bad Request: The server could not understand the request due to invalid syntax.",
|
|
14282
|
-
message: {
|
|
14283
|
-
fi: "",
|
|
14284
|
-
sv: "",
|
|
14285
|
-
en: "The server rejected your file"
|
|
14286
|
-
}
|
|
14287
|
-
},
|
|
14288
|
-
{
|
|
14289
|
-
type: "401",
|
|
14290
|
-
system_message: "Not Authenticated: The client must authenticate itself to get the requested response..",
|
|
14291
|
-
message: {
|
|
14292
|
-
fi: "",
|
|
14293
|
-
sv: "",
|
|
14294
|
-
en: "You need to be logged in to upload files"
|
|
14295
|
-
}
|
|
14296
|
-
},
|
|
14297
|
-
{
|
|
14298
|
-
type: "403",
|
|
14299
|
-
system_message: "No Access: The client does not have access rights to the content;",
|
|
14300
|
-
message: {
|
|
14301
|
-
fi: "",
|
|
14302
|
-
sv: "",
|
|
14303
|
-
en: "You do not have the correct access rights to upload files"
|
|
14304
|
-
}
|
|
14305
|
-
},
|
|
14306
|
-
{
|
|
14307
|
-
type: "413",
|
|
14308
|
-
system_message: "Payload too large",
|
|
14309
|
-
message: {
|
|
14310
|
-
fi: "",
|
|
14311
|
-
sv: "",
|
|
14312
|
-
en: "The file was to large for the server to handle"
|
|
14313
|
-
}
|
|
14314
|
-
},
|
|
14315
|
-
{
|
|
14316
|
-
type: "415",
|
|
14317
|
-
system_message: "Unsupported media type",
|
|
14318
|
-
message: {
|
|
14319
|
-
fi: "",
|
|
14320
|
-
sv: "",
|
|
14321
|
-
en: "The server rejected the file because it had the wrong type"
|
|
14322
|
-
}
|
|
14323
|
-
},
|
|
14324
|
-
{
|
|
14325
|
-
type: "429",
|
|
14326
|
-
system_message: "Too many request from same address",
|
|
14327
|
-
message: {
|
|
14328
|
-
fi: "",
|
|
14329
|
-
sv: "",
|
|
14330
|
-
en: "The server has received to many request from you, please try again later"
|
|
14331
|
-
}
|
|
14332
|
-
},
|
|
14333
|
-
{
|
|
14334
|
-
type: "500",
|
|
14335
|
-
system_message: "Internal Server Error",
|
|
14336
|
-
message: {
|
|
14337
|
-
fi: "",
|
|
14338
|
-
sv: "",
|
|
14339
|
-
en: "The server reported an unknown error and the upload failed"
|
|
14340
|
-
}
|
|
14341
|
-
},
|
|
14342
|
-
{
|
|
14343
|
-
type: "duet-upload-100",
|
|
14344
|
-
system_message: "File extension not allowed",
|
|
14345
|
-
message: {
|
|
14346
|
-
fi: "",
|
|
14347
|
-
sv: "",
|
|
14348
|
-
en: "You cannot upload files with that extension"
|
|
14349
|
-
}
|
|
14350
|
-
},
|
|
14351
|
-
{
|
|
14352
|
-
type: "duet-upload-001",
|
|
14353
|
-
system_message: "File transfer failed",
|
|
14354
|
-
message: {
|
|
14355
|
-
fi: "",
|
|
14356
|
-
sv: "",
|
|
14357
|
-
en: "Your connection to the server was interrupted, try again"
|
|
14358
|
-
}
|
|
14359
|
-
},
|
|
14360
|
-
{
|
|
14361
|
-
type: "duet-upload-101",
|
|
14362
|
-
system_message: "File mimetype not allowed",
|
|
14363
|
-
message: {
|
|
14364
|
-
fi: "",
|
|
14365
|
-
sv: "",
|
|
14366
|
-
en: "You cannot upload files of that type"
|
|
14367
|
-
}
|
|
14368
|
-
},
|
|
14369
|
-
{
|
|
14370
|
-
type: "duet-upload-201",
|
|
14371
|
-
system_message: "File is too large",
|
|
14372
|
-
message: {
|
|
14373
|
-
fi: "",
|
|
14374
|
-
sv: "",
|
|
14375
|
-
en: "The file is larger than permitted"
|
|
14376
|
-
}
|
|
14377
|
-
},
|
|
14378
|
-
{
|
|
14379
|
-
type: "duet-upload-202",
|
|
14380
|
-
system_message: "The combined size of all files is too large",
|
|
14381
|
-
message: {
|
|
14382
|
-
fi: "",
|
|
14383
|
-
sv: "",
|
|
14384
|
-
en: "You have reached the maximum combined filesize"
|
|
14385
|
-
}
|
|
14386
|
-
},
|
|
14387
|
-
{
|
|
14388
|
-
type: "duet-upload-301",
|
|
14389
|
-
system_message: "The maximum file limit has been reached",
|
|
14390
|
-
message: {
|
|
14391
|
-
fi: "Liitteiden maksimimäärä saavutettu.",
|
|
14392
|
-
sv: "",
|
|
14393
|
-
en: "Maximum number of attachments reached."
|
|
14394
|
-
}
|
|
14395
|
-
}
|
|
14396
|
-
];
|
|
14397
|
-
|
|
14398
|
-
const getError = (code) => {
|
|
14399
|
-
let error = {
|
|
14400
|
-
type: undefined,
|
|
14401
|
-
system_message: undefined,
|
|
14402
|
-
message: undefined,
|
|
14403
|
-
};
|
|
14404
|
-
error = errorcodes.filter(errorItem => {
|
|
14405
|
-
return errorItem.type === code;
|
|
14406
|
-
})[0];
|
|
14407
|
-
if (!error) {
|
|
14408
|
-
error = errorcodes.filter(errorItem => {
|
|
14409
|
-
return errorItem.type === "default";
|
|
14410
|
-
})[0];
|
|
14411
|
-
}
|
|
14412
|
-
return error;
|
|
14413
|
-
};
|
|
14414
|
-
|
|
14415
|
-
const validateFileExtension = (name, allowedExtensions) => {
|
|
14416
|
-
if (!allowedExtensions) {
|
|
14417
|
-
return true;
|
|
14418
|
-
}
|
|
14419
|
-
const ext = name.split(".");
|
|
14420
|
-
const validExtension = allowedExtensions.split(",");
|
|
14421
|
-
const extension = ext[ext.length - 1];
|
|
14422
|
-
return validExtension.includes(extension);
|
|
14423
|
-
};
|
|
14424
|
-
const validateFileMime = (type, allowedMimetypes) => {
|
|
14425
|
-
if (!allowedMimetypes || !type) {
|
|
14426
|
-
return true;
|
|
14427
|
-
}
|
|
14428
|
-
const validMimeTypes = allowedMimetypes.split(",");
|
|
14429
|
-
let valid = false;
|
|
14430
|
-
validMimeTypes.forEach(mimeType => {
|
|
14431
|
-
const allowedTypes = mimeType.split("/");
|
|
14432
|
-
const fileType = type.split("/");
|
|
14433
|
-
if (allowedTypes[0] === fileType[0] && (allowedTypes[1] === fileType[1] || allowedTypes[1] === "*")) {
|
|
14434
|
-
valid = true;
|
|
14435
|
-
}
|
|
14436
|
-
});
|
|
14437
|
-
return valid;
|
|
14438
|
-
};
|
|
14439
|
-
const validateFileSize = (size, maxBytes) => {
|
|
14440
|
-
if (!maxBytes || !size) {
|
|
14441
|
-
return true;
|
|
14442
|
-
}
|
|
14443
|
-
return maxBytes >= size;
|
|
14444
|
-
};
|
|
14445
|
-
const validateFile = (item, validators) => {
|
|
14446
|
-
const { allowedMimetypes, allowedExtensions, maxBytes } = validators;
|
|
14447
|
-
let valid = false;
|
|
14448
|
-
let errorMessage = getError("default");
|
|
14449
|
-
if (item) {
|
|
14450
|
-
const { name, type, size } = item;
|
|
14451
|
-
const mime = validateFileMime(type, allowedMimetypes);
|
|
14452
|
-
const ext = validateFileExtension(name, allowedExtensions);
|
|
14453
|
-
const bytes = validateFileSize(size, maxBytes);
|
|
14454
|
-
if (!mime) {
|
|
14455
|
-
errorMessage = getError("duet-upload-101");
|
|
14456
|
-
}
|
|
14457
|
-
if (!ext) {
|
|
14458
|
-
errorMessage = getError("duet-upload-100");
|
|
14459
|
-
}
|
|
14460
|
-
if (!bytes) {
|
|
14461
|
-
errorMessage = getError("duet-upload-201");
|
|
14462
|
-
}
|
|
14463
|
-
valid = mime && ext && bytes;
|
|
14464
|
-
}
|
|
14465
|
-
else {
|
|
14466
|
-
valid = false;
|
|
14467
|
-
}
|
|
14468
|
-
return {
|
|
14469
|
-
valid,
|
|
14470
|
-
errorMessage: valid ? undefined : getLocaleString(errorMessage.message),
|
|
14471
|
-
errorSystem: valid ? undefined : errorMessage.system_message,
|
|
14472
|
-
errorType: valid ? undefined : errorMessage.type,
|
|
14473
|
-
};
|
|
14474
|
-
};
|
|
14475
|
-
const validateTotalSizeIsAboveMax = (filelist, maxTotalBytes) => {
|
|
14476
|
-
let total = 0;
|
|
14477
|
-
if (maxTotalBytes) {
|
|
14478
|
-
filelist.forEach(item => {
|
|
14479
|
-
if (item.valid && item.size) {
|
|
14480
|
-
total += item.size;
|
|
14481
|
-
}
|
|
14482
|
-
});
|
|
14483
|
-
if (total < maxTotalBytes) {
|
|
14484
|
-
return true;
|
|
14485
|
-
}
|
|
14486
|
-
}
|
|
14487
|
-
return false;
|
|
14488
|
-
};
|
|
14489
|
-
const validateTotalAmountIsAboveMax = (filelist, maxFiles) => {
|
|
14490
|
-
let total = 0;
|
|
14491
|
-
if (maxFiles) {
|
|
14492
|
-
filelist.forEach(item => {
|
|
14493
|
-
if (item.valid) {
|
|
14494
|
-
total++;
|
|
14495
|
-
}
|
|
14496
|
-
});
|
|
14497
|
-
if (total > maxFiles) {
|
|
14498
|
-
return true;
|
|
14499
|
-
}
|
|
14500
|
-
}
|
|
14501
|
-
return false;
|
|
14502
|
-
};
|
|
14503
|
-
|
|
14504
|
-
const makeXhrRequest = (payload, options, onFailure, onSuccess, onProgress) => {
|
|
14505
|
-
const { type, xhr, uri, argument, headers } = Object.assign({
|
|
14506
|
-
type: "POST",
|
|
14507
|
-
argument: null,
|
|
14508
|
-
headers: null,
|
|
14509
|
-
}, options);
|
|
14510
|
-
xhr.open(type, `${uri}${argument || ""}`, true);
|
|
14511
|
-
const { data, name } = payload;
|
|
14512
|
-
// headers must be added after open
|
|
14513
|
-
if (headers) {
|
|
14514
|
-
Object.keys(headers).forEach(key => {
|
|
14515
|
-
xhr.setRequestHeader(key, headers[key]);
|
|
14516
|
-
});
|
|
14517
|
-
}
|
|
14518
|
-
if (type === "POST") {
|
|
14519
|
-
xhr.onreadystatechange = () => {
|
|
14520
|
-
// Call a function when the state changes.
|
|
14521
|
-
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status >= 200 && xhr.status < 300) {
|
|
14522
|
-
// Request finished without errors
|
|
14523
|
-
onSuccess(xhr, name, xhr.status);
|
|
14524
|
-
}
|
|
14525
|
-
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status >= 300 && xhr.status < 999) {
|
|
14526
|
-
// Request finished with errors
|
|
14527
|
-
onFailure(xhr, name, xhr.status);
|
|
14528
|
-
}
|
|
14529
|
-
};
|
|
14530
|
-
onProgress(name);
|
|
14531
|
-
}
|
|
14532
|
-
xhr.send(data);
|
|
14533
|
-
return xhr;
|
|
14534
|
-
};
|
|
14535
|
-
|
|
14536
|
-
const duetUploadCss = "/*!@*,\n*::after,\n*::before*/*.sc-duet-upload,*.sc-duet-upload::after,*.sc-duet-upload::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host*/.sc-duet-upload-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}/*!@:host li*/.sc-duet-upload-h li.sc-duet-upload{list-style:none}/*!@.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 li*/.duet-upload.sc-duet-upload li.sc-duet-upload{list-style:none}/*!@.duet-upload-file-errors*/.duet-upload-file-errors.sc-duet-upload{padding:20px 0;color:#de2362}/*!@.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;background-color:#f3f9fc}/*!@.duet-upload-file*/.duet-upload-file.sc-duet-upload{display:flex;flex-flow:column;justify-content:center;min-height:50px;border-bottom:1px solid #e1e3e6}/*!@.duet-upload-file:first-of-type:not(.duet-upload-file-errors)*/.duet-upload-file.sc-duet-upload:first-of-type:not(.duet-upload-file-errors){border-top:1px solid #e1e3e6}/*!@.duet-upload-file-container*/.duet-upload-file-container.sc-duet-upload{display:flex;place-items:center;width:100%}/*!@.duet-upload-file-link*/.duet-upload-file-link.sc-duet-upload{display:flex;flex-grow:2;place-items:center}/*!@.duet-upload-file-link-error*/.duet-upload-file-link-error.sc-duet-upload{flex-direction:column;place-items:flex-start}/*!@.duet-upload-file-link duet-button*/.duet-upload-file-link.sc-duet-upload duet-button.sc-duet-upload{position:relative;top:6px}/*!@.duet-upload-file-actions*/.duet-upload-file-actions.sc-duet-upload{display:flex;transform:scale(0.8)}/*!@.duet-upload-file-progress*//*!@.duet-upload-file-progress .progress-bar*/.duet-upload-file-progress.sc-duet-upload .progress-bar.sc-duet-upload{position:relative;display:block;width:100%;height:15px;background-color:#f3f9fc;border-radius:0;box-shadow:none}/*!@.duet-upload-file-progress .progress-bar > span*/.duet-upload-file-progress.sc-duet-upload .progress-bar.sc-duet-upload>span.sc-duet-upload{display:block;text-indent:-9999px;background-color:#0077b3;border-radius:0}/*!@.duet-upload-file-progress progress[value]*/.duet-upload-file-progress.sc-duet-upload progress[value].sc-duet-upload{display:flex;width:100%;height:15px;color:#0077b3;border:0 none;-webkit-appearance:none;-moz-appearance:none;appearance:none}/*!@.duet-upload-file-progress progress[value]::-webkit-progress-bar*/.duet-upload-file-progress.sc-duet-upload progress[value].sc-duet-upload::-webkit-progress-bar{background-color:#f3f9fc;border-radius:0}/*!@.duet-upload-file-progress progress[value]::-webkit-progress-value*/.duet-upload-file-progress.sc-duet-upload progress[value].sc-duet-upload::-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-upload-file-progress progress[value] ::-moz-progress-bar*/.duet-upload-file-progress.sc-duet-upload progress[value].sc-duet-upload .sc-duet-upload::-moz-progress-bar{background-color:#f3f9fc}";
|
|
14537
|
-
|
|
14538
|
-
/**
|
|
14539
|
-
* @slot header - named slot - to place content after description / caption
|
|
14540
|
-
* @slot fileheader - named slot - to place content above filelist (only displayed when filelist contains items)
|
|
14541
|
-
* @slot filefooter - named slot - to place content below filelist (only displayed when filelist contains items)
|
|
14542
|
-
*/
|
|
14543
|
-
class DuetUpload {
|
|
14544
|
-
constructor(hostRef) {
|
|
14545
|
-
registerInstance(this, hostRef);
|
|
14546
|
-
this.duetChange = createEvent$2(this, "duetChange", 3);
|
|
14547
|
-
this.duetBlur = createEvent$2(this, "duetBlur", 7);
|
|
14548
|
-
this.duetFocus = createEvent$2(this, "duetFocus", 7);
|
|
14549
|
-
this.duetDone = createEvent$2(this, "duetDone", 3);
|
|
14550
|
-
this.duetState = createEvent$2(this, "duetState", 3);
|
|
14551
|
-
this.duetDelete = createEvent$2(this, "duetDelete", 3);
|
|
14552
|
-
this.duetCancel = createEvent$2(this, "duetCancel", 3);
|
|
14553
|
-
this.duetProgress = createEvent$2(this, "duetProgress", 3);
|
|
14554
|
-
this.duetUpload = createEvent$2(this, "duetUpload", 3);
|
|
14555
|
-
/**
|
|
14556
|
-
* Own Properties
|
|
14557
|
-
*/
|
|
14558
|
-
this.buttonId = createID("DuetButton");
|
|
14559
|
-
this.labelId = createID("DuetLabel");
|
|
14560
|
-
this.uploadId = createID("DuetUpload");
|
|
14561
|
-
this.filesInProgress = new Map();
|
|
14562
|
-
this.fileMaxReached = false;
|
|
14563
|
-
this.bytesMaxReached = false;
|
|
14564
|
-
/**
|
|
14565
|
-
* State() variables
|
|
14566
|
-
*/
|
|
14567
|
-
this.tick = Date.now();
|
|
14568
|
-
/**
|
|
14569
|
-
* If external is set to true, the upload component will not actually upload the files, but only keep states
|
|
14570
|
-
* it will be up to you to handle the upload and return progress information to the upload-component
|
|
14571
|
-
*/
|
|
14572
|
-
this.external = false;
|
|
14573
|
-
/**
|
|
14574
|
-
* Property to change descriptionDefaults defaults on the component.
|
|
14575
|
-
* normally you would handle these strings on an application level and override @label when needed
|
|
14576
|
-
*/
|
|
14577
|
-
this.buttonLabelDefaults = {
|
|
14578
|
-
fi: "Lisää liite",
|
|
14579
|
-
sv: "Lägg till en bilaga",
|
|
14580
|
-
en: "Add an attachment",
|
|
14581
|
-
};
|
|
14582
|
-
/**
|
|
14583
|
-
* Label of button
|
|
14584
|
-
* @default { fi: "Lisää liite", sv: "Lägg till en bilaga", en: "Add an attachment" }
|
|
14585
|
-
*/
|
|
14586
|
-
this.buttonLabel = getLocaleString(this.buttonLabelDefaults);
|
|
14587
|
-
/**
|
|
14588
|
-
* accessible Label of button
|
|
14589
|
-
*/
|
|
14590
|
-
this.accessibleButtonLabel = undefined;
|
|
14591
|
-
/**
|
|
14592
|
-
* Theme of the input.
|
|
14593
|
-
*/
|
|
14594
|
-
this.theme = "";
|
|
14595
|
-
/**
|
|
14596
|
-
* Makes the input component disabled. This prevents users from being able to
|
|
14597
|
-
* interact with the upload component, and conveys its inactive state to assistive technologies.
|
|
14598
|
-
*/
|
|
14599
|
-
this.disabled = false;
|
|
14600
|
-
/**
|
|
14601
|
-
* Controls the margin of the component.
|
|
14602
|
-
*/
|
|
14603
|
-
this.margin = "auto";
|
|
14604
|
-
/**
|
|
14605
|
-
* Set whether the input is required or not. Please note that this is necessary for
|
|
14606
|
-
* accessible inputs when the user is required to fill them. When using this property
|
|
14607
|
-
* you need to also set “novalidate” attribute to your form element to prevent
|
|
14608
|
-
* browser from displaying its own validation errors.
|
|
14609
|
-
*/
|
|
14610
|
-
this.required = false;
|
|
14611
|
-
/**
|
|
14612
|
-
* Map of string that contain list of uploaded files.
|
|
14613
|
-
*/
|
|
14614
|
-
this.files = new Map();
|
|
14615
|
-
/**
|
|
14616
|
-
* Property to read if filelist contains errors or not
|
|
14617
|
-
*/
|
|
14618
|
-
this.valid = !this.required;
|
|
14619
|
-
/**
|
|
14620
|
-
* Property to change labelDefaults defaults on the component.
|
|
14621
|
-
* normally you would handle these strings on an application level and override @label when needed
|
|
14622
|
-
*/
|
|
14623
|
-
this.labelDefaults = {
|
|
14624
|
-
fi: "Lisää liite",
|
|
14625
|
-
sv: "Lägg till en bilaga",
|
|
14626
|
-
en: "Add attachments",
|
|
14627
|
-
};
|
|
14628
|
-
/**
|
|
14629
|
-
* Label for the input.
|
|
14630
|
-
* @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
|
|
14631
|
-
*/
|
|
14632
|
-
this.label = getLocaleString(this.labelDefaults);
|
|
14633
|
-
/**
|
|
14634
|
-
* Property to change descriptionDefaults defaults on the component.
|
|
14635
|
-
* normally you would handle these strings on an application level and override @label when needed
|
|
14636
|
-
*/
|
|
14637
|
-
this.descriptionDefaults = {
|
|
14638
|
-
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.",
|
|
14639
|
-
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.",
|
|
14640
|
-
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.",
|
|
14641
|
-
};
|
|
14642
|
-
/**
|
|
14643
|
-
* Description for the upload component.
|
|
14644
|
-
* @default ...
|
|
14645
|
-
*/
|
|
14646
|
-
this.description = getLocaleString(this.descriptionDefaults);
|
|
14647
|
-
/**
|
|
14648
|
-
* Defaults for the filelist's empty state.
|
|
14649
|
-
* @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
|
|
14650
|
-
*/
|
|
14651
|
-
this.fileListEmptyDefaults = {
|
|
14652
|
-
fi: "Ei vielä lisättyjä tiedostoja.",
|
|
14653
|
-
sv: "Inga filer har lagts till ännu.",
|
|
14654
|
-
en: "No files added yet.",
|
|
14655
|
-
};
|
|
14656
|
-
/**
|
|
14657
|
-
* Label for the filelist's empty state.
|
|
14658
|
-
* @default { fi: "Ei vielä lisättyjä tiedostoja.",sv: "Inga filer har lagts till ännu.",en: "No files added yet."}
|
|
14659
|
-
*/
|
|
14660
|
-
this.fileListEmpty = getLocaleString(this.fileListEmptyDefaults);
|
|
14661
|
-
/**
|
|
14662
|
-
* Display the input in error state along with an error message.
|
|
14663
|
-
*/
|
|
14664
|
-
this.error = "";
|
|
14665
|
-
/**
|
|
14666
|
-
* Visually hide the label, but still show it to screen readers.
|
|
14667
|
-
*/
|
|
14668
|
-
this.labelHidden = false;
|
|
14669
|
-
/**
|
|
14670
|
-
* if set, allows capture of media from user camera / microphone
|
|
14671
|
-
* The capture attribute value is a string that specifies which camera to use for capture
|
|
14672
|
-
* of image or video data, if the accept attribute indicates that the input should be of
|
|
14673
|
-
* one of those types. A value of user indicates that the user-facing camera and/or
|
|
14674
|
-
* microphone should be used. A value of environment specifies that the outward-facing
|
|
14675
|
-
* camera and/or microphone should be used. If this attribute is missing, the user agent
|
|
14676
|
-
* is free to decide on its own what to do. If the requested facing mode isn't available,
|
|
14677
|
-
* the user agent may fall back to its preferred default mode.
|
|
14678
|
-
*/
|
|
14679
|
-
this.capture = undefined;
|
|
14680
|
-
/**
|
|
14681
|
-
* Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded.
|
|
14682
|
-
*/
|
|
14683
|
-
this.maxBytes = 200000000;
|
|
14684
|
-
/**
|
|
14685
|
-
* Use maxBytesTotal to specify the maximum size in Bytes of All files combined that can be uploaded.
|
|
14686
|
-
*/
|
|
14687
|
-
this.maxBytesTotal = undefined;
|
|
14688
|
-
/**
|
|
14689
|
-
* Use maxFiles to specify the maximum amount of files that can be uploaded
|
|
14690
|
-
*/
|
|
14691
|
-
this.maxFiles = 99;
|
|
14692
|
-
/**
|
|
14693
|
-
* A string of commaseperated file type values that are allowed
|
|
14694
|
-
* @example: .pdf,.doc,.docx
|
|
14695
|
-
*/
|
|
14696
|
-
this.allowedExtensions = "all";
|
|
14697
|
-
/**
|
|
14698
|
-
* A string of commaseperated mime type values that are allowed
|
|
14699
|
-
* @example: image/*,application/msword,
|
|
14700
|
-
*/
|
|
14701
|
-
this.allowedMimetypes = "*";
|
|
14702
|
-
/**
|
|
14703
|
-
* Use multiple to allow the user to select multiple files when uploading
|
|
14704
|
-
*/
|
|
14705
|
-
this.multiple = true;
|
|
14706
|
-
/**
|
|
14707
|
-
* Use limitSelection to enforce the value in allowedExtension & allowedMimetypes when selecting files,
|
|
14708
|
-
* by default this is off, setting this to true will limit the users choices to what has been explicitly set
|
|
14709
|
-
*/
|
|
14710
|
-
this.limitSelection = false;
|
|
14711
|
-
/**
|
|
14712
|
-
* Private functions
|
|
14713
|
-
*/
|
|
14714
|
-
this.kick = () => (this.tick = Date.now()); // will trigger re-render
|
|
14715
|
-
this.genHashName = () => Date.now().toString(36) + Math.random();
|
|
14716
|
-
this.updateValueInMap = (item, key, value, kick = true) => {
|
|
14717
|
-
const fileItem = this.files.get(item);
|
|
14718
|
-
fileItem[key] = value;
|
|
14719
|
-
this.files.set(item, fileItem);
|
|
14720
|
-
if (kick) {
|
|
14721
|
-
this.kick();
|
|
14722
|
-
}
|
|
14723
|
-
};
|
|
14724
|
-
this.updateProgress = (ev, name) => {
|
|
14725
|
-
if (ev.lengthComputable) {
|
|
14726
|
-
const percentComplete = (ev.loaded / ev.total) * 100;
|
|
14727
|
-
this.updateValueInMap(name, "progress", percentComplete);
|
|
14728
|
-
this.onProgress(name, percentComplete, ev);
|
|
14729
|
-
}
|
|
14730
|
-
else {
|
|
14731
|
-
console.log("cant read progress");
|
|
14732
|
-
}
|
|
14733
|
-
};
|
|
14734
|
-
this.trackProgress = (name, remove = false) => {
|
|
14735
|
-
if (remove) {
|
|
14736
|
-
this.filesInProgress.delete(name);
|
|
14737
|
-
}
|
|
14738
|
-
else {
|
|
14739
|
-
this.filesInProgress.set(name, "inprogress");
|
|
14740
|
-
}
|
|
14741
|
-
if (this.filesInProgress.size === 0) {
|
|
14742
|
-
this.onDone();
|
|
14743
|
-
}
|
|
14744
|
-
};
|
|
14745
|
-
this.getFilesAsArray = () => {
|
|
14746
|
-
const filesInQueue = [];
|
|
14747
|
-
const filesInError = [];
|
|
14748
|
-
this.files.forEach(value => {
|
|
14749
|
-
if (value.valid && !value.deleted) {
|
|
14750
|
-
filesInQueue.push(value);
|
|
14751
|
-
}
|
|
14752
|
-
else if (!value.valid && !value.deleted) {
|
|
14753
|
-
filesInError.push(value);
|
|
14754
|
-
}
|
|
14755
|
-
});
|
|
14756
|
-
return { valid: filesInQueue, invalid: filesInError };
|
|
14757
|
-
};
|
|
14758
|
-
this.resetFormFields = () => {
|
|
14759
|
-
/**
|
|
14760
|
-
* You cannot modify a FileList, nor remove single items from it
|
|
14761
|
-
* This completely removes all items in the FileList
|
|
14762
|
-
* We reset the form fields to always be able to re-upload files
|
|
14763
|
-
* and because we handle all uploads and states internally in the component (not relying on native form elements)
|
|
14764
|
-
*/
|
|
14765
|
-
this.nativeInput.value = "";
|
|
14766
|
-
};
|
|
14767
|
-
this.getI18nError = (errorCode) => {
|
|
14768
|
-
const errorFromJson = getError(errorCode);
|
|
14769
|
-
const i18String = getLocaleString(errorFromJson.message);
|
|
14770
|
-
if (i18String === "" || !i18String) {
|
|
14771
|
-
return errorFromJson.system_message;
|
|
14772
|
-
}
|
|
14773
|
-
else {
|
|
14774
|
-
return i18String;
|
|
14775
|
-
}
|
|
14776
|
-
};
|
|
14777
|
-
/**
|
|
14778
|
-
* Eventlisteners for the XHR requests
|
|
14779
|
-
*/
|
|
14780
|
-
this.transferComplete = name => {
|
|
14781
|
-
this.updateValueInMap(name, "progress", 100, false);
|
|
14782
|
-
this.trackProgress(name, true);
|
|
14783
|
-
};
|
|
14784
|
-
this.transferDone = (xhr, name, status) => {
|
|
14785
|
-
this.updateValueInMap(name, "status", status, false);
|
|
14786
|
-
try {
|
|
14787
|
-
const response = JSON.parse(xhr.response);
|
|
14788
|
-
this.updateValueInMap(name, "url", response.url);
|
|
14789
|
-
}
|
|
14790
|
-
catch (e) {
|
|
14791
|
-
this.updateValueInMap(name, "url", null);
|
|
14792
|
-
console.error("Server did not respond with expected response {url: string}");
|
|
14793
|
-
}
|
|
14794
|
-
return;
|
|
14795
|
-
};
|
|
14796
|
-
this.transferDoneWithFailure = (xhr, name, status) => {
|
|
14797
|
-
try {
|
|
14798
|
-
const { error } = JSON.parse(xhr.response);
|
|
14799
|
-
this.updateValueInMap(name, "error", { message: error.message, type: error.type });
|
|
14800
|
-
}
|
|
14801
|
-
catch (e) {
|
|
14802
|
-
console.error("Server did not respond with expected response error:{message: string, type: int}");
|
|
14803
|
-
this.updateValueInMap(name, "error", { type: status });
|
|
14804
|
-
}
|
|
14805
|
-
};
|
|
14806
|
-
this.transferFailed = name => {
|
|
14807
|
-
this.updateValueInMap(name, "error", getError("duet-upload-001"));
|
|
14808
|
-
};
|
|
14809
|
-
this.transferCanceled = name => {
|
|
14810
|
-
this.files.delete(name);
|
|
14811
|
-
this.validateTotals(name);
|
|
14812
|
-
this.kick();
|
|
14813
|
-
};
|
|
14814
|
-
this.validateTotals = (name) => {
|
|
14815
|
-
const isTotalSizeOverMaxSize = validateTotalSizeIsAboveMax(this.files, this.maxBytesTotal);
|
|
14816
|
-
const isTotalFileAmountAboveMax = validateTotalAmountIsAboveMax(this.files, this.maxFiles);
|
|
14817
|
-
if (isTotalSizeOverMaxSize && name) {
|
|
14818
|
-
this.updateValueInMap(name, "error", getError("duet-upload-202"), false);
|
|
14819
|
-
}
|
|
14820
|
-
if (isTotalFileAmountAboveMax && name) {
|
|
14821
|
-
this.updateValueInMap(name, "error", getError("duet-upload-301"), false);
|
|
14822
|
-
}
|
|
14823
|
-
this.bytesMaxReached = isTotalSizeOverMaxSize;
|
|
14824
|
-
this.fileMaxReached = isTotalFileAmountAboveMax;
|
|
14825
|
-
return {
|
|
14826
|
-
bytesMaxReached: isTotalSizeOverMaxSize,
|
|
14827
|
-
fileMaxReached: isTotalFileAmountAboveMax,
|
|
14828
|
-
};
|
|
14829
|
-
};
|
|
14830
|
-
this.onDelete = (key, ev) => {
|
|
14831
|
-
const deletedItem = this.files.get(key);
|
|
14832
|
-
this.files.delete(key);
|
|
14833
|
-
this.validateTotals();
|
|
14834
|
-
this.kick();
|
|
14835
|
-
if (!this.external) {
|
|
14836
|
-
this.makeXHRDeleteRequest(deletedItem);
|
|
14837
|
-
}
|
|
14838
|
-
this.resetFormFields();
|
|
14839
|
-
this.duetDelete.emit({
|
|
14840
|
-
originalEvent: ev,
|
|
14841
|
-
data: { deletion: deletedItem },
|
|
14842
|
-
component: "duet-upload",
|
|
14843
|
-
});
|
|
14844
|
-
};
|
|
14845
|
-
this.onCancel = (key, ev) => {
|
|
14846
|
-
const cancelledItem = this.files.get(key);
|
|
14847
|
-
this.files.delete(key);
|
|
14848
|
-
if (!this.external) {
|
|
14849
|
-
const { xhr } = cancelledItem;
|
|
14850
|
-
xhr.abort();
|
|
14851
|
-
}
|
|
14852
|
-
else {
|
|
14853
|
-
this.kick();
|
|
14854
|
-
}
|
|
14855
|
-
this.resetFormFields();
|
|
14856
|
-
this.duetCancel.emit({
|
|
14857
|
-
originalEvent: ev,
|
|
14858
|
-
data: { cancelled: cancelledItem },
|
|
14859
|
-
component: "duet-upload",
|
|
14860
|
-
});
|
|
14861
|
-
};
|
|
14862
|
-
this.onUpload = (ev) => {
|
|
14863
|
-
this.duetUpload.emit({
|
|
14864
|
-
originalEvent: ev,
|
|
14865
|
-
component: "duet-upload",
|
|
14866
|
-
});
|
|
14867
|
-
};
|
|
14868
|
-
this.onBlur = (ev) => {
|
|
14869
|
-
this.duetBlur.emit({
|
|
14870
|
-
originalEvent: ev,
|
|
14871
|
-
component: "duet-upload",
|
|
14872
|
-
});
|
|
14873
|
-
};
|
|
14874
|
-
this.onProgress = (key, percentComplete, ev) => {
|
|
14875
|
-
this.duetChange.emit({
|
|
14876
|
-
originalEvent: ev,
|
|
14877
|
-
data: {
|
|
14878
|
-
key,
|
|
14879
|
-
percentComplete,
|
|
14880
|
-
},
|
|
14881
|
-
component: "duet-upload",
|
|
14882
|
-
});
|
|
14883
|
-
};
|
|
14884
|
-
this.onFocus = (ev) => {
|
|
14885
|
-
this.duetFocus.emit({
|
|
14886
|
-
originalEvent: ev,
|
|
14887
|
-
component: "duet-upload",
|
|
14888
|
-
});
|
|
14889
|
-
};
|
|
14890
|
-
this.onDone = () => {
|
|
14891
|
-
this.duetDone.emit({
|
|
14892
|
-
component: "duet-upload",
|
|
14893
|
-
data: { files: this.files },
|
|
14894
|
-
});
|
|
14895
|
-
};
|
|
14896
|
-
this.startUpload = async (ev) => {
|
|
14897
|
-
await this.setFocus();
|
|
14898
|
-
this.nativeInput.click();
|
|
14899
|
-
this.onUpload(ev);
|
|
14900
|
-
ev.stopPropagation();
|
|
14901
|
-
ev.preventDefault();
|
|
14902
|
-
};
|
|
14903
|
-
}
|
|
14904
|
-
watchValidHandler(newValue, oldValue) {
|
|
14905
|
-
if (newValue !== oldValue) {
|
|
14906
|
-
this.kick();
|
|
14907
|
-
}
|
|
14908
|
-
}
|
|
14909
|
-
/**
|
|
14910
|
-
* Component lifecycle events.
|
|
14911
|
-
*/
|
|
14912
|
-
componentWillLoad() {
|
|
14913
|
-
inheritGlobalTheme(this);
|
|
14914
|
-
}
|
|
14915
|
-
componentWillRender() {
|
|
14916
|
-
const { invalid, valid } = this.getFilesAsArray();
|
|
14917
|
-
const oldValid = this.valid;
|
|
14918
|
-
this.valid = invalid.length === 0 && valid.length !== 0;
|
|
14919
|
-
if (this.valid !== oldValid) {
|
|
14920
|
-
this.duetState.emit({
|
|
14921
|
-
originalEvent: undefined,
|
|
14922
|
-
data: { valid: this.valid, from: "componentWillRender" },
|
|
14923
|
-
component: "duet-upload",
|
|
14924
|
-
});
|
|
14925
|
-
}
|
|
14926
|
-
}
|
|
14927
|
-
/**
|
|
14928
|
-
* XHR request utilities
|
|
14929
|
-
*/
|
|
14930
|
-
makeXHRPostRequest(data) {
|
|
14931
|
-
const xhr = new XMLHttpRequest();
|
|
14932
|
-
const name = data.get("name");
|
|
14933
|
-
xhr.upload.addEventListener("progress", ev => {
|
|
14934
|
-
this.updateProgress(ev, name);
|
|
14935
|
-
});
|
|
14936
|
-
xhr.upload.addEventListener("load", () => {
|
|
14937
|
-
this.transferComplete(name);
|
|
14938
|
-
});
|
|
14939
|
-
xhr.upload.addEventListener("error", () => {
|
|
14940
|
-
this.transferFailed(name);
|
|
14941
|
-
});
|
|
14942
|
-
xhr.upload.addEventListener("abort", () => {
|
|
14943
|
-
this.transferCanceled(name);
|
|
14944
|
-
});
|
|
14945
|
-
return makeXhrRequest({ data, name }, { type: "POST", uri: this.uri, xhr, argument: null, headers: null }, this.transferDoneWithFailure, this.transferDone, this.trackProgress);
|
|
14946
|
-
}
|
|
14947
|
-
makeXHRDeleteRequest(data) {
|
|
14948
|
-
const { uid, item } = data;
|
|
14949
|
-
const xhr = new XMLHttpRequest();
|
|
14950
|
-
// don't present server issues to user on deletes, just remove them from the visible list
|
|
14951
|
-
return makeXhrRequest({ data: null, name }, {
|
|
14952
|
-
type: "DELETE",
|
|
14953
|
-
xhr,
|
|
14954
|
-
uri: this.uri,
|
|
14955
|
-
arguments: `?key=${uid}&name=${item.name}`,
|
|
14956
|
-
headers: {
|
|
14957
|
-
"x-fileuid": uid,
|
|
14958
|
-
"x-filename": item.name,
|
|
14959
|
-
},
|
|
14960
|
-
}, this.transferDoneWithFailure, this.transferDone, this.trackProgress);
|
|
14961
|
-
}
|
|
14962
|
-
/**
|
|
14963
|
-
* Component event handling.
|
|
14964
|
-
*/
|
|
14965
|
-
async onChange(ev) {
|
|
14966
|
-
var _a;
|
|
14967
|
-
const selectedFiles = Array.from((_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.files);
|
|
14968
|
-
// FileList is a nice array like structure but
|
|
14969
|
-
// to ensure uniqueness of files we use a mapping structure and
|
|
14970
|
-
// key to the name (makes it easier to delete)
|
|
14971
|
-
if (selectedFiles) {
|
|
14972
|
-
for (const item of selectedFiles) {
|
|
14973
|
-
const { valid, errorMessage, errorType, errorSystem } = validateFile(item, {
|
|
14974
|
-
maxBytes: this.maxBytes,
|
|
14975
|
-
allowedExtensions: this.allowedExtensions,
|
|
14976
|
-
allowedMimetypes: this.allowedMimetypes,
|
|
14977
|
-
});
|
|
14978
|
-
const uid = this.genHashName();
|
|
14979
|
-
const fileListItem = {
|
|
14980
|
-
uid,
|
|
14981
|
-
item: item,
|
|
14982
|
-
size: item.size,
|
|
14983
|
-
valid,
|
|
14984
|
-
error: {
|
|
14985
|
-
type: valid ? undefined : errorType,
|
|
14986
|
-
message: valid ? undefined : errorMessage,
|
|
14987
|
-
system_message: valid ? undefined : errorSystem,
|
|
14988
|
-
},
|
|
14989
|
-
progress: 0,
|
|
14990
|
-
deleted: false,
|
|
14991
|
-
xhr: false,
|
|
14992
|
-
url: false,
|
|
14993
|
-
};
|
|
14994
|
-
this.files.set(item.name, fileListItem);
|
|
14995
|
-
// validate that we haven't hit any maxfiles or maxbytes limits before we upload
|
|
14996
|
-
const { bytesMaxReached, fileMaxReached } = this.validateTotals(item.name);
|
|
14997
|
-
if (bytesMaxReached) {
|
|
14998
|
-
// in case one of the global maxes have been reached, invalidate the file
|
|
14999
|
-
this.updateValueInMap(item.name, "valid", false, false);
|
|
15000
|
-
}
|
|
15001
|
-
else if (fileMaxReached) {
|
|
15002
|
-
// in case one of the global maxes have been reached, invalidate the file
|
|
15003
|
-
this.updateValueInMap(item.name, "valid", false, false);
|
|
15004
|
-
}
|
|
15005
|
-
else if (valid && !this.external) {
|
|
15006
|
-
// if all is well AND external file upload handling has not been set, start upload
|
|
15007
|
-
const data = new FormData();
|
|
15008
|
-
data.append("file", item);
|
|
15009
|
-
data.append("uid", uid);
|
|
15010
|
-
data.append("name", item.name);
|
|
15011
|
-
data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size }));
|
|
15012
|
-
fileListItem.xhr = await this.makeXHRPostRequest(data);
|
|
15013
|
-
}
|
|
15014
|
-
// kick the stat to force update
|
|
15015
|
-
this.kick();
|
|
15016
|
-
}
|
|
15017
|
-
}
|
|
15018
|
-
// reset the form, so that a user may upload a file again (with the same name)
|
|
15019
|
-
this.resetFormFields();
|
|
15020
|
-
this.duetChange.emit({
|
|
15021
|
-
originalEvent: ev,
|
|
15022
|
-
data: { files: this.files },
|
|
15023
|
-
component: "duet-upload",
|
|
15024
|
-
});
|
|
15025
|
-
}
|
|
15026
|
-
/**
|
|
15027
|
-
* Sets focus on the specified `duet-input`. Use this method instead of the global
|
|
15028
|
-
* `input.focus()`.
|
|
15029
|
-
*/
|
|
15030
|
-
async setFocus(options) {
|
|
15031
|
-
if (this.nativeInput) {
|
|
15032
|
-
this.nativeInput.focus(options);
|
|
15033
|
-
}
|
|
15034
|
-
return;
|
|
15035
|
-
}
|
|
15036
|
-
/**
|
|
15037
|
-
* Get list of files, divided in errors and valid sections
|
|
15038
|
-
*/
|
|
15039
|
-
async getFiles() {
|
|
15040
|
-
if (!this.files || this.files.size === 0) {
|
|
15041
|
-
return false;
|
|
15042
|
-
}
|
|
15043
|
-
return this.getFilesAsArray();
|
|
15044
|
-
}
|
|
15045
|
-
/**
|
|
15046
|
-
* render() function
|
|
15047
|
-
* Always the last one in the class.
|
|
15048
|
-
*/
|
|
15049
|
-
render() {
|
|
15050
|
-
const identifier = this.identifier || this.uploadId;
|
|
15051
|
-
let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
|
|
15052
|
-
caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
|
|
15053
|
-
caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
|
|
15054
|
-
return (hAsync(Host, { class: { "duet-m-0": this.margin === "none" } }, hAsync("duet-fieldset", { label: this.label, caption: caption }, hAsync("slot", { name: "header" }), hAsync("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
|
|
15055
|
-
"duet-upload-filelist-empty": !this.files.size,
|
|
15056
|
-
"duet-upload-filelist": true,
|
|
15057
|
-
"duet-upload-filelist-filled": this.files.size,
|
|
15058
|
-
}, id: this.labelId, for: identifier }, !this.files.size && this.fileListEmpty), !!this.files.size && hAsync("slot", { name: "fileheader" }), hAsync(DuetUploadFileList, { data: this.getFilesAsArray(), onDelete: this.onDelete, onCancel: this.onCancel, getError: this.getI18nError }, hAsync("li", null, "testing something")), !!this.files.size && hAsync("slot", { name: "filefooter" }), hAsync("duet-spacer", { size: "large" }), 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 && this.getI18nError("duet-upload-301"), this.bytesMaxReached && this.getI18nError("duet-upload-202"))), hAsync("duet-spacer", { size: "medium" }), hAsync("duet-visually-hidden", null, hAsync("input", { ref: input => {
|
|
15059
|
-
this.nativeInput = input;
|
|
15060
|
-
}, accept: this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
|
|
15061
|
-
"duet-upload": true,
|
|
15062
|
-
}, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
|
|
15063
|
-
}
|
|
15064
|
-
get element() { return getElement(this); }
|
|
15065
|
-
static get watchers() { return {
|
|
15066
|
-
"valid": ["watchValidHandler"]
|
|
15067
|
-
}; }
|
|
15068
|
-
static get style() { return duetUploadCss; }
|
|
15069
|
-
static get cmpMeta() { return {
|
|
15070
|
-
"$flags$": 9,
|
|
15071
|
-
"$tagName$": "duet-upload",
|
|
15072
|
-
"$members$": {
|
|
15073
|
-
"accessibleActiveDescendant": [1, "accessible-active-descendant"],
|
|
15074
|
-
"accessibleDescribedBy": [1, "accessible-described-by"],
|
|
15075
|
-
"accessibleControls": [1, "accessible-controls"],
|
|
15076
|
-
"accessibleOwns": [1, "accessible-owns"],
|
|
15077
|
-
"external": [4],
|
|
15078
|
-
"uri": [1],
|
|
15079
|
-
"caption": [1],
|
|
15080
|
-
"buttonLabelDefaults": [16],
|
|
15081
|
-
"buttonLabel": [1, "button-label"],
|
|
15082
|
-
"accessibleButtonLabel": [1, "accessible-button-label"],
|
|
15083
|
-
"theme": [1025],
|
|
15084
|
-
"disabled": [516],
|
|
15085
|
-
"identifier": [1],
|
|
15086
|
-
"margin": [1],
|
|
15087
|
-
"required": [4],
|
|
15088
|
-
"files": [1040],
|
|
15089
|
-
"valid": [1540],
|
|
15090
|
-
"labelDefaults": [16],
|
|
15091
|
-
"label": [1],
|
|
15092
|
-
"descriptionDefaults": [16],
|
|
15093
|
-
"description": [1],
|
|
15094
|
-
"fileListEmptyDefaults": [16],
|
|
15095
|
-
"fileListEmpty": [1, "file-list-empty"],
|
|
15096
|
-
"error": [1],
|
|
15097
|
-
"labelHidden": [4, "label-hidden"],
|
|
15098
|
-
"name": [1],
|
|
15099
|
-
"capture": [8],
|
|
15100
|
-
"maxBytes": [2, "max-bytes"],
|
|
15101
|
-
"maxBytesTotal": [2, "max-bytes-total"],
|
|
15102
|
-
"maxFiles": [2, "max-files"],
|
|
15103
|
-
"allowedExtensions": [1, "allowed-extensions"],
|
|
15104
|
-
"allowedMimetypes": [1, "allowed-mimetypes"],
|
|
15105
|
-
"multiple": [4],
|
|
15106
|
-
"limitSelection": [4, "limit-selection"],
|
|
15107
|
-
"value": [1025],
|
|
15108
|
-
"tick": [32],
|
|
15109
|
-
"setFocus": [64],
|
|
15110
|
-
"getFiles": [64]
|
|
15111
|
-
},
|
|
15112
|
-
"$listeners$": undefined,
|
|
15113
|
-
"$lazyBundleId$": "-",
|
|
15114
|
-
"$attrsToReflect$": [["disabled", "disabled"], ["valid", "valid"]]
|
|
15115
|
-
}; }
|
|
15116
|
-
}
|
|
15117
|
-
|
|
15118
14311
|
const duetVisuallyHiddenCss = "/*!@:host*/.sc-duet-visually-hidden-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}";
|
|
15119
14312
|
|
|
15120
14313
|
class DuetVisuallyHidden {
|
|
@@ -15188,7 +14381,6 @@ registerComponents([
|
|
|
15188
14381
|
DuetToggle,
|
|
15189
14382
|
DuetTooltip,
|
|
15190
14383
|
DuetTray,
|
|
15191
|
-
DuetUpload,
|
|
15192
14384
|
DuetVisuallyHidden,
|
|
15193
14385
|
]);
|
|
15194
14386
|
|