@a-ui/react 7.13.0-beta.4 → 7.13.0-beta.6

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 (269) hide show
  1. package/cjs/index10.js +1 -1
  2. package/cjs/index100.js +1 -1
  3. package/cjs/index101.js +1 -1
  4. package/cjs/index102.js +1 -1
  5. package/cjs/index103.js +1 -1
  6. package/cjs/index104.js +1 -1
  7. package/cjs/index105.js +1 -1
  8. package/cjs/index106.js +1 -1
  9. package/cjs/index107.js +1 -1
  10. package/cjs/index108.js +1 -1
  11. package/cjs/index109.js +1 -1
  12. package/cjs/index11.js +1 -1
  13. package/cjs/index110.js +1 -1
  14. package/cjs/index111.js +1 -1
  15. package/cjs/index112.js +1 -1
  16. package/cjs/index113.js +1 -1
  17. package/cjs/index114.js +2 -1
  18. package/cjs/index115.js +1 -1
  19. package/cjs/index116.js +1 -1
  20. package/cjs/index117.js +1 -1
  21. package/cjs/index118.js +1 -1
  22. package/cjs/index119.js +10 -1
  23. package/cjs/index12.js +1 -1
  24. package/cjs/index120.js +1 -1
  25. package/cjs/index121.js +1 -1
  26. package/cjs/index122.js +1 -1
  27. package/cjs/index123.js +1 -2
  28. package/cjs/index124.js +1 -1
  29. package/cjs/index125.js +1 -1
  30. package/cjs/index126.js +5 -1
  31. package/cjs/index127.js +9 -1
  32. package/cjs/index128.js +1 -10
  33. package/cjs/index129.js +1 -1
  34. package/cjs/index13.js +1 -1
  35. package/cjs/index130.js +1 -1
  36. package/cjs/index131.js +1 -1
  37. package/cjs/index132.js +1 -1
  38. package/cjs/index133.js +1 -1
  39. package/cjs/index134.js +1 -1
  40. package/cjs/index135.js +1 -5
  41. package/cjs/index136.js +1 -9
  42. package/cjs/index14.js +1 -1
  43. package/cjs/index144.js +1 -11
  44. package/cjs/index145.js +11 -1
  45. package/cjs/index146.js +1 -1
  46. package/cjs/index147.js +1 -1
  47. package/cjs/index16.js +1 -1
  48. package/cjs/index167.js +1 -1
  49. package/cjs/index17.js +1 -1
  50. package/cjs/index170.js +1 -1
  51. package/cjs/index171.js +1 -1
  52. package/cjs/index172.js +1 -1
  53. package/cjs/index176.js +1 -1
  54. package/cjs/index177.js +1 -1
  55. package/cjs/index18.js +1 -1
  56. package/cjs/index187.js +1 -1
  57. package/cjs/index194.js +1 -1
  58. package/cjs/index2.js +1 -1
  59. package/cjs/index20.js +1 -1
  60. package/cjs/index21.js +1 -1
  61. package/cjs/index22.js +1 -1
  62. package/cjs/index224.js +1 -1
  63. package/cjs/index225.js +1 -1
  64. package/cjs/index226.js +1 -1
  65. package/cjs/index227.js +1 -1
  66. package/cjs/index228.js +1 -1
  67. package/cjs/index229.js +1 -1
  68. package/cjs/index230.js +1 -1
  69. package/cjs/index231.js +1 -1
  70. package/cjs/index24.js +1 -1
  71. package/cjs/index25.js +1 -1
  72. package/cjs/index26.js +1 -1
  73. package/cjs/index27.js +1 -1
  74. package/cjs/index28.js +1 -1
  75. package/cjs/index3.js +1 -1
  76. package/cjs/index30.js +1 -1
  77. package/cjs/index31.js +1 -1
  78. package/cjs/index32.js +1 -1
  79. package/cjs/index33.js +1 -1
  80. package/cjs/index34.js +1 -1
  81. package/cjs/index36.js +1 -1
  82. package/cjs/index37.js +1 -1
  83. package/cjs/index38.js +1 -1
  84. package/cjs/index39.js +1 -1
  85. package/cjs/index4.js +1 -1
  86. package/cjs/index40.js +1 -1
  87. package/cjs/index41.js +1 -1
  88. package/cjs/index42.js +1 -1
  89. package/cjs/index43.js +1 -1
  90. package/cjs/index44.js +1 -1
  91. package/cjs/index45.js +1 -1
  92. package/cjs/index46.js +1 -1
  93. package/cjs/index47.js +1 -1
  94. package/cjs/index48.js +1 -1
  95. package/cjs/index49.js +1 -1
  96. package/cjs/index5.js +1 -1
  97. package/cjs/index50.js +1 -1
  98. package/cjs/index51.js +1 -1
  99. package/cjs/index52.js +1 -1
  100. package/cjs/index53.js +1 -1
  101. package/cjs/index54.js +1 -1
  102. package/cjs/index55.js +1 -7
  103. package/cjs/index56.js +1 -1
  104. package/cjs/index57.js +1 -1
  105. package/cjs/index58.js +1 -1
  106. package/cjs/index59.js +1 -1
  107. package/cjs/index6.js +1 -1
  108. package/cjs/index60.js +1 -1
  109. package/cjs/index61.js +7 -1
  110. package/cjs/index62.js +1 -1
  111. package/cjs/index63.js +1 -1
  112. package/cjs/index64.js +1 -1
  113. package/cjs/index65.js +1 -1
  114. package/cjs/index67.js +1 -1
  115. package/cjs/index68.js +1 -1
  116. package/cjs/index69.js +1 -1
  117. package/cjs/index71.js +1 -1
  118. package/cjs/index8.js +1 -1
  119. package/cjs/index82.js +1 -1
  120. package/cjs/index83.js +1 -1
  121. package/cjs/index85.js +1 -1
  122. package/cjs/index86.js +1 -1
  123. package/cjs/index87.js +1 -0
  124. package/cjs/index88.js +1 -0
  125. package/cjs/index89.js +1 -1
  126. package/cjs/index9.js +1 -1
  127. package/cjs/index90.js +1 -1
  128. package/cjs/index91.js +1 -1
  129. package/cjs/index94.js +1 -1
  130. package/cjs/index95.js +1 -1
  131. package/cjs/index96.js +1 -1
  132. package/cjs/index97.js +1 -1
  133. package/cjs/index98.js +1 -1
  134. package/cjs/index99.js +1 -1
  135. package/es/index10.mjs +4 -4
  136. package/es/index100.mjs +4 -66
  137. package/es/index101.mjs +11 -3
  138. package/es/index102.mjs +247 -5
  139. package/es/index103.mjs +88 -10
  140. package/es/index104.mjs +14 -6
  141. package/es/index105.mjs +4 -11
  142. package/es/index106.mjs +2 -247
  143. package/es/index107.mjs +2 -89
  144. package/es/index108.mjs +4 -15
  145. package/es/index109.mjs +391 -4
  146. package/es/index11.mjs +1 -1
  147. package/es/index110.mjs +125 -2
  148. package/es/index111.mjs +134 -2
  149. package/es/index112.mjs +2 -63
  150. package/es/index113.mjs +7 -13
  151. package/es/index114.mjs +326 -6
  152. package/es/index115.mjs +49 -6
  153. package/es/index116.mjs +2 -6
  154. package/es/index117.mjs +64 -5
  155. package/es/index118.mjs +43 -5
  156. package/es/index119.mjs +59 -6
  157. package/es/index12.mjs +2 -2
  158. package/es/index120.mjs +45 -6
  159. package/es/index121.mjs +40 -2
  160. package/es/index122.mjs +2 -8
  161. package/es/index123.mjs +2 -327
  162. package/es/index124.mjs +2 -50
  163. package/es/index125.mjs +31 -2
  164. package/es/index126.mjs +19 -65
  165. package/es/index127.mjs +58 -40
  166. package/es/index128.mjs +62 -59
  167. package/es/index129.mjs +15 -45
  168. package/es/index13.mjs +2 -2
  169. package/es/index130.mjs +6 -39
  170. package/es/index131.mjs +7 -2
  171. package/es/index132.mjs +6 -2
  172. package/es/index133.mjs +6 -2
  173. package/es/index134.mjs +4 -30
  174. package/es/index135.mjs +7 -19
  175. package/es/index136.mjs +4 -60
  176. package/es/index14.mjs +3 -3
  177. package/es/index144.mjs +2 -58
  178. package/es/index145.mjs +58 -2
  179. package/es/index146.mjs +2 -2
  180. package/es/index147.mjs +2 -2
  181. package/es/index16.mjs +1 -1
  182. package/es/index167.mjs +1 -1
  183. package/es/index17.mjs +2 -2
  184. package/es/index170.mjs +1 -1
  185. package/es/index171.mjs +1 -1
  186. package/es/index172.mjs +1 -1
  187. package/es/index176.mjs +1 -1
  188. package/es/index177.mjs +1 -1
  189. package/es/index18.mjs +3 -3
  190. package/es/index187.mjs +1 -1
  191. package/es/index194.mjs +1 -1
  192. package/es/index2.mjs +1 -1
  193. package/es/index20.mjs +2 -2
  194. package/es/index21.mjs +1 -1
  195. package/es/index22.mjs +1 -1
  196. package/es/index224.mjs +67 -58
  197. package/es/index225.mjs +31 -9
  198. package/es/index226.mjs +9 -20
  199. package/es/index227.mjs +104 -64
  200. package/es/index228.mjs +102 -26
  201. package/es/index229.mjs +59 -9
  202. package/es/index230.mjs +9 -108
  203. package/es/index231.mjs +19 -106
  204. package/es/index24.mjs +4 -4
  205. package/es/index25.mjs +2 -2
  206. package/es/index26.mjs +1 -1
  207. package/es/index27.mjs +1 -1
  208. package/es/index28.mjs +1 -1
  209. package/es/index3.mjs +1 -1
  210. package/es/index30.mjs +2 -2
  211. package/es/index31.mjs +2 -2
  212. package/es/index32.mjs +2 -2
  213. package/es/index33.mjs +3 -3
  214. package/es/index34.mjs +1 -1
  215. package/es/index36.mjs +3 -3
  216. package/es/index37.mjs +3 -3
  217. package/es/index38.mjs +3 -3
  218. package/es/index39.mjs +3 -3
  219. package/es/index4.mjs +2 -2
  220. package/es/index40.mjs +2 -2
  221. package/es/index41.mjs +1 -1
  222. package/es/index42.mjs +4 -4
  223. package/es/index43.mjs +1 -1
  224. package/es/index44.mjs +2 -2
  225. package/es/index45.mjs +3 -3
  226. package/es/index46.mjs +3 -3
  227. package/es/index47.mjs +2 -2
  228. package/es/index48.mjs +1 -1
  229. package/es/index49.mjs +2 -2
  230. package/es/index50.mjs +1 -1
  231. package/es/index51.mjs +11 -8
  232. package/es/index52.mjs +8 -11
  233. package/es/index53.mjs +21 -28
  234. package/es/index54.mjs +8 -47
  235. package/es/index55.mjs +28 -409
  236. package/es/index56.mjs +47 -21
  237. package/es/index57.mjs +47 -45
  238. package/es/index58.mjs +30 -8
  239. package/es/index59.mjs +17 -49
  240. package/es/index6.mjs +3 -3
  241. package/es/index60.mjs +28 -61
  242. package/es/index61.mjs +407 -58
  243. package/es/index62.mjs +27 -27
  244. package/es/index63.mjs +35 -20
  245. package/es/index64.mjs +3 -3
  246. package/es/index65.mjs +35 -30
  247. package/es/index67.mjs +9 -9
  248. package/es/index68.mjs +2 -2
  249. package/es/index69.mjs +2 -2
  250. package/es/index71.mjs +6 -6
  251. package/es/index8.mjs +3 -3
  252. package/es/index82.mjs +83 -60
  253. package/es/index83.mjs +1 -1
  254. package/es/index85.mjs +60 -12
  255. package/es/index86.mjs +57 -56
  256. package/es/index87.mjs +16 -0
  257. package/es/index88.mjs +61 -0
  258. package/es/index89.mjs +5 -5
  259. package/es/index9.mjs +1 -1
  260. package/es/index90.mjs +3 -3
  261. package/es/index91.mjs +1 -1
  262. package/es/index93.mjs +2 -2
  263. package/es/index94.mjs +224 -380
  264. package/es/index95.mjs +2 -125
  265. package/es/index96.mjs +63 -130
  266. package/es/index97.mjs +3 -2
  267. package/es/index98.mjs +5 -235
  268. package/es/index99.mjs +11 -2
  269. package/package.json +1 -1
