@duetds/components 4.33.1 → 4.34.2
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 +438 -191
- package/lib/cjs/{dom-c850c8d7.js → dom-52a4f07a.js} +1 -1
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-caption_4.cjs.entry.js +3 -3
- package/lib/cjs/duet-card.cjs.entry.js +2 -2
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-collapsible.cjs.entry.js +5 -453
- 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 +14 -7
- package/lib/cjs/duet-editable-table_4.cjs.entry.js +86 -11
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +2 -2
- package/lib/cjs/duet-grid_2.cjs.entry.js +26 -3
- package/lib/cjs/duet-header_2.cjs.entry.js +220 -47
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +13 -21
- package/lib/cjs/duet-input_2.cjs.entry.js +3 -4
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-modal.cjs.entry.js +2 -2
- package/lib/cjs/duet-notification_2.cjs.entry.js +2 -2
- 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 +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +4 -4
- package/lib/cjs/{focus-utils-b609a7a5.js → focus-utils-b57facfe.js} +1 -1
- package/lib/cjs/form-search-d61b2843.js +8 -0
- package/lib/cjs/{index-9a57d969.js → index-e2021bf7.js} +2 -9
- package/lib/cjs/loader.cjs.js +3 -3
- package/lib/cjs/{shadow-css-e3edeed1.js → shadow-css-e1b62a99.js} +1 -1
- package/lib/cjs/token-utils-05bd23b4.js +77 -0
- package/lib/cjs/tokens-8596cece.js +459 -0
- package/lib/collection/collection-manifest.json +2 -2
- package/lib/collection/components/duet-collapsible/duet-collapsible.js +4 -1
- package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +13 -6
- package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +25 -3
- package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +3 -3
- package/lib/collection/components/duet-editable-table/duet-editable-table.js +58 -2
- package/lib/collection/components/duet-footer/duet-footer.css +2 -0
- package/lib/collection/components/duet-grid/duet-grid.js +25 -2
- package/lib/collection/components/duet-header/duet-header-dropdown.js +27 -0
- package/lib/collection/components/duet-header/duet-header-hamburger.js +9 -0
- package/lib/collection/components/duet-header/duet-header-icon.js +9 -0
- package/lib/collection/components/duet-header/duet-header.css +272 -39
- package/lib/collection/components/duet-header/duet-header.js +316 -122
- package/lib/collection/components/duet-icon/duet-icon.js +11 -5
- package/lib/collection/components/duet-icon/icon-utils.js +5 -15
- package/lib/collection/components/duet-link/duet-link.js +4 -1
- package/lib/collection/components/duet-list-item/duet-list-item.css +1 -1
- package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.css +4 -3
- package/lib/collection/components/duet-table/duet-table.css +42 -17
- package/lib/collection/components/duet-table/duet-table.js +2 -2
- package/lib/collection/components/duet-upload/duet-upload.js +26 -4
- package/lib/collection/utils/template-utils.js +33 -0
- package/lib/collection/utils/token-utils.js +67 -14
- package/lib/custom-elements-bundle/index.js +422 -114
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-bf9f6d80.system.entry.js → p-00bf3bbb.system.entry.js} +1 -1
- package/lib/duet/{p-75edcaed.entry.js → p-08d1abc7.entry.js} +1 -1
- package/lib/duet/{p-2297d13f.system.entry.js → p-0dc01111.system.entry.js} +1 -1
- package/lib/duet/{p-19d7d9d5.system.entry.js → p-0e742087.system.entry.js} +1 -1
- package/lib/duet/p-12941c46.system.entry.js +4 -0
- package/lib/duet/{p-b314348c.system.js → p-13bc14a6.system.js} +2 -2
- package/lib/duet/{p-cf319832.system.entry.js → p-13d5fe80.system.entry.js} +1 -1
- package/lib/duet/{p-35a3794e.js → p-183726f7.js} +0 -0
- package/lib/duet/{p-323643af.system.entry.js → p-1fff32a9.system.entry.js} +1 -1
- package/lib/duet/{p-b5c7d304.system.entry.js → p-2524481a.system.entry.js} +1 -1
- package/lib/duet/{p-6a5ab3eb.entry.js → p-2862054c.entry.js} +1 -1
- package/lib/duet/{p-e1dc86b5.system.js → p-30d13a27.system.js} +1 -1
- package/lib/duet/p-354bf924.entry.js +4 -0
- package/lib/duet/{p-df6f39a3.entry.js → p-3998eed6.entry.js} +1 -1
- package/lib/duet/{p-079795e5.entry.js → p-3e0a774d.entry.js} +1 -1
- package/lib/duet/{p-fd613733.entry.js → p-3e273d8d.entry.js} +1 -1
- package/lib/duet/{p-2fdcff82.entry.js → p-3e47c910.entry.js} +1 -1
- package/lib/duet/{p-de5ec54e.system.entry.js → p-45a6838d.system.entry.js} +1 -1
- package/lib/duet/p-4836f66d.entry.js +4 -0
- package/lib/duet/{p-af49d4f9.entry.js → p-488addbc.entry.js} +1 -1
- package/lib/duet/{p-ba18b56e.entry.js → p-4a742d83.entry.js} +1 -1
- package/lib/duet/{p-37cda933.entry.js → p-4d5531be.entry.js} +1 -1
- package/lib/duet/{p-00210a63.entry.js → p-4db07868.entry.js} +1 -1
- package/lib/duet/p-50b4fb2c.js +4 -0
- package/lib/duet/{p-987edcd0.js → p-52621211.js} +0 -0
- package/lib/duet/p-582f9135.system.entry.js +4 -0
- package/lib/duet/{p-85e52be8.entry.js → p-58d7f2d1.entry.js} +1 -1
- package/lib/duet/{p-b25edbbe.entry.js → p-5a5e7977.entry.js} +1 -1
- package/lib/duet/{p-85ad012a.system.entry.js → p-5c67bb73.system.entry.js} +1 -1
- package/lib/duet/{p-3013c9bb.system.entry.js → p-5e03b63f.system.entry.js} +1 -1
- package/lib/duet/{p-e8123a53.entry.js → p-5f2fb5db.entry.js} +1 -1
- package/lib/duet/{p-f5a55b3c.entry.js → p-5f813e15.entry.js} +1 -1
- package/lib/duet/p-5f866721.entry.js +4 -0
- package/lib/duet/p-60aa83c0.js +4 -0
- package/lib/duet/{p-bf4596bd.system.entry.js → p-62de4645.system.entry.js} +1 -1
- package/lib/duet/{p-360086f8.entry.js → p-66c35cd2.entry.js} +1 -1
- package/lib/duet/{p-cbdb9e98.system.entry.js → p-69133107.system.entry.js} +1 -1
- package/lib/duet/p-6a8b3cf0.system.entry.js +4 -0
- package/lib/duet/{p-c18a599e.system.js → p-6e4fd6ba.system.js} +0 -0
- package/lib/duet/{p-e2596ea0.entry.js → p-72ad7798.entry.js} +1 -1
- package/lib/duet/{p-32b7397d.entry.js → p-746b3bee.entry.js} +1 -1
- package/lib/duet/p-75261615.system.entry.js +4 -0
- package/lib/duet/{p-8aaf3383.entry.js → p-760d2226.entry.js} +1 -1
- package/lib/duet/{p-7530be48.system.entry.js → p-7a0a375e.system.entry.js} +1 -1
- package/lib/duet/p-8143f3de.js +4 -0
- package/lib/duet/p-8b01f978.system.entry.js +4 -0
- package/lib/duet/{p-6e4b1c0d.entry.js → p-8d42cb7c.entry.js} +1 -1
- package/lib/duet/p-8e16057d.system.entry.js +4 -0
- package/lib/duet/p-8f477bd6.system.js +4 -0
- package/lib/duet/p-90e7e876.entry.js +4 -0
- package/lib/duet/{p-09013a48.system.entry.js → p-939bf739.system.entry.js} +1 -1
- package/lib/duet/{p-0205162d.entry.js → p-9793f3d8.entry.js} +1 -1
- package/lib/duet/p-9849a4ab.system.entry.js +4 -0
- package/lib/duet/{p-5cfc53f9.entry.js → p-9d487a0d.entry.js} +1 -1
- package/lib/duet/p-a16a58c1.system.js +4 -0
- package/lib/duet/p-a52d436c.entry.js +4 -0
- package/lib/duet/{p-e48f3a32.system.entry.js → p-a58f0665.system.entry.js} +1 -1
- package/lib/duet/{p-9e79e033.entry.js → p-a900d55b.entry.js} +1 -1
- package/lib/duet/p-ae46a7d2.system.entry.js +4 -0
- package/lib/duet/{p-6f36f647.system.entry.js → p-ae8401c9.system.entry.js} +1 -1
- package/lib/duet/{p-e60ee8b0.entry.js → p-b70f164d.entry.js} +1 -1
- package/lib/duet/{p-3ba62cf1.system.entry.js → p-b8dde0c8.system.entry.js} +1 -1
- package/lib/duet/{p-e5031543.entry.js → p-baef2241.entry.js} +1 -1
- package/lib/duet/{p-ef7251bf.entry.js → p-c50bbff5.entry.js} +1 -1
- package/lib/duet/{p-3fd9190b.system.entry.js → p-c67a63cc.system.entry.js} +1 -1
- package/lib/duet/p-c6ba80c6.entry.js +4 -0
- package/lib/duet/{p-e7b90769.system.entry.js → p-c92b1af1.system.entry.js} +1 -1
- package/lib/duet/{p-71a77368.system.entry.js → p-cdaa629d.system.entry.js} +1 -1
- package/lib/duet/{p-c1a1ea1b.js → p-ce566b2b.js} +1 -1
- package/lib/duet/p-d004da5f.js +4 -0
- package/lib/duet/{p-e70088d5.entry.js → p-d1adeb76.entry.js} +1 -1
- package/lib/duet/{p-5decc259.system.entry.js → p-d3b5d2ef.system.entry.js} +1 -1
- package/lib/duet/{p-a2a00146.system.entry.js → p-db87c4b1.system.entry.js} +1 -1
- package/lib/duet/{p-9f35d682.entry.js → p-ddbdac54.entry.js} +1 -1
- package/lib/duet/{p-e370c18b.entry.js → p-de23ae41.entry.js} +1 -1
- package/lib/duet/{p-f0cfe033.system.entry.js → p-e0038277.system.entry.js} +1 -1
- package/lib/duet/p-e1c6f74b.entry.js +4 -0
- package/lib/duet/{p-1cbc6269.entry.js → p-e242bf98.entry.js} +1 -1
- package/lib/duet/{p-51955fc0.system.js → p-e3973f41.system.js} +1 -1
- package/lib/duet/{p-0d22396e.system.js → p-e5c1751e.system.js} +0 -0
- package/lib/duet/p-ec5d0cda.entry.js +4 -0
- package/lib/duet/{p-43847557.entry.js → p-ee74ff67.entry.js} +1 -1
- package/lib/duet/{p-6a4d85ed.system.entry.js → p-eed6f9cc.system.entry.js} +1 -1
- package/lib/duet/{p-7a8597c2.system.entry.js → p-f01494f9.system.entry.js} +1 -1
- package/lib/duet/{p-b4111e88.system.entry.js → p-f2c402a9.system.entry.js} +1 -1
- package/lib/duet/{p-4b6e8558.system.entry.js → p-f3c258d8.system.entry.js} +1 -1
- package/lib/duet/{p-2a822e91.system.entry.js → p-f6e1fb0f.system.entry.js} +1 -1
- package/lib/duet/{p-020a2c42.system.entry.js → p-f7f4f98a.system.entry.js} +1 -1
- package/lib/duet/{p-dd76db9b.system.entry.js → p-f9a096a9.system.entry.js} +1 -1
- package/lib/duet/p-fa99eaa4.system.js +4 -0
- package/lib/duet/{p-6024e484.system.entry.js → p-ffd449ef.system.entry.js} +1 -1
- package/lib/esm/{dom-58cd15f6.js → dom-5d060ace.js} +1 -1
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +2 -2
- package/lib/esm/duet-caption_4.entry.js +3 -3
- package/lib/esm/duet-card.entry.js +2 -2
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +2 -2
- package/lib/esm/duet-collapsible.entry.js +4 -452
- 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 +14 -7
- package/lib/esm/duet-editable-table_4.entry.js +86 -11
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +2 -2
- package/lib/esm/duet-grid_2.entry.js +26 -3
- package/lib/esm/duet-header_2.entry.js +220 -47
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +13 -21
- package/lib/esm/duet-input_2.entry.js +2 -3
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +2 -2
- package/lib/esm/duet-modal.entry.js +2 -2
- package/lib/esm/duet-notification_2.entry.js +2 -2
- 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 +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +4 -4
- package/lib/esm/{focus-utils-aeb6ca93.js → focus-utils-fc14cf36.js} +1 -1
- package/lib/esm/form-search-ea8e19ae.js +6 -0
- package/lib/esm/{index-e8c7d36f.js → index-9ef5d3bc.js} +3 -9
- package/lib/esm/loader.js +3 -3
- package/lib/esm/{shadow-css-7c726abb.js → shadow-css-13d024f4.js} +1 -1
- package/lib/esm/token-utils-75f78ca4.js +75 -0
- package/lib/esm/tokens-e110dc89.js +453 -0
- package/lib/esm-es5/{dom-58cd15f6.js → dom-5d060ace.js} +0 -0
- 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 +2 -2
- 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 +1 -1
- package/lib/esm-es5/duet-editable-table_4.entry.js +2 -2
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +2 -2
- package/lib/esm-es5/duet-header_2.entry.js +2 -2
- 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 +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/{focus-utils-aeb6ca93.js → focus-utils-fc14cf36.js} +1 -1
- package/lib/esm-es5/form-search-ea8e19ae.js +4 -0
- package/lib/esm-es5/{index-e8c7d36f.js → index-9ef5d3bc.js} +2 -2
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/{shadow-css-7c726abb.js → shadow-css-13d024f4.js} +0 -0
- package/lib/esm-es5/token-utils-75f78ca4.js +4 -0
- package/lib/esm-es5/tokens-e110dc89.js +4 -0
- package/lib/html.html-data.json +29 -10
- package/lib/types/common-types.d.ts +0 -1
- package/lib/types/components/duet-collapsible/duet-collapsible.d.ts +3 -0
- package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +1 -0
- package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +5 -1
- package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +1 -0
- package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +10 -0
- package/lib/types/components/duet-grid/duet-grid.d.ts +1 -0
- package/lib/types/components/duet-header/duet-header-dropdown.d.ts +16 -0
- package/lib/types/components/duet-header/duet-header-hamburger.d.ts +2 -0
- package/lib/types/components/duet-header/duet-header-icon.d.ts +8 -0
- package/lib/types/components/duet-header/duet-header.d.ts +41 -4
- package/lib/types/components/duet-icon/duet-icon.d.ts +1 -1
- package/lib/types/components/duet-icon/icon-utils.d.ts +1 -1
- package/lib/types/components/duet-link/duet-link.d.ts +3 -0
- package/lib/types/components/duet-table/duet-table.d.ts +1 -1
- package/lib/types/components/duet-upload/duet-upload.d.ts +4 -0
- package/lib/types/components.d.ts +46 -10
- package/lib/types/stencil-public-runtime.d.ts +6 -4
- package/lib/types/utils/template-utils.d.ts +13 -0
- package/lib/types/utils/token-utils.d.ts +8 -2
- package/package.json +13 -14
- package/lib/cjs/token-utils-63a9c8dc.js +0 -30
- package/lib/duet/p-0a89315d.entry.js +0 -4
- package/lib/duet/p-0e90f075.system.entry.js +0 -4
- package/lib/duet/p-3212a556.entry.js +0 -4
- package/lib/duet/p-3c1971d8.js +0 -4
- package/lib/duet/p-4c5eedf8.entry.js +0 -4
- package/lib/duet/p-4c827f0d.entry.js +0 -4
- package/lib/duet/p-5e0071d6.js +0 -4
- package/lib/duet/p-5e77432e.system.entry.js +0 -4
- package/lib/duet/p-68008644.entry.js +0 -4
- package/lib/duet/p-69385972.system.entry.js +0 -4
- package/lib/duet/p-6e363557.system.js +0 -4
- package/lib/duet/p-6fa6c4fb.system.entry.js +0 -4
- package/lib/duet/p-73f9db25.system.entry.js +0 -4
- package/lib/duet/p-74f4a0d8.system.entry.js +0 -4
- package/lib/duet/p-a545398c.entry.js +0 -4
- package/lib/duet/p-b6e9860a.entry.js +0 -4
- package/lib/duet/p-c742856b.system.entry.js +0 -4
- package/lib/duet/p-d67fff56.entry.js +0 -4
- package/lib/duet/p-f2a087a8.system.entry.js +0 -4
- package/lib/esm/token-utils-590d9413.js +0 -28
- package/lib/esm-es5/token-utils-590d9413.js +0 -4
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FunctionalComponent } from "../../stencil-public-runtime";
|
|
2
|
+
interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
accessibleText?: string;
|
|
8
|
+
active: boolean;
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
badge: boolean;
|
|
11
|
+
toggleRef: (el: HTMLButtonElement) => void;
|
|
12
|
+
itemsRef: (el: HTMLDivElement) => void;
|
|
13
|
+
onToggle: (e: Event) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const DuetHeaderDropdown: FunctionalComponent<Props>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionalComponent } from "../../stencil-public-runtime";
|
|
2
|
+
import { DuetIconSize } from "../duet-icon/duet-icon";
|
|
3
|
+
interface Props {
|
|
4
|
+
icon: string;
|
|
5
|
+
iconSize?: DuetIconSize;
|
|
6
|
+
}
|
|
7
|
+
export declare const DuetHeaderIcon: FunctionalComponent<Props>;
|
|
8
|
+
export {};
|
|
@@ -13,6 +13,10 @@ export declare type DuetHeaderContactItem = DuetHeaderItem & {
|
|
|
13
13
|
};
|
|
14
14
|
export declare type DuetHeaderMainItem = DuetHeaderItem & {
|
|
15
15
|
badge?: boolean;
|
|
16
|
+
active?: boolean;
|
|
17
|
+
external: boolean;
|
|
18
|
+
icon?: string;
|
|
19
|
+
items?: DuetHeaderMainItem[];
|
|
16
20
|
};
|
|
17
21
|
export declare type DuetHeaderLanguageItem = DuetHeaderItem & {
|
|
18
22
|
country: DuetLanguage;
|
|
@@ -20,6 +24,7 @@ export declare type DuetHeaderLanguageItem = DuetHeaderItem & {
|
|
|
20
24
|
export declare type DuetHeaderSession = DuetHeaderItem & {
|
|
21
25
|
type: "login" | "logout";
|
|
22
26
|
};
|
|
27
|
+
export declare type DuetHeaderSearch = DuetHeaderItem;
|
|
23
28
|
export declare type DuetHeaderChangeEvent = {
|
|
24
29
|
originalEvent: Event;
|
|
25
30
|
data: DuetHeaderItem | DuetHeaderLanguageItem | DuetHeaderSession;
|
|
@@ -32,20 +37,26 @@ export interface I18nText {
|
|
|
32
37
|
activeLanguage: string;
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
35
|
-
* @slot utility - A slot for utilities, such as a notification drawer
|
|
36
|
-
* @slot logo-utility - A slot to place elements alongside the logo. This takes precedence over the **region** prop.
|
|
40
|
+
* @slot utility - A slot for utilities, such as a notification drawer or shopping basket.
|
|
41
|
+
* @slot logo-utility - A slot to place elements alongside the logo. This takes precedence over the **region** prop. Note: not available in desktop multilevel header.
|
|
37
42
|
*/
|
|
38
43
|
export declare class DuetHeader implements ThemeableComponent {
|
|
39
44
|
/**
|
|
40
45
|
* Own Properties
|
|
41
46
|
*/
|
|
47
|
+
private subMenuItemRefs;
|
|
48
|
+
private subMenuButtonRefs;
|
|
42
49
|
private contactItemsEl;
|
|
43
50
|
private contactItemsButtonEl;
|
|
44
51
|
private hasLanguageChanged;
|
|
45
52
|
private languageItemsEl;
|
|
46
53
|
private languageItemsButtonEl;
|
|
54
|
+
private segmentItemsEl;
|
|
55
|
+
private segmentItemsButtonEl;
|
|
47
56
|
private navigationEl;
|
|
48
57
|
private logoEl;
|
|
58
|
+
private mql;
|
|
59
|
+
private boundMqlFunctions;
|
|
49
60
|
/**
|
|
50
61
|
* Reference to host HTML element.
|
|
51
62
|
*/
|
|
@@ -57,12 +68,17 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
57
68
|
isContactOpen: boolean;
|
|
58
69
|
isLanguageOpen: boolean;
|
|
59
70
|
isSlideOutOpen: boolean;
|
|
71
|
+
isSegmentOpen: boolean;
|
|
72
|
+
openMenu: string;
|
|
73
|
+
closedActives: string[];
|
|
60
74
|
processedItems: DuetHeaderMainItem[];
|
|
61
75
|
processedLanguageItems: DuetHeaderLanguageItem[];
|
|
62
76
|
processedContactItems: DuetHeaderContactItem[];
|
|
63
77
|
processedSession: DuetHeaderSession;
|
|
78
|
+
processedSearch: DuetHeaderSearch;
|
|
64
79
|
processedUser: DuetHeaderItem;
|
|
65
80
|
processedBack: DuetHeaderItem;
|
|
81
|
+
renderDesktopNav: boolean;
|
|
66
82
|
/**
|
|
67
83
|
* Theme of the header.
|
|
68
84
|
*/
|
|
@@ -146,6 +162,7 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
146
162
|
* An object that includes mandatory "label" and "href" fields for the user
|
|
147
163
|
* profile link. Additionally, you can pass an "id" that is added as an HTML
|
|
148
164
|
* identifier for the element. If nothing is passed, user won’t be shown.
|
|
165
|
+
* Note: not available in multilevel headers.
|
|
149
166
|
*/
|
|
150
167
|
user: any;
|
|
151
168
|
/**
|
|
@@ -154,6 +171,7 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
154
171
|
logoHref: string;
|
|
155
172
|
/**
|
|
156
173
|
* The href of the current page item that is shown as “active”.
|
|
174
|
+
* Note: not available in multilevel headers.
|
|
157
175
|
*/
|
|
158
176
|
currentHref: string;
|
|
159
177
|
/**
|
|
@@ -164,20 +182,30 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
164
182
|
/**
|
|
165
183
|
* An array of items for the main navigation. Items have to include mandatory
|
|
166
184
|
* "label" and "href" fields to work. Additionally, you can pass an "id" that is
|
|
167
|
-
* added as an HTML identifier for the element
|
|
185
|
+
* added as an HTML identifier for the element, "active" boolean that makes item active,
|
|
186
|
+
* "badge" boolean to add notification badge next to the item and
|
|
187
|
+
* "items" array consisting of sub items that are allowed up to three levels.
|
|
168
188
|
*/
|
|
169
189
|
items: any;
|
|
170
190
|
/**
|
|
171
191
|
* Region that is shown next to the logo. If empty, region will be hidden.
|
|
192
|
+
* Note: not available in desktop multilevel header.
|
|
172
193
|
*/
|
|
173
194
|
region: string;
|
|
174
195
|
/**
|
|
175
196
|
* An object that includes mandatory "label", "href" and "type" fields for the
|
|
176
197
|
* session login/logout link. Additionally, you can pass an "id" that is added
|
|
198
|
+
* as an HTML identifier for the element.
|
|
199
|
+
* If nothing is passed, this link won’t be shown.
|
|
200
|
+
*/
|
|
201
|
+
session: any;
|
|
202
|
+
/**
|
|
203
|
+
* An object that includes mandatory "label" and "href" fields for the
|
|
204
|
+
* search link. Additionally, you can pass an "id" that is added
|
|
177
205
|
* as an HTML identifier for the element. If nothing is passed, this link won’t
|
|
178
206
|
* be shown.
|
|
179
207
|
*/
|
|
180
|
-
|
|
208
|
+
search: any;
|
|
181
209
|
/**
|
|
182
210
|
* An object that includes mandatory "label" and "href" fields for the back link.
|
|
183
211
|
* Additionally, you can pass an "id" that is added as an HTML identifier for the
|
|
@@ -187,6 +215,7 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
187
215
|
back: any;
|
|
188
216
|
/**
|
|
189
217
|
* Label of the contact menu. If empty, contact menu will be hidden.
|
|
218
|
+
* Note: not available in multilevel headers.
|
|
190
219
|
*/
|
|
191
220
|
contact: string;
|
|
192
221
|
/**
|
|
@@ -214,6 +243,12 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
214
243
|
* inside your listener. Additionally, the passed data is available via **event.detail.data**.
|
|
215
244
|
*/
|
|
216
245
|
duetSessionClick: EventEmitter<DuetHeaderChangeEvent>;
|
|
246
|
+
/**
|
|
247
|
+
* Event for when a user has clicked the search link. You can prevent the
|
|
248
|
+
* default browser functionality by calling **event.detail.originalEvent.preventDefault()**
|
|
249
|
+
* inside your listener. Additionally, the passed data is available via **event.detail.data**.
|
|
250
|
+
*/
|
|
251
|
+
duetSearchClick: EventEmitter<DuetHeaderChangeEvent>;
|
|
217
252
|
/**
|
|
218
253
|
* Event raised when a user has clicked the user link. You can prevent the
|
|
219
254
|
* default browser functionality by calling **event.detail.originalEvent.preventDefault()**
|
|
@@ -265,6 +300,7 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
265
300
|
* Component lifecycle events.
|
|
266
301
|
*/
|
|
267
302
|
componentWillLoad(): void;
|
|
303
|
+
connectedCallback(): void;
|
|
268
304
|
disconnectedCallback(): void;
|
|
269
305
|
/**
|
|
270
306
|
* Component event handling.
|
|
@@ -275,6 +311,7 @@ export declare class DuetHeader implements ThemeableComponent {
|
|
|
275
311
|
private handleLanguageClick;
|
|
276
312
|
private handleClick;
|
|
277
313
|
private handleSessionClick;
|
|
314
|
+
private handleSearchClick;
|
|
278
315
|
private handleUserClick;
|
|
279
316
|
private handleBackClick;
|
|
280
317
|
private handleContactClick;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const buildIconUrl: (iconName: string) => string;
|
|
2
|
-
export declare function fetchIconByUrl(url: string
|
|
2
|
+
export declare function fetchIconByUrl(url: string): Promise<string>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DuetLanguage, DuetTheme } from "../../common-types";
|
|
2
2
|
import { DuetLangObject } from "../../utils/language-utils";
|
|
3
3
|
import { ThemeableComponent } from "../../utils/themeable-component";
|
|
4
|
+
/**
|
|
5
|
+
* @part duet-link - piercing selector for styling the link
|
|
6
|
+
*/
|
|
4
7
|
export declare class DuetLink implements ThemeableComponent {
|
|
5
8
|
private nativeLink;
|
|
6
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DuetMargin, DuetTheme } from "../../common-types";
|
|
2
2
|
import { ThemeableComponent } from "../../utils/themeable-component";
|
|
3
3
|
export declare type DuetTableBreakpoint = keyof typeof breakpointToToken;
|
|
4
|
-
export declare type DuetTableVariant = "striped" | "plain";
|
|
4
|
+
export declare type DuetTableVariant = "striped" | "plain" | "fixed";
|
|
5
5
|
export declare type DuetTableStickyDistance = "with-links" | "without-links" | "none";
|
|
6
6
|
declare const breakpointToToken: {
|
|
7
7
|
none: string;
|
|
@@ -195,6 +195,10 @@ export declare class DuetUpload implements ThemeableComponent, FormComponent {
|
|
|
195
195
|
* @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}]
|
|
196
196
|
*/
|
|
197
197
|
groups: DuetEditableTableGroupNames | string;
|
|
198
|
+
/**
|
|
199
|
+
* Key used to set vertical alignment of action buttons
|
|
200
|
+
*/
|
|
201
|
+
alignment: string;
|
|
198
202
|
/**
|
|
199
203
|
* Visually hides the groups labels in the editable table list used to display the list of files
|
|
200
204
|
*/
|
|
@@ -753,6 +753,10 @@ export namespace Components {
|
|
|
753
753
|
* @example [{ variation: "default", icon: "action-edit-2", id: "edit", map: ["success"], label: { fi: " Label", en: " Label", sv: " Label", } }]
|
|
754
754
|
*/
|
|
755
755
|
"actions": DuetEditableTableActions | string;
|
|
756
|
+
/**
|
|
757
|
+
* Key used to set vertical alignment of action buttons
|
|
758
|
+
*/
|
|
759
|
+
"alignment": string;
|
|
756
760
|
/**
|
|
757
761
|
* Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
|
|
758
762
|
* @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
|
|
@@ -807,6 +811,10 @@ export namespace Components {
|
|
|
807
811
|
* Actions that can be performed on the element
|
|
808
812
|
*/
|
|
809
813
|
"actions": DuetEditableTableActions;
|
|
814
|
+
/**
|
|
815
|
+
* Key used to set vertical alignment of action buttons
|
|
816
|
+
*/
|
|
817
|
+
"alignment": string;
|
|
810
818
|
/**
|
|
811
819
|
* Object of data itemsused to render the entire row
|
|
812
820
|
*/
|
|
@@ -996,7 +1004,7 @@ export namespace Components {
|
|
|
996
1004
|
*/
|
|
997
1005
|
"closeMenus": (moveFocusToButton?: boolean) => Promise<void>;
|
|
998
1006
|
/**
|
|
999
|
-
* Label of the contact menu. If empty, contact menu will be hidden.
|
|
1007
|
+
* Label of the contact menu. If empty, contact menu will be hidden. Note: not available in multilevel headers.
|
|
1000
1008
|
*/
|
|
1001
1009
|
"contact": string;
|
|
1002
1010
|
/**
|
|
@@ -1004,11 +1012,11 @@ export namespace Components {
|
|
|
1004
1012
|
*/
|
|
1005
1013
|
"contactItems": any;
|
|
1006
1014
|
/**
|
|
1007
|
-
* The href of the current page item that is shown as “active”.
|
|
1015
|
+
* The href of the current page item that is shown as “active”. Note: not available in multilevel headers.
|
|
1008
1016
|
*/
|
|
1009
1017
|
"currentHref": string;
|
|
1010
1018
|
/**
|
|
1011
|
-
* An array of items for the main navigation. Items have to include mandatory "label" and "href" fields to work. Additionally, you can pass an "id" that is added as an HTML identifier for the element.
|
|
1019
|
+
* An array of items for the main navigation. Items have to include mandatory "label" and "href" fields to work. Additionally, you can pass an "id" that is added as an HTML identifier for the element, "active" boolean that makes item active, "badge" boolean to add notification badge next to the item and "items" array consisting of sub items that are allowed up to three levels.
|
|
1012
1020
|
*/
|
|
1013
1021
|
"items": any;
|
|
1014
1022
|
/**
|
|
@@ -1026,9 +1034,13 @@ export namespace Components {
|
|
|
1026
1034
|
*/
|
|
1027
1035
|
"logoHref": string;
|
|
1028
1036
|
/**
|
|
1029
|
-
* Region that is shown next to the logo. If empty, region will be hidden.
|
|
1037
|
+
* Region that is shown next to the logo. If empty, region will be hidden. Note: not available in desktop multilevel header.
|
|
1030
1038
|
*/
|
|
1031
1039
|
"region": string;
|
|
1040
|
+
/**
|
|
1041
|
+
* An object that includes mandatory "label" and "href" fields for the search link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, this link won’t be shown.
|
|
1042
|
+
*/
|
|
1043
|
+
"search": any;
|
|
1032
1044
|
/**
|
|
1033
1045
|
* An object that includes mandatory "label", "href" and "type" fields for the session login/logout link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, this link won’t be shown.
|
|
1034
1046
|
*/
|
|
@@ -1046,7 +1058,7 @@ export namespace Components {
|
|
|
1046
1058
|
*/
|
|
1047
1059
|
"theme": DuetTheme;
|
|
1048
1060
|
/**
|
|
1049
|
-
* An object that includes mandatory "label" and "href" fields for the user profile link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, user won’t be shown.
|
|
1061
|
+
* An object that includes mandatory "label" and "href" fields for the user profile link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, user won’t be shown. Note: not available in multilevel headers.
|
|
1050
1062
|
*/
|
|
1051
1063
|
"user": any;
|
|
1052
1064
|
}
|
|
@@ -2636,6 +2648,10 @@ export namespace Components {
|
|
|
2636
2648
|
* Default actions added to the internally used duet-editable-table
|
|
2637
2649
|
*/
|
|
2638
2650
|
"actions": DuetEditableTableActions | string;
|
|
2651
|
+
/**
|
|
2652
|
+
* Key used to set vertical alignment of action buttons
|
|
2653
|
+
*/
|
|
2654
|
+
"alignment": string;
|
|
2639
2655
|
/**
|
|
2640
2656
|
* A string of commaseperated file type values that are allowed
|
|
2641
2657
|
* @example : .pdf,.doc,.docx
|
|
@@ -3945,6 +3961,10 @@ declare namespace LocalJSX {
|
|
|
3945
3961
|
* @example [{ variation: "default", icon: "action-edit-2", id: "edit", map: ["success"], label: { fi: " Label", en: " Label", sv: " Label", } }]
|
|
3946
3962
|
*/
|
|
3947
3963
|
"actions"?: DuetEditableTableActions | string;
|
|
3964
|
+
/**
|
|
3965
|
+
* Key used to set vertical alignment of action buttons
|
|
3966
|
+
*/
|
|
3967
|
+
"alignment"?: string;
|
|
3948
3968
|
/**
|
|
3949
3969
|
* Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
|
|
3950
3970
|
* @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
|
|
@@ -3983,6 +4003,10 @@ declare namespace LocalJSX {
|
|
|
3983
4003
|
* Actions that can be performed on the element
|
|
3984
4004
|
*/
|
|
3985
4005
|
"actions"?: DuetEditableTableActions;
|
|
4006
|
+
/**
|
|
4007
|
+
* Key used to set vertical alignment of action buttons
|
|
4008
|
+
*/
|
|
4009
|
+
"alignment"?: string;
|
|
3986
4010
|
/**
|
|
3987
4011
|
* Object of data itemsused to render the entire row
|
|
3988
4012
|
*/
|
|
@@ -4186,7 +4210,7 @@ declare namespace LocalJSX {
|
|
|
4186
4210
|
*/
|
|
4187
4211
|
"back"?: any;
|
|
4188
4212
|
/**
|
|
4189
|
-
* Label of the contact menu. If empty, contact menu will be hidden.
|
|
4213
|
+
* Label of the contact menu. If empty, contact menu will be hidden. Note: not available in multilevel headers.
|
|
4190
4214
|
*/
|
|
4191
4215
|
"contact"?: string;
|
|
4192
4216
|
/**
|
|
@@ -4194,11 +4218,11 @@ declare namespace LocalJSX {
|
|
|
4194
4218
|
*/
|
|
4195
4219
|
"contactItems"?: any;
|
|
4196
4220
|
/**
|
|
4197
|
-
* The href of the current page item that is shown as “active”.
|
|
4221
|
+
* The href of the current page item that is shown as “active”. Note: not available in multilevel headers.
|
|
4198
4222
|
*/
|
|
4199
4223
|
"currentHref"?: string;
|
|
4200
4224
|
/**
|
|
4201
|
-
* An array of items for the main navigation. Items have to include mandatory "label" and "href" fields to work. Additionally, you can pass an "id" that is added as an HTML identifier for the element.
|
|
4225
|
+
* An array of items for the main navigation. Items have to include mandatory "label" and "href" fields to work. Additionally, you can pass an "id" that is added as an HTML identifier for the element, "active" boolean that makes item active, "badge" boolean to add notification badge next to the item and "items" array consisting of sub items that are allowed up to three levels.
|
|
4202
4226
|
*/
|
|
4203
4227
|
"items"?: any;
|
|
4204
4228
|
/**
|
|
@@ -4243,6 +4267,10 @@ declare namespace LocalJSX {
|
|
|
4243
4267
|
* Event raised when a user has clicked the logo. You can prevent the default browser functionality by calling **event.detail.originalEvent.preventDefault()** inside your listener. Additionally, the passed data is available via **event.detail.data**.
|
|
4244
4268
|
*/
|
|
4245
4269
|
"onDuetLogoClick"?: (event: CustomEvent<DuetHeaderChangeEvent>) => void;
|
|
4270
|
+
/**
|
|
4271
|
+
* Event for when a user has clicked the search link. You can prevent the default browser functionality by calling **event.detail.originalEvent.preventDefault()** inside your listener. Additionally, the passed data is available via **event.detail.data**.
|
|
4272
|
+
*/
|
|
4273
|
+
"onDuetSearchClick"?: (event: CustomEvent<DuetHeaderChangeEvent>) => void;
|
|
4246
4274
|
/**
|
|
4247
4275
|
* Event for when a user has clicked the session link. You can prevent the default browser functionality by calling **event.detail.originalEvent.preventDefault()** inside your listener. Additionally, the passed data is available via **event.detail.data**.
|
|
4248
4276
|
*/
|
|
@@ -4256,9 +4284,13 @@ declare namespace LocalJSX {
|
|
|
4256
4284
|
*/
|
|
4257
4285
|
"onDuetUserClick"?: (event: CustomEvent<DuetHeaderChangeEvent>) => void;
|
|
4258
4286
|
/**
|
|
4259
|
-
* Region that is shown next to the logo. If empty, region will be hidden.
|
|
4287
|
+
* Region that is shown next to the logo. If empty, region will be hidden. Note: not available in desktop multilevel header.
|
|
4260
4288
|
*/
|
|
4261
4289
|
"region"?: string;
|
|
4290
|
+
/**
|
|
4291
|
+
* An object that includes mandatory "label" and "href" fields for the search link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, this link won’t be shown.
|
|
4292
|
+
*/
|
|
4293
|
+
"search"?: any;
|
|
4262
4294
|
/**
|
|
4263
4295
|
* An object that includes mandatory "label", "href" and "type" fields for the session login/logout link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, this link won’t be shown.
|
|
4264
4296
|
*/
|
|
@@ -4272,7 +4304,7 @@ declare namespace LocalJSX {
|
|
|
4272
4304
|
*/
|
|
4273
4305
|
"theme"?: DuetTheme;
|
|
4274
4306
|
/**
|
|
4275
|
-
* An object that includes mandatory "label" and "href" fields for the user profile link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, user won’t be shown.
|
|
4307
|
+
* An object that includes mandatory "label" and "href" fields for the user profile link. Additionally, you can pass an "id" that is added as an HTML identifier for the element. If nothing is passed, user won’t be shown. Note: not available in multilevel headers.
|
|
4276
4308
|
*/
|
|
4277
4309
|
"user"?: any;
|
|
4278
4310
|
}
|
|
@@ -5898,6 +5930,10 @@ declare namespace LocalJSX {
|
|
|
5898
5930
|
* Default actions added to the internally used duet-editable-table
|
|
5899
5931
|
*/
|
|
5900
5932
|
"actions"?: DuetEditableTableActions | string;
|
|
5933
|
+
/**
|
|
5934
|
+
* Key used to set vertical alignment of action buttons
|
|
5935
|
+
*/
|
|
5936
|
+
"alignment"?: string;
|
|
5901
5937
|
/**
|
|
5902
5938
|
* A string of commaseperated file type values that are allowed
|
|
5903
5939
|
* @example : .pdf,.doc,.docx
|
|
@@ -666,7 +666,7 @@ export declare namespace JSXBase {
|
|
|
666
666
|
use: JSXBase.SVGAttributes;
|
|
667
667
|
view: JSXBase.SVGAttributes;
|
|
668
668
|
}
|
|
669
|
-
interface SlotAttributes {
|
|
669
|
+
interface SlotAttributes extends JSXAttributes {
|
|
670
670
|
name?: string;
|
|
671
671
|
slot?: string;
|
|
672
672
|
onSlotchange?: (event: Event) => void;
|
|
@@ -1427,9 +1427,7 @@ export declare namespace JSXBase {
|
|
|
1427
1427
|
z?: number | string;
|
|
1428
1428
|
zoomAndPan?: string;
|
|
1429
1429
|
}
|
|
1430
|
-
interface DOMAttributes<T
|
|
1431
|
-
key?: string | number;
|
|
1432
|
-
ref?: (elm?: T) => void;
|
|
1430
|
+
interface DOMAttributes<T> extends JSXAttributes<T> {
|
|
1433
1431
|
slot?: string;
|
|
1434
1432
|
part?: string;
|
|
1435
1433
|
exportparts?: string;
|
|
@@ -1550,6 +1548,10 @@ export declare namespace JSXBase {
|
|
|
1550
1548
|
onTransitionEndCapture?: (event: TransitionEvent) => void;
|
|
1551
1549
|
}
|
|
1552
1550
|
}
|
|
1551
|
+
export interface JSXAttributes<T = Element> {
|
|
1552
|
+
key?: string | number;
|
|
1553
|
+
ref?: (elm?: T) => void;
|
|
1554
|
+
}
|
|
1553
1555
|
export interface CustomElementsDefineOptions {
|
|
1554
1556
|
exclude?: string[];
|
|
1555
1557
|
resourcesUrl?: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Produces a function which uses template strings to do simple interpolation from objects.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* var makeMeKing = generateTemplateFn('${name} is now the king of ${country}!');
|
|
6
|
+
*
|
|
7
|
+
* console.log(makeMeKing({ name: 'Bryan', country: 'Scotland'}));
|
|
8
|
+
* // Logs 'Bryan is now the king of Scotland!'
|
|
9
|
+
*/
|
|
10
|
+
export interface templateFn {
|
|
11
|
+
(template: string | Node, data?: Record<string, any>): any;
|
|
12
|
+
}
|
|
13
|
+
export declare const generateTemplateFn: templateFn;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
import { DuetTheme } from "../common-types";
|
|
2
|
+
export declare function isCamelCase(str: any): boolean;
|
|
3
|
+
export declare function isDashCase(str: any): boolean;
|
|
4
|
+
export declare function capitalize(str?: string): string;
|
|
5
|
+
export declare function camelize(str?: string): string;
|
|
6
|
+
export declare function getTheme(theme?: DuetTheme): DuetTheme;
|
|
7
|
+
export declare function getColorByName(name: string, theme?: DuetTheme): string | undefined;
|
|
8
|
+
export declare function convertToColorName(name?: string, theme?: DuetTheme): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duetds/components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.34.2",
|
|
4
4
|
"description": "This package includes Duet Design System Web Components and related utilities.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"email": "duetdesignsystem@lahitapiola.fi"
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"koa-colorful-logger": "0.0.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@duetds/fonts": "1.4.
|
|
56
|
-
"@duetds/icons": "2.2.
|
|
55
|
+
"@duetds/fonts": "1.4.8",
|
|
56
|
+
"@duetds/icons": "2.2.8",
|
|
57
57
|
"@duetds/stencil-angular-output-target": "0.0.2",
|
|
58
58
|
"@duetds/stencil-react-output-target": "0.0.10",
|
|
59
|
-
"@duetds/tokens": "2.4.
|
|
59
|
+
"@duetds/tokens": "2.4.8",
|
|
60
60
|
"@koa/cors": "3.1.0",
|
|
61
|
-
"@rollup/plugin-replace": "3.0.
|
|
62
|
-
"@stencil/core": "2.
|
|
61
|
+
"@rollup/plugin-replace": "3.0.1",
|
|
62
|
+
"@stencil/core": "2.12.1",
|
|
63
63
|
"@stencil/sass": "1.5.2",
|
|
64
64
|
"@stencil/utils": "0.0.5",
|
|
65
65
|
"@types/jest": "26.0.24",
|
|
@@ -75,20 +75,19 @@
|
|
|
75
75
|
"jest-image-snapshot": "4.5.1",
|
|
76
76
|
"jest-junit": "12.2.0",
|
|
77
77
|
"kill-process-by-name": "1.0.5",
|
|
78
|
-
"koa": "2.13.
|
|
78
|
+
"koa": "2.13.4",
|
|
79
79
|
"koa-body": "4.2.0",
|
|
80
80
|
"koa-mount": "4.0.0",
|
|
81
81
|
"koa-router": "10.1.1",
|
|
82
82
|
"koa-static": "5.0.0",
|
|
83
83
|
"npm-run-all": "4.1.5",
|
|
84
84
|
"onchange": "7.1.0",
|
|
85
|
-
"prettier": "2.
|
|
85
|
+
"prettier": "2.5.1",
|
|
86
86
|
"puppeteer": "9.1.1",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"stylelint": "
|
|
90
|
-
"stylelint-config-
|
|
91
|
-
"stylelint-config-sass-guidelines": "8.0.0"
|
|
87
|
+
"sass": "1.49.0",
|
|
88
|
+
"stylelint": "14.2.0",
|
|
89
|
+
"stylelint-config-recess-order": "3.0.0",
|
|
90
|
+
"stylelint-config-sass-guidelines": "9.0.1"
|
|
92
91
|
},
|
|
93
92
|
"publishConfig": {
|
|
94
93
|
"access": "public"
|
|
@@ -96,5 +95,5 @@
|
|
|
96
95
|
"collection": "lib/collection/collection-manifest.json",
|
|
97
96
|
"es2015": "lib/esm/index.js",
|
|
98
97
|
"es2017": "lib/esm/index.js",
|
|
99
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "26cd823437cbe6efde9c9bb33b2c616d73cb9f67"
|
|
100
99
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Duet Design System
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
const tokens_module = require('./tokens.module-6b2df1c2.js');
|
|
7
|
-
|
|
8
|
-
const MATCH_DASH_CASE = /-([a-z])/g;
|
|
9
|
-
function replaceDashCase(g) {
|
|
10
|
-
return g[1].toUpperCase();
|
|
11
|
-
}
|
|
12
|
-
function convertToCamelCase(string) {
|
|
13
|
-
return string.replace(MATCH_DASH_CASE, replaceDashCase);
|
|
14
|
-
}
|
|
15
|
-
function convertToColorName(name) {
|
|
16
|
-
if (name.indexOf("color-") === -1 && name.indexOf("-") !== -1) {
|
|
17
|
-
return convertToCamelCase(`color-${name}`);
|
|
18
|
-
}
|
|
19
|
-
if (name.indexOf("color") === -1) {
|
|
20
|
-
return convertToCamelCase(`color${name.charAt(0).toUpperCase()}${name.slice(1)}`);
|
|
21
|
-
}
|
|
22
|
-
return convertToCamelCase(name);
|
|
23
|
-
}
|
|
24
|
-
function getColorByName(name) {
|
|
25
|
-
if (name) {
|
|
26
|
-
return tokens_module.tokens[convertToColorName(name)];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
exports.getColorByName = getColorByName;
|
|
@@ -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 i,c as s}from"./p-c1a1ea1b.js";import{s as o,g as l}from"./p-2764f081.js";import{i as d}from"./p-a28cf57b.js";import{m as n,h as r,i as h,j as u,k as p,l as m,n as b,s as c}from"./p-ad07f399.js";import{c as f}from"./p-c1325e35.js";import"./p-986779fb.js";const g=(t,e=50)=>{let a;return(...i)=>{clearTimeout(a),a=setTimeout((()=>{t.apply(void 0,i)}),e)}};let y=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=g((()=>{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,d(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,l(t.label)):l(t.label)),e("th",{class:{"duet-editable-table-header-hidden":this.hideGroups}},e("duet-visually-hidden",null,l(t.actionLabel?t.actionLabel:this.actionLabelDefaults))))),e("tbody",null,a.map((a=>{const[i,s]=a;return e("duet-editable-table-item",{keyName:i,data:Object.assign({},s),groupId:t.id,part:t.id,actions:this.internalActionsArray})})))))})))}get element(){return i(this)}};y.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 v=({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=s(this,"duetEditableItemAction",7),this.isHovering=!1,this.theme="",this.actions=void 0,this.groupId="",this.keyName="",this.data=void 0}watchPropHandler(t,e){}componentWillLoad(){d(this)}render(){return e(a,{role:"row"},e(v,{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 i(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),w={none:"all","none-scrollable":"all",small:k(m),medium:k(n),large:k(r),"x-large":k(h),"xx-large":k(u),"xxx-large":k(p)},T={none:0,"with-links":16*parseFloat(b),"without-links":16*parseFloat(c)};let z=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(w[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(d(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=T[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 i(this)}};z.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)}';const E=[{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."}}],M=t=>{let e={type:void 0,system_message:void 0,message:void 0};return e=E.filter((e=>e.type==t))[0],e||(e=E.filter((t=>"default"===t.type))[0]),e},j=t=>{const e=M(t),a=l(e.message);return""!==a&&a?a:e.system_message},S=({data:t})=>{const{item:a,error:i}=t,{name:s}=a,{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"})," ",s),e("duet-paragraph",{class:"duet-upload-item-error-label",size:"small",margin:"none",color:"danger"},j(o)))},L=({progress:t,name:a})=>e("span",null,e("duet-paragraph",{color:"secondary",margin:"none",size:"small"},a),e("duet-spacer",{size:"xx-small"}),e("duet-progress",{progress:Math.ceil(t),"aria-hidden":!0})),D=({data:t,showLinks:a})=>{const{item:i,size:s,uploaded:o,url:l,meta:d}=t,{name:n}=i,r=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"}),n),h=e("span",{class:"duet-upload-item-size",style:{fontSize:"14px",fontWeight:"400"}},"(",((t,e=2)=>{if(0===t)return"0 Bytes";const a=e<0?0:e,i=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,i)).toFixed(a))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][i]})(s),")"),u=e("duet-paragraph",{color:"secondary",margin:"none",weight:"semi-bold"},o&&l&&a?e("duet-link",{url:l,external:!0},r):r,e("duet-spacer",{size:"xx-small",direction:"horizontal"}),h),p=d&&d.badges?e("span",null,e("duet-spacer",{size:"xx-small"}),d.badges.map((t=>e("duet-badge",{color:"primary"},t)))):void 0;return e("span",{class:"duet-upload-item-success"},e("div",null,u),p)},_=(t,e)=>{const{allowedMimetypes:a,allowedExtensions:i,maxBytes:s}=e;let o=!1,d=M("default");if(t){const{name:e,type:l,size:n}=t,r=((t,e)=>{if(!e||!t)return!0;const a=e.split(",");let i=!1;return a.forEach((e=>{const a=e.split("/"),s=t.split("/");a[0]!==s[0]||a[1]!==s[1]&&"*"!==a[1]||(i=!0)})),i})(l,a),h=((t,e)=>{if(!e)return!0;const a=t.split(".");return e.split(",").includes(a[a.length-1])})(e,i),u=((t,e)=>!e||!t||e>=t)(n,s);r||(d=M("duet-upload-101")),h||(d=M("duet-upload-100")),u||(d=M("duet-upload-201")),o=r&&h&&u}else o=!1;return{valid:o,errorMessage:o?void 0:l(d.message),errorSystem:o?void 0:d.system_message,errorType:o?void 0:d.type}},A=({payload:t,options:e,onFailure:a,onSuccess:i,onProgress:s})=>{const{type:o="POST",xhr:l,uri:d,argument:n=null,headers:r=null}=e;l.open(o,`${d}${n||""}`,!0);const{data:h,name:u}=t;return r&&Object.keys(r).forEach((t=>{l.setRequestHeader(t,r[t])})),"POST"===o&&(l.onreadystatechange=()=>{l.readyState===XMLHttpRequest.DONE&&l.status>=200&&l.status<300&&i(l,u,l.status),l.readyState===XMLHttpRequest.DONE&&l.status>=300&&l.status<999&&a(l,u,l.status)},s(u)),l.send(h),l};let P=class{constructor(a){t(this,a),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=f("DuetButton"),this.labelId=f("DuetLabel"),this.uploadId=f("DuetUpload"),this.editableTableId=f("DuetEditableTable"),this.filesInProgress=new Map,this.fileMaxReached=!1,this.bytesMaxReached=!1,this.internalStatusMessageLabel=void 0,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=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=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=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=void 0,this.maxFiles=99,this.allowedExtensions="all",this.allowedMimetypes="*",this.multiple=!0,this.limitSelection=!1,this.listenForActionEvents=()=>{this.element.addEventListener("duetEditableItemAction",(t=>{const e=t.detail,{action:a,keyName:i,originalEvent:s}=e;switch(a){case"delete":this.onDelete(i,s);break;case"cancel":this.onCancel(i,s)}}))},this.verifyValidity=()=>{const{invalid:t,valid:e}=this.getFilesAsArray(),a=this.valid;this.valid=0===t.length&&0!==e.length,this.valid!==a&&this.duetState.emit({originalEvent:void 0,data:{valid:this.valid,from:"componentWillRender"},component:"duet-upload"})},this.getGroupFromItemData=t=>t.valid&&100===t.progress?t.group?t.group:this.DefaultGroups.success:t.progress>0&&100!==t.progress?this.DefaultGroups.inprogress:t.valid?t.group?t.group:"none":this.DefaultGroups.failure,this.getItemHTMLFromItemData=(t,a)=>a===this.DefaultGroups.success?e(D,{data:t,showLinks:this.showLinks}):a===this.DefaultGroups.inprogress?e(L,{progress:t.progress,name:t.item.name}):a===this.DefaultGroups.failure?e(S,{data:t}):t.group?t.html:"none",this.convertToDuetEditableTableItems=()=>{const t=new Map;return this.files.forEach(((e,a)=>{const i=this.getGroupFromItemData(e),s=this.getItemHTMLFromItemData(e,i);t.set(a,{uid:e.uid,item:s,group:i})})),t},this.kick=g((()=>{this.tick=Date.now()}),30),this.genHashName=()=>Date.now().toString(36)+Math.random(),this.updateValueInMap=(t,e,a,i=!0)=>{const s=this.files.get(t);s[e]=a,this.files.set(t,s),i&&this.kick()},this.updateProgress=(t,e)=>{t.lengthComputable?(a=>{this.updateValueInMap(e,"progress",a),this.onProgress(e,a,t)})(t.loaded/t.total*100):console.log("cant read progress")},this.trackProgress=(t,e=!1)=>{e?this.filesInProgress.delete(t):this.filesInProgress.set(t,"inprogress"),0===this.filesInProgress.size&&this.onDone()},this.getFilesAsArray=()=>{const t=[],e=[];return this.files.forEach((a=>{a.valid&&!a.deleted?t.push(a):a.valid||a.deleted||e.push(a)})),{valid:t,invalid:e}},this.resetFormFields=()=>{this.nativeInput.value=""},this.startUpload=async(t,e)=>{await this.setFocus(),this.metaData=e,this.nativeInput.click(),this.onUpload(t,e),t.stopPropagation(),t.preventDefault()},this.transferComplete=t=>{this.updateValueInMap(t,"progress",100,!1),this.trackProgress(t,!0)},this.transferDone=(t,e,a)=>{this.updateValueInMap(e,"status",a,!1),this.updateValueInMap(e,"uploaded",!0,!1);try{const a=JSON.parse(t.response);this.updateValueInMap(e,"url",a.url)}catch(i){this.updateValueInMap(e,"url",null),console.error("Server did not respond with expected response {url: string}")}},this.transferDoneWithFailure=(t,e,a)=>{try{const{error:a}=JSON.parse(t.response);this.updateValueInMap(e,"error",{message:a.message,type:a.type},!1)}catch(i){console.error("Server did not respond with expected response error:{message: string, type: int}"),this.updateValueInMap(e,"error",{type:a},!1)}this.updateValueInMap(e,"valid",!1,!0)},this.transferFailed=t=>{this.updateValueInMap(t,"error",M("duet-upload-001"))},this.transferCanceled=t=>{this.files.delete(t),this.validateTotals(t),this.kick()},this.validateTotals=t=>{const e=((t,e)=>{let a=0;return!!(e&&(this.files.forEach((t=>{t.valid&&t.size&&(a+=t.size)})),a<e))})(0,this.maxBytesTotal),a=((t,e)=>{let a=0;return!!(e&&(this.files.forEach((t=>{t.valid&&a++})),a>e))})(0,this.maxFiles);return e&&t&&this.updateValueInMap(t,"error",M("duet-upload-202"),!1),a&&t&&this.updateValueInMap(t,"error",M("duet-upload-301"),!1),this.bytesMaxReached=e,this.fileMaxReached=a,{bytesMaxReached:e,fileMaxReached:a}},this.onDelete=(t,e)=>{const a=this.files.get(t);this.files.delete(t),this.validateTotals(),this.kick(),this.duetDelete.emit({originalEvent:e,data:{deletion:a},component:"duet-upload"}),this.external||this.makeXHRDeleteRequest(a),this.resetFormFields()},this.onCancel=(t,e)=>{const a=this.files.get(t);if(this.files.delete(t),this.external)this.kick();else{const{xhr:t}=a;t.abort()}this.resetFormFields(),this.duetCancel.emit({originalEvent:e,data:{cancelled:a},component:"duet-upload"})},this.onUpload=(t,e)=>{this.duetUpload.emit({originalEvent:t,metaData:e,component:"duet-upload"})},this.onBlur=t=>{this.duetBlur.emit({originalEvent:t,component:"duet-upload"})},this.onProgress=(t,e,a)=>{this.duetChange.emit({originalEvent:a,data:{key:t,percentComplete:e},component:"duet-upload"})},this.onFocus=t=>{this.duetFocus.emit({originalEvent:t,component:"duet-upload"})},this.onDone=()=>{this.duetDone.emit({component:"duet-upload",data:{files:this.files}})}}watchValidHandler(t,e){t!==e&&this.kick()}componentWillLoad(){this.internalStatusMessageLabel="string"==typeof this.statusMessageLabel?o(this.groups):this.statusMessageLabel,d(this),this.listenForActionEvents()}componentWillRender(){this.verifyValidity()}makeXHRPostRequest(t){const e=new XMLHttpRequest,a=t.get("name");return e.upload.addEventListener("progress",(t=>{this.updateProgress(t,a)})),e.upload.addEventListener("load",(()=>{this.transferComplete(a)})),e.upload.addEventListener("error",(()=>{this.transferFailed(a)})),e.upload.addEventListener("abort",(()=>{this.transferCanceled(a)})),A({payload:{data:t,name:a},options:{type:"POST",uri:this.uri,xhr:e,argument:null,headers:null},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress})}makeXHRDeleteRequest(t){const{uid:e,item:a}=t,i=new XMLHttpRequest;return A({payload:{data:null,name},options:{type:"DELETE",xhr:i,uri:this.uri,arguments:`?key=${e}&name=${a.name}`,headers:{"x-fileuid":e,"x-filename":a.name}},onFailure:this.transferDoneWithFailure,onSuccess:this.transferDone,onProgress:this.trackProgress})}async onChange(t){var e;const a=Array.from(null===(e=this.nativeInput)||void 0===e?void 0:e.files);if(a)for(const s of a){const{valid:t,errorMessage:e,errorType:a,errorSystem:o}=_(s,{maxBytes:this.maxBytes,allowedExtensions:this.allowedExtensions,allowedMimetypes:this.allowedMimetypes}),l=this.genHashName(),d={uid:l,item:s,size:s.size,meta:this.metaData,uploaded:!1,valid:t,error:{type:t?void 0:a,message:t?void 0:e,system_message:t?void 0:o},progress:0,deleted:!1,xhr:!1,url:!1};this.files.set(s.name,d);const{bytesMaxReached:n,fileMaxReached:r}=this.validateTotals(s.name);if(n)this.updateValueInMap(s.name,"valid",!1,!1);else if(r)this.updateValueInMap(s.name,"valid",!1,!1);else if(t&&!this.external){const t=new FormData;t.append("file",s),t.append("uid",l),t.append("name",s.name),t.append("metadata",JSON.stringify({uid:l,url:this.uri,size:s.size,meta:d.meta}));try{d.xhr=await this.makeXHRPostRequest(t)}catch(i){this.updateValueInMap(s.name,"valid",!1,!1)}}this.kick()}this.resetFormFields(),this.metaData=void 0,this.duetChange.emit({originalEvent:t,data:{files:this.files},component:"duet-upload"})}async setFocus(t){this.nativeInput&&this.nativeInput.focus(t)}async upload(t){await this.setFocus(),this.metaData=t,this.nativeInput.click()}async getFiles(){return!(!this.files||0===this.files.size)&&this.getFilesAsArray()}async updateValue(t,e,a){this.updateValueInMap(t,e,a)}render(){const t=this.identifier||this.uploadId;let i=this.description.replace(/{maxfiles}/g,this.maxFiles.toString());return i=i.replace(/{maxbytes}/g,`${Math.floor(this.maxBytes/1024/1024)} MB`),i=i.replace(/{filetypes}/g,this.allowedExtensions.split(",").join(", ")),e(a,{class:{"duet-m-0":"none"===this.margin}},e("duet-fieldset",{label:this.label,caption:i},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.internalStatusMessageLabel}),!!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&&j("duet-upload-301"),this.bytesMaxReached&&j("duet-upload-202")),e("duet-spacer",{size:"medium"}),e("duet-visually-hidden",null,e("input",{ref:t=>{this.nativeInput=t},accept:this.limitSelection?`${this.allowedMimetypes},${this.allowedExtensions}`:void 0,onBlur:this.onBlur,onFocus:this.onFocus,onChange:t=>this.onChange(t),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 i(this)}static get watchers(){return{valid:["watchValidHandler"]}}};P.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_editable_table,x as duet_editable_table_item,z as duet_table,P as duet_upload}
|