@profiq/ui 0.1.1 → 0.1.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.
- package/dist/components/custom/basic/button.d.ts +2 -1
- package/dist/components/custom/basic/button.d.ts.map +1 -1
- package/dist/components/custom/basic/input.d.ts +2 -1
- package/dist/components/custom/basic/input.d.ts.map +1 -1
- package/dist/components/ui/buttonVariants.d.ts.map +1 -1
- package/dist/components/ui/buttonVariants.js +2 -2
- package/dist/components/ui/slider.js +23 -23
- package/dist/index.css +161 -260
- package/dist/index.js +7 -50
- package/dist/lib/baseProps.d.ts +2 -2
- package/dist/lib/baseProps.d.ts.map +1 -1
- package/dist/lib/baseProps.js +6 -6
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +171 -171
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +191 -190
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +125 -101
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +97 -97
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +60 -62
- package/package.json +4 -20
- package/dist/components/custom/basic/index.d.ts +0 -17
- package/dist/components/custom/basic/index.d.ts.map +0 -1
- package/dist/components/custom/basic/index.js +0 -20
- package/dist/components/custom/icons/index.d.ts +0 -15
- package/dist/components/custom/icons/index.d.ts.map +0 -1
- package/dist/components/custom/icons/index.js +0 -27
- package/dist/components/ui/index.d.ts +0 -14
- package/dist/components/ui/index.d.ts.map +0 -1
- package/dist/components/ui/index.js +0 -59
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -11
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { getSideAxis as T, getAlignmentAxis as
|
|
2
|
-
function
|
|
1
|
+
import { getSideAxis as T, getAlignmentAxis as U, getSide as j, getAlignment as _, evaluate as L, getPaddingObject as q, rectToClientRect as z, getAxisLength as G, clamp as $, getOppositePlacement as Z, getExpandedPlacements as ee, getOppositeAxisPlacements as te, getAlignmentSides as ne, min as Y, max as B, getOppositeAxis as J, sides as ie } from "../../utils/dist/floating-ui.utils.js";
|
|
2
|
+
function X(t, e, d) {
|
|
3
3
|
let {
|
|
4
4
|
reference: a,
|
|
5
5
|
floating: m
|
|
6
6
|
} = t;
|
|
7
|
-
const n = T(e),
|
|
8
|
-
let
|
|
7
|
+
const n = T(e), i = U(e), l = G(i), g = j(e), p = n === "y", r = a.x + a.width / 2 - m.width / 2, o = a.y + a.height / 2 - m.height / 2, f = a[l] / 2 - m[l] / 2;
|
|
8
|
+
let s;
|
|
9
9
|
switch (g) {
|
|
10
10
|
case "top":
|
|
11
|
-
|
|
11
|
+
s = {
|
|
12
12
|
x: r,
|
|
13
13
|
y: a.y - m.height
|
|
14
14
|
};
|
|
15
15
|
break;
|
|
16
16
|
case "bottom":
|
|
17
|
-
|
|
17
|
+
s = {
|
|
18
18
|
x: r,
|
|
19
19
|
y: a.y + a.height
|
|
20
20
|
};
|
|
21
21
|
break;
|
|
22
22
|
case "right":
|
|
23
|
-
|
|
23
|
+
s = {
|
|
24
24
|
x: a.x + a.width,
|
|
25
25
|
y: o
|
|
26
26
|
};
|
|
27
27
|
break;
|
|
28
28
|
case "left":
|
|
29
|
-
|
|
29
|
+
s = {
|
|
30
30
|
x: a.x - m.width,
|
|
31
31
|
y: o
|
|
32
32
|
};
|
|
33
33
|
break;
|
|
34
34
|
default:
|
|
35
|
-
|
|
35
|
+
s = {
|
|
36
36
|
x: a.x,
|
|
37
37
|
y: a.y
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
switch (
|
|
40
|
+
switch (_(e)) {
|
|
41
41
|
case "start":
|
|
42
|
-
i
|
|
42
|
+
s[i] -= f * (d && p ? -1 : 1);
|
|
43
43
|
break;
|
|
44
44
|
case "end":
|
|
45
|
-
i
|
|
45
|
+
s[i] += f * (d && p ? -1 : 1);
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return s;
|
|
49
49
|
}
|
|
50
50
|
async function se(t, e) {
|
|
51
51
|
var d;
|
|
@@ -54,7 +54,7 @@ async function se(t, e) {
|
|
|
54
54
|
x: a,
|
|
55
55
|
y: m,
|
|
56
56
|
platform: n,
|
|
57
|
-
rects:
|
|
57
|
+
rects: i,
|
|
58
58
|
elements: l,
|
|
59
59
|
strategy: g
|
|
60
60
|
} = t, {
|
|
@@ -62,101 +62,101 @@ async function se(t, e) {
|
|
|
62
62
|
rootBoundary: r = "viewport",
|
|
63
63
|
elementContext: o = "floating",
|
|
64
64
|
altBoundary: f = !1,
|
|
65
|
-
padding:
|
|
66
|
-
} = L(e, t), c =
|
|
67
|
-
element: (d = await (n.isElement == null ? void 0 : n.isElement(
|
|
65
|
+
padding: s = 0
|
|
66
|
+
} = L(e, t), c = q(s), h = l[f ? o === "floating" ? "reference" : "floating" : o], v = z(await n.getClippingRect({
|
|
67
|
+
element: (d = await (n.isElement == null ? void 0 : n.isElement(h))) == null || d ? h : h.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(l.floating)),
|
|
68
68
|
boundary: p,
|
|
69
69
|
rootBoundary: r,
|
|
70
70
|
strategy: g
|
|
71
|
-
})),
|
|
71
|
+
})), A = o === "floating" ? {
|
|
72
72
|
x: a,
|
|
73
73
|
y: m,
|
|
74
|
-
width:
|
|
75
|
-
height:
|
|
76
|
-
} :
|
|
74
|
+
width: i.floating.width,
|
|
75
|
+
height: i.floating.height
|
|
76
|
+
} : i.reference, u = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(l.floating)), w = await (n.isElement == null ? void 0 : n.isElement(u)) ? await (n.getScale == null ? void 0 : n.getScale(u)) || {
|
|
77
77
|
x: 1,
|
|
78
78
|
y: 1
|
|
79
79
|
} : {
|
|
80
80
|
x: 1,
|
|
81
81
|
y: 1
|
|
82
|
-
},
|
|
82
|
+
}, y = z(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
83
83
|
elements: l,
|
|
84
|
-
rect:
|
|
85
|
-
offsetParent:
|
|
84
|
+
rect: A,
|
|
85
|
+
offsetParent: u,
|
|
86
86
|
strategy: g
|
|
87
|
-
}) :
|
|
87
|
+
}) : A);
|
|
88
88
|
return {
|
|
89
|
-
top: (v.top -
|
|
90
|
-
bottom: (
|
|
91
|
-
left: (v.left -
|
|
92
|
-
right: (
|
|
89
|
+
top: (v.top - y.top + c.top) / w.y,
|
|
90
|
+
bottom: (y.bottom - v.bottom + c.bottom) / w.y,
|
|
91
|
+
left: (v.left - y.left + c.left) / w.x,
|
|
92
|
+
right: (y.right - v.right + c.right) / w.x
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
const le = async (t, e, d) => {
|
|
95
|
+
const oe = 50, le = async (t, e, d) => {
|
|
96
96
|
const {
|
|
97
97
|
placement: a = "bottom",
|
|
98
98
|
strategy: m = "absolute",
|
|
99
99
|
middleware: n = [],
|
|
100
|
-
platform:
|
|
101
|
-
} = d, l =
|
|
102
|
-
|
|
100
|
+
platform: i
|
|
101
|
+
} = d, l = i.detectOverflow ? i : {
|
|
102
|
+
...i,
|
|
103
|
+
detectOverflow: se
|
|
104
|
+
}, g = await (i.isRTL == null ? void 0 : i.isRTL(e));
|
|
105
|
+
let p = await i.getElementRects({
|
|
103
106
|
reference: t,
|
|
104
107
|
floating: e,
|
|
105
108
|
strategy: m
|
|
106
109
|
}), {
|
|
107
110
|
x: r,
|
|
108
111
|
y: o
|
|
109
|
-
} =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
} = X(p, a, g), f = a, s = 0;
|
|
113
|
+
const c = {};
|
|
114
|
+
for (let x = 0; x < n.length; x++) {
|
|
115
|
+
const h = n[x];
|
|
116
|
+
if (!h)
|
|
117
|
+
continue;
|
|
112
118
|
const {
|
|
113
119
|
name: v,
|
|
114
|
-
fn:
|
|
115
|
-
} =
|
|
116
|
-
x:
|
|
117
|
-
y:
|
|
118
|
-
data:
|
|
120
|
+
fn: A
|
|
121
|
+
} = h, {
|
|
122
|
+
x: u,
|
|
123
|
+
y: w,
|
|
124
|
+
data: y,
|
|
119
125
|
reset: b
|
|
120
|
-
} = await
|
|
126
|
+
} = await A({
|
|
121
127
|
x: r,
|
|
122
128
|
y: o,
|
|
123
129
|
initialPlacement: a,
|
|
124
130
|
placement: f,
|
|
125
131
|
strategy: m,
|
|
126
|
-
middlewareData:
|
|
132
|
+
middlewareData: c,
|
|
127
133
|
rects: p,
|
|
128
|
-
platform:
|
|
129
|
-
...s,
|
|
130
|
-
detectOverflow: (u = s.detectOverflow) != null ? u : se
|
|
131
|
-
},
|
|
134
|
+
platform: l,
|
|
132
135
|
elements: {
|
|
133
136
|
reference: t,
|
|
134
137
|
floating: e
|
|
135
138
|
}
|
|
136
139
|
});
|
|
137
|
-
r =
|
|
138
|
-
...
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
...A
|
|
142
|
-
}
|
|
143
|
-
}, b && c <= 50 && (c++, typeof b == "object" && (b.placement && (f = b.placement), b.rects && (p = b.rects === !0 ? await s.getElementRects({
|
|
140
|
+
r = u ?? r, o = w ?? o, c[v] = {
|
|
141
|
+
...c[v],
|
|
142
|
+
...y
|
|
143
|
+
}, b && s < oe && (s++, typeof b == "object" && (b.placement && (f = b.placement), b.rects && (p = b.rects === !0 ? await i.getElementRects({
|
|
144
144
|
reference: t,
|
|
145
145
|
floating: e,
|
|
146
146
|
strategy: m
|
|
147
147
|
}) : b.rects), {
|
|
148
148
|
x: r,
|
|
149
149
|
y: o
|
|
150
|
-
} =
|
|
150
|
+
} = X(p, f, g)), x = -1);
|
|
151
151
|
}
|
|
152
152
|
return {
|
|
153
153
|
x: r,
|
|
154
154
|
y: o,
|
|
155
155
|
placement: f,
|
|
156
156
|
strategy: m,
|
|
157
|
-
middlewareData:
|
|
157
|
+
middlewareData: c
|
|
158
158
|
};
|
|
159
|
-
},
|
|
159
|
+
}, re = (t) => ({
|
|
160
160
|
name: "arrow",
|
|
161
161
|
options: t,
|
|
162
162
|
async fn(e) {
|
|
@@ -165,7 +165,7 @@ const le = async (t, e, d) => {
|
|
|
165
165
|
y: a,
|
|
166
166
|
placement: m,
|
|
167
167
|
rects: n,
|
|
168
|
-
platform:
|
|
168
|
+
platform: i,
|
|
169
169
|
elements: l,
|
|
170
170
|
middlewareData: g
|
|
171
171
|
} = e, {
|
|
@@ -174,26 +174,26 @@ const le = async (t, e, d) => {
|
|
|
174
174
|
} = L(t, e) || {};
|
|
175
175
|
if (p == null)
|
|
176
176
|
return {};
|
|
177
|
-
const o =
|
|
177
|
+
const o = q(r), f = {
|
|
178
178
|
x: d,
|
|
179
179
|
y: a
|
|
180
|
-
},
|
|
181
|
-
let C = b ? b[
|
|
182
|
-
(!C || !await (
|
|
183
|
-
const
|
|
180
|
+
}, s = U(m), c = G(s), x = await i.getDimensions(p), h = s === "y", v = h ? "top" : "left", A = h ? "bottom" : "right", u = h ? "clientHeight" : "clientWidth", w = n.reference[c] + n.reference[s] - f[s] - n.floating[c], y = f[s] - n.reference[s], b = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(p));
|
|
181
|
+
let C = b ? b[u] : 0;
|
|
182
|
+
(!C || !await (i.isElement == null ? void 0 : i.isElement(b))) && (C = l.floating[u] || n.floating[c]);
|
|
183
|
+
const E = w / 2 - y / 2, D = C / 2 - x[c] / 2 - 1, P = Y(o[v], D), H = Y(o[A], D), k = P, F = C - x[c] - H, O = C / 2 - x[c] / 2 + E, W = $(k, O, F), M = !g.arrow && _(m) != null && O !== W && n.reference[c] / 2 - (O < k ? P : H) - x[c] / 2 < 0, S = M ? O < k ? O - k : O - F : 0;
|
|
184
184
|
return {
|
|
185
|
-
[
|
|
185
|
+
[s]: f[s] + S,
|
|
186
186
|
data: {
|
|
187
|
-
[
|
|
188
|
-
centerOffset: O -
|
|
189
|
-
...
|
|
187
|
+
[s]: W,
|
|
188
|
+
centerOffset: O - W - S,
|
|
189
|
+
...M && {
|
|
190
190
|
alignmentOffset: S
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
|
-
reset:
|
|
193
|
+
reset: M
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
}),
|
|
196
|
+
}), fe = function(t) {
|
|
197
197
|
return t === void 0 && (t = {}), {
|
|
198
198
|
name: "flip",
|
|
199
199
|
options: t,
|
|
@@ -202,7 +202,7 @@ const le = async (t, e, d) => {
|
|
|
202
202
|
const {
|
|
203
203
|
placement: m,
|
|
204
204
|
middlewareData: n,
|
|
205
|
-
rects:
|
|
205
|
+
rects: i,
|
|
206
206
|
initialPlacement: l,
|
|
207
207
|
platform: g,
|
|
208
208
|
elements: p
|
|
@@ -210,64 +210,64 @@ const le = async (t, e, d) => {
|
|
|
210
210
|
mainAxis: r = !0,
|
|
211
211
|
crossAxis: o = !0,
|
|
212
212
|
fallbackPlacements: f,
|
|
213
|
-
fallbackStrategy:
|
|
213
|
+
fallbackStrategy: s = "bestFit",
|
|
214
214
|
fallbackAxisSideDirection: c = "none",
|
|
215
|
-
flipAlignment:
|
|
216
|
-
...
|
|
215
|
+
flipAlignment: x = !0,
|
|
216
|
+
...h
|
|
217
217
|
} = L(t, e);
|
|
218
218
|
if ((d = n.arrow) != null && d.alignmentOffset)
|
|
219
219
|
return {};
|
|
220
|
-
const v = j(m),
|
|
221
|
-
!f && b &&
|
|
222
|
-
const C = [l, ...
|
|
220
|
+
const v = j(m), A = T(l), u = j(l) === l, w = await (g.isRTL == null ? void 0 : g.isRTL(p.floating)), y = f || (u || !x ? [Z(l)] : ee(l)), b = c !== "none";
|
|
221
|
+
!f && b && y.push(...te(l, x, c, w));
|
|
222
|
+
const C = [l, ...y], E = await g.detectOverflow(e, h), D = [];
|
|
223
223
|
let P = ((a = n.flip) == null ? void 0 : a.overflows) || [];
|
|
224
|
-
if (r &&
|
|
225
|
-
const O = ne(m,
|
|
226
|
-
|
|
224
|
+
if (r && D.push(E[v]), o) {
|
|
225
|
+
const O = ne(m, i, w);
|
|
226
|
+
D.push(E[O[0]], E[O[1]]);
|
|
227
227
|
}
|
|
228
228
|
if (P = [...P, {
|
|
229
229
|
placement: m,
|
|
230
|
-
overflows:
|
|
231
|
-
}], !
|
|
232
|
-
var H,
|
|
233
|
-
const O = (((H = n.flip) == null ? void 0 : H.index) || 0) + 1,
|
|
234
|
-
if (
|
|
230
|
+
overflows: D
|
|
231
|
+
}], !D.every((O) => O <= 0)) {
|
|
232
|
+
var H, k;
|
|
233
|
+
const O = (((H = n.flip) == null ? void 0 : H.index) || 0) + 1, W = C[O];
|
|
234
|
+
if (W && (!(o === "alignment" ? A !== T(W) : !1) || // We leave the current main axis only if every placement on that axis
|
|
235
235
|
// overflows the main axis.
|
|
236
|
-
P.every((R) => T(R.placement) ===
|
|
236
|
+
P.every((R) => T(R.placement) === A ? R.overflows[0] > 0 : !0)))
|
|
237
237
|
return {
|
|
238
238
|
data: {
|
|
239
239
|
index: O,
|
|
240
240
|
overflows: P
|
|
241
241
|
},
|
|
242
242
|
reset: {
|
|
243
|
-
placement:
|
|
243
|
+
placement: W
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
let
|
|
247
|
-
if (!
|
|
248
|
-
switch (
|
|
246
|
+
let M = (k = P.filter((S) => S.overflows[0] <= 0).sort((S, R) => S.overflows[1] - R.overflows[1])[0]) == null ? void 0 : k.placement;
|
|
247
|
+
if (!M)
|
|
248
|
+
switch (s) {
|
|
249
249
|
case "bestFit": {
|
|
250
250
|
var F;
|
|
251
251
|
const S = (F = P.filter((R) => {
|
|
252
252
|
if (b) {
|
|
253
253
|
const V = T(R.placement);
|
|
254
|
-
return V ===
|
|
254
|
+
return V === A || // Create a bias to the `y` side axis due to horizontal
|
|
255
255
|
// reading directions favoring greater width.
|
|
256
256
|
V === "y";
|
|
257
257
|
}
|
|
258
258
|
return !0;
|
|
259
|
-
}).map((R) => [R.placement, R.overflows.filter((V) => V > 0).reduce((V,
|
|
260
|
-
S && (
|
|
259
|
+
}).map((R) => [R.placement, R.overflows.filter((V) => V > 0).reduce((V, Q) => V + Q, 0)]).sort((R, V) => R[1] - V[1])[0]) == null ? void 0 : F[0];
|
|
260
|
+
S && (M = S);
|
|
261
261
|
break;
|
|
262
262
|
}
|
|
263
263
|
case "initialPlacement":
|
|
264
|
-
|
|
264
|
+
M = l;
|
|
265
265
|
break;
|
|
266
266
|
}
|
|
267
|
-
if (m !==
|
|
267
|
+
if (m !== M)
|
|
268
268
|
return {
|
|
269
269
|
reset: {
|
|
270
|
-
placement:
|
|
270
|
+
placement: M
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
}
|
|
@@ -275,7 +275,7 @@ const le = async (t, e, d) => {
|
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
|
-
function
|
|
278
|
+
function I(t, e) {
|
|
279
279
|
return {
|
|
280
280
|
top: t.top - e.height,
|
|
281
281
|
right: t.right - e.width,
|
|
@@ -283,10 +283,10 @@ function _(t, e) {
|
|
|
283
283
|
left: t.left - e.width
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function N(t) {
|
|
287
287
|
return ie.some((e) => t[e] >= 0);
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const me = function(t) {
|
|
290
290
|
return t === void 0 && (t = {}), {
|
|
291
291
|
name: "hide",
|
|
292
292
|
options: t,
|
|
@@ -300,26 +300,26 @@ const fe = function(t) {
|
|
|
300
300
|
} = L(t, e);
|
|
301
301
|
switch (m) {
|
|
302
302
|
case "referenceHidden": {
|
|
303
|
-
const
|
|
303
|
+
const i = await a.detectOverflow(e, {
|
|
304
304
|
...n,
|
|
305
305
|
elementContext: "reference"
|
|
306
|
-
}), l =
|
|
306
|
+
}), l = I(i, d.reference);
|
|
307
307
|
return {
|
|
308
308
|
data: {
|
|
309
309
|
referenceHiddenOffsets: l,
|
|
310
|
-
referenceHidden:
|
|
310
|
+
referenceHidden: N(l)
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
case "escaped": {
|
|
315
|
-
const
|
|
315
|
+
const i = await a.detectOverflow(e, {
|
|
316
316
|
...n,
|
|
317
317
|
altBoundary: !0
|
|
318
|
-
}), l =
|
|
318
|
+
}), l = I(i, d.floating);
|
|
319
319
|
return {
|
|
320
320
|
data: {
|
|
321
321
|
escapedOffsets: l,
|
|
322
|
-
escaped:
|
|
322
|
+
escaped: N(l)
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
325
|
}
|
|
@@ -328,16 +328,16 @@ const fe = function(t) {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
|
-
},
|
|
332
|
-
async function
|
|
331
|
+
}, K = /* @__PURE__ */ new Set(["left", "top"]);
|
|
332
|
+
async function ce(t, e) {
|
|
333
333
|
const {
|
|
334
334
|
placement: d,
|
|
335
335
|
platform: a,
|
|
336
336
|
elements: m
|
|
337
|
-
} = t, n = await (a.isRTL == null ? void 0 : a.isRTL(m.floating)),
|
|
337
|
+
} = t, n = await (a.isRTL == null ? void 0 : a.isRTL(m.floating)), i = j(d), l = _(d), g = T(d) === "y", p = K.has(i) ? -1 : 1, r = n && g ? -1 : 1, o = L(e, t);
|
|
338
338
|
let {
|
|
339
339
|
mainAxis: f,
|
|
340
|
-
crossAxis:
|
|
340
|
+
crossAxis: s,
|
|
341
341
|
alignmentAxis: c
|
|
342
342
|
} = typeof o == "number" ? {
|
|
343
343
|
mainAxis: o,
|
|
@@ -348,15 +348,15 @@ async function oe(t, e) {
|
|
|
348
348
|
crossAxis: o.crossAxis || 0,
|
|
349
349
|
alignmentAxis: o.alignmentAxis
|
|
350
350
|
};
|
|
351
|
-
return l && typeof c == "number" && (
|
|
352
|
-
x:
|
|
351
|
+
return l && typeof c == "number" && (s = l === "end" ? c * -1 : c), g ? {
|
|
352
|
+
x: s * r,
|
|
353
353
|
y: f * p
|
|
354
354
|
} : {
|
|
355
355
|
x: f * p,
|
|
356
|
-
y:
|
|
356
|
+
y: s * r
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
const
|
|
359
|
+
const de = function(t) {
|
|
360
360
|
return t === void 0 && (t = 0), {
|
|
361
361
|
name: "offset",
|
|
362
362
|
options: t,
|
|
@@ -365,20 +365,20 @@ const me = function(t) {
|
|
|
365
365
|
const {
|
|
366
366
|
x: m,
|
|
367
367
|
y: n,
|
|
368
|
-
placement:
|
|
368
|
+
placement: i,
|
|
369
369
|
middlewareData: l
|
|
370
|
-
} = e, g = await
|
|
371
|
-
return
|
|
370
|
+
} = e, g = await ce(e, t);
|
|
371
|
+
return i === ((d = l.offset) == null ? void 0 : d.placement) && (a = l.arrow) != null && a.alignmentOffset ? {} : {
|
|
372
372
|
x: m + g.x,
|
|
373
373
|
y: n + g.y,
|
|
374
374
|
data: {
|
|
375
375
|
...g,
|
|
376
|
-
placement:
|
|
376
|
+
placement: i
|
|
377
377
|
}
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
|
-
},
|
|
381
|
+
}, xe = function(t) {
|
|
382
382
|
return t === void 0 && (t = {}), {
|
|
383
383
|
name: "shift",
|
|
384
384
|
options: t,
|
|
@@ -389,17 +389,17 @@ const me = function(t) {
|
|
|
389
389
|
placement: m,
|
|
390
390
|
platform: n
|
|
391
391
|
} = e, {
|
|
392
|
-
mainAxis:
|
|
392
|
+
mainAxis: i = !0,
|
|
393
393
|
crossAxis: l = !1,
|
|
394
394
|
limiter: g = {
|
|
395
395
|
fn: (v) => {
|
|
396
396
|
let {
|
|
397
|
-
x:
|
|
398
|
-
y:
|
|
397
|
+
x: A,
|
|
398
|
+
y: u
|
|
399
399
|
} = v;
|
|
400
400
|
return {
|
|
401
|
-
x:
|
|
402
|
-
y:
|
|
401
|
+
x: A,
|
|
402
|
+
y: u
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
405
|
},
|
|
@@ -407,35 +407,35 @@ const me = function(t) {
|
|
|
407
407
|
} = L(t, e), r = {
|
|
408
408
|
x: d,
|
|
409
409
|
y: a
|
|
410
|
-
}, o = await n.detectOverflow(e, p), f = T(j(m)),
|
|
411
|
-
let c = r[
|
|
412
|
-
if (
|
|
413
|
-
const v =
|
|
414
|
-
c = $(
|
|
410
|
+
}, o = await n.detectOverflow(e, p), f = T(j(m)), s = J(f);
|
|
411
|
+
let c = r[s], x = r[f];
|
|
412
|
+
if (i) {
|
|
413
|
+
const v = s === "y" ? "top" : "left", A = s === "y" ? "bottom" : "right", u = c + o[v], w = c - o[A];
|
|
414
|
+
c = $(u, c, w);
|
|
415
415
|
}
|
|
416
416
|
if (l) {
|
|
417
|
-
const v = f === "y" ? "top" : "left",
|
|
418
|
-
|
|
417
|
+
const v = f === "y" ? "top" : "left", A = f === "y" ? "bottom" : "right", u = x + o[v], w = x - o[A];
|
|
418
|
+
x = $(u, x, w);
|
|
419
419
|
}
|
|
420
|
-
const
|
|
420
|
+
const h = g.fn({
|
|
421
421
|
...e,
|
|
422
|
-
[
|
|
423
|
-
[f]:
|
|
422
|
+
[s]: c,
|
|
423
|
+
[f]: x
|
|
424
424
|
});
|
|
425
425
|
return {
|
|
426
|
-
...
|
|
426
|
+
...h,
|
|
427
427
|
data: {
|
|
428
|
-
x:
|
|
429
|
-
y:
|
|
428
|
+
x: h.x - d,
|
|
429
|
+
y: h.y - a,
|
|
430
430
|
enabled: {
|
|
431
|
-
[
|
|
431
|
+
[s]: i,
|
|
432
432
|
[f]: l
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
};
|
|
438
|
-
},
|
|
438
|
+
}, ge = function(t) {
|
|
439
439
|
return t === void 0 && (t = {}), {
|
|
440
440
|
options: t,
|
|
441
441
|
fn(e) {
|
|
@@ -444,7 +444,7 @@ const me = function(t) {
|
|
|
444
444
|
y: a,
|
|
445
445
|
placement: m,
|
|
446
446
|
rects: n,
|
|
447
|
-
middlewareData:
|
|
447
|
+
middlewareData: i
|
|
448
448
|
} = e, {
|
|
449
449
|
offset: l = 0,
|
|
450
450
|
mainAxis: g = !0,
|
|
@@ -452,32 +452,32 @@ const me = function(t) {
|
|
|
452
452
|
} = L(t, e), r = {
|
|
453
453
|
x: d,
|
|
454
454
|
y: a
|
|
455
|
-
}, o = T(m), f =
|
|
456
|
-
let
|
|
457
|
-
const
|
|
458
|
-
mainAxis:
|
|
455
|
+
}, o = T(m), f = J(o);
|
|
456
|
+
let s = r[f], c = r[o];
|
|
457
|
+
const x = L(l, e), h = typeof x == "number" ? {
|
|
458
|
+
mainAxis: x,
|
|
459
459
|
crossAxis: 0
|
|
460
460
|
} : {
|
|
461
461
|
mainAxis: 0,
|
|
462
462
|
crossAxis: 0,
|
|
463
|
-
...
|
|
463
|
+
...x
|
|
464
464
|
};
|
|
465
465
|
if (g) {
|
|
466
|
-
const
|
|
467
|
-
|
|
466
|
+
const u = f === "y" ? "height" : "width", w = n.reference[f] - n.floating[u] + h.mainAxis, y = n.reference[f] + n.reference[u] - h.mainAxis;
|
|
467
|
+
s < w ? s = w : s > y && (s = y);
|
|
468
468
|
}
|
|
469
469
|
if (p) {
|
|
470
|
-
var v,
|
|
471
|
-
const
|
|
472
|
-
c <
|
|
470
|
+
var v, A;
|
|
471
|
+
const u = f === "y" ? "width" : "height", w = K.has(j(m)), y = n.reference[o] - n.floating[u] + (w && ((v = i.offset) == null ? void 0 : v[o]) || 0) + (w ? 0 : h.crossAxis), b = n.reference[o] + n.reference[u] + (w ? 0 : ((A = i.offset) == null ? void 0 : A[o]) || 0) - (w ? h.crossAxis : 0);
|
|
472
|
+
c < y ? c = y : c > b && (c = b);
|
|
473
473
|
}
|
|
474
474
|
return {
|
|
475
|
-
[f]:
|
|
475
|
+
[f]: s,
|
|
476
476
|
[o]: c
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
479
|
};
|
|
480
|
-
},
|
|
480
|
+
}, ue = function(t) {
|
|
481
481
|
return t === void 0 && (t = {}), {
|
|
482
482
|
name: "size",
|
|
483
483
|
options: t,
|
|
@@ -486,31 +486,31 @@ const me = function(t) {
|
|
|
486
486
|
const {
|
|
487
487
|
placement: m,
|
|
488
488
|
rects: n,
|
|
489
|
-
platform:
|
|
489
|
+
platform: i,
|
|
490
490
|
elements: l
|
|
491
491
|
} = e, {
|
|
492
492
|
apply: g = () => {
|
|
493
493
|
},
|
|
494
494
|
...p
|
|
495
|
-
} = L(t, e), r = await
|
|
495
|
+
} = L(t, e), r = await i.detectOverflow(e, p), o = j(m), f = _(m), s = T(m) === "y", {
|
|
496
496
|
width: c,
|
|
497
|
-
height:
|
|
497
|
+
height: x
|
|
498
498
|
} = n.floating;
|
|
499
|
-
let
|
|
500
|
-
o === "top" || o === "bottom" ? (
|
|
501
|
-
const
|
|
502
|
-
let C =
|
|
503
|
-
if ((d = e.middlewareData.shift) != null && d.enabled.x && (
|
|
504
|
-
const P =
|
|
505
|
-
|
|
499
|
+
let h, v;
|
|
500
|
+
o === "top" || o === "bottom" ? (h = o, v = f === (await (i.isRTL == null ? void 0 : i.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (v = o, h = f === "end" ? "top" : "bottom");
|
|
501
|
+
const A = x - r.top - r.bottom, u = c - r.left - r.right, w = Y(x - r[h], A), y = Y(c - r[v], u), b = !e.middlewareData.shift;
|
|
502
|
+
let C = w, E = y;
|
|
503
|
+
if ((d = e.middlewareData.shift) != null && d.enabled.x && (E = u), (a = e.middlewareData.shift) != null && a.enabled.y && (C = A), b && !f) {
|
|
504
|
+
const P = B(r.left, 0), H = B(r.right, 0), k = B(r.top, 0), F = B(r.bottom, 0);
|
|
505
|
+
s ? E = c - 2 * (P !== 0 || H !== 0 ? P + H : B(r.left, r.right)) : C = x - 2 * (k !== 0 || F !== 0 ? k + F : B(r.top, r.bottom));
|
|
506
506
|
}
|
|
507
507
|
await g({
|
|
508
508
|
...e,
|
|
509
|
-
availableWidth:
|
|
509
|
+
availableWidth: E,
|
|
510
510
|
availableHeight: C
|
|
511
511
|
});
|
|
512
|
-
const
|
|
513
|
-
return c !==
|
|
512
|
+
const D = await i.getDimensions(l.floating);
|
|
513
|
+
return c !== D.width || x !== D.height ? {
|
|
514
514
|
reset: {
|
|
515
515
|
rects: !0
|
|
516
516
|
}
|
|
@@ -519,14 +519,14 @@ const me = function(t) {
|
|
|
519
519
|
};
|
|
520
520
|
};
|
|
521
521
|
export {
|
|
522
|
-
|
|
522
|
+
re as arrow,
|
|
523
523
|
le as computePosition,
|
|
524
524
|
se as detectOverflow,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
525
|
+
fe as flip,
|
|
526
|
+
me as hide,
|
|
527
|
+
ge as limitShift,
|
|
528
|
+
de as offset,
|
|
529
|
+
z as rectToClientRect,
|
|
530
|
+
xe as shift,
|
|
531
|
+
ue as size
|
|
532
532
|
};
|