@sellmate/design-system 1.0.67 → 1.0.69
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/dist/cjs/{component.textinput-C4SsDjA1.js → component.textinput-BpXDeZPD.js} +3 -2
- package/dist/cjs/design-system.cjs.js +2 -2
- package/dist/cjs/{index-BpT5VmKY.js → index-B2QvhbC3.js} +1 -1
- package/dist/cjs/index.cjs.js +36 -41
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/modal-stack-DucFLON7.js +112 -0
- package/dist/cjs/sd-action-modal.cjs.entry.js +2 -2
- package/dist/cjs/sd-badge.cjs.entry.js +2 -2
- package/dist/cjs/sd-barcode-input.cjs.entry.js +4 -3
- package/dist/cjs/sd-button-v2_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-button_4.cjs.entry.js +35 -18
- package/dist/cjs/sd-calendar.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +2 -2
- package/dist/cjs/sd-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/sd-chip.cjs.entry.js +312 -0
- package/dist/cjs/sd-circle-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +4 -4
- package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker-calendar.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-picker-trigger.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-picker.cjs.entry.js +4 -3
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +4 -3
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +8 -19
- package/dist/cjs/sd-file-picker.cjs.entry.js +5 -4
- package/dist/cjs/sd-form.cjs.entry.js +1 -1
- package/dist/cjs/sd-ghost-button.cjs.entry.js +6 -6
- package/dist/cjs/sd-guide.cjs.entry.js +167 -34
- package/dist/cjs/sd-input_2.cjs.entry.js +8 -7
- package/dist/cjs/sd-loading-container.cjs.entry.js +4 -4
- package/dist/cjs/sd-modal-container.cjs.entry.js +126 -155
- package/dist/cjs/sd-number-input.cjs.entry.js +5 -4
- package/dist/cjs/sd-pagination_2.cjs.entry.js +117 -42
- package/dist/cjs/sd-popover.cjs.entry.js +4 -4
- package/dist/cjs/sd-portal.cjs.entry.js +4 -4
- package/dist/cjs/sd-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/sd-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/sd-radio.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-dropdown_2.cjs.entry.js +4 -4
- package/dist/cjs/sd-select-group.cjs.entry.js +3 -2
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-multiple.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-option-group.cjs.entry.js +4 -4
- package/dist/cjs/sd-select-v2-list-item_4.cjs.entry.js +12 -16
- package/dist/cjs/sd-select.cjs.entry.js +3 -2
- package/dist/cjs/sd-switch.cjs.entry.js +2 -2
- package/dist/cjs/sd-table.cjs.entry.js +6 -6
- package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
- package/dist/cjs/sd-tag.cjs.entry.js +3 -3
- package/dist/cjs/sd-tbody.cjs.entry.js +2 -2
- package/dist/cjs/sd-td.cjs.entry.js +2 -2
- package/dist/cjs/sd-text-link.cjs.entry.js +4 -4
- package/dist/cjs/sd-textarea.cjs.entry.js +4 -3
- package/dist/cjs/sd-thead.cjs.entry.js +4 -4
- package/dist/cjs/sd-toast-container.cjs.entry.js +3 -3
- package/dist/cjs/sd-toast.cjs.entry.js +3 -3
- package/dist/cjs/sd-toggle.cjs.entry.js +2 -2
- package/dist/cjs/sd-tr.cjs.entry.js +3 -3
- package/dist/cjs/system-C89o3A9Z.js +16 -0
- package/dist/cjs/table-test.cjs.entry.js +2 -2
- package/dist/cjs/{tooltipArrow-C9i0ZsG_.js → tooltipArrow-Xkv-p1bY.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/sd-action-modal/sd-action-modal.js +1 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +29 -1
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +2 -2
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-chip/sd-chip.config.js +37 -0
- package/dist/collection/components/sd-chip/sd-chip.css +56 -0
- package/dist/collection/components/sd-chip/sd-chip.js +544 -0
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker-calendar/sd-date-picker-calendar.js +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +30 -2
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +30 -2
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +3 -3
- package/dist/collection/components/sd-field/sd-field.config.js +5 -0
- package/dist/collection/components/sd-field/sd-field.css +4 -0
- package/dist/collection/components/sd-field/sd-field.js +39 -5
- package/dist/collection/components/sd-file-picker/sd-file-picker.css +1 -1
- package/dist/collection/components/sd-file-picker/sd-file-picker.js +30 -2
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +12 -8
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +5 -5
- package/dist/collection/components/sd-guide/sd-guide.config.js +48 -0
- package/dist/collection/components/sd-guide/sd-guide.css +58 -29
- package/dist/collection/components/sd-guide/sd-guide.js +69 -40
- package/dist/collection/components/sd-input/sd-input.js +30 -2
- package/dist/collection/components/sd-loading-container/sd-loading-container.config.js +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.css +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +1 -1
- package/dist/collection/components/sd-modal-container/sd-modal-container.css +11 -10
- package/dist/collection/components/sd-modal-container/sd-modal-container.js +150 -164
- package/dist/collection/components/sd-number-input/sd-number-input.js +31 -3
- package/dist/collection/components/sd-pagination/sd-pagination.config.js +25 -0
- package/dist/collection/components/sd-pagination/sd-pagination.css +69 -53
- package/dist/collection/components/sd-pagination/sd-pagination.js +53 -37
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +4 -4
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-radio/sd-radio.js +1 -1
- package/dist/collection/components/sd-radio-button/sd-radio-button.js +1 -1
- package/dist/collection/components/sd-radio-group/sd-radio-group.js +1 -1
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
- package/dist/collection/components/sd-select/sd-select.js +29 -1
- package/dist/collection/components/sd-select-group/sd-select-group.js +29 -1
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.js +4 -4
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.css +5 -5
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2-trigger/sd-select-v2-trigger.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2.config.js +0 -1
- package/dist/collection/components/sd-select-v2/sd-select-v2.js +31 -3
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.js +5 -5
- package/dist/collection/components/sd-table/sd-table.stories.helpers.js +146 -0
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +1 -1
- package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +2 -2
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-text-link/sd-text-link.js +3 -3
- package/dist/collection/components/sd-textarea/sd-textarea.js +29 -1
- package/dist/collection/components/sd-toast/sd-toast.js +2 -2
- package/dist/collection/components/sd-toast-container/sd-toast-container.config.js +1 -1
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/collection/components/table-test/table-test.js +1 -1
- package/dist/collection/utils/modal-stack.js +109 -0
- package/dist/collection/utils/modal.js +17 -23
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DHh_uT9m.js → p-B1j9ZWLJ.js} +1 -1
- package/dist/components/{p-DPJPXCqf.js → p-BBluw-CU.js} +1 -1
- package/dist/components/{p-D74FHxKd.js → p-BFd54Imz.js} +1 -1
- package/dist/components/{p-IbLrnrk8.js → p-BJshZele.js} +1 -1
- package/dist/components/p-BaHpEtbz.js +1 -0
- package/dist/components/{p-DZJZLfsh.js → p-BlqLear7.js} +1 -1
- package/dist/components/{p-CJwbBrt5.js → p-ByhWX2NK.js} +1 -1
- package/dist/components/{p-ByYIyCZY.js → p-BylHC3lv.js} +1 -1
- package/dist/components/p-C-txBx-h.js +1 -0
- package/dist/components/p-C0VkfKIA.js +1 -0
- package/dist/components/p-C4uWhzoG.js +1 -0
- package/dist/components/p-CEnwrYaY.js +1 -0
- package/dist/components/{p-DDOw5GBw.js → p-CLZ8NObl.js} +1 -1
- package/dist/components/{p-tZWFjQm2.js → p-COM91Bya.js} +1 -1
- package/dist/components/{p-BH4I7hqf.js → p-CS62OEXf.js} +1 -1
- package/dist/components/{p-iWu6aGXE.js → p-CX0V7awA.js} +1 -1
- package/dist/components/{p-DlsWuYWL.js → p-Cb1M05mf.js} +1 -1
- package/dist/{design-system/p-CRTx3YEe.js → components/p-Cj4NAUzE.js} +1 -1
- package/dist/components/{p-1iOCtFn5.js → p-CsPyZohK.js} +1 -1
- package/dist/components/{p-DhkPKN1J.js → p-CsVPC3FD.js} +1 -1
- package/dist/components/{p-tvysh3yO.js → p-Csfk-CtX.js} +1 -1
- package/dist/components/{p-DqYRbHxW.js → p-CtrDZYN5.js} +1 -1
- package/dist/components/p-D21iKAp7.js +1 -0
- package/dist/components/{p-cNJ6VOYI.js → p-D6C4-apu.js} +1 -1
- package/dist/components/p-D99-lhhk.js +1 -0
- package/dist/components/{p-V6yl4lMM.js → p-DGPGMB_Z.js} +1 -1
- package/dist/components/{p-CymMpTU-.js → p-DIro-Wat.js} +1 -1
- package/dist/components/{p-BstWg2vS.js → p-DPCj-bFr.js} +1 -1
- package/dist/components/p-DRVnqiWc.js +1 -0
- package/dist/components/p-D_lyw4rN.js +1 -0
- package/dist/components/{p-DL69hClF.js → p-Diis5oCN.js} +1 -1
- package/dist/components/{p-BRRvU4ZQ.js → p-DlkxQ9Jn.js} +1 -1
- package/dist/components/{p-Ds4UCVE1.js → p-DoSEK0_q.js} +1 -1
- package/dist/components/p-DukibDDA.js +1 -0
- package/dist/components/{p-hN9rpxkR.js → p-T5BGXHZg.js} +1 -1
- package/dist/components/{p-BF4hokOY.js → p-YgnF5oje.js} +1 -1
- package/dist/components/{p-CX2EDIQM.js → p-z9MoRjYX.js} +1 -1
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-button-v2.js +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-chip.d.ts +11 -0
- package/dist/components/sd-chip.js +1 -0
- package/dist/components/sd-circle-progress.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker-calendar.js +1 -1
- package/dist/components/sd-date-picker-trigger.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker-calendar.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-form.js +1 -1
- package/dist/components/sd-ghost-button.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-loading-container.js +1 -1
- package/dist/components/sd-loading-modal.js +1 -1
- package/dist/components/sd-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-progress.js +1 -1
- package/dist/components/sd-radio-button.js +1 -1
- package/dist/components/sd-radio-group.js +1 -1
- package/dist/components/sd-radio.js +1 -1
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-group.js +1 -1
- package/dist/components/sd-select-multiple-group.js +1 -1
- package/dist/components/sd-select-multiple.js +1 -1
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select-v2-list-item-search.js +1 -1
- package/dist/components/sd-select-v2-list-item.js +1 -1
- package/dist/components/sd-select-v2-listbox.js +1 -1
- package/dist/components/sd-select-v2-trigger.js +1 -1
- package/dist/components/sd-select-v2.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-text-link.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/components/sd-tr.js +1 -1
- package/dist/components/table-test.js +1 -1
- package/dist/design-system/design-system.css +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/{p-c44ba991.entry.js → p-002e10ac.entry.js} +1 -1
- package/dist/design-system/p-01ac7743.entry.js +1 -0
- package/dist/design-system/p-06080355.entry.js +1 -0
- package/dist/design-system/p-0929f910.entry.js +1 -0
- package/dist/design-system/{p-b2b5b2d3.entry.js → p-0b216b11.entry.js} +1 -1
- package/dist/design-system/{p-5b2486c9.entry.js → p-0bffdbf4.entry.js} +1 -1
- package/dist/design-system/{p-5224553e.entry.js → p-0d485537.entry.js} +1 -1
- package/dist/design-system/p-1389a68e.entry.js +1 -0
- package/dist/design-system/{p-aebf903f.entry.js → p-1a455448.entry.js} +1 -1
- package/dist/design-system/{p-10763304.entry.js → p-1b8e63a6.entry.js} +1 -1
- package/dist/design-system/{p-525aefd5.entry.js → p-23c31074.entry.js} +1 -1
- package/dist/design-system/{p-87a23bd0.entry.js → p-2a4b6bc7.entry.js} +1 -1
- package/dist/design-system/{p-fa1072f7.entry.js → p-308c2a72.entry.js} +1 -1
- package/dist/design-system/p-35b29182.entry.js +1 -0
- package/dist/design-system/{p-9e0b944f.entry.js → p-449e58ee.entry.js} +1 -1
- package/dist/design-system/{p-73383b2f.entry.js → p-48f1f9ff.entry.js} +1 -1
- package/dist/design-system/{p-504fdb4e.entry.js → p-4d434794.entry.js} +1 -1
- package/dist/design-system/p-4de3b6b1.entry.js +1 -0
- package/dist/design-system/p-4f9f25a1.entry.js +1 -0
- package/dist/design-system/p-5442b4b4.entry.js +1 -0
- package/dist/design-system/{p-40371bf6.entry.js → p-59aa62ff.entry.js} +1 -1
- package/dist/design-system/{p-7b433296.entry.js → p-5a0b0a1b.entry.js} +1 -1
- package/dist/design-system/p-609b3748.entry.js +1 -0
- package/dist/design-system/p-60ece09d.entry.js +1 -0
- package/dist/design-system/{p-10ed0768.entry.js → p-641c2f3d.entry.js} +1 -1
- package/dist/design-system/{p-2841d5e1.entry.js → p-64a56a4e.entry.js} +1 -1
- package/dist/design-system/{p-dff0060e.entry.js → p-6b2f6efb.entry.js} +1 -1
- package/dist/design-system/{p-e1202ad3.entry.js → p-6b478f5c.entry.js} +1 -1
- package/dist/design-system/{p-337267a7.entry.js → p-6ef2d08f.entry.js} +1 -1
- package/dist/design-system/{p-51fcc29f.entry.js → p-703eee55.entry.js} +1 -1
- package/dist/design-system/p-71897864.entry.js +1 -0
- package/dist/design-system/p-731429da.entry.js +1 -0
- package/dist/design-system/p-75c5e31b.entry.js +1 -0
- package/dist/design-system/{p-768efd5a.entry.js → p-7dd8beba.entry.js} +1 -1
- package/dist/design-system/{p-348eff76.entry.js → p-7ef0c428.entry.js} +1 -1
- package/dist/design-system/p-87222184.entry.js +1 -0
- package/dist/design-system/p-8cd1b533.entry.js +1 -0
- package/dist/design-system/{p-f9559741.entry.js → p-92a52f89.entry.js} +1 -1
- package/dist/design-system/{p-19257b97.entry.js → p-95d96917.entry.js} +1 -1
- package/dist/design-system/p-9dd7befe.entry.js +1 -0
- package/dist/design-system/{p-fb7e8c54.entry.js → p-9ecde011.entry.js} +1 -1
- package/dist/design-system/{p-b4e56b67.entry.js → p-9f0fe1f6.entry.js} +1 -1
- package/dist/design-system/p-BGyJgVXm.js +2 -0
- package/dist/design-system/{p-CJwbBrt5.js → p-ByhWX2NK.js} +1 -1
- package/dist/design-system/p-C-txBx-h.js +1 -0
- package/dist/design-system/p-C4tHYnB4.js +1 -0
- package/dist/design-system/p-DRVnqiWc.js +1 -0
- package/dist/design-system/p-a7ef7465.entry.js +1 -0
- package/dist/design-system/p-ac9f7551.entry.js +1 -0
- package/dist/design-system/{p-513d85e1.entry.js → p-ade9319d.entry.js} +1 -1
- package/dist/design-system/{p-671a9ca8.entry.js → p-aeadfb9c.entry.js} +1 -1
- package/dist/design-system/p-b3d959b0.entry.js +1 -0
- package/dist/design-system/{p-b6e7b8c8.entry.js → p-cdedac3c.entry.js} +1 -1
- package/dist/design-system/{p-5982bcd0.entry.js → p-d43772c0.entry.js} +1 -1
- package/dist/design-system/p-d668fd71.entry.js +1 -0
- package/dist/design-system/{p-c6d2f909.entry.js → p-dfa716e0.entry.js} +1 -1
- package/dist/design-system/{p-a66529a5.entry.js → p-e1288299.entry.js} +1 -1
- package/dist/design-system/p-e3a1e677.entry.js +1 -0
- package/dist/design-system/{p-e385cbf4.entry.js → p-fa888a37.entry.js} +1 -1
- package/dist/esm/{component.textinput-CJwbBrt5.js → component.textinput-ByhWX2NK.js} +3 -2
- package/dist/esm/design-system.js +3 -3
- package/dist/esm/{index-Dcpqhs6V.js → index-BGyJgVXm.js} +1 -1
- package/dist/esm/index.js +36 -41
- package/dist/esm/loader.js +3 -3
- package/dist/esm/modal-stack-DRVnqiWc.js +105 -0
- package/dist/esm/sd-action-modal.entry.js +2 -2
- package/dist/esm/sd-badge.entry.js +2 -2
- package/dist/esm/sd-barcode-input.entry.js +4 -3
- package/dist/esm/sd-button-v2_2.entry.js +3 -3
- package/dist/esm/sd-button_4.entry.js +35 -18
- package/dist/esm/sd-calendar.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +2 -2
- package/dist/esm/sd-checkbox.entry.js +1 -1
- package/dist/esm/sd-chip.entry.js +310 -0
- package/dist/esm/sd-circle-progress.entry.js +2 -2
- package/dist/esm/sd-confirm-modal_2.entry.js +4 -4
- package/dist/esm/sd-date-box.entry.js +1 -1
- package/dist/esm/sd-date-picker-calendar.entry.js +2 -2
- package/dist/esm/sd-date-picker-trigger.entry.js +3 -3
- package/dist/esm/sd-date-picker.entry.js +4 -3
- package/dist/esm/sd-date-range-picker-calendar.entry.js +2 -2
- package/dist/esm/sd-date-range-picker.entry.js +4 -3
- package/dist/esm/sd-dropdown-button.entry.js +5 -16
- package/dist/esm/sd-file-picker.entry.js +5 -4
- package/dist/esm/sd-form.entry.js +1 -1
- package/dist/esm/sd-ghost-button.entry.js +6 -6
- package/dist/esm/sd-guide.entry.js +167 -34
- package/dist/esm/sd-input_2.entry.js +8 -7
- package/dist/esm/sd-loading-container.entry.js +4 -4
- package/dist/esm/sd-modal-container.entry.js +126 -155
- package/dist/esm/sd-number-input.entry.js +5 -4
- package/dist/esm/sd-pagination_2.entry.js +117 -42
- package/dist/esm/sd-popover.entry.js +4 -4
- package/dist/esm/sd-portal.entry.js +4 -4
- package/dist/esm/sd-progress.entry.js +3 -3
- package/dist/esm/sd-radio-button.entry.js +2 -2
- package/dist/esm/sd-radio-group.entry.js +2 -2
- package/dist/esm/sd-radio.entry.js +2 -2
- package/dist/esm/sd-select-dropdown_2.entry.js +4 -4
- package/dist/esm/sd-select-group.entry.js +3 -2
- package/dist/esm/sd-select-multiple-group.entry.js +2 -2
- package/dist/esm/sd-select-multiple.entry.js +2 -2
- package/dist/esm/sd-select-option-group.entry.js +4 -4
- package/dist/esm/sd-select-v2-list-item_4.entry.js +12 -16
- package/dist/esm/sd-select.entry.js +3 -2
- package/dist/esm/sd-switch.entry.js +2 -2
- package/dist/esm/sd-table.entry.js +6 -6
- package/dist/esm/sd-tabs.entry.js +2 -2
- package/dist/esm/sd-tag.entry.js +3 -3
- package/dist/esm/sd-tbody.entry.js +2 -2
- package/dist/esm/sd-td.entry.js +2 -2
- package/dist/esm/sd-text-link.entry.js +4 -4
- package/dist/esm/sd-textarea.entry.js +4 -3
- package/dist/esm/sd-thead.entry.js +4 -4
- package/dist/esm/sd-toast-container.entry.js +3 -3
- package/dist/esm/sd-toast.entry.js +3 -3
- package/dist/esm/sd-toggle.entry.js +2 -2
- package/dist/esm/sd-tr.entry.js +3 -3
- package/dist/esm/system-C-txBx-h.js +14 -0
- package/dist/esm/table-test.entry.js +2 -2
- package/dist/esm/{tooltipArrow-fP-ISMAm.js → tooltipArrow-BAjP9_Hx.js} +1 -1
- package/dist/types/components/sd-barcode-input/sd-barcode-input.d.ts +2 -0
- package/dist/types/components/sd-chip/sd-chip.config.d.ts +36 -0
- package/dist/types/components/sd-chip/sd-chip.d.ts +47 -0
- package/dist/types/components/sd-date-picker/sd-date-picker.d.ts +2 -0
- package/dist/types/components/sd-date-range-picker/sd-date-range-picker.d.ts +2 -0
- package/dist/types/components/sd-field/sd-field.config.d.ts +2 -0
- package/dist/types/components/sd-field/sd-field.d.ts +2 -1
- package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +2 -0
- package/dist/types/components/sd-guide/sd-guide.config.d.ts +44 -0
- package/dist/types/components/sd-guide/sd-guide.d.ts +3 -4
- package/dist/types/components/sd-input/sd-input.d.ts +2 -0
- package/dist/types/components/sd-loading-container/sd-loading-container.config.d.ts +1 -1
- package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +12 -16
- package/dist/types/components/sd-number-input/sd-number-input.d.ts +2 -0
- package/dist/types/components/sd-pagination/sd-pagination.config.d.ts +23 -0
- package/dist/types/components/sd-pagination/sd-pagination.d.ts +3 -3
- package/dist/types/components/sd-select/sd-select.d.ts +2 -0
- package/dist/types/components/sd-select-group/sd-select-group.d.ts +2 -0
- package/dist/types/components/sd-select-v2/sd-select-v2.config.d.ts +0 -1
- package/dist/types/components/sd-select-v2/sd-select-v2.d.ts +2 -0
- package/dist/types/components/sd-table/sd-table.stories.helpers.d.ts +29 -0
- package/dist/types/components/sd-textarea/sd-textarea.d.ts +2 -0
- package/dist/types/components/sd-toast-container/sd-toast-container.config.d.ts +1 -1
- package/dist/types/components.d.ts +226 -18
- package/dist/types/utils/modal-stack.d.ts +17 -0
- package/hydrate/index.js +1000 -358
- package/hydrate/index.mjs +1000 -358
- package/package.json +1 -1
- package/dist/components/p-B_7ozne7.js +0 -1
- package/dist/components/p-BsPBl6g5.js +0 -1
- package/dist/components/p-BuSniZ67.js +0 -1
- package/dist/components/p-C02KLCcO.js +0 -1
- package/dist/components/p-CCHce_Dt.js +0 -1
- package/dist/components/p-CkMs7IA8.js +0 -1
- package/dist/components/p-DLeCo2gh.js +0 -1
- package/dist/components/p-DNVUhw5A.js +0 -1
- package/dist/components/p-UR2Cf2Sm.js +0 -1
- package/dist/design-system/p-1645da95.entry.js +0 -1
- package/dist/design-system/p-244d2d6e.entry.js +0 -1
- package/dist/design-system/p-298d9b57.entry.js +0 -1
- package/dist/design-system/p-2edd355b.entry.js +0 -1
- package/dist/design-system/p-3b8595de.entry.js +0 -1
- package/dist/design-system/p-3bbf23b4.entry.js +0 -1
- package/dist/design-system/p-4c55ba79.entry.js +0 -1
- package/dist/design-system/p-6e9d6063.entry.js +0 -1
- package/dist/design-system/p-6eb3462d.entry.js +0 -1
- package/dist/design-system/p-7cf63a80.entry.js +0 -1
- package/dist/design-system/p-7fe09661.entry.js +0 -1
- package/dist/design-system/p-87b2c270.entry.js +0 -1
- package/dist/design-system/p-9925857c.entry.js +0 -1
- package/dist/design-system/p-9cb3be8c.entry.js +0 -1
- package/dist/design-system/p-Dcpqhs6V.js +0 -2
- package/dist/design-system/p-b56ae914.entry.js +0 -1
- package/dist/design-system/p-d263d476.entry.js +0 -1
- package/dist/design-system/p-e1c17466.entry.js +0 -1
- package/dist/design-system/p-e232fb11.entry.js +0 -1
- package/dist/design-system/p-e474fa8c.entry.js +0 -1
- package/dist/design-system/p-e9d36c02.entry.js +0 -1
|
@@ -15,6 +15,7 @@ export class SdSelectV2 {
|
|
|
15
15
|
label = '';
|
|
16
16
|
labelWidth = '';
|
|
17
17
|
addonLabel = '';
|
|
18
|
+
addonAlign = 'start';
|
|
18
19
|
error = false;
|
|
19
20
|
hint = '';
|
|
20
21
|
errorMessage = '';
|
|
@@ -207,13 +208,13 @@ export class SdSelectV2 {
|
|
|
207
208
|
this.closeDropdown();
|
|
208
209
|
},
|
|
209
210
|
};
|
|
210
|
-
return (h("sd-field", { key: '
|
|
211
|
+
return (h("sd-field", { key: '6074cfea700e1f3ea03aaedb0146d7dffdaa7101', name: this.fieldName || this.internalName, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, onMouseEnter: () => {
|
|
211
212
|
this.hovered = true;
|
|
212
213
|
}, onMouseLeave: () => {
|
|
213
214
|
this.hovered = false;
|
|
214
|
-
} }, h("div", { key: '
|
|
215
|
+
} }, h("div", { key: '4840cfcf19e262903110245f88b73f3f03713624', class: "sd-select-v2", ref: el => {
|
|
215
216
|
this.triggerRef = el;
|
|
216
|
-
} }, h("sd-select-v2-trigger", { key: '
|
|
217
|
+
} }, h("sd-select-v2-trigger", { key: '4b34dd8007864623d17c80b4e5cea02aa4db954a', displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, isOpen: this.isOpen, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: '7ec2c4ca8e32f877a894f9f766d3558c10d66596', ...portalProps }, h("sd-select-v2-listbox", { key: 'c804a19a142d2978d8fb4eaa33ad2a6a7028e7d3', name: this.name, options: this.options, value: this.value, emitValue: this.emitValue, triggerWidth: this.triggerWidth, maxWidth: this.resolvedMaxDropdownWidth, maxHeight: this.resolvedDropdownHeight, onSdOptionSelect: event => this.handleOptionSelect(event.detail) })))));
|
|
217
218
|
}
|
|
218
219
|
static get is() { return "sd-select-v2"; }
|
|
219
220
|
static get originalStyleUrls() {
|
|
@@ -447,6 +448,33 @@ export class SdSelectV2 {
|
|
|
447
448
|
"attribute": "addon-label",
|
|
448
449
|
"defaultValue": "''"
|
|
449
450
|
},
|
|
451
|
+
"addonAlign": {
|
|
452
|
+
"type": "string",
|
|
453
|
+
"mutable": false,
|
|
454
|
+
"complexType": {
|
|
455
|
+
"original": "FieldAddonAlign",
|
|
456
|
+
"resolved": "\"center\" | \"end\" | \"start\"",
|
|
457
|
+
"references": {
|
|
458
|
+
"FieldAddonAlign": {
|
|
459
|
+
"location": "import",
|
|
460
|
+
"path": "../sd-field/sd-field.config",
|
|
461
|
+
"id": "src/components/sd-field/sd-field.config.ts::FieldAddonAlign",
|
|
462
|
+
"referenceLocation": "FieldAddonAlign"
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
"required": false,
|
|
467
|
+
"optional": false,
|
|
468
|
+
"docs": {
|
|
469
|
+
"tags": [],
|
|
470
|
+
"text": ""
|
|
471
|
+
},
|
|
472
|
+
"getter": false,
|
|
473
|
+
"setter": false,
|
|
474
|
+
"reflect": false,
|
|
475
|
+
"attribute": "addon-align",
|
|
476
|
+
"defaultValue": "'start'"
|
|
477
|
+
},
|
|
450
478
|
"error": {
|
|
451
479
|
"type": "boolean",
|
|
452
480
|
"mutable": true,
|
|
@@ -40,7 +40,7 @@ export class SdSwitch {
|
|
|
40
40
|
'--sd-switch-line-height': `${SWITCH_TYPOGRAPHY.lineHeight}px`,
|
|
41
41
|
'--sd-switch-text-decoration': SWITCH_TYPOGRAPHY.textDecoration,
|
|
42
42
|
};
|
|
43
|
-
return (h("label", { key: '
|
|
43
|
+
return (h("label", { key: '730eacd9dbc035c76ff99396caf13b37ecc19c86', "aria-label": this.label || 'switch', class: this.switchClasses, style: cssVars }, h("input", { key: '2cb2e4ba617d6f9f2d86a56ac6cc134a43cd1594', type: "checkbox", checked: this.value, disabled: this.disabled, onInput: this.handleChange }), h("div", { key: 'b67a6243d2af4b89e433e44047da3336e87da9f9', class: "sd-switch__track" }, h("div", { key: 'a99cf1e298cd3ed474cb7f94a48332475fe68641', class: "sd-switch__knob" })), this.label && h("span", { key: '084960a8dce47c47b17f807aa46acea3a08aa53b', class: "sd-switch__label" }, this.label)));
|
|
44
44
|
}
|
|
45
45
|
static get is() { return "sd-switch"; }
|
|
46
46
|
static get originalStyleUrls() {
|
|
@@ -495,24 +495,24 @@ export class SdTable {
|
|
|
495
495
|
}
|
|
496
496
|
render() {
|
|
497
497
|
const resolvedTableId = this.getResolvedTableId();
|
|
498
|
-
return (h(Host, { key: '
|
|
498
|
+
return (h(Host, { key: 'd2a43d075579bf4ffc53949fb074afaf9987113d' }, h("div", { key: '3e6b69b3ab38281c1763ab779d66b0916b2cb295', class: "sd-table__container", style: {
|
|
499
499
|
'--table-width': this.width,
|
|
500
500
|
'--table-height': this.height,
|
|
501
501
|
'--table-container-height': `calc(${this.height || '100%'} - ${this.pagination && this.rowCount > 0 && !this.useVirtualScroll ? 48 : 0}px)`,
|
|
502
|
-
} }, h("div", { key: '
|
|
502
|
+
} }, h("div", { key: '60ac7f5d53cdfbb0225dd3ed57be4788e6b7ff2b', class: {
|
|
503
503
|
'sd-table__clip': true,
|
|
504
504
|
'sd-table__clip--has-pagination': !!(this.pagination &&
|
|
505
505
|
this.pagination.rowsPerPage > 0 &&
|
|
506
506
|
this.rowCount > 0 &&
|
|
507
507
|
!this.useVirtualScroll),
|
|
508
|
-
} }, h("div", { key: '
|
|
508
|
+
} }, h("div", { key: 'ea4144995650e283bf62de067fe792e1b7d90eb1', class: {
|
|
509
509
|
'sd-table__wrapper': true,
|
|
510
510
|
'sd-table__wrapper--loading': this.isLoading,
|
|
511
511
|
'sd-table__wrapper--no-data': this.rowCount === 0 && !this.isLoading,
|
|
512
|
-
} }, this.isLoading && (h("div", { key: '
|
|
512
|
+
} }, this.isLoading && (h("div", { key: '36fd919bbf313d4d5a62d657223ce7e68bd7678d', class: "sd-table__loading", style: { top: `${this.loadingScrollTop}px` } }, h("sd-circle-progress", { key: '5854fbf9090072e1caf5d4a497fe35403c4c8c21', indeterminate: true }))), this.rowCount === 0 && !this.isLoading && (h("div", { key: '210bc0045bacd05d4134f96716f74c5893c494dd', class: "sd-table__no-data" }, h("slot", { key: 'a2aabac27057d00a6352230d23a9c776a99818b5', name: "no-data" }, h("span", { key: 'd030f9abc7bc3afd8cb70433513a8875ae3eecb2' }, this.resolvedNoDataLabel)))), h("table", { key: '731208435f8e018b74f2a0670e4c4f68f4c7fd58', class: this.tableClasses }, h("slot", { key: 'd12bbe4ed17e9c0d781c50c6b4161c7bddec3480', name: `${resolvedTableId}-head`, onSlotchange: this.handleStructureSlotChange }), h("slot", { key: '555d63d8f0ad56d49bcc09451b893e05cc7110cd', name: `${resolvedTableId}-body`, onSlotchange: this.handleStructureSlotChange })))), this.pagination &&
|
|
513
513
|
this.pagination.rowsPerPage > 0 &&
|
|
514
514
|
this.rowCount > 0 &&
|
|
515
|
-
!this.useVirtualScroll && (h("div", { key: '
|
|
515
|
+
!this.useVirtualScroll && (h("div", { key: '83b1c554f574013c8a93707f99d4224c581d485c', class: "sd-table__pagination" }, h("sd-pagination", { key: '425c036f79001e4d7f012dc528d2c2ecec25ed9b', currentPage: !this.useInternalPagination ? this.pagination.page : this.currentPage, lastPage: !this.useInternalPagination ? this.pagination.lastPage : this.lastPageNumber, onSdPageChange: (e) => this.changePage(e.detail) }), this.useRowsPerPageSelect && (h("sd-select-v2", { key: '1c7c6ddacdd24cfa0cef627cd8ba06fe2466d415', value: this.useInternalPagination
|
|
516
516
|
? this.innerRowsPerPage
|
|
517
517
|
: this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", emitValue: true, onSdUpdate: e => {
|
|
518
518
|
if (!this.isRowsPerPageValue(e.detail))
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else
|
|
6
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
7
|
+
if (d = decorators[i])
|
|
8
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
import { css, LitElement, html, nothing } from "lit";
|
|
12
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
13
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
14
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
15
|
+
// React/Vue의 useSdTableVirtualScroll과 동일 역할:
|
|
16
|
+
// sd-table의 sdVirtualUpdate를 listen해서 vsStart..vsEnd 슬라이스만 슬롯에 꽂는다.
|
|
17
|
+
// Storybook(lit-html)에는 그 역할을 할 reactive 호스트가 없어서 wrapper로 제공.
|
|
18
|
+
//
|
|
19
|
+
// declare + constructor 초기화 패턴: tsconfig가 target es2022라
|
|
20
|
+
// class field가 native define으로 컴파일되어 lit의 accessor를 overwrite하는 문제를 회피.
|
|
21
|
+
let StoryVirtualTable = class StoryVirtualTable extends LitElement {
|
|
22
|
+
static styles = css `
|
|
23
|
+
:host {
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
tableRef = createRef();
|
|
29
|
+
detachListener;
|
|
30
|
+
syncRafId = 0;
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
this.columns = [];
|
|
34
|
+
this.rows = [];
|
|
35
|
+
this.stickyColumn = { left: 0, right: 0 };
|
|
36
|
+
this.stickyHeader = false;
|
|
37
|
+
this.selectable = false;
|
|
38
|
+
this.resizable = false;
|
|
39
|
+
this.height = '480px';
|
|
40
|
+
this.width = '100%';
|
|
41
|
+
this.rowHeight = 44;
|
|
42
|
+
this.rowKey = 'id';
|
|
43
|
+
this.range = null;
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
super.disconnectedCallback();
|
|
47
|
+
this.detachListener?.();
|
|
48
|
+
if (this.syncRafId)
|
|
49
|
+
cancelAnimationFrame(this.syncRafId);
|
|
50
|
+
}
|
|
51
|
+
firstUpdated() {
|
|
52
|
+
const el = this.tableRef.value;
|
|
53
|
+
if (!el)
|
|
54
|
+
return;
|
|
55
|
+
const onUpdate = (e) => {
|
|
56
|
+
const detail = e.detail;
|
|
57
|
+
this.range = { from: detail.from, to: detail.to };
|
|
58
|
+
};
|
|
59
|
+
el.addEventListener('sdVirtualUpdate', onUpdate);
|
|
60
|
+
this.detachListener = () => el.removeEventListener('sdVirtualUpdate', onUpdate);
|
|
61
|
+
const trySync = () => {
|
|
62
|
+
const r = el
|
|
63
|
+
.getVirtualScrollRangeSync?.();
|
|
64
|
+
if (r && typeof r.from === 'number' && typeof r.to === 'number') {
|
|
65
|
+
this.range = { from: r.from, to: r.to };
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.syncRafId = requestAnimationFrame(trySync);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
trySync();
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
const from = this.range?.from ?? 0;
|
|
75
|
+
const to = this.range?.to ?? 0;
|
|
76
|
+
const slice = this.range ? this.rows.slice(from, to) : [];
|
|
77
|
+
return html `
|
|
78
|
+
<sd-table
|
|
79
|
+
${ref(this.tableRef)}
|
|
80
|
+
.columns=${this.columns}
|
|
81
|
+
.rows=${this.rows}
|
|
82
|
+
row-key=${this.rowKey}
|
|
83
|
+
?selectable=${this.selectable}
|
|
84
|
+
?resizable=${this.resizable}
|
|
85
|
+
?sticky-header=${this.stickyHeader}
|
|
86
|
+
.stickyColumn=${this.stickyColumn}
|
|
87
|
+
width=${this.width}
|
|
88
|
+
height=${this.height}
|
|
89
|
+
?use-virtual-scroll=${true}
|
|
90
|
+
row-height=${this.rowHeight}
|
|
91
|
+
>
|
|
92
|
+
<sd-thead></sd-thead>
|
|
93
|
+
<sd-tbody>
|
|
94
|
+
${repeat(slice, (_row, i) => from + i, (row, i) => {
|
|
95
|
+
const absoluteIndex = from + i;
|
|
96
|
+
return html `
|
|
97
|
+
<sd-tr row-key=${String(absoluteIndex)} .row=${row}>
|
|
98
|
+
${this.renderRow ? this.renderRow(row, absoluteIndex) : nothing}
|
|
99
|
+
</sd-tr>
|
|
100
|
+
`;
|
|
101
|
+
})}
|
|
102
|
+
</sd-tbody>
|
|
103
|
+
</sd-table>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
__decorate([
|
|
108
|
+
property({ attribute: false })
|
|
109
|
+
], StoryVirtualTable.prototype, "columns", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ attribute: false })
|
|
112
|
+
], StoryVirtualTable.prototype, "rows", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ attribute: false })
|
|
115
|
+
], StoryVirtualTable.prototype, "stickyColumn", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: Boolean, attribute: 'sticky-header' })
|
|
118
|
+
], StoryVirtualTable.prototype, "stickyHeader", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
property({ type: Boolean })
|
|
121
|
+
], StoryVirtualTable.prototype, "selectable", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
property({ type: Boolean })
|
|
124
|
+
], StoryVirtualTable.prototype, "resizable", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
property()
|
|
127
|
+
], StoryVirtualTable.prototype, "height", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property()
|
|
130
|
+
], StoryVirtualTable.prototype, "width", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
property({ type: Number, attribute: 'row-height' })
|
|
133
|
+
], StoryVirtualTable.prototype, "rowHeight", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
property({ attribute: 'row-key' })
|
|
136
|
+
], StoryVirtualTable.prototype, "rowKey", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ attribute: false })
|
|
139
|
+
], StoryVirtualTable.prototype, "renderRow", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
state()
|
|
142
|
+
], StoryVirtualTable.prototype, "range", void 0);
|
|
143
|
+
StoryVirtualTable = __decorate([
|
|
144
|
+
customElement('story-virtual-table')
|
|
145
|
+
], StoryVirtualTable);
|
|
146
|
+
export { StoryVirtualTable };
|
|
@@ -41,7 +41,7 @@ export class SdTbody {
|
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
43
|
const hasRows = this.rows.length > 0;
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: '82a437ddf0cb3c34877b9dbcb47b5406c20a0c0e', slot: `${this.tableId}-body` }, h("tbody", { key: '0f0257720491c781eda0479fb0c08d7dffc4f734', class: { 'tbody': true, 'tbody--empty': !hasRows } }, hasRows ? ([
|
|
45
45
|
this.topSpacerHeight > 0 && (h("tr", { key: "spacer-top", class: "tbody__spacer", style: { height: `${this.topSpacerHeight}px`, display: 'block' } })),
|
|
46
46
|
h("slot", null),
|
|
47
47
|
this.bottomSpacerHeight > 0 && (h("tr", { key: "spacer-bottom", class: "tbody__spacer", style: { height: `${this.bottomSpacerHeight}px`, display: 'block' } })),
|
|
@@ -34,7 +34,7 @@ export class SdTd {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
render() {
|
|
37
|
-
return (h(Host, { key: '
|
|
37
|
+
return (h(Host, { key: 'c6ddb546268b573694b827509ebdfe74fff8a15a', class: { [`align-${this.align}`]: Boolean(this.align) } }, h("slot", { key: '0b59fb8a0cfa1ef628f50496af96aa2f39fdc89a' })));
|
|
38
38
|
}
|
|
39
39
|
static get is() { return "sd-td"; }
|
|
40
40
|
static get originalStyleUrls() {
|
|
@@ -128,16 +128,16 @@ export class SdThead {
|
|
|
128
128
|
const stickyLeftCols = this.visibleColumns.slice(0, stickyLeftCount);
|
|
129
129
|
const middleCols = this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
130
130
|
const stickyRightCols = this.visibleColumns.slice(this.visibleColumns.length - stickyRightCount);
|
|
131
|
-
return (h(Host, { key: '
|
|
131
|
+
return (h(Host, { key: '97badde9634e2e7363eace5a402fc49a587459c3', slot: `${this.tableId}-head` }, h("thead", { key: 'd1ce731f6082679d8d61f4b74ac122f28f344909', class: {
|
|
132
132
|
'thead': true,
|
|
133
133
|
'thead--sticky': this._stickyHeader,
|
|
134
|
-
} }, h("tr", { key: '
|
|
134
|
+
} }, h("tr", { key: 'd0f8b1e8b8a7174cc9b39fabf782eddf2e2accaa', class: "tr" }, this._selectable && (h("th", { key: 'c422f5bd9f9a045785d2d91dd9e2dee6e8f91185', class: {
|
|
135
135
|
'th': true,
|
|
136
136
|
'th--selected': true,
|
|
137
137
|
'sticky-left': true,
|
|
138
138
|
'sticky-left-edge': stickyLeftCount === 0,
|
|
139
139
|
'is-scrolled-left': stickyLeftCount === 0 && this._scrolledLeft,
|
|
140
|
-
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { key: '
|
|
140
|
+
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { key: '32cea740457b21d4d6fd53a8f1c10b505a24a481', value: this.getIsAllChecked(), disabled: !safeRows.length, onSdUpdate: (e) => this.handleSelectAll(e.detail) }))), stickyLeftCols.map((col, idx) => (h("th", { key: col.name, class: {
|
|
141
141
|
'th': true,
|
|
142
142
|
[`${col.thClass}`]: Boolean(col.thClass),
|
|
143
143
|
'sticky-left': true,
|
|
@@ -123,13 +123,13 @@ export class SdTr {
|
|
|
123
123
|
const stickyLeftCols = this.visibleColumns.slice(0, stickyLeftCount);
|
|
124
124
|
const middleCols = this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
125
125
|
const stickyRightCols = this.visibleColumns.slice(this.visibleColumns.length - stickyRightCount);
|
|
126
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: '3bc910f3afa801d7824eee2e73456ef152c7dc93', style: { display: this.isVisible ? '' : 'none' } }, h("tr", { key: '93b1f4113ae63aa1c0cf79addaa9e8d15c9e8287', class: "tr" }, this._selectable && (h("td", { key: '0caba47c216126f4b7407dfe26afb9f0c75f6450', class: {
|
|
127
127
|
'td': true,
|
|
128
128
|
'td--selected': true,
|
|
129
129
|
'sticky-left': true,
|
|
130
130
|
'sticky-left-edge': stickyLeftCount === 0,
|
|
131
131
|
'is-scrolled-left': stickyLeftCount === 0 && this._scrolledLeft,
|
|
132
|
-
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { key: '
|
|
132
|
+
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { key: '2e41b3902f489877b624266e588221698aaa8f12', value: this.isSelected(), onSdUpdate: () => this.handleSelect() }))), stickyLeftCols.map((col, idx) => (h("td", { key: col.name, class: {
|
|
133
133
|
'td': true,
|
|
134
134
|
[`td--${col.align || 'left'}`]: true,
|
|
135
135
|
'sticky-left': true,
|
|
@@ -39,7 +39,7 @@ export class SdTabs {
|
|
|
39
39
|
return `square_xs_${color}`;
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return (h("div", { key: '
|
|
42
|
+
return (h("div", { key: '62ace36515932f8889fc35121b6a8cf98fd9a314', class: this.getContainerClasses() }, this.tabs.map((tab, index) => {
|
|
43
43
|
const badgeName = this.getBadgeName(tab);
|
|
44
44
|
return (h("div", { key: `tab-${index}`, class: this.getTabClasses(tab), "aria-label": tab.label || 'tab', onClick: () => this.handleTabClick(tab.value) }, h("span", { "data-label": tab.label, class: "sd-tabs__label" }, tab.label), tab.badge && h("sd-tag", { name: badgeName, label: tab.badge.toString() })));
|
|
45
45
|
})));
|
|
@@ -19,7 +19,7 @@ export class SdTag {
|
|
|
19
19
|
render() {
|
|
20
20
|
const config = this.resolvedConfig;
|
|
21
21
|
const iconNode = this.renderIcon(config.icon, config.iconSize);
|
|
22
|
-
return (h("span", { key: '
|
|
22
|
+
return (h("span", { key: '3e3bf735f8d832e75f1061eac69ccd8972b9f40f', class: "sd-tag", style: {
|
|
23
23
|
'--sd-tag-background': config.background,
|
|
24
24
|
'--sd-tag-content': config.content,
|
|
25
25
|
'--sd-tag-height': config.height,
|
|
@@ -29,7 +29,7 @@ export class SdTag {
|
|
|
29
29
|
'--sd-tag-font-weight': config.fontWeight,
|
|
30
30
|
'--sd-tag-line-height': config.lineHeight,
|
|
31
31
|
'--sd-tag-radius': config.radius,
|
|
32
|
-
}, "aria-label": this.label || 'tag' }, this.icon && this.isLeft && iconNode, h("span", { key: '
|
|
32
|
+
}, "aria-label": this.label || 'tag' }, this.icon && this.isLeft && iconNode, h("span", { key: 'a06237d1d29bb64b4b830294f5385a9b9b909624', class: "sd-tag__label" }, this.label), this.icon && !this.isLeft && iconNode));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "sd-tag"; }
|
|
35
35
|
static get originalStyleUrls() {
|
|
@@ -26,16 +26,16 @@ export class SdTextLink {
|
|
|
26
26
|
'--sd-text-link-text-decoration': typo.textDecoration,
|
|
27
27
|
...(this.disabled ? { '--sd-text-link-color': TEXT_LINK_COLORS.content.disabled } : {}),
|
|
28
28
|
};
|
|
29
|
-
return (h("span", { key: '
|
|
29
|
+
return (h("span", { key: 'c485091d0a9d7f8aa946ac54d96baab50bcaa3c7', class: {
|
|
30
30
|
'sd-text-link': true,
|
|
31
31
|
'sd-text-link--disabled': this.disabled,
|
|
32
|
-
}, style: cssVars, onClick: this.handleClick }, this.icon && (h("sd-icon", { key: '
|
|
32
|
+
}, style: cssVars, onClick: this.handleClick }, this.icon && (h("sd-icon", { key: '98a2df9a2ba9b5d77eb73c0989cdf38383cfcd15', name: this.icon, size: TEXT_LINK_LAYOUT.iconSize, color: iconColor, class: "sd-text-link__icon" })), h("span", { key: '3c6867611e0d970855897b06f7e9368a8588ff76', class: labelClassName }, this.label), this.useArrow && (h("span", { key: '460bebf92782560d64e41b47ea9ef42b66cc08c0', class: "sd-text-link__arrow", style: {
|
|
33
33
|
width: `${TEXT_LINK_LAYOUT.arrowFrame}px`,
|
|
34
34
|
height: `${TEXT_LINK_LAYOUT.arrowFrame}px`,
|
|
35
35
|
display: 'inline-flex',
|
|
36
36
|
alignItems: 'center',
|
|
37
37
|
justifyContent: 'center',
|
|
38
|
-
} }, h("sd-icon", { key: '
|
|
38
|
+
} }, h("sd-icon", { key: 'fee7c74359e683829ad3fa802191b651aa9e94da', name: "chevronRight", size: TEXT_LINK_LAYOUT.arrowIconSize, color: arrowColor })))));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "sd-text-link"; }
|
|
41
41
|
static get originalStyleUrls() {
|
|
@@ -18,6 +18,7 @@ export class SdTextarea {
|
|
|
18
18
|
label = '';
|
|
19
19
|
labelWidth = '';
|
|
20
20
|
addonLabel = '';
|
|
21
|
+
addonAlign = 'start';
|
|
21
22
|
hint = '';
|
|
22
23
|
errorMessage = '';
|
|
23
24
|
icon = undefined;
|
|
@@ -104,7 +105,7 @@ export class SdTextarea {
|
|
|
104
105
|
'--sd-system-size-field-sm-height': 'auto',
|
|
105
106
|
'--sd-system-radius-field-sm': `${TEXTAREA_TOKENS.radius}px`,
|
|
106
107
|
};
|
|
107
|
-
return (h("sd-field", { key: '
|
|
108
|
+
return (h("sd-field", { key: '9f456eb1b18d0d83fb40f0b6b66125d587bcb4c6', name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: 'f201962ed64908c97d24923b62e97c33b356170a', class: "sd-textarea__content" }, h("textarea", { key: '826e4b3c4743dbf16387b68317bd09ca7c75746d', name: this.name, ref: el => (this.nativeEl = el), class: `sd-textarea__native ${this.textareaClass}`, value: this.internalValue || '', placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, autofocus: this.autoFocus, maxLength: this.maxLength, rows: this.rows, spellcheck: this.spellcheck, onInput: this.handleInput, onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event), style: this.textareaStyle }))));
|
|
108
109
|
}
|
|
109
110
|
static get is() { return "sd-textarea"; }
|
|
110
111
|
static get originalStyleUrls() {
|
|
@@ -395,6 +396,33 @@ export class SdTextarea {
|
|
|
395
396
|
"attribute": "addon-label",
|
|
396
397
|
"defaultValue": "''"
|
|
397
398
|
},
|
|
399
|
+
"addonAlign": {
|
|
400
|
+
"type": "string",
|
|
401
|
+
"mutable": false,
|
|
402
|
+
"complexType": {
|
|
403
|
+
"original": "FieldAddonAlign",
|
|
404
|
+
"resolved": "\"center\" | \"end\" | \"start\"",
|
|
405
|
+
"references": {
|
|
406
|
+
"FieldAddonAlign": {
|
|
407
|
+
"location": "import",
|
|
408
|
+
"path": "../sd-field/sd-field.config",
|
|
409
|
+
"id": "src/components/sd-field/sd-field.config.ts::FieldAddonAlign",
|
|
410
|
+
"referenceLocation": "FieldAddonAlign"
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"required": false,
|
|
415
|
+
"optional": false,
|
|
416
|
+
"docs": {
|
|
417
|
+
"tags": [],
|
|
418
|
+
"text": ""
|
|
419
|
+
},
|
|
420
|
+
"getter": false,
|
|
421
|
+
"setter": false,
|
|
422
|
+
"reflect": false,
|
|
423
|
+
"attribute": "addon-align",
|
|
424
|
+
"defaultValue": "'start'"
|
|
425
|
+
},
|
|
398
426
|
"hint": {
|
|
399
427
|
"type": "string",
|
|
400
428
|
"mutable": false,
|
|
@@ -11,10 +11,10 @@ export class SdToast {
|
|
|
11
11
|
render() {
|
|
12
12
|
const typeConfig = TOAST_TYPE_CONFIG[this.type] ?? TOAST_TYPE_CONFIG.default;
|
|
13
13
|
const iconSize = Number(TOAST_LAYOUT.iconSize);
|
|
14
|
-
return (h("div", { key: '
|
|
14
|
+
return (h("div", { key: 'a041d5561d09ef56f4afd722e141b0a2e3a9453f', style: {
|
|
15
15
|
'--sd-toast-bg': typeConfig.bg,
|
|
16
16
|
'--sd-toast-text': typeConfig.content,
|
|
17
|
-
} }, h("div", { key: '
|
|
17
|
+
} }, h("div", { key: 'bf2a397484ec5938c0442ee0ee98f0ce00ad1ec0', class: "sd-toast", role: "status", "aria-live": "polite", "aria-atomic": "true" }, this.icon && (h("div", { key: '4ea8468b31909e3aea1a293c393621e1815dea5c', class: "sd-toast__icon" }, h("sd-icon", { key: '407a0be71e36a6dca30f5cfb300f2c9ebf6b32c2', name: this.icon, size: iconSize, color: typeConfig.content }))), h("div", { key: '756ca54899ec4d6c3543f8fb1f681d09181674c9', class: "sd-toast__content" }, h("span", { key: 'f0e66dbd5e99bc3921a354ac51294a3c29fe9ea0', class: "sd-toast__message" }, this.message)), this.link && (h("a", { key: '9f4a1a938b7559b03d7dd824c7f2fdbcb093e6fe', href: this.link, class: "sd-toast__link", target: "_blank", rel: "noopener noreferrer" }, this.linkLabel || this.link)), this.useClose && (h("sd-ghost-button", { key: '03d64765901bc8a93f09642b09ae733fa9da0db4', class: "sd-toast__close", icon: "close", intent: this.type === 'caution' ? 'default' : 'inverse', ariaLabel: "close", size: "xs", onClick: () => this.close.emit() })))));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "sd-toast"; }
|
|
20
20
|
static get originalStyleUrls() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const DEFAULT_DURATION = 4000;
|
|
2
2
|
export const DEFAULT_MAX_VISIBLE = 3;
|
|
3
3
|
export const DEFAULT_GAP = 8;
|
|
4
|
-
export const DEFAULT_Z_INDEX =
|
|
4
|
+
export const DEFAULT_Z_INDEX = 999;
|
|
5
5
|
export const TRANSITION_DURATION = 400;
|
|
6
6
|
export const TRANSITION_FALLBACK_BUFFER = 100;
|
|
7
7
|
export const COLLAPSED_SCALE_STEP = 0.05;
|
|
@@ -216,7 +216,7 @@ export class SdToastContainer {
|
|
|
216
216
|
const activeToasts = toasts.filter(t => t.state !== 'exiting').reverse();
|
|
217
217
|
const indexMap = new Map();
|
|
218
218
|
activeToasts.forEach((t, i) => indexMap.set(t.id, i));
|
|
219
|
-
return (h("div", { key: '
|
|
219
|
+
return (h("div", { key: '4660dd2f2626d391bbcca7da59e16e6c4204d80d', class: "sd-toast-container", style: this.getContainerStyles(), onMouseEnter: () => {
|
|
220
220
|
this.expanded = true;
|
|
221
221
|
this.pauseTimers();
|
|
222
222
|
}, onMouseLeave: () => {
|
|
@@ -45,7 +45,7 @@ export class SdToggle {
|
|
|
45
45
|
'--sd-toggle-content-select': TOGGLE_COLORS.content.select,
|
|
46
46
|
'--sd-toggle-content-disabled': TOGGLE_COLORS.content.disabled,
|
|
47
47
|
};
|
|
48
|
-
return (h("label", { key: '
|
|
48
|
+
return (h("label", { key: '1e0864450b0447ec08643290d1050e4d0ee0c4a4', class: this.toggleClasses, style: cssVars, "aria-label": this.label || 'toggle' }, this.label, h("input", { key: '7e44e8569de24839c41e8c28f579923e3a837366', style: { display: 'none' }, type: "checkbox", onInput: this.handleChange })));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "sd-toggle"; }
|
|
51
51
|
static get originalStyleUrls() {
|
|
@@ -81,14 +81,14 @@ export class SdTooltip {
|
|
|
81
81
|
const toggleTooltip = () => (this.showTooltip = !this.showTooltip);
|
|
82
82
|
const divTrigger = trigger === 'hover' ? hoverTrigger : this.label ? {} : { onClick: toggleTooltip };
|
|
83
83
|
const buttonClickTrigger = trigger === 'click' && this.label ? { onSdClick: toggleTooltip } : {};
|
|
84
|
-
return (h(Fragment, { key: '
|
|
84
|
+
return (h(Fragment, { key: 'aade7a4be8e9955ca4dc437845ee8de9d212fd61' }, h("div", { key: '332c4872541bea334c1f0b6f06de8a1789dc10b8', class: `sd-tooltip-trigger ${this.sdClass || ''}`, ...divTrigger }, this.label ? (h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: icon, size: this.buttonSize ?? 'sm', color: color, variant: this.buttonVariant ?? 'primary', class: "sd-tooltip", ...buttonClickTrigger })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: icon, size: this.iconSize ?? 12, color: color, class: "sd-tooltip" }))), this.showTooltip && (h("sd-floating-portal", { key: '96f19d91f765020ae5663f216011e2000617c9d1', parentRef: this.buttonEl, onSdClose: this.handleClose.bind(this), placement: placement, offset: this.tooltipOffset }, h("div", { key: '12c2f1fbf59dc1a790016da071805164b0426419', ref: el => (this.menuEl = el), class: {
|
|
85
85
|
'sd-floating-menu': true,
|
|
86
86
|
[`sd-floating-menu--${tooltipType}`]: true,
|
|
87
87
|
[`sd-floating-menu--${placement}`]: true,
|
|
88
88
|
}, style: {
|
|
89
89
|
'--sd-floating-bg': typeConfig.bg,
|
|
90
90
|
'--sd-floating-content': typeConfig.content,
|
|
91
|
-
}, onMouseEnter: () => this.show(), onMouseLeave: () => this.startHideTimer() }, h("i", { key: '
|
|
91
|
+
}, onMouseEnter: () => this.show(), onMouseLeave: () => this.startHideTimer() }, h("i", { key: 'f69c0cb66d5be975f60bfa7cdbd46e0283d4af2b', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${placement}` }, h(TooltipArrow, { key: '3fbc2c3baa903e80d525225ab1f1aa4b3ec6ad4b' })), h("div", { key: 'a2286ef4e9f5d6c1b1a26ea044ddf1051900c5a2', class: "sd-floating-menu__content", innerHTML: this.slotContentHTML }))))));
|
|
92
92
|
}
|
|
93
93
|
static get is() { return "sd-tooltip"; }
|
|
94
94
|
static get originalStyleUrls() {
|
|
@@ -71,7 +71,7 @@ export class DataTable {
|
|
|
71
71
|
return el.innerHTML;
|
|
72
72
|
}
|
|
73
73
|
render() {
|
|
74
|
-
return (h("div", { key: '
|
|
74
|
+
return (h("div", { key: 'eb6246d49bb46a1c2b2b9d93cff90e7c0d6788b4', class: "table-wrapper" }, h("table", { key: '584d752e51f252f2dd7a29868ae4300b55c47065', class: { 'data-table': true, 'bordered': this.bordered, 'striped': this.striped } }, h("thead", { key: 'fd35de9ad1cb79cf77ab9f7a806d2d7258d8b11b' }, h("tr", { key: '39a42d9fc76571aa5ef6073ec554471d5fd1b4c1' }, this.columns.map(column => (h("th", { key: column.field, style: { width: column.width } }, this.renderHeaderContent(column)))))), h("tbody", { key: '5c3a2b5853f619666b20145e0f7a221c75969071' }, this.rows.map((row, rowIndex) => (h("tr", { key: rowIndex }, this.columns.map(column => (h("td", { key: `${rowIndex}-${column.field}` }, this.renderCellContent(column, row, rowIndex))))))))), h("div", { key: 'bbbd15c2d1b517774340dbcdfb59338f260df21b', class: "templates-slot", hidden: true }, h("slot", { key: '28733f09dd4a90976d9bb60102039981c736cf87' }))));
|
|
75
75
|
}
|
|
76
76
|
static get is() { return "table-test"; }
|
|
77
77
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const DEFAULT_BASE_Z_INDEX = 997;
|
|
2
|
+
let baseZIndex = DEFAULT_BASE_Z_INDEX;
|
|
3
|
+
let entries = [];
|
|
4
|
+
let bodyScrollLocked = false;
|
|
5
|
+
let previousBodyOverflow = null;
|
|
6
|
+
let isKeydownAttached = false;
|
|
7
|
+
function isBrowserEnvironment() {
|
|
8
|
+
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
9
|
+
}
|
|
10
|
+
function getTopInteractiveEntry() {
|
|
11
|
+
return [...entries].reverse().find(entry => entry.interactive);
|
|
12
|
+
}
|
|
13
|
+
function syncBodyScrollLock() {
|
|
14
|
+
if (!isBrowserEnvironment())
|
|
15
|
+
return;
|
|
16
|
+
const shouldLock = entries.length > 0;
|
|
17
|
+
if (shouldLock === bodyScrollLocked)
|
|
18
|
+
return;
|
|
19
|
+
if (shouldLock) {
|
|
20
|
+
previousBodyOverflow = document.body.style.overflow || '';
|
|
21
|
+
document.body.style.overflow = 'hidden';
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
document.body.style.overflow = previousBodyOverflow ?? '';
|
|
25
|
+
previousBodyOverflow = null;
|
|
26
|
+
}
|
|
27
|
+
bodyScrollLocked = shouldLock;
|
|
28
|
+
}
|
|
29
|
+
function updateEntryZIndices() {
|
|
30
|
+
entries.forEach(entry => {
|
|
31
|
+
entry.setZIndex(baseZIndex);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function detachKeydownListener() {
|
|
35
|
+
if (!isBrowserEnvironment() || !isKeydownAttached)
|
|
36
|
+
return;
|
|
37
|
+
window.removeEventListener('keydown', handleWindowKeydown);
|
|
38
|
+
isKeydownAttached = false;
|
|
39
|
+
}
|
|
40
|
+
function attachKeydownListener() {
|
|
41
|
+
if (!isBrowserEnvironment() || isKeydownAttached)
|
|
42
|
+
return;
|
|
43
|
+
window.addEventListener('keydown', handleWindowKeydown);
|
|
44
|
+
isKeydownAttached = true;
|
|
45
|
+
}
|
|
46
|
+
function syncGlobalState() {
|
|
47
|
+
updateEntryZIndices();
|
|
48
|
+
syncBodyScrollLock();
|
|
49
|
+
if (entries.length > 0)
|
|
50
|
+
attachKeydownListener();
|
|
51
|
+
else
|
|
52
|
+
detachKeydownListener();
|
|
53
|
+
}
|
|
54
|
+
function handleWindowKeydown(e) {
|
|
55
|
+
if (e.key !== 'Escape')
|
|
56
|
+
return;
|
|
57
|
+
const topEntry = getTopInteractiveEntry();
|
|
58
|
+
if (!topEntry)
|
|
59
|
+
return;
|
|
60
|
+
if (topEntry.persistent) {
|
|
61
|
+
topEntry.shake();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
topEntry.requestClose('close');
|
|
65
|
+
}
|
|
66
|
+
export function configureModalStack(options = {}) {
|
|
67
|
+
if (options.zIndex != null) {
|
|
68
|
+
baseZIndex = options.zIndex;
|
|
69
|
+
}
|
|
70
|
+
syncGlobalState();
|
|
71
|
+
}
|
|
72
|
+
export function registerModal(entry) {
|
|
73
|
+
entries = [
|
|
74
|
+
...entries.filter(item => item.id !== entry.id),
|
|
75
|
+
{
|
|
76
|
+
...entry,
|
|
77
|
+
interactive: true,
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
syncGlobalState();
|
|
81
|
+
}
|
|
82
|
+
export function unregisterModal(id) {
|
|
83
|
+
entries = entries.filter(entry => entry.id !== id);
|
|
84
|
+
syncGlobalState();
|
|
85
|
+
}
|
|
86
|
+
export function setModalInteractive(id, interactive) {
|
|
87
|
+
entries = entries.map(entry => (entry.id === id ? { ...entry, interactive } : entry));
|
|
88
|
+
syncGlobalState();
|
|
89
|
+
}
|
|
90
|
+
export function isTopInteractiveModal(id) {
|
|
91
|
+
return getTopInteractiveEntry()?.id === id;
|
|
92
|
+
}
|
|
93
|
+
export function requestCloseForModal(id) {
|
|
94
|
+
const topEntry = getTopInteractiveEntry();
|
|
95
|
+
if (!topEntry || topEntry.id !== id)
|
|
96
|
+
return false;
|
|
97
|
+
if (topEntry.persistent) {
|
|
98
|
+
topEntry.shake();
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
topEntry.requestClose('close');
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
export function resetModalStackManagerForTests() {
|
|
105
|
+
entries = [];
|
|
106
|
+
baseZIndex = DEFAULT_BASE_Z_INDEX;
|
|
107
|
+
syncBodyScrollLock();
|
|
108
|
+
detachKeydownListener();
|
|
109
|
+
}
|