@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,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,h as e,H as a,g as d,c as l}from"./p-e2a44156.js";import{d as i}from"./p-b25d3769.js";import{s as o,g as n}from"./p-2764f081.js";import{i as r}from"./p-a28cf57b.js";import{m as b,h as s,i as u,j as p,k as h,l as m,n as c,s as f}from"./p-ad07f399.js";import"./p-986779fb.js";let g=class{constructor(e){t(this,e),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=void 0,this.hideGroups=!1,this.accessibleRole=void 0,this.kick=i((()=>{this.tick=Date.now()}),100),this.filterMap=t=>"all"===t?Array.from(this.items):Array.from(this.items).filter((e=>t===e[1].group))}componentWillLoad(){this.internalGroupArray="string"==typeof this.groups?o(this.groups):this.groups,this.internalActionsArray="string"==typeof this.actions?o(this.actions):this.actions,r(this)}async updateTable(t){this.items=new Map(t||this.items),this.kick()}render(){return e(a,{class:{"duet-theme-turva":"turva"===this.theme}},this.internalGroupArray.map((t=>{const a=this.filterMap(t.id);if(a.length)return e("duet-table",{variation:"plain",breakpoint:"none",role:"",margin:this.hideGroups?"none":"auto"},e("table",{class:"duet-editable-table","aria-role":this.accessibleRole},e("thead",{class:"duet-editable-table-header"},e("tr",null,e("th",{class:{"duet-editable-table-header-hidden":this.hideGroups}},this.hideGroups?e("duet-visually-hidden",null,n(t.label)):n(t.label)),e("th",{class:{"duet-editable-table-header-hidden":this.hideGroups}},e("duet-visually-hidden",null,n(t.actionLabel?t.actionLabel:this.actionLabelDefaults))))),e("tbody",null,a.map((a=>{const[d,l]=a;return e("duet-editable-table-item",{keyName:d,data:Object.assign({},l),groupId:t.id,part:t.id,actions:this.internalActionsArray})})))))})))}get element(){return d(this)}};g.style="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}";const y=({data:t,groupId:a})=>"string"==typeof t?e("td",{innerHTML:t,class:"duet-editable-table-content",part:`${a}content`}):e("td",{class:"duet-editable-table-content",part:`${a}content`},t);let x=class{constructor(e){t(this,e),this.duetEditableItemAction=l(this,"duetEditableItemAction",7),this.isHovering=!1,this.theme="",this.actions=void 0,this.groupId="",this.keyName="",this.data=void 0}watchPropHandler(t,e){}componentWillLoad(){r(this)}render(){return e(a,{role:"row"},e(y,{data:this.data.item,groupId:this.groupId}),e("td",{class:"duet-editable-table-actions"},e("div",{class:"duet-editable-table-actions-items",part:`${this.groupId}actions`},this.actions.map((t=>{const{map:a}=t;if(!a||a.includes(this.groupId))return e("duet-editable-table-button",{keyName:this.keyName,group:this.data.group,uid:this.data.uid,actions:t,theme:this.theme})})))))}get el(){return d(this)}static get watchers(){return{data:["watchPropHandler"]}}};x.style="*,*::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}";const k=t=>t.substring(1,t.length-1),v={none:"all","none-scrollable":"all",small:k(m),medium:k(b),large:k(s),"x-large":k(u),"xx-large":k(p),"xxx-large":k(h)},w={none:0,"with-links":16*parseFloat(c),"without-links":16*parseFloat(f)};let j=class{constructor(e){t(this,e),this.matchesBreakpoint=!0,this.margin="auto",this.variation="striped",this.sticky=!1,this.stickyDistance="with-links",this.breakpoint="small",this.handleMediaQueryChange=t=>{this.matchesBreakpoint=t.matches}}connectedCallback(){this.mq=matchMedia(v[this.breakpoint]),this.mq.addListener(this.handleMediaQueryChange),this.handleMediaQueryChange(this.mq),this.observer=new MutationObserver((()=>this.copyHeadingsToCells())),this.observer.observe(this.element,{childList:!0,subtree:!0})}componentWillLoad(){if(r(this),this.copyHeadingsToCells(),this.sticky&&"none-scrollable"===this.breakpoint&&console.warn('[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence'),this.sticky){const t=w[this.stickyDistance];this.element.querySelectorAll("thead th").forEach((e=>e.style.top=`${t}px`))}}componentDidLoad(){this.observer.takeRecords()}disconnectedCallback(){this.observer.disconnect(),this.observer=null,this.mq.removeListener(this.handleMediaQueryChange),this.mq=null,this.matchesBreakpoint=!0}copyHeadingsToCells(){const t=this.element.querySelectorAll("thead th"),e=this.element.querySelectorAll("tbody tr"),a=Array.from(t).map((t=>t.textContent.trim()));e.forEach((t=>{t.querySelectorAll("td").forEach(((t,e)=>{a[e]&&(t.dataset.heading=a[e])}))}))}render(){return e(a,{class:{[`duet-table-${this.variation}`]:!0,"duet-table-flattened":!this.matchesBreakpoint,"duet-table-sticky":this.matchesBreakpoint&&this.sticky,"duet-table-scrollable":"none-scrollable"===this.breakpoint,"duet-m-0":"none"===this.margin,"duet-theme-turva":"turva"===this.theme}},e("slot",null))}get element(){return d(this)}};j.style='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)}';export{g as duet_editable_table,x as duet_editable_table_item,j as duet_table}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
System.register([],(function(e){"use strict";return{execute:function(){var t=e("d",(function(e,t){if(t===void 0){t=50}var n;return function(){var r=[];for(var i=0;i<arguments.length;i++){r[i]=arguments[i]}clearTimeout(n);n=setTimeout((function(){e.apply(undefined,r)}),t)}}))}}}));
|
package/lib/duet/p-b25d3769.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import{h as e,r as t,c as s,H as i,g as a}from"./p-e2a44156.js";import{c as o}from"./p-c1325e35.js";import{d as r}from"./p-b25d3769.js";import{g as n}from"./p-2764f081.js";import{i as l}from"./p-a28cf57b.js";import"./p-986779fb.js";const 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."}}],h=e=>{let t={type:void 0,system_message:void 0,message:void 0};return t=d.filter((t=>t.type==e))[0],t||(t=d.filter((e=>"default"===e.type))[0]),t},u=e=>{const t=h(e),s=n(t.message);return""!==s&&s?s:t.system_message},p=({data:t})=>{const{item:s,error:i}=t,{name:a}=s,{type:o}=i;return e("span",{class:"duet-upload-item-error",role:"status"},e("duet-paragraph",{class:"duet-upload-item-name",color:"danger",margin:"none",weight:"semi-bold"},e("duet-icon",{margin:"none",size:"xx-small",name:"messaging-attachment"})," ",a),e("duet-paragraph",{class:"duet-upload-item-error-label",size:"small",margin:"none",color:"danger"},u(o)))},m=({progress:t,name:s})=>e("span",null,e("duet-paragraph",{color:"secondary",margin:"none",size:"small"},s),e("duet-spacer",{size:"xx-small"}),e("duet-progress",{progress:Math.ceil(t),"aria-hidden":!0})),c=({data:t,showLinks:s})=>{const{item:i,size:a,uploaded:o,url:r,meta:n}=t,{name:l}=i,d=e("span",{class:"duet-upload-item-name"},e("duet-icon",{margin:"none",size:"xx-small",name:"messaging-attachment"}),e("duet-spacer",{size:"xx-small",direction:"horizontal"}),l),h=e("span",{class:"duet-upload-item-size",style:{fontSize:"14px",fontWeight:"400"}},"(",((e,t=2)=>{if(0===e)return"0 Bytes";const s=t<0?0:t,i=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,i)).toFixed(s))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][i]})(a),")"),u=e("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},o&&r&&s?e("duet-link",{url:r,external:!0},d):d,e("duet-spacer",{size:"xx-small",direction:"horizontal"}),h),p=n&&n.badges?e("span",null,e("duet-spacer",{size:"xx-small"}),n.badges.map((t=>e("duet-badge",{color:"primary"},t)))):void 0;return e("span",{class:"duet-upload-item-success"},e("div",null,u),p)},f=(e,t)=>{const{allowedMimetypes:s,allowedExtensions:i,maxBytes:a}=t;let o=!1,r=h("default");if(e){const{name:t,type:n,size:l}=e,d=((e,t)=>{if(!t||!e)return!0;const s=t.split(",");let i=!1;return s.forEach((t=>{const s=t.split("/"),a=e.split("/");s[0]!==a[0]||s[1]!==a[1]&&"*"!==s[1]||(i=!0)})),i})(n,s),u=((e,t)=>{if(!t)return!0;const s=e.split(".");return t.split(",").includes(s[s.length-1])})(t,i),p=((e,t)=>!t||!e||t>=e)(l,a);d||(r=h("duet-upload-101")),u||(r=h("duet-upload-100")),p||(r=h("duet-upload-201")),o=d&&u&&p}else o=!1;return{valid:o,errorMessage:o?void 0:n(r.message),errorSystem:o?void 0:r.system_message,errorType:o?void 0:r.type}},g=({payload:e,options:t,onFailure:s,onSuccess:i,onProgress:a})=>{const{type:o="POST",xhr:r,uri:n,argument:l=null,headers:d=null}=t;r.open(o,`${n}${l||""}`,!0);const{data:h,name:u}=e;return d&&Object.keys(d).forEach((e=>{r.setRequestHeader(e,d[e])})),"POST"===o&&(r.onreadystatechange=()=>{r.readyState===XMLHttpRequest.DONE&&r.status>=200&&r.status<300&&i(r,u,r.status),r.readyState===XMLHttpRequest.DONE&&r.status>=300&&r.status<999&&s(r,u,r.status)},a(u)),r.send(h),r};let y=class{constructor(i){t(this,i),this.duetChange=s(this,"duetChange",3),this.duetBlur=s(this,"duetBlur",7),this.duetFocus=s(this,"duetFocus",7),this.duetDone=s(this,"duetDone",3),this.duetState=s(this,"duetState",3),this.duetDelete=s(this,"duetDelete",3),this.duetCancel=s(this,"duetCancel",3),this.duetProgress=s(this,"duetProgress",3),this.duetUpload=s(this,"duetUpload",3),this.buttonId=o("DuetButton"),this.labelId=o("DuetLabel"),this.uploadId=o("DuetUpload"),this.editableTableId=o("DuetEditableTable"),this.filesInProgress=new Map,this.fileMaxReached=!1,this.bytesMaxReached=!1,this.DefaultGroups={inprogress:"inprogress",success:"success",failure:"failure"},this.tick=Date.now(),this.external=!1,this.hideButton=!1,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=!1,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=n(this.statusLabelDefaults),this.buttonLabelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add an attachment"},this.buttonLabel=n(this.buttonLabelDefaults),this.accessibleButtonLabel=void 0,this.theme="",this.disabled=!1,this.margin="auto",this.required=!1,this.hideGroups=!1,this.files=new Map,this.valid=!this.required,this.labelDefaults={fi:"Lisää liite",sv:"Lägg till en bilaga",en:"Add attachments"},this.label=n(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=n(this.descriptionDefaults),this.fileListEmptyDefaults={fi:"Ei vielä lisättyjä tiedostoja.",sv:"Inga filer har lagts till ännu.",en:"No files added yet."},this.fileListEmpty=n(this.fileListEmptyDefaults),this.error="",this.maxBytes=2e8,this.maxBytesTotal=void 0,this.maxFiles=99,this.allowedExtensions="all",this.allowedMimetypes="*",this.multiple=!0,this.limitSelection=!1,this.listenForActionEvents=()=>{this.element.addEventListener("duetEditableItemAction",(e=>{const t=e.detail,{action:s,keyName:i,originalEvent:a}=t;switch(s){case"delete":this.onDelete(i,a);break;case"cancel":this.onCancel(i,a)}}))},this.verifyValidity=()=>{const{invalid:e,valid:t}=this.getFilesAsArray(),s=this.valid;this.valid=0===e.length&&0!==t.length,this.valid!==s&&this.duetState.emit({originalEvent:void 0,data:{valid:this.valid,from:"componentWillRender"},component:"duet-upload"})},this.getGroupFromItemData=e=>e.valid&&100===e.progress?e.group?e.group:this.DefaultGroups.success:e.progress>0&&100!==e.progress?this.DefaultGroups.inprogress:e.valid?e.group?e.group:"none":this.DefaultGroups.failure,this.getItemHTMLFromItemData=(t,s)=>s===this.DefaultGroups.success?e(c,{data:t,showLinks:this.showLinks}):s===this.DefaultGroups.inprogress?e(m,{progress:t.progress,name:t.item.name}):s===this.DefaultGroups.failure?e(p,{data:t}):t.group?t.html:"none",this.convertToDuetEditableTableItems=()=>{const e=new Map;return this.files.forEach(((t,s)=>{const i=this.getGroupFromItemData(t),a=this.getItemHTMLFromItemData(t,i);e.set(s,{uid:t.uid,item:a,group:i})})),e},this.kick=r((()=>{this.tick=Date.now()}),30),this.genHashName=()=>Date.now().toString(36)+Math.random(),this.updateValueInMap=(e,t,s,i=!0)=>{const a=this.files.get(e);a[t]=s,this.files.set(e,a),i&&this.kick()},this.updateProgress=(e,t)=>{console.log(this.filesInProgress.size);e.lengthComputable?(s=>{this.updateValueInMap(t,"progress",s),this.onProgress(t,s,e)})(e.loaded/e.total*100):console.log("cant read progress")},this.trackProgress=(e,t=!1)=>{t?this.filesInProgress.delete(e):this.filesInProgress.set(e,"inprogress"),0===this.filesInProgress.size&&this.onDone()},this.getFilesAsArray=()=>{const e=[],t=[];return this.files.forEach((s=>{s.valid&&!s.deleted?e.push(s):s.valid||s.deleted||t.push(s)})),{valid:e,invalid:t}},this.resetFormFields=()=>{this.nativeInput.value=""},this.startUpload=async(e,t)=>{await this.setFocus(),this.metaData=t,this.nativeInput.click(),this.onUpload(e,t),e.stopPropagation(),e.preventDefault()},this.transferComplete=e=>{this.updateValueInMap(e,"progress",100,!1),this.trackProgress(e,!0)},this.transferDone=(e,t,s)=>{this.updateValueInMap(t,"status",s,!1),this.updateValueInMap(t,"uploaded",!0,!1);try{const s=JSON.parse(e.response);this.updateValueInMap(t,"url",s.url)}catch(i){this.updateValueInMap(t,"url",null),console.error("Server did not respond with expected response {url: string}")}},this.transferDoneWithFailure=(e,t,s)=>{try{const{error:s}=JSON.parse(e.response);this.updateValueInMap(t,"error",{message:s.message,type:s.type},!1)}catch(i){console.error("Server did not respond with expected response error:{message: string, type: int}"),this.updateValueInMap(t,"error",{type:s},!1)}this.updateValueInMap(t,"valid",!1,!0)},this.transferFailed=e=>{this.updateValueInMap(e,"error",h("duet-upload-001"))},this.transferCanceled=e=>{this.files.delete(e),this.validateTotals(e),this.kick()},this.validateTotals=e=>{const t=((e,t)=>{let s=0;return!!(t&&(this.files.forEach((e=>{e.valid&&e.size&&(s+=e.size)})),s<t))})(0,this.maxBytesTotal),s=((e,t)=>{let s=0;return!!(t&&(this.files.forEach((e=>{e.valid&&s++})),s>t))})(0,this.maxFiles);return t&&e&&this.updateValueInMap(e,"error",h("duet-upload-202"),!1),s&&e&&this.updateValueInMap(e,"error",h("duet-upload-301"),!1),this.bytesMaxReached=t,this.fileMaxReached=s,{bytesMaxReached:t,fileMaxReached:s}},this.onDelete=(e,t)=>{const s=this.files.get(e);this.files.delete(e),this.validateTotals(),this.kick(),this.duetDelete.emit({originalEvent:t,data:{deletion:s},component:"duet-upload"}),this.external||this.makeXHRDeleteRequest(s),this.resetFormFields()},this.onCancel=(e,t)=>{const s=this.files.get(e);if(this.files.delete(e),this.external)this.kick();else{const{xhr:e}=s;e.abort()}this.resetFormFields(),this.duetCancel.emit({originalEvent:t,data:{cancelled:s},component:"duet-upload"})},this.onUpload=(e,t)=>{this.duetUpload.emit({originalEvent:e,metaData:t,component:"duet-upload"})},this.onBlur=e=>{this.duetBlur.emit({originalEvent:e,component:"duet-upload"})},this.onProgress=(e,t,s)=>{this.duetChange.emit({originalEvent:s,data:{key:e,percentComplete:t},component:"duet-upload"})},this.onFocus=e=>{this.duetFocus.emit({originalEvent:e,component:"duet-upload"})},this.onDone=()=>{this.duetDone.emit({component:"duet-upload",data:{files:this.files}})}}watchValidHandler(e,t){e!==t&&this.kick()}componentWillLoad(){l(this),this.listenForActionEvents()}componentWillRender(){this.verifyValidity()}makeXHRPostRequest(e){const t=new XMLHttpRequest,s=e.get("name");return t.upload.addEventListener("progress",(e=>{this.updateProgress(e,s)})),t.upload.addEventListener("load",(()=>{this.transferComplete(s)})),t.upload.addEventListener("error",(()=>{this.transferFailed(s)})),t.upload.addEventListener("abort",(()=>{this.transferCanceled(s)})),g({payload:{data:e,name:s},options:{type:"POST",uri:this.uri,xhr:t,argument:null,headers:null},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress})}makeXHRDeleteRequest(e){const{uid:t,item:s}=e,i=new XMLHttpRequest;return g({payload:{data:null,name},options:{type:"DELETE",xhr:i,uri:this.uri,arguments:`?key=${t}&name=${s.name}`,headers:{"x-fileuid":t,"x-filename":s.name}},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress})}async onChange(e){var t;const s=Array.from(null===(t=this.nativeInput)||void 0===t?void 0:t.files);if(s)for(const a of s){const{valid:e,errorMessage:t,errorType:s,errorSystem:o}=f(a,{maxBytes:this.maxBytes,allowedExtensions:this.allowedExtensions,allowedMimetypes:this.allowedMimetypes}),r=this.genHashName(),n={uid:r,item:a,size:a.size,meta:this.metaData,uploaded:!1,valid:e,error:{type:e?void 0:s,message:e?void 0:t,system_message:e?void 0:o},progress:0,deleted:!1,xhr:!1,url:!1};this.files.set(a.name,n);const{bytesMaxReached:l,fileMaxReached:d}=this.validateTotals(a.name);if(l)this.updateValueInMap(a.name,"valid",!1,!1);else if(d)this.updateValueInMap(a.name,"valid",!1,!1);else if(e&&!this.external){const e=new FormData;e.append("file",a),e.append("uid",r),e.append("name",a.name),e.append("metadata",JSON.stringify({uid:r,url:this.uri,size:a.size,meta:n.meta}));try{n.xhr=await this.makeXHRPostRequest(e)}catch(i){this.updateValueInMap(a.name,"valid",!1,!1)}}this.kick()}this.resetFormFields(),this.metaData=void 0,this.duetChange.emit({originalEvent:e,data:{files:this.files},component:"duet-upload"})}async setFocus(e){this.nativeInput&&this.nativeInput.focus(e)}async upload(e){await this.setFocus(),this.metaData=e,this.nativeInput.click()}async getFiles(){return!(!this.files||0===this.files.size)&&this.getFilesAsArray()}async updateValue(e,t,s){this.updateValueInMap(e,t,s)}render(){const t=this.identifier||this.uploadId;let s=this.description.replace(/{maxfiles}/g,this.maxFiles.toString());return s=s.replace(/{maxbytes}/g,`${Math.floor(this.maxBytes/1024/1024)} MB`),s=s.replace(/{filetypes}/g,this.allowedExtensions.split(",").join(", ")),e(i,{class:{"duet-m-0":"none"===this.margin}},e("duet-fieldset",{label:this.label,caption:s},e("slot",{name:"header"}),!this.files.size&&e("duet-label",{theme:"turva"===this.theme?"turva":"default",size:"small",class:{"duet-upload-filelist-empty":!this.files.size,"duet-upload-filelist":!0,"duet-upload-filelist-filled":this.files.size},id:this.labelId,for:t},this.fileListEmpty),!!this.files.size&&e("slot",{name:"fileheader"}),!!this.files.size&&e("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&&e("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&&e("slot",{name:"filefooter"}),e("duet-spacer",{size:"large"}),!this.hideButton&&e("duet-button",{id:this.buttonId,onClick:this.startUpload,"accessible-controls":t,disabled:this.fileMaxReached,"accessible-label":this.accessibleButtonLabel,"accessible-owns":t,size:"small",variation:"secondary",fixed:!0,icon:"action-add-circle"},this.buttonLabel),e("duet-spacer",{size:"medium"}),(this.fileMaxReached||this.bytesMaxReached)&&e("duet-alert",null,this.fileMaxReached&&u("duet-upload-301"),this.bytesMaxReached&&u("duet-upload-202")),e("duet-spacer",{size:"medium"}),e("duet-visually-hidden",null,e("input",{ref:e=>{this.nativeInput=e},accept:this.limitSelection?`${this.allowedMimetypes},${this.allowedExtensions}`:void 0,onBlur:this.onBlur,onFocus:this.onFocus,onChange:e=>this.onChange(e),type:"file",class:{"duet-upload":!0},disabled:this.disabled,"aria-hidden":"true",required:this.required,name:this.name,id:this.identifier,multiple:this.multiple,capture:"user"}))))}get element(){return a(this)}static get watchers(){return{valid:["watchValidHandler"]}}};y.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}::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}";export{y as duet_upload}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{c(i.next(e))}catch(t){r(t)}}function u(e){try{c(i["throw"](e))}catch(t){r(t)}}function c(e){e.done?n(e.value):o(e.value).then(a,u)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(t){return c([e,t])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,o&&(r=a[0]&2?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;if(o=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(u){a=[6,u];o=0}finally{i=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* Built with Duet Design System
|
|
4
|
-
*/System.register(["./p-e12f2b8b.system.js","./p-efaa0c04.system.js","./p-6e363557.system.js","./p-ddb6344c.system.js"],(function(e){"use strict";var t,n,i,o,r,a,u;return{setters:[function(e){t=e.E;n=e.r;i=e.h;o=e.H;r=e.g},function(e){a=e.i},function(e){u=e.g},function(){}],execute:function(){var c=function(e){if(typeof document==="undefined"||!e){return}var t=document.createElement("div");t.innerHTML=e;for(var n=t.childNodes.length-1;n>=0;n--){var i=t.childNodes[n];if(i.nodeName.toLowerCase()!=="svg"){t.removeChild(t.childNodes[n])}}return t.firstElementChild};var s=function(e){if(e.nodeName.toLowerCase()==="script"){return false}for(var t=0;t<e.attributes.length;t++){var n=e.attributes[t];if(n.name.toLowerCase().indexOf("on")===0){return false}}if(e.children){for(var t=0;t<e.children.length;t++){if(!s(e.children[t])){return false}}}return true};var d=function(e){{return t.cdnURIProd+"/icons/"+t.duetIconVersion+"/lib/assets/"+e+".svg"}};var h={};function l(e){if(h[e]){return h[e]}function t(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,o;return __generator(this,(function(r){switch(r.label){case 0:return[4,fetch(e)];case 1:t=r.sent();if(!t.ok){throw new Error("SVG request failed: "+t.status+" "+t.statusText)}return[4,t.text()];case 2:n=r.sent();i=c(n);if(!s(i)){throw new Error("SVG validation failed")}o=document.createElement("div");o.appendChild(i);return[2,o.innerHTML]}}))}))}var n=t();return h[e]=n}var p="*,*::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:16px !important;display:inline-block;width:auto;max-width:100%;color:inherit;-webkit-tap-highlight-color:transparent}@media (max-width: 35.9375em){:host(.duet-icon-has-outline){margin-bottom:0 !important}}@media (max-width: 35.9375em){:host(.duet-icon-has-background){margin-bottom:0 !important}}:host(.duet-m-0){margin:0 !important}@media (max-width: 35.9375em){:host(.duet-m-0){margin:0 !important}}.duet-icon{-webkit-user-select:none;user-select:none;width:100%;height:100%;transform-origin:top center}.duet-icon.duet-icon-has-outline{padding:12px;border-style:solid;border-width:1px;border-radius:50%}@media (max-width: 35.9375em){.duet-icon.duet-icon-has-outline{outline:1px solid transparent;transform:scale(0.8)}}.duet-icon.duet-icon-has-background{padding:16px;color:white;border-radius:50%}@media (max-width: 35.9375em){.duet-icon.duet-icon-has-background{outline:1px solid transparent;transform:scale(0.8)}}.duet-icon.duet-icon-has-background.duet-theme-turva,.duet-icon.duet-icon-has-background.duet-theme-default{color:white}.duet-icon.duet-icon-has-background.xxx-small .duet-icon-svg,.duet-icon.duet-icon-has-outline.xxx-small .duet-icon-svg{width:10px;height:10px}.duet-icon.duet-icon-has-background.xx-small .duet-icon-svg,.duet-icon.duet-icon-has-outline.xx-small .duet-icon-svg{width:16px;height:16px}@media (max-width: 35.9375em){.duet-icon.duet-icon-not-responsive{transform:scale(1) !important}}.duet-icon.duet-theme-default{color:#0077b3}.duet-icon.duet-theme-turva{color:#c60c30}.duet-icon.auto .duet-icon-svg{width:100%;height:100%}.duet-icon.xxx-small .duet-icon-svg{width:7px;height:7px}.duet-icon.duet-icon-has-background.xxx-small{padding:6px}.duet-icon.duet-icon-has-outline.xxx-small{padding:4px}.duet-icon.xx-small .duet-icon-svg{width:10px;height:10px}.duet-icon.duet-icon-has-background.xx-small{padding:8px}.duet-icon.duet-icon-has-outline.xx-small{padding:7px}.duet-icon.x-small .duet-icon-svg{width:16px;height:16px}.duet-icon.duet-icon-has-outline.x-small{padding:10px}.duet-icon.duet-icon-has-background.x-small{padding:12px}.duet-icon.small .duet-icon-svg{width:20px;height:20px}.duet-icon.duet-icon-has-background.small{padding:14px}.duet-icon.large .duet-icon-svg{width:30px;height:30px}.duet-icon.x-large .duet-icon-svg{width:36px;height:36px}.duet-icon.xx-large .duet-icon-svg{width:48px;height:48px}.duet-icon.xxx-large .duet-icon-svg{width:48px;height:48px}@media (min-width: 48em){.duet-icon.xxx-large .duet-icon-svg{width:72px;height:72px}}.duet-icon .duet-icon-svg{display:block;width:24px;min-width:100%;height:24px;font-size:0}.duet-icon svg{width:100%;min-width:100%;fill:currentColor}";var g=e("duet_icon",function(){function e(e){n(this,e);this.theme="";this.name="action-add";this.margin="auto";this.responsive=true;this.color="";this.background="";this.size="medium";this.outline=""}e.prototype.componentWillLoad=function(){a(this);if(this.src&&this.icon){console.warn("[DUET COMPONENTS]: <duet-icon> should have either have src or icon attributes, but not both. icon attribute will take precedence","icon:",this.icon,"src:",this.src)}return this.loadIcon()};e.prototype.loadIcon=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:if(this.icon){this.svgContent=this.icon;return[2]}e=this.src?this.src:d(this.name);i.label=1;case 1:i.trys.push([1,3,,4]);t=this;return[4,l(e)];case 2:t.svgContent=i.sent();return[3,4];case 3:n=i.sent();console.warn("[DUET COMPONENTS]: <duet-icon> could not load SVG from URL: "+e+".",n);return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e;var t=this.color==="currentColor"?"currentColor":u(this.color)||u(this.outline);var n={color:t,background:u(this.background),"border-color":u(this.outline)};return i(o,{class:{"duet-m-0":this.margin==="none","duet-icon-has-outline":!!this.outline,"duet-icon-has-background":!!this.background}},i("div",{"aria-hidden":"true",style:n,class:(e={"duet-icon":true},e[this.size]=true,e["duet-theme-turva"]=this.theme==="turva",e["duet-theme-default"]=this.theme==="default",e["duet-icon-has-outline"]=!!this.outline,e["duet-icon-has-background"]=!!this.background,e["duet-icon-not-responsive"]=!this.responsive,e)},i("span",{"aria-hidden":"true",class:"duet-icon-svg",innerHTML:this.svgContent})))};Object.defineProperty(e.prototype,"element",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{src:["loadIcon"],icon:["loadIcon"],name:["loadIcon"]}},enumerable:false,configurable:true});return e}());g.style=p}}}));
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
System.register(["./p-e12f2b8b.system.js","./p-70fafc98.system.js","./p-efaa0c04.system.js","./p-6e363557.system.js","./p-5f6bd5db.system.js","./p-9a945278.system.js","./p-ddb6344c.system.js"],(function(e){"use strict";var t,i,a,o,n,s,r,l,d;return{setters:[function(e){t=e.r;i=e.c;a=e.h;o=e.g;n=e.H},function(e){s=e.g},function(e){r=e.i},function(e){l=e.g},function(e){d=e.c},function(){},function(){}],execute:function(){var u="*.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}";var p=e("duet_editable_table_button",function(){function e(e){var a=this;t(this,e);this.duetEditableItemAction=i(this,"duetEditableItemAction",7);this.isHovering=false;this.theme="";this.actions=undefined;this.uid="";this.group="";this.keyName="";this.onMouseEnter=function(){a.isHovering=true};this.onMouseLeave=function(){a.isHovering=false}}e.prototype.componentWillLoad=function(){r(this)};e.prototype.emitActionEvent=function(e){this.duetEditableItemAction.emit({originalEvent:e,uid:this.uid,group:this.group,action:this.actions.id,keyName:this.keyName,component:"duet-editable-table-item"})};e.prototype.render=function(){var e=this;return a("button",{style:{"border-color":this.isHovering?l(this.actions.color_hover):l(this.actions.color)},onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,role:"menuitem",class:"duet-editable-table-actions-items-button","aria-label":this.actions.label?s(this.actions.label):undefined,onClick:function(t){return e.emitActionEvent(t)}},a("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"}))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());p.style=u;var c='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}fieldset{border:0}legend{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-legend-wrapper{position:relative;display:block;width:100%;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:600;line-height:1.5;color:#00294d;text-align:left;background:transparent}.duet-theme-turva .duet-legend-wrapper{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}.duet-fieldset-label{margin-bottom:12px !important;margin-top:8px}.duet-legend-has-caption .duet-fieldset-label{margin-bottom:6px !important}.duet-legend-has-tooltip .duet-fieldset-label{padding-right:36px}@media (min-width: 48em){.duet-legend-has-tooltip .duet-fieldset-label{margin-bottom:3px !important;padding-right:0}}@media (min-width: 48em){.duet-legend-has-tooltip.duet-legend-has-caption .duet-fieldset-label{margin-bottom:-3px !important}}.duet-fieldset-caption{margin-bottom:12px !important}.duet-fieldset-help{display:block;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.875rem;font-weight:400;line-height:1.25;color:#de2362;border-radius:4px}.duet-fieldset-help span{display:block;margin-top:12px}.duet-theme-turva .duet-fieldset-help{color:#e02a0d}::slotted(duet-tooltip){position:absolute;top:4px;right:0}@media (min-width: 48em){::slotted(duet-tooltip){position:relative;right:auto}}.duet-legend-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}';var h=e("duet_fieldset",function(){function e(e){var i=this;t(this,e);this.errorId=d("DuetError");this.labelId=d("DuetLabel");this.hasTooltip=false;this.theme="";this.margin="auto";this.labelHidden=false;this.checkHasTooltip=function(){i.hasTooltip=!!i.element.querySelector("[slot='tooltip']")}}e.prototype.componentWillLoad=function(){r(this);this.checkHasTooltip()};e.prototype.render=function(){return a(n,{class:{"duet-m-0":this.margin==="none"}},a("fieldset",{"aria-labelledby":this.labelId+" "+this.errorId,class:{"duet-fieldset":true,"duet-theme-turva":this.theme==="turva"}},a("legend",{id:this.labelId},a("span",null,this.label),this.caption&&a("span",null,this.caption)),a("div",{class:{"duet-legend-wrapper":true,"duet-legend-has-caption":!!this.caption,"duet-legend-has-tooltip":this.hasTooltip,"duet-legend-hidden":this.labelHidden}},a("div",{class:"duet-fieldset-label"},a("span",{"aria-hidden":"true"},this.label),a("slot",{onSlotchange:this.checkHasTooltip,name:"tooltip"})),this.caption&&a("div",{class:"duet-fieldset-caption","aria-hidden":"true"},a("duet-caption",{margin:"none"},this.caption))),a("slot",null),a("span",{class:"duet-fieldset-help",id:this.errorId,"aria-live":"assertive","aria-relevant":"additions removals"},this.error&&a("span",null,this.error))))};Object.defineProperty(e.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());h.style=c;var b=e("duet_upload_aria_status",function(){function e(e){var i=this;t(this,e);this.statusMessage=null;this.statusMessageLabel=null;this.accessibleAriaLive="polite";this.valid=undefined;this.total=undefined;this.invalid=undefined;this.inprogress=undefined;this.replacePlaceHolders=function(e){var t=function(e){return e>1?e+" "+i.statusMessageLabel.files:e+" "+i.statusMessageLabel.file};return e.replace("{filesUploaded}",t(i.valid)).replace("{filesInProgress}",t(i.inprogress)).replace("{filesTotal}",t(i.total)).replace("{filesWithErrors}",t(i.invalid))};this.getStatusMessage=function(){var e=i.statusMessageLabel,t=e.done,a=e.inProgress,o=e.doneWithErrors,n=e.inProgressWithErrors;var s=i.invalid>0;var r=i.inprogress>0;var l=i.inprogress>0&&s;var d=i.valid===i.total&&!r&&!s;var u=i.valid+i.invalid===i.total&&!r;if(d){i.statusMessage=i.replacePlaceHolders(t);return}else if(l){i.statusMessage=i.replacePlaceHolders(n);return}else if(r){i.statusMessage=i.replacePlaceHolders(a);return}else if(u){i.statusMessage=i.replacePlaceHolders(o);return}return}}e.prototype.watchHandler=function(e,t){if(e!==t){this.getStatusMessage()}};e.prototype.render=function(){return a(n,{role:"status","aria-live":"assertive","aria-atomic":"true","aria-relevant":"all"},a("duet-visually-hidden",null,this.statusMessage))};Object.defineProperty(e,"watchers",{get:function(){return{valid:["watchHandler"],invalid:["watchHandler"],inprogress:["watchHandler"],total:["watchHandler"]}},enumerable:false,configurable:true});return e}())}}}));
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import{E as t,r as i,h as e,H as o,g as n}from"./p-e2a44156.js";import{i as d}from"./p-a28cf57b.js";import{g as a}from"./p-3c1971d8.js";import"./p-ad07f399.js";const r=t=>{if("script"===t.nodeName.toLowerCase())return!1;for(let i=0;i<t.attributes.length;i++)if(0===t.attributes[i].name.toLowerCase().indexOf("on"))return!1;if(t.children)for(let i=0;i<t.children.length;i++)if(!r(t.children[i]))return!1;return!0},s={};let c=class{constructor(t){i(this,t),this.theme="",this.name="action-add",this.margin="auto",this.responsive=!0,this.color="",this.background="",this.size="medium",this.outline=""}componentWillLoad(){return d(this),this.src&&this.icon&&console.warn("[DUET COMPONENTS]: <duet-icon> should have either have src or icon attributes, but not both. icon attribute will take precedence","icon:",this.icon,"src:",this.src),this.loadIcon()}async loadIcon(){if(this.icon)return void(this.svgContent=this.icon);const i=this.src?this.src:`${t.cdnURIProd}/icons/${t.duetIconVersion}/lib/assets/${this.name}.svg`;try{this.svgContent=await function(t){if(s[t])return s[t];const i=async function(){const i=await fetch(t);if(!i.ok)throw new Error(`SVG request failed: ${i.status} ${i.statusText}`);const e=(t=>{if("undefined"==typeof document||!t)return;const i=document.createElement("div");i.innerHTML=t;for(let e=i.childNodes.length-1;e>=0;e--)"svg"!==i.childNodes[e].nodeName.toLowerCase()&&i.removeChild(i.childNodes[e]);return i.firstElementChild})(await i.text());if(!r(e))throw new Error("SVG validation failed");const o=document.createElement("div");return o.appendChild(e),o.innerHTML}();return s[t]=i}(i)}catch(e){console.warn(`[DUET COMPONENTS]: <duet-icon> could not load SVG from URL: ${i}.`,e)}}render(){const t={color:"currentColor"===this.color?"currentColor":a(this.color)||a(this.outline),background:a(this.background),"border-color":a(this.outline)};return e(o,{class:{"duet-m-0":"none"===this.margin,"duet-icon-has-outline":!!this.outline,"duet-icon-has-background":!!this.background}},e("div",{"aria-hidden":"true",style:t,class:{"duet-icon":!0,[this.size]:!0,"duet-theme-turva":"turva"===this.theme,"duet-theme-default":"default"===this.theme,"duet-icon-has-outline":!!this.outline,"duet-icon-has-background":!!this.background,"duet-icon-not-responsive":!this.responsive}},e("span",{"aria-hidden":"true",class:"duet-icon-svg",innerHTML:this.svgContent})))}get element(){return n(this)}static get watchers(){return{src:["loadIcon"],icon:["loadIcon"],name:["loadIcon"]}}};c.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:16px !important;display:inline-block;width:auto;max-width:100%;color:inherit;-webkit-tap-highlight-color:transparent}@media (max-width: 35.9375em){:host(.duet-icon-has-outline){margin-bottom:0 !important}}@media (max-width: 35.9375em){:host(.duet-icon-has-background){margin-bottom:0 !important}}:host(.duet-m-0){margin:0 !important}@media (max-width: 35.9375em){:host(.duet-m-0){margin:0 !important}}.duet-icon{-webkit-user-select:none;user-select:none;width:100%;height:100%;transform-origin:top center}.duet-icon.duet-icon-has-outline{padding:12px;border-style:solid;border-width:1px;border-radius:50%}@media (max-width: 35.9375em){.duet-icon.duet-icon-has-outline{outline:1px solid transparent;transform:scale(0.8)}}.duet-icon.duet-icon-has-background{padding:16px;color:white;border-radius:50%}@media (max-width: 35.9375em){.duet-icon.duet-icon-has-background{outline:1px solid transparent;transform:scale(0.8)}}.duet-icon.duet-icon-has-background.duet-theme-turva,.duet-icon.duet-icon-has-background.duet-theme-default{color:white}.duet-icon.duet-icon-has-background.xxx-small .duet-icon-svg,.duet-icon.duet-icon-has-outline.xxx-small .duet-icon-svg{width:10px;height:10px}.duet-icon.duet-icon-has-background.xx-small .duet-icon-svg,.duet-icon.duet-icon-has-outline.xx-small .duet-icon-svg{width:16px;height:16px}@media (max-width: 35.9375em){.duet-icon.duet-icon-not-responsive{transform:scale(1) !important}}.duet-icon.duet-theme-default{color:#0077b3}.duet-icon.duet-theme-turva{color:#c60c30}.duet-icon.auto .duet-icon-svg{width:100%;height:100%}.duet-icon.xxx-small .duet-icon-svg{width:7px;height:7px}.duet-icon.duet-icon-has-background.xxx-small{padding:6px}.duet-icon.duet-icon-has-outline.xxx-small{padding:4px}.duet-icon.xx-small .duet-icon-svg{width:10px;height:10px}.duet-icon.duet-icon-has-background.xx-small{padding:8px}.duet-icon.duet-icon-has-outline.xx-small{padding:7px}.duet-icon.x-small .duet-icon-svg{width:16px;height:16px}.duet-icon.duet-icon-has-outline.x-small{padding:10px}.duet-icon.duet-icon-has-background.x-small{padding:12px}.duet-icon.small .duet-icon-svg{width:20px;height:20px}.duet-icon.duet-icon-has-background.small{padding:14px}.duet-icon.large .duet-icon-svg{width:30px;height:30px}.duet-icon.x-large .duet-icon-svg{width:36px;height:36px}.duet-icon.xx-large .duet-icon-svg{width:48px;height:48px}.duet-icon.xxx-large .duet-icon-svg{width:48px;height:48px}@media (min-width: 48em){.duet-icon.xxx-large .duet-icon-svg{width:72px;height:72px}}.duet-icon .duet-icon-svg{display:block;width:24px;min-width:100%;height:24px;font-size:0}.duet-icon svg{width:100%;min-width:100%;fill:currentColor}";export{c as duet_icon}
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-84d97bd1.js';
|
|
5
|
-
import { g as getLocaleString } from './language-utils-344d894c.js';
|
|
6
|
-
import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
|
|
7
|
-
import { g as getColorByName } from './token-utils-590d9413.js';
|
|
8
|
-
import { c as createID } from './create-id-981107da.js';
|
|
9
|
-
import './string-utils-2f1793b8.js';
|
|
10
|
-
import './tokens.module-49cbf963.js';
|
|
11
|
-
|
|
12
|
-
const duetEditableTableButtonCss = "*.sc-duet-editable-table-button,*.sc-duet-editable-table-button::after,*.sc-duet-editable-table-button::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button{display:flex;align-content:space-between;justify-content:center;min-width:32px;max-width:32px;height:100%;min-height:32px;max-height:32px;padding:0;margin:0;cursor:pointer !important;background-color:transparent;border:1px solid;border-radius:50%}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button duet-icon.sc-duet-editable-table-button{align-self:center}";
|
|
13
|
-
|
|
14
|
-
let DuetEditableTableButton = class {
|
|
15
|
-
constructor(hostRef) {
|
|
16
|
-
registerInstance(this, hostRef);
|
|
17
|
-
this.duetEditableItemAction = createEvent(this, "duetEditableItemAction", 7);
|
|
18
|
-
this.isHovering = false;
|
|
19
|
-
/**
|
|
20
|
-
* Theme of the empty state component.
|
|
21
|
-
*/
|
|
22
|
-
this.theme = "";
|
|
23
|
-
/**
|
|
24
|
-
* action items passed from host component
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
this.actions = undefined;
|
|
28
|
-
/**
|
|
29
|
-
* uid that gets passed along when the action is emitted
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
this.uid = "";
|
|
33
|
-
/**
|
|
34
|
-
* group associated with action
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
this.group = "";
|
|
38
|
-
/**
|
|
39
|
-
* key of the item in the map
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
this.keyName = "";
|
|
43
|
-
this.onMouseEnter = () => {
|
|
44
|
-
this.isHovering = true;
|
|
45
|
-
};
|
|
46
|
-
this.onMouseLeave = () => {
|
|
47
|
-
this.isHovering = false;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
/**
|
|
52
|
-
* Component lifecycle events.
|
|
53
|
-
*/
|
|
54
|
-
componentWillLoad() {
|
|
55
|
-
inheritGlobalTheme(this);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
/**
|
|
59
|
-
* private functions
|
|
60
|
-
*/
|
|
61
|
-
emitActionEvent(ev) {
|
|
62
|
-
this.duetEditableItemAction.emit({
|
|
63
|
-
originalEvent: ev,
|
|
64
|
-
uid: this.uid,
|
|
65
|
-
group: this.group,
|
|
66
|
-
action: this.actions.id,
|
|
67
|
-
keyName: this.keyName,
|
|
68
|
-
component: "duet-editable-table-item",
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* render() function
|
|
73
|
-
* Always the last one in the class.
|
|
74
|
-
*/
|
|
75
|
-
render() {
|
|
76
|
-
return (h("button", { style: {
|
|
77
|
-
"border-color": this.isHovering
|
|
78
|
-
? getColorByName(this.actions.color_hover)
|
|
79
|
-
: getColorByName(this.actions.color),
|
|
80
|
-
}, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, role: "menuitem", class: "duet-editable-table-actions-items-button", "aria-label": this.actions.label ? getLocaleString(this.actions.label) : undefined, onClick: ev => this.emitActionEvent(ev) }, h("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" })));
|
|
81
|
-
}
|
|
82
|
-
get el() { return getElement(this); }
|
|
83
|
-
};
|
|
84
|
-
DuetEditableTableButton.style = duetEditableTableButtonCss;
|
|
85
|
-
|
|
86
|
-
const duetFieldsetCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}fieldset{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}";
|
|
87
|
-
|
|
88
|
-
let DuetFieldset = class {
|
|
89
|
-
constructor(hostRef) {
|
|
90
|
-
registerInstance(this, hostRef);
|
|
91
|
-
this.errorId = createID("DuetError");
|
|
92
|
-
this.labelId = createID("DuetLabel");
|
|
93
|
-
this.hasTooltip = false;
|
|
94
|
-
/**
|
|
95
|
-
* Theme of the fieldset.
|
|
96
|
-
*/
|
|
97
|
-
this.theme = "";
|
|
98
|
-
/**
|
|
99
|
-
* Controls the margin of the component.
|
|
100
|
-
*/
|
|
101
|
-
this.margin = "auto";
|
|
102
|
-
/**
|
|
103
|
-
* Visually hide the label, but still show it to screen readers.
|
|
104
|
-
*/
|
|
105
|
-
this.labelHidden = false;
|
|
106
|
-
this.checkHasTooltip = () => {
|
|
107
|
-
this.hasTooltip = !!this.element.querySelector("[slot='tooltip']");
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Component lifecycle events.
|
|
112
|
-
*/
|
|
113
|
-
componentWillLoad() {
|
|
114
|
-
inheritGlobalTheme(this);
|
|
115
|
-
this.checkHasTooltip();
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* render() function
|
|
119
|
-
* Always the last one in the class.
|
|
120
|
-
*/
|
|
121
|
-
render() {
|
|
122
|
-
return (h(Host, { class: { "duet-m-0": this.margin === "none" } }, h("fieldset", { "aria-labelledby": `${this.labelId} ${this.errorId}`, class: {
|
|
123
|
-
"duet-fieldset": true,
|
|
124
|
-
"duet-theme-turva": this.theme === "turva",
|
|
125
|
-
} }, h("legend", { id: this.labelId }, h("span", null, this.label), this.caption && h("span", null, this.caption)), h("div", { class: {
|
|
126
|
-
"duet-legend-wrapper": true,
|
|
127
|
-
"duet-legend-has-caption": !!this.caption,
|
|
128
|
-
"duet-legend-has-tooltip": this.hasTooltip,
|
|
129
|
-
"duet-legend-hidden": this.labelHidden,
|
|
130
|
-
} }, h("div", { class: "duet-fieldset-label" }, h("span", { "aria-hidden": "true" }, this.label), h("slot", { onSlotchange: this.checkHasTooltip, name: "tooltip" })), this.caption && (h("div", { class: "duet-fieldset-caption", "aria-hidden": "true" }, h("duet-caption", { margin: "none" }, this.caption)))), h("slot", null), h("span", { class: "duet-fieldset-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h("span", null, this.error)))));
|
|
131
|
-
}
|
|
132
|
-
get element() { return getElement(this); }
|
|
133
|
-
};
|
|
134
|
-
DuetFieldset.style = duetFieldsetCss;
|
|
135
|
-
|
|
136
|
-
let DuetUploadAriaStatus = class {
|
|
137
|
-
constructor(hostRef) {
|
|
138
|
-
registerInstance(this, hostRef);
|
|
139
|
-
/**
|
|
140
|
-
* State() variables
|
|
141
|
-
*/
|
|
142
|
-
this.statusMessage = null;
|
|
143
|
-
/**
|
|
144
|
-
* State() variables
|
|
145
|
-
*/
|
|
146
|
-
this.statusMessageLabel = null;
|
|
147
|
-
/**
|
|
148
|
-
* Adds accessible label that is read aloud
|
|
149
|
-
*/
|
|
150
|
-
this.accessibleAriaLive = "polite";
|
|
151
|
-
/**
|
|
152
|
-
* valid file amount
|
|
153
|
-
*/
|
|
154
|
-
this.valid = undefined;
|
|
155
|
-
/**
|
|
156
|
-
* total files
|
|
157
|
-
*/
|
|
158
|
-
this.total = undefined;
|
|
159
|
-
/**
|
|
160
|
-
* invalid file amount
|
|
161
|
-
*/
|
|
162
|
-
this.invalid = undefined;
|
|
163
|
-
/**
|
|
164
|
-
* valid file amount
|
|
165
|
-
*/
|
|
166
|
-
this.inprogress = undefined;
|
|
167
|
-
/**
|
|
168
|
-
* Component lifecycle events.
|
|
169
|
-
*/
|
|
170
|
-
this.replacePlaceHolders = (statusString) => {
|
|
171
|
-
const addFiles = (amount) => {
|
|
172
|
-
return amount > 1 ? `${amount} ${this.statusMessageLabel.files}` : `${amount} ${this.statusMessageLabel.file}`;
|
|
173
|
-
};
|
|
174
|
-
return statusString
|
|
175
|
-
.replace("{filesUploaded}", addFiles(this.valid))
|
|
176
|
-
.replace("{filesInProgress}", addFiles(this.inprogress))
|
|
177
|
-
.replace("{filesTotal}", addFiles(this.total))
|
|
178
|
-
.replace("{filesWithErrors}", addFiles(this.invalid));
|
|
179
|
-
};
|
|
180
|
-
this.getStatusMessage = () => {
|
|
181
|
-
const { done, inProgress, doneWithErrors, inProgressWithErrors } = this.statusMessageLabel;
|
|
182
|
-
const hasErrors = this.invalid > 0;
|
|
183
|
-
const isInProgress = this.inprogress > 0;
|
|
184
|
-
const isInProgressWithErrors = this.inprogress > 0 && hasErrors;
|
|
185
|
-
const isDone = this.valid === this.total && !isInProgress && !hasErrors;
|
|
186
|
-
const isDoneWithErrors = this.valid + this.invalid === this.total && !isInProgress;
|
|
187
|
-
if (isDone) {
|
|
188
|
-
this.statusMessage = this.replacePlaceHolders(done);
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
else if (isInProgressWithErrors) {
|
|
192
|
-
this.statusMessage = this.replacePlaceHolders(inProgressWithErrors);
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
else if (isInProgress) {
|
|
196
|
-
this.statusMessage = this.replacePlaceHolders(inProgress);
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
else if (isDoneWithErrors) {
|
|
200
|
-
this.statusMessage = this.replacePlaceHolders(doneWithErrors);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
return;
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
watchHandler(newValue, oldValue) {
|
|
207
|
-
if (newValue !== oldValue) {
|
|
208
|
-
this.getStatusMessage();
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* render() function
|
|
213
|
-
* Always the last one in the class.
|
|
214
|
-
*/
|
|
215
|
-
render() {
|
|
216
|
-
return (h(Host, { role: "status", "aria-live": "assertive", "aria-atomic": "true", "aria-relevant": "all" }, h("duet-visually-hidden", null, this.statusMessage)));
|
|
217
|
-
}
|
|
218
|
-
static get watchers() { return {
|
|
219
|
-
"valid": ["watchHandler"],
|
|
220
|
-
"invalid": ["watchHandler"],
|
|
221
|
-
"inprogress": ["watchHandler"],
|
|
222
|
-
"total": ["watchHandler"]
|
|
223
|
-
}; }
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
export { DuetEditableTableButton as duet_editable_table_button, DuetFieldset as duet_fieldset, DuetUploadAriaStatus as duet_upload_aria_status };
|