package/es/index94.mjs CHANGED
@@ -1,393 +1,237 @@
1
- import { evaluate as $, getPaddingObject as H, getAlignmentAxis as I, getAlignment as X, getSide as _, getSideAxis as M, getOppositePlacement as q, getExpandedPlacements as G, getOppositeAxisPlacements as J, getAlignmentSides as K, clamp as B, getAxisLength as N, min as Y, rectToClientRect as W, getOppositeAxis as Q } from "./index95.mjs";
2
- function z(a, s, m) {
3
- let {
4
- reference: n,
5
- floating: r
6
- } = a;
7
- const e = M(s), i = I(s), l = N(i), d = _(s), g = e === "y", x = n.x + n.width / 2 - r.width / 2, c = n.y + n.height / 2 - r.height / 2, f = n[l] / 2 - r[l] / 2;
8
- let t;
9
- switch (d) {
10
- case "top":
11
- t = {
12
- x,
13
- y: n.y - r.height
14
- };
15
- break;
16
- case "bottom":
17
- t = {
18
- x,
19
- y: n.y + n.height
20
- };
21
- break;
22
- case "right":
23
- t = {
24
- x: n.x + n.width,
25
- y: c
26
- };
27
- break;
28
- case "left":
29
- t = {
30
- x: n.x - r.width,
31
- y: c
32
- };
33
- break;
34
- default:
35
- t = {
36
- x: n.x,
37
- y: n.y
38
- };
1
+ import { __exports as p } from "./index95.mjs";
2
+ import N from "react";
3
+ import T from "react-dom";
4
+ import { p as x } from "./index101.mjs";
5
+ import { M as A } from "./index102.mjs";
6
+ import "./index103.mjs";
7
+ import "./index104.mjs";
8
+ import D from "./index105.mjs";
9
+ import { __exports as w } from "./index106.mjs";
10
+ import { __exports as q } from "./index107.mjs";
11
+ Object.defineProperty(p, "__esModule", {
12
+ value: !0
13
+ });
14
+ p.bodyOpenClassName = p.portalClassName = void 0;
15
+ var g = Object.assign || function(r) {
16
+ for (var e = 1; e < arguments.length; e++) {
17
+ var o = arguments[e];
18
+ for (var a in o)
19
+ Object.prototype.hasOwnProperty.call(o, a) && (r[a] = o[a]);
39
20
  }
40
- switch (X(s)) {
41
- case "start":
42
- t[i] -= f * (m && g ? -1 : 1);
43
- break;
44
- case "end":
45
- t[i] += f * (m && g ? -1 : 1);
46
- break;
21
+ return r;
22
+ }, H = /* @__PURE__ */ function() {
23
+ function r(e, o) {
24
+ for (var a = 0; a < o.length; a++) {
25
+ var n = o[a];
26
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
27
+ }
47
28
  }
48
- return t;
49
- }
50
- async function Z(a, s) {
51
- var m;
52
- s === void 0 && (s = {});
53
- const {
54
- x: n,
55
- y: r,
56
- platform: e,
57
- rects: i,
58
- elements: l,
59
- strategy: d
60
- } = a, {
61
- boundary: g = "clippingAncestors",
62
- rootBoundary: x = "viewport",
63
- elementContext: c = "floating",
64
- altBoundary: f = !1,
65
- padding: t = 0
66
- } = $(s, a), o = H(t), v = l[f ? c === "floating" ? "reference" : "floating" : c], w = W(await e.getClippingRect({
67
- element: (m = await (e.isElement == null ? void 0 : e.isElement(v))) == null || m ? v : v.contextElement || await (e.getDocumentElement == null ? void 0 : e.getDocumentElement(l.floating)),
68
- boundary: g,
69
- rootBoundary: x,
70
- strategy: d
71
- })), y = c === "floating" ? {
72
- x: n,
73
- y: r,
74
- width: i.floating.width,
75
- height: i.floating.height
76
- } : i.reference, p = await (e.getOffsetParent == null ? void 0 : e.getOffsetParent(l.floating)), h = await (e.isElement == null ? void 0 : e.isElement(p)) ? await (e.getScale == null ? void 0 : e.getScale(p)) || {
77
- x: 1,
78
- y: 1
79
- } : {
80
- x: 1,
81
- y: 1
82
- }, P = W(e.convertOffsetParentRelativeRectToViewportRelativeRect ? await e.convertOffsetParentRelativeRectToViewportRelativeRect({
83
- elements: l,
84
- rect: y,
85
- offsetParent: p,
86
- strategy: d
87
- }) : y);
88
- return {
89
- top: (w.top - P.top + o.top) / h.y,
90
- bottom: (P.bottom - w.bottom + o.bottom) / h.y,
91
- left: (w.left - P.left + o.left) / h.x,
92
- right: (P.right - w.right + o.right) / h.x
29
+ return function(e, o, a) {
30
+ return o && r(e.prototype, o), a && r(e, a), e;
93
31
  };
32
+ }(), R = N, O = m(R), U = T, _ = m(U), L = x, t = m(L), k = A, C = m(k), $ = q, W = B($), u = w, M = m(u), F = D;
33
+ function B(r) {
34
+ if (r && r.__esModule)
35
+ return r;
36
+ var e = {};
37
+ if (r != null)
38
+ for (var o in r)
39
+ Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]);
40
+ return e.default = r, e;
94
41
  }
95
- const ee = 50, oe = async (a, s, m) => {
96
- const {
97
- placement: n = "bottom",
98
- strategy: r = "absolute",
99
- middleware: e = [],
100
- platform: i
101
- } = m, l = i.detectOverflow ? i : {
102
- ...i,
103
- detectOverflow: Z
104
- }, d = await (i.isRTL == null ? void 0 : i.isRTL(s));
105
- let g = await i.getElementRects({
106
- reference: a,
107
- floating: s,
108
- strategy: r
109
- }), {
110
- x,
111
- y: c
112
- } = z(g, n, d), f = n, t = 0;
113
- const o = {};
114
- for (let u = 0; u < e.length; u++) {
115
- const v = e[u];
116
- if (!v)
117
- continue;
118
- const {
119
- name: w,
120
- fn: y
121
- } = v, {
122
- x: p,
123
- y: h,
124
- data: P,
125
- reset: b
126
- } = await y({
127
- x,
128
- y: c,
129
- initialPlacement: n,
130
- placement: f,
131
- strategy: r,
132
- middlewareData: o,
133
- rects: g,
134
- platform: l,
135
- elements: {
136
- reference: a,
137
- floating: s
138
- }
139
- });
140
- x = p ?? x, c = h ?? c, o[w] = {
141
- ...o[w],
142
- ...P
143
- }, b && t < ee && (t++, typeof b == "object" && (b.placement && (f = b.placement), b.rects && (g = b.rects === !0 ? await i.getElementRects({
144
- reference: a,
145
- floating: s,
146
- strategy: r
147
- }) : b.rects), {
148
- x,
149
- y: c
150
- } = z(g, f, d)), u = -1);
151
- }
152
- return {
153
- x,
154
- y: c,
155
- placement: f,
156
- strategy: r,
157
- middlewareData: o
158
- };
159
- }, se = (a) => ({
160
- name: "arrow",
161
- options: a,
162
- async fn(s) {
163
- const {
164
- x: m,
165
- y: n,
166
- placement: r,
167
- rects: e,
168
- platform: i,
169
- elements: l,
170
- middlewareData: d
171
- } = s, {
172
- element: g,
173
- padding: x = 0
174
- } = $(a, s) || {};
175
- if (g == null)
176
- return {};
177
- const c = H(x), f = {
178
- x: m,
179
- y: n
180
- }, t = I(r), o = N(t), u = await i.getDimensions(g), v = t === "y", w = v ? "top" : "left", y = v ? "bottom" : "right", p = v ? "clientHeight" : "clientWidth", h = e.reference[o] + e.reference[t] - f[t] - e.floating[o], P = f[t] - e.reference[t], b = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(g));
181
- let D = b ? b[p] : 0;
182
- (!D || !await (i.isElement == null ? void 0 : i.isElement(b))) && (D = l.floating[p] || e.floating[o]);
183
- const V = h / 2 - P / 2, E = D / 2 - u[o] / 2 - 1, C = Y(c[w], E), F = Y(c[y], E), T = C, j = D - u[o] - F, A = D / 2 - u[o] / 2 + V, L = B(T, A, j), S = !d.arrow && X(r) != null && A !== L && e.reference[o] / 2 - (A < T ? C : F) - u[o] / 2 < 0, O = S ? A < T ? A - T : A - j : 0;
184
- return {
185
- [t]: f[t] + O,
186
- data: {
187
- [t]: L,
188
- centerOffset: A - L - O,
189
- ...S && {
190
- alignmentOffset: O
191
- }
192
- },
193
- reset: S
194
- };
42
+ function m(r) {
43
+ return r && r.__esModule ? r : { default: r };
44
+ }
45
+ function j(r, e) {
46
+ if (!(r instanceof e))
47
+ throw new TypeError("Cannot call a class as a function");
48
+ }
49
+ function E(r, e) {
50
+ if (!r)
51
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
52
+ return e && (typeof e == "object" || typeof e == "function") ? e : r;
53
+ }
54
+ function I(r, e) {
55
+ if (typeof e != "function" && e !== null)
56
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
57
+ r.prototype = Object.create(e && e.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(r, e) : r.__proto__ = e);
58
+ }
59
+ var V = p.portalClassName = "ReactModalPortal", z = p.bodyOpenClassName = "ReactModal__Body--open", s = u.canUseDOM && _.default.createPortal !== void 0, b = function(e) {
60
+ return document.createElement(e);
61
+ }, P = function() {
62
+ return s ? _.default.createPortal : _.default.unstable_renderSubtreeIntoContainer;
63
+ };
64
+ function y(r) {
65
+ return r();
66
+ }
67
+ var d = function(r) {
68
+ I(e, r);
69
+ function e() {
70
+ var o, a, n, l;
71
+ j(this, e);
72
+ for (var c = arguments.length, v = Array(c), f = 0; f < c; f++)
73
+ v[f] = arguments[f];
74
+ return l = (a = (n = E(this, (o = e.__proto__ || Object.getPrototypeOf(e)).call.apply(o, [this].concat(v))), n), n.removePortal = function() {
75
+ !s && _.default.unmountComponentAtNode(n.node);
76
+ var i = y(n.props.parentSelector);
77
+ i && i.contains(n.node) ? i.removeChild(n.node) : console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.');
78
+ }, n.portalRef = function(i) {
79
+ n.portal = i;
80
+ }, n.renderPortal = function(i) {
81
+ var h = P(), S = h(n, O.default.createElement(C.default, g({ defaultStyles: e.defaultStyles }, i)), n.node);
82
+ n.portalRef(S);
83
+ }, a), E(n, l);
195
84
  }
196
- }), ae = function(a) {
197
- return a === void 0 && (a = {}), {
198
- name: "flip",
199
- options: a,
200
- async fn(s) {
201
- var m, n;
202
- const {
203
- placement: r,
204
- middlewareData: e,
205
- rects: i,
206
- initialPlacement: l,
207
- platform: d,
208
- elements: g
209
- } = s, {
210
- mainAxis: x = !0,
211
- crossAxis: c = !0,
212
- fallbackPlacements: f,
213
- fallbackStrategy: t = "bestFit",
214
- fallbackAxisSideDirection: o = "none",
215
- flipAlignment: u = !0,
216
- ...v
217
- } = $(a, s);
218
- if ((m = e.arrow) != null && m.alignmentOffset)
219
- return {};
220
- const w = _(r), y = M(l), p = _(l) === l, h = await (d.isRTL == null ? void 0 : d.isRTL(g.floating)), P = f || (p || !u ? [q(l)] : G(l)), b = o !== "none";
221
- !f && b && P.push(...J(l, u, o, h));
222
- const D = [l, ...P], V = await d.detectOverflow(s, v), E = [];
223
- let C = ((n = e.flip) == null ? void 0 : n.overflows) || [];
224
- if (x && E.push(V[w]), c) {
225
- const A = K(r, i, h);
226
- E.push(V[A[0]], V[A[1]]);
227
- }
228
- if (C = [...C, {
229
- placement: r,
230
- overflows: E
231
- }], !E.every((A) => A <= 0)) {
232
- var F, T;
233
- const A = (((F = e.flip) == null ? void 0 : F.index) || 0) + 1, L = D[A];
234
- if (L && (!(c === "alignment" ? y !== M(L) : !1) || // We leave the current main axis only if every placement on that axis
235
- // overflows the main axis.
236
- C.every((R) => M(R.placement) === y ? R.overflows[0] > 0 : !0)))
237
- return {
238
- data: {
239
- index: A,
240
- overflows: C
241
- },
242
- reset: {
243
- placement: L
244
- }
245
- };
246
- let S = (T = C.filter((O) => O.overflows[0] <= 0).sort((O, R) => O.overflows[1] - R.overflows[1])[0]) == null ? void 0 : T.placement;
247
- if (!S)
248
- switch (t) {
249
- case "bestFit": {
250
- var j;
251
- const O = (j = C.filter((R) => {
252
- if (b) {
253
- const k = M(R.placement);
254
- return k === y || // Create a bias to the `y` side axis due to horizontal
255
- // reading directions favoring greater width.
256
- k === "y";
257
- }
258
- return !0;
259
- }).map((R) => [R.placement, R.overflows.filter((k) => k > 0).reduce((k, U) => k + U, 0)]).sort((R, k) => R[1] - k[1])[0]) == null ? void 0 : j[0];
260
- O && (S = O);
261
- break;
262
- }
263
- case "initialPlacement":
264
- S = l;
265
- break;
266
- }
267
- if (r !== S)
268
- return {
269
- reset: {
270
- placement: S
271
- }
272
- };
85
+ return H(e, [{
86
+ key: "componentDidMount",
87
+ value: function() {
88
+ if (u.canUseDOM) {
89
+ s || (this.node = b("div")), this.node.className = this.props.portalClassName;
90
+ var a = y(this.props.parentSelector);
91
+ a.appendChild(this.node), !s && this.renderPortal(this.props);
273
92
  }
274
- return {};
275
93
  }
276
- };
277
- }, te = /* @__PURE__ */ new Set(["left", "top"]);
278
- async function ne(a, s) {
279
- const {
280
- placement: m,
281
- platform: n,
282
- elements: r
283
- } = a, e = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), i = _(m), l = X(m), d = M(m) === "y", g = te.has(i) ? -1 : 1, x = e && d ? -1 : 1, c = $(s, a);
284
- let {
285
- mainAxis: f,
286
- crossAxis: t,
287
- alignmentAxis: o
288
- } = typeof c == "number" ? {
289
- mainAxis: c,
290
- crossAxis: 0,
291
- alignmentAxis: null
292
- } : {
293
- mainAxis: c.mainAxis || 0,
294
- crossAxis: c.crossAxis || 0,
295
- alignmentAxis: c.alignmentAxis
296
- };
297
- return l && typeof o == "number" && (t = l === "end" ? o * -1 : o), d ? {
298
- x: t * x,
299
- y: f * g
300
- } : {
301
- x: f * g,
302
- y: t * x
303
- };
304
- }
305
- const le = function(a) {
306
- return a === void 0 && (a = 0), {
307
- name: "offset",
308
- options: a,
309
- async fn(s) {
310
- var m, n;
311
- const {
312
- x: r,
313
- y: e,
314
- placement: i,
315
- middlewareData: l
316
- } = s, d = await ne(s, a);
317
- return i === ((m = l.offset) == null ? void 0 : m.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
318
- x: r + d.x,
319
- y: e + d.y,
320
- data: {
321
- ...d,
322
- placement: i
323
- }
324
- };
94
+ }, {
95
+ key: "getSnapshotBeforeUpdate",
96
+ value: function(a) {
97
+ var n = y(a.parentSelector), l = y(this.props.parentSelector);
98
+ return { prevParent: n, nextParent: l };
325
99
  }
326
- };
327
- }, ce = function(a) {
328
- return a === void 0 && (a = {}), {
329
- name: "shift",
330
- options: a,
331
- async fn(s) {
332
- const {
333
- x: m,
334
- y: n,
335
- placement: r,
336
- platform: e
337
- } = s, {
338
- mainAxis: i = !0,
339
- crossAxis: l = !1,
340
- limiter: d = {
341
- fn: (w) => {
342
- let {
343
- x: y,
344
- y: p
345
- } = w;
346
- return {
347
- x: y,
348
- y: p
349
- };
350
- }
351
- },
352
- ...g
353
- } = $(a, s), x = {
354
- x: m,
355
- y: n
356
- }, c = await e.detectOverflow(s, g), f = M(_(r)), t = Q(f);
357
- let o = x[t], u = x[f];
358
- if (i) {
359
- const w = t === "y" ? "top" : "left", y = t === "y" ? "bottom" : "right", p = o + c[w], h = o - c[y];
360
- o = B(p, o, h);
100
+ }, {
101
+ key: "componentDidUpdate",
102
+ value: function(a, n, l) {
103
+ if (u.canUseDOM) {
104
+ var c = this.props, v = c.isOpen, f = c.portalClassName;
105
+ a.portalClassName !== f && (this.node.className = f);
106
+ var i = l.prevParent, h = l.nextParent;
107
+ h !== i && (i.removeChild(this.node), h.appendChild(this.node)), !(!a.isOpen && !v) && !s && this.renderPortal(this.props);
361
108
  }
362
- if (l) {
363
- const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", p = u + c[w], h = u - c[y];
364
- u = B(p, u, h);
109
+ }
110
+ }, {
111
+ key: "componentWillUnmount",
112
+ value: function() {
113
+ if (!(!u.canUseDOM || !this.node || !this.portal)) {
114
+ var a = this.portal.state, n = Date.now(), l = a.isOpen && this.props.closeTimeoutMS && (a.closesAt || n + this.props.closeTimeoutMS);
115
+ l ? (a.beforeClose || this.portal.closeWithTimeout(), setTimeout(this.removePortal, l - n)) : this.removePortal();
365
116
  }
366
- const v = d.fn({
367
- ...s,
368
- [t]: o,
369
- [f]: u
370
- });
371
- return {
372
- ...v,
373
- data: {
374
- x: v.x - m,
375
- y: v.y - n,
376
- enabled: {
377
- [t]: i,
378
- [f]: l
379
- }
380
- }
381
- };
382
117
  }
383
- };
118
+ }, {
119
+ key: "render",
120
+ value: function() {
121
+ if (!u.canUseDOM || !s)
122
+ return null;
123
+ !this.node && s && (this.node = b("div"));
124
+ var a = P();
125
+ return a(O.default.createElement(C.default, g({
126
+ ref: this.portalRef,
127
+ defaultStyles: e.defaultStyles
128
+ }, this.props)), this.node);
129
+ }
130
+ }], [{
131
+ key: "setAppElement",
132
+ value: function(a) {
133
+ W.setElement(a);
134
+ }
135
+ /* eslint-disable react/no-unused-prop-types */
136
+ /* eslint-enable react/no-unused-prop-types */
137
+ }]), e;
138
+ }(R.Component);
139
+ d.propTypes = {
140
+ isOpen: t.default.bool.isRequired,
141
+ style: t.default.shape({
142
+ content: t.default.object,
143
+ overlay: t.default.object
144
+ }),
145
+ portalClassName: t.default.string,
146
+ bodyOpenClassName: t.default.string,
147
+ htmlOpenClassName: t.default.string,
148
+ className: t.default.oneOfType([t.default.string, t.default.shape({
149
+ base: t.default.string.isRequired,
150
+ afterOpen: t.default.string.isRequired,
151
+ beforeClose: t.default.string.isRequired
152
+ })]),
153
+ overlayClassName: t.default.oneOfType([t.default.string, t.default.shape({
154
+ base: t.default.string.isRequired,
155
+ afterOpen: t.default.string.isRequired,
156
+ beforeClose: t.default.string.isRequired
157
+ })]),
158
+ appElement: t.default.oneOfType([t.default.instanceOf(M.default), t.default.instanceOf(u.SafeHTMLCollection), t.default.instanceOf(u.SafeNodeList), t.default.arrayOf(t.default.instanceOf(M.default))]),
159
+ onAfterOpen: t.default.func,
160
+ onRequestClose: t.default.func,
161
+ closeTimeoutMS: t.default.number,
162
+ ariaHideApp: t.default.bool,
163
+ shouldFocusAfterRender: t.default.bool,
164
+ shouldCloseOnOverlayClick: t.default.bool,
165
+ shouldReturnFocusAfterClose: t.default.bool,
166
+ preventScroll: t.default.bool,
167
+ parentSelector: t.default.func,
168
+ aria: t.default.object,
169
+ data: t.default.object,
170
+ role: t.default.string,
171
+ contentLabel: t.default.string,
172
+ shouldCloseOnEsc: t.default.bool,
173
+ overlayRef: t.default.func,
174
+ contentRef: t.default.func,
175
+ id: t.default.string,
176
+ overlayElement: t.default.func,
177
+ contentElement: t.default.func
384
178
  };
385
- export {
386
- se as arrow,
387
- oe as computePosition,
388
- Z as detectOverflow,
389
- ae as flip,
390
- le as offset,
391
- W as rectToClientRect,
392
- ce as shift
179
+ d.defaultProps = {
180
+ isOpen: !1,
181
+ portalClassName: V,
182
+ bodyOpenClassName: z,
183
+ role: "dialog",
184
+ ariaHideApp: !0,
185
+ closeTimeoutMS: 0,
186
+ shouldFocusAfterRender: !0,
187
+ shouldCloseOnEsc: !0,
188
+ shouldCloseOnOverlayClick: !0,
189
+ shouldReturnFocusAfterClose: !0,
190
+ preventScroll: !1,
191
+ parentSelector: function() {
192
+ return document.body;
193
+ },
194
+ overlayElement: function(e, o) {
195
+ return O.default.createElement(
196
+ "div",
197
+ e,
198
+ o
199
+ );
200
+ },
201
+ contentElement: function(e, o) {
202
+ return O.default.createElement(
203
+ "div",
204
+ e,
205
+ o
206
+ );
207
+ }
208
+ };
209
+ d.defaultStyles = {
210
+ overlay: {
211
+ position: "fixed",
212
+ top: 0,
213
+ left: 0,
214
+ right: 0,
215
+ bottom: 0,
216
+ backgroundColor: "rgba(255, 255, 255, 0.75)"
217
+ },
218
+ content: {
219
+ position: "absolute",
220
+ top: "40px",
221
+ left: "40px",
222
+ right: "40px",
223
+ bottom: "40px",
224
+ border: "1px solid #ccc",
225
+ background: "#fff",
226
+ overflow: "auto",
227
+ WebkitOverflowScrolling: "touch",
228
+ borderRadius: "4px",
229
+ outline: "none",
230
+ padding: "20px"
231
+ }
393
232
  };
233
+ (0, F.polyfill)(d);
234
+ process.env.NODE_ENV !== "production" && (d.setCreateHTMLElement = function(r) {
235
+ return b = r;
236
+ });
237
+ p.default = d;