@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
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
import { Component, Element, h, Host, Method, Prop, State } from "@stencil/core";
|
|
5
5
|
import { debounce } from "../../utils/js-utils";
|
|
6
6
|
import { getLocaleString, sanitizeString } from "../../utils/language-utils";
|
|
7
|
+
import { generateTemplateFn } from "../../utils/template-utils";
|
|
7
8
|
import { inheritGlobalTheme } from "../../utils/themeable-component";
|
|
8
9
|
export class DuetEditableTable {
|
|
9
10
|
constructor() {
|
|
11
|
+
this.template = undefined;
|
|
10
12
|
/**
|
|
11
13
|
* State() variables
|
|
12
14
|
* @internal
|
|
@@ -16,6 +18,10 @@ export class DuetEditableTable {
|
|
|
16
18
|
* Map of items that contain list of things.
|
|
17
19
|
*/
|
|
18
20
|
this.items = new Map();
|
|
21
|
+
/**
|
|
22
|
+
* Key used to set vertical alignment of action buttons
|
|
23
|
+
*/
|
|
24
|
+
this.alignment = "middle";
|
|
19
25
|
/**
|
|
20
26
|
* Array of internationalized defaults for the default groups labels.
|
|
21
27
|
*/
|
|
@@ -64,12 +70,40 @@ export class DuetEditableTable {
|
|
|
64
70
|
* Exposes the aria role for optimizing accessibility.
|
|
65
71
|
*/
|
|
66
72
|
this.accessibleRole = undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Theme of the table.
|
|
75
|
+
*/
|
|
76
|
+
this.theme = "";
|
|
67
77
|
/**
|
|
68
78
|
* Private methods.
|
|
69
79
|
*/
|
|
70
80
|
this.kick = debounce(() => {
|
|
71
81
|
this.tick = Date.now();
|
|
72
82
|
}, 100); // will trigger re-render
|
|
83
|
+
/**
|
|
84
|
+
* If a user defines a template section within editable table, try to read an use it.
|
|
85
|
+
*/
|
|
86
|
+
this.getTemplate = () => {
|
|
87
|
+
const templateDom = this.element.getElementsByTagName("template");
|
|
88
|
+
if (templateDom === null || templateDom === void 0 ? void 0 : templateDom.length) {
|
|
89
|
+
const templateString = templateDom[0].content.firstElementChild.outerHTML;
|
|
90
|
+
return generateTemplateFn(templateString);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
this.getItemData = (data) => {
|
|
97
|
+
const { item, group, uid } = data;
|
|
98
|
+
if (this.template) {
|
|
99
|
+
return {
|
|
100
|
+
group,
|
|
101
|
+
uid,
|
|
102
|
+
item: this.template(item),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return { item, group, uid };
|
|
106
|
+
};
|
|
73
107
|
this.filterMap = needle => {
|
|
74
108
|
if (needle === "all") {
|
|
75
109
|
return Array.from(this.items);
|
|
@@ -81,6 +115,9 @@ export class DuetEditableTable {
|
|
|
81
115
|
* Component lifecycle events.
|
|
82
116
|
*/
|
|
83
117
|
componentWillLoad() {
|
|
118
|
+
// look for a <template> region in the duet-editable-table
|
|
119
|
+
this.template = this.getTemplate();
|
|
120
|
+
// take care of the case where groups and actions are defined as html properties instead of javascript objects
|
|
84
121
|
if (typeof this.groups === "string") {
|
|
85
122
|
this.internalGroupArray = sanitizeString(this.groups);
|
|
86
123
|
}
|
|
@@ -126,7 +163,7 @@ export class DuetEditableTable {
|
|
|
126
163
|
: getLocaleString(this.actionLabelDefaults))))),
|
|
127
164
|
h("tbody", null, currentGroup.map(dataAsArray => {
|
|
128
165
|
const [key, value] = dataAsArray;
|
|
129
|
-
return (h("duet-editable-table-item", { keyName: key, data:
|
|
166
|
+
return (h("duet-editable-table-item", { theme: this.theme, keyName: key, data: this.getItemData(value), groupId: group.id, part: group.id, alignment: this.alignment, actions: this.internalActionsArray }));
|
|
130
167
|
})))));
|
|
131
168
|
})));
|
|
132
169
|
}
|
|
@@ -159,6 +196,24 @@ export class DuetEditableTable {
|
|
|
159
196
|
},
|
|
160
197
|
"defaultValue": "new Map()"
|
|
161
198
|
},
|
|
199
|
+
"alignment": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"mutable": false,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "string",
|
|
204
|
+
"resolved": "string",
|
|
205
|
+
"references": {}
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"optional": false,
|
|
209
|
+
"docs": {
|
|
210
|
+
"tags": [],
|
|
211
|
+
"text": "Key used to set vertical alignment of action buttons"
|
|
212
|
+
},
|
|
213
|
+
"attribute": "alignment",
|
|
214
|
+
"reflect": false,
|
|
215
|
+
"defaultValue": "\"middle\""
|
|
216
|
+
},
|
|
162
217
|
"groupsLabelDefaults": {
|
|
163
218
|
"type": "unknown",
|
|
164
219
|
"mutable": false,
|
|
@@ -314,7 +369,8 @@ export class DuetEditableTable {
|
|
|
314
369
|
"text": "Theme of the table."
|
|
315
370
|
},
|
|
316
371
|
"attribute": "theme",
|
|
317
|
-
"reflect": false
|
|
372
|
+
"reflect": false,
|
|
373
|
+
"defaultValue": "\"\""
|
|
318
374
|
}
|
|
319
375
|
}; }
|
|
320
376
|
static get states() { return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
+
import { media_query_large, media_query_medium, media_query_small } from "@duetds/tokens/lib/tokens.json";
|
|
4
5
|
import { Component, Element, h, Host, Prop, State, Watch } from "@stencil/core";
|
|
5
6
|
import { watchForElement, watchForOptions } from "../../utils/watch-options";
|
|
6
7
|
function isGridItem(element) {
|
|
@@ -8,6 +9,11 @@ function isGridItem(element) {
|
|
|
8
9
|
}
|
|
9
10
|
export class DuetGrid {
|
|
10
11
|
constructor() {
|
|
12
|
+
this.mql = [
|
|
13
|
+
window.matchMedia(media_query_large.replace(/'/g, "")),
|
|
14
|
+
window.matchMedia(media_query_medium.replace(/'/g, "")),
|
|
15
|
+
window.matchMedia(media_query_small.replace(/'/g, "")),
|
|
16
|
+
];
|
|
11
17
|
this.distributeFormElement = false;
|
|
12
18
|
/**
|
|
13
19
|
* Enable or disable the automatic responsive behaviour of the grid component.
|
|
@@ -62,10 +68,18 @@ export class DuetGrid {
|
|
|
62
68
|
this.mutationO = watchForOptions(el, "duet-grid-item", () => {
|
|
63
69
|
this.updateGridItems();
|
|
64
70
|
});
|
|
71
|
+
// the next two functions are used to watch for changes in the grid items, and are process intensive - so only run when needed
|
|
65
72
|
if (this.distributeFormElement) {
|
|
66
73
|
this.mutation1 = watchForElement(el, "duet-input", () => {
|
|
67
74
|
this.updateGridItemsWithInputFields();
|
|
68
75
|
});
|
|
76
|
+
// listen for potential mediaquery changes and reset layout
|
|
77
|
+
for (let i = 0; i < this.mql.length; i++) {
|
|
78
|
+
// addEventListener is not available in Stencil hydrate
|
|
79
|
+
if (this.mql[i].addEventListener) {
|
|
80
|
+
this.mql[i].addEventListener("change", this.updateGridItemsWithInputFields.bind(this));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
69
83
|
}
|
|
70
84
|
this.updateGridItems();
|
|
71
85
|
}
|
|
@@ -78,6 +92,13 @@ export class DuetGrid {
|
|
|
78
92
|
this.mutation1.disconnect();
|
|
79
93
|
this.mutation1 = undefined;
|
|
80
94
|
}
|
|
95
|
+
// listen for potential mediaquery changes and reset layout
|
|
96
|
+
for (let i = 0; i < this.mql.length; i++) {
|
|
97
|
+
// addEventListener is not available in Stencil hydrate
|
|
98
|
+
if (this.mql[i].removeEventListener) {
|
|
99
|
+
this.mql[i].removeEventListener("change", this.updateGridItemsWithInputFields.bind(this));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
81
102
|
}
|
|
82
103
|
/**
|
|
83
104
|
* Local methods
|
|
@@ -91,6 +112,8 @@ export class DuetGrid {
|
|
|
91
112
|
}
|
|
92
113
|
async updateGridItemsWithInputFields() {
|
|
93
114
|
const items = Array.from(this.element.children).filter(isGridItem);
|
|
115
|
+
// if layout changes to columns instead of row, remove all padding
|
|
116
|
+
const hasColumnLayout = window ? window.getComputedStyle(this.element).flexDirection === "column" : false;
|
|
94
117
|
let maxHeight = 0;
|
|
95
118
|
const sizes = [];
|
|
96
119
|
items.forEach(item => {
|
|
@@ -102,10 +125,10 @@ export class DuetGrid {
|
|
|
102
125
|
items.forEach(item => {
|
|
103
126
|
const inputErrorDom = item.querySelector("span.duet-input-error");
|
|
104
127
|
const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
|
|
105
|
-
if (height < maxHeight) {
|
|
128
|
+
if (height < maxHeight && !hasColumnLayout) {
|
|
106
129
|
item.setAttribute("style", `padding-bottom: ${maxHeight - height}px;`);
|
|
107
130
|
}
|
|
108
|
-
else if (height === maxHeight) {
|
|
131
|
+
else if (height === maxHeight || hasColumnLayout) {
|
|
109
132
|
item.setAttribute("style", `padding-bottom: 0px;`);
|
|
110
133
|
}
|
|
111
134
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import arrowDownIcon from "@duetds/icons/lib/assets/action-arrow-down-small";
|
|
5
|
+
import { h } from "@stencil/core";
|
|
6
|
+
import { DuetHeaderIcon } from "./duet-header-icon";
|
|
7
|
+
export const DuetHeaderDropdown = (props, _children) => {
|
|
8
|
+
const accessibleLabel = props.accessibleText ? props.accessibleText : props.label;
|
|
9
|
+
return (h("div", { class: { ["duet-header-dropdown"]: true, [props.className]: !!props.className } },
|
|
10
|
+
h("button", { ref: props.toggleRef, "aria-haspopup": "listbox", "aria-controls": props.id, "aria-expanded": props.isOpen ? "true" : "false", "aria-labelledby": `${props.id}-accessible-label`, id: `${props.id}-button`, type: "button", class: {
|
|
11
|
+
[props.id]: true,
|
|
12
|
+
"duet-header-dropdown-toggle": true,
|
|
13
|
+
"duet-header-button": true,
|
|
14
|
+
active: props.active,
|
|
15
|
+
}, onClick: props.onToggle },
|
|
16
|
+
props.icon && h(DuetHeaderIcon, { icon: props.icon }),
|
|
17
|
+
h("span", { "aria-hidden": "true", id: `${props.id}-label`, class: "duet-header-dropdown-label" }, props.label),
|
|
18
|
+
props.badge && h("div", { class: "duet-header-badge" }),
|
|
19
|
+
h("div", { class: "duet-header-caret", "aria-hidden": "true" },
|
|
20
|
+
h("duet-icon", { margin: "none", size: "auto", icon: arrowDownIcon.svg, color: "currentColor" })),
|
|
21
|
+
h("duet-visually-hidden", { id: `${props.id}-accessible-label` }, accessibleLabel)),
|
|
22
|
+
h("div", { ref: props.itemsRef, tabindex: "-1", role: "menu", id: props.id, "aria-labelledby": `${props.id}-button`, class: {
|
|
23
|
+
"duet-header-dropdown-content": true,
|
|
24
|
+
[`${props.id}-items`]: true,
|
|
25
|
+
active: props.isOpen,
|
|
26
|
+
} }, _children)));
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
export const DuetHeaderHamburger = () => (h("div", { class: "duet-header-hamburger" },
|
|
6
|
+
h("span", { class: "duet-header-bar" }),
|
|
7
|
+
h("span", { class: "duet-header-bar" }),
|
|
8
|
+
h("span", { class: "duet-header-bar" }),
|
|
9
|
+
h("span", { class: "duet-header-bar" })));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Duet Design System
|
|
3
|
+
*/
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
export const DuetHeaderIcon = (props, _children) => {
|
|
6
|
+
const iconSize = props.iconSize ? props.iconSize : "x-small";
|
|
7
|
+
return (h("span", { class: "duet-header-icon" },
|
|
8
|
+
h("duet-icon", { margin: "none", size: iconSize, icon: props.icon, color: "currentColor" })));
|
|
9
|
+
};
|