@sankhyalabs/ezui 7.2.0-dev.1 → 7.2.0-dev.3

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.
Files changed (240) hide show
  1. package/dist/cjs/{ApplicationUtils-006ca96f.js → ApplicationUtils-dc653b57.js} +1 -1
  2. package/dist/cjs/{app-globals-5cb12916.js → app-globals-16ec1ff7.js} +1 -1
  3. package/dist/cjs/classic-search-list_7.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
  5. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-classic-combo-box.cjs.entry.js +2 -1
  9. package/dist/cjs/ez-classic-date-input.cjs.entry.js +2 -2
  10. package/dist/cjs/ez-classic-date-time-input.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-classic-number-input.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-classic-search-plus.cjs.entry.js +4 -4
  13. package/dist/cjs/ez-classic-search.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-classic-time-input.cjs.entry.js +4 -3
  15. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  16. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
  17. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-form.cjs.entry.js +3 -3
  26. package/dist/cjs/ez-grid-pagination.cjs.entry.js +227 -0
  27. package/dist/cjs/ez-grid.cjs.entry.js +62 -154
  28. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-popover-core.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-popup.cjs.entry.js +1 -2
  39. package/dist/cjs/ez-record-navigation.cjs.entry.js +121 -0
  40. package/dist/cjs/ez-scroller_2.cjs.entry.js +81 -14
  41. package/dist/cjs/ez-search-plus.cjs.entry.js +4 -4
  42. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-search.cjs.entry.js +3 -3
  44. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-sortable-list.cjs.entry.js +98 -113
  47. package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-split-button.cjs.entry.js +4 -4
  49. package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
  50. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  51. package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
  52. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  53. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  54. package/dist/cjs/ezui.cjs.js +3 -3
  55. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  56. package/dist/cjs/{floating-ui.dom.esm-f4d87617.js → floating-ui.dom.esm-bea31048.js} +165 -119
  57. package/dist/cjs/index-a7b0c73d.js +8 -0
  58. package/dist/cjs/{index-350d0fa0.js → index-a8537087.js} +85 -30
  59. package/dist/cjs/loader.cjs.js +3 -3
  60. package/dist/cjs/{search-column-fbf680d7.js → search-column-cd0e44be.js} +4 -7
  61. package/dist/collection/collection-manifest.json +7 -0
  62. package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js +2 -1
  63. package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.js +1 -1
  64. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.css +22 -0
  65. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.js +1 -1
  66. package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.js +3 -2
  67. package/dist/collection/components/ez-dropdown/ez-dropdown.css +1 -1
  68. package/dist/collection/components/ez-empty-card/ez-empty-card.js +7 -7
  69. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +20 -6
  70. package/dist/collection/components/ez-grid/controller/ag-grid/gridColumnDefaultWidths.js +23 -0
  71. package/dist/collection/components/ez-grid/ez-grid.css +1 -60
  72. package/dist/collection/components/ez-grid/ez-grid.js +52 -150
  73. package/dist/collection/components/ez-grid/utils/index.js +1 -0
  74. package/dist/collection/components/ez-grid-pagination/ez-grid-pagination.css +111 -0
  75. package/dist/collection/components/ez-grid-pagination/ez-grid-pagination.js +410 -0
  76. package/dist/collection/components/ez-icon/ez-icon.css +5 -5
  77. package/dist/collection/components/ez-popup/ez-popup.js +0 -1
  78. package/dist/collection/components/ez-record-navigation/ez-record-navigation.css +51 -0
  79. package/dist/collection/components/ez-record-navigation/ez-record-navigation.js +246 -0
  80. package/dist/collection/components/ez-scroller/EzScrollNavigationMode.js +5 -0
  81. package/dist/collection/components/ez-scroller/ez-scroller.css +117 -11
  82. package/dist/collection/components/ez-scroller/ez-scroller.js +118 -13
  83. package/dist/collection/components/ez-search/ez-search.css +4 -0
  84. package/dist/collection/components/ez-search-plus/ez-search-plus.js +2 -2
  85. package/dist/collection/components/ez-split-button/ez-split-button.css +1 -1
  86. package/dist/collection/components/ez-split-button/ez-split-button.js +2 -2
  87. package/dist/collection/utils/i18n/locales/en-us.js +25 -4
  88. package/dist/collection/utils/i18n/locales/es-es.js +25 -4
  89. package/dist/collection/utils/i18n/locales/pt-br.js +25 -4
  90. package/dist/collection/utils/searchColumn/search-column.js +2 -5
  91. package/dist/custom-elements/index.d.ts +12 -0
  92. package/dist/custom-elements/index.js +835 -439
  93. package/dist/esm/{ApplicationUtils-0c5cb207.js → ApplicationUtils-e99e53c8.js} +1 -1
  94. package/dist/esm/{app-globals-1db10325.js → app-globals-6e27b3bb.js} +1 -1
  95. package/dist/esm/classic-search-list_7.entry.js +2 -2
  96. package/dist/esm/ez-actions-button.entry.js +2 -2
  97. package/dist/esm/ez-alert-list.entry.js +1 -1
  98. package/dist/esm/ez-avatar.entry.js +1 -1
  99. package/dist/esm/ez-calendar.entry.js +1 -1
  100. package/dist/esm/ez-classic-combo-box.entry.js +2 -1
  101. package/dist/esm/ez-classic-date-input.entry.js +2 -2
  102. package/dist/esm/ez-classic-date-time-input.entry.js +1 -1
  103. package/dist/esm/ez-classic-number-input.entry.js +1 -1
  104. package/dist/esm/ez-classic-search-plus.entry.js +4 -4
  105. package/dist/esm/ez-classic-search.entry.js +2 -2
  106. package/dist/esm/ez-classic-time-input.entry.js +4 -3
  107. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  108. package/dist/esm/ez-combo-box.entry.js +2 -2
  109. package/dist/esm/ez-date-input.entry.js +1 -1
  110. package/dist/esm/ez-date-time-input.entry.js +1 -1
  111. package/dist/esm/ez-dialog.entry.js +1 -1
  112. package/dist/esm/ez-double-list.entry.js +1 -1
  113. package/dist/esm/ez-dropdown.entry.js +1 -1
  114. package/dist/esm/ez-empty-card.entry.js +1 -1
  115. package/dist/esm/ez-file-item.entry.js +1 -1
  116. package/dist/esm/ez-form-view.entry.js +1 -1
  117. package/dist/esm/ez-form.entry.js +3 -3
  118. package/dist/esm/ez-grid-pagination.entry.js +223 -0
  119. package/dist/esm/ez-grid.entry.js +63 -155
  120. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  121. package/dist/esm/ez-icon.entry.js +1 -1
  122. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  123. package/dist/esm/ez-list.entry.js +1 -1
  124. package/dist/esm/ez-modal-container.entry.js +1 -1
  125. package/dist/esm/ez-modal.entry.js +1 -1
  126. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  127. package/dist/esm/ez-number-input.entry.js +1 -1
  128. package/dist/esm/ez-pagination.entry.js +1 -1
  129. package/dist/esm/ez-popover-core.entry.js +1 -1
  130. package/dist/esm/ez-popup.entry.js +1 -2
  131. package/dist/esm/ez-record-navigation.entry.js +117 -0
  132. package/dist/esm/ez-scroller_2.entry.js +81 -14
  133. package/dist/esm/ez-search-plus.entry.js +4 -4
  134. package/dist/esm/ez-search-result-list.entry.js +1 -1
  135. package/dist/esm/ez-search.entry.js +3 -3
  136. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  137. package/dist/esm/ez-skeleton.entry.js +1 -1
  138. package/dist/esm/ez-sortable-list.entry.js +98 -113
  139. package/dist/esm/ez-spinner.entry.js +1 -1
  140. package/dist/esm/ez-split-button.entry.js +4 -4
  141. package/dist/esm/ez-split-item.entry.js +2 -2
  142. package/dist/esm/ez-time-input.entry.js +1 -1
  143. package/dist/esm/ez-tooltip.entry.js +1 -1
  144. package/dist/esm/ez-tree.entry.js +1 -1
  145. package/dist/esm/ez-upload.entry.js +2 -2
  146. package/dist/esm/ezui.js +3 -3
  147. package/dist/esm/filter-column.entry.js +1 -1
  148. package/dist/esm/{floating-ui.dom.esm-ad30f2f0.js → floating-ui.dom.esm-2964eae1.js} +165 -119
  149. package/dist/esm/{index-225aa0c3.js → index-a031816b.js} +85 -30
  150. package/dist/esm/index-baa5e267.js +8 -0
  151. package/dist/esm/loader.js +3 -3
  152. package/dist/esm/{search-column-40a78cac.js → search-column-33d72c20.js} +4 -7
  153. package/dist/ezui/ezui.esm.js +1 -1
  154. package/dist/ezui/p-05e4541a.entry.js +7 -0
  155. package/dist/ezui/{p-56565777.entry.js → p-0bc16f75.entry.js} +1 -1
  156. package/dist/ezui/p-0d80e3ec.entry.js +1 -0
  157. package/dist/ezui/{p-556bf329.entry.js → p-0fc981e9.entry.js} +1 -1
  158. package/dist/ezui/{p-26cd4c2e.entry.js → p-1244fac0.entry.js} +1 -1
  159. package/dist/ezui/{p-0625743b.entry.js → p-160a268d.entry.js} +1 -1
  160. package/dist/ezui/p-178cb9df.entry.js +1 -0
  161. package/dist/ezui/{p-6ac056d7.entry.js → p-1ab5ba19.entry.js} +1 -1
  162. package/dist/ezui/p-2241dea1.js +1 -0
  163. package/dist/ezui/{p-9825c1d2.js → p-24582dd6.js} +1 -1
  164. package/dist/ezui/{p-62c149cb.entry.js → p-2887cbf9.entry.js} +1 -1
  165. package/dist/ezui/p-2b65728f.entry.js +1 -0
  166. package/dist/ezui/{p-b705b342.entry.js → p-318d4dc9.entry.js} +1 -1
  167. package/dist/ezui/{p-8e5f1c74.entry.js → p-32b8f057.entry.js} +1 -1
  168. package/dist/ezui/{p-f5552540.entry.js → p-3311e7ef.entry.js} +1 -1
  169. package/dist/ezui/{p-b0a716ef.entry.js → p-39d2bce5.entry.js} +1 -1
  170. package/dist/ezui/{p-e3cd5080.entry.js → p-3d772561.entry.js} +1 -1
  171. package/dist/ezui/{p-c56ee8c0.entry.js → p-473a397f.entry.js} +1 -1
  172. package/dist/ezui/{p-729bd1be.entry.js → p-4991931a.entry.js} +1 -1
  173. package/dist/ezui/{p-d5dc6b01.entry.js → p-4ca4e8d1.entry.js} +1 -1
  174. package/dist/ezui/{p-4f7ad3ee.entry.js → p-4f76dc28.entry.js} +1 -1
  175. package/dist/ezui/{p-2da9faf1.entry.js → p-510eccc7.entry.js} +1 -1
  176. package/dist/ezui/p-54975948.entry.js +1 -0
  177. package/dist/ezui/p-69344c23.js +1 -0
  178. package/dist/ezui/p-6bb36afc.entry.js +1 -0
  179. package/dist/ezui/{p-5abb220b.entry.js → p-700af412.entry.js} +1 -1
  180. package/dist/ezui/{p-a4351519.entry.js → p-7f475884.entry.js} +1 -1
  181. package/dist/ezui/{p-4c76b365.entry.js → p-84be1391.entry.js} +1 -1
  182. package/dist/ezui/{p-987185c4.entry.js → p-879cee4d.entry.js} +1 -1
  183. package/dist/ezui/{p-34d459e4.entry.js → p-8980b477.entry.js} +1 -1
  184. package/dist/ezui/p-8a5efec5.entry.js +1 -0
  185. package/dist/ezui/p-91ff4511.entry.js +1 -0
  186. package/dist/ezui/{p-7134726a.entry.js → p-93097edc.entry.js} +1 -1
  187. package/dist/ezui/{p-e2972977.entry.js → p-96e5eaa2.entry.js} +1 -1
  188. package/dist/ezui/{p-0248846f.entry.js → p-a383fbc5.entry.js} +1 -1
  189. package/dist/ezui/{p-351fb12f.entry.js → p-a4735a12.entry.js} +1 -1
  190. package/dist/ezui/{p-a3bad8f8.entry.js → p-a4911d89.entry.js} +1 -1
  191. package/dist/ezui/{p-7edc3ef7.entry.js → p-a8f807ed.entry.js} +1 -1
  192. package/dist/ezui/{p-e3a42f47.entry.js → p-ab41edab.entry.js} +1 -1
  193. package/dist/ezui/{p-7953ecb9.entry.js → p-ab4da973.entry.js} +1 -1
  194. package/dist/ezui/{p-e493ad57.entry.js → p-adee66db.entry.js} +1 -1
  195. package/dist/ezui/{p-544605c4.entry.js → p-b5f45319.entry.js} +1 -1
  196. package/dist/ezui/p-c2d44132.entry.js +1 -0
  197. package/dist/ezui/{p-df802548.entry.js → p-c33d46e0.entry.js} +1 -1
  198. package/dist/ezui/{p-b36475f9.entry.js → p-c8584e28.entry.js} +1 -1
  199. package/dist/ezui/{p-a872c642.entry.js → p-caf3cd8f.entry.js} +1 -1
  200. package/dist/ezui/{p-4d30b703.entry.js → p-cf66ace0.entry.js} +1 -1
  201. package/dist/ezui/p-d2601b25.js +1 -0
  202. package/dist/ezui/{p-4c2a4435.entry.js → p-d98dd01a.entry.js} +1 -1
  203. package/dist/ezui/p-dd5326e6.entry.js +1 -0
  204. package/dist/ezui/{p-4af745e1.entry.js → p-ddc6432d.entry.js} +1 -1
  205. package/dist/ezui/{p-5a74d132.entry.js → p-ea0f78d1.entry.js} +46 -46
  206. package/dist/ezui/{p-97312709.entry.js → p-ed6b6e0f.entry.js} +1 -1
  207. package/dist/ezui/{p-4e869617.entry.js → p-f1390be9.entry.js} +1 -1
  208. package/dist/ezui/{p-6a794336.js → p-f71a4d97.js} +1 -1
  209. package/dist/ezui/{p-ef8bd3e8.entry.js → p-fc72aeb8.entry.js} +1 -1
  210. package/dist/ezui/p-fcdd861e.entry.js +1 -0
  211. package/dist/types/components/ez-empty-card/ez-empty-card.d.ts +2 -2
  212. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -0
  213. package/dist/types/components/ez-grid/controller/ag-grid/gridColumnDefaultWidths.d.ts +4 -0
  214. package/dist/types/components/ez-grid/ez-grid.d.ts +10 -27
  215. package/dist/types/components/ez-grid/utils/index.d.ts +1 -0
  216. package/dist/types/components/ez-grid-pagination/ez-grid-pagination.d.ts +75 -0
  217. package/dist/types/components/ez-record-navigation/ez-record-navigation.d.ts +43 -0
  218. package/dist/types/components/ez-scroller/EzScrollNavigationMode.d.ts +4 -0
  219. package/dist/types/components/ez-scroller/ez-scroller.d.ts +16 -2
  220. package/dist/types/components.d.ts +154 -6
  221. package/dist/types/utils/i18n/locales/en-us.d.ts +24 -3
  222. package/dist/types/utils/i18n/locales/es-es.d.ts +24 -3
  223. package/dist/types/utils/i18n/locales/pt-br.d.ts +24 -3
  224. package/dist/types/utils/i18n/translations.d.ts +72 -9
  225. package/package.json +2 -2
  226. package/react/components.d.ts +2 -0
  227. package/react/components.js +2 -0
  228. package/react/components.js.map +1 -1
  229. package/dist/ezui/p-07fb22c3.entry.js +0 -1
  230. package/dist/ezui/p-288631d1.entry.js +0 -1
  231. package/dist/ezui/p-2a806303.js +0 -1
  232. package/dist/ezui/p-2de94faf.entry.js +0 -1
  233. package/dist/ezui/p-619225ce.entry.js +0 -1
  234. package/dist/ezui/p-a813a748.entry.js +0 -1
  235. package/dist/ezui/p-b8078832.entry.js +0 -1
  236. package/dist/ezui/p-c0ae79fa.entry.js +0 -1
  237. package/dist/ezui/p-c178730b.js +0 -1
  238. package/dist/ezui/p-ce0a0036.entry.js +0 -7
  239. package/dist/ezui/p-d2645bdf.entry.js +0 -1
  240. package/dist/ezui/p-ff4312d5.js +0 -1
