@duetds/components 5.3.3 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hydrate/index.js +62 -16
- package/lib/cjs/duet-action-button.cjs.entry.js +24 -6
- 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 +2 -2
- package/lib/cjs/duet-caption_4.cjs.entry.js +2 -2
- package/lib/cjs/duet-card.cjs.entry.js +2 -2
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-combobox.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 +4 -4
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +1 -1
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +2 -2
- package/lib/cjs/duet-input_2.cjs.entry.js +21 -4
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +2 -2
- 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-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-select.cjs.entry.js +1 -1
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +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-54bf88c4.js → focus-utils-7c1832b2.js} +1 -1
- package/lib/cjs/{index-d74701f0.js → index-63f324e3.js} +1 -1
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/cjs/{token-utils-50a1f7e2.js → token-utils-fef5b4eb.js} +1 -0
- package/lib/collection/components/duet-action-button/duet-action-button.js +47 -11
- package/lib/collection/components/duet-collapsible/duet-collapsible.js +1 -1
- package/lib/collection/components/duet-header/duet-header.css +28 -5
- package/lib/collection/components/duet-input/duet-input.js +21 -3
- package/lib/collection/components/duet-pagination/duet-pagination.js +6 -0
- package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +4 -0
- package/lib/collection/components/duet-upload/duet-upload.js +4 -4
- package/lib/collection/components/duet-upload/upload-validators.js +1 -1
- package/lib/collection/utils/token-utils.js +1 -1
- package/lib/custom-elements-bundle/index.js +50 -16
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/p-03957a48.js +5 -0
- package/lib/duet/p-0416a99f.entry.js +4 -0
- package/lib/duet/p-0b3f7f25.entry.js +4 -0
- package/lib/duet/{p-1463ec25.entry.js → p-0d8f88c8.entry.js} +1 -1
- package/lib/duet/p-0f69bf5d.entry.js +4 -0
- package/lib/duet/{p-e56acd55.system.js → p-0f6e4db9.system.js} +1 -1
- package/lib/duet/{p-d11db0d5.system.entry.js → p-128ee483.system.entry.js} +1 -1
- package/lib/duet/{p-e58d06d9.entry.js → p-14acc501.entry.js} +1 -1
- package/lib/duet/{p-9db6c3ef.system.entry.js → p-19cac237.system.entry.js} +1 -1
- package/lib/duet/{p-a21321dc.entry.js → p-1dec0f2c.entry.js} +1 -1
- package/lib/duet/{p-aebf923d.entry.js → p-21d74fec.entry.js} +1 -1
- package/lib/duet/{p-4f4e6e7a.entry.js → p-23a1875c.entry.js} +1 -1
- package/lib/duet/{p-fb761b8d.system.entry.js → p-2522f85c.system.entry.js} +1 -1
- package/lib/duet/{p-e6b88a4b.entry.js → p-282ee56b.entry.js} +1 -1
- package/lib/duet/{p-efa06b0e.system.entry.js → p-30153133.system.entry.js} +1 -1
- package/lib/duet/{p-9e979cae.system.entry.js → p-347a4bb8.system.entry.js} +1 -1
- package/lib/duet/{p-cfc5df00.system.entry.js → p-355fd4fc.system.entry.js} +1 -1
- package/lib/duet/{p-707e6bde.entry.js → p-3b06dacd.entry.js} +1 -1
- package/lib/duet/{p-4407c77f.entry.js → p-3bdc0b4e.entry.js} +1 -1
- package/lib/duet/{p-351c4ca8.entry.js → p-40d4bc49.entry.js} +1 -1
- package/lib/duet/{p-7b37a578.js → p-413df442.js} +1 -1
- package/lib/duet/{p-d03be8d0.system.entry.js → p-426854f8.system.entry.js} +1 -1
- package/lib/duet/{p-334e765b.system.entry.js → p-46f6dea4.system.entry.js} +1 -1
- package/lib/duet/{p-aea395e2.entry.js → p-4b50c47b.entry.js} +1 -1
- package/lib/duet/{p-f640e49b.system.entry.js → p-538ca1e8.system.entry.js} +1 -1
- package/lib/duet/{p-d749146f.entry.js → p-56081d74.entry.js} +1 -1
- package/lib/duet/{p-0fe15b1c.system.entry.js → p-568fe563.system.entry.js} +1 -1
- package/lib/duet/{p-b786f4a1.system.entry.js → p-5d5c0181.system.entry.js} +1 -1
- package/lib/duet/{p-7ce0b78c.entry.js → p-5fea867d.entry.js} +1 -1
- package/lib/duet/p-6002f3d2.system.js +4 -0
- package/lib/duet/{p-80db2a1e.system.entry.js → p-62352bbe.system.entry.js} +1 -1
- package/lib/duet/{p-997ef66e.entry.js → p-671453a4.entry.js} +1 -1
- package/lib/duet/{p-310cc65a.system.js → p-67cbfa71.system.js} +1 -1
- package/lib/duet/{p-dcfa2ae4.system.entry.js → p-6944e2d1.system.entry.js} +1 -1
- package/lib/duet/{p-b9f2984d.entry.js → p-6aece7e2.entry.js} +1 -1
- package/lib/duet/{p-f67a994f.system.entry.js → p-6f073ee3.system.entry.js} +1 -1
- package/lib/duet/{p-f94cb455.system.entry.js → p-70886ae8.system.entry.js} +1 -1
- package/lib/duet/{p-b717297c.system.entry.js → p-723b036a.system.entry.js} +1 -1
- package/lib/duet/{p-29b78a88.system.entry.js → p-767767ad.system.entry.js} +1 -1
- package/lib/duet/{p-badcd20b.system.entry.js → p-768141d2.system.entry.js} +1 -1
- package/lib/duet/{p-4390278a.entry.js → p-77b7fbcd.entry.js} +1 -1
- package/lib/duet/{p-cd0b0258.system.entry.js → p-7ad2c618.system.entry.js} +1 -1
- package/lib/duet/{p-b112ecc7.entry.js → p-7df06bf2.entry.js} +1 -1
- package/lib/duet/{p-52cd446d.entry.js → p-86575e21.entry.js} +1 -1
- package/lib/duet/p-86ed3c73.system.entry.js +4 -0
- package/lib/duet/{p-98aa8c7e.entry.js → p-8717227c.entry.js} +1 -1
- package/lib/duet/{p-10dd6a3a.entry.js → p-87738b6e.entry.js} +1 -1
- package/lib/duet/{p-4be003ee.entry.js → p-8d175e68.entry.js} +1 -1
- package/lib/duet/{p-c0dea844.entry.js → p-8fb5f933.entry.js} +1 -1
- package/lib/duet/{p-d77dcab2.entry.js → p-9062ca61.entry.js} +1 -1
- package/lib/duet/{p-9195e263.system.entry.js → p-909a229b.system.entry.js} +1 -1
- package/lib/duet/{p-53feaad0.system.entry.js → p-909b6b44.system.entry.js} +1 -1
- package/lib/duet/{p-0ed8f525.system.entry.js → p-967eb38f.system.entry.js} +1 -1
- package/lib/duet/{p-f23108a0.entry.js → p-a2b29846.entry.js} +1 -1
- package/lib/duet/{p-d3d3538f.entry.js → p-a903df4e.entry.js} +1 -1
- package/lib/duet/{p-d28243a8.entry.js → p-a93fca8b.entry.js} +1 -1
- package/lib/duet/{p-ac356267.system.entry.js → p-b263653d.system.entry.js} +1 -1
- package/lib/duet/{p-05093845.entry.js → p-b2680be5.entry.js} +1 -1
- package/lib/duet/{p-b52d2351.system.entry.js → p-b34d417d.system.entry.js} +1 -1
- package/lib/duet/{p-d0eceac9.entry.js → p-b5fc4eee.entry.js} +1 -1
- package/lib/duet/p-b98bb109.system.entry.js +4 -0
- package/lib/duet/{p-f9787dbb.system.entry.js → p-bdbb5c7d.system.entry.js} +1 -1
- package/lib/duet/{p-60903f76.system.entry.js → p-bf0efbe9.system.entry.js} +1 -1
- package/lib/duet/{p-5231f09f.system.entry.js → p-c2fe4072.system.entry.js} +1 -1
- package/lib/duet/{p-9e8acf0a.entry.js → p-c5bd7c30.entry.js} +1 -1
- package/lib/duet/{p-7ee40ef2.entry.js → p-c83e1e74.entry.js} +1 -1
- package/lib/duet/{p-31ee57ef.entry.js → p-c90ab5d7.entry.js} +1 -1
- package/lib/duet/{p-54adb28a.system.entry.js → p-c9453dc6.system.entry.js} +1 -1
- package/lib/duet/{p-187dac44.entry.js → p-c993f95a.entry.js} +1 -1
- package/lib/duet/p-cb64979e.system.entry.js +4 -0
- package/lib/duet/{p-bd97848c.system.entry.js → p-cbd51090.system.entry.js} +1 -1
- package/lib/duet/{p-a07b994c.entry.js → p-cd8b61fd.entry.js} +1 -1
- package/lib/duet/{p-2ae81abd.entry.js → p-ce8ddf05.entry.js} +1 -1
- package/lib/duet/{p-5a134750.entry.js → p-d243054f.entry.js} +1 -1
- package/lib/duet/{p-933b5471.system.entry.js → p-da59200a.system.entry.js} +1 -1
- package/lib/duet/{p-3357023c.system.entry.js → p-da62b929.system.entry.js} +1 -1
- package/lib/duet/{p-09f8d68b.system.entry.js → p-da9aa2cc.system.entry.js} +1 -1
- package/lib/duet/p-de3c0f4d.js +4 -0
- package/lib/duet/{p-daa9880c.system.entry.js → p-e15ae3b1.system.entry.js} +1 -1
- package/lib/duet/{p-7a803a0f.system.entry.js → p-e2628b7c.system.entry.js} +1 -1
- package/lib/duet/{p-97395d40.entry.js → p-e74db103.entry.js} +1 -1
- package/lib/duet/{p-263d5c73.system.entry.js → p-ea4e6d02.system.entry.js} +1 -1
- package/lib/duet/{p-a77df5a4.system.entry.js → p-ec34f321.system.entry.js} +1 -1
- package/lib/duet/{p-c2a4820d.system.entry.js → p-ec96f020.system.entry.js} +1 -1
- package/lib/duet/{p-8ea1558f.entry.js → p-ed9cc88f.entry.js} +1 -1
- package/lib/duet/{p-323af601.system.entry.js → p-efcc198f.system.entry.js} +1 -1
- package/lib/duet/{p-7b776a5f.entry.js → p-f2aeef65.entry.js} +1 -1
- package/lib/duet/{p-017c8f85.system.entry.js → p-f3e72c0f.system.entry.js} +1 -1
- package/lib/duet/{p-b0053a35.entry.js → p-f63f1511.entry.js} +1 -1
- package/lib/duet/p-f86937f0.system.js +5 -0
- package/lib/duet/{p-dadfe56f.entry.js → p-fd7f32f7.entry.js} +1 -1
- package/lib/esm/duet-action-button.entry.js +24 -6
- 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 +2 -2
- package/lib/esm/duet-caption_4.entry.js +2 -2
- package/lib/esm/duet-card.entry.js +2 -2
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +2 -2
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-combobox.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 +4 -4
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +1 -1
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +2 -2
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +2 -2
- package/lib/esm/duet-input_2.entry.js +21 -4
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +2 -2
- package/lib/esm/duet-notification_2.entry.js +1 -1
- package/lib/esm/duet-number-input.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-select.entry.js +1 -1
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +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 +2 -2
- package/lib/esm/{focus-utils-2632e19f.js → focus-utils-4ca66786.js} +1 -1
- package/lib/esm/{index-ab50bfb2.js → index-d5956898.js} +1 -1
- package/lib/esm/loader.js +2 -2
- package/lib/esm/{token-utils-1f9435bc.js → token-utils-df78f4d8.js} +1 -1
- 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-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +2 -2
- package/lib/esm-es5/duet-combobox.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 +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +2 -2
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +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-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +2 -2
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +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-2632e19f.js → focus-utils-4ca66786.js} +1 -1
- package/lib/esm-es5/index-d5956898.js +5 -0
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/token-utils-df78f4d8.js +4 -0
- package/lib/types/components/duet-action-button/duet-action-button.d.ts +15 -7
- package/lib/types/components/duet-input/duet-input.d.ts +2 -1
- package/lib/types/components/duet-pagination/duet-pagination.d.ts +6 -0
- package/lib/types/components/duet-range-stepper/duet-range-stepper.d.ts +4 -0
- package/lib/types/components/duet-upload/duet-upload.d.ts +1 -2
- package/lib/types/components.d.ts +13 -5
- package/lib/types/utils/token-utils.d.ts +1 -0
- package/package.json +5 -5
- package/lib/duet/p-0c2a368b.entry.js +0 -4
- package/lib/duet/p-1b971cb4.system.entry.js +0 -4
- package/lib/duet/p-3d4098a1.system.entry.js +0 -4
- package/lib/duet/p-4bfb3001.js +0 -5
- package/lib/duet/p-6190e2d6.system.js +0 -4
- package/lib/duet/p-711c5825.entry.js +0 -4
- package/lib/duet/p-9cca0bb4.js +0 -4
- package/lib/duet/p-bd697adb.entry.js +0 -4
- package/lib/duet/p-d06ccc00.system.entry.js +0 -4
- package/lib/duet/p-e97c0bf3.system.js +0 -5
- package/lib/esm-es5/index-ab50bfb2.js +0 -5
- package/lib/esm-es5/token-utils-1f9435bc.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as r,H as a,g as d}from"./p-
|
|
4
|
+
import{r as e,c as t,h as r,H as a,g as d}from"./p-03957a48.js";import{c as i,a as s,b as n,d as u}from"./p-398a79a0.js";import{i as o}from"./p-4ebf1618.js";import{c as l}from"./p-c1325e35.js";import{i as c}from"./p-704245ef.js";const g={turva:{active:i,inactive:s},default:{active:n,inactive:u}},h=class{constructor(r){e(this,r),this.duetChange=t(this,"duetChange",3),this.duetInput=t(this,"duetInput",7),this.rangeId=l("DuetRange"),this.theme="",this.margin="auto",this.expand=!1,this.required=!1,this.disabled=!1,this.min=0,this.label="label",this.labelHidden=!1,this.unit="",this.max=100,this.step=1,this.locale="fi-FI",this.value=0,this.debounce=0,this.onInput=e=>{const t=e.target;t&&(this.value=parseFloat(t.value)||0),this.duetInput.emit({originalEvent:e,value:this.value,component:"duet-range-slider"})},this.onChange=e=>{const t=e.target;t&&(this.value=parseFloat(t.value)||0),clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>{this.duetChange.emit({originalEvent:e,value:this.value,component:"duet-range-slider"})}),this.debounce)}}componentWillLoad(){o(this)}async setFocus(e){this.nativeInput.focus(e)}calculatePercentage(){return(this.value-this.min)/(this.max-this.min)*100}render(){const e=this.identifier||this.rangeId,t="turva"===this.theme?"turva":"default",{inactive:d,active:i}=g[t],s=this.calculatePercentage(),n={background:`-webkit-linear-gradient(left,${i} 0%,${i} ${s}%,${d} ${s}%)`};return r(a,{class:{"duet-m-0":"none"===this.margin,"duet-expand":this.expand}},r("div",{class:{"duet-range-container":!0,"duet-label-hidden":this.labelHidden,"duet-theme-turva":"turva"===this.theme,"duet-ie":c(),"duet-range-disabled":this.disabled}},r("duet-label",{theme:t,margin:"small",for:e},this.label),r("output",{"aria-hidden":"true",htmlFor:e,class:"duet-output"},this.value.toLocaleString(this.locale),this.unit),r("input",{onInput:this.onInput,onChange:this.onChange,ref:e=>this.nativeInput=e,type:"range",min:this.min,max:this.max,step:this.step,value:this.value,style:n,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.value,"aria-valuetext":`${this.value} ${this.unit}`,"aria-controls":this.accessibleControls,"aria-activedescendant":this.accessibleActiveDescendant,"aria-owns":this.accessibleOwns,"aria-describedby":this.accessibleDescribedBy,id:e,name:this.name,disabled:this.disabled,required:this.required,class:"duet-range"})))}get element(){return d(this)}};h.style='*.sc-duet-range-slider,*.sc-duet-range-slider::after,*.sc-duet-range-slider::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-range-slider-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;width:100%;max-width:100%;text-align:left;vertical-align:bottom}.sc-duet-range-slider-h:last-child,.sc-duet-range-slider-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-range-slider-h{width:calc(50% - 16px - 3px)}.duet-expand.sc-duet-range-slider-h{width:100% !important}}.duet-m-0.sc-duet-range-slider-h{margin:0 !important}.duet-range-container.sc-duet-range-slider{position:relative;width:100%}.duet-output.sc-duet-range-slider{position:absolute;top:12px;right:0;z-index:200;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.875rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.25;color:#00294d;background:white}.duet-theme-turva.sc-duet-range-slider .duet-output.sc-duet-range-slider{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}.duet-range-disabled.sc-duet-range-slider .duet-output.sc-duet-range-slider{color:#909599}.duet-range-disabled.duet-theme-turva.sc-duet-range-slider .duet-output.sc-duet-range-slider{color:#747475}.duet-range.sc-duet-range-slider{position:relative;z-index:100;width:100%;height:4px;background:#cfd2d4;border-radius:4px}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider{background:#cfcfd1}.duet-ie.sc-duet-range-slider .duet-range.sc-duet-range-slider{display:block;width:auto;height:26px;background:transparent !important}.duet-range.sc-duet-range-slider::-moz-range-track{height:1px;background:transparent !important;border:0;-moz-appearance:none}.duet-range.sc-duet-range-slider::-ms-track{color:transparent;background:transparent;border:0}.duet-range.sc-duet-range-slider:focus,.duet-range.sc-duet-range-slider:active{outline:0}.user-is-tabbing.sc-duet-range-slider-h .duet-range.sc-duet-range-slider:focus{box-shadow:0 0 0 1px white, 0 0 0 3px rgba(0, 119, 179, 0.75)}.user-is-tabbing.sc-duet-range-slider-h .duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider:focus{box-shadow:0 0 0 1px white, 0 0 0 3px #171c3a}.duet-range.sc-duet-range-slider::-webkit-slider-runnable-track{background:transparent}.duet-range.sc-duet-range-slider::-webkit-slider-thumb{position:relative;width:24px;height:24px;cursor:-webkit-grab;background:white;border:1px solid #909599;border-radius:50%;transition:box-shadow 300ms ease;-webkit-appearance:none}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider::-webkit-slider-thumb{border-color:#747475}.duet-range.sc-duet-range-slider:active::-webkit-slider-thumb{cursor:-webkit-grabbing}.duet-range.sc-duet-range-slider::-moz-range-thumb{position:relative;width:24px;height:24px;cursor:-moz-grab;background:white;border:1px solid #909599;border-radius:50%;appearance:none}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider::-moz-range-thumb{border-color:#747475}.duet-range.sc-duet-range-slider:active::-moz-range-thumb{cursor:-moz-grabbing}.duet-range.sc-duet-range-slider::-ms-thumb{position:relative;width:24px;height:24px;overflow:visible;background:white;border:1px solid #909599;border-radius:50%}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider::-ms-thumb{border-color:#747475}.duet-range.sc-duet-range-slider:disabled{background:#cfd2d4 !important}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider:disabled{background:#cfcfd1 !important}.duet-range.sc-duet-range-slider:disabled::-webkit-slider-thumb{cursor:default;background:#cfd2d4;border-color:transparent}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider:disabled::-webkit-slider-thumb{background:#cfcfd1;border-color:transparent}.duet-range.sc-duet-range-slider:disabled::-moz-range-thumb{cursor:default;background:#cfd2d4;border-color:transparent}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider:disabled::-moz-range-thumb{background:#cfcfd1;border-color:transparent}.duet-range.sc-duet-range-slider:disabled::-ms-thumb{cursor:default;background:#cfd2d4;border-color:transparent}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider:disabled::-ms-thumb{background:#cfcfd1;border-color:transparent}.duet-range.sc-duet-range-slider::-ms-fill-lower{height:4px;background:#0077b3}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider::-ms-fill-lower{background:#c60c30}.duet-range.sc-duet-range-slider::-ms-fill-upper{height:4px;background:#cfd2d4}.duet-theme-turva.sc-duet-range-slider .duet-range.sc-duet-range-slider::-ms-fill-upper{background:#cfcfd1}.duet-label-hidden.sc-duet-range-slider duet-label.sc-duet-range-slider,.duet-label-hidden.sc-duet-range-slider output.sc-duet-range-slider{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}';export{h as duet_range_slider}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function a(e){try{s(o.next(e))}catch(t){n(t)}}function d(e){try{s(o["throw"](e))}catch(t){n(t)}}function s(e){e.done?i(e.value):r(e.value).then(a,d)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,r,n,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 s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,r&&(n=a[0]&2?r["return"]:a[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;if(r=0,n)a=[a[0]&2,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(a[0]===6&&i.label<n[1]){i.label=n[1];n=a;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(a);break}if(n[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(d){a=[6,d];r=0}finally{o=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/System.register(["./p-e97c0bf3.system.js","./p-33b3aba4.system.js","./p-f69b64c9.system.js","./p-0c4bbd65.system.js","./p-b6d51921.system.js"],(function(e){"use strict";var t,i,o,r,n,a,d;return{setters:[function(e){t=e.r;i=e.h;o=e.g},function(e){r=e.i},function(e){n=e.a;a=e.g},function(e){d=e.a},function(){}],execute:function(){var s="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-notification{display:block;padding:16px;color:#00294d;cursor:pointer;border-bottom:1px solid #e1e3e6;transition:300ms ease}:host(:last-of-type) .duet-notification{border-bottom:0}.duet-notification.duet-theme-turva{color:#171c3a;border-bottom-color:#e4e4e6}.duet-notification.duet-notification-highlight{font-weight:600;background:#f3f9fc}.duet-notification.duet-notification-highlight.duet-theme-turva{background:#fcf3f4}@media (min-width: 62em){.duet-notification:hover{background:#f3f9fc}.duet-notification:hover.duet-theme-turva{background:#fcf3f4}}.duet-notification a{text-decoration:none}.duet-notification a:focus{outline:0}:host(.user-is-tabbing) .duet-notification:focus-within{z-index:1;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-notification:focus-within.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-notification-container{position:relative;display:flex}.duet-notification-badge-container{position:relative;width:16px}.duet-notification-badge{position:absolute;top:6px;left:-2px;width:8px;height:8px;background:#0077b3;border-radius:50%}.duet-theme-turva .duet-notification-badge{background:#c60c30}.duet-notification-content{flex:1}.duet-notification-date{position:absolute;top:2px;right:0;width:96px;font-size:0.75rem;font-weight:600;line-height:1.25;color:#657787;text-align:right;text-transform:uppercase}@media (max-width: 35.9375em){.duet-notification-date{width:auto}}.duet-theme-turva .duet-notification-date{color:#444445}::slotted(duet-heading){padding-right:80px !important}::slotted(duet-paragraph){margin-bottom:2px !important}";var u=e("duet_notification",function(){function e(e){t(this,e);this.language=n();this.accessibleLabelUnreadDefaults={en:"Unread",fi:"Lukematon",sv:"Oläst"};this.accessibleLabelUnread=a(this.accessibleLabelUnreadDefaults,this.language);this.url="#";this.date="";this.highlight=false;this.external=false;this.theme=""}e.prototype.componentWillLoad=function(){r(this)};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.linkElement.focus(e);return[2]}))}))};e.prototype.render=function(){var e=this;return i("div",{role:"listitem",class:{"duet-notification":true,"duet-notification-highlight":this.highlight,"duet-theme-turva":this.theme==="turva"}},i("a",{ref:function(t){return e.linkElement=t},href:this.url,target:this.external?"_blank":"_self"},i("div",{class:"duet-notification-container"},i("div",{class:"duet-notification-badge-container"},this.highlight&&i("div",{class:"duet-notification-badge"},i("duet-visually-hidden",null,this.accessibleLabelUnread,":"))),i("div",{class:"duet-notification-content"},i("slot",null)),i("div",{class:"duet-notification-date"},this.date))))};Object.defineProperty(e.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());u.style=s;var l='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-drawer{position:relative}@media (min-width: 62em){.duet-drawer{display:inline-block}}.duet-drawer-toggle{position:relative;display:flex;align-items:center;width:100%;height:48px;padding:0 20px;overflow:hidden;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:48px;color:#00294d;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background-color:white;border-bottom:1px solid #e1e3e6;border-radius:0;-webkit-appearance:none;appearance:none}@media (min-width: 62em){.duet-drawer-toggle{z-index:200;width:auto;max-width:200px;padding:0 30px 0 12px;overflow:hidden;font-size:0.875rem;line-height:4rem;border:0;border-radius:4px;transition:border 300ms ease}}.duet-theme-turva .duet-drawer-toggle{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a;background-color:white;border-color:#e4e4e6}.duet-drawer-toggle:active{opacity:0.75}.duet-drawer-toggle:focus{outline:0}:host(.user-is-tabbing) .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-drawer-toggle:hover{color:#004d80}.duet-theme-turva .duet-drawer-toggle:hover{color:#444445}.duet-drawer-toggle::after{display:none !important}@media (min-width: 62em){.duet-drawer-toggle::after{position:absolute;top:auto;bottom:0;left:0;display:block !important;width:100%;height:3px;content:"";background:#0077b3;transition:300ms ease;transform:translateY(3px)}.duet-theme-turva .duet-drawer-toggle::after{background:#c60c30}}.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{color:#004d80;border-bottom:1px solid #f5f8fa;border-radius:0}.duet-theme-turva .duet-drawer-toggle[aria-expanded=true],.duet-theme-turva .duet-drawer-toggle[aria-expanded=true]:hover{color:#444445;border-color:#f5f5f7}@media (min-width: 62em){.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{border:0}.duet-drawer-toggle[aria-expanded=true]::after,.duet-drawer-toggle[aria-expanded=true]:hover::after{left:0;width:100%;transform:translateY(0)}}.duet-drawer-icon{position:relative;display:inline-flex;min-width:12px;margin-right:12px;font-size:0;line-height:normal;vertical-align:baseline}@media (min-width: 62em){.duet-drawer-icon{margin-right:8px}}.duet-drawer-label{line-height:1}.duet-drawer-caret{position:absolute;top:50%;right:20px;display:flex;width:10px;height:10px;margin-left:8px;line-height:normal;pointer-events:none;transition:300ms ease;transform:translateY(-50%);transform-origin:50% 50%}@media (min-width: 62em){.duet-drawer-caret{right:16px;width:7px;height:7px}}.duet-drawer-caret duet-icon{width:10px}.duet-drawer-toggle[aria-expanded=true] .duet-drawer-caret{transform:translateY(-50%) rotate(180deg)}.duet-drawer-badge{position:absolute;top:0;right:0;display:inline-block;width:6px;height:6px;background:#f7b228;border-radius:50%;box-shadow:0 0 0 1px #c18b1f}.duet-theme-turva .duet-drawer-badge{background:#faa40f}.duet-drawer-content{display:none;background-color:white;border-bottom:1px solid #e1e3e6}.duet-drawer-content:focus{outline:0}.duet-theme-turva .duet-drawer-content{background-color:white;border-color:#e1e3e6}@media (min-width: 62em){.duet-drawer-content{position:absolute;top:100%;z-index:600;display:block;width:450px;max-height:420px;padding-left:0;overflow-y:auto;visibility:hidden;background-color:white;border:1px solid #e1e3e6;border-radius:4px;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);opacity:0;transition:300ms ease;transform:scale(0.95) translateZ(0) translateY(-10px);transform-origin:50% 0;scrollbar-width:none}.duet-drawer-content::-webkit-scrollbar{display:none}.duet-theme-turva .duet-drawer-content{background-color:white}.duet-drawer-content.duet-drawer-left{right:0}.duet-drawer-content.duet-drawer-right{left:0}}.duet-drawer-content.duet-drawer-open{display:block}@media (min-width: 62em){.duet-drawer-content.duet-drawer-open{visibility:visible;opacity:1;transform:scale(1) translateZ(0) translateY(0)}}';var c=27;var h=e("duet_notification_drawer",function(){function e(e){var i=this;t(this,e);this.isOpen=false;this.icon="";this.label="Label";this.language=n();this.accessibleLabelNotificationsDefaults={en:"No notifications",fi:"Ei ilmoituksia",sv:"Inga notifikationer"};this.accessibleLabelNotifications=a(this.accessibleLabelNotificationsDefaults);this.badge=false;this.theme="";this.direction="left";this.handleKeyDown=function(e){if(i.isOpen&&e.keyCode===c){i.close()}};this.toggleMenu=function(e){e.stopPropagation();i.isOpen?i.close():i.open()};this.updateNotificationState=function(){i.hasNotifications=i.element.children.length>0}}e.prototype.componentWillLoad=function(){r(this);this.updateNotificationState()};e.prototype.connectedCallback=function(){this.observer=new MutationObserver(this.updateNotificationState);this.observer.observe(this.element,{childList:true})};e.prototype.disconnectedCallback=function(){this.observer.disconnect();this.observer=null};e.prototype.handleClickFocusOutside=function(e){var t=e.target;if(this.isOpen&&!this.element.contains(t)){this.close(false)}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.drawerButtonEl.focus(e);return[2]}))}))};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.element.closest("duet-header");if(e){e.closeMenus()}this.isOpen=true;this.drawerContentEl.scrollTop=0;return[2]}))}))};e.prototype.close=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isOpen=false;if(e){this.setFocus({preventScroll:true})}return[2]}))}))};e.prototype.render=function(){var e=this;return i("div",{class:{"duet-drawer":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:this.handleKeyDown},i("button",{ref:function(t){return e.drawerButtonEl=t},type:"button",class:"duet-drawer-toggle",id:"duet-drawer-toggle","aria-controls":"duet-drawer-content","aria-expanded":this.isOpen?"true":"false",onClick:this.toggleMenu},this.icon&&i("div",{class:"duet-drawer-icon"},i("duet-icon",{margin:"none",size:"x-small",name:this.icon,color:"currentColor"}),this.badge&&i("div",{class:"duet-drawer-badge"})),i("span",{class:"duet-drawer-label"},this.label),i("div",{class:"duet-drawer-caret"},i("duet-icon",{margin:"none",size:"auto",icon:d.svg,color:"currentColor"}))),i("div",{id:"duet-drawer-content",class:{"duet-drawer-content":true,"duet-drawer-right":this.direction==="right","duet-drawer-left":this.direction==="left","duet-drawer-open":this.isOpen},ref:function(t){return e.drawerContentEl=t}},this.hasNotifications?i("div",{role:"list"},i("slot",null)):i("duet-empty-state",{size:"small"},i("duet-paragraph",{size:"small",margin:"none"},this.accessibleLabelNotifications))))};Object.defineProperty(e.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());h.style=l}}}));
|
|
4
|
+
*/System.register(["./p-f86937f0.system.js","./p-33b3aba4.system.js","./p-f69b64c9.system.js","./p-0c4bbd65.system.js","./p-b6d51921.system.js"],(function(e){"use strict";var t,i,o,r,n,a,d;return{setters:[function(e){t=e.r;i=e.h;o=e.g},function(e){r=e.i},function(e){n=e.a;a=e.g},function(e){d=e.a},function(){}],execute:function(){var s="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-notification{display:block;padding:16px;color:#00294d;cursor:pointer;border-bottom:1px solid #e1e3e6;transition:300ms ease}:host(:last-of-type) .duet-notification{border-bottom:0}.duet-notification.duet-theme-turva{color:#171c3a;border-bottom-color:#e4e4e6}.duet-notification.duet-notification-highlight{font-weight:600;background:#f3f9fc}.duet-notification.duet-notification-highlight.duet-theme-turva{background:#fcf3f4}@media (min-width: 62em){.duet-notification:hover{background:#f3f9fc}.duet-notification:hover.duet-theme-turva{background:#fcf3f4}}.duet-notification a{text-decoration:none}.duet-notification a:focus{outline:0}:host(.user-is-tabbing) .duet-notification:focus-within{z-index:1;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-notification:focus-within.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-notification-container{position:relative;display:flex}.duet-notification-badge-container{position:relative;width:16px}.duet-notification-badge{position:absolute;top:6px;left:-2px;width:8px;height:8px;background:#0077b3;border-radius:50%}.duet-theme-turva .duet-notification-badge{background:#c60c30}.duet-notification-content{flex:1}.duet-notification-date{position:absolute;top:2px;right:0;width:96px;font-size:0.75rem;font-weight:600;line-height:1.25;color:#657787;text-align:right;text-transform:uppercase}@media (max-width: 35.9375em){.duet-notification-date{width:auto}}.duet-theme-turva .duet-notification-date{color:#444445}::slotted(duet-heading){padding-right:80px !important}::slotted(duet-paragraph){margin-bottom:2px !important}";var u=e("duet_notification",function(){function e(e){t(this,e);this.language=n();this.accessibleLabelUnreadDefaults={en:"Unread",fi:"Lukematon",sv:"Oläst"};this.accessibleLabelUnread=a(this.accessibleLabelUnreadDefaults,this.language);this.url="#";this.date="";this.highlight=false;this.external=false;this.theme=""}e.prototype.componentWillLoad=function(){r(this)};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.linkElement.focus(e);return[2]}))}))};e.prototype.render=function(){var e=this;return i("div",{role:"listitem",class:{"duet-notification":true,"duet-notification-highlight":this.highlight,"duet-theme-turva":this.theme==="turva"}},i("a",{ref:function(t){return e.linkElement=t},href:this.url,target:this.external?"_blank":"_self"},i("div",{class:"duet-notification-container"},i("div",{class:"duet-notification-badge-container"},this.highlight&&i("div",{class:"duet-notification-badge"},i("duet-visually-hidden",null,this.accessibleLabelUnread,":"))),i("div",{class:"duet-notification-content"},i("slot",null)),i("div",{class:"duet-notification-date"},this.date))))};Object.defineProperty(e.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());u.style=s;var l='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-drawer{position:relative}@media (min-width: 62em){.duet-drawer{display:inline-block}}.duet-drawer-toggle{position:relative;display:flex;align-items:center;width:100%;height:48px;padding:0 20px;overflow:hidden;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:48px;color:#00294d;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background-color:white;border-bottom:1px solid #e1e3e6;border-radius:0;-webkit-appearance:none;appearance:none}@media (min-width: 62em){.duet-drawer-toggle{z-index:200;width:auto;max-width:200px;padding:0 30px 0 12px;overflow:hidden;font-size:0.875rem;line-height:4rem;border:0;border-radius:4px;transition:border 300ms ease}}.duet-theme-turva .duet-drawer-toggle{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a;background-color:white;border-color:#e4e4e6}.duet-drawer-toggle:active{opacity:0.75}.duet-drawer-toggle:focus{outline:0}:host(.user-is-tabbing) .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-drawer-toggle:hover{color:#004d80}.duet-theme-turva .duet-drawer-toggle:hover{color:#444445}.duet-drawer-toggle::after{display:none !important}@media (min-width: 62em){.duet-drawer-toggle::after{position:absolute;top:auto;bottom:0;left:0;display:block !important;width:100%;height:3px;content:"";background:#0077b3;transition:300ms ease;transform:translateY(3px)}.duet-theme-turva .duet-drawer-toggle::after{background:#c60c30}}.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{color:#004d80;border-bottom:1px solid #f5f8fa;border-radius:0}.duet-theme-turva .duet-drawer-toggle[aria-expanded=true],.duet-theme-turva .duet-drawer-toggle[aria-expanded=true]:hover{color:#444445;border-color:#f5f5f7}@media (min-width: 62em){.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{border:0}.duet-drawer-toggle[aria-expanded=true]::after,.duet-drawer-toggle[aria-expanded=true]:hover::after{left:0;width:100%;transform:translateY(0)}}.duet-drawer-icon{position:relative;display:inline-flex;min-width:12px;margin-right:12px;font-size:0;line-height:normal;vertical-align:baseline}@media (min-width: 62em){.duet-drawer-icon{margin-right:8px}}.duet-drawer-label{line-height:1}.duet-drawer-caret{position:absolute;top:50%;right:20px;display:flex;width:10px;height:10px;margin-left:8px;line-height:normal;pointer-events:none;transition:300ms ease;transform:translateY(-50%);transform-origin:50% 50%}@media (min-width: 62em){.duet-drawer-caret{right:16px;width:7px;height:7px}}.duet-drawer-caret duet-icon{width:10px}.duet-drawer-toggle[aria-expanded=true] .duet-drawer-caret{transform:translateY(-50%) rotate(180deg)}.duet-drawer-badge{position:absolute;top:0;right:0;display:inline-block;width:6px;height:6px;background:#f7b228;border-radius:50%;box-shadow:0 0 0 1px #c18b1f}.duet-theme-turva .duet-drawer-badge{background:#faa40f}.duet-drawer-content{display:none;background-color:white;border-bottom:1px solid #e1e3e6}.duet-drawer-content:focus{outline:0}.duet-theme-turva .duet-drawer-content{background-color:white;border-color:#e1e3e6}@media (min-width: 62em){.duet-drawer-content{position:absolute;top:100%;z-index:600;display:block;width:450px;max-height:420px;padding-left:0;overflow-y:auto;visibility:hidden;background-color:white;border:1px solid #e1e3e6;border-radius:4px;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);opacity:0;transition:300ms ease;transform:scale(0.95) translateZ(0) translateY(-10px);transform-origin:50% 0;scrollbar-width:none}.duet-drawer-content::-webkit-scrollbar{display:none}.duet-theme-turva .duet-drawer-content{background-color:white}.duet-drawer-content.duet-drawer-left{right:0}.duet-drawer-content.duet-drawer-right{left:0}}.duet-drawer-content.duet-drawer-open{display:block}@media (min-width: 62em){.duet-drawer-content.duet-drawer-open{visibility:visible;opacity:1;transform:scale(1) translateZ(0) translateY(0)}}';var c=27;var h=e("duet_notification_drawer",function(){function e(e){var i=this;t(this,e);this.isOpen=false;this.icon="";this.label="Label";this.language=n();this.accessibleLabelNotificationsDefaults={en:"No notifications",fi:"Ei ilmoituksia",sv:"Inga notifikationer"};this.accessibleLabelNotifications=a(this.accessibleLabelNotificationsDefaults);this.badge=false;this.theme="";this.direction="left";this.handleKeyDown=function(e){if(i.isOpen&&e.keyCode===c){i.close()}};this.toggleMenu=function(e){e.stopPropagation();i.isOpen?i.close():i.open()};this.updateNotificationState=function(){i.hasNotifications=i.element.children.length>0}}e.prototype.componentWillLoad=function(){r(this);this.updateNotificationState()};e.prototype.connectedCallback=function(){this.observer=new MutationObserver(this.updateNotificationState);this.observer.observe(this.element,{childList:true})};e.prototype.disconnectedCallback=function(){this.observer.disconnect();this.observer=null};e.prototype.handleClickFocusOutside=function(e){var t=e.target;if(this.isOpen&&!this.element.contains(t)){this.close(false)}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.drawerButtonEl.focus(e);return[2]}))}))};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.element.closest("duet-header");if(e){e.closeMenus()}this.isOpen=true;this.drawerContentEl.scrollTop=0;return[2]}))}))};e.prototype.close=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isOpen=false;if(e){this.setFocus({preventScroll:true})}return[2]}))}))};e.prototype.render=function(){var e=this;return i("div",{class:{"duet-drawer":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:this.handleKeyDown},i("button",{ref:function(t){return e.drawerButtonEl=t},type:"button",class:"duet-drawer-toggle",id:"duet-drawer-toggle","aria-controls":"duet-drawer-content","aria-expanded":this.isOpen?"true":"false",onClick:this.toggleMenu},this.icon&&i("div",{class:"duet-drawer-icon"},i("duet-icon",{margin:"none",size:"x-small",name:this.icon,color:"currentColor"}),this.badge&&i("div",{class:"duet-drawer-badge"})),i("span",{class:"duet-drawer-label"},this.label),i("div",{class:"duet-drawer-caret"},i("duet-icon",{margin:"none",size:"auto",icon:d.svg,color:"currentColor"}))),i("div",{id:"duet-drawer-content",class:{"duet-drawer-content":true,"duet-drawer-right":this.direction==="right","duet-drawer-left":this.direction==="left","duet-drawer-open":this.isOpen},ref:function(t){return e.drawerContentEl=t}},this.hasNotifications?i("div",{role:"list"},i("slot",null)):i("duet-empty-state",{size:"small"},i("duet-paragraph",{size:"small",margin:"none"},this.accessibleLabelNotifications))))};Object.defineProperty(e.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());h.style=l}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var a=0,n=r.length,o;a<n;a++){if(o||!(a in r)){if(!o)o=Array.prototype.slice.call(r,0,a);o[a]=r[a]}}return e.concat(o||Array.prototype.slice.call(r))};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/System.register(["./p-
|
|
4
|
+
*/System.register(["./p-f86937f0.system.js","./p-33b3aba4.system.js","./p-f69b64c9.system.js","./p-b6d51921.system.js"],(function(e){"use strict";var r,t,a,n,o,i,s;return{setters:[function(e){r=e.r;t=e.h;a=e.F;n=e.H;o=e.g},function(e){i=e.i},function(e){s=e.g},function(){}],execute:function(){var l={title:"action-arrow-right-small",tags:"action arrow right small caret",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M19.5 12a2.3 2.3 0 0 1-.78 1.729L7.568 23.54a1.847 1.847 0 0 1-2.439-2.773l9.752-8.579a.25.25 0 0 0 0-.376L5.129 3.233A1.847 1.847 0 0 1 7.568.46l11.148 9.808A2.31 2.31 0 0 1 19.5 12z"/></svg>'};var c='*,*::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}.duet-breadcrumbs{font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.duet-breadcrumbs ol{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-start;padding:10px 16px;color:#00294d;list-style:none;background:#f3f9fc;border-bottom:1px solid #e1e3e6}@media (min-width: 62em){.duet-breadcrumbs ol{padding:10px 36px}}.duet-breadcrumbs.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"}.duet-breadcrumbs.duet-theme-turva ol{color:#171c3a;background:#f5f5f7}.duet-breadcrumbs .duet-breadrumbs-arrow{display:inherit;align-items:center;justify-content:center;width:0.375rem;height:0.375rem}.duet-breadcrumbs .hide{display:none}';var u=e("duet_breadcrumbs",function(){function e(e){r(this,e);this.observers=[];this.breadcrumbsAriaLabel=s({fi:"Murupolku",sv:"Ströbröd",en:"Breadcrumbs"});this.theme=""}e.prototype.componentWillLoad=function(){i(this);this.children=Array.from(this.element.children)};e.prototype.connectedCallback=function(){var e=this;Array.from(this.element.children).forEach((function(r){var t=new MutationObserver((function(){return e.children=Array.from(e.element.children)}));t.observe(r,{childList:true,subtree:true,attributes:true,characterData:true});e.observers=__spreadArray(__spreadArray([],e.observers,true),[t],false)}))};e.prototype.disconnectedCallback=function(){this.observers.forEach((function(e){return e.disconnect()}));this.observers=[]};e.prototype.render=function(){return t(n,null,t("nav",{"aria-label":this.breadcrumbsAriaLabel,class:{"duet-breadcrumbs":true,"duet-theme-turva":this.theme==="turva"}},t("ol",null,this.children.map((function(e,r){return t(a,null,r>0&&t("li",{"aria-hidden":"true"},t("duet-icon",{class:"duet-breadrumbs-arrow",size:"auto",icon:l.svg,margin:"none",color:"currentColor"})),t("li",{innerHTML:e.outerHTML}),t("div",{class:"hide"},t("slot",null)))})))))};Object.defineProperty(e.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());u.style=c}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function d(e){try{r(o.next(e))}catch(t){n(t)}}function c(e){try{r(o["throw"](e))}catch(t){n(t)}}function r(e){e.done?i(e.value):s(e.value).then(d,c)}r((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,d;return d={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(d[Symbol.iterator]=function(){return this}),d;function c(e){return function(t){return r([e,t])}}function r(d){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(n=d[0]&2?s["return"]:d[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,d[1])).done)return n;if(s=0,n)d=[d[0]&2,n.value];switch(d[0]){case 0:case 1:n=d;break;case 4:i.label++;return{value:d[1],done:false};case 5:i.label++;s=d[1];d=[0];continue;case 7:d=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(d[0]===6||d[0]===2)){i=0;continue}if(d[0]===3&&(!n||d[1]>n[0]&&d[1]<n[3])){i.label=d[1];break}if(d[0]===6&&i.label<n[1]){i.label=n[1];n=d;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(d);break}if(n[2])i.ops.pop();i.trys.pop();continue}d=t.call(e,i)}catch(c){d=[6,c];s=0}finally{o=n=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
|
-
*/System.register(["./p-
|
|
4
|
+
*/System.register(["./p-f86937f0.system.js","./p-33b3aba4.system.js","./p-5f6bd5db.system.js"],(function(e){"use strict";var t,i,o,s,n,d,c;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.H;n=e.g},function(e){d=e.i},function(e){c=e.c}],execute:function(){var r='*.sc-duet-toggle,*.sc-duet-toggle::after,*.sc-duet-toggle::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-toggle-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:8px !important;margin-bottom:12px !important;-webkit-user-select:none;user-select:none;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-toggle-h:last-child,.sc-duet-toggle-h:last-of-type{margin-right:0 !important}.duet-m-0.sc-duet-toggle-h{margin:0 !important}duet-label.sc-duet-toggle{display:block !important;width:100% !important}.duet-switch.sc-duet-toggle{position:relative;display:block;width:48px;height:28px}.duet-switch.sc-duet-toggle input.sc-duet-toggle{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-switch.sc-duet-toggle input.sc-duet-toggle:checked+.duet-slider.sc-duet-toggle{background-color:#0077b3;box-shadow:none}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:checked+.duet-slider.sc-duet-toggle{background-color:#c60c30}.duet-switch.sc-duet-toggle input.sc-duet-toggle:checked+.duet-slider.sc-duet-toggle::before{background-color:white;box-shadow:none;transform:translateX(20px)}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled+.duet-slider.sc-duet-toggle{cursor:default}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle{box-shadow:inset 0 0 0 1px #cfd2d4}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle{box-shadow:inset 0 0 0 1px #cfcfd1}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle::before{background:#cfd2d4}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:not(:checked)+.duet-slider.sc-duet-toggle::before{background:#cfcfd1}.duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:checked+.duet-slider.sc-duet-toggle{background:#cfd2d4}.duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:disabled:checked+.duet-slider.sc-duet-toggle{background:#cfcfd1}.user-is-tabbing.sc-duet-toggle-h .duet-switch.sc-duet-toggle input.sc-duet-toggle:focus+.duet-slider.sc-duet-toggle{box-shadow:0 0 0 1px white, 0 0 0 3px rgba(0, 119, 179, 0.75)}.user-is-tabbing.sc-duet-toggle-h .duet-theme-turva.sc-duet-toggle .duet-switch.sc-duet-toggle input.sc-duet-toggle:focus+.duet-slider.sc-duet-toggle{box-shadow:0 0 0 1px white, 0 0 0 3px #171c3a}.duet-slider.sc-duet-toggle{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer;background-color:white;border-radius:20px;box-shadow:inset 0 0 0 1px #00294d;transition:background-color 300ms ease}.duet-theme-turva.sc-duet-toggle .duet-slider.sc-duet-toggle{box-shadow:inset 0 0 0 1px #171c3a}.duet-slider.sc-duet-toggle::before{position:absolute;bottom:4px;left:4px;width:20px;height:20px;content:"";background-color:#00294d;border-radius:50%;transition:300ms ease}.duet-theme-turva.sc-duet-toggle .duet-slider.sc-duet-toggle::before{background-color:#171c3a}';var u=e("duet_toggle",function(){function e(e){var o=this;t(this,e);this.duetChange=i(this,"duetChange",3);this.toggleId=c("DuetToggle");this.theme="";this.margin="auto";this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.label="label";this.required=false;this.disabled=false;this.checked=false;this.onClick=function(e){e.preventDefault();o.setFocus();o.checked=!o.checked}}e.prototype.checkedChanged=function(e){this.duetChange.emit({checked:e,value:this.value,component:"duet-toggle"})};e.prototype.componentWillLoad=function(){d(this);if(this.value===undefined){this.value=this.identifier}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.nativeInput.focus(e);return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.identifier||this.toggleId;return o(s,{onClick:this.disabled?undefined:this.onClick,class:{"duet-m-0":this.margin==="none"}},o("div",{class:{"duet-toggle":true,"duet-theme-turva":this.theme==="turva"}},o("duet-label",{theme:this.theme,for:t},this.label),o("label",{class:"duet-switch",htmlFor:t},o("input",{type:"checkbox",value:this.value,"aria-controls":this.accessibleControls,"aria-activedescendant":this.accessibleActiveDescendant,"aria-owns":this.accessibleOwns,"aria-describedby":this.accessibleDescribedBy,"aria-labelledby":this.accessibleLabelledBy,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,id:t,role:this.role,name:this.name,checked:this.checked,required:this.required,disabled:this.disabled,ref:function(t){return e.nativeInput=t}}),o("div",{class:"duet-slider"}))))};Object.defineProperty(e.prototype,"element",{get:function(){return n(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{checked:["checkedChanged"]}},enumerable:false,configurable:true});return e}());u.style=r}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,g as i}from"./p-4bfb3001.js";import{i as o}from"./p-4ebf1618.js";import{a,g as r}from"./p-ede854e1.js";import{a as n}from"./p-115c79b6.js";import"./p-5a9d75e1.js";const d=class{constructor(t){e(this,t),this.language=a(),this.accessibleLabelUnreadDefaults={en:"Unread",fi:"Lukematon",sv:"Oläst"},this.accessibleLabelUnread=r(this.accessibleLabelUnreadDefaults,this.language),this.url="#",this.date="",this.highlight=!1,this.external=!1,this.theme=""}componentWillLoad(){o(this)}async setFocus(e){this.linkElement.focus(e)}render(){return t("div",{role:"listitem",class:{"duet-notification":!0,"duet-notification-highlight":this.highlight,"duet-theme-turva":"turva"===this.theme}},t("a",{ref:e=>this.linkElement=e,href:this.url,target:this.external?"_blank":"_self"},t("div",{class:"duet-notification-container"},t("div",{class:"duet-notification-badge-container"},this.highlight&&t("div",{class:"duet-notification-badge"},t("duet-visually-hidden",null,this.accessibleLabelUnread,":"))),t("div",{class:"duet-notification-content"},t("slot",null)),t("div",{class:"duet-notification-date"},this.date))))}get element(){return i(this)}};d.style="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-notification{display:block;padding:16px;color:#00294d;cursor:pointer;border-bottom:1px solid #e1e3e6;transition:300ms ease}:host(:last-of-type) .duet-notification{border-bottom:0}.duet-notification.duet-theme-turva{color:#171c3a;border-bottom-color:#e4e4e6}.duet-notification.duet-notification-highlight{font-weight:600;background:#f3f9fc}.duet-notification.duet-notification-highlight.duet-theme-turva{background:#fcf3f4}@media (min-width: 62em){.duet-notification:hover{background:#f3f9fc}.duet-notification:hover.duet-theme-turva{background:#fcf3f4}}.duet-notification a{text-decoration:none}.duet-notification a:focus{outline:0}:host(.user-is-tabbing) .duet-notification:focus-within{z-index:1;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-notification:focus-within.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-notification-container{position:relative;display:flex}.duet-notification-badge-container{position:relative;width:16px}.duet-notification-badge{position:absolute;top:6px;left:-2px;width:8px;height:8px;background:#0077b3;border-radius:50%}.duet-theme-turva .duet-notification-badge{background:#c60c30}.duet-notification-content{flex:1}.duet-notification-date{position:absolute;top:2px;right:0;width:96px;font-size:0.75rem;font-weight:600;line-height:1.25;color:#657787;text-align:right;text-transform:uppercase}@media (max-width: 35.9375em){.duet-notification-date{width:auto}}.duet-theme-turva .duet-notification-date{color:#444445}::slotted(duet-heading){padding-right:80px !important}::slotted(duet-paragraph){margin-bottom:2px !important}";const s=class{constructor(t){e(this,t),this.isOpen=!1,this.icon="",this.label="Label",this.language=a(),this.accessibleLabelNotificationsDefaults={en:"No notifications",fi:"Ei ilmoituksia",sv:"Inga notifikationer"},this.accessibleLabelNotifications=r(this.accessibleLabelNotificationsDefaults),this.badge=!1,this.theme="",this.direction="left",this.handleKeyDown=e=>{this.isOpen&&27===e.keyCode&&this.close()},this.toggleMenu=e=>{e.stopPropagation(),this.isOpen?this.close():this.open()},this.updateNotificationState=()=>{this.hasNotifications=this.element.children.length>0}}componentWillLoad(){o(this),this.updateNotificationState()}connectedCallback(){this.observer=new MutationObserver(this.updateNotificationState),this.observer.observe(this.element,{childList:!0})}disconnectedCallback(){this.observer.disconnect(),this.observer=null}handleClickFocusOutside(e){this.isOpen&&!this.element.contains(e.target)&&this.close(!1)}async setFocus(e){this.drawerButtonEl.focus(e)}async open(){const e=this.element.closest("duet-header");e&&e.closeMenus(),this.isOpen=!0,this.drawerContentEl.scrollTop=0}async close(e=!0){this.isOpen=!1,e&&this.setFocus({preventScroll:!0})}render(){return t("div",{class:{"duet-drawer":!0,"duet-theme-turva":"turva"===this.theme},onKeyDown:this.handleKeyDown},t("button",{ref:e=>this.drawerButtonEl=e,type:"button",class:"duet-drawer-toggle",id:"duet-drawer-toggle","aria-controls":"duet-drawer-content","aria-expanded":this.isOpen?"true":"false",onClick:this.toggleMenu},this.icon&&t("div",{class:"duet-drawer-icon"},t("duet-icon",{margin:"none",size:"x-small",name:this.icon,color:"currentColor"}),this.badge&&t("div",{class:"duet-drawer-badge"})),t("span",{class:"duet-drawer-label"},this.label),t("div",{class:"duet-drawer-caret"},t("duet-icon",{margin:"none",size:"auto",icon:n.svg,color:"currentColor"}))),t("div",{id:"duet-drawer-content",class:{"duet-drawer-content":!0,"duet-drawer-right":"right"===this.direction,"duet-drawer-left":"left"===this.direction,"duet-drawer-open":this.isOpen},ref:e=>this.drawerContentEl=e},this.hasNotifications?t("div",{role:"list"},t("slot",null)):t("duet-empty-state",{size:"small"},t("duet-paragraph",{size:"small",margin:"none"},this.accessibleLabelNotifications))))}get element(){return i(this)}};s.style='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-drawer{position:relative}@media (min-width: 62em){.duet-drawer{display:inline-block}}.duet-drawer-toggle{position:relative;display:flex;align-items:center;width:100%;height:48px;padding:0 20px;overflow:hidden;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:48px;color:#00294d;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background-color:white;border-bottom:1px solid #e1e3e6;border-radius:0;-webkit-appearance:none;appearance:none}@media (min-width: 62em){.duet-drawer-toggle{z-index:200;width:auto;max-width:200px;padding:0 30px 0 12px;overflow:hidden;font-size:0.875rem;line-height:4rem;border:0;border-radius:4px;transition:border 300ms ease}}.duet-theme-turva .duet-drawer-toggle{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a;background-color:white;border-color:#e4e4e6}.duet-drawer-toggle:active{opacity:0.75}.duet-drawer-toggle:focus{outline:0}:host(.user-is-tabbing) .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-drawer-toggle:hover{color:#004d80}.duet-theme-turva .duet-drawer-toggle:hover{color:#444445}.duet-drawer-toggle::after{display:none !important}@media (min-width: 62em){.duet-drawer-toggle::after{position:absolute;top:auto;bottom:0;left:0;display:block !important;width:100%;height:3px;content:"";background:#0077b3;transition:300ms ease;transform:translateY(3px)}.duet-theme-turva .duet-drawer-toggle::after{background:#c60c30}}.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{color:#004d80;border-bottom:1px solid #f5f8fa;border-radius:0}.duet-theme-turva .duet-drawer-toggle[aria-expanded=true],.duet-theme-turva .duet-drawer-toggle[aria-expanded=true]:hover{color:#444445;border-color:#f5f5f7}@media (min-width: 62em){.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{border:0}.duet-drawer-toggle[aria-expanded=true]::after,.duet-drawer-toggle[aria-expanded=true]:hover::after{left:0;width:100%;transform:translateY(0)}}.duet-drawer-icon{position:relative;display:inline-flex;min-width:12px;margin-right:12px;font-size:0;line-height:normal;vertical-align:baseline}@media (min-width: 62em){.duet-drawer-icon{margin-right:8px}}.duet-drawer-label{line-height:1}.duet-drawer-caret{position:absolute;top:50%;right:20px;display:flex;width:10px;height:10px;margin-left:8px;line-height:normal;pointer-events:none;transition:300ms ease;transform:translateY(-50%);transform-origin:50% 50%}@media (min-width: 62em){.duet-drawer-caret{right:16px;width:7px;height:7px}}.duet-drawer-caret duet-icon{width:10px}.duet-drawer-toggle[aria-expanded=true] .duet-drawer-caret{transform:translateY(-50%) rotate(180deg)}.duet-drawer-badge{position:absolute;top:0;right:0;display:inline-block;width:6px;height:6px;background:#f7b228;border-radius:50%;box-shadow:0 0 0 1px #c18b1f}.duet-theme-turva .duet-drawer-badge{background:#faa40f}.duet-drawer-content{display:none;background-color:white;border-bottom:1px solid #e1e3e6}.duet-drawer-content:focus{outline:0}.duet-theme-turva .duet-drawer-content{background-color:white;border-color:#e1e3e6}@media (min-width: 62em){.duet-drawer-content{position:absolute;top:100%;z-index:600;display:block;width:450px;max-height:420px;padding-left:0;overflow-y:auto;visibility:hidden;background-color:white;border:1px solid #e1e3e6;border-radius:4px;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);opacity:0;transition:300ms ease;transform:scale(0.95) translateZ(0) translateY(-10px);transform-origin:50% 0;scrollbar-width:none}.duet-drawer-content::-webkit-scrollbar{display:none}.duet-theme-turva .duet-drawer-content{background-color:white}.duet-drawer-content.duet-drawer-left{right:0}.duet-drawer-content.duet-drawer-right{left:0}}.duet-drawer-content.duet-drawer-open{display:block}@media (min-width: 62em){.duet-drawer-content.duet-drawer-open{visibility:visible;opacity:1;transform:scale(1) translateZ(0) translateY(0)}}';export{d as duet_notification,s as duet_notification_drawer}
|
|
4
|
+
import{r as e,h as t,g as i}from"./p-03957a48.js";import{i as o}from"./p-4ebf1618.js";import{a,g as r}from"./p-ede854e1.js";import{a as n}from"./p-115c79b6.js";import"./p-5a9d75e1.js";const d=class{constructor(t){e(this,t),this.language=a(),this.accessibleLabelUnreadDefaults={en:"Unread",fi:"Lukematon",sv:"Oläst"},this.accessibleLabelUnread=r(this.accessibleLabelUnreadDefaults,this.language),this.url="#",this.date="",this.highlight=!1,this.external=!1,this.theme=""}componentWillLoad(){o(this)}async setFocus(e){this.linkElement.focus(e)}render(){return t("div",{role:"listitem",class:{"duet-notification":!0,"duet-notification-highlight":this.highlight,"duet-theme-turva":"turva"===this.theme}},t("a",{ref:e=>this.linkElement=e,href:this.url,target:this.external?"_blank":"_self"},t("div",{class:"duet-notification-container"},t("div",{class:"duet-notification-badge-container"},this.highlight&&t("div",{class:"duet-notification-badge"},t("duet-visually-hidden",null,this.accessibleLabelUnread,":"))),t("div",{class:"duet-notification-content"},t("slot",null)),t("div",{class:"duet-notification-date"},this.date))))}get element(){return i(this)}};d.style="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-notification{display:block;padding:16px;color:#00294d;cursor:pointer;border-bottom:1px solid #e1e3e6;transition:300ms ease}:host(:last-of-type) .duet-notification{border-bottom:0}.duet-notification.duet-theme-turva{color:#171c3a;border-bottom-color:#e4e4e6}.duet-notification.duet-notification-highlight{font-weight:600;background:#f3f9fc}.duet-notification.duet-notification-highlight.duet-theme-turva{background:#fcf3f4}@media (min-width: 62em){.duet-notification:hover{background:#f3f9fc}.duet-notification:hover.duet-theme-turva{background:#fcf3f4}}.duet-notification a{text-decoration:none}.duet-notification a:focus{outline:0}:host(.user-is-tabbing) .duet-notification:focus-within{z-index:1;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-notification:focus-within.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-notification-container{position:relative;display:flex}.duet-notification-badge-container{position:relative;width:16px}.duet-notification-badge{position:absolute;top:6px;left:-2px;width:8px;height:8px;background:#0077b3;border-radius:50%}.duet-theme-turva .duet-notification-badge{background:#c60c30}.duet-notification-content{flex:1}.duet-notification-date{position:absolute;top:2px;right:0;width:96px;font-size:0.75rem;font-weight:600;line-height:1.25;color:#657787;text-align:right;text-transform:uppercase}@media (max-width: 35.9375em){.duet-notification-date{width:auto}}.duet-theme-turva .duet-notification-date{color:#444445}::slotted(duet-heading){padding-right:80px !important}::slotted(duet-paragraph){margin-bottom:2px !important}";const s=class{constructor(t){e(this,t),this.isOpen=!1,this.icon="",this.label="Label",this.language=a(),this.accessibleLabelNotificationsDefaults={en:"No notifications",fi:"Ei ilmoituksia",sv:"Inga notifikationer"},this.accessibleLabelNotifications=r(this.accessibleLabelNotificationsDefaults),this.badge=!1,this.theme="",this.direction="left",this.handleKeyDown=e=>{this.isOpen&&27===e.keyCode&&this.close()},this.toggleMenu=e=>{e.stopPropagation(),this.isOpen?this.close():this.open()},this.updateNotificationState=()=>{this.hasNotifications=this.element.children.length>0}}componentWillLoad(){o(this),this.updateNotificationState()}connectedCallback(){this.observer=new MutationObserver(this.updateNotificationState),this.observer.observe(this.element,{childList:!0})}disconnectedCallback(){this.observer.disconnect(),this.observer=null}handleClickFocusOutside(e){this.isOpen&&!this.element.contains(e.target)&&this.close(!1)}async setFocus(e){this.drawerButtonEl.focus(e)}async open(){const e=this.element.closest("duet-header");e&&e.closeMenus(),this.isOpen=!0,this.drawerContentEl.scrollTop=0}async close(e=!0){this.isOpen=!1,e&&this.setFocus({preventScroll:!0})}render(){return t("div",{class:{"duet-drawer":!0,"duet-theme-turva":"turva"===this.theme},onKeyDown:this.handleKeyDown},t("button",{ref:e=>this.drawerButtonEl=e,type:"button",class:"duet-drawer-toggle",id:"duet-drawer-toggle","aria-controls":"duet-drawer-content","aria-expanded":this.isOpen?"true":"false",onClick:this.toggleMenu},this.icon&&t("div",{class:"duet-drawer-icon"},t("duet-icon",{margin:"none",size:"x-small",name:this.icon,color:"currentColor"}),this.badge&&t("div",{class:"duet-drawer-badge"})),t("span",{class:"duet-drawer-label"},this.label),t("div",{class:"duet-drawer-caret"},t("duet-icon",{margin:"none",size:"auto",icon:n.svg,color:"currentColor"}))),t("div",{id:"duet-drawer-content",class:{"duet-drawer-content":!0,"duet-drawer-right":"right"===this.direction,"duet-drawer-left":"left"===this.direction,"duet-drawer-open":this.isOpen},ref:e=>this.drawerContentEl=e},this.hasNotifications?t("div",{role:"list"},t("slot",null)):t("duet-empty-state",{size:"small"},t("duet-paragraph",{size:"small",margin:"none"},this.accessibleLabelNotifications))))}get element(){return i(this)}};s.style='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-drawer{position:relative}@media (min-width: 62em){.duet-drawer{display:inline-block}}.duet-drawer-toggle{position:relative;display:flex;align-items:center;width:100%;height:48px;padding:0 20px;overflow:hidden;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:48px;color:#00294d;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background-color:white;border-bottom:1px solid #e1e3e6;border-radius:0;-webkit-appearance:none;appearance:none}@media (min-width: 62em){.duet-drawer-toggle{z-index:200;width:auto;max-width:200px;padding:0 30px 0 12px;overflow:hidden;font-size:0.875rem;line-height:4rem;border:0;border-radius:4px;transition:border 300ms ease}}.duet-theme-turva .duet-drawer-toggle{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a;background-color:white;border-color:#e4e4e6}.duet-drawer-toggle:active{opacity:0.75}.duet-drawer-toggle:focus{outline:0}:host(.user-is-tabbing) .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-drawer-toggle:hover{color:#004d80}.duet-theme-turva .duet-drawer-toggle:hover{color:#444445}.duet-drawer-toggle::after{display:none !important}@media (min-width: 62em){.duet-drawer-toggle::after{position:absolute;top:auto;bottom:0;left:0;display:block !important;width:100%;height:3px;content:"";background:#0077b3;transition:300ms ease;transform:translateY(3px)}.duet-theme-turva .duet-drawer-toggle::after{background:#c60c30}}.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{color:#004d80;border-bottom:1px solid #f5f8fa;border-radius:0}.duet-theme-turva .duet-drawer-toggle[aria-expanded=true],.duet-theme-turva .duet-drawer-toggle[aria-expanded=true]:hover{color:#444445;border-color:#f5f5f7}@media (min-width: 62em){.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{border:0}.duet-drawer-toggle[aria-expanded=true]::after,.duet-drawer-toggle[aria-expanded=true]:hover::after{left:0;width:100%;transform:translateY(0)}}.duet-drawer-icon{position:relative;display:inline-flex;min-width:12px;margin-right:12px;font-size:0;line-height:normal;vertical-align:baseline}@media (min-width: 62em){.duet-drawer-icon{margin-right:8px}}.duet-drawer-label{line-height:1}.duet-drawer-caret{position:absolute;top:50%;right:20px;display:flex;width:10px;height:10px;margin-left:8px;line-height:normal;pointer-events:none;transition:300ms ease;transform:translateY(-50%);transform-origin:50% 50%}@media (min-width: 62em){.duet-drawer-caret{right:16px;width:7px;height:7px}}.duet-drawer-caret duet-icon{width:10px}.duet-drawer-toggle[aria-expanded=true] .duet-drawer-caret{transform:translateY(-50%) rotate(180deg)}.duet-drawer-badge{position:absolute;top:0;right:0;display:inline-block;width:6px;height:6px;background:#f7b228;border-radius:50%;box-shadow:0 0 0 1px #c18b1f}.duet-theme-turva .duet-drawer-badge{background:#faa40f}.duet-drawer-content{display:none;background-color:white;border-bottom:1px solid #e1e3e6}.duet-drawer-content:focus{outline:0}.duet-theme-turva .duet-drawer-content{background-color:white;border-color:#e1e3e6}@media (min-width: 62em){.duet-drawer-content{position:absolute;top:100%;z-index:600;display:block;width:450px;max-height:420px;padding-left:0;overflow-y:auto;visibility:hidden;background-color:white;border:1px solid #e1e3e6;border-radius:4px;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);opacity:0;transition:300ms ease;transform:scale(0.95) translateZ(0) translateY(-10px);transform-origin:50% 0;scrollbar-width:none}.duet-drawer-content::-webkit-scrollbar{display:none}.duet-theme-turva .duet-drawer-content{background-color:white}.duet-drawer-content.duet-drawer-left{right:0}.duet-drawer-content.duet-drawer-right{left:0}}.duet-drawer-content.duet-drawer-open{display:block}@media (min-width: 62em){.duet-drawer-content.duet-drawer-open{visibility:visible;opacity:1;transform:scale(1) translateZ(0) translateY(0)}}';export{d as duet_notification,s as duet_notification_drawer}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
4
|
+
System.register(["./p-f86937f0.system.js","./p-33b3aba4.system.js","./p-5f6bd5db.system.js"],(function(e){"use strict";var t,i,o,a,n,l;return{setters:[function(e){t=e.r;i=e.h;o=e.H;a=e.g},function(e){n=e.i},function(e){l=e.c}],execute:function(){var r='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}fieldset{border:0}legend{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-legend-wrapper{position:relative;display:block;width:100%;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:600;line-height:1.5;color:#00294d;text-align:left;background:transparent}.duet-theme-turva .duet-legend-wrapper{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}.duet-fieldset-label{margin-bottom:12px !important;margin-top:8px}.duet-legend-has-caption .duet-fieldset-label{margin-bottom:6px !important}.duet-legend-has-tooltip .duet-fieldset-label{padding-right:36px}@media (min-width: 48em){.duet-legend-has-tooltip .duet-fieldset-label{margin-bottom:3px !important;padding-right:0}}@media (min-width: 48em){.duet-legend-has-tooltip.duet-legend-has-caption .duet-fieldset-label{margin-bottom:-3px !important}}.duet-fieldset-caption{margin-bottom:12px !important}.duet-fieldset-help{display:block;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.875rem;font-weight:400;line-height:1.25;color:#de2362;border-radius:4px}.duet-fieldset-help span{display:block;margin-top:12px}.duet-theme-turva .duet-fieldset-help{color:#e02a0d}::slotted(duet-tooltip){position:absolute;top:4px;right:0}@media (min-width: 48em){::slotted(duet-tooltip){position:relative;right:auto}}.duet-legend-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}';var s=e("duet_fieldset",function(){function e(e){var i=this;t(this,e);this.errorId=l("DuetError");this.labelId=l("DuetLabel");this.hasTooltip=false;this.theme="";this.margin="auto";this.labelHidden=false;this.checkHasTooltip=function(){i.hasTooltip=!!i.element.querySelector("[slot='tooltip']")}}e.prototype.componentWillLoad=function(){n(this);this.checkHasTooltip()};e.prototype.render=function(){return i(o,{class:{"duet-m-0":this.margin==="none"}},i("fieldset",{"aria-labelledby":"".concat(this.labelId," ").concat(this.errorId),class:{"duet-fieldset":true,"duet-theme-turva":this.theme==="turva"}},i("legend",{id:this.labelId},i("span",null,this.label),this.caption&&i("span",null,this.caption)),i("div",{class:{"duet-legend-wrapper":true,"duet-legend-has-caption":!!this.caption,"duet-legend-has-tooltip":this.hasTooltip,"duet-legend-hidden":this.labelHidden}},i("div",{class:"duet-fieldset-label"},i("span",{"aria-hidden":"true"},this.label),i("slot",{onSlotchange:this.checkHasTooltip,name:"tooltip"})),this.caption&&i("div",{class:"duet-fieldset-caption","aria-hidden":"true"},i("duet-caption",{margin:"none"},this.caption))),i("slot",null),i("span",{class:"duet-fieldset-help",id:this.errorId,"aria-live":"assertive","aria-relevant":"additions removals"},this.error&&i("span",null,this.error))))};Object.defineProperty(e.prototype,"element",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());s.style=r}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as c,H as i,g as o}from"./p-4bfb3001.js";import{i as d}from"./p-4ebf1618.js";import{D as h}from"./p-76f00bd5.js";import{c as s}from"./p-c1325e35.js";import{F as a}from"./p-7b37a578.js";import{i as r,h as u,f as n}from"./p-54f35a79.js";import{g as l,a as p}from"./p-ede854e1.js";import{f as b,w as m}from"./p-12721178.js";import"./p-5a9d75e1.js";const g=class{constructor(c){e(this,c),this.duetChange=t(this,"duetChange",7),this.duetFocus=t(this,"duetFocus",7),this.duetBlur=t(this,"duetBlur",7),this.hasHeader=!1,this.choiceId=s("DuetChoice"),this.expandId=s("DuetChoiceExpand"),this.headerId=s("DuetChoiceHeader"),this.infoButtonId=s("DuetChoiceInfoButton"),this.isHovering=!1,this.isInfoOpen=!1,this.isBlurred=!1,this.theme="",this.label="label",this.accessibleLabelInfoButtonDefaults=h,this.accessibleLabelInfoButton=l(this.accessibleLabelInfoButtonDefaults),this.accessibleDetails=void 0,this.accessibleLabelledBy=void 0,this.accessibleDescription=void 0,this.caption="",this.type="checkbox",this.checked=!1,this.collapsible=!1,this.margin="auto",this.icon="",this.expand=!1,this.padding="auto",this.disabled=!1,this.required=!1,this.infoLabelDefaults={fi:"Lisätietoja",en:"More information about",sv:"Mera information om"},this.infoLabel=l(this.infoLabelDefaults,p()),this.onMouseEnter=()=>{this.isHovering=!0},this.onMouseLeave=()=>{this.isHovering=!1},this.onClick=e=>{this.toggleChecked(e)},this.handleKeyDown=e=>{r(e)&&this.toggleChecked(e),u(e)&&this.hasInfo&&this.toggleInfo()},this.onChange=()=>{this.checked=this.nativeInput.checked||!1,this.duetChange.emit({checked:this.checked,value:this.value,component:"duet-choice"})},this.onBlur=e=>{this.duetBlur.emit({originalEvent:e,checked:this.checked,value:this.value,component:"duet-choice"})},this.onFocus=e=>{this.duetFocus.emit({originalEvent:e,checked:this.checked,value:this.value,component:"duet-choice"})},this.toggleChecked=e=>{this.disabled||this.groupDisabled||(this.isInfoOpen=!1,"radio"===this.type&&this.checked||(this.checked=!this.checked,this.duetChange.emit({originalEvent:e,checked:this.checked,value:this.value,component:"duet-choice"}),e.preventDefault(),e.stopPropagation()))},this.toggleInfo=()=>{this.isInfoOpen=!this.isInfoOpen}}componentWillLoad(){d(this),this.hasInfo=!!this.element.querySelector("[slot='info']"),this.hasHeader=!!this.element.querySelector('[slot="header"]'),this.hasAdditional=!!this.element.querySelector("[slot='additional']")}handleHostBlur(e){this.hasInfo&&this.isInfoOpen&&this.isKeyDown&&(this.element.contains(null==e?void 0:e.relatedTarget)||this.toggleInfo())}handleHostKeyDown(){this.isKeyDown=!0}handleHostKeyUp(e){this.isKeyDown=!1,n(e)&&this.isInfoOpen&&this.toggleInfo()}async setFocus(e){this.nativeInput.focus(e)}getAriaDescribedby(){return this.accessibleDescribedBy?this.accessibleDescribedBy:this.collapsible||this.hasInfo?this.hasHeader?this.headerId:this.expandId:null}getClassNames(){return this.hasInfo&&!this.collapsible?{"duet-choice-card-info":!0,"duet-choice-card-info-expanded":this.isInfoOpen,"duet-choice-card-collapsed":!this.isInfoOpen,"duet-theme-turva":"turva"===this.theme}:!this.hasInfo&&this.collapsible?{"duet-choice-card-collapsible":!0,"duet-choice-card-collapsible-expanded":this.checked,"duet-choice-card-collapsed":!this.checked,"duet-choice-card-collapsible-disabled":!(!this.disabled&&!this.groupDisabled),"duet-theme-turva":"turva"===this.theme}:{"duet-choice-default-slot":!0}}render(){const e=this.identifier||this.choiceId;return c(i,{class:{horizontal:"horizontal"===this.groupDirection&&!this.groupResponsive,"horizontal-responsive":"horizontal"===this.groupDirection&&this.groupResponsive,"duet-m-0":"none"===this.margin,"duet-expand":this.expand,"duet-theme-turva":"turva"===this.theme}},c("div",{class:{"duet-choice-card-flextainer":!0,"duet-theme-turva":"turva"===this.theme}},c("div",{class:{"duet-choice-card":!0,"has-icon":!!this.icon,"has-info":this.hasInfo,checked:this.checked,info:this.isInfoOpen,collapsible:this.collapsible,"duet-p-0":"none"===this.padding}},c("input",{class:"duet-choice-input",type:this.type,onFocus:this.onFocus,onBlur:this.onBlur,onChange:this.onChange,disabled:this.disabled||this.groupDisabled,required:this.required,id:e,name:this.name,value:this.value,checked:this.checked,"aria-controls":this.accessibleControls,"aria-activedescendant":this.accessibleActiveDescendant,"aria-labelledby":this.accessibleLabelledBy,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,"aria-owns":this.accessibleOwns,"aria-describedby":this.getAriaDescribedby(),onKeyDown:this.handleKeyDown,ref:e=>this.nativeInput=e}),c("label",{htmlFor:e,class:{"duet-choice-label":!0,"no-hover":this.isHovering},onClick:this.onClick},this.icon&&c("div",{class:"duet-choice-card-icon"},c("duet-icon",{margin:"none",size:"small",name:this.icon,color:"currentColor"})),c("div",null,c("div",null,this.label),this.caption&&c("div",null,c("duet-spacer",{size:"xx-small"}),c("duet-caption",{margin:"none",selected:this.checked},this.caption)),this.hasAdditional&&c("div",null,c("duet-spacer",{size:"xx-small"}),c("slot",{name:"additional"}))),c("div",null,c("div",{class:{"duet-checkmark-container":!0,"duet-checkmark-radio":"radio"===this.type}},this.checked&&c("div",{class:"duet-checkmark"}))))),this.hasInfo&&!this.collapsible&&c("button",{ref:e=>this.infoButtonEl=e,id:this.infoButtonId,class:{"duet-choice-info-toggle":!0,"duet-theme-turva":"turva"===this.theme},onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onClick:this.toggleInfo,disabled:this.disabled||this.groupDisabled,"aria-expanded":this.isInfoOpen?"true":"false","aria-label":`${this.infoLabel} ${this.label}`,"aria-controls":this.expandId,"aria-flowto":this.expandId,tabindex:"radio"!==this.type||this.checked?"0":"-1",type:"button"},c("duet-visually-hidden",{"aria-hidden":this.isBlurred?"false":"true"},this.accessibleLabelInfoButton),c("div",{class:"duet-choice-info-icon"},c("duet-icon",{icon:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M13.5 17.25A2.252 2.252 0 0 1 11.25 15v-3.75h-.75a.75.75 0 0 1 0-1.5h.75c.827 0 1.5.673 1.5 1.5V15c0 .414.336.75.75.75h.75a.75.75 0 0 1 0 1.5z"/><circle cx="11.625" cy="7.125" r="1.125"/><path d="M12 24C5.383 24 0 18.617 0 12S5.383 0 12 0s12 5.383 12 12-5.383 12-12 12zm0-22.5C6.21 1.5 1.5 6.21 1.5 12S6.21 22.5 12 22.5 22.5 17.79 22.5 12 17.79 1.5 12 1.5z"/></svg>',margin:"none",size:"small",color:"currentColor"})))),this.collapsible||this.hasInfo?c("div",{class:this.getClassNames(),id:this.expandId},c("span",{class:{"duet-choice-section-visible":this.collapsible?this.checked:this.isInfoOpen,"duet-choice-section-hidden":this.collapsible?!this.checked:!this.isInfoOpen}},c("span",{id:this.headerId},c("slot",{name:"header"})),this.hasInfo?c("span",null,c("span",{"aria-relevant":"all","aria-atomic":"true","aria-live":this.isInfoOpen?"polite":"off"},c("slot",{name:"info"})),c("slot",null)):c("span",null,c("slot",null))),this.isInfoOpen&&c(a,{moveFocusTo:this.infoButtonEl})):null)}get element(){return o(this)}};g.style='*.sc-duet-choice,*.sc-duet-choice::after,*.sc-duet-choice::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;flex-direction:column;width:auto;max-width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-choice-h:last-child,.sc-duet-choice-h:last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){.sc-duet-choice-h{width:100%}}.duet-expand.sc-duet-choice-h{width:100% !important}.duet-m-0.sc-duet-choice-h{margin:0 !important}.duet-fixed.sc-duet-choice-h{width:auto !important}.vertical.sc-duet-choice-h{margin-right:0 !important}.horizontal.sc-duet-choice-h{margin-bottom:0 !important}@media (min-width: 48em){.horizontal-responsive.sc-duet-choice-h{margin-bottom:0 !important;margin-right:16px !important}.horizontal-responsive.sc-duet-choice-h:last-child,.horizontal-responsive.sc-duet-choice-h:last-of-type{margin-right:0 !important}}.sc-duet-choice-h:last-child:not(:only-child){margin-right:0 !important}.duet-choice-card.sc-duet-choice{position:relative;display:block;width:100%;min-width:8rem;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;-webkit-hyphens:auto;hyphens:auto;line-height:1.1;color:#00294d !important;text-align:left;background:white;border-width:2px}.duet-choice-card.duet-p-0.sc-duet-choice{padding:0 !important}.duet-choice-card.duet-m-0.sc-duet-choice{margin:0 !important}.duet-theme-turva.sc-duet-choice .duet-choice-card.sc-duet-choice{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a !important}.duet-choice-card-flextainer.sc-duet-choice{display:flex}.duet-choice-label.sc-duet-choice{-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:flex;gap:1rem;align-items:center;justify-content:flex-start;width:100%;height:100%;min-height:3.875rem;padding:1rem;font-size:1rem;font-weight:600;text-decoration:none;word-break:break-word;cursor:pointer;border:2px solid #e1e3e6;border-radius:4px;transition:background-color 150ms ease}.duet-choice-label.sc-duet-choice>div.sc-duet-choice:last-child{flex:1;align-self:flex-start;justify-self:flex-end;margin-top:0.25rem}.has-info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-top-right-radius:0;border-bottom-right-radius:0}.info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom-right-radius:0;border-bottom-left-radius:0}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#909599}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#909599}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#747475}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-choice-label.sc-duet-choice:active{opacity:0.75;transition:none !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#0077b3 !important;background:#f3f9fc;border-color:#0077b3 !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#0077b3}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#171c3a !important;background:#f5f5f7;border-color:#171c3a !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#c60c30}.checked.collapsible.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom:0 !important;border-bottom-right-radius:0;border-bottom-left-radius:0}input.sc-duet-choice:focus{outline:0}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3)}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2)}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#e1e3e6 !important}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#657787 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#747475 !important;background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#747475 !important}.checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e1e3e6 !important;border-color:#e1e3e6 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-checkmark-container.sc-duet-choice{position:relative;width:20px;height:20px;margin-left:auto;border:1px solid #909599;border-radius:4px;transition:border 300ms ease}.duet-theme-turva.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#747475}.checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#0077b3;border-color:#0077b3;transition:none}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#171c3a;border-color:#171c3a !important}.duet-checkmark-container.duet-checkmark-radio.sc-duet-choice{border-radius:50%}[disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfcfd1 !important}.checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfcfd1 !important}.duet-checkmark.sc-duet-choice{position:absolute;top:10px;left:3px;width:5.3333333333px;height:11.8518518519px;border-top:2px solid white;border-right:2px solid white;opacity:1;transform:scaleX(-1) rotate(135deg) translateZ(0);transform-origin:left top;animation-name:duet-checkmark;animation-duration:600ms;animation-timing-function:ease-out;animation-fill-mode:forwards}@keyframes duet-checkmark{0%{width:0;height:0;opacity:1}20%{width:5.3333333333px;height:0;opacity:1}40%,100%{width:5.3333333333px;height:11.8518518519px;opacity:1}}.duet-choice-card-icon.sc-duet-choice{position:relative}.duet-choice-card-icon.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-section-hidden.sc-duet-choice{display:none}.duet-choice-card-info.duet-choice-card-collapsed.sc-duet-choice,.duet-choice-card-collapsed.duet-choice-card-collapsible.sc-duet-choice{position:relative;width:auto;padding:0 !important;background:unset !important;border:0;border-radius:0}.duet-choice-card-info.sc-duet-choice,.duet-choice-card-collapsible.sc-duet-choice{padding:28px !important;position:relative;z-index:200;width:100%;font-weight:400;color:#00294d;border:2px solid #e1e3e6;border-top:0;border-radius:0 0 4px 4px}.duet-theme-turva.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.duet-theme-turva.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{color:#171c3a;border-color:#171c3a}.checked.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.checked.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{display:block}.duet-choice-card-info-expanded.sc-duet-choice,.duet-choice-card-collapsible-expanded.sc-duet-choice{display:block}.duet-choice-card-collapsible.sc-duet-choice{background:white;border:2px solid #0077b3;border-top:0}.duet-choice-card-collapsible.duet-theme-turva.sc-duet-choice{background:white;border-color:#171c3a}.duet-choice-card-collapsible-disabled.sc-duet-choice{background:#f5f8fa;border-color:#e1e3e6}.duet-choice-card-collapsible-disabled.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-card-info.sc-duet-choice{font-size:0.875rem;line-height:1.5;background:#f5f8fa;transition:150ms ease-out}.duet-choice-card-info.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-info-toggle.sc-duet-choice{display:flex;flex-shrink:0;align-items:flex-start;justify-content:center;width:57.6px;padding-top:1.25rem;cursor:pointer;background:white;border:2px solid #e1e3e6;border-left:0 none;border-top-right-radius:4px;border-bottom-right-radius:4px;-webkit-appearance:none;appearance:none}.duet-choice-info-toggle[aria-expanded=true].sc-duet-choice{background:#f5f8fa;border-bottom-color:transparent;border-bottom-right-radius:0}.duet-choice-info-toggle[disabled].sc-duet-choice{pointer-events:none;background:#f5f8fa !important;border-color:#e1e3e6 !important}.duet-choice-info-toggle[disabled].sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#909599 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice{background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#747475 !important}.duet-choice-info-toggle.sc-duet-choice:focus{outline:none}.user-is-tabbing.sc-duet-choice-h .duet-choice-info-toggle.sc-duet-choice:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-choice-info-toggle.sc-duet-choice{border-left-color:#909599}.checked.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice{border-left-color:#0077b3 !important}.duet-choice-info-toggle.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#0077b3}.duet-theme-turva.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#c60c30}.duet-choice-input.sc-duet-choice{position:absolute !important;width:auto;height:auto;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);color:transparent}';const f=class{constructor(t){e(this,t),this.direction="vertical",this.margin="auto",this.theme="",this.error="",this.label="Label",this.labelHidden=!1,this.caption=void 0,this.tooltip=void 0,this.tooltipDirection="auto",this.responsive=!1,this.onSelect=e=>{if("duet-choice"!==e.detail.component)return;const t=e.target;t&&(this.value=t.value),e.cancelBubble=!0}}async connectedCallback(){const e=this.element;if(void 0===this.value){const t=b(e,":scope > duet-choice");void 0!==t&&(await t.componentOnReady(),void 0===this.value&&(this.value=t.value))}this.mutationO=m(e,":scope > duet-choice",(e=>{void 0!==e?e.componentOnReady().then((()=>{this.value=e.value})):this.updateChoices()})),this.updateChoices()}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)}componentWillLoad(){d(this)}async updateChoices(){const e=Array.from(this.element.querySelectorAll(":scope > duet-choice, :scope .duet-choice-group > duet-choice")),{value:t}=this;let c=!1;for(const i of e)i.name=this.name,i.groupDisabled=this.disabled,i.groupDirection=this.direction,i.groupResponsive=this.responsive,c||i.value!==t?i.checked=!1:(c=!0,i.checked=!0);c||(this.value=void 0)}render(){return c(i,{onDuetChange:this.onSelect,class:{horizontal:"horizontal"===this.direction}},c("duet-fieldset",{label:this.label,labelHidden:this.labelHidden,caption:this.caption,error:this.error,margin:this.margin,theme:this.theme},this.tooltip&&c("duet-tooltip",{slot:"tooltip",direction:this.tooltipDirection,accessibleInputLabel:this.label},this.tooltip),c("div",{class:{"duet-choice-group":!0,"duet-no-stacking":!this.responsive}},c("slot",null))))}get element(){return o(this)}static get watchers(){return{value:["updateChoices"],disabled:["updateChoices"],name:["updateChoices"],direction:["updateChoices"],responsive:["updateChoices"]}}};f.style="*.sc-duet-choice-group,*.sc-duet-choice-group::after,*.sc-duet-choice-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:flex;margin-bottom:0}}.horizontal.sc-duet-choice-group-h .duet-choice-group.duet-no-stacking.sc-duet-choice-group{display:flex}.duet-choice-group.sc-duet-choice-group{position:relative;width:100%;margin-bottom:-12px}";export{g as duet_choice,f as duet_choice_group}
|
|
4
|
+
import{r as e,c as t,h as c,H as i,g as o}from"./p-03957a48.js";import{i as d}from"./p-4ebf1618.js";import{D as h}from"./p-76f00bd5.js";import{c as s}from"./p-c1325e35.js";import{F as a}from"./p-413df442.js";import{i as r,h as u,f as n}from"./p-54f35a79.js";import{g as l,a as p}from"./p-ede854e1.js";import{f as b,w as m}from"./p-12721178.js";import"./p-5a9d75e1.js";const g=class{constructor(c){e(this,c),this.duetChange=t(this,"duetChange",7),this.duetFocus=t(this,"duetFocus",7),this.duetBlur=t(this,"duetBlur",7),this.hasHeader=!1,this.choiceId=s("DuetChoice"),this.expandId=s("DuetChoiceExpand"),this.headerId=s("DuetChoiceHeader"),this.infoButtonId=s("DuetChoiceInfoButton"),this.isHovering=!1,this.isInfoOpen=!1,this.isBlurred=!1,this.theme="",this.label="label",this.accessibleLabelInfoButtonDefaults=h,this.accessibleLabelInfoButton=l(this.accessibleLabelInfoButtonDefaults),this.accessibleDetails=void 0,this.accessibleLabelledBy=void 0,this.accessibleDescription=void 0,this.caption="",this.type="checkbox",this.checked=!1,this.collapsible=!1,this.margin="auto",this.icon="",this.expand=!1,this.padding="auto",this.disabled=!1,this.required=!1,this.infoLabelDefaults={fi:"Lisätietoja",en:"More information about",sv:"Mera information om"},this.infoLabel=l(this.infoLabelDefaults,p()),this.onMouseEnter=()=>{this.isHovering=!0},this.onMouseLeave=()=>{this.isHovering=!1},this.onClick=e=>{this.toggleChecked(e)},this.handleKeyDown=e=>{r(e)&&this.toggleChecked(e),u(e)&&this.hasInfo&&this.toggleInfo()},this.onChange=()=>{this.checked=this.nativeInput.checked||!1,this.duetChange.emit({checked:this.checked,value:this.value,component:"duet-choice"})},this.onBlur=e=>{this.duetBlur.emit({originalEvent:e,checked:this.checked,value:this.value,component:"duet-choice"})},this.onFocus=e=>{this.duetFocus.emit({originalEvent:e,checked:this.checked,value:this.value,component:"duet-choice"})},this.toggleChecked=e=>{this.disabled||this.groupDisabled||(this.isInfoOpen=!1,"radio"===this.type&&this.checked||(this.checked=!this.checked,this.duetChange.emit({originalEvent:e,checked:this.checked,value:this.value,component:"duet-choice"}),e.preventDefault(),e.stopPropagation()))},this.toggleInfo=()=>{this.isInfoOpen=!this.isInfoOpen}}componentWillLoad(){d(this),this.hasInfo=!!this.element.querySelector("[slot='info']"),this.hasHeader=!!this.element.querySelector('[slot="header"]'),this.hasAdditional=!!this.element.querySelector("[slot='additional']")}handleHostBlur(e){this.hasInfo&&this.isInfoOpen&&this.isKeyDown&&(this.element.contains(null==e?void 0:e.relatedTarget)||this.toggleInfo())}handleHostKeyDown(){this.isKeyDown=!0}handleHostKeyUp(e){this.isKeyDown=!1,n(e)&&this.isInfoOpen&&this.toggleInfo()}async setFocus(e){this.nativeInput.focus(e)}getAriaDescribedby(){return this.accessibleDescribedBy?this.accessibleDescribedBy:this.collapsible||this.hasInfo?this.hasHeader?this.headerId:this.expandId:null}getClassNames(){return this.hasInfo&&!this.collapsible?{"duet-choice-card-info":!0,"duet-choice-card-info-expanded":this.isInfoOpen,"duet-choice-card-collapsed":!this.isInfoOpen,"duet-theme-turva":"turva"===this.theme}:!this.hasInfo&&this.collapsible?{"duet-choice-card-collapsible":!0,"duet-choice-card-collapsible-expanded":this.checked,"duet-choice-card-collapsed":!this.checked,"duet-choice-card-collapsible-disabled":!(!this.disabled&&!this.groupDisabled),"duet-theme-turva":"turva"===this.theme}:{"duet-choice-default-slot":!0}}render(){const e=this.identifier||this.choiceId;return c(i,{class:{horizontal:"horizontal"===this.groupDirection&&!this.groupResponsive,"horizontal-responsive":"horizontal"===this.groupDirection&&this.groupResponsive,"duet-m-0":"none"===this.margin,"duet-expand":this.expand,"duet-theme-turva":"turva"===this.theme}},c("div",{class:{"duet-choice-card-flextainer":!0,"duet-theme-turva":"turva"===this.theme}},c("div",{class:{"duet-choice-card":!0,"has-icon":!!this.icon,"has-info":this.hasInfo,checked:this.checked,info:this.isInfoOpen,collapsible:this.collapsible,"duet-p-0":"none"===this.padding}},c("input",{class:"duet-choice-input",type:this.type,onFocus:this.onFocus,onBlur:this.onBlur,onChange:this.onChange,disabled:this.disabled||this.groupDisabled,required:this.required,id:e,name:this.name,value:this.value,checked:this.checked,"aria-controls":this.accessibleControls,"aria-activedescendant":this.accessibleActiveDescendant,"aria-labelledby":this.accessibleLabelledBy,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,"aria-owns":this.accessibleOwns,"aria-describedby":this.getAriaDescribedby(),onKeyDown:this.handleKeyDown,ref:e=>this.nativeInput=e}),c("label",{htmlFor:e,class:{"duet-choice-label":!0,"no-hover":this.isHovering},onClick:this.onClick},this.icon&&c("div",{class:"duet-choice-card-icon"},c("duet-icon",{margin:"none",size:"small",name:this.icon,color:"currentColor"})),c("div",null,c("div",null,this.label),this.caption&&c("div",null,c("duet-spacer",{size:"xx-small"}),c("duet-caption",{margin:"none",selected:this.checked},this.caption)),this.hasAdditional&&c("div",null,c("duet-spacer",{size:"xx-small"}),c("slot",{name:"additional"}))),c("div",null,c("div",{class:{"duet-checkmark-container":!0,"duet-checkmark-radio":"radio"===this.type}},this.checked&&c("div",{class:"duet-checkmark"}))))),this.hasInfo&&!this.collapsible&&c("button",{ref:e=>this.infoButtonEl=e,id:this.infoButtonId,class:{"duet-choice-info-toggle":!0,"duet-theme-turva":"turva"===this.theme},onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onClick:this.toggleInfo,disabled:this.disabled||this.groupDisabled,"aria-expanded":this.isInfoOpen?"true":"false","aria-label":`${this.infoLabel} ${this.label}`,"aria-controls":this.expandId,"aria-flowto":this.expandId,tabindex:"radio"!==this.type||this.checked?"0":"-1",type:"button"},c("duet-visually-hidden",{"aria-hidden":this.isBlurred?"false":"true"},this.accessibleLabelInfoButton),c("div",{class:"duet-choice-info-icon"},c("duet-icon",{icon:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M13.5 17.25A2.252 2.252 0 0 1 11.25 15v-3.75h-.75a.75.75 0 0 1 0-1.5h.75c.827 0 1.5.673 1.5 1.5V15c0 .414.336.75.75.75h.75a.75.75 0 0 1 0 1.5z"/><circle cx="11.625" cy="7.125" r="1.125"/><path d="M12 24C5.383 24 0 18.617 0 12S5.383 0 12 0s12 5.383 12 12-5.383 12-12 12zm0-22.5C6.21 1.5 1.5 6.21 1.5 12S6.21 22.5 12 22.5 22.5 17.79 22.5 12 17.79 1.5 12 1.5z"/></svg>',margin:"none",size:"small",color:"currentColor"})))),this.collapsible||this.hasInfo?c("div",{class:this.getClassNames(),id:this.expandId},c("span",{class:{"duet-choice-section-visible":this.collapsible?this.checked:this.isInfoOpen,"duet-choice-section-hidden":this.collapsible?!this.checked:!this.isInfoOpen}},c("span",{id:this.headerId},c("slot",{name:"header"})),this.hasInfo?c("span",null,c("span",{"aria-relevant":"all","aria-atomic":"true","aria-live":this.isInfoOpen?"polite":"off"},c("slot",{name:"info"})),c("slot",null)):c("span",null,c("slot",null))),this.isInfoOpen&&c(a,{moveFocusTo:this.infoButtonEl})):null)}get element(){return o(this)}};g.style='*.sc-duet-choice,*.sc-duet-choice::after,*.sc-duet-choice::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;flex-direction:column;width:auto;max-width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-choice-h:last-child,.sc-duet-choice-h:last-of-type{margin-right:0 !important}@media (max-width: 35.9375em){.sc-duet-choice-h{width:100%}}.duet-expand.sc-duet-choice-h{width:100% !important}.duet-m-0.sc-duet-choice-h{margin:0 !important}.duet-fixed.sc-duet-choice-h{width:auto !important}.vertical.sc-duet-choice-h{margin-right:0 !important}.horizontal.sc-duet-choice-h{margin-bottom:0 !important}@media (min-width: 48em){.horizontal-responsive.sc-duet-choice-h{margin-bottom:0 !important;margin-right:16px !important}.horizontal-responsive.sc-duet-choice-h:last-child,.horizontal-responsive.sc-duet-choice-h:last-of-type{margin-right:0 !important}}.sc-duet-choice-h:last-child:not(:only-child){margin-right:0 !important}.duet-choice-card.sc-duet-choice{position:relative;display:block;width:100%;min-width:8rem;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;-webkit-hyphens:auto;hyphens:auto;line-height:1.1;color:#00294d !important;text-align:left;background:white;border-width:2px}.duet-choice-card.duet-p-0.sc-duet-choice{padding:0 !important}.duet-choice-card.duet-m-0.sc-duet-choice{margin:0 !important}.duet-theme-turva.sc-duet-choice .duet-choice-card.sc-duet-choice{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a !important}.duet-choice-card-flextainer.sc-duet-choice{display:flex}.duet-choice-label.sc-duet-choice{-webkit-user-select:none;user-select:none;position:relative;z-index:100;display:flex;gap:1rem;align-items:center;justify-content:flex-start;width:100%;height:100%;min-height:3.875rem;padding:1rem;font-size:1rem;font-weight:600;text-decoration:none;word-break:break-word;cursor:pointer;border:2px solid #e1e3e6;border-radius:4px;transition:background-color 150ms ease}.duet-choice-label.sc-duet-choice>div.sc-duet-choice:last-child{flex:1;align-self:flex-start;justify-self:flex-end;margin-top:0.25rem}.has-info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-top-right-radius:0;border-bottom-right-radius:0}.info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom-right-radius:0;border-bottom-left-radius:0}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#909599}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#909599}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#747475}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-choice-label.sc-duet-choice:active{opacity:0.75;transition:none !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#0077b3 !important;background:#f3f9fc;border-color:#0077b3 !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#0077b3}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#171c3a !important;background:#f5f5f7;border-color:#171c3a !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#c60c30}.checked.collapsible.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom:0 !important;border-bottom-right-radius:0;border-bottom-left-radius:0}input.sc-duet-choice:focus{outline:0}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3)}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2)}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#e1e3e6 !important}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#657787 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#747475 !important;background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#747475 !important}.checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e1e3e6 !important;border-color:#e1e3e6 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-checkmark-container.sc-duet-choice{position:relative;width:20px;height:20px;margin-left:auto;border:1px solid #909599;border-radius:4px;transition:border 300ms ease}.duet-theme-turva.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#747475}.checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#0077b3;border-color:#0077b3;transition:none}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#171c3a;border-color:#171c3a !important}.duet-checkmark-container.duet-checkmark-radio.sc-duet-choice{border-radius:50%}[disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfcfd1 !important}.checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfcfd1 !important}.duet-checkmark.sc-duet-choice{position:absolute;top:10px;left:3px;width:5.3333333333px;height:11.8518518519px;border-top:2px solid white;border-right:2px solid white;opacity:1;transform:scaleX(-1) rotate(135deg) translateZ(0);transform-origin:left top;animation-name:duet-checkmark;animation-duration:600ms;animation-timing-function:ease-out;animation-fill-mode:forwards}@keyframes duet-checkmark{0%{width:0;height:0;opacity:1}20%{width:5.3333333333px;height:0;opacity:1}40%,100%{width:5.3333333333px;height:11.8518518519px;opacity:1}}.duet-choice-card-icon.sc-duet-choice{position:relative}.duet-choice-card-icon.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-section-hidden.sc-duet-choice{display:none}.duet-choice-card-info.duet-choice-card-collapsed.sc-duet-choice,.duet-choice-card-collapsed.duet-choice-card-collapsible.sc-duet-choice{position:relative;width:auto;padding:0 !important;background:unset !important;border:0;border-radius:0}.duet-choice-card-info.sc-duet-choice,.duet-choice-card-collapsible.sc-duet-choice{padding:28px !important;position:relative;z-index:200;width:100%;font-weight:400;color:#00294d;border:2px solid #e1e3e6;border-top:0;border-radius:0 0 4px 4px}.duet-theme-turva.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.duet-theme-turva.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{color:#171c3a;border-color:#171c3a}.checked.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.checked.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{display:block}.duet-choice-card-info-expanded.sc-duet-choice,.duet-choice-card-collapsible-expanded.sc-duet-choice{display:block}.duet-choice-card-collapsible.sc-duet-choice{background:white;border:2px solid #0077b3;border-top:0}.duet-choice-card-collapsible.duet-theme-turva.sc-duet-choice{background:white;border-color:#171c3a}.duet-choice-card-collapsible-disabled.sc-duet-choice{background:#f5f8fa;border-color:#e1e3e6}.duet-choice-card-collapsible-disabled.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-card-info.sc-duet-choice{font-size:0.875rem;line-height:1.5;background:#f5f8fa;transition:150ms ease-out}.duet-choice-card-info.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-info-toggle.sc-duet-choice{display:flex;flex-shrink:0;align-items:flex-start;justify-content:center;width:57.6px;padding-top:1.25rem;cursor:pointer;background:white;border:2px solid #e1e3e6;border-left:0 none;border-top-right-radius:4px;border-bottom-right-radius:4px;-webkit-appearance:none;appearance:none}.duet-choice-info-toggle[aria-expanded=true].sc-duet-choice{background:#f5f8fa;border-bottom-color:transparent;border-bottom-right-radius:0}.duet-choice-info-toggle[disabled].sc-duet-choice{pointer-events:none;background:#f5f8fa !important;border-color:#e1e3e6 !important}.duet-choice-info-toggle[disabled].sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#909599 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice{background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#747475 !important}.duet-choice-info-toggle.sc-duet-choice:focus{outline:none}.user-is-tabbing.sc-duet-choice-h .duet-choice-info-toggle.sc-duet-choice:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-choice-info-toggle.sc-duet-choice{border-left-color:#909599}.checked.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice{border-left-color:#0077b3 !important}.duet-choice-info-toggle.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#0077b3}.duet-theme-turva.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#c60c30}.duet-choice-input.sc-duet-choice{position:absolute !important;width:auto;height:auto;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);color:transparent}';const f=class{constructor(t){e(this,t),this.direction="vertical",this.margin="auto",this.theme="",this.error="",this.label="Label",this.labelHidden=!1,this.caption=void 0,this.tooltip=void 0,this.tooltipDirection="auto",this.responsive=!1,this.onSelect=e=>{if("duet-choice"!==e.detail.component)return;const t=e.target;t&&(this.value=t.value),e.cancelBubble=!0}}async connectedCallback(){const e=this.element;if(void 0===this.value){const t=b(e,":scope > duet-choice");void 0!==t&&(await t.componentOnReady(),void 0===this.value&&(this.value=t.value))}this.mutationO=m(e,":scope > duet-choice",(e=>{void 0!==e?e.componentOnReady().then((()=>{this.value=e.value})):this.updateChoices()})),this.updateChoices()}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)}componentWillLoad(){d(this)}async updateChoices(){const e=Array.from(this.element.querySelectorAll(":scope > duet-choice, :scope .duet-choice-group > duet-choice")),{value:t}=this;let c=!1;for(const i of e)i.name=this.name,i.groupDisabled=this.disabled,i.groupDirection=this.direction,i.groupResponsive=this.responsive,c||i.value!==t?i.checked=!1:(c=!0,i.checked=!0);c||(this.value=void 0)}render(){return c(i,{onDuetChange:this.onSelect,class:{horizontal:"horizontal"===this.direction}},c("duet-fieldset",{label:this.label,labelHidden:this.labelHidden,caption:this.caption,error:this.error,margin:this.margin,theme:this.theme},this.tooltip&&c("duet-tooltip",{slot:"tooltip",direction:this.tooltipDirection,accessibleInputLabel:this.label},this.tooltip),c("div",{class:{"duet-choice-group":!0,"duet-no-stacking":!this.responsive}},c("slot",null))))}get element(){return o(this)}static get watchers(){return{value:["updateChoices"],disabled:["updateChoices"],name:["updateChoices"],direction:["updateChoices"],responsive:["updateChoices"]}}};f.style="*.sc-duet-choice-group,*.sc-duet-choice-group::after,*.sc-duet-choice-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-choice-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-choice-group-h .duet-choice-group.sc-duet-choice-group{display:flex;margin-bottom:0}}.horizontal.sc-duet-choice-group-h .duet-choice-group.duet-no-stacking.sc-duet-choice-group{display:flex}.duet-choice-group.sc-duet-choice-group{position:relative;width:100%;margin-bottom:-12px}";export{g as duet_choice,f as duet_choice_group}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function a(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{l(n.next(t))}catch(e){r(e)}}function o(t){try{l(n["throw"](t))}catch(e){r(e)}}function l(t){t.done?i(t.value):a(t.value).then(s,o)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,a&&(r=s[0]&2?a["return"]:s[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;if(a=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;a=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(o){s=[6,o];a=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/System.register(["./p-e97c0bf3.system.js","./p-33b3aba4.system.js","./p-5f6bd5db.system.js","./p-92639d0b.system.js","./p-a63f753e.system.js","./p-f69b64c9.system.js","./p-b6d51921.system.js"],(function(t){"use strict";var e,i,n,a,r,s,o,l,u,c,p,d,h,g,b,f,m,v;return{setters:[function(t){e=t.r;i=t.c;n=t.h;a=t.F;r=t.H;s=t.g},function(t){o=t.i},function(t){l=t.c},function(t){u=t.d},function(t){c=t.j;p=t.k;d=t.d;h=t.b;g=t.a;b=t.c;f=t.l;m=t.m},function(t){v=t.g},function(){}],execute:function(){var y=function(t,e,i){if(t*2>e/i){return false}return true};var x="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-pagination-nav{position:relative}.duet-pagination ::part(button){border:0}.duet-pagination,.duet-pagination li{display:flex;flex-wrap:wrap;gap:0.1rem;align-items:center}.duet-pagination-item-is-active .duet-pagination-page-number{border-bottom-color:inherit;border-bottom-style:solid;border-bottom-width:2px}.duet-pagination duet-button{width:30px;min-width:36px;font-weight:600;text-decoration:none;border-left-width:0}.duet-pagination-overlay{position:absolute;top:1rem;z-index:300;width:100%;text-align:center}.duet-pagination.duet-pagination-is-dimmed{opacity:0.5}";var k=t("duet_pagination",function(){function t(t){var n=this;e(this,t);this.duetPageChange=i(this,"duetPageChange",3);this.listId=l("duet-pagination-list");this.numbersStore="";this.totalPages=10;this.internalSectionIndex=0;this.theme="";this.jumpString="...";this.variation="default";this.accessibleDescribedBy=undefined;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.accessibleLabelsDefaults={en:{next_page:"Next page",previous_page:"Previous page",first_page:"First page",last_page:"Last page",jump_to:"Jump to page",go_to:"Go to page",description:"You may use arrow keys to select page number, or enter a page number when this element is in focus to jump to a page",pagination_label:"Pagination, choose a number to jump to a page",prev_section:"Show previous {0} page numbers, screen reader user should use arrowkeys to navigate",next_section:"Show next {0} page numbers, screen reader user should use arrowkeys to navigate"},fi:{next_page:"Seuraava sivu",previous_page:"Edellinen sivu",first_page:"Ensimmäinen sivu",last_page:"Viimeinen sivu",jump_to:"Siirry sivulle",go_to:"Siirry sivulle",description:"Voit käyttää nuolinäppäimiä sivunumeron valitsemiseen, tai kirjoittaa sivunumeron, jos tämä elementti on aktiivinen, siirtymään sivulle",pagination_label:"Sivutus, valitse sivunumero siirtyäksesi sivulle",prev_section:"Näytä edelliset {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",next_section:"Näytä seuraavat {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi"},sv:{next_page:"Nästa sida",previous_page:"Föregående sida",first_page:"Första sidan",last_page:"Sista sidan",jump_to:"Hoppa till sida",go_to:"Hoppa till sida",description:"Du kan använda piltangenterna för att välja sida, eller skriva in sida när elementet är i fokus för att hoppa till en sida",pagination_label:"Sidutning, välj en siffra för att hoppa till en sida",prev_section:"Visa föregående {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",next_section:"Visa nästa {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera"}};this.accessibleLabels=v(this.accessibleLabelsDefaults);this.take=5;this.visibleItems=5;this.total=1e3;this.ariaControls="";this.current=1;this.actionChain=function(t,e){return __awaiter(n,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:if(!(t===0))return[3,1];this.current=1;return[3,3];case 1:if(!(e!==t))return[3,3];i=Math.ceil(t/this.visibleItems)-1;if(!(i!==this.internalSectionIndex))return[3,3];this.internalSectionIndex=i;return[4,this.setFocus()];case 2:n.sent();n.label=3;case 3:return[2,true]}}))}))};this.emitPageEvent=u((function(t,e){var i=Number(e||n.current);n.duetPageChange.emit({component:"duet-pagination",from:i*n.take,to:i*n.take+n.take,current:i,take:n.take,type:"page",originalEvent:t})}),100);this.getEnteredNumber=u((function(t){n.emitPageEvent(t,n.numbersStore);n.current=Number(n.numbersStore);n.numbersStore="";n.duetPageChange.emit({component:"duet-pagination",from:n.current*n.take,to:n.current*n.take+n.take,current:n.current,take:n.take,type:"jump",originalEvent:t})}),500)}t.prototype.watchPropTotalHandler=function(){this.calculatePageTake();return true};t.prototype.watchStateHandler=function(t,e){return this.actionChain(t,e)};t.prototype.componentWillLoad=function(){this.internalSectionIndex=Math.ceil(this.current/this.visibleItems)-1;this.calculatePageTake();o(this)};t.prototype.componentWillRender=function(){if(this.internalSectionIndex!==0&&this.internalSectionIndex!==this.totalPages){this.calculatePageTake()}};t.prototype.componentDidRender=function(){this.setFocus()};t.prototype.calculatePageTake=function(){this.totalPages=Math.ceil(this.total/this.take)};t.prototype.onMouseHandler=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){t.preventDefault();t.stopPropagation();this.current=this.current+e;this.emitPageEvent(t);return[2]}))}))};t.prototype.onKeyboardDown=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=this.current;if(d(t)||h(t)){e--}if(g(t)||b(t)){e++}if(c(t)){if(e<=this.totalPages){this.current=e;this.emitPageEvent(t)}}if(p(t)&&this.shouldDisplayNavigation()){this.numbersStore=this.numbersStore+t.key;if(Number(this.numbersStore)>this.totalPages){this.numbersStore=this.totalPages+""}this.getEnteredNumber(t)}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:t=this.nativeNav.querySelector("li.duet-pagination-item-is-active duet-button");e=t;if(!e)return[3,2];return[4,t.setFocus()];case 1:e=i.sent();i.label=2;case 2:e;return[2]}}))}))};t.prototype.pageClickHandler=function(t){t.preventDefault();var e=Number(t.target.getAttribute("data-id"));this.current=e;this.emitPageEvent({},e)};t.prototype.sectionClickHandler=function(t,e){t.preventDefault();var i=this.internalSectionIndex+e;var n=this.take*this.visibleItems;if(i*n>this.total){i=this.internalSectionIndex}var a=i;this.internalSectionIndex=a>=0?a:0};t.prototype.jumpToStart=function(t){t.preventDefault();this.internalSectionIndex=0;this.current=1;this.emitPageEvent(t)};t.prototype.jumpToEnd=function(t){t.preventDefault();this.internalSectionIndex=Math.ceil(this.totalPages/this.take-1);this.current=this.totalPages;this.emitPageEvent(t)};t.prototype.renderPageNumbers=function(){var t=this;var e=[];var i=this.internalSectionIndex*this.visibleItems;do{i++;if(i>this.totalPages){break}e.push(n("li",{class:{"duet-pagination-item":true,"duet-pagination-item-is-active":i===this.current},role:"menuitem"},n("duet-button",{class:{"duet-pagination-link":true},color:i!==this.current?"secondary":"primary","data-id":i,"center-text":true,variation:"plain",margin:"none",accessibleLabel:"".concat(this.accessibleLabels.go_to," ").concat(i),onClick:function(e){return t.pageClickHandler(e)}},n("div",{class:"duet-pagination-page-number","aria-hidden":true},i))))}while(i<this.visibleItems+this.internalSectionIndex*this.visibleItems);return e};t.prototype.shouldDisplayNavigation=function(){if(this.variation!=="compact"){return y(this.visibleItems,this.total,this.take)}return false};t.prototype.render=function(){var t;var e=this;return n(r,{onKeyDown:function(t){return e.onKeyboardDown(t)}},n("nav",{role:"navigation","aria-labelledby":this.accessibleLabelledBy?"".concat(this.accessibleLabelledBy," ").concat(this.listId):this.listId,"aria-describedby":this.accessibleDescribedBy?"".concat(this.accessibleDescribedBy," ").concat(this.listId):this.listId,"aria-descriptions":this.accessibleDescription,"aria-details":this.accessibleDetails,ref:function(t){return e.nativeNav=t},"aria-controls":this.ariaControls,class:(t={"duet-pagination-nav":true},t["duet-pagination-variation-".concat(this.variation)]=true,t)},this.numbersStore!==""&&n("div",{"aria-live":"assertive","aria-relevant":"text",class:"duet-pagination-overlay","aria-label":"".concat(this.accessibleLabels.jump_to," ").concat(this.numbersStore),part:"navigation-overlay"},n("duet-badge",null,"jump to page : ",this.numbersStore)),n("ol",{id:this.listId,class:{"duet-pagination":true,"duet-pagination-is-dimmed":this.numbersStore!==""},role:"menubar","aria-label":this.accessibleLabels.pagination_label,"aria-description":this.accessibleLabels.description},n("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-first":true},role:"menuitem",part:"navigation-arrow"},n("duet-action-button",{disabled:this.internalSectionIndex===0&&this.current<=1,"data-direction":"back",onClick:function(t){return e.onMouseHandler(t,-1)},"aria-label":this.accessibleLabels.previous_page,"icon-name":"action-arrow-left-small"})),this.internalSectionIndex!==0&&this.shouldDisplayNavigation()&&n(a,null,n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-back","center-text":"true",variation:"plain",color:"secondary",margin:"none",accessibleLabel:this.accessibleLabels.first_page,onClick:function(t){return e.jumpToStart(t)}},n("div",{class:"duet-pagination-page-number"},"1"))),n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-back","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.prev_section.replace("{0}","".concat(this.visibleItems)),onClick:function(t){return e.sectionClickHandler(t,-1)}},n("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"...")))),this.renderPageNumbers(),this.internalSectionIndex*(this.visibleItems+2)<this.totalPages&&this.shouldDisplayNavigation()&&n(a,null,n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.next_section.replace("{0}","".concat(this.visibleItems)),onClick:function(t){return e.sectionClickHandler(t,1)}},n("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"..."))),n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.last_page,onClick:function(t){return e.jumpToEnd(t)}},n("div",{class:"duet-pagination-page-number"},this.totalPages)))),n("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-last":true},role:"menuitem",part:"navigation-arrow"},n("duet-action-button",{disabled:this.current===this.totalPages&&this.internalSectionIndex===Math.ceil(this.totalPages/this.visibleItems)-1,class:"duet-date-dialog-next","aria-label":this.accessibleLabels.next_page,onClick:function(t){return e.onMouseHandler(t,1)},"icon-name":"action-arrow-right-small"})))))};Object.defineProperty(t.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{total:["watchPropTotalHandler"],current:["watchStateHandler"]}},enumerable:false,configurable:true});return t}());k.style=x;var S="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-range-stepper{display:flex;flex-wrap:wrap;gap:0;align-items:baseline;justify-content:center;min-width:30px;min-height:30px;font-weight:600;text-decoration:none;border-left-width:0}.duet-range-stepper{white-space:nowrap}.duet-range-stepper .duet-range-step-counter{font-weight:600;color:#00294d}.duet-range-stepper ::part(button){border:0}";var _=t("duet_range_stepper",function(){function t(t){var n=this;e(this,t);this.duetRangeStepUpdate=i(this,"duetRangeStepUpdate",7);this.leftBn=l("duetRangeStepper-left");this.rightBn=l("duetRangeStepper-right");this.theme="";this.stepIndex=1;this.stepSize=50;this.total=1e3;this.ariaLabelsDefaults={en:{next_increment:"Next range increment",previous_increment:"Previous range increment",x_of_y:"{0}–{1} of {2}"},fi:{next_increment:"Seuraava välillä",previous_increment:"Edellinen välillä",x_of_y:"{0}–{1} / {2}"},sv:{next_increment:"Nästa intervall",previous_increment:"Föregående intervall",x_of_y:"{0}–{1} av {2}"}};this.ariaLabels=v(this.ariaLabelsDefaults);this.ariaControls="";this.handleClick=function(t,e){t.preventDefault();n.increment(e);n.handleStepClick(t)}}t.prototype.watchStepIndexStateHandler=function(t){if(t<=1){this.leftBnRef.setAttribute("disabled","");this.rightBnRef.focus()}else{this.leftBnRef.removeAttribute("disabled")}if(t>=this.total/this.stepSize){this.rightBnRef.setAttribute("disabled","");this.leftBnRef.focus()}else{this.rightBnRef.removeAttribute("disabled")}};t.prototype.watchStepSizeStateHandler=function(t,e){if(t!==e){if(this.stepIndex*t>this.total){this.stepIndex=this.total/t}}};t.prototype.handleStepClick=function(t){var e=this.stepIndex*this.stepSize-this.stepSize;this.duetRangeStepUpdate.emit({originalEvent:t,component:"duet-range-stepper",from:e,to:this.getTo(),index:this.stepIndex})};t.prototype.componentWillLoad=function(){o(this)};t.prototype.componentDidLoad=function(){this.watchStepIndexStateHandler(this.stepIndex)};t.prototype.increment=function(t){var e=this.stepIndex+t;if(e<=0){this.stepIndex=1}else{if(e*this.stepSize<this.total+this.stepSize){this.stepIndex=e}else if(e*this.stepSize>this.total+this.stepSize){this.stepIndex=Math.floor(this.total/this.stepSize)}}};t.prototype.getTo=function(){var t=this.stepIndex*this.stepSize;var e=t>this.total?this.total:t;return e};t.prototype.generateStepSize=function(){var t=Math.floor((this.stepIndex-1)*this.stepSize);if(t===0){t=1}var e=Math.floor(this.stepIndex*this.stepSize);return this.ariaLabels.x_of_y.replace("{0}",String(t)).replace("{1}",String(e)).replace("{2}",String(this.total))};t.prototype.onKeyboardDown=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){e=this.stepIndex;i=1;if(d(t)||h(t)||f(t)){e--;i=-1;this.leftBnRef.focus()}if(g(t)||b(t)||m(t)){e++;i=1}if(c(t)){if(e>0&&e*this.stepSize<=this.total){this.handleClick(t,i)}}return[2]}))}))};t.prototype.render=function(){var t=this;return n("div",{class:{"duet-range-stepper":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:function(e){return t.onKeyboardDown(e)},"aria-controls":this.ariaControls},n("span",{class:"duet-range-step-counter",part:"range-numbers"},this.generateStepSize()),n("duet-action-button",{class:"duet-range-step-button duet-range-step-minus",onClick:function(e){return t.handleClick(e,-1)},id:this.leftBn,"aria-label":this.ariaLabels.previous_increment,ref:function(e){return t.leftBnRef=e},part:"navigation-arrow",iconName:"action-arrow-left-small"}),n("duet-action-button",{class:"duet-range-step-button duet-range-step-plus",onClick:function(e){return t.handleClick(e,1)},"aria-label":this.ariaLabels.next_increment,id:this.rightBn,ref:function(e){return t.rightBnRef=e},part:"navigation-arrow",iconName:"action-arrow-right-small"}))};Object.defineProperty(t.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{stepIndex:["watchStepIndexStateHandler"],stepSize:["watchStepSizeStateHandler"]}},enumerable:false,configurable:true});return t}());_.style=S}}}));
|
|
4
|
+
*/System.register(["./p-f86937f0.system.js","./p-33b3aba4.system.js","./p-5f6bd5db.system.js","./p-92639d0b.system.js","./p-a63f753e.system.js","./p-f69b64c9.system.js","./p-b6d51921.system.js"],(function(t){"use strict";var e,i,n,a,r,s,o,l,u,c,p,d,h,g,b,f,m,v;return{setters:[function(t){e=t.r;i=t.c;n=t.h;a=t.F;r=t.H;s=t.g},function(t){o=t.i},function(t){l=t.c},function(t){u=t.d},function(t){c=t.j;p=t.k;d=t.d;h=t.b;g=t.a;b=t.c;f=t.l;m=t.m},function(t){v=t.g},function(){}],execute:function(){var y=function(t,e,i){if(t*2>e/i){return false}return true};var x="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-pagination-nav{position:relative}.duet-pagination ::part(button){border:0}.duet-pagination,.duet-pagination li{display:flex;flex-wrap:wrap;gap:0.1rem;align-items:center}.duet-pagination-item-is-active .duet-pagination-page-number{border-bottom-color:inherit;border-bottom-style:solid;border-bottom-width:2px}.duet-pagination duet-button{width:30px;min-width:36px;font-weight:600;text-decoration:none;border-left-width:0}.duet-pagination-overlay{position:absolute;top:1rem;z-index:300;width:100%;text-align:center}.duet-pagination.duet-pagination-is-dimmed{opacity:0.5}";var k=t("duet_pagination",function(){function t(t){var n=this;e(this,t);this.duetPageChange=i(this,"duetPageChange",3);this.listId=l("duet-pagination-list");this.numbersStore="";this.totalPages=10;this.internalSectionIndex=0;this.theme="";this.jumpString="...";this.variation="default";this.accessibleDescribedBy=undefined;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.accessibleLabelsDefaults={en:{next_page:"Next page",previous_page:"Previous page",first_page:"First page",last_page:"Last page",jump_to:"Jump to page",go_to:"Go to page",description:"You may use arrow keys to select page number, or enter a page number when this element is in focus to jump to a page",pagination_label:"Pagination, choose a number to jump to a page",prev_section:"Show previous {0} page numbers, screen reader user should use arrowkeys to navigate",next_section:"Show next {0} page numbers, screen reader user should use arrowkeys to navigate"},fi:{next_page:"Seuraava sivu",previous_page:"Edellinen sivu",first_page:"Ensimmäinen sivu",last_page:"Viimeinen sivu",jump_to:"Siirry sivulle",go_to:"Siirry sivulle",description:"Voit käyttää nuolinäppäimiä sivunumeron valitsemiseen, tai kirjoittaa sivunumeron, jos tämä elementti on aktiivinen, siirtymään sivulle",pagination_label:"Sivutus, valitse sivunumero siirtyäksesi sivulle",prev_section:"Näytä edelliset {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",next_section:"Näytä seuraavat {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi"},sv:{next_page:"Nästa sida",previous_page:"Föregående sida",first_page:"Första sidan",last_page:"Sista sidan",jump_to:"Hoppa till sida",go_to:"Hoppa till sida",description:"Du kan använda piltangenterna för att välja sida, eller skriva in sida när elementet är i fokus för att hoppa till en sida",pagination_label:"Sidutning, välj en siffra för att hoppa till en sida",prev_section:"Visa föregående {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",next_section:"Visa nästa {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera"}};this.accessibleLabels=v(this.accessibleLabelsDefaults);this.take=5;this.visibleItems=5;this.total=1e3;this.ariaControls="";this.current=1;this.actionChain=function(t,e){return __awaiter(n,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:if(!(t===0))return[3,1];this.current=1;return[3,3];case 1:if(!(e!==t))return[3,3];i=Math.ceil(t/this.visibleItems)-1;if(!(i!==this.internalSectionIndex))return[3,3];this.internalSectionIndex=i;return[4,this.setFocus()];case 2:n.sent();n.label=3;case 3:return[2,true]}}))}))};this.emitPageEvent=u((function(t,e){var i=Number(e||n.current);n.duetPageChange.emit({component:"duet-pagination",from:i*n.take,to:i*n.take+n.take,current:i,take:n.take,type:"page",originalEvent:t})}),100);this.getEnteredNumber=u((function(t){n.emitPageEvent(t,n.numbersStore);n.current=Number(n.numbersStore);n.numbersStore="";n.duetPageChange.emit({component:"duet-pagination",from:n.current*n.take,to:n.current*n.take+n.take,current:n.current,take:n.take,type:"jump",originalEvent:t})}),500)}t.prototype.watchPropTotalHandler=function(){this.calculatePageTake();return true};t.prototype.watchStateHandler=function(t,e){return this.actionChain(t,e)};t.prototype.componentWillLoad=function(){this.internalSectionIndex=Math.ceil(this.current/this.visibleItems)-1;this.calculatePageTake();o(this)};t.prototype.componentWillRender=function(){if(this.internalSectionIndex!==0&&this.internalSectionIndex!==this.totalPages){this.calculatePageTake()}};t.prototype.componentDidRender=function(){this.setFocus()};t.prototype.calculatePageTake=function(){this.totalPages=Math.ceil(this.total/this.take)};t.prototype.onMouseHandler=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){t.preventDefault();t.stopPropagation();this.current=this.current+e;this.emitPageEvent(t);return[2]}))}))};t.prototype.onKeyboardDown=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=this.current;if(d(t)||h(t)){e--}if(g(t)||b(t)){e++}if(c(t)){if(e<=this.totalPages){this.current=e;this.emitPageEvent(t)}}if(p(t)&&this.shouldDisplayNavigation()){this.numbersStore=this.numbersStore+t.key;if(Number(this.numbersStore)>this.totalPages){this.numbersStore=this.totalPages+""}this.getEnteredNumber(t)}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:t=this.nativeNav.querySelector("li.duet-pagination-item-is-active duet-button");e=t;if(!e)return[3,2];return[4,t.setFocus()];case 1:e=i.sent();i.label=2;case 2:e;return[2]}}))}))};t.prototype.pageClickHandler=function(t){t.preventDefault();var e=Number(t.target.getAttribute("data-id"));this.current=e;this.emitPageEvent({},e)};t.prototype.sectionClickHandler=function(t,e){t.preventDefault();var i=this.internalSectionIndex+e;var n=this.take*this.visibleItems;if(i*n>this.total){i=this.internalSectionIndex}var a=i;this.internalSectionIndex=a>=0?a:0};t.prototype.jumpToStart=function(t){t.preventDefault();this.internalSectionIndex=0;this.current=1;this.emitPageEvent(t)};t.prototype.jumpToEnd=function(t){t.preventDefault();this.internalSectionIndex=Math.ceil(this.totalPages/this.take-1);this.current=this.totalPages;this.emitPageEvent(t)};t.prototype.renderPageNumbers=function(){var t=this;var e=[];var i=this.internalSectionIndex*this.visibleItems;do{i++;if(i>this.totalPages){break}e.push(n("li",{class:{"duet-pagination-item":true,"duet-pagination-item-is-active":i===this.current},role:"menuitem"},n("duet-button",{class:{"duet-pagination-link":true},color:i!==this.current?"secondary":"primary","data-id":i,"center-text":true,variation:"plain",margin:"none",accessibleLabel:"".concat(this.accessibleLabels.go_to," ").concat(i),onClick:function(e){return t.pageClickHandler(e)}},n("div",{class:"duet-pagination-page-number","aria-hidden":true},i))))}while(i<this.visibleItems+this.internalSectionIndex*this.visibleItems);return e};t.prototype.shouldDisplayNavigation=function(){if(this.variation!=="compact"){return y(this.visibleItems,this.total,this.take)}return false};t.prototype.render=function(){var t;var e=this;return n(r,{onKeyDown:function(t){return e.onKeyboardDown(t)}},n("nav",{role:"navigation","aria-labelledby":this.accessibleLabelledBy?"".concat(this.accessibleLabelledBy," ").concat(this.listId):this.listId,"aria-describedby":this.accessibleDescribedBy?"".concat(this.accessibleDescribedBy," ").concat(this.listId):this.listId,"aria-descriptions":this.accessibleDescription,"aria-details":this.accessibleDetails,ref:function(t){return e.nativeNav=t},"aria-controls":this.ariaControls,class:(t={"duet-pagination-nav":true},t["duet-pagination-variation-".concat(this.variation)]=true,t)},this.numbersStore!==""&&n("div",{"aria-live":"assertive","aria-relevant":"text",class:"duet-pagination-overlay","aria-label":"".concat(this.accessibleLabels.jump_to," ").concat(this.numbersStore),part:"navigation-overlay"},n("duet-badge",null,"jump to page : ",this.numbersStore)),n("ol",{id:this.listId,class:{"duet-pagination":true,"duet-pagination-is-dimmed":this.numbersStore!==""},role:"menubar","aria-label":this.accessibleLabels.pagination_label,"aria-description":this.accessibleLabels.description},n("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-first":true},role:"menuitem",part:"navigation-arrow"},n("duet-action-button",{disabled:this.internalSectionIndex===0&&this.current<=1,"data-direction":"back",onClick:function(t){return e.onMouseHandler(t,-1)},"aria-label":this.accessibleLabels.previous_page,"icon-name":"action-arrow-left-small"})),this.internalSectionIndex!==0&&this.shouldDisplayNavigation()&&n(a,null,n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-back","center-text":"true",variation:"plain",color:"secondary",margin:"none",accessibleLabel:this.accessibleLabels.first_page,onClick:function(t){return e.jumpToStart(t)}},n("div",{class:"duet-pagination-page-number"},"1"))),n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-back","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.prev_section.replace("{0}","".concat(this.visibleItems)),onClick:function(t){return e.sectionClickHandler(t,-1)}},n("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"...")))),this.renderPageNumbers(),this.internalSectionIndex*(this.visibleItems+2)<this.totalPages&&this.shouldDisplayNavigation()&&n(a,null,n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.next_section.replace("{0}","".concat(this.visibleItems)),onClick:function(t){return e.sectionClickHandler(t,1)}},n("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"..."))),n("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},n("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.last_page,onClick:function(t){return e.jumpToEnd(t)}},n("div",{class:"duet-pagination-page-number"},this.totalPages)))),n("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-last":true},role:"menuitem",part:"navigation-arrow"},n("duet-action-button",{disabled:this.current===this.totalPages&&this.internalSectionIndex===Math.ceil(this.totalPages/this.visibleItems)-1,class:"duet-date-dialog-next","aria-label":this.accessibleLabels.next_page,onClick:function(t){return e.onMouseHandler(t,1)},"icon-name":"action-arrow-right-small"})))))};Object.defineProperty(t.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{total:["watchPropTotalHandler"],current:["watchStateHandler"]}},enumerable:false,configurable:true});return t}());k.style=x;var S="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-range-stepper{display:flex;flex-wrap:wrap;gap:0;align-items:baseline;justify-content:center;min-width:30px;min-height:30px;font-weight:600;text-decoration:none;border-left-width:0}.duet-range-stepper{white-space:nowrap}.duet-range-stepper .duet-range-step-counter{font-weight:600;color:#00294d}.duet-range-stepper ::part(button){border:0}";var _=t("duet_range_stepper",function(){function t(t){var n=this;e(this,t);this.duetRangeStepUpdate=i(this,"duetRangeStepUpdate",7);this.leftBn=l("duetRangeStepper-left");this.rightBn=l("duetRangeStepper-right");this.theme="";this.stepIndex=1;this.stepSize=50;this.total=1e3;this.ariaLabelsDefaults={en:{next_increment:"Next range increment",previous_increment:"Previous range increment",x_of_y:"{0}–{1} of {2}"},fi:{next_increment:"Seuraava välillä",previous_increment:"Edellinen välillä",x_of_y:"{0}–{1} / {2}"},sv:{next_increment:"Nästa intervall",previous_increment:"Föregående intervall",x_of_y:"{0}–{1} av {2}"}};this.ariaLabels=v(this.ariaLabelsDefaults);this.ariaControls="";this.handleClick=function(t,e){t.preventDefault();n.increment(e);n.handleStepClick(t)}}t.prototype.watchStepIndexStateHandler=function(t){if(t<=1){this.leftBnRef.setAttribute("disabled","");this.rightBnRef.focus()}else{this.leftBnRef.removeAttribute("disabled")}if(t>=this.total/this.stepSize){this.rightBnRef.setAttribute("disabled","");this.leftBnRef.focus()}else{this.rightBnRef.removeAttribute("disabled")}};t.prototype.watchStepSizeStateHandler=function(t,e){if(t!==e){if(this.stepIndex*t>this.total){this.stepIndex=this.total/t}}};t.prototype.handleStepClick=function(t){var e=this.stepIndex*this.stepSize-this.stepSize;this.duetRangeStepUpdate.emit({originalEvent:t,component:"duet-range-stepper",from:e,to:this.getTo(),index:this.stepIndex})};t.prototype.componentWillLoad=function(){o(this)};t.prototype.componentDidLoad=function(){this.watchStepIndexStateHandler(this.stepIndex)};t.prototype.increment=function(t){var e=this.stepIndex+t;if(e<=0){this.stepIndex=1}else{if(e*this.stepSize<this.total+this.stepSize){this.stepIndex=e}else if(e*this.stepSize>this.total+this.stepSize){this.stepIndex=Math.floor(this.total/this.stepSize)}}};t.prototype.getTo=function(){var t=this.stepIndex*this.stepSize;var e=t>this.total?this.total:t;return e};t.prototype.generateStepSize=function(){var t=Math.floor((this.stepIndex-1)*this.stepSize);if(t===0){t=1}var e=Math.floor(this.stepIndex*this.stepSize);return this.ariaLabels.x_of_y.replace("{0}",String(t)).replace("{1}",String(e)).replace("{2}",String(this.total))};t.prototype.onKeyboardDown=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){e=this.stepIndex;i=1;if(d(t)||h(t)||f(t)){e--;i=-1;this.leftBnRef.focus()}if(g(t)||b(t)||m(t)){e++;i=1}if(c(t)){if(e>0&&e*this.stepSize<=this.total){this.handleClick(t,i)}}return[2]}))}))};t.prototype.render=function(){var t=this;return n("div",{class:{"duet-range-stepper":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:function(e){return t.onKeyboardDown(e)},"aria-controls":this.ariaControls},n("span",{class:"duet-range-step-counter",part:"range-numbers"},this.generateStepSize()),n("duet-action-button",{class:"duet-range-step-button duet-range-step-minus",onClick:function(e){return t.handleClick(e,-1)},id:this.leftBn,"aria-label":this.ariaLabels.previous_increment,ref:function(e){return t.leftBnRef=e},part:"navigation-arrow",iconName:"action-arrow-left-small"}),n("duet-action-button",{class:"duet-range-step-button duet-range-step-plus",onClick:function(e){return t.handleClick(e,1)},"aria-label":this.ariaLabels.next_increment,id:this.rightBn,ref:function(e){return t.rightBnRef=e},part:"navigation-arrow",iconName:"action-arrow-right-small"}))};Object.defineProperty(t.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{stepIndex:["watchStepIndexStateHandler"],stepSize:["watchStepSizeStateHandler"]}},enumerable:false,configurable:true});return t}());_.style=S}}}));
|