@mt-gloss/ui 0.0.16 → 0.0.18
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/{Expandable-Bvd-OyRQ.js → Expandable-B7Umnd4T.js} +2247 -2232
- package/catalog.js +2 -2
- package/index.js +343 -315
- package/lib/primitives/dashboard/MetricCard/EdgeHoverHandle.d.ts +9 -0
- package/lib/primitives/dashboard/MetricCard/StackedGroupCard.d.ts +10 -1
- package/lib/primitives/dashboard/MetricCard/useEdgeHoverResize.d.ts +9 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { N as Xt, T as Jt, O as ea, Q as ta, b2 as aa, av as ra, ad as na, Z as oa, aj as sa, K as ia, a4 as la, bl as da, P as ca, B as ua, a as ma, y as ga, H as pa, be as ba, F as
|
|
1
|
+
import { N as Xt, T as Jt, O as ea, Q as ta, b2 as aa, av as ra, ad as na, Z as oa, aj as sa, K as ia, a4 as la, bl as da, P as ca, B as ua, a as ma, y as ga, H as pa, be as ba, F as ha, J as fa, A as va, z as Ca, bd as ya, E as Da, D as wa, bt as Na, b as Sa, C as Ta, L as xa, o as ka, a9 as Ia, aJ as _a, y as Pa, H as Ma, F as Ra, J as Fa, A as Oa, z as Aa, E as Ea, D as La, aX as Ba, a_ as Ga, aZ as $a, aY as Ha, a$ as za, ay as Ka, am as Wa, k as Za, m as Ya, aB as qa, a7 as Va, b4 as Ua, a5 as ja, bm as Qa, Y as Xa, bD as Ja, bC as er, bE as tr, al as ar, aM as rr, b6 as nr, bI as or, n as sr, ai as ir, bx as lr, bp as dr, a0 as cr, an as ur, a2 as mr, bw as gr, G as pr, d as br, bg as hr, a6 as fr, bF as vr, aP as Cr, r as yr, v as Dr, I as wr, g as Nr, as as Sr, bJ as Tr, M as xr, w as kr, U as Ir, X as _r, V as Pr, W as Mr, ao as Rr, bc as Fr, bL as Or, bH as Ar, ak as Er, t as Lr, bn as Br, aO as Gr, af as $r, aG as Hr, ac as zr, ah as Kr, aq as Wr, aN as Zr, a8 as Yr, ap as qr, c as Vr, R as Ur, j as jr, p as Qr, aD as Xr, bu as Jr, bv as en, ae as tn, aa as an, h as rn, x as nn, b3 as on, ab as sn, bK as ln, b8 as dn, bb as cn, b9 as un, ba as mn, i as gn, b5 as pn, bk as bn, S as hn, bh as fn, bi as vn, ar as Cn, b7 as yn, bM as Dn, ag as wn, s as Nn, bG as Sn, l as Tn, f as xn, q as kn, _ as In, $ as _n, a3 as Pn, bf as Mn, bs as Rn, bz as Fn, aw as On, ax as An, aK as En, aL as Ln, az as Bn, aA as Gn, aC as $n, aR as Hn, aS as zn, bB as Kn, bA as Wn, aU as Zn, aV as Yn, at as qn, au as Vn, b1 as Un, b0 as jn, aW as Qn, aH as Xn, aI as Jn, aT as eo, aE as to, aF as ao, u as ro, by as no, bo as oo, bq as so, br as io, aQ as lo, a1 as co, e as uo, bj as mo } from "./Expandable-B7Umnd4T.js";
|
|
2
2
|
import { jsxs as R, jsx as c } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { B as
|
|
3
|
+
import _, { useRef as O, useEffect as E, useState as M, useCallback as C, forwardRef as ge, useMemo as pe, createContext as be, useContext as he } from "react";
|
|
4
|
+
import { B as fe, U as j } from "./UIContext-C3E-k7HI.js";
|
|
5
5
|
import { a as po, u as bo } from "./UIContext-C3E-k7HI.js";
|
|
6
6
|
import { createPortal as ve } from "react-dom";
|
|
7
|
-
import { DEFAULT_MARKET_PRESETS as
|
|
7
|
+
import { DEFAULT_MARKET_PRESETS as fo, DEFAULT_PINNED as vo, PERIOD_OPTIONS as Co, ROLLING_OPTIONS as yo, TODAY_PRESET as Do, findPreset as wo, formatDateRange as No, formatMarketDates as So, formatTrend as To, formatValue as xo, generateMarketId as ko, getAllPresets as Io, getDateRangeForPreset as _o, getPresetLabel as Po, isInRange as Mo, isMarketActive as Ro, isSameDay as Fo, normalizePresetId as Oo, toUppercasePresetId as Ao } from "@mt-gloss/utils";
|
|
8
8
|
function st(e = {}) {
|
|
9
|
-
const { enabled: t = !0, returnTo: r } = e, a =
|
|
10
|
-
return
|
|
9
|
+
const { enabled: t = !0, returnTo: r } = e, a = O(null);
|
|
10
|
+
return E(() => {
|
|
11
11
|
t && (a.current = r || document.activeElement);
|
|
12
|
-
}, [t, r]),
|
|
12
|
+
}, [t, r]), E(() => () => {
|
|
13
13
|
t && a.current && setTimeout(() => {
|
|
14
14
|
a.current?.focus?.();
|
|
15
15
|
}, 0);
|
|
@@ -24,65 +24,65 @@ function it(e) {
|
|
|
24
24
|
orientation: o = "vertical",
|
|
25
25
|
enabled: s = !0,
|
|
26
26
|
isItemDisabled: d,
|
|
27
|
-
onSelect:
|
|
27
|
+
onSelect: u,
|
|
28
28
|
onEscape: g
|
|
29
|
-
} = e, [
|
|
30
|
-
(
|
|
31
|
-
r === void 0 &&
|
|
29
|
+
} = e, [b, S] = M(-1), p = r !== void 0 ? r : b, i = C(
|
|
30
|
+
(m) => {
|
|
31
|
+
r === void 0 && S(m), a?.(m);
|
|
32
32
|
},
|
|
33
33
|
[r, a]
|
|
34
|
-
),
|
|
35
|
-
(
|
|
36
|
-
const v =
|
|
34
|
+
), h = C(() => t.map((m, D) => ({ item: m, index: D })).filter(({ item: m, index: D }) => !d?.(m, D)).map(({ index: m }) => m), [t, d]), T = C(
|
|
35
|
+
(m, D) => {
|
|
36
|
+
const v = h();
|
|
37
37
|
if (v.length === 0) return -1;
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
41
|
-
let k =
|
|
38
|
+
const I = v.indexOf(m);
|
|
39
|
+
if (I === -1)
|
|
40
|
+
return D === 1 ? v.find((L) => L > m) ?? (n ? v[0] : -1) : [...v].reverse().find((G) => G < m) ?? (n ? v[v.length - 1] : -1);
|
|
41
|
+
let k = I + D;
|
|
42
42
|
return n ? k = (k + v.length) % v.length : k = Math.max(0, Math.min(v.length - 1, k)), v[k];
|
|
43
43
|
},
|
|
44
|
-
[
|
|
45
|
-
),
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
}, [p,
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}, [p,
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
(
|
|
44
|
+
[h, n]
|
|
45
|
+
), x = C(() => {
|
|
46
|
+
const m = h();
|
|
47
|
+
m.length > 0 && i(m[0]);
|
|
48
|
+
}, [h, i]), f = C(() => {
|
|
49
|
+
const m = h();
|
|
50
|
+
m.length > 0 && i(m[m.length - 1]);
|
|
51
|
+
}, [h, i]), w = C(() => {
|
|
52
|
+
const m = T(p, 1);
|
|
53
|
+
m !== -1 && i(m);
|
|
54
|
+
}, [p, T, i]), N = C(() => {
|
|
55
|
+
const m = T(p, -1);
|
|
56
|
+
m !== -1 && i(m);
|
|
57
|
+
}, [p, T, i]), l = C(() => {
|
|
58
|
+
i(-1);
|
|
59
|
+
}, [i]), y = C(
|
|
60
|
+
(m) => {
|
|
61
61
|
if (!s) return;
|
|
62
|
-
const { key:
|
|
62
|
+
const { key: D } = m, v = D === "ArrowUp" && (o === "vertical" || o === "both"), I = D === "ArrowDown" && (o === "vertical" || o === "both"), k = D === "ArrowLeft" && (o === "horizontal" || o === "both"), L = D === "ArrowRight" && (o === "horizontal" || o === "both");
|
|
63
63
|
if (v || k) {
|
|
64
|
-
|
|
64
|
+
m.preventDefault(), p === -1 ? f() : N();
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
68
|
-
|
|
67
|
+
if (I || L) {
|
|
68
|
+
m.preventDefault(), p === -1 ? x() : w();
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
72
|
-
|
|
71
|
+
if (D === "Home") {
|
|
72
|
+
m.preventDefault(), x();
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
if (
|
|
76
|
-
|
|
75
|
+
if (D === "End") {
|
|
76
|
+
m.preventDefault(), f();
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
if ((
|
|
80
|
-
|
|
79
|
+
if ((D === "Enter" || D === " ") && p >= 0 && p < t.length) {
|
|
80
|
+
m.preventDefault();
|
|
81
81
|
const G = t[p];
|
|
82
|
-
d?.(G, p) ||
|
|
82
|
+
d?.(G, p) || u?.(G, p);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
85
|
+
if (D === "Escape") {
|
|
86
86
|
g?.();
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
@@ -92,24 +92,24 @@ function it(e) {
|
|
|
92
92
|
o,
|
|
93
93
|
p,
|
|
94
94
|
t,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
x,
|
|
96
|
+
f,
|
|
97
|
+
w,
|
|
98
98
|
N,
|
|
99
99
|
d,
|
|
100
|
-
|
|
100
|
+
u,
|
|
101
101
|
g
|
|
102
102
|
]
|
|
103
103
|
);
|
|
104
104
|
return {
|
|
105
105
|
focusedIndex: p,
|
|
106
|
-
setFocusedIndex:
|
|
107
|
-
handleKeyDown:
|
|
108
|
-
focusFirst:
|
|
109
|
-
focusLast:
|
|
110
|
-
focusNext:
|
|
106
|
+
setFocusedIndex: i,
|
|
107
|
+
handleKeyDown: y,
|
|
108
|
+
focusFirst: x,
|
|
109
|
+
focusLast: f,
|
|
110
|
+
focusNext: w,
|
|
111
111
|
focusPrevious: N,
|
|
112
|
-
resetFocus:
|
|
112
|
+
resetFocus: l
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
const K = (e) => {
|
|
@@ -180,10 +180,10 @@ const K = (e) => {
|
|
|
180
180
|
], bt = [
|
|
181
181
|
{ bars: 10, maxHeight: 120 },
|
|
182
182
|
{ bars: 5, maxHeight: 80 }
|
|
183
|
-
],
|
|
183
|
+
], ht = [
|
|
184
184
|
{ rows: 5, columns: 3, hasCheckbox: !1, rowHeight: 44 },
|
|
185
185
|
{ rows: 8, columns: 5, hasCheckbox: !0, rowHeight: 44 }
|
|
186
|
-
],
|
|
186
|
+
], ft = [
|
|
187
187
|
{ variant: "value", colSpan: 1 },
|
|
188
188
|
{ variant: "trend", colSpan: 2 },
|
|
189
189
|
{ variant: "target", colSpan: 1 }
|
|
@@ -231,44 +231,44 @@ function Te({
|
|
|
231
231
|
overflowActions: o,
|
|
232
232
|
onClose: s
|
|
233
233
|
}) {
|
|
234
|
-
const [d,
|
|
234
|
+
const [d, u] = M(null), g = O(null), b = C(() => {
|
|
235
235
|
if (!t) return { ...J, top: 0, left: 0 };
|
|
236
|
-
const
|
|
236
|
+
const i = t.getBoundingClientRect();
|
|
237
237
|
return {
|
|
238
238
|
...J,
|
|
239
|
-
top:
|
|
240
|
-
left:
|
|
239
|
+
top: i.bottom + 4,
|
|
240
|
+
left: i.left
|
|
241
241
|
};
|
|
242
242
|
}, [t]);
|
|
243
|
-
if (
|
|
243
|
+
if (E(() => {
|
|
244
244
|
if (!e) return;
|
|
245
|
-
const
|
|
246
|
-
|
|
245
|
+
const i = (h) => {
|
|
246
|
+
h.key === "Escape" && s();
|
|
247
247
|
};
|
|
248
|
-
return document.addEventListener("keydown",
|
|
249
|
-
}, [e, s]),
|
|
248
|
+
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
249
|
+
}, [e, s]), E(() => {
|
|
250
250
|
if (!e) return;
|
|
251
|
-
const
|
|
252
|
-
g.current && !g.current.contains(
|
|
251
|
+
const i = (h) => {
|
|
252
|
+
g.current && !g.current.contains(h.target) && s();
|
|
253
253
|
};
|
|
254
|
-
return document.addEventListener("pointerdown",
|
|
254
|
+
return document.addEventListener("pointerdown", i, !0), () => document.removeEventListener("pointerdown", i, !0);
|
|
255
255
|
}, [e, s]), !e) return null;
|
|
256
|
-
const
|
|
256
|
+
const S = o && o.length > 0, p = /* @__PURE__ */ R(
|
|
257
257
|
"div",
|
|
258
258
|
{
|
|
259
259
|
ref: g,
|
|
260
260
|
"data-status-chip-menu": r,
|
|
261
261
|
role: "menu",
|
|
262
262
|
"aria-label": "Status actions",
|
|
263
|
-
style:
|
|
263
|
+
style: b(),
|
|
264
264
|
children: [
|
|
265
265
|
/* @__PURE__ */ c(
|
|
266
266
|
"button",
|
|
267
267
|
{
|
|
268
268
|
role: "menuitem",
|
|
269
269
|
style: Ne(d === "__primary"),
|
|
270
|
-
onMouseEnter: () =>
|
|
271
|
-
onMouseLeave: () =>
|
|
270
|
+
onMouseEnter: () => u("__primary"),
|
|
271
|
+
onMouseLeave: () => u(null),
|
|
272
272
|
onClick: () => {
|
|
273
273
|
a(r), s();
|
|
274
274
|
},
|
|
@@ -280,28 +280,28 @@ function Te({
|
|
|
280
280
|
{
|
|
281
281
|
role: "menuitem",
|
|
282
282
|
style: Y(d === "__graph"),
|
|
283
|
-
onMouseEnter: () =>
|
|
284
|
-
onMouseLeave: () =>
|
|
283
|
+
onMouseEnter: () => u("__graph"),
|
|
284
|
+
onMouseLeave: () => u(null),
|
|
285
285
|
onClick: () => {
|
|
286
286
|
n(r), s();
|
|
287
287
|
},
|
|
288
288
|
children: "Show on graph"
|
|
289
289
|
}
|
|
290
290
|
),
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
S && /* @__PURE__ */ c("div", { style: Se }),
|
|
292
|
+
S && o?.map((i) => /* @__PURE__ */ c(
|
|
293
293
|
"button",
|
|
294
294
|
{
|
|
295
295
|
role: "menuitem",
|
|
296
|
-
style: Y(d ===
|
|
297
|
-
onMouseEnter: () =>
|
|
298
|
-
onMouseLeave: () =>
|
|
296
|
+
style: Y(d === i.id),
|
|
297
|
+
onMouseEnter: () => u(i.id),
|
|
298
|
+
onMouseLeave: () => u(null),
|
|
299
299
|
onClick: () => {
|
|
300
|
-
|
|
300
|
+
i.onSelect(r), s();
|
|
301
301
|
},
|
|
302
|
-
children:
|
|
302
|
+
children: i.label
|
|
303
303
|
},
|
|
304
|
-
|
|
304
|
+
i.id
|
|
305
305
|
))
|
|
306
306
|
]
|
|
307
307
|
}
|
|
@@ -311,7 +311,19 @@ function Te({
|
|
|
311
311
|
Te.displayName = "StatusSlotChipMenu";
|
|
312
312
|
const xe = ge(
|
|
313
313
|
function({ state: t, onPointerDown: r, onPointerUp: a, edge: n = "right", ariaLabel: o = "Resize card" }, s) {
|
|
314
|
-
const d = t === "handle-visible" || t === "dragging"
|
|
314
|
+
const d = t === "handle-visible" || t === "dragging", u = (b) => {
|
|
315
|
+
try {
|
|
316
|
+
b.currentTarget.setPointerCapture(b.pointerId);
|
|
317
|
+
} catch {
|
|
318
|
+
}
|
|
319
|
+
r(b);
|
|
320
|
+
}, g = (b) => {
|
|
321
|
+
try {
|
|
322
|
+
b.currentTarget.hasPointerCapture?.(b.pointerId) && b.currentTarget.releasePointerCapture(b.pointerId);
|
|
323
|
+
} catch {
|
|
324
|
+
}
|
|
325
|
+
a(b);
|
|
326
|
+
};
|
|
315
327
|
return /* @__PURE__ */ c(
|
|
316
328
|
"button",
|
|
317
329
|
{
|
|
@@ -325,8 +337,8 @@ const xe = ge(
|
|
|
325
337
|
`gloss-edge-handle--${n}`,
|
|
326
338
|
d ? "gloss-edge-handle--visible" : ""
|
|
327
339
|
].filter(Boolean).join(" "),
|
|
328
|
-
onPointerDown:
|
|
329
|
-
onPointerUp:
|
|
340
|
+
onPointerDown: u,
|
|
341
|
+
onPointerUp: g,
|
|
330
342
|
tabIndex: d ? 0 : -1
|
|
331
343
|
}
|
|
332
344
|
);
|
|
@@ -363,48 +375,64 @@ function vt({
|
|
|
363
375
|
enterMs: o = 180,
|
|
364
376
|
exitMs: s = 120
|
|
365
377
|
}) {
|
|
366
|
-
const [d,
|
|
367
|
-
|
|
368
|
-
}, []),
|
|
369
|
-
|
|
370
|
-
}, [n]),
|
|
371
|
-
|
|
372
|
-
}, [
|
|
373
|
-
(
|
|
374
|
-
|
|
378
|
+
const [d, u] = M("idle"), [g, b] = M(e), S = O(null), p = O(null), i = 180, h = C(() => {
|
|
379
|
+
S.current && (clearTimeout(S.current), S.current = null);
|
|
380
|
+
}, []), T = C(() => {
|
|
381
|
+
u((l) => l !== "idle" ? l : (S.current = setTimeout(() => u("handle-visible"), n), "dwelling"));
|
|
382
|
+
}, [n]), x = C(() => {
|
|
383
|
+
h(), u((l) => l === "dwelling" || l === "handle-visible" ? "idle" : l);
|
|
384
|
+
}, [h]), f = C(
|
|
385
|
+
(l) => {
|
|
386
|
+
u((y) => y !== "handle-visible" ? y : (p.current = l.clientX, "dragging"));
|
|
375
387
|
},
|
|
376
388
|
[]
|
|
377
|
-
),
|
|
378
|
-
(
|
|
379
|
-
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
389
|
+
), w = C(
|
|
390
|
+
(l) => {
|
|
391
|
+
u((y) => {
|
|
392
|
+
if (y !== "dragging") return y;
|
|
393
|
+
const m = l.clientX - (p.current ?? l.clientX), D = Math.round(m / i), v = Math.min(3, Math.max(1, e + D));
|
|
394
|
+
if (v === e)
|
|
383
395
|
return a?.(), "cancelled";
|
|
384
|
-
const
|
|
385
|
-
return r({ direction:
|
|
396
|
+
const I = v > e ? "grow" : "shrink";
|
|
397
|
+
return r({ direction: I, targetColSpan: v, mode: t ? "slot-fill" : "sparkline-fidelity" }), "committed";
|
|
386
398
|
});
|
|
387
399
|
},
|
|
388
400
|
[e, t, r, a]
|
|
389
|
-
),
|
|
390
|
-
|
|
391
|
-
}, [
|
|
392
|
-
return
|
|
401
|
+
), N = C(() => {
|
|
402
|
+
h(), u((l) => l === "dragging" || l === "handle-visible" ? (a?.(), "cancelled") : l);
|
|
403
|
+
}, [h, a]);
|
|
404
|
+
return E(() => {
|
|
393
405
|
if (d !== "dragging" && d !== "handle-visible") return;
|
|
394
|
-
const
|
|
395
|
-
|
|
406
|
+
const l = (y) => {
|
|
407
|
+
y.key === "Escape" && N();
|
|
408
|
+
};
|
|
409
|
+
return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
|
|
410
|
+
}, [d, N]), E(() => {
|
|
411
|
+
if (d !== "dragging") {
|
|
412
|
+
b(e);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
const l = (y) => {
|
|
416
|
+
const m = y.clientX - (p.current ?? y.clientX), D = Math.round(m / i), v = Math.min(3, Math.max(1, e + D));
|
|
417
|
+
b((I) => I === v ? I : v);
|
|
396
418
|
};
|
|
397
|
-
return window.addEventListener("
|
|
398
|
-
}, [d,
|
|
419
|
+
return window.addEventListener("pointermove", l), () => window.removeEventListener("pointermove", l);
|
|
420
|
+
}, [d, e]), E(() => () => h(), [h]), E(() => {
|
|
399
421
|
if (d !== "committed" && d !== "cancelled") return;
|
|
400
|
-
const
|
|
401
|
-
return () => clearTimeout(
|
|
422
|
+
const l = setTimeout(() => u("idle"), s);
|
|
423
|
+
return () => clearTimeout(l);
|
|
402
424
|
}, [d, s]), {
|
|
403
425
|
state: d,
|
|
404
|
-
enterEdgeZone:
|
|
405
|
-
leaveEdgeZone:
|
|
406
|
-
handleProps: { onPointerDown:
|
|
407
|
-
|
|
426
|
+
enterEdgeZone: T,
|
|
427
|
+
leaveEdgeZone: x,
|
|
428
|
+
handleProps: { onPointerDown: f, onPointerUp: w },
|
|
429
|
+
previewColSpan: g,
|
|
430
|
+
ghostProps: {
|
|
431
|
+
visible: d === "dragging",
|
|
432
|
+
targetColSpan: g,
|
|
433
|
+
enterMs: o,
|
|
434
|
+
exitMs: s
|
|
435
|
+
}
|
|
408
436
|
};
|
|
409
437
|
}
|
|
410
438
|
const Ct = {
|
|
@@ -530,7 +558,7 @@ const Ct = {
|
|
|
530
558
|
value: 125430,
|
|
531
559
|
valueFormat: { prefix: "$", abbreviated: !0 },
|
|
532
560
|
isError: !0
|
|
533
|
-
},
|
|
561
|
+
}, Pe = {
|
|
534
562
|
variant: "standard",
|
|
535
563
|
label: "Total Revenue",
|
|
536
564
|
value: null,
|
|
@@ -545,7 +573,7 @@ const Ct = {
|
|
|
545
573
|
trend: { value: 12.5, direction: "up" },
|
|
546
574
|
subtitle: "MTD",
|
|
547
575
|
isStale: !0
|
|
548
|
-
},
|
|
576
|
+
}, Re = {
|
|
549
577
|
variant: "sparkline",
|
|
550
578
|
label: "Daily Orders",
|
|
551
579
|
value: 847,
|
|
@@ -568,9 +596,9 @@ const Ct = {
|
|
|
568
596
|
}, Dt = [
|
|
569
597
|
Ie,
|
|
570
598
|
_e,
|
|
571
|
-
Re,
|
|
572
|
-
Me,
|
|
573
599
|
Pe,
|
|
600
|
+
Me,
|
|
601
|
+
Re,
|
|
574
602
|
Fe
|
|
575
603
|
], wt = {
|
|
576
604
|
variant: "sparkline",
|
|
@@ -666,23 +694,23 @@ function ne({
|
|
|
666
694
|
onCreatePage: s,
|
|
667
695
|
onManagePages: d
|
|
668
696
|
}) {
|
|
669
|
-
const
|
|
697
|
+
const u = C(
|
|
670
698
|
(p) => {
|
|
671
699
|
o(p), t();
|
|
672
700
|
},
|
|
673
701
|
[o, t]
|
|
674
|
-
), g =
|
|
675
|
-
(p,
|
|
676
|
-
(
|
|
702
|
+
), g = C(
|
|
703
|
+
(p, i) => {
|
|
704
|
+
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), u(p));
|
|
677
705
|
},
|
|
678
|
-
[
|
|
679
|
-
),
|
|
706
|
+
[u]
|
|
707
|
+
), b = C(() => {
|
|
680
708
|
s(), t();
|
|
681
|
-
}, [s, t]),
|
|
709
|
+
}, [s, t]), S = C(() => {
|
|
682
710
|
d(), t();
|
|
683
711
|
}, [d, t]);
|
|
684
712
|
return /* @__PURE__ */ R(
|
|
685
|
-
|
|
713
|
+
fe,
|
|
686
714
|
{
|
|
687
715
|
definition: {
|
|
688
716
|
placement: "bottom-end",
|
|
@@ -696,22 +724,22 @@ function ne({
|
|
|
696
724
|
className: "gloss-page-dropdown",
|
|
697
725
|
children: [
|
|
698
726
|
/* @__PURE__ */ c("ul", { role: "menu", className: "gloss-page-dropdown__list", children: a.map((p) => {
|
|
699
|
-
const
|
|
727
|
+
const i = p.id === n;
|
|
700
728
|
return /* @__PURE__ */ R(
|
|
701
729
|
"li",
|
|
702
730
|
{
|
|
703
731
|
role: "menuitemradio",
|
|
704
|
-
"aria-checked":
|
|
705
|
-
"aria-current":
|
|
732
|
+
"aria-checked": i,
|
|
733
|
+
"aria-current": i ? "page" : void 0,
|
|
706
734
|
tabIndex: 0,
|
|
707
|
-
className: `gloss-page-dropdown__item${
|
|
708
|
-
onClick: () =>
|
|
709
|
-
onKeyDown: (
|
|
735
|
+
className: `gloss-page-dropdown__item${i ? " gloss-page-dropdown__item--active" : ""}`,
|
|
736
|
+
onClick: () => u(p.id),
|
|
737
|
+
onKeyDown: (h) => g(p.id, h),
|
|
710
738
|
children: [
|
|
711
739
|
/* @__PURE__ */ c(
|
|
712
740
|
"span",
|
|
713
741
|
{
|
|
714
|
-
className: `gloss-page-dropdown__dot${
|
|
742
|
+
className: `gloss-page-dropdown__dot${i ? " gloss-page-dropdown__dot--active" : ""}`
|
|
715
743
|
}
|
|
716
744
|
),
|
|
717
745
|
/* @__PURE__ */ c(
|
|
@@ -733,7 +761,7 @@ function ne({
|
|
|
733
761
|
{
|
|
734
762
|
role: "menuitem",
|
|
735
763
|
className: "gloss-page-dropdown__action",
|
|
736
|
-
onClick:
|
|
764
|
+
onClick: b,
|
|
737
765
|
children: "+ New page"
|
|
738
766
|
}
|
|
739
767
|
),
|
|
@@ -743,7 +771,7 @@ function ne({
|
|
|
743
771
|
{
|
|
744
772
|
role: "menuitem",
|
|
745
773
|
className: "gloss-page-dropdown__action gloss-page-dropdown__action--muted",
|
|
746
|
-
onClick:
|
|
774
|
+
onClick: S,
|
|
747
775
|
children: "Manage pages"
|
|
748
776
|
}
|
|
749
777
|
)
|
|
@@ -761,16 +789,16 @@ const Oe = function({
|
|
|
761
789
|
onManagePages: s,
|
|
762
790
|
maskRadius: d = "var(--gloss-radius-md)"
|
|
763
791
|
}) {
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
}, []), p =
|
|
767
|
-
|
|
768
|
-
}, []),
|
|
792
|
+
const u = O(null), [g, b] = M(!1), S = C(() => {
|
|
793
|
+
b((h) => !h);
|
|
794
|
+
}, []), p = C(() => {
|
|
795
|
+
b(!1);
|
|
796
|
+
}, []), i = a[t]?.id ?? "";
|
|
769
797
|
return /* @__PURE__ */ R(
|
|
770
798
|
"div",
|
|
771
799
|
{
|
|
772
800
|
className: "gloss-page-chip",
|
|
773
|
-
ref:
|
|
801
|
+
ref: u,
|
|
774
802
|
style: { position: "absolute", top: 0, right: 0 },
|
|
775
803
|
"data-page-chip": !0,
|
|
776
804
|
children: [
|
|
@@ -788,7 +816,7 @@ const Oe = function({
|
|
|
788
816
|
"aria-haspopup": "menu",
|
|
789
817
|
"aria-expanded": g,
|
|
790
818
|
"aria-label": `Page ${t + 1} of ${r}. Click to switch pages.`,
|
|
791
|
-
onClick:
|
|
819
|
+
onClick: S,
|
|
792
820
|
children: [
|
|
793
821
|
t + 1,
|
|
794
822
|
" / ",
|
|
@@ -801,9 +829,9 @@ const Oe = function({
|
|
|
801
829
|
{
|
|
802
830
|
open: g,
|
|
803
831
|
onDismiss: p,
|
|
804
|
-
anchorRef:
|
|
832
|
+
anchorRef: u,
|
|
805
833
|
pages: a,
|
|
806
|
-
activePageId:
|
|
834
|
+
activePageId: i,
|
|
807
835
|
onPageChange: n,
|
|
808
836
|
onCreatePage: o,
|
|
809
837
|
onManagePages: s
|
|
@@ -1090,7 +1118,7 @@ function oe(e) {
|
|
|
1090
1118
|
function se(e) {
|
|
1091
1119
|
return new Date(e).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
1092
1120
|
}
|
|
1093
|
-
const H =
|
|
1121
|
+
const H = _.createElement("span", { style: { color: "var(--color-text-muted)" } }, "—"), _t = [
|
|
1094
1122
|
{
|
|
1095
1123
|
field: "id",
|
|
1096
1124
|
headerName: "Order",
|
|
@@ -1142,7 +1170,7 @@ const H = I.createElement("span", { style: { color: "var(--color-text-muted)" }
|
|
|
1142
1170
|
cellClassName: "gloss-tabular-nums",
|
|
1143
1171
|
renderCell: ({ row: e }) => e.date ? se(e.date) : ""
|
|
1144
1172
|
}
|
|
1145
|
-
],
|
|
1173
|
+
], Pt = [
|
|
1146
1174
|
{
|
|
1147
1175
|
field: "sku",
|
|
1148
1176
|
headerName: "Item ID",
|
|
@@ -1247,7 +1275,7 @@ const H = I.createElement("span", { style: { color: "var(--color-text-muted)" }
|
|
|
1247
1275
|
byItem: { id: "i-003", name: "Walnut Console Table" },
|
|
1248
1276
|
timeFrame: "YTD"
|
|
1249
1277
|
}
|
|
1250
|
-
},
|
|
1278
|
+
}, Rt = {
|
|
1251
1279
|
...ie,
|
|
1252
1280
|
vizState: {
|
|
1253
1281
|
type: "orders",
|
|
@@ -1458,11 +1486,11 @@ const H = I.createElement("span", { style: { color: "var(--color-text-muted)" }
|
|
|
1458
1486
|
{ id: "ytd", label: "YTD" },
|
|
1459
1487
|
{ id: "lytd", label: "LYTD" }
|
|
1460
1488
|
];
|
|
1461
|
-
function
|
|
1489
|
+
function F(e, t) {
|
|
1462
1490
|
return {
|
|
1463
1491
|
id: e,
|
|
1464
1492
|
colSpan: 1,
|
|
1465
|
-
content:
|
|
1493
|
+
content: _.createElement("div", {
|
|
1466
1494
|
style: {
|
|
1467
1495
|
width: "100%",
|
|
1468
1496
|
height: "100%",
|
|
@@ -1480,21 +1508,21 @@ function P(e, t) {
|
|
|
1480
1508
|
}
|
|
1481
1509
|
function te(e, t) {
|
|
1482
1510
|
return {
|
|
1483
|
-
...
|
|
1511
|
+
...F(e, t),
|
|
1484
1512
|
colSpan: 2
|
|
1485
1513
|
};
|
|
1486
1514
|
}
|
|
1487
1515
|
const zt = [
|
|
1488
|
-
|
|
1489
|
-
|
|
1516
|
+
F("total-revenue", "Total Revenue"),
|
|
1517
|
+
F("total-orders", "Total Orders"),
|
|
1490
1518
|
te("revenue-trend", "Revenue Trend (2x)"),
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1519
|
+
F("avg-order", "Avg Order Value"),
|
|
1520
|
+
F("new-customers", "New Customers"),
|
|
1521
|
+
F("top-salesperson", "Top Salesperson"),
|
|
1494
1522
|
te("order-trend", "Order Trend (2x)"),
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1523
|
+
F("repeat-rate", "Repeat Rate"),
|
|
1524
|
+
F("open-orders", "Open Orders"),
|
|
1525
|
+
F("shipped-orders", "Shipped Orders")
|
|
1498
1526
|
], Kt = {
|
|
1499
1527
|
columns: 6,
|
|
1500
1528
|
rowHeight: 120,
|
|
@@ -1518,7 +1546,7 @@ const zt = [
|
|
|
1518
1546
|
totalPages: 3
|
|
1519
1547
|
};
|
|
1520
1548
|
function Z(e) {
|
|
1521
|
-
return
|
|
1549
|
+
return _.createElement("span", { style: { fontSize: 14 } }, e);
|
|
1522
1550
|
}
|
|
1523
1551
|
const Yt = [
|
|
1524
1552
|
{
|
|
@@ -1701,7 +1729,7 @@ const ze = function(t) {
|
|
|
1701
1729
|
);
|
|
1702
1730
|
};
|
|
1703
1731
|
ze.displayName = "MetricGroupContainer";
|
|
1704
|
-
const
|
|
1732
|
+
const B = {
|
|
1705
1733
|
"gloss-inline-nudge": "_gloss-inline-nudge_kdk88_34",
|
|
1706
1734
|
"gloss-inline-nudge__message": "_gloss-inline-nudge__message_kdk88_65",
|
|
1707
1735
|
"gloss-inline-nudge__actions": "_gloss-inline-nudge__actions_kdk88_72",
|
|
@@ -1716,41 +1744,41 @@ function Ke({
|
|
|
1716
1744
|
anchorEl: a,
|
|
1717
1745
|
anchorSelector: n
|
|
1718
1746
|
}) {
|
|
1719
|
-
const [o, s] =
|
|
1747
|
+
const [o, s] = _.useState(null), d = _.useMemo(
|
|
1720
1748
|
() => typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1,
|
|
1721
1749
|
[]
|
|
1722
1750
|
);
|
|
1723
|
-
|
|
1751
|
+
_.useEffect(() => {
|
|
1724
1752
|
!a && !n && (typeof process > "u" || process.env.NODE_ENV !== "production") && console.error(
|
|
1725
1753
|
"[InlineNudge] requires anchorEl or anchorSelector. AP-07: Do not mount InlineNudge in Layout/** or _app.tsx."
|
|
1726
1754
|
);
|
|
1727
|
-
}, [a, n]),
|
|
1755
|
+
}, [a, n]), _.useLayoutEffect(() => {
|
|
1728
1756
|
let g = null;
|
|
1729
1757
|
if (a ? g = a : n && (g = document.querySelector(n)), g) {
|
|
1730
|
-
const
|
|
1758
|
+
const b = g.getBoundingClientRect();
|
|
1731
1759
|
s({
|
|
1732
|
-
top:
|
|
1733
|
-
left:
|
|
1760
|
+
top: b.bottom + window.scrollY + 6,
|
|
1761
|
+
left: b.left + window.scrollX
|
|
1734
1762
|
});
|
|
1735
1763
|
}
|
|
1736
1764
|
}, [a, n]);
|
|
1737
|
-
const
|
|
1765
|
+
const u = o ? { top: o.top, left: o.left } : {};
|
|
1738
1766
|
return /* @__PURE__ */ R(
|
|
1739
1767
|
"div",
|
|
1740
1768
|
{
|
|
1741
|
-
className:
|
|
1742
|
-
style:
|
|
1769
|
+
className: B["gloss-inline-nudge"],
|
|
1770
|
+
style: u,
|
|
1743
1771
|
role: "status",
|
|
1744
1772
|
"aria-live": "polite",
|
|
1745
1773
|
"data-reduced-motion": d ? "true" : void 0,
|
|
1746
1774
|
children: [
|
|
1747
|
-
/* @__PURE__ */ c("span", { className:
|
|
1748
|
-
/* @__PURE__ */ R("div", { className:
|
|
1775
|
+
/* @__PURE__ */ c("span", { className: B["gloss-inline-nudge__message"], children: e }),
|
|
1776
|
+
/* @__PURE__ */ R("div", { className: B["gloss-inline-nudge__actions"], children: [
|
|
1749
1777
|
/* @__PURE__ */ c(
|
|
1750
1778
|
"button",
|
|
1751
1779
|
{
|
|
1752
1780
|
type: "button",
|
|
1753
|
-
className: `${
|
|
1781
|
+
className: `${B["gloss-inline-nudge__btn"]} ${B["gloss-inline-nudge__btn--action"]}`,
|
|
1754
1782
|
onClick: t.onClick,
|
|
1755
1783
|
children: t.label
|
|
1756
1784
|
}
|
|
@@ -1759,7 +1787,7 @@ function Ke({
|
|
|
1759
1787
|
"button",
|
|
1760
1788
|
{
|
|
1761
1789
|
type: "button",
|
|
1762
|
-
className: `${
|
|
1790
|
+
className: `${B["gloss-inline-nudge__btn"]} ${B["gloss-inline-nudge__btn--dismiss"]}`,
|
|
1763
1791
|
onClick: r,
|
|
1764
1792
|
"aria-label": "Dismiss",
|
|
1765
1793
|
children: "Dismiss"
|
|
@@ -1788,70 +1816,70 @@ function Ze({
|
|
|
1788
1816
|
max: a = 100,
|
|
1789
1817
|
disabled: n = !1
|
|
1790
1818
|
}) {
|
|
1791
|
-
const o =
|
|
1792
|
-
|
|
1793
|
-
const
|
|
1794
|
-
(
|
|
1819
|
+
const o = O(null), [s, d] = M(null), [u, g] = M(e), b = O(e);
|
|
1820
|
+
b.current !== e && (b.current = e, g(e));
|
|
1821
|
+
const S = pe(() => We(u, r, a), [u, r, a]), p = C(
|
|
1822
|
+
(f) => {
|
|
1795
1823
|
if (!o.current) return r;
|
|
1796
|
-
const
|
|
1797
|
-
return Math.round(
|
|
1824
|
+
const w = o.current.getBoundingClientRect(), N = Math.max(0, Math.min(1, (f - w.left) / w.width)), l = r + N * (a - r);
|
|
1825
|
+
return Math.round(l * 100) / 100;
|
|
1798
1826
|
},
|
|
1799
1827
|
[r, a]
|
|
1800
|
-
),
|
|
1801
|
-
(
|
|
1802
|
-
const N =
|
|
1803
|
-
n || N?.disabled || (typeof
|
|
1828
|
+
), i = C(
|
|
1829
|
+
(f, w) => {
|
|
1830
|
+
const N = u.find((l) => l.id === w);
|
|
1831
|
+
n || N?.disabled || (typeof f.currentTarget.setPointerCapture == "function" && f.currentTarget.setPointerCapture(f.pointerId), d(w));
|
|
1804
1832
|
},
|
|
1805
|
-
[n,
|
|
1806
|
-
),
|
|
1807
|
-
(
|
|
1833
|
+
[n, u]
|
|
1834
|
+
), h = C(
|
|
1835
|
+
(f) => {
|
|
1808
1836
|
if (!s) return;
|
|
1809
|
-
const
|
|
1837
|
+
const w = p(f.clientX);
|
|
1810
1838
|
g(
|
|
1811
|
-
(N) => N.map((
|
|
1839
|
+
(N) => N.map((l) => l.id === s ? { ...l, value: w } : l)
|
|
1812
1840
|
);
|
|
1813
1841
|
},
|
|
1814
1842
|
[s, p]
|
|
1815
|
-
),
|
|
1816
|
-
(
|
|
1843
|
+
), T = C(
|
|
1844
|
+
(f) => {
|
|
1817
1845
|
if (!s) return;
|
|
1818
|
-
const
|
|
1819
|
-
(
|
|
1846
|
+
const w = p(f.clientX), N = u.map(
|
|
1847
|
+
(l) => l.id === s ? { ...l, value: w } : l
|
|
1820
1848
|
);
|
|
1821
1849
|
g(N), d(null), t(N);
|
|
1822
1850
|
},
|
|
1823
|
-
[s, p,
|
|
1824
|
-
),
|
|
1851
|
+
[s, p, u, t]
|
|
1852
|
+
), x = a - r || 1;
|
|
1825
1853
|
return /* @__PURE__ */ c("div", { className: "gloss-threshold-ramp", "data-disabled": n || void 0, children: /* @__PURE__ */ c(
|
|
1826
1854
|
"div",
|
|
1827
1855
|
{
|
|
1828
1856
|
ref: o,
|
|
1829
1857
|
className: "gloss-threshold-ramp__track",
|
|
1830
|
-
style: { background:
|
|
1831
|
-
onPointerMove:
|
|
1832
|
-
onPointerUp:
|
|
1833
|
-
onPointerLeave:
|
|
1834
|
-
children:
|
|
1835
|
-
const
|
|
1858
|
+
style: { background: S },
|
|
1859
|
+
onPointerMove: h,
|
|
1860
|
+
onPointerUp: T,
|
|
1861
|
+
onPointerLeave: T,
|
|
1862
|
+
children: u.map((f) => {
|
|
1863
|
+
const w = (f.value - r) / x * 100;
|
|
1836
1864
|
return /* @__PURE__ */ c(
|
|
1837
1865
|
"span",
|
|
1838
1866
|
{
|
|
1839
1867
|
className: "gloss-threshold-ramp__stop",
|
|
1840
1868
|
style: {
|
|
1841
|
-
left: `${
|
|
1842
|
-
color: le(
|
|
1869
|
+
left: `${w}%`,
|
|
1870
|
+
color: le(f)
|
|
1843
1871
|
},
|
|
1844
|
-
"data-disabled":
|
|
1845
|
-
"data-dragging": s ===
|
|
1846
|
-
onPointerDown: (N) =>
|
|
1847
|
-
"aria-label":
|
|
1872
|
+
"data-disabled": f.disabled || void 0,
|
|
1873
|
+
"data-dragging": s === f.id || void 0,
|
|
1874
|
+
onPointerDown: (N) => i(N, f.id),
|
|
1875
|
+
"aria-label": f.label ?? `Stop at ${f.value}`,
|
|
1848
1876
|
role: "slider",
|
|
1849
|
-
"aria-valuenow":
|
|
1877
|
+
"aria-valuenow": f.value,
|
|
1850
1878
|
"aria-valuemin": r,
|
|
1851
1879
|
"aria-valuemax": a,
|
|
1852
|
-
tabIndex:
|
|
1880
|
+
tabIndex: f.disabled ? -1 : 0
|
|
1853
1881
|
},
|
|
1854
|
-
|
|
1882
|
+
f.id
|
|
1855
1883
|
);
|
|
1856
1884
|
})
|
|
1857
1885
|
}
|
|
@@ -1860,10 +1888,10 @@ function Ze({
|
|
|
1860
1888
|
Ze.displayName = "ThresholdRamp";
|
|
1861
1889
|
const de = be(null);
|
|
1862
1890
|
function Ye() {
|
|
1863
|
-
return
|
|
1891
|
+
return he(de);
|
|
1864
1892
|
}
|
|
1865
1893
|
function qe({ option: e }) {
|
|
1866
|
-
const t = Ye(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n =
|
|
1894
|
+
const t = Ye(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n = C(() => {
|
|
1867
1895
|
a || t?.select(e.value);
|
|
1868
1896
|
}, [a, t, e.value]), o = e.colorToken ? `var(--gloss-color-${e.colorToken}, ${e.color ?? "#888"})` : e.color ?? "#888";
|
|
1869
1897
|
return /* @__PURE__ */ c(
|
|
@@ -1891,18 +1919,18 @@ function Ve({
|
|
|
1891
1919
|
disabled: n = !1,
|
|
1892
1920
|
name: o
|
|
1893
1921
|
}) {
|
|
1894
|
-
const s = t !== void 0, [d,
|
|
1895
|
-
(
|
|
1896
|
-
s ||
|
|
1922
|
+
const s = t !== void 0, [d, u] = M(r), g = s ? t : d, b = C(
|
|
1923
|
+
(i) => {
|
|
1924
|
+
s || u(i), a?.(i);
|
|
1897
1925
|
},
|
|
1898
1926
|
[s, a]
|
|
1899
|
-
),
|
|
1900
|
-
(
|
|
1927
|
+
), S = C(
|
|
1928
|
+
(i) => g === i,
|
|
1901
1929
|
[g]
|
|
1902
1930
|
), p = {
|
|
1903
1931
|
selectedValue: g,
|
|
1904
|
-
select:
|
|
1905
|
-
isSelected:
|
|
1932
|
+
select: b,
|
|
1933
|
+
isSelected: S,
|
|
1906
1934
|
groupDisabled: n,
|
|
1907
1935
|
name: o
|
|
1908
1936
|
};
|
|
@@ -1914,7 +1942,7 @@ function Ve({
|
|
|
1914
1942
|
"aria-label": o,
|
|
1915
1943
|
"aria-disabled": n,
|
|
1916
1944
|
"data-disabled": n || void 0,
|
|
1917
|
-
children: e.map((
|
|
1945
|
+
children: e.map((i) => /* @__PURE__ */ c(qe, { option: i }, i.value))
|
|
1918
1946
|
}
|
|
1919
1947
|
) });
|
|
1920
1948
|
}
|
|
@@ -1934,83 +1962,83 @@ function Ue(e, t, r) {
|
|
|
1934
1962
|
return a.splice(r, 0, n), a;
|
|
1935
1963
|
}
|
|
1936
1964
|
function je(e) {
|
|
1937
|
-
const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null), d =
|
|
1938
|
-
|
|
1939
|
-
const g =
|
|
1940
|
-
(
|
|
1941
|
-
const
|
|
1942
|
-
let
|
|
1943
|
-
for (const
|
|
1944
|
-
const N =
|
|
1965
|
+
const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null), d = O(null), u = O(e.onZoneChange);
|
|
1966
|
+
u.current = e.onZoneChange;
|
|
1967
|
+
const g = C(
|
|
1968
|
+
(h) => {
|
|
1969
|
+
const T = h.active.id;
|
|
1970
|
+
let x = null, f = null;
|
|
1971
|
+
for (const w of t) {
|
|
1972
|
+
const N = w.items.find((l) => l.id === T);
|
|
1945
1973
|
if (N) {
|
|
1946
|
-
|
|
1974
|
+
x = N, f = w.zoneKey;
|
|
1947
1975
|
break;
|
|
1948
1976
|
}
|
|
1949
1977
|
}
|
|
1950
|
-
d.current =
|
|
1978
|
+
d.current = f, n(x), s(f);
|
|
1951
1979
|
},
|
|
1952
1980
|
[t]
|
|
1953
|
-
),
|
|
1954
|
-
(
|
|
1955
|
-
if (!
|
|
1981
|
+
), b = C(
|
|
1982
|
+
(h) => {
|
|
1983
|
+
if (!h.over) {
|
|
1956
1984
|
s(d.current);
|
|
1957
1985
|
return;
|
|
1958
1986
|
}
|
|
1959
|
-
const
|
|
1960
|
-
s(
|
|
1987
|
+
const T = ae(t, h.over.id);
|
|
1988
|
+
s(T);
|
|
1961
1989
|
},
|
|
1962
1990
|
[t]
|
|
1963
|
-
),
|
|
1964
|
-
(
|
|
1965
|
-
const { active:
|
|
1991
|
+
), S = C(
|
|
1992
|
+
(h) => {
|
|
1993
|
+
const { active: T, over: x } = h, f = () => {
|
|
1966
1994
|
d.current = null, n(null), s(null);
|
|
1967
1995
|
};
|
|
1968
|
-
if (!
|
|
1969
|
-
|
|
1996
|
+
if (!x) {
|
|
1997
|
+
f();
|
|
1970
1998
|
return;
|
|
1971
1999
|
}
|
|
1972
|
-
const
|
|
1973
|
-
if (!
|
|
1974
|
-
|
|
2000
|
+
const w = U(t, T.id), N = ae(t, x.id);
|
|
2001
|
+
if (!w || !N) {
|
|
2002
|
+
f();
|
|
1975
2003
|
return;
|
|
1976
2004
|
}
|
|
1977
|
-
let
|
|
1978
|
-
if (
|
|
1979
|
-
const
|
|
1980
|
-
|
|
1981
|
-
...
|
|
1982
|
-
items: Ue(
|
|
2005
|
+
let l = t.map((y) => ({ ...y, items: [...y.items] }));
|
|
2006
|
+
if (w === N) {
|
|
2007
|
+
const y = l.findIndex((k) => k.zoneKey === w), m = l[y], D = m.items.findIndex((k) => k.id === T.id), v = m.items.findIndex((k) => k.id === x.id), I = v >= 0 ? v : m.items.length - 1;
|
|
2008
|
+
l[y] = {
|
|
2009
|
+
...m,
|
|
2010
|
+
items: Ue(m.items, D, I)
|
|
1983
2011
|
};
|
|
1984
2012
|
} else {
|
|
1985
|
-
const
|
|
2013
|
+
const y = l.findIndex((P) => P.zoneKey === w), m = l.findIndex((P) => P.zoneKey === N), D = l[y], v = l[m], I = D.items.find((P) => P.id === T.id), k = D.items.filter((P) => P.id !== T.id), L = v.items.findIndex((P) => P.id === x.id), G = L >= 0 ? L : v.items.length;
|
|
1986
2014
|
let Q = k, A = [...v.items];
|
|
1987
2015
|
if (v.maxItems !== void 0 && A.length >= v.maxItems) {
|
|
1988
|
-
const
|
|
1989
|
-
A = A.slice(0, v.maxItems - 1), Q = [...k,
|
|
2016
|
+
const P = A[A.length - 1];
|
|
2017
|
+
A = A.slice(0, v.maxItems - 1), Q = [...k, P];
|
|
1990
2018
|
}
|
|
1991
2019
|
const X = Math.min(G, A.length), me = [
|
|
1992
2020
|
...A.slice(0, X),
|
|
1993
|
-
|
|
2021
|
+
I,
|
|
1994
2022
|
...A.slice(X)
|
|
1995
2023
|
];
|
|
1996
|
-
|
|
2024
|
+
l[y] = { ...D, items: Q }, l[m] = { ...v, items: me };
|
|
1997
2025
|
}
|
|
1998
|
-
r(
|
|
2026
|
+
r(l), u.current?.(l), f();
|
|
1999
2027
|
},
|
|
2000
2028
|
[t]
|
|
2001
|
-
), p =
|
|
2002
|
-
(
|
|
2003
|
-
id:
|
|
2004
|
-
"data-zone-key":
|
|
2029
|
+
), p = C(
|
|
2030
|
+
(h) => ({
|
|
2031
|
+
id: h,
|
|
2032
|
+
"data-zone-key": h
|
|
2005
2033
|
}),
|
|
2006
2034
|
[]
|
|
2007
|
-
),
|
|
2008
|
-
(
|
|
2009
|
-
const
|
|
2035
|
+
), i = C(
|
|
2036
|
+
(h) => {
|
|
2037
|
+
const T = U(t, h.id) ?? "";
|
|
2010
2038
|
return {
|
|
2011
|
-
id:
|
|
2012
|
-
"data-item-id":
|
|
2013
|
-
"data-zone-key":
|
|
2039
|
+
id: h.id,
|
|
2040
|
+
"data-item-id": h.id,
|
|
2041
|
+
"data-zone-key": T
|
|
2014
2042
|
};
|
|
2015
2043
|
},
|
|
2016
2044
|
[t]
|
|
@@ -2020,10 +2048,10 @@ function je(e) {
|
|
|
2020
2048
|
activeZone: o,
|
|
2021
2049
|
activeItem: a,
|
|
2022
2050
|
getZoneProps: p,
|
|
2023
|
-
getItemProps:
|
|
2051
|
+
getItemProps: i,
|
|
2024
2052
|
handleDragStart: g,
|
|
2025
|
-
handleDragOver:
|
|
2026
|
-
handleDragEnd:
|
|
2053
|
+
handleDragOver: b,
|
|
2054
|
+
handleDragEnd: S
|
|
2027
2055
|
};
|
|
2028
2056
|
}
|
|
2029
2057
|
let $ = null, z = null, re = !1;
|
|
@@ -2046,12 +2074,12 @@ function Qe() {
|
|
|
2046
2074
|
})(), z);
|
|
2047
2075
|
}
|
|
2048
2076
|
function Xe(e) {
|
|
2049
|
-
const { zones: t, onZoneChange: r, renderZone: a, renderItem: n, renderDragOverlay: o } = e, s = je({ zones: t, onZoneChange: r }), [d,
|
|
2050
|
-
return
|
|
2077
|
+
const { zones: t, onZoneChange: r, renderZone: a, renderItem: n, renderDragOverlay: o } = e, s = je({ zones: t, onZoneChange: r }), [d, u] = _.useState($);
|
|
2078
|
+
return _.useEffect(() => {
|
|
2051
2079
|
if (d) return;
|
|
2052
2080
|
let g = !0;
|
|
2053
|
-
return Qe().then((
|
|
2054
|
-
g &&
|
|
2081
|
+
return Qe().then((b) => {
|
|
2082
|
+
g && u(b);
|
|
2055
2083
|
}), () => {
|
|
2056
2084
|
g = !1;
|
|
2057
2085
|
};
|
|
@@ -2065,8 +2093,8 @@ function Xe(e) {
|
|
|
2065
2093
|
renderDragOverlay: o
|
|
2066
2094
|
}
|
|
2067
2095
|
) : /* @__PURE__ */ c("div", { "data-sortable-zones-passive": "true", children: s.zones.map((g) => {
|
|
2068
|
-
const
|
|
2069
|
-
return /* @__PURE__ */ c("div", { ...s.getZoneProps(g.zoneKey), children: a(g.zoneKey, g.items,
|
|
2096
|
+
const b = g.items.map((S) => /* @__PURE__ */ c(_.Fragment, { children: n(S) }, S.id));
|
|
2097
|
+
return /* @__PURE__ */ c("div", { ...s.getZoneProps(g.zoneKey), children: a(g.zoneKey, g.items, b) }, g.zoneKey);
|
|
2070
2098
|
}) });
|
|
2071
2099
|
}
|
|
2072
2100
|
Xe.displayName = "SortableZones";
|
|
@@ -2077,21 +2105,21 @@ function ce({
|
|
|
2077
2105
|
renderItem: a,
|
|
2078
2106
|
renderDragOverlay: n
|
|
2079
2107
|
}) {
|
|
2080
|
-
const { core: o, sortable: s, utilities: d } = t, { DndContext:
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
),
|
|
2108
|
+
const { core: o, sortable: s, utilities: d } = t, { DndContext: u, DragOverlay: g, useSensors: b, useSensor: S, PointerSensor: p, KeyboardSensor: i, closestCenter: h } = o, { SortableContext: T, verticalListSortingStrategy: x } = s, f = b(
|
|
2109
|
+
S(p, { activationConstraint: { distance: 5 } }),
|
|
2110
|
+
S(i)
|
|
2111
|
+
), w = u, N = g, l = T;
|
|
2084
2112
|
return /* @__PURE__ */ R(
|
|
2085
|
-
|
|
2113
|
+
w,
|
|
2086
2114
|
{
|
|
2087
|
-
sensors:
|
|
2088
|
-
collisionDetection:
|
|
2115
|
+
sensors: f,
|
|
2116
|
+
collisionDetection: h,
|
|
2089
2117
|
onDragStart: e.handleDragStart,
|
|
2090
2118
|
onDragOver: e.handleDragOver,
|
|
2091
2119
|
onDragEnd: e.handleDragEnd,
|
|
2092
2120
|
children: [
|
|
2093
|
-
e.zones.map((
|
|
2094
|
-
const
|
|
2121
|
+
e.zones.map((y) => {
|
|
2122
|
+
const m = y.items.map((v) => v.id), D = y.items.map((v) => /* @__PURE__ */ c(
|
|
2095
2123
|
ue,
|
|
2096
2124
|
{
|
|
2097
2125
|
id: v.id,
|
|
@@ -2101,7 +2129,7 @@ function ce({
|
|
|
2101
2129
|
},
|
|
2102
2130
|
v.id
|
|
2103
2131
|
));
|
|
2104
|
-
return /* @__PURE__ */ c("div", { ...e.getZoneProps(
|
|
2132
|
+
return /* @__PURE__ */ c("div", { ...e.getZoneProps(y.zoneKey), children: /* @__PURE__ */ c(l, { items: m, strategy: x, children: r(y.zoneKey, y.items, D) }) }, y.zoneKey);
|
|
2105
2133
|
}),
|
|
2106
2134
|
/* @__PURE__ */ c(N, { children: e.activeItem ? n?.(e.activeItem) ?? a(e.activeItem) : null })
|
|
2107
2135
|
]
|
|
@@ -2110,20 +2138,20 @@ function ce({
|
|
|
2110
2138
|
}
|
|
2111
2139
|
ce.displayName = "SortableZonesInner";
|
|
2112
2140
|
function ue({ id: e, useSortable: t, cssHelper: r, children: a }) {
|
|
2113
|
-
const { attributes: n, listeners: o, setNodeRef: s, transform: d, transition:
|
|
2141
|
+
const { attributes: n, listeners: o, setNodeRef: s, transform: d, transition: u, isDragging: g } = t({ id: e }), b = {
|
|
2114
2142
|
transform: r?.Transform?.toString(d) ?? void 0,
|
|
2115
|
-
transition:
|
|
2143
|
+
transition: u,
|
|
2116
2144
|
opacity: g ? 0.5 : 1
|
|
2117
2145
|
};
|
|
2118
|
-
return /* @__PURE__ */ c("div", { ref: s, style:
|
|
2146
|
+
return /* @__PURE__ */ c("div", { ref: s, style: b, "data-sortable-item-id": e, ...n, ...o, children: a });
|
|
2119
2147
|
}
|
|
2120
2148
|
ue.displayName = "SortableItem";
|
|
2121
|
-
const Je =
|
|
2149
|
+
const Je = _.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
|
|
2122
2150
|
const n = { ...r };
|
|
2123
2151
|
return delete n.className, delete n.style, /* @__PURE__ */ c("div", { ref: a, className: "gloss-container-toolbar", role: "toolbar", ...n, children: /* @__PURE__ */ c(j, { region: "toolbar", density: e, children: t }) });
|
|
2124
2152
|
});
|
|
2125
2153
|
Je.displayName = "ContainerToolbar";
|
|
2126
|
-
const et =
|
|
2154
|
+
const et = _.forwardRef(({ legend: e, description: t, density: r = "default", children: a, ...n }, o) => {
|
|
2127
2155
|
const s = { ...n };
|
|
2128
2156
|
return delete s.className, delete s.style, /* @__PURE__ */ R("fieldset", { ref: o, className: "gloss-container-form-section", ...s, children: [
|
|
2129
2157
|
e && /* @__PURE__ */ c("legend", { className: "gloss-container-form-section__legend", children: e }),
|
|
@@ -2132,7 +2160,7 @@ const et = I.forwardRef(({ legend: e, description: t, density: r = "default", ch
|
|
|
2132
2160
|
] });
|
|
2133
2161
|
});
|
|
2134
2162
|
et.displayName = "ContainerFormSection";
|
|
2135
|
-
const tt =
|
|
2163
|
+
const tt = _.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
|
|
2136
2164
|
const n = { ...r };
|
|
2137
2165
|
return delete n.className, delete n.style, /* @__PURE__ */ c("div", { ref: a, className: "gloss-container-table", ...n, children: /* @__PURE__ */ c(j, { region: "table", density: e, children: t }) });
|
|
2138
2166
|
});
|
|
@@ -2156,8 +2184,8 @@ export {
|
|
|
2156
2184
|
ga as Card,
|
|
2157
2185
|
pa as CardActions,
|
|
2158
2186
|
ba as CardBack,
|
|
2159
|
-
|
|
2160
|
-
|
|
2187
|
+
ha as CardBody,
|
|
2188
|
+
fa as CardFooter,
|
|
2161
2189
|
va as CardHeader,
|
|
2162
2190
|
Ca as CardMedia,
|
|
2163
2191
|
ya as CardShell,
|
|
@@ -2170,9 +2198,9 @@ export {
|
|
|
2170
2198
|
ka as ColorPicker,
|
|
2171
2199
|
Ia as ComparisonCard,
|
|
2172
2200
|
_a as ContactForm,
|
|
2173
|
-
|
|
2201
|
+
Pa as ContainerCard,
|
|
2174
2202
|
Ma as ContainerCardActions,
|
|
2175
|
-
|
|
2203
|
+
Ra as ContainerCardBody,
|
|
2176
2204
|
Fa as ContainerCardFooter,
|
|
2177
2205
|
Oa as ContainerCardHeader,
|
|
2178
2206
|
Aa as ContainerCardMedia,
|
|
@@ -2187,7 +2215,7 @@ export {
|
|
|
2187
2215
|
tt as ContainerTable,
|
|
2188
2216
|
Je as ContainerToolbar,
|
|
2189
2217
|
Ka as CreditCardForm,
|
|
2190
|
-
|
|
2218
|
+
fo as DEFAULT_MARKET_PRESETS,
|
|
2191
2219
|
vo as DEFAULT_PINNED,
|
|
2192
2220
|
Wa as DataTable,
|
|
2193
2221
|
Za as DatePicker,
|
|
@@ -2218,8 +2246,8 @@ export {
|
|
|
2218
2246
|
ke as GhostPreview,
|
|
2219
2247
|
pr as GroupCheckbox,
|
|
2220
2248
|
br as GroupRadio,
|
|
2221
|
-
|
|
2222
|
-
|
|
2249
|
+
hr as GutterActions,
|
|
2250
|
+
fr as HighlightCard,
|
|
2223
2251
|
vr as HybridDatePicker,
|
|
2224
2252
|
Cr as ImportWizard,
|
|
2225
2253
|
Ke as InlineNudge,
|
|
@@ -2233,9 +2261,9 @@ export {
|
|
|
2233
2261
|
kr as MaskedInput,
|
|
2234
2262
|
Ir as Menu,
|
|
2235
2263
|
_r as MenuDivider,
|
|
2236
|
-
|
|
2264
|
+
Pr as MenuGroup,
|
|
2237
2265
|
Mr as MenuItem,
|
|
2238
|
-
|
|
2266
|
+
Rr as MergePrompt,
|
|
2239
2267
|
Fr as MetricCard,
|
|
2240
2268
|
Or as MetricCardGrid,
|
|
2241
2269
|
ze as MetricGroupContainer,
|
|
@@ -2279,8 +2307,8 @@ export {
|
|
|
2279
2307
|
pn as Sortable,
|
|
2280
2308
|
Xe as SortableZones,
|
|
2281
2309
|
bn as SparklineBg,
|
|
2282
|
-
|
|
2283
|
-
|
|
2310
|
+
hn as SplitButton,
|
|
2311
|
+
fn as StackedGroupCard,
|
|
2284
2312
|
vn as StatusModeCard,
|
|
2285
2313
|
Te as StatusSlotChipMenu,
|
|
2286
2314
|
Cn as Stepper,
|
|
@@ -2296,11 +2324,11 @@ export {
|
|
|
2296
2324
|
kn as Tooltip,
|
|
2297
2325
|
In as Transition,
|
|
2298
2326
|
_n as TransitionGroup,
|
|
2299
|
-
|
|
2327
|
+
Pn as TrendCard,
|
|
2300
2328
|
Mn as TrendIndicator,
|
|
2301
2329
|
po as UIContext,
|
|
2302
2330
|
j as UIContextProvider,
|
|
2303
|
-
|
|
2331
|
+
Rn as UnifiedBreakdownTable,
|
|
2304
2332
|
Fn as UnifiedContextMenu,
|
|
2305
2333
|
On as addressGroupMetadata,
|
|
2306
2334
|
An as addressSchema,
|
|
@@ -2308,11 +2336,11 @@ export {
|
|
|
2308
2336
|
Dt as allStateFixtures,
|
|
2309
2337
|
yt as allVariantFixtures,
|
|
2310
2338
|
mt as blockSamples,
|
|
2311
|
-
|
|
2339
|
+
ft as cardSamples,
|
|
2312
2340
|
bt as chartSamples,
|
|
2313
2341
|
pt as circleSamples,
|
|
2314
2342
|
Kt as compactLayout,
|
|
2315
|
-
|
|
2343
|
+
Rt as compactState,
|
|
2316
2344
|
En as contactFormMetadata,
|
|
2317
2345
|
Ln as contactSchema,
|
|
2318
2346
|
Ft as contextMenuFixtures,
|
|
@@ -2323,7 +2351,7 @@ export {
|
|
|
2323
2351
|
$n as destructiveModalMetadata,
|
|
2324
2352
|
Hn as durations,
|
|
2325
2353
|
zn as easings,
|
|
2326
|
-
|
|
2354
|
+
Pe as emptyFixture,
|
|
2327
2355
|
Ce as entityChip,
|
|
2328
2356
|
Be as entityNameActions,
|
|
2329
2357
|
ct as entityTabGroup,
|
|
@@ -2340,14 +2368,14 @@ export {
|
|
|
2340
2368
|
Io as getAllPresets,
|
|
2341
2369
|
_o as getDateRangeForPreset,
|
|
2342
2370
|
Wn as getMenuActions,
|
|
2343
|
-
|
|
2371
|
+
Po as getPresetLabel,
|
|
2344
2372
|
Zn as getTransitionStyle,
|
|
2345
2373
|
zt as gridCards,
|
|
2346
2374
|
Yn as interpolate,
|
|
2347
2375
|
Mo as isInRange,
|
|
2348
|
-
|
|
2376
|
+
Ro as isMarketActive,
|
|
2349
2377
|
Fo as isSameDay,
|
|
2350
|
-
|
|
2378
|
+
Pt as itemColumns,
|
|
2351
2379
|
It as itemRows,
|
|
2352
2380
|
Ie as loadingFixture,
|
|
2353
2381
|
qn as loginFormMetadata,
|
|
@@ -2383,13 +2411,13 @@ export {
|
|
|
2383
2411
|
Nt as sparklineUpFixture,
|
|
2384
2412
|
Fe as staleDonutFixture,
|
|
2385
2413
|
Me as staleFixture,
|
|
2386
|
-
|
|
2414
|
+
Re as staleSparklineFixture,
|
|
2387
2415
|
St as standardFixture,
|
|
2388
2416
|
xt as standardFlatFixture,
|
|
2389
2417
|
Wt as standardLayout,
|
|
2390
2418
|
Tt as standardNegativeFixture,
|
|
2391
2419
|
ye as statusChip,
|
|
2392
|
-
|
|
2420
|
+
ht as tableSamples,
|
|
2393
2421
|
gt as textSamples,
|
|
2394
2422
|
ut as timeFrameTabGroup,
|
|
2395
2423
|
Ao as toUppercasePresetId,
|