@element-plus/nightly 0.0.20250807 → 0.0.20250809
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +2670 -821
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +16 -16
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2670 -821
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/anchor/index.mjs +2 -2
- package/es/components/anchor/src/anchor.mjs +40 -207
- package/es/components/anchor/src/anchor.mjs.map +1 -1
- package/es/components/anchor/src/anchor2.mjs +207 -40
- package/es/components/anchor/src/anchor2.mjs.map +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +31 -65
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +65 -31
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb.mjs +10 -37
- package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb2.mjs +37 -10
- package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/components/button/index.mjs +2 -2
- package/es/components/button/src/button-group.mjs +1 -1
- package/es/components/button/src/button.mjs +62 -87
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +87 -62
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +1 -1
- package/es/components/calendar/src/date-table.mjs +31 -89
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +89 -31
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/calendar/src/use-date-table.mjs +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +7 -69
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +69 -7
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/cascader-panel/src/index.mjs +1 -1
- package/es/components/cascader-panel/src/menu.mjs +1 -1
- package/es/components/cascader-panel/src/node.mjs +115 -181
- package/es/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/components/cascader-panel/src/node2.mjs +181 -115
- package/es/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.mjs +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +23 -28
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +28 -23
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +400 -49
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +49 -400
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/color-picker/src/components/predefine.mjs +1 -1
- package/es/components/config-provider/src/config-provider-props.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +26 -178
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +178 -26
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +35 -8
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +8 -35
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +46 -447
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +447 -46
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +18 -18
- package/es/components/input/src/utils.mjs +3 -3
- package/es/components/input/src/utils.mjs.map +1 -1
- package/es/components/input-tag/src/input-tag.mjs +1 -1
- package/es/components/mention/src/mention-dropdown.mjs +15 -166
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +166 -15
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +73 -140
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +140 -73
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/pagination/src/components/pager.mjs +210 -16
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +16 -210
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/popper/index.mjs +4 -4
- package/es/components/popper/src/content.mjs +88 -130
- package/es/components/popper/src/content.mjs.map +1 -1
- package/es/components/popper/src/content2.mjs +130 -88
- package/es/components/popper/src/content2.mjs.map +1 -1
- package/es/components/popper/src/popper.mjs +22 -32
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +32 -22
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +30 -62
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +62 -30
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.mjs +10 -64
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +64 -10
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/slider/src/button.mjs +91 -19
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +19 -91
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +227 -72
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +72 -227
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +27 -99
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +99 -27
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/content.mjs +1 -1
- package/es/components/tooltip/src/content2.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +165 -30
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +30 -165
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip-v2/index.mjs +4 -4
- package/es/components/tooltip-v2/src/content.mjs +110 -48
- package/es/components/tooltip-v2/src/content.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +48 -110
- package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +20 -78
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +78 -20
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/trigger.mjs +12 -89
- package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
- package/es/components/tooltip-v2/src/trigger2.mjs +89 -12
- package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
- package/es/index.mjs +18 -18
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/anchor/index.js +2 -2
- package/lib/components/anchor/src/anchor.js +40 -206
- package/lib/components/anchor/src/anchor.js.map +1 -1
- package/lib/components/anchor/src/anchor2.js +206 -40
- package/lib/components/anchor/src/anchor2.js.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +32 -65
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +65 -32
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb.js +10 -37
- package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb2.js +37 -10
- package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/src/button-group.js +1 -1
- package/lib/components/button/src/button.js +65 -87
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +87 -65
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +1 -1
- package/lib/components/calendar/src/date-table.js +35 -89
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +89 -35
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/calendar/src/use-date-table.js +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +7 -69
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +69 -7
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/cascader-panel/src/index.js +1 -1
- package/lib/components/cascader-panel/src/menu.js +1 -1
- package/lib/components/cascader-panel/src/node.js +115 -181
- package/lib/components/cascader-panel/src/node.js.map +1 -1
- package/lib/components/cascader-panel/src/node2.js +181 -115
- package/lib/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/components/cascader-panel/src/store.js +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +25 -28
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +28 -25
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +399 -50
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +50 -399
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/color-picker/src/components/predefine.js +1 -1
- package/lib/components/config-provider/src/config-provider-props.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +27 -178
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +178 -27
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +35 -8
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +8 -35
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +47 -447
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +447 -47
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +18 -18
- package/lib/components/input/src/utils.js +3 -3
- package/lib/components/input/src/utils.js.map +1 -1
- package/lib/components/input-tag/src/input-tag.js +1 -1
- package/lib/components/mention/src/mention-dropdown.js +16 -166
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +166 -16
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +74 -139
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +139 -74
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/pagination/src/components/pager.js +210 -16
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +16 -210
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/popper/index.js +4 -4
- package/lib/components/popper/src/content.js +93 -130
- package/lib/components/popper/src/content.js.map +1 -1
- package/lib/components/popper/src/content2.js +130 -93
- package/lib/components/popper/src/content2.js.map +1 -1
- package/lib/components/popper/src/popper.js +25 -32
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +32 -25
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +32 -62
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +62 -32
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/scrollbar/src/bar.js +10 -64
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +64 -10
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/slider/src/button.js +91 -20
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +20 -91
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +226 -72
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +72 -226
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +28 -99
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +99 -28
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/tooltip/index.js +2 -2
- package/lib/components/tooltip/src/content.js +1 -1
- package/lib/components/tooltip/src/content2.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +165 -34
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +34 -165
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip-v2/index.js +4 -4
- package/lib/components/tooltip-v2/src/content.js +110 -48
- package/lib/components/tooltip-v2/src/content.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +48 -110
- package/lib/components/tooltip-v2/src/content2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +20 -78
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +78 -20
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip-v2/src/trigger.js +12 -89
- package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
- package/lib/components/tooltip-v2/src/trigger2.js +89 -12
- package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
- package/lib/index.js +18 -18
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
package/dist/index.full.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Element Plus v0.0.
|
1
|
+
/*! Element Plus v0.0.20250809 */
|
2
2
|
|
3
3
|
import { unref, readonly, shallowRef, watchEffect, getCurrentScope, onScopeDispose, isRef, ref, watch, getCurrentInstance, onMounted, nextTick, computed, defineComponent, openBlock, createElementBlock, createElementVNode, warn, isVNode, Fragment, Comment, onBeforeUnmount, inject, onUnmounted, h as h$1, Teleport as Teleport$1, onBeforeMount, provide, triggerRef, renderSlot, normalizeClass, normalizeStyle, mergeProps, useSlots, toRef, createBlock, Transition, withCtx, withDirectives, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createVNode, vShow, reactive, toRefs, onUpdated, TransitionGroup, useAttrs as useAttrs$1, withModifiers, onActivated, cloneVNode, Text as Text$1, onDeactivated, renderList, withKeys, createSlots, normalizeProps, guardReactiveProps, toRaw, vModelCheckbox, vModelRadio, onBeforeUpdate, vModelText, toHandlers, resolveComponent, markRaw, effectScope, resolveDirective, toHandlerKey, render, createApp, shallowReactive } from 'vue';
|
4
4
|
|
@@ -3036,7 +3036,7 @@ function baseClamp(number, lower, upper) {
|
|
3036
3036
|
return number;
|
3037
3037
|
}
|
3038
3038
|
|
3039
|
-
function clamp(number, lower, upper) {
|
3039
|
+
function clamp$1(number, lower, upper) {
|
3040
3040
|
if (upper === void 0) {
|
3041
3041
|
upper = lower;
|
3042
3042
|
lower = void 0;
|
@@ -4645,7 +4645,7 @@ function flattenDepth(array, depth) {
|
|
4645
4645
|
}
|
4646
4646
|
|
4647
4647
|
var WRAP_FLIP_FLAG = 512;
|
4648
|
-
function flip$
|
4648
|
+
function flip$2(func) {
|
4649
4649
|
return createWrap(func, WRAP_FLIP_FLAG);
|
4650
4650
|
}
|
4651
4651
|
|
@@ -4980,7 +4980,7 @@ function baseIsDate(value) {
|
|
4980
4980
|
var nodeIsDate = nodeUtil && nodeUtil.isDate;
|
4981
4981
|
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
4982
4982
|
|
4983
|
-
function isElement$
|
4983
|
+
function isElement$3(value) {
|
4984
4984
|
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
4985
4985
|
}
|
4986
4986
|
|
@@ -5191,7 +5191,7 @@ function baseExtremum(array, iteratee, comparator) {
|
|
5191
5191
|
return result;
|
5192
5192
|
}
|
5193
5193
|
|
5194
|
-
function max$
|
5194
|
+
function max$4(array) {
|
5195
5195
|
return array && array.length ? baseExtremum(array, identity, baseGt) : void 0;
|
5196
5196
|
}
|
5197
5197
|
|
@@ -5240,7 +5240,7 @@ var methodOf = baseRest(function(object, args) {
|
|
5240
5240
|
};
|
5241
5241
|
});
|
5242
5242
|
|
5243
|
-
function min$
|
5243
|
+
function min$4(array) {
|
5244
5244
|
return array && array.length ? baseExtremum(array, identity, baseLt) : void 0;
|
5245
5245
|
}
|
5246
5246
|
|
@@ -5959,7 +5959,7 @@ function reverse(array) {
|
|
5959
5959
|
return array == null ? array : nativeReverse.call(array);
|
5960
5960
|
}
|
5961
5961
|
|
5962
|
-
var round$
|
5962
|
+
var round$2 = createRound("round");
|
5963
5963
|
|
5964
5964
|
function arraySample(array) {
|
5965
5965
|
var length = array.length;
|
@@ -6030,7 +6030,7 @@ function shuffle(collection) {
|
|
6030
6030
|
|
6031
6031
|
var mapTag = "[object Map]";
|
6032
6032
|
var setTag = "[object Set]";
|
6033
|
-
function size(collection) {
|
6033
|
+
function size$1(collection) {
|
6034
6034
|
if (collection == null) {
|
6035
6035
|
return 0;
|
6036
6036
|
}
|
@@ -6966,7 +6966,7 @@ var collection = {
|
|
6966
6966
|
sample,
|
6967
6967
|
sampleSize,
|
6968
6968
|
shuffle,
|
6969
|
-
size,
|
6969
|
+
size: size$1,
|
6970
6970
|
some,
|
6971
6971
|
sortBy
|
6972
6972
|
};
|
@@ -6986,7 +6986,7 @@ var func = {
|
|
6986
6986
|
debounce,
|
6987
6987
|
defer,
|
6988
6988
|
delay,
|
6989
|
-
flip: flip$
|
6989
|
+
flip: flip$2,
|
6990
6990
|
memoize,
|
6991
6991
|
negate,
|
6992
6992
|
once,
|
@@ -7019,7 +7019,7 @@ var lang = {
|
|
7019
7019
|
isBoolean: isBoolean$1,
|
7020
7020
|
isBuffer,
|
7021
7021
|
isDate,
|
7022
|
-
isElement: isElement$
|
7022
|
+
isElement: isElement$3,
|
7023
7023
|
isEmpty: isEmpty$1,
|
7024
7024
|
isEqual: isEqual$1,
|
7025
7025
|
isEqualWith,
|
@@ -7065,21 +7065,21 @@ var math = {
|
|
7065
7065
|
ceil,
|
7066
7066
|
divide,
|
7067
7067
|
floor: floor$1,
|
7068
|
-
max: max$
|
7068
|
+
max: max$4,
|
7069
7069
|
maxBy,
|
7070
7070
|
mean,
|
7071
7071
|
meanBy,
|
7072
|
-
min: min$
|
7072
|
+
min: min$4,
|
7073
7073
|
minBy,
|
7074
7074
|
multiply,
|
7075
|
-
round: round$
|
7075
|
+
round: round$2,
|
7076
7076
|
subtract,
|
7077
7077
|
sum: sum$1,
|
7078
7078
|
sumBy
|
7079
7079
|
};
|
7080
7080
|
|
7081
7081
|
var number = {
|
7082
|
-
clamp,
|
7082
|
+
clamp: clamp$1,
|
7083
7083
|
inRange,
|
7084
7084
|
random
|
7085
7085
|
};
|
@@ -7807,7 +7807,7 @@ const isUndefined = (val) => val === void 0;
|
|
7807
7807
|
const isBoolean = (val) => typeof val === "boolean";
|
7808
7808
|
const isNumber = (val) => typeof val === "number";
|
7809
7809
|
const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
|
7810
|
-
const isElement$
|
7810
|
+
const isElement$2 = (e) => {
|
7811
7811
|
if (typeof Element === "undefined")
|
7812
7812
|
return false;
|
7813
7813
|
return e instanceof Element;
|
@@ -10111,36 +10111,156 @@ const useZIndex = (zIndexOverrides) => {
|
|
10111
10111
|
};
|
10112
10112
|
};
|
10113
10113
|
|
10114
|
-
|
10114
|
+
/**
|
10115
|
+
* Custom positioning reference element.
|
10116
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
10117
|
+
*/
|
10118
|
+
|
10119
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
10120
|
+
const alignments = ['start', 'end'];
|
10121
|
+
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
10122
|
+
const min$3 = Math.min;
|
10123
|
+
const max$3 = Math.max;
|
10124
|
+
const round$1 = Math.round;
|
10125
|
+
const createCoords = v => ({
|
10126
|
+
x: v,
|
10127
|
+
y: v
|
10128
|
+
});
|
10129
|
+
const oppositeSideMap = {
|
10130
|
+
left: 'right',
|
10131
|
+
right: 'left',
|
10132
|
+
bottom: 'top',
|
10133
|
+
top: 'bottom'
|
10134
|
+
};
|
10135
|
+
const oppositeAlignmentMap = {
|
10136
|
+
start: 'end',
|
10137
|
+
end: 'start'
|
10138
|
+
};
|
10139
|
+
function clamp(start, value, end) {
|
10140
|
+
return max$3(start, min$3(value, end));
|
10141
|
+
}
|
10142
|
+
function evaluate(value, param) {
|
10143
|
+
return typeof value === 'function' ? value(param) : value;
|
10144
|
+
}
|
10145
|
+
function getSide$1(placement) {
|
10115
10146
|
return placement.split('-')[0];
|
10116
10147
|
}
|
10117
|
-
|
10118
|
-
function getAlignment(placement) {
|
10148
|
+
function getAlignment$1(placement) {
|
10119
10149
|
return placement.split('-')[1];
|
10120
10150
|
}
|
10121
|
-
|
10122
|
-
|
10123
|
-
return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
|
10151
|
+
function getOppositeAxis(axis) {
|
10152
|
+
return axis === 'x' ? 'y' : 'x';
|
10124
10153
|
}
|
10125
|
-
|
10126
|
-
function getLengthFromAxis(axis) {
|
10154
|
+
function getAxisLength(axis) {
|
10127
10155
|
return axis === 'y' ? 'height' : 'width';
|
10128
10156
|
}
|
10157
|
+
function getSideAxis(placement) {
|
10158
|
+
return ['top', 'bottom'].includes(getSide$1(placement)) ? 'y' : 'x';
|
10159
|
+
}
|
10160
|
+
function getAlignmentAxis(placement) {
|
10161
|
+
return getOppositeAxis(getSideAxis(placement));
|
10162
|
+
}
|
10163
|
+
function getAlignmentSides$1(placement, rects, rtl) {
|
10164
|
+
if (rtl === void 0) {
|
10165
|
+
rtl = false;
|
10166
|
+
}
|
10167
|
+
const alignment = getAlignment$1(placement);
|
10168
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
10169
|
+
const length = getAxisLength(alignmentAxis);
|
10170
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
10171
|
+
if (rects.reference[length] > rects.floating[length]) {
|
10172
|
+
mainAlignmentSide = getOppositePlacement$1(mainAlignmentSide);
|
10173
|
+
}
|
10174
|
+
return [mainAlignmentSide, getOppositePlacement$1(mainAlignmentSide)];
|
10175
|
+
}
|
10176
|
+
function getExpandedPlacements$1(placement) {
|
10177
|
+
const oppositePlacement = getOppositePlacement$1(placement);
|
10178
|
+
return [getOppositeAlignmentPlacement$1(placement), oppositePlacement, getOppositeAlignmentPlacement$1(oppositePlacement)];
|
10179
|
+
}
|
10180
|
+
function getOppositeAlignmentPlacement$1(placement) {
|
10181
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
10182
|
+
}
|
10183
|
+
function getSideList(side, isStart, rtl) {
|
10184
|
+
const lr = ['left', 'right'];
|
10185
|
+
const rl = ['right', 'left'];
|
10186
|
+
const tb = ['top', 'bottom'];
|
10187
|
+
const bt = ['bottom', 'top'];
|
10188
|
+
switch (side) {
|
10189
|
+
case 'top':
|
10190
|
+
case 'bottom':
|
10191
|
+
if (rtl) return isStart ? rl : lr;
|
10192
|
+
return isStart ? lr : rl;
|
10193
|
+
case 'left':
|
10194
|
+
case 'right':
|
10195
|
+
return isStart ? tb : bt;
|
10196
|
+
default:
|
10197
|
+
return [];
|
10198
|
+
}
|
10199
|
+
}
|
10200
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
10201
|
+
const alignment = getAlignment$1(placement);
|
10202
|
+
let list = getSideList(getSide$1(placement), direction === 'start', rtl);
|
10203
|
+
if (alignment) {
|
10204
|
+
list = list.map(side => side + "-" + alignment);
|
10205
|
+
if (flipAlignment) {
|
10206
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement$1));
|
10207
|
+
}
|
10208
|
+
}
|
10209
|
+
return list;
|
10210
|
+
}
|
10211
|
+
function getOppositePlacement$1(placement) {
|
10212
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
10213
|
+
}
|
10214
|
+
function expandPaddingObject$1(padding) {
|
10215
|
+
return {
|
10216
|
+
top: 0,
|
10217
|
+
right: 0,
|
10218
|
+
bottom: 0,
|
10219
|
+
left: 0,
|
10220
|
+
...padding
|
10221
|
+
};
|
10222
|
+
}
|
10223
|
+
function getPaddingObject(padding) {
|
10224
|
+
return typeof padding !== 'number' ? expandPaddingObject$1(padding) : {
|
10225
|
+
top: padding,
|
10226
|
+
right: padding,
|
10227
|
+
bottom: padding,
|
10228
|
+
left: padding
|
10229
|
+
};
|
10230
|
+
}
|
10231
|
+
function rectToClientRect$1(rect) {
|
10232
|
+
const {
|
10233
|
+
x,
|
10234
|
+
y,
|
10235
|
+
width,
|
10236
|
+
height
|
10237
|
+
} = rect;
|
10238
|
+
return {
|
10239
|
+
width,
|
10240
|
+
height,
|
10241
|
+
top: y,
|
10242
|
+
left: x,
|
10243
|
+
right: x + width,
|
10244
|
+
bottom: y + height,
|
10245
|
+
x,
|
10246
|
+
y
|
10247
|
+
};
|
10248
|
+
}
|
10129
10249
|
|
10130
|
-
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
10250
|
+
function computeCoordsFromPlacement$1(_ref, placement, rtl) {
|
10131
10251
|
let {
|
10132
10252
|
reference,
|
10133
10253
|
floating
|
10134
10254
|
} = _ref;
|
10255
|
+
const sideAxis = getSideAxis(placement);
|
10256
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
10257
|
+
const alignLength = getAxisLength(alignmentAxis);
|
10258
|
+
const side = getSide$1(placement);
|
10259
|
+
const isVertical = sideAxis === 'y';
|
10135
10260
|
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
10136
10261
|
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
10137
|
-
const
|
10138
|
-
const length = getLengthFromAxis(mainAxis);
|
10139
|
-
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
10140
|
-
const side = getSide(placement);
|
10141
|
-
const isVertical = mainAxis === 'x';
|
10262
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
10142
10263
|
let coords;
|
10143
|
-
|
10144
10264
|
switch (side) {
|
10145
10265
|
case 'top':
|
10146
10266
|
coords = {
|
@@ -10148,65 +10268,57 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
10148
10268
|
y: reference.y - floating.height
|
10149
10269
|
};
|
10150
10270
|
break;
|
10151
|
-
|
10152
10271
|
case 'bottom':
|
10153
10272
|
coords = {
|
10154
10273
|
x: commonX,
|
10155
10274
|
y: reference.y + reference.height
|
10156
10275
|
};
|
10157
10276
|
break;
|
10158
|
-
|
10159
10277
|
case 'right':
|
10160
10278
|
coords = {
|
10161
10279
|
x: reference.x + reference.width,
|
10162
10280
|
y: commonY
|
10163
10281
|
};
|
10164
10282
|
break;
|
10165
|
-
|
10166
10283
|
case 'left':
|
10167
10284
|
coords = {
|
10168
10285
|
x: reference.x - floating.width,
|
10169
10286
|
y: commonY
|
10170
10287
|
};
|
10171
10288
|
break;
|
10172
|
-
|
10173
10289
|
default:
|
10174
10290
|
coords = {
|
10175
10291
|
x: reference.x,
|
10176
10292
|
y: reference.y
|
10177
10293
|
};
|
10178
10294
|
}
|
10179
|
-
|
10180
|
-
switch (getAlignment(placement)) {
|
10295
|
+
switch (getAlignment$1(placement)) {
|
10181
10296
|
case 'start':
|
10182
|
-
coords[
|
10297
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
10183
10298
|
break;
|
10184
|
-
|
10185
10299
|
case 'end':
|
10186
|
-
coords[
|
10300
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
10187
10301
|
break;
|
10188
10302
|
}
|
10189
|
-
|
10190
10303
|
return coords;
|
10191
10304
|
}
|
10192
10305
|
|
10193
10306
|
/**
|
10194
10307
|
* Computes the `x` and `y` coordinates that will place the floating element
|
10195
|
-
* next to a reference element
|
10308
|
+
* next to a given reference element.
|
10196
10309
|
*
|
10197
10310
|
* This export does not have any `platform` interface logic. You will need to
|
10198
10311
|
* write one for the platform you are using Floating UI with.
|
10199
10312
|
*/
|
10200
|
-
|
10201
|
-
const computePosition$1 = async (reference, floating, config) => {
|
10313
|
+
const computePosition$3 = async (reference, floating, config) => {
|
10202
10314
|
const {
|
10203
10315
|
placement = 'bottom',
|
10204
10316
|
strategy = 'absolute',
|
10205
10317
|
middleware = [],
|
10206
10318
|
platform
|
10207
10319
|
} = config;
|
10320
|
+
const validMiddleware = middleware.filter(Boolean);
|
10208
10321
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
10209
|
-
|
10210
10322
|
let rects = await platform.getElementRects({
|
10211
10323
|
reference,
|
10212
10324
|
floating,
|
@@ -10215,16 +10327,15 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
10215
10327
|
let {
|
10216
10328
|
x,
|
10217
10329
|
y
|
10218
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
10330
|
+
} = computeCoordsFromPlacement$1(rects, placement, rtl);
|
10219
10331
|
let statefulPlacement = placement;
|
10220
10332
|
let middlewareData = {};
|
10221
10333
|
let resetCount = 0;
|
10222
|
-
|
10223
|
-
for (let i = 0; i < middleware.length; i++) {
|
10334
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
10224
10335
|
const {
|
10225
10336
|
name,
|
10226
10337
|
fn
|
10227
|
-
} =
|
10338
|
+
} = validMiddleware[i];
|
10228
10339
|
const {
|
10229
10340
|
x: nextX,
|
10230
10341
|
y: nextY,
|
@@ -10246,20 +10357,19 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
10246
10357
|
});
|
10247
10358
|
x = nextX != null ? nextX : x;
|
10248
10359
|
y = nextY != null ? nextY : y;
|
10249
|
-
middlewareData = {
|
10250
|
-
|
10360
|
+
middlewareData = {
|
10361
|
+
...middlewareData,
|
10362
|
+
[name]: {
|
10363
|
+
...middlewareData[name],
|
10251
10364
|
...data
|
10252
10365
|
}
|
10253
10366
|
};
|
10254
|
-
|
10255
10367
|
if (reset && resetCount <= 50) {
|
10256
10368
|
resetCount++;
|
10257
|
-
|
10258
10369
|
if (typeof reset === 'object') {
|
10259
10370
|
if (reset.placement) {
|
10260
10371
|
statefulPlacement = reset.placement;
|
10261
10372
|
}
|
10262
|
-
|
10263
10373
|
if (reset.rects) {
|
10264
10374
|
rects = reset.rects === true ? await platform.getElementRects({
|
10265
10375
|
reference,
|
@@ -10267,18 +10377,14 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
10267
10377
|
strategy
|
10268
10378
|
}) : reset.rects;
|
10269
10379
|
}
|
10270
|
-
|
10271
10380
|
({
|
10272
10381
|
x,
|
10273
10382
|
y
|
10274
|
-
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
10383
|
+
} = computeCoordsFromPlacement$1(rects, statefulPlacement, rtl));
|
10275
10384
|
}
|
10276
|
-
|
10277
10385
|
i = -1;
|
10278
|
-
continue;
|
10279
10386
|
}
|
10280
10387
|
}
|
10281
|
-
|
10282
10388
|
return {
|
10283
10389
|
x,
|
10284
10390
|
y,
|
@@ -10288,49 +10394,19 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
10288
10394
|
};
|
10289
10395
|
};
|
10290
10396
|
|
10291
|
-
function expandPaddingObject(padding) {
|
10292
|
-
return {
|
10293
|
-
top: 0,
|
10294
|
-
right: 0,
|
10295
|
-
bottom: 0,
|
10296
|
-
left: 0,
|
10297
|
-
...padding
|
10298
|
-
};
|
10299
|
-
}
|
10300
|
-
|
10301
|
-
function getSideObjectFromPadding(padding) {
|
10302
|
-
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
10303
|
-
top: padding,
|
10304
|
-
right: padding,
|
10305
|
-
bottom: padding,
|
10306
|
-
left: padding
|
10307
|
-
};
|
10308
|
-
}
|
10309
|
-
|
10310
|
-
function rectToClientRect(rect) {
|
10311
|
-
return { ...rect,
|
10312
|
-
top: rect.y,
|
10313
|
-
left: rect.x,
|
10314
|
-
right: rect.x + rect.width,
|
10315
|
-
bottom: rect.y + rect.height
|
10316
|
-
};
|
10317
|
-
}
|
10318
|
-
|
10319
10397
|
/**
|
10320
10398
|
* Resolves with an object of overflow side offsets that determine how much the
|
10321
|
-
* element is overflowing a given clipping boundary.
|
10399
|
+
* element is overflowing a given clipping boundary on each side.
|
10322
10400
|
* - positive = overflowing the boundary by that number of pixels
|
10323
10401
|
* - negative = how many pixels left before it will overflow
|
10324
10402
|
* - 0 = lies flush with the boundary
|
10325
10403
|
* @see https://floating-ui.com/docs/detectOverflow
|
10326
10404
|
*/
|
10327
|
-
async function detectOverflow(
|
10405
|
+
async function detectOverflow$1(state, options) {
|
10328
10406
|
var _await$platform$isEle;
|
10329
|
-
|
10330
10407
|
if (options === void 0) {
|
10331
10408
|
options = {};
|
10332
10409
|
}
|
10333
|
-
|
10334
10410
|
const {
|
10335
10411
|
x,
|
10336
10412
|
y,
|
@@ -10338,176 +10414,251 @@ async function detectOverflow(middlewareArguments, options) {
|
|
10338
10414
|
rects,
|
10339
10415
|
elements,
|
10340
10416
|
strategy
|
10341
|
-
} =
|
10417
|
+
} = state;
|
10342
10418
|
const {
|
10343
10419
|
boundary = 'clippingAncestors',
|
10344
10420
|
rootBoundary = 'viewport',
|
10345
10421
|
elementContext = 'floating',
|
10346
10422
|
altBoundary = false,
|
10347
10423
|
padding = 0
|
10348
|
-
} = options;
|
10349
|
-
const paddingObject =
|
10424
|
+
} = evaluate(options, state);
|
10425
|
+
const paddingObject = getPaddingObject(padding);
|
10350
10426
|
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
10351
10427
|
const element = elements[altBoundary ? altContext : elementContext];
|
10352
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
10428
|
+
const clippingClientRect = rectToClientRect$1(await platform.getClippingRect({
|
10353
10429
|
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
10354
10430
|
boundary,
|
10355
10431
|
rootBoundary,
|
10356
10432
|
strategy
|
10357
10433
|
}));
|
10358
|
-
const
|
10359
|
-
|
10360
|
-
|
10361
|
-
|
10362
|
-
|
10363
|
-
|
10434
|
+
const rect = elementContext === 'floating' ? {
|
10435
|
+
x,
|
10436
|
+
y,
|
10437
|
+
width: rects.floating.width,
|
10438
|
+
height: rects.floating.height
|
10439
|
+
} : rects.reference;
|
10440
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
10441
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
10442
|
+
x: 1,
|
10443
|
+
y: 1
|
10444
|
+
} : {
|
10445
|
+
x: 1,
|
10446
|
+
y: 1
|
10447
|
+
};
|
10448
|
+
const elementClientRect = rectToClientRect$1(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
10449
|
+
elements,
|
10450
|
+
rect,
|
10451
|
+
offsetParent,
|
10364
10452
|
strategy
|
10365
|
-
}) :
|
10453
|
+
}) : rect);
|
10366
10454
|
return {
|
10367
|
-
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
10368
|
-
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
10369
|
-
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
10370
|
-
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
10455
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
10456
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
10457
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
10458
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
10371
10459
|
};
|
10372
10460
|
}
|
10373
10461
|
|
10374
|
-
const min$2 = Math.min;
|
10375
|
-
const max$2 = Math.max;
|
10376
|
-
|
10377
|
-
function within(min$1, value, max$1) {
|
10378
|
-
return max$2(min$1, min$2(value, max$1));
|
10379
|
-
}
|
10380
|
-
|
10381
10462
|
/**
|
10382
|
-
*
|
10383
|
-
* to the reference element.
|
10463
|
+
* Provides data to position an inner element of the floating element so that it
|
10464
|
+
* appears centered to the reference element.
|
10384
10465
|
* @see https://floating-ui.com/docs/arrow
|
10385
10466
|
*/
|
10386
|
-
const arrow = options => ({
|
10467
|
+
const arrow$2 = options => ({
|
10387
10468
|
name: 'arrow',
|
10388
10469
|
options,
|
10389
|
-
|
10390
|
-
async fn(middlewareArguments) {
|
10391
|
-
// Since `element` is required, we don't Partial<> the type
|
10392
|
-
const {
|
10393
|
-
element,
|
10394
|
-
padding = 0
|
10395
|
-
} = options != null ? options : {};
|
10470
|
+
async fn(state) {
|
10396
10471
|
const {
|
10397
10472
|
x,
|
10398
10473
|
y,
|
10399
10474
|
placement,
|
10400
10475
|
rects,
|
10401
|
-
platform
|
10402
|
-
|
10403
|
-
|
10476
|
+
platform,
|
10477
|
+
elements,
|
10478
|
+
middlewareData
|
10479
|
+
} = state;
|
10480
|
+
// Since `element` is required, we don't Partial<> the type.
|
10481
|
+
const {
|
10482
|
+
element,
|
10483
|
+
padding = 0
|
10484
|
+
} = evaluate(options, state) || {};
|
10404
10485
|
if (element == null) {
|
10405
|
-
|
10406
10486
|
return {};
|
10407
10487
|
}
|
10408
|
-
|
10409
|
-
const paddingObject = getSideObjectFromPadding(padding);
|
10488
|
+
const paddingObject = getPaddingObject(padding);
|
10410
10489
|
const coords = {
|
10411
10490
|
x,
|
10412
10491
|
y
|
10413
10492
|
};
|
10414
|
-
const axis =
|
10415
|
-
const
|
10416
|
-
const length = getLengthFromAxis(axis);
|
10493
|
+
const axis = getAlignmentAxis(placement);
|
10494
|
+
const length = getAxisLength(axis);
|
10417
10495
|
const arrowDimensions = await platform.getDimensions(element);
|
10418
|
-
const
|
10419
|
-
const
|
10496
|
+
const isYAxis = axis === 'y';
|
10497
|
+
const minProp = isYAxis ? 'top' : 'left';
|
10498
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
10499
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
10420
10500
|
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
10421
10501
|
const startDiff = coords[axis] - rects.reference[axis];
|
10422
10502
|
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
10423
|
-
let clientSize = arrowOffsetParent ?
|
10503
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
10424
10504
|
|
10425
|
-
|
10426
|
-
|
10505
|
+
// DOM platform can return `window` as the `offsetParent`.
|
10506
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
10507
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
10427
10508
|
}
|
10509
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
10428
10510
|
|
10429
|
-
|
10430
|
-
//
|
10511
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
10512
|
+
// centered, modify the padding so that it is centered.
|
10513
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
10514
|
+
const minPadding = min$3(paddingObject[minProp], largestPossiblePadding);
|
10515
|
+
const maxPadding = min$3(paddingObject[maxProp], largestPossiblePadding);
|
10431
10516
|
|
10432
|
-
|
10433
|
-
|
10517
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
10518
|
+
// point is outside the floating element's bounds.
|
10519
|
+
const min$1 = minPadding;
|
10520
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
10434
10521
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
10435
|
-
const offset =
|
10436
|
-
|
10437
|
-
|
10438
|
-
|
10439
|
-
|
10522
|
+
const offset = clamp(min$1, center, max);
|
10523
|
+
|
10524
|
+
// If the reference is small enough that the arrow's padding causes it to
|
10525
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
10526
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
10527
|
+
// a single reset is performed when this is true.
|
10528
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment$1(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
10529
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
10440
10530
|
return {
|
10441
|
-
[axis]: coords[axis]
|
10531
|
+
[axis]: coords[axis] + alignmentOffset,
|
10442
10532
|
data: {
|
10443
10533
|
[axis]: offset,
|
10444
|
-
centerOffset: center - offset
|
10445
|
-
|
10534
|
+
centerOffset: center - offset - alignmentOffset,
|
10535
|
+
...(shouldAddOffset && {
|
10536
|
+
alignmentOffset
|
10537
|
+
})
|
10538
|
+
},
|
10539
|
+
reset: shouldAddOffset
|
10446
10540
|
};
|
10447
10541
|
}
|
10448
|
-
|
10449
10542
|
});
|
10450
10543
|
|
10451
|
-
|
10452
|
-
|
10453
|
-
|
10454
|
-
|
10455
|
-
|
10456
|
-
}
|
10457
|
-
|
10458
|
-
|
10544
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
10545
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment$1(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment$1(placement) !== alignment)] : allowedPlacements.filter(placement => getSide$1(placement) === placement);
|
10546
|
+
return allowedPlacementsSortedByAlignment.filter(placement => {
|
10547
|
+
if (alignment) {
|
10548
|
+
return getAlignment$1(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement$1(placement) !== placement : false);
|
10549
|
+
}
|
10550
|
+
return true;
|
10551
|
+
});
|
10459
10552
|
}
|
10460
|
-
|
10461
|
-
|
10462
|
-
|
10463
|
-
|
10553
|
+
/**
|
10554
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
10555
|
+
* that has the most space available automatically, without needing to specify a
|
10556
|
+
* preferred placement. Alternative to `flip`.
|
10557
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
10558
|
+
*/
|
10559
|
+
const autoPlacement = function (options) {
|
10560
|
+
if (options === void 0) {
|
10561
|
+
options = {};
|
10464
10562
|
}
|
10563
|
+
return {
|
10564
|
+
name: 'autoPlacement',
|
10565
|
+
options,
|
10566
|
+
async fn(state) {
|
10567
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
10568
|
+
const {
|
10569
|
+
rects,
|
10570
|
+
middlewareData,
|
10571
|
+
placement,
|
10572
|
+
platform,
|
10573
|
+
elements
|
10574
|
+
} = state;
|
10575
|
+
const {
|
10576
|
+
crossAxis = false,
|
10577
|
+
alignment,
|
10578
|
+
allowedPlacements = placements,
|
10579
|
+
autoAlignment = true,
|
10580
|
+
...detectOverflowOptions
|
10581
|
+
} = evaluate(options, state);
|
10582
|
+
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
10583
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
10584
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
10585
|
+
const currentPlacement = placements$1[currentIndex];
|
10586
|
+
if (currentPlacement == null) {
|
10587
|
+
return {};
|
10588
|
+
}
|
10589
|
+
const alignmentSides = getAlignmentSides$1(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
10465
10590
|
|
10466
|
-
|
10467
|
-
|
10468
|
-
|
10469
|
-
|
10470
|
-
|
10471
|
-
|
10472
|
-
|
10473
|
-
|
10591
|
+
// Make `computeCoords` start from the right place.
|
10592
|
+
if (placement !== currentPlacement) {
|
10593
|
+
return {
|
10594
|
+
reset: {
|
10595
|
+
placement: placements$1[0]
|
10596
|
+
}
|
10597
|
+
};
|
10598
|
+
}
|
10599
|
+
const currentOverflows = [overflow[getSide$1(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
10600
|
+
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
|
10601
|
+
placement: currentPlacement,
|
10602
|
+
overflows: currentOverflows
|
10603
|
+
}];
|
10604
|
+
const nextPlacement = placements$1[currentIndex + 1];
|
10474
10605
|
|
10475
|
-
|
10476
|
-
|
10477
|
-
|
10606
|
+
// There are more placements to check.
|
10607
|
+
if (nextPlacement) {
|
10608
|
+
return {
|
10609
|
+
data: {
|
10610
|
+
index: currentIndex + 1,
|
10611
|
+
overflows: allOverflows
|
10612
|
+
},
|
10613
|
+
reset: {
|
10614
|
+
placement: nextPlacement
|
10615
|
+
}
|
10616
|
+
};
|
10617
|
+
}
|
10618
|
+
const placementsSortedByMostSpace = allOverflows.map(d => {
|
10619
|
+
const alignment = getAlignment$1(d.placement);
|
10620
|
+
return [d.placement, alignment && crossAxis ?
|
10621
|
+
// Check along the mainAxis and main crossAxis side.
|
10622
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
|
10623
|
+
// Check only the mainAxis.
|
10624
|
+
d.overflows[0], d.overflows];
|
10625
|
+
}).sort((a, b) => a[1] - b[1]);
|
10626
|
+
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
|
10627
|
+
// Aligned placements should not check their opposite crossAxis
|
10628
|
+
// side.
|
10629
|
+
getAlignment$1(d[0]) ? 2 : 3).every(v => v <= 0));
|
10630
|
+
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
10631
|
+
if (resetPlacement !== placement) {
|
10632
|
+
return {
|
10633
|
+
data: {
|
10634
|
+
index: currentIndex + 1,
|
10635
|
+
overflows: allOverflows
|
10636
|
+
},
|
10637
|
+
reset: {
|
10638
|
+
placement: resetPlacement
|
10639
|
+
}
|
10640
|
+
};
|
10641
|
+
}
|
10642
|
+
return {};
|
10643
|
+
}
|
10478
10644
|
};
|
10479
|
-
}
|
10480
|
-
|
10481
|
-
const hash = {
|
10482
|
-
start: 'end',
|
10483
|
-
end: 'start'
|
10484
10645
|
};
|
10485
|
-
function getOppositeAlignmentPlacement(placement) {
|
10486
|
-
return placement.replace(/start|end/g, matched => hash[matched]);
|
10487
|
-
}
|
10488
|
-
|
10489
|
-
function getExpandedPlacements(placement) {
|
10490
|
-
const oppositePlacement = getOppositePlacement(placement);
|
10491
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
10492
|
-
}
|
10493
10646
|
|
10494
10647
|
/**
|
10495
|
-
*
|
10496
|
-
*
|
10648
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
10649
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
10650
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
10497
10651
|
* @see https://floating-ui.com/docs/flip
|
10498
10652
|
*/
|
10499
|
-
const flip = function (options) {
|
10653
|
+
const flip$1 = function (options) {
|
10500
10654
|
if (options === void 0) {
|
10501
10655
|
options = {};
|
10502
10656
|
}
|
10503
|
-
|
10504
10657
|
return {
|
10505
10658
|
name: 'flip',
|
10506
10659
|
options,
|
10507
|
-
|
10508
|
-
|
10509
|
-
var _middlewareData$flip;
|
10510
|
-
|
10660
|
+
async fn(state) {
|
10661
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
10511
10662
|
const {
|
10512
10663
|
placement,
|
10513
10664
|
middlewareData,
|
@@ -10515,48 +10666,56 @@ const flip = function (options) {
|
|
10515
10666
|
initialPlacement,
|
10516
10667
|
platform,
|
10517
10668
|
elements
|
10518
|
-
} =
|
10669
|
+
} = state;
|
10519
10670
|
const {
|
10520
10671
|
mainAxis: checkMainAxis = true,
|
10521
10672
|
crossAxis: checkCrossAxis = true,
|
10522
10673
|
fallbackPlacements: specifiedFallbackPlacements,
|
10523
10674
|
fallbackStrategy = 'bestFit',
|
10675
|
+
fallbackAxisSideDirection = 'none',
|
10524
10676
|
flipAlignment = true,
|
10525
10677
|
...detectOverflowOptions
|
10526
|
-
} = options;
|
10527
|
-
|
10528
|
-
|
10529
|
-
|
10678
|
+
} = evaluate(options, state);
|
10679
|
+
|
10680
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
10681
|
+
// added, we should skip any logic now since `flip()` has already done its
|
10682
|
+
// work.
|
10683
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
10684
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
10685
|
+
return {};
|
10686
|
+
}
|
10687
|
+
const side = getSide$1(placement);
|
10688
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
10689
|
+
const isBasePlacement = getSide$1(initialPlacement) === initialPlacement;
|
10690
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
10691
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement$1(initialPlacement)] : getExpandedPlacements$1(initialPlacement));
|
10692
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
10693
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
10694
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
10695
|
+
}
|
10530
10696
|
const placements = [initialPlacement, ...fallbackPlacements];
|
10531
|
-
const overflow = await detectOverflow(
|
10697
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
10532
10698
|
const overflows = [];
|
10533
10699
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
10534
|
-
|
10535
10700
|
if (checkMainAxis) {
|
10536
10701
|
overflows.push(overflow[side]);
|
10537
10702
|
}
|
10538
|
-
|
10539
10703
|
if (checkCrossAxis) {
|
10540
|
-
const
|
10541
|
-
|
10542
|
-
cross
|
10543
|
-
} = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
10544
|
-
overflows.push(overflow[main], overflow[cross]);
|
10704
|
+
const sides = getAlignmentSides$1(placement, rects, rtl);
|
10705
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
10545
10706
|
}
|
10546
|
-
|
10547
10707
|
overflowsData = [...overflowsData, {
|
10548
10708
|
placement,
|
10549
10709
|
overflows
|
10550
|
-
}];
|
10710
|
+
}];
|
10551
10711
|
|
10712
|
+
// One or more sides is overflowing.
|
10552
10713
|
if (!overflows.every(side => side <= 0)) {
|
10553
|
-
var _middlewareData$
|
10554
|
-
|
10555
|
-
const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
|
10714
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
10715
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
10556
10716
|
const nextPlacement = placements[nextIndex];
|
10557
|
-
|
10558
10717
|
if (nextPlacement) {
|
10559
|
-
// Try next placement and re-run the lifecycle
|
10718
|
+
// Try next placement and re-run the lifecycle.
|
10560
10719
|
return {
|
10561
10720
|
data: {
|
10562
10721
|
index: nextIndex,
|
@@ -10568,27 +10727,36 @@ const flip = function (options) {
|
|
10568
10727
|
};
|
10569
10728
|
}
|
10570
10729
|
|
10571
|
-
|
10572
|
-
|
10573
|
-
|
10574
|
-
case 'bestFit':
|
10575
|
-
{
|
10576
|
-
var _overflowsData$map$so;
|
10577
|
-
|
10578
|
-
const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
|
10730
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
10731
|
+
// then find the placement that fits the best on the main crossAxis side.
|
10732
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
10579
10733
|
|
10580
|
-
|
10581
|
-
|
10734
|
+
// Otherwise fallback.
|
10735
|
+
if (!resetPlacement) {
|
10736
|
+
switch (fallbackStrategy) {
|
10737
|
+
case 'bestFit':
|
10738
|
+
{
|
10739
|
+
var _overflowsData$filter2;
|
10740
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
10741
|
+
if (hasFallbackAxisSideDirection) {
|
10742
|
+
const currentSideAxis = getSideAxis(d.placement);
|
10743
|
+
return currentSideAxis === initialSideAxis ||
|
10744
|
+
// Create a bias to the `y` side axis due to horizontal
|
10745
|
+
// reading directions favoring greater width.
|
10746
|
+
currentSideAxis === 'y';
|
10747
|
+
}
|
10748
|
+
return true;
|
10749
|
+
}).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];
|
10750
|
+
if (placement) {
|
10751
|
+
resetPlacement = placement;
|
10752
|
+
}
|
10753
|
+
break;
|
10582
10754
|
}
|
10583
|
-
|
10755
|
+
case 'initialPlacement':
|
10756
|
+
resetPlacement = initialPlacement;
|
10584
10757
|
break;
|
10585
|
-
|
10586
|
-
|
10587
|
-
case 'initialPlacement':
|
10588
|
-
resetPlacement = initialPlacement;
|
10589
|
-
break;
|
10758
|
+
}
|
10590
10759
|
}
|
10591
|
-
|
10592
10760
|
if (placement !== resetPlacement) {
|
10593
10761
|
return {
|
10594
10762
|
reset: {
|
@@ -10597,27 +10765,229 @@ const flip = function (options) {
|
|
10597
10765
|
};
|
10598
10766
|
}
|
10599
10767
|
}
|
10600
|
-
|
10601
10768
|
return {};
|
10602
10769
|
}
|
10770
|
+
};
|
10771
|
+
};
|
10603
10772
|
|
10773
|
+
function getSideOffsets(overflow, rect) {
|
10774
|
+
return {
|
10775
|
+
top: overflow.top - rect.height,
|
10776
|
+
right: overflow.right - rect.width,
|
10777
|
+
bottom: overflow.bottom - rect.height,
|
10778
|
+
left: overflow.left - rect.width
|
10779
|
+
};
|
10780
|
+
}
|
10781
|
+
function isAnySideFullyClipped(overflow) {
|
10782
|
+
return sides.some(side => overflow[side] >= 0);
|
10783
|
+
}
|
10784
|
+
/**
|
10785
|
+
* Provides data to hide the floating element in applicable situations, such as
|
10786
|
+
* when it is not in the same clipping context as the reference element.
|
10787
|
+
* @see https://floating-ui.com/docs/hide
|
10788
|
+
*/
|
10789
|
+
const hide = function (options) {
|
10790
|
+
if (options === void 0) {
|
10791
|
+
options = {};
|
10792
|
+
}
|
10793
|
+
return {
|
10794
|
+
name: 'hide',
|
10795
|
+
options,
|
10796
|
+
async fn(state) {
|
10797
|
+
const {
|
10798
|
+
rects
|
10799
|
+
} = state;
|
10800
|
+
const {
|
10801
|
+
strategy = 'referenceHidden',
|
10802
|
+
...detectOverflowOptions
|
10803
|
+
} = evaluate(options, state);
|
10804
|
+
switch (strategy) {
|
10805
|
+
case 'referenceHidden':
|
10806
|
+
{
|
10807
|
+
const overflow = await detectOverflow$1(state, {
|
10808
|
+
...detectOverflowOptions,
|
10809
|
+
elementContext: 'reference'
|
10810
|
+
});
|
10811
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
10812
|
+
return {
|
10813
|
+
data: {
|
10814
|
+
referenceHiddenOffsets: offsets,
|
10815
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
10816
|
+
}
|
10817
|
+
};
|
10818
|
+
}
|
10819
|
+
case 'escaped':
|
10820
|
+
{
|
10821
|
+
const overflow = await detectOverflow$1(state, {
|
10822
|
+
...detectOverflowOptions,
|
10823
|
+
altBoundary: true
|
10824
|
+
});
|
10825
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
10826
|
+
return {
|
10827
|
+
data: {
|
10828
|
+
escapedOffsets: offsets,
|
10829
|
+
escaped: isAnySideFullyClipped(offsets)
|
10830
|
+
}
|
10831
|
+
};
|
10832
|
+
}
|
10833
|
+
default:
|
10834
|
+
{
|
10835
|
+
return {};
|
10836
|
+
}
|
10837
|
+
}
|
10838
|
+
}
|
10604
10839
|
};
|
10605
10840
|
};
|
10606
10841
|
|
10607
|
-
|
10842
|
+
function getBoundingRect(rects) {
|
10843
|
+
const minX = min$3(...rects.map(rect => rect.left));
|
10844
|
+
const minY = min$3(...rects.map(rect => rect.top));
|
10845
|
+
const maxX = max$3(...rects.map(rect => rect.right));
|
10846
|
+
const maxY = max$3(...rects.map(rect => rect.bottom));
|
10847
|
+
return {
|
10848
|
+
x: minX,
|
10849
|
+
y: minY,
|
10850
|
+
width: maxX - minX,
|
10851
|
+
height: maxY - minY
|
10852
|
+
};
|
10853
|
+
}
|
10854
|
+
function getRectsByLine(rects) {
|
10855
|
+
const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
|
10856
|
+
const groups = [];
|
10857
|
+
let prevRect = null;
|
10858
|
+
for (let i = 0; i < sortedRects.length; i++) {
|
10859
|
+
const rect = sortedRects[i];
|
10860
|
+
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
|
10861
|
+
groups.push([rect]);
|
10862
|
+
} else {
|
10863
|
+
groups[groups.length - 1].push(rect);
|
10864
|
+
}
|
10865
|
+
prevRect = rect;
|
10866
|
+
}
|
10867
|
+
return groups.map(rect => rectToClientRect$1(getBoundingRect(rect)));
|
10868
|
+
}
|
10869
|
+
/**
|
10870
|
+
* Provides improved positioning for inline reference elements that can span
|
10871
|
+
* over multiple lines, such as hyperlinks or range selections.
|
10872
|
+
* @see https://floating-ui.com/docs/inline
|
10873
|
+
*/
|
10874
|
+
const inline = function (options) {
|
10875
|
+
if (options === void 0) {
|
10876
|
+
options = {};
|
10877
|
+
}
|
10878
|
+
return {
|
10879
|
+
name: 'inline',
|
10880
|
+
options,
|
10881
|
+
async fn(state) {
|
10882
|
+
const {
|
10883
|
+
placement,
|
10884
|
+
elements,
|
10885
|
+
rects,
|
10886
|
+
platform,
|
10887
|
+
strategy
|
10888
|
+
} = state;
|
10889
|
+
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
10890
|
+
// ClientRect's bounds, despite the event listener being triggered. A
|
10891
|
+
// padding of 2 seems to handle this issue.
|
10892
|
+
const {
|
10893
|
+
padding = 2,
|
10894
|
+
x,
|
10895
|
+
y
|
10896
|
+
} = evaluate(options, state);
|
10897
|
+
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
|
10898
|
+
const clientRects = getRectsByLine(nativeClientRects);
|
10899
|
+
const fallback = rectToClientRect$1(getBoundingRect(nativeClientRects));
|
10900
|
+
const paddingObject = getPaddingObject(padding);
|
10901
|
+
function getBoundingClientRect() {
|
10902
|
+
// There are two rects and they are disjoined.
|
10903
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
10904
|
+
// Find the first rect in which the point is fully inside.
|
10905
|
+
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
10906
|
+
}
|
10907
|
+
|
10908
|
+
// There are 2 or more connected rects.
|
10909
|
+
if (clientRects.length >= 2) {
|
10910
|
+
if (getSideAxis(placement) === 'y') {
|
10911
|
+
const firstRect = clientRects[0];
|
10912
|
+
const lastRect = clientRects[clientRects.length - 1];
|
10913
|
+
const isTop = getSide$1(placement) === 'top';
|
10914
|
+
const top = firstRect.top;
|
10915
|
+
const bottom = lastRect.bottom;
|
10916
|
+
const left = isTop ? firstRect.left : lastRect.left;
|
10917
|
+
const right = isTop ? firstRect.right : lastRect.right;
|
10918
|
+
const width = right - left;
|
10919
|
+
const height = bottom - top;
|
10920
|
+
return {
|
10921
|
+
top,
|
10922
|
+
bottom,
|
10923
|
+
left,
|
10924
|
+
right,
|
10925
|
+
width,
|
10926
|
+
height,
|
10927
|
+
x: left,
|
10928
|
+
y: top
|
10929
|
+
};
|
10930
|
+
}
|
10931
|
+
const isLeftSide = getSide$1(placement) === 'left';
|
10932
|
+
const maxRight = max$3(...clientRects.map(rect => rect.right));
|
10933
|
+
const minLeft = min$3(...clientRects.map(rect => rect.left));
|
10934
|
+
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
10935
|
+
const top = measureRects[0].top;
|
10936
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
10937
|
+
const left = minLeft;
|
10938
|
+
const right = maxRight;
|
10939
|
+
const width = right - left;
|
10940
|
+
const height = bottom - top;
|
10941
|
+
return {
|
10942
|
+
top,
|
10943
|
+
bottom,
|
10944
|
+
left,
|
10945
|
+
right,
|
10946
|
+
width,
|
10947
|
+
height,
|
10948
|
+
x: left,
|
10949
|
+
y: top
|
10950
|
+
};
|
10951
|
+
}
|
10952
|
+
return fallback;
|
10953
|
+
}
|
10954
|
+
const resetRects = await platform.getElementRects({
|
10955
|
+
reference: {
|
10956
|
+
getBoundingClientRect
|
10957
|
+
},
|
10958
|
+
floating: elements.floating,
|
10959
|
+
strategy
|
10960
|
+
});
|
10961
|
+
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
10962
|
+
return {
|
10963
|
+
reset: {
|
10964
|
+
rects: resetRects
|
10965
|
+
}
|
10966
|
+
};
|
10967
|
+
}
|
10968
|
+
return {};
|
10969
|
+
}
|
10970
|
+
};
|
10971
|
+
};
|
10972
|
+
|
10973
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
10974
|
+
// Derivable.
|
10975
|
+
|
10976
|
+
async function convertValueToCoords$1(state, options) {
|
10608
10977
|
const {
|
10609
10978
|
placement,
|
10610
10979
|
platform,
|
10611
10980
|
elements
|
10612
|
-
} =
|
10981
|
+
} = state;
|
10613
10982
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
10614
|
-
const side = getSide(placement);
|
10615
|
-
const alignment = getAlignment(placement);
|
10616
|
-
const isVertical =
|
10983
|
+
const side = getSide$1(placement);
|
10984
|
+
const alignment = getAlignment$1(placement);
|
10985
|
+
const isVertical = getSideAxis(placement) === 'y';
|
10617
10986
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
10618
10987
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
10619
|
-
const rawValue =
|
10988
|
+
const rawValue = evaluate(options, state);
|
10620
10989
|
|
10990
|
+
// eslint-disable-next-line prefer-const
|
10621
10991
|
let {
|
10622
10992
|
mainAxis,
|
10623
10993
|
crossAxis,
|
@@ -10632,11 +11002,9 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
10632
11002
|
alignmentAxis: null,
|
10633
11003
|
...rawValue
|
10634
11004
|
};
|
10635
|
-
|
10636
11005
|
if (alignment && typeof alignmentAxis === 'number') {
|
10637
11006
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
10638
11007
|
}
|
10639
|
-
|
10640
11008
|
return isVertical ? {
|
10641
11009
|
x: crossAxis * crossAxisMulti,
|
10642
11010
|
y: mainAxis * mainAxisMulti
|
@@ -10645,60 +11013,66 @@ async function convertValueToCoords(middlewareArguments, value) {
|
|
10645
11013
|
y: crossAxis * crossAxisMulti
|
10646
11014
|
};
|
10647
11015
|
}
|
11016
|
+
|
10648
11017
|
/**
|
10649
|
-
*
|
11018
|
+
* Modifies the placement by translating the floating element along the
|
11019
|
+
* specified axes.
|
11020
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
11021
|
+
* object may be passed.
|
10650
11022
|
* @see https://floating-ui.com/docs/offset
|
10651
11023
|
*/
|
10652
|
-
|
10653
|
-
|
10654
|
-
|
10655
|
-
value = 0;
|
11024
|
+
const offset$1 = function (options) {
|
11025
|
+
if (options === void 0) {
|
11026
|
+
options = 0;
|
10656
11027
|
}
|
10657
|
-
|
10658
11028
|
return {
|
10659
11029
|
name: 'offset',
|
10660
|
-
options
|
10661
|
-
|
10662
|
-
|
11030
|
+
options,
|
11031
|
+
async fn(state) {
|
11032
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
10663
11033
|
const {
|
10664
11034
|
x,
|
10665
|
-
y
|
10666
|
-
|
10667
|
-
|
11035
|
+
y,
|
11036
|
+
placement,
|
11037
|
+
middlewareData
|
11038
|
+
} = state;
|
11039
|
+
const diffCoords = await convertValueToCoords$1(state, options);
|
11040
|
+
|
11041
|
+
// If the placement is the same and the arrow caused an alignment offset
|
11042
|
+
// then we don't need to change the positioning coordinates.
|
11043
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
11044
|
+
return {};
|
11045
|
+
}
|
10668
11046
|
return {
|
10669
11047
|
x: x + diffCoords.x,
|
10670
11048
|
y: y + diffCoords.y,
|
10671
|
-
data:
|
11049
|
+
data: {
|
11050
|
+
...diffCoords,
|
11051
|
+
placement
|
11052
|
+
}
|
10672
11053
|
};
|
10673
11054
|
}
|
10674
|
-
|
10675
11055
|
};
|
10676
11056
|
};
|
10677
11057
|
|
10678
|
-
function getCrossAxis(axis) {
|
10679
|
-
return axis === 'x' ? 'y' : 'x';
|
10680
|
-
}
|
10681
|
-
|
10682
11058
|
/**
|
10683
|
-
*
|
10684
|
-
*
|
11059
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
11060
|
+
* keep it in view when it will overflow the clipping boundary.
|
10685
11061
|
* @see https://floating-ui.com/docs/shift
|
10686
11062
|
*/
|
10687
|
-
const shift = function (options) {
|
11063
|
+
const shift$1 = function (options) {
|
10688
11064
|
if (options === void 0) {
|
10689
11065
|
options = {};
|
10690
11066
|
}
|
10691
|
-
|
10692
11067
|
return {
|
10693
11068
|
name: 'shift',
|
10694
11069
|
options,
|
10695
|
-
|
10696
|
-
async fn(middlewareArguments) {
|
11070
|
+
async fn(state) {
|
10697
11071
|
const {
|
10698
11072
|
x,
|
10699
11073
|
y,
|
10700
11074
|
placement
|
10701
|
-
} =
|
11075
|
+
} = state;
|
10702
11076
|
const {
|
10703
11077
|
mainAxis: checkMainAxis = true,
|
10704
11078
|
crossAxis: checkCrossAxis = false,
|
@@ -10715,424 +11089,547 @@ const shift = function (options) {
|
|
10715
11089
|
}
|
10716
11090
|
},
|
10717
11091
|
...detectOverflowOptions
|
10718
|
-
} = options;
|
11092
|
+
} = evaluate(options, state);
|
10719
11093
|
const coords = {
|
10720
11094
|
x,
|
10721
11095
|
y
|
10722
11096
|
};
|
10723
|
-
const overflow = await detectOverflow(
|
10724
|
-
const
|
10725
|
-
const
|
11097
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
11098
|
+
const crossAxis = getSideAxis(getSide$1(placement));
|
11099
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
10726
11100
|
let mainAxisCoord = coords[mainAxis];
|
10727
11101
|
let crossAxisCoord = coords[crossAxis];
|
10728
|
-
|
10729
11102
|
if (checkMainAxis) {
|
10730
11103
|
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
10731
11104
|
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
10732
11105
|
const min = mainAxisCoord + overflow[minSide];
|
10733
11106
|
const max = mainAxisCoord - overflow[maxSide];
|
10734
|
-
mainAxisCoord =
|
11107
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
10735
11108
|
}
|
10736
|
-
|
10737
11109
|
if (checkCrossAxis) {
|
10738
11110
|
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
10739
11111
|
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
10740
11112
|
const min = crossAxisCoord + overflow[minSide];
|
10741
11113
|
const max = crossAxisCoord - overflow[maxSide];
|
10742
|
-
crossAxisCoord =
|
11114
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
10743
11115
|
}
|
10744
|
-
|
10745
|
-
|
11116
|
+
const limitedCoords = limiter.fn({
|
11117
|
+
...state,
|
10746
11118
|
[mainAxis]: mainAxisCoord,
|
10747
11119
|
[crossAxis]: crossAxisCoord
|
10748
11120
|
});
|
10749
|
-
return {
|
11121
|
+
return {
|
11122
|
+
...limitedCoords,
|
10750
11123
|
data: {
|
10751
11124
|
x: limitedCoords.x - x,
|
10752
11125
|
y: limitedCoords.y - y
|
10753
11126
|
}
|
10754
11127
|
};
|
10755
11128
|
}
|
10756
|
-
|
10757
11129
|
};
|
10758
11130
|
};
|
10759
|
-
|
10760
|
-
|
10761
|
-
|
10762
|
-
|
10763
|
-
|
10764
|
-
|
10765
|
-
return window;
|
11131
|
+
/**
|
11132
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
11133
|
+
*/
|
11134
|
+
const limitShift = function (options) {
|
11135
|
+
if (options === void 0) {
|
11136
|
+
options = {};
|
10766
11137
|
}
|
11138
|
+
return {
|
11139
|
+
options,
|
11140
|
+
fn(state) {
|
11141
|
+
const {
|
11142
|
+
x,
|
11143
|
+
y,
|
11144
|
+
placement,
|
11145
|
+
rects,
|
11146
|
+
middlewareData
|
11147
|
+
} = state;
|
11148
|
+
const {
|
11149
|
+
offset = 0,
|
11150
|
+
mainAxis: checkMainAxis = true,
|
11151
|
+
crossAxis: checkCrossAxis = true
|
11152
|
+
} = evaluate(options, state);
|
11153
|
+
const coords = {
|
11154
|
+
x,
|
11155
|
+
y
|
11156
|
+
};
|
11157
|
+
const crossAxis = getSideAxis(placement);
|
11158
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
11159
|
+
let mainAxisCoord = coords[mainAxis];
|
11160
|
+
let crossAxisCoord = coords[crossAxis];
|
11161
|
+
const rawOffset = evaluate(offset, state);
|
11162
|
+
const computedOffset = typeof rawOffset === 'number' ? {
|
11163
|
+
mainAxis: rawOffset,
|
11164
|
+
crossAxis: 0
|
11165
|
+
} : {
|
11166
|
+
mainAxis: 0,
|
11167
|
+
crossAxis: 0,
|
11168
|
+
...rawOffset
|
11169
|
+
};
|
11170
|
+
if (checkMainAxis) {
|
11171
|
+
const len = mainAxis === 'y' ? 'height' : 'width';
|
11172
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
11173
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
11174
|
+
if (mainAxisCoord < limitMin) {
|
11175
|
+
mainAxisCoord = limitMin;
|
11176
|
+
} else if (mainAxisCoord > limitMax) {
|
11177
|
+
mainAxisCoord = limitMax;
|
11178
|
+
}
|
11179
|
+
}
|
11180
|
+
if (checkCrossAxis) {
|
11181
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
11182
|
+
const len = mainAxis === 'y' ? 'width' : 'height';
|
11183
|
+
const isOriginSide = ['top', 'left'].includes(getSide$1(placement));
|
11184
|
+
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);
|
11185
|
+
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);
|
11186
|
+
if (crossAxisCoord < limitMin) {
|
11187
|
+
crossAxisCoord = limitMin;
|
11188
|
+
} else if (crossAxisCoord > limitMax) {
|
11189
|
+
crossAxisCoord = limitMax;
|
11190
|
+
}
|
11191
|
+
}
|
11192
|
+
return {
|
11193
|
+
[mainAxis]: mainAxisCoord,
|
11194
|
+
[crossAxis]: crossAxisCoord
|
11195
|
+
};
|
11196
|
+
}
|
11197
|
+
};
|
11198
|
+
};
|
10767
11199
|
|
10768
|
-
|
10769
|
-
|
10770
|
-
|
11200
|
+
/**
|
11201
|
+
* Provides data that allows you to change the size of the floating element —
|
11202
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
11203
|
+
* width of the reference element.
|
11204
|
+
* @see https://floating-ui.com/docs/size
|
11205
|
+
*/
|
11206
|
+
const size = function (options) {
|
11207
|
+
if (options === void 0) {
|
11208
|
+
options = {};
|
10771
11209
|
}
|
11210
|
+
return {
|
11211
|
+
name: 'size',
|
11212
|
+
options,
|
11213
|
+
async fn(state) {
|
11214
|
+
const {
|
11215
|
+
placement,
|
11216
|
+
rects,
|
11217
|
+
platform,
|
11218
|
+
elements
|
11219
|
+
} = state;
|
11220
|
+
const {
|
11221
|
+
apply = () => {},
|
11222
|
+
...detectOverflowOptions
|
11223
|
+
} = evaluate(options, state);
|
11224
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
11225
|
+
const side = getSide$1(placement);
|
11226
|
+
const alignment = getAlignment$1(placement);
|
11227
|
+
const isYAxis = getSideAxis(placement) === 'y';
|
11228
|
+
const {
|
11229
|
+
width,
|
11230
|
+
height
|
11231
|
+
} = rects.floating;
|
11232
|
+
let heightSide;
|
11233
|
+
let widthSide;
|
11234
|
+
if (side === 'top' || side === 'bottom') {
|
11235
|
+
heightSide = side;
|
11236
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
11237
|
+
} else {
|
11238
|
+
widthSide = side;
|
11239
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
11240
|
+
}
|
11241
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
11242
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
11243
|
+
const overflowAvailableHeight = min$3(height - overflow[heightSide], maximumClippingHeight);
|
11244
|
+
const overflowAvailableWidth = min$3(width - overflow[widthSide], maximumClippingWidth);
|
11245
|
+
const noShift = !state.middlewareData.shift;
|
11246
|
+
let availableHeight = overflowAvailableHeight;
|
11247
|
+
let availableWidth = overflowAvailableWidth;
|
11248
|
+
if (isYAxis) {
|
11249
|
+
availableWidth = alignment || noShift ? min$3(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
11250
|
+
} else {
|
11251
|
+
availableHeight = alignment || noShift ? min$3(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
11252
|
+
}
|
11253
|
+
if (noShift && !alignment) {
|
11254
|
+
const xMin = max$3(overflow.left, 0);
|
11255
|
+
const xMax = max$3(overflow.right, 0);
|
11256
|
+
const yMin = max$3(overflow.top, 0);
|
11257
|
+
const yMax = max$3(overflow.bottom, 0);
|
11258
|
+
if (isYAxis) {
|
11259
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$3(overflow.left, overflow.right));
|
11260
|
+
} else {
|
11261
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$3(overflow.top, overflow.bottom));
|
11262
|
+
}
|
11263
|
+
}
|
11264
|
+
await apply({
|
11265
|
+
...state,
|
11266
|
+
availableWidth,
|
11267
|
+
availableHeight
|
11268
|
+
});
|
11269
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
11270
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
11271
|
+
return {
|
11272
|
+
reset: {
|
11273
|
+
rects: true
|
11274
|
+
}
|
11275
|
+
};
|
11276
|
+
}
|
11277
|
+
return {};
|
11278
|
+
}
|
11279
|
+
};
|
11280
|
+
};
|
10772
11281
|
|
10773
|
-
|
10774
|
-
|
10775
|
-
|
10776
|
-
|
10777
|
-
|
11282
|
+
function getNodeName$1(node) {
|
11283
|
+
if (isNode$1(node)) {
|
11284
|
+
return (node.nodeName || '').toLowerCase();
|
11285
|
+
}
|
11286
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
11287
|
+
// returning `#document` an infinite loop won't occur.
|
11288
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
11289
|
+
return '#document';
|
10778
11290
|
}
|
10779
|
-
|
10780
|
-
|
10781
|
-
return
|
11291
|
+
function getWindow$1(node) {
|
11292
|
+
var _node$ownerDocument;
|
11293
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
10782
11294
|
}
|
10783
|
-
|
10784
|
-
|
10785
|
-
|
10786
|
-
|
10787
|
-
if (uaData != null && uaData.brands) {
|
10788
|
-
return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
10789
|
-
}
|
10790
|
-
|
10791
|
-
return navigator.userAgent;
|
11295
|
+
function getDocumentElement$1(node) {
|
11296
|
+
var _ref;
|
11297
|
+
return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
10792
11298
|
}
|
10793
|
-
|
10794
|
-
|
10795
|
-
return value instanceof getWindow(value).HTMLElement;
|
11299
|
+
function isNode$1(value) {
|
11300
|
+
return value instanceof Node || value instanceof getWindow$1(value).Node;
|
10796
11301
|
}
|
10797
|
-
function isElement(value) {
|
10798
|
-
return value instanceof getWindow(value).Element;
|
11302
|
+
function isElement$1(value) {
|
11303
|
+
return value instanceof Element || value instanceof getWindow$1(value).Element;
|
10799
11304
|
}
|
10800
|
-
function
|
10801
|
-
return value instanceof getWindow(value).
|
11305
|
+
function isHTMLElement$1(value) {
|
11306
|
+
return value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement;
|
10802
11307
|
}
|
10803
|
-
function isShadowRoot(
|
10804
|
-
// Browsers without `ShadowRoot` support
|
11308
|
+
function isShadowRoot$1(value) {
|
11309
|
+
// Browsers without `ShadowRoot` support.
|
10805
11310
|
if (typeof ShadowRoot === 'undefined') {
|
10806
11311
|
return false;
|
10807
11312
|
}
|
10808
|
-
|
10809
|
-
const OwnElement = getWindow(node).ShadowRoot;
|
10810
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
11313
|
+
return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
|
10811
11314
|
}
|
10812
|
-
function isOverflowElement(element) {
|
10813
|
-
// Firefox wants us to check `-x` and `-y` variations as well
|
11315
|
+
function isOverflowElement$1(element) {
|
10814
11316
|
const {
|
10815
11317
|
overflow,
|
10816
11318
|
overflowX,
|
10817
|
-
overflowY
|
10818
|
-
|
10819
|
-
|
10820
|
-
|
10821
|
-
function isTableElement(element) {
|
10822
|
-
return ['table', 'td', 'th'].includes(getNodeName(element));
|
11319
|
+
overflowY,
|
11320
|
+
display
|
11321
|
+
} = getComputedStyle$2(element);
|
11322
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
10823
11323
|
}
|
10824
|
-
function
|
10825
|
-
|
10826
|
-
const isFirefox = /firefox/i.test(getUAString());
|
10827
|
-
const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
|
10828
|
-
// create a containing block.
|
10829
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
10830
|
-
|
10831
|
-
return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
|
10832
|
-
css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
|
11324
|
+
function isTableElement$1(element) {
|
11325
|
+
return ['table', 'td', 'th'].includes(getNodeName$1(element));
|
10833
11326
|
}
|
10834
|
-
function
|
10835
|
-
|
10836
|
-
|
10837
|
-
|
10838
|
-
|
10839
|
-
|
10840
|
-
|
11327
|
+
function isTopLayer(element) {
|
11328
|
+
return [':popover-open', ':modal'].some(selector => {
|
11329
|
+
try {
|
11330
|
+
return element.matches(selector);
|
11331
|
+
} catch (e) {
|
11332
|
+
return false;
|
11333
|
+
}
|
11334
|
+
});
|
10841
11335
|
}
|
11336
|
+
function isContainingBlock$1(elementOrCss) {
|
11337
|
+
const webkit = isWebKit();
|
11338
|
+
const css = isElement$1(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss;
|
10842
11339
|
|
10843
|
-
|
10844
|
-
|
10845
|
-
|
10846
|
-
|
10847
|
-
|
10848
|
-
|
10849
|
-
|
10850
|
-
|
10851
|
-
|
10852
|
-
|
10853
|
-
|
10854
|
-
|
10855
|
-
isFixedStrategy = false;
|
10856
|
-
}
|
10857
|
-
|
10858
|
-
const clientRect = element.getBoundingClientRect();
|
10859
|
-
let scaleX = 1;
|
10860
|
-
let scaleY = 1;
|
10861
|
-
|
10862
|
-
if (includeScale && isHTMLElement(element)) {
|
10863
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
10864
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
11340
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
11341
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
11342
|
+
}
|
11343
|
+
function getContainingBlock$1(element) {
|
11344
|
+
let currentNode = getParentNode$1(element);
|
11345
|
+
while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
|
11346
|
+
if (isContainingBlock$1(currentNode)) {
|
11347
|
+
return currentNode;
|
11348
|
+
} else if (isTopLayer(currentNode)) {
|
11349
|
+
return null;
|
11350
|
+
}
|
11351
|
+
currentNode = getParentNode$1(currentNode);
|
10865
11352
|
}
|
10866
|
-
|
10867
|
-
const win = isElement(element) ? getWindow(element) : window;
|
10868
|
-
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
10869
|
-
const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
|
10870
|
-
const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
|
10871
|
-
const width = clientRect.width / scaleX;
|
10872
|
-
const height = clientRect.height / scaleY;
|
10873
|
-
return {
|
10874
|
-
width,
|
10875
|
-
height,
|
10876
|
-
top: y,
|
10877
|
-
right: x + width,
|
10878
|
-
bottom: y + height,
|
10879
|
-
left: x,
|
10880
|
-
x,
|
10881
|
-
y
|
10882
|
-
};
|
11353
|
+
return null;
|
10883
11354
|
}
|
10884
|
-
|
10885
|
-
|
10886
|
-
return (
|
11355
|
+
function isWebKit() {
|
11356
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
11357
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
10887
11358
|
}
|
10888
|
-
|
10889
|
-
|
10890
|
-
|
11359
|
+
function isLastTraversableNode(node) {
|
11360
|
+
return ['html', 'body', '#document'].includes(getNodeName$1(node));
|
11361
|
+
}
|
11362
|
+
function getComputedStyle$2(element) {
|
11363
|
+
return getWindow$1(element).getComputedStyle(element);
|
11364
|
+
}
|
11365
|
+
function getNodeScroll$1(element) {
|
11366
|
+
if (isElement$1(element)) {
|
10891
11367
|
return {
|
10892
11368
|
scrollLeft: element.scrollLeft,
|
10893
11369
|
scrollTop: element.scrollTop
|
10894
11370
|
};
|
10895
11371
|
}
|
10896
|
-
|
10897
11372
|
return {
|
10898
|
-
scrollLeft: element.
|
10899
|
-
scrollTop: element.
|
11373
|
+
scrollLeft: element.scrollX,
|
11374
|
+
scrollTop: element.scrollY
|
10900
11375
|
};
|
10901
11376
|
}
|
10902
|
-
|
10903
|
-
|
10904
|
-
|
10905
|
-
|
10906
|
-
|
11377
|
+
function getParentNode$1(node) {
|
11378
|
+
if (getNodeName$1(node) === 'html') {
|
11379
|
+
return node;
|
11380
|
+
}
|
11381
|
+
const result =
|
11382
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
11383
|
+
node.assignedSlot ||
|
11384
|
+
// DOM Element detected.
|
11385
|
+
node.parentNode ||
|
11386
|
+
// ShadowRoot detected.
|
11387
|
+
isShadowRoot$1(node) && node.host ||
|
11388
|
+
// Fallback.
|
11389
|
+
getDocumentElement$1(node);
|
11390
|
+
return isShadowRoot$1(result) ? result.host : result;
|
11391
|
+
}
|
11392
|
+
function getNearestOverflowAncestor$1(node) {
|
11393
|
+
const parentNode = getParentNode$1(node);
|
11394
|
+
if (isLastTraversableNode(parentNode)) {
|
11395
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
11396
|
+
}
|
11397
|
+
if (isHTMLElement$1(parentNode) && isOverflowElement$1(parentNode)) {
|
11398
|
+
return parentNode;
|
11399
|
+
}
|
11400
|
+
return getNearestOverflowAncestor$1(parentNode);
|
10907
11401
|
}
|
10908
|
-
|
10909
|
-
|
10910
|
-
|
10911
|
-
|
11402
|
+
function getOverflowAncestors$1(node, list, traverseIframes) {
|
11403
|
+
var _node$ownerDocument2;
|
11404
|
+
if (list === void 0) {
|
11405
|
+
list = [];
|
11406
|
+
}
|
11407
|
+
if (traverseIframes === void 0) {
|
11408
|
+
traverseIframes = true;
|
11409
|
+
}
|
11410
|
+
const scrollableAncestor = getNearestOverflowAncestor$1(node);
|
11411
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
11412
|
+
const win = getWindow$1(scrollableAncestor);
|
11413
|
+
if (isBody) {
|
11414
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement$1(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors$1(win.frameElement) : []);
|
11415
|
+
}
|
11416
|
+
return list.concat(scrollableAncestor, getOverflowAncestors$1(scrollableAncestor, [], traverseIframes));
|
10912
11417
|
}
|
10913
11418
|
|
10914
|
-
function
|
10915
|
-
const
|
10916
|
-
|
10917
|
-
|
10918
|
-
|
10919
|
-
let
|
10920
|
-
|
10921
|
-
|
10922
|
-
|
10923
|
-
const
|
10924
|
-
|
10925
|
-
|
10926
|
-
|
10927
|
-
|
10928
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
10929
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
10930
|
-
scroll = getNodeScroll(offsetParent);
|
10931
|
-
}
|
10932
|
-
|
10933
|
-
if (isHTMLElement(offsetParent)) {
|
10934
|
-
const offsetRect = getBoundingClientRect(offsetParent, true);
|
10935
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
10936
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
10937
|
-
} else if (documentElement) {
|
10938
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
10939
|
-
}
|
11419
|
+
function getCssDimensions(element) {
|
11420
|
+
const css = getComputedStyle$2(element);
|
11421
|
+
// In testing environments, the `width` and `height` properties are empty
|
11422
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
11423
|
+
let width = parseFloat(css.width) || 0;
|
11424
|
+
let height = parseFloat(css.height) || 0;
|
11425
|
+
const hasOffset = isHTMLElement$1(element);
|
11426
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
11427
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
11428
|
+
const shouldFallback = round$1(width) !== offsetWidth || round$1(height) !== offsetHeight;
|
11429
|
+
if (shouldFallback) {
|
11430
|
+
width = offsetWidth;
|
11431
|
+
height = offsetHeight;
|
10940
11432
|
}
|
10941
|
-
|
10942
11433
|
return {
|
10943
|
-
|
10944
|
-
|
10945
|
-
|
10946
|
-
height: rect.height
|
11434
|
+
width,
|
11435
|
+
height,
|
11436
|
+
$: shouldFallback
|
10947
11437
|
};
|
10948
11438
|
}
|
10949
11439
|
|
10950
|
-
function
|
10951
|
-
|
10952
|
-
return node;
|
10953
|
-
}
|
10954
|
-
|
10955
|
-
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
10956
|
-
// @ts-ignore
|
10957
|
-
node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
10958
|
-
node.parentNode || ( // DOM Element detected
|
10959
|
-
isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
|
10960
|
-
getDocumentElement(node) // fallback
|
10961
|
-
|
10962
|
-
);
|
11440
|
+
function unwrapElement(element) {
|
11441
|
+
return !isElement$1(element) ? element.contextElement : element;
|
10963
11442
|
}
|
10964
11443
|
|
10965
|
-
function
|
10966
|
-
|
10967
|
-
|
11444
|
+
function getScale(element) {
|
11445
|
+
const domElement = unwrapElement(element);
|
11446
|
+
if (!isHTMLElement$1(domElement)) {
|
11447
|
+
return createCoords(1);
|
10968
11448
|
}
|
11449
|
+
const rect = domElement.getBoundingClientRect();
|
11450
|
+
const {
|
11451
|
+
width,
|
11452
|
+
height,
|
11453
|
+
$
|
11454
|
+
} = getCssDimensions(domElement);
|
11455
|
+
let x = ($ ? round$1(rect.width) : rect.width) / width;
|
11456
|
+
let y = ($ ? round$1(rect.height) : rect.height) / height;
|
10969
11457
|
|
10970
|
-
|
10971
|
-
}
|
10972
|
-
/**
|
10973
|
-
* Polyfills the old offsetParent behavior from before the spec was changed:
|
10974
|
-
* https://github.com/w3c/csswg-drafts/issues/159
|
10975
|
-
*/
|
10976
|
-
|
10977
|
-
|
10978
|
-
function composedOffsetParent(element) {
|
10979
|
-
let {
|
10980
|
-
offsetParent
|
10981
|
-
} = element;
|
10982
|
-
let ancestor = element;
|
10983
|
-
let foundInsideSlot = false;
|
10984
|
-
|
10985
|
-
while (ancestor && ancestor !== offsetParent) {
|
10986
|
-
const {
|
10987
|
-
assignedSlot
|
10988
|
-
} = ancestor;
|
10989
|
-
|
10990
|
-
if (assignedSlot) {
|
10991
|
-
let newOffsetParent = assignedSlot.offsetParent;
|
10992
|
-
|
10993
|
-
if (getComputedStyle$1(assignedSlot).display === 'contents') {
|
10994
|
-
const hadStyleAttribute = assignedSlot.hasAttribute('style');
|
10995
|
-
const oldDisplay = assignedSlot.style.display;
|
10996
|
-
assignedSlot.style.display = getComputedStyle$1(ancestor).display;
|
10997
|
-
newOffsetParent = assignedSlot.offsetParent;
|
10998
|
-
assignedSlot.style.display = oldDisplay;
|
10999
|
-
|
11000
|
-
if (!hadStyleAttribute) {
|
11001
|
-
assignedSlot.removeAttribute('style');
|
11002
|
-
}
|
11003
|
-
}
|
11004
|
-
|
11005
|
-
ancestor = assignedSlot;
|
11006
|
-
|
11007
|
-
if (offsetParent !== newOffsetParent) {
|
11008
|
-
offsetParent = newOffsetParent;
|
11009
|
-
foundInsideSlot = true;
|
11010
|
-
}
|
11011
|
-
} else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
|
11012
|
-
break;
|
11013
|
-
}
|
11458
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
11014
11459
|
|
11015
|
-
|
11460
|
+
if (!x || !Number.isFinite(x)) {
|
11461
|
+
x = 1;
|
11016
11462
|
}
|
11017
|
-
|
11018
|
-
|
11019
|
-
}
|
11020
|
-
|
11021
|
-
function getContainingBlock(element) {
|
11022
|
-
let currentNode = getParentNode(element);
|
11023
|
-
|
11024
|
-
if (isShadowRoot(currentNode)) {
|
11025
|
-
currentNode = currentNode.host;
|
11463
|
+
if (!y || !Number.isFinite(y)) {
|
11464
|
+
y = 1;
|
11026
11465
|
}
|
11466
|
+
return {
|
11467
|
+
x,
|
11468
|
+
y
|
11469
|
+
};
|
11470
|
+
}
|
11027
11471
|
|
11028
|
-
|
11029
|
-
|
11030
|
-
|
11031
|
-
|
11032
|
-
|
11033
|
-
currentNode = isShadowRoot(parent) ? parent.host : parent;
|
11034
|
-
}
|
11472
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
11473
|
+
function getVisualOffsets(element) {
|
11474
|
+
const win = getWindow$1(element);
|
11475
|
+
if (!isWebKit() || !win.visualViewport) {
|
11476
|
+
return noOffsets;
|
11035
11477
|
}
|
11036
|
-
|
11037
|
-
|
11038
|
-
|
11039
|
-
|
11040
|
-
|
11041
|
-
|
11042
|
-
|
11043
|
-
|
11044
|
-
let offsetParent = getTrueOffsetParent(element);
|
11045
|
-
|
11046
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
11047
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
11478
|
+
return {
|
11479
|
+
x: win.visualViewport.offsetLeft,
|
11480
|
+
y: win.visualViewport.offsetTop
|
11481
|
+
};
|
11482
|
+
}
|
11483
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
11484
|
+
if (isFixed === void 0) {
|
11485
|
+
isFixed = false;
|
11048
11486
|
}
|
11049
|
-
|
11050
|
-
|
11051
|
-
return window;
|
11487
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow$1(element)) {
|
11488
|
+
return false;
|
11052
11489
|
}
|
11053
|
-
|
11054
|
-
return offsetParent || getContainingBlock(element) || window;
|
11490
|
+
return isFixed;
|
11055
11491
|
}
|
11056
11492
|
|
11057
|
-
function
|
11058
|
-
if (
|
11059
|
-
|
11060
|
-
width: element.offsetWidth,
|
11061
|
-
height: element.offsetHeight
|
11062
|
-
};
|
11493
|
+
function getBoundingClientRect$1(element, includeScale, isFixedStrategy, offsetParent) {
|
11494
|
+
if (includeScale === void 0) {
|
11495
|
+
includeScale = false;
|
11063
11496
|
}
|
11064
|
-
|
11065
|
-
|
11066
|
-
|
11067
|
-
|
11068
|
-
|
11069
|
-
|
11497
|
+
if (isFixedStrategy === void 0) {
|
11498
|
+
isFixedStrategy = false;
|
11499
|
+
}
|
11500
|
+
const clientRect = element.getBoundingClientRect();
|
11501
|
+
const domElement = unwrapElement(element);
|
11502
|
+
let scale = createCoords(1);
|
11503
|
+
if (includeScale) {
|
11504
|
+
if (offsetParent) {
|
11505
|
+
if (isElement$1(offsetParent)) {
|
11506
|
+
scale = getScale(offsetParent);
|
11507
|
+
}
|
11508
|
+
} else {
|
11509
|
+
scale = getScale(element);
|
11510
|
+
}
|
11511
|
+
}
|
11512
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
11513
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
11514
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
11515
|
+
let width = clientRect.width / scale.x;
|
11516
|
+
let height = clientRect.height / scale.y;
|
11517
|
+
if (domElement) {
|
11518
|
+
const win = getWindow$1(domElement);
|
11519
|
+
const offsetWin = offsetParent && isElement$1(offsetParent) ? getWindow$1(offsetParent) : offsetParent;
|
11520
|
+
let currentWin = win;
|
11521
|
+
let currentIFrame = currentWin.frameElement;
|
11522
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
11523
|
+
const iframeScale = getScale(currentIFrame);
|
11524
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
11525
|
+
const css = getComputedStyle$2(currentIFrame);
|
11526
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
11527
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
11528
|
+
x *= iframeScale.x;
|
11529
|
+
y *= iframeScale.y;
|
11530
|
+
width *= iframeScale.x;
|
11531
|
+
height *= iframeScale.y;
|
11532
|
+
x += left;
|
11533
|
+
y += top;
|
11534
|
+
currentWin = getWindow$1(currentIFrame);
|
11535
|
+
currentIFrame = currentWin.frameElement;
|
11536
|
+
}
|
11537
|
+
}
|
11538
|
+
return rectToClientRect$1({
|
11539
|
+
width,
|
11540
|
+
height,
|
11541
|
+
x,
|
11542
|
+
y
|
11543
|
+
});
|
11070
11544
|
}
|
11071
11545
|
|
11072
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
11546
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect$1(_ref) {
|
11073
11547
|
let {
|
11548
|
+
elements,
|
11074
11549
|
rect,
|
11075
11550
|
offsetParent,
|
11076
11551
|
strategy
|
11077
11552
|
} = _ref;
|
11078
|
-
const
|
11079
|
-
const documentElement = getDocumentElement(offsetParent);
|
11080
|
-
|
11081
|
-
if (offsetParent === documentElement) {
|
11553
|
+
const isFixed = strategy === 'fixed';
|
11554
|
+
const documentElement = getDocumentElement$1(offsetParent);
|
11555
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
11556
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
11082
11557
|
return rect;
|
11083
11558
|
}
|
11084
|
-
|
11085
11559
|
let scroll = {
|
11086
11560
|
scrollLeft: 0,
|
11087
11561
|
scrollTop: 0
|
11088
11562
|
};
|
11089
|
-
|
11090
|
-
|
11091
|
-
|
11092
|
-
|
11093
|
-
|
11094
|
-
|
11095
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
11096
|
-
scroll = getNodeScroll(offsetParent);
|
11563
|
+
let scale = createCoords(1);
|
11564
|
+
const offsets = createCoords(0);
|
11565
|
+
const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
11566
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
11567
|
+
if (getNodeName$1(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
|
11568
|
+
scroll = getNodeScroll$1(offsetParent);
|
11097
11569
|
}
|
11098
|
-
|
11099
|
-
|
11100
|
-
|
11570
|
+
if (isHTMLElement$1(offsetParent)) {
|
11571
|
+
const offsetRect = getBoundingClientRect$1(offsetParent);
|
11572
|
+
scale = getScale(offsetParent);
|
11101
11573
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
11102
11574
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
11103
|
-
}
|
11104
|
-
// else if (documentElement) {
|
11105
|
-
// offsets.x = getWindowScrollBarX(documentElement);
|
11106
|
-
// }
|
11107
|
-
|
11575
|
+
}
|
11108
11576
|
}
|
11577
|
+
return {
|
11578
|
+
width: rect.width * scale.x,
|
11579
|
+
height: rect.height * scale.y,
|
11580
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
11581
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
11582
|
+
};
|
11583
|
+
}
|
11109
11584
|
|
11110
|
-
|
11111
|
-
|
11112
|
-
|
11585
|
+
function getClientRects(element) {
|
11586
|
+
return Array.from(element.getClientRects());
|
11587
|
+
}
|
11588
|
+
|
11589
|
+
function getWindowScrollBarX$1(element) {
|
11590
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
11591
|
+
// incorrect for RTL.
|
11592
|
+
return getBoundingClientRect$1(getDocumentElement$1(element)).left + getNodeScroll$1(element).scrollLeft;
|
11593
|
+
}
|
11594
|
+
|
11595
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
11596
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
11597
|
+
function getDocumentRect$1(element) {
|
11598
|
+
const html = getDocumentElement$1(element);
|
11599
|
+
const scroll = getNodeScroll$1(element);
|
11600
|
+
const body = element.ownerDocument.body;
|
11601
|
+
const width = max$3(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
11602
|
+
const height = max$3(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
11603
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX$1(element);
|
11604
|
+
const y = -scroll.scrollTop;
|
11605
|
+
if (getComputedStyle$2(body).direction === 'rtl') {
|
11606
|
+
x += max$3(html.clientWidth, body.clientWidth) - width;
|
11607
|
+
}
|
11608
|
+
return {
|
11609
|
+
width,
|
11610
|
+
height,
|
11611
|
+
x,
|
11612
|
+
y
|
11113
11613
|
};
|
11114
11614
|
}
|
11115
11615
|
|
11116
|
-
function getViewportRect(element, strategy) {
|
11117
|
-
const win = getWindow(element);
|
11118
|
-
const html = getDocumentElement(element);
|
11616
|
+
function getViewportRect$1(element, strategy) {
|
11617
|
+
const win = getWindow$1(element);
|
11618
|
+
const html = getDocumentElement$1(element);
|
11119
11619
|
const visualViewport = win.visualViewport;
|
11120
11620
|
let width = html.clientWidth;
|
11121
11621
|
let height = html.clientHeight;
|
11122
11622
|
let x = 0;
|
11123
11623
|
let y = 0;
|
11124
|
-
|
11125
11624
|
if (visualViewport) {
|
11126
11625
|
width = visualViewport.width;
|
11127
11626
|
height = visualViewport.height;
|
11128
|
-
const
|
11129
|
-
|
11130
|
-
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
11627
|
+
const visualViewportBased = isWebKit();
|
11628
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
11131
11629
|
x = visualViewport.offsetLeft;
|
11132
11630
|
y = visualViewport.offsetTop;
|
11133
11631
|
}
|
11134
11632
|
}
|
11135
|
-
|
11136
11633
|
return {
|
11137
11634
|
width,
|
11138
11635
|
height,
|
@@ -11141,23 +11638,16 @@ function getViewportRect(element, strategy) {
|
|
11141
11638
|
};
|
11142
11639
|
}
|
11143
11640
|
|
11144
|
-
//
|
11145
|
-
|
11146
|
-
|
11147
|
-
|
11148
|
-
|
11149
|
-
const
|
11150
|
-
const
|
11151
|
-
const
|
11152
|
-
const
|
11153
|
-
const
|
11154
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
11155
|
-
const y = -scroll.scrollTop;
|
11156
|
-
|
11157
|
-
if (getComputedStyle$1(body || html).direction === 'rtl') {
|
11158
|
-
x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
|
11159
|
-
}
|
11160
|
-
|
11641
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
11642
|
+
function getInnerBoundingClientRect$1(element, strategy) {
|
11643
|
+
const clientRect = getBoundingClientRect$1(element, true, strategy === 'fixed');
|
11644
|
+
const top = clientRect.top + element.clientTop;
|
11645
|
+
const left = clientRect.left + element.clientLeft;
|
11646
|
+
const scale = isHTMLElement$1(element) ? getScale(element) : createCoords(1);
|
11647
|
+
const width = element.clientWidth * scale.x;
|
11648
|
+
const height = element.clientHeight * scale.y;
|
11649
|
+
const x = left * scale.x;
|
11650
|
+
const y = top * scale.y;
|
11161
11651
|
return {
|
11162
11652
|
width,
|
11163
11653
|
height,
|
@@ -11165,125 +11655,86 @@ function getDocumentRect(element) {
|
|
11165
11655
|
y
|
11166
11656
|
};
|
11167
11657
|
}
|
11168
|
-
|
11169
|
-
|
11170
|
-
|
11171
|
-
|
11172
|
-
if (
|
11173
|
-
|
11174
|
-
|
11175
|
-
|
11176
|
-
|
11177
|
-
|
11178
|
-
|
11179
|
-
|
11180
|
-
|
11181
|
-
|
11182
|
-
}
|
11183
|
-
|
11184
|
-
function getOverflowAncestors(node, list) {
|
11185
|
-
var _node$ownerDocument;
|
11186
|
-
|
11187
|
-
if (list === void 0) {
|
11188
|
-
list = [];
|
11658
|
+
function getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy) {
|
11659
|
+
let rect;
|
11660
|
+
if (clippingAncestor === 'viewport') {
|
11661
|
+
rect = getViewportRect$1(element, strategy);
|
11662
|
+
} else if (clippingAncestor === 'document') {
|
11663
|
+
rect = getDocumentRect$1(getDocumentElement$1(element));
|
11664
|
+
} else if (isElement$1(clippingAncestor)) {
|
11665
|
+
rect = getInnerBoundingClientRect$1(clippingAncestor, strategy);
|
11666
|
+
} else {
|
11667
|
+
const visualOffsets = getVisualOffsets(element);
|
11668
|
+
rect = {
|
11669
|
+
...clippingAncestor,
|
11670
|
+
x: clippingAncestor.x - visualOffsets.x,
|
11671
|
+
y: clippingAncestor.y - visualOffsets.y
|
11672
|
+
};
|
11189
11673
|
}
|
11190
|
-
|
11191
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
11192
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
11193
|
-
const win = getWindow(scrollableAncestor);
|
11194
|
-
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
11195
|
-
const updatedList = list.concat(target);
|
11196
|
-
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
11197
|
-
updatedList.concat(getOverflowAncestors(target));
|
11674
|
+
return rectToClientRect$1(rect);
|
11198
11675
|
}
|
11199
|
-
|
11200
|
-
|
11201
|
-
|
11202
|
-
|
11203
|
-
if (parent.contains(child)) {
|
11204
|
-
return true;
|
11205
|
-
} // then fallback to custom implementation with Shadow DOM support
|
11206
|
-
else if (rootNode && isShadowRoot(rootNode)) {
|
11207
|
-
let next = child;
|
11208
|
-
|
11209
|
-
do {
|
11210
|
-
// use `===` replace node.isSameNode()
|
11211
|
-
if (next && parent === next) {
|
11212
|
-
return true;
|
11213
|
-
} // @ts-ignore: need a better way to handle this...
|
11214
|
-
|
11215
|
-
|
11216
|
-
next = next.parentNode || next.host;
|
11217
|
-
} while (next);
|
11676
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
11677
|
+
const parentNode = getParentNode$1(element);
|
11678
|
+
if (parentNode === stopNode || !isElement$1(parentNode) || isLastTraversableNode(parentNode)) {
|
11679
|
+
return false;
|
11218
11680
|
}
|
11219
|
-
|
11220
|
-
return false;
|
11221
|
-
}
|
11222
|
-
|
11223
|
-
function getInnerBoundingClientRect(element, strategy) {
|
11224
|
-
const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
|
11225
|
-
const top = clientRect.top + element.clientTop;
|
11226
|
-
const left = clientRect.left + element.clientLeft;
|
11227
|
-
return {
|
11228
|
-
top,
|
11229
|
-
left,
|
11230
|
-
x: left,
|
11231
|
-
y: top,
|
11232
|
-
right: left + element.clientWidth,
|
11233
|
-
bottom: top + element.clientHeight,
|
11234
|
-
width: element.clientWidth,
|
11235
|
-
height: element.clientHeight
|
11236
|
-
};
|
11681
|
+
return getComputedStyle$2(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
11237
11682
|
}
|
11238
11683
|
|
11239
|
-
|
11240
|
-
|
11241
|
-
|
11684
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
11685
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
11686
|
+
// of the given element up the tree.
|
11687
|
+
function getClippingElementAncestors(element, cache) {
|
11688
|
+
const cachedResult = cache.get(element);
|
11689
|
+
if (cachedResult) {
|
11690
|
+
return cachedResult;
|
11242
11691
|
}
|
11692
|
+
let result = getOverflowAncestors$1(element, [], false).filter(el => isElement$1(el) && getNodeName$1(el) !== 'body');
|
11693
|
+
let currentContainingBlockComputedStyle = null;
|
11694
|
+
const elementIsFixed = getComputedStyle$2(element).position === 'fixed';
|
11695
|
+
let currentNode = elementIsFixed ? getParentNode$1(element) : element;
|
11243
11696
|
|
11244
|
-
|
11245
|
-
|
11697
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
11698
|
+
while (isElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
|
11699
|
+
const computedStyle = getComputedStyle$2(currentNode);
|
11700
|
+
const currentNodeIsContaining = isContainingBlock$1(currentNode);
|
11701
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
11702
|
+
currentContainingBlockComputedStyle = null;
|
11703
|
+
}
|
11704
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement$1(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
11705
|
+
if (shouldDropCurrentNode) {
|
11706
|
+
// Drop non-containing blocks.
|
11707
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
11708
|
+
} else {
|
11709
|
+
// Record last containing block for next iteration.
|
11710
|
+
currentContainingBlockComputedStyle = computedStyle;
|
11711
|
+
}
|
11712
|
+
currentNode = getParentNode$1(currentNode);
|
11246
11713
|
}
|
11714
|
+
cache.set(element, result);
|
11715
|
+
return result;
|
11716
|
+
}
|
11247
11717
|
|
11248
|
-
|
11249
|
-
|
11250
|
-
|
11251
|
-
// `initial`
|
11252
|
-
|
11253
|
-
|
11254
|
-
function getClippingAncestors(element) {
|
11255
|
-
const clippingAncestors = getOverflowAncestors(element);
|
11256
|
-
const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
|
11257
|
-
const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
11258
|
-
|
11259
|
-
if (!isElement(clipperElement)) {
|
11260
|
-
return [];
|
11261
|
-
} // @ts-ignore isElement check ensures we return Array<Element>
|
11262
|
-
|
11263
|
-
|
11264
|
-
return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
11265
|
-
} // Gets the maximum area that the element is visible in due to any number of
|
11266
|
-
// clipping ancestors
|
11267
|
-
|
11268
|
-
|
11269
|
-
function getClippingRect(_ref) {
|
11718
|
+
// Gets the maximum area that the element is visible in due to any number of
|
11719
|
+
// clipping ancestors.
|
11720
|
+
function getClippingRect$1(_ref) {
|
11270
11721
|
let {
|
11271
11722
|
element,
|
11272
11723
|
boundary,
|
11273
11724
|
rootBoundary,
|
11274
11725
|
strategy
|
11275
11726
|
} = _ref;
|
11276
|
-
const
|
11277
|
-
const clippingAncestors = [...
|
11727
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
11728
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
11278
11729
|
const firstClippingAncestor = clippingAncestors[0];
|
11279
11730
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
11280
|
-
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
11281
|
-
accRect.top = max$
|
11282
|
-
accRect.right = min$
|
11283
|
-
accRect.bottom = min$
|
11284
|
-
accRect.left = max$
|
11731
|
+
const rect = getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy);
|
11732
|
+
accRect.top = max$3(rect.top, accRect.top);
|
11733
|
+
accRect.right = min$3(rect.right, accRect.right);
|
11734
|
+
accRect.bottom = min$3(rect.bottom, accRect.bottom);
|
11735
|
+
accRect.left = max$3(rect.left, accRect.left);
|
11285
11736
|
return accRect;
|
11286
|
-
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
11737
|
+
}, getClientRectFromClippingAncestor$1(element, firstClippingAncestor, strategy));
|
11287
11738
|
return {
|
11288
11739
|
width: clippingRect.right - clippingRect.left,
|
11289
11740
|
height: clippingRect.bottom - clippingRect.top,
|
@@ -11292,115 +11743,210 @@ function getClippingRect(_ref) {
|
|
11292
11743
|
};
|
11293
11744
|
}
|
11294
11745
|
|
11295
|
-
|
11296
|
-
|
11297
|
-
|
11298
|
-
|
11299
|
-
|
11300
|
-
|
11301
|
-
|
11302
|
-
|
11303
|
-
|
11304
|
-
|
11305
|
-
floating,
|
11306
|
-
strategy
|
11307
|
-
} = _ref;
|
11308
|
-
return {
|
11309
|
-
reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
|
11310
|
-
floating: { ...getDimensions(floating),
|
11311
|
-
x: 0,
|
11312
|
-
y: 0
|
11313
|
-
}
|
11314
|
-
};
|
11315
|
-
},
|
11316
|
-
getClientRects: element => Array.from(element.getClientRects()),
|
11317
|
-
isRTL: element => getComputedStyle$1(element).direction === 'rtl'
|
11318
|
-
};
|
11746
|
+
function getDimensions$1(element) {
|
11747
|
+
const {
|
11748
|
+
width,
|
11749
|
+
height
|
11750
|
+
} = getCssDimensions(element);
|
11751
|
+
return {
|
11752
|
+
width,
|
11753
|
+
height
|
11754
|
+
};
|
11755
|
+
}
|
11319
11756
|
|
11320
|
-
|
11321
|
-
|
11322
|
-
|
11323
|
-
|
11324
|
-
|
11325
|
-
|
11326
|
-
|
11757
|
+
function getRectRelativeToOffsetParent$1(element, offsetParent, strategy) {
|
11758
|
+
const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
11759
|
+
const documentElement = getDocumentElement$1(offsetParent);
|
11760
|
+
const isFixed = strategy === 'fixed';
|
11761
|
+
const rect = getBoundingClientRect$1(element, true, isFixed, offsetParent);
|
11762
|
+
let scroll = {
|
11763
|
+
scrollLeft: 0,
|
11764
|
+
scrollTop: 0
|
11765
|
+
};
|
11766
|
+
const offsets = createCoords(0);
|
11767
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
11768
|
+
if (getNodeName$1(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
|
11769
|
+
scroll = getNodeScroll$1(offsetParent);
|
11770
|
+
}
|
11771
|
+
if (isOffsetParentAnElement) {
|
11772
|
+
const offsetRect = getBoundingClientRect$1(offsetParent, true, isFixed, offsetParent);
|
11773
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
11774
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
11775
|
+
} else if (documentElement) {
|
11776
|
+
offsets.x = getWindowScrollBarX$1(documentElement);
|
11777
|
+
}
|
11327
11778
|
}
|
11779
|
+
const x = rect.left + scroll.scrollLeft - offsets.x;
|
11780
|
+
const y = rect.top + scroll.scrollTop - offsets.y;
|
11781
|
+
return {
|
11782
|
+
x,
|
11783
|
+
y,
|
11784
|
+
width: rect.width,
|
11785
|
+
height: rect.height
|
11786
|
+
};
|
11787
|
+
}
|
11328
11788
|
|
11329
|
-
|
11330
|
-
|
11331
|
-
|
11332
|
-
elementResize = true,
|
11333
|
-
animationFrame = false
|
11334
|
-
} = options;
|
11335
|
-
const ancestorScroll = _ancestorScroll && !animationFrame;
|
11336
|
-
const ancestorResize = _ancestorResize && !animationFrame;
|
11337
|
-
const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
|
11338
|
-
ancestors.forEach(ancestor => {
|
11339
|
-
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
11340
|
-
passive: true
|
11341
|
-
});
|
11342
|
-
ancestorResize && ancestor.addEventListener('resize', update);
|
11343
|
-
});
|
11344
|
-
let observer = null;
|
11789
|
+
function isStaticPositioned(element) {
|
11790
|
+
return getComputedStyle$2(element).position === 'static';
|
11791
|
+
}
|
11345
11792
|
|
11346
|
-
|
11347
|
-
|
11348
|
-
|
11349
|
-
|
11350
|
-
|
11351
|
-
|
11793
|
+
function getTrueOffsetParent$1(element, polyfill) {
|
11794
|
+
if (!isHTMLElement$1(element) || getComputedStyle$2(element).position === 'fixed') {
|
11795
|
+
return null;
|
11796
|
+
}
|
11797
|
+
if (polyfill) {
|
11798
|
+
return polyfill(element);
|
11799
|
+
}
|
11800
|
+
return element.offsetParent;
|
11801
|
+
}
|
11352
11802
|
|
11353
|
-
|
11354
|
-
|
11355
|
-
|
11356
|
-
|
11803
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
11804
|
+
// such as table ancestors and cross browser bugs.
|
11805
|
+
function getOffsetParent$1(element, polyfill) {
|
11806
|
+
const win = getWindow$1(element);
|
11807
|
+
if (isTopLayer(element)) {
|
11808
|
+
return win;
|
11357
11809
|
}
|
11810
|
+
if (!isHTMLElement$1(element)) {
|
11811
|
+
let svgOffsetParent = getParentNode$1(element);
|
11812
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
11813
|
+
if (isElement$1(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
11814
|
+
return svgOffsetParent;
|
11815
|
+
}
|
11816
|
+
svgOffsetParent = getParentNode$1(svgOffsetParent);
|
11817
|
+
}
|
11818
|
+
return win;
|
11819
|
+
}
|
11820
|
+
let offsetParent = getTrueOffsetParent$1(element, polyfill);
|
11821
|
+
while (offsetParent && isTableElement$1(offsetParent) && isStaticPositioned(offsetParent)) {
|
11822
|
+
offsetParent = getTrueOffsetParent$1(offsetParent, polyfill);
|
11823
|
+
}
|
11824
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock$1(offsetParent)) {
|
11825
|
+
return win;
|
11826
|
+
}
|
11827
|
+
return offsetParent || getContainingBlock$1(element) || win;
|
11828
|
+
}
|
11358
11829
|
|
11359
|
-
|
11360
|
-
|
11830
|
+
const getElementRects = async function (data) {
|
11831
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent$1;
|
11832
|
+
const getDimensionsFn = this.getDimensions;
|
11833
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
11834
|
+
return {
|
11835
|
+
reference: getRectRelativeToOffsetParent$1(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
11836
|
+
floating: {
|
11837
|
+
x: 0,
|
11838
|
+
y: 0,
|
11839
|
+
width: floatingDimensions.width,
|
11840
|
+
height: floatingDimensions.height
|
11841
|
+
}
|
11842
|
+
};
|
11843
|
+
};
|
11361
11844
|
|
11362
|
-
|
11363
|
-
|
11364
|
-
|
11845
|
+
function isRTL$1(element) {
|
11846
|
+
return getComputedStyle$2(element).direction === 'rtl';
|
11847
|
+
}
|
11365
11848
|
|
11366
|
-
|
11367
|
-
|
11849
|
+
const platform$1 = {
|
11850
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect$1,
|
11851
|
+
getDocumentElement: getDocumentElement$1,
|
11852
|
+
getClippingRect: getClippingRect$1,
|
11853
|
+
getOffsetParent: getOffsetParent$1,
|
11854
|
+
getElementRects,
|
11855
|
+
getClientRects,
|
11856
|
+
getDimensions: getDimensions$1,
|
11857
|
+
getScale,
|
11858
|
+
isElement: isElement$1,
|
11859
|
+
isRTL: isRTL$1
|
11860
|
+
};
|
11368
11861
|
|
11369
|
-
|
11370
|
-
|
11371
|
-
|
11862
|
+
/**
|
11863
|
+
* Modifies the placement by translating the floating element along the
|
11864
|
+
* specified axes.
|
11865
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
11866
|
+
* object may be passed.
|
11867
|
+
* @see https://floating-ui.com/docs/offset
|
11868
|
+
*/
|
11869
|
+
offset$1;
|
11372
11870
|
|
11373
|
-
|
11374
|
-
|
11375
|
-
|
11871
|
+
/**
|
11872
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
11873
|
+
* that has the most space available automatically, without needing to specify a
|
11874
|
+
* preferred placement. Alternative to `flip`.
|
11875
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
11876
|
+
*/
|
11877
|
+
autoPlacement;
|
11376
11878
|
|
11377
|
-
|
11378
|
-
|
11379
|
-
|
11879
|
+
/**
|
11880
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
11881
|
+
* keep it in view when it will overflow the clipping boundary.
|
11882
|
+
* @see https://floating-ui.com/docs/shift
|
11883
|
+
*/
|
11884
|
+
shift$1;
|
11380
11885
|
|
11381
|
-
|
11382
|
-
|
11383
|
-
|
11384
|
-
|
11385
|
-
|
11386
|
-
|
11886
|
+
/**
|
11887
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
11888
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
11889
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
11890
|
+
* @see https://floating-ui.com/docs/flip
|
11891
|
+
*/
|
11892
|
+
flip$1;
|
11387
11893
|
|
11388
|
-
|
11389
|
-
|
11390
|
-
|
11391
|
-
|
11392
|
-
|
11894
|
+
/**
|
11895
|
+
* Provides data that allows you to change the size of the floating element —
|
11896
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
11897
|
+
* width of the reference element.
|
11898
|
+
* @see https://floating-ui.com/docs/size
|
11899
|
+
*/
|
11900
|
+
size;
|
11393
11901
|
|
11394
11902
|
/**
|
11395
|
-
*
|
11396
|
-
*
|
11397
|
-
*
|
11903
|
+
* Provides data to hide the floating element in applicable situations, such as
|
11904
|
+
* when it is not in the same clipping context as the reference element.
|
11905
|
+
* @see https://floating-ui.com/docs/hide
|
11398
11906
|
*/
|
11907
|
+
hide;
|
11399
11908
|
|
11400
|
-
|
11401
|
-
|
11402
|
-
|
11403
|
-
|
11909
|
+
/**
|
11910
|
+
* Provides data to position an inner element of the floating element so that it
|
11911
|
+
* appears centered to the reference element.
|
11912
|
+
* @see https://floating-ui.com/docs/arrow
|
11913
|
+
*/
|
11914
|
+
const arrow$1 = arrow$2;
|
11915
|
+
|
11916
|
+
/**
|
11917
|
+
* Provides improved positioning for inline reference elements that can span
|
11918
|
+
* over multiple lines, such as hyperlinks or range selections.
|
11919
|
+
* @see https://floating-ui.com/docs/inline
|
11920
|
+
*/
|
11921
|
+
inline;
|
11922
|
+
|
11923
|
+
/**
|
11924
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
11925
|
+
*/
|
11926
|
+
limitShift;
|
11927
|
+
|
11928
|
+
/**
|
11929
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
11930
|
+
* next to a given reference element.
|
11931
|
+
*/
|
11932
|
+
const computePosition$2 = (reference, floating, options) => {
|
11933
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
11934
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
11935
|
+
// single call. If other functions become expensive, we can add them as well.
|
11936
|
+
const cache = new Map();
|
11937
|
+
const mergedOptions = {
|
11938
|
+
platform: platform$1,
|
11939
|
+
...options
|
11940
|
+
};
|
11941
|
+
const platformWithCache = {
|
11942
|
+
...mergedOptions.platform,
|
11943
|
+
_c: cache
|
11944
|
+
};
|
11945
|
+
return computePosition$3(reference, floating, {
|
11946
|
+
...mergedOptions,
|
11947
|
+
platform: platformWithCache
|
11948
|
+
});
|
11949
|
+
};
|
11404
11950
|
|
11405
11951
|
const useFloatingProps = buildProps({});
|
11406
11952
|
const unrefReference = (elRef) => {
|
@@ -11441,7 +11987,7 @@ const useFloating$1 = ({
|
|
11441
11987
|
const contentEl = unrefElement(contentRef);
|
11442
11988
|
if (!referenceEl || !contentEl)
|
11443
11989
|
return;
|
11444
|
-
const data = await computePosition(referenceEl, contentEl, {
|
11990
|
+
const data = await computePosition$2(referenceEl, contentEl, {
|
11445
11991
|
placement: unref(placement),
|
11446
11992
|
strategy: unref(strategy),
|
11447
11993
|
middleware: unref(middleware)
|
@@ -11476,7 +12022,7 @@ const arrowMiddleware = ({
|
|
11476
12022
|
const arrowEl = unref(arrowRef);
|
11477
12023
|
if (!arrowEl)
|
11478
12024
|
return {};
|
11479
|
-
return arrow({
|
12025
|
+
return arrow$1({
|
11480
12026
|
element: arrowEl,
|
11481
12027
|
padding
|
11482
12028
|
}).fn(args);
|
@@ -11881,7 +12427,7 @@ const ConfigProvider = defineComponent({
|
|
11881
12427
|
|
11882
12428
|
const ElConfigProvider = withInstall(ConfigProvider);
|
11883
12429
|
|
11884
|
-
const version$1 = "0.0.
|
12430
|
+
const version$1 = "0.0.20250809";
|
11885
12431
|
|
11886
12432
|
const makeInstaller = (components = []) => {
|
11887
12433
|
const install = (app, options) => {
|
@@ -14097,10 +14643,10 @@ function calculateNodeStyling(targetElement) {
|
|
14097
14643
|
return { contextStyle, paddingSize, borderSize, boxSizing };
|
14098
14644
|
}
|
14099
14645
|
function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
|
14100
|
-
var _a;
|
14646
|
+
var _a, _b;
|
14101
14647
|
if (!hiddenTextarea) {
|
14102
14648
|
hiddenTextarea = document.createElement("textarea");
|
14103
|
-
document.body.appendChild(hiddenTextarea);
|
14649
|
+
((_a = targetElement.parentNode) != null ? _a : document.body).appendChild(hiddenTextarea);
|
14104
14650
|
}
|
14105
14651
|
const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
|
14106
14652
|
contextStyle.forEach(([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value));
|
@@ -14131,7 +14677,7 @@ function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
|
|
14131
14677
|
height = Math.min(maxHeight, height);
|
14132
14678
|
}
|
14133
14679
|
result.height = `${height}px`;
|
14134
|
-
(
|
14680
|
+
(_b = hiddenTextarea.parentNode) == null ? void 0 : _b.removeChild(hiddenTextarea);
|
14135
14681
|
hiddenTextarea = void 0;
|
14136
14682
|
return result;
|
14137
14683
|
}
|
@@ -15395,7 +15941,7 @@ const _sfc_main$2p = /* @__PURE__ */ defineComponent({
|
|
15395
15941
|
watch(triggerRef, (el, prevEl) => {
|
15396
15942
|
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
15397
15943
|
virtualTriggerAriaStopWatch = void 0;
|
15398
|
-
if (isElement$
|
15944
|
+
if (isElement$2(el)) {
|
15399
15945
|
TRIGGER_ELE_EVENTS.forEach((eventName) => {
|
15400
15946
|
var _a;
|
15401
15947
|
const handler = props[eventName];
|
@@ -15417,7 +15963,7 @@ const _sfc_main$2p = /* @__PURE__ */ defineComponent({
|
|
15417
15963
|
}, { immediate: true });
|
15418
15964
|
}
|
15419
15965
|
}
|
15420
|
-
if (isElement$
|
15966
|
+
if (isElement$2(prevEl) && isFocusable(prevEl)) {
|
15421
15967
|
[
|
15422
15968
|
"aria-controls",
|
15423
15969
|
"aria-describedby",
|
@@ -15432,7 +15978,7 @@ const _sfc_main$2p = /* @__PURE__ */ defineComponent({
|
|
15432
15978
|
onBeforeUnmount(() => {
|
15433
15979
|
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
15434
15980
|
virtualTriggerAriaStopWatch = void 0;
|
15435
|
-
if (triggerRef.value && isElement$
|
15981
|
+
if (triggerRef.value && isElement$2(triggerRef.value)) {
|
15436
15982
|
const el = triggerRef.value;
|
15437
15983
|
TRIGGER_ELE_EVENTS.forEach((eventName) => {
|
15438
15984
|
const handler = props[eventName];
|
@@ -15527,7 +16073,7 @@ const tryFocus = (element, shouldSelect) => {
|
|
15527
16073
|
if (element && element.focus) {
|
15528
16074
|
const prevFocusedElement = document.activeElement;
|
15529
16075
|
let cleanup = false;
|
15530
|
-
if (isElement$
|
16076
|
+
if (isElement$2(element) && !isFocusable(element) && !element.getAttribute("tabindex")) {
|
15531
16077
|
element.setAttribute("tabindex", "-1");
|
15532
16078
|
cleanup = true;
|
15533
16079
|
}
|
@@ -15536,7 +16082,7 @@ const tryFocus = (element, shouldSelect) => {
|
|
15536
16082
|
if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
|
15537
16083
|
element.select();
|
15538
16084
|
}
|
15539
|
-
if (isElement$
|
16085
|
+
if (isElement$2(element) && cleanup) {
|
15540
16086
|
element.removeAttribute("tabindex");
|
15541
16087
|
}
|
15542
16088
|
}
|
@@ -16222,14 +16768,14 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
|
|
16222
16768
|
triggerTargetAriaStopWatch = void 0;
|
16223
16769
|
const el = unref(triggerTargetEl || contentRef.value);
|
16224
16770
|
const prevEl = unref(prevTriggerTargetEl || contentRef.value);
|
16225
|
-
if (isElement$
|
16771
|
+
if (isElement$2(el)) {
|
16226
16772
|
triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
|
16227
16773
|
["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
|
16228
16774
|
isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
16229
16775
|
});
|
16230
16776
|
}, { immediate: true });
|
16231
16777
|
}
|
16232
|
-
if (prevEl !== el && isElement$
|
16778
|
+
if (prevEl !== el && isElement$2(prevEl)) {
|
16233
16779
|
["role", "aria-label", "aria-modal", "id"].forEach((key) => {
|
16234
16780
|
prevEl.removeAttribute(key);
|
16235
16781
|
});
|
@@ -18334,6 +18880,10 @@ var TinyColor = function() {
|
|
18334
18880
|
this.roundA = Math.round(100 * this.a) / 100;
|
18335
18881
|
return this;
|
18336
18882
|
};
|
18883
|
+
TinyColor2.prototype.isMonochrome = function() {
|
18884
|
+
var s = this.toHsl().s;
|
18885
|
+
return s === 0;
|
18886
|
+
};
|
18337
18887
|
TinyColor2.prototype.toHsv = function() {
|
18338
18888
|
var hsv = rgbToHsv(this.r, this.g, this.b);
|
18339
18889
|
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
|
@@ -18380,6 +18930,12 @@ var TinyColor = function() {
|
|
18380
18930
|
}
|
18381
18931
|
return "#" + this.toHex8(allow4Char);
|
18382
18932
|
};
|
18933
|
+
TinyColor2.prototype.toHexShortString = function(allowShortChar) {
|
18934
|
+
if (allowShortChar === void 0) {
|
18935
|
+
allowShortChar = false;
|
18936
|
+
}
|
18937
|
+
return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
|
18938
|
+
};
|
18383
18939
|
TinyColor2.prototype.toRgb = function() {
|
18384
18940
|
return {
|
18385
18941
|
r: Math.round(this.r),
|
@@ -18605,10 +19161,12 @@ var TinyColor = function() {
|
|
18605
19161
|
TinyColor2.prototype.onBackground = function(background) {
|
18606
19162
|
var fg = this.toRgb();
|
18607
19163
|
var bg = new TinyColor2(background).toRgb();
|
19164
|
+
var alpha = fg.a + bg.a * (1 - fg.a);
|
18608
19165
|
return new TinyColor2({
|
18609
|
-
r:
|
18610
|
-
g:
|
18611
|
-
b:
|
19166
|
+
r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
|
19167
|
+
g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
|
19168
|
+
b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
|
19169
|
+
a: alpha
|
18612
19170
|
});
|
18613
19171
|
};
|
18614
19172
|
TinyColor2.prototype.triad = function() {
|
@@ -20309,7 +20867,7 @@ function createDocumentHandler(el, binding) {
|
|
20309
20867
|
let excludes = [];
|
20310
20868
|
if (isArray$1(binding.arg)) {
|
20311
20869
|
excludes = binding.arg;
|
20312
|
-
} else if (isElement$
|
20870
|
+
} else if (isElement$2(binding.arg)) {
|
20313
20871
|
excludes.push(binding.arg);
|
20314
20872
|
}
|
20315
20873
|
return function(mouseup, mousedown) {
|
@@ -23867,7 +24425,7 @@ const calculatePathNodes = (node) => {
|
|
23867
24425
|
}
|
23868
24426
|
return nodes;
|
23869
24427
|
};
|
23870
|
-
class Node$
|
24428
|
+
class Node$3 {
|
23871
24429
|
constructor(data, config, parent, root = false) {
|
23872
24430
|
this.data = data;
|
23873
24431
|
this.config = config;
|
@@ -23887,7 +24445,7 @@ class Node$2 {
|
|
23887
24445
|
this.pathValues = pathNodes.map((node) => node.value);
|
23888
24446
|
this.pathLabels = pathNodes.map((node) => node.label);
|
23889
24447
|
this.childrenData = childrenData;
|
23890
|
-
this.children = (childrenData || []).map((child) => new Node$
|
24448
|
+
this.children = (childrenData || []).map((child) => new Node$3(child, config, this));
|
23891
24449
|
this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
|
23892
24450
|
this.text = "";
|
23893
24451
|
}
|
@@ -23908,7 +24466,7 @@ class Node$2 {
|
|
23908
24466
|
}
|
23909
24467
|
appendChild(childData) {
|
23910
24468
|
const { childrenData, children } = this;
|
23911
|
-
const node = new Node$
|
24469
|
+
const node = new Node$3(childData, this.config, this);
|
23912
24470
|
if (isArray$1(childrenData)) {
|
23913
24471
|
childrenData.push(childData);
|
23914
24472
|
} else {
|
@@ -23972,7 +24530,7 @@ class Node$2 {
|
|
23972
24530
|
}
|
23973
24531
|
}
|
23974
24532
|
}
|
23975
|
-
var Node$
|
24533
|
+
var Node$4 = Node$3;
|
23976
24534
|
|
23977
24535
|
const flatNodes = (nodes, leafOnly) => {
|
23978
24536
|
return nodes.reduce((res, node) => {
|
@@ -23988,7 +24546,7 @@ const flatNodes = (nodes, leafOnly) => {
|
|
23988
24546
|
class Store {
|
23989
24547
|
constructor(data, config) {
|
23990
24548
|
this.config = config;
|
23991
|
-
const nodes = (data || []).map((nodeData) => new Node$
|
24549
|
+
const nodes = (data || []).map((nodeData) => new Node$4(nodeData, this.config));
|
23992
24550
|
this.nodes = nodes;
|
23993
24551
|
this.allNodes = flatNodes(nodes, false);
|
23994
24552
|
this.leafNodes = flatNodes(nodes, true);
|
@@ -24000,7 +24558,7 @@ class Store {
|
|
24000
24558
|
return leafOnly ? this.leafNodes : this.allNodes;
|
24001
24559
|
}
|
24002
24560
|
appendNode(nodeData, parentNode) {
|
24003
|
-
const node = parentNode ? parentNode.appendChild(nodeData) : new Node$
|
24561
|
+
const node = parentNode ? parentNode.appendChild(nodeData) : new Node$4(nodeData, this.config);
|
24004
24562
|
if (!parentNode)
|
24005
24563
|
this.nodes.push(node);
|
24006
24564
|
this.appendAllNodesAndLeafNodes(node);
|
@@ -24162,7 +24720,7 @@ const _sfc_main$1U = /* @__PURE__ */ defineComponent({
|
|
24162
24720
|
};
|
24163
24721
|
const lazyLoad = (node, cb) => {
|
24164
24722
|
const cfg = config.value;
|
24165
|
-
node = node || new Node$
|
24723
|
+
node = node || new Node$4({}, cfg, void 0, true);
|
24166
24724
|
node.loading = true;
|
24167
24725
|
const resolve = (dataList) => {
|
24168
24726
|
const _node = node;
|
@@ -33807,7 +34365,7 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
33807
34365
|
return;
|
33808
34366
|
await nextTick();
|
33809
34367
|
const { scrollContainer } = props;
|
33810
|
-
if (isElement$
|
34368
|
+
if (isElement$2(scrollContainer)) {
|
33811
34369
|
_scrollContainer.value = scrollContainer;
|
33812
34370
|
} else if (isString$1(scrollContainer) && scrollContainer !== "") {
|
33813
34371
|
_scrollContainer.value = (_a = document.querySelector(scrollContainer)) != null ? _a : void 0;
|
@@ -41081,7 +41639,7 @@ const FixedSizeGrid = createGrid$1({
|
|
41081
41639
|
});
|
41082
41640
|
var FixedSizeGrid$1 = FixedSizeGrid;
|
41083
41641
|
|
41084
|
-
const { max, min, floor } = Math;
|
41642
|
+
const { max: max$2, min: min$2, floor } = Math;
|
41085
41643
|
const ACCESS_SIZER_KEY_MAP = {
|
41086
41644
|
column: "columnWidth",
|
41087
41645
|
row: "rowHeight"
|
@@ -41126,7 +41684,7 @@ const bs = (props, gridCache, low, high, offset, type) => {
|
|
41126
41684
|
high = mid - 1;
|
41127
41685
|
}
|
41128
41686
|
}
|
41129
|
-
return max(0, low - 1);
|
41687
|
+
return max$2(0, low - 1);
|
41130
41688
|
};
|
41131
41689
|
const es = (props, gridCache, idx, offset, type) => {
|
41132
41690
|
const total = type === "column" ? props.totalColumn : props.totalRow;
|
@@ -41135,7 +41693,7 @@ const es = (props, gridCache, idx, offset, type) => {
|
|
41135
41693
|
idx += exponent;
|
41136
41694
|
exponent *= 2;
|
41137
41695
|
}
|
41138
|
-
return bs(props, gridCache, floor(idx / 2), min(idx, total - 1), offset, type);
|
41696
|
+
return bs(props, gridCache, floor(idx / 2), min$2(idx, total - 1), offset, type);
|
41139
41697
|
};
|
41140
41698
|
const findItem = (props, gridCache, offset, type) => {
|
41141
41699
|
const [cache, lastVisitedIndex] = [
|
@@ -41146,7 +41704,7 @@ const findItem = (props, gridCache, offset, type) => {
|
|
41146
41704
|
if (lastVisitedItemOffset >= offset) {
|
41147
41705
|
return bs(props, gridCache, 0, lastVisitedIndex, offset, type);
|
41148
41706
|
}
|
41149
|
-
return es(props, gridCache, max(0, lastVisitedIndex), offset, type);
|
41707
|
+
return es(props, gridCache, max$2(0, lastVisitedIndex), offset, type);
|
41150
41708
|
};
|
41151
41709
|
const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
|
41152
41710
|
let sizeOfVisitedRows = 0;
|
@@ -41185,8 +41743,8 @@ const getOffset$1 = (props, index, alignment, scrollOffset, cache, type, scrollB
|
|
41185
41743
|
];
|
41186
41744
|
const item = getItemFromCache(props, index, cache, type);
|
41187
41745
|
const estimatedSize = estimatedSizeAssociates(props, cache);
|
41188
|
-
const maxOffset = max(0, min(estimatedSize - size, item.offset));
|
41189
|
-
const minOffset = max(0, item.offset - size + scrollBarWidth + item.size);
|
41746
|
+
const maxOffset = max$2(0, min$2(estimatedSize - size, item.offset));
|
41747
|
+
const minOffset = max$2(0, item.offset - size + scrollBarWidth + item.size);
|
41190
41748
|
if (alignment === SMART_ALIGNMENT) {
|
41191
41749
|
if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
|
41192
41750
|
alignment = AUTO_ALIGNMENT;
|
@@ -47138,7 +47696,7 @@ function useEvent(props, emit) {
|
|
47138
47696
|
if (column.children && column.children.length > 0)
|
47139
47697
|
return;
|
47140
47698
|
const el = event.target;
|
47141
|
-
if (!isElement$
|
47699
|
+
if (!isElement$2(el)) {
|
47142
47700
|
return;
|
47143
47701
|
}
|
47144
47702
|
const target = el == null ? void 0 : el.closest("th");
|
@@ -53263,6 +53821,1297 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
53263
53821
|
});
|
53264
53822
|
var TooltipV2Arrow = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "arrow.vue"]]);
|
53265
53823
|
|
53824
|
+
function getSide(placement) {
|
53825
|
+
return placement.split('-')[0];
|
53826
|
+
}
|
53827
|
+
|
53828
|
+
function getAlignment(placement) {
|
53829
|
+
return placement.split('-')[1];
|
53830
|
+
}
|
53831
|
+
|
53832
|
+
function getMainAxisFromPlacement(placement) {
|
53833
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
|
53834
|
+
}
|
53835
|
+
|
53836
|
+
function getLengthFromAxis(axis) {
|
53837
|
+
return axis === 'y' ? 'height' : 'width';
|
53838
|
+
}
|
53839
|
+
|
53840
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
53841
|
+
let {
|
53842
|
+
reference,
|
53843
|
+
floating
|
53844
|
+
} = _ref;
|
53845
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
53846
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
53847
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
53848
|
+
const length = getLengthFromAxis(mainAxis);
|
53849
|
+
const commonAlign = reference[length] / 2 - floating[length] / 2;
|
53850
|
+
const side = getSide(placement);
|
53851
|
+
const isVertical = mainAxis === 'x';
|
53852
|
+
let coords;
|
53853
|
+
|
53854
|
+
switch (side) {
|
53855
|
+
case 'top':
|
53856
|
+
coords = {
|
53857
|
+
x: commonX,
|
53858
|
+
y: reference.y - floating.height
|
53859
|
+
};
|
53860
|
+
break;
|
53861
|
+
|
53862
|
+
case 'bottom':
|
53863
|
+
coords = {
|
53864
|
+
x: commonX,
|
53865
|
+
y: reference.y + reference.height
|
53866
|
+
};
|
53867
|
+
break;
|
53868
|
+
|
53869
|
+
case 'right':
|
53870
|
+
coords = {
|
53871
|
+
x: reference.x + reference.width,
|
53872
|
+
y: commonY
|
53873
|
+
};
|
53874
|
+
break;
|
53875
|
+
|
53876
|
+
case 'left':
|
53877
|
+
coords = {
|
53878
|
+
x: reference.x - floating.width,
|
53879
|
+
y: commonY
|
53880
|
+
};
|
53881
|
+
break;
|
53882
|
+
|
53883
|
+
default:
|
53884
|
+
coords = {
|
53885
|
+
x: reference.x,
|
53886
|
+
y: reference.y
|
53887
|
+
};
|
53888
|
+
}
|
53889
|
+
|
53890
|
+
switch (getAlignment(placement)) {
|
53891
|
+
case 'start':
|
53892
|
+
coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
53893
|
+
break;
|
53894
|
+
|
53895
|
+
case 'end':
|
53896
|
+
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
53897
|
+
break;
|
53898
|
+
}
|
53899
|
+
|
53900
|
+
return coords;
|
53901
|
+
}
|
53902
|
+
|
53903
|
+
/**
|
53904
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
53905
|
+
* next to a reference element when it is given a certain positioning strategy.
|
53906
|
+
*
|
53907
|
+
* This export does not have any `platform` interface logic. You will need to
|
53908
|
+
* write one for the platform you are using Floating UI with.
|
53909
|
+
*/
|
53910
|
+
|
53911
|
+
const computePosition$1 = async (reference, floating, config) => {
|
53912
|
+
const {
|
53913
|
+
placement = 'bottom',
|
53914
|
+
strategy = 'absolute',
|
53915
|
+
middleware = [],
|
53916
|
+
platform
|
53917
|
+
} = config;
|
53918
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
53919
|
+
|
53920
|
+
let rects = await platform.getElementRects({
|
53921
|
+
reference,
|
53922
|
+
floating,
|
53923
|
+
strategy
|
53924
|
+
});
|
53925
|
+
let {
|
53926
|
+
x,
|
53927
|
+
y
|
53928
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
53929
|
+
let statefulPlacement = placement;
|
53930
|
+
let middlewareData = {};
|
53931
|
+
let resetCount = 0;
|
53932
|
+
|
53933
|
+
for (let i = 0; i < middleware.length; i++) {
|
53934
|
+
const {
|
53935
|
+
name,
|
53936
|
+
fn
|
53937
|
+
} = middleware[i];
|
53938
|
+
const {
|
53939
|
+
x: nextX,
|
53940
|
+
y: nextY,
|
53941
|
+
data,
|
53942
|
+
reset
|
53943
|
+
} = await fn({
|
53944
|
+
x,
|
53945
|
+
y,
|
53946
|
+
initialPlacement: placement,
|
53947
|
+
placement: statefulPlacement,
|
53948
|
+
strategy,
|
53949
|
+
middlewareData,
|
53950
|
+
rects,
|
53951
|
+
platform,
|
53952
|
+
elements: {
|
53953
|
+
reference,
|
53954
|
+
floating
|
53955
|
+
}
|
53956
|
+
});
|
53957
|
+
x = nextX != null ? nextX : x;
|
53958
|
+
y = nextY != null ? nextY : y;
|
53959
|
+
middlewareData = { ...middlewareData,
|
53960
|
+
[name]: { ...middlewareData[name],
|
53961
|
+
...data
|
53962
|
+
}
|
53963
|
+
};
|
53964
|
+
|
53965
|
+
if (reset && resetCount <= 50) {
|
53966
|
+
resetCount++;
|
53967
|
+
|
53968
|
+
if (typeof reset === 'object') {
|
53969
|
+
if (reset.placement) {
|
53970
|
+
statefulPlacement = reset.placement;
|
53971
|
+
}
|
53972
|
+
|
53973
|
+
if (reset.rects) {
|
53974
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
53975
|
+
reference,
|
53976
|
+
floating,
|
53977
|
+
strategy
|
53978
|
+
}) : reset.rects;
|
53979
|
+
}
|
53980
|
+
|
53981
|
+
({
|
53982
|
+
x,
|
53983
|
+
y
|
53984
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
53985
|
+
}
|
53986
|
+
|
53987
|
+
i = -1;
|
53988
|
+
continue;
|
53989
|
+
}
|
53990
|
+
}
|
53991
|
+
|
53992
|
+
return {
|
53993
|
+
x,
|
53994
|
+
y,
|
53995
|
+
placement: statefulPlacement,
|
53996
|
+
strategy,
|
53997
|
+
middlewareData
|
53998
|
+
};
|
53999
|
+
};
|
54000
|
+
|
54001
|
+
function expandPaddingObject(padding) {
|
54002
|
+
return {
|
54003
|
+
top: 0,
|
54004
|
+
right: 0,
|
54005
|
+
bottom: 0,
|
54006
|
+
left: 0,
|
54007
|
+
...padding
|
54008
|
+
};
|
54009
|
+
}
|
54010
|
+
|
54011
|
+
function getSideObjectFromPadding(padding) {
|
54012
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
54013
|
+
top: padding,
|
54014
|
+
right: padding,
|
54015
|
+
bottom: padding,
|
54016
|
+
left: padding
|
54017
|
+
};
|
54018
|
+
}
|
54019
|
+
|
54020
|
+
function rectToClientRect(rect) {
|
54021
|
+
return { ...rect,
|
54022
|
+
top: rect.y,
|
54023
|
+
left: rect.x,
|
54024
|
+
right: rect.x + rect.width,
|
54025
|
+
bottom: rect.y + rect.height
|
54026
|
+
};
|
54027
|
+
}
|
54028
|
+
|
54029
|
+
/**
|
54030
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
54031
|
+
* element is overflowing a given clipping boundary.
|
54032
|
+
* - positive = overflowing the boundary by that number of pixels
|
54033
|
+
* - negative = how many pixels left before it will overflow
|
54034
|
+
* - 0 = lies flush with the boundary
|
54035
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
54036
|
+
*/
|
54037
|
+
async function detectOverflow(middlewareArguments, options) {
|
54038
|
+
var _await$platform$isEle;
|
54039
|
+
|
54040
|
+
if (options === void 0) {
|
54041
|
+
options = {};
|
54042
|
+
}
|
54043
|
+
|
54044
|
+
const {
|
54045
|
+
x,
|
54046
|
+
y,
|
54047
|
+
platform,
|
54048
|
+
rects,
|
54049
|
+
elements,
|
54050
|
+
strategy
|
54051
|
+
} = middlewareArguments;
|
54052
|
+
const {
|
54053
|
+
boundary = 'clippingAncestors',
|
54054
|
+
rootBoundary = 'viewport',
|
54055
|
+
elementContext = 'floating',
|
54056
|
+
altBoundary = false,
|
54057
|
+
padding = 0
|
54058
|
+
} = options;
|
54059
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
54060
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
54061
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
54062
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
54063
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
54064
|
+
boundary,
|
54065
|
+
rootBoundary,
|
54066
|
+
strategy
|
54067
|
+
}));
|
54068
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
54069
|
+
rect: elementContext === 'floating' ? { ...rects.floating,
|
54070
|
+
x,
|
54071
|
+
y
|
54072
|
+
} : rects.reference,
|
54073
|
+
offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
|
54074
|
+
strategy
|
54075
|
+
}) : rects[elementContext]);
|
54076
|
+
return {
|
54077
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
54078
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
54079
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
54080
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
54081
|
+
};
|
54082
|
+
}
|
54083
|
+
|
54084
|
+
const min$1 = Math.min;
|
54085
|
+
const max$1 = Math.max;
|
54086
|
+
|
54087
|
+
function within(min$1$1, value, max$1$1) {
|
54088
|
+
return max$1(min$1$1, min$1(value, max$1$1));
|
54089
|
+
}
|
54090
|
+
|
54091
|
+
/**
|
54092
|
+
* Positions an inner element of the floating element such that it is centered
|
54093
|
+
* to the reference element.
|
54094
|
+
* @see https://floating-ui.com/docs/arrow
|
54095
|
+
*/
|
54096
|
+
const arrow = options => ({
|
54097
|
+
name: 'arrow',
|
54098
|
+
options,
|
54099
|
+
|
54100
|
+
async fn(middlewareArguments) {
|
54101
|
+
// Since `element` is required, we don't Partial<> the type
|
54102
|
+
const {
|
54103
|
+
element,
|
54104
|
+
padding = 0
|
54105
|
+
} = options != null ? options : {};
|
54106
|
+
const {
|
54107
|
+
x,
|
54108
|
+
y,
|
54109
|
+
placement,
|
54110
|
+
rects,
|
54111
|
+
platform
|
54112
|
+
} = middlewareArguments;
|
54113
|
+
|
54114
|
+
if (element == null) {
|
54115
|
+
|
54116
|
+
return {};
|
54117
|
+
}
|
54118
|
+
|
54119
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
54120
|
+
const coords = {
|
54121
|
+
x,
|
54122
|
+
y
|
54123
|
+
};
|
54124
|
+
const axis = getMainAxisFromPlacement(placement);
|
54125
|
+
const alignment = getAlignment(placement);
|
54126
|
+
const length = getLengthFromAxis(axis);
|
54127
|
+
const arrowDimensions = await platform.getDimensions(element);
|
54128
|
+
const minProp = axis === 'y' ? 'top' : 'left';
|
54129
|
+
const maxProp = axis === 'y' ? 'bottom' : 'right';
|
54130
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
54131
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
54132
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
54133
|
+
let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
54134
|
+
|
54135
|
+
if (clientSize === 0) {
|
54136
|
+
clientSize = rects.floating[length];
|
54137
|
+
}
|
54138
|
+
|
54139
|
+
const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
|
54140
|
+
// point is outside the floating element's bounds
|
54141
|
+
|
54142
|
+
const min = paddingObject[minProp];
|
54143
|
+
const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
54144
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
54145
|
+
const offset = within(min, center, max); // Make sure that arrow points at the reference
|
54146
|
+
|
54147
|
+
const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
|
54148
|
+
const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
|
54149
|
+
const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
|
54150
|
+
return {
|
54151
|
+
[axis]: coords[axis] - alignmentOffset,
|
54152
|
+
data: {
|
54153
|
+
[axis]: offset,
|
54154
|
+
centerOffset: center - offset
|
54155
|
+
}
|
54156
|
+
};
|
54157
|
+
}
|
54158
|
+
|
54159
|
+
});
|
54160
|
+
|
54161
|
+
const hash$1 = {
|
54162
|
+
left: 'right',
|
54163
|
+
right: 'left',
|
54164
|
+
bottom: 'top',
|
54165
|
+
top: 'bottom'
|
54166
|
+
};
|
54167
|
+
function getOppositePlacement(placement) {
|
54168
|
+
return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
|
54169
|
+
}
|
54170
|
+
|
54171
|
+
function getAlignmentSides(placement, rects, rtl) {
|
54172
|
+
if (rtl === void 0) {
|
54173
|
+
rtl = false;
|
54174
|
+
}
|
54175
|
+
|
54176
|
+
const alignment = getAlignment(placement);
|
54177
|
+
const mainAxis = getMainAxisFromPlacement(placement);
|
54178
|
+
const length = getLengthFromAxis(mainAxis);
|
54179
|
+
let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
54180
|
+
|
54181
|
+
if (rects.reference[length] > rects.floating[length]) {
|
54182
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
54183
|
+
}
|
54184
|
+
|
54185
|
+
return {
|
54186
|
+
main: mainAlignmentSide,
|
54187
|
+
cross: getOppositePlacement(mainAlignmentSide)
|
54188
|
+
};
|
54189
|
+
}
|
54190
|
+
|
54191
|
+
const hash = {
|
54192
|
+
start: 'end',
|
54193
|
+
end: 'start'
|
54194
|
+
};
|
54195
|
+
function getOppositeAlignmentPlacement(placement) {
|
54196
|
+
return placement.replace(/start|end/g, matched => hash[matched]);
|
54197
|
+
}
|
54198
|
+
|
54199
|
+
function getExpandedPlacements(placement) {
|
54200
|
+
const oppositePlacement = getOppositePlacement(placement);
|
54201
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
54202
|
+
}
|
54203
|
+
|
54204
|
+
/**
|
54205
|
+
* Changes the placement of the floating element to one that will fit if the
|
54206
|
+
* initially specified `placement` does not.
|
54207
|
+
* @see https://floating-ui.com/docs/flip
|
54208
|
+
*/
|
54209
|
+
const flip = function (options) {
|
54210
|
+
if (options === void 0) {
|
54211
|
+
options = {};
|
54212
|
+
}
|
54213
|
+
|
54214
|
+
return {
|
54215
|
+
name: 'flip',
|
54216
|
+
options,
|
54217
|
+
|
54218
|
+
async fn(middlewareArguments) {
|
54219
|
+
var _middlewareData$flip;
|
54220
|
+
|
54221
|
+
const {
|
54222
|
+
placement,
|
54223
|
+
middlewareData,
|
54224
|
+
rects,
|
54225
|
+
initialPlacement,
|
54226
|
+
platform,
|
54227
|
+
elements
|
54228
|
+
} = middlewareArguments;
|
54229
|
+
const {
|
54230
|
+
mainAxis: checkMainAxis = true,
|
54231
|
+
crossAxis: checkCrossAxis = true,
|
54232
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
54233
|
+
fallbackStrategy = 'bestFit',
|
54234
|
+
flipAlignment = true,
|
54235
|
+
...detectOverflowOptions
|
54236
|
+
} = options;
|
54237
|
+
const side = getSide(placement);
|
54238
|
+
const isBasePlacement = side === initialPlacement;
|
54239
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
54240
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
54241
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
54242
|
+
const overflows = [];
|
54243
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
54244
|
+
|
54245
|
+
if (checkMainAxis) {
|
54246
|
+
overflows.push(overflow[side]);
|
54247
|
+
}
|
54248
|
+
|
54249
|
+
if (checkCrossAxis) {
|
54250
|
+
const {
|
54251
|
+
main,
|
54252
|
+
cross
|
54253
|
+
} = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
54254
|
+
overflows.push(overflow[main], overflow[cross]);
|
54255
|
+
}
|
54256
|
+
|
54257
|
+
overflowsData = [...overflowsData, {
|
54258
|
+
placement,
|
54259
|
+
overflows
|
54260
|
+
}]; // One or more sides is overflowing
|
54261
|
+
|
54262
|
+
if (!overflows.every(side => side <= 0)) {
|
54263
|
+
var _middlewareData$flip$, _middlewareData$flip2;
|
54264
|
+
|
54265
|
+
const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
|
54266
|
+
const nextPlacement = placements[nextIndex];
|
54267
|
+
|
54268
|
+
if (nextPlacement) {
|
54269
|
+
// Try next placement and re-run the lifecycle
|
54270
|
+
return {
|
54271
|
+
data: {
|
54272
|
+
index: nextIndex,
|
54273
|
+
overflows: overflowsData
|
54274
|
+
},
|
54275
|
+
reset: {
|
54276
|
+
placement: nextPlacement
|
54277
|
+
}
|
54278
|
+
};
|
54279
|
+
}
|
54280
|
+
|
54281
|
+
let resetPlacement = 'bottom';
|
54282
|
+
|
54283
|
+
switch (fallbackStrategy) {
|
54284
|
+
case 'bestFit':
|
54285
|
+
{
|
54286
|
+
var _overflowsData$map$so;
|
54287
|
+
|
54288
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
|
54289
|
+
|
54290
|
+
if (placement) {
|
54291
|
+
resetPlacement = placement;
|
54292
|
+
}
|
54293
|
+
|
54294
|
+
break;
|
54295
|
+
}
|
54296
|
+
|
54297
|
+
case 'initialPlacement':
|
54298
|
+
resetPlacement = initialPlacement;
|
54299
|
+
break;
|
54300
|
+
}
|
54301
|
+
|
54302
|
+
if (placement !== resetPlacement) {
|
54303
|
+
return {
|
54304
|
+
reset: {
|
54305
|
+
placement: resetPlacement
|
54306
|
+
}
|
54307
|
+
};
|
54308
|
+
}
|
54309
|
+
}
|
54310
|
+
|
54311
|
+
return {};
|
54312
|
+
}
|
54313
|
+
|
54314
|
+
};
|
54315
|
+
};
|
54316
|
+
|
54317
|
+
async function convertValueToCoords(middlewareArguments, value) {
|
54318
|
+
const {
|
54319
|
+
placement,
|
54320
|
+
platform,
|
54321
|
+
elements
|
54322
|
+
} = middlewareArguments;
|
54323
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
54324
|
+
const side = getSide(placement);
|
54325
|
+
const alignment = getAlignment(placement);
|
54326
|
+
const isVertical = getMainAxisFromPlacement(placement) === 'x';
|
54327
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
54328
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
54329
|
+
const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
|
54330
|
+
|
54331
|
+
let {
|
54332
|
+
mainAxis,
|
54333
|
+
crossAxis,
|
54334
|
+
alignmentAxis
|
54335
|
+
} = typeof rawValue === 'number' ? {
|
54336
|
+
mainAxis: rawValue,
|
54337
|
+
crossAxis: 0,
|
54338
|
+
alignmentAxis: null
|
54339
|
+
} : {
|
54340
|
+
mainAxis: 0,
|
54341
|
+
crossAxis: 0,
|
54342
|
+
alignmentAxis: null,
|
54343
|
+
...rawValue
|
54344
|
+
};
|
54345
|
+
|
54346
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
54347
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
54348
|
+
}
|
54349
|
+
|
54350
|
+
return isVertical ? {
|
54351
|
+
x: crossAxis * crossAxisMulti,
|
54352
|
+
y: mainAxis * mainAxisMulti
|
54353
|
+
} : {
|
54354
|
+
x: mainAxis * mainAxisMulti,
|
54355
|
+
y: crossAxis * crossAxisMulti
|
54356
|
+
};
|
54357
|
+
}
|
54358
|
+
/**
|
54359
|
+
* Displaces the floating element from its reference element.
|
54360
|
+
* @see https://floating-ui.com/docs/offset
|
54361
|
+
*/
|
54362
|
+
|
54363
|
+
const offset = function (value) {
|
54364
|
+
if (value === void 0) {
|
54365
|
+
value = 0;
|
54366
|
+
}
|
54367
|
+
|
54368
|
+
return {
|
54369
|
+
name: 'offset',
|
54370
|
+
options: value,
|
54371
|
+
|
54372
|
+
async fn(middlewareArguments) {
|
54373
|
+
const {
|
54374
|
+
x,
|
54375
|
+
y
|
54376
|
+
} = middlewareArguments;
|
54377
|
+
const diffCoords = await convertValueToCoords(middlewareArguments, value);
|
54378
|
+
return {
|
54379
|
+
x: x + diffCoords.x,
|
54380
|
+
y: y + diffCoords.y,
|
54381
|
+
data: diffCoords
|
54382
|
+
};
|
54383
|
+
}
|
54384
|
+
|
54385
|
+
};
|
54386
|
+
};
|
54387
|
+
|
54388
|
+
function getCrossAxis(axis) {
|
54389
|
+
return axis === 'x' ? 'y' : 'x';
|
54390
|
+
}
|
54391
|
+
|
54392
|
+
/**
|
54393
|
+
* Shifts the floating element in order to keep it in view when it will overflow
|
54394
|
+
* a clipping boundary.
|
54395
|
+
* @see https://floating-ui.com/docs/shift
|
54396
|
+
*/
|
54397
|
+
const shift = function (options) {
|
54398
|
+
if (options === void 0) {
|
54399
|
+
options = {};
|
54400
|
+
}
|
54401
|
+
|
54402
|
+
return {
|
54403
|
+
name: 'shift',
|
54404
|
+
options,
|
54405
|
+
|
54406
|
+
async fn(middlewareArguments) {
|
54407
|
+
const {
|
54408
|
+
x,
|
54409
|
+
y,
|
54410
|
+
placement
|
54411
|
+
} = middlewareArguments;
|
54412
|
+
const {
|
54413
|
+
mainAxis: checkMainAxis = true,
|
54414
|
+
crossAxis: checkCrossAxis = false,
|
54415
|
+
limiter = {
|
54416
|
+
fn: _ref => {
|
54417
|
+
let {
|
54418
|
+
x,
|
54419
|
+
y
|
54420
|
+
} = _ref;
|
54421
|
+
return {
|
54422
|
+
x,
|
54423
|
+
y
|
54424
|
+
};
|
54425
|
+
}
|
54426
|
+
},
|
54427
|
+
...detectOverflowOptions
|
54428
|
+
} = options;
|
54429
|
+
const coords = {
|
54430
|
+
x,
|
54431
|
+
y
|
54432
|
+
};
|
54433
|
+
const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
|
54434
|
+
const mainAxis = getMainAxisFromPlacement(getSide(placement));
|
54435
|
+
const crossAxis = getCrossAxis(mainAxis);
|
54436
|
+
let mainAxisCoord = coords[mainAxis];
|
54437
|
+
let crossAxisCoord = coords[crossAxis];
|
54438
|
+
|
54439
|
+
if (checkMainAxis) {
|
54440
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
54441
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
54442
|
+
const min = mainAxisCoord + overflow[minSide];
|
54443
|
+
const max = mainAxisCoord - overflow[maxSide];
|
54444
|
+
mainAxisCoord = within(min, mainAxisCoord, max);
|
54445
|
+
}
|
54446
|
+
|
54447
|
+
if (checkCrossAxis) {
|
54448
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
54449
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
54450
|
+
const min = crossAxisCoord + overflow[minSide];
|
54451
|
+
const max = crossAxisCoord - overflow[maxSide];
|
54452
|
+
crossAxisCoord = within(min, crossAxisCoord, max);
|
54453
|
+
}
|
54454
|
+
|
54455
|
+
const limitedCoords = limiter.fn({ ...middlewareArguments,
|
54456
|
+
[mainAxis]: mainAxisCoord,
|
54457
|
+
[crossAxis]: crossAxisCoord
|
54458
|
+
});
|
54459
|
+
return { ...limitedCoords,
|
54460
|
+
data: {
|
54461
|
+
x: limitedCoords.x - x,
|
54462
|
+
y: limitedCoords.y - y
|
54463
|
+
}
|
54464
|
+
};
|
54465
|
+
}
|
54466
|
+
|
54467
|
+
};
|
54468
|
+
};
|
54469
|
+
|
54470
|
+
function isWindow(value) {
|
54471
|
+
return value && value.document && value.location && value.alert && value.setInterval;
|
54472
|
+
}
|
54473
|
+
function getWindow(node) {
|
54474
|
+
if (node == null) {
|
54475
|
+
return window;
|
54476
|
+
}
|
54477
|
+
|
54478
|
+
if (!isWindow(node)) {
|
54479
|
+
const ownerDocument = node.ownerDocument;
|
54480
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
54481
|
+
}
|
54482
|
+
|
54483
|
+
return node;
|
54484
|
+
}
|
54485
|
+
|
54486
|
+
function getComputedStyle$1(element) {
|
54487
|
+
return getWindow(element).getComputedStyle(element);
|
54488
|
+
}
|
54489
|
+
|
54490
|
+
function getNodeName(node) {
|
54491
|
+
return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
|
54492
|
+
}
|
54493
|
+
|
54494
|
+
function getUAString() {
|
54495
|
+
const uaData = navigator.userAgentData;
|
54496
|
+
|
54497
|
+
if (uaData != null && uaData.brands) {
|
54498
|
+
return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
|
54499
|
+
}
|
54500
|
+
|
54501
|
+
return navigator.userAgent;
|
54502
|
+
}
|
54503
|
+
|
54504
|
+
function isHTMLElement(value) {
|
54505
|
+
return value instanceof getWindow(value).HTMLElement;
|
54506
|
+
}
|
54507
|
+
function isElement(value) {
|
54508
|
+
return value instanceof getWindow(value).Element;
|
54509
|
+
}
|
54510
|
+
function isNode(value) {
|
54511
|
+
return value instanceof getWindow(value).Node;
|
54512
|
+
}
|
54513
|
+
function isShadowRoot(node) {
|
54514
|
+
// Browsers without `ShadowRoot` support
|
54515
|
+
if (typeof ShadowRoot === 'undefined') {
|
54516
|
+
return false;
|
54517
|
+
}
|
54518
|
+
|
54519
|
+
const OwnElement = getWindow(node).ShadowRoot;
|
54520
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
54521
|
+
}
|
54522
|
+
function isOverflowElement(element) {
|
54523
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
54524
|
+
const {
|
54525
|
+
overflow,
|
54526
|
+
overflowX,
|
54527
|
+
overflowY
|
54528
|
+
} = getComputedStyle$1(element);
|
54529
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
54530
|
+
}
|
54531
|
+
function isTableElement(element) {
|
54532
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
54533
|
+
}
|
54534
|
+
function isContainingBlock(element) {
|
54535
|
+
// TODO: Try and use feature detection here instead
|
54536
|
+
const isFirefox = /firefox/i.test(getUAString());
|
54537
|
+
const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
|
54538
|
+
// create a containing block.
|
54539
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
54540
|
+
|
54541
|
+
return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
|
54542
|
+
css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
|
54543
|
+
}
|
54544
|
+
function isLayoutViewport() {
|
54545
|
+
// Not Safari
|
54546
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
|
54547
|
+
// • Always-visible scrollbar or not
|
54548
|
+
// • Width of <html>, etc.
|
54549
|
+
// const vV = win.visualViewport;
|
54550
|
+
// return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
|
54551
|
+
}
|
54552
|
+
|
54553
|
+
const min = Math.min;
|
54554
|
+
const max = Math.max;
|
54555
|
+
const round = Math.round;
|
54556
|
+
|
54557
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
54558
|
+
var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
|
54559
|
+
|
54560
|
+
if (includeScale === void 0) {
|
54561
|
+
includeScale = false;
|
54562
|
+
}
|
54563
|
+
|
54564
|
+
if (isFixedStrategy === void 0) {
|
54565
|
+
isFixedStrategy = false;
|
54566
|
+
}
|
54567
|
+
|
54568
|
+
const clientRect = element.getBoundingClientRect();
|
54569
|
+
let scaleX = 1;
|
54570
|
+
let scaleY = 1;
|
54571
|
+
|
54572
|
+
if (includeScale && isHTMLElement(element)) {
|
54573
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
54574
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
54575
|
+
}
|
54576
|
+
|
54577
|
+
const win = isElement(element) ? getWindow(element) : window;
|
54578
|
+
const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
54579
|
+
const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
|
54580
|
+
const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
|
54581
|
+
const width = clientRect.width / scaleX;
|
54582
|
+
const height = clientRect.height / scaleY;
|
54583
|
+
return {
|
54584
|
+
width,
|
54585
|
+
height,
|
54586
|
+
top: y,
|
54587
|
+
right: x + width,
|
54588
|
+
bottom: y + height,
|
54589
|
+
left: x,
|
54590
|
+
x,
|
54591
|
+
y
|
54592
|
+
};
|
54593
|
+
}
|
54594
|
+
|
54595
|
+
function getDocumentElement(node) {
|
54596
|
+
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
|
54597
|
+
}
|
54598
|
+
|
54599
|
+
function getNodeScroll(element) {
|
54600
|
+
if (isElement(element)) {
|
54601
|
+
return {
|
54602
|
+
scrollLeft: element.scrollLeft,
|
54603
|
+
scrollTop: element.scrollTop
|
54604
|
+
};
|
54605
|
+
}
|
54606
|
+
|
54607
|
+
return {
|
54608
|
+
scrollLeft: element.pageXOffset,
|
54609
|
+
scrollTop: element.pageYOffset
|
54610
|
+
};
|
54611
|
+
}
|
54612
|
+
|
54613
|
+
function getWindowScrollBarX(element) {
|
54614
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
54615
|
+
// incorrect for RTL.
|
54616
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
54617
|
+
}
|
54618
|
+
|
54619
|
+
function isScaled(element) {
|
54620
|
+
const rect = getBoundingClientRect(element);
|
54621
|
+
return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
|
54622
|
+
}
|
54623
|
+
|
54624
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
54625
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
54626
|
+
const documentElement = getDocumentElement(offsetParent);
|
54627
|
+
const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
|
54628
|
+
isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
|
54629
|
+
let scroll = {
|
54630
|
+
scrollLeft: 0,
|
54631
|
+
scrollTop: 0
|
54632
|
+
};
|
54633
|
+
const offsets = {
|
54634
|
+
x: 0,
|
54635
|
+
y: 0
|
54636
|
+
};
|
54637
|
+
|
54638
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
54639
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
54640
|
+
scroll = getNodeScroll(offsetParent);
|
54641
|
+
}
|
54642
|
+
|
54643
|
+
if (isHTMLElement(offsetParent)) {
|
54644
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
54645
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
54646
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
54647
|
+
} else if (documentElement) {
|
54648
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
54649
|
+
}
|
54650
|
+
}
|
54651
|
+
|
54652
|
+
return {
|
54653
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
54654
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
54655
|
+
width: rect.width,
|
54656
|
+
height: rect.height
|
54657
|
+
};
|
54658
|
+
}
|
54659
|
+
|
54660
|
+
function getParentNode(node) {
|
54661
|
+
if (getNodeName(node) === 'html') {
|
54662
|
+
return node;
|
54663
|
+
}
|
54664
|
+
|
54665
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
54666
|
+
// @ts-ignore
|
54667
|
+
node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
54668
|
+
node.parentNode || ( // DOM Element detected
|
54669
|
+
isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
|
54670
|
+
getDocumentElement(node) // fallback
|
54671
|
+
|
54672
|
+
);
|
54673
|
+
}
|
54674
|
+
|
54675
|
+
function getTrueOffsetParent(element) {
|
54676
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
54677
|
+
return null;
|
54678
|
+
}
|
54679
|
+
|
54680
|
+
return composedOffsetParent(element);
|
54681
|
+
}
|
54682
|
+
/**
|
54683
|
+
* Polyfills the old offsetParent behavior from before the spec was changed:
|
54684
|
+
* https://github.com/w3c/csswg-drafts/issues/159
|
54685
|
+
*/
|
54686
|
+
|
54687
|
+
|
54688
|
+
function composedOffsetParent(element) {
|
54689
|
+
let {
|
54690
|
+
offsetParent
|
54691
|
+
} = element;
|
54692
|
+
let ancestor = element;
|
54693
|
+
let foundInsideSlot = false;
|
54694
|
+
|
54695
|
+
while (ancestor && ancestor !== offsetParent) {
|
54696
|
+
const {
|
54697
|
+
assignedSlot
|
54698
|
+
} = ancestor;
|
54699
|
+
|
54700
|
+
if (assignedSlot) {
|
54701
|
+
let newOffsetParent = assignedSlot.offsetParent;
|
54702
|
+
|
54703
|
+
if (getComputedStyle$1(assignedSlot).display === 'contents') {
|
54704
|
+
const hadStyleAttribute = assignedSlot.hasAttribute('style');
|
54705
|
+
const oldDisplay = assignedSlot.style.display;
|
54706
|
+
assignedSlot.style.display = getComputedStyle$1(ancestor).display;
|
54707
|
+
newOffsetParent = assignedSlot.offsetParent;
|
54708
|
+
assignedSlot.style.display = oldDisplay;
|
54709
|
+
|
54710
|
+
if (!hadStyleAttribute) {
|
54711
|
+
assignedSlot.removeAttribute('style');
|
54712
|
+
}
|
54713
|
+
}
|
54714
|
+
|
54715
|
+
ancestor = assignedSlot;
|
54716
|
+
|
54717
|
+
if (offsetParent !== newOffsetParent) {
|
54718
|
+
offsetParent = newOffsetParent;
|
54719
|
+
foundInsideSlot = true;
|
54720
|
+
}
|
54721
|
+
} else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
|
54722
|
+
break;
|
54723
|
+
}
|
54724
|
+
|
54725
|
+
ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
|
54726
|
+
}
|
54727
|
+
|
54728
|
+
return offsetParent;
|
54729
|
+
}
|
54730
|
+
|
54731
|
+
function getContainingBlock(element) {
|
54732
|
+
let currentNode = getParentNode(element);
|
54733
|
+
|
54734
|
+
if (isShadowRoot(currentNode)) {
|
54735
|
+
currentNode = currentNode.host;
|
54736
|
+
}
|
54737
|
+
|
54738
|
+
while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
|
54739
|
+
if (isContainingBlock(currentNode)) {
|
54740
|
+
return currentNode;
|
54741
|
+
} else {
|
54742
|
+
const parent = currentNode.parentNode;
|
54743
|
+
currentNode = isShadowRoot(parent) ? parent.host : parent;
|
54744
|
+
}
|
54745
|
+
}
|
54746
|
+
|
54747
|
+
return null;
|
54748
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
54749
|
+
// such as table ancestors and cross browser bugs.
|
54750
|
+
|
54751
|
+
|
54752
|
+
function getOffsetParent(element) {
|
54753
|
+
const window = getWindow(element);
|
54754
|
+
let offsetParent = getTrueOffsetParent(element);
|
54755
|
+
|
54756
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
54757
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
54758
|
+
}
|
54759
|
+
|
54760
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
54761
|
+
return window;
|
54762
|
+
}
|
54763
|
+
|
54764
|
+
return offsetParent || getContainingBlock(element) || window;
|
54765
|
+
}
|
54766
|
+
|
54767
|
+
function getDimensions(element) {
|
54768
|
+
if (isHTMLElement(element)) {
|
54769
|
+
return {
|
54770
|
+
width: element.offsetWidth,
|
54771
|
+
height: element.offsetHeight
|
54772
|
+
};
|
54773
|
+
}
|
54774
|
+
|
54775
|
+
const rect = getBoundingClientRect(element);
|
54776
|
+
return {
|
54777
|
+
width: rect.width,
|
54778
|
+
height: rect.height
|
54779
|
+
};
|
54780
|
+
}
|
54781
|
+
|
54782
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
54783
|
+
let {
|
54784
|
+
rect,
|
54785
|
+
offsetParent,
|
54786
|
+
strategy
|
54787
|
+
} = _ref;
|
54788
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
54789
|
+
const documentElement = getDocumentElement(offsetParent);
|
54790
|
+
|
54791
|
+
if (offsetParent === documentElement) {
|
54792
|
+
return rect;
|
54793
|
+
}
|
54794
|
+
|
54795
|
+
let scroll = {
|
54796
|
+
scrollLeft: 0,
|
54797
|
+
scrollTop: 0
|
54798
|
+
};
|
54799
|
+
const offsets = {
|
54800
|
+
x: 0,
|
54801
|
+
y: 0
|
54802
|
+
};
|
54803
|
+
|
54804
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
54805
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
54806
|
+
scroll = getNodeScroll(offsetParent);
|
54807
|
+
}
|
54808
|
+
|
54809
|
+
if (isHTMLElement(offsetParent)) {
|
54810
|
+
const offsetRect = getBoundingClientRect(offsetParent, true);
|
54811
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
54812
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
54813
|
+
} // This doesn't appear to be need to be negated.
|
54814
|
+
// else if (documentElement) {
|
54815
|
+
// offsets.x = getWindowScrollBarX(documentElement);
|
54816
|
+
// }
|
54817
|
+
|
54818
|
+
}
|
54819
|
+
|
54820
|
+
return { ...rect,
|
54821
|
+
x: rect.x - scroll.scrollLeft + offsets.x,
|
54822
|
+
y: rect.y - scroll.scrollTop + offsets.y
|
54823
|
+
};
|
54824
|
+
}
|
54825
|
+
|
54826
|
+
function getViewportRect(element, strategy) {
|
54827
|
+
const win = getWindow(element);
|
54828
|
+
const html = getDocumentElement(element);
|
54829
|
+
const visualViewport = win.visualViewport;
|
54830
|
+
let width = html.clientWidth;
|
54831
|
+
let height = html.clientHeight;
|
54832
|
+
let x = 0;
|
54833
|
+
let y = 0;
|
54834
|
+
|
54835
|
+
if (visualViewport) {
|
54836
|
+
width = visualViewport.width;
|
54837
|
+
height = visualViewport.height;
|
54838
|
+
const layoutViewport = isLayoutViewport();
|
54839
|
+
|
54840
|
+
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
54841
|
+
x = visualViewport.offsetLeft;
|
54842
|
+
y = visualViewport.offsetTop;
|
54843
|
+
}
|
54844
|
+
}
|
54845
|
+
|
54846
|
+
return {
|
54847
|
+
width,
|
54848
|
+
height,
|
54849
|
+
x,
|
54850
|
+
y
|
54851
|
+
};
|
54852
|
+
}
|
54853
|
+
|
54854
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
54855
|
+
|
54856
|
+
function getDocumentRect(element) {
|
54857
|
+
var _element$ownerDocumen;
|
54858
|
+
|
54859
|
+
const html = getDocumentElement(element);
|
54860
|
+
const scroll = getNodeScroll(element);
|
54861
|
+
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
54862
|
+
const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
54863
|
+
const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
54864
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
54865
|
+
const y = -scroll.scrollTop;
|
54866
|
+
|
54867
|
+
if (getComputedStyle$1(body || html).direction === 'rtl') {
|
54868
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
54869
|
+
}
|
54870
|
+
|
54871
|
+
return {
|
54872
|
+
width,
|
54873
|
+
height,
|
54874
|
+
x,
|
54875
|
+
y
|
54876
|
+
};
|
54877
|
+
}
|
54878
|
+
|
54879
|
+
function getNearestOverflowAncestor(node) {
|
54880
|
+
const parentNode = getParentNode(node);
|
54881
|
+
|
54882
|
+
if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
|
54883
|
+
// @ts-ignore assume body is always available
|
54884
|
+
return node.ownerDocument.body;
|
54885
|
+
}
|
54886
|
+
|
54887
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
54888
|
+
return parentNode;
|
54889
|
+
}
|
54890
|
+
|
54891
|
+
return getNearestOverflowAncestor(parentNode);
|
54892
|
+
}
|
54893
|
+
|
54894
|
+
function getOverflowAncestors(node, list) {
|
54895
|
+
var _node$ownerDocument;
|
54896
|
+
|
54897
|
+
if (list === void 0) {
|
54898
|
+
list = [];
|
54899
|
+
}
|
54900
|
+
|
54901
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
54902
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
54903
|
+
const win = getWindow(scrollableAncestor);
|
54904
|
+
const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
|
54905
|
+
const updatedList = list.concat(target);
|
54906
|
+
return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
|
54907
|
+
updatedList.concat(getOverflowAncestors(target));
|
54908
|
+
}
|
54909
|
+
|
54910
|
+
function contains(parent, child) {
|
54911
|
+
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
|
54912
|
+
|
54913
|
+
if (parent.contains(child)) {
|
54914
|
+
return true;
|
54915
|
+
} // then fallback to custom implementation with Shadow DOM support
|
54916
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
54917
|
+
let next = child;
|
54918
|
+
|
54919
|
+
do {
|
54920
|
+
// use `===` replace node.isSameNode()
|
54921
|
+
if (next && parent === next) {
|
54922
|
+
return true;
|
54923
|
+
} // @ts-ignore: need a better way to handle this...
|
54924
|
+
|
54925
|
+
|
54926
|
+
next = next.parentNode || next.host;
|
54927
|
+
} while (next);
|
54928
|
+
}
|
54929
|
+
|
54930
|
+
return false;
|
54931
|
+
}
|
54932
|
+
|
54933
|
+
function getInnerBoundingClientRect(element, strategy) {
|
54934
|
+
const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
|
54935
|
+
const top = clientRect.top + element.clientTop;
|
54936
|
+
const left = clientRect.left + element.clientLeft;
|
54937
|
+
return {
|
54938
|
+
top,
|
54939
|
+
left,
|
54940
|
+
x: left,
|
54941
|
+
y: top,
|
54942
|
+
right: left + element.clientWidth,
|
54943
|
+
bottom: top + element.clientHeight,
|
54944
|
+
width: element.clientWidth,
|
54945
|
+
height: element.clientHeight
|
54946
|
+
};
|
54947
|
+
}
|
54948
|
+
|
54949
|
+
function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
|
54950
|
+
if (clippingParent === 'viewport') {
|
54951
|
+
return rectToClientRect(getViewportRect(element, strategy));
|
54952
|
+
}
|
54953
|
+
|
54954
|
+
if (isElement(clippingParent)) {
|
54955
|
+
return getInnerBoundingClientRect(clippingParent, strategy);
|
54956
|
+
}
|
54957
|
+
|
54958
|
+
return rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
54959
|
+
} // A "clipping ancestor" is an overflowable container with the characteristic of
|
54960
|
+
// clipping (or hiding) overflowing elements with a position different from
|
54961
|
+
// `initial`
|
54962
|
+
|
54963
|
+
|
54964
|
+
function getClippingAncestors(element) {
|
54965
|
+
const clippingAncestors = getOverflowAncestors(element);
|
54966
|
+
const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
|
54967
|
+
const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
54968
|
+
|
54969
|
+
if (!isElement(clipperElement)) {
|
54970
|
+
return [];
|
54971
|
+
} // @ts-ignore isElement check ensures we return Array<Element>
|
54972
|
+
|
54973
|
+
|
54974
|
+
return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
|
54975
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
54976
|
+
// clipping ancestors
|
54977
|
+
|
54978
|
+
|
54979
|
+
function getClippingRect(_ref) {
|
54980
|
+
let {
|
54981
|
+
element,
|
54982
|
+
boundary,
|
54983
|
+
rootBoundary,
|
54984
|
+
strategy
|
54985
|
+
} = _ref;
|
54986
|
+
const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
|
54987
|
+
const clippingAncestors = [...mainClippingAncestors, rootBoundary];
|
54988
|
+
const firstClippingAncestor = clippingAncestors[0];
|
54989
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
54990
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
54991
|
+
accRect.top = max(rect.top, accRect.top);
|
54992
|
+
accRect.right = min(rect.right, accRect.right);
|
54993
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
54994
|
+
accRect.left = max(rect.left, accRect.left);
|
54995
|
+
return accRect;
|
54996
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
54997
|
+
return {
|
54998
|
+
width: clippingRect.right - clippingRect.left,
|
54999
|
+
height: clippingRect.bottom - clippingRect.top,
|
55000
|
+
x: clippingRect.left,
|
55001
|
+
y: clippingRect.top
|
55002
|
+
};
|
55003
|
+
}
|
55004
|
+
|
55005
|
+
const platform = {
|
55006
|
+
getClippingRect,
|
55007
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
55008
|
+
isElement,
|
55009
|
+
getDimensions,
|
55010
|
+
getOffsetParent,
|
55011
|
+
getDocumentElement,
|
55012
|
+
getElementRects: _ref => {
|
55013
|
+
let {
|
55014
|
+
reference,
|
55015
|
+
floating,
|
55016
|
+
strategy
|
55017
|
+
} = _ref;
|
55018
|
+
return {
|
55019
|
+
reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
|
55020
|
+
floating: { ...getDimensions(floating),
|
55021
|
+
x: 0,
|
55022
|
+
y: 0
|
55023
|
+
}
|
55024
|
+
};
|
55025
|
+
},
|
55026
|
+
getClientRects: element => Array.from(element.getClientRects()),
|
55027
|
+
isRTL: element => getComputedStyle$1(element).direction === 'rtl'
|
55028
|
+
};
|
55029
|
+
|
55030
|
+
/**
|
55031
|
+
* Automatically updates the position of the floating element when necessary.
|
55032
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
55033
|
+
*/
|
55034
|
+
function autoUpdate(reference, floating, update, options) {
|
55035
|
+
if (options === void 0) {
|
55036
|
+
options = {};
|
55037
|
+
}
|
55038
|
+
|
55039
|
+
const {
|
55040
|
+
ancestorScroll: _ancestorScroll = true,
|
55041
|
+
ancestorResize: _ancestorResize = true,
|
55042
|
+
elementResize = true,
|
55043
|
+
animationFrame = false
|
55044
|
+
} = options;
|
55045
|
+
const ancestorScroll = _ancestorScroll && !animationFrame;
|
55046
|
+
const ancestorResize = _ancestorResize && !animationFrame;
|
55047
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
|
55048
|
+
ancestors.forEach(ancestor => {
|
55049
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
55050
|
+
passive: true
|
55051
|
+
});
|
55052
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
55053
|
+
});
|
55054
|
+
let observer = null;
|
55055
|
+
|
55056
|
+
if (elementResize) {
|
55057
|
+
let initialUpdate = true;
|
55058
|
+
observer = new ResizeObserver(() => {
|
55059
|
+
if (!initialUpdate) {
|
55060
|
+
update();
|
55061
|
+
}
|
55062
|
+
|
55063
|
+
initialUpdate = false;
|
55064
|
+
});
|
55065
|
+
isElement(reference) && !animationFrame && observer.observe(reference);
|
55066
|
+
observer.observe(floating);
|
55067
|
+
}
|
55068
|
+
|
55069
|
+
let frameId;
|
55070
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
55071
|
+
|
55072
|
+
if (animationFrame) {
|
55073
|
+
frameLoop();
|
55074
|
+
}
|
55075
|
+
|
55076
|
+
function frameLoop() {
|
55077
|
+
const nextRefRect = getBoundingClientRect(reference);
|
55078
|
+
|
55079
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
55080
|
+
update();
|
55081
|
+
}
|
55082
|
+
|
55083
|
+
prevRefRect = nextRefRect;
|
55084
|
+
frameId = requestAnimationFrame(frameLoop);
|
55085
|
+
}
|
55086
|
+
|
55087
|
+
update();
|
55088
|
+
return () => {
|
55089
|
+
var _observer;
|
55090
|
+
|
55091
|
+
ancestors.forEach(ancestor => {
|
55092
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
55093
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
55094
|
+
});
|
55095
|
+
(_observer = observer) == null ? void 0 : _observer.disconnect();
|
55096
|
+
observer = null;
|
55097
|
+
|
55098
|
+
if (animationFrame) {
|
55099
|
+
cancelAnimationFrame(frameId);
|
55100
|
+
}
|
55101
|
+
};
|
55102
|
+
}
|
55103
|
+
|
55104
|
+
/**
|
55105
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
55106
|
+
* next to a reference element when it is given a certain CSS positioning
|
55107
|
+
* strategy.
|
55108
|
+
*/
|
55109
|
+
|
55110
|
+
const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
|
55111
|
+
platform,
|
55112
|
+
...options
|
55113
|
+
});
|
55114
|
+
|
53266
55115
|
const visualHiddenProps = buildProps({
|
53267
55116
|
style: {
|
53268
55117
|
type: definePropType([String, Object, Array]),
|
@@ -54195,7 +56044,7 @@ const setCanFocus = function(childNodes, focus) {
|
|
54195
56044
|
});
|
54196
56045
|
};
|
54197
56046
|
let nodeIdSeed = 0;
|
54198
|
-
class Node {
|
56047
|
+
class Node$1 {
|
54199
56048
|
constructor(options) {
|
54200
56049
|
this.isLeafByUser = void 0;
|
54201
56050
|
this.isLeaf = void 0;
|
@@ -54326,7 +56175,7 @@ class Node {
|
|
54326
56175
|
insertChild(child, index, batch) {
|
54327
56176
|
if (!child)
|
54328
56177
|
throw new Error("InsertChild error: child is required.");
|
54329
|
-
if (!(child instanceof Node)) {
|
56178
|
+
if (!(child instanceof Node$1)) {
|
54330
56179
|
if (!batch) {
|
54331
56180
|
const children = this.getChildren(true);
|
54332
56181
|
if (!(children == null ? void 0 : children.includes(child.data))) {
|
@@ -54341,8 +56190,8 @@ class Node {
|
|
54341
56190
|
parent: this,
|
54342
56191
|
store: this.store
|
54343
56192
|
});
|
54344
|
-
child = reactive(new Node(child));
|
54345
|
-
if (child instanceof Node) {
|
56193
|
+
child = reactive(new Node$1(child));
|
56194
|
+
if (child instanceof Node$1) {
|
54346
56195
|
child.initialize();
|
54347
56196
|
}
|
54348
56197
|
}
|
@@ -54576,7 +56425,7 @@ class Node {
|
|
54576
56425
|
reInitChecked(this);
|
54577
56426
|
}
|
54578
56427
|
}
|
54579
|
-
var Node$
|
56428
|
+
var Node$2 = Node$1;
|
54580
56429
|
|
54581
56430
|
class TreeStore {
|
54582
56431
|
constructor(options) {
|
@@ -54595,7 +56444,7 @@ class TreeStore {
|
|
54595
56444
|
this.nodesMap = {};
|
54596
56445
|
}
|
54597
56446
|
initialize() {
|
54598
|
-
this.root = new Node$
|
56447
|
+
this.root = new Node$2({
|
54599
56448
|
data: this.data,
|
54600
56449
|
store: this
|
54601
56450
|
});
|
@@ -54653,7 +56502,7 @@ class TreeStore {
|
|
54653
56502
|
}
|
54654
56503
|
}
|
54655
56504
|
getNode(data) {
|
54656
|
-
if (data instanceof Node$
|
56505
|
+
if (data instanceof Node$2)
|
54657
56506
|
return data;
|
54658
56507
|
const key = isObject$1(data) ? getNodeKey(this.key, data) : data;
|
54659
56508
|
return this.nodesMap[key] || null;
|
@@ -55131,7 +56980,7 @@ const _sfc_main$o = defineComponent({
|
|
55131
56980
|
},
|
55132
56981
|
props: {
|
55133
56982
|
node: {
|
55134
|
-
type: Node$
|
56983
|
+
type: Node$2,
|
55135
56984
|
default: () => ({})
|
55136
56985
|
},
|
55137
56986
|
props: {
|
@@ -61776,7 +63625,7 @@ const normalizeOptions = (params) => {
|
|
61776
63625
|
normalized.appendTo = document.body;
|
61777
63626
|
} else if (isString$1(normalized.appendTo)) {
|
61778
63627
|
let appendTo = document.querySelector(normalized.appendTo);
|
61779
|
-
if (!isElement$
|
63628
|
+
if (!isElement$2(appendTo)) {
|
61780
63629
|
appendTo = document.body;
|
61781
63630
|
}
|
61782
63631
|
normalized.appendTo = appendTo;
|
@@ -62363,10 +64212,10 @@ const getAppendToElement = (props) => {
|
|
62363
64212
|
if (isString$1(props.appendTo)) {
|
62364
64213
|
appendTo = document.querySelector(props.appendTo);
|
62365
64214
|
}
|
62366
|
-
if (isElement$
|
64215
|
+
if (isElement$2(props.appendTo)) {
|
62367
64216
|
appendTo = props.appendTo;
|
62368
64217
|
}
|
62369
|
-
if (!isElement$
|
64218
|
+
if (!isElement$2(appendTo)) {
|
62370
64219
|
appendTo = document.body;
|
62371
64220
|
}
|
62372
64221
|
}
|
@@ -62734,12 +64583,12 @@ const notify = function(options = {}, context) {
|
|
62734
64583
|
}
|
62735
64584
|
};
|
62736
64585
|
let appendTo = document.body;
|
62737
|
-
if (isElement$
|
64586
|
+
if (isElement$2(options.appendTo)) {
|
62738
64587
|
appendTo = options.appendTo;
|
62739
64588
|
} else if (isString$1(options.appendTo)) {
|
62740
64589
|
appendTo = document.querySelector(options.appendTo);
|
62741
64590
|
}
|
62742
|
-
if (!isElement$
|
64591
|
+
if (!isElement$2(appendTo)) {
|
62743
64592
|
appendTo = document.body;
|
62744
64593
|
}
|
62745
64594
|
const container = document.createElement("div");
|