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