@quartzds/core 1.0.0-beta.12 → 1.0.0-beta.120
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 +1895 -0
- package/README.md +23 -23
- package/components/index.d.ts +50 -0
- package/components/index.js +62 -28
- package/components/index.js.map +1 -1
- package/components/p-5RFBIepu.js +112 -0
- package/components/p-5RFBIepu.js.map +1 -0
- package/components/p-B03FWheS.js +393 -0
- package/components/p-B03FWheS.js.map +1 -0
- package/components/p-BkBJDD6Y.js +274 -0
- package/components/p-BkBJDD6Y.js.map +1 -0
- package/components/p-BkgfW_tl.js +282 -0
- package/components/p-BkgfW_tl.js.map +1 -0
- package/components/p-Bnc7Puxx.js +164 -0
- package/components/p-Bnc7Puxx.js.map +1 -0
- package/components/{floating-ui.dom.esm.js → p-Bv2vPjgL.js} +557 -345
- package/components/p-Bv2vPjgL.js.map +1 -0
- package/components/p-CDRwHAIT.js +105 -0
- package/components/p-CDRwHAIT.js.map +1 -0
- package/components/p-CFVg7I9T.js +269 -0
- package/components/p-CFVg7I9T.js.map +1 -0
- package/components/p-CRVPDKfO.js +163 -0
- package/components/p-CRVPDKfO.js.map +1 -0
- package/components/p-CXP6q9Mr.js +286 -0
- package/components/p-CXP6q9Mr.js.map +1 -0
- package/components/p-CZRW1LV_.js +28 -0
- package/components/p-CZRW1LV_.js.map +1 -0
- package/components/p-D2489VzR.js +2133 -0
- package/components/p-D2489VzR.js.map +1 -0
- package/components/p-DeRqCYmp.js +102 -0
- package/components/p-DeRqCYmp.js.map +1 -0
- package/components/p-DnZdwX0l.js +149 -0
- package/components/p-DnZdwX0l.js.map +1 -0
- package/components/p-Dsc0-aXK.js +162 -0
- package/components/p-Dsc0-aXK.js.map +1 -0
- package/components/p-DwxIJEUj.js +91 -0
- package/components/p-DwxIJEUj.js.map +1 -0
- package/components/p-U2Q0vF-d.js +96 -0
- package/components/p-U2Q0vF-d.js.map +1 -0
- package/components/p-eFhV8w2l.js +428 -0
- package/components/p-eFhV8w2l.js.map +1 -0
- package/components/qds-action-item.d.ts +11 -0
- package/components/qds-action-item.js +183 -0
- package/components/qds-action-item.js.map +1 -0
- package/components/qds-avatar-media.d.ts +11 -0
- package/components/qds-avatar-media.js +14 -0
- package/components/qds-avatar-media.js.map +1 -0
- package/components/qds-badge-counter.d.ts +11 -0
- package/components/qds-badge-counter.js +14 -0
- package/components/qds-badge-counter.js.map +1 -0
- package/components/qds-badge-indicator.d.ts +11 -0
- package/components/qds-badge-indicator.js +14 -0
- package/components/qds-badge-indicator.js.map +1 -0
- package/components/qds-breadcrumb-item.d.ts +11 -0
- package/components/qds-breadcrumb-item.js +169 -0
- package/components/qds-breadcrumb-item.js.map +1 -0
- package/components/qds-button.d.ts +2 -2
- package/components/qds-button.js +457 -129
- package/components/qds-button.js.map +1 -1
- package/components/qds-checkbox.d.ts +2 -2
- package/components/qds-checkbox.js +4 -146
- package/components/qds-checkbox.js.map +1 -1
- package/components/qds-chip.d.ts +11 -0
- package/components/qds-chip.js +304 -0
- package/components/qds-chip.js.map +1 -0
- package/components/qds-dialog.d.ts +2 -2
- package/components/qds-dialog.js +179 -93
- package/components/qds-dialog.js.map +1 -1
- package/components/qds-divider.d.ts +2 -2
- package/components/qds-divider.js +4 -39
- package/components/qds-divider.js.map +1 -1
- package/components/qds-dropdown.d.ts +2 -2
- package/components/qds-dropdown.js +4 -249
- package/components/qds-dropdown.js.map +1 -1
- package/components/qds-form-message.d.ts +2 -2
- package/components/qds-form-message.js +100 -50
- package/components/qds-form-message.js.map +1 -1
- package/components/qds-icon-button.d.ts +11 -0
- package/components/qds-icon-button.js +14 -0
- package/components/qds-icon-button.js.map +1 -0
- package/components/qds-icon-tab.d.ts +11 -0
- package/components/qds-icon-tab.js +278 -0
- package/components/qds-icon-tab.js.map +1 -0
- package/components/qds-icon.d.ts +2 -2
- package/components/qds-icon.js +4 -3
- package/components/qds-inline-link.d.ts +2 -2
- package/components/qds-inline-link.js +171 -74
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.d.ts +2 -2
- package/components/qds-input.js +548 -230
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.d.ts +2 -2
- package/components/qds-label.js +4 -3
- package/components/qds-list-item.d.ts +11 -0
- package/components/qds-list-item.js +395 -0
- package/components/qds-list-item.js.map +1 -0
- package/components/qds-loader.d.ts +11 -0
- package/components/qds-loader.js +152 -0
- package/components/qds-loader.js.map +1 -0
- package/components/qds-menu-item.d.ts +11 -0
- package/components/qds-menu-item.js +204 -0
- package/components/qds-menu-item.js.map +1 -0
- package/components/qds-mini-button.d.ts +11 -0
- package/components/qds-mini-button.js +14 -0
- package/components/qds-mini-button.js.map +1 -0
- package/components/qds-progress-bar.d.ts +11 -0
- package/components/qds-progress-bar.js +155 -0
- package/components/qds-progress-bar.js.map +1 -0
- package/components/qds-radio.d.ts +2 -2
- package/components/qds-radio.js +4 -99
- package/components/qds-radio.js.map +1 -1
- package/components/qds-select.d.ts +11 -0
- package/components/qds-select.js +363 -0
- package/components/qds-select.js.map +1 -0
- package/components/qds-standalone-link.d.ts +11 -0
- package/components/qds-standalone-link.js +208 -0
- package/components/qds-standalone-link.js.map +1 -0
- package/components/qds-switch.d.ts +2 -2
- package/components/qds-switch.js +257 -105
- package/components/qds-switch.js.map +1 -1
- package/components/qds-tab.d.ts +11 -0
- package/components/qds-tab.js +339 -0
- package/components/qds-tab.js.map +1 -0
- package/components/qds-tabbar.d.ts +11 -0
- package/components/qds-tabbar.js +410 -0
- package/components/qds-tabbar.js.map +1 -0
- package/components/qds-table-cell.d.ts +11 -0
- package/components/qds-table-cell.js +81 -0
- package/components/qds-table-cell.js.map +1 -0
- package/components/qds-table-head-cell.d.ts +11 -0
- package/components/qds-table-head-cell.js +87 -0
- package/components/qds-table-head-cell.js.map +1 -0
- package/components/qds-table-row.d.ts +11 -0
- package/components/qds-table-row.js +48 -0
- package/components/qds-table-row.js.map +1 -0
- package/components/qds-table.d.ts +11 -0
- package/components/qds-table.js +48 -0
- package/components/qds-table.js.map +1 -0
- package/components/qds-tag.d.ts +11 -0
- package/components/qds-tag.js +14 -0
- package/components/qds-tag.js.map +1 -0
- package/components/qds-textarea.d.ts +2 -2
- package/components/qds-textarea.js +352 -193
- package/components/qds-textarea.js.map +1 -1
- package/components/qds-title.d.ts +2 -2
- package/components/qds-title.js +4 -84
- package/components/qds-title.js.map +1 -1
- package/components/qds-tooltip.d.ts +2 -2
- package/components/qds-tooltip.js +4 -315
- package/components/qds-tooltip.js.map +1 -1
- package/dist/cjs/app-globals-CLoao1by.js +13 -0
- package/dist/cjs/app-globals-CLoao1by.js.map +1 -0
- package/dist/cjs/controls-DKGeNyr5.js +32 -0
- package/dist/cjs/controls-DKGeNyr5.js.map +1 -0
- package/dist/cjs/{floating-ui.dom.esm-7f1cac3e.js → floating-ui.dom-Bvzubd50.js} +557 -345
- package/dist/cjs/floating-ui.dom-Bvzubd50.js.map +1 -0
- package/dist/cjs/helpers-BIL8yXqA.js +303 -0
- package/dist/cjs/helpers-BIL8yXqA.js.map +1 -0
- package/dist/cjs/index-DIY7gpXM.js +2376 -0
- package/dist/cjs/index-DIY7gpXM.js.map +1 -0
- package/dist/cjs/index.cjs.js +40 -31
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/library-CeKRI2f2.js +142 -0
- package/dist/cjs/library-CeKRI2f2.js.map +1 -0
- package/dist/cjs/loader.cjs.js +9 -10
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/qds-action-item.cjs.entry.js +145 -0
- package/dist/cjs/qds-action-item.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-avatar-media.qds-checkbox.qds-radio.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-avatar-media_3.cjs.entry.js +399 -0
- package/dist/cjs/qds-badge-counter.qds-badge-indicator.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js +146 -0
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +129 -0
- package/dist/cjs/qds-breadcrumb-item.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-button.cjs.entry.js +385 -93
- package/dist/cjs/qds-button.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-chip.cjs.entry.js +252 -0
- package/dist/cjs/qds-chip.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-dialog.cjs.entry.js +124 -77
- package/dist/cjs/qds-dialog.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-divider.qds-icon-button.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-divider_2.cjs.entry.js +280 -0
- package/dist/cjs/qds-dropdown.cjs.entry.js +373 -209
- package/dist/cjs/qds-dropdown.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-form-message.cjs.entry.js +70 -27
- package/dist/cjs/qds-form-message.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-icon-tab.cjs.entry.js +214 -0
- package/dist/cjs/qds-icon-tab.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-icon.cjs.entry.js +112 -93
- package/dist/cjs/qds-icon.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-inline-link.cjs.entry.js +137 -49
- package/dist/cjs/qds-inline-link.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-input.cjs.entry.js +473 -188
- package/dist/cjs/qds-input.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-label.cjs.entry.js +118 -27
- package/dist/cjs/qds-label.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-list-item.cjs.entry.js +290 -0
- package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-loader.cjs.entry.js +126 -0
- package/dist/cjs/qds-loader.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-menu-item.cjs.entry.js +158 -0
- package/dist/cjs/qds-menu-item.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-mini-button.cjs.entry.js +132 -0
- package/dist/cjs/qds-mini-button.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-progress-bar.cjs.entry.js +131 -0
- package/dist/cjs/qds-progress-bar.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-select.cjs.entry.js +319 -0
- package/dist/cjs/qds-select.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-standalone-link.cjs.entry.js +169 -0
- package/dist/cjs/qds-standalone-link.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-switch.cjs.entry.js +221 -67
- package/dist/cjs/qds-switch.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-tab.cjs.entry.js +265 -0
- package/dist/cjs/qds-tab.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-tabbar.cjs.entry.js +344 -0
- package/dist/cjs/qds-tabbar.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-table-cell.cjs.entry.js +61 -0
- package/dist/cjs/qds-table-cell.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +65 -0
- package/dist/cjs/qds-table-head-cell.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-table-row.cjs.entry.js +34 -0
- package/dist/cjs/qds-table-row.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-table.cjs.entry.js +34 -0
- package/dist/cjs/qds-table.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-tag.cjs.entry.js +110 -0
- package/dist/cjs/qds-tag.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-textarea.cjs.entry.js +303 -156
- package/dist/cjs/qds-textarea.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-title.cjs.entry.js +61 -52
- package/dist/cjs/qds-title.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-tooltip.cjs.entry.js +334 -263
- package/dist/cjs/qds-tooltip.entry.cjs.js.map +1 -0
- package/dist/cjs/qds.cjs.js +18 -17
- package/dist/cjs/qds.cjs.js.map +1 -1
- package/dist/custom-elements.json +12056 -2304
- package/dist/docs.d.ts +344 -240
- package/dist/docs.json +13125 -3360
- package/dist/esm/app-globals-WylVyaRG.js +11 -0
- package/dist/esm/app-globals-WylVyaRG.js.map +1 -0
- package/dist/esm/controls-CZRW1LV_.js +28 -0
- package/dist/esm/controls-CZRW1LV_.js.map +1 -0
- package/dist/esm/{floating-ui.dom.esm-c2f3e549.js → floating-ui.dom-Bv2vPjgL.js} +557 -345
- package/dist/esm/floating-ui.dom-Bv2vPjgL.js.map +1 -0
- package/dist/esm/helpers-BgaJNF9u.js +286 -0
- package/dist/esm/helpers-BgaJNF9u.js.map +1 -0
- package/dist/esm/index-Hg1Liloy.js +2364 -0
- package/dist/esm/index-Hg1Liloy.js.map +1 -0
- package/dist/esm/index.js +40 -30
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/library-CBfntPWH.js +138 -0
- package/dist/esm/library-CBfntPWH.js.map +1 -0
- package/dist/esm/loader.js +10 -9
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/qds-action-item.entry.js +143 -0
- package/dist/esm/qds-action-item.entry.js.map +1 -0
- package/dist/esm/qds-avatar-media.qds-checkbox.qds-radio.entry.js.map +1 -0
- package/dist/esm/qds-avatar-media_3.entry.js +395 -0
- package/dist/esm/qds-badge-counter.qds-badge-indicator.entry.js.map +1 -0
- package/dist/esm/qds-badge-counter_2.entry.js +143 -0
- package/dist/esm/qds-breadcrumb-item.entry.js +127 -0
- package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -0
- package/dist/esm/qds-button.entry.js +385 -91
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-chip.entry.js +250 -0
- package/dist/esm/qds-chip.entry.js.map +1 -0
- package/dist/esm/qds-dialog.entry.js +124 -75
- package/dist/esm/qds-dialog.entry.js.map +1 -1
- package/dist/esm/qds-divider.qds-icon-button.entry.js.map +1 -0
- package/dist/esm/qds-divider_2.entry.js +277 -0
- package/dist/esm/qds-dropdown.entry.js +373 -207
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-form-message.entry.js +70 -25
- package/dist/esm/qds-form-message.entry.js.map +1 -1
- package/dist/esm/qds-icon-tab.entry.js +212 -0
- package/dist/esm/qds-icon-tab.entry.js.map +1 -0
- package/dist/esm/qds-icon.entry.js +112 -91
- package/dist/esm/qds-icon.entry.js.map +1 -1
- package/dist/esm/qds-inline-link.entry.js +137 -47
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +473 -186
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +118 -25
- package/dist/esm/qds-label.entry.js.map +1 -1
- package/dist/esm/qds-list-item.entry.js +288 -0
- package/dist/esm/qds-list-item.entry.js.map +1 -0
- package/dist/esm/qds-loader.entry.js +124 -0
- package/dist/esm/qds-loader.entry.js.map +1 -0
- package/dist/esm/qds-menu-item.entry.js +156 -0
- package/dist/esm/qds-menu-item.entry.js.map +1 -0
- package/dist/esm/qds-mini-button.entry.js +130 -0
- package/dist/esm/qds-mini-button.entry.js.map +1 -0
- package/dist/esm/qds-progress-bar.entry.js +129 -0
- package/dist/esm/qds-progress-bar.entry.js.map +1 -0
- package/dist/esm/qds-select.entry.js +317 -0
- package/dist/esm/qds-select.entry.js.map +1 -0
- package/dist/esm/qds-standalone-link.entry.js +167 -0
- package/dist/esm/qds-standalone-link.entry.js.map +1 -0
- package/dist/esm/qds-switch.entry.js +221 -65
- package/dist/esm/qds-switch.entry.js.map +1 -1
- package/dist/esm/qds-tab.entry.js +263 -0
- package/dist/esm/qds-tab.entry.js.map +1 -0
- package/dist/esm/qds-tabbar.entry.js +342 -0
- package/dist/esm/qds-tabbar.entry.js.map +1 -0
- package/dist/esm/qds-table-cell.entry.js +59 -0
- package/dist/esm/qds-table-cell.entry.js.map +1 -0
- package/dist/esm/qds-table-head-cell.entry.js +63 -0
- package/dist/esm/qds-table-head-cell.entry.js.map +1 -0
- package/dist/esm/qds-table-row.entry.js +32 -0
- package/dist/esm/qds-table-row.entry.js.map +1 -0
- package/dist/esm/qds-table.entry.js +32 -0
- package/dist/esm/qds-table.entry.js.map +1 -0
- package/dist/esm/qds-tag.entry.js +108 -0
- package/dist/esm/qds-tag.entry.js.map +1 -0
- package/dist/esm/qds-textarea.entry.js +303 -154
- package/dist/esm/qds-textarea.entry.js.map +1 -1
- package/dist/esm/qds-title.entry.js +61 -50
- package/dist/esm/qds-title.entry.js.map +1 -1
- package/dist/esm/qds-tooltip.entry.js +334 -261
- package/dist/esm/qds-tooltip.entry.js.map +1 -1
- package/dist/esm/qds.js +18 -16
- package/dist/esm/qds.js.map +1 -1
- package/dist/types/components/action-item/action-item.d.ts +67 -0
- package/dist/types/components/avatar-media/avatar-media.d.ts +39 -0
- package/dist/types/components/badge-counter/badge-counter.d.ts +40 -0
- package/dist/types/components/badge-indicator/badge-indicator.d.ts +36 -0
- package/dist/types/components/breadcrumb-item/breadcrumb-item.d.ts +178 -0
- package/dist/types/components/button/button.d.ts +282 -198
- package/dist/types/components/checkbox/checkbox.d.ts +137 -124
- package/dist/types/components/chip/chip.d.ts +109 -0
- package/dist/types/components/controls.d.ts +4 -1
- package/dist/types/components/dialog/dialog.d.ts +32 -41
- package/dist/types/components/divider/divider.d.ts +14 -9
- package/dist/types/components/dropdown/dropdown.d.ts +116 -125
- package/dist/types/components/form-message/form-message.d.ts +33 -25
- package/dist/types/components/icon/icon.d.ts +24 -24
- package/dist/types/components/icon/library.d.ts +3 -3
- package/dist/types/components/icon/request.d.ts +5 -9
- package/dist/types/components/icon-button/icon-button.d.ts +121 -0
- package/dist/types/components/icon-tab/icon-tab.d.ts +110 -0
- package/dist/types/components/inline-link/inline-link.d.ts +209 -191
- package/dist/types/components/input/input.d.ts +431 -368
- package/dist/types/components/label/label.d.ts +37 -24
- package/dist/types/components/list-item/list-item.d.ts +121 -0
- package/dist/types/components/loader/loader.d.ts +32 -0
- package/dist/types/components/menu-item/menu-item.d.ts +71 -0
- package/dist/types/components/mini-button/mini-button.d.ts +82 -0
- package/dist/types/components/progress-bar/progress-bar.d.ts +60 -0
- package/dist/types/components/radio/radio.d.ts +90 -95
- package/dist/types/components/select/select.d.ts +203 -0
- package/dist/types/components/shared.d.ts +6 -0
- package/dist/types/components/standalone-link/standalone-link.d.ts +234 -0
- package/dist/types/components/switch/switch.d.ts +122 -107
- package/dist/types/components/tab/tab.d.ts +155 -0
- package/dist/types/components/tabbar/tabbar.d.ts +56 -0
- package/dist/types/components/table/table.d.ts +14 -0
- package/dist/types/components/table-cell/table-cell.d.ts +33 -0
- package/dist/types/components/table-head-cell/table-head-cell.d.ts +50 -0
- package/dist/types/components/table-row/table-row.d.ts +14 -0
- package/dist/types/components/tag/tag.d.ts +55 -0
- package/dist/types/components/textarea/textarea.d.ts +295 -300
- package/dist/types/components/title/title.d.ts +39 -32
- package/dist/types/components/tooltip/tooltip.d.ts +111 -136
- package/dist/types/components.d.ts +4403 -959
- package/dist/types/helpers.d.ts +38 -19
- package/dist/types/index.d.ts +2 -1
- package/dist/types/interface-overrides.d.ts +215 -0
- package/dist/types/qds-test.d.ts +22 -11
- package/dist/types/stencil-public-runtime.d.ts +109 -17
- package/dist/types/utils.d.ts +11 -4
- package/dist/vscode.html-custom-data.json +2365 -445
- package/hydrate/index.d.ts +73 -18
- package/hydrate/index.js +28020 -9256
- package/hydrate/index.mjs +28907 -0
- package/hydrate/package.json +7 -1
- package/loader/cdn.js +3 -4
- package/loader/index.cjs.js +3 -4
- package/loader/index.d.ts +4 -1
- package/loader/index.es2017.js +3 -4
- package/loader/index.js +3 -4
- package/package.json +23 -180
- package/styles/core.css +147 -19
- package/components/floating-ui.dom.esm.js.map +0 -1
- package/components/helpers.js +0 -175
- package/components/helpers.js.map +0 -1
- package/components/icon.js +0 -185
- package/components/icon.js.map +0 -1
- package/components/label.js +0 -55
- package/components/label.js.map +0 -1
- package/dist/cjs/floating-ui.dom.esm-7f1cac3e.js.map +0 -1
- package/dist/cjs/helpers-452256e8.js +0 -185
- package/dist/cjs/helpers-452256e8.js.map +0 -1
- package/dist/cjs/index-d181f952.js +0 -2039
- package/dist/cjs/index-d181f952.js.map +0 -1
- package/dist/cjs/library-ad8d9466.js +0 -72
- package/dist/cjs/library-ad8d9466.js.map +0 -1
- package/dist/cjs/qds-button.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-checkbox.cjs.entry.js +0 -116
- package/dist/cjs/qds-checkbox.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-dialog.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-divider.cjs.entry.js +0 -33
- package/dist/cjs/qds-divider.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-dropdown.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-form-message.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-input.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-label.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-radio.cjs.entry.js +0 -74
- package/dist/cjs/qds-radio.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-switch.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-textarea.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-title.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-tooltip.cjs.entry.js.map +0 -1
- package/dist/esm/floating-ui.dom.esm-c2f3e549.js.map +0 -1
- package/dist/esm/helpers-76b84f45.js +0 -175
- package/dist/esm/helpers-76b84f45.js.map +0 -1
- package/dist/esm/index-d7183092.js +0 -2009
- package/dist/esm/index-d7183092.js.map +0 -1
- package/dist/esm/library-f36d7d09.js +0 -68
- package/dist/esm/library-f36d7d09.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/qds-checkbox.entry.js +0 -112
- package/dist/esm/qds-checkbox.entry.js.map +0 -1
- package/dist/esm/qds-divider.entry.js +0 -29
- package/dist/esm/qds-divider.entry.js.map +0 -1
- package/dist/esm/qds-radio.entry.js +0 -70
- package/dist/esm/qds-radio.entry.js.map +0 -1
- package/dist/types/components/create-story.d.ts +0 -5
- package/loader/package.json +0 -11
|
@@ -1,22 +1,141 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: ©
|
|
2
|
+
* SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
3
|
*
|
|
4
|
-
* SPDX-License-Identifier:
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Custom positioning reference element.
|
|
8
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const min = Math.min;
|
|
12
|
+
const max = Math.max;
|
|
13
|
+
const round = Math.round;
|
|
14
|
+
const floor = Math.floor;
|
|
15
|
+
const createCoords = v => ({
|
|
16
|
+
x: v,
|
|
17
|
+
y: v
|
|
18
|
+
});
|
|
19
|
+
const oppositeSideMap = {
|
|
20
|
+
left: 'right',
|
|
21
|
+
right: 'left',
|
|
22
|
+
bottom: 'top',
|
|
23
|
+
top: 'bottom'
|
|
24
|
+
};
|
|
25
|
+
const oppositeAlignmentMap = {
|
|
26
|
+
start: 'end',
|
|
27
|
+
end: 'start'
|
|
28
|
+
};
|
|
29
|
+
function clamp(start, value, end) {
|
|
30
|
+
return max(start, min(value, end));
|
|
31
|
+
}
|
|
32
|
+
function evaluate(value, param) {
|
|
33
|
+
return typeof value === 'function' ? value(param) : value;
|
|
34
|
+
}
|
|
35
|
+
function getSide(placement) {
|
|
36
|
+
return placement.split('-')[0];
|
|
37
|
+
}
|
|
6
38
|
function getAlignment(placement) {
|
|
7
39
|
return placement.split('-')[1];
|
|
8
40
|
}
|
|
9
|
-
|
|
10
|
-
|
|
41
|
+
function getOppositeAxis(axis) {
|
|
42
|
+
return axis === 'x' ? 'y' : 'x';
|
|
43
|
+
}
|
|
44
|
+
function getAxisLength(axis) {
|
|
11
45
|
return axis === 'y' ? 'height' : 'width';
|
|
12
46
|
}
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
return
|
|
47
|
+
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
48
|
+
function getSideAxis(placement) {
|
|
49
|
+
return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
|
|
16
50
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
51
|
+
function getAlignmentAxis(placement) {
|
|
52
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
53
|
+
}
|
|
54
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
55
|
+
if (rtl === void 0) {
|
|
56
|
+
rtl = false;
|
|
57
|
+
}
|
|
58
|
+
const alignment = getAlignment(placement);
|
|
59
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
60
|
+
const length = getAxisLength(alignmentAxis);
|
|
61
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
62
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
63
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
64
|
+
}
|
|
65
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
66
|
+
}
|
|
67
|
+
function getExpandedPlacements(placement) {
|
|
68
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
69
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
70
|
+
}
|
|
71
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
72
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
73
|
+
}
|
|
74
|
+
const lrPlacement = ['left', 'right'];
|
|
75
|
+
const rlPlacement = ['right', 'left'];
|
|
76
|
+
const tbPlacement = ['top', 'bottom'];
|
|
77
|
+
const btPlacement = ['bottom', 'top'];
|
|
78
|
+
function getSideList(side, isStart, rtl) {
|
|
79
|
+
switch (side) {
|
|
80
|
+
case 'top':
|
|
81
|
+
case 'bottom':
|
|
82
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
83
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
84
|
+
case 'left':
|
|
85
|
+
case 'right':
|
|
86
|
+
return isStart ? tbPlacement : btPlacement;
|
|
87
|
+
default:
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
92
|
+
const alignment = getAlignment(placement);
|
|
93
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
94
|
+
if (alignment) {
|
|
95
|
+
list = list.map(side => side + "-" + alignment);
|
|
96
|
+
if (flipAlignment) {
|
|
97
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return list;
|
|
101
|
+
}
|
|
102
|
+
function getOppositePlacement(placement) {
|
|
103
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
104
|
+
}
|
|
105
|
+
function expandPaddingObject(padding) {
|
|
106
|
+
return {
|
|
107
|
+
top: 0,
|
|
108
|
+
right: 0,
|
|
109
|
+
bottom: 0,
|
|
110
|
+
left: 0,
|
|
111
|
+
...padding
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function getPaddingObject(padding) {
|
|
115
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
116
|
+
top: padding,
|
|
117
|
+
right: padding,
|
|
118
|
+
bottom: padding,
|
|
119
|
+
left: padding
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function rectToClientRect(rect) {
|
|
123
|
+
const {
|
|
124
|
+
x,
|
|
125
|
+
y,
|
|
126
|
+
width,
|
|
127
|
+
height
|
|
128
|
+
} = rect;
|
|
129
|
+
return {
|
|
130
|
+
width,
|
|
131
|
+
height,
|
|
132
|
+
top: y,
|
|
133
|
+
left: x,
|
|
134
|
+
right: x + width,
|
|
135
|
+
bottom: y + height,
|
|
136
|
+
x,
|
|
137
|
+
y
|
|
138
|
+
};
|
|
20
139
|
}
|
|
21
140
|
|
|
22
141
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
@@ -24,13 +143,14 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
24
143
|
reference,
|
|
25
144
|
floating
|
|
26
145
|
} = _ref;
|
|
146
|
+
const sideAxis = getSideAxis(placement);
|
|
147
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
148
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
149
|
+
const side = getSide(placement);
|
|
150
|
+
const isVertical = sideAxis === 'y';
|
|
27
151
|
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
28
152
|
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
29
|
-
const
|
|
30
|
-
const length = getLengthFromAxis(mainAxis);
|
|
31
|
-
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
|
32
|
-
const side = getSide(placement);
|
|
33
|
-
const isVertical = mainAxis === 'x';
|
|
153
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
34
154
|
let coords;
|
|
35
155
|
switch (side) {
|
|
36
156
|
case 'top':
|
|
@@ -65,10 +185,10 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
65
185
|
}
|
|
66
186
|
switch (getAlignment(placement)) {
|
|
67
187
|
case 'start':
|
|
68
|
-
coords[
|
|
188
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
69
189
|
break;
|
|
70
190
|
case 'end':
|
|
71
|
-
coords[
|
|
191
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
72
192
|
break;
|
|
73
193
|
}
|
|
74
194
|
return coords;
|
|
@@ -76,7 +196,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
76
196
|
|
|
77
197
|
/**
|
|
78
198
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
79
|
-
* next to a reference element
|
|
199
|
+
* next to a given reference element.
|
|
80
200
|
*
|
|
81
201
|
* This export does not have any `platform` interface logic. You will need to
|
|
82
202
|
* write one for the platform you are using Floating UI with.
|
|
@@ -154,7 +274,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
154
274
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
155
275
|
}
|
|
156
276
|
i = -1;
|
|
157
|
-
continue;
|
|
158
277
|
}
|
|
159
278
|
}
|
|
160
279
|
return {
|
|
@@ -166,39 +285,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
166
285
|
};
|
|
167
286
|
};
|
|
168
287
|
|
|
169
|
-
function evaluate(value, param) {
|
|
170
|
-
return typeof value === 'function' ? value(param) : value;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function expandPaddingObject(padding) {
|
|
174
|
-
return {
|
|
175
|
-
top: 0,
|
|
176
|
-
right: 0,
|
|
177
|
-
bottom: 0,
|
|
178
|
-
left: 0,
|
|
179
|
-
...padding
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function getSideObjectFromPadding(padding) {
|
|
184
|
-
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
185
|
-
top: padding,
|
|
186
|
-
right: padding,
|
|
187
|
-
bottom: padding,
|
|
188
|
-
left: padding
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function rectToClientRect(rect) {
|
|
193
|
-
return {
|
|
194
|
-
...rect,
|
|
195
|
-
top: rect.y,
|
|
196
|
-
left: rect.x,
|
|
197
|
-
right: rect.x + rect.width,
|
|
198
|
-
bottom: rect.y + rect.height
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
288
|
/**
|
|
203
289
|
* Resolves with an object of overflow side offsets that determine how much the
|
|
204
290
|
* element is overflowing a given clipping boundary on each side.
|
|
@@ -227,7 +313,7 @@ async function detectOverflow(state, options) {
|
|
|
227
313
|
altBoundary = false,
|
|
228
314
|
padding = 0
|
|
229
315
|
} = evaluate(options, state);
|
|
230
|
-
const paddingObject =
|
|
316
|
+
const paddingObject = getPaddingObject(padding);
|
|
231
317
|
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
232
318
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
233
319
|
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
@@ -237,9 +323,10 @@ async function detectOverflow(state, options) {
|
|
|
237
323
|
strategy
|
|
238
324
|
}));
|
|
239
325
|
const rect = elementContext === 'floating' ? {
|
|
240
|
-
...rects.floating,
|
|
241
326
|
x,
|
|
242
|
-
y
|
|
327
|
+
y,
|
|
328
|
+
width: rects.floating.width,
|
|
329
|
+
height: rects.floating.height
|
|
243
330
|
} : rects.reference;
|
|
244
331
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
245
332
|
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
@@ -250,6 +337,7 @@ async function detectOverflow(state, options) {
|
|
|
250
337
|
y: 1
|
|
251
338
|
};
|
|
252
339
|
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
340
|
+
elements,
|
|
253
341
|
rect,
|
|
254
342
|
offsetParent,
|
|
255
343
|
strategy
|
|
@@ -262,19 +350,12 @@ async function detectOverflow(state, options) {
|
|
|
262
350
|
};
|
|
263
351
|
}
|
|
264
352
|
|
|
265
|
-
const min$1 = Math.min;
|
|
266
|
-
const max$1 = Math.max;
|
|
267
|
-
|
|
268
|
-
function within(min$1$1, value, max$1$1) {
|
|
269
|
-
return max$1(min$1$1, min$1(value, max$1$1));
|
|
270
|
-
}
|
|
271
|
-
|
|
272
353
|
/**
|
|
273
354
|
* Provides data to position an inner element of the floating element so that it
|
|
274
355
|
* appears centered to the reference element.
|
|
275
356
|
* @see https://floating-ui.com/docs/arrow
|
|
276
357
|
*/
|
|
277
|
-
const arrow = options => ({
|
|
358
|
+
const arrow$1 = options => ({
|
|
278
359
|
name: 'arrow',
|
|
279
360
|
options,
|
|
280
361
|
async fn(state) {
|
|
@@ -284,7 +365,8 @@ const arrow = options => ({
|
|
|
284
365
|
placement,
|
|
285
366
|
rects,
|
|
286
367
|
platform,
|
|
287
|
-
elements
|
|
368
|
+
elements,
|
|
369
|
+
middlewareData
|
|
288
370
|
} = state;
|
|
289
371
|
// Since `element` is required, we don't Partial<> the type.
|
|
290
372
|
const {
|
|
@@ -294,13 +376,13 @@ const arrow = options => ({
|
|
|
294
376
|
if (element == null) {
|
|
295
377
|
return {};
|
|
296
378
|
}
|
|
297
|
-
const paddingObject =
|
|
379
|
+
const paddingObject = getPaddingObject(padding);
|
|
298
380
|
const coords = {
|
|
299
381
|
x,
|
|
300
382
|
y
|
|
301
383
|
};
|
|
302
|
-
const axis =
|
|
303
|
-
const length =
|
|
384
|
+
const axis = getAlignmentAxis(placement);
|
|
385
|
+
const length = getAxisLength(axis);
|
|
304
386
|
const arrowDimensions = await platform.getDimensions(element);
|
|
305
387
|
const isYAxis = axis === 'y';
|
|
306
388
|
const minProp = isYAxis ? 'top' : 'left';
|
|
@@ -320,108 +402,43 @@ const arrow = options => ({
|
|
|
320
402
|
// If the padding is large enough that it causes the arrow to no longer be
|
|
321
403
|
// centered, modify the padding so that it is centered.
|
|
322
404
|
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
323
|
-
const minPadding = min
|
|
324
|
-
const maxPadding = min
|
|
405
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
406
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
325
407
|
|
|
326
408
|
// Make sure the arrow doesn't overflow the floating element if the center
|
|
327
409
|
// point is outside the floating element's bounds.
|
|
328
|
-
const min$1
|
|
410
|
+
const min$1 = minPadding;
|
|
329
411
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
330
412
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
331
|
-
const offset =
|
|
413
|
+
const offset = clamp(min$1, center, max);
|
|
332
414
|
|
|
333
415
|
// If the reference is small enough that the arrow's padding causes it to
|
|
334
416
|
// to point to nothing for an aligned placement, adjust the offset of the
|
|
335
|
-
// floating element itself.
|
|
336
|
-
//
|
|
337
|
-
const shouldAddOffset = getAlignment(placement) != null && center
|
|
338
|
-
const alignmentOffset = shouldAddOffset ? center < min$1
|
|
417
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
418
|
+
// a single reset is performed when this is true.
|
|
419
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
420
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
339
421
|
return {
|
|
340
|
-
[axis]: coords[axis]
|
|
422
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
341
423
|
data: {
|
|
342
424
|
[axis]: offset,
|
|
343
|
-
centerOffset: center - offset
|
|
344
|
-
|
|
425
|
+
centerOffset: center - offset - alignmentOffset,
|
|
426
|
+
...(shouldAddOffset && {
|
|
427
|
+
alignmentOffset
|
|
428
|
+
})
|
|
429
|
+
},
|
|
430
|
+
reset: shouldAddOffset
|
|
345
431
|
};
|
|
346
432
|
}
|
|
347
433
|
});
|
|
348
434
|
|
|
349
|
-
const oppositeSideMap = {
|
|
350
|
-
left: 'right',
|
|
351
|
-
right: 'left',
|
|
352
|
-
bottom: 'top',
|
|
353
|
-
top: 'bottom'
|
|
354
|
-
};
|
|
355
|
-
function getOppositePlacement(placement) {
|
|
356
|
-
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
360
|
-
if (rtl === void 0) {
|
|
361
|
-
rtl = false;
|
|
362
|
-
}
|
|
363
|
-
const alignment = getAlignment(placement);
|
|
364
|
-
const mainAxis = getMainAxisFromPlacement(placement);
|
|
365
|
-
const length = getLengthFromAxis(mainAxis);
|
|
366
|
-
let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
367
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
368
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
369
|
-
}
|
|
370
|
-
return {
|
|
371
|
-
main: mainAlignmentSide,
|
|
372
|
-
cross: getOppositePlacement(mainAlignmentSide)
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
const oppositeAlignmentMap = {
|
|
377
|
-
start: 'end',
|
|
378
|
-
end: 'start'
|
|
379
|
-
};
|
|
380
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
381
|
-
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
function getExpandedPlacements(placement) {
|
|
385
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
386
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
function getSideList(side, isStart, rtl) {
|
|
390
|
-
const lr = ['left', 'right'];
|
|
391
|
-
const rl = ['right', 'left'];
|
|
392
|
-
const tb = ['top', 'bottom'];
|
|
393
|
-
const bt = ['bottom', 'top'];
|
|
394
|
-
switch (side) {
|
|
395
|
-
case 'top':
|
|
396
|
-
case 'bottom':
|
|
397
|
-
if (rtl) return isStart ? rl : lr;
|
|
398
|
-
return isStart ? lr : rl;
|
|
399
|
-
case 'left':
|
|
400
|
-
case 'right':
|
|
401
|
-
return isStart ? tb : bt;
|
|
402
|
-
default:
|
|
403
|
-
return [];
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
407
|
-
const alignment = getAlignment(placement);
|
|
408
|
-
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
409
|
-
if (alignment) {
|
|
410
|
-
list = list.map(side => side + "-" + alignment);
|
|
411
|
-
if (flipAlignment) {
|
|
412
|
-
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
return list;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
435
|
/**
|
|
419
436
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
420
437
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
421
438
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
422
439
|
* @see https://floating-ui.com/docs/flip
|
|
423
440
|
*/
|
|
424
|
-
const flip = function (options) {
|
|
441
|
+
const flip$1 = function (options) {
|
|
425
442
|
if (options === void 0) {
|
|
426
443
|
options = {};
|
|
427
444
|
}
|
|
@@ -429,7 +446,7 @@ const flip = function (options) {
|
|
|
429
446
|
name: 'flip',
|
|
430
447
|
options,
|
|
431
448
|
async fn(state) {
|
|
432
|
-
var _middlewareData$flip;
|
|
449
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
433
450
|
const {
|
|
434
451
|
placement,
|
|
435
452
|
middlewareData,
|
|
@@ -447,11 +464,21 @@ const flip = function (options) {
|
|
|
447
464
|
flipAlignment = true,
|
|
448
465
|
...detectOverflowOptions
|
|
449
466
|
} = evaluate(options, state);
|
|
467
|
+
|
|
468
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
469
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
470
|
+
// work.
|
|
471
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
472
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
473
|
+
return {};
|
|
474
|
+
}
|
|
450
475
|
const side = getSide(placement);
|
|
476
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
451
477
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
452
478
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
453
479
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
454
|
-
|
|
480
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
481
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
455
482
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
456
483
|
}
|
|
457
484
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
@@ -462,11 +489,8 @@ const flip = function (options) {
|
|
|
462
489
|
overflows.push(overflow[side]);
|
|
463
490
|
}
|
|
464
491
|
if (checkCrossAxis) {
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
cross
|
|
468
|
-
} = getAlignmentSides(placement, rects, rtl);
|
|
469
|
-
overflows.push(overflow[main], overflow[cross]);
|
|
492
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
493
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
470
494
|
}
|
|
471
495
|
overflowsData = [...overflowsData, {
|
|
472
496
|
placement,
|
|
@@ -479,16 +503,22 @@ const flip = function (options) {
|
|
|
479
503
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
480
504
|
const nextPlacement = placements[nextIndex];
|
|
481
505
|
if (nextPlacement) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
506
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
507
|
+
if (!ignoreCrossAxisOverflow ||
|
|
508
|
+
// We leave the current main axis only if every placement on that axis
|
|
509
|
+
// overflows the main axis.
|
|
510
|
+
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
511
|
+
// Try next placement and re-run the lifecycle.
|
|
512
|
+
return {
|
|
513
|
+
data: {
|
|
514
|
+
index: nextIndex,
|
|
515
|
+
overflows: overflowsData
|
|
516
|
+
},
|
|
517
|
+
reset: {
|
|
518
|
+
placement: nextPlacement
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
492
522
|
}
|
|
493
523
|
|
|
494
524
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
@@ -500,8 +530,17 @@ const flip = function (options) {
|
|
|
500
530
|
switch (fallbackStrategy) {
|
|
501
531
|
case 'bestFit':
|
|
502
532
|
{
|
|
503
|
-
var _overflowsData$
|
|
504
|
-
const placement = (_overflowsData$
|
|
533
|
+
var _overflowsData$filter2;
|
|
534
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
535
|
+
if (hasFallbackAxisSideDirection) {
|
|
536
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
537
|
+
return currentSideAxis === initialSideAxis ||
|
|
538
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
539
|
+
// reading directions favoring greater width.
|
|
540
|
+
currentSideAxis === 'y';
|
|
541
|
+
}
|
|
542
|
+
return true;
|
|
543
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
505
544
|
if (placement) {
|
|
506
545
|
resetPlacement = placement;
|
|
507
546
|
}
|
|
@@ -525,6 +564,11 @@ const flip = function (options) {
|
|
|
525
564
|
};
|
|
526
565
|
};
|
|
527
566
|
|
|
567
|
+
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
568
|
+
|
|
569
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
570
|
+
// Derivable.
|
|
571
|
+
|
|
528
572
|
async function convertValueToCoords(state, options) {
|
|
529
573
|
const {
|
|
530
574
|
placement,
|
|
@@ -534,8 +578,8 @@ async function convertValueToCoords(state, options) {
|
|
|
534
578
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
535
579
|
const side = getSide(placement);
|
|
536
580
|
const alignment = getAlignment(placement);
|
|
537
|
-
const isVertical =
|
|
538
|
-
const mainAxisMulti =
|
|
581
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
582
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
539
583
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
540
584
|
const rawValue = evaluate(options, state);
|
|
541
585
|
|
|
@@ -549,10 +593,9 @@ async function convertValueToCoords(state, options) {
|
|
|
549
593
|
crossAxis: 0,
|
|
550
594
|
alignmentAxis: null
|
|
551
595
|
} : {
|
|
552
|
-
mainAxis: 0,
|
|
553
|
-
crossAxis: 0,
|
|
554
|
-
alignmentAxis:
|
|
555
|
-
...rawValue
|
|
596
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
597
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
598
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
556
599
|
};
|
|
557
600
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
558
601
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -573,7 +616,7 @@ async function convertValueToCoords(state, options) {
|
|
|
573
616
|
* object may be passed.
|
|
574
617
|
* @see https://floating-ui.com/docs/offset
|
|
575
618
|
*/
|
|
576
|
-
const offset = function (options) {
|
|
619
|
+
const offset$1 = function (options) {
|
|
577
620
|
if (options === void 0) {
|
|
578
621
|
options = 0;
|
|
579
622
|
}
|
|
@@ -581,30 +624,38 @@ const offset = function (options) {
|
|
|
581
624
|
name: 'offset',
|
|
582
625
|
options,
|
|
583
626
|
async fn(state) {
|
|
627
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
584
628
|
const {
|
|
585
629
|
x,
|
|
586
|
-
y
|
|
630
|
+
y,
|
|
631
|
+
placement,
|
|
632
|
+
middlewareData
|
|
587
633
|
} = state;
|
|
588
634
|
const diffCoords = await convertValueToCoords(state, options);
|
|
635
|
+
|
|
636
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
637
|
+
// then we don't need to change the positioning coordinates.
|
|
638
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
639
|
+
return {};
|
|
640
|
+
}
|
|
589
641
|
return {
|
|
590
642
|
x: x + diffCoords.x,
|
|
591
643
|
y: y + diffCoords.y,
|
|
592
|
-
data:
|
|
644
|
+
data: {
|
|
645
|
+
...diffCoords,
|
|
646
|
+
placement
|
|
647
|
+
}
|
|
593
648
|
};
|
|
594
649
|
}
|
|
595
650
|
};
|
|
596
651
|
};
|
|
597
652
|
|
|
598
|
-
function getCrossAxis(axis) {
|
|
599
|
-
return axis === 'x' ? 'y' : 'x';
|
|
600
|
-
}
|
|
601
|
-
|
|
602
653
|
/**
|
|
603
654
|
* Optimizes the visibility of the floating element by shifting it in order to
|
|
604
655
|
* keep it in view when it will overflow the clipping boundary.
|
|
605
656
|
* @see https://floating-ui.com/docs/shift
|
|
606
657
|
*/
|
|
607
|
-
const shift = function (options) {
|
|
658
|
+
const shift$1 = function (options) {
|
|
608
659
|
if (options === void 0) {
|
|
609
660
|
options = {};
|
|
610
661
|
}
|
|
@@ -639,8 +690,8 @@ const shift = function (options) {
|
|
|
639
690
|
y
|
|
640
691
|
};
|
|
641
692
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
642
|
-
const
|
|
643
|
-
const
|
|
693
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
694
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
644
695
|
let mainAxisCoord = coords[mainAxis];
|
|
645
696
|
let crossAxisCoord = coords[crossAxis];
|
|
646
697
|
if (checkMainAxis) {
|
|
@@ -648,14 +699,14 @@ const shift = function (options) {
|
|
|
648
699
|
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
649
700
|
const min = mainAxisCoord + overflow[minSide];
|
|
650
701
|
const max = mainAxisCoord - overflow[maxSide];
|
|
651
|
-
mainAxisCoord =
|
|
702
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
652
703
|
}
|
|
653
704
|
if (checkCrossAxis) {
|
|
654
705
|
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
655
706
|
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
656
707
|
const min = crossAxisCoord + overflow[minSide];
|
|
657
708
|
const max = crossAxisCoord - overflow[maxSide];
|
|
658
|
-
crossAxisCoord =
|
|
709
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
659
710
|
}
|
|
660
711
|
const limitedCoords = limiter.fn({
|
|
661
712
|
...state,
|
|
@@ -666,7 +717,11 @@ const shift = function (options) {
|
|
|
666
717
|
...limitedCoords,
|
|
667
718
|
data: {
|
|
668
719
|
x: limitedCoords.x - x,
|
|
669
|
-
y: limitedCoords.y - y
|
|
720
|
+
y: limitedCoords.y - y,
|
|
721
|
+
enabled: {
|
|
722
|
+
[mainAxis]: checkMainAxis,
|
|
723
|
+
[crossAxis]: checkCrossAxis
|
|
724
|
+
}
|
|
670
725
|
}
|
|
671
726
|
};
|
|
672
727
|
}
|
|
@@ -675,7 +730,7 @@ const shift = function (options) {
|
|
|
675
730
|
/**
|
|
676
731
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
677
732
|
*/
|
|
678
|
-
const limitShift = function (options) {
|
|
733
|
+
const limitShift$1 = function (options) {
|
|
679
734
|
if (options === void 0) {
|
|
680
735
|
options = {};
|
|
681
736
|
}
|
|
@@ -698,8 +753,8 @@ const limitShift = function (options) {
|
|
|
698
753
|
x,
|
|
699
754
|
y
|
|
700
755
|
};
|
|
701
|
-
const
|
|
702
|
-
const
|
|
756
|
+
const crossAxis = getSideAxis(placement);
|
|
757
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
703
758
|
let mainAxisCoord = coords[mainAxis];
|
|
704
759
|
let crossAxisCoord = coords[crossAxis];
|
|
705
760
|
const rawOffset = evaluate(offset, state);
|
|
@@ -724,7 +779,7 @@ const limitShift = function (options) {
|
|
|
724
779
|
if (checkCrossAxis) {
|
|
725
780
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
726
781
|
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
727
|
-
const isOriginSide =
|
|
782
|
+
const isOriginSide = originSides.has(getSide(placement));
|
|
728
783
|
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
729
784
|
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
730
785
|
if (crossAxisCoord < limitMin) {
|
|
@@ -741,17 +796,8 @@ const limitShift = function (options) {
|
|
|
741
796
|
};
|
|
742
797
|
};
|
|
743
798
|
|
|
744
|
-
function
|
|
745
|
-
|
|
746
|
-
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
function getComputedStyle$1(element) {
|
|
750
|
-
return getWindow(element).getComputedStyle(element);
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
function isNode(value) {
|
|
754
|
-
return value instanceof getWindow(value).Node;
|
|
799
|
+
function hasWindow() {
|
|
800
|
+
return typeof window !== 'undefined';
|
|
755
801
|
}
|
|
756
802
|
function getNodeName(node) {
|
|
757
803
|
if (isNode(node)) {
|
|
@@ -762,17 +808,39 @@ function getNodeName(node) {
|
|
|
762
808
|
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
763
809
|
return '#document';
|
|
764
810
|
}
|
|
765
|
-
|
|
811
|
+
function getWindow(node) {
|
|
812
|
+
var _node$ownerDocument;
|
|
813
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
814
|
+
}
|
|
815
|
+
function getDocumentElement(node) {
|
|
816
|
+
var _ref;
|
|
817
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
818
|
+
}
|
|
819
|
+
function isNode(value) {
|
|
820
|
+
if (!hasWindow()) {
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
824
|
+
}
|
|
825
|
+
function isElement(value) {
|
|
826
|
+
if (!hasWindow()) {
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
829
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
830
|
+
}
|
|
766
831
|
function isHTMLElement(value) {
|
|
832
|
+
if (!hasWindow()) {
|
|
833
|
+
return false;
|
|
834
|
+
}
|
|
767
835
|
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
768
836
|
}
|
|
769
|
-
function isShadowRoot(
|
|
770
|
-
|
|
771
|
-
if (typeof ShadowRoot === 'undefined') {
|
|
837
|
+
function isShadowRoot(value) {
|
|
838
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
772
839
|
return false;
|
|
773
840
|
}
|
|
774
|
-
return
|
|
841
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
775
842
|
}
|
|
843
|
+
const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
|
|
776
844
|
function isOverflowElement(element) {
|
|
777
845
|
const {
|
|
778
846
|
overflow,
|
|
@@ -780,34 +848,113 @@ function isOverflowElement(element) {
|
|
|
780
848
|
overflowY,
|
|
781
849
|
display
|
|
782
850
|
} = getComputedStyle$1(element);
|
|
783
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !
|
|
851
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
784
852
|
}
|
|
853
|
+
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
785
854
|
function isTableElement(element) {
|
|
786
|
-
return
|
|
855
|
+
return tableElements.has(getNodeName(element));
|
|
787
856
|
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
857
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
858
|
+
function isTopLayer(element) {
|
|
859
|
+
return topLayerSelectors.some(selector => {
|
|
860
|
+
try {
|
|
861
|
+
return element.matches(selector);
|
|
862
|
+
} catch (_e) {
|
|
863
|
+
return false;
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
868
|
+
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
869
|
+
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
870
|
+
function isContainingBlock(elementOrCss) {
|
|
871
|
+
const webkit = isWebKit();
|
|
872
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
791
873
|
|
|
792
874
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
793
|
-
|
|
875
|
+
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
876
|
+
return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
|
|
794
877
|
}
|
|
795
|
-
function
|
|
878
|
+
function getContainingBlock(element) {
|
|
879
|
+
let currentNode = getParentNode(element);
|
|
880
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
881
|
+
if (isContainingBlock(currentNode)) {
|
|
882
|
+
return currentNode;
|
|
883
|
+
} else if (isTopLayer(currentNode)) {
|
|
884
|
+
return null;
|
|
885
|
+
}
|
|
886
|
+
currentNode = getParentNode(currentNode);
|
|
887
|
+
}
|
|
888
|
+
return null;
|
|
889
|
+
}
|
|
890
|
+
function isWebKit() {
|
|
796
891
|
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
797
892
|
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
798
893
|
}
|
|
894
|
+
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
799
895
|
function isLastTraversableNode(node) {
|
|
800
|
-
return
|
|
896
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
897
|
+
}
|
|
898
|
+
function getComputedStyle$1(element) {
|
|
899
|
+
return getWindow(element).getComputedStyle(element);
|
|
900
|
+
}
|
|
901
|
+
function getNodeScroll(element) {
|
|
902
|
+
if (isElement(element)) {
|
|
903
|
+
return {
|
|
904
|
+
scrollLeft: element.scrollLeft,
|
|
905
|
+
scrollTop: element.scrollTop
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
return {
|
|
909
|
+
scrollLeft: element.scrollX,
|
|
910
|
+
scrollTop: element.scrollY
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
function getParentNode(node) {
|
|
914
|
+
if (getNodeName(node) === 'html') {
|
|
915
|
+
return node;
|
|
916
|
+
}
|
|
917
|
+
const result =
|
|
918
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
919
|
+
node.assignedSlot ||
|
|
920
|
+
// DOM Element detected.
|
|
921
|
+
node.parentNode ||
|
|
922
|
+
// ShadowRoot detected.
|
|
923
|
+
isShadowRoot(node) && node.host ||
|
|
924
|
+
// Fallback.
|
|
925
|
+
getDocumentElement(node);
|
|
926
|
+
return isShadowRoot(result) ? result.host : result;
|
|
927
|
+
}
|
|
928
|
+
function getNearestOverflowAncestor(node) {
|
|
929
|
+
const parentNode = getParentNode(node);
|
|
930
|
+
if (isLastTraversableNode(parentNode)) {
|
|
931
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
932
|
+
}
|
|
933
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
934
|
+
return parentNode;
|
|
935
|
+
}
|
|
936
|
+
return getNearestOverflowAncestor(parentNode);
|
|
937
|
+
}
|
|
938
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
939
|
+
var _node$ownerDocument2;
|
|
940
|
+
if (list === void 0) {
|
|
941
|
+
list = [];
|
|
942
|
+
}
|
|
943
|
+
if (traverseIframes === void 0) {
|
|
944
|
+
traverseIframes = true;
|
|
945
|
+
}
|
|
946
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
947
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
948
|
+
const win = getWindow(scrollableAncestor);
|
|
949
|
+
if (isBody) {
|
|
950
|
+
const frameElement = getFrameElement(win);
|
|
951
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
952
|
+
}
|
|
953
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
954
|
+
}
|
|
955
|
+
function getFrameElement(win) {
|
|
956
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
801
957
|
}
|
|
802
|
-
|
|
803
|
-
const min = Math.min;
|
|
804
|
-
const max = Math.max;
|
|
805
|
-
const round = Math.round;
|
|
806
|
-
const floor = Math.floor;
|
|
807
|
-
const createCoords = v => ({
|
|
808
|
-
x: v,
|
|
809
|
-
y: v
|
|
810
|
-
});
|
|
811
958
|
|
|
812
959
|
function getCssDimensions(element) {
|
|
813
960
|
const css = getComputedStyle$1(element);
|
|
@@ -830,10 +977,6 @@ function getCssDimensions(element) {
|
|
|
830
977
|
};
|
|
831
978
|
}
|
|
832
979
|
|
|
833
|
-
function isElement(value) {
|
|
834
|
-
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
980
|
function unwrapElement(element) {
|
|
838
981
|
return !isElement(element) ? element.contextElement : element;
|
|
839
982
|
}
|
|
@@ -869,7 +1012,7 @@ function getScale(element) {
|
|
|
869
1012
|
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
870
1013
|
function getVisualOffsets(element) {
|
|
871
1014
|
const win = getWindow(element);
|
|
872
|
-
if (!
|
|
1015
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
873
1016
|
return noOffsets;
|
|
874
1017
|
}
|
|
875
1018
|
return {
|
|
@@ -914,11 +1057,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
914
1057
|
if (domElement) {
|
|
915
1058
|
const win = getWindow(domElement);
|
|
916
1059
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
917
|
-
let
|
|
918
|
-
|
|
1060
|
+
let currentWin = win;
|
|
1061
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
1062
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
919
1063
|
const iframeScale = getScale(currentIFrame);
|
|
920
1064
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
921
|
-
const css = getComputedStyle(currentIFrame);
|
|
1065
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
922
1066
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
923
1067
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
924
1068
|
x *= iframeScale.x;
|
|
@@ -927,7 +1071,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
927
1071
|
height *= iframeScale.y;
|
|
928
1072
|
x += left;
|
|
929
1073
|
y += top;
|
|
930
|
-
|
|
1074
|
+
currentWin = getWindow(currentIFrame);
|
|
1075
|
+
currentIFrame = getFrameElement(currentWin);
|
|
931
1076
|
}
|
|
932
1077
|
}
|
|
933
1078
|
return rectToClientRect({
|
|
@@ -938,33 +1083,37 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
938
1083
|
});
|
|
939
1084
|
}
|
|
940
1085
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1086
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1087
|
+
// incorrect for RTL.
|
|
1088
|
+
function getWindowScrollBarX(element, rect) {
|
|
1089
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1090
|
+
if (!rect) {
|
|
1091
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
947
1092
|
}
|
|
948
|
-
return
|
|
949
|
-
scrollLeft: element.pageXOffset,
|
|
950
|
-
scrollTop: element.pageYOffset
|
|
951
|
-
};
|
|
1093
|
+
return rect.left + leftScroll;
|
|
952
1094
|
}
|
|
953
1095
|
|
|
954
|
-
function
|
|
955
|
-
|
|
956
|
-
|
|
1096
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
1097
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
1098
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
1099
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
1100
|
+
return {
|
|
1101
|
+
x,
|
|
1102
|
+
y
|
|
1103
|
+
};
|
|
957
1104
|
}
|
|
958
1105
|
|
|
959
1106
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
960
1107
|
let {
|
|
1108
|
+
elements,
|
|
961
1109
|
rect,
|
|
962
1110
|
offsetParent,
|
|
963
1111
|
strategy
|
|
964
1112
|
} = _ref;
|
|
965
|
-
const
|
|
1113
|
+
const isFixed = strategy === 'fixed';
|
|
966
1114
|
const documentElement = getDocumentElement(offsetParent);
|
|
967
|
-
|
|
1115
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1116
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
968
1117
|
return rect;
|
|
969
1118
|
}
|
|
970
1119
|
let scroll = {
|
|
@@ -973,7 +1122,8 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
973
1122
|
};
|
|
974
1123
|
let scale = createCoords(1);
|
|
975
1124
|
const offsets = createCoords(0);
|
|
976
|
-
|
|
1125
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1126
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
977
1127
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
978
1128
|
scroll = getNodeScroll(offsetParent);
|
|
979
1129
|
}
|
|
@@ -984,11 +1134,12 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
984
1134
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
985
1135
|
}
|
|
986
1136
|
}
|
|
1137
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
987
1138
|
return {
|
|
988
1139
|
width: rect.width * scale.x,
|
|
989
1140
|
height: rect.height * scale.y,
|
|
990
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
991
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1141
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1142
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
992
1143
|
};
|
|
993
1144
|
}
|
|
994
1145
|
|
|
@@ -996,12 +1147,6 @@ function getClientRects(element) {
|
|
|
996
1147
|
return Array.from(element.getClientRects());
|
|
997
1148
|
}
|
|
998
1149
|
|
|
999
|
-
function getWindowScrollBarX(element) {
|
|
1000
|
-
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1001
|
-
// incorrect for RTL.
|
|
1002
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
1150
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
1006
1151
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1007
1152
|
function getDocumentRect(element) {
|
|
@@ -1023,47 +1168,10 @@ function getDocumentRect(element) {
|
|
|
1023
1168
|
};
|
|
1024
1169
|
}
|
|
1025
1170
|
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
const result =
|
|
1031
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
1032
|
-
node.assignedSlot ||
|
|
1033
|
-
// DOM Element detected.
|
|
1034
|
-
node.parentNode ||
|
|
1035
|
-
// ShadowRoot detected.
|
|
1036
|
-
isShadowRoot(node) && node.host ||
|
|
1037
|
-
// Fallback.
|
|
1038
|
-
getDocumentElement(node);
|
|
1039
|
-
return isShadowRoot(result) ? result.host : result;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
function getNearestOverflowAncestor(node) {
|
|
1043
|
-
const parentNode = getParentNode(node);
|
|
1044
|
-
if (isLastTraversableNode(parentNode)) {
|
|
1045
|
-
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
1046
|
-
}
|
|
1047
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1048
|
-
return parentNode;
|
|
1049
|
-
}
|
|
1050
|
-
return getNearestOverflowAncestor(parentNode);
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
function getOverflowAncestors(node, list) {
|
|
1054
|
-
var _node$ownerDocument;
|
|
1055
|
-
if (list === void 0) {
|
|
1056
|
-
list = [];
|
|
1057
|
-
}
|
|
1058
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1059
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
1060
|
-
const win = getWindow(scrollableAncestor);
|
|
1061
|
-
if (isBody) {
|
|
1062
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
|
|
1063
|
-
}
|
|
1064
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1171
|
+
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
1172
|
+
// calculation is affected by unusual styles.
|
|
1173
|
+
// Most scrollbars leave 15-18px of space.
|
|
1174
|
+
const SCROLLBAR_MAX = 25;
|
|
1067
1175
|
function getViewportRect(element, strategy) {
|
|
1068
1176
|
const win = getWindow(element);
|
|
1069
1177
|
const html = getDocumentElement(element);
|
|
@@ -1075,12 +1183,30 @@ function getViewportRect(element, strategy) {
|
|
|
1075
1183
|
if (visualViewport) {
|
|
1076
1184
|
width = visualViewport.width;
|
|
1077
1185
|
height = visualViewport.height;
|
|
1078
|
-
const visualViewportBased =
|
|
1186
|
+
const visualViewportBased = isWebKit();
|
|
1079
1187
|
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1080
1188
|
x = visualViewport.offsetLeft;
|
|
1081
1189
|
y = visualViewport.offsetTop;
|
|
1082
1190
|
}
|
|
1083
1191
|
}
|
|
1192
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1193
|
+
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
1194
|
+
// visual width of the <html> but this is not considered in the size
|
|
1195
|
+
// of `html.clientWidth`.
|
|
1196
|
+
if (windowScrollbarX <= 0) {
|
|
1197
|
+
const doc = html.ownerDocument;
|
|
1198
|
+
const body = doc.body;
|
|
1199
|
+
const bodyStyles = getComputedStyle(body);
|
|
1200
|
+
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1201
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1202
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
1203
|
+
width -= clippingStableScrollbarWidth;
|
|
1204
|
+
}
|
|
1205
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1206
|
+
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1207
|
+
// by the scrollbar amount so there isn't extra space on the right.
|
|
1208
|
+
width += windowScrollbarX;
|
|
1209
|
+
}
|
|
1084
1210
|
return {
|
|
1085
1211
|
width,
|
|
1086
1212
|
height,
|
|
@@ -1089,6 +1215,7 @@ function getViewportRect(element, strategy) {
|
|
|
1089
1215
|
};
|
|
1090
1216
|
}
|
|
1091
1217
|
|
|
1218
|
+
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
1092
1219
|
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1093
1220
|
function getInnerBoundingClientRect(element, strategy) {
|
|
1094
1221
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
@@ -1117,9 +1244,10 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1117
1244
|
} else {
|
|
1118
1245
|
const visualOffsets = getVisualOffsets(element);
|
|
1119
1246
|
rect = {
|
|
1120
|
-
...clippingAncestor,
|
|
1121
1247
|
x: clippingAncestor.x - visualOffsets.x,
|
|
1122
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
1248
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1249
|
+
width: clippingAncestor.width,
|
|
1250
|
+
height: clippingAncestor.height
|
|
1123
1251
|
};
|
|
1124
1252
|
}
|
|
1125
1253
|
return rectToClientRect(rect);
|
|
@@ -1140,7 +1268,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1140
1268
|
if (cachedResult) {
|
|
1141
1269
|
return cachedResult;
|
|
1142
1270
|
}
|
|
1143
|
-
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1271
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1144
1272
|
let currentContainingBlockComputedStyle = null;
|
|
1145
1273
|
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1146
1274
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
@@ -1152,7 +1280,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1152
1280
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1153
1281
|
currentContainingBlockComputedStyle = null;
|
|
1154
1282
|
}
|
|
1155
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle &&
|
|
1283
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1156
1284
|
if (shouldDropCurrentNode) {
|
|
1157
1285
|
// Drop non-containing blocks.
|
|
1158
1286
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
@@ -1175,7 +1303,7 @@ function getClippingRect(_ref) {
|
|
|
1175
1303
|
rootBoundary,
|
|
1176
1304
|
strategy
|
|
1177
1305
|
} = _ref;
|
|
1178
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1306
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1179
1307
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1180
1308
|
const firstClippingAncestor = clippingAncestors[0];
|
|
1181
1309
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -1195,7 +1323,14 @@ function getClippingRect(_ref) {
|
|
|
1195
1323
|
}
|
|
1196
1324
|
|
|
1197
1325
|
function getDimensions(element) {
|
|
1198
|
-
|
|
1326
|
+
const {
|
|
1327
|
+
width,
|
|
1328
|
+
height
|
|
1329
|
+
} = getCssDimensions(element);
|
|
1330
|
+
return {
|
|
1331
|
+
width,
|
|
1332
|
+
height
|
|
1333
|
+
};
|
|
1199
1334
|
}
|
|
1200
1335
|
|
|
1201
1336
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
@@ -1208,26 +1343,42 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1208
1343
|
scrollTop: 0
|
|
1209
1344
|
};
|
|
1210
1345
|
const offsets = createCoords(0);
|
|
1346
|
+
|
|
1347
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1348
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1349
|
+
function setLeftRTLScrollbarOffset() {
|
|
1350
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1351
|
+
}
|
|
1211
1352
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1212
1353
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1213
1354
|
scroll = getNodeScroll(offsetParent);
|
|
1214
1355
|
}
|
|
1215
|
-
if (
|
|
1356
|
+
if (isOffsetParentAnElement) {
|
|
1216
1357
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1217
1358
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1218
1359
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1219
1360
|
} else if (documentElement) {
|
|
1220
|
-
|
|
1361
|
+
setLeftRTLScrollbarOffset();
|
|
1221
1362
|
}
|
|
1222
1363
|
}
|
|
1364
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
1365
|
+
setLeftRTLScrollbarOffset();
|
|
1366
|
+
}
|
|
1367
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1368
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1369
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1223
1370
|
return {
|
|
1224
|
-
x
|
|
1225
|
-
y
|
|
1371
|
+
x,
|
|
1372
|
+
y,
|
|
1226
1373
|
width: rect.width,
|
|
1227
1374
|
height: rect.height
|
|
1228
1375
|
};
|
|
1229
1376
|
}
|
|
1230
1377
|
|
|
1378
|
+
function isStaticPositioned(element) {
|
|
1379
|
+
return getComputedStyle$1(element).position === 'static';
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1231
1382
|
function getTrueOffsetParent(element, polyfill) {
|
|
1232
1383
|
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
1233
1384
|
return null;
|
|
@@ -1235,57 +1386,62 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
1235
1386
|
if (polyfill) {
|
|
1236
1387
|
return polyfill(element);
|
|
1237
1388
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
currentNode = getParentNode(currentNode);
|
|
1247
|
-
}
|
|
1389
|
+
let rawOffsetParent = element.offsetParent;
|
|
1390
|
+
|
|
1391
|
+
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
1392
|
+
// while Chrome and Safari return the <body> element. The <body> element must
|
|
1393
|
+
// be used to perform the correct calculations even if the <html> element is
|
|
1394
|
+
// non-static.
|
|
1395
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1396
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1248
1397
|
}
|
|
1249
|
-
return
|
|
1398
|
+
return rawOffsetParent;
|
|
1250
1399
|
}
|
|
1251
1400
|
|
|
1252
1401
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1253
1402
|
// such as table ancestors and cross browser bugs.
|
|
1254
1403
|
function getOffsetParent(element, polyfill) {
|
|
1255
|
-
const
|
|
1404
|
+
const win = getWindow(element);
|
|
1405
|
+
if (isTopLayer(element)) {
|
|
1406
|
+
return win;
|
|
1407
|
+
}
|
|
1256
1408
|
if (!isHTMLElement(element)) {
|
|
1257
|
-
|
|
1409
|
+
let svgOffsetParent = getParentNode(element);
|
|
1410
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1411
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1412
|
+
return svgOffsetParent;
|
|
1413
|
+
}
|
|
1414
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1415
|
+
}
|
|
1416
|
+
return win;
|
|
1258
1417
|
}
|
|
1259
1418
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1260
|
-
while (offsetParent && isTableElement(offsetParent) &&
|
|
1419
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1261
1420
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1262
1421
|
}
|
|
1263
|
-
if (offsetParent && (
|
|
1264
|
-
return
|
|
1422
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
1423
|
+
return win;
|
|
1265
1424
|
}
|
|
1266
|
-
return offsetParent || getContainingBlock(element) ||
|
|
1425
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1267
1426
|
}
|
|
1268
1427
|
|
|
1269
|
-
const getElementRects = async function (
|
|
1270
|
-
let {
|
|
1271
|
-
reference,
|
|
1272
|
-
floating,
|
|
1273
|
-
strategy
|
|
1274
|
-
} = _ref;
|
|
1428
|
+
const getElementRects = async function (data) {
|
|
1275
1429
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1276
1430
|
const getDimensionsFn = this.getDimensions;
|
|
1431
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1277
1432
|
return {
|
|
1278
|
-
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
1433
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1279
1434
|
floating: {
|
|
1280
1435
|
x: 0,
|
|
1281
1436
|
y: 0,
|
|
1282
|
-
|
|
1437
|
+
width: floatingDimensions.width,
|
|
1438
|
+
height: floatingDimensions.height
|
|
1283
1439
|
}
|
|
1284
1440
|
};
|
|
1285
1441
|
};
|
|
1286
1442
|
|
|
1287
1443
|
function isRTL(element) {
|
|
1288
|
-
return getComputedStyle(element).direction === 'rtl';
|
|
1444
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
1289
1445
|
}
|
|
1290
1446
|
|
|
1291
1447
|
const platform = {
|
|
@@ -1301,14 +1457,19 @@ const platform = {
|
|
|
1301
1457
|
isRTL
|
|
1302
1458
|
};
|
|
1303
1459
|
|
|
1460
|
+
function rectsAreEqual(a, b) {
|
|
1461
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1304
1464
|
// https://samthor.au/2021/observing-dom/
|
|
1305
1465
|
function observeMove(element, onMove) {
|
|
1306
1466
|
let io = null;
|
|
1307
1467
|
let timeoutId;
|
|
1308
1468
|
const root = getDocumentElement(element);
|
|
1309
1469
|
function cleanup() {
|
|
1470
|
+
var _io;
|
|
1310
1471
|
clearTimeout(timeoutId);
|
|
1311
|
-
io
|
|
1472
|
+
(_io = io) == null || _io.disconnect();
|
|
1312
1473
|
io = null;
|
|
1313
1474
|
}
|
|
1314
1475
|
function refresh(skip, threshold) {
|
|
@@ -1319,12 +1480,13 @@ function observeMove(element, onMove) {
|
|
|
1319
1480
|
threshold = 1;
|
|
1320
1481
|
}
|
|
1321
1482
|
cleanup();
|
|
1483
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1322
1484
|
const {
|
|
1323
1485
|
left,
|
|
1324
1486
|
top,
|
|
1325
1487
|
width,
|
|
1326
1488
|
height
|
|
1327
|
-
} =
|
|
1489
|
+
} = elementRectForRootMargin;
|
|
1328
1490
|
if (!skip) {
|
|
1329
1491
|
onMove();
|
|
1330
1492
|
}
|
|
@@ -1348,13 +1510,25 @@ function observeMove(element, onMove) {
|
|
|
1348
1510
|
return refresh();
|
|
1349
1511
|
}
|
|
1350
1512
|
if (!ratio) {
|
|
1513
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
1514
|
+
// to prevent an infinite loop of updates.
|
|
1351
1515
|
timeoutId = setTimeout(() => {
|
|
1352
1516
|
refresh(false, 1e-7);
|
|
1353
|
-
},
|
|
1517
|
+
}, 1000);
|
|
1354
1518
|
} else {
|
|
1355
1519
|
refresh(false, ratio);
|
|
1356
1520
|
}
|
|
1357
1521
|
}
|
|
1522
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1523
|
+
// It's possible that even though the ratio is reported as 1, the
|
|
1524
|
+
// element is not actually fully within the IntersectionObserver's root
|
|
1525
|
+
// area anymore. This can happen under performance constraints. This may
|
|
1526
|
+
// be a bug in the browser's IntersectionObserver implementation. To
|
|
1527
|
+
// work around this, we compare the element's bounding rect now with
|
|
1528
|
+
// what it was at the time we created the IntersectionObserver. If they
|
|
1529
|
+
// are not equal then the element moved, so we refresh.
|
|
1530
|
+
refresh();
|
|
1531
|
+
}
|
|
1358
1532
|
isFirstUpdate = false;
|
|
1359
1533
|
}
|
|
1360
1534
|
|
|
@@ -1366,7 +1540,7 @@ function observeMove(element, onMove) {
|
|
|
1366
1540
|
// Handle <iframe>s
|
|
1367
1541
|
root: root.ownerDocument
|
|
1368
1542
|
});
|
|
1369
|
-
} catch (
|
|
1543
|
+
} catch (_e) {
|
|
1370
1544
|
io = new IntersectionObserver(handleObserve, options);
|
|
1371
1545
|
}
|
|
1372
1546
|
io.observe(element);
|
|
@@ -1414,7 +1588,8 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1414
1588
|
resizeObserver.unobserve(floating);
|
|
1415
1589
|
cancelAnimationFrame(reobserveFrame);
|
|
1416
1590
|
reobserveFrame = requestAnimationFrame(() => {
|
|
1417
|
-
|
|
1591
|
+
var _resizeObserver;
|
|
1592
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1418
1593
|
});
|
|
1419
1594
|
}
|
|
1420
1595
|
update();
|
|
@@ -1431,7 +1606,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1431
1606
|
}
|
|
1432
1607
|
function frameLoop() {
|
|
1433
1608
|
const nextRefRect = getBoundingClientRect(reference);
|
|
1434
|
-
if (prevRefRect && (
|
|
1609
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
1435
1610
|
update();
|
|
1436
1611
|
}
|
|
1437
1612
|
prevRefRect = nextRefRect;
|
|
@@ -1439,12 +1614,13 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1439
1614
|
}
|
|
1440
1615
|
update();
|
|
1441
1616
|
return () => {
|
|
1617
|
+
var _resizeObserver2;
|
|
1442
1618
|
ancestors.forEach(ancestor => {
|
|
1443
1619
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1444
1620
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1445
1621
|
});
|
|
1446
|
-
cleanupIo
|
|
1447
|
-
resizeObserver
|
|
1622
|
+
cleanupIo == null || cleanupIo();
|
|
1623
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
1448
1624
|
resizeObserver = null;
|
|
1449
1625
|
if (animationFrame) {
|
|
1450
1626
|
cancelAnimationFrame(frameId);
|
|
@@ -1452,10 +1628,45 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1452
1628
|
};
|
|
1453
1629
|
}
|
|
1454
1630
|
|
|
1631
|
+
/**
|
|
1632
|
+
* Modifies the placement by translating the floating element along the
|
|
1633
|
+
* specified axes.
|
|
1634
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1635
|
+
* object may be passed.
|
|
1636
|
+
* @see https://floating-ui.com/docs/offset
|
|
1637
|
+
*/
|
|
1638
|
+
const offset = offset$1;
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1642
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1643
|
+
* @see https://floating-ui.com/docs/shift
|
|
1644
|
+
*/
|
|
1645
|
+
const shift = shift$1;
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1649
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1650
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1651
|
+
* @see https://floating-ui.com/docs/flip
|
|
1652
|
+
*/
|
|
1653
|
+
const flip = flip$1;
|
|
1654
|
+
|
|
1655
|
+
/**
|
|
1656
|
+
* Provides data to position an inner element of the floating element so that it
|
|
1657
|
+
* appears centered to the reference element.
|
|
1658
|
+
* @see https://floating-ui.com/docs/arrow
|
|
1659
|
+
*/
|
|
1660
|
+
const arrow = arrow$1;
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
1664
|
+
*/
|
|
1665
|
+
const limitShift = limitShift$1;
|
|
1666
|
+
|
|
1455
1667
|
/**
|
|
1456
1668
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1457
|
-
* next to a reference element
|
|
1458
|
-
* strategy.
|
|
1669
|
+
* next to a given reference element.
|
|
1459
1670
|
*/
|
|
1460
1671
|
const computePosition = (reference, floating, options) => {
|
|
1461
1672
|
// This caches the expensive `getClippingElementAncestors` function so that
|
|
@@ -1477,5 +1688,6 @@ const computePosition = (reference, floating, options) => {
|
|
|
1477
1688
|
};
|
|
1478
1689
|
|
|
1479
1690
|
export { autoUpdate as a, arrow as b, computePosition as c, flip as f, limitShift as l, offset as o, shift as s };
|
|
1691
|
+
//# sourceMappingURL=p-Bv2vPjgL.js.map
|
|
1480
1692
|
|
|
1481
|
-
//# sourceMappingURL=
|
|
1693
|
+
//# sourceMappingURL=p-Bv2vPjgL.js.map
|