@duetds/components 6.9.3 → 6.9.5
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 +39 -9
- package/lib/cjs/duet-action-button.cjs.entry.js +1 -1
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-caption_4.cjs.entry.js +1 -1
- package/lib/cjs/duet-card.cjs.entry.js +1 -1
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-checkmark.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-collapsible.cjs.entry.js +1 -1
- package/lib/cjs/duet-combobox.cjs.entry.js +24 -4
- package/lib/cjs/duet-contact-card.cjs.entry.js +1 -1
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +2 -2
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +1 -1
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +3 -2
- package/lib/cjs/duet-footer.cjs.entry.js +1 -1
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +1 -1
- package/lib/cjs/duet-input_2.cjs.entry.js +3 -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-menu-bar-button.cjs.entry.js +1 -1
- package/lib/cjs/duet-menu-bar-dropdown-link.cjs.entry.js +1 -1
- package/lib/cjs/duet-menu-bar-dropdown.cjs.entry.js +1 -1
- package/lib/cjs/duet-menu-bar-link.cjs.entry.js +1 -1
- package/lib/cjs/duet-menu-bar.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +2 -2
- package/lib/cjs/duet-multiselect.cjs.entry.js +3 -2
- package/lib/cjs/duet-nav.cjs.entry.js +1 -1
- package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
- package/lib/cjs/duet-page-heading.cjs.entry.js +1 -1
- package/lib/cjs/duet-pagination_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-progress.cjs.entry.js +1 -1
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +1 -1
- package/lib/cjs/duet-section-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +4 -3
- package/lib/cjs/duet-slideout-lang.cjs.entry.js +1 -1
- package/lib/cjs/duet-slideout-link.cjs.entry.js +1 -1
- package/lib/cjs/duet-slideout-panel-dropdown.cjs.entry.js +1 -1
- package/lib/cjs/duet-slideout-panel.cjs.entry.js +2 -2
- package/lib/cjs/duet-slideout.cjs.entry.js +2 -2
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-submenu-bar-dropdown-link.cjs.entry.js +1 -1
- package/lib/cjs/duet-submenu-bar-dropdown.cjs.entry.js +1 -1
- package/lib/cjs/duet-submenu-bar-link.cjs.entry.js +1 -1
- package/lib/cjs/duet-submenu-bar.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +3 -2
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-toolbar-dropdown-link.cjs.entry.js +1 -1
- package/lib/cjs/duet-toolbar-dropdown.cjs.entry.js +1 -1
- package/lib/cjs/duet-toolbar-link.cjs.entry.js +1 -1
- package/lib/cjs/duet-toolbar.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
- package/lib/cjs/duet-tray.cjs.entry.js +1 -1
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-05197b44.js → focus-utils-8edb1dd0.js} +1 -1
- package/lib/cjs/{index-eee9d583.js → index-81121cf7.js} +1 -1
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/collection/components/duet-combobox/duet-combobox.css +2 -1
- package/lib/collection/components/duet-combobox/duet-combobox.js +26 -2
- package/lib/collection/components/duet-fieldset/duet-fieldset.js +20 -1
- package/lib/collection/components/duet-input/duet-input.js +20 -1
- package/lib/collection/components/duet-multiselect/duet-multiselect.js +20 -1
- package/lib/collection/components/duet-select/duet-select.css +3 -0
- package/lib/collection/components/duet-select/duet-select.js +20 -1
- package/lib/collection/components/duet-textarea/duet-textarea.js +20 -1
- package/lib/dist-custom-elements/duet-action-button.js +1 -1
- package/lib/dist-custom-elements/duet-alert.js +1 -1
- package/lib/dist-custom-elements/duet-badge.js +1 -1
- package/lib/dist-custom-elements/duet-breadcrumb.js +2 -2
- package/lib/dist-custom-elements/duet-breadcrumbs.js +2 -2
- package/lib/dist-custom-elements/duet-button.js +1 -1
- package/lib/dist-custom-elements/duet-caption.js +1 -1
- package/lib/dist-custom-elements/duet-card.js +3 -3
- package/lib/dist-custom-elements/duet-checkbox.js +1 -1
- package/lib/dist-custom-elements/duet-checkmark.js +1 -1
- package/lib/dist-custom-elements/duet-choice-group.js +6 -6
- package/lib/dist-custom-elements/duet-choice.js +5 -5
- package/lib/dist-custom-elements/duet-collapsible.js +2 -2
- package/lib/dist-custom-elements/duet-combobox.js +25 -5
- package/lib/dist-custom-elements/duet-contact-card.js +8 -8
- package/lib/dist-custom-elements/duet-cookie-consent.js +6 -6
- package/lib/dist-custom-elements/duet-date-picker.js +10 -10
- package/lib/dist-custom-elements/duet-divider.js +1 -1
- package/lib/dist-custom-elements/duet-editable-table.js +7 -7
- package/lib/dist-custom-elements/duet-empty-state.js +1 -1
- package/lib/dist-custom-elements/duet-fieldset.js +1 -1
- package/lib/dist-custom-elements/duet-footer.js +4 -4
- package/lib/dist-custom-elements/duet-grid-item.js +1 -1
- package/lib/dist-custom-elements/duet-grid.js +1 -1
- package/lib/dist-custom-elements/duet-header.js +8 -8
- package/lib/dist-custom-elements/duet-heading.js +1 -1
- package/lib/dist-custom-elements/duet-hero.js +9 -9
- package/lib/dist-custom-elements/duet-icon.js +1 -1
- package/lib/dist-custom-elements/duet-input.js +1 -1
- package/lib/dist-custom-elements/duet-label.js +1 -1
- package/lib/dist-custom-elements/duet-layout.js +1 -1
- package/lib/dist-custom-elements/duet-link.js +1 -1
- package/lib/dist-custom-elements/duet-list-item.js +1 -1
- package/lib/dist-custom-elements/duet-list.js +1 -1
- package/lib/dist-custom-elements/duet-logo.js +1 -1
- package/lib/dist-custom-elements/duet-menu-bar-button.js +2 -2
- package/lib/dist-custom-elements/duet-menu-bar-dropdown-link.js +2 -2
- package/lib/dist-custom-elements/duet-menu-bar-dropdown.js +2 -2
- package/lib/dist-custom-elements/duet-menu-bar-link.js +2 -2
- package/lib/dist-custom-elements/duet-menu-bar.js +2 -2
- package/lib/dist-custom-elements/duet-modal.js +7 -7
- package/lib/dist-custom-elements/duet-multiselect.js +11 -9
- package/lib/dist-custom-elements/duet-nav.js +1 -1
- package/lib/dist-custom-elements/duet-notification-drawer.js +4 -4
- package/lib/dist-custom-elements/duet-notification.js +2 -2
- package/lib/dist-custom-elements/duet-number-input.js +9 -9
- package/lib/dist-custom-elements/duet-page-heading.js +2 -2
- package/lib/dist-custom-elements/duet-pagination.js +7 -7
- package/lib/dist-custom-elements/duet-paragraph.js +1 -1
- package/lib/dist-custom-elements/duet-progress.js +1 -1
- package/lib/dist-custom-elements/duet-radio-group.js +6 -6
- package/lib/dist-custom-elements/duet-radio.js +1 -1
- package/lib/dist-custom-elements/duet-range-slider.js +2 -2
- package/lib/dist-custom-elements/duet-range-stepper.js +4 -4
- package/lib/dist-custom-elements/duet-scrollable.js +1 -1
- package/lib/dist-custom-elements/duet-section-layout.js +1 -1
- package/lib/dist-custom-elements/duet-select.js +1 -1
- package/lib/dist-custom-elements/duet-slideout-lang.js +2 -2
- package/lib/dist-custom-elements/duet-slideout-link.js +2 -2
- package/lib/dist-custom-elements/duet-slideout-panel-dropdown.js +2 -2
- package/lib/dist-custom-elements/duet-slideout-panel.js +2 -2
- package/lib/dist-custom-elements/duet-slideout.js +2 -2
- package/lib/dist-custom-elements/duet-spacer.js +1 -1
- package/lib/dist-custom-elements/duet-spinner.js +1 -1
- package/lib/dist-custom-elements/duet-step.js +4 -4
- package/lib/dist-custom-elements/duet-stepper.js +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown-link.js +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown.js +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar-link.js +2 -2
- package/lib/dist-custom-elements/duet-submenu-bar.js +2 -2
- package/lib/dist-custom-elements/duet-tab-group.js +9 -9
- package/lib/dist-custom-elements/duet-tab.js +1 -1
- package/lib/dist-custom-elements/duet-table.js +1 -1
- package/lib/dist-custom-elements/duet-textarea.js +11 -9
- package/lib/dist-custom-elements/duet-toggle.js +2 -2
- package/lib/dist-custom-elements/duet-toolbar-dropdown-link.js +2 -2
- package/lib/dist-custom-elements/duet-toolbar-dropdown.js +2 -2
- package/lib/dist-custom-elements/duet-toolbar-link.js +2 -2
- package/lib/dist-custom-elements/duet-toolbar.js +1 -1
- package/lib/dist-custom-elements/duet-tooltip.js +1 -1
- package/lib/dist-custom-elements/duet-tray.js +3 -3
- package/lib/dist-custom-elements/duet-upload-aria-status.js +1 -1
- package/lib/dist-custom-elements/duet-upload.js +17 -17
- package/lib/dist-custom-elements/duet-visually-hidden.js +1 -1
- package/lib/dist-custom-elements/index.js +1 -1
- package/lib/dist-custom-elements/{p-deb13767.js → p-00622251.js} +3 -3
- package/lib/dist-custom-elements/{p-95748e22.js → p-0acc5ed6.js} +1 -1
- package/lib/dist-custom-elements/{p-11726aff.js → p-111c553d.js} +2 -2
- package/lib/dist-custom-elements/{p-b36e239a.js → p-20c82fbd.js} +1 -1
- package/lib/dist-custom-elements/{p-3a3c90d4.js → p-27efb5f6.js} +1 -1
- package/lib/dist-custom-elements/{p-9b058d94.js → p-27f66954.js} +1 -1
- package/lib/dist-custom-elements/{p-be5f6a1d.js → p-2ea5174d.js} +1 -1
- package/lib/dist-custom-elements/{p-1fc0569f.js → p-2ff017a8.js} +1 -1
- package/lib/dist-custom-elements/{p-abcc88a0.js → p-4b87207e.js} +10 -8
- package/lib/dist-custom-elements/{p-220ddc4d.js → p-4c1f4126.js} +1 -1
- package/lib/dist-custom-elements/{p-d8b913a2.js → p-57b9edb8.js} +5 -5
- package/lib/dist-custom-elements/{p-c4537db0.js → p-5808a711.js} +1 -1
- package/lib/dist-custom-elements/{p-486f5398.js → p-7ccd5f61.js} +1 -1
- package/lib/dist-custom-elements/{p-08f56203.js → p-82cb614b.js} +1 -1
- package/lib/dist-custom-elements/{p-9a4e8a6c.js → p-95f8531c.js} +1 -1
- package/lib/dist-custom-elements/{p-47633ac9.js → p-98983cf5.js} +11 -9
- package/lib/dist-custom-elements/{p-8ac11c5c.js → p-a4a81077.js} +2 -2
- package/lib/dist-custom-elements/{p-6a4b0b8a.js → p-a6f793fc.js} +1 -1
- package/lib/dist-custom-elements/{p-1b58a33e.js → p-a7109746.js} +2 -2
- package/lib/dist-custom-elements/{p-f48f6476.js → p-a81b913d.js} +4 -4
- package/lib/dist-custom-elements/{p-fc615ca3.js → p-aacb3b95.js} +1 -1
- package/lib/dist-custom-elements/{p-98adfbc0.js → p-b385a866.js} +1 -1
- package/lib/dist-custom-elements/{p-084bbc37.js → p-bd0dd4e8.js} +1 -1
- package/lib/dist-custom-elements/{p-aa927ce0.js → p-ca210b87.js} +3 -3
- package/lib/dist-custom-elements/{p-2379a67f.js → p-d2e453e5.js} +5 -3
- package/lib/dist-custom-elements/{p-743407d6.js → p-d6aa9453.js} +3 -3
- package/lib/dist-custom-elements/{p-05d02fd2.js → p-de83b878.js} +1 -1
- package/lib/dist-custom-elements/{p-dbbd6cd5.js → p-e051482f.js} +1 -1
- package/lib/dist-custom-elements/{p-3332f673.js → p-e873b671.js} +1 -1
- package/lib/dist-custom-elements/{p-070a067c.js → p-eb0f0871.js} +1 -1
- package/lib/dist-custom-elements/{p-48eb0804.js → p-f8646bdd.js} +2 -2
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-894225c9.system.entry.js → p-01470001.system.entry.js} +1 -1
- package/lib/duet/{p-3c41107f.system.entry.js → p-03a69a82.system.entry.js} +1 -1
- package/lib/duet/{p-1eab9ea5.system.entry.js → p-07b5abec.system.entry.js} +1 -1
- package/lib/duet/{p-259d5d84.system.js → p-0cd46f36.system.js} +1 -1
- package/lib/duet/{p-48449639.entry.js → p-0d21f532.entry.js} +1 -1
- package/lib/duet/{p-fb400276.entry.js → p-0d8f3f8b.entry.js} +1 -1
- package/lib/duet/{p-21381440.system.entry.js → p-0dd90f16.system.entry.js} +1 -1
- package/lib/duet/{p-9a7822e3.system.entry.js → p-0ee30eab.system.entry.js} +1 -1
- package/lib/duet/{p-a99957df.system.entry.js → p-11c9648d.system.entry.js} +1 -1
- package/lib/duet/p-12fd0273.js +4 -0
- package/lib/duet/{p-c307f048.system.entry.js → p-152af7a3.system.entry.js} +1 -1
- package/lib/duet/{p-f4b9cbc6.system.entry.js → p-19bb927c.system.entry.js} +1 -1
- package/lib/duet/{p-a224fc1a.entry.js → p-1acbcfe5.entry.js} +1 -1
- package/lib/duet/{p-cc67de6a.system.entry.js → p-1b2cc0ed.system.entry.js} +1 -1
- package/lib/duet/{p-724367a5.system.entry.js → p-1c1a784e.system.entry.js} +1 -1
- package/lib/duet/{p-910a0043.entry.js → p-1c667631.entry.js} +1 -1
- package/lib/duet/{p-6cf4109e.system.entry.js → p-21241efd.system.entry.js} +1 -1
- package/lib/duet/{p-abc29e21.entry.js → p-230e5380.entry.js} +1 -1
- package/lib/duet/{p-2e931fc4.system.entry.js → p-248a1e70.system.entry.js} +1 -1
- package/lib/duet/{p-36481d15.system.entry.js → p-258e74a2.system.entry.js} +1 -1
- package/lib/duet/{p-11ef8af0.system.entry.js → p-26e5f323.system.entry.js} +1 -1
- package/lib/duet/{p-2a22b73f.system.entry.js → p-2743b8e3.system.entry.js} +1 -1
- package/lib/duet/{p-4ce9c319.system.entry.js → p-277d8df3.system.entry.js} +1 -1
- package/lib/duet/{p-8f98f017.system.entry.js → p-28f4474e.system.entry.js} +1 -1
- package/lib/duet/{p-2f389915.system.entry.js → p-29864af5.system.entry.js} +1 -1
- package/lib/duet/{p-cabe3f7c.system.entry.js → p-2bed99fa.system.entry.js} +1 -1
- package/lib/duet/{p-414a631b.system.entry.js → p-2c0520ca.system.entry.js} +1 -1
- package/lib/duet/{p-e13f59e4.system.entry.js → p-2fd74d57.system.entry.js} +1 -1
- package/lib/duet/{p-95a3f764.entry.js → p-33196e22.entry.js} +1 -1
- package/lib/duet/{p-7ef9de3e.entry.js → p-354090fc.entry.js} +1 -1
- package/lib/duet/{p-997df7b3.entry.js → p-35872d73.entry.js} +1 -1
- package/lib/duet/{p-9f207355.system.entry.js → p-3791056c.system.entry.js} +1 -1
- package/lib/duet/{p-fd2a5cac.entry.js → p-37aa45f3.entry.js} +1 -1
- package/lib/duet/{p-878386d9.entry.js → p-398cb719.entry.js} +1 -1
- package/lib/duet/{p-4e8ffea9.system.entry.js → p-3bffc1ba.system.entry.js} +1 -1
- package/lib/duet/{p-c955c3c0.system.entry.js → p-413a3ebd.system.entry.js} +1 -1
- package/lib/duet/{p-d1a0472a.system.entry.js → p-450469cd.system.entry.js} +1 -1
- package/lib/duet/{p-f5e31079.entry.js → p-4e75e28e.entry.js} +1 -1
- package/lib/duet/{p-7e9ebcb2.entry.js → p-50495b74.entry.js} +1 -1
- package/lib/duet/{p-e6b7aee0.entry.js → p-50dad157.entry.js} +1 -1
- package/lib/duet/{p-db400c06.entry.js → p-53ec70ad.entry.js} +1 -1
- package/lib/duet/{p-57efae9d.js → p-540a243d.js} +1 -1
- package/lib/duet/{p-1ce8948f.entry.js → p-5632e848.entry.js} +1 -1
- package/lib/duet/{p-155652e9.entry.js → p-576caf16.entry.js} +1 -1
- package/lib/duet/{p-dd32b730.entry.js → p-58fb7a22.entry.js} +1 -1
- package/lib/duet/{p-8a8425cb.entry.js → p-59187969.entry.js} +1 -1
- package/lib/duet/{p-442c8063.system.entry.js → p-59efa9e0.system.entry.js} +1 -1
- package/lib/duet/{p-25f897af.system.entry.js → p-5ab222b7.system.entry.js} +1 -1
- package/lib/duet/p-5b93cff5.entry.js +4 -0
- package/lib/duet/{p-e4f8292f.entry.js → p-5df2cedc.entry.js} +1 -1
- package/lib/duet/{p-e71f044b.system.entry.js → p-5e68175c.system.entry.js} +1 -1
- package/lib/duet/{p-ddb0e72b.system.entry.js → p-5e97f333.system.entry.js} +1 -1
- package/lib/duet/{p-ac42a831.entry.js → p-5ee88d22.entry.js} +1 -1
- package/lib/duet/{p-28a49e7e.system.entry.js → p-6020bc32.system.entry.js} +1 -1
- package/lib/duet/{p-92a84fa7.system.entry.js → p-663247df.system.entry.js} +1 -1
- package/lib/duet/{p-407f6a22.entry.js → p-66ab4869.entry.js} +1 -1
- package/lib/duet/{p-83a1e8a9.system.entry.js → p-676730a8.system.entry.js} +1 -1
- package/lib/duet/{p-964a54d2.entry.js → p-68750bf4.entry.js} +1 -1
- package/lib/duet/{p-a71e810d.entry.js → p-6d204f7f.entry.js} +1 -1
- package/lib/duet/{p-cc86b267.entry.js → p-6da60c3a.entry.js} +1 -1
- package/lib/duet/p-7286fe0a.system.entry.js +4 -0
- package/lib/duet/{p-d66220a1.system.entry.js → p-7454a974.system.entry.js} +1 -1
- package/lib/duet/p-756f81d6.system.js +4 -0
- package/lib/duet/{p-349331d9.system.entry.js → p-76ac794f.system.entry.js} +1 -1
- package/lib/duet/{p-6b43c686.entry.js → p-76c6eef8.entry.js} +1 -1
- package/lib/duet/{p-d9499685.system.entry.js → p-76d453ec.system.entry.js} +1 -1
- package/lib/duet/{p-3847ef6d.entry.js → p-7caf9f8c.entry.js} +1 -1
- package/lib/duet/{p-da0eeef6.entry.js → p-7df39ae6.entry.js} +1 -1
- package/lib/duet/p-7e401d44.entry.js +4 -0
- package/lib/duet/{p-396a1d2a.system.entry.js → p-7f8e1e3e.system.entry.js} +1 -1
- package/lib/duet/{p-b71fca88.system.entry.js → p-8151dad5.system.entry.js} +1 -1
- package/lib/duet/{p-24fea307.system.js → p-81e5dfca.system.js} +1 -1
- package/lib/duet/{p-5bfdb0c0.system.entry.js → p-82e72de8.system.entry.js} +1 -1
- package/lib/duet/{p-3014636c.entry.js → p-8442ce22.entry.js} +1 -1
- package/lib/duet/{p-9b874e31.entry.js → p-84abe886.entry.js} +1 -1
- package/lib/duet/{p-68f54c0a.system.entry.js → p-8acfaf91.system.entry.js} +1 -1
- package/lib/duet/{p-aad61eac.entry.js → p-8bd0fbf8.entry.js} +1 -1
- package/lib/duet/{p-b1d50c67.entry.js → p-8c9438d3.entry.js} +1 -1
- package/lib/duet/p-920d58da.entry.js +4 -0
- package/lib/duet/{p-e2a2e011.entry.js → p-92a86be1.entry.js} +1 -1
- package/lib/duet/{p-17f84373.entry.js → p-94c122ea.entry.js} +1 -1
- package/lib/duet/{p-e5294139.system.entry.js → p-95c7021f.system.entry.js} +1 -1
- package/lib/duet/{p-0a7ba5c7.entry.js → p-9711aa31.entry.js} +1 -1
- package/lib/duet/{p-8bd1ef85.entry.js → p-984e12ad.entry.js} +1 -1
- package/lib/duet/{p-11758911.system.entry.js → p-9a5d8dc8.system.entry.js} +1 -1
- package/lib/duet/{p-7f39a8a5.system.entry.js → p-9a784d29.system.entry.js} +1 -1
- package/lib/duet/{p-74152c5e.entry.js → p-9b4096ae.entry.js} +1 -1
- package/lib/duet/{p-bca173de.entry.js → p-a35708d9.entry.js} +1 -1
- package/lib/duet/{p-da0d4641.system.entry.js → p-a38015bf.system.entry.js} +1 -1
- package/lib/duet/{p-4add9927.system.entry.js → p-a3b02dfe.system.entry.js} +1 -1
- package/lib/duet/{p-661af5a7.system.entry.js → p-a57d2cd7.system.entry.js} +1 -1
- package/lib/duet/{p-173ed9e7.entry.js → p-a5f307cc.entry.js} +1 -1
- package/lib/duet/p-ac7ea81a.entry.js +4 -0
- package/lib/duet/{p-e7bfb225.system.entry.js → p-ad18ed23.system.entry.js} +1 -1
- package/lib/duet/p-afc5adae.entry.js +4 -0
- package/lib/duet/{p-59ca36c2.entry.js → p-b323c9dd.entry.js} +1 -1
- package/lib/duet/{p-9664ebdc.entry.js → p-b32b8786.entry.js} +1 -1
- package/lib/duet/{p-59d60527.system.entry.js → p-b3693e82.system.entry.js} +1 -1
- package/lib/duet/{p-34f27b50.system.entry.js → p-b5813a0f.system.entry.js} +1 -1
- package/lib/duet/{p-11358fff.system.entry.js → p-b5bc42d3.system.entry.js} +1 -1
- package/lib/duet/{p-4e6acc63.system.entry.js → p-b5e831ad.system.entry.js} +1 -1
- package/lib/duet/{p-2c89239c.entry.js → p-b6ba60c4.entry.js} +1 -1
- package/lib/duet/{p-800dbb26.system.entry.js → p-b6e15be0.system.entry.js} +1 -1
- package/lib/duet/{p-2cc41c08.entry.js → p-bbcb7a1d.entry.js} +1 -1
- package/lib/duet/{p-dfdd58b9.entry.js → p-bd29e941.entry.js} +1 -1
- package/lib/duet/{p-cd7bf69f.entry.js → p-bd426f15.entry.js} +1 -1
- package/lib/duet/{p-1b423f25.entry.js → p-c76d7cab.entry.js} +1 -1
- package/lib/duet/{p-e56a2b7e.entry.js → p-c820689f.entry.js} +1 -1
- package/lib/duet/{p-3712296a.entry.js → p-c85acd95.entry.js} +1 -1
- package/lib/duet/{p-edc52faf.system.entry.js → p-c86e5e36.system.entry.js} +1 -1
- package/lib/duet/{p-357cc693.system.entry.js → p-cce99a1d.system.entry.js} +1 -1
- package/lib/duet/{p-8c8357ad.entry.js → p-ce6e2909.entry.js} +1 -1
- package/lib/duet/{p-7b092de5.system.entry.js → p-cee25077.system.entry.js} +1 -1
- package/lib/duet/{p-395d05bb.system.entry.js → p-d08acf37.system.entry.js} +1 -1
- package/lib/duet/{p-653a0453.entry.js → p-d119935f.entry.js} +1 -1
- package/lib/duet/{p-68102093.system.entry.js → p-d38eb818.system.entry.js} +1 -1
- package/lib/duet/{p-9910f982.entry.js → p-d398189d.entry.js} +1 -1
- package/lib/duet/{p-d9667ce7.system.entry.js → p-d54e170f.system.entry.js} +2 -2
- package/lib/duet/{p-be6da1bf.entry.js → p-d5a9a127.entry.js} +1 -1
- package/lib/duet/{p-4d4f0b19.system.entry.js → p-d6280581.system.entry.js} +1 -1
- package/lib/duet/{p-23361048.entry.js → p-da91528a.entry.js} +1 -1
- package/lib/duet/{p-2b68991e.system.entry.js → p-dbc4a1f6.system.entry.js} +1 -1
- package/lib/duet/p-ddd374b4.system.entry.js +4 -0
- package/lib/duet/{p-4faeaadc.system.entry.js → p-dee6ebe6.system.entry.js} +1 -1
- package/lib/duet/{p-aae6309d.entry.js → p-dfa1a8cd.entry.js} +1 -1
- package/lib/duet/{p-aaf572b3.entry.js → p-e016d27b.entry.js} +1 -1
- package/lib/duet/{p-48556df8.entry.js → p-e483eaf7.entry.js} +1 -1
- package/lib/duet/{p-1a98ab00.system.entry.js → p-e4e8671a.system.entry.js} +1 -1
- package/lib/duet/{p-672928d4.entry.js → p-e76b6f2f.entry.js} +1 -1
- package/lib/duet/{p-1c533863.entry.js → p-e98fe1b4.entry.js} +1 -1
- package/lib/duet/{p-8bef9998.entry.js → p-e9c70c19.entry.js} +1 -1
- package/lib/duet/{p-402b0ebf.system.entry.js → p-f31f949c.system.entry.js} +1 -1
- package/lib/duet/{p-96281e8b.system.entry.js → p-f3221a0e.system.entry.js} +1 -1
- package/lib/duet/{p-f461ac1c.entry.js → p-f3fa09d1.entry.js} +1 -1
- package/lib/duet/{p-d43a06e6.system.entry.js → p-f6adb078.system.entry.js} +1 -1
- package/lib/duet/{p-b3fcc7af.entry.js → p-f7c3b41f.entry.js} +1 -1
- package/lib/duet/p-fe039b5e.entry.js +4 -0
- package/lib/esm/duet-action-button.entry.js +1 -1
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-breadcrumb.entry.js +1 -1
- package/lib/esm/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +1 -1
- package/lib/esm/duet-caption_4.entry.js +1 -1
- package/lib/esm/duet-card.entry.js +1 -1
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-checkmark.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +2 -2
- package/lib/esm/duet-collapsible.entry.js +1 -1
- package/lib/esm/duet-combobox.entry.js +24 -4
- package/lib/esm/duet-contact-card.entry.js +1 -1
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +2 -2
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table_3.entry.js +1 -1
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +3 -2
- package/lib/esm/duet-footer.entry.js +1 -1
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +1 -1
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +1 -1
- package/lib/esm/duet-input_2.entry.js +3 -2
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-menu-bar-button.entry.js +1 -1
- package/lib/esm/duet-menu-bar-dropdown-link.entry.js +1 -1
- package/lib/esm/duet-menu-bar-dropdown.entry.js +1 -1
- package/lib/esm/duet-menu-bar-link.entry.js +1 -1
- package/lib/esm/duet-menu-bar.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +2 -2
- package/lib/esm/duet-multiselect.entry.js +3 -2
- package/lib/esm/duet-nav.entry.js +1 -1
- package/lib/esm/duet-notification_2.entry.js +1 -1
- package/lib/esm/duet-number-input.entry.js +1 -1
- package/lib/esm/duet-page-heading.entry.js +1 -1
- package/lib/esm/duet-pagination_2.entry.js +1 -1
- package/lib/esm/duet-progress.entry.js +1 -1
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +1 -1
- package/lib/esm/duet-scrollable_3.entry.js +1 -1
- package/lib/esm/duet-section-layout.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +4 -3
- package/lib/esm/duet-slideout-lang.entry.js +1 -1
- package/lib/esm/duet-slideout-link.entry.js +1 -1
- package/lib/esm/duet-slideout-panel-dropdown.entry.js +1 -1
- package/lib/esm/duet-slideout-panel.entry.js +2 -2
- package/lib/esm/duet-slideout.entry.js +2 -2
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-submenu-bar-dropdown-link.entry.js +1 -1
- package/lib/esm/duet-submenu-bar-dropdown.entry.js +1 -1
- package/lib/esm/duet-submenu-bar-link.entry.js +1 -1
- package/lib/esm/duet-submenu-bar.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +3 -2
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-toolbar-dropdown-link.entry.js +1 -1
- package/lib/esm/duet-toolbar-dropdown.entry.js +1 -1
- package/lib/esm/duet-toolbar-link.entry.js +1 -1
- package/lib/esm/duet-toolbar.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +1 -1
- package/lib/esm/duet-tray.entry.js +1 -1
- package/lib/esm/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +3 -3
- package/lib/esm/{focus-utils-babfdd77.js → focus-utils-21faee80.js} +1 -1
- package/lib/esm/{index-1f0abe67.js → index-ccc5c541.js} +1 -1
- package/lib/esm/loader.js +3 -3
- package/lib/esm-es5/duet-action-button.entry.js +2 -2
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-checkmark.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-combobox.entry.js +1 -1
- package/lib/esm-es5/duet-contact-card.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table_3.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 +2 -2
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +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-menu-bar-button.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-dropdown-link.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-multiselect.entry.js +2 -2
- package/lib/esm-es5/duet-nav.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +1 -1
- package/lib/esm-es5/duet-page-heading.entry.js +1 -1
- package/lib/esm-es5/duet-pagination_2.entry.js +1 -1
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
- package/lib/esm-es5/duet-section-layout.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-lang.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-link.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-panel-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-slideout-panel.entry.js +1 -1
- package/lib/esm-es5/duet-slideout.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar-dropdown-link.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet-toggle.entry.js +2 -2
- package/lib/esm-es5/duet-toolbar-dropdown-link.entry.js +1 -1
- package/lib/esm-es5/duet-toolbar-dropdown.entry.js +1 -1
- package/lib/esm-es5/duet-toolbar-link.entry.js +1 -1
- package/lib/esm-es5/duet-toolbar.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/focus-utils-21faee80.js +4 -0
- package/lib/esm-es5/{index-1f0abe67.js → index-ccc5c541.js} +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/types/components/duet-combobox/duet-combobox.d.ts +3 -1
- package/lib/types/components/duet-fieldset/duet-fieldset.d.ts +7 -0
- package/lib/types/components/duet-input/duet-input.d.ts +7 -0
- package/lib/types/components/duet-multiselect/duet-multiselect.d.ts +7 -0
- package/lib/types/components/duet-select/duet-select.d.ts +7 -0
- package/lib/types/components/duet-textarea/duet-textarea.d.ts +7 -0
- package/lib/types/components.d.ts +42 -2
- package/package.json +5 -5
- package/lib/duet/p-0b3515f3.entry.js +0 -4
- package/lib/duet/p-1d54c498.system.entry.js +0 -4
- package/lib/duet/p-1ebda85b.entry.js +0 -4
- package/lib/duet/p-34429ce9.entry.js +0 -4
- package/lib/duet/p-3d47e55b.entry.js +0 -4
- package/lib/duet/p-4b9ca577.system.js +0 -4
- package/lib/duet/p-5f68a158.entry.js +0 -4
- package/lib/duet/p-7ea72ed8.entry.js +0 -4
- package/lib/duet/p-b78516ae.system.entry.js +0 -4
- package/lib/duet/p-f1572d2f.js +0 -4
- package/lib/esm-es5/focus-utils-babfdd77.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,a,i){function r(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,n){function o(e){try{s(i.next(e))}catch(t){n(t)}}function l(e){try{s(i["throw"](e))}catch(t){n(t)}}function s(e){e.done?a(e.value):r(e.value).then(o,l)}s((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,r,n,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(e){return function(t){return s([e,t])}}function s(l){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,l[0]&&(a=0)),a)try{if(i=1,r&&(n=l[0]&2?r["return"]:l[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,l[1])).done)return n;if(r=0,n)l=[l[0]&2,n.value];switch(l[0]){case 0:case 1:n=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;r=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(n=a.trys,n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){a.label=l[1];break}if(l[0]===6&&a.label<n[1]){a.label=n[1];n=l;break}if(n&&a.label<n[2]){a.label=n[2];a.ops.push(l);break}if(n[2])a.ops.pop();a.trys.pop();continue}l=t.call(e,a)}catch(s){l=[6,s];r=0}finally{i=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,a){if(a||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++){if(n||!(i in t)){if(!n)n=Array.prototype.slice.call(t,0,i);n[i]=t[i]}}return e.concat(n||Array.prototype.slice.call(t))};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{h,r as registerInstance,c as createEvent,H as Host,g as getElement,F as Fragment}from"./index-1f0abe67.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{f as fieldSorter,d as debounce}from"./js-utils-fa98b8cd.js";import{i as isKeyboardClick}from"./keyboard-utils-d237bd5a.js";import{g as getLanguage,c as connectLanguageChangeObserver,d as disconnectLanguageChangeObserver,a as getLocaleString,s as sanitizeString}from"./language-utils-6be16ff0.js";import{p as sizeNavigation,s as sizeHeader}from"./tokens.module-5601adc9.js";import{b as breakpointTokensUpTo,a as breakpointToToken}from"./token-utils-6e0e2653.js";import{c as createID}from"./create-id-981107da.js";import{p as parsePossibleJSON}from"./string-utils-5954f458.js";var TableData=function(e,t){var a=e.data,i=e.groupId,r=e.alignment;var n="duet-editable-table duet-editable-table-content-".concat(i);if(typeof a==="string"){return h("td",{innerHTML:a,class:n,part:"".concat(i,"content"),style:{verticalAlign:r}})}else{return h("td",{class:n,part:"".concat(i,"content"),style:{verticalAlign:r}},a)}};var duetEditableTableCss=".sc-duet-editable-table-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-actions-menu.sc-duet-editable-table{position:relative;padding:0 !important;margin:0}.duet-editable-table-actions-menu-button.sc-duet-editable-table{position:relative;right:-16px;float:right;padding:0}.duet-editable-table-actions-menu-icon.sc-duet-editable-table .duet-icon.sc-duet-editable-table{max-width:16px;max-height:16px}.duet-editable-table-row.duet-table-action-row.sc-duet-editable-table .duet-text-right.sc-duet-editable-table{text-align:right}.duet-editable-table-header.sc-duet-editable-table tr.sc-duet-editable-table .duet-editable-table-header-hidden.sc-duet-editable-table{padding:0 !important;font-size:0;border-bottom:0}";var DuetEditableTable=function(){function e(e){var t=this;registerInstance(this,e);this.duetTableToggle=createEvent(this,"duetTableToggle",7);this.duetMenuClick=createEvent(this,"duetMenuClick",7);this.hasHeadSlotFirst=false;this.hasHeadSlotLast=false;this.sortableDefaultLabel={fi:"Järjestä",en:"Click to sort",sv:"Klicka för att sortera"};this.actionColumnLabel={en:"Actions for rows",fi:"Toiminnot rivillä",sv:"Åtgärder för rader"};this.toggleColumn=function(e,a){a.preventDefault();var i=e.sort_order,r=e.direction,n=e.index,o=e.key;t.duetTableToggle.emit({sort_order:i,index:n,direction:r,key:o,component:"duet-editable-table",originalEvent:a})};this.handleKeyDown=function(e,a){if(isKeyboardClick(a)){t.toggleColumn(e,a)}};this.language=getLanguage();this.margin="auto";this.variation="striped";this.sticky=false;this.stickyDistance="with-links";this.breakpoint="small";this.actions=undefined;this.columns=undefined;this.rows=undefined;this.sortable=false;this.groupId="";this.theme="";this.accessibleRole=undefined;this.hideHeadVisually=false}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.hasHeadSlotFirst=!!this.element.querySelector("[slot='thead-first']");this.hasHeadSlotLast=!!this.element.querySelector("[slot='thead-last']")};e.prototype.connectedCallback=function(){connectLanguageChangeObserver(this)};e.prototype.disconnectedCallback=function(){disconnectLanguageChangeObserver(this)};e.prototype.createLabel=function(e){var t=this;var a=e.sort_order,i=e.direction,r=e.index,n=e.label;var o=getLocaleString(n);if(!this.sortable){return o}var l=function(){if(!!a&&i===1){return"action-arrow-down-small"}else if(!!a&&i===-1){return"action-arrow-up-small"}return"action-subtract-small"};return h("span",{class:"duet-table-label","data-index":r},h("duet-button",{size:"small",icon:l(),"icon-size":"medium-small","accessible-label":this.sortableDefaultLabel[this.language],variation:"plain",margin:"none","icon-right":true,onClick:function(a){return t.toggleColumn(e,a)},onKeyDown:function(a){return t.handleKeyDown(e,a)}},o))};e.prototype.getSortedColumns=function(){return __spreadArray([],this.columns,true).sort(fieldSorter(["index"]))};e.prototype.getRowSortOrder=function(){var e=__spreadArray([],this.columns,true).sort(fieldSorter(["sort_order"]));return e.filter((function(e){return e.sort_order})).map((function(e){return e.direction===-1?"-".concat(e.key):e.key}))};e.prototype.renderTableHeader=function(){var e=this;if(!this.columns){return}var t=this.getSortedColumns();return h("tr",{class:{"duet-table-action-header":!!this.actions}},t.map((function(t){if(t.display!==false){var a=e.createLabel(t);return a!==""?h("th",{scope:"col"},a):h("td",null)}})),this.actions&&h("th",{scope:"col",class:"duet-table-action-header-heading"},this.actions&&h("duet-visually-hidden",null,this.actionColumnLabel[this.language])))};e.prototype.renderActions=function(e,t){var a=this;if(!this.actions){return}return h("td",{class:"duet-text-right"},this.actions.map((function(i){return h("duet-action-button",{actionMeta:Object.assign({},(e===null||e===void 0?void 0:e.meta)||{},{index:t}),actionId:(e===null||e===void 0?void 0:e.uid)||(e===null||e===void 0?void 0:e.id)||null,actionName:i.name,theme:a.theme,iconName:i.icon,iconColor:i.color,iconSize:i.size,background:i.background,"accessible-label":"".concat(e.actionDescription||""," ").concat(getLocaleString(i.label)," ")})})))};e.prototype.renderTableBody=function(){var e=this;var t=this.getSortedColumns();var a=this.getRowSortOrder();var i=__spreadArray([],this.rows,true).sort(fieldSorter(a));return i.map((function(a,i){var r;return h("tr",{class:(r={"duet-table-action-row":!!e.actions,"duet-editable-table-row":true},r["duet-editable-table-row-".concat(e.groupId)]=true,r),"data-meta":JSON.stringify(a.meta)},t.map((function(t){var i=a[t.key]?a[t.key]:a.item;if(t.display!==false){return h(TableData,{data:i,groupId:e.groupId})}})),e.actions&&e.renderActions(a,i))}))};e.prototype.render=function(){var e;return h(Host,{class:(e={},e["duet-editable-table-".concat(this.variation)]=true,e["duet-editable-table"]=true,e["duet-editable-table-".concat(this.theme)]=true,e["duet-editable-table-scrollable"]=this.breakpoint==="none-scrollable",e["duet-editable-table-sortable"]=this.sortable,e["duet-editable-table-actions"]=!!this.actions,e["duet-m-0"]=this.margin==="none",e["duet-theme-turva"]=this.theme==="turva",e)},h("duet-table",{class:"duet-editable-table-table",sticky:this.sticky,stickyDistance:this.stickyDistance,margin:this.margin,theme:this.theme,variation:this.variation,breakpoint:this.breakpoint,"hide-head-visually":this.hideHeadVisually},h("table",{role:this.accessibleRole},h("caption",null,h("slot",{name:"tcaption"})),h("thead",null,this.hasHeadSlotFirst&&h("tr",null,h("td",{class:"duet-editable-table-actions-menu",colSpan:99},h("slot",{name:"thead-first"}))),this.renderTableHeader(),this.hasHeadSlotLast&&h("tr",null,h("td",{class:"duet-editable-table-actions-menu",colSpan:99},h("slot",{name:"thead-last"})))),h("tbody",null,this.renderTableBody()),h("tfoot",null,h("tr",null,h("th",{class:"duet-editable-table-footer-menu",colSpan:99},h("slot",{name:"tfoot"})))))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetEditableTable.style=duetEditableTableCss;var duetTableCss='duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{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;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-table-hide-head-visually.duet-table-hide-head-visually thead,duet-table.duet-table-hide-head-visually.duet-table-hide-head-visually thead *{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}duet-table.duet-theme-turva table{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:rgb(0, 41, 77)}duet-table.duet-theme-turva td{color:rgb(23, 28, 58)}duet-table th{font-weight:600;line-height:1.25;color:rgb(101, 119, 135);text-align:left}duet-table.duet-theme-turva th{color:rgb(116, 116, 117)}duet-table tbody th{font-weight:600;color:rgb(0, 41, 77)}duet-table.duet-theme-turva tbody th{color:rgb(23, 28, 58)}duet-table .duet-table-action-row td:last-child{justify-self:end;padding-right:20px !important;white-space:nowrap}.duet-table-flattened table,.duet-table-flattened thead,.duet-table-flattened tbody,.duet-table-flattened tfoot,.duet-table-flattened th,.duet-table-flattened td,.duet-table-flattened tr{display:block}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:rgb(101, 119, 135);text-align:left}.duet-table-flattened td[data-heading]::before{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:rgb(0, 41, 77);content:attr(data-heading)}.duet-table-flattened.duet-theme-turva td[data-heading]::before{color:rgb(23, 28, 58)}.duet-table-sticky thead th{position:sticky;top:0;background:rgb(255, 255, 255)}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:rgb(255, 255, 255)}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:rgb(228, 228, 230)}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:rgb(228, 228, 230)}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:rgb(228, 228, 230)}.duet-table-fixed th,.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid rgb(101, 119, 135)}.duet-table-fixed th:first-child,.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-fixed th:last-child,.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-fixed th,.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:rgb(68, 68, 69)}.duet-table-fixed tbody th,.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:rgb(225, 227, 230)}.duet-theme-turva.duet-table-fixed tbody th,.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:rgb(228, 228, 230)}.duet-table-fixed td,.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-fixed td:first-child,.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-fixed td:last-child,.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-fixed tbody td,.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid rgb(225, 227, 230)}.duet-theme-turva.duet-table-fixed tbody td,.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:rgb(228, 228, 230)}.duet-table-flattened.duet-table-fixed tbody:first-of-type th,.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-fixed td,.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-fixed tr,.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-fixed tfoot td,.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-fixed tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:rgb(228, 228, 230)}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-fixed table{table-layout:fixed}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td,.duet-table-fixed tbody tr td:first-child{padding:4px !important;vertical-align:text-bottom;border-bottom:0 none}.duet-table-fixed thead{display:none}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td{border-bottom:0 none}.duet-table-fixed:not(.duet-table-flattened) tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-fixed:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}.duet-table-sortable tbody tr td:first-child,.duet-table-sortable thead tr th:first-child{padding:20px}.duet-table-sortable:not(.duet-table-flattened) tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-sortable:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-actions table{table-layout:auto}.duet-table-actions thead th:last-child{width:1px;white-space:nowrap}.duet-editable-table-table.duet-table-flattened tr{display:grid;grid-template-columns:repeat(2, 1fr);grid-auto-rows:auto;gap:10px}.duet-editable-table-table.duet-table-flattened tr.duet-table-action-row td:last-child::before{padding:0;content:""}.duet-editable-table-table.duet-table-flattened td{grid-column:1/2}.duet-editable-table-table.duet-table-flattened td:first-child{grid-row:1;grid-column:1}.duet-editable-table-table.duet-table-flattened td:last-child{grid-row:1;grid-column:2}';var stickyTopValues={none:0,"with-links":parseFloat(sizeNavigation)*16,"without-links":parseFloat(sizeHeader)*16};var DuetTable=function(){function e(e){var t=this;registerInstance(this,e);this.headingSelector="thead tr > :not(*.duet-editable-table-actions-menu)";this.handleMediaQueryChange=function(e){t.matchesBreakpoint=breakpointTokensUpTo.includes(t.breakpoint)?!e.matches:e.matches};this.matchesBreakpoint=true;this.language=getLanguage();this.theme=undefined;this.margin="auto";this.variation="striped";this.sticky=false;this.stickyDistance="with-links";this.breakpoint="small";this.hideHeadVisually=false}e.prototype.watchLanguageStateHandler=function(e,t){var a=this;if(e!==t){setTimeout((function(){return a.copyHeadingsToCells()}),50)}};e.prototype.connectedCallback=function(){var e=this;var t=this.breakpoint==="none"||this.breakpoint==="none-scrollable"?"all":breakpointToToken[this.breakpoint];this.mq=matchMedia(t);this.mq.addEventListener("change",debounce(this.handleMediaQueryChange,50));this.handleMediaQueryChange(this.mq);this.observer=new MutationObserver((function(){return debounce(e.copyHeadingsToCells(),50)}));this.observer.observe(this.element,{childList:true,subtree:true})};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.copyHeadingsToCells();if(this.sticky&&this.breakpoint==="none-scrollable"){console.warn('[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence')}if(this.sticky){var e=stickyTopValues[this.stickyDistance];var t=this.element.querySelectorAll(this.headingSelector);t.forEach((function(t){return t.style.top="".concat(e,"px")}))}};e.prototype.componentDidLoad=function(){this.observer?this.observer.takeRecords():null;connectLanguageChangeObserver(this)};e.prototype.disconnectedCallback=function(){this.observer.disconnect();this.observer=null;this.mq.removeListener(this.handleMediaQueryChange);this.mq=null;this.matchesBreakpoint=true;disconnectLanguageChangeObserver(this)};e.prototype.copyHeadingsToCells=function(){var e=this.element.querySelectorAll(this.headingSelector);var t=this.element.querySelectorAll("tbody tr");var a=Array.from(e).map((function(e){return e.textContent.trim()}));t.forEach((function(e){e.querySelectorAll("td").forEach((function(e,t){if(a[t]){e.dataset.heading=a[t]}}))}))};e.prototype.render=function(){var e;return h(Host,{class:(e={},e["duet-table-".concat(this.variation)]=true,e["duet-table-flattened"]=!this.matchesBreakpoint,e["duet-table-sticky"]=this.matchesBreakpoint&&this.sticky,e["duet-table-scrollable"]=this.breakpoint==="none-scrollable",e["duet-m-0"]=this.margin==="none",e["duet-theme-turva"]=this.theme==="turva",e["duet-table-hide-head-visually"]=this.hideHeadVisually,e)},h("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{language:["watchLanguageStateHandler"]}},enumerable:false,configurable:true});return e}();DuetTable.style=duetTableCss;var errorCodes=[{type:"default",system_message:"unknown error",message:{fi:"Tapahtui tuntematon virhe, ole hyvä ja yritä uudelleen.",sv:"Ett okänt fel uppstod, försök igen.",en:"An unknown error occured, please try again."}},{type:"400",system_message:"Bad Request: The server could not understand the request due to invalid syntax.",message:{fi:"Tiedostoa ei hyväksytty.",sv:"Servern avvisade din fil.",en:"The server rejected your file."}},{type:"401",system_message:"Not Authenticated: The client must authenticate itself to get the requested response...",message:{fi:"Vain kirjautunut käyttäjä voi lähettää tiedostoja.",sv:"Du måste vara inloggad för att ladda upp filer.",en:"You need to be logged in to upload files."}},{type:"403",system_message:"No Access: The client does not have access rights to the content.",message:{fi:"Ei oikeuksia lähettää tiedostoja.",sv:"Du har inte rätt åtkomsträttigheter för att ladda upp filer.",en:"You do not have the correct access rights to upload files."}},{type:"413",system_message:"Payload too large",message:{fi:"Tiedosto oli liian vastaanotettavaksi.",sv:"Filen var för stor för servern att hantera.",en:"The file was to large for the server to handle."}},{type:"415",system_message:"Unsupported media type",message:{fi:"Tiedoston tyyppi oli väärä.",sv:"Servern avvisade filen eftersom den hade fel typ.",en:"The server rejected the file because it had the wrong type."}},{type:"429",system_message:"Too many request from same address",message:{fi:"Liian monta yritystä, ole hyvä ja yritä myöhemmin uudelleen.",sv:"Servern har fått många förfrågningar från dig, försök igen senare.",en:"The server has received to many request from you, please try again later."}},{type:"500",system_message:"Internal Server Error",message:{fi:"Palvelin ilmoitti tuntemattomasta virheestä ja lataus epäonnistui.",sv:"Servern rapporterade ett okänt fel och uppladdningen misslyckades.",en:"The server reported an unknown error and the upload failed."}},{type:"duet-upload-100",system_message:"File extension not allowed",message:{fi:"Tiedoston tyyppi ei ole sallittu.",sv:"Du kan inte ladda upp filer av den type.",en:"You cannot upload files with that extension."}},{type:"duet-upload-001",system_message:"File transfer failed",message:{fi:"Tiedoston lähetys keskeytyi, ole hyvä ja yritä uudelleen.",sv:"Din anslutning till servern avbröts, försök igen.",en:"Your connection to the server was interrupted, try again."}},{type:"duet-upload-101",system_message:"File mimetype not allowed",message:{fi:"Tiedoston tyyppi ei ole sallittu.",sv:"Du kan inte ladda upp filer av den typ.",en:"You cannot upload files of that type."}},{type:"duet-upload-201",system_message:"File is too large",message:{fi:"Tiedosto on liian iso.",sv:"Filen är större än tillåtet.",en:"The file is larger than permitted."}},{type:"duet-upload-202",system_message:"The combined size of all files is too large",message:{fi:"Tiedostojen yhteenlaskettu koko on liian iso.",sv:"Du har nått den maximala kombinerade filstorleken.",en:"You have reached the maximum combined filesize."}},{type:"duet-upload-301",system_message:"The maximum file limit has been reached",message:{fi:"Liitteiden maksimimäärä saavutettu.",sv:"Maximalt antal bilagor har uppnåtts.",en:"Maximum number of attachments reached."}}];var getError=function(e,t){var a={type:undefined,system_message:undefined,message:undefined};t=parsePossibleJSON(t);a=t.filter((function(t){return t.type==e}))[0];if(!a){a=t.filter((function(e){return e.type==="default"}))[0]}return a};var getI18nError=function(e,t){var a=getError(e,t);var i=getLocaleString(a.message);if(i===""||!i){return a.system_message}else{return i}};var formatBytes=function(e,t){if(t===void 0){t=2}if(e===0){return"0 Bytes"}var a=1024;var i=t<0?0:t;var r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];var n=Math.floor(Math.log(e)/Math.log(a));return parseFloat((e/Math.pow(a,n)).toFixed(i))+" "+r[n]};var UploadItem=function(e){var t=e.data,a=e.showLinks,i=e.type,r=e.actions,n=e.errorCodes,o=e.theme,l=e.label,s=e.categoryLabel,d=e.showCategory;var u=t.uid,p=t.item,c=t.size,b=t.uploaded,f=t.url,m=t.meta,g=t.progress,y=t.error;var v=p.name;var x=function(){switch(i){case"inprogress":return h("span",{class:"duet-upload-item-name"},h("duet-paragraph",{class:"duet-upload-item-name",color:"gray-darker",margin:"none",weight:"semi-bold"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v),h("duet-progress",{progress:Math.ceil(g),"aria-hidden":true}));case"pending":return h("span",{class:"duet-upload-item-name"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v);case"failure":return h("span",{class:"duet-upload-item-error",role:"status"},h("duet-paragraph",{class:"duet-upload-item-name",color:"danger",margin:"none",weight:"semi-bold"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v),h("duet-paragraph",{class:"duet-upload-item-error-label",size:"small",margin:"none",color:"danger"},getI18nError(y.type,n)));default:return b&&f&&a?h("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},h("duet-link",{url:f,external:true},k),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),w):h("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},k,h("duet-spacer",{size:"xx-small",direction:"horizontal"}),w)}};var k=h("span",{class:"duet-upload-item-name"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v);var w=h("span",{class:"duet-upload-item-size",style:{fontSize:"14px",fontWeight:"400"}},"(",formatBytes(c),")");var L=m&&m.badges?h("span",null,m.badges.map((function(e){return h("duet-badge",{color:"primary"},e)}))):undefined;var I="".concat(m&&m.badges?m.badges.join(","):""," ").concat(v);return h("div",{class:{"upload-item-row":true}},d&&h("div",{class:"item-categories"},h("duet-heading",{class:"heading",color:"color-secondary",level:"h6",weight:"semibold"},getLocaleString(s)),L),h("div",{class:{"item-name":true,"no-category":!d}},!!l&&h("duet-heading",{class:"heading",color:"color-secondary",level:"h6",weight:"semibold"},getLocaleString(l)),x()),h("div",{class:"item-actions"},r.map((function(e){return h("duet-action-button",{actionMeta:Object.assign({},m||{}),actionId:u||null,actionName:e.name,theme:o,iconName:e.icon,iconColor:e.color,iconSize:e.size,background:e.background,"accessible-label":"".concat(I," ").concat(getLocaleString(e.label)," ")})}))))};var UploadItemHeader=function(e){var t=e.label,a=e.categoryLabel;return h("div",{class:"items-header"},a&&h("duet-heading",{class:"category-header",border:"solid",color:"gray-darker",level:"h3","visual-level":"h6",weight:"semibold",margin:"none"},getLocaleString(a)),h("duet-heading",{class:{"filename-header":true,"no-category":!a},border:"solid",color:"gray-darker",level:"h3","visual-level":"h6",weight:"semibold",margin:"none"},getLocaleString(t)))};var validateFileExtension=function(e,t){if(!t){return true}var a=e.split(".");var i=t.split(",");var r=a[a.length-1];return i.includes(r)};var validateFileMime=function(e,t){if(!t||!e){return true}var a=t.split(",");var i=false;a.forEach((function(t){var a=t.split("/");var r=e.split("/");if(a[0]===r[0]&&(a[1]===r[1]||a[1]==="*")){i=true}}));return i};var validateFileSize=function(e,t){if(!t||!e){return true}return t>=e};var validateFile=function(e,t,a){var i=t.allowedMimetypes,r=t.allowedExtensions,n=t.maxBytes;var o=false;var l=getError("default",a);if(e){var s=e.name,d=e.type,u=e.size;var h=validateFileMime(d,i);var p=r==="all"||r===""||r===" "||r===undefined?true:validateFileExtension(s.toLowerCase(),r);var c=validateFileSize(u,n);if(!h){l=getError("duet-upload-101",a)}if(!p){l=getError("duet-upload-100",a)}if(!c){l=getError("duet-upload-201",a)}o=h&&p&&c}else{o=false}return{valid:o,errorMessage:o?undefined:getLocaleString(l.message),errorSystem:o?undefined:l.system_message,errorType:o?undefined:l.type}};var validateTotalSizeIsAboveMax=function(e,t){var a=0;if(t){e.forEach((function(e){if(e.valid&&e.size){a+=e.size}}));if(a>t){return true}}return false};var validateTotalAmountIsAboveMax=function(e,t){var a=0;if(t){e.forEach((function(e){if(e.valid){a++}}));if(a>t){return true}}return false};var makeXhrRequest=function(e){var t=e.payload,a=e.options,i=e.onFailure,r=e.onSuccess,n=e.onProgress;var o=a.type,l=o===void 0?"POST":o,s=a.xhr,d=a.uri,u=a.argument,h=u===void 0?null:u,p=a.headers,c=p===void 0?null:p;s.open(l,"".concat(d).concat(h||""),true);var b=t.data,f=t.name;if(c){Object.keys(c).forEach((function(e){s.setRequestHeader(e,c[e])}))}if(l==="POST"){s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE&&s.status>=200&&s.status<300){r(s,f,s.status)}if(s.readyState===XMLHttpRequest.DONE&&s.status>=300&&s.status<999){i(s,f,s.status)}};n(f)}s.send(b);return s};var duetUploadCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}::slotted([slot=header]){margin-bottom:16px}::slotted([slot=fileheader]){margin:16px 0 0 0}::slotted([slot=filefooter]){margin-top:16px}::slotted([slot=uploadfooter]){margin-top:20px}.duet-upload{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-upload-item-size{font-size:0.75rem;font-weight:400}.duet-upload-filelist{margin-bottom:25px}.duet-upload-filelist-empty{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:rgb(245, 248, 250)}.duet-upload-filelist-empty-label{font-size:1rem;font-weight:400}.duet-upload-editable-table-header-hidden{display:none}.duet-upload-editable-table tbody .duet-upload-editable-table-data{padding:0 !important;border:0}.duet-upload-editable-table duet-editable-table tfoot,.duet-upload-editable-table duet-editable-table thead{display:none}.duet-upload-editable-table duet-editable-table .duet-editable-table-content{padding-right:0 !important;padding-left:0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td{padding:1rem 0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td:last-child{padding-right:0 !important}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress,.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending{position:relative}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-progress,.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending duet-progress{position:absolute;bottom:0;width:100%}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-action-button::part(button),.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending duet-action-button::part(button){border:0}duet-paragraph::part(duet-paragraph){word-break:break-word}duet-editable-table tfoot{display:none}.upload-bottom-caption{margin-top:12px;margin-bottom:28px}.items-header{display:none;flex-direction:row;margin-bottom:0}@media (min-width: 36em){.items-header{display:flex}}.items-header:not(:last-child),.items-header:not(:first-child){margin-top:12px}.items-header .category-header{width:35%}.items-header .filename-header{width:65%}.items-header .filename-header.no-category{width:100%}.upload-item-row{display:flex;flex-direction:column;gap:16px;align-content:center;align-items:center;padding:16px 0 16px 0;border-bottom:1px solid rgb(225, 227, 230)}@media (min-width: 36em){.upload-item-row{flex-direction:row;gap:10px}}.upload-item-row .item-categories{width:100%}@media (min-width: 36em){.upload-item-row .item-categories{width:35%}}.upload-item-row .item-name{position:relative;bottom:2px;width:100%;text-align:left}@media (min-width: 36em){.upload-item-row .item-name{width:50%}.upload-item-row .item-name.no-category{width:85%}}.upload-item-row .item-categories .heading,.upload-item-row .item-name .heading{display:block}@media (min-width: 36em){.upload-item-row .item-categories .heading,.upload-item-row .item-name .heading{display:none}}.upload-item-row .item-actions{width:100%;margin-left:-8px;text-align:left}@media (min-width: 36em){.upload-item-row .item-actions{width:15%;padding-top:0;margin-left:auto;text-align:right}}.upload-item-row .duet-upload-item-name duet-icon{position:relative;top:4px}.upload-item-row .duet-upload-item-name duet-progress{display:block;margin-top:16px}";var DuetUpload=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",3);this.duetBlur=createEvent(this,"duetBlur",7);this.duetFocus=createEvent(this,"duetFocus",7);this.duetReady=createEvent(this,"duetReady",7);this.duetDone=createEvent(this,"duetDone",3);this.duetState=createEvent(this,"duetState",3);this.duetDelete=createEvent(this,"duetDelete",3);this.duetCancel=createEvent(this,"duetCancel",3);this.duetProgress=createEvent(this,"duetProgress",3);this.duetUpload=createEvent(this,"duetUpload",3);this.buttonId=createID("DuetButton");this.labelId=createID("DuetLabel");this.uploadId=createID("DuetUpload");this.filesInProgress=new Map;this.fileMaxReached=false;this.bytesMaxReached=false;this.internalStatusMessageLabel=undefined;this.DefaultGroups={inprogress:"inprogress",success:"success",pending:"pending",failure:"failure"};this.kick=debounce((function(){t.tick=Date.now()}),30);this.categoryLabel={en:"Category",sv:"Filtyp",fi:"Tiedostotyyppi"};this.listenForActionEvents=function(){t.element.addEventListener("duetActionEvent",(function(e){var a=e.detail;var i=a.action,r=a.id,n=a.originalEvent;switch(i){case"delete":t.onDelete(r,n);break;case"cancel":t.onCancel(r,n);break}}))};this.verifyValidity=function(){var e=t.getFilesAsArray(),a=e.invalid,i=e.valid;var r=t.valid;t.valid=a.length===0&&i.length!==0;if(t.valid!==r){t.duetState.emit({originalEvent:undefined,data:{valid:t.valid,from:"componentWillRender"},component:"duet-upload"})}};this.getGroupFromItemData=function(e){if(e.valid&&e.progress===100){return t.DefaultGroups.success}else if(e.progress>0&&e.progress!==100){return t.DefaultGroups.inprogress}else if(!e.valid){return t.DefaultGroups.failure}else if(e.pending){return t.DefaultGroups.pending}else if(e.group){return e.group}else{return"none"}};this.mapFilesToUploadItems=function(e,a,i){if(a===t.DefaultGroups.success){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"success",data:e,showLinks:t.showLinks,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(a===t.DefaultGroups.inprogress){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"inprogress",data:e,showLinks:t.showLinks,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(a===t.DefaultGroups.pending){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"pending",data:e,showLinks:t.showLinks,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(a===t.DefaultGroups.failure){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"failure",data:e,showLinks:t.showLinks,errorCodes:t.errorCodes,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(e.group){return e.html}else{return"none"}};this.genHashName=function(){return Date.now().toString(36)+Math.random()};this.updateValueInMap=function(e,a,i,r){if(r===void 0){r=true}try{var n=t.files.get(e);n[a]=i;t.files.set(e,n)}catch(o){}if(r){t.kick()}};this.updateProgress=function(e,a){var i=function(i){t.updateValueInMap(a,"progress",i);t.onProgress(a,i,e)};if(e.lengthComputable){var r=e.loaded/e.total*100;i(r)}else{console.log("cant read progress")}};this.trackProgress=function(e,a){if(a===void 0){a=false}if(a){t.filesInProgress.delete(e)}else{t.filesInProgress.set(e,"inprogress")}if(t.filesInProgress.size===0){t.onDone()}};this.getFilesAsArray=function(){var e=[];var a=[];t.files.forEach((function(t){if(t.valid&&!t.deleted){e.push(t)}else if(!t.valid&&!t.deleted){a.push(t)}}));return{valid:e,invalid:a}};this.resetFormFields=function(){t.nativeInput.value=""};this.startUpload=function(e,a){if(a===void 0){a=undefined}return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.metaData=a;this.nativeInput.click();this.onUpload(e,a);e.stopPropagation();e.preventDefault();return[2]}))}))};this.transferComplete=function(e){t.updateValueInMap(e,"progress",100,false);t.trackProgress(e,true)};this.transferDone=function(e,a,i){t.updateValueInMap(a,"status",i,false);t.updateValueInMap(a,"uploaded",true,false);try{var r=JSON.parse(e.response);t.updateValueInMap(a,"url",r.url)}catch(n){t.updateValueInMap(a,"url",null);console.error("Server did not respond with expected response {url: string}")}return};this.transferDoneWithFailure=function(e,a,i){try{var r=JSON.parse(e.response).error;t.updateValueInMap(a,"error",{message:r.message,type:r.type},false)}catch(n){console.error("Server did not respond with expected response error:{message: string, type: int}");t.updateValueInMap(a,"error",{type:i},false)}t.updateValueInMap(a,"valid",false,true)};this.transferFailed=function(e){t.updateValueInMap(e,"error",getI18nError("duet-upload-001",t.errorCodes))};this.transferCanceled=function(e){t.files.delete(e);t.validateTotals(e);t.kick()};this.validateTotals=function(e){var a=validateTotalSizeIsAboveMax(t.files,t.maxBytesTotal);var i=validateTotalAmountIsAboveMax(t.files,t.maxFiles);if(a&&e){t.updateValueInMap(e,"error",getI18nError("duet-upload-202",t.errorCodes),false)}if(i&&e){t.updateValueInMap(e,"error",getI18nError("duet-upload-301",t.errorCodes),false)}t.bytesMaxReached=a;t.fileMaxReached=i;return{bytesMaxReached:a,fileMaxReached:i}};this.uploadFile=function(e,a,i){if(a===void 0){a=false}return __awaiter(t,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(o){switch(o.label){case 0:if(!a&&this.deferUpload){this.updateValueInMap(e.item.name,"pending",true,false);this.updateValueInMap(e.item.name,"group","pending",true)}else if(a){this.updateValueInMap(e.item.name,"pending",false,false);this.updateValueInMap(e.item.name,"group",undefined,true)}o.label=1;case 1:o.trys.push([1,4,,5]);if(!(!this.deferUpload||a))return[3,3];t=new FormData;t.append("file",e.item);if(i){t.append("key",i)}t.append("uid",e.uid);t.append("name",e.item.name);t.append("metadata",JSON.stringify({uid:e.uid,url:this.uri,size:e.item.size,meta:e.meta}));r=e;return[4,this.makeXHRPostRequest(t)];case 2:r.xhr=o.sent();o.label=3;case 3:return[3,5];case 4:n=o.sent();this.updateValueInMap(e.item.name,"valid",false,false);return[3,5];case 5:return[2]}}))}))};this.uploadPendingFiles=function(){for(var e=0,a=Array.from(t.files.entries());e<a.length;e++){var i=a[e],r=i[0],n=i[1];if(n.group==="pending"&&n.pending===true){t.uploadFile(n,true,r)}}};this.getItemFromUID=function(e){for(var a=0,i=Array.from(t.files.entries());a<i.length;a++){var r=i[a],n=r[0],o=r[1];if(o.uid===e){return{value:o,key:n}}}return null};this.onDelete=function(e,a){var i=t.getItemFromUID(e);var r=i.key;var n=t.files.get(r);t.files.delete(r);t.validateTotals();t.kick();t.duetDelete.emit({originalEvent:a,data:{deletion:n},component:"duet-upload"});if(!t.external&&!n.pending){t.makeXHRDeleteRequest(n)}t.resetFormFields()};this.onCancel=function(e,a){var i=t.getItemFromUID(e).key;var r=t.files.get(i);t.files.delete(i);if(!t.external){var n=r.xhr;if(n){n.abort()}}else{t.kick()}t.resetFormFields();t.duetCancel.emit({originalEvent:a,data:{cancelled:r},component:"duet-upload"})};this.onUpload=function(e,a){t.duetUpload.emit({originalEvent:e,metaData:a,component:"duet-upload"})};this.onBlur=function(e){t.duetBlur.emit({originalEvent:e,component:"duet-upload"})};this.onProgress=function(e,a,i){t.duetChange.emit({originalEvent:i,data:{key:e,percentComplete:a},component:"duet-upload"})};this.onFocus=function(e){t.duetFocus.emit({originalEvent:e,component:"duet-upload"})};this.onReady=function(){t.duetReady.emit({component:"duet-upload"})};this.onDone=function(){t.duetDone.emit({component:"duet-upload",data:{files:t.files}})};this.filterMap=function(){var e=Array.from(t.files.values());var a=[];var i=[];var r=[];var n=[];var o=false;e.forEach((function(e){var l=t.getGroupFromItemData(e);if(e.meta&&!!e.meta.badges){o=true}if(l===t.DefaultGroups.success){n.push({uid:e.uid,data:e})}else if(l===t.DefaultGroups.inprogress){a.push({uid:e.uid,data:e})}else if(l===t.DefaultGroups.pending){r.push({uid:e.uid,data:e})}else if(l===t.DefaultGroups.failure){i.push({uid:e.uid,data:e})}else if(e.group){a.push({uid:e.uid,data:e})}}));return{pending:r,failure:i,success:n,inprogress:a,hasCategory:o}};this.getActions=function(e){return t.actions.filter((function(t){return t.map.includes(e)}))};this.renderUploadedItems=function(){var e=t.filterMap();var a=e.hasCategory;var i=t.groups.map((function(i){var r=e[i.id];if(!(r===null||r===void 0?void 0:r.length)){return}return h(Fragment,null,!t.hideGroups&&h(UploadItemHeader,{categoryLabel:a?t.categoryLabel:undefined,label:i.label}),r.map((function(e){return t.mapFilesToUploadItems(e.data,i.id,a)})))}));return h(Fragment,null,t.showUploadedItemsHeader&&h(UploadItemHeader,{categoryLabel:a?t.categoryLabel:undefined,label:t.uploadedItemsHeaderLabel}),i)};this.tick=Date.now();this.accessibleActiveDescendant=undefined;this.accessibleDescribedBy=undefined;this.accessibleControls=undefined;this.accessibleOwns=undefined;this.external=false;this.middleware=null;this.deferUpload=false;this.hideButton=false;this.actions=[{icon:"action-delete",color:"color-danger",size:"x-small",background:"gray-lightest",name:"delete",map:["success","failure"],label:{fi:"Poista tiedosto",en:"Delete the file",sv:"Ta bort filen"}},{icon:"navigation-close",color:"primary",size:"x-small",background:"gray-lightest",name:"cancel",map:["inprogress","pending"],label:{fi:"Keskeytä lähetys",en:"Cancel the upload",sv:"Stop överföringen"}}];this.uri=undefined;this.showLinks=false;this.caption=undefined;this.statusLabelDefaults={fi:{inProgress:"Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",inProgressWithErrors:"Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",done:"Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",doneWithErrors:"Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",files:"tiedostot",file:"tiedosto"},sv:{inProgress:"Adding {filesUploaded} of {filesTotal}",inProgressWithErrors:"Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",done:"Alla {filesTotal} har lagts till",doneWithErrors:"Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",files:"filer",file:"fil"},en:{inProgress:"Adding {filesUploaded} of {filesTotal}",inProgressWithErrors:"Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",done:"All {filesTotal} added successfully",doneWithErrors:"Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",files:"File",file:"file"}};this.statusMessageLabel=getLocaleString(this.statusLabelDefaults);this.buttonLabelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add an attachment"};this.buttonLabel=getLocaleString(this.buttonLabelDefaults);this.accessibleButtonLabel=undefined;this.theme="";this.disabled=false;this.identifier=undefined;this.margin="auto";this.required=false;this.alignment="middle";this.hideGroups=false;this.files=new Map;this.valid=!this.required;this.labelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add attachments"};this.label=getLocaleString(this.labelDefaults);this.descriptionDefaults={en:"You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytestotal} of files at a time, and add up to {maxfiles} attachments at a time each no larger than {maxbytes}.",sv:"Du kan bifoga följande filtyper: {filetypes} - samt de vanligaste videofilerna. Du kan ladda upp {maxbytestotal} av filer åt gången, och lägga till upp till {maxfiles} bilagor åt gången varje inte större än {maxbytes}.",fi:"Voit liittää seuraavat tiedostotyypit: {filetypes} - sekä yleisimmät videotiedostot. Voit lähettää {maxbytestotal} tiedostoa kerrallaan, ja lisätä enintään {maxfiles} liitettä kerrallaan, jokainen enintään {maxbytes} kokoisena."};this.description=getLocaleString(this.descriptionDefaults);this.fileListEmptyDefaults={fi:"Ei vielä lisättyjä tiedostoja.",sv:"Inga filer har lagts till ännu.",en:"No files added yet."};this.fileListEmpty=getLocaleString(this.fileListEmptyDefaults);this.error="";this.errorCodes=errorCodes;this.name=undefined;this.maxBytes=2e8;this.maxBytesTotal=undefined;this.maxFiles=99;this.allowedExtensions="all";this.allowedMimetypes="*";this.multiple=true;this.limitSelection=false;this.value=undefined;this.externalUploadButtonId=undefined;this.captionOnBottom=false;this.showUploadedItemsHeader=false;this.uploadedItemsHeaderLabel={fi:"Ladattu tiedosto",sv:"Lägg till en bilaga",en:"Uploaded file"};this.hideHeader=false;this.groups=[{id:this.DefaultGroups.success,label:{fi:"Valmiit tiedostot",sv:"Files success",en:"Files success"}},{id:this.DefaultGroups.failure,label:{fi:"Tiedostot, joissa on virheitä",sv:"Filer med fel",en:"Files with errors"}},{id:this.DefaultGroups.inprogress,label:{fi:"Kesken olevat tiedostot",sv:"Filer inprogress",en:"Files inprogress"}},{id:this.DefaultGroups.pending,label:{en:"Files to upload",sv:"Filer att ladda",fi:"Ladattavat tiedostot"}}]}e.prototype.watchValidHandler=function(e,t){if(e!==t){this.kick()}};e.prototype.componentWillLoad=function(){if(typeof this.statusMessageLabel==="string"){this.internalStatusMessageLabel=sanitizeString(this.groups)}else{this.internalStatusMessageLabel=this.statusMessageLabel}inheritGlobalTheme(this);this.listenForActionEvents();this.onReady();this.externalUploadButton=document.querySelector("#".concat(this.externalUploadButtonId))};e.prototype.componentWillRender=function(){this.verifyValidity()};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput){this.nativeInput.focus(e)}return[2]}))}))};e.prototype.upload=function(e){if(e===void 0){e=undefined}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.setFocus()];case 1:t.sent();this.metaData=e;this.nativeInput.click();return[2]}}))}))};e.prototype.uploadPending=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.uploadPendingFiles();return[2]}))}))};e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.kick();return[4,this.setFocus()];case 1:e.sent();return[2]}}))}))};e.prototype.getFiles=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.files||this.files.size===0){return[2,false]}return[2,this.getFilesAsArray()]}))}))};e.prototype.updateValue=function(e,t,a){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.updateValueInMap(e,t,a);return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.identifier||this.uploadId;var a=Math.round((this.maxBytesTotal?this.maxBytesTotal:this.maxBytes*this.maxFiles)/1024/1024);var i=Math.round(this.maxBytes/1024/1024);var r=this.description.replace(/{maxfiles}/g,this.maxFiles.toString());r=r.replace(/{maxbytes}/g,"".concat(i.toString()," MB"));r=r.replace(/{maxbytestotal}/g,"".concat(a.toString()," MB"));r=r.replace(/{filetypes}/g,this.allowedExtensions.split(",").join(", "));if(this.externalUploadButton){this.externalUploadButton.ariaLabel=r}return h(Host,{class:{"duet-m-0":this.margin==="none"}},h("duet-fieldset",{"label-hidden":this.hideHeader,label:this.label,caption:!this.captionOnBottom?r:undefined},h("slot",{name:"header"}),!this.files.size&&h("duet-empty-state",{id:this.labelId,part:this.identifier?"".concat(this.identifier,"-empty-state"):"duet-upload-empty-state",icon:"messaging-attachment"},h("duet-paragraph",{margin:"none"},this.fileListEmpty)),!!this.files.size&&h("slot",{name:"fileheader"}),!!this.files.size&&h("duet-upload-aria-status",{invalid:this.getFilesAsArray().invalid.length,valid:this.getFilesAsArray().valid.length,inprogress:this.filesInProgress.size,total:this.files.size,statusMessageLabel:this.internalStatusMessageLabel}),!!this.files.size&&this.renderUploadedItems(),!!this.files.size&&h("slot",{name:"filefooter"}),h("slot",{name:"uploadfooter"}),this.captionOnBottom&&h("duet-caption",{margin:"none",size:"small"},h("div",{class:"upload-bottom-caption"},r)),h("slot",{name:"afterfooter"}),!this.hideButton&&h(Fragment,null,h("duet-spacer",{size:"large"}),h("duet-button",{id:this.buttonId,onClick:this.startUpload,"accessible-controls":t,disabled:this.fileMaxReached,"accessible-label":this.accessibleButtonLabel,"accessible-owns":t,size:"small",variation:"secondary",fixed:true,icon:"action-add-circle",part:this.identifier?"".concat(this.identifier,"-button-upload"):"duet-upload-button-upload"},this.buttonLabel)),(this.fileMaxReached||this.bytesMaxReached)&&h(Fragment,null,h("duet-spacer",{size:"medium"}),h("duet-alert",{part:this.identifier?"".concat(this.identifier,"-error-notification"):"duet-upload-error-notification"},this.fileMaxReached&&getI18nError("duet-upload-301",this.errorCodes),this.bytesMaxReached&&getI18nError("duet-upload-202",this.errorCodes))),h("duet-visually-hidden",{"aria-hidden":"true"},h("input",{ref:function(t){e.nativeInput=t},accept:!this.limitSelection?undefined:"".concat(this.allowedMimetypes,",").concat(this.allowedExtensions),onBlur:this.onBlur,onFocus:this.onFocus,onChange:function(t){return e.onChange(t)},type:"file",class:{"duet-upload":true},disabled:this.disabled,"aria-hidden":"true",required:this.required,name:this.name,id:this.identifier,multiple:this.multiple,tabIndex:-1}))))};e.prototype.makeXHRPostRequest=function(e){var t=this;var a=new XMLHttpRequest;var i=e.get("name");a.upload.addEventListener("progress",(function(e){t.updateProgress(e,i)}));a.upload.addEventListener("load",(function(){t.transferComplete(i)}));a.upload.addEventListener("error",(function(){t.transferFailed(i)}));a.upload.addEventListener("abort",(function(){t.transferCanceled(i)}));var r={payload:{data:e,name:i},options:{type:"POST",uri:this.uri,xhr:a,argument:null,headers:undefined},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress};if(this.middleware){r=this.middleware(r)}return makeXhrRequest(r)};e.prototype.makeXHRDeleteRequest=function(e){var t=e.uid,a=e.item;var i=new XMLHttpRequest;var r={"x-fileuid":t,"x-filename":a.name};var n={payload:{data:null,name:name},options:{type:"DELETE",xhr:i,uri:this.uri,argument:"?key=".concat(t,"&name=").concat(a.name),headers:r},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress};if(this.middleware){n=this.middleware(n)}return makeXhrRequest(n)};e.prototype.onChange=function(e){return __awaiter(this,void 0,void 0,(function(){var t,a,i,r,n,o,l,s,d,u,h,p,c,b,f;return __generator(this,(function(m){switch(m.label){case 0:a=Array.from((t=this.nativeInput)===null||t===void 0?void 0:t.files);if(!a)return[3,8];i=0,r=a;m.label=1;case 1:if(!(i<r.length))return[3,8];n=r[i];o=validateFile(n,{maxBytes:this.maxBytes,allowedExtensions:this.allowedExtensions,allowedMimetypes:this.allowedMimetypes},this.errorCodes),l=o.valid,s=o.errorMessage,d=o.errorType,u=o.errorSystem;h=this.genHashName();p={uid:h,item:n,size:n.size,meta:this.metaData,uploaded:false,valid:l,error:{type:l?undefined:d,message:l?undefined:s,system_message:l?undefined:u},progress:0,deleted:false,xhr:false,url:false};this.files.set(n.name,p);c=this.validateTotals(n.name),b=c.bytesMaxReached,f=c.fileMaxReached;if(!b)return[3,2];this.updateValueInMap(n.name,"valid",false,false);return[3,6];case 2:if(!f)return[3,3];this.updateValueInMap(n.name,"valid",false,false);return[3,6];case 3:if(!(l&&!this.external))return[3,5];return[4,this.uploadFile(p)];case 4:m.sent();return[3,6];case 5:if(l&&this.external){this.updateValueInMap(p.item.name,"pending",true,false);this.updateValueInMap(p.item.name,"group","pending",true)}else if(!l){this.updateValueInMap(n.name,"valid",false,true)}m.label=6;case 6:this.kick();m.label=7;case 7:i++;return[3,1];case 8:this.resetFormFields();this.metaData=undefined;this.duetChange.emit({originalEvent:e,data:{files:this.files},component:"duet-upload"});return[2]}}))}))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{valid:["watchValidHandler"]}},enumerable:false,configurable:true});return e}();DuetUpload.style=duetUploadCss;export{DuetEditableTable as duet_editable_table,DuetTable as duet_table,DuetUpload as duet_upload};
|
|
4
|
+
*/import{h,r as registerInstance,c as createEvent,H as Host,g as getElement,F as Fragment}from"./index-ccc5c541.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{f as fieldSorter,d as debounce}from"./js-utils-fa98b8cd.js";import{i as isKeyboardClick}from"./keyboard-utils-d237bd5a.js";import{g as getLanguage,c as connectLanguageChangeObserver,d as disconnectLanguageChangeObserver,a as getLocaleString,s as sanitizeString}from"./language-utils-6be16ff0.js";import{p as sizeNavigation,s as sizeHeader}from"./tokens.module-5601adc9.js";import{b as breakpointTokensUpTo,a as breakpointToToken}from"./token-utils-6e0e2653.js";import{c as createID}from"./create-id-981107da.js";import{p as parsePossibleJSON}from"./string-utils-5954f458.js";var TableData=function(e,t){var a=e.data,i=e.groupId,r=e.alignment;var n="duet-editable-table duet-editable-table-content-".concat(i);if(typeof a==="string"){return h("td",{innerHTML:a,class:n,part:"".concat(i,"content"),style:{verticalAlign:r}})}else{return h("td",{class:n,part:"".concat(i,"content"),style:{verticalAlign:r}},a)}};var duetEditableTableCss=".sc-duet-editable-table-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-actions-menu.sc-duet-editable-table{position:relative;padding:0 !important;margin:0}.duet-editable-table-actions-menu-button.sc-duet-editable-table{position:relative;right:-16px;float:right;padding:0}.duet-editable-table-actions-menu-icon.sc-duet-editable-table .duet-icon.sc-duet-editable-table{max-width:16px;max-height:16px}.duet-editable-table-row.duet-table-action-row.sc-duet-editable-table .duet-text-right.sc-duet-editable-table{text-align:right}.duet-editable-table-header.sc-duet-editable-table tr.sc-duet-editable-table .duet-editable-table-header-hidden.sc-duet-editable-table{padding:0 !important;font-size:0;border-bottom:0}";var DuetEditableTable=function(){function e(e){var t=this;registerInstance(this,e);this.duetTableToggle=createEvent(this,"duetTableToggle",7);this.duetMenuClick=createEvent(this,"duetMenuClick",7);this.hasHeadSlotFirst=false;this.hasHeadSlotLast=false;this.sortableDefaultLabel={fi:"Järjestä",en:"Click to sort",sv:"Klicka för att sortera"};this.actionColumnLabel={en:"Actions for rows",fi:"Toiminnot rivillä",sv:"Åtgärder för rader"};this.toggleColumn=function(e,a){a.preventDefault();var i=e.sort_order,r=e.direction,n=e.index,o=e.key;t.duetTableToggle.emit({sort_order:i,index:n,direction:r,key:o,component:"duet-editable-table",originalEvent:a})};this.handleKeyDown=function(e,a){if(isKeyboardClick(a)){t.toggleColumn(e,a)}};this.language=getLanguage();this.margin="auto";this.variation="striped";this.sticky=false;this.stickyDistance="with-links";this.breakpoint="small";this.actions=undefined;this.columns=undefined;this.rows=undefined;this.sortable=false;this.groupId="";this.theme="";this.accessibleRole=undefined;this.hideHeadVisually=false}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.hasHeadSlotFirst=!!this.element.querySelector("[slot='thead-first']");this.hasHeadSlotLast=!!this.element.querySelector("[slot='thead-last']")};e.prototype.connectedCallback=function(){connectLanguageChangeObserver(this)};e.prototype.disconnectedCallback=function(){disconnectLanguageChangeObserver(this)};e.prototype.createLabel=function(e){var t=this;var a=e.sort_order,i=e.direction,r=e.index,n=e.label;var o=getLocaleString(n);if(!this.sortable){return o}var l=function(){if(!!a&&i===1){return"action-arrow-down-small"}else if(!!a&&i===-1){return"action-arrow-up-small"}return"action-subtract-small"};return h("span",{class:"duet-table-label","data-index":r},h("duet-button",{size:"small",icon:l(),"icon-size":"medium-small","accessible-label":this.sortableDefaultLabel[this.language],variation:"plain",margin:"none","icon-right":true,onClick:function(a){return t.toggleColumn(e,a)},onKeyDown:function(a){return t.handleKeyDown(e,a)}},o))};e.prototype.getSortedColumns=function(){return __spreadArray([],this.columns,true).sort(fieldSorter(["index"]))};e.prototype.getRowSortOrder=function(){var e=__spreadArray([],this.columns,true).sort(fieldSorter(["sort_order"]));return e.filter((function(e){return e.sort_order})).map((function(e){return e.direction===-1?"-".concat(e.key):e.key}))};e.prototype.renderTableHeader=function(){var e=this;if(!this.columns){return}var t=this.getSortedColumns();return h("tr",{class:{"duet-table-action-header":!!this.actions}},t.map((function(t){if(t.display!==false){var a=e.createLabel(t);return a!==""?h("th",{scope:"col"},a):h("td",null)}})),this.actions&&h("th",{scope:"col",class:"duet-table-action-header-heading"},this.actions&&h("duet-visually-hidden",null,this.actionColumnLabel[this.language])))};e.prototype.renderActions=function(e,t){var a=this;if(!this.actions){return}return h("td",{class:"duet-text-right"},this.actions.map((function(i){return h("duet-action-button",{actionMeta:Object.assign({},(e===null||e===void 0?void 0:e.meta)||{},{index:t}),actionId:(e===null||e===void 0?void 0:e.uid)||(e===null||e===void 0?void 0:e.id)||null,actionName:i.name,theme:a.theme,iconName:i.icon,iconColor:i.color,iconSize:i.size,background:i.background,"accessible-label":"".concat(e.actionDescription||""," ").concat(getLocaleString(i.label)," ")})})))};e.prototype.renderTableBody=function(){var e=this;var t=this.getSortedColumns();var a=this.getRowSortOrder();var i=__spreadArray([],this.rows,true).sort(fieldSorter(a));return i.map((function(a,i){var r;return h("tr",{class:(r={"duet-table-action-row":!!e.actions,"duet-editable-table-row":true},r["duet-editable-table-row-".concat(e.groupId)]=true,r),"data-meta":JSON.stringify(a.meta)},t.map((function(t){var i=a[t.key]?a[t.key]:a.item;if(t.display!==false){return h(TableData,{data:i,groupId:e.groupId})}})),e.actions&&e.renderActions(a,i))}))};e.prototype.render=function(){var e;return h(Host,{class:(e={},e["duet-editable-table-".concat(this.variation)]=true,e["duet-editable-table"]=true,e["duet-editable-table-".concat(this.theme)]=true,e["duet-editable-table-scrollable"]=this.breakpoint==="none-scrollable",e["duet-editable-table-sortable"]=this.sortable,e["duet-editable-table-actions"]=!!this.actions,e["duet-m-0"]=this.margin==="none",e["duet-theme-turva"]=this.theme==="turva",e)},h("duet-table",{class:"duet-editable-table-table",sticky:this.sticky,stickyDistance:this.stickyDistance,margin:this.margin,theme:this.theme,variation:this.variation,breakpoint:this.breakpoint,"hide-head-visually":this.hideHeadVisually},h("table",{role:this.accessibleRole},h("caption",null,h("slot",{name:"tcaption"})),h("thead",null,this.hasHeadSlotFirst&&h("tr",null,h("td",{class:"duet-editable-table-actions-menu",colSpan:99},h("slot",{name:"thead-first"}))),this.renderTableHeader(),this.hasHeadSlotLast&&h("tr",null,h("td",{class:"duet-editable-table-actions-menu",colSpan:99},h("slot",{name:"thead-last"})))),h("tbody",null,this.renderTableBody()),h("tfoot",null,h("tr",null,h("th",{class:"duet-editable-table-footer-menu",colSpan:99},h("slot",{name:"tfoot"})))))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetEditableTable.style=duetEditableTableCss;var duetTableCss='duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{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;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-table-hide-head-visually.duet-table-hide-head-visually thead,duet-table.duet-table-hide-head-visually.duet-table-hide-head-visually thead *{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}duet-table.duet-theme-turva table{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:rgb(0, 41, 77)}duet-table.duet-theme-turva td{color:rgb(23, 28, 58)}duet-table th{font-weight:600;line-height:1.25;color:rgb(101, 119, 135);text-align:left}duet-table.duet-theme-turva th{color:rgb(116, 116, 117)}duet-table tbody th{font-weight:600;color:rgb(0, 41, 77)}duet-table.duet-theme-turva tbody th{color:rgb(23, 28, 58)}duet-table .duet-table-action-row td:last-child{justify-self:end;padding-right:20px !important;white-space:nowrap}.duet-table-flattened table,.duet-table-flattened thead,.duet-table-flattened tbody,.duet-table-flattened tfoot,.duet-table-flattened th,.duet-table-flattened td,.duet-table-flattened tr{display:block}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:rgb(101, 119, 135);text-align:left}.duet-table-flattened td[data-heading]::before{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:rgb(0, 41, 77);content:attr(data-heading)}.duet-table-flattened.duet-theme-turva td[data-heading]::before{color:rgb(23, 28, 58)}.duet-table-sticky thead th{position:sticky;top:0;background:rgb(255, 255, 255)}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:rgb(255, 255, 255)}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:rgb(228, 228, 230)}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:rgb(228, 228, 230)}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid rgb(225, 227, 230)}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:rgb(228, 228, 230)}.duet-table-fixed th,.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid rgb(101, 119, 135)}.duet-table-fixed th:first-child,.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-fixed th:last-child,.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-fixed th,.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:rgb(68, 68, 69)}.duet-table-fixed tbody th,.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:rgb(225, 227, 230)}.duet-theme-turva.duet-table-fixed tbody th,.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:rgb(228, 228, 230)}.duet-table-fixed td,.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-fixed td:first-child,.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-fixed td:last-child,.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-fixed tbody td,.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid rgb(225, 227, 230)}.duet-theme-turva.duet-table-fixed tbody td,.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:rgb(228, 228, 230)}.duet-table-flattened.duet-table-fixed tbody:first-of-type th,.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-fixed td,.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-fixed tr,.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-fixed tfoot td,.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-fixed tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:rgb(228, 228, 230)}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid rgb(225, 227, 230)}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-fixed table{table-layout:fixed}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td,.duet-table-fixed tbody tr td:first-child{padding:4px !important;vertical-align:text-bottom;border-bottom:0 none}.duet-table-fixed thead{display:none}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td{border-bottom:0 none}.duet-table-fixed:not(.duet-table-flattened) tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-fixed:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}.duet-table-sortable tbody tr td:first-child,.duet-table-sortable thead tr th:first-child{padding:20px}.duet-table-sortable:not(.duet-table-flattened) tfoot{border-top:1px solid rgb(225, 227, 230)}.duet-table-sortable:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:rgb(228, 228, 230)}.duet-table-actions table{table-layout:auto}.duet-table-actions thead th:last-child{width:1px;white-space:nowrap}.duet-editable-table-table.duet-table-flattened tr{display:grid;grid-template-columns:repeat(2, 1fr);grid-auto-rows:auto;gap:10px}.duet-editable-table-table.duet-table-flattened tr.duet-table-action-row td:last-child::before{padding:0;content:""}.duet-editable-table-table.duet-table-flattened td{grid-column:1/2}.duet-editable-table-table.duet-table-flattened td:first-child{grid-row:1;grid-column:1}.duet-editable-table-table.duet-table-flattened td:last-child{grid-row:1;grid-column:2}';var stickyTopValues={none:0,"with-links":parseFloat(sizeNavigation)*16,"without-links":parseFloat(sizeHeader)*16};var DuetTable=function(){function e(e){var t=this;registerInstance(this,e);this.headingSelector="thead tr > :not(*.duet-editable-table-actions-menu)";this.handleMediaQueryChange=function(e){t.matchesBreakpoint=breakpointTokensUpTo.includes(t.breakpoint)?!e.matches:e.matches};this.matchesBreakpoint=true;this.language=getLanguage();this.theme=undefined;this.margin="auto";this.variation="striped";this.sticky=false;this.stickyDistance="with-links";this.breakpoint="small";this.hideHeadVisually=false}e.prototype.watchLanguageStateHandler=function(e,t){var a=this;if(e!==t){setTimeout((function(){return a.copyHeadingsToCells()}),50)}};e.prototype.connectedCallback=function(){var e=this;var t=this.breakpoint==="none"||this.breakpoint==="none-scrollable"?"all":breakpointToToken[this.breakpoint];this.mq=matchMedia(t);this.mq.addEventListener("change",debounce(this.handleMediaQueryChange,50));this.handleMediaQueryChange(this.mq);this.observer=new MutationObserver((function(){return debounce(e.copyHeadingsToCells(),50)}));this.observer.observe(this.element,{childList:true,subtree:true})};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.copyHeadingsToCells();if(this.sticky&&this.breakpoint==="none-scrollable"){console.warn('[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence')}if(this.sticky){var e=stickyTopValues[this.stickyDistance];var t=this.element.querySelectorAll(this.headingSelector);t.forEach((function(t){return t.style.top="".concat(e,"px")}))}};e.prototype.componentDidLoad=function(){this.observer?this.observer.takeRecords():null;connectLanguageChangeObserver(this)};e.prototype.disconnectedCallback=function(){this.observer.disconnect();this.observer=null;this.mq.removeListener(this.handleMediaQueryChange);this.mq=null;this.matchesBreakpoint=true;disconnectLanguageChangeObserver(this)};e.prototype.copyHeadingsToCells=function(){var e=this.element.querySelectorAll(this.headingSelector);var t=this.element.querySelectorAll("tbody tr");var a=Array.from(e).map((function(e){return e.textContent.trim()}));t.forEach((function(e){e.querySelectorAll("td").forEach((function(e,t){if(a[t]){e.dataset.heading=a[t]}}))}))};e.prototype.render=function(){var e;return h(Host,{class:(e={},e["duet-table-".concat(this.variation)]=true,e["duet-table-flattened"]=!this.matchesBreakpoint,e["duet-table-sticky"]=this.matchesBreakpoint&&this.sticky,e["duet-table-scrollable"]=this.breakpoint==="none-scrollable",e["duet-m-0"]=this.margin==="none",e["duet-theme-turva"]=this.theme==="turva",e["duet-table-hide-head-visually"]=this.hideHeadVisually,e)},h("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{language:["watchLanguageStateHandler"]}},enumerable:false,configurable:true});return e}();DuetTable.style=duetTableCss;var errorCodes=[{type:"default",system_message:"unknown error",message:{fi:"Tapahtui tuntematon virhe, ole hyvä ja yritä uudelleen.",sv:"Ett okänt fel uppstod, försök igen.",en:"An unknown error occured, please try again."}},{type:"400",system_message:"Bad Request: The server could not understand the request due to invalid syntax.",message:{fi:"Tiedostoa ei hyväksytty.",sv:"Servern avvisade din fil.",en:"The server rejected your file."}},{type:"401",system_message:"Not Authenticated: The client must authenticate itself to get the requested response...",message:{fi:"Vain kirjautunut käyttäjä voi lähettää tiedostoja.",sv:"Du måste vara inloggad för att ladda upp filer.",en:"You need to be logged in to upload files."}},{type:"403",system_message:"No Access: The client does not have access rights to the content.",message:{fi:"Ei oikeuksia lähettää tiedostoja.",sv:"Du har inte rätt åtkomsträttigheter för att ladda upp filer.",en:"You do not have the correct access rights to upload files."}},{type:"413",system_message:"Payload too large",message:{fi:"Tiedosto oli liian vastaanotettavaksi.",sv:"Filen var för stor för servern att hantera.",en:"The file was to large for the server to handle."}},{type:"415",system_message:"Unsupported media type",message:{fi:"Tiedoston tyyppi oli väärä.",sv:"Servern avvisade filen eftersom den hade fel typ.",en:"The server rejected the file because it had the wrong type."}},{type:"429",system_message:"Too many request from same address",message:{fi:"Liian monta yritystä, ole hyvä ja yritä myöhemmin uudelleen.",sv:"Servern har fått många förfrågningar från dig, försök igen senare.",en:"The server has received to many request from you, please try again later."}},{type:"500",system_message:"Internal Server Error",message:{fi:"Palvelin ilmoitti tuntemattomasta virheestä ja lataus epäonnistui.",sv:"Servern rapporterade ett okänt fel och uppladdningen misslyckades.",en:"The server reported an unknown error and the upload failed."}},{type:"duet-upload-100",system_message:"File extension not allowed",message:{fi:"Tiedoston tyyppi ei ole sallittu.",sv:"Du kan inte ladda upp filer av den type.",en:"You cannot upload files with that extension."}},{type:"duet-upload-001",system_message:"File transfer failed",message:{fi:"Tiedoston lähetys keskeytyi, ole hyvä ja yritä uudelleen.",sv:"Din anslutning till servern avbröts, försök igen.",en:"Your connection to the server was interrupted, try again."}},{type:"duet-upload-101",system_message:"File mimetype not allowed",message:{fi:"Tiedoston tyyppi ei ole sallittu.",sv:"Du kan inte ladda upp filer av den typ.",en:"You cannot upload files of that type."}},{type:"duet-upload-201",system_message:"File is too large",message:{fi:"Tiedosto on liian iso.",sv:"Filen är större än tillåtet.",en:"The file is larger than permitted."}},{type:"duet-upload-202",system_message:"The combined size of all files is too large",message:{fi:"Tiedostojen yhteenlaskettu koko on liian iso.",sv:"Du har nått den maximala kombinerade filstorleken.",en:"You have reached the maximum combined filesize."}},{type:"duet-upload-301",system_message:"The maximum file limit has been reached",message:{fi:"Liitteiden maksimimäärä saavutettu.",sv:"Maximalt antal bilagor har uppnåtts.",en:"Maximum number of attachments reached."}}];var getError=function(e,t){var a={type:undefined,system_message:undefined,message:undefined};t=parsePossibleJSON(t);a=t.filter((function(t){return t.type==e}))[0];if(!a){a=t.filter((function(e){return e.type==="default"}))[0]}return a};var getI18nError=function(e,t){var a=getError(e,t);var i=getLocaleString(a.message);if(i===""||!i){return a.system_message}else{return i}};var formatBytes=function(e,t){if(t===void 0){t=2}if(e===0){return"0 Bytes"}var a=1024;var i=t<0?0:t;var r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];var n=Math.floor(Math.log(e)/Math.log(a));return parseFloat((e/Math.pow(a,n)).toFixed(i))+" "+r[n]};var UploadItem=function(e){var t=e.data,a=e.showLinks,i=e.type,r=e.actions,n=e.errorCodes,o=e.theme,l=e.label,s=e.categoryLabel,d=e.showCategory;var u=t.uid,p=t.item,c=t.size,b=t.uploaded,f=t.url,m=t.meta,g=t.progress,y=t.error;var v=p.name;var x=function(){switch(i){case"inprogress":return h("span",{class:"duet-upload-item-name"},h("duet-paragraph",{class:"duet-upload-item-name",color:"gray-darker",margin:"none",weight:"semi-bold"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v),h("duet-progress",{progress:Math.ceil(g),"aria-hidden":true}));case"pending":return h("span",{class:"duet-upload-item-name"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v);case"failure":return h("span",{class:"duet-upload-item-error",role:"status"},h("duet-paragraph",{class:"duet-upload-item-name",color:"danger",margin:"none",weight:"semi-bold"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v),h("duet-paragraph",{class:"duet-upload-item-error-label",size:"small",margin:"none",color:"danger"},getI18nError(y.type,n)));default:return b&&f&&a?h("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},h("duet-link",{url:f,external:true},k),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),w):h("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},k,h("duet-spacer",{size:"xx-small",direction:"horizontal"}),w)}};var k=h("span",{class:"duet-upload-item-name"},h("duet-icon",{margin:"none",size:"x-small",name:"messaging-attachment"}),h("duet-spacer",{size:"xx-small",direction:"horizontal"}),v);var w=h("span",{class:"duet-upload-item-size",style:{fontSize:"14px",fontWeight:"400"}},"(",formatBytes(c),")");var L=m&&m.badges?h("span",null,m.badges.map((function(e){return h("duet-badge",{color:"primary"},e)}))):undefined;var I="".concat(m&&m.badges?m.badges.join(","):""," ").concat(v);return h("div",{class:{"upload-item-row":true}},d&&h("div",{class:"item-categories"},h("duet-heading",{class:"heading",color:"color-secondary",level:"h6",weight:"semibold"},getLocaleString(s)),L),h("div",{class:{"item-name":true,"no-category":!d}},!!l&&h("duet-heading",{class:"heading",color:"color-secondary",level:"h6",weight:"semibold"},getLocaleString(l)),x()),h("div",{class:"item-actions"},r.map((function(e){return h("duet-action-button",{actionMeta:Object.assign({},m||{}),actionId:u||null,actionName:e.name,theme:o,iconName:e.icon,iconColor:e.color,iconSize:e.size,background:e.background,"accessible-label":"".concat(I," ").concat(getLocaleString(e.label)," ")})}))))};var UploadItemHeader=function(e){var t=e.label,a=e.categoryLabel;return h("div",{class:"items-header"},a&&h("duet-heading",{class:"category-header",border:"solid",color:"gray-darker",level:"h3","visual-level":"h6",weight:"semibold",margin:"none"},getLocaleString(a)),h("duet-heading",{class:{"filename-header":true,"no-category":!a},border:"solid",color:"gray-darker",level:"h3","visual-level":"h6",weight:"semibold",margin:"none"},getLocaleString(t)))};var validateFileExtension=function(e,t){if(!t){return true}var a=e.split(".");var i=t.split(",");var r=a[a.length-1];return i.includes(r)};var validateFileMime=function(e,t){if(!t||!e){return true}var a=t.split(",");var i=false;a.forEach((function(t){var a=t.split("/");var r=e.split("/");if(a[0]===r[0]&&(a[1]===r[1]||a[1]==="*")){i=true}}));return i};var validateFileSize=function(e,t){if(!t||!e){return true}return t>=e};var validateFile=function(e,t,a){var i=t.allowedMimetypes,r=t.allowedExtensions,n=t.maxBytes;var o=false;var l=getError("default",a);if(e){var s=e.name,d=e.type,u=e.size;var h=validateFileMime(d,i);var p=r==="all"||r===""||r===" "||r===undefined?true:validateFileExtension(s.toLowerCase(),r);var c=validateFileSize(u,n);if(!h){l=getError("duet-upload-101",a)}if(!p){l=getError("duet-upload-100",a)}if(!c){l=getError("duet-upload-201",a)}o=h&&p&&c}else{o=false}return{valid:o,errorMessage:o?undefined:getLocaleString(l.message),errorSystem:o?undefined:l.system_message,errorType:o?undefined:l.type}};var validateTotalSizeIsAboveMax=function(e,t){var a=0;if(t){e.forEach((function(e){if(e.valid&&e.size){a+=e.size}}));if(a>t){return true}}return false};var validateTotalAmountIsAboveMax=function(e,t){var a=0;if(t){e.forEach((function(e){if(e.valid){a++}}));if(a>t){return true}}return false};var makeXhrRequest=function(e){var t=e.payload,a=e.options,i=e.onFailure,r=e.onSuccess,n=e.onProgress;var o=a.type,l=o===void 0?"POST":o,s=a.xhr,d=a.uri,u=a.argument,h=u===void 0?null:u,p=a.headers,c=p===void 0?null:p;s.open(l,"".concat(d).concat(h||""),true);var b=t.data,f=t.name;if(c){Object.keys(c).forEach((function(e){s.setRequestHeader(e,c[e])}))}if(l==="POST"){s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE&&s.status>=200&&s.status<300){r(s,f,s.status)}if(s.readyState===XMLHttpRequest.DONE&&s.status>=300&&s.status<999){i(s,f,s.status)}};n(f)}s.send(b);return s};var duetUploadCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}::slotted([slot=header]){margin-bottom:16px}::slotted([slot=fileheader]){margin:16px 0 0 0}::slotted([slot=filefooter]){margin-top:16px}::slotted([slot=uploadfooter]){margin-top:20px}.duet-upload{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-upload-item-size{font-size:0.75rem;font-weight:400}.duet-upload-filelist{margin-bottom:25px}.duet-upload-filelist-empty{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:rgb(245, 248, 250)}.duet-upload-filelist-empty-label{font-size:1rem;font-weight:400}.duet-upload-editable-table-header-hidden{display:none}.duet-upload-editable-table tbody .duet-upload-editable-table-data{padding:0 !important;border:0}.duet-upload-editable-table duet-editable-table tfoot,.duet-upload-editable-table duet-editable-table thead{display:none}.duet-upload-editable-table duet-editable-table .duet-editable-table-content{padding-right:0 !important;padding-left:0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td{padding:1rem 0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td:last-child{padding-right:0 !important}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress,.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending{position:relative}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-progress,.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending duet-progress{position:absolute;bottom:0;width:100%}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-action-button::part(button),.duet-upload-editable-table duet-editable-table .duet-editable-table-row-pending duet-action-button::part(button){border:0}duet-paragraph::part(duet-paragraph){word-break:break-word}duet-editable-table tfoot{display:none}.upload-bottom-caption{margin-top:12px;margin-bottom:28px}.items-header{display:none;flex-direction:row;margin-bottom:0}@media (min-width: 36em){.items-header{display:flex}}.items-header:not(:last-child),.items-header:not(:first-child){margin-top:12px}.items-header .category-header{width:35%}.items-header .filename-header{width:65%}.items-header .filename-header.no-category{width:100%}.upload-item-row{display:flex;flex-direction:column;gap:16px;align-content:center;align-items:center;padding:16px 0 16px 0;border-bottom:1px solid rgb(225, 227, 230)}@media (min-width: 36em){.upload-item-row{flex-direction:row;gap:10px}}.upload-item-row .item-categories{width:100%}@media (min-width: 36em){.upload-item-row .item-categories{width:35%}}.upload-item-row .item-name{position:relative;bottom:2px;width:100%;text-align:left}@media (min-width: 36em){.upload-item-row .item-name{width:50%}.upload-item-row .item-name.no-category{width:85%}}.upload-item-row .item-categories .heading,.upload-item-row .item-name .heading{display:block}@media (min-width: 36em){.upload-item-row .item-categories .heading,.upload-item-row .item-name .heading{display:none}}.upload-item-row .item-actions{width:100%;margin-left:-8px;text-align:left}@media (min-width: 36em){.upload-item-row .item-actions{width:15%;padding-top:0;margin-left:auto;text-align:right}}.upload-item-row .duet-upload-item-name duet-icon{position:relative;top:4px}.upload-item-row .duet-upload-item-name duet-progress{display:block;margin-top:16px}";var DuetUpload=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",3);this.duetBlur=createEvent(this,"duetBlur",7);this.duetFocus=createEvent(this,"duetFocus",7);this.duetReady=createEvent(this,"duetReady",7);this.duetDone=createEvent(this,"duetDone",3);this.duetState=createEvent(this,"duetState",3);this.duetDelete=createEvent(this,"duetDelete",3);this.duetCancel=createEvent(this,"duetCancel",3);this.duetProgress=createEvent(this,"duetProgress",3);this.duetUpload=createEvent(this,"duetUpload",3);this.buttonId=createID("DuetButton");this.labelId=createID("DuetLabel");this.uploadId=createID("DuetUpload");this.filesInProgress=new Map;this.fileMaxReached=false;this.bytesMaxReached=false;this.internalStatusMessageLabel=undefined;this.DefaultGroups={inprogress:"inprogress",success:"success",pending:"pending",failure:"failure"};this.kick=debounce((function(){t.tick=Date.now()}),30);this.categoryLabel={en:"Category",sv:"Filtyp",fi:"Tiedostotyyppi"};this.listenForActionEvents=function(){t.element.addEventListener("duetActionEvent",(function(e){var a=e.detail;var i=a.action,r=a.id,n=a.originalEvent;switch(i){case"delete":t.onDelete(r,n);break;case"cancel":t.onCancel(r,n);break}}))};this.verifyValidity=function(){var e=t.getFilesAsArray(),a=e.invalid,i=e.valid;var r=t.valid;t.valid=a.length===0&&i.length!==0;if(t.valid!==r){t.duetState.emit({originalEvent:undefined,data:{valid:t.valid,from:"componentWillRender"},component:"duet-upload"})}};this.getGroupFromItemData=function(e){if(e.valid&&e.progress===100){return t.DefaultGroups.success}else if(e.progress>0&&e.progress!==100){return t.DefaultGroups.inprogress}else if(!e.valid){return t.DefaultGroups.failure}else if(e.pending){return t.DefaultGroups.pending}else if(e.group){return e.group}else{return"none"}};this.mapFilesToUploadItems=function(e,a,i){if(a===t.DefaultGroups.success){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"success",data:e,showLinks:t.showLinks,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(a===t.DefaultGroups.inprogress){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"inprogress",data:e,showLinks:t.showLinks,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(a===t.DefaultGroups.pending){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"pending",data:e,showLinks:t.showLinks,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(a===t.DefaultGroups.failure){return h(UploadItem,{theme:t.theme,actions:t.getActions(a),type:"failure",data:e,showLinks:t.showLinks,errorCodes:t.errorCodes,categoryLabel:t.categoryLabel,label:t.uploadedItemsHeaderLabel,showCategory:i})}else if(e.group){return e.html}else{return"none"}};this.genHashName=function(){return Date.now().toString(36)+Math.random()};this.updateValueInMap=function(e,a,i,r){if(r===void 0){r=true}try{var n=t.files.get(e);n[a]=i;t.files.set(e,n)}catch(o){}if(r){t.kick()}};this.updateProgress=function(e,a){var i=function(i){t.updateValueInMap(a,"progress",i);t.onProgress(a,i,e)};if(e.lengthComputable){var r=e.loaded/e.total*100;i(r)}else{console.log("cant read progress")}};this.trackProgress=function(e,a){if(a===void 0){a=false}if(a){t.filesInProgress.delete(e)}else{t.filesInProgress.set(e,"inprogress")}if(t.filesInProgress.size===0){t.onDone()}};this.getFilesAsArray=function(){var e=[];var a=[];t.files.forEach((function(t){if(t.valid&&!t.deleted){e.push(t)}else if(!t.valid&&!t.deleted){a.push(t)}}));return{valid:e,invalid:a}};this.resetFormFields=function(){t.nativeInput.value=""};this.startUpload=function(e,a){if(a===void 0){a=undefined}return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.metaData=a;this.nativeInput.click();this.onUpload(e,a);e.stopPropagation();e.preventDefault();return[2]}))}))};this.transferComplete=function(e){t.updateValueInMap(e,"progress",100,false);t.trackProgress(e,true)};this.transferDone=function(e,a,i){t.updateValueInMap(a,"status",i,false);t.updateValueInMap(a,"uploaded",true,false);try{var r=JSON.parse(e.response);t.updateValueInMap(a,"url",r.url)}catch(n){t.updateValueInMap(a,"url",null);console.error("Server did not respond with expected response {url: string}")}return};this.transferDoneWithFailure=function(e,a,i){try{var r=JSON.parse(e.response).error;t.updateValueInMap(a,"error",{message:r.message,type:r.type},false)}catch(n){console.error("Server did not respond with expected response error:{message: string, type: int}");t.updateValueInMap(a,"error",{type:i},false)}t.updateValueInMap(a,"valid",false,true)};this.transferFailed=function(e){t.updateValueInMap(e,"error",getI18nError("duet-upload-001",t.errorCodes))};this.transferCanceled=function(e){t.files.delete(e);t.validateTotals(e);t.kick()};this.validateTotals=function(e){var a=validateTotalSizeIsAboveMax(t.files,t.maxBytesTotal);var i=validateTotalAmountIsAboveMax(t.files,t.maxFiles);if(a&&e){t.updateValueInMap(e,"error",getI18nError("duet-upload-202",t.errorCodes),false)}if(i&&e){t.updateValueInMap(e,"error",getI18nError("duet-upload-301",t.errorCodes),false)}t.bytesMaxReached=a;t.fileMaxReached=i;return{bytesMaxReached:a,fileMaxReached:i}};this.uploadFile=function(e,a,i){if(a===void 0){a=false}return __awaiter(t,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(o){switch(o.label){case 0:if(!a&&this.deferUpload){this.updateValueInMap(e.item.name,"pending",true,false);this.updateValueInMap(e.item.name,"group","pending",true)}else if(a){this.updateValueInMap(e.item.name,"pending",false,false);this.updateValueInMap(e.item.name,"group",undefined,true)}o.label=1;case 1:o.trys.push([1,4,,5]);if(!(!this.deferUpload||a))return[3,3];t=new FormData;t.append("file",e.item);if(i){t.append("key",i)}t.append("uid",e.uid);t.append("name",e.item.name);t.append("metadata",JSON.stringify({uid:e.uid,url:this.uri,size:e.item.size,meta:e.meta}));r=e;return[4,this.makeXHRPostRequest(t)];case 2:r.xhr=o.sent();o.label=3;case 3:return[3,5];case 4:n=o.sent();this.updateValueInMap(e.item.name,"valid",false,false);return[3,5];case 5:return[2]}}))}))};this.uploadPendingFiles=function(){for(var e=0,a=Array.from(t.files.entries());e<a.length;e++){var i=a[e],r=i[0],n=i[1];if(n.group==="pending"&&n.pending===true){t.uploadFile(n,true,r)}}};this.getItemFromUID=function(e){for(var a=0,i=Array.from(t.files.entries());a<i.length;a++){var r=i[a],n=r[0],o=r[1];if(o.uid===e){return{value:o,key:n}}}return null};this.onDelete=function(e,a){var i=t.getItemFromUID(e);var r=i.key;var n=t.files.get(r);t.files.delete(r);t.validateTotals();t.kick();t.duetDelete.emit({originalEvent:a,data:{deletion:n},component:"duet-upload"});if(!t.external&&!n.pending){t.makeXHRDeleteRequest(n)}t.resetFormFields()};this.onCancel=function(e,a){var i=t.getItemFromUID(e).key;var r=t.files.get(i);t.files.delete(i);if(!t.external){var n=r.xhr;if(n){n.abort()}}else{t.kick()}t.resetFormFields();t.duetCancel.emit({originalEvent:a,data:{cancelled:r},component:"duet-upload"})};this.onUpload=function(e,a){t.duetUpload.emit({originalEvent:e,metaData:a,component:"duet-upload"})};this.onBlur=function(e){t.duetBlur.emit({originalEvent:e,component:"duet-upload"})};this.onProgress=function(e,a,i){t.duetChange.emit({originalEvent:i,data:{key:e,percentComplete:a},component:"duet-upload"})};this.onFocus=function(e){t.duetFocus.emit({originalEvent:e,component:"duet-upload"})};this.onReady=function(){t.duetReady.emit({component:"duet-upload"})};this.onDone=function(){t.duetDone.emit({component:"duet-upload",data:{files:t.files}})};this.filterMap=function(){var e=Array.from(t.files.values());var a=[];var i=[];var r=[];var n=[];var o=false;e.forEach((function(e){var l=t.getGroupFromItemData(e);if(e.meta&&!!e.meta.badges){o=true}if(l===t.DefaultGroups.success){n.push({uid:e.uid,data:e})}else if(l===t.DefaultGroups.inprogress){a.push({uid:e.uid,data:e})}else if(l===t.DefaultGroups.pending){r.push({uid:e.uid,data:e})}else if(l===t.DefaultGroups.failure){i.push({uid:e.uid,data:e})}else if(e.group){a.push({uid:e.uid,data:e})}}));return{pending:r,failure:i,success:n,inprogress:a,hasCategory:o}};this.getActions=function(e){return t.actions.filter((function(t){return t.map.includes(e)}))};this.renderUploadedItems=function(){var e=t.filterMap();var a=e.hasCategory;var i=t.groups.map((function(i){var r=e[i.id];if(!(r===null||r===void 0?void 0:r.length)){return}return h(Fragment,null,!t.hideGroups&&h(UploadItemHeader,{categoryLabel:a?t.categoryLabel:undefined,label:i.label}),r.map((function(e){return t.mapFilesToUploadItems(e.data,i.id,a)})))}));return h(Fragment,null,t.showUploadedItemsHeader&&h(UploadItemHeader,{categoryLabel:a?t.categoryLabel:undefined,label:t.uploadedItemsHeaderLabel}),i)};this.tick=Date.now();this.accessibleActiveDescendant=undefined;this.accessibleDescribedBy=undefined;this.accessibleControls=undefined;this.accessibleOwns=undefined;this.external=false;this.middleware=null;this.deferUpload=false;this.hideButton=false;this.actions=[{icon:"action-delete",color:"color-danger",size:"x-small",background:"gray-lightest",name:"delete",map:["success","failure"],label:{fi:"Poista tiedosto",en:"Delete the file",sv:"Ta bort filen"}},{icon:"navigation-close",color:"primary",size:"x-small",background:"gray-lightest",name:"cancel",map:["inprogress","pending"],label:{fi:"Keskeytä lähetys",en:"Cancel the upload",sv:"Stop överföringen"}}];this.uri=undefined;this.showLinks=false;this.caption=undefined;this.statusLabelDefaults={fi:{inProgress:"Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",inProgressWithErrors:"Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",done:"Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",doneWithErrors:"Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",files:"tiedostot",file:"tiedosto"},sv:{inProgress:"Adding {filesUploaded} of {filesTotal}",inProgressWithErrors:"Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",done:"Alla {filesTotal} har lagts till",doneWithErrors:"Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",files:"filer",file:"fil"},en:{inProgress:"Adding {filesUploaded} of {filesTotal}",inProgressWithErrors:"Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",done:"All {filesTotal} added successfully",doneWithErrors:"Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",files:"File",file:"file"}};this.statusMessageLabel=getLocaleString(this.statusLabelDefaults);this.buttonLabelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add an attachment"};this.buttonLabel=getLocaleString(this.buttonLabelDefaults);this.accessibleButtonLabel=undefined;this.theme="";this.disabled=false;this.identifier=undefined;this.margin="auto";this.required=false;this.alignment="middle";this.hideGroups=false;this.files=new Map;this.valid=!this.required;this.labelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add attachments"};this.label=getLocaleString(this.labelDefaults);this.descriptionDefaults={en:"You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytestotal} of files at a time, and add up to {maxfiles} attachments at a time each no larger than {maxbytes}.",sv:"Du kan bifoga följande filtyper: {filetypes} - samt de vanligaste videofilerna. Du kan ladda upp {maxbytestotal} av filer åt gången, och lägga till upp till {maxfiles} bilagor åt gången varje inte större än {maxbytes}.",fi:"Voit liittää seuraavat tiedostotyypit: {filetypes} - sekä yleisimmät videotiedostot. Voit lähettää {maxbytestotal} tiedostoa kerrallaan, ja lisätä enintään {maxfiles} liitettä kerrallaan, jokainen enintään {maxbytes} kokoisena."};this.description=getLocaleString(this.descriptionDefaults);this.fileListEmptyDefaults={fi:"Ei vielä lisättyjä tiedostoja.",sv:"Inga filer har lagts till ännu.",en:"No files added yet."};this.fileListEmpty=getLocaleString(this.fileListEmptyDefaults);this.error="";this.errorCodes=errorCodes;this.name=undefined;this.maxBytes=2e8;this.maxBytesTotal=undefined;this.maxFiles=99;this.allowedExtensions="all";this.allowedMimetypes="*";this.multiple=true;this.limitSelection=false;this.value=undefined;this.externalUploadButtonId=undefined;this.captionOnBottom=false;this.showUploadedItemsHeader=false;this.uploadedItemsHeaderLabel={fi:"Ladattu tiedosto",sv:"Lägg till en bilaga",en:"Uploaded file"};this.hideHeader=false;this.groups=[{id:this.DefaultGroups.success,label:{fi:"Valmiit tiedostot",sv:"Files success",en:"Files success"}},{id:this.DefaultGroups.failure,label:{fi:"Tiedostot, joissa on virheitä",sv:"Filer med fel",en:"Files with errors"}},{id:this.DefaultGroups.inprogress,label:{fi:"Kesken olevat tiedostot",sv:"Filer inprogress",en:"Files inprogress"}},{id:this.DefaultGroups.pending,label:{en:"Files to upload",sv:"Filer att ladda",fi:"Ladattavat tiedostot"}}]}e.prototype.watchValidHandler=function(e,t){if(e!==t){this.kick()}};e.prototype.componentWillLoad=function(){if(typeof this.statusMessageLabel==="string"){this.internalStatusMessageLabel=sanitizeString(this.groups)}else{this.internalStatusMessageLabel=this.statusMessageLabel}inheritGlobalTheme(this);this.listenForActionEvents();this.onReady();this.externalUploadButton=document.querySelector("#".concat(this.externalUploadButtonId))};e.prototype.componentWillRender=function(){this.verifyValidity()};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput){this.nativeInput.focus(e)}return[2]}))}))};e.prototype.upload=function(e){if(e===void 0){e=undefined}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.setFocus()];case 1:t.sent();this.metaData=e;this.nativeInput.click();return[2]}}))}))};e.prototype.uploadPending=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.uploadPendingFiles();return[2]}))}))};e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.kick();return[4,this.setFocus()];case 1:e.sent();return[2]}}))}))};e.prototype.getFiles=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.files||this.files.size===0){return[2,false]}return[2,this.getFilesAsArray()]}))}))};e.prototype.updateValue=function(e,t,a){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.updateValueInMap(e,t,a);return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.identifier||this.uploadId;var a=Math.round((this.maxBytesTotal?this.maxBytesTotal:this.maxBytes*this.maxFiles)/1024/1024);var i=Math.round(this.maxBytes/1024/1024);var r=this.description.replace(/{maxfiles}/g,this.maxFiles.toString());r=r.replace(/{maxbytes}/g,"".concat(i.toString()," MB"));r=r.replace(/{maxbytestotal}/g,"".concat(a.toString()," MB"));r=r.replace(/{filetypes}/g,this.allowedExtensions.split(",").join(", "));if(this.externalUploadButton){this.externalUploadButton.ariaLabel=r}return h(Host,{class:{"duet-m-0":this.margin==="none"}},h("duet-fieldset",{"label-hidden":this.hideHeader,label:this.label,caption:!this.captionOnBottom?r:undefined},h("slot",{name:"header"}),!this.files.size&&h("duet-empty-state",{id:this.labelId,part:this.identifier?"".concat(this.identifier,"-empty-state"):"duet-upload-empty-state",icon:"messaging-attachment"},h("duet-paragraph",{margin:"none"},this.fileListEmpty)),!!this.files.size&&h("slot",{name:"fileheader"}),!!this.files.size&&h("duet-upload-aria-status",{invalid:this.getFilesAsArray().invalid.length,valid:this.getFilesAsArray().valid.length,inprogress:this.filesInProgress.size,total:this.files.size,statusMessageLabel:this.internalStatusMessageLabel}),!!this.files.size&&this.renderUploadedItems(),!!this.files.size&&h("slot",{name:"filefooter"}),h("slot",{name:"uploadfooter"}),this.captionOnBottom&&h("duet-caption",{margin:"none",size:"small"},h("div",{class:"upload-bottom-caption"},r)),h("slot",{name:"afterfooter"}),!this.hideButton&&h(Fragment,null,h("duet-spacer",{size:"large"}),h("duet-button",{id:this.buttonId,onClick:this.startUpload,"accessible-controls":t,disabled:this.fileMaxReached,"accessible-label":this.accessibleButtonLabel,"accessible-owns":t,size:"small",variation:"secondary",fixed:true,icon:"action-add-circle",part:this.identifier?"".concat(this.identifier,"-button-upload"):"duet-upload-button-upload"},this.buttonLabel)),(this.fileMaxReached||this.bytesMaxReached)&&h(Fragment,null,h("duet-spacer",{size:"medium"}),h("duet-alert",{part:this.identifier?"".concat(this.identifier,"-error-notification"):"duet-upload-error-notification"},this.fileMaxReached&&getI18nError("duet-upload-301",this.errorCodes),this.bytesMaxReached&&getI18nError("duet-upload-202",this.errorCodes))),h("duet-visually-hidden",{"aria-hidden":"true"},h("input",{ref:function(t){e.nativeInput=t},accept:!this.limitSelection?undefined:"".concat(this.allowedMimetypes,",").concat(this.allowedExtensions),onBlur:this.onBlur,onFocus:this.onFocus,onChange:function(t){return e.onChange(t)},type:"file",class:{"duet-upload":true},disabled:this.disabled,"aria-hidden":"true",required:this.required,name:this.name,id:this.identifier,multiple:this.multiple,tabIndex:-1}))))};e.prototype.makeXHRPostRequest=function(e){var t=this;var a=new XMLHttpRequest;var i=e.get("name");a.upload.addEventListener("progress",(function(e){t.updateProgress(e,i)}));a.upload.addEventListener("load",(function(){t.transferComplete(i)}));a.upload.addEventListener("error",(function(){t.transferFailed(i)}));a.upload.addEventListener("abort",(function(){t.transferCanceled(i)}));var r={payload:{data:e,name:i},options:{type:"POST",uri:this.uri,xhr:a,argument:null,headers:undefined},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress};if(this.middleware){r=this.middleware(r)}return makeXhrRequest(r)};e.prototype.makeXHRDeleteRequest=function(e){var t=e.uid,a=e.item;var i=new XMLHttpRequest;var r={"x-fileuid":t,"x-filename":a.name};var n={payload:{data:null,name:name},options:{type:"DELETE",xhr:i,uri:this.uri,argument:"?key=".concat(t,"&name=").concat(a.name),headers:r},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress};if(this.middleware){n=this.middleware(n)}return makeXhrRequest(n)};e.prototype.onChange=function(e){return __awaiter(this,void 0,void 0,(function(){var t,a,i,r,n,o,l,s,d,u,h,p,c,b,f;return __generator(this,(function(m){switch(m.label){case 0:a=Array.from((t=this.nativeInput)===null||t===void 0?void 0:t.files);if(!a)return[3,8];i=0,r=a;m.label=1;case 1:if(!(i<r.length))return[3,8];n=r[i];o=validateFile(n,{maxBytes:this.maxBytes,allowedExtensions:this.allowedExtensions,allowedMimetypes:this.allowedMimetypes},this.errorCodes),l=o.valid,s=o.errorMessage,d=o.errorType,u=o.errorSystem;h=this.genHashName();p={uid:h,item:n,size:n.size,meta:this.metaData,uploaded:false,valid:l,error:{type:l?undefined:d,message:l?undefined:s,system_message:l?undefined:u},progress:0,deleted:false,xhr:false,url:false};this.files.set(n.name,p);c=this.validateTotals(n.name),b=c.bytesMaxReached,f=c.fileMaxReached;if(!b)return[3,2];this.updateValueInMap(n.name,"valid",false,false);return[3,6];case 2:if(!f)return[3,3];this.updateValueInMap(n.name,"valid",false,false);return[3,6];case 3:if(!(l&&!this.external))return[3,5];return[4,this.uploadFile(p)];case 4:m.sent();return[3,6];case 5:if(l&&this.external){this.updateValueInMap(p.item.name,"pending",true,false);this.updateValueInMap(p.item.name,"group","pending",true)}else if(!l){this.updateValueInMap(n.name,"valid",false,true)}m.label=6;case 6:this.kick();m.label=7;case 7:i++;return[3,1];case 8:this.resetFormFields();this.metaData=undefined;this.duetChange.emit({originalEvent:e,data:{files:this.files},component:"duet-upload"});return[2]}}))}))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{valid:["watchValidHandler"]}},enumerable:false,configurable:true});return e}();DuetUpload.style=duetUploadCss;export{DuetEditableTable as duet_editable_table,DuetTable as duet_table,DuetUpload as duet_upload};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host}from"./index-ccc5c541.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";var duetEmptyStateCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%;height:100%}.duet-empty-state{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;width:100%;height:100%;padding:48px;color:rgb(0, 41, 77);text-align:center;background:rgb(245, 248, 250);border-radius:4px}.duet-empty-state.duet-theme-turva{color:rgb(23, 28, 58);background:rgb(245, 245, 247)}";var DuetEmptyState=function(){function e(e){registerInstance(this,e);this.theme="";this.icon="messaging-question";this.size="medium"}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.render=function(){return h(Host,null,h("div",{class:{"duet-empty-state":true,"duet-theme-turva":this.theme==="turva","duet-is-small":this.size==="small"}},h("duet-icon",{color:"currentColor",name:this.icon,size:this.size==="small"?"large":"x-large"}),h("div",null,h("slot",null))))};return e}();DuetEmptyState.style=duetEmptyStateCss;export{DuetEmptyState as duet_empty_state};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-ccc5c541.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";var duetFieldsetCss='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}fieldset{position:relative;width:100%;min-width:0;border:0}fieldset legend{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-legend-wrapper{position:relative;display:block;width:100%;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:600;line-height:1.5;color:rgb(0, 41, 77);text-align:left;background:transparent}.duet-theme-turva .duet-legend-wrapper{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:rgb(23, 28, 58)}.duet-fieldset-label{margin-bottom:12px !important;margin-top:8px}.duet-legend-has-caption .duet-fieldset-label{margin-bottom:6px !important}.duet-legend-has-tooltip .duet-fieldset-label{padding-right:36px}@media (min-width: 48em){.duet-legend-has-tooltip .duet-fieldset-label{margin-bottom:3px !important;padding-right:0}}@media (min-width: 48em){.duet-legend-has-tooltip.duet-legend-has-caption .duet-fieldset-label{margin-bottom:-3px !important}}.duet-fieldset-caption{margin-bottom:12px !important}.duet-fieldset-help{display:block;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.875rem;font-weight:400;line-height:1.25;color:rgb(222, 35, 98);border-radius:4px}.duet-fieldset-help span{display:block;margin-top:12px}.duet-theme-turva .duet-fieldset-help{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:rgb(224, 42, 13)}::slotted(duet-tooltip){position:absolute;top:4px;right:0}@media (min-width: 48em){::slotted(duet-tooltip){position:relative;right:auto}}.duet-legend-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}';var DuetFieldset=function(){function e(e){var t=this;registerInstance(this,e);this.errorId=createID("DuetError");this.labelId=createID("DuetLabel");this.checkHasTooltip=function(){t.hasTooltip=!!t.element.querySelector("[slot='tooltip']")};this.hasTooltip=false;this.theme="";this.margin="auto";this.caption=undefined;this.label=undefined;this.error=undefined;this.accessibleLiveError="polite";this.labelHidden=false}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.checkHasTooltip()};e.prototype.render=function(){return h(Host,{class:{"duet-m-0":this.margin==="none"}},h("fieldset",{"aria-labelledby":this.labelId,"aria-describedby":this.error?this.errorId:null,class:{"duet-fieldset":true,"duet-theme-turva":this.theme==="turva"}},h("legend",{id:this.labelId},h("span",null,this.label),this.caption&&h("span",null,this.caption)),h("div",{class:{"duet-legend-wrapper":true,"duet-legend-has-caption":!!this.caption,"duet-legend-has-tooltip":this.hasTooltip,"duet-legend-hidden":this.labelHidden}},h("div",{class:"duet-fieldset-label"},h("span",{"aria-hidden":"true"},this.label),h("slot",{onSlotchange:this.checkHasTooltip,name:"tooltip"})),this.caption&&h("div",{class:"duet-fieldset-caption","aria-hidden":"true"},h("duet-caption",{margin:"none"},this.caption))),h("slot",null),h("span",{class:"duet-fieldset-help",id:this.errorId,"aria-atomic":"true","aria-live":this.accessibleLiveError,"aria-relevant":"additions removals"},this.error&&h("span",null,this.error))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetFieldset.style=duetFieldsetCss;export{DuetFieldset as duet_fieldset};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,o,r){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function d(e){try{l(r["throw"](e))}catch(t){i(t)}}function l(e){e.done?o(e.value):n(e.value).then(a,d)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,a;return a={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function d(e){return function(t){return l([e,t])}}function l(d){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,d[0]&&(o=0)),o)try{if(r=1,n&&(i=d[0]&2?n["return"]:d[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,d[1])).done)return i;if(n=0,i)d=[d[0]&2,i.value];switch(d[0]){case 0:case 1:i=d;break;case 4:o.label++;return{value:d[1],done:false};case 5:o.label++;n=d[1];d=[0];continue;case 7:d=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){o=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){o.label=d[1];break}if(d[0]===6&&o.label<i[1]){o.label=i[1];i=d;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(d);break}if(i[2])o.ops.pop();o.trys.pop();continue}d=t.call(e,o)}catch(l){d=[6,l];n=0}finally{r=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,c as createEvent$1,h,F as Fragment,g as getElement}from"./index-1f0abe67.js";import{a as actionArrowRight}from"./action-arrow-right-f7d56681.js";import{a as actionNewWindowSmall}from"./action-new-window-small-1945be91.js";import{D as DuetStringsExternalDefaults}from"./common-strings-97e04e4b.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{g as getLanguage,a as getLocaleString,c as connectLanguageChangeObserver,d as disconnectLanguageChangeObserver}from"./language-utils-6be16ff0.js";import{p as parsePossibleJSON}from"./string-utils-5954f458.js";var actionNewWindow={title:"action-new-window",tags:"arrow open new window tab external link square box rectangle action",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M10.25 2a.75.75 0 1 1 0 1.5h-6.5A2.252 2.252 0 0 0 1.5 5.75v14.5a2.252 2.252 0 0 0 2.25 2.25h14.5a2.252 2.252 0 0 0 2.25-2.25v-6.5a.75.75 0 0 1 1.5 0v6.5A3.754 3.754 0 0 1 18.25 24H3.75A3.754 3.754 0 0 1 0 20.25V5.75A3.754 3.754 0 0 1 3.75 2zm12.985-2c.1 0 .198.02.29.058l.025.011a.726.726 0 0 1 .15.091l.066.059a.755.755 0 0 1 .109.138l.051.1c.04.092.06.192.06.293l-.001 6.363c0 .2-.078.389-.22.53a.743.743 0 0 1-.53.22.743.743 0 0 1-.53-.22.743.743 0 0 1-.22-.53V2.559L15.28 9.764a.75.75 0 0 1-1.06-1.06l7.204-7.205h-4.553a.744.744 0 0 1-.75-.75c0-.2.078-.388.22-.53A.743.743 0 0 1 16.87 0z"/></svg>'};var duetFooterCss='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;flex-shrink:0;width:100%}.duet-footer{display:block;width:100%;padding-top:20px;padding-bottom:16px;margin-top:48px;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:rgb(255, 255, 255);text-align:left;background:rgb(0, 41, 77)}.duet-footer.duet-p-0{padding:0 !important}.duet-footer.duet-m-0{margin:0 !important}@media (min-width: 36em){.duet-footer{padding-top:36px}}@media (min-width: 62em){.duet-footer{padding-top:48px;padding-bottom:36px}}.duet-footer.duet-theme-turva{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";background:rgb(198, 12, 48)}.duet-footer a{color:rgb(255, 255, 255);text-decoration:none}@media (min-width: 62em){.duet-footer a{border-radius:4px}}.duet-footer a:focus{outline:0}:host(.user-is-tabbing) .duet-footer a:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px rgb(0, 119, 179)}:host(.user-is-tabbing) .duet-theme-turva a:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px rgb(23, 28, 58)}.duet-footer-wrapper{position:relative;margin:0 auto}@media (min-width: 62em){.duet-footer-wrapper{padding:0 72px 0 48px}}@media (min-width: 76.25em){.duet-footer-wrapper{max-width:1110px;padding:0 20px 0 0}}.duet-footer-top{width:100%}@media (min-width: 62em){.duet-footer-top{display:flex;flex-direction:row;align-items:center;justify-content:space-between}}duet-logo{margin-left:16px !important}@media (min-width: 36em){duet-logo{margin-left:28px !important}}@media (min-width: 62em){duet-logo{margin-left:0 !important}}.duet-footer-link{padding:16px !important;display:flex;flex-direction:row;align-items:center;width:100%;font-weight:600;border-bottom:1px solid rgba(255, 255, 255, 0.2);transition:background-color 300ms ease}@media (min-width: 36em){.duet-footer-link{padding-right:20px !important;padding-left:28px !important}}@media (min-width: 62em){.duet-footer-link{width:auto;min-width:0;padding-right:0 !important;padding-left:0 !important;border:0}}.duet-footer-link:first-of-type{margin-top:20px;border-top:1px solid rgba(255, 255, 255, 0.2)}@media (min-width: 62em){.duet-footer-link:first-of-type{margin:0;border:0}}.duet-footer-link span{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.duet-footer-link:hover{background:rgba(0, 0, 0, 0.1)}@media (min-width: 62em){.duet-footer-link:hover{background:transparent}}.duet-footer-icon{display:flex;align-items:center;justify-content:center;padding:12px;margin-right:16px;background:rgb(0, 119, 179);border-radius:50%;transition:300ms ease}.duet-theme-turva .duet-footer-icon{background:transparent;box-shadow:0 0 0 1px rgb(255, 255, 255)}a:hover .duet-footer-icon{background:#006ba1}.duet-theme-turva a:hover .duet-footer-icon{background:transparent}.duet-footer-arrow{display:flex;align-items:center;justify-content:center;width:20px;min-width:20px;max-width:20px;height:20px;max-height:20px;margin-left:auto;color:rgb(255, 255, 255);transition:transform 300ms ease}@media (min-width: 62em){.duet-footer-arrow{width:10px;min-width:10px;margin-top:3px;margin-left:8px}}@media (min-width: 62em){.duet-footer-arrow{margin-right:0}}a:hover .duet-footer-arrow{transform:translateX(4px)}.duet-footer-arrow duet-icon{width:20px;height:20px}@media (min-width: 62em){.duet-footer-arrow duet-icon{width:10px;height:10px}}.duet-footer-menu{padding:20px !important;display:flex;gap:2rem;font-size:0.875rem}@media (min-width: 36em){.duet-footer-menu{padding:28px !important}}@media (min-width: 62em){.duet-footer-menu{padding-left:8px !important}}.duet-footer-menu a{display:inline-block;text-decoration:none;word-break:break-all}.duet-footer-menu a:hover,.duet-footer-menu a:focus{text-decoration:underline}.duet-footer-menu a:hover .duet-footer-divider,.duet-footer-menu a:focus .duet-footer-divider{text-decoration:none}.duet-footer-menu .duet-footer-divider{display:inline-block;margin:0 8px}.duet-footer-menu .duet-footer-divider-copyright{display:none}.duet-footer-menu .duet-footer-menu-links{flex:1}@media (min-width: 62em){.duet-footer-menu .duet-footer-menu-links{text-align:right}}.duet-footer-menu a:last-of-type .duet-footer-divider{display:none}.duet-footer-copyright{display:none;font-size:0.875rem;color:rgb(255, 255, 255)}@media (min-width: 62em){.duet-footer-copyright{display:inline}}.duet-footer-copyright.duet-footer-copyright-mobile{display:block;padding-top:0.5rem;padding-bottom:1.25rem;padding-left:2rem;text-align:left}@media (min-width: 62em){.duet-footer-copyright.duet-footer-copyright-mobile{display:none}}.duet-footer-simple{padding:0;margin:0;margin-top:16px;color:rgb(0, 41, 77);background:transparent !important;border-top:1px solid rgb(225, 227, 230)}.duet-footer-simple .duet-footer-wrapper{max-width:100%;padding:0 20px;margin:0}@media (min-width: 62em){.duet-footer-simple .duet-footer-wrapper{padding:0 36px}}@media (min-width: 106.25em){.duet-footer-simple .duet-footer-wrapper{padding:0 48px}}.duet-footer-simple .duet-footer-copyright,.duet-footer-simple .duet-footer-menu a{color:rgb(0, 41, 77)}.duet-footer-simple .duet-footer-menu{padding:20px 0 !important}.duet-footer-simple .duet-footer-copyright-mobile{padding-left:0}.duet-footer-simple.duet-theme-turva{color:rgb(23, 28, 58);border-color:rgb(228, 228, 230)}.duet-footer-simple.duet-theme-turva .duet-footer-copyright,.duet-footer-simple.duet-theme-turva .duet-footer-menu a{color:rgb(23, 28, 58)}.duet-footer-external{display:inline-block;margin-left:4px;color:rgb(0, 119, 179)}.duet-theme-turva .duet-footer-external{color:rgb(255, 255, 255)}.duet-footer-simple.duet-theme-turva .duet-footer-external{color:rgb(198, 12, 48)}';var i18n={fi:{lahi:"© LähiTapiola",turva:"© Turva"},sv:{lahi:"© LokalTapiola",turva:"© Turva"},en:{lahi:"© LocalTapiola",turva:"© Turva"}};var createEvent=function(e,t){return{component:"duet-footer",data:t,originalEvent:e}};var DuetFooter=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent$1(this,"duetChange",3);this.duetLogoClick=createEvent$1(this,"duetLogoClick",7);this.duetMenuClick=createEvent$1(this,"duetMenuClick",7);this.duetItemClick=createEvent$1(this,"duetItemClick",7);this.duetAnalytics=createEvent$1(this,"duetAnalytics",7);this.duetEvent=createEvent$1(this,"duetEvent",7);this.handleClick=function(e){if(e.data.analyticsId){t.duetAnalytics.emit({component:"duet-footer",analyticsId:e.data.analyticsId})}t.duetChange.emit(e)};this.handleLogoClick=function(e){var o=createEvent(e,{href:t.logoHref,label:"logo"});t.duetLogoClick.emit(o);t.handleClick(o)};this.handleMenuClick=function(e,o){var r=createEvent(e,o);t.handleClick(r);t.duetMenuClick.emit(r)};this.handleItemClick=function(e,o){var r=createEvent(e,o);t.handleClick(r);t.duetItemClick.emit(r)};this.emitDuetEvent=function(e,o){t.duetEvent.emit({component:"duet-footer",data:o,originalEvent:e})};this.processedMainItem=null;this.processedItems=null;this.processedMenu=null;this.theme="";this.variation="default";this.margin="auto";this.logoHref="/";this.language=getLanguage();this.items=undefined;this.accessibleLabelExternalDefaults=DuetStringsExternalDefaults;this.accessibleLabelExternal=getLocaleString(this.accessibleLabelExternalDefaults);this.menu=undefined}e.prototype.watchLanguageStateHandler=function(e,t){if(e!==t&&this.accessibleLabelExternal===this.accessibleLabelExternalDefaults[t]){this.accessibleLabelExternal=getLocaleString(this.accessibleLabelExternalDefaults,e)}};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.refresh()};e.prototype.connectedCallback=function(){connectLanguageChangeObserver(this)};e.prototype.disconnectedCallback=function(){disconnectLanguageChangeObserver(this)};e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.processedItems=parsePossibleJSON(this.items);this.processedMenu=parsePossibleJSON(this.menu);return[2]}))}))};e.prototype.render=function(){var e=this;var t=getLocaleString(i18n);var o=this.theme==="turva"?t.turva:t.lahi;return h("footer",{class:{"duet-footer":true,"duet-m-0":this.margin==="none","duet-theme-turva":this.theme==="turva","duet-footer-simple":this.variation==="simple"}},h("div",{class:"duet-footer-wrapper"},h("div",{class:"duet-footer-top",part:"top"},this.variation!=="simple"&&h("duet-logo",{href:this.logoHref,onClick:this.handleLogoClick,size:"large",inverse:true,language:this.language,theme:this.theme}),this.processedItems&&this.variation!=="simple"&&this.processedItems.map((function(t){return h("a",{class:"duet-footer-link",href:t.href,id:t.id,target:t.external?"_blank":"_self",onClick:function(o){return e.handleItemClick(o,t)},onMouseEnter:function(o){return e.emitDuetEvent(o,t)},onTouchStart:function(o){return e.emitDuetEvent(o,t)}},h("div",{class:"duet-footer-icon"},h("duet-icon",{size:"medium",margin:"none",name:t.icon,color:"currentColor"})),h("span",null,t.label),t.external&&h("duet-visually-hidden",null,", ",e.accessibleLabelExternal),h("div",{class:"duet-footer-arrow"},t.external?h("duet-icon",{icon:actionNewWindow.svg,size:"xx-small",margin:"none",color:"currentColor"}):h("duet-icon",{icon:actionArrowRight.svg,size:"auto",margin:"none",color:"currentColor"})))}))),h("slot",{name:"extra"}),h("p",{class:"duet-footer-menu",part:"menu"},h("span",{class:"duet-footer-copyright"},"".concat(o," ").concat((new Date).getFullYear())),h("div",{class:"duet-footer-menu-links"},this.processedMenu&&h(Fragment,null,this.processedMenu.map((function(t){return h("a",{href:t.href,id:t.id,target:t.external?"_blank":"_self",onClick:function(o){return e.handleMenuClick(o,t)},onMouseEnter:function(o){return e.emitDuetEvent(o,t)},onTouchStart:function(o){return e.emitDuetEvent(o,t)}},t.label,t.external&&h(Fragment,null,h("duet-visually-hidden",null,", ",e.accessibleLabelExternal),h("div",{class:"duet-footer-external"},h("duet-icon",{icon:actionNewWindowSmall.svg,size:"xx-small",margin:"none",color:"currentColor"}))),h("span",{class:"duet-footer-divider",role:"presentation","aria-hidden":"true"},"/"))}))))),h("p",{class:"duet-footer-copyright duet-footer-copyright-mobile"},"".concat(o," ").concat((new Date).getFullYear()))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{language:["watchLanguageStateHandler"],menu:["refresh"],items:["refresh"]}},enumerable:false,configurable:true});return e}();DuetFooter.style=duetFooterCss;export{DuetFooter as duet_footer};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent$1,h,F as Fragment,g as getElement}from"./index-ccc5c541.js";import{a as actionArrowRight}from"./action-arrow-right-f7d56681.js";import{a as actionNewWindowSmall}from"./action-new-window-small-1945be91.js";import{D as DuetStringsExternalDefaults}from"./common-strings-97e04e4b.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{g as getLanguage,a as getLocaleString,c as connectLanguageChangeObserver,d as disconnectLanguageChangeObserver}from"./language-utils-6be16ff0.js";import{p as parsePossibleJSON}from"./string-utils-5954f458.js";var actionNewWindow={title:"action-new-window",tags:"arrow open new window tab external link square box rectangle action",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M10.25 2a.75.75 0 1 1 0 1.5h-6.5A2.252 2.252 0 0 0 1.5 5.75v14.5a2.252 2.252 0 0 0 2.25 2.25h14.5a2.252 2.252 0 0 0 2.25-2.25v-6.5a.75.75 0 0 1 1.5 0v6.5A3.754 3.754 0 0 1 18.25 24H3.75A3.754 3.754 0 0 1 0 20.25V5.75A3.754 3.754 0 0 1 3.75 2zm12.985-2c.1 0 .198.02.29.058l.025.011a.726.726 0 0 1 .15.091l.066.059a.755.755 0 0 1 .109.138l.051.1c.04.092.06.192.06.293l-.001 6.363c0 .2-.078.389-.22.53a.743.743 0 0 1-.53.22.743.743 0 0 1-.53-.22.743.743 0 0 1-.22-.53V2.559L15.28 9.764a.75.75 0 0 1-1.06-1.06l7.204-7.205h-4.553a.744.744 0 0 1-.75-.75c0-.2.078-.388.22-.53A.743.743 0 0 1 16.87 0z"/></svg>'};var duetFooterCss='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;flex-shrink:0;width:100%}.duet-footer{display:block;width:100%;padding-top:20px;padding-bottom:16px;margin-top:48px;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:rgb(255, 255, 255);text-align:left;background:rgb(0, 41, 77)}.duet-footer.duet-p-0{padding:0 !important}.duet-footer.duet-m-0{margin:0 !important}@media (min-width: 36em){.duet-footer{padding-top:36px}}@media (min-width: 62em){.duet-footer{padding-top:48px;padding-bottom:36px}}.duet-footer.duet-theme-turva{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";background:rgb(198, 12, 48)}.duet-footer a{color:rgb(255, 255, 255);text-decoration:none}@media (min-width: 62em){.duet-footer a{border-radius:4px}}.duet-footer a:focus{outline:0}:host(.user-is-tabbing) .duet-footer a:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px rgb(0, 119, 179)}:host(.user-is-tabbing) .duet-theme-turva a:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px rgb(23, 28, 58)}.duet-footer-wrapper{position:relative;margin:0 auto}@media (min-width: 62em){.duet-footer-wrapper{padding:0 72px 0 48px}}@media (min-width: 76.25em){.duet-footer-wrapper{max-width:1110px;padding:0 20px 0 0}}.duet-footer-top{width:100%}@media (min-width: 62em){.duet-footer-top{display:flex;flex-direction:row;align-items:center;justify-content:space-between}}duet-logo{margin-left:16px !important}@media (min-width: 36em){duet-logo{margin-left:28px !important}}@media (min-width: 62em){duet-logo{margin-left:0 !important}}.duet-footer-link{padding:16px !important;display:flex;flex-direction:row;align-items:center;width:100%;font-weight:600;border-bottom:1px solid rgba(255, 255, 255, 0.2);transition:background-color 300ms ease}@media (min-width: 36em){.duet-footer-link{padding-right:20px !important;padding-left:28px !important}}@media (min-width: 62em){.duet-footer-link{width:auto;min-width:0;padding-right:0 !important;padding-left:0 !important;border:0}}.duet-footer-link:first-of-type{margin-top:20px;border-top:1px solid rgba(255, 255, 255, 0.2)}@media (min-width: 62em){.duet-footer-link:first-of-type{margin:0;border:0}}.duet-footer-link span{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.duet-footer-link:hover{background:rgba(0, 0, 0, 0.1)}@media (min-width: 62em){.duet-footer-link:hover{background:transparent}}.duet-footer-icon{display:flex;align-items:center;justify-content:center;padding:12px;margin-right:16px;background:rgb(0, 119, 179);border-radius:50%;transition:300ms ease}.duet-theme-turva .duet-footer-icon{background:transparent;box-shadow:0 0 0 1px rgb(255, 255, 255)}a:hover .duet-footer-icon{background:#006ba1}.duet-theme-turva a:hover .duet-footer-icon{background:transparent}.duet-footer-arrow{display:flex;align-items:center;justify-content:center;width:20px;min-width:20px;max-width:20px;height:20px;max-height:20px;margin-left:auto;color:rgb(255, 255, 255);transition:transform 300ms ease}@media (min-width: 62em){.duet-footer-arrow{width:10px;min-width:10px;margin-top:3px;margin-left:8px}}@media (min-width: 62em){.duet-footer-arrow{margin-right:0}}a:hover .duet-footer-arrow{transform:translateX(4px)}.duet-footer-arrow duet-icon{width:20px;height:20px}@media (min-width: 62em){.duet-footer-arrow duet-icon{width:10px;height:10px}}.duet-footer-menu{padding:20px !important;display:flex;gap:2rem;font-size:0.875rem}@media (min-width: 36em){.duet-footer-menu{padding:28px !important}}@media (min-width: 62em){.duet-footer-menu{padding-left:8px !important}}.duet-footer-menu a{display:inline-block;text-decoration:none;word-break:break-all}.duet-footer-menu a:hover,.duet-footer-menu a:focus{text-decoration:underline}.duet-footer-menu a:hover .duet-footer-divider,.duet-footer-menu a:focus .duet-footer-divider{text-decoration:none}.duet-footer-menu .duet-footer-divider{display:inline-block;margin:0 8px}.duet-footer-menu .duet-footer-divider-copyright{display:none}.duet-footer-menu .duet-footer-menu-links{flex:1}@media (min-width: 62em){.duet-footer-menu .duet-footer-menu-links{text-align:right}}.duet-footer-menu a:last-of-type .duet-footer-divider{display:none}.duet-footer-copyright{display:none;font-size:0.875rem;color:rgb(255, 255, 255)}@media (min-width: 62em){.duet-footer-copyright{display:inline}}.duet-footer-copyright.duet-footer-copyright-mobile{display:block;padding-top:0.5rem;padding-bottom:1.25rem;padding-left:2rem;text-align:left}@media (min-width: 62em){.duet-footer-copyright.duet-footer-copyright-mobile{display:none}}.duet-footer-simple{padding:0;margin:0;margin-top:16px;color:rgb(0, 41, 77);background:transparent !important;border-top:1px solid rgb(225, 227, 230)}.duet-footer-simple .duet-footer-wrapper{max-width:100%;padding:0 20px;margin:0}@media (min-width: 62em){.duet-footer-simple .duet-footer-wrapper{padding:0 36px}}@media (min-width: 106.25em){.duet-footer-simple .duet-footer-wrapper{padding:0 48px}}.duet-footer-simple .duet-footer-copyright,.duet-footer-simple .duet-footer-menu a{color:rgb(0, 41, 77)}.duet-footer-simple .duet-footer-menu{padding:20px 0 !important}.duet-footer-simple .duet-footer-copyright-mobile{padding-left:0}.duet-footer-simple.duet-theme-turva{color:rgb(23, 28, 58);border-color:rgb(228, 228, 230)}.duet-footer-simple.duet-theme-turva .duet-footer-copyright,.duet-footer-simple.duet-theme-turva .duet-footer-menu a{color:rgb(23, 28, 58)}.duet-footer-external{display:inline-block;margin-left:4px;color:rgb(0, 119, 179)}.duet-theme-turva .duet-footer-external{color:rgb(255, 255, 255)}.duet-footer-simple.duet-theme-turva .duet-footer-external{color:rgb(198, 12, 48)}';var i18n={fi:{lahi:"© LähiTapiola",turva:"© Turva"},sv:{lahi:"© LokalTapiola",turva:"© Turva"},en:{lahi:"© LocalTapiola",turva:"© Turva"}};var createEvent=function(e,t){return{component:"duet-footer",data:t,originalEvent:e}};var DuetFooter=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent$1(this,"duetChange",3);this.duetLogoClick=createEvent$1(this,"duetLogoClick",7);this.duetMenuClick=createEvent$1(this,"duetMenuClick",7);this.duetItemClick=createEvent$1(this,"duetItemClick",7);this.duetAnalytics=createEvent$1(this,"duetAnalytics",7);this.duetEvent=createEvent$1(this,"duetEvent",7);this.handleClick=function(e){if(e.data.analyticsId){t.duetAnalytics.emit({component:"duet-footer",analyticsId:e.data.analyticsId})}t.duetChange.emit(e)};this.handleLogoClick=function(e){var o=createEvent(e,{href:t.logoHref,label:"logo"});t.duetLogoClick.emit(o);t.handleClick(o)};this.handleMenuClick=function(e,o){var r=createEvent(e,o);t.handleClick(r);t.duetMenuClick.emit(r)};this.handleItemClick=function(e,o){var r=createEvent(e,o);t.handleClick(r);t.duetItemClick.emit(r)};this.emitDuetEvent=function(e,o){t.duetEvent.emit({component:"duet-footer",data:o,originalEvent:e})};this.processedMainItem=null;this.processedItems=null;this.processedMenu=null;this.theme="";this.variation="default";this.margin="auto";this.logoHref="/";this.language=getLanguage();this.items=undefined;this.accessibleLabelExternalDefaults=DuetStringsExternalDefaults;this.accessibleLabelExternal=getLocaleString(this.accessibleLabelExternalDefaults);this.menu=undefined}e.prototype.watchLanguageStateHandler=function(e,t){if(e!==t&&this.accessibleLabelExternal===this.accessibleLabelExternalDefaults[t]){this.accessibleLabelExternal=getLocaleString(this.accessibleLabelExternalDefaults,e)}};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.refresh()};e.prototype.connectedCallback=function(){connectLanguageChangeObserver(this)};e.prototype.disconnectedCallback=function(){disconnectLanguageChangeObserver(this)};e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.processedItems=parsePossibleJSON(this.items);this.processedMenu=parsePossibleJSON(this.menu);return[2]}))}))};e.prototype.render=function(){var e=this;var t=getLocaleString(i18n);var o=this.theme==="turva"?t.turva:t.lahi;return h("footer",{class:{"duet-footer":true,"duet-m-0":this.margin==="none","duet-theme-turva":this.theme==="turva","duet-footer-simple":this.variation==="simple"}},h("div",{class:"duet-footer-wrapper"},h("div",{class:"duet-footer-top",part:"top"},this.variation!=="simple"&&h("duet-logo",{href:this.logoHref,onClick:this.handleLogoClick,size:"large",inverse:true,language:this.language,theme:this.theme}),this.processedItems&&this.variation!=="simple"&&this.processedItems.map((function(t){return h("a",{class:"duet-footer-link",href:t.href,id:t.id,target:t.external?"_blank":"_self",onClick:function(o){return e.handleItemClick(o,t)},onMouseEnter:function(o){return e.emitDuetEvent(o,t)},onTouchStart:function(o){return e.emitDuetEvent(o,t)}},h("div",{class:"duet-footer-icon"},h("duet-icon",{size:"medium",margin:"none",name:t.icon,color:"currentColor"})),h("span",null,t.label),t.external&&h("duet-visually-hidden",null,", ",e.accessibleLabelExternal),h("div",{class:"duet-footer-arrow"},t.external?h("duet-icon",{icon:actionNewWindow.svg,size:"xx-small",margin:"none",color:"currentColor"}):h("duet-icon",{icon:actionArrowRight.svg,size:"auto",margin:"none",color:"currentColor"})))}))),h("slot",{name:"extra"}),h("p",{class:"duet-footer-menu",part:"menu"},h("span",{class:"duet-footer-copyright"},"".concat(o," ").concat((new Date).getFullYear())),h("div",{class:"duet-footer-menu-links"},this.processedMenu&&h(Fragment,null,this.processedMenu.map((function(t){return h("a",{href:t.href,id:t.id,target:t.external?"_blank":"_self",onClick:function(o){return e.handleMenuClick(o,t)},onMouseEnter:function(o){return e.emitDuetEvent(o,t)},onTouchStart:function(o){return e.emitDuetEvent(o,t)}},t.label,t.external&&h(Fragment,null,h("duet-visually-hidden",null,", ",e.accessibleLabelExternal),h("div",{class:"duet-footer-external"},h("duet-icon",{icon:actionNewWindowSmall.svg,size:"xx-small",margin:"none",color:"currentColor"}))),h("span",{class:"duet-footer-divider",role:"presentation","aria-hidden":"true"},"/"))}))))),h("p",{class:"duet-footer-copyright duet-footer-copyright-mobile"},"".concat(o," ").concat((new Date).getFullYear()))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{language:["watchLanguageStateHandler"],menu:["refresh"],items:["refresh"]}},enumerable:false,configurable:true});return e}();DuetFooter.style=duetFooterCss;export{DuetFooter as duet_footer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,i,e,r){function d(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,n){function a(t){try{m(r.next(t))}catch(i){n(i)}}function o(t){try{m(r["throw"](t))}catch(i){n(i)}}function m(t){t.done?e(t.value):d(t.value).then(a,o)}m((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,d,n,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(t){return function(i){return m([t,i])}}function m(o){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(e=0)),e)try{if(r=1,d&&(n=o[0]&2?d["return"]:o[0]?d["throw"]||((n=d["return"])&&n.call(d),0):d.next)&&!(n=n.call(d,o[1])).done)return n;if(d=0,n)o=[o[0]&2,n.value];switch(o[0]){case 0:case 1:n=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;d=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(n=e.trys,n=n.length>0&&n[n.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!n||o[1]>n[0]&&o[1]<n[3])){e.label=o[1];break}if(o[0]===6&&e.label<n[1]){e.label=n[1];n=o;break}if(n&&e.label<n[2]){e.label=n[2];e.ops.push(o);break}if(n[2])e.ops.pop();e.trys.pop();continue}o=i.call(t,e)}catch(m){o=[6,m];d=0}finally{r=n=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,h,g as getElement,H as Host}from"./index-1f0abe67.js";import{m as media_query_large,a as media_query_medium,b as media_query_small}from"./tokens-0963dc8b.js";import{w as watchForOptions,a as watchForElement}from"./watch-options-dd55bce8.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";var duetGridCss=".sc-duet-grid-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:flex !important;flex-direction:column !important;align-items:flex-start !important;justify-content:flex-start !important;width:100%;max-width:100%;height:auto}.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-x-small.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}@media (max-width: 22.5em){.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:column !important}}@media (min-width: 36em){.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-small.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}@media (min-width: 48em){.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-medium.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}@media (min-width: 62em){.duet-grid-breakpoint-large.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-large.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}@media (min-width: 64.0625em){.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-x-large.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}.duet-grid-wrap.sc-duet-grid-h{flex-wrap:wrap !important}.duet-no-stacking.sc-duet-grid-h{flex-direction:row !important}.duet-no-stacking.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}.duet-grid-direction-vertical.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:column !important}@media (max-width: 35.9375em){.duet-grid-direction-vertical.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 36em){.duet-grid-direction-vertical.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 48em){.duet-grid-direction-vertical.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-large.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 62em){.duet-grid-direction-vertical.duet-grid-breakpoint-large.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 64.0625em){.duet-grid-direction-vertical.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-align-top.duet-no-stacking.sc-duet-grid-h{align-items:flex-start !important}.duet-grid-align-bottom.duet-no-stacking.sc-duet-grid-h{align-items:flex-end !important}.duet-grid-align-center.duet-no-stacking.sc-duet-grid-h{align-items:center !important}.duet-grid-align-stretch.duet-no-stacking.sc-duet-grid-h{align-items:stretch !important}.duet-grid-align-baseline.duet-no-stacking.sc-duet-grid-h{align-items:baseline !important}.duet-grid-align-top.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:flex-start !important}.duet-grid-align-bottom.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:flex-end !important}.duet-grid-align-center.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:center !important}.duet-grid-align-stretch.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:stretch !important}.duet-grid-align-baseline.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:baseline !important}@media (min-width: 36em){.duet-grid-align-top.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 36em){.duet-grid-align-bottom.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 36em){.duet-grid-align-center.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:center !important}}@media (min-width: 36em){.duet-grid-align-stretch.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 36em){.duet-grid-align-baseline.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 48em){.duet-grid-align-top.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 48em){.duet-grid-align-bottom.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 48em){.duet-grid-align-center.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:center !important}}@media (min-width: 48em){.duet-grid-align-stretch.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 48em){.duet-grid-align-baseline.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 62em){.duet-grid-align-top.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 62em){.duet-grid-align-bottom.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 62em){.duet-grid-align-center.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:center !important}}@media (min-width: 62em){.duet-grid-align-stretch.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 62em){.duet-grid-align-baseline.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 64.0625em){.duet-grid-align-top.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 64.0625em){.duet-grid-align-bottom.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 64.0625em){.duet-grid-align-center.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:center !important}}@media (min-width: 64.0625em){.duet-grid-align-stretch.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 64.0625em){.duet-grid-align-baseline.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:baseline !important}}.duet-grid-distribution-left.sc-duet-grid-h{justify-content:flex-start !important}.duet-grid-distribution-right.sc-duet-grid-h{justify-content:flex-end !important}.duet-grid-distribution-center.sc-duet-grid-h{justify-content:center !important}.duet-grid-distribution-between.sc-duet-grid-h{justify-content:space-between !important}.duet-grid-distribution-around.sc-duet-grid-h{justify-content:space-around !important}.duet-grid-distribution-evenly.sc-duet-grid-h{justify-content:space-evenly !important}@media (max-width: 35.9375em){.duet-grid-mobile-left.sc-duet-grid-h{align-items:flex-start !important;justify-content:flex-start !important;text-align:left !important}}@media (max-width: 35.9375em){.duet-grid-mobile-center.sc-duet-grid-h{align-items:center !important;justify-content:center !important;text-align:center !important}.duet-grid-mobile-center.sc-duet-grid-h *.sc-duet-grid{text-align:center !important}}@media (max-width: 35.9375em){.duet-grid-mobile-right.sc-duet-grid-h{align-items:flex-end !important;justify-content:flex-end !important;text-align:right !important}.duet-grid-mobile-right.sc-duet-grid-h *.sc-duet-grid{text-align:right !important}}";function isGridItem(t){return t.tagName.toLowerCase()==="duet-grid-item"}var DuetGrid=function(){function t(t){registerInstance(this,t);this.mql=[window.matchMedia(media_query_large.replace(/'/g,"")),window.matchMedia(media_query_medium.replace(/'/g,"")),window.matchMedia(media_query_small.replace(/'/g,""))];this.distributeFormElement=false;this.responsive=false;this.breakpoint="small";this.direction="horizontal";this.rowReverse=false;this.alignment="top";this.distribution="default";this.mobile=""}t.prototype.outerHeight=function(t){var e=t.offsetHeight,i=window.getComputedStyle(t);return["top","bottom"].map((function(t){return parseInt(i["margin-".concat(t)])})).reduce((function(t,e){return t+e}),e)};t.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;var i=this;return __generator(this,(function(r){t=this.element;this.distributeFormElement=this.alignment==="form_distribute";this.mutationO=watchForOptions(t,"duet-grid-item",(function(){i.updateGridItems()}));if(this.distributeFormElement){this.mutation1=watchForElement(t,"duet-input",(function(){i.updateGridItemsWithInputFields()}));for(e=0;e<this.mql.length;e++){if(this.mql[e].addEventListener){this.mql[e].addEventListener("change",this.updateGridItemsWithInputFields.bind(this))}}}this.updateGridItems();return[2]}))}))};t.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}if(this.mutation1){this.mutation1.disconnect();this.mutation1=undefined}for(var t=0;t<this.mql.length;t++){if(this.mql[t].removeEventListener){this.mql[t].removeEventListener("change",this.updateGridItemsWithInputFields.bind(this))}}};t.prototype.updateGridItems=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){t=Array.from(this.element.children).filter(isGridItem);t.forEach((function(t){t.responsive=e.responsive;t.breakpoint=e.breakpoint;t.direction=e.direction}));return[2]}))}))};t.prototype.updateGridItemsWithInputFields=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r;var d=this;return __generator(this,(function(n){t=Array.from(this.element.children).filter(isGridItem);e=window?window.getComputedStyle(this.element).flexDirection==="column":false;i=0;r=[];t.forEach((function(t){var e=t.querySelector("span.duet-input-error");var i=e?d.outerHeight(e):0;r.push(i)}));i=Math.max.apply(Math,r);t.forEach((function(t){var r=t.querySelector("span.duet-input-error");var n=r?d.outerHeight(r):0;if(n<i&&!e){t.setAttribute("style","padding-bottom: ".concat(i-n,"px;"))}else if(n===i||e){t.setAttribute("style","padding-bottom: 0px;")}}));return[2]}))}))};t.prototype.render=function(){return h(Host,{class:{"duet-grid":true,"duet-no-stacking":!this.responsive,"duet-grid-align-top":this.alignment==="top","duet-grid-align-bottom":this.alignment==="bottom"||this.alignment==="form_distribute","duet-grid-align-center":this.alignment==="center","duet-grid-align-stretch":this.alignment==="stretch","duet-grid-align-baseline":this.alignment==="baseline","duet-grid-distribution-left":this.distribution==="left","duet-grid-distribution-right":this.distribution==="right","duet-grid-distribution-center":this.distribution==="center","duet-grid-distribution-between":this.distribution==="space-between","duet-grid-distribution-around":this.distribution==="space-around","duet-grid-distribution-evenly":this.distribution==="space-evenly","duet-grid-mobile-left":this.mobile==="left","duet-grid-mobile-center":this.mobile==="center","duet-grid-mobile-right":this.mobile==="right","duet-grid-direction-horizontal":this.direction==="horizontal","duet-grid-direction-vertical":this.direction==="vertical","duet-grid-breakpoint-x-small":this.breakpoint==="x-small","duet-grid-breakpoint-small":this.breakpoint==="small","duet-grid-breakpoint-medium":this.breakpoint==="medium","duet-grid-breakpoint-large":this.breakpoint==="large","duet-grid-breakpoint-x-large":this.breakpoint==="x-large","duet-grid-row-reverse":this.rowReverse}})};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{responsive:["updateGridItems"],breakpoint:["updateGridItems"],direction:["updateGridItems"]}},enumerable:false,configurable:true});return t}();DuetGrid.style=duetGridCss;var duetGridItemCss='.sc-duet-grid-item-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:16px !important;min-width:0;max-width:100%;flex:0 0 auto;padding-right:8px;padding-left:8px;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-style:normal;font-weight:400;line-height:1.5;color:rgb(0, 41, 77)}.duet-grid-direction-horizontal.sc-duet-grid-item-h:first-child,.duet-grid-direction-horizontal.sc-duet-grid-item-h:first-of-type{padding-left:0}.duet-grid-direction-horizontal.sc-duet-grid-item-h:last-child,.duet-grid-direction-horizontal.sc-duet-grid-item-h:last-of-type{padding-right:0}@media (max-width: 35.9375em){.duet-grid-item-responsive.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important;padding-right:0;padding-left:0}}@media screen and (max-width: 47.9375em){.duet-grid-item-br-medium.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important}}@media screen and (max-width: 47.9375em){.duet-grid-item-responsive.duet-grid-item-br-medium.sc-duet-grid-item-h{padding-right:0;padding-left:0}}@media screen and (max-width: 64em){.duet-grid-item-br-x-large.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important}}@media screen and (max-width: 64em){.duet-grid-item-responsive.duet-grid-item-br-x-large.sc-duet-grid-item-h{padding-right:0;padding-left:0}}.duet-grid-item-fill.sc-duet-grid-item-h{flex:1 1 auto;width:100%}.duet-theme-turva.sc-duet-grid-item-h{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:rgb(23, 28, 58)}.duet-m-0.sc-duet-grid-item-h{padding:0 !important;margin:0 !important}';var DuetGridItem=function(){function t(t){registerInstance(this,t);this.fill=false;this.maxWidth=undefined;this.minWidth=undefined;this.theme="";this.margin="auto";this.responsive=false;this.direction="horizontal";this.breakpoint="small"}t.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};t.prototype.render=function(){return h(Host,{style:{"min-width":this.minWidth,"max-width":this.maxWidth},class:{"duet-m-0":this.margin==="none","duet-theme-turva":this.theme==="turva","duet-grid-item":true,"duet-grid-item-fill":this.fill,"duet-grid-item-responsive":this.responsive,"duet-grid-direction-horizontal":this.direction==="horizontal","duet-grid-direction-vertical":this.direction==="vertical","duet-grid-item-br-x-small":this.breakpoint==="x-small","duet-grid-item-br-small":this.breakpoint==="small","duet-grid-item-br-medium":this.breakpoint==="medium","duet-grid-item-br-large":this.breakpoint==="large","duet-grid-item-br-x-large":this.breakpoint==="x-large"}})};return t}();DuetGridItem.style=duetGridItemCss;export{DuetGrid as duet_grid,DuetGridItem as duet_grid_item};
|
|
4
|
+
*/import{r as registerInstance,h,g as getElement,H as Host}from"./index-ccc5c541.js";import{m as media_query_large,a as media_query_medium,b as media_query_small}from"./tokens-0963dc8b.js";import{w as watchForOptions,a as watchForElement}from"./watch-options-dd55bce8.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";var duetGridCss=".sc-duet-grid-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:flex !important;flex-direction:column !important;align-items:flex-start !important;justify-content:flex-start !important;width:100%;max-width:100%;height:auto}.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-x-small.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}@media (max-width: 22.5em){.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:column !important}}@media (min-width: 36em){.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-small.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}@media (min-width: 48em){.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-medium.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}@media (min-width: 62em){.duet-grid-breakpoint-large.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-large.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}@media (min-width: 64.0625em){.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:row !important}.duet-grid-breakpoint-x-large.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}}.duet-grid-wrap.sc-duet-grid-h{flex-wrap:wrap !important}.duet-no-stacking.sc-duet-grid-h{flex-direction:row !important}.duet-no-stacking.duet-grid-row-reverse.sc-duet-grid-h{flex-direction:row-reverse !important}.duet-grid-direction-vertical.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:column !important}@media (max-width: 35.9375em){.duet-grid-direction-vertical.duet-grid-breakpoint-x-small.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 36em){.duet-grid-direction-vertical.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 48em){.duet-grid-direction-vertical.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-large.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 62em){.duet-grid-direction-vertical.duet-grid-breakpoint-large.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 64.0625em){.duet-grid-direction-vertical.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-align-top.duet-no-stacking.sc-duet-grid-h{align-items:flex-start !important}.duet-grid-align-bottom.duet-no-stacking.sc-duet-grid-h{align-items:flex-end !important}.duet-grid-align-center.duet-no-stacking.sc-duet-grid-h{align-items:center !important}.duet-grid-align-stretch.duet-no-stacking.sc-duet-grid-h{align-items:stretch !important}.duet-grid-align-baseline.duet-no-stacking.sc-duet-grid-h{align-items:baseline !important}.duet-grid-align-top.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:flex-start !important}.duet-grid-align-bottom.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:flex-end !important}.duet-grid-align-center.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:center !important}.duet-grid-align-stretch.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:stretch !important}.duet-grid-align-baseline.duet-grid-breakpoint-x-small.sc-duet-grid-h{align-items:baseline !important}@media (min-width: 36em){.duet-grid-align-top.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 36em){.duet-grid-align-bottom.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 36em){.duet-grid-align-center.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:center !important}}@media (min-width: 36em){.duet-grid-align-stretch.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 36em){.duet-grid-align-baseline.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 48em){.duet-grid-align-top.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 48em){.duet-grid-align-bottom.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 48em){.duet-grid-align-center.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:center !important}}@media (min-width: 48em){.duet-grid-align-stretch.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 48em){.duet-grid-align-baseline.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 62em){.duet-grid-align-top.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 62em){.duet-grid-align-bottom.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 62em){.duet-grid-align-center.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:center !important}}@media (min-width: 62em){.duet-grid-align-stretch.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 62em){.duet-grid-align-baseline.duet-grid-breakpoint-large.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 64.0625em){.duet-grid-align-top.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 64.0625em){.duet-grid-align-bottom.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 64.0625em){.duet-grid-align-center.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:center !important}}@media (min-width: 64.0625em){.duet-grid-align-stretch.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 64.0625em){.duet-grid-align-baseline.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:baseline !important}}.duet-grid-distribution-left.sc-duet-grid-h{justify-content:flex-start !important}.duet-grid-distribution-right.sc-duet-grid-h{justify-content:flex-end !important}.duet-grid-distribution-center.sc-duet-grid-h{justify-content:center !important}.duet-grid-distribution-between.sc-duet-grid-h{justify-content:space-between !important}.duet-grid-distribution-around.sc-duet-grid-h{justify-content:space-around !important}.duet-grid-distribution-evenly.sc-duet-grid-h{justify-content:space-evenly !important}@media (max-width: 35.9375em){.duet-grid-mobile-left.sc-duet-grid-h{align-items:flex-start !important;justify-content:flex-start !important;text-align:left !important}}@media (max-width: 35.9375em){.duet-grid-mobile-center.sc-duet-grid-h{align-items:center !important;justify-content:center !important;text-align:center !important}.duet-grid-mobile-center.sc-duet-grid-h *.sc-duet-grid{text-align:center !important}}@media (max-width: 35.9375em){.duet-grid-mobile-right.sc-duet-grid-h{align-items:flex-end !important;justify-content:flex-end !important;text-align:right !important}.duet-grid-mobile-right.sc-duet-grid-h *.sc-duet-grid{text-align:right !important}}";function isGridItem(t){return t.tagName.toLowerCase()==="duet-grid-item"}var DuetGrid=function(){function t(t){registerInstance(this,t);this.mql=[window.matchMedia(media_query_large.replace(/'/g,"")),window.matchMedia(media_query_medium.replace(/'/g,"")),window.matchMedia(media_query_small.replace(/'/g,""))];this.distributeFormElement=false;this.responsive=false;this.breakpoint="small";this.direction="horizontal";this.rowReverse=false;this.alignment="top";this.distribution="default";this.mobile=""}t.prototype.outerHeight=function(t){var i=t.offsetHeight,e=window.getComputedStyle(t);return["top","bottom"].map((function(t){return parseInt(e["margin-".concat(t)])})).reduce((function(t,i){return t+i}),i)};t.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var t,i;var e=this;return __generator(this,(function(r){t=this.element;this.distributeFormElement=this.alignment==="form_distribute";this.mutationO=watchForOptions(t,"duet-grid-item",(function(){e.updateGridItems()}));if(this.distributeFormElement){this.mutation1=watchForElement(t,"duet-input",(function(){e.updateGridItemsWithInputFields()}));for(i=0;i<this.mql.length;i++){if(this.mql[i].addEventListener){this.mql[i].addEventListener("change",this.updateGridItemsWithInputFields.bind(this))}}}this.updateGridItems();return[2]}))}))};t.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}if(this.mutation1){this.mutation1.disconnect();this.mutation1=undefined}for(var t=0;t<this.mql.length;t++){if(this.mql[t].removeEventListener){this.mql[t].removeEventListener("change",this.updateGridItemsWithInputFields.bind(this))}}};t.prototype.updateGridItems=function(){return __awaiter(this,void 0,void 0,(function(){var t;var i=this;return __generator(this,(function(e){t=Array.from(this.element.children).filter(isGridItem);t.forEach((function(t){t.responsive=i.responsive;t.breakpoint=i.breakpoint;t.direction=i.direction}));return[2]}))}))};t.prototype.updateGridItemsWithInputFields=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,r;var d=this;return __generator(this,(function(n){t=Array.from(this.element.children).filter(isGridItem);i=window?window.getComputedStyle(this.element).flexDirection==="column":false;e=0;r=[];t.forEach((function(t){var i=t.querySelector("span.duet-input-error");var e=i?d.outerHeight(i):0;r.push(e)}));e=Math.max.apply(Math,r);t.forEach((function(t){var r=t.querySelector("span.duet-input-error");var n=r?d.outerHeight(r):0;if(n<e&&!i){t.setAttribute("style","padding-bottom: ".concat(e-n,"px;"))}else if(n===e||i){t.setAttribute("style","padding-bottom: 0px;")}}));return[2]}))}))};t.prototype.render=function(){return h(Host,{class:{"duet-grid":true,"duet-no-stacking":!this.responsive,"duet-grid-align-top":this.alignment==="top","duet-grid-align-bottom":this.alignment==="bottom"||this.alignment==="form_distribute","duet-grid-align-center":this.alignment==="center","duet-grid-align-stretch":this.alignment==="stretch","duet-grid-align-baseline":this.alignment==="baseline","duet-grid-distribution-left":this.distribution==="left","duet-grid-distribution-right":this.distribution==="right","duet-grid-distribution-center":this.distribution==="center","duet-grid-distribution-between":this.distribution==="space-between","duet-grid-distribution-around":this.distribution==="space-around","duet-grid-distribution-evenly":this.distribution==="space-evenly","duet-grid-mobile-left":this.mobile==="left","duet-grid-mobile-center":this.mobile==="center","duet-grid-mobile-right":this.mobile==="right","duet-grid-direction-horizontal":this.direction==="horizontal","duet-grid-direction-vertical":this.direction==="vertical","duet-grid-breakpoint-x-small":this.breakpoint==="x-small","duet-grid-breakpoint-small":this.breakpoint==="small","duet-grid-breakpoint-medium":this.breakpoint==="medium","duet-grid-breakpoint-large":this.breakpoint==="large","duet-grid-breakpoint-x-large":this.breakpoint==="x-large","duet-grid-row-reverse":this.rowReverse}})};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{responsive:["updateGridItems"],breakpoint:["updateGridItems"],direction:["updateGridItems"]}},enumerable:false,configurable:true});return t}();DuetGrid.style=duetGridCss;var duetGridItemCss='.sc-duet-grid-item-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:16px !important;min-width:0;max-width:100%;flex:0 0 auto;padding-right:8px;padding-left:8px;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-style:normal;font-weight:400;line-height:1.5;color:rgb(0, 41, 77)}.duet-grid-direction-horizontal.sc-duet-grid-item-h:first-child,.duet-grid-direction-horizontal.sc-duet-grid-item-h:first-of-type{padding-left:0}.duet-grid-direction-horizontal.sc-duet-grid-item-h:last-child,.duet-grid-direction-horizontal.sc-duet-grid-item-h:last-of-type{padding-right:0}@media (max-width: 35.9375em){.duet-grid-item-responsive.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important;padding-right:0;padding-left:0}}@media screen and (max-width: 47.9375em){.duet-grid-item-br-medium.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important}}@media screen and (max-width: 47.9375em){.duet-grid-item-responsive.duet-grid-item-br-medium.sc-duet-grid-item-h{padding-right:0;padding-left:0}}@media screen and (max-width: 64em){.duet-grid-item-br-x-large.sc-duet-grid-item-h{width:100% !important;min-width:0 !important;max-width:100% !important}}@media screen and (max-width: 64em){.duet-grid-item-responsive.duet-grid-item-br-x-large.sc-duet-grid-item-h{padding-right:0;padding-left:0}}.duet-grid-item-fill.sc-duet-grid-item-h{flex:1 1 auto;width:100%}.duet-theme-turva.sc-duet-grid-item-h{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:rgb(23, 28, 58)}.duet-m-0.sc-duet-grid-item-h{padding:0 !important;margin:0 !important}';var DuetGridItem=function(){function t(t){registerInstance(this,t);this.fill=false;this.maxWidth=undefined;this.minWidth=undefined;this.theme="";this.margin="auto";this.responsive=false;this.direction="horizontal";this.breakpoint="small"}t.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};t.prototype.render=function(){return h(Host,{style:{"min-width":this.minWidth,"max-width":this.maxWidth},class:{"duet-m-0":this.margin==="none","duet-theme-turva":this.theme==="turva","duet-grid-item":true,"duet-grid-item-fill":this.fill,"duet-grid-item-responsive":this.responsive,"duet-grid-direction-horizontal":this.direction==="horizontal","duet-grid-direction-vertical":this.direction==="vertical","duet-grid-item-br-x-small":this.breakpoint==="x-small","duet-grid-item-br-small":this.breakpoint==="small","duet-grid-item-br-medium":this.breakpoint==="medium","duet-grid-item-br-large":this.breakpoint==="large","duet-grid-item-br-x-large":this.breakpoint==="x-large"}})};return t}();DuetGridItem.style=duetGridItemCss;export{DuetGrid as duet_grid,DuetGridItem as duet_grid_item};
|