@sekiui/elements 0.1.3 → 0.1.4
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/cdn/index.js +1 -1
- package/dist/{components/p-Bml9QXVd.js → cdn/p--1ROPZet.js} +22 -12
- package/dist/cdn/p-B4SOpX_A.js +155 -0
- package/dist/cdn/{p-B7jKUvZz.js → p-C3WFySZp.js} +29 -3
- package/dist/cdn/p-COBvV3Rw.js +201 -0
- package/dist/cdn/seki-alert-dialog-content.js +10 -24
- package/dist/cdn/seki-alert-dialog.js +8 -10
- package/dist/cdn/seki-carousel-dots.js +1 -1
- package/dist/cdn/seki-carousel-next.js +1 -1
- package/dist/cdn/seki-carousel-previous.js +1 -1
- package/dist/cdn/seki-collapsible-content.js +23 -40
- package/dist/cdn/seki-collapsible-trigger.js +21 -5
- package/dist/cdn/seki-collapsible.js +18 -11
- package/dist/cdn/seki-combobox-content.js +15 -22
- package/dist/cdn/seki-combobox-input.js +1 -1
- package/dist/cdn/seki-combobox-item.js +1 -1
- package/dist/cdn/seki-combobox.js +1 -1
- package/dist/cdn/seki-command-empty.js +6 -22
- package/dist/cdn/seki-command-group.js +11 -13
- package/dist/cdn/seki-command-input.js +23 -8
- package/dist/cdn/seki-command-item.js +17 -0
- package/dist/cdn/seki-command.js +58 -57
- package/dist/cdn/seki-data-table.js +13 -6
- package/dist/cdn/seki-dialog-content.js +10 -25
- package/dist/cdn/seki-dialog-description.js +13 -7
- package/dist/cdn/seki-dialog-overlay.js +6 -15
- package/dist/cdn/seki-dialog-title.js +13 -7
- package/dist/cdn/seki-dialog.js +1 -1
- package/dist/cdn/seki-drawer-content.js +21 -24
- package/dist/cdn/seki-drawer.js +8 -7
- package/dist/cdn/seki-field-label.js +28 -2
- package/dist/cdn/seki-label.js +1 -1
- package/dist/cdn/seki-navigation-menu-content.js +1 -1
- package/dist/cdn/seki-navigation-menu-item.js +1 -1
- package/dist/cdn/seki-navigation-menu-trigger.js +1 -1
- package/dist/cdn/seki-navigation-menu.js +1 -1
- package/dist/cdn/seki-popover-content.js +14 -20
- package/dist/cdn/seki-popover.js +27 -17
- package/dist/cdn/seki-resizable-handle.js +1 -1
- package/dist/cdn/seki-resizable-panel-group.js +1 -1
- package/dist/cdn/seki-resizable-panel.js +1 -1
- package/dist/cdn/seki-select-content.js +14 -17
- package/dist/cdn/seki-select-option.js +23 -25
- package/dist/cdn/seki-select-trigger.js +32 -38
- package/dist/cdn/seki-select.js +30 -7
- package/dist/cdn/seki-sheet-content.js +24 -24
- package/dist/cdn/seki-sheet.js +8 -7
- package/dist/cdn/seki-toggle-group.js +1 -1
- package/dist/cdn/seki-toggle.js +1 -1
- package/dist/cjs/context-bridge-t3FBhOrW.js +159 -0
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/label-association-sgmb4sai.js +203 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/seki-alert-dialog-content.cjs.entry.js +10 -24
- package/dist/cjs/seki-alert-dialog.cjs.entry.js +7 -9
- package/dist/cjs/seki-carousel-dots.cjs.entry.js +1 -1
- package/dist/cjs/seki-carousel-next.cjs.entry.js +1 -1
- package/dist/cjs/seki-carousel-previous.cjs.entry.js +1 -1
- package/dist/cjs/seki-collapsible-content.cjs.entry.js +20 -39
- package/dist/cjs/seki-collapsible-trigger.cjs.entry.js +19 -4
- package/dist/cjs/seki-collapsible.cjs.entry.js +16 -10
- package/dist/cjs/seki-combobox-content.cjs.entry.js +15 -22
- package/dist/cjs/seki-combobox-input.cjs.entry.js +1 -1
- package/dist/cjs/seki-combobox-item.cjs.entry.js +1 -1
- package/dist/cjs/seki-combobox.cjs.entry.js +1 -1
- package/dist/cjs/seki-command-empty.cjs.entry.js +6 -22
- package/dist/cjs/seki-command-group.cjs.entry.js +11 -13
- package/dist/cjs/seki-command-input.cjs.entry.js +22 -8
- package/dist/cjs/seki-command-item.cjs.entry.js +17 -0
- package/dist/cjs/seki-command.cjs.entry.js +56 -56
- package/dist/cjs/seki-data-table.cjs.entry.js +10 -6
- package/dist/cjs/seki-dialog-content.cjs.entry.js +10 -25
- package/dist/cjs/seki-dialog-description.cjs.entry.js +10 -6
- package/dist/cjs/seki-dialog-overlay.cjs.entry.js +6 -15
- package/dist/cjs/seki-dialog-title.cjs.entry.js +10 -6
- package/dist/cjs/seki-dialog.cjs.entry.js +21 -12
- package/dist/cjs/seki-drawer-content.cjs.entry.js +20 -24
- package/dist/cjs/seki-drawer.cjs.entry.js +8 -7
- package/dist/cjs/seki-field-label.cjs.entry.js +26 -2
- package/dist/cjs/seki-label.cjs.entry.js +27 -3
- package/dist/cjs/seki-navigation-menu-content.cjs.entry.js +1 -1
- package/dist/cjs/seki-navigation-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/seki-navigation-menu-trigger.cjs.entry.js +1 -1
- package/dist/cjs/seki-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/seki-popover-content.cjs.entry.js +14 -20
- package/dist/cjs/seki-popover.cjs.entry.js +24 -16
- package/dist/cjs/seki-resizable-handle.cjs.entry.js +1 -1
- package/dist/cjs/seki-resizable-panel-group.cjs.entry.js +1 -1
- package/dist/cjs/seki-resizable-panel.cjs.entry.js +1 -1
- package/dist/cjs/seki-select-content.cjs.entry.js +14 -17
- package/dist/cjs/seki-select-option.cjs.entry.js +23 -25
- package/dist/cjs/seki-select-trigger.cjs.entry.js +32 -38
- package/dist/cjs/seki-select.cjs.entry.js +29 -7
- package/dist/cjs/seki-sheet-content.cjs.entry.js +22 -24
- package/dist/cjs/seki-sheet.cjs.entry.js +8 -7
- package/dist/cjs/seki-toggle-group.cjs.entry.js +1 -1
- package/dist/cjs/seki-toggle.cjs.entry.js +1 -1
- package/dist/cjs/sekiui.cjs.js +1 -1
- package/dist/collection/components/alert-dialog/seki-alert-dialog-content.js +10 -24
- package/dist/collection/components/alert-dialog/seki-alert-dialog.js +21 -9
- package/dist/collection/components/collapsible/seki-collapsible-content.js +23 -40
- package/dist/collection/components/collapsible/seki-collapsible-trigger.js +24 -4
- package/dist/collection/components/collapsible/seki-collapsible.js +31 -9
- package/dist/collection/components/combobox-content/seki-combobox-content.js +15 -22
- package/dist/collection/components/command/seki-command-empty.js +6 -22
- package/dist/collection/components/command/seki-command-group.js +11 -13
- package/dist/collection/components/command/seki-command-input.js +27 -8
- package/dist/collection/components/command/seki-command-item.js +17 -0
- package/dist/collection/components/command/seki-command.js +71 -55
- package/dist/collection/components/data-table/seki-data-table.js +64 -6
- package/dist/collection/components/dialog/seki-dialog-content.js +10 -25
- package/dist/collection/components/dialog/seki-dialog-description.js +17 -6
- package/dist/collection/components/dialog/seki-dialog-overlay.js +6 -15
- package/dist/collection/components/dialog/seki-dialog-title.js +17 -6
- package/dist/collection/components/dialog/seki-dialog.js +37 -12
- package/dist/collection/components/drawer/seki-drawer-content.js +22 -24
- package/dist/collection/components/drawer/seki-drawer.js +22 -7
- package/dist/collection/components/field-label/seki-field-label.js +39 -3
- package/dist/collection/components/label/seki-label.js +40 -4
- package/dist/collection/components/popover/seki-popover-content.js +14 -20
- package/dist/collection/components/popover/seki-popover.js +41 -15
- package/dist/collection/components/select/seki-select.js +30 -6
- package/dist/collection/components/select-content/seki-select-content.js +14 -17
- package/dist/collection/components/select-option/seki-select-option.js +23 -25
- package/dist/collection/components/select-trigger/seki-select-trigger.js +32 -38
- package/dist/collection/components/sheet/seki-sheet-content.js +25 -24
- package/dist/collection/components/sheet/seki-sheet.js +22 -7
- package/dist/collection/utils/context-bridge.js +105 -4
- package/dist/collection/utils/label-association.js +199 -0
- package/dist/components/index.js +1 -1
- package/dist/{cdn/p-Bml9QXVd.js → components/p--1ROPZet.js} +22 -12
- package/dist/components/p-B4SOpX_A.js +155 -0
- package/dist/components/{p-B7jKUvZz.js → p-C3WFySZp.js} +29 -3
- package/dist/components/p-COBvV3Rw.js +201 -0
- package/dist/components/seki-alert-dialog-content.js +10 -24
- package/dist/components/seki-alert-dialog.js +8 -10
- package/dist/components/seki-carousel-dots.js +1 -1
- package/dist/components/seki-carousel-next.js +1 -1
- package/dist/components/seki-carousel-previous.js +1 -1
- package/dist/components/seki-collapsible-content.js +23 -40
- package/dist/components/seki-collapsible-trigger.js +21 -5
- package/dist/components/seki-collapsible.js +18 -11
- package/dist/components/seki-combobox-content.js +15 -22
- package/dist/components/seki-combobox-input.js +1 -1
- package/dist/components/seki-combobox-item.js +1 -1
- package/dist/components/seki-combobox.js +1 -1
- package/dist/components/seki-command-empty.js +6 -22
- package/dist/components/seki-command-group.js +11 -13
- package/dist/components/seki-command-input.js +23 -8
- package/dist/components/seki-command-item.js +17 -0
- package/dist/components/seki-command.js +58 -57
- package/dist/components/seki-data-table.js +13 -6
- package/dist/components/seki-dialog-content.js +10 -25
- package/dist/components/seki-dialog-description.js +13 -7
- package/dist/components/seki-dialog-overlay.js +6 -15
- package/dist/components/seki-dialog-title.js +13 -7
- package/dist/components/seki-dialog.js +1 -1
- package/dist/components/seki-drawer-content.js +21 -24
- package/dist/components/seki-drawer.js +8 -7
- package/dist/components/seki-field-label.js +28 -2
- package/dist/components/seki-label.js +1 -1
- package/dist/components/seki-navigation-menu-content.js +1 -1
- package/dist/components/seki-navigation-menu-item.js +1 -1
- package/dist/components/seki-navigation-menu-trigger.js +1 -1
- package/dist/components/seki-navigation-menu.js +1 -1
- package/dist/components/seki-popover-content.js +14 -20
- package/dist/components/seki-popover.js +27 -17
- package/dist/components/seki-resizable-handle.js +1 -1
- package/dist/components/seki-resizable-panel-group.js +1 -1
- package/dist/components/seki-resizable-panel.js +1 -1
- package/dist/components/seki-select-content.js +14 -17
- package/dist/components/seki-select-option.js +23 -25
- package/dist/components/seki-select-trigger.js +32 -38
- package/dist/components/seki-select.js +30 -7
- package/dist/components/seki-sheet-content.js +24 -24
- package/dist/components/seki-sheet.js +8 -7
- package/dist/components/seki-toggle-group.js +1 -1
- package/dist/components/seki-toggle.js +1 -1
- package/dist/esm/context-bridge-B4SOpX_A.js +155 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/label-association-COBvV3Rw.js +201 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/seki-alert-dialog-content.entry.js +10 -24
- package/dist/esm/seki-alert-dialog.entry.js +7 -9
- package/dist/esm/seki-carousel-dots.entry.js +1 -1
- package/dist/esm/seki-carousel-next.entry.js +1 -1
- package/dist/esm/seki-carousel-previous.entry.js +1 -1
- package/dist/esm/seki-collapsible-content.entry.js +20 -39
- package/dist/esm/seki-collapsible-trigger.entry.js +19 -4
- package/dist/esm/seki-collapsible.entry.js +16 -10
- package/dist/esm/seki-combobox-content.entry.js +15 -22
- package/dist/esm/seki-combobox-input.entry.js +1 -1
- package/dist/esm/seki-combobox-item.entry.js +1 -1
- package/dist/esm/seki-combobox.entry.js +1 -1
- package/dist/esm/seki-command-empty.entry.js +6 -22
- package/dist/esm/seki-command-group.entry.js +11 -13
- package/dist/esm/seki-command-input.entry.js +22 -8
- package/dist/esm/seki-command-item.entry.js +17 -0
- package/dist/esm/seki-command.entry.js +56 -56
- package/dist/esm/seki-data-table.entry.js +10 -6
- package/dist/esm/seki-dialog-content.entry.js +10 -25
- package/dist/esm/seki-dialog-description.entry.js +10 -6
- package/dist/esm/seki-dialog-overlay.entry.js +6 -15
- package/dist/esm/seki-dialog-title.entry.js +10 -6
- package/dist/esm/seki-dialog.entry.js +21 -12
- package/dist/esm/seki-drawer-content.entry.js +20 -24
- package/dist/esm/seki-drawer.entry.js +8 -7
- package/dist/esm/seki-field-label.entry.js +26 -2
- package/dist/esm/seki-label.entry.js +27 -3
- package/dist/esm/seki-navigation-menu-content.entry.js +1 -1
- package/dist/esm/seki-navigation-menu-item.entry.js +1 -1
- package/dist/esm/seki-navigation-menu-trigger.entry.js +1 -1
- package/dist/esm/seki-navigation-menu.entry.js +1 -1
- package/dist/esm/seki-popover-content.entry.js +14 -20
- package/dist/esm/seki-popover.entry.js +24 -16
- package/dist/esm/seki-resizable-handle.entry.js +1 -1
- package/dist/esm/seki-resizable-panel-group.entry.js +1 -1
- package/dist/esm/seki-resizable-panel.entry.js +1 -1
- package/dist/esm/seki-select-content.entry.js +14 -17
- package/dist/esm/seki-select-option.entry.js +23 -25
- package/dist/esm/seki-select-trigger.entry.js +32 -38
- package/dist/esm/seki-select.entry.js +29 -7
- package/dist/esm/seki-sheet-content.entry.js +22 -24
- package/dist/esm/seki-sheet.entry.js +8 -7
- package/dist/esm/seki-toggle-group.entry.js +1 -1
- package/dist/esm/seki-toggle.entry.js +1 -1
- package/dist/esm/sekiui.js +1 -1
- package/dist/sekiui/index.esm.js +1 -1
- package/dist/sekiui/{p-2459de33.entry.js → p-09131578.entry.js} +1 -1
- package/dist/sekiui/p-14ca64d7.entry.js +1 -0
- package/dist/sekiui/p-1564ab34.entry.js +1 -0
- package/dist/sekiui/p-1b7681eb.entry.js +1 -0
- package/dist/sekiui/{p-573fcf7e.entry.js → p-20e5e17a.entry.js} +1 -1
- package/dist/sekiui/p-2bd3c250.entry.js +1 -0
- package/dist/sekiui/p-2d50d0c2.entry.js +1 -0
- package/dist/sekiui/p-31db5c3f.entry.js +1 -0
- package/dist/sekiui/p-33dd3d17.entry.js +1 -0
- package/dist/sekiui/p-360d7dea.entry.js +1 -0
- package/dist/sekiui/p-3c6d6845.entry.js +1 -0
- package/dist/sekiui/{p-731740ec.entry.js → p-3cd3f36e.entry.js} +1 -1
- package/dist/sekiui/{p-1d173026.entry.js → p-3e456430.entry.js} +1 -1
- package/dist/sekiui/{p-e287c9b0.entry.js → p-4191a2cf.entry.js} +1 -1
- package/dist/sekiui/{p-b75f801b.entry.js → p-48fe9b46.entry.js} +1 -1
- package/dist/sekiui/{p-5a60c7f5.entry.js → p-5132d055.entry.js} +1 -1
- package/dist/sekiui/p-5700ac69.entry.js +1 -0
- package/dist/sekiui/{p-d2592287.entry.js → p-57e7170b.entry.js} +1 -1
- package/dist/sekiui/{p-edac50c7.entry.js → p-5dbd46b4.entry.js} +1 -1
- package/dist/sekiui/p-6923d926.entry.js +1 -0
- package/dist/sekiui/{p-22daeb37.entry.js → p-6c2e4ae8.entry.js} +1 -1
- package/dist/sekiui/p-6edbced1.entry.js +1 -0
- package/dist/sekiui/p-7dac94b2.entry.js +1 -0
- package/dist/sekiui/p-80dbf1f5.entry.js +1 -0
- package/dist/sekiui/p-817af69a.entry.js +1 -0
- package/dist/sekiui/{p-ddcdc3da.entry.js → p-8b3bc7c2.entry.js} +1 -1
- package/dist/sekiui/p-8fb55d56.entry.js +1 -0
- package/dist/sekiui/{p-a575f386.entry.js → p-92b800a2.entry.js} +1 -1
- package/dist/sekiui/{p-63e922dc.entry.js → p-938ce866.entry.js} +1 -1
- package/dist/sekiui/{p-d0533172.entry.js → p-95501e60.entry.js} +1 -1
- package/dist/sekiui/p-979708a0.entry.js +1 -0
- package/dist/sekiui/{p-faf09566.entry.js → p-9c921a6c.entry.js} +1 -1
- package/dist/sekiui/p-B4SOpX_A.js +1 -0
- package/dist/sekiui/p-COBvV3Rw.js +1 -0
- package/dist/sekiui/{p-fc6b3691.entry.js → p-a4fc4f1a.entry.js} +1 -1
- package/dist/sekiui/{p-d7bd5d5e.entry.js → p-b94e0f1b.entry.js} +1 -1
- package/dist/sekiui/{p-1c5fe316.entry.js → p-c6efedab.entry.js} +1 -1
- package/dist/sekiui/p-c8da7923.entry.js +1 -0
- package/dist/sekiui/p-c97fbaf2.entry.js +1 -0
- package/dist/sekiui/p-cb28d764.entry.js +1 -0
- package/dist/sekiui/{p-5f52b52d.entry.js → p-cc2ac0f0.entry.js} +1 -1
- package/dist/sekiui/{p-acebf429.entry.js → p-d32614a4.entry.js} +1 -1
- package/dist/sekiui/p-d3449109.entry.js +1 -0
- package/dist/sekiui/p-ddbf98ca.entry.js +1 -0
- package/dist/sekiui/p-eb03eb37.entry.js +1 -0
- package/dist/sekiui/{p-c57bbe35.entry.js → p-fc9e8583.entry.js} +1 -1
- package/dist/sekiui/sekiui.esm.js +1 -1
- package/dist/types/components/alert-dialog/seki-alert-dialog-content.d.ts +6 -3
- package/dist/types/components/alert-dialog/seki-alert-dialog.d.ts +5 -2
- package/dist/types/components/collapsible/seki-collapsible-content.d.ts +4 -5
- package/dist/types/components/collapsible/seki-collapsible-trigger.d.ts +11 -0
- package/dist/types/components/collapsible/seki-collapsible.d.ts +6 -2
- package/dist/types/components/combobox-content/seki-combobox-content.d.ts +3 -4
- package/dist/types/components/command/seki-command-empty.d.ts +2 -4
- package/dist/types/components/command/seki-command-group.d.ts +2 -3
- package/dist/types/components/command/seki-command-input.d.ts +5 -1
- package/dist/types/components/command/seki-command-item.d.ts +3 -0
- package/dist/types/components/command/seki-command.d.ts +19 -1
- package/dist/types/components/command/types.d.ts +9 -1
- package/dist/types/components/data-table/seki-data-table.d.ts +7 -2
- package/dist/types/components/dialog/seki-dialog-content.d.ts +6 -3
- package/dist/types/components/dialog/seki-dialog-description.d.ts +5 -1
- package/dist/types/components/dialog/seki-dialog-overlay.d.ts +2 -3
- package/dist/types/components/dialog/seki-dialog-title.d.ts +5 -1
- package/dist/types/components/dialog/seki-dialog.d.ts +9 -2
- package/dist/types/components/drawer/seki-drawer-content.d.ts +8 -3
- package/dist/types/components/drawer/seki-drawer.d.ts +5 -1
- package/dist/types/components/field-label/seki-field-label.d.ts +9 -1
- package/dist/types/components/label/seki-label.d.ts +11 -2
- package/dist/types/components/popover/seki-popover-content.d.ts +6 -3
- package/dist/types/components/popover/seki-popover.d.ts +7 -1
- package/dist/types/components/select/seki-select.d.ts +8 -0
- package/dist/types/components/select-content/seki-select-content.d.ts +3 -2
- package/dist/types/components/select-option/seki-select-option.d.ts +9 -3
- package/dist/types/components/select-trigger/seki-select-trigger.d.ts +10 -4
- package/dist/types/components/sheet/seki-sheet-content.d.ts +8 -4
- package/dist/types/components/sheet/seki-sheet.d.ts +5 -1
- package/dist/types/components.d.ts +61 -6
- package/dist/types/utils/context-bridge.d.ts +68 -4
- package/dist/types/utils/label-association.d.ts +58 -0
- package/package.json +1 -1
- package/dist/cdn/p-DJMgrCw3.js +0 -54
- package/dist/cjs/context-bridge-CywF7uJm.js +0 -57
- package/dist/components/p-DJMgrCw3.js +0 -54
- package/dist/esm/context-bridge-DJMgrCw3.js +0 -54
- package/dist/sekiui/p-063951fe.entry.js +0 -1
- package/dist/sekiui/p-326909c5.entry.js +0 -1
- package/dist/sekiui/p-3511d6e5.entry.js +0 -1
- package/dist/sekiui/p-4253845a.entry.js +0 -1
- package/dist/sekiui/p-565acaf2.entry.js +0 -1
- package/dist/sekiui/p-5a55a239.entry.js +0 -1
- package/dist/sekiui/p-5fd3b090.entry.js +0 -1
- package/dist/sekiui/p-6466865a.entry.js +0 -1
- package/dist/sekiui/p-9324d212.entry.js +0 -1
- package/dist/sekiui/p-959fef36.entry.js +0 -1
- package/dist/sekiui/p-DJMgrCw3.js +0 -1
- package/dist/sekiui/p-a55bc3d3.entry.js +0 -1
- package/dist/sekiui/p-ab56de7a.entry.js +0 -1
- package/dist/sekiui/p-ad62e316.entry.js +0 -1
- package/dist/sekiui/p-b8d3aa31.entry.js +0 -1
- package/dist/sekiui/p-b99c6433.entry.js +0 -1
- package/dist/sekiui/p-c15c21b4.entry.js +0 -1
- package/dist/sekiui/p-c529a6b8.entry.js +0 -1
- package/dist/sekiui/p-c99961a7.entry.js +0 -1
- package/dist/sekiui/p-d61319d6.entry.js +0 -1
- package/dist/sekiui/p-da9b3eaa.entry.js +0 -1
- package/dist/sekiui/p-eb50f8d5.entry.js +0 -1
- package/dist/sekiui/p-f886fe62.entry.js +0 -1
- package/dist/sekiui/p-fc288df2.entry.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { ContextConsumer } from "../../utils/context-bridge";
|
|
2
3
|
/**
|
|
3
4
|
* seki-sheet-content: Container for sheet content
|
|
4
5
|
*
|
|
@@ -16,39 +17,33 @@ export class SekiSheetContent {
|
|
|
16
17
|
* seki-sheet parent (e.g. mounted standalone).
|
|
17
18
|
*/
|
|
18
19
|
this._isOpen = true;
|
|
20
|
+
this.sheetConsumer = new ContextConsumer('seki-sheet', '_sheetContext', () => this.syncOpenState());
|
|
19
21
|
this.handleCloseClick = () => {
|
|
20
22
|
this.closeSheet.emit();
|
|
21
23
|
};
|
|
22
|
-
this.onSheetOpenChange = () => {
|
|
23
|
-
this.syncOpenState();
|
|
24
|
-
};
|
|
25
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Re-read the parent's open state. Runs once on connect (picking up a sheet
|
|
27
|
+
* that is already open, e.g. `<seki-sheet open>`) and on every publish.
|
|
28
|
+
*/
|
|
26
29
|
syncOpenState() {
|
|
27
|
-
var _a;
|
|
28
|
-
|
|
30
|
+
var _a, _b;
|
|
31
|
+
// No seki-sheet parent: stay open (standalone use).
|
|
32
|
+
if (!this.sheetConsumer.parent)
|
|
29
33
|
return;
|
|
30
|
-
|
|
31
|
-
const context = this.sheetEl._sheetContext;
|
|
32
|
-
this._isOpen = (_a = context === null || context === void 0 ? void 0 : context.isOpen) !== null && _a !== void 0 ? _a : false;
|
|
34
|
+
this._isOpen = (_b = (_a = this.sheetConsumer.context) === null || _a === void 0 ? void 0 : _a.isOpen) !== null && _b !== void 0 ? _b : false;
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
// Propagate side attribute to parent for CSS targeting
|
|
38
|
-
if (this.sheetEl) {
|
|
39
|
-
this.sheetEl.setAttribute('data-side', this.side || 'right');
|
|
40
|
-
this.syncOpenState();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
componentDidLoad() {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
(_a = this.sheetEl) === null || _a === void 0 ? void 0 : _a.addEventListener('sheetOpen', this.onSheetOpenChange);
|
|
46
|
-
(_b = this.sheetEl) === null || _b === void 0 ? void 0 : _b.addEventListener('sheetClose', this.onSheetOpenChange);
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
this.sheetConsumer.connect(this.el);
|
|
38
|
+
this.propagateSide();
|
|
47
39
|
}
|
|
48
40
|
disconnectedCallback() {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
this.sheetConsumer.disconnect();
|
|
42
|
+
}
|
|
43
|
+
/** Propagate the side attribute to the parent for CSS targeting. */
|
|
44
|
+
propagateSide() {
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = this.sheetConsumer.parent) === null || _a === void 0 ? void 0 : _a.setAttribute('data-side', this.side || 'right');
|
|
52
47
|
}
|
|
53
48
|
render() {
|
|
54
49
|
if (!this._isOpen) {
|
|
@@ -128,4 +123,10 @@ export class SekiSheetContent {
|
|
|
128
123
|
}];
|
|
129
124
|
}
|
|
130
125
|
static get elementRef() { return "el"; }
|
|
126
|
+
static get watchers() {
|
|
127
|
+
return [{
|
|
128
|
+
"propName": "side",
|
|
129
|
+
"methodName": "propagateSide"
|
|
130
|
+
}];
|
|
131
|
+
}
|
|
131
132
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { publishContext } from "../../utils/context-bridge";
|
|
2
3
|
/**
|
|
3
4
|
* seki-sheet: Root sheet component (slide-out panel)
|
|
4
5
|
*
|
|
@@ -36,8 +37,8 @@ export class SekiSheet {
|
|
|
36
37
|
componentWillLoad() {
|
|
37
38
|
this._isOpen = this.open || this.defaultOpen;
|
|
38
39
|
this.open = this._isOpen;
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
// Publish before the first render so `<seki-sheet open>` shows its content
|
|
41
|
+
// at first paint (#323).
|
|
41
42
|
this.updateContext();
|
|
42
43
|
}
|
|
43
44
|
handleOpenPropChange(newValue) {
|
|
@@ -89,9 +90,8 @@ export class SekiSheet {
|
|
|
89
90
|
}
|
|
90
91
|
updateContext() {
|
|
91
92
|
// seki-sheet-content has no other way to know this sheet's open state — it
|
|
92
|
-
// reads this off the host element
|
|
93
|
-
|
|
94
|
-
this.el._sheetContext = { isOpen: this._isOpen };
|
|
93
|
+
// reads this off the host element (see consumeContext in context-bridge).
|
|
94
|
+
publishContext(this.el, '_sheetContext', { isOpen: this._isOpen }, this.sheetContextChange);
|
|
95
95
|
}
|
|
96
96
|
handleTriggerClick() {
|
|
97
97
|
this.toggleSheet();
|
|
@@ -105,10 +105,10 @@ export class SekiSheet {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
render() {
|
|
108
|
-
return (h("div", { key: '
|
|
108
|
+
return (h("div", { key: 'dda645ffb1445b876a53d3713777ed25e7f85998', class: {
|
|
109
109
|
'seki-sheet': true,
|
|
110
110
|
'seki-sheet--open': this._isOpen,
|
|
111
|
-
}, part: "sheet" }, h("slot", { key: '
|
|
111
|
+
}, part: "sheet" }, h("slot", { key: '8c7fca42b42eb4c81ce3a4ab7f01d9ddf284a469' }), this._isOpen && (h("div", { key: '2fc1c0d783f8f39656ace7f065d326d4a70c2da6', class: "seki-sheet-overlay", part: "overlay", onClick: () => this.closeSheet() }))));
|
|
112
112
|
}
|
|
113
113
|
static get is() { return "seki-sheet"; }
|
|
114
114
|
static get encapsulation() { return "shadow"; }
|
|
@@ -217,6 +217,21 @@ export class SekiSheet {
|
|
|
217
217
|
"resolved": "boolean",
|
|
218
218
|
"references": {}
|
|
219
219
|
}
|
|
220
|
+
}, {
|
|
221
|
+
"method": "sheetContextChange",
|
|
222
|
+
"name": "sekiContextChange",
|
|
223
|
+
"bubbles": true,
|
|
224
|
+
"cancelable": true,
|
|
225
|
+
"composed": true,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": "Internal: notifies seki-sheet-content that `_sheetContext` changed. Not\npart of the public API; listen to `sekiOpenChange` instead."
|
|
229
|
+
},
|
|
230
|
+
"complexType": {
|
|
231
|
+
"original": "void",
|
|
232
|
+
"resolved": "void",
|
|
233
|
+
"references": {}
|
|
234
|
+
}
|
|
220
235
|
}];
|
|
221
236
|
}
|
|
222
237
|
static get methods() {
|
|
@@ -3,10 +3,25 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generalizes the "parent publishes state onto its host element + child
|
|
5
5
|
* subscribes via closest()" pattern used by compound components (select,
|
|
6
|
-
* toggle-group, combobox, ...).
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* toggle-group, combobox, dialog, popover, ...).
|
|
7
|
+
*
|
|
8
|
+
* Parent (provider) contract:
|
|
9
|
+
* - call publishContext() from componentWillLoad(), so the context exists
|
|
10
|
+
* before any child renders for the first time, and
|
|
11
|
+
* - call it again on every state change, including changes that arrive as a
|
|
12
|
+
* @Prop assignment (@Watch) rather than through a @Method or user input.
|
|
13
|
+
*
|
|
14
|
+
* Child (consumer) contract — use a ContextConsumer:
|
|
15
|
+
* - call connect(this.el) from connectedCallback() (runs before the first
|
|
16
|
+
* render, and again after the element is moved to a new parent), and
|
|
17
|
+
* - call disconnect() from disconnectedCallback().
|
|
18
|
+
* connect() invokes the callback once immediately, so a child that
|
|
19
|
+
* upgrades after its parent already published still starts from the current
|
|
20
|
+
* state; a child that upgrades before its parent (one-module-per-tag
|
|
21
|
+
* loading, #314) hears the parent's first publish from componentWillLoad().
|
|
22
|
+
*
|
|
23
|
+
* subscribeToContextChange() is the older listener-only form (no immediate
|
|
24
|
+
* read, light-DOM closest() only); prefer ContextConsumer for new code.
|
|
10
25
|
*
|
|
11
26
|
* Extracted after the same bug (child freezes at mount-time state because
|
|
12
27
|
* nothing told it the parent changed) was independently fixed three times
|
|
@@ -50,3 +65,89 @@ export function subscribeToContextChange(el, parentSelector, onChange) {
|
|
|
50
65
|
unsubscribe: () => parent === null || parent === void 0 ? void 0 : parent.removeEventListener(SEKI_CONTEXT_CHANGE_EVENT, onChange),
|
|
51
66
|
};
|
|
52
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Nearest ancestor matching `selector`, continuing past shadow roots: when the
|
|
70
|
+
* element's own tree has no match, the search resumes from the shadow host.
|
|
71
|
+
* This lets a part rendered inside another component's shadow tree still find
|
|
72
|
+
* the provider that wraps that component.
|
|
73
|
+
*/
|
|
74
|
+
export function findContextProvider(el, selector) {
|
|
75
|
+
var _a;
|
|
76
|
+
let node = el;
|
|
77
|
+
while (node) {
|
|
78
|
+
const match = node.closest(selector);
|
|
79
|
+
if (match)
|
|
80
|
+
return match;
|
|
81
|
+
const root = node.getRootNode();
|
|
82
|
+
// A shadow root is a document fragment with a host (no global ShadowRoot
|
|
83
|
+
// reference, so this also runs under mock-doc / hydrate).
|
|
84
|
+
node = root.nodeType === 11 ? ((_a = root.host) !== null && _a !== void 0 ? _a : null) : null;
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Child-side: tracks one provider (see findContextProvider) for a part.
|
|
90
|
+
*
|
|
91
|
+
* private dialog = new ContextConsumer<DialogContext>('seki-dialog', '_dialogContext', () => this.sync());
|
|
92
|
+
* connectedCallback() { this.dialog.connect(this.el); }
|
|
93
|
+
* disconnectedCallback() { this.dialog.disconnect(); }
|
|
94
|
+
*
|
|
95
|
+
* connect() finds the provider, starts listening for its context-change
|
|
96
|
+
* notifications and calls `onChange` once right away, so the part starts from
|
|
97
|
+
* whatever is already published. `parent` and `context` are already set when
|
|
98
|
+
* that first call happens. Calling connect() from connectedCallback runs it
|
|
99
|
+
* before the first render and again after the part is moved to another
|
|
100
|
+
* provider.
|
|
101
|
+
*
|
|
102
|
+
* `onChange` gets no event payload by design (see SEKI_CONTEXT_CHANGE_EVENT):
|
|
103
|
+
* it reads the live `context`. Notifications bubbling up from a nested
|
|
104
|
+
* provider are ignored; only events dispatched by this part's own provider
|
|
105
|
+
* host (or retargeted to it from that host's shadow tree) count.
|
|
106
|
+
*
|
|
107
|
+
* Works whether or not the provider element has been upgraded yet: the
|
|
108
|
+
* listener sits on the element itself, so the provider's first
|
|
109
|
+
* publishContext() from componentWillLoad() reaches it.
|
|
110
|
+
*/
|
|
111
|
+
export class ContextConsumer {
|
|
112
|
+
constructor(parentSelector, propertyName, onChange) {
|
|
113
|
+
this.parentSelector = parentSelector;
|
|
114
|
+
this.propertyName = propertyName;
|
|
115
|
+
this.onChange = onChange;
|
|
116
|
+
this.provider = null;
|
|
117
|
+
this.handleEvent = (event) => {
|
|
118
|
+
if (event.target === this.provider) {
|
|
119
|
+
this.onChange(this.context);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** The provider element found by the last connect(), or null. */
|
|
124
|
+
get parent() {
|
|
125
|
+
return this.provider;
|
|
126
|
+
}
|
|
127
|
+
/** The provider's current context, or null when there is none yet. */
|
|
128
|
+
get context() {
|
|
129
|
+
return readContext(this.provider, this.propertyName);
|
|
130
|
+
}
|
|
131
|
+
connect(host) {
|
|
132
|
+
var _a;
|
|
133
|
+
this.disconnect();
|
|
134
|
+
this.provider = findContextProvider(host, this.parentSelector);
|
|
135
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.addEventListener(SEKI_CONTEXT_CHANGE_EVENT, this.handleEvent);
|
|
136
|
+
this.onChange(this.context);
|
|
137
|
+
}
|
|
138
|
+
disconnect() {
|
|
139
|
+
var _a;
|
|
140
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.removeEventListener(SEKI_CONTEXT_CHANGE_EVENT, this.handleEvent);
|
|
141
|
+
this.provider = null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Read a context object a provider published with publishContext(). Returns
|
|
146
|
+
* null when there is no provider or it has not published yet.
|
|
147
|
+
*/
|
|
148
|
+
export function readContext(parent, propertyName) {
|
|
149
|
+
var _a;
|
|
150
|
+
if (!parent)
|
|
151
|
+
return null;
|
|
152
|
+
return ((_a = parent[propertyName]) !== null && _a !== void 0 ? _a : null);
|
|
153
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label association for `seki-label` and `seki-field-label`.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists
|
|
5
|
+
*
|
|
6
|
+
* Both labels render their text inside a shadow root. A native `<label for>`
|
|
7
|
+
* resolves its `for` id inside the tree the `<label>` lives in, so a `<label>`
|
|
8
|
+
* in our shadow root can never reach a control in the page's light DOM: clicks
|
|
9
|
+
* did nothing and the control had no accessible name (#329).
|
|
10
|
+
*
|
|
11
|
+
* The host element (`<seki-label>`) *does* live in the consumer's tree, so the
|
|
12
|
+
* wiring is done from the host in script, resolving the id against
|
|
13
|
+
* `host.getRootNode()` (the label's own root, which is where an author expects
|
|
14
|
+
* `for` to point, also when the label sits inside another component's shadow
|
|
15
|
+
* root together with its control).
|
|
16
|
+
*
|
|
17
|
+
* ## Behaviour
|
|
18
|
+
*
|
|
19
|
+
* - **Activation**: a click on the label forwards to the target the way a native
|
|
20
|
+
* label would. Toggles (checkbox, switch, radio) are clicked, text-like
|
|
21
|
+
* controls are focused. A click that originated on the control itself (the
|
|
22
|
+
* wrapping form `<seki-label><seki-checkbox/> Text</seki-label>`) is ignored so
|
|
23
|
+
* the control never toggles twice.
|
|
24
|
+
* - **Accessible name**: a shadow-DOM control hides its real focusable element
|
|
25
|
+
* (`<button role="checkbox">`, `<input>`, ...) inside its own shadow root, and
|
|
26
|
+
* an `aria-labelledby` id reference cannot cross a shadow boundary, so
|
|
27
|
+
* pointing the host at the label would not name the inner element. SekiUI
|
|
28
|
+
* controls all forward their `aria-label` attribute to that inner element, so
|
|
29
|
+
* for them the label text is passed through as `aria-label`. For native
|
|
30
|
+
* elements the reference does resolve, so we use `aria-labelledby` and the
|
|
31
|
+
* name tracks the label's live content.
|
|
32
|
+
* Anything the author set explicitly (`aria-label`, `aria-labelledby`) is
|
|
33
|
+
* never overwritten; we only manage values we wrote ourselves, tracked with a
|
|
34
|
+
* marker attribute so they can be updated and cleaned up.
|
|
35
|
+
* `ElementInternals.ariaLabelledByElements` is deliberately not used: it is
|
|
36
|
+
* unavailable in Firefox and older Safari, and cannot reach the inner element
|
|
37
|
+
* of a shadow-DOM control either.
|
|
38
|
+
*/
|
|
39
|
+
/* global Document */
|
|
40
|
+
const MANAGED_ATTR = 'data-seki-label-managed';
|
|
41
|
+
/** SekiUI form controls that render their focusable element in a shadow root. */
|
|
42
|
+
const SEKI_CONTROLS = [
|
|
43
|
+
'seki-input',
|
|
44
|
+
'seki-textarea',
|
|
45
|
+
'seki-checkbox',
|
|
46
|
+
'seki-switch',
|
|
47
|
+
'seki-select',
|
|
48
|
+
'seki-slider',
|
|
49
|
+
'seki-radio-group',
|
|
50
|
+
'seki-input-otp',
|
|
51
|
+
'seki-date-picker',
|
|
52
|
+
'seki-combobox',
|
|
53
|
+
].join(',');
|
|
54
|
+
const NATIVE_CONTROLS = 'input:not([type="hidden"]), select, textarea, button';
|
|
55
|
+
let uid = 0;
|
|
56
|
+
function focusInside(target) {
|
|
57
|
+
var _a, _b, _c;
|
|
58
|
+
const inner = (_a = target.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]');
|
|
59
|
+
(_c = (_b = (inner !== null && inner !== void 0 ? inner : target)).focus) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
60
|
+
}
|
|
61
|
+
export class LabelBinding {
|
|
62
|
+
constructor(host, getFor) {
|
|
63
|
+
this.host = host;
|
|
64
|
+
this.getFor = getFor;
|
|
65
|
+
this.target = null;
|
|
66
|
+
}
|
|
67
|
+
/** Resolve the control this label is for, in the label's own root. */
|
|
68
|
+
resolveTarget() {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
const id = this.getFor();
|
|
71
|
+
if (id) {
|
|
72
|
+
const root = this.host.getRootNode();
|
|
73
|
+
return (_b = (_a = root.getElementById) === null || _a === void 0 ? void 0 : _a.call(root, id)) !== null && _b !== void 0 ? _b : null;
|
|
74
|
+
}
|
|
75
|
+
const controls = `${SEKI_CONTROLS}, ${NATIVE_CONTROLS}`;
|
|
76
|
+
// Implicit association: <seki-label><seki-checkbox></seki-checkbox> Text</seki-label>
|
|
77
|
+
const nested = this.host.querySelector(controls);
|
|
78
|
+
if (nested)
|
|
79
|
+
return nested;
|
|
80
|
+
// Inside <seki-field>, a label without `for` names the field's control.
|
|
81
|
+
if (this.host.getAttribute('slot') === 'label') {
|
|
82
|
+
const field = this.host.closest('seki-field');
|
|
83
|
+
return (_c = field === null || field === void 0 ? void 0 : field.querySelector(`:scope > :not([slot]):is(${controls})`)) !== null && _c !== void 0 ? _c : null;
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
/** Label text, without the text of a control nested inside the label. */
|
|
88
|
+
labelText(skip) {
|
|
89
|
+
const parts = [];
|
|
90
|
+
const walk = (node) => {
|
|
91
|
+
var _a;
|
|
92
|
+
if (node === skip)
|
|
93
|
+
return;
|
|
94
|
+
if (node.nodeType === Node.TEXT_NODE)
|
|
95
|
+
parts.push((_a = node.textContent) !== null && _a !== void 0 ? _a : '');
|
|
96
|
+
else
|
|
97
|
+
node.childNodes.forEach(walk);
|
|
98
|
+
};
|
|
99
|
+
this.host.childNodes.forEach(walk);
|
|
100
|
+
return parts.join(' ').replace(/\s+/g, ' ').trim();
|
|
101
|
+
}
|
|
102
|
+
/** (Re)apply the accessible name. Call on load, `for` change and slot change. */
|
|
103
|
+
sync() {
|
|
104
|
+
const next = this.resolveTarget();
|
|
105
|
+
if (next !== this.target) {
|
|
106
|
+
this.release();
|
|
107
|
+
this.target = next;
|
|
108
|
+
}
|
|
109
|
+
const target = this.target;
|
|
110
|
+
if (!target)
|
|
111
|
+
return;
|
|
112
|
+
const managed = target.getAttribute(MANAGED_ATTR);
|
|
113
|
+
const authored = (name) => target.hasAttribute(name) && managed !== name;
|
|
114
|
+
if (target.tagName.includes('-')) {
|
|
115
|
+
if (authored('aria-label'))
|
|
116
|
+
return;
|
|
117
|
+
const text = this.labelText(this.host.contains(target) ? target : null);
|
|
118
|
+
if (text) {
|
|
119
|
+
target.setAttribute('aria-label', text);
|
|
120
|
+
target.setAttribute(MANAGED_ATTR, 'aria-label');
|
|
121
|
+
}
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (authored('aria-labelledby') || authored('aria-label'))
|
|
125
|
+
return;
|
|
126
|
+
if (!this.host.id)
|
|
127
|
+
this.host.id = `seki-label-${++uid}`;
|
|
128
|
+
target.setAttribute('aria-labelledby', this.host.id);
|
|
129
|
+
target.setAttribute(MANAGED_ATTR, 'aria-labelledby');
|
|
130
|
+
}
|
|
131
|
+
/** Remove anything this binding wrote on the current target. */
|
|
132
|
+
release() {
|
|
133
|
+
const target = this.target;
|
|
134
|
+
const managed = target === null || target === void 0 ? void 0 : target.getAttribute(MANAGED_ATTR);
|
|
135
|
+
if (target && managed) {
|
|
136
|
+
target.removeAttribute(managed);
|
|
137
|
+
target.removeAttribute(MANAGED_ATTR);
|
|
138
|
+
}
|
|
139
|
+
this.target = null;
|
|
140
|
+
}
|
|
141
|
+
/** Re-sync when the control is added after the label (async rendering). */
|
|
142
|
+
observe() {
|
|
143
|
+
if (this.observer || typeof MutationObserver === 'undefined')
|
|
144
|
+
return;
|
|
145
|
+
this.observer = new MutationObserver(() => {
|
|
146
|
+
if (this.resolveTarget() !== this.target)
|
|
147
|
+
this.sync();
|
|
148
|
+
});
|
|
149
|
+
this.observer.observe(this.host.getRootNode(), { childList: true, subtree: true });
|
|
150
|
+
}
|
|
151
|
+
disconnect() {
|
|
152
|
+
var _a;
|
|
153
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
154
|
+
this.observer = undefined;
|
|
155
|
+
this.release();
|
|
156
|
+
}
|
|
157
|
+
/** Forward a click on the label to its control, as a native label would. */
|
|
158
|
+
handleClick(event) {
|
|
159
|
+
var _a, _b;
|
|
160
|
+
if (event.defaultPrevented)
|
|
161
|
+
return;
|
|
162
|
+
const target = this.resolveTarget();
|
|
163
|
+
if (!target)
|
|
164
|
+
return;
|
|
165
|
+
const path = event.composedPath();
|
|
166
|
+
// The click came from the control itself: it already handled it.
|
|
167
|
+
if (path.includes(target))
|
|
168
|
+
return;
|
|
169
|
+
// Don't hijack clicks on other interactive content placed inside the label.
|
|
170
|
+
for (const node of path) {
|
|
171
|
+
if (node === this.host)
|
|
172
|
+
break;
|
|
173
|
+
if (node instanceof HTMLElement && node.matches('a[href], button, input, select, textarea'))
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (target.hasAttribute('disabled') || target.getAttribute('aria-disabled') === 'true')
|
|
177
|
+
return;
|
|
178
|
+
const toggle = (_a = target.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('[role="checkbox"], [role="switch"]');
|
|
179
|
+
if (toggle) {
|
|
180
|
+
toggle.focus();
|
|
181
|
+
toggle.click();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (target instanceof HTMLInputElement &&
|
|
185
|
+
['checkbox', 'radio', 'button', 'submit', 'reset'].includes(target.type)) {
|
|
186
|
+
target.focus();
|
|
187
|
+
target.click();
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (target instanceof HTMLButtonElement) {
|
|
191
|
+
target.click();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (target.shadowRoot)
|
|
195
|
+
focusInside(target);
|
|
196
|
+
else
|
|
197
|
+
(_b = target.focus) === null || _b === void 0 ? void 0 : _b.call(target);
|
|
198
|
+
}
|
|
199
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { g as globalScripts } from './p-jMliCqbB.js';
|
|
2
2
|
export { a as getAssetPath, r as render, s as setAssetPath, b as setNonce, c as setPlatformOptions } from './p-jMliCqbB.js';
|
|
3
3
|
export { S as SekiSwitch } from './p-Dh9pvFzL.js';
|
|
4
|
-
export { S as SekiLabel } from './p-
|
|
4
|
+
export { S as SekiLabel } from './p-C3WFySZp.js';
|
|
5
5
|
export { a as SekiSonner, S as SekiSonnerElement } from './p-D4LyQFQp.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, e as Host } from './p-jMliCqbB.js';
|
|
2
2
|
import { l as lockBodyScroll, u as unlockBodyScroll } from './p-D50kwTtW.js';
|
|
3
|
+
import { p as publishContext } from './p-B4SOpX_A.js';
|
|
3
4
|
|
|
4
5
|
const sekiDialogCss = ":host{--seki-neutral-50:hsl(0, 0%, 98%);--seki-neutral-100:hsl(0, 0%, 96.1%);--seki-neutral-200:hsl(0, 0%, 89.8%);--seki-neutral-300:hsl(0, 0%, 83.1%);--seki-neutral-400:hsl(0, 0%, 63.9%);--seki-neutral-500:hsl(0, 0%, 45.1%);--seki-neutral-600:hsl(0, 0%, 32.2%);--seki-neutral-700:hsl(0, 0%, 25.1%);--seki-neutral-800:hsl(0, 0%, 14.9%);--seki-neutral-900:hsl(0, 0%, 9%);--seki-neutral-950:hsl(0, 0%, 3.9%);--seki-primary-50:hsl(210, 100%, 97%);--seki-primary-100:hsl(210, 95%, 93%);--seki-primary-200:hsl(210, 95%, 85%);--seki-primary-300:hsl(210, 90%, 73%);--seki-primary-400:hsl(210, 85%, 58%);--seki-primary-500:hsl(210, 80%, 48%);--seki-primary-600:hsl(210, 75%, 40%);--seki-primary-700:hsl(210, 70%, 32%);--seki-primary-800:hsl(210, 65%, 25%);--seki-primary-900:hsl(210, 60%, 18%);--seki-primary-950:hsl(210, 55%, 10%);--seki-success-500:hsl(142, 71%, 45%);--seki-success-600:hsl(142, 71%, 35%);--seki-warning-500:hsl(38, 92%, 50%);--seki-warning-600:hsl(38, 92%, 40%);--seki-destructive-500:hsl(0, 84.2%, 60.2%);--seki-destructive-600:hsl(0, 72%, 41%);--seki-chart-1:hsl(12, 76%, 61%);--seki-chart-2:hsl(173, 58%, 39%);--seki-chart-3:hsl(197, 37%, 24%);--seki-chart-4:hsl(43, 74%, 66%);--seki-chart-5:hsl(27, 87%, 67%)}:host([data-theme='dark']){color-scheme:dark}:host([data-theme='light']){color-scheme:light}:host{--seki-background:light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 3.9%));--seki-foreground:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 98%));--seki-muted:light-dark(hsl(0, 0%, 96.1%), hsl(0, 0%, 14.9%));--seki-muted-foreground:light-dark(hsl(0, 0%, 42%), hsl(0, 0%, 63.9%));--seki-card:light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 3.9%));--seki-card-foreground:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 98%));--seki-popover:light-dark(hsl(0, 0%, 100%), hsl(0, 0%, 3.9%));--seki-popover-foreground:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 98%));--seki-border:light-dark(hsl(0, 0%, 89.8%), hsl(0, 0%, 14.9%));--seki-input:light-dark(hsl(0, 0%, 89.8%), hsl(0, 0%, 14.9%));--seki-primary:light-dark(hsl(0, 0%, 9%), hsl(0, 0%, 98%));--seki-primary-foreground:light-dark(hsl(0, 0%, 98%), hsl(0, 0%, 9%));--seki-primary-tint:light-dark(hsl(0, 0%, 9%, 0.06), hsl(0, 0%, 98%, 0.1));--seki-primary-tint-foreground:var(--seki-foreground);--seki-secondary:light-dark(hsl(0, 0%, 96.1%), hsl(0, 0%, 14.9%));--seki-secondary-foreground:light-dark(hsl(0, 0%, 9%), hsl(0, 0%, 98%));--seki-accent:light-dark(hsl(0, 0%, 96.1%), hsl(0, 0%, 14.9%));--seki-accent-foreground:light-dark(hsl(0, 0%, 9%), hsl(0, 0%, 98%));--seki-destructive:light-dark(hsl(0, 84.2%, 60.2%), hsl(0, 62.8%, 30.6%));--seki-destructive-foreground:hsl(0, 0%, 98%);--seki-destructive-bg:light-dark(hsl(0, 86%, 97%), rgba(239, 68, 68, 0.1));--seki-destructive-soft-foreground:light-dark(hsl(0, 63%, 31%), hsl(0, 91%, 71%));--seki-success:light-dark(hsl(142, 71%, 45%), hsl(142, 69%, 58%));--seki-success-foreground:light-dark(hsl(142, 64%, 24%), hsl(142, 69%, 58%));--seki-success-bg:light-dark(hsl(142, 76%, 97%), rgba(34, 197, 94, 0.1));--seki-warning:light-dark(hsl(38, 92%, 50%), hsl(43, 96%, 56%));--seki-warning-foreground:light-dark(hsl(21, 77%, 27%), hsl(43, 96%, 56%));--seki-warning-bg:light-dark(hsl(48, 96%, 96%), rgba(245, 158, 11, 0.1));--seki-info:light-dark(hsl(217, 91%, 60%), hsl(217, 92%, 68%));--seki-info-foreground:light-dark(hsl(224, 64%, 33%), hsl(217, 92%, 68%));--seki-info-bg:light-dark(hsl(214, 100%, 97%), rgba(59, 130, 246, 0.1));--seki-ring:light-dark(hsl(0, 0%, 3.9%), hsl(0, 0%, 83.1%));--seki-ring-shadow:hsl(0, 0%, 3.9%, 0.1);--seki-bg-primary:var(--seki-background);--seki-bg-secondary:var(--seki-muted);--seki-bg-tertiary:var(--seki-accent);--seki-text-primary:var(--seki-foreground);--seki-text-secondary:var(--seki-muted-foreground);--seki-text-tertiary:light-dark(var(--seki-neutral-400), var(--seki-neutral-600));--seki-border-default:var(--seki-border);--seki-border-emphasis:light-dark(var(--seki-neutral-300), var(--seki-neutral-700))}:host{--seki-button-primary-bg:var(--seki-primary);--seki-button-primary-text:var(--seki-primary-foreground);--seki-button-primary-border:transparent;--seki-button-primary-hover-bg:light-dark(hsl(0, 0%, 9%, 0.9), hsl(0, 0%, 98%, 0.9));--seki-button-primary-hover-text:var(--seki-primary-foreground);--seki-button-primary-hover-border:transparent;--seki-button-secondary-bg:var(--seki-secondary);--seki-button-secondary-text:var(--seki-secondary-foreground);--seki-button-secondary-border:transparent;--seki-button-secondary-hover-bg:light-dark(hsl(0, 0%, 96.1%, 0.8), hsl(0, 0%, 14.9%, 0.8));--seki-button-secondary-hover-text:var(--seki-secondary-foreground);--seki-button-secondary-hover-border:transparent;--seki-button-outline-bg:transparent;--seki-button-outline-text:var(--seki-foreground);--seki-button-outline-border:var(--seki-input);--seki-button-outline-hover-bg:var(--seki-accent);--seki-button-outline-hover-text:var(--seki-accent-foreground);--seki-button-outline-hover-border:var(--seki-input);--seki-button-ghost-bg:transparent;--seki-button-ghost-text:var(--seki-foreground);--seki-button-ghost-border:transparent;--seki-button-ghost-hover-bg:var(--seki-accent);--seki-button-ghost-hover-text:var(--seki-accent-foreground);--seki-button-ghost-hover-border:transparent;--seki-button-destructive-bg:var(--seki-destructive);--seki-button-destructive-text:var(--seki-destructive-foreground);--seki-button-destructive-border:transparent;--seki-button-destructive-hover-bg:hsl(0, 84.2%, 60.2%, 0.9);--seki-button-destructive-hover-border:transparent;--seki-button-sm-padding-x:var(--seki-spacing-3, 0.75rem);--seki-button-sm-padding-y:0.375rem;--seki-button-sm-font-size:var(--seki-text-sm, 0.875rem);--seki-button-sm-height:2.25rem;--seki-button-md-padding-x:var(--seki-spacing-4, 1rem);--seki-button-md-padding-y:var(--seki-spacing-2, 0.5rem);--seki-button-md-font-size:var(--seki-text-base, 1rem);--seki-button-md-height:2.5rem;--seki-button-lg-padding-x:2rem;--seki-button-lg-padding-y:0.5rem;--seki-button-lg-font-size:1rem;--seki-button-lg-height:2.75rem;--seki-button-icon-sm-size:2rem;--seki-button-icon-size:2.5rem;--seki-button-icon-lg-size:3rem;--seki-button-icon-gap:0.5rem;--seki-button-link-bg:transparent;--seki-button-link-text:var(--seki-primary);--seki-button-link-border:transparent;--seki-button-link-hover-bg:transparent;--seki-button-link-hover-text:var(--seki-primary);--seki-button-link-hover-border:transparent;--seki-button-radius:var(--seki-radius-md, 0.375rem);--seki-button-font-weight:var(--seki-font-medium, 500);--seki-button-transition-duration:150ms;--seki-button-transition-timing:ease-in-out;--seki-button-shadow:var(--seki-shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));--seki-button-shadow-hover:var(--seki-shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1));--seki-button-disabled-opacity:0.5;--seki-input-bg:var(--seki-background);--seki-input-border:var(--seki-border);--seki-input-text:var(--seki-foreground);--seki-input-placeholder:var(--seki-muted-foreground);--seki-input-ring:var(--seki-ring);--seki-input-invalid-border:var(--seki-destructive);--seki-input-invalid-ring:var(--seki-destructive);--seki-input-disabled-opacity:0.5;--seki-input-radius:var(--seki-radius-md);--seki-input-ring-offset:2px;--seki-select-trigger-bg:var(--seki-background);--seki-select-trigger-border:1px solid var(--seki-border);--seki-select-trigger-bg-hover:var(--seki-muted);--seki-select-trigger-radius:var(--seki-radius-md);--seki-select-trigger-min-height:2.5rem;--seki-select-trigger-padding:0.5rem 0.75rem;--seki-select-trigger-gap:0.5rem;--seki-select-content-bg:var(--seki-popover);--seki-select-content-border:1px solid var(--seki-border);--seki-select-content-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1);--seki-select-content-radius:var(--seki-radius-md);--seki-select-content-padding:0.5rem 0;--seki-select-option-padding:0.5rem 0.75rem;--seki-select-option-gap:0.5rem;--seki-select-option-radius:var(--seki-radius-sm);--seki-select-option-bg-hover:var(--seki-muted);--seki-select-option-bg-selected:var(--seki-muted);--seki-select-group-label-padding:0.5rem 0.75rem;--seki-select-group-label-font-size:var(--seki-font-size-xs);--seki-select-group-label-font-weight:var(--seki-font-semibold);--seki-select-group-label-color:var(--seki-muted-foreground);--seki-select-group-separator:1px solid var(--seki-border)}:host{--seki-spacing-0:0;--seki-spacing-0-5:0.125rem;--seki-spacing-1:0.25rem;--seki-spacing-1-5:0.375rem;--seki-spacing-2:0.5rem;--seki-spacing-2-5:0.625rem;--seki-spacing-3:0.75rem;--seki-spacing-3-5:0.875rem;--seki-spacing-4:1rem;--seki-spacing-5:1.25rem;--seki-spacing-6:1.5rem;--seki-spacing-8:2rem;--seki-spacing-10:2.5rem;--seki-spacing-12:3rem;--seki-spacing-16:4rem;--seki-spacing-20:5rem;--seki-spacing-24:6rem;--seki-input-height-sm:2rem;--seki-input-height-md:2.5rem;--seki-input-height-lg:3rem;--seki-input-padding-x:0.75rem;--seki-input-padding-y:0.5rem;--seki-input-font-size:0.875rem;--seki-input-ring-offset:2px}:host{--seki-shadow-sm:0 1px 2px 0 rgb(0 0 0 / 0.05);--seki-shadow-md:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--seki-shadow-lg:0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.1);--seki-shadow-xl:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)}:host{--seki-font-sans:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',\n Arial, sans-serif;--seki-font-mono:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;--seki-text-xs:0.75rem;--seki-text-sm:0.875rem;--seki-text-base:1rem;--seki-text-lg:1.125rem;--seki-text-xl:1.25rem;--seki-text-2xl:1.5rem;--seki-text-3xl:1.875rem;--seki-text-4xl:2.25rem;--seki-font-normal:400;--seki-font-medium:500;--seki-font-semibold:600;--seki-font-bold:700;--seki-leading-none:1;--seki-leading-tight:1.25;--seki-leading-normal:1.5;--seki-leading-relaxed:1.75}:host{--seki-radius-sm:0.25rem;--seki-radius-md:0.375rem;--seki-radius-lg:0.5rem;--seki-radius-xl:1rem;--seki-radius-full:9999px;}:host{--seki-sidebar-width:16rem;--seki-sidebar-width-icon:3rem;--seki-sidebar-width-mobile:18rem;--seki-sidebar-background:light-dark(hsl(0, 0%, 98%), hsl(240, 5.9%, 10%));--seki-sidebar-foreground:light-dark(hsl(240, 5.3%, 26.1%), hsl(240, 4.8%, 95.9%));--seki-sidebar-primary:light-dark(hsl(240, 5.9%, 10%), hsl(0, 0%, 98%));--seki-sidebar-primary-foreground:light-dark(hsl(0, 0%, 98%), hsl(240, 5.9%, 10%));--seki-sidebar-accent:light-dark(hsl(240, 4.8%, 95.9%), hsl(240, 3.7%, 15.9%));--seki-sidebar-accent-foreground:light-dark(hsl(240, 5.9%, 10%), hsl(240, 4.8%, 95.9%));--seki-sidebar-border:light-dark(hsl(220, 13%, 91%), hsl(240, 3.7%, 15.9%));--seki-sidebar-ring:hsl(217.2, 91.2%, 59.8%);--seki-sidebar-muted-foreground:light-dark(hsl(240, 3.8%, 46.1%), hsl(240, 5%, 64.9%));--seki-sidebar-menu-button-height:2rem;--seki-sidebar-menu-button-height-lg:3rem;--seki-sidebar-menu-button-padding:0.5rem;--seki-sidebar-menu-button-gap:0.5rem;--seki-sidebar-menu-button-radius:var(--seki-radius-md, 0.375rem);--seki-sidebar-menu-sub-padding-left:1.75rem;--seki-sidebar-menu-sub-border-width:1px;--seki-sidebar-group-padding:0.5rem;--seki-sidebar-group-label-height:2rem;--seki-sidebar-group-label-padding:0.5rem;--seki-sidebar-header-height:auto;--seki-sidebar-footer-height:auto;--seki-sidebar-header-padding:0.5rem;--seki-sidebar-footer-padding:0.5rem;--seki-sidebar-content-padding:0.5rem;--seki-sidebar-rail-width:1rem;--seki-sidebar-transition-duration:200ms;--seki-sidebar-transition-timing:ease-in-out;--seki-sidebar-mobile-breakpoint:768px;--seki-sidebar-overlay-bg:hsla(0, 0%, 0%, 0.8)}:host{--seki-animation-fast:150ms;--seki-animation-normal:200ms;--seki-animation-slow:300ms;--seki-ease-in:cubic-bezier(0.4, 0, 1, 1);--seki-ease-out:cubic-bezier(0, 0, 0.2, 1);--seki-ease-in-out:cubic-bezier(0.4, 0, 0.2, 1);--seki-accordion-content-height:auto}@keyframes seki-fade-in{from{opacity:0}to{opacity:1}}@keyframes seki-fade-out{from{opacity:1}to{opacity:0}}@keyframes seki-scale-in{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}@keyframes seki-scale-out{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0.95)}}@keyframes seki-slide-in-from-top{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes seki-slide-out-to-top{from{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes seki-slide-in-from-bottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes seki-slide-out-to-bottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes seki-slide-in-from-left{from{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes seki-slide-out-to-left{from{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes seki-slide-in-from-right{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes seki-slide-out-to-right{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes seki-accordion-down{from{height:0;opacity:0}to{height:var(--seki-accordion-content-height);opacity:1}}@keyframes seki-accordion-up{from{height:var(--seki-accordion-content-height);opacity:1}to{height:0;opacity:0}}@keyframes seki-zoom-in{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:scale(1)}}@keyframes seki-zoom-out{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0.96)}}@keyframes seki-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes seki-pulse{0%,100%{opacity:1}50%{opacity:0.5}}@keyframes seki-bounce{0%,100%{transform:translateY(-25%);animation-timing-function:cubic-bezier(0.8, 0, 1, 1)}50%{transform:translateY(0);animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}}@keyframes seki-collapsible-open{from{height:0;overflow:hidden}to{height:var(--seki-collapsible-content-height, auto)}}@keyframes seki-collapsible-close{from{height:var(--seki-collapsible-content-height, auto)}to{height:0;overflow:hidden}}@keyframes seki-toast-slide-in-right{from{transform:translateX(calc(100% + 1rem))}to{transform:translateX(0)}}@keyframes seki-toast-slide-out-right{from{transform:translateX(0)}to{transform:translateX(calc(100% + 1rem))}}@keyframes seki-toast-swipe-out{from{transform:translateX(var(--seki-toast-swipe-end-x, 0))}to{transform:translateX(calc(100% + 1rem))}}.seki-animate-fade-in{animation:seki-fade-in var(--seki-animation-normal) var(--seki-ease-out)}.seki-animate-fade-out{animation:seki-fade-out var(--seki-animation-normal) var(--seki-ease-in)}.seki-animate-scale-in{animation:seki-scale-in var(--seki-animation-normal) var(--seki-ease-out)}.seki-animate-scale-out{animation:seki-scale-out var(--seki-animation-normal) var(--seki-ease-in)}.seki-animate-spin{animation:seki-spin 1s linear infinite}.seki-animate-pulse{animation:seki-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}.seki-animate-bounce{animation:seki-bounce 1s infinite}@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important}}[data-theme='dark']{color-scheme:dark}[data-theme='light']{color-scheme:light}:host{display:contents}.dialog{display:contents}";
|
|
5
6
|
|
|
@@ -11,6 +12,7 @@ const SekiDialog = /*@__PURE__*/ proxyCustomElement(class SekiDialog extends H {
|
|
|
11
12
|
}
|
|
12
13
|
this.__attachShadow();
|
|
13
14
|
this.sekiOpenChange = createEvent(this, "sekiOpenChange");
|
|
15
|
+
this.dialogContextChange = createEvent(this, "sekiContextChange");
|
|
14
16
|
/**
|
|
15
17
|
* Controlled open state
|
|
16
18
|
*/
|
|
@@ -31,6 +33,19 @@ const SekiDialog = /*@__PURE__*/ proxyCustomElement(class SekiDialog extends H {
|
|
|
31
33
|
}
|
|
32
34
|
componentWillLoad() {
|
|
33
35
|
this._isOpen = this.open || this.defaultOpen;
|
|
36
|
+
// Publish before the first render so parts that render with this dialog
|
|
37
|
+
// (or upgrade before it, under one-module-per-tag loading) see `open`
|
|
38
|
+
// declared in HTML (#323).
|
|
39
|
+
this.publish();
|
|
40
|
+
}
|
|
41
|
+
componentDidLoad() {
|
|
42
|
+
// A dialog declared open in HTML never went through openDialog().
|
|
43
|
+
if (this._isOpen && this.modal) {
|
|
44
|
+
lockBodyScroll();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
handleModalChange() {
|
|
48
|
+
this.publish();
|
|
34
49
|
}
|
|
35
50
|
handleOpenPropChange(newValue) {
|
|
36
51
|
// Honour controlled `open` updates after first render. Without this, setting
|
|
@@ -59,8 +74,7 @@ const SekiDialog = /*@__PURE__*/ proxyCustomElement(class SekiDialog extends H {
|
|
|
59
74
|
// Update context for child components before emitting, so that any listener
|
|
60
75
|
// reading _dialogContext synchronously (e.g. seki-dialog-content) sees isOpen
|
|
61
76
|
// already updated.
|
|
62
|
-
|
|
63
|
-
this.el._dialogContext = this.getContext();
|
|
77
|
+
this.publish();
|
|
64
78
|
this.sekiOpenChange.emit(true);
|
|
65
79
|
if (this.modal) {
|
|
66
80
|
lockBodyScroll();
|
|
@@ -77,8 +91,7 @@ const SekiDialog = /*@__PURE__*/ proxyCustomElement(class SekiDialog extends H {
|
|
|
77
91
|
// Update context for child components before emitting, so that any listener
|
|
78
92
|
// reading _dialogContext synchronously (e.g. seki-dialog-content) sees isOpen
|
|
79
93
|
// already updated.
|
|
80
|
-
|
|
81
|
-
this.el._dialogContext = this.getContext();
|
|
94
|
+
this.publish();
|
|
82
95
|
this.sekiOpenChange.emit(false);
|
|
83
96
|
if (this.modal) {
|
|
84
97
|
unlockBodyScroll();
|
|
@@ -100,13 +113,8 @@ const SekiDialog = /*@__PURE__*/ proxyCustomElement(class SekiDialog extends H {
|
|
|
100
113
|
close: () => this.closeDialog(),
|
|
101
114
|
};
|
|
102
115
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
this.el._dialogContext = this.getContext();
|
|
106
|
-
}
|
|
107
|
-
componentDidUpdate() {
|
|
108
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
|
-
this.el._dialogContext = this.getContext();
|
|
116
|
+
publish() {
|
|
117
|
+
publishContext(this.el, '_dialogContext', this.getContext(), this.dialogContextChange);
|
|
110
118
|
}
|
|
111
119
|
disconnectedCallback() {
|
|
112
120
|
// Ensure body scroll is unlocked if component is removed while open
|
|
@@ -115,10 +123,11 @@ const SekiDialog = /*@__PURE__*/ proxyCustomElement(class SekiDialog extends H {
|
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
125
|
render() {
|
|
118
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: 'a1aa2d420059b896076fc23e80ad0843c54ca6e9', "data-state": this._isOpen ? 'open' : 'closed' }, h("div", { key: 'c84e45a16884cc61fb26e4a5fd5b96547405bcea', part: "dialog", class: "dialog" }, h("slot", { key: '13f5b8cbae8ba716473dabdef44e5ea08f5a881b' }))));
|
|
119
127
|
}
|
|
120
128
|
get el() { return this; }
|
|
121
129
|
static get watchers() { return {
|
|
130
|
+
"modal": ["handleModalChange"],
|
|
122
131
|
"open": ["handleOpenPropChange"]
|
|
123
132
|
}; }
|
|
124
133
|
static get style() { return sekiDialogCss; }
|
|
@@ -130,6 +139,7 @@ const SekiDialog = /*@__PURE__*/ proxyCustomElement(class SekiDialog extends H {
|
|
|
130
139
|
"openDialog": [64],
|
|
131
140
|
"closeDialog": [64]
|
|
132
141
|
}, [[0, "sekiDialogTriggerClick", "handleTriggerClick"], [0, "sekiDialogClose", "handleCloseRequest"]], {
|
|
142
|
+
"modal": ["handleModalChange"],
|
|
133
143
|
"open": ["handleOpenPropChange"]
|
|
134
144
|
}]);
|
|
135
145
|
SekiDialog.instanceCount = 0;
|