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