@db-ux/wc-core-components 4.12.0 → 4.13.0-shell-f221975
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/CHANGELOG.md +14 -0
- package/agent/ControlPanelBrand.md +9 -0
- package/agent/ControlPanelDesktop.md +46 -0
- package/agent/ControlPanelMeta.md +13 -0
- package/agent/ControlPanelMobile.md +37 -0
- package/agent/ControlPanelNavigation.md +19 -0
- package/agent/ControlPanelNavigationItem.md +33 -0
- package/agent/ControlPanelPrimaryActions.md +13 -0
- package/agent/ControlPanelSecondaryActions.md +19 -0
- package/agent/Drawer.md +0 -8
- package/agent/Shell.md +24 -0
- package/agent/ShellSubNavigation.md +6 -0
- package/agent/_instructions.md +11 -6
- package/bundle/db-accordion-item.js +1 -1
- package/bundle/db-accordion.js +1 -1
- package/bundle/db-badge.js +1 -1
- package/bundle/db-button.js +1 -1
- package/bundle/db-card.js +1 -1
- package/bundle/db-checkbox.js +1 -1
- package/bundle/db-control-panel-brand.d.ts +11 -0
- package/bundle/db-control-panel-brand.js +1 -0
- package/bundle/db-control-panel-desktop.d.ts +11 -0
- package/bundle/db-control-panel-desktop.js +1 -0
- package/bundle/db-control-panel-flat-icon.d.ts +11 -0
- package/bundle/db-control-panel-flat-icon.js +1 -0
- package/bundle/{db-navigation-item.d.ts → db-control-panel-meta.d.ts} +4 -4
- package/bundle/db-control-panel-meta.js +1 -0
- package/bundle/db-control-panel-mobile.d.ts +11 -0
- package/bundle/db-control-panel-mobile.js +1 -0
- package/bundle/db-control-panel-navigation-item-group.d.ts +11 -0
- package/bundle/db-control-panel-navigation-item-group.js +1 -0
- package/bundle/db-control-panel-navigation-item.d.ts +11 -0
- package/bundle/db-control-panel-navigation-item.js +1 -0
- package/bundle/db-control-panel-navigation.d.ts +11 -0
- package/bundle/db-control-panel-navigation.js +1 -0
- package/bundle/db-control-panel-primary-actions.d.ts +11 -0
- package/bundle/db-control-panel-primary-actions.js +1 -0
- package/bundle/db-control-panel-secondary-actions.d.ts +11 -0
- package/bundle/db-control-panel-secondary-actions.js +1 -0
- package/bundle/db-control-panel-skip-navigation.d.ts +11 -0
- package/bundle/db-control-panel-skip-navigation.js +1 -0
- package/bundle/db-custom-button.js +1 -1
- package/bundle/db-custom-select-dropdown.js +1 -1
- package/bundle/db-custom-select-form-field.js +1 -1
- package/bundle/db-custom-select-list-item.js +1 -1
- package/bundle/db-custom-select-list.js +1 -1
- package/bundle/db-custom-select.js +1 -1
- package/bundle/db-divider.js +1 -1
- package/bundle/{db-navigation.d.ts → db-drawer-footer.d.ts} +4 -4
- package/bundle/db-drawer-footer.js +1 -0
- package/bundle/{db-page.d.ts → db-drawer-header.d.ts} +4 -4
- package/bundle/db-drawer-header.js +1 -0
- package/bundle/db-drawer.js +1 -1
- package/bundle/db-icon.js +1 -1
- package/bundle/db-infotext.js +1 -1
- package/bundle/db-input.js +1 -1
- package/bundle/db-link.js +1 -1
- package/bundle/db-notification.js +1 -1
- package/bundle/db-popover.js +1 -1
- package/bundle/db-radio.js +1 -1
- package/bundle/db-section.js +1 -1
- package/bundle/db-select.js +1 -1
- package/bundle/{db-header.d.ts → db-shell-content.d.ts} +4 -4
- package/bundle/db-shell-content.js +1 -0
- package/bundle/db-shell-sub-navigation.d.ts +11 -0
- package/bundle/db-shell-sub-navigation.js +1 -0
- package/bundle/{db-brand.d.ts → db-shell.d.ts} +4 -4
- package/bundle/db-shell.js +1 -0
- package/bundle/db-stack.js +1 -1
- package/bundle/db-switch.js +1 -1
- package/bundle/db-tab-item.js +1 -1
- package/bundle/db-tab-list.js +1 -1
- package/bundle/db-tab-panel.js +1 -1
- package/bundle/db-table-body.js +1 -1
- package/bundle/db-table-caption.js +1 -1
- package/bundle/db-table-data-cell.js +1 -1
- package/bundle/db-table-footer.js +1 -1
- package/bundle/db-table-head.js +1 -1
- package/bundle/db-table-header-cell.js +1 -1
- package/bundle/db-table-row.js +1 -1
- package/bundle/db-table.js +1 -1
- package/bundle/db-tabs.js +1 -1
- package/bundle/db-tag.js +1 -1
- package/bundle/db-textarea.js +1 -1
- package/bundle/db-tooltip.js +1 -1
- package/bundle/index.js +1 -1
- package/bundle/p-6eFmbk2q.js +1 -0
- package/bundle/p-9FBjLlz8.js +1 -0
- package/bundle/p-B2-mqMAV.js +1 -0
- package/bundle/{p-G57oLrr4.js → p-B3HO0pCt.js} +1 -1
- package/bundle/p-B5p2TBcA.js +1 -0
- package/bundle/{p-BQov9sQb.js → p-BSn68Z6b.js} +1 -1
- package/bundle/p-BT3wZY6f.js +1 -0
- package/bundle/p-BWWm2aVB.js +1 -0
- package/bundle/{p-Cc5hdI0x.js → p-B_cQ652T.js} +1 -1
- package/bundle/{p-DcgghWWs.js → p-BbEdAR4o.js} +1 -1
- package/bundle/{p-C0JLpZ9Q.js → p-BtQh3jbl.js} +1 -1
- package/bundle/p-C3NPZvho.js +1 -0
- package/bundle/p-CGLknNHl.js +1 -0
- package/bundle/p-COv1iCFP.js +1 -0
- package/bundle/p-C_xaJ8Kg.js +1 -0
- package/bundle/p-CjeAJfEo.js +1 -0
- package/bundle/{p-to845Mg2.js → p-Cr4l4OlK.js} +1 -1
- package/bundle/p-CtoC6vGL.js +1 -0
- package/bundle/p-D2lYeElK.js +1 -0
- package/bundle/{p-BvgvWjGH.js → p-D9qEmJkQ.js} +1 -1
- package/bundle/p-DAr8BCe0.js +1 -0
- package/bundle/{p-CYYSsu3p.js → p-DEicAzan.js} +1 -1
- package/bundle/{p-C9llbu6g.js → p-DKhSQnne.js} +1 -1
- package/bundle/{p-BpO8Ok-r.js → p-DTmum76Y.js} +1 -1
- package/bundle/p-DtqySxCV.js +1 -0
- package/bundle/p-Nyi3Ccqz.js +1 -0
- package/bundle/p-V6Dppnfj.js +1 -0
- package/bundle/p-WOdZHiUh.js +1 -0
- package/bundle/p-_kvIQ0Iy.js +1 -0
- package/bundle/{p-fu0VCCbW.js → p-mf371GRo.js} +1 -1
- package/dist/cjs/{constants-bMY2_d8A.js → constants-BM1EltPT.js} +12 -3
- package/dist/cjs/db-accordion-item.cjs.entry.js +3 -3
- package/dist/cjs/db-accordion.cjs.entry.js +2 -2
- package/dist/cjs/db-badge.cjs.entry.js +4 -4
- package/dist/cjs/db-button.cjs.entry.js +6 -3
- package/dist/cjs/db-card.cjs.entry.js +3 -3
- package/dist/cjs/db-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/{db-brand.cjs.entry.js → db-control-panel-brand.cjs.entry.js} +9 -10
- package/dist/cjs/db-control-panel-desktop.cjs.entry.js +148 -0
- package/dist/cjs/db-control-panel-flat-icon.cjs.entry.js +134 -0
- package/dist/cjs/{db-navigation.cjs.entry.js → db-control-panel-meta.cjs.entry.js} +8 -8
- package/dist/cjs/db-control-panel-mobile.cjs.entry.js +124 -0
- package/dist/cjs/db-control-panel-navigation-item-group.cjs.entry.js +420 -0
- package/dist/cjs/db-control-panel-navigation-item.cjs.entry.js +235 -0
- package/dist/cjs/db-control-panel-navigation.cjs.entry.js +579 -0
- package/dist/cjs/db-control-panel-primary-actions.cjs.entry.js +95 -0
- package/dist/cjs/db-control-panel-secondary-actions.cjs.entry.js +95 -0
- package/dist/cjs/db-control-panel-skip-navigation.cjs.entry.js +96 -0
- package/dist/cjs/db-custom-button.cjs.entry.js +3 -3
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +14 -14
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js +3 -3
- package/dist/cjs/db-custom-select.cjs.entry.js +50 -26
- package/dist/cjs/db-divider.cjs.entry.js +2 -2
- package/dist/cjs/db-drawer_3.cjs.entry.js +457 -0
- package/dist/cjs/db-icon.cjs.entry.js +3 -3
- package/dist/cjs/db-infotext.cjs.entry.js +3 -3
- package/dist/cjs/db-link_4.cjs.entry.js +12 -10
- package/dist/cjs/db-notification.cjs.entry.js +4 -4
- package/dist/cjs/db-popover.cjs.entry.js +50 -22
- package/dist/cjs/db-radio.cjs.entry.js +4 -4
- package/dist/cjs/db-section.cjs.entry.js +3 -3
- package/dist/cjs/db-select.cjs.entry.js +5 -5
- package/dist/cjs/db-shell-content.cjs.entry.js +97 -0
- package/dist/cjs/db-shell-sub-navigation.cjs.entry.js +110 -0
- package/dist/cjs/{db-page.cjs.entry.js → db-shell.cjs.entry.js} +16 -17
- package/dist/cjs/db-stack.cjs.entry.js +3 -3
- package/dist/cjs/db-switch.cjs.entry.js +5 -5
- package/dist/cjs/db-tab-item_3.cjs.entry.js +8 -8
- package/dist/cjs/db-table-body_3.cjs.entry.js +10 -10
- package/dist/cjs/db-table-caption.cjs.entry.js +4 -3
- package/dist/cjs/db-table.cjs.entry.js +4 -4
- package/dist/cjs/db-tabs.cjs.entry.js +23 -18
- package/dist/cjs/db-textarea.cjs.entry.js +5 -5
- package/dist/cjs/db-tooltip.cjs.entry.js +39 -26
- package/dist/cjs/db-ux.cjs.js +1 -1
- package/dist/cjs/{document-click-listener-DdNXbErU.js → document-click-listener-D_0Q6lvb.js} +5 -9
- package/dist/cjs/{document-scroll-listener-CvAZ6uPr.js → document-scroll-listener-CgyYRmvZ.js} +29 -9
- package/dist/cjs/{floating-components-DlstoCKH.js → floating-components-B3bpFI90.js} +193 -115
- package/dist/cjs/{form-components-CmQlkARp.js → form-components-XNiwIGq8.js} +1 -1
- package/dist/cjs/{index-spuu3sXz.js → index-Df-6pBQf.js} +41 -2
- package/dist/cjs/index.cjs.js +34 -17
- package/dist/cjs/intersection-observer-listener-DlrHabJb.js +41 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/navigation-CHCtasZv.js +178 -0
- package/dist/cjs/resize-observer-listener-CmPDfoZs.js +103 -0
- package/dist/collection/collection-manifest.json +18 -7
- package/dist/collection/components/accordion/accordion.js +1 -1
- package/dist/collection/components/accordion/model.js +0 -1
- package/dist/collection/components/accordion-item/accordion-item.js +2 -2
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/button/button.js +57 -2
- package/dist/collection/components/card/card.js +2 -2
- package/dist/collection/components/checkbox/checkbox.js +2 -2
- package/dist/collection/components/control-panel-brand/control-panel-brand.js +179 -0
- package/dist/collection/components/control-panel-brand/index.js +2 -0
- package/dist/collection/components/control-panel-desktop/control-panel-desktop.js +343 -0
- package/dist/collection/components/control-panel-desktop/index.js +2 -0
- package/dist/collection/components/control-panel-flat-icon/control-panel-flat-icon.js +246 -0
- package/dist/collection/components/control-panel-flat-icon/index.js +2 -0
- package/dist/collection/components/control-panel-meta/control-panel-meta.js +179 -0
- package/dist/collection/components/control-panel-meta/index.js +2 -0
- package/dist/collection/components/control-panel-mobile/control-panel-mobile.js +307 -0
- package/dist/collection/components/control-panel-mobile/index.js +2 -0
- package/dist/collection/components/control-panel-mobile/model.js +1 -0
- package/dist/collection/components/control-panel-navigation/control-panel-navigation.js +829 -0
- package/dist/collection/components/control-panel-navigation/index.js +2 -0
- package/dist/collection/components/control-panel-navigation/model.js +1 -0
- package/dist/collection/components/control-panel-navigation-item/control-panel-navigation-item.js +484 -0
- package/dist/collection/components/control-panel-navigation-item/index.js +2 -0
- package/dist/collection/components/control-panel-navigation-item/model.js +1 -0
- package/dist/collection/components/control-panel-navigation-item-group/control-panel-navigation-item-group.js +772 -0
- package/dist/collection/components/control-panel-navigation-item-group/index.js +2 -0
- package/dist/collection/components/control-panel-navigation-item-group/model.js +1 -0
- package/dist/collection/components/control-panel-primary-actions/control-panel-primary-actions.js +179 -0
- package/dist/collection/components/control-panel-primary-actions/index.js +2 -0
- package/dist/collection/components/control-panel-primary-actions/model.js +1 -0
- package/dist/collection/components/control-panel-secondary-actions/control-panel-secondary-actions.js +179 -0
- package/dist/collection/components/control-panel-secondary-actions/index.js +2 -0
- package/dist/collection/components/control-panel-secondary-actions/model.js +1 -0
- package/dist/collection/components/control-panel-skip-navigation/control-panel-skip-navigation.js +232 -0
- package/dist/collection/components/control-panel-skip-navigation/index.js +2 -0
- package/dist/collection/components/control-panel-skip-navigation/model.js +1 -0
- package/dist/collection/components/custom-button/custom-button.js +2 -2
- package/dist/collection/components/custom-select/custom-select.js +46 -21
- package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +2 -2
- package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +2 -2
- package/dist/collection/components/custom-select-list/custom-select-list.js +2 -2
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +2 -2
- package/dist/collection/components/divider/divider.js +1 -1
- package/dist/collection/components/drawer/drawer.js +71 -75
- package/dist/collection/components/drawer/model.js +1 -0
- package/dist/collection/components/{navigation/navigation.js → drawer-footer/drawer-footer.js} +19 -19
- package/dist/collection/components/drawer-footer/index.js +2 -0
- package/dist/collection/components/drawer-footer/model.js +1 -0
- package/dist/collection/components/{brand/brand.js → drawer-header/drawer-header.js} +83 -79
- package/dist/collection/components/drawer-header/index.js +2 -0
- package/dist/collection/components/drawer-header/model.js +1 -0
- package/dist/collection/components/icon/icon.js +2 -2
- package/dist/collection/components/infotext/infotext.js +2 -2
- package/dist/collection/components/input/input.js +3 -3
- package/dist/collection/components/link/link.js +2 -2
- package/dist/collection/components/notification/notification.js +2 -2
- package/dist/collection/components/popover/popover.js +75 -46
- package/dist/collection/components/radio/radio.js +2 -2
- package/dist/collection/components/section/section.js +2 -2
- package/dist/collection/components/select/select.js +2 -2
- package/dist/collection/components/shell/index.js +2 -0
- package/dist/collection/components/shell/model.js +1 -0
- package/dist/collection/components/{header/header.js → shell/shell.js} +92 -143
- package/dist/collection/components/shell-content/index.js +2 -0
- package/dist/collection/components/shell-content/model.js +1 -0
- package/dist/collection/components/{page/page.js → shell-content/shell-content.js} +67 -86
- package/dist/collection/components/shell-sub-navigation/index.js +2 -0
- package/dist/collection/components/shell-sub-navigation/model.js +1 -0
- package/dist/collection/components/shell-sub-navigation/shell-sub-navigation.js +248 -0
- package/dist/collection/components/stack/stack.js +2 -2
- package/dist/collection/components/switch/switch.js +2 -2
- package/dist/collection/components/tab-item/tab-item.js +3 -3
- package/dist/collection/components/tab-list/tab-list.js +2 -2
- package/dist/collection/components/tab-panel/tab-panel.js +2 -2
- package/dist/collection/components/table/table.js +27 -3
- package/dist/collection/components/table-body/table-body.js +27 -3
- package/dist/collection/components/table-caption/table-caption.js +27 -2
- package/dist/collection/components/table-data-cell/table-data-cell.js +27 -2
- package/dist/collection/components/table-footer/table-footer.js +27 -3
- package/dist/collection/components/table-head/table-head.js +27 -3
- package/dist/collection/components/table-header-cell/table-header-cell.js +27 -2
- package/dist/collection/components/table-row/table-row.js +27 -3
- package/dist/collection/components/tabs/tabs.js +75 -18
- package/dist/collection/components/tag/tag.js +2 -2
- package/dist/collection/components/textarea/textarea.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +63 -49
- package/dist/collection/index.js +32 -10
- package/dist/collection/shared/constants.js +7 -2
- package/dist/collection/shared/model.js +4 -0
- package/dist/collection/utils/abstract-document-listener.js +23 -0
- package/dist/collection/utils/abstract-observer-listener.js +61 -0
- package/dist/collection/utils/document-click-listener.js +5 -9
- package/dist/collection/utils/document-scroll-listener.js +5 -9
- package/dist/collection/utils/floating-components.js +193 -115
- package/dist/collection/utils/index.js +40 -2
- package/dist/collection/utils/intersection-observer-listener.js +36 -0
- package/dist/collection/utils/navigation.js +113 -74
- package/dist/collection/utils/resize-observer-listener.js +36 -0
- package/dist/custom-elements.json +11897 -8400
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/{p-d9d006e7.entry.js → p-158c64e0.entry.js} +1 -1
- package/dist/db-ux/p-1fa944fd.entry.js +1 -0
- package/dist/db-ux/{p-a176424b.entry.js → p-2012c72a.entry.js} +1 -1
- package/dist/db-ux/p-234fee81.entry.js +1 -0
- package/dist/db-ux/{p-6b8375e8.entry.js → p-3566a5b2.entry.js} +1 -1
- package/dist/db-ux/p-3b61c223.entry.js +1 -0
- package/dist/db-ux/p-3d5fc4b6.entry.js +1 -0
- package/dist/db-ux/p-3e113cfe.entry.js +1 -0
- package/dist/db-ux/p-42644385.entry.js +1 -0
- package/dist/db-ux/p-42fd6a5c.entry.js +1 -0
- package/dist/db-ux/p-441d444e.entry.js +1 -0
- package/dist/db-ux/{p-a8556349.entry.js → p-4ecd501a.entry.js} +1 -1
- package/dist/db-ux/{p-77a47225.entry.js → p-53f827e1.entry.js} +1 -1
- package/dist/db-ux/{p-eedf08e0.entry.js → p-5696a8d3.entry.js} +1 -1
- package/dist/db-ux/p-56b2a25d.entry.js +1 -0
- package/dist/db-ux/{p-68f00121.entry.js → p-5a1a7588.entry.js} +1 -1
- package/dist/db-ux/p-5c5dce95.entry.js +1 -0
- package/dist/db-ux/p-5ce9ac6d.entry.js +1 -0
- package/dist/db-ux/{p-57527cef.entry.js → p-636e6a6d.entry.js} +1 -1
- package/dist/db-ux/p-6aac51bf.entry.js +1 -0
- package/dist/db-ux/p-6fc31876.entry.js +1 -0
- package/dist/db-ux/p-7d3541c6.entry.js +1 -0
- package/dist/db-ux/p-8f288b5e.entry.js +1 -0
- package/dist/db-ux/{p-37bf8d87.entry.js → p-9174a1f8.entry.js} +1 -1
- package/dist/db-ux/p-92d1d118.entry.js +1 -0
- package/dist/db-ux/p-94806e39.entry.js +1 -0
- package/dist/db-ux/p-95afbd4b.entry.js +1 -0
- package/dist/db-ux/p-BNNa1bIH.js +1 -0
- package/dist/db-ux/p-BT3wZY6f.js +1 -0
- package/dist/db-ux/p-Bs6e6rEa.js +1 -0
- package/dist/db-ux/p-Bu2uTpuB.js +1 -0
- package/dist/db-ux/p-CHtd83tf.js +1 -0
- package/dist/db-ux/p-COv1iCFP.js +1 -0
- package/dist/db-ux/p-D-LMtTru.js +1 -0
- package/dist/db-ux/p-DB8jc8lh.js +1 -0
- package/dist/db-ux/p-a2fd6f02.entry.js +1 -0
- package/dist/db-ux/p-a526be72.entry.js +1 -0
- package/dist/db-ux/{p-db1b9f5d.entry.js → p-aa0d6af7.entry.js} +1 -1
- package/dist/db-ux/p-ab2ca4f9.entry.js +1 -0
- package/dist/db-ux/p-b124f5d7.entry.js +1 -0
- package/dist/db-ux/p-b4069c07.entry.js +1 -0
- package/dist/db-ux/p-b90adbf2.entry.js +1 -0
- package/dist/db-ux/p-bbqCwwgU.js +1 -0
- package/dist/db-ux/p-c36731c4.entry.js +1 -0
- package/dist/db-ux/p-c6e965b9.entry.js +1 -0
- package/dist/db-ux/p-d0340bf6.entry.js +1 -0
- package/dist/db-ux/p-d354d861.entry.js +1 -0
- package/dist/db-ux/{p-6d41baf1.entry.js → p-d7ffa767.entry.js} +1 -1
- package/dist/db-ux/{p-70b6ebcd.entry.js → p-da34c367.entry.js} +1 -1
- package/dist/db-ux/{p-81edb316.entry.js → p-eb18be29.entry.js} +1 -1
- package/dist/db-ux/p-eee0f32c.entry.js +1 -0
- package/dist/db-ux/p-f1f23724.entry.js +1 -0
- package/dist/esm/{constants-BdL-nI5y.js → constants-COv1iCFP.js} +8 -3
- package/dist/esm/db-accordion-item.entry.js +3 -3
- package/dist/esm/db-accordion.entry.js +2 -2
- package/dist/esm/db-badge.entry.js +4 -4
- package/dist/esm/db-button.entry.js +6 -3
- package/dist/esm/db-card.entry.js +3 -3
- package/dist/esm/db-checkbox.entry.js +5 -5
- package/dist/esm/db-control-panel-brand.entry.js +93 -0
- package/dist/esm/db-control-panel-desktop.entry.js +146 -0
- package/dist/esm/db-control-panel-flat-icon.entry.js +132 -0
- package/dist/esm/{db-navigation.entry.js → db-control-panel-meta.entry.js} +8 -8
- package/dist/esm/db-control-panel-mobile.entry.js +122 -0
- package/dist/esm/db-control-panel-navigation-item-group.entry.js +418 -0
- package/dist/esm/db-control-panel-navigation-item.entry.js +233 -0
- package/dist/esm/db-control-panel-navigation.entry.js +577 -0
- package/dist/esm/db-control-panel-primary-actions.entry.js +93 -0
- package/dist/esm/db-control-panel-secondary-actions.entry.js +93 -0
- package/dist/esm/{db-brand.entry.js → db-control-panel-skip-navigation.entry.js} +9 -9
- package/dist/esm/db-custom-button.entry.js +3 -3
- package/dist/esm/db-custom-select-dropdown_5.entry.js +14 -14
- package/dist/esm/db-custom-select-form-field.entry.js +3 -3
- package/dist/esm/db-custom-select.entry.js +50 -26
- package/dist/esm/db-divider.entry.js +2 -2
- package/dist/esm/db-drawer_3.entry.js +453 -0
- package/dist/esm/db-icon.entry.js +3 -3
- package/dist/esm/db-infotext.entry.js +3 -3
- package/dist/esm/db-link_4.entry.js +12 -10
- package/dist/esm/db-notification.entry.js +4 -4
- package/dist/esm/db-popover.entry.js +50 -22
- package/dist/esm/db-radio.entry.js +4 -4
- package/dist/esm/db-section.entry.js +3 -3
- package/dist/esm/db-select.entry.js +5 -5
- package/dist/esm/db-shell-content.entry.js +95 -0
- package/dist/esm/db-shell-sub-navigation.entry.js +108 -0
- package/dist/esm/{db-page.entry.js → db-shell.entry.js} +16 -17
- package/dist/esm/db-stack.entry.js +3 -3
- package/dist/esm/db-switch.entry.js +5 -5
- package/dist/esm/db-tab-item_3.entry.js +8 -8
- package/dist/esm/db-table-body_3.entry.js +10 -10
- package/dist/esm/db-table-caption.entry.js +4 -3
- package/dist/esm/db-table.entry.js +4 -4
- package/dist/esm/db-tabs.entry.js +23 -18
- package/dist/esm/db-textarea.entry.js +5 -5
- package/dist/esm/db-tooltip.entry.js +39 -26
- package/dist/esm/db-ux.js +1 -1
- package/dist/esm/{document-click-listener-9wJfRcvz.js → document-click-listener-BEYsNvC5.js} +5 -9
- package/dist/esm/{document-scroll-listener-4F0ZAg9p.js → document-scroll-listener-B8lkAL-m.js} +29 -10
- package/dist/esm/{floating-components-DOPXnIzL.js → floating-components-BT3wZY6f.js} +194 -116
- package/dist/esm/{form-components-ZV7IN0oG.js → form-components-zJeL8XMn.js} +1 -1
- package/dist/esm/{index-fumiz06Y.js → index-DB8jc8lh.js} +41 -3
- package/dist/esm/index.js +17 -10
- package/dist/esm/intersection-observer-listener-DQ4WWSLe.js +39 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/navigation-Cc_Ln-dl.js +174 -0
- package/dist/esm/resize-observer-listener-z8XjzxC9.js +100 -0
- package/dist/types/components/accordion/model.d.ts +2 -8
- package/dist/types/components/button/button.d.ts +2 -0
- package/dist/types/components/button/model.d.ts +8 -0
- package/dist/types/components/{brand/brand.d.ts → control-panel-brand/control-panel-brand.d.ts} +5 -9
- package/dist/types/components/control-panel-brand/index.d.ts +2 -0
- package/dist/types/components/control-panel-brand/model.d.ts +5 -0
- package/dist/types/components/control-panel-desktop/control-panel-desktop.d.ts +41 -0
- package/dist/types/components/control-panel-desktop/index.d.ts +2 -0
- package/dist/types/components/control-panel-desktop/model.d.ts +5 -0
- package/dist/types/components/{page/page.d.ts → control-panel-flat-icon/control-panel-flat-icon.d.ts} +10 -12
- package/dist/types/components/control-panel-flat-icon/index.d.ts +2 -0
- package/dist/types/components/control-panel-flat-icon/model.d.ts +12 -0
- package/dist/types/components/control-panel-meta/control-panel-meta.d.ts +23 -0
- package/dist/types/components/control-panel-meta/index.d.ts +2 -0
- package/dist/types/components/control-panel-meta/model.d.ts +5 -0
- package/dist/types/components/control-panel-mobile/control-panel-mobile.d.ts +36 -0
- package/dist/types/components/control-panel-mobile/index.d.ts +2 -0
- package/dist/types/components/control-panel-mobile/model.d.ts +21 -0
- package/dist/types/components/control-panel-navigation/control-panel-navigation.d.ts +54 -0
- package/dist/types/components/control-panel-navigation/index.d.ts +2 -0
- package/dist/types/components/control-panel-navigation/model.d.ts +25 -0
- package/dist/types/components/control-panel-navigation-item/control-panel-navigation-item.d.ts +42 -0
- package/dist/types/components/control-panel-navigation-item/index.d.ts +2 -0
- package/dist/types/components/control-panel-navigation-item/model.d.ts +20 -0
- package/dist/types/components/control-panel-navigation-item-group/control-panel-navigation-item-group.d.ts +74 -0
- package/dist/types/components/control-panel-navigation-item-group/index.d.ts +2 -0
- package/dist/types/components/control-panel-navigation-item-group/model.d.ts +44 -0
- package/dist/types/components/control-panel-primary-actions/control-panel-primary-actions.d.ts +23 -0
- package/dist/types/components/control-panel-primary-actions/index.d.ts +2 -0
- package/dist/types/components/control-panel-primary-actions/model.d.ts +5 -0
- package/dist/types/components/control-panel-secondary-actions/control-panel-secondary-actions.d.ts +23 -0
- package/dist/types/components/control-panel-secondary-actions/index.d.ts +2 -0
- package/dist/types/components/control-panel-secondary-actions/model.d.ts +5 -0
- package/dist/types/components/control-panel-skip-navigation/control-panel-skip-navigation.d.ts +25 -0
- package/dist/types/components/control-panel-skip-navigation/index.d.ts +2 -0
- package/dist/types/components/control-panel-skip-navigation/model.d.ts +16 -0
- package/dist/types/components/custom-select/custom-select.d.ts +2 -1
- package/dist/types/components/custom-select/model.d.ts +5 -1
- package/dist/types/components/drawer/drawer.d.ts +9 -6
- package/dist/types/components/drawer/model.d.ts +21 -3
- package/dist/types/components/{navigation/navigation.d.ts → drawer-footer/drawer-footer.d.ts} +5 -5
- package/dist/types/components/drawer-footer/index.d.ts +2 -0
- package/dist/types/components/drawer-footer/model.d.ts +5 -0
- package/dist/types/components/drawer-header/drawer-header.d.ts +30 -0
- package/dist/types/components/drawer-header/index.d.ts +2 -0
- package/dist/types/components/drawer-header/model.d.ts +9 -0
- package/dist/types/components/popover/popover.d.ts +3 -2
- package/dist/types/components/shell/index.d.ts +2 -0
- package/dist/types/components/shell/model.d.ts +34 -0
- package/dist/types/components/shell/shell.d.ts +30 -0
- package/dist/types/components/shell-content/index.d.ts +2 -0
- package/dist/types/components/shell-content/model.d.ts +28 -0
- package/dist/types/components/shell-content/shell-content.d.ts +28 -0
- package/dist/types/components/shell-sub-navigation/index.d.ts +2 -0
- package/dist/types/components/shell-sub-navigation/model.d.ts +5 -0
- package/dist/types/components/shell-sub-navigation/shell-sub-navigation.d.ts +29 -0
- package/dist/types/components/table/table.d.ts +1 -0
- package/dist/types/components/table-body/table-body.d.ts +1 -0
- package/dist/types/components/table-caption/table-caption.d.ts +1 -0
- package/dist/types/components/table-data-cell/table-data-cell.d.ts +1 -0
- package/dist/types/components/table-footer/table-footer.d.ts +1 -0
- package/dist/types/components/table-head/table-head.d.ts +1 -0
- package/dist/types/components/table-header-cell/table-header-cell.d.ts +1 -0
- package/dist/types/components/table-row/table-row.d.ts +1 -0
- package/dist/types/components/tabs/model.d.ts +4 -12
- package/dist/types/components/tabs/tabs.d.ts +3 -1
- package/dist/types/components/tooltip/tooltip.d.ts +3 -2
- package/dist/types/components.d.ts +621 -243
- package/dist/types/index.d.ts +32 -10
- package/dist/types/shared/constants.d.ts +44 -39
- package/dist/types/shared/figma.d.ts +11 -4
- package/dist/types/shared/model.d.ts +109 -7
- package/dist/types/utils/abstract-document-listener.d.ts +18 -0
- package/dist/types/utils/abstract-observer-listener.d.ts +39 -0
- package/dist/types/utils/document-click-listener.d.ts +3 -3
- package/dist/types/utils/document-scroll-listener.d.ts +3 -3
- package/dist/types/utils/floating-components.d.ts +29 -6
- package/dist/types/utils/index.d.ts +11 -0
- package/dist/types/utils/intersection-observer-listener.d.ts +15 -0
- package/dist/types/utils/navigation.d.ts +12 -11
- package/dist/types/utils/resize-observer-listener.d.ts +15 -0
- package/dist/vscode.html-custom-data.json +998 -540
- package/dist/web-types.json +2176 -1176
- package/package.json +5 -5
- package/agent/Brand.md +0 -13
- package/agent/Header.md +0 -29
- package/agent/Navigation.md +0 -19
- package/agent/NavigationItem.md +0 -29
- package/agent/Page.md +0 -27
- package/bundle/db-brand.js +0 -1
- package/bundle/db-header.js +0 -1
- package/bundle/db-navigation-item.js +0 -1
- package/bundle/db-navigation.js +0 -1
- package/bundle/db-page.js +0 -1
- package/bundle/p-2eQDIPlF.js +0 -1
- package/bundle/p-BdL-nI5y.js +0 -1
- package/bundle/p-BuBrj57D.js +0 -1
- package/bundle/p-C2w7ILj8.js +0 -1
- package/bundle/p-C47AKJPy.js +0 -1
- package/bundle/p-Cn5NdjPW.js +0 -1
- package/bundle/p-D6L0n3gO.js +0 -1
- package/bundle/p-DFypNnh0.js +0 -1
- package/bundle/p-DJTpgiBy.js +0 -1
- package/bundle/p-DOPXnIzL.js +0 -1
- package/bundle/p-DTM6Wcbf.js +0 -1
- package/bundle/p-DVuZmW_J.js +0 -1
- package/bundle/p-DW47OZNu.js +0 -1
- package/bundle/p-DiEfz0o1.js +0 -1
- package/bundle/p-n2qePi9e.js +0 -1
- package/dist/cjs/db-drawer.cjs.entry.js +0 -204
- package/dist/cjs/db-header.cjs.entry.js +0 -145
- package/dist/cjs/db-navigation-item.cjs.entry.js +0 -182
- package/dist/cjs/navigation-Bah882nU.js +0 -138
- package/dist/collection/components/brand/index.js +0 -2
- package/dist/collection/components/header/index.js +0 -2
- package/dist/collection/components/navigation/index.js +0 -2
- package/dist/collection/components/navigation-item/index.js +0 -2
- package/dist/collection/components/navigation-item/navigation-item.js +0 -577
- package/dist/collection/components/page/index.js +0 -2
- package/dist/collection/components/page/model.js +0 -2
- package/dist/db-ux/p-0758418a.entry.js +0 -1
- package/dist/db-ux/p-1e70d93f.entry.js +0 -1
- package/dist/db-ux/p-2c23efe2.entry.js +0 -1
- package/dist/db-ux/p-38c55e9c.entry.js +0 -1
- package/dist/db-ux/p-4a94fbc9.entry.js +0 -1
- package/dist/db-ux/p-5706f20a.entry.js +0 -1
- package/dist/db-ux/p-6ce4a109.entry.js +0 -1
- package/dist/db-ux/p-6fd70ba4.entry.js +0 -1
- package/dist/db-ux/p-6fdc00bd.entry.js +0 -1
- package/dist/db-ux/p-71399ee3.entry.js +0 -1
- package/dist/db-ux/p-88dcff6a.entry.js +0 -1
- package/dist/db-ux/p-90e9ec2d.entry.js +0 -1
- package/dist/db-ux/p-96978a7f.entry.js +0 -1
- package/dist/db-ux/p-BdL-nI5y.js +0 -1
- package/dist/db-ux/p-BihrW11j.js +0 -1
- package/dist/db-ux/p-BtImZ8Nt.js +0 -1
- package/dist/db-ux/p-BuBrj57D.js +0 -1
- package/dist/db-ux/p-DOPXnIzL.js +0 -1
- package/dist/db-ux/p-OOIf-5XP.js +0 -1
- package/dist/db-ux/p-a07e33e7.entry.js +0 -1
- package/dist/db-ux/p-a4fb4782.entry.js +0 -1
- package/dist/db-ux/p-bb5149a9.entry.js +0 -1
- package/dist/db-ux/p-e58fbd4d.entry.js +0 -1
- package/dist/db-ux/p-e66aa9d8.entry.js +0 -1
- package/dist/db-ux/p-ef63c591.entry.js +0 -1
- package/dist/db-ux/p-f0b5c785.entry.js +0 -1
- package/dist/db-ux/p-f964d5f5.entry.js +0 -1
- package/dist/db-ux/p-fumiz06Y.js +0 -1
- package/dist/esm/db-drawer.entry.js +0 -202
- package/dist/esm/db-header.entry.js +0 -143
- package/dist/esm/db-navigation-item.entry.js +0 -180
- package/dist/esm/navigation-Jh6m0eMk.js +0 -135
- package/dist/types/components/brand/index.d.ts +0 -2
- package/dist/types/components/brand/model.d.ts +0 -10
- package/dist/types/components/header/header.d.ts +0 -40
- package/dist/types/components/header/index.d.ts +0 -2
- package/dist/types/components/header/model.d.ts +0 -44
- package/dist/types/components/navigation/index.d.ts +0 -2
- package/dist/types/components/navigation/model.d.ts +0 -5
- package/dist/types/components/navigation-item/index.d.ts +0 -2
- package/dist/types/components/navigation-item/model.d.ts +0 -39
- package/dist/types/components/navigation-item/navigation-item.d.ts +0 -52
- package/dist/types/components/page/index.d.ts +0 -2
- package/dist/types/components/page/model.d.ts +0 -36
- /package/dist/collection/components/{brand → control-panel-brand}/model.js +0 -0
- /package/dist/collection/components/{header → control-panel-desktop}/model.js +0 -0
- /package/dist/collection/components/{navigation-item → control-panel-flat-icon}/model.js +0 -0
- /package/dist/collection/components/{navigation → control-panel-meta}/model.js +0 -0
package/dist/cjs/{document-scroll-listener-CvAZ6uPr.js → document-scroll-listener-CgyYRmvZ.js}
RENAMED
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Df-6pBQf.js');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Generic base class for singleton document event listeners.
|
|
7
|
+
* Manages a shared set of callbacks dispatched when a document-level
|
|
8
|
+
* event fires.
|
|
9
|
+
*
|
|
10
|
+
* Subclasses own their static state (callbacks, instance) and expose
|
|
11
|
+
* it via the abstract accessor methods below.
|
|
12
|
+
*
|
|
13
|
+
* @template TEvent - The event type passed to callbacks (Event, MouseEvent, etc.)
|
|
14
|
+
*/
|
|
15
|
+
class AbstractDocumentListener {
|
|
16
|
+
addCallback(callback) {
|
|
17
|
+
const id = index.uuid();
|
|
18
|
+
const callbacks = this.getCallbacks();
|
|
19
|
+
callbacks[id] = callback;
|
|
20
|
+
return id;
|
|
21
|
+
}
|
|
22
|
+
removeCallback(id) {
|
|
23
|
+
const callbacks = this.getCallbacks();
|
|
24
|
+
delete callbacks[id];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class DocumentScrollListener extends AbstractDocumentListener {
|
|
6
29
|
static runCallbacks(event) {
|
|
7
30
|
for (const callback of Object.values(DocumentScrollListener.callbacks)) {
|
|
8
31
|
if (typeof callback === 'function') {
|
|
@@ -11,6 +34,7 @@ class DocumentScrollListener {
|
|
|
11
34
|
}
|
|
12
35
|
}
|
|
13
36
|
constructor() {
|
|
37
|
+
super();
|
|
14
38
|
this.ticking = false;
|
|
15
39
|
if (DocumentScrollListener._instance) {
|
|
16
40
|
return DocumentScrollListener._instance;
|
|
@@ -28,16 +52,12 @@ class DocumentScrollListener {
|
|
|
28
52
|
}, true);
|
|
29
53
|
}
|
|
30
54
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
DocumentScrollListener.callbacks[callbackID] = callback;
|
|
34
|
-
return callbackID;
|
|
35
|
-
}
|
|
36
|
-
removeCallback(id) {
|
|
37
|
-
delete DocumentScrollListener.callbacks[id];
|
|
55
|
+
getCallbacks() {
|
|
56
|
+
return DocumentScrollListener.callbacks;
|
|
38
57
|
}
|
|
39
58
|
}
|
|
40
59
|
DocumentScrollListener.callbacks = {};
|
|
41
60
|
DocumentScrollListener._instance = null;
|
|
42
61
|
|
|
62
|
+
exports.AbstractDocumentListener = AbstractDocumentListener;
|
|
43
63
|
exports.DocumentScrollListener = DocumentScrollListener;
|
|
@@ -1,87 +1,74 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// TODO: We should reevaluate this as soon as CSS Anchor Positioning is supported in all relevant browsers
|
|
4
|
-
const isInView = (el) => {
|
|
5
|
-
var _a;
|
|
6
|
-
const { top, bottom, left, right } = el.getBoundingClientRect();
|
|
7
|
-
const { innerHeight, innerWidth } = window;
|
|
8
|
-
let outTop = top < 0;
|
|
9
|
-
let outBottom = bottom > innerHeight;
|
|
10
|
-
let outLeft = left < 0;
|
|
11
|
-
let outRight = right > innerWidth;
|
|
12
|
-
// We need to check if it was already outside
|
|
13
|
-
const outsideY = el.dataset['outsideVy'];
|
|
14
|
-
const outsideX = el.dataset['outsideVx'];
|
|
15
|
-
const parentRect = (_a = el === null || el === void 0 ? void 0 : el.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
16
|
-
if (parentRect) {
|
|
17
|
-
if (outsideY) {
|
|
18
|
-
const position = el.dataset['outsideVy'];
|
|
19
|
-
if (position === 'top') {
|
|
20
|
-
outTop = parentRect.top - (bottom - parentRect.bottom) < 0;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (outsideX) {
|
|
27
|
-
const position = el.dataset['outsideVx'];
|
|
28
|
-
if (position === 'left') {
|
|
29
|
-
outLeft = parentRect.left - (right - parentRect.right) < 0;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
outRight = parentRect.right + (parentRect.left - left) > innerWidth;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
outTop,
|
|
38
|
-
outBottom,
|
|
39
|
-
outLeft,
|
|
40
|
-
outRight
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
const handleDataOutside = (el) => {
|
|
44
|
-
const { outTop, outBottom, outLeft, outRight } = isInView(el);
|
|
45
|
-
let dataOutsidePair = {};
|
|
46
|
-
if (outTop || outBottom) {
|
|
47
|
-
dataOutsidePair = {
|
|
48
|
-
vy: outTop ? 'top' : 'bottom'
|
|
49
|
-
};
|
|
50
|
-
el.dataset['outsideVy'] = dataOutsidePair.vy;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
delete el.dataset['outsideVy'];
|
|
54
|
-
}
|
|
55
|
-
if (outLeft || outRight) {
|
|
56
|
-
dataOutsidePair = Object.assign(Object.assign({}, dataOutsidePair), { vx: outRight ? 'right' : 'left' });
|
|
57
|
-
el.dataset['outsideVx'] = dataOutsidePair.vx;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
delete el.dataset['outsideVx'];
|
|
61
|
-
}
|
|
62
|
-
return dataOutsidePair;
|
|
63
|
-
};
|
|
64
4
|
const handleFixedDropdown = (element, parent, placement) => {
|
|
65
5
|
if (!element || !parent)
|
|
66
6
|
return;
|
|
67
|
-
// We skip this if we are in mobile it's already fixed
|
|
68
|
-
if (getComputedStyle(element).zIndex === '9999')
|
|
69
|
-
return;
|
|
70
|
-
const { top, bottom, childHeight, childWidth, width, right, left, correctedPlacement } = getFloatingProps(element, parent, placement);
|
|
71
7
|
const fullWidth = element.dataset['width'] === 'full';
|
|
8
|
+
const autoWidth = element.dataset['width'] === 'auto';
|
|
9
|
+
// Reset width-specific inline styles first so a previous mode (e.g. "auto")
|
|
10
|
+
// doesn't leave a stale minInlineSize/inlineSize behind when the dropdown
|
|
11
|
+
// width changes at runtime. This must happen before getFloatingProps
|
|
12
|
+
// measures the element, otherwise the dropdown would be measured with a
|
|
13
|
+
// width it no longer has and positioned incorrectly. It also has to run
|
|
14
|
+
// before the mobile bailout below: otherwise a desktop minInlineSize would
|
|
15
|
+
// survive into the mobile sheet, where CSS min-inline-size beats the
|
|
16
|
+
// mobile max-inline-size guard and overflows the viewport.
|
|
17
|
+
element.style.inlineSize = '';
|
|
18
|
+
element.style.minInlineSize = '';
|
|
19
|
+
// We skip this if we are in mobile it's already fixed or if we don't have a floating dropdown
|
|
20
|
+
const computedStyle = getComputedStyle(element);
|
|
21
|
+
if (computedStyle.zIndex === '9999' || computedStyle.position !== 'fixed' && computedStyle.position !== 'absolute') {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const { top, bottom, childHeight, childWidth, width, right, left, correctedPlacement, innerWidth } = getFloatingProps(element, parent, placement);
|
|
25
|
+
// For auto width the dropdown is forced to be at least as wide as the trigger,
|
|
26
|
+
// but clamped to its own max-inline-size: CSS lets a min-inline-size override
|
|
27
|
+
// the max when the minimum is larger, so a trigger wider than the viewport
|
|
28
|
+
// limit would otherwise drop the side margins or overflow horizontally.
|
|
29
|
+
let autoMinWidth = width;
|
|
30
|
+
if (autoWidth) {
|
|
31
|
+
const maxInlineSize = parseFloat(getComputedStyle(element).maxInlineSize);
|
|
32
|
+
if (!isNaN(maxInlineSize) && maxInlineSize > 0) {
|
|
33
|
+
autoMinWidth = Math.min(width, maxInlineSize);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
72
36
|
if (fullWidth) {
|
|
73
37
|
element.style.inlineSize = `${width}px`;
|
|
74
38
|
}
|
|
75
|
-
if (
|
|
39
|
+
else if (autoWidth) {
|
|
40
|
+
element.style.minInlineSize = `${autoMinWidth}px`;
|
|
41
|
+
}
|
|
42
|
+
// getFloatingProps measured childWidth before the inline styles were
|
|
43
|
+
// (re)applied, so use the width the dropdown will actually have:
|
|
44
|
+
// - auto: the clamped minimum, so end-aligned dropdowns don't extend past
|
|
45
|
+
// the trigger's right edge.
|
|
46
|
+
// - full: the trigger width (the reset above drops it to content width).
|
|
47
|
+
let effectiveChildWidth = childWidth;
|
|
48
|
+
if (autoWidth) {
|
|
49
|
+
effectiveChildWidth = Math.max(childWidth, autoMinWidth);
|
|
50
|
+
}
|
|
51
|
+
else if (fullWidth) {
|
|
52
|
+
effectiveChildWidth = width;
|
|
53
|
+
}
|
|
54
|
+
// getFloatingProps detects horizontal overflow assuming a centered element
|
|
55
|
+
// (it halves childWidth). The dropdown is actually start-aligned (inset =
|
|
56
|
+
// left), so for the wider auto dropdown re-check overflow against its full
|
|
57
|
+
// width and flip to end-alignment when it would extend past the viewport.
|
|
58
|
+
let dropdownPlacement = correctedPlacement;
|
|
59
|
+
if (autoWidth && (dropdownPlacement === 'top' || dropdownPlacement === 'bottom' || dropdownPlacement === 'top-start' || dropdownPlacement === 'bottom-start') && left + effectiveChildWidth > innerWidth) {
|
|
60
|
+
dropdownPlacement = dropdownPlacement.startsWith('top') ? 'top-end' : 'bottom-end';
|
|
61
|
+
}
|
|
62
|
+
if (dropdownPlacement === 'top' || dropdownPlacement === 'bottom' || dropdownPlacement === 'top-start' || dropdownPlacement === 'bottom-start') {
|
|
76
63
|
element.style.insetInlineStart = `${left}px`;
|
|
77
64
|
}
|
|
78
|
-
else if (
|
|
79
|
-
element.style.insetInlineStart = `${right -
|
|
65
|
+
else if (dropdownPlacement === 'top-end' || dropdownPlacement === 'bottom-end') {
|
|
66
|
+
element.style.insetInlineStart = `${Math.max(right - effectiveChildWidth, 0)}px`;
|
|
80
67
|
}
|
|
81
|
-
if (
|
|
68
|
+
if (dropdownPlacement === null || dropdownPlacement === void 0 ? void 0 : dropdownPlacement.startsWith('top')) {
|
|
82
69
|
element.style.insetBlockStart = `${top - childHeight}px`;
|
|
83
70
|
}
|
|
84
|
-
else if (
|
|
71
|
+
else if (dropdownPlacement === null || dropdownPlacement === void 0 ? void 0 : dropdownPlacement.startsWith('bottom')) {
|
|
85
72
|
element.style.insetBlockStart = `${bottom}px`;
|
|
86
73
|
}
|
|
87
74
|
element.style.position = 'fixed';
|
|
@@ -108,27 +95,29 @@ const getFloatingProps = (element, parent, placement) => {
|
|
|
108
95
|
let childHeight = childRect.height;
|
|
109
96
|
let childWidth = childRect.width;
|
|
110
97
|
if (placement === 'bottom' || placement === 'top') {
|
|
111
|
-
childWidth = childWidth / 2;
|
|
98
|
+
childWidth = width > childWidth ? 0 : childWidth / 2;
|
|
112
99
|
}
|
|
113
100
|
if (placement === 'left' || placement === 'right') {
|
|
114
|
-
childHeight = childHeight / 2;
|
|
101
|
+
childHeight = height > childHeight ? 0 : childHeight / 2;
|
|
115
102
|
}
|
|
116
|
-
const outsideBottom = bottom + childHeight > innerHeight;
|
|
117
|
-
const outsideTop = top - childHeight < 0;
|
|
118
|
-
const outsideLeft = left - childWidth < 0;
|
|
119
|
-
const outsideRight = right + childWidth > innerWidth;
|
|
103
|
+
const outsideBottom = Math.floor(bottom + childHeight) > innerHeight;
|
|
104
|
+
const outsideTop = Math.ceil(top - childHeight) < 0;
|
|
105
|
+
const outsideLeft = Math.ceil(left - childWidth) < 0;
|
|
106
|
+
const outsideRight = Math.floor(right + childWidth) > innerWidth;
|
|
120
107
|
let correctedPlacement = placement;
|
|
121
108
|
if (placement.startsWith('bottom')) {
|
|
122
109
|
if (outsideBottom) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
110
|
+
if (!outsideTop) {
|
|
111
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('bottom', 'top');
|
|
112
|
+
if (outsideLeft && outsideRight) {
|
|
113
|
+
correctedPlacement = 'top';
|
|
114
|
+
}
|
|
115
|
+
else if (outsideLeft) {
|
|
116
|
+
correctedPlacement = 'top-start';
|
|
117
|
+
}
|
|
118
|
+
else if (outsideRight) {
|
|
119
|
+
correctedPlacement = 'top-end';
|
|
120
|
+
}
|
|
132
121
|
}
|
|
133
122
|
}
|
|
134
123
|
else {
|
|
@@ -145,15 +134,17 @@ const getFloatingProps = (element, parent, placement) => {
|
|
|
145
134
|
}
|
|
146
135
|
else if (placement.startsWith('top')) {
|
|
147
136
|
if (outsideTop) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
137
|
+
if (!outsideBottom) {
|
|
138
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('top', 'bottom');
|
|
139
|
+
if (outsideLeft && outsideRight) {
|
|
140
|
+
correctedPlacement = 'bottom';
|
|
141
|
+
}
|
|
142
|
+
else if (outsideLeft) {
|
|
143
|
+
correctedPlacement = 'bottom-start';
|
|
144
|
+
}
|
|
145
|
+
else if (outsideRight) {
|
|
146
|
+
correctedPlacement = 'bottom-end';
|
|
147
|
+
}
|
|
157
148
|
}
|
|
158
149
|
}
|
|
159
150
|
else {
|
|
@@ -170,15 +161,17 @@ const getFloatingProps = (element, parent, placement) => {
|
|
|
170
161
|
}
|
|
171
162
|
else if (placement.startsWith('left')) {
|
|
172
163
|
if (outsideLeft) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
164
|
+
if (!outsideRight) {
|
|
165
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('left', 'right');
|
|
166
|
+
if (outsideBottom && outsideTop) {
|
|
167
|
+
correctedPlacement = 'right';
|
|
168
|
+
}
|
|
169
|
+
else if (outsideBottom) {
|
|
170
|
+
correctedPlacement = 'right-end';
|
|
171
|
+
}
|
|
172
|
+
else if (outsideTop) {
|
|
173
|
+
correctedPlacement = 'right-start';
|
|
174
|
+
}
|
|
182
175
|
}
|
|
183
176
|
}
|
|
184
177
|
else {
|
|
@@ -195,15 +188,17 @@ const getFloatingProps = (element, parent, placement) => {
|
|
|
195
188
|
}
|
|
196
189
|
else if (correctedPlacement.startsWith('right')) {
|
|
197
190
|
if (outsideRight) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
191
|
+
if (!outsideLeft) {
|
|
192
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('right', 'left');
|
|
193
|
+
if (outsideBottom && outsideTop) {
|
|
194
|
+
correctedPlacement = 'left';
|
|
195
|
+
}
|
|
196
|
+
else if (outsideBottom) {
|
|
197
|
+
correctedPlacement = 'left-end';
|
|
198
|
+
}
|
|
199
|
+
else if (outsideTop) {
|
|
200
|
+
correctedPlacement = 'left-start';
|
|
201
|
+
}
|
|
207
202
|
}
|
|
208
203
|
}
|
|
209
204
|
else {
|
|
@@ -229,7 +224,8 @@ const getFloatingProps = (element, parent, placement) => {
|
|
|
229
224
|
childWidth: childRect.width,
|
|
230
225
|
correctedPlacement,
|
|
231
226
|
innerWidth,
|
|
232
|
-
innerHeight
|
|
227
|
+
innerHeight,
|
|
228
|
+
outsideYBoth: outsideTop && outsideBottom
|
|
233
229
|
};
|
|
234
230
|
};
|
|
235
231
|
const MAX_ANCESTOR_DEPTH = 10;
|
|
@@ -252,15 +248,24 @@ const getAncestorHasCorrectedPlacement = (element) => {
|
|
|
252
248
|
return null;
|
|
253
249
|
};
|
|
254
250
|
const handleFixedPopover = (element, parent, placement) => {
|
|
255
|
-
var _a, _b;
|
|
251
|
+
var _a, _b, _c;
|
|
256
252
|
if (!element || !parent)
|
|
257
253
|
return;
|
|
258
254
|
const parentComputedStyles = getComputedStyle(parent);
|
|
259
255
|
const parentHasFloatingPosition = ['absolute', 'fixed'].includes(parentComputedStyles.position);
|
|
260
256
|
const ancestorWithCorrectedPlacement = getAncestorHasCorrectedPlacement(element);
|
|
261
257
|
const noFloatingAncestor = !ancestorWithCorrectedPlacement && !parentHasFloatingPosition;
|
|
262
|
-
const
|
|
263
|
-
|
|
258
|
+
const computedStyle = getComputedStyle(element);
|
|
259
|
+
// We skip if we don't have a floating popover
|
|
260
|
+
if (computedStyle.position !== 'fixed' && computedStyle.position !== 'absolute') {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
let distance = computedStyle.getPropertyValue('--db-popover-distance');
|
|
264
|
+
if (!distance.length) {
|
|
265
|
+
distance = '0px';
|
|
266
|
+
}
|
|
267
|
+
const elementPlacement = (_c = (_b = (_a = element === null || element === void 0 ? void 0 : element.dataset) === null || _a === void 0 ? void 0 : _a['placement']) !== null && _b !== void 0 ? _b : placement) !== null && _c !== void 0 ? _c : 'bottom';
|
|
268
|
+
let { top, height, width, childHeight, childWidth, right, left, bottom, correctedPlacement, innerWidth, innerHeight, outsideYBoth } = getFloatingProps(element, parent, elementPlacement);
|
|
264
269
|
if (ancestorWithCorrectedPlacement) {
|
|
265
270
|
const ancestorRect = ancestorWithCorrectedPlacement.getBoundingClientRect();
|
|
266
271
|
left = Math.abs(left - ancestorRect.left);
|
|
@@ -356,8 +361,81 @@ const handleFixedPopover = (element, parent, placement) => {
|
|
|
356
361
|
element.style.insetBlockStart = `calc(${parentHasFloatingPosition ? end : bottom}px + ${distance})`;
|
|
357
362
|
element.style.insetBlockEnd = `calc(${noFloatingAncestor && end > innerHeight ? innerHeight : end}px + ${distance})`;
|
|
358
363
|
}
|
|
364
|
+
// In this case we are outside of top and bottom so we need to scroll
|
|
365
|
+
// We use the full height in this case
|
|
366
|
+
if (outsideYBoth) {
|
|
367
|
+
element.style.overflow = 'hidden auto';
|
|
368
|
+
element.style.insetBlock = distance;
|
|
369
|
+
element.style.maxBlockSize = `calc(${innerHeight}px - 2 * ${distance})`;
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
element.style.overflow = '';
|
|
373
|
+
element.style.maxBlockSize = '';
|
|
374
|
+
}
|
|
359
375
|
element.style.position = 'fixed';
|
|
360
376
|
element.dataset['correctedPlacement'] = correctedPlacement;
|
|
377
|
+
// Set data-outside-vy / data-outside-vx for CSS-based flipping
|
|
378
|
+
handleDataOutside(element);
|
|
379
|
+
};
|
|
380
|
+
const handleDataOutside = (el) => {
|
|
381
|
+
const { outTop, outBottom, outLeft, outRight } = isInView(el);
|
|
382
|
+
let dataOutsidePair = {};
|
|
383
|
+
if (outTop || outBottom) {
|
|
384
|
+
dataOutsidePair = {
|
|
385
|
+
vy: outTop ? 'top' : 'bottom'
|
|
386
|
+
};
|
|
387
|
+
el.dataset['outsideVy'] = dataOutsidePair.vy;
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
delete el.dataset['outsideVy'];
|
|
391
|
+
}
|
|
392
|
+
if (outLeft || outRight) {
|
|
393
|
+
dataOutsidePair = Object.assign(Object.assign({}, dataOutsidePair), { vx: outRight ? 'right' : 'left' });
|
|
394
|
+
el.dataset['outsideVx'] = dataOutsidePair.vx;
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
delete el.dataset['outsideVx'];
|
|
398
|
+
}
|
|
399
|
+
return dataOutsidePair;
|
|
400
|
+
};
|
|
401
|
+
const isInView = (el) => {
|
|
402
|
+
var _a;
|
|
403
|
+
const { top, bottom, left, right } = el.getBoundingClientRect();
|
|
404
|
+
const { innerHeight, innerWidth } = window;
|
|
405
|
+
let outTop = top < 0;
|
|
406
|
+
let outBottom = bottom > innerHeight;
|
|
407
|
+
let outLeft = left < 0;
|
|
408
|
+
let outRight = right > innerWidth;
|
|
409
|
+
// We need to check if it was already outside
|
|
410
|
+
const outsideY = el.dataset['outsideVy'];
|
|
411
|
+
const outsideX = el.dataset['outsideVx'];
|
|
412
|
+
const parentRect = (_a = el === null || el === void 0 ? void 0 : el.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
413
|
+
if (parentRect) {
|
|
414
|
+
if (outsideY) {
|
|
415
|
+
const position = el.dataset['outsideVy'];
|
|
416
|
+
if (position === 'top') {
|
|
417
|
+
outTop = parentRect.top - (bottom - parentRect.bottom) < 0;
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (outsideX) {
|
|
424
|
+
const position = el.dataset['outsideVx'];
|
|
425
|
+
if (position === 'left') {
|
|
426
|
+
outLeft = parentRect.left - (right - parentRect.right) < 0;
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
outRight = parentRect.right + (parentRect.left - left) > innerWidth;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return {
|
|
434
|
+
outTop,
|
|
435
|
+
outBottom,
|
|
436
|
+
outLeft,
|
|
437
|
+
outRight
|
|
438
|
+
};
|
|
361
439
|
};
|
|
362
440
|
|
|
363
441
|
exports.getFloatingProps = getFloatingProps;
|
|
@@ -62,6 +62,16 @@ const isIOSSafari = () => {
|
|
|
62
62
|
return isIOS && isSafari;
|
|
63
63
|
};
|
|
64
64
|
const delay = (fn, ms) => new Promise(() => setTimeout(fn, ms));
|
|
65
|
+
/**
|
|
66
|
+
* Checks whether a CSS custom property on an element equals '1'.
|
|
67
|
+
* Useful for detecting CSS-driven boolean state (e.g. responsive breakpoints)
|
|
68
|
+
* without coupling JS to hardcoded breakpoint values.
|
|
69
|
+
*
|
|
70
|
+
* @param element - The element to read computed styles from
|
|
71
|
+
* @param property - The CSS custom property name (e.g. '--db-my-flag')
|
|
72
|
+
* @returns `true` if the trimmed property value is '1'
|
|
73
|
+
*/
|
|
74
|
+
const hasCssFlag = (element, property) => typeof window !== 'undefined' && getComputedStyle(element).getPropertyValue(property).trim() === '1';
|
|
65
75
|
/**
|
|
66
76
|
* Converts boolean-like inputs to "true" or "false" strings.
|
|
67
77
|
* Handles HTML-style boolean attributes where an empty string or the
|
|
@@ -141,9 +151,37 @@ const stringPropVisible = (givenString, showString) => {
|
|
|
141
151
|
return toBool(showString) && Boolean(givenString);
|
|
142
152
|
};
|
|
143
153
|
const getSearchInput = (element) => element.querySelector(`input[type="search"]`);
|
|
154
|
+
// WeakMap to store generated keys for option objects without mutating them.
|
|
155
|
+
// Used only as a last resort for options that have neither id, value, nor label.
|
|
156
|
+
const optionKeyMap = new WeakMap();
|
|
144
157
|
const getOptionKey = (option, prefix) => {
|
|
145
|
-
var _a
|
|
146
|
-
|
|
158
|
+
var _a;
|
|
159
|
+
// 1. Consumer-provided id — stable and unique (best case).
|
|
160
|
+
if (option.id) {
|
|
161
|
+
return `${prefix}${option.id}`;
|
|
162
|
+
}
|
|
163
|
+
// 2. Data-based key from value and/or label — stable across object
|
|
164
|
+
// recreations (e.g. inline options={[...]} on every render).
|
|
165
|
+
// Combining both fields maximizes uniqueness: two options may share
|
|
166
|
+
// a value but users couldn't distinguish identical labels, so in
|
|
167
|
+
// practice the combination is unique.
|
|
168
|
+
// We prefix each segment with its length to avoid ambiguous
|
|
169
|
+
// concatenations (e.g. 'a-b'+'c' vs 'a'+'b-c').
|
|
170
|
+
const value = option.value !== undefined && option.value !== '' ? String(option.value) : '';
|
|
171
|
+
const label = (_a = option.label) !== null && _a !== void 0 ? _a : '';
|
|
172
|
+
if (value || label) {
|
|
173
|
+
return `${prefix}${value.length}:${value}.${label}`;
|
|
174
|
+
}
|
|
175
|
+
// 3. Last resort for truly anonymous options (no id, no value, no label).
|
|
176
|
+
// WeakMap ties a generated uuid to the object reference so the key
|
|
177
|
+
// persists as long as the same object is reused. If the consumer
|
|
178
|
+
// recreates these objects every render, keys will be unstable — but
|
|
179
|
+
// that's an unsolvable edge case without any data to anchor to.
|
|
180
|
+
let key = optionKeyMap.get(option);
|
|
181
|
+
if (!key) {
|
|
182
|
+
key = uuid();
|
|
183
|
+
optionKeyMap.set(option, key);
|
|
184
|
+
}
|
|
147
185
|
return `${prefix}${key}`;
|
|
148
186
|
};
|
|
149
187
|
const isKeyboardEvent = (event) => event.key !== undefined;
|
|
@@ -185,6 +223,7 @@ exports.getNumber = getNumber;
|
|
|
185
223
|
exports.getOptionKey = getOptionKey;
|
|
186
224
|
exports.getSearchInput = getSearchInput;
|
|
187
225
|
exports.getStep = getStep;
|
|
226
|
+
exports.hasCssFlag = hasCssFlag;
|
|
188
227
|
exports.hasVoiceOver = hasVoiceOver;
|
|
189
228
|
exports.isArrayOfStrings = isArrayOfStrings;
|
|
190
229
|
exports.isIOSSafari = isIOSSafari;
|