@@ -38,8 +38,9 @@ function getOppositeAxis(axis) {
38
38
  function getAxisLength(axis) {
39
39
  return axis === 'y' ? 'height' : 'width';
40
40
  }
41
+ const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
41
42
  function getSideAxis(placement) {
42
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
43
+ return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
43
44
  }
44
45
  function getAlignmentAxis(placement) {
45
46
  return getOppositeAxis(getSideAxis(placement));
@@ -64,19 +65,19 @@ function getExpandedPlacements(placement) {
64
65
  function getOppositeAlignmentPlacement(placement) {
65
66
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
66
67
  }
68
+ const lrPlacement = ['left', 'right'];
69
+ const rlPlacement = ['right', 'left'];
70
+ const tbPlacement = ['top', 'bottom'];
71
+ const btPlacement = ['bottom', 'top'];
67
72
  function getSideList(side, isStart, rtl) {
68
- const lr = ['left', 'right'];
69
- const rl = ['right', 'left'];
70
- const tb = ['top', 'bottom'];
71
- const bt = ['bottom', 'top'];
72
73
  switch (side) {
73
74
  case 'top':
74
75
  case 'bottom':
75
- if (rtl) return isStart ? rl : lr;
76
- return isStart ? lr : rl;
76
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
77
+ return isStart ? lrPlacement : rlPlacement;
77
78
  case 'left':
78
79
  case 'right':
79
- return isStart ? tb : bt;
80
+ return isStart ? tbPlacement : btPlacement;
80
81
  default:
81
82
  return [];
82
83
  }
@@ -187,6 +188,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
187
188
  return coords;
188
189
  }
189
190
 
191
+ /**
192
+ * Resolves with an object of overflow side offsets that determine how much the
193
+ * element is overflowing a given clipping boundary on each side.
194
+ * - positive = overflowing the boundary by that number of pixels
195
+ * - negative = how many pixels left before it will overflow
196
+ * - 0 = lies flush with the boundary
197
+ * @see https://floating-ui.com/docs/detectOverflow
198
+ */
199
+ async function detectOverflow(state, options) {
200
+ var _await$platform$isEle;
201
+ if (options === void 0) {
202
+ options = {};
203
+ }
204
+ const {
205
+ x,
206
+ y,
207
+ platform,
208
+ rects,
209
+ elements,
210
+ strategy
211
+ } = state;
212
+ const {
213
+ boundary = 'clippingAncestors',
214
+ rootBoundary = 'viewport',
215
+ elementContext = 'floating',
216
+ altBoundary = false,
217
+ padding = 0
218
+ } = evaluate(options, state);
219
+ const paddingObject = getPaddingObject(padding);
220
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
221
+ const element = elements[altBoundary ? altContext : elementContext];
222
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
223
+ 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))),
224
+ boundary,
225
+ rootBoundary,
226
+ strategy
227
+ }));
228
+ const rect = elementContext === 'floating' ? {
229
+ x,
230
+ y,
231
+ width: rects.floating.width,
232
+ height: rects.floating.height
233
+ } : rects.reference;
234
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
235
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
236
+ x: 1,
237
+ y: 1
238
+ } : {
239
+ x: 1,
240
+ y: 1
241
+ };
242
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
243
+ elements,
244
+ rect,
245
+ offsetParent,
246
+ strategy
247
+ }) : rect);
248
+ return {
249
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
250
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
251
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
252
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
253
+ };
254
+ }
255
+
190
256
  /**
191
257
  * Computes the `x` and `y` coordinates that will place the floating element
192
258
  * next to a given reference element.
@@ -216,6 +282,7 @@ const computePosition$1 = async (reference, floating, config) => {
216
282
  let middlewareData = {};
217
283
  let resetCount = 0;
218
284
  for (let i = 0; i < validMiddleware.length; i++) {
285
+ var _platform$detectOverf;
219
286
  const {
220
287
  name,
221
288
  fn
@@ -233,7 +300,10 @@ const computePosition$1 = async (reference, floating, config) => {
233
300
  strategy,
234
301
  middlewareData,
235
302
  rects,
236
- platform,
303
+ platform: {
304
+ ...platform,
305
+ detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
306
+ },
237
307
  elements: {
238
308
  reference,
239
309
  floating
@@ -278,71 +348,6 @@ const computePosition$1 = async (reference, floating, config) => {
278
348
  };
279
349
  };
280
350
 
281
- /**
282
- * Resolves with an object of overflow side offsets that determine how much the
283
- * element is overflowing a given clipping boundary on each side.
284
- * - positive = overflowing the boundary by that number of pixels
285
- * - negative = how many pixels left before it will overflow
286
- * - 0 = lies flush with the boundary
287
- * @see https://floating-ui.com/docs/detectOverflow
288
- */
289
- async function detectOverflow(state, options) {
290
- var _await$platform$isEle;
291
- if (options === void 0) {
292
- options = {};
293
- }
294
- const {
295
- x,
296
- y,
297
- platform,
298
- rects,
299
- elements,
300
- strategy
301
- } = state;
302
- const {
303
- boundary = 'clippingAncestors',
304
- rootBoundary = 'viewport',
305
- elementContext = 'floating',
306
- altBoundary = false,
307
- padding = 0
308
- } = evaluate(options, state);
309
- const paddingObject = getPaddingObject(padding);
310
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
311
- const element = elements[altBoundary ? altContext : elementContext];
312
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
313
- 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))),
314
- boundary,
315
- rootBoundary,
316
- strategy
317
- }));
318
- const rect = elementContext === 'floating' ? {
319
- x,
320
- y,
321
- width: rects.floating.width,
322
- height: rects.floating.height
323
- } : rects.reference;
324
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
325
- const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
326
- x: 1,
327
- y: 1
328
- } : {
329
- x: 1,
330
- y: 1
331
- };
332
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
333
- elements,
334
- rect,
335
- offsetParent,
336
- strategy
337
- }) : rect);
338
- return {
339
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
340
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
341
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
342
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
343
- };
344
- }
345
-
346
351
  /**
347
352
  * Provides data to position an inner element of the floating element so that it
348
353
  * appears centered to the reference element.
@@ -475,7 +480,7 @@ const flip$1 = function (options) {
475
480
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
476
481
  }
477
482
  const placements = [initialPlacement, ...fallbackPlacements];
478
- const overflow = await detectOverflow(state, detectOverflowOptions);
483
+ const overflow = await platform.detectOverflow(state, detectOverflowOptions);
479
484
  const overflows = [];
480
485
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
481
486
  if (checkMainAxis) {
@@ -496,16 +501,22 @@ const flip$1 = function (options) {
496
501
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
497
502
  const nextPlacement = placements[nextIndex];
498
503
  if (nextPlacement) {
499
- // Try next placement and re-run the lifecycle.
500
- return {
501
- data: {
502
- index: nextIndex,
503
- overflows: overflowsData
504
- },
505
- reset: {
506
- placement: nextPlacement
507
- }
508
- };
504
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
505
+ if (!ignoreCrossAxisOverflow ||
506
+ // We leave the current main axis only if every placement on that axis
507
+ // overflows the main axis.
508
+ overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
509
+ // Try next placement and re-run the lifecycle.
510
+ return {
511
+ data: {
512
+ index: nextIndex,
513
+ overflows: overflowsData
514
+ },
515
+ reset: {
516
+ placement: nextPlacement
517
+ }
518
+ };
519
+ }
509
520
  }
510
521
 
511
522
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -551,6 +562,8 @@ const flip$1 = function (options) {
551
562
  };
552
563
  };
553
564
 
565
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
566
+
554
567
  // For type backwards-compatibility, the `OffsetOptions` type was also
555
568
  // Derivable.
556
569
 
@@ -564,7 +577,7 @@ async function convertValueToCoords(state, options) {
564
577
  const side = getSide(placement);
565
578
  const alignment = getAlignment(placement);
566
579
  const isVertical = getSideAxis(placement) === 'y';
567
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
580
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
568
581
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
569
582
  const rawValue = evaluate(options, state);
570
583
 
@@ -651,7 +664,8 @@ const shift$1 = function (options) {
651
664
  const {
652
665
  x,
653
666
  y,
654
- placement
667
+ placement,
668
+ platform
655
669
  } = state;
656
670
  const {
657
671
  mainAxis: checkMainAxis = true,
@@ -674,7 +688,7 @@ const shift$1 = function (options) {
674
688
  x,
675
689
  y
676
690
  };
677
- const overflow = await detectOverflow(state, detectOverflowOptions);
691
+ const overflow = await platform.detectOverflow(state, detectOverflowOptions);
678
692
  const crossAxis = getSideAxis(getSide(placement));
679
693
  const mainAxis = getOppositeAxis(crossAxis);
680
694
  let mainAxisCoord = coords[mainAxis];
@@ -757,34 +771,40 @@ function isShadowRoot(value) {
757
771
  }
758
772
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
759
773
  }
774
+ const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
760
775
  function isOverflowElement(element) {
761
776
  const {
762
777
  overflow,
763
778
  overflowX,
764
779
  overflowY,
765
780
  display
766
- } = getComputedStyle(element);
767
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
781
+ } = getComputedStyle$1(element);
782
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
768
783
  }
784
+ const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
769
785
  function isTableElement(element) {
770
- return ['table', 'td', 'th'].includes(getNodeName(element));
786
+ return tableElements.has(getNodeName(element));
771
787
  }
788
+ const topLayerSelectors = [':popover-open', ':modal'];
772
789
  function isTopLayer(element) {
773
- return [':popover-open', ':modal'].some(selector => {
790
+ return topLayerSelectors.some(selector => {
774
791
  try {
775
792
  return element.matches(selector);
776
- } catch (e) {
793
+ } catch (_e) {
777
794
  return false;
778
795
  }
779
796
  });
780
797
  }
798
+ const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
799
+ const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
800
+ const containValues = ['paint', 'layout', 'strict', 'content'];
781
801
  function isContainingBlock(elementOrCss) {
782
802
  const webkit = isWebKit();
783
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
803
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
784
804
 
785
805
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
786
806
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
787
- return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
807
+ return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
788
808
  }
789
809
  function getContainingBlock(element) {
790
810
  let currentNode = getParentNode(element);
@@ -802,10 +822,11 @@ function isWebKit() {
802
822
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
803
823
  return CSS.supports('-webkit-backdrop-filter', 'none');
804
824
  }
825
+ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
805
826
  function isLastTraversableNode(node) {
806
- return ['html', 'body', '#document'].includes(getNodeName(node));
827
+ return lastTraversableNodeNames.has(getNodeName(node));
807
828
  }
808
- function getComputedStyle(element) {
829
+ function getComputedStyle$1(element) {
809
830
  return getWindow(element).getComputedStyle(element);
810
831
  }
811
832
  function getNodeScroll(element) {
@@ -867,7 +888,7 @@ function getFrameElement(win) {
867
888
  }
868
889
 
869
890
  function getCssDimensions(element) {
870
- const css = getComputedStyle(element);
891
+ const css = getComputedStyle$1(element);
871
892
  // In testing environments, the `width` and `height` properties are empty
872
893
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
873
894
  let width = parseFloat(css.width) || 0;
@@ -972,7 +993,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
972
993
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
973
994
  const iframeScale = getScale(currentIFrame);
974
995
  const iframeRect = currentIFrame.getBoundingClientRect();
975
- const css = getComputedStyle(currentIFrame);
996
+ const css = getComputedStyle$1(currentIFrame);
976
997
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
977
998
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
978
999
  x *= iframeScale.x;
@@ -1003,14 +1024,9 @@ function getWindowScrollBarX(element, rect) {
1003
1024
  return rect.left + leftScroll;
1004
1025
  }
1005
1026
 
1006
- function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
1007
- if (ignoreScrollbarX === void 0) {
1008
- ignoreScrollbarX = false;
1009
- }
1027
+ function getHTMLOffset(documentElement, scroll) {
1010
1028
  const htmlRect = documentElement.getBoundingClientRect();
1011
- const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
1012
- // RTL <body> scrollbar.
1013
- getWindowScrollBarX(documentElement, htmlRect));
1029
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
1014
1030
  const y = htmlRect.top + scroll.scrollTop;
1015
1031
  return {
1016
1032
  x,
@@ -1049,7 +1065,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1049
1065
  offsets.y = offsetRect.y + offsetParent.clientTop;
1050
1066
  }
1051
1067
  }
1052
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
1068
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1053
1069
  return {
1054
1070
  width: rect.width * scale.x,
1055
1071
  height: rect.height * scale.y,
@@ -1072,7 +1088,7 @@ function getDocumentRect(element) {
1072
1088
  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1073
1089
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1074
1090
  const y = -scroll.scrollTop;
1075
- if (getComputedStyle(body).direction === 'rtl') {
1091
+ if (getComputedStyle$1(body).direction === 'rtl') {
1076
1092
  x += max(html.clientWidth, body.clientWidth) - width;
1077
1093
  }
1078
1094
  return {
@@ -1083,6 +1099,10 @@ function getDocumentRect(element) {
1083
1099
  };
1084
1100
  }
1085
1101
 
1102
+ // Safety check: ensure the scrollbar space is reasonable in case this
1103
+ // calculation is affected by unusual styles.
1104
+ // Most scrollbars leave 15-18px of space.
1105
+ const SCROLLBAR_MAX = 25;
1086
1106
  function getViewportRect(element, strategy) {
1087
1107
  const win = getWindow(element);
1088
1108
  const html = getDocumentElement(element);
@@ -1100,6 +1120,24 @@ function getViewportRect(element, strategy) {
1100
1120
  y = visualViewport.offsetTop;
1101
1121
  }
1102
1122
  }
1123
+ const windowScrollbarX = getWindowScrollBarX(html);
1124
+ // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
1125
+ // visual width of the <html> but this is not considered in the size
1126
+ // of `html.clientWidth`.
1127
+ if (windowScrollbarX <= 0) {
1128
+ const doc = html.ownerDocument;
1129
+ const body = doc.body;
1130
+ const bodyStyles = getComputedStyle(body);
1131
+ const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
1132
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
1133
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
1134
+ width -= clippingStableScrollbarWidth;
1135
+ }
1136
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
1137
+ // If the <body> scrollbar is on the left, the width needs to be extended
1138
+ // by the scrollbar amount so there isn't extra space on the right.
1139
+ width += windowScrollbarX;
1140
+ }
1103
1141
  return {
1104
1142
  width,
1105
1143
  height,
@@ -1108,6 +1146,7 @@ function getViewportRect(element, strategy) {
1108
1146
  };
1109
1147
  }
1110
1148
 
1149
+ const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
1111
1150
  // Returns the inner client rect, subtracting scrollbars if present.
1112
1151
  function getInnerBoundingClientRect(element, strategy) {
1113
1152
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -1149,7 +1188,7 @@ function hasFixedPositionAncestor(element, stopNode) {
1149
1188
  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1150
1189
  return false;
1151
1190
  }
1152
- return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1191
+ return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1153
1192
  }
1154
1193
 
1155
1194
  // A "clipping ancestor" is an `overflow` element with the characteristic of
@@ -1162,17 +1201,17 @@ function getClippingElementAncestors(element, cache) {
1162
1201
  }
1163
1202
  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
1164
1203
  let currentContainingBlockComputedStyle = null;
1165
- const elementIsFixed = getComputedStyle(element).position === 'fixed';
1204
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
1166
1205
  let currentNode = elementIsFixed ? getParentNode(element) : element;
1167
1206
 
1168
1207
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1169
1208
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1170
- const computedStyle = getComputedStyle(currentNode);
1209
+ const computedStyle = getComputedStyle$1(currentNode);
1171
1210
  const currentNodeIsContaining = isContainingBlock(currentNode);
1172
1211
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1173
1212
  currentContainingBlockComputedStyle = null;
1174
1213
  }
1175
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1214
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1176
1215
  if (shouldDropCurrentNode) {
1177
1216
  // Drop non-containing blocks.
1178
1217
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -1235,6 +1274,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1235
1274
  scrollTop: 0
1236
1275
  };
1237
1276
  const offsets = createCoords(0);
1277
+
1278
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1279
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1280
+ function setLeftRTLScrollbarOffset() {
1281
+ offsets.x = getWindowScrollBarX(documentElement);
1282
+ }
1238
1283
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1239
1284
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1240
1285
  scroll = getNodeScroll(offsetParent);
@@ -1244,11 +1289,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1244
1289
  offsets.x = offsetRect.x + offsetParent.clientLeft;
1245
1290
  offsets.y = offsetRect.y + offsetParent.clientTop;
1246
1291
  } else if (documentElement) {
1247
- // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1248
- // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1249
- offsets.x = getWindowScrollBarX(documentElement);
1292
+ setLeftRTLScrollbarOffset();
1250
1293
  }
1251
1294
  }
1295
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
1296
+ setLeftRTLScrollbarOffset();
1297
+ }
1252
1298
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1253
1299
  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1254
1300
  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
@@ -1261,11 +1307,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1261
1307
  }
1262
1308
 
1263
1309
  function isStaticPositioned(element) {
1264
- return getComputedStyle(element).position === 'static';
1310
+ return getComputedStyle$1(element).position === 'static';
1265
1311
  }
1266
1312
 
1267
1313
  function getTrueOffsetParent(element, polyfill) {
1268
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1314
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
1269
1315
  return null;
1270
1316
  }
1271
1317
  if (polyfill) {
@@ -1326,7 +1372,7 @@ const getElementRects = async function (data) {
1326
1372
  };
1327
1373
 
1328
1374
  function isRTL(element) {
1329
- return getComputedStyle(element).direction === 'rtl';
1375
+ return getComputedStyle$1(element).direction === 'rtl';
1330
1376
  }
1331
1377
 
1332
1378
  const platform = {
@@ -1425,7 +1471,7 @@ function observeMove(element, onMove) {
1425
1471
  // Handle <iframe>s
1426
1472
  root: root.ownerDocument
1427
1473
  });
1428
- } catch (e) {
1474
+ } catch (_e) {
1429
1475
  io = new IntersectionObserver(handleObserve, options);
1430
1476
  }
1431
1477
  io.observe(element);