@duetds/components 4.33.0 → 4.33.1
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 +82 -40
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-caption_4.cjs.entry.js +1 -1
- package/lib/cjs/duet-card.cjs.entry.js +1 -1
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +2 -3
- package/lib/cjs/duet-collapsible.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-button.cjs.entry.js +89 -0
- package/lib/cjs/{duet-upload.cjs.entry.js → duet-editable-table_4.cjs.entry.js} +386 -30
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +62 -0
- package/lib/cjs/duet-footer.cjs.entry.js +1 -1
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +16 -6
- package/lib/cjs/duet-input_2.cjs.entry.js +1 -1
- 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-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-select.cjs.entry.js +1 -1
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-tab_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 +100 -0
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-a7a1fb8b.js → focus-utils-b609a7a5.js} +1 -1
- package/lib/cjs/{index-b724d698.js → index-9a57d969.js} +8 -1
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/collection/collection-manifest.json +9 -8
- package/lib/collection/components/duet-choice/duet-choice.js +0 -1
- package/lib/collection/components/duet-icon/icon-utils.js +15 -5
- package/lib/collection/components/duet-upload/duet-upload.js +72 -47
- package/lib/collection/components/duet-upload/{duet-upload-editable-item-error.js → upload-editable-item-error.js} +0 -0
- package/lib/collection/components/duet-upload/{duet-upload-editable-item-inprogres.js → upload-editable-item-inprogres.js} +0 -0
- package/lib/collection/components/duet-upload/{duet-upload-editable-item-success.js → upload-editable-item-success.js} +0 -0
- package/lib/collection/components/duet-upload/{duet-upload-validators.js → upload-validators.js} +0 -0
- package/lib/collection/components/{duet-upload → duet-upload-aria-status}/duet-upload-aria-status.js +3 -3
- package/lib/custom-elements-bundle/index.js +75 -36
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-a207b008.entry.js → p-00210a63.entry.js} +1 -1
- package/lib/duet/{p-8cb7416d.entry.js → p-0205162d.entry.js} +1 -1
- package/lib/duet/{p-d744d188.system.entry.js → p-020a2c42.system.entry.js} +1 -1
- package/lib/duet/{p-c36b4da0.entry.js → p-079795e5.entry.js} +1 -1
- package/lib/duet/{p-6e6e76db.system.entry.js → p-09013a48.system.entry.js} +1 -1
- package/lib/duet/p-0a89315d.entry.js +4 -0
- package/lib/duet/{p-6cc3be76.system.entry.js → p-0e90f075.system.entry.js} +1 -1
- package/lib/duet/{p-8f826843.system.entry.js → p-19d7d9d5.system.entry.js} +1 -1
- package/lib/duet/{p-c2e77278.entry.js → p-1cbc6269.entry.js} +1 -1
- package/lib/duet/{p-a5b9c192.system.entry.js → p-2297d13f.system.entry.js} +1 -1
- package/lib/duet/{p-263bc9cd.system.entry.js → p-2a822e91.system.entry.js} +1 -1
- package/lib/duet/{p-2bb1460c.entry.js → p-2fdcff82.entry.js} +1 -1
- package/lib/duet/{p-67d9a9a9.system.entry.js → p-3013c9bb.system.entry.js} +1 -1
- package/lib/duet/{p-c34329f3.entry.js → p-3212a556.entry.js} +1 -1
- package/lib/duet/{p-b32224fe.system.entry.js → p-323643af.system.entry.js} +1 -1
- package/lib/duet/{p-a9859a82.entry.js → p-32b7397d.entry.js} +1 -1
- package/lib/duet/{p-6a19b5ec.entry.js → p-360086f8.entry.js} +1 -1
- package/lib/duet/{p-bf93a991.entry.js → p-37cda933.entry.js} +1 -1
- package/lib/duet/{p-af41d894.system.entry.js → p-3ba62cf1.system.entry.js} +1 -1
- package/lib/duet/{p-4a87e9ab.system.entry.js → p-3fd9190b.system.entry.js} +1 -1
- package/lib/duet/{p-acc57c77.entry.js → p-43847557.entry.js} +1 -1
- package/lib/duet/{p-374fb7e6.system.entry.js → p-4b6e8558.system.entry.js} +1 -1
- package/lib/duet/p-4c5eedf8.entry.js +4 -0
- package/lib/duet/{p-a6a84ec6.entry.js → p-4c827f0d.entry.js} +1 -1
- package/lib/duet/{p-b42d81c3.system.js → p-51955fc0.system.js} +1 -1
- package/lib/duet/{p-e964d062.entry.js → p-5cfc53f9.entry.js} +1 -1
- package/lib/duet/{p-2443bdca.system.entry.js → p-5decc259.system.entry.js} +1 -1
- package/lib/duet/{p-548d484e.js → p-5e0071d6.js} +1 -1
- package/lib/duet/p-5e77432e.system.entry.js +4 -0
- package/lib/duet/{p-58750bae.system.entry.js → p-6024e484.system.entry.js} +1 -1
- package/lib/duet/{p-9d73343a.entry.js → p-68008644.entry.js} +1 -1
- package/lib/duet/p-69385972.system.entry.js +4 -0
- package/lib/duet/{p-4e28da18.system.entry.js → p-6a4d85ed.system.entry.js} +1 -1
- package/lib/duet/{p-984576c9.entry.js → p-6a5ab3eb.entry.js} +1 -1
- package/lib/duet/{p-aba68b7b.entry.js → p-6e4b1c0d.entry.js} +1 -1
- package/lib/duet/{p-27d80cef.system.entry.js → p-6f36f647.system.entry.js} +1 -1
- package/lib/duet/{p-7e8d5bb9.system.entry.js → p-6fa6c4fb.system.entry.js} +1 -1
- package/lib/duet/{p-d1c19f04.system.entry.js → p-71a77368.system.entry.js} +1 -1
- package/lib/duet/p-73f9db25.system.entry.js +4 -0
- package/lib/duet/{p-63d5bf73.system.entry.js → p-74f4a0d8.system.entry.js} +1 -1
- package/lib/duet/{p-aef1b720.system.entry.js → p-7530be48.system.entry.js} +1 -1
- package/lib/duet/{p-9481e312.entry.js → p-75edcaed.entry.js} +1 -1
- package/lib/duet/{p-237e47b4.system.entry.js → p-7a8597c2.system.entry.js} +1 -1
- package/lib/duet/p-85ad012a.system.entry.js +4 -0
- package/lib/duet/{p-cdd70b93.entry.js → p-85e52be8.entry.js} +1 -1
- package/lib/duet/{p-94169303.entry.js → p-8aaf3383.entry.js} +1 -1
- package/lib/duet/{p-86daec1c.entry.js → p-9e79e033.entry.js} +1 -1
- package/lib/duet/{p-4607af59.entry.js → p-9f35d682.entry.js} +1 -1
- package/lib/duet/{p-d3a3c3c7.system.entry.js → p-a2a00146.system.entry.js} +1 -1
- package/lib/duet/{p-1208c84f.entry.js → p-a545398c.entry.js} +1 -1
- package/lib/duet/{p-00735436.entry.js → p-af49d4f9.entry.js} +1 -1
- package/lib/duet/p-b25edbbe.entry.js +4 -0
- package/lib/duet/{p-e12f2b8b.system.js → p-b314348c.system.js} +2 -2
- package/lib/duet/{p-751542a0.system.entry.js → p-b4111e88.system.entry.js} +1 -1
- package/lib/duet/{p-7fee0d23.system.entry.js → p-b5c7d304.system.entry.js} +1 -1
- package/lib/duet/{p-16c48c5d.entry.js → p-b6e9860a.entry.js} +1 -1
- package/lib/duet/{p-060d79be.entry.js → p-ba18b56e.entry.js} +1 -1
- package/lib/duet/{p-387823af.system.entry.js → p-bf4596bd.system.entry.js} +1 -1
- package/lib/duet/{p-8b5ca0e7.system.entry.js → p-bf9f6d80.system.entry.js} +1 -1
- package/lib/duet/{p-e2a44156.js → p-c1a1ea1b.js} +1 -1
- package/lib/duet/{p-7368b14e.system.entry.js → p-c742856b.system.entry.js} +1 -1
- package/lib/duet/{p-48d1eb1f.system.entry.js → p-cbdb9e98.system.entry.js} +1 -1
- package/lib/duet/{p-b4e87f02.system.entry.js → p-cf319832.system.entry.js} +1 -1
- package/lib/duet/p-d67fff56.entry.js +4 -0
- package/lib/duet/{p-4b6ebe40.system.entry.js → p-dd76db9b.system.entry.js} +1 -1
- package/lib/duet/{p-d4118b6e.system.entry.js → p-de5ec54e.system.entry.js} +1 -1
- package/lib/duet/{p-5826523b.entry.js → p-df6f39a3.entry.js} +1 -1
- package/lib/duet/p-e1dc86b5.system.js +4 -0
- package/lib/duet/{p-b3744481.entry.js → p-e2596ea0.entry.js} +1 -1
- package/lib/duet/{p-e76b722f.entry.js → p-e370c18b.entry.js} +1 -1
- package/lib/duet/{p-9dca5c22.system.entry.js → p-e48f3a32.system.entry.js} +1 -1
- package/lib/duet/p-e5031543.entry.js +4 -0
- package/lib/duet/{p-597d99c7.entry.js → p-e60ee8b0.entry.js} +1 -1
- package/lib/duet/{p-794659ac.entry.js → p-e70088d5.entry.js} +1 -1
- package/lib/duet/{p-aee24388.system.entry.js → p-e7b90769.system.entry.js} +1 -1
- package/lib/duet/{p-f8ce39fb.entry.js → p-e8123a53.entry.js} +1 -1
- package/lib/duet/{p-a890da72.entry.js → p-ef7251bf.entry.js} +1 -1
- package/lib/duet/p-f0cfe033.system.entry.js +4 -0
- package/lib/duet/{p-1a08fc22.system.entry.js → p-f2a087a8.system.entry.js} +1 -1
- package/lib/duet/{p-3af5d66f.entry.js → p-f5a55b3c.entry.js} +1 -1
- package/lib/duet/p-fd613733.entry.js +4 -0
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +1 -1
- package/lib/esm/duet-caption_4.entry.js +1 -1
- package/lib/esm/duet-card.entry.js +1 -1
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +2 -3
- package/lib/esm/duet-collapsible.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-button.entry.js +85 -0
- package/lib/esm/{duet-upload.entry.js → duet-editable-table_4.entry.js} +384 -31
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +58 -0
- package/lib/esm/duet-footer.entry.js +1 -1
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +1 -1
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +16 -6
- package/lib/esm/duet-input_2.entry.js +1 -1
- 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-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-select.entry.js +1 -1
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-tab_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 +96 -0
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-1fe0dcd0.js → focus-utils-aeb6ca93.js} +1 -1
- package/lib/esm/{index-84d97bd1.js → index-e8c7d36f.js} +8 -2
- package/lib/esm/loader.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-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 +2 -2
- package/lib/esm-es5/duet-collapsible.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table-button.entry.js +4 -0
- package/lib/esm-es5/duet-editable-table_4.entry.js +4 -0
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +4 -0
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +2 -2
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +1 -1
- package/lib/esm-es5/duet-progress.entry.js +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-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-tab_2.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +1 -1
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +4 -0
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/focus-utils-aeb6ca93.js +4 -0
- package/lib/esm-es5/{index-84d97bd1.js → index-e8c7d36f.js} +2 -2
- package/lib/esm-es5/loader.js +1 -1
- package/lib/html.html-data.json +4906 -0
- package/lib/types/components/duet-icon/icon-utils.d.ts +1 -1
- package/lib/types/components/duet-upload/duet-upload.d.ts +42 -18
- package/lib/types/components/duet-upload/{duet-upload-editable-item-error.d.ts → upload-editable-item-error.d.ts} +0 -0
- package/lib/types/components/duet-upload/{duet-upload-editable-item-inprogres.d.ts → upload-editable-item-inprogres.d.ts} +0 -0
- package/lib/types/components/duet-upload/{duet-upload-editable-item-success.d.ts → upload-editable-item-success.d.ts} +0 -0
- package/lib/types/components/duet-upload/{duet-upload-validators.d.ts → upload-validators.d.ts} +0 -0
- package/lib/types/components/{duet-upload → duet-upload-aria-status}/duet-upload-aria-status.d.ts +2 -2
- package/lib/types/components.d.ts +25 -25
- package/package.json +6 -5
- package/lib/cjs/duet-editable-table-button_3.cjs.entry.js +0 -232
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +0 -336
- package/lib/cjs/js-utils-33a9dbe3.js +0 -16
- package/lib/duet/p-10deead0.system.js +0 -4
- package/lib/duet/p-155ef581.system.entry.js +0 -4
- package/lib/duet/p-1797df7b.system.entry.js +0 -4
- package/lib/duet/p-28e02c08.entry.js +0 -4
- package/lib/duet/p-33c58756.entry.js +0 -4
- package/lib/duet/p-5ea0cd19.entry.js +0 -4
- package/lib/duet/p-81867417.system.js +0 -4
- package/lib/duet/p-b25d3769.js +0 -4
- package/lib/duet/p-de07c7d7.entry.js +0 -4
- package/lib/duet/p-dfe79666.system.entry.js +0 -4
- package/lib/duet/p-f0a4b68d.system.entry.js +0 -4
- package/lib/duet/p-f364eb96.entry.js +0 -4
- package/lib/esm/duet-editable-table-button_3.entry.js +0 -226
- package/lib/esm/duet-editable-table_3.entry.js +0 -330
- package/lib/esm/js-utils-b69f17df.js +0 -14
- package/lib/esm-es5/duet-editable-table-button_3.entry.js +0 -4
- package/lib/esm-es5/duet-editable-table_3.entry.js +0 -4
- package/lib/esm-es5/duet-upload.entry.js +0 -4
- package/lib/esm-es5/focus-utils-1fe0dcd0.js +0 -4
- package/lib/esm-es5/js-utils-b69f17df.js +0 -4
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
|
-
|
|
8
|
-
const index = require('./index-b724d698.js');
|
|
9
|
-
const jsUtils = require('./js-utils-33a9dbe3.js');
|
|
10
|
-
const languageUtils = require('./language-utils-aa282901.js');
|
|
11
|
-
const themeableComponent = require('./themeable-component-0c1be552.js');
|
|
12
|
-
const tokens_module = require('./tokens.module-6b2df1c2.js');
|
|
13
|
-
require('./string-utils-267e3dbb.js');
|
|
14
|
-
|
|
15
|
-
const duetEditableTableCss = "duet-editable-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-header tr .duet-editable-table-header-hidden{padding:0 !important;font-size:0;border-bottom:0}";
|
|
16
|
-
|
|
17
|
-
let DuetEditableTable = class {
|
|
18
|
-
constructor(hostRef) {
|
|
19
|
-
index.registerInstance(this, hostRef);
|
|
20
|
-
/**
|
|
21
|
-
* State() variables
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
this.tick = Date.now();
|
|
25
|
-
/**
|
|
26
|
-
* Map of items that contain list of things.
|
|
27
|
-
*/
|
|
28
|
-
this.items = new Map();
|
|
29
|
-
/**
|
|
30
|
-
* Array of internationalized defaults for the default groups labels.
|
|
31
|
-
*/
|
|
32
|
-
this.groupsLabelDefaults = {
|
|
33
|
-
fi: "Kaikki",
|
|
34
|
-
en: "All items",
|
|
35
|
-
sv: "Alla objekt",
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Array of internationalized defaults for the default action labels.
|
|
39
|
-
*/
|
|
40
|
-
this.actionLabelDefaults = {
|
|
41
|
-
fi: "Toiminnot",
|
|
42
|
-
en: "Actions",
|
|
43
|
-
sv: "Handlingar",
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
|
|
47
|
-
* @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
|
|
48
|
-
* @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
|
|
49
|
-
*/
|
|
50
|
-
this.groups = [
|
|
51
|
-
{ id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
|
|
52
|
-
];
|
|
53
|
-
/**
|
|
54
|
-
* Array of actions that are mapped via the map variable to the various groups defined in group.
|
|
55
|
-
* @default undefined
|
|
56
|
-
* @example [{
|
|
57
|
-
variation: "default",
|
|
58
|
-
icon: "action-edit-2",
|
|
59
|
-
id: "edit",
|
|
60
|
-
map: ["success"],
|
|
61
|
-
label: {
|
|
62
|
-
fi: " Label",
|
|
63
|
-
en: " Label",
|
|
64
|
-
sv: " Label",
|
|
65
|
-
}
|
|
66
|
-
}]
|
|
67
|
-
*/
|
|
68
|
-
this.actions = undefined;
|
|
69
|
-
/**
|
|
70
|
-
* Shows or hides the table labels.
|
|
71
|
-
*/
|
|
72
|
-
this.hideGroups = false;
|
|
73
|
-
/**
|
|
74
|
-
* Exposes the aria role for optimizing accessibility.
|
|
75
|
-
*/
|
|
76
|
-
this.accessibleRole = undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Private methods.
|
|
79
|
-
*/
|
|
80
|
-
this.kick = jsUtils.debounce(() => {
|
|
81
|
-
this.tick = Date.now();
|
|
82
|
-
}, 100); // will trigger re-render
|
|
83
|
-
this.filterMap = needle => {
|
|
84
|
-
if (needle === "all") {
|
|
85
|
-
return Array.from(this.items);
|
|
86
|
-
}
|
|
87
|
-
return Array.from(this.items).filter(item => needle === item[1].group);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Component lifecycle events.
|
|
92
|
-
*/
|
|
93
|
-
componentWillLoad() {
|
|
94
|
-
if (typeof this.groups === "string") {
|
|
95
|
-
this.internalGroupArray = languageUtils.sanitizeString(this.groups);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
this.internalGroupArray = this.groups;
|
|
99
|
-
}
|
|
100
|
-
if (typeof this.actions === "string") {
|
|
101
|
-
this.internalActionsArray = languageUtils.sanitizeString(this.actions);
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this.internalActionsArray = this.actions;
|
|
105
|
-
}
|
|
106
|
-
themeableComponent.inheritGlobalTheme(this);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Method to force an update of a tabular data array.
|
|
110
|
-
* when called the method will rerender the entire tabular structure.
|
|
111
|
-
*/
|
|
112
|
-
async updateTable(passedItems = undefined) {
|
|
113
|
-
this.items = new Map(passedItems || this.items);
|
|
114
|
-
this.kick();
|
|
115
|
-
}
|
|
116
|
-
render() {
|
|
117
|
-
return (index.h(index.Host, { class: {
|
|
118
|
-
"duet-theme-turva": this.theme === "turva",
|
|
119
|
-
} }, this.internalGroupArray.map(group => {
|
|
120
|
-
const currentGroup = this.filterMap(group.id);
|
|
121
|
-
if (!currentGroup.length) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
return (index.h("duet-table", { variation: "plain", breakpoint: "none", role: "", margin: this.hideGroups ? "none" : "auto" }, index.h("table", { class: "duet-editable-table", "aria-role": this.accessibleRole }, index.h("thead", { class: "duet-editable-table-header" }, index.h("tr", null, index.h("th", { class: {
|
|
125
|
-
"duet-editable-table-header-hidden": this.hideGroups,
|
|
126
|
-
} }, !this.hideGroups ? (languageUtils.getLocaleString(group.label)) : (index.h("duet-visually-hidden", null, languageUtils.getLocaleString(group.label)))), index.h("th", { class: {
|
|
127
|
-
"duet-editable-table-header-hidden": this.hideGroups,
|
|
128
|
-
} }, index.h("duet-visually-hidden", null, group.actionLabel
|
|
129
|
-
? languageUtils.getLocaleString(group.actionLabel)
|
|
130
|
-
: languageUtils.getLocaleString(this.actionLabelDefaults))))), index.h("tbody", null, currentGroup.map(dataAsArray => {
|
|
131
|
-
const [key, value] = dataAsArray;
|
|
132
|
-
return (index.h("duet-editable-table-item", { keyName: key, data: Object.assign({}, value), groupId: group.id, part: group.id, actions: this.internalActionsArray }));
|
|
133
|
-
})))));
|
|
134
|
-
})));
|
|
135
|
-
}
|
|
136
|
-
get element() { return index.getElement(this); }
|
|
137
|
-
};
|
|
138
|
-
DuetEditableTable.style = duetEditableTableCss;
|
|
139
|
-
|
|
140
|
-
//simple functional component that renders the data in the table
|
|
141
|
-
const TableData = ({ data, groupId }, _children) => {
|
|
142
|
-
if (typeof data === "string") {
|
|
143
|
-
return index.h("td", { innerHTML: data, class: "duet-editable-table-content", part: `${groupId}content` });
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
return (index.h("td", { class: "duet-editable-table-content", part: `${groupId}content` }, data));
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const duetEditableTableItemCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{display:table-row;height:32px}.duet-editable-table-content,.duet-editable-table-actions{height:32px;padding:12px 0;vertical-align:middle;break-word:break-all;border-bottom:1px solid #e1e3e6}.duet-editable-table-actions-items{display:flex;justify-content:flex-end}.duet-editable-table-actions-items duet-editable-table-button{padding-left:8px}.duet-editable-table .editable-item-small{font-size:0.75rem;font-weight:400}";
|
|
151
|
-
|
|
152
|
-
let DuetEditableTableItem = class {
|
|
153
|
-
constructor(hostRef) {
|
|
154
|
-
index.registerInstance(this, hostRef);
|
|
155
|
-
this.duetEditableItemAction = index.createEvent(this, "duetEditableItemAction", 7);
|
|
156
|
-
this.isHovering = false;
|
|
157
|
-
/**
|
|
158
|
-
* Theme of the empty state component.
|
|
159
|
-
*/
|
|
160
|
-
this.theme = "";
|
|
161
|
-
/**
|
|
162
|
-
* Actions that can be performed on the element
|
|
163
|
-
*/
|
|
164
|
-
this.actions = undefined;
|
|
165
|
-
/**
|
|
166
|
-
* GroupId used to pierce the shadowdom - gets concatenated with "content & actions" and used as part="groupIDcontent/actions" to pierce the content/Action item
|
|
167
|
-
* @internal
|
|
168
|
-
*/
|
|
169
|
-
this.groupId = "";
|
|
170
|
-
/**
|
|
171
|
-
* Key used to identify item, when running actions
|
|
172
|
-
*/
|
|
173
|
-
this.keyName = "";
|
|
174
|
-
/**
|
|
175
|
-
* Object of data itemsused to render the entire row
|
|
176
|
-
*/
|
|
177
|
-
this.data = undefined;
|
|
178
|
-
}
|
|
179
|
-
watchPropHandler(_newValue, _oldValue) {
|
|
180
|
-
// console.log("The new value of activated is: ", _newValue)
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
/**
|
|
184
|
-
* Component lifecycle events.
|
|
185
|
-
*/
|
|
186
|
-
componentWillLoad() {
|
|
187
|
-
themeableComponent.inheritGlobalTheme(this);
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
/**
|
|
191
|
-
* private functions
|
|
192
|
-
*/
|
|
193
|
-
/**
|
|
194
|
-
* render() function
|
|
195
|
-
* Always the last one in the class.
|
|
196
|
-
*/
|
|
197
|
-
render() {
|
|
198
|
-
return (index.h(index.Host, { role: "row" }, index.h(TableData, { data: this.data.item, groupId: this.groupId }), index.h("td", { class: "duet-editable-table-actions" }, index.h("div", { class: "duet-editable-table-actions-items", part: `${this.groupId}actions` }, this.actions.map(result => {
|
|
199
|
-
const { map = undefined } = result;
|
|
200
|
-
// if map has been specified, only show the current action if groupID matches the map array
|
|
201
|
-
if (map && !map.includes(this.groupId)) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
return (index.h("duet-editable-table-button", { keyName: this.keyName, group: this.data.group, uid: this.data.uid, actions: result, theme: this.theme }));
|
|
205
|
-
})))));
|
|
206
|
-
}
|
|
207
|
-
get el() { return index.getElement(this); }
|
|
208
|
-
static get watchers() { return {
|
|
209
|
-
"data": ["watchPropHandler"]
|
|
210
|
-
}; }
|
|
211
|
-
};
|
|
212
|
-
DuetEditableTableItem.style = duetEditableTableItemCss;
|
|
213
|
-
|
|
214
|
-
const duetTableCss = "duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-theme-turva table{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:#00294d}duet-table.duet-theme-turva td{color:#171c3a}duet-table th{font-weight:600;line-height:1.25;color:#657787;text-align:left}duet-table.duet-theme-turva th{color:#747475}duet-table tbody th{font-weight:600;color:#00294d}duet-table.duet-theme-turva tbody th{color:#171c3a}.duet-table-flattened table,.duet-table-flattened thead,.duet-table-flattened tbody,.duet-table-flattened tfoot,.duet-table-flattened th,.duet-table-flattened td,.duet-table-flattened tr{display:block}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:#657787;text-align:left}.duet-table-flattened td[data-heading]::before{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:#00294d;content:attr(data-heading)}.duet-table-flattened.duet-theme-turva td[data-heading]::before{color:#171c3a}.duet-table-sticky thead th{position:sticky;top:0;background:white}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:white}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid #e1e3e6}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:#e4e4e6}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid #e1e3e6}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:#e4e4e6}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid #e1e3e6}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:#e4e4e6}.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid #657787}.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:#444445}.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:#e1e3e6}.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:#e4e4e6}.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid #e1e3e6}.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:#e4e4e6}.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid #e1e3e6}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:#e4e4e6}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}";
|
|
215
|
-
|
|
216
|
-
// remove wrapping speech marks.
|
|
217
|
-
// media query tokens are wrapped in speech marks,
|
|
218
|
-
// which need to be removed before use with matchMedia.
|
|
219
|
-
const unwrap = (str) => str.substring(1, str.length - 1);
|
|
220
|
-
const breakpointToToken = {
|
|
221
|
-
none: "all",
|
|
222
|
-
"none-scrollable": "all",
|
|
223
|
-
small: unwrap(tokens_module.mediaQuerySmall),
|
|
224
|
-
medium: unwrap(tokens_module.mediaQueryMedium),
|
|
225
|
-
large: unwrap(tokens_module.mediaQueryLarge),
|
|
226
|
-
"x-large": unwrap(tokens_module.mediaQueryXLarge),
|
|
227
|
-
"xx-large": unwrap(tokens_module.mediaQueryXxLarge),
|
|
228
|
-
"xxx-large": unwrap(tokens_module.mediaQueryXxxLarge),
|
|
229
|
-
};
|
|
230
|
-
const stickyTopValues = {
|
|
231
|
-
none: 0,
|
|
232
|
-
"with-links": parseFloat(tokens_module.sizeNavigation) * 16,
|
|
233
|
-
"without-links": parseFloat(tokens_module.sizeHeader) * 16,
|
|
234
|
-
};
|
|
235
|
-
let DuetTable = class {
|
|
236
|
-
constructor(hostRef) {
|
|
237
|
-
index.registerInstance(this, hostRef);
|
|
238
|
-
/**
|
|
239
|
-
* Tracks whether the breakpoint is matched. This is set to true by default so that JavaScript disabled in SSR mode we get accessible table data first.
|
|
240
|
-
*/
|
|
241
|
-
this.matchesBreakpoint = true;
|
|
242
|
-
/**
|
|
243
|
-
* Controls the margin of the component.
|
|
244
|
-
*/
|
|
245
|
-
this.margin = "auto";
|
|
246
|
-
/**
|
|
247
|
-
* Style variation of the table.
|
|
248
|
-
*/
|
|
249
|
-
this.variation = "striped";
|
|
250
|
-
/**
|
|
251
|
-
* Controls whether the table has a sticky header.
|
|
252
|
-
* Sticky headers are not compatible with breakpoint="none-scrollable".
|
|
253
|
-
*/
|
|
254
|
-
this.sticky = false;
|
|
255
|
-
/**
|
|
256
|
-
* Adjust the distance from top of the viewport (in pixels) when the
|
|
257
|
-
* table header becomes sticky.
|
|
258
|
-
*/
|
|
259
|
-
this.stickyDistance = "with-links";
|
|
260
|
-
/**
|
|
261
|
-
* By default the table is responsive - it will be flattened at narrow viewport widths.
|
|
262
|
-
* This prop controls the breakpoint at which the table should be rendered as a _regular_ table.
|
|
263
|
-
* Set to "none" to disable the responsive functionality.
|
|
264
|
-
* Set to "none-scrollable" to disable responsive functionality _and_ allow horizontal scrolling -
|
|
265
|
-
* this is useful for comparison tables where it's important to maintain column and row layout.
|
|
266
|
-
*/
|
|
267
|
-
this.breakpoint = "small";
|
|
268
|
-
this.handleMediaQueryChange = (mq) => {
|
|
269
|
-
this.matchesBreakpoint = mq.matches;
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
connectedCallback() {
|
|
273
|
-
this.mq = matchMedia(breakpointToToken[this.breakpoint]);
|
|
274
|
-
this.mq.addListener(this.handleMediaQueryChange);
|
|
275
|
-
this.handleMediaQueryChange(this.mq);
|
|
276
|
-
this.observer = new MutationObserver(() => this.copyHeadingsToCells());
|
|
277
|
-
this.observer.observe(this.element, {
|
|
278
|
-
childList: true,
|
|
279
|
-
subtree: true,
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
componentWillLoad() {
|
|
283
|
-
themeableComponent.inheritGlobalTheme(this);
|
|
284
|
-
this.copyHeadingsToCells();
|
|
285
|
-
if (this.sticky && this.breakpoint === "none-scrollable") {
|
|
286
|
-
console.warn(`[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence`);
|
|
287
|
-
}
|
|
288
|
-
if (this.sticky) {
|
|
289
|
-
const stickyTop = stickyTopValues[this.stickyDistance];
|
|
290
|
-
const headingElements = this.element.querySelectorAll("thead th");
|
|
291
|
-
headingElements.forEach(th => (th.style.top = `${stickyTop}px`));
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
componentDidLoad() {
|
|
295
|
-
// this clears all pending mutations,
|
|
296
|
-
// that way we avoid dealing with any initial changes
|
|
297
|
-
// and only get genuine mutations as rows are added/removed
|
|
298
|
-
this.observer.takeRecords();
|
|
299
|
-
}
|
|
300
|
-
disconnectedCallback() {
|
|
301
|
-
this.observer.disconnect();
|
|
302
|
-
this.observer = null;
|
|
303
|
-
this.mq.removeListener(this.handleMediaQueryChange);
|
|
304
|
-
this.mq = null;
|
|
305
|
-
this.matchesBreakpoint = true;
|
|
306
|
-
}
|
|
307
|
-
copyHeadingsToCells() {
|
|
308
|
-
const headingElements = this.element.querySelectorAll("thead th");
|
|
309
|
-
const rowElements = this.element.querySelectorAll("tbody tr");
|
|
310
|
-
const headings = Array.from(headingElements).map(th => th.textContent.trim());
|
|
311
|
-
rowElements.forEach(tr => {
|
|
312
|
-
tr.querySelectorAll("td").forEach((td, i) => {
|
|
313
|
-
if (headings[i]) {
|
|
314
|
-
td.dataset.heading = headings[i];
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
render() {
|
|
320
|
-
return (index.h(index.Host, { class: {
|
|
321
|
-
[`duet-table-${this.variation}`]: true,
|
|
322
|
-
"duet-table-flattened": !this.matchesBreakpoint,
|
|
323
|
-
// sticky only valid when in regular table layout
|
|
324
|
-
"duet-table-sticky": this.matchesBreakpoint && this.sticky,
|
|
325
|
-
"duet-table-scrollable": this.breakpoint === "none-scrollable",
|
|
326
|
-
"duet-m-0": this.margin === "none",
|
|
327
|
-
"duet-theme-turva": this.theme === "turva",
|
|
328
|
-
} }, index.h("slot", null)));
|
|
329
|
-
}
|
|
330
|
-
get element() { return index.getElement(this); }
|
|
331
|
-
};
|
|
332
|
-
DuetTable.style = duetTableCss;
|
|
333
|
-
|
|
334
|
-
exports.duet_editable_table = DuetEditableTable;
|
|
335
|
-
exports.duet_editable_table_item = DuetEditableTableItem;
|
|
336
|
-
exports.duet_table = DuetTable;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
const debounce = (func, timeout = 50) => {
|
|
7
|
-
let timer;
|
|
8
|
-
return (...args) => {
|
|
9
|
-
clearTimeout(timer);
|
|
10
|
-
timer = setTimeout(() => {
|
|
11
|
-
func.apply(undefined, args);
|
|
12
|
-
}, timeout);
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.debounce = debounce;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
System.register(["./p-e12f2b8b.system.js","./p-ce0892e6.system.js"],(function(e,s){"use strict";var a,l,i,c,t,n;return{setters:[function(e){a=e.d;l=e.N;i=e.w;c=e.p;t=e.b},function(e){n=e.g}],execute:function(){var e=function(e){return"__sc_import_"+e.replace(/\s|-/g,"_")};var o=function(){var e=Array.from(a.querySelectorAll("script")).find((function(e){return new RegExp("/"+l+"(\\.esm)?\\.js($|\\?|#)").test(e.src)||e.getAttribute("data-stencil-namespace")===l}));var t=e["data-opts"]||{};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{t.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,i.location.href)).href;{d(t.resourcesUrl,e)}if(!i.customElements){return s.import("./p-c18a599e.system.js").then((function(){return t}))}}return c(t)};var d=function(s,c){var t=e(l);try{i[t]=new Function("w","return import(w);//"+Math.random())}catch(o){var n=new Map;i[t]=function(e){var l=new URL(e,s).href;var o=n.get(l);if(!o){var d=a.createElement("script");d.type="module";d.crossOrigin=c.crossOrigin;d.src=URL.createObjectURL(new Blob(["import * as m from '"+l+"'; window."+t+".m = m;"],{type:"application/javascript"}));o=new Promise((function(e){d.onload=function(){e(i[t].m);d.remove()}}));n.set(l,o);a.head.appendChild(d)}return o}}};o().then((function(e){n();return t(JSON.parse('[["p-155ef581.system",[[1,"duet-upload",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"external":[4],"hideButton":[4,"hide-upload-button"],"actions":[1],"uri":[1],"showLinks":[4,"show-links"],"caption":[1],"statusLabelDefaults":[1,"status-label-default"],"statusMessageLabel":[16],"buttonLabelDefaults":[1,"button-label-default"],"buttonLabel":[1,"button-label"],"accessibleButtonLabel":[1,"accessible-button-label"],"theme":[1025],"disabled":[516],"identifier":[1],"margin":[1],"required":[4],"groups":[1],"hideGroups":[4,"hide-table-labels"],"files":[1040],"valid":[1540],"labelDefaults":[1,"label-default"],"label":[1],"descriptionDefaults":[1,"description-default"],"description":[1],"fileListEmptyDefaults":[1,"list-empty-default"],"fileListEmpty":[1,"file-list-empty"],"error":[1],"name":[1],"maxBytes":[2,"max-bytes"],"maxBytesTotal":[2,"max-bytes-total"],"maxFiles":[2,"max-files"],"allowedExtensions":[1,"allowed-extensions"],"allowedMimetypes":[1,"allowed-mimetypes"],"multiple":[4],"limitSelection":[4,"limit-selection"],"value":[1025],"tick":[32],"setFocus":[64],"upload":[64],"getFiles":[64],"updateValue":[64]}]]],["p-d1c19f04.system",[[6,"duet-choice-group",{"direction":[1],"margin":[1],"theme":[1025],"error":[1],"name":[1],"label":[1],"labelHidden":[4,"label-hidden"],"caption":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"responsive":[4],"value":[1537],"disabled":[4]}],[6,"duet-choice",{"theme":[1025],"label":[1],"accessibleLabelInfoButtonDefaults":[1,"accessible-label-info-default"],"accessibleLabelInfoButton":[1,"accessible-label-info-button"],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"caption":[1],"value":[1537],"type":[513],"name":[1],"checked":[1540],"collapsible":[4],"margin":[1],"icon":[1],"expand":[4],"padding":[1],"identifier":[1],"groupDirection":[1,"group-direction"],"groupDisabled":[4,"group-disabled"],"groupResponsive":[4,"group-responsive"],"disabled":[516],"required":[4],"infoLabelDefaults":[1,"accessible-label-info-default"],"infoLabel":[1,"info-label"],"isHovering":[32],"isInfoOpen":[32],"isBlurred":[32],"setFocus":[64]},[[2,"blur","handleHostBlur"],[2,"keydown","handleHostKeyDown"],[2,"keyup","handleHostKeyUp"]]]]],["p-9dca5c22.system",[[1,"duet-hero",{"theme":[1025],"heading":[1],"preHeading":[1,"pre-heading"],"level":[1],"description":[1],"icon":[1],"iconSize":[1,"icon-size"],"iconRight":[4,"icon-right"],"categoryIcon":[1,"category-icon"],"categoryIconColor":[1,"category-icon-color"],"buttonLabel":[1,"button-label"],"language":[1025],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"buttonUrl":[1,"button-url"],"buttonId":[1,"button-id"],"buttonData":[16],"textCenter":[4,"text-center"],"leftAlign":[4,"left-align"],"image":[1],"variation":[1],"back":[8],"listItems":[8,"list-items"],"actions":[8],"processedListItems":[32],"processedActions":[32],"processedBack":[32]}]]],["p-aee24388.system",[[6,"duet-tab-group",{"theme":[1025],"variation":[1],"language":[1025],"labelDefaults":[1,"label-default"],"label":[1],"labelHidden":[4,"label-hidden"],"margin":[1],"padding":[1],"tabs":[32],"selected":[32],"openTab":[64],"refresh":[64]}],[6,"duet-tab",{"label":[513],"selected":[516]}]]],["p-387823af.system",[[2,"duet-date-picker",{"theme":[1025],"expand":[4],"name":[1],"identifier":[1],"label":[1],"caption":[1],"margin":[1],"language":[1],"placeholderDefaults":[1,"placeholder-default"],"placeholder":[1],"echoPlaceholder":[1540,"echo-placeholder"],"disabled":[516],"error":[1],"labelHidden":[4,"label-hidden"],"role":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"required":[4],"direction":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"value":[1537],"min":[1],"max":[1],"validity":[1040],"open":[32],"focusedDay":[32],"inputValue":[32],"setFocus":[64],"show":[64],"hide":[64]},[[4,"click","handleDocumentClick"]]]]],["p-67d9a9a9.system",[[2,"duet-number-input",{"language":[1025],"locale":[1],"unit":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleLiveDefaults":[1,"accessible-live-default"],"accessibleLive":[1,"accessible-live"],"accessibleLiveEnabled":[4,"accessible-live-enabled"],"accessibleAddDefaults":[1,"accessible-add-default"],"accessibleAdd":[1,"accessible-add"],"accessibleSubtractDefaults":[1,"accessible-subtract-defaults"],"accessibleSubtract":[1,"accessible-subtract"],"theme":[1025],"margin":[1],"expand":[4],"identifier":[1],"min":[2],"labelDefaults":[1,"label-default"],"label":[1],"labelHidden":[4,"label-hidden"],"max":[2],"name":[1],"error":[1],"tooltip":[1],"step":[2],"rounding":[4],"role":[1],"disabled":[516],"required":[4],"value":[1025],"focusedValue":[32],"setFocus":[64]}]]],["p-d744d188.system",[[6,"duet-radio-group",{"direction":[1],"margin":[1],"theme":[1025],"error":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"name":[1],"label":[1],"labelHidden":[4,"label-hidden"],"caption":[1],"responsive":[4],"value":[1537],"disabled":[4]}],[2,"duet-radio",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleIndex":[1,"accessible-index"],"margin":[1],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"theme":[1025],"disabled":[516],"required":[4],"blockEvents":[4,"block-events"],"identifier":[1],"label":[1],"name":[1],"role":[1],"groupDisabled":[4,"group-disabled"],"groupDirection":[1,"group-direction"],"groupResponsive":[4,"group-responsive"],"checked":[1540],"value":[1537],"setFocus":[64]}]]],["p-263bc9cd.system",[[1,"duet-card",{"accessibleLabel":[1,"accessible-label"],"heading":[1],"secondaryHeading":[1,"secondary-heading"],"variation":[1],"collapsible":[4],"open":[1540],"headingLevel":[1,"heading-level"],"icon":[1],"image":[1],"background":[1],"padding":[1],"margin":[1],"theme":[1025],"url":[1],"setFocus":[64]}]]],["p-8b5ca0e7.system",[[2,"duet-range-slider",{"theme":[1025],"margin":[1],"expand":[4],"identifier":[1],"name":[1],"required":[4],"disabled":[516],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"min":[2],"label":[1],"labelHidden":[4,"label-hidden"],"unit":[1],"max":[2],"step":[2],"locale":[1],"value":[1026],"debounce":[2],"setFocus":[64]}]]],["p-b32224fe.system",[[2,"duet-toggle",{"theme":[1025],"margin":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"label":[1],"required":[4],"disabled":[516],"checked":[1540],"value":[1537],"identifier":[1],"name":[1],"role":[1],"setFocus":[64]}]]],["p-8f826843.system",[[2,"duet-checkbox",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"margin":[1],"accessibleControls":[1,"accessible-controls"],"accessibleIndex":[1,"accessible-index"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"required":[4],"theme":[1025],"disabled":[516],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"role":[1],"checked":[1540],"value":[1537],"setFocus":[64]}]]],["p-237e47b4.system",[[1,"duet-layout",{"sticky":[4],"margin":[1],"stickyDistance":[1,"sticky-distance"],"center":[4],"tabs":[4],"middle":[4]}]]],["p-af41d894.system",[[1,"duet-divider",{"theme":[1025],"margin":[1]}],[1,"duet-spacer",{"size":[1],"direction":[1],"breakpoint":[1]}]]],["p-d4118b6e.system",[[1,"duet-visually-hidden"]]],["p-dfe79666.system",[[1,"duet-icon",{"theme":[1025],"icon":[1],"src":[1],"name":[1],"margin":[1],"responsive":[4],"color":[513],"background":[1],"size":[1],"outline":[1],"svgContent":[32]}]]],["p-a5b9c192.system",[[2,"duet-textarea",{"margin":[1],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleAutocomplete":[1,"accessible-autocomplete"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"theme":[1025],"expand":[4],"disabled":[516],"identifier":[1],"required":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"placeholder":[1],"caption":[1],"echoPlaceholder":[4,"echo-placeholder"],"maxlength":[2],"minlength":[2],"error":[1],"role":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"value":[1025],"disallowPattern":[1,"disallow-pattern"],"counter":[4],"counterLabel":[1,"counter-label"],"setFocus":[64]}]]],["p-6e6e76db.system",[[1,"duet-modal",{"language":[1025],"accessibleCloseLabelDefaults":[1,"accessible-close-label-default"],"accessibleCloseLabel":[1,"accessible-close-label"],"size":[1],"gutterSize":[1,"gutter-size"],"theme":[1025],"heading":[1],"headingLevel":[1,"heading-level"],"icon":[1],"color":[1],"active":[1540],"open":[32],"show":[64],"hide":[64]},[[8,"keyup","handleKeyUp"]]]]],["p-4b6ebe40.system",[[1,"duet-cookie-consent",{"accessibleLabel":[1,"accessible-label"],"theme":[1025]}]]],["p-374fb7e6.system",[[6,"duet-step",{"theme":[1025],"heading":[1],"headingLevel":[1,"heading-level"],"stepIndex":[2,"step-index"],"state":[1],"roundedTop":[4,"rounded-top"],"roundedBottom":[4,"rounded-bottom"],"setFocus":[64]}],[1,"duet-stepper",{"theme":[1025],"accessibleLive":[1,"accessible-live"],"margin":[1],"backDisabled":[4,"back-disabled"],"selected":[514]},[[0,"duetStepClick","onDuetStepClick"]]]]],["p-b4e87f02.system",[[1,"duet-footer",{"theme":[1025],"variation":[1],"margin":[1],"logoHref":[1,"logo-href"],"language":[1025],"items":[8],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"menu":[8],"processedItems":[32],"processedMenu":[32]}]]],["p-2443bdca.system",[[1,"duet-tray",{"language":[1025],"accessibleCloseLabelDefaults":[1,"accessible-close-label-default"],"accessibleCloseLabel":[1,"accessible-close-label"],"accessibleOpenLabelDefaults":[1,"accessible-open-label-default"],"accessibleOpenLabel":[1,"accessible-open-label"],"theme":[1025],"active":[516],"autoHide":[4,"auto-hide"],"responsive":[4],"expanded":[32],"hiddenState":[32]},[[9,"scroll","getFrame"],[16,"click","handleBodyClick"]]]]],["p-6cc3be76.system",[[1,"duet-collapsible",{"theme":[1025],"heading":[1],"headingWeight":[1,"heading-weight"],"headingSize":[1,"heading-size"],"headingLevel":[1,"heading-level"],"margin":[1],"open":[1540],"setFocus":[64]}]]],["p-4a87e9ab.system",[[2,"duet-select",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleDescribedBy":[1,"accessible-described-by"],"margin":[1],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"error":[1],"expand":[4],"value":[1537],"theme":[1025],"labelHidden":[4,"label-hidden"],"identifier":[1],"name":[1],"placeholder":[1],"caption":[1],"echoPlaceholder":[4,"echo-placeholder"],"items":[1],"disabled":[516],"required":[4],"label":[1],"role":[1],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"processedItems":[32],"setFocus":[64]}]]],["p-751542a0.system",[[1,"duet-button",{"accessibleLabel":[1,"accessible-label"],"accessibleControls":[1,"accessible-controls"],"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleExpanded":[4,"accessible-expanded"],"accessiblePressed":[4,"accessible-pressed"],"loading":[4],"variation":[1],"negative":[4],"theme":[1025],"margin":[1],"padding":[1],"wrapping":[1],"expand":[4],"fixed":[4],"disabled":[516],"name":[1],"value":[1],"identifier":[1],"submit":[516],"external":[4],"language":[1],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"icon":[1],"color":[1],"iconRight":[4,"icon-right"],"iconSize":[1,"icon-size"],"size":[1],"iconOnly":[4,"icon-only"],"url":[513],"setFocus":[64]}],[1,"duet-spinner",{"accessibleLabel":[1,"accessible-label"],"color":[1],"size":[1],"theme":[1025]}]]],["p-27d80cef.system",[[1,"duet-alert",{"theme":[1025],"accessibleLabelDefaults":[1,"accessible-label-default"],"accessibleLabel":[1,"accessible-label"],"announcements":[4],"icon":[1],"autoDismiss":[2,"auto-dismiss"],"margin":[1],"padding":[1],"variation":[1],"dismissible":[4],"isDismissed":[32],"timeoutID":[32]}]]],["p-58750bae.system",[[1,"duet-empty-state",{"theme":[1025],"icon":[1],"size":[1]}]]],["p-7e8d5bb9.system",[[1,"duet-notification-drawer",{"icon":[1],"label":[1],"language":[1],"accessibleLabelNotificationsDefaults":[1,"accessible-label-notification-default"],"accessibleLabelNotifications":[1,"accessible-label-notifications"],"badge":[4],"theme":[1025],"direction":[1],"isOpen":[32],"hasNotifications":[32],"setFocus":[64],"open":[64],"close":[64]},[[6,"focus","handleClickFocusOutside"],[6,"click","handleClickFocusOutside"]]],[1,"duet-notification",{"language":[1],"accessibleLabelUnreadDefaults":[16],"accessibleLabelUnread":[1,"accessible-label-unread"],"url":[1],"date":[1],"highlight":[4],"external":[4],"theme":[1025],"setFocus":[64]}]]],["p-7fee0d23.system",[[0,"duet-progress",{"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleLabel":[1,"accessible-label"],"accessibleLabelUploadDefaults":[1,"accessible-label-upload-defaults"],"accessibleLabelUpload":[1,"accessible-label-upload"],"progress":[1538],"caption":[1],"height":[1],"theme":[1025]}]]],["p-48d1eb1f.system",[[1,"duet-badge",{"theme":[1025],"variation":[1],"margin":[1]}]]],["p-7368b14e.system",[[1,"duet-header",{"theme":[1025],"language":[1025],"accessibleI18nLabelsDefaults":[1,"accessible-labels-default"],"accessibleI18nLabels":[16],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"accessibleLabelDefaults":[1,"accessible-label-default"],"accessibleLabel":[1,"accessible-label"],"user":[8],"logoHref":[1,"logo-href"],"currentHref":[1025,"current-href"],"skipToId":[1,"skip-to-id"],"items":[8],"region":[1],"session":[8],"back":[8],"contact":[1],"contactItems":[8,"contact-items"],"languageItems":[8,"language-items"],"isContactOpen":[32],"isLanguageOpen":[32],"isSlideOutOpen":[32],"processedItems":[32],"processedLanguageItems":[32],"processedContactItems":[32],"processedSession":[32],"processedUser":[32],"processedBack":[32],"closeMenus":[64],"setFocus":[64]},[[8,"keyup","handleKeyUp"],[8,"keydown","handleKeyDown"],[4,"focus","handleDocumentClick"],[4,"click","handleDocumentClick"]]],[1,"duet-logo",{"theme":[1025],"margin":[1],"inverse":[4],"size":[1],"href":[1537],"language":[1537],"setFocus":[64]}]]],["p-1a08fc22.system",[[2,"duet-grid",{"responsive":[4],"breakpoint":[1],"direction":[1],"alignment":[1],"distribution":[1],"mobile":[1],"distributeFormElement":[32]}],[2,"duet-grid-item",{"fill":[4],"maxWidth":[1,"max-width"],"minWidth":[1,"min-width"],"theme":[1025],"margin":[1],"responsive":[4],"breakpoint":[1]}]]],["p-d3a3c3c7.system",[[1,"duet-list",{"theme":[1025],"margin":[1],"padding":[1],"mobile":[1],"breakpoint":[1],"variation":[1],"labelWidth":[1,"label-width"]}],[1,"duet-list-item"]]],["p-f0a4b68d.system",[[1,"duet-upload-aria-status",{"statusMessageLabel":[16],"accessibleAriaLive":[1,"accessible-aria-live"],"valid":[2],"total":[2],"invalid":[2],"inprogress":[2],"statusMessage":[32]}],[2,"duet-editable-table-button",{"theme":[1025],"actions":[16],"uid":[1],"group":[1],"keyName":[1,"key-name"],"isHovering":[32]}],[1,"duet-fieldset",{"theme":[1025],"margin":[1],"caption":[1],"label":[1],"error":[1],"labelHidden":[4,"label-hidden"],"hasTooltip":[32]}]]],["p-1797df7b.system",[[1,"duet-editable-table",{"items":[1040],"groupsLabelDefaults":[16],"actionLabelDefaults":[16],"groups":[1],"actions":[1],"hideGroups":[4,"hide-table-labels"],"accessibleRole":[1,"accessible-role"],"theme":[1025],"tick":[32],"updateTable":[64]}],[1,"duet-editable-table-item",{"theme":[1025],"actions":[16],"groupId":[1,"group-id"],"keyName":[1,"key-name"],"data":[1040],"isHovering":[32]}],[4,"duet-table",{"theme":[1025],"margin":[1],"variation":[1],"sticky":[4],"stickyDistance":[1,"sticky-distance"],"breakpoint":[1],"matchesBreakpoint":[32]}]]],["p-4e28da18.system",[[1,"duet-tooltip",{"theme":[1025],"language":[1025],"accessibleLabelDefault":[1,"accessible-label-default"],"accessibleLabel":[1,"accessible-label"],"accessibleInputLabel":[1,"accessible-input-label"],"accessibleCloseLabelDefault":[1,"accessible-close-label-default"],"accessibleCloseLabel":[1,"accessible-close-label"],"label":[1],"breakpoint":[1],"direction":[1],"positionVertical":[513,"position-vertical"],"positionHorizontal":[513,"position-horizontal"],"active":[1540],"openDown":[32]},[[9,"scroll","onScroll"],[4,"click","handleDocumentClick"]]]]],["p-aef1b720.system",[[17,"duet-link",{"accessibleLabel":[1,"accessible-label"],"language":[1025],"accessibleLabelExternalDefaults":[1,"accessible-label-external-default"],"accessibleLabelExternal":[1,"accessible-label-external"],"identifier":[1],"theme":[1025],"url":[513],"external":[4],"setFocus":[64]}],[1,"duet-heading",{"level":[513],"margin":[1],"visualLevel":[1,"visual-level"],"border":[8],"weight":[1],"color":[1],"theme":[1025],"hyphenate":[4]}],[1,"duet-paragraph",{"theme":[1025],"margin":[1],"size":[1],"weight":[1],"variation":[1],"color":[1]}],[1,"duet-caption",{"theme":[1025],"margin":[1],"selected":[4],"size":[1]}]]],["p-63d5bf73.system",[[6,"duet-input",{"accessibleActiveDescendant":[1,"accessible-active-descendant"],"accessibleAutocomplete":[1,"accessible-autocomplete"],"accessibleControls":[1,"accessible-controls"],"accessibleOwns":[1,"accessible-owns"],"accessibleDescribedBy":[1,"accessible-described-by"],"debounce":[2],"caption":[1],"echoPlaceholder":[4,"echo-placeholder"],"theme":[1025],"expand":[4],"disabled":[516],"identifier":[1],"margin":[1],"required":[4],"type":[1],"label":[1],"error":[1],"labelHidden":[4,"label-hidden"],"numericKeyboard":[4,"numeric-keyboard"],"name":[1],"pattern":[1],"maxlength":[2],"minlength":[2],"placeholder":[1],"component":[1],"role":[1],"icon":[1],"autoComplete":[1,"auto-complete"],"disallowPattern":[1,"disallow-pattern"],"value":[1025],"tooltip":[1],"tooltipDirection":[1,"tooltip-direction"],"setFocus":[64]}],[6,"duet-label",{"theme":[1025],"for":[1],"margin":[1],"size":[1]}]]]]'),e)}))}}}));
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,a,i){function s(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,r){function n(e){try{l(i.next(e))}catch(t){r(t)}}function o(e){try{l(i["throw"](e))}catch(t){r(t)}}function l(e){e.done?a(e.value):s(e.value).then(n,o)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,n;return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(e){return function(t){return l([e,t])}}function l(n){if(i)throw new TypeError("Generator is already executing.");while(a)try{if(i=1,s&&(r=n[0]&2?s["return"]:n[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;if(s=0,r)n=[n[0]&2,r.value];switch(n[0]){case 0:case 1:r=n;break;case 4:a.label++;return{value:n[1],done:false};case 5:a.label++;s=n[1];n=[0];continue;case 7:n=a.ops.pop();a.trys.pop();continue;default:if(!(r=a.trys,r=r.length>0&&r[r.length-1])&&(n[0]===6||n[0]===2)){a=0;continue}if(n[0]===3&&(!r||n[1]>r[0]&&n[1]<r[3])){a.label=n[1];break}if(n[0]===6&&a.label<r[1]){a.label=r[1];r=n;break}if(r&&a.label<r[2]){a.label=r[2];a.ops.push(n);break}if(r[2])a.ops.pop();a.trys.pop();continue}n=t.call(e,a)}catch(o){n=[6,o];s=0}finally{i=r=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* Built with Duet Design System
|
|
4
|
-
*/System.register(["./p-e12f2b8b.system.js","./p-5f6bd5db.system.js","./p-81867417.system.js","./p-70fafc98.system.js","./p-efaa0c04.system.js","./p-9a945278.system.js"],(function(e){"use strict";var t,a,i,s,r,n,o,l,u;return{setters:[function(e){t=e.h;a=e.r;i=e.c;s=e.H;r=e.g},function(e){n=e.c},function(e){o=e.d},function(e){l=e.g},function(e){u=e.i},function(){}],execute:function(){var d=[{type:"default",system_message:"unknown error",message:{fi:"Tapahtui tuntematon virhe, ole hyvä ja yritä uudelleen.",sv:"Ett okänt fel uppstod, försök igen.",en:"An unknown error occured, please try again."}},{type:"400",system_message:"Bad Request: The server could not understand the request due to invalid syntax.",message:{fi:"Tiedostoa ei hyväksytty.",sv:"Servern avvisade din fil.",en:"The server rejected your file."}},{type:"401",system_message:"Not Authenticated: The client must authenticate itself to get the requested response...",message:{fi:"Vain kirjautunut käyttäjä voi lähettää tiedostoja.",sv:"Du måste vara inloggad för att ladda upp filer.",en:"You need to be logged in to upload files."}},{type:"403",system_message:"No Access: The client does not have access rights to the content.",message:{fi:"Ei oikeuksia lähettää tiedostoja.",sv:"Du har inte rätt åtkomsträttigheter för att ladda upp filer.",en:"You do not have the correct access rights to upload files."}},{type:"413",system_message:"Payload too large",message:{fi:"Tiedosto oli liian vastaanotettavaksi.",sv:"Filen var för stor för servern att hantera.",en:"The file was to large for the server to handle."}},{type:"415",system_message:"Unsupported media type",message:{fi:"Tiedoston tyyppi oli väärä.",sv:"Servern avvisade filen eftersom den hade fel typ.",en:"The server rejected the file because it had the wrong type."}},{type:"429",system_message:"Too many request from same address",message:{fi:"Liian monta yritystä, ole hyvä ja yritä myöhemmin uudelleen.",sv:"Servern har fått många förfrågningar från dig, försök igen senare.",en:"The server has received to many request from you, please try again later."}},{type:"500",system_message:"Internal Server Error",message:{fi:"Palvelin ilmoitti tuntemattomasta virheestä ja lataus epäonnistui.",sv:"Servern rapporterade ett okänt fel och uppladdningen misslyckades.",en:"The server reported an unknown error and the upload failed."}},{type:"duet-upload-100",system_message:"File extension not allowed",message:{fi:"Tiedoston tyyppi ei ole sallittu.",sv:"Du kan inte ladda upp filer av den type.",en:"You cannot upload files with that extension."}},{type:"duet-upload-001",system_message:"File transfer failed",message:{fi:"Tiedoston lähetys keskeytyi, ole hyvä ja yritä uudelleen.",sv:"Din anslutning till servern avbröts, försök igen.",en:"Your connection to the server was interrupted, try again."}},{type:"duet-upload-101",system_message:"File mimetype not allowed",message:{fi:"Tiedoston tyyppi ei ole sallittu.",sv:"Du kan inte ladda upp filer av den typ.",en:"You cannot upload files of that type."}},{type:"duet-upload-201",system_message:"File is too large",message:{fi:"Tiedosto on liian iso.",sv:"Filen är större än tillåtet.",en:"The file is larger than permitted."}},{type:"duet-upload-202",system_message:"The combined size of all files is too large",message:{fi:"Tiedostojen yhteenlaskettu koko on liian iso.",sv:"Du har nått den maximala kombinerade filstorleken.",en:"You have reached the maximum combined filesize."}},{type:"duet-upload-301",system_message:"The maximum file limit has been reached",message:{fi:"Liitteiden maksimimäärä saavutettu.",sv:"Maximalt antal bilagor har uppnåtts.",en:"Maximum number of attachments reached."}}];var f=function(e){var t={type:undefined,system_message:undefined,message:undefined};t=d.filter((function(t){return t.type==e}))[0];if(!t){t=d.filter((function(e){return e.type==="default"}))[0]}return t};var p=function(e){var t=f(e);var a=l(t.message);if(a===""||!a){return t.system_message}else{return a}};var h=function(e){var a=e.data;var i=a.item,s=a.error;var r=i.name;var n=s.type;return t("span",{class:"duet-upload-item-error",role:"status"},t("duet-paragraph",{class:"duet-upload-item-name",color:"danger",margin:"none",weight:"semi-bold"},t("duet-icon",{margin:"none",size:"xx-small",name:"messaging-attachment"})," ",r),t("duet-paragraph",{class:"duet-upload-item-error-label",size:"small",margin:"none",color:"danger"},p(n)))};var c=function(e){var a=e.progress,i=e.name;return t("span",null,t("duet-paragraph",{color:"secondary",margin:"none",size:"small"},i),t("duet-spacer",{size:"xx-small"}),t("duet-progress",{progress:Math.ceil(a),"aria-hidden":true}))};var m=function(e,t){if(t===void 0){t=2}if(e===0){return"0 Bytes"}var a=1024;var i=t<0?0:t;var s=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];var r=Math.floor(Math.log(e)/Math.log(a));return parseFloat((e/Math.pow(a,r)).toFixed(i))+" "+s[r]};var g=function(e){var a=e.data,i=e.showLinks;var s=a.item,r=a.size,n=a.uploaded,o=a.url,l=a.meta;var u=s.name;var d=t("span",{class:"duet-upload-item-name"},t("duet-icon",{margin:"none",size:"xx-small",name:"messaging-attachment"}),t("duet-spacer",{size:"xx-small",direction:"horizontal"}),u);var f=t("span",{class:"duet-upload-item-size",style:{fontSize:"14px",fontWeight:"400"}},"(",m(r),")");var p=n&&o&&i?t("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},t("duet-link",{url:o,external:true},d),t("duet-spacer",{size:"xx-small",direction:"horizontal"}),f):t("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},d,t("duet-spacer",{size:"xx-small",direction:"horizontal"}),f);var h=l&&l.badges?t("span",null,t("duet-spacer",{size:"xx-small"}),l.badges.map((function(e){return t("duet-badge",{color:"primary"},e)}))):undefined;return t("span",{class:"duet-upload-item-success"},t("div",null,p),h)};var v=function(e,t){if(!t){return true}var a=e.split(".");var i=t.split(",");var s=a[a.length-1];return i.includes(s)};var y=function(e,t){if(!t||!e){return true}var a=t.split(",");var i=false;a.forEach((function(t){var a=t.split("/");var s=e.split("/");if(a[0]===s[0]&&(a[1]===s[1]||a[1]==="*")){i=true}}));return i};var b=function(e,t){if(!t||!e){return true}return t>=e};var x=function(e,t){var a=t.allowedMimetypes,i=t.allowedExtensions,s=t.maxBytes;var r=false;var n=f("default");if(e){var o=e.name,u=e.type,d=e.size;var p=y(u,a);var h=v(o,i);var c=b(d,s);if(!p){n=f("duet-upload-101")}if(!h){n=f("duet-upload-100")}if(!c){n=f("duet-upload-201")}r=p&&h&&c}else{r=false}return{valid:r,errorMessage:r?undefined:l(n.message),errorSystem:r?undefined:n.system_message,errorType:r?undefined:n.type}};var k=function(e,t){var a=0;if(t){e.forEach((function(e){if(e.valid&&e.size){a+=e.size}}));if(a<t){return true}}return false};var w=function(e,t){var a=0;if(t){e.forEach((function(e){if(e.valid){a++}}));if(a>t){return true}}return false};var D=function(e){var t=e.payload,a=e.options,i=e.onFailure,s=e.onSuccess,r=e.onProgress;var n=a.type,o=n===void 0?"POST":n,l=a.xhr,u=a.uri,d=a.argument,f=d===void 0?null:d,p=a.headers,h=p===void 0?null:p;l.open(o,""+u+(f||""),true);var c=t.data,m=t.name;if(h){Object.keys(h).forEach((function(e){l.setRequestHeader(e,h[e])}))}if(o==="POST"){l.onreadystatechange=function(){if(l.readyState===XMLHttpRequest.DONE&&l.status>=200&&l.status<300){s(l,m,l.status)}if(l.readyState===XMLHttpRequest.DONE&&l.status>=300&&l.status<999){i(l,m,l.status)}};r(m)}l.send(c);return l};var M="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}::slotted([slot=header]){margin-bottom:16px}::slotted([slot=fileheader]){margin:16px 0 0 0}::slotted([slot=filefooter]){margin-top:16px}.duet-upload{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-upload-item-size{font-size:0.75rem;font-weight:400}.duet-upload-filelist{margin-bottom:25px}.duet-upload-filelist-empty{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:#f5f8fa}";var E=e("duet_upload",function(){function e(e){var s=this;a(this,e);this.duetChange=i(this,"duetChange",3);this.duetBlur=i(this,"duetBlur",7);this.duetFocus=i(this,"duetFocus",7);this.duetDone=i(this,"duetDone",3);this.duetState=i(this,"duetState",3);this.duetDelete=i(this,"duetDelete",3);this.duetCancel=i(this,"duetCancel",3);this.duetProgress=i(this,"duetProgress",3);this.duetUpload=i(this,"duetUpload",3);this.buttonId=n("DuetButton");this.labelId=n("DuetLabel");this.uploadId=n("DuetUpload");this.editableTableId=n("DuetEditableTable");this.filesInProgress=new Map;this.fileMaxReached=false;this.bytesMaxReached=false;this.DefaultGroups={inprogress:"inprogress",success:"success",failure:"failure"};this.tick=Date.now();this.external=false;this.hideButton=false;this.actions=[{icon:"action-delete",color:"color-danger",color_hover:"category-home",id:"delete",map:["success","failure"],label:{fi:"Poista tiedosto",en:"Poista tiedosto",sv:"Ta bort filen"}},{icon:"navigation-close",color:"primary",color_hover:"category-home",id:"cancel",map:["inprogress"],label:{fi:"Keskeytä lähetys",en:"Cancel the upload",sv:"Stop överföringen"}}];this.showLinks=false;this.statusLabelDefaults={fi:{inProgress:"Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",inProgressWithErrors:"Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",done:"Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",doneWithErrors:"Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",files:"tiedostot",file:"tiedosto"},sv:{inProgress:"Adding {filesUploaded} of {filesTotal}",inProgressWithErrors:"Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",done:"Alla {filesTotal} har lagts till",doneWithErrors:"Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",files:"filer",file:"fil"},en:{inProgress:"Adding {filesUploaded} of {filesTotal}",inProgressWithErrors:"Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",done:"All {filesTotal} added successfully",doneWithErrors:"Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",files:"tiedostoa",file:"tiedosto"}};this.statusMessageLabel=l(this.statusLabelDefaults);this.buttonLabelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add an attachment"};this.buttonLabel=l(this.buttonLabelDefaults);this.accessibleButtonLabel=undefined;this.theme="";this.disabled=false;this.margin="auto";this.required=false;this.hideGroups=false;this.files=new Map;this.valid=!this.required;this.labelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add attachments"};this.label=l(this.labelDefaults);this.descriptionDefaults={fi:"Voit liittää {filetypes}-muotoisia tiedostoja sekä yleisimpiä videotiedostoja. Voit lähettää {maxbytes} verran tiedostoja yhdellä kertaa, ja lisätä enintään {maxfiles} liitettä kerrallaan.",sv:"Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer åt gången och lägga till upp till {maxfiles} bilagor åt gången.",en:"You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time."};this.description=l(this.descriptionDefaults);this.fileListEmptyDefaults={fi:"Ei vielä lisättyjä tiedostoja.",sv:"Inga filer har lagts till ännu.",en:"No files added yet."};this.fileListEmpty=l(this.fileListEmptyDefaults);this.error="";this.maxBytes=2e8;this.maxBytesTotal=undefined;this.maxFiles=99;this.allowedExtensions="all";this.allowedMimetypes="*";this.multiple=true;this.limitSelection=false;this.listenForActionEvents=function(){s.element.addEventListener("duetEditableItemAction",(function(e){var t=e.detail;var a=t.action,i=t.keyName,r=t.originalEvent;switch(a){case"delete":s.onDelete(i,r);break;case"cancel":s.onCancel(i,r);break}}))};this.verifyValidity=function(){var e=s.getFilesAsArray(),t=e.invalid,a=e.valid;var i=s.valid;s.valid=t.length===0&&a.length!==0;if(s.valid!==i){s.duetState.emit({originalEvent:undefined,data:{valid:s.valid,from:"componentWillRender"},component:"duet-upload"})}};this.getGroupFromItemData=function(e){if(e.valid&&e.progress===100){if(e.group){return e.group}return s.DefaultGroups.success}else if(e.progress>0&&e.progress!==100){return s.DefaultGroups.inprogress}else if(!e.valid){return s.DefaultGroups.failure}else if(e.group){return e.group}else{return"none"}};this.getItemHTMLFromItemData=function(e,a){if(a===s.DefaultGroups.success){return t(g,{data:e,showLinks:s.showLinks})}else if(a===s.DefaultGroups.inprogress){return t(c,{progress:e.progress,name:e.item.name})}else if(a===s.DefaultGroups.failure){return t(h,{data:e})}else if(e.group){return e.html}else{return"none"}};this.convertToDuetEditableTableItems=function(){var e=new Map;s.files.forEach((function(t,a,i){var r=s.getGroupFromItemData(t);var n=s.getItemHTMLFromItemData(t,r);e.set(a,{uid:t.uid,item:n,group:r})}));return e};this.kick=o((function(){s.tick=Date.now()}),30);this.genHashName=function(){return Date.now().toString(36)+Math.random()};this.updateValueInMap=function(e,t,a,i){if(i===void 0){i=true}var r=s.files.get(e);r[t]=a;s.files.set(e,r);if(i){s.kick()}};this.updateProgress=function(e,t){console.log(s.filesInProgress.size);var a=function(a){s.updateValueInMap(t,"progress",a);s.onProgress(t,a,e)};if(e.lengthComputable){var i=e.loaded/e.total*100;a(i)}else{console.log("cant read progress")}};this.trackProgress=function(e,t){if(t===void 0){t=false}if(t){s.filesInProgress.delete(e)}else{s.filesInProgress.set(e,"inprogress")}if(s.filesInProgress.size===0){s.onDone()}};this.getFilesAsArray=function(){var e=[];var t=[];s.files.forEach((function(a){if(a.valid&&!a.deleted){e.push(a)}else if(!a.valid&&!a.deleted){t.push(a)}}));return{valid:e,invalid:t}};this.resetFormFields=function(){s.nativeInput.value=""};this.startUpload=function(e,t){if(t===void 0){t=undefined}return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(a){switch(a.label){case 0:return[4,this.setFocus()];case 1:a.sent();this.metaData=t;this.nativeInput.click();this.onUpload(e,t);e.stopPropagation();e.preventDefault();return[2]}}))}))};this.transferComplete=function(e){s.updateValueInMap(e,"progress",100,false);s.trackProgress(e,true)};this.transferDone=function(e,t,a){s.updateValueInMap(t,"status",a,false);s.updateValueInMap(t,"uploaded",true,false);try{var i=JSON.parse(e.response);s.updateValueInMap(t,"url",i.url)}catch(r){s.updateValueInMap(t,"url",null);console.error("Server did not respond with expected response {url: string}")}return};this.transferDoneWithFailure=function(e,t,a){try{var i=JSON.parse(e.response).error;s.updateValueInMap(t,"error",{message:i.message,type:i.type},false)}catch(r){console.error("Server did not respond with expected response error:{message: string, type: int}");s.updateValueInMap(t,"error",{type:a},false)}s.updateValueInMap(t,"valid",false,true)};this.transferFailed=function(e){s.updateValueInMap(e,"error",f("duet-upload-001"))};this.transferCanceled=function(e){s.files.delete(e);s.validateTotals(e);s.kick()};this.validateTotals=function(e){var t=k(s.files,s.maxBytesTotal);var a=w(s.files,s.maxFiles);if(t&&e){s.updateValueInMap(e,"error",f("duet-upload-202"),false)}if(a&&e){s.updateValueInMap(e,"error",f("duet-upload-301"),false)}s.bytesMaxReached=t;s.fileMaxReached=a;return{bytesMaxReached:t,fileMaxReached:a}};this.onDelete=function(e,t){var a=s.files.get(e);s.files.delete(e);s.validateTotals();s.kick();s.duetDelete.emit({originalEvent:t,data:{deletion:a},component:"duet-upload"});if(!s.external){s.makeXHRDeleteRequest(a)}s.resetFormFields()};this.onCancel=function(e,t){var a=s.files.get(e);s.files.delete(e);if(!s.external){var i=a.xhr;i.abort()}else{s.kick()}s.resetFormFields();s.duetCancel.emit({originalEvent:t,data:{cancelled:a},component:"duet-upload"})};this.onUpload=function(e,t){s.duetUpload.emit({originalEvent:e,metaData:t,component:"duet-upload"})};this.onBlur=function(e){s.duetBlur.emit({originalEvent:e,component:"duet-upload"})};this.onProgress=function(e,t,a){s.duetChange.emit({originalEvent:a,data:{key:e,percentComplete:t},component:"duet-upload"})};this.onFocus=function(e){s.duetFocus.emit({originalEvent:e,component:"duet-upload"})};this.onDone=function(){s.duetDone.emit({component:"duet-upload",data:{files:s.files}})}}e.prototype.watchValidHandler=function(e,t){if(e!==t){this.kick()}};e.prototype.componentWillLoad=function(){u(this);this.listenForActionEvents()};e.prototype.componentWillRender=function(){this.verifyValidity()};e.prototype.makeXHRPostRequest=function(e){var t=this;var a=new XMLHttpRequest;var i=e.get("name");a.upload.addEventListener("progress",(function(e){t.updateProgress(e,i)}));a.upload.addEventListener("load",(function(){t.transferComplete(i)}));a.upload.addEventListener("error",(function(){t.transferFailed(i)}));a.upload.addEventListener("abort",(function(){t.transferCanceled(i)}));return D({payload:{data:e,name:i},options:{type:"POST",uri:this.uri,xhr:a,argument:null,headers:null},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress})};e.prototype.makeXHRDeleteRequest=function(e){var t=e.uid,a=e.item;var i=new XMLHttpRequest;return D({payload:{data:null,name:name},options:{type:"DELETE",xhr:i,uri:this.uri,arguments:"?key="+t+"&name="+a.name,headers:{"x-fileuid":t,"x-filename":a.name}},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress})};e.prototype.onChange=function(e){return __awaiter(this,void 0,void 0,(function(){var t,a,i,s,r,n,o,l,u,d,f,p,h,c,m,g,v,y;return __generator(this,(function(b){switch(b.label){case 0:a=Array.from((t=this.nativeInput)===null||t===void 0?void 0:t.files);if(!a)return[3,9];i=0,s=a;b.label=1;case 1:if(!(i<s.length))return[3,9];r=s[i];n=x(r,{maxBytes:this.maxBytes,allowedExtensions:this.allowedExtensions,allowedMimetypes:this.allowedMimetypes}),o=n.valid,l=n.errorMessage,u=n.errorType,d=n.errorSystem;f=this.genHashName();p={uid:f,item:r,size:r.size,meta:this.metaData,uploaded:false,valid:o,error:{type:o?undefined:u,message:o?undefined:l,system_message:o?undefined:d},progress:0,deleted:false,xhr:false,url:false};this.files.set(r.name,p);h=this.validateTotals(r.name),c=h.bytesMaxReached,m=h.fileMaxReached;if(!c)return[3,2];this.updateValueInMap(r.name,"valid",false,false);return[3,7];case 2:if(!m)return[3,3];this.updateValueInMap(r.name,"valid",false,false);return[3,7];case 3:if(!(o&&!this.external))return[3,7];g=new FormData;g.append("file",r);g.append("uid",f);g.append("name",r.name);g.append("metadata",JSON.stringify({uid:f,url:this.uri,size:r.size,meta:p.meta}));b.label=4;case 4:b.trys.push([4,6,,7]);v=p;return[4,this.makeXHRPostRequest(g)];case 5:v.xhr=b.sent();return[3,7];case 6:y=b.sent();this.updateValueInMap(r.name,"valid",false,false);return[3,7];case 7:this.kick();b.label=8;case 8:i++;return[3,1];case 9:this.resetFormFields();this.metaData=undefined;this.duetChange.emit({originalEvent:e,data:{files:this.files},component:"duet-upload"});return[2]}}))}))};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput){this.nativeInput.focus(e)}return[2]}))}))};e.prototype.upload=function(e){if(e===void 0){e=undefined}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.setFocus()];case 1:t.sent();this.metaData=e;this.nativeInput.click();return[2]}}))}))};e.prototype.getFiles=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.files||this.files.size===0){return[2,false]}return[2,this.getFilesAsArray()]}))}))};e.prototype.updateValue=function(e,t,a){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.updateValueInMap(e,t,a);return[2]}))}))};e.prototype.render=function(){var e=this;var a=this.identifier||this.uploadId;var i=this.description.replace(/{maxfiles}/g,this.maxFiles.toString());i=i.replace(/{maxbytes}/g,Math.floor(this.maxBytes/1024/1024)+" MB");i=i.replace(/{filetypes}/g,this.allowedExtensions.split(",").join(", "));return t(s,{class:{"duet-m-0":this.margin==="none"}},t("duet-fieldset",{label:this.label,caption:i},t("slot",{name:"header"}),!this.files.size&&t("duet-label",{theme:this.theme==="turva"?"turva":"default",size:"small",class:{"duet-upload-filelist-empty":!this.files.size,"duet-upload-filelist":true,"duet-upload-filelist-filled":this.files.size},id:this.labelId,for:a},this.fileListEmpty),!!this.files.size&&t("slot",{name:"fileheader"}),!!this.files.size&&t("duet-upload-aria-status",{invalid:this.getFilesAsArray().invalid.length,valid:this.getFilesAsArray().valid.length,inprogress:this.filesInProgress.size,total:this.files.size,statusMessageLabel:this.statusMessageLabel}),!!this.files.size&&t("duet-editable-table",{"aria-live":"polite","aria-relevant":"removals",accessibleRole:"log",id:this.editableTableId,groups:this.groups,actions:this.actions,hideGroups:this.hideGroups,items:this.convertToDuetEditableTableItems()}),!!this.files.size&&t("slot",{name:"filefooter"}),t("duet-spacer",{size:"large"}),!this.hideButton&&t("duet-button",{id:this.buttonId,onClick:this.startUpload,"accessible-controls":a,disabled:this.fileMaxReached,"accessible-label":this.accessibleButtonLabel,"accessible-owns":a,size:"small",variation:"secondary",fixed:true,icon:"action-add-circle"},this.buttonLabel),t("duet-spacer",{size:"medium"}),(this.fileMaxReached||this.bytesMaxReached)&&t("duet-alert",null,this.fileMaxReached&&p("duet-upload-301"),this.bytesMaxReached&&p("duet-upload-202")),t("duet-spacer",{size:"medium"}),t("duet-visually-hidden",null,t("input",{ref:function(t){e.nativeInput=t},accept:!this.limitSelection?undefined:this.allowedMimetypes+","+this.allowedExtensions,onBlur:this.onBlur,onFocus:this.onFocus,onChange:function(t){return e.onChange(t)},type:"file",class:{"duet-upload":true},disabled:this.disabled,"aria-hidden":"true",required:this.required,name:this.name,id:this.identifier,multiple:this.multiple,capture:"user"}))))};Object.defineProperty(e.prototype,"element",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{valid:["watchValidHandler"]}},enumerable:false,configurable:true});return e}());E.style=M}}}));
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,a,n){function i(t){return t instanceof a?t:new a((function(e){e(t)}))}return new(a||(a=Promise))((function(a,o){function r(t){try{l(n.next(t))}catch(e){o(e)}}function d(t){try{l(n["throw"](t))}catch(e){o(e)}}function l(t){t.done?a(t.value):i(t.value).then(r,d)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,r;return r={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function d(t){return function(e){return l([t,e])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,i&&(o=r[0]&2?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;if(i=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:a.label++;return{value:r[1],done:false};case 5:a.label++;i=r[1];r=[0];continue;case 7:r=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){a=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(r[0]===6&&a.label<o[1]){a.label=o[1];o=r;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(r);break}if(o[2])a.ops.pop();a.trys.pop();continue}r=e.call(t,a)}catch(d){r=[6,d];i=0}finally{n=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* Built with Duet Design System
|
|
4
|
-
*/System.register(["./p-e12f2b8b.system.js","./p-81867417.system.js","./p-70fafc98.system.js","./p-efaa0c04.system.js","./p-ddb6344c.system.js","./p-9a945278.system.js"],(function(t){"use strict";var e,a,n,i,o,r,d,l,u,b,s,p,c,h,f,m,y;return{setters:[function(t){e=t.r;a=t.h;n=t.H;i=t.g;o=t.c},function(t){r=t.d},function(t){d=t.s;l=t.g},function(t){u=t.i},function(t){b=t.m;s=t.h;p=t.i;c=t.j;h=t.k;f=t.l;m=t.n;y=t.s},function(){}],execute:function(){var g="duet-editable-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-header tr .duet-editable-table-header-hidden{padding:0 !important;font-size:0;border-bottom:0}";var v=t("duet_editable_table",function(){function t(t){var a=this;e(this,t);this.tick=Date.now();this.items=new Map;this.groupsLabelDefaults={fi:"Kaikki",en:"All items",sv:"Alla objekt"};this.actionLabelDefaults={fi:"Toiminnot",en:"Actions",sv:"Handlingar"};this.groups=[{id:"all",label:this.groupsLabelDefaults,actionLabel:this.actionLabelDefaults}];this.actions=undefined;this.hideGroups=false;this.accessibleRole=undefined;this.kick=r((function(){a.tick=Date.now()}),100);this.filterMap=function(t){if(t==="all"){return Array.from(a.items)}return Array.from(a.items).filter((function(e){return t===e[1].group}))}}t.prototype.componentWillLoad=function(){if(typeof this.groups==="string"){this.internalGroupArray=d(this.groups)}else{this.internalGroupArray=this.groups}if(typeof this.actions==="string"){this.internalActionsArray=d(this.actions)}else{this.internalActionsArray=this.actions}u(this)};t.prototype.updateTable=function(t){if(t===void 0){t=undefined}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.items=new Map(t||this.items);this.kick();return[2]}))}))};t.prototype.render=function(){var t=this;return a(n,{class:{"duet-theme-turva":this.theme==="turva"}},this.internalGroupArray.map((function(e){var n=t.filterMap(e.id);if(!n.length){return}return a("duet-table",{variation:"plain",breakpoint:"none",role:"",margin:t.hideGroups?"none":"auto"},a("table",{class:"duet-editable-table","aria-role":t.accessibleRole},a("thead",{class:"duet-editable-table-header"},a("tr",null,a("th",{class:{"duet-editable-table-header-hidden":t.hideGroups}},!t.hideGroups?l(e.label):a("duet-visually-hidden",null,l(e.label))),a("th",{class:{"duet-editable-table-header-hidden":t.hideGroups}},a("duet-visually-hidden",null,e.actionLabel?l(e.actionLabel):l(t.actionLabelDefaults))))),a("tbody",null,n.map((function(n){var i=n[0],o=n[1];return a("duet-editable-table-item",{keyName:i,data:Object.assign({},o),groupId:e.id,part:e.id,actions:t.internalActionsArray})})))))})))};Object.defineProperty(t.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());v.style=g;var k=function(t,e){var n=t.data,i=t.groupId;if(typeof n==="string"){return a("td",{innerHTML:n,class:"duet-editable-table-content",part:i+"content"})}else{return a("td",{class:"duet-editable-table-content",part:i+"content"},n)}};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{display:table-row;height:32px}.duet-editable-table-content,.duet-editable-table-actions{height:32px;padding:12px 0;vertical-align:middle;break-word:break-all;border-bottom:1px solid #e1e3e6}.duet-editable-table-actions-items{display:flex;justify-content:flex-end}.duet-editable-table-actions-items duet-editable-table-button{padding-left:8px}.duet-editable-table .editable-item-small{font-size:0.75rem;font-weight:400}";var w=t("duet_editable_table_item",function(){function t(t){e(this,t);this.duetEditableItemAction=o(this,"duetEditableItemAction",7);this.isHovering=false;this.theme="";this.actions=undefined;this.groupId="";this.keyName="";this.data=undefined}t.prototype.watchPropHandler=function(t,e){};t.prototype.componentWillLoad=function(){u(this)};t.prototype.render=function(){var t=this;return a(n,{role:"row"},a(k,{data:this.data.item,groupId:this.groupId}),a("td",{class:"duet-editable-table-actions"},a("div",{class:"duet-editable-table-actions-items",part:this.groupId+"actions"},this.actions.map((function(e){var n=e.map,i=n===void 0?undefined:n;if(i&&!i.includes(t.groupId)){return}return a("duet-editable-table-button",{keyName:t.keyName,group:t.data.group,uid:t.data.uid,actions:e,theme:t.theme})})))))};Object.defineProperty(t.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{data:["watchPropHandler"]}},enumerable:false,configurable:true});return t}());w.style=x;var A='duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{width:100%;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-theme-turva table{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:#00294d}duet-table.duet-theme-turva td{color:#171c3a}duet-table th{font-weight:600;line-height:1.25;color:#657787;text-align:left}duet-table.duet-theme-turva th{color:#747475}duet-table tbody th{font-weight:600;color:#00294d}duet-table.duet-theme-turva tbody th{color:#171c3a}.duet-table-flattened table,.duet-table-flattened thead,.duet-table-flattened tbody,.duet-table-flattened tfoot,.duet-table-flattened th,.duet-table-flattened td,.duet-table-flattened tr{display:block}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:#657787;text-align:left}.duet-table-flattened td[data-heading]::before{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:#00294d;content:attr(data-heading)}.duet-table-flattened.duet-theme-turva td[data-heading]::before{color:#171c3a}.duet-table-sticky thead th{position:sticky;top:0;background:white}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:white}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid #e1e3e6}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:#e4e4e6}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid #e1e3e6}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:#e4e4e6}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid #e1e3e6}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:#e4e4e6}.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid #657787}.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:#444445}.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:#e1e3e6}.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:#e4e4e6}.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid #e1e3e6}.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:#e4e4e6}.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid #e1e3e6}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:#e4e4e6}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}';var j=function(t){return t.substring(1,t.length-1)};var S={none:"all","none-scrollable":"all",small:j(f),medium:j(b),large:j(s),"x-large":j(p),"xx-large":j(c),"xxx-large":j(h)};var _={none:0,"with-links":parseFloat(m)*16,"without-links":parseFloat(y)*16};var I=t("duet_table",function(){function t(t){var a=this;e(this,t);this.matchesBreakpoint=true;this.margin="auto";this.variation="striped";this.sticky=false;this.stickyDistance="with-links";this.breakpoint="small";this.handleMediaQueryChange=function(t){a.matchesBreakpoint=t.matches}}t.prototype.connectedCallback=function(){var t=this;this.mq=matchMedia(S[this.breakpoint]);this.mq.addListener(this.handleMediaQueryChange);this.handleMediaQueryChange(this.mq);this.observer=new MutationObserver((function(){return t.copyHeadingsToCells()}));this.observer.observe(this.element,{childList:true,subtree:true})};t.prototype.componentWillLoad=function(){u(this);this.copyHeadingsToCells();if(this.sticky&&this.breakpoint==="none-scrollable"){console.warn('[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence')}if(this.sticky){var t=_[this.stickyDistance];var e=this.element.querySelectorAll("thead th");e.forEach((function(e){return e.style.top=t+"px"}))}};t.prototype.componentDidLoad=function(){this.observer.takeRecords()};t.prototype.disconnectedCallback=function(){this.observer.disconnect();this.observer=null;this.mq.removeListener(this.handleMediaQueryChange);this.mq=null;this.matchesBreakpoint=true};t.prototype.copyHeadingsToCells=function(){var t=this.element.querySelectorAll("thead th");var e=this.element.querySelectorAll("tbody tr");var a=Array.from(t).map((function(t){return t.textContent.trim()}));e.forEach((function(t){t.querySelectorAll("td").forEach((function(t,e){if(a[e]){t.dataset.heading=a[e]}}))}))};t.prototype.render=function(){var t;return a(n,{class:(t={},t["duet-table-"+this.variation]=true,t["duet-table-flattened"]=!this.matchesBreakpoint,t["duet-table-sticky"]=this.matchesBreakpoint&&this.sticky,t["duet-table-scrollable"]=this.breakpoint==="none-scrollable",t["duet-m-0"]=this.margin==="none",t["duet-theme-turva"]=this.theme==="turva",t)},a("slot",null))};Object.defineProperty(t.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());I.style=A}}}));
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import{r as e,c as t,h as c,H as i,g as o}from"./p-e2a44156.js";import{D as d}from"./p-76f00bd5.js";import{c as h}from"./p-c1325e35.js";import{F as s}from"./p-548d484e.js";import{i as a,h as r,f as u}from"./p-04f9f1bf.js";import{g as n,a as l}from"./p-2764f081.js";import{i as p}from"./p-a28cf57b.js";import{f as b,w as m}from"./p-12721178.js";import"./p-986779fb.js";let 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=h("DuetChoice"),this.expandId=h("DuetChoiceExpand"),this.headerId=h("DuetChoiceHeader"),this.infoButtonId=h("DuetChoiceInfoButton"),this.isHovering=!1,this.isInfoOpen=!1,this.isBlurred=!1,this.theme="",this.label="label",this.accessibleLabelInfoButtonDefaults=d,this.accessibleLabelInfoButton=n(this.accessibleLabelInfoButtonDefaults),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=n(this.infoLabelDefaults,l()),this.onMouseEnter=()=>{this.isHovering=!0},this.onMouseLeave=()=>{this.isHovering=!1},this.onClick=e=>{this.toggleChecked(e)},this.handleKeyDown=e=>{a(e)&&this.toggleChecked(e),r(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(){p(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,u(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 console.log(this.element),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-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"})),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",{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(s,{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:block;width:100%;padding:20px 48px 20px 16px;font-size:1rem;font-weight:600;text-decoration:none;cursor:pointer;border:2px solid #e1e3e6;border-radius:4px;transition:background-color 150ms ease}.has-info.sc-duet-choice .duet-choice-label.sc-duet-choice{padding-right:110px;border-top-right-radius:0;border-bottom-right-radius:0}.info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom-right-radius:0;border-bottom-left-radius:0}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice{border-color:#e4e4e6}.duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#909599}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#909599}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-theme-turva.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-checkmark-container.sc-duet-choice{border-color:#747475}.duet-theme-turva.sc-duet-choice .info.sc-duet-choice .duet-choice-label.sc-duet-choice:not(.no-hover):hover{border-color:#747475}.duet-choice-label.sc-duet-choice:active{opacity:0.75;transition:none !important}.has-icon.sc-duet-choice .duet-choice-label.sc-duet-choice{padding-left:48px}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#0077b3 !important;background:#f3f9fc;border-color:#0077b3 !important}.checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#0077b3}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice{color:#171c3a !important;background:#f5f5f7;border-color:#171c3a !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-choice-label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#c60c30}.checked.collapsible.sc-duet-choice .duet-choice-label.sc-duet-choice{border-bottom:0 !important;border-bottom-right-radius:0;border-bottom-left-radius:0}input.sc-duet-choice:focus{outline:0}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3)}.user-is-tabbing.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:checked:focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2)}.user-is-tabbing.duet-theme-turva.sc-duet-choice-h input.sc-duet-choice:not(:checked):focus+.duet-choice-label.sc-duet-choice{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#657787 !important;cursor:default !important;background:#f5f8fa !important;border-color:#e1e3e6 !important}input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#657787 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{color:#747475 !important;background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-theme-turva.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice .duet-checkmark.sc-duet-choice{border-color:#747475 !important}.checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e1e3e6 !important;border-color:#e1e3e6 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice input[disabled].sc-duet-choice+.duet-choice-label.sc-duet-choice{background:#e4e4e6 !important;border-color:#e4e4e6 !important}.duet-checkmark-container.sc-duet-choice{position:absolute;top:17.7777777778px;right:16px;width:20px;height:20px;border:1px solid #909599;border-radius:4px;transition:border 300ms ease}.duet-theme-turva.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#747475}.checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#0077b3;border-color:#0077b3;transition:none}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#171c3a;border-color:#171c3a !important}.duet-checkmark-container.duet-checkmark-radio.sc-duet-choice{border-radius:50%}[disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{border-color:#cfcfd1 !important}.checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfd2d4 !important}.duet-theme-turva.sc-duet-choice .checked.sc-duet-choice [disabled].sc-duet-choice+label.sc-duet-choice .duet-checkmark-container.sc-duet-choice{background:#cfcfd1 !important}.duet-checkmark.sc-duet-choice{position:absolute;top:10px;left:3px;width:5.3333333333px;height:11.8518518519px;border-top:2px solid white;border-right:2px solid white;opacity:1;transform:scaleX(-1) rotate(135deg) translateZ(0);transform-origin:left top;animation-name:duet-checkmark;animation-duration:600ms;animation-timing-function:ease-out;animation-fill-mode:forwards}@keyframes duet-checkmark{0%{width:0;height:0;opacity:1}20%{width:5.3333333333px;height:0;opacity:1}40%,100%{width:5.3333333333px;height:11.8518518519px;opacity:1}}.duet-choice-card-icon.sc-duet-choice{position:absolute;top:50%;left:16px;transform:translateY(-50%)}.duet-choice-card-icon.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-section-hidden.sc-duet-choice{display:none}.duet-choice-card-info.duet-choice-card-collapsed.sc-duet-choice,.duet-choice-card-collapsed.duet-choice-card-collapsible.sc-duet-choice{position:relative;width:auto;padding:0 !important;background:unset !important;border:0;border-radius:0}.duet-choice-card-info.sc-duet-choice,.duet-choice-card-collapsible.sc-duet-choice{padding:28px !important;position:relative;z-index:200;width:100%;font-weight:400;color:#00294d;border:2px solid #e1e3e6;border-top:0;border-radius:0 0 4px 4px}.duet-theme-turva.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.duet-theme-turva.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{color:#171c3a;border-color:#171c3a}.checked.sc-duet-choice .duet-choice-card-info.sc-duet-choice,.checked.sc-duet-choice .duet-choice-card-collapsible.sc-duet-choice{display:block}.duet-choice-card-info-expanded.sc-duet-choice,.duet-choice-card-collapsible-expanded.sc-duet-choice{display:block}.duet-choice-card-collapsible.sc-duet-choice{background:white;border:2px solid #0077b3;border-top:0}.duet-choice-card-collapsible.duet-theme-turva.sc-duet-choice{background:white;border-color:#171c3a}.duet-choice-card-collapsible-disabled.sc-duet-choice{background:#f5f8fa;border-color:#e1e3e6}.duet-choice-card-collapsible-disabled.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-card-info.sc-duet-choice{font-size:0.875rem;line-height:1.5;background:#f5f8fa;transition:150ms ease-out}.duet-choice-card-info.duet-theme-turva.sc-duet-choice{background:#f5f5f7;border-color:#e4e4e6}.duet-choice-info-toggle.sc-duet-choice{display:flex;flex-shrink:0;justify-content:center;width:57.6px;padding-top:18px;cursor:pointer;background:white;border:2px solid #e1e3e6;border-left:0 none;border-top-right-radius:4px;border-bottom-right-radius:4px;-webkit-appearance:none;appearance:none}.duet-choice-info-toggle[aria-expanded=true].sc-duet-choice{background:#f5f8fa;border-bottom:0;border-bottom-right-radius:0}.duet-choice-info-toggle[disabled].sc-duet-choice{pointer-events:none;background:#f5f8fa !important;border-color:#e1e3e6 !important}.duet-choice-info-toggle[disabled].sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#909599 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice{background:#f5f5f7 !important;border-color:#e4e4e6 !important}.duet-choice-info-toggle[disabled].duet-theme-turva.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#747475 !important}.duet-choice-info-toggle.sc-duet-choice:focus{outline:none}.user-is-tabbing.sc-duet-choice-h .duet-choice-info-toggle.sc-duet-choice:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-choice-label.sc-duet-choice:not(.no-hover):hover .duet-choice-info-toggle.sc-duet-choice{border-left-color:#909599}.checked.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice{border-left-color:#0077b3 !important}.duet-choice-info-toggle.sc-duet-choice duet-icon.sc-duet-choice{display:block}.duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#0077b3}.duet-theme-turva.sc-duet-choice .duet-choice-info-toggle.sc-duet-choice .duet-choice-info-icon.sc-duet-choice{color:#c60c30}.duet-choice-input.sc-duet-choice{position:absolute !important;width:auto;height:auto;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);color:transparent}';let 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,"duet-choice");void 0!==t&&(await t.componentOnReady(),void 0===this.value&&(this.value=t.value))}this.mutationO=m(e,"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(){p(this)}async updateChoices(){const e=Array.from(this.element.querySelectorAll("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 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,c as e,h as i,g as a,H as s}from"./p-e2a44156.js";import{g as o}from"./p-2764f081.js";import{i as n}from"./p-a28cf57b.js";import{g as l}from"./p-3c1971d8.js";import{c as r}from"./p-c1325e35.js";import"./p-986779fb.js";import"./p-ad07f399.js";let d=class{constructor(i){t(this,i),this.duetEditableItemAction=e(this,"duetEditableItemAction",7),this.isHovering=!1,this.theme="",this.actions=void 0,this.uid="",this.group="",this.keyName="",this.onMouseEnter=()=>{this.isHovering=!0},this.onMouseLeave=()=>{this.isHovering=!1}}componentWillLoad(){n(this)}emitActionEvent(t){this.duetEditableItemAction.emit({originalEvent:t,uid:this.uid,group:this.group,action:this.actions.id,keyName:this.keyName,component:"duet-editable-table-item"})}render(){return i("button",{style:{"border-color":l(this.isHovering?this.actions.color_hover:this.actions.color)},onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,role:"menuitem",class:"duet-editable-table-actions-items-button","aria-label":this.actions.label?o(this.actions.label):void 0,onClick:t=>this.emitActionEvent(t)},i("duet-icon",{class:"duet-editable-table-actions-items-icon",size:"x-small",name:this.actions.icon,color:this.isHovering?this.actions.color_hover:this.actions.color,margin:"none"}))}get el(){return a(this)}};d.style="*.sc-duet-editable-table-button,*.sc-duet-editable-table-button::after,*.sc-duet-editable-table-button::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button{display:flex;align-content:space-between;justify-content:center;min-width:32px;max-width:32px;height:100%;min-height:32px;max-height:32px;padding:0;margin:0;cursor:pointer !important;background-color:transparent;border:1px solid;border-radius:50%}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button duet-icon.sc-duet-editable-table-button{align-self:center}";let h=class{constructor(e){t(this,e),this.errorId=r("DuetError"),this.labelId=r("DuetLabel"),this.hasTooltip=!1,this.theme="",this.margin="auto",this.labelHidden=!1,this.checkHasTooltip=()=>{this.hasTooltip=!!this.element.querySelector("[slot='tooltip']")}}componentWillLoad(){n(this),this.checkHasTooltip()}render(){return i(s,{class:{"duet-m-0":"none"===this.margin}},i("fieldset",{"aria-labelledby":`${this.labelId} ${this.errorId}`,class:{"duet-fieldset":!0,"duet-theme-turva":"turva"===this.theme}},i("legend",{id:this.labelId},i("span",null,this.label),this.caption&&i("span",null,this.caption)),i("div",{class:{"duet-legend-wrapper":!0,"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))))}get element(){return a(this)}};h.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;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}';let p=class{constructor(e){t(this,e),this.statusMessage=null,this.statusMessageLabel=null,this.accessibleAriaLive="polite",this.valid=void 0,this.total=void 0,this.invalid=void 0,this.inprogress=void 0,this.replacePlaceHolders=t=>{const e=t=>t>1?`${t} ${this.statusMessageLabel.files}`:`${t} ${this.statusMessageLabel.file}`;return t.replace("{filesUploaded}",e(this.valid)).replace("{filesInProgress}",e(this.inprogress)).replace("{filesTotal}",e(this.total)).replace("{filesWithErrors}",e(this.invalid))},this.getStatusMessage=()=>{const{done:t,inProgress:e,doneWithErrors:i,inProgressWithErrors:a}=this.statusMessageLabel,s=this.invalid>0,o=this.inprogress>0,n=this.valid+this.invalid===this.total&&!o;this.valid!==this.total||o||s?this.inprogress>0&&s?this.statusMessage=this.replacePlaceHolders(a):o?this.statusMessage=this.replacePlaceHolders(e):n&&(this.statusMessage=this.replacePlaceHolders(i)):this.statusMessage=this.replacePlaceHolders(t)}}watchHandler(t,e){t!==e&&this.getStatusMessage()}render(){return i(s,{role:"status","aria-live":"assertive","aria-atomic":"true","aria-relevant":"all"},i("duet-visually-hidden",null,this.statusMessage))}static get watchers(){return{valid:["watchHandler"],invalid:["watchHandler"],inprogress:["watchHandler"],total:["watchHandler"]}}};export{d as duet_editable_table_button,h as duet_fieldset,p as duet_upload_aria_status}
|