@mt-gloss/ui 0.0.18 → 0.0.19
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/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 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
|
|
2
|
-
import { jsxs as R, jsx as
|
|
3
|
-
import
|
|
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 Pa, y as _a, 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 Pr, V as _r, 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 Pn, a3 as _n, 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
|
+
import { jsxs as R, jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import P, { useRef as F, useEffect as A, useState as M, useCallback as v, forwardRef as ge, useMemo as pe, createContext as be, useContext as he } from "react";
|
|
4
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 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
|
|
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 Po, getPresetLabel as _o, 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 = F(null);
|
|
10
|
+
return A(() => {
|
|
11
11
|
t && (a.current = r || document.activeElement);
|
|
12
|
-
}, [t, r]),
|
|
12
|
+
}, [t, r]), A(() => () => {
|
|
13
13
|
t && a.current && setTimeout(() => {
|
|
14
14
|
a.current?.focus?.();
|
|
15
15
|
}, 0);
|
|
@@ -24,62 +24,62 @@ function it(e) {
|
|
|
24
24
|
orientation: o = "vertical",
|
|
25
25
|
enabled: s = !0,
|
|
26
26
|
isItemDisabled: d,
|
|
27
|
-
onSelect:
|
|
27
|
+
onSelect: m,
|
|
28
28
|
onEscape: g
|
|
29
|
-
} = e, [
|
|
30
|
-
(
|
|
31
|
-
r === void 0 &&
|
|
29
|
+
} = e, [y, w] = M(-1), l = r !== void 0 ? r : y, i = v(
|
|
30
|
+
(c) => {
|
|
31
|
+
r === void 0 && w(c), a?.(c);
|
|
32
32
|
},
|
|
33
33
|
[r, a]
|
|
34
|
-
),
|
|
35
|
-
(
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const I =
|
|
34
|
+
), f = v(() => t.map((c, D) => ({ item: c, index: D })).filter(({ item: c, index: D }) => !d?.(c, D)).map(({ index: c }) => c), [t, d]), N = v(
|
|
35
|
+
(c, D) => {
|
|
36
|
+
const h = f();
|
|
37
|
+
if (h.length === 0) return -1;
|
|
38
|
+
const I = h.indexOf(c);
|
|
39
39
|
if (I === -1)
|
|
40
|
-
return D === 1 ?
|
|
41
|
-
let
|
|
42
|
-
return n ?
|
|
40
|
+
return D === 1 ? h.find((E) => E > c) ?? (n ? h[0] : -1) : [...h].reverse().find((G) => G < c) ?? (n ? h[h.length - 1] : -1);
|
|
41
|
+
let x = I + D;
|
|
42
|
+
return n ? x = (x + h.length) % h.length : x = Math.max(0, Math.min(h.length - 1, x)), h[x];
|
|
43
43
|
},
|
|
44
|
-
[
|
|
45
|
-
),
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}, [
|
|
44
|
+
[f, n]
|
|
45
|
+
), k = v(() => {
|
|
46
|
+
const c = f();
|
|
47
|
+
c.length > 0 && i(c[0]);
|
|
48
|
+
}, [f, i]), b = v(() => {
|
|
49
|
+
const c = f();
|
|
50
|
+
c.length > 0 && i(c[c.length - 1]);
|
|
51
|
+
}, [f, i]), S = v(() => {
|
|
52
|
+
const c = N(l, 1);
|
|
53
|
+
c !== -1 && i(c);
|
|
54
|
+
}, [l, N, i]), T = v(() => {
|
|
55
|
+
const c = N(l, -1);
|
|
56
|
+
c !== -1 && i(c);
|
|
57
|
+
}, [l, N, i]), C = v(() => {
|
|
58
58
|
i(-1);
|
|
59
|
-
}, [i]),
|
|
60
|
-
(
|
|
59
|
+
}, [i]), p = v(
|
|
60
|
+
(c) => {
|
|
61
61
|
if (!s) return;
|
|
62
|
-
const { key: D } =
|
|
63
|
-
if (
|
|
64
|
-
|
|
62
|
+
const { key: D } = c, h = D === "ArrowUp" && (o === "vertical" || o === "both"), I = D === "ArrowDown" && (o === "vertical" || o === "both"), x = D === "ArrowLeft" && (o === "horizontal" || o === "both"), E = D === "ArrowRight" && (o === "horizontal" || o === "both");
|
|
63
|
+
if (h || x) {
|
|
64
|
+
c.preventDefault(), l === -1 ? b() : T();
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
if (I ||
|
|
68
|
-
|
|
67
|
+
if (I || E) {
|
|
68
|
+
c.preventDefault(), l === -1 ? k() : S();
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
if (D === "Home") {
|
|
72
|
-
|
|
72
|
+
c.preventDefault(), k();
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
if (D === "End") {
|
|
76
|
-
|
|
76
|
+
c.preventDefault(), b();
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
if ((D === "Enter" || D === " ") &&
|
|
80
|
-
|
|
81
|
-
const G = t[
|
|
82
|
-
d?.(G,
|
|
79
|
+
if ((D === "Enter" || D === " ") && l >= 0 && l < t.length) {
|
|
80
|
+
c.preventDefault();
|
|
81
|
+
const G = t[l];
|
|
82
|
+
d?.(G, l) || m?.(G, l);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
if (D === "Escape") {
|
|
@@ -90,26 +90,26 @@ function it(e) {
|
|
|
90
90
|
[
|
|
91
91
|
s,
|
|
92
92
|
o,
|
|
93
|
-
|
|
93
|
+
l,
|
|
94
94
|
t,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
k,
|
|
96
|
+
b,
|
|
97
|
+
S,
|
|
98
|
+
T,
|
|
99
99
|
d,
|
|
100
|
-
|
|
100
|
+
m,
|
|
101
101
|
g
|
|
102
102
|
]
|
|
103
103
|
);
|
|
104
104
|
return {
|
|
105
|
-
focusedIndex:
|
|
105
|
+
focusedIndex: l,
|
|
106
106
|
setFocusedIndex: i,
|
|
107
|
-
handleKeyDown:
|
|
108
|
-
focusFirst:
|
|
109
|
-
focusLast:
|
|
110
|
-
focusNext:
|
|
111
|
-
focusPrevious:
|
|
112
|
-
resetFocus:
|
|
107
|
+
handleKeyDown: p,
|
|
108
|
+
focusFirst: k,
|
|
109
|
+
focusLast: b,
|
|
110
|
+
focusNext: S,
|
|
111
|
+
focusPrevious: T,
|
|
112
|
+
resetFocus: C
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
const K = (e) => {
|
|
@@ -231,7 +231,7 @@ function Te({
|
|
|
231
231
|
overflowActions: o,
|
|
232
232
|
onClose: s
|
|
233
233
|
}) {
|
|
234
|
-
const [d,
|
|
234
|
+
const [d, m] = M(null), g = F(null), y = v(() => {
|
|
235
235
|
if (!t) return { ...J, top: 0, left: 0 };
|
|
236
236
|
const i = t.getBoundingClientRect();
|
|
237
237
|
return {
|
|
@@ -240,62 +240,62 @@ function Te({
|
|
|
240
240
|
left: i.left
|
|
241
241
|
};
|
|
242
242
|
}, [t]);
|
|
243
|
-
if (
|
|
243
|
+
if (A(() => {
|
|
244
244
|
if (!e) return;
|
|
245
|
-
const i = (
|
|
246
|
-
|
|
245
|
+
const i = (f) => {
|
|
246
|
+
f.key === "Escape" && s();
|
|
247
247
|
};
|
|
248
248
|
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
249
|
-
}, [e, s]),
|
|
249
|
+
}, [e, s]), A(() => {
|
|
250
250
|
if (!e) return;
|
|
251
|
-
const i = (
|
|
252
|
-
g.current && !g.current.contains(
|
|
251
|
+
const i = (f) => {
|
|
252
|
+
g.current && !g.current.contains(f.target) && s();
|
|
253
253
|
};
|
|
254
254
|
return document.addEventListener("pointerdown", i, !0), () => document.removeEventListener("pointerdown", i, !0);
|
|
255
255
|
}, [e, s]), !e) return null;
|
|
256
|
-
const
|
|
256
|
+
const w = o && o.length > 0, l = /* @__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: y(),
|
|
264
264
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ u(
|
|
266
266
|
"button",
|
|
267
267
|
{
|
|
268
268
|
role: "menuitem",
|
|
269
269
|
style: Ne(d === "__primary"),
|
|
270
|
-
onMouseEnter: () =>
|
|
271
|
-
onMouseLeave: () =>
|
|
270
|
+
onMouseEnter: () => m("__primary"),
|
|
271
|
+
onMouseLeave: () => m(null),
|
|
272
272
|
onClick: () => {
|
|
273
273
|
a(r), s();
|
|
274
274
|
},
|
|
275
275
|
children: "Open in table"
|
|
276
276
|
}
|
|
277
277
|
),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ u(
|
|
279
279
|
"button",
|
|
280
280
|
{
|
|
281
281
|
role: "menuitem",
|
|
282
282
|
style: Y(d === "__graph"),
|
|
283
|
-
onMouseEnter: () =>
|
|
284
|
-
onMouseLeave: () =>
|
|
283
|
+
onMouseEnter: () => m("__graph"),
|
|
284
|
+
onMouseLeave: () => m(null),
|
|
285
285
|
onClick: () => {
|
|
286
286
|
n(r), s();
|
|
287
287
|
},
|
|
288
288
|
children: "Show on graph"
|
|
289
289
|
}
|
|
290
290
|
),
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
w && /* @__PURE__ */ u("div", { style: Se }),
|
|
292
|
+
w && o?.map((i) => /* @__PURE__ */ u(
|
|
293
293
|
"button",
|
|
294
294
|
{
|
|
295
295
|
role: "menuitem",
|
|
296
296
|
style: Y(d === i.id),
|
|
297
|
-
onMouseEnter: () =>
|
|
298
|
-
onMouseLeave: () =>
|
|
297
|
+
onMouseEnter: () => m(i.id),
|
|
298
|
+
onMouseLeave: () => m(null),
|
|
299
299
|
onClick: () => {
|
|
300
300
|
i.onSelect(r), s();
|
|
301
301
|
},
|
|
@@ -306,40 +306,42 @@ function Te({
|
|
|
306
306
|
]
|
|
307
307
|
}
|
|
308
308
|
);
|
|
309
|
-
return ve(
|
|
309
|
+
return ve(l, document.body);
|
|
310
310
|
}
|
|
311
311
|
Te.displayName = "StatusSlotChipMenu";
|
|
312
312
|
const xe = ge(
|
|
313
|
-
function({ state: t, onPointerDown: r, onPointerUp: a,
|
|
314
|
-
const
|
|
313
|
+
function({ state: t, onPointerDown: r, onPointerUp: a, onPointerEnter: n, onPointerLeave: o, edge: s = "right", ariaLabel: d = "Resize card" }, m) {
|
|
314
|
+
const g = t === "handle-visible" || t === "dragging", y = (l) => {
|
|
315
315
|
try {
|
|
316
|
-
|
|
316
|
+
l.currentTarget.setPointerCapture(l.pointerId);
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
|
-
r(
|
|
320
|
-
},
|
|
319
|
+
r(l);
|
|
320
|
+
}, w = (l) => {
|
|
321
321
|
try {
|
|
322
|
-
|
|
322
|
+
l.currentTarget.hasPointerCapture?.(l.pointerId) && l.currentTarget.releasePointerCapture(l.pointerId);
|
|
323
323
|
} catch {
|
|
324
324
|
}
|
|
325
|
-
a(
|
|
325
|
+
a(l);
|
|
326
326
|
};
|
|
327
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ u(
|
|
328
328
|
"button",
|
|
329
329
|
{
|
|
330
|
-
ref:
|
|
330
|
+
ref: m,
|
|
331
331
|
type: "button",
|
|
332
|
-
"aria-label":
|
|
333
|
-
"data-edge":
|
|
332
|
+
"aria-label": d,
|
|
333
|
+
"data-edge": s,
|
|
334
334
|
"data-resize-state": t,
|
|
335
335
|
className: [
|
|
336
336
|
"gloss-edge-handle",
|
|
337
|
-
`gloss-edge-handle--${
|
|
338
|
-
|
|
337
|
+
`gloss-edge-handle--${s}`,
|
|
338
|
+
g ? "gloss-edge-handle--visible" : ""
|
|
339
339
|
].filter(Boolean).join(" "),
|
|
340
|
-
onPointerDown:
|
|
341
|
-
onPointerUp:
|
|
342
|
-
|
|
340
|
+
onPointerDown: y,
|
|
341
|
+
onPointerUp: w,
|
|
342
|
+
onPointerEnter: n,
|
|
343
|
+
onPointerLeave: o,
|
|
344
|
+
tabIndex: g ? 0 : -1
|
|
343
345
|
}
|
|
344
346
|
);
|
|
345
347
|
}
|
|
@@ -351,7 +353,7 @@ function ke({
|
|
|
351
353
|
enterMs: r = 180,
|
|
352
354
|
exitMs: a = 120
|
|
353
355
|
}) {
|
|
354
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ u(
|
|
355
357
|
"div",
|
|
356
358
|
{
|
|
357
359
|
"aria-hidden": "true",
|
|
@@ -375,57 +377,67 @@ function vt({
|
|
|
375
377
|
enterMs: o = 180,
|
|
376
378
|
exitMs: s = 120
|
|
377
379
|
}) {
|
|
378
|
-
const [d,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}, [
|
|
385
|
-
(
|
|
386
|
-
|
|
380
|
+
const [d, m] = M("idle"), [g, y] = M(e), w = F(null), l = F(null), i = F("idle");
|
|
381
|
+
A(() => {
|
|
382
|
+
i.current = d;
|
|
383
|
+
}, [d]);
|
|
384
|
+
const f = 180, N = v(() => {
|
|
385
|
+
w.current && (clearTimeout(w.current), w.current = null);
|
|
386
|
+
}, []), k = v(() => {
|
|
387
|
+
m((p) => p !== "idle" ? p : (w.current = setTimeout(() => m("handle-visible"), n), "dwelling"));
|
|
388
|
+
}, [n]), b = v(() => {
|
|
389
|
+
N(), m((p) => p === "dwelling" || p === "handle-visible" ? "idle" : p);
|
|
390
|
+
}, [N]), S = v(
|
|
391
|
+
(p) => {
|
|
392
|
+
i.current === "handle-visible" && (l.current = p.clientX, i.current = "dragging", m("dragging"));
|
|
387
393
|
},
|
|
388
394
|
[]
|
|
389
|
-
),
|
|
390
|
-
(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
});
|
|
395
|
+
), T = v(
|
|
396
|
+
(p) => {
|
|
397
|
+
if (i.current !== "dragging") return;
|
|
398
|
+
const c = p.clientX - (l.current ?? p.clientX), D = Math.round(c / f), h = Math.min(3, Math.max(1, e + D)), I = h !== e;
|
|
399
|
+
if (m(I ? "committed" : "cancelled"), I) {
|
|
400
|
+
const x = h > e ? "grow" : "shrink";
|
|
401
|
+
r({ direction: x, targetColSpan: h, mode: t ? "slot-fill" : "sparkline-fidelity" });
|
|
402
|
+
} else
|
|
403
|
+
a?.();
|
|
399
404
|
},
|
|
400
405
|
[e, t, r, a]
|
|
401
|
-
),
|
|
402
|
-
|
|
403
|
-
}, [
|
|
404
|
-
return
|
|
406
|
+
), C = v(() => {
|
|
407
|
+
N(), m((p) => p === "dragging" || p === "handle-visible" ? (a?.(), "cancelled") : p);
|
|
408
|
+
}, [N, a]);
|
|
409
|
+
return A(() => {
|
|
405
410
|
if (d !== "dragging" && d !== "handle-visible") return;
|
|
406
|
-
const
|
|
407
|
-
|
|
411
|
+
const p = (c) => {
|
|
412
|
+
c.key === "Escape" && C();
|
|
408
413
|
};
|
|
409
|
-
return window.addEventListener("keydown",
|
|
410
|
-
}, [d,
|
|
414
|
+
return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
|
|
415
|
+
}, [d, C]), A(() => {
|
|
411
416
|
if (d !== "dragging") {
|
|
412
|
-
|
|
417
|
+
y(e);
|
|
413
418
|
return;
|
|
414
419
|
}
|
|
415
|
-
const
|
|
416
|
-
const
|
|
417
|
-
|
|
420
|
+
const p = (c) => {
|
|
421
|
+
const D = c.clientX - (l.current ?? c.clientX), h = Math.round(D / f), I = Math.min(3, Math.max(1, e + h));
|
|
422
|
+
y((x) => x === I ? x : I);
|
|
418
423
|
};
|
|
419
|
-
return window.addEventListener("pointermove",
|
|
420
|
-
}, [d, e]),
|
|
424
|
+
return window.addEventListener("pointermove", p), () => window.removeEventListener("pointermove", p);
|
|
425
|
+
}, [d, e]), A(() => () => N(), [N]), A(() => {
|
|
421
426
|
if (d !== "committed" && d !== "cancelled") return;
|
|
422
|
-
const
|
|
423
|
-
return () => clearTimeout(
|
|
427
|
+
const p = setTimeout(() => m("idle"), s);
|
|
428
|
+
return () => clearTimeout(p);
|
|
424
429
|
}, [d, s]), {
|
|
425
430
|
state: d,
|
|
426
|
-
enterEdgeZone:
|
|
427
|
-
leaveEdgeZone:
|
|
428
|
-
handleProps: {
|
|
431
|
+
enterEdgeZone: k,
|
|
432
|
+
leaveEdgeZone: b,
|
|
433
|
+
handleProps: {
|
|
434
|
+
onPointerDown: S,
|
|
435
|
+
onPointerUp: T,
|
|
436
|
+
// Bug E: handle continues zone presence so pointer crossing sentinel→handle
|
|
437
|
+
// doesn't collapse state. handle's pointerenter = stay in zone.
|
|
438
|
+
onPointerEnter: k,
|
|
439
|
+
onPointerLeave: b
|
|
440
|
+
},
|
|
429
441
|
previewColSpan: g,
|
|
430
442
|
ghostProps: {
|
|
431
443
|
visible: d === "dragging",
|
|
@@ -552,13 +564,13 @@ const Ct = {
|
|
|
552
564
|
variant: "standard",
|
|
553
565
|
label: "Total Revenue",
|
|
554
566
|
isLoading: !0
|
|
555
|
-
},
|
|
567
|
+
}, Pe = {
|
|
556
568
|
variant: "standard",
|
|
557
569
|
label: "Total Revenue",
|
|
558
570
|
value: 125430,
|
|
559
571
|
valueFormat: { prefix: "$", abbreviated: !0 },
|
|
560
572
|
isError: !0
|
|
561
|
-
},
|
|
573
|
+
}, _e = {
|
|
562
574
|
variant: "standard",
|
|
563
575
|
label: "Total Revenue",
|
|
564
576
|
value: null,
|
|
@@ -595,8 +607,8 @@ const Ct = {
|
|
|
595
607
|
isStale: !0
|
|
596
608
|
}, Dt = [
|
|
597
609
|
Ie,
|
|
598
|
-
_e,
|
|
599
610
|
Pe,
|
|
611
|
+
_e,
|
|
600
612
|
Me,
|
|
601
613
|
Re,
|
|
602
614
|
Fe
|
|
@@ -694,19 +706,19 @@ function ne({
|
|
|
694
706
|
onCreatePage: s,
|
|
695
707
|
onManagePages: d
|
|
696
708
|
}) {
|
|
697
|
-
const
|
|
698
|
-
(
|
|
699
|
-
o(
|
|
709
|
+
const m = v(
|
|
710
|
+
(l) => {
|
|
711
|
+
o(l), t();
|
|
700
712
|
},
|
|
701
713
|
[o, t]
|
|
702
|
-
), g =
|
|
703
|
-
(
|
|
704
|
-
(i.key === "Enter" || i.key === " ") && (i.preventDefault(),
|
|
714
|
+
), g = v(
|
|
715
|
+
(l, i) => {
|
|
716
|
+
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), m(l));
|
|
705
717
|
},
|
|
706
|
-
[
|
|
707
|
-
),
|
|
718
|
+
[m]
|
|
719
|
+
), y = v(() => {
|
|
708
720
|
s(), t();
|
|
709
|
-
}, [s, t]),
|
|
721
|
+
}, [s, t]), w = v(() => {
|
|
710
722
|
d(), t();
|
|
711
723
|
}, [d, t]);
|
|
712
724
|
return /* @__PURE__ */ R(
|
|
@@ -723,8 +735,8 @@ function ne({
|
|
|
723
735
|
anchorRef: r,
|
|
724
736
|
className: "gloss-page-dropdown",
|
|
725
737
|
children: [
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
const i =
|
|
738
|
+
/* @__PURE__ */ u("ul", { role: "menu", className: "gloss-page-dropdown__list", children: a.map((l) => {
|
|
739
|
+
const i = l.id === n;
|
|
728
740
|
return /* @__PURE__ */ R(
|
|
729
741
|
"li",
|
|
730
742
|
{
|
|
@@ -733,45 +745,45 @@ function ne({
|
|
|
733
745
|
"aria-current": i ? "page" : void 0,
|
|
734
746
|
tabIndex: 0,
|
|
735
747
|
className: `gloss-page-dropdown__item${i ? " gloss-page-dropdown__item--active" : ""}`,
|
|
736
|
-
onClick: () =>
|
|
737
|
-
onKeyDown: (
|
|
748
|
+
onClick: () => m(l.id),
|
|
749
|
+
onKeyDown: (f) => g(l.id, f),
|
|
738
750
|
children: [
|
|
739
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ u(
|
|
740
752
|
"span",
|
|
741
753
|
{
|
|
742
754
|
className: `gloss-page-dropdown__dot${i ? " gloss-page-dropdown__dot--active" : ""}`
|
|
743
755
|
}
|
|
744
756
|
),
|
|
745
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ u(
|
|
746
758
|
"span",
|
|
747
759
|
{
|
|
748
|
-
className: `gloss-page-dropdown__name${
|
|
749
|
-
children:
|
|
760
|
+
className: `gloss-page-dropdown__name${l.named ? "" : " gloss-page-dropdown__name--unnamed"}`,
|
|
761
|
+
children: l.name
|
|
750
762
|
}
|
|
751
763
|
),
|
|
752
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ u("span", { className: "gloss-page-dropdown__count", children: l.cardCount })
|
|
753
765
|
]
|
|
754
766
|
},
|
|
755
|
-
|
|
767
|
+
l.id
|
|
756
768
|
);
|
|
757
769
|
}) }),
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ u("hr", { className: "gloss-page-dropdown__separator" }),
|
|
771
|
+
/* @__PURE__ */ u(
|
|
760
772
|
"button",
|
|
761
773
|
{
|
|
762
774
|
role: "menuitem",
|
|
763
775
|
className: "gloss-page-dropdown__action",
|
|
764
|
-
onClick:
|
|
776
|
+
onClick: y,
|
|
765
777
|
children: "+ New page"
|
|
766
778
|
}
|
|
767
779
|
),
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ u("hr", { className: "gloss-page-dropdown__separator" }),
|
|
781
|
+
/* @__PURE__ */ u(
|
|
770
782
|
"button",
|
|
771
783
|
{
|
|
772
784
|
role: "menuitem",
|
|
773
785
|
className: "gloss-page-dropdown__action gloss-page-dropdown__action--muted",
|
|
774
|
-
onClick:
|
|
786
|
+
onClick: w,
|
|
775
787
|
children: "Manage pages"
|
|
776
788
|
}
|
|
777
789
|
)
|
|
@@ -789,20 +801,20 @@ const Oe = function({
|
|
|
789
801
|
onManagePages: s,
|
|
790
802
|
maskRadius: d = "var(--gloss-radius-md)"
|
|
791
803
|
}) {
|
|
792
|
-
const
|
|
793
|
-
|
|
794
|
-
}, []),
|
|
795
|
-
|
|
804
|
+
const m = F(null), [g, y] = M(!1), w = v(() => {
|
|
805
|
+
y((f) => !f);
|
|
806
|
+
}, []), l = v(() => {
|
|
807
|
+
y(!1);
|
|
796
808
|
}, []), i = a[t]?.id ?? "";
|
|
797
809
|
return /* @__PURE__ */ R(
|
|
798
810
|
"div",
|
|
799
811
|
{
|
|
800
812
|
className: "gloss-page-chip",
|
|
801
|
-
ref:
|
|
813
|
+
ref: m,
|
|
802
814
|
style: { position: "absolute", top: 0, right: 0 },
|
|
803
815
|
"data-page-chip": !0,
|
|
804
816
|
children: [
|
|
805
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ u(
|
|
806
818
|
"div",
|
|
807
819
|
{
|
|
808
820
|
className: "gloss-page-chip__nuzzle",
|
|
@@ -816,7 +828,7 @@ const Oe = function({
|
|
|
816
828
|
"aria-haspopup": "menu",
|
|
817
829
|
"aria-expanded": g,
|
|
818
830
|
"aria-label": `Page ${t + 1} of ${r}. Click to switch pages.`,
|
|
819
|
-
onClick:
|
|
831
|
+
onClick: w,
|
|
820
832
|
children: [
|
|
821
833
|
t + 1,
|
|
822
834
|
" / ",
|
|
@@ -824,12 +836,12 @@ const Oe = function({
|
|
|
824
836
|
]
|
|
825
837
|
}
|
|
826
838
|
),
|
|
827
|
-
/* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ u(
|
|
828
840
|
ne,
|
|
829
841
|
{
|
|
830
842
|
open: g,
|
|
831
|
-
onDismiss:
|
|
832
|
-
anchorRef:
|
|
843
|
+
onDismiss: l,
|
|
844
|
+
anchorRef: m,
|
|
833
845
|
pages: a,
|
|
834
846
|
activePageId: i,
|
|
835
847
|
onPageChange: n,
|
|
@@ -1118,7 +1130,7 @@ function oe(e) {
|
|
|
1118
1130
|
function se(e) {
|
|
1119
1131
|
return new Date(e).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
1120
1132
|
}
|
|
1121
|
-
const H =
|
|
1133
|
+
const H = P.createElement("span", { style: { color: "var(--color-text-muted)" } }, "—"), Pt = [
|
|
1122
1134
|
{
|
|
1123
1135
|
field: "id",
|
|
1124
1136
|
headerName: "Order",
|
|
@@ -1170,7 +1182,7 @@ const H = _.createElement("span", { style: { color: "var(--color-text-muted)" }
|
|
|
1170
1182
|
cellClassName: "gloss-tabular-nums",
|
|
1171
1183
|
renderCell: ({ row: e }) => e.date ? se(e.date) : ""
|
|
1172
1184
|
}
|
|
1173
|
-
],
|
|
1185
|
+
], _t = [
|
|
1174
1186
|
{
|
|
1175
1187
|
field: "sku",
|
|
1176
1188
|
headerName: "Item ID",
|
|
@@ -1486,11 +1498,11 @@ const H = _.createElement("span", { style: { color: "var(--color-text-muted)" }
|
|
|
1486
1498
|
{ id: "ytd", label: "YTD" },
|
|
1487
1499
|
{ id: "lytd", label: "LYTD" }
|
|
1488
1500
|
];
|
|
1489
|
-
function
|
|
1501
|
+
function O(e, t) {
|
|
1490
1502
|
return {
|
|
1491
1503
|
id: e,
|
|
1492
1504
|
colSpan: 1,
|
|
1493
|
-
content:
|
|
1505
|
+
content: P.createElement("div", {
|
|
1494
1506
|
style: {
|
|
1495
1507
|
width: "100%",
|
|
1496
1508
|
height: "100%",
|
|
@@ -1508,21 +1520,21 @@ function F(e, t) {
|
|
|
1508
1520
|
}
|
|
1509
1521
|
function te(e, t) {
|
|
1510
1522
|
return {
|
|
1511
|
-
...
|
|
1523
|
+
...O(e, t),
|
|
1512
1524
|
colSpan: 2
|
|
1513
1525
|
};
|
|
1514
1526
|
}
|
|
1515
1527
|
const zt = [
|
|
1516
|
-
|
|
1517
|
-
|
|
1528
|
+
O("total-revenue", "Total Revenue"),
|
|
1529
|
+
O("total-orders", "Total Orders"),
|
|
1518
1530
|
te("revenue-trend", "Revenue Trend (2x)"),
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1531
|
+
O("avg-order", "Avg Order Value"),
|
|
1532
|
+
O("new-customers", "New Customers"),
|
|
1533
|
+
O("top-salesperson", "Top Salesperson"),
|
|
1522
1534
|
te("order-trend", "Order Trend (2x)"),
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1535
|
+
O("repeat-rate", "Repeat Rate"),
|
|
1536
|
+
O("open-orders", "Open Orders"),
|
|
1537
|
+
O("shipped-orders", "Shipped Orders")
|
|
1526
1538
|
], Kt = {
|
|
1527
1539
|
columns: 6,
|
|
1528
1540
|
rowHeight: 120,
|
|
@@ -1546,7 +1558,7 @@ const zt = [
|
|
|
1546
1558
|
totalPages: 3
|
|
1547
1559
|
};
|
|
1548
1560
|
function Z(e) {
|
|
1549
|
-
return
|
|
1561
|
+
return P.createElement("span", { style: { fontSize: 14 } }, e);
|
|
1550
1562
|
}
|
|
1551
1563
|
const Yt = [
|
|
1552
1564
|
{
|
|
@@ -1638,14 +1650,14 @@ function He(e) {
|
|
|
1638
1650
|
}
|
|
1639
1651
|
const ze = function(t) {
|
|
1640
1652
|
if (t.renderMode === "discrete")
|
|
1641
|
-
return /* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ u(
|
|
1642
1654
|
"div",
|
|
1643
1655
|
{
|
|
1644
1656
|
className: "gloss-metric-group gloss-metric-group--discrete",
|
|
1645
1657
|
style: { display: "contents" },
|
|
1646
1658
|
children: t.cards.map((n) => {
|
|
1647
1659
|
const o = V(n.size);
|
|
1648
|
-
return /* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ u(
|
|
1649
1661
|
"div",
|
|
1650
1662
|
{
|
|
1651
1663
|
className: "gloss-metric-group__slot",
|
|
@@ -1680,7 +1692,7 @@ const ze = function(t) {
|
|
|
1680
1692
|
"aria-label": a?.label,
|
|
1681
1693
|
tabIndex: void 0,
|
|
1682
1694
|
children: [
|
|
1683
|
-
a?.accentColor && /* @__PURE__ */
|
|
1695
|
+
a?.accentColor && /* @__PURE__ */ u(
|
|
1684
1696
|
"div",
|
|
1685
1697
|
{
|
|
1686
1698
|
className: "gloss-metric-group__accent",
|
|
@@ -1688,8 +1700,8 @@ const ze = function(t) {
|
|
|
1688
1700
|
}
|
|
1689
1701
|
),
|
|
1690
1702
|
a?.label && /* @__PURE__ */ R("div", { className: "gloss-metric-group__label", children: [
|
|
1691
|
-
/* @__PURE__ */
|
|
1692
|
-
a?.trend && /* @__PURE__ */
|
|
1703
|
+
/* @__PURE__ */ u("span", { children: a.label }),
|
|
1704
|
+
a?.trend && /* @__PURE__ */ u(
|
|
1693
1705
|
"span",
|
|
1694
1706
|
{
|
|
1695
1707
|
className: "gloss-metric-group__trend",
|
|
@@ -1698,7 +1710,7 @@ const ze = function(t) {
|
|
|
1698
1710
|
}
|
|
1699
1711
|
)
|
|
1700
1712
|
] }),
|
|
1701
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ u(
|
|
1702
1714
|
"div",
|
|
1703
1715
|
{
|
|
1704
1716
|
className: "gloss-metric-group__slots",
|
|
@@ -1709,7 +1721,7 @@ const ze = function(t) {
|
|
|
1709
1721
|
},
|
|
1710
1722
|
children: r.map((n) => {
|
|
1711
1723
|
const o = V(n.size);
|
|
1712
|
-
return /* @__PURE__ */
|
|
1724
|
+
return /* @__PURE__ */ u(
|
|
1713
1725
|
"div",
|
|
1714
1726
|
{
|
|
1715
1727
|
className: "gloss-metric-group__slot--composite",
|
|
@@ -1744,37 +1756,37 @@ function Ke({
|
|
|
1744
1756
|
anchorEl: a,
|
|
1745
1757
|
anchorSelector: n
|
|
1746
1758
|
}) {
|
|
1747
|
-
const [o, s] =
|
|
1759
|
+
const [o, s] = P.useState(null), d = P.useMemo(
|
|
1748
1760
|
() => typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1,
|
|
1749
1761
|
[]
|
|
1750
1762
|
);
|
|
1751
|
-
|
|
1763
|
+
P.useEffect(() => {
|
|
1752
1764
|
!a && !n && (typeof process > "u" || process.env.NODE_ENV !== "production") && console.error(
|
|
1753
1765
|
"[InlineNudge] requires anchorEl or anchorSelector. AP-07: Do not mount InlineNudge in Layout/** or _app.tsx."
|
|
1754
1766
|
);
|
|
1755
|
-
}, [a, n]),
|
|
1767
|
+
}, [a, n]), P.useLayoutEffect(() => {
|
|
1756
1768
|
let g = null;
|
|
1757
1769
|
if (a ? g = a : n && (g = document.querySelector(n)), g) {
|
|
1758
|
-
const
|
|
1770
|
+
const y = g.getBoundingClientRect();
|
|
1759
1771
|
s({
|
|
1760
|
-
top:
|
|
1761
|
-
left:
|
|
1772
|
+
top: y.bottom + window.scrollY + 6,
|
|
1773
|
+
left: y.left + window.scrollX
|
|
1762
1774
|
});
|
|
1763
1775
|
}
|
|
1764
1776
|
}, [a, n]);
|
|
1765
|
-
const
|
|
1777
|
+
const m = o ? { top: o.top, left: o.left } : {};
|
|
1766
1778
|
return /* @__PURE__ */ R(
|
|
1767
1779
|
"div",
|
|
1768
1780
|
{
|
|
1769
1781
|
className: B["gloss-inline-nudge"],
|
|
1770
|
-
style:
|
|
1782
|
+
style: m,
|
|
1771
1783
|
role: "status",
|
|
1772
1784
|
"aria-live": "polite",
|
|
1773
1785
|
"data-reduced-motion": d ? "true" : void 0,
|
|
1774
1786
|
children: [
|
|
1775
|
-
/* @__PURE__ */
|
|
1787
|
+
/* @__PURE__ */ u("span", { className: B["gloss-inline-nudge__message"], children: e }),
|
|
1776
1788
|
/* @__PURE__ */ R("div", { className: B["gloss-inline-nudge__actions"], children: [
|
|
1777
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ u(
|
|
1778
1790
|
"button",
|
|
1779
1791
|
{
|
|
1780
1792
|
type: "button",
|
|
@@ -1783,7 +1795,7 @@ function Ke({
|
|
|
1783
1795
|
children: t.label
|
|
1784
1796
|
}
|
|
1785
1797
|
),
|
|
1786
|
-
/* @__PURE__ */
|
|
1798
|
+
/* @__PURE__ */ u(
|
|
1787
1799
|
"button",
|
|
1788
1800
|
{
|
|
1789
1801
|
type: "button",
|
|
@@ -1816,70 +1828,70 @@ function Ze({
|
|
|
1816
1828
|
max: a = 100,
|
|
1817
1829
|
disabled: n = !1
|
|
1818
1830
|
}) {
|
|
1819
|
-
const o =
|
|
1820
|
-
|
|
1821
|
-
const
|
|
1822
|
-
(
|
|
1831
|
+
const o = F(null), [s, d] = M(null), [m, g] = M(e), y = F(e);
|
|
1832
|
+
y.current !== e && (y.current = e, g(e));
|
|
1833
|
+
const w = pe(() => We(m, r, a), [m, r, a]), l = v(
|
|
1834
|
+
(b) => {
|
|
1823
1835
|
if (!o.current) return r;
|
|
1824
|
-
const
|
|
1825
|
-
return Math.round(
|
|
1836
|
+
const S = o.current.getBoundingClientRect(), T = Math.max(0, Math.min(1, (b - S.left) / S.width)), C = r + T * (a - r);
|
|
1837
|
+
return Math.round(C * 100) / 100;
|
|
1826
1838
|
},
|
|
1827
1839
|
[r, a]
|
|
1828
|
-
), i =
|
|
1829
|
-
(
|
|
1830
|
-
const
|
|
1831
|
-
n ||
|
|
1840
|
+
), i = v(
|
|
1841
|
+
(b, S) => {
|
|
1842
|
+
const T = m.find((C) => C.id === S);
|
|
1843
|
+
n || T?.disabled || (typeof b.currentTarget.setPointerCapture == "function" && b.currentTarget.setPointerCapture(b.pointerId), d(S));
|
|
1832
1844
|
},
|
|
1833
|
-
[n,
|
|
1834
|
-
),
|
|
1835
|
-
(
|
|
1845
|
+
[n, m]
|
|
1846
|
+
), f = v(
|
|
1847
|
+
(b) => {
|
|
1836
1848
|
if (!s) return;
|
|
1837
|
-
const
|
|
1849
|
+
const S = l(b.clientX);
|
|
1838
1850
|
g(
|
|
1839
|
-
(
|
|
1851
|
+
(T) => T.map((C) => C.id === s ? { ...C, value: S } : C)
|
|
1840
1852
|
);
|
|
1841
1853
|
},
|
|
1842
|
-
[s,
|
|
1843
|
-
),
|
|
1844
|
-
(
|
|
1854
|
+
[s, l]
|
|
1855
|
+
), N = v(
|
|
1856
|
+
(b) => {
|
|
1845
1857
|
if (!s) return;
|
|
1846
|
-
const
|
|
1847
|
-
(
|
|
1858
|
+
const S = l(b.clientX), T = m.map(
|
|
1859
|
+
(C) => C.id === s ? { ...C, value: S } : C
|
|
1848
1860
|
);
|
|
1849
|
-
g(
|
|
1861
|
+
g(T), d(null), t(T);
|
|
1850
1862
|
},
|
|
1851
|
-
[s,
|
|
1852
|
-
),
|
|
1853
|
-
return /* @__PURE__ */
|
|
1863
|
+
[s, l, m, t]
|
|
1864
|
+
), k = a - r || 1;
|
|
1865
|
+
return /* @__PURE__ */ u("div", { className: "gloss-threshold-ramp", "data-disabled": n || void 0, children: /* @__PURE__ */ u(
|
|
1854
1866
|
"div",
|
|
1855
1867
|
{
|
|
1856
1868
|
ref: o,
|
|
1857
1869
|
className: "gloss-threshold-ramp__track",
|
|
1858
|
-
style: { background:
|
|
1859
|
-
onPointerMove:
|
|
1860
|
-
onPointerUp:
|
|
1861
|
-
onPointerLeave:
|
|
1862
|
-
children:
|
|
1863
|
-
const
|
|
1864
|
-
return /* @__PURE__ */
|
|
1870
|
+
style: { background: w },
|
|
1871
|
+
onPointerMove: f,
|
|
1872
|
+
onPointerUp: N,
|
|
1873
|
+
onPointerLeave: N,
|
|
1874
|
+
children: m.map((b) => {
|
|
1875
|
+
const S = (b.value - r) / k * 100;
|
|
1876
|
+
return /* @__PURE__ */ u(
|
|
1865
1877
|
"span",
|
|
1866
1878
|
{
|
|
1867
1879
|
className: "gloss-threshold-ramp__stop",
|
|
1868
1880
|
style: {
|
|
1869
|
-
left: `${
|
|
1870
|
-
color: le(
|
|
1881
|
+
left: `${S}%`,
|
|
1882
|
+
color: le(b)
|
|
1871
1883
|
},
|
|
1872
|
-
"data-disabled":
|
|
1873
|
-
"data-dragging": s ===
|
|
1874
|
-
onPointerDown: (
|
|
1875
|
-
"aria-label":
|
|
1884
|
+
"data-disabled": b.disabled || void 0,
|
|
1885
|
+
"data-dragging": s === b.id || void 0,
|
|
1886
|
+
onPointerDown: (T) => i(T, b.id),
|
|
1887
|
+
"aria-label": b.label ?? `Stop at ${b.value}`,
|
|
1876
1888
|
role: "slider",
|
|
1877
|
-
"aria-valuenow":
|
|
1889
|
+
"aria-valuenow": b.value,
|
|
1878
1890
|
"aria-valuemin": r,
|
|
1879
1891
|
"aria-valuemax": a,
|
|
1880
|
-
tabIndex:
|
|
1892
|
+
tabIndex: b.disabled ? -1 : 0
|
|
1881
1893
|
},
|
|
1882
|
-
|
|
1894
|
+
b.id
|
|
1883
1895
|
);
|
|
1884
1896
|
})
|
|
1885
1897
|
}
|
|
@@ -1891,10 +1903,10 @@ function Ye() {
|
|
|
1891
1903
|
return he(de);
|
|
1892
1904
|
}
|
|
1893
1905
|
function qe({ option: e }) {
|
|
1894
|
-
const t = Ye(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n =
|
|
1906
|
+
const t = Ye(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n = v(() => {
|
|
1895
1907
|
a || t?.select(e.value);
|
|
1896
1908
|
}, [a, t, e.value]), o = e.colorToken ? `var(--gloss-color-${e.colorToken}, ${e.color ?? "#888"})` : e.color ?? "#888";
|
|
1897
|
-
return /* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ u(
|
|
1898
1910
|
"button",
|
|
1899
1911
|
{
|
|
1900
1912
|
type: "button",
|
|
@@ -1919,22 +1931,22 @@ function Ve({
|
|
|
1919
1931
|
disabled: n = !1,
|
|
1920
1932
|
name: o
|
|
1921
1933
|
}) {
|
|
1922
|
-
const s = t !== void 0, [d,
|
|
1934
|
+
const s = t !== void 0, [d, m] = M(r), g = s ? t : d, y = v(
|
|
1923
1935
|
(i) => {
|
|
1924
|
-
s ||
|
|
1936
|
+
s || m(i), a?.(i);
|
|
1925
1937
|
},
|
|
1926
1938
|
[s, a]
|
|
1927
|
-
),
|
|
1939
|
+
), w = v(
|
|
1928
1940
|
(i) => g === i,
|
|
1929
1941
|
[g]
|
|
1930
|
-
),
|
|
1942
|
+
), l = {
|
|
1931
1943
|
selectedValue: g,
|
|
1932
|
-
select:
|
|
1933
|
-
isSelected:
|
|
1944
|
+
select: y,
|
|
1945
|
+
isSelected: w,
|
|
1934
1946
|
groupDisabled: n,
|
|
1935
1947
|
name: o
|
|
1936
1948
|
};
|
|
1937
|
-
return /* @__PURE__ */
|
|
1949
|
+
return /* @__PURE__ */ u(de.Provider, { value: l, children: /* @__PURE__ */ u(
|
|
1938
1950
|
"div",
|
|
1939
1951
|
{
|
|
1940
1952
|
className: "gloss-preset-swatch-row",
|
|
@@ -1942,7 +1954,7 @@ function Ve({
|
|
|
1942
1954
|
"aria-label": o,
|
|
1943
1955
|
"aria-disabled": n,
|
|
1944
1956
|
"data-disabled": n || void 0,
|
|
1945
|
-
children: e.map((i) => /* @__PURE__ */
|
|
1957
|
+
children: e.map((i) => /* @__PURE__ */ u(qe, { option: i }, i.value))
|
|
1946
1958
|
}
|
|
1947
1959
|
) });
|
|
1948
1960
|
}
|
|
@@ -1962,83 +1974,83 @@ function Ue(e, t, r) {
|
|
|
1962
1974
|
return a.splice(r, 0, n), a;
|
|
1963
1975
|
}
|
|
1964
1976
|
function je(e) {
|
|
1965
|
-
const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null), d =
|
|
1966
|
-
|
|
1967
|
-
const g =
|
|
1968
|
-
(
|
|
1969
|
-
const
|
|
1970
|
-
let
|
|
1971
|
-
for (const
|
|
1972
|
-
const
|
|
1973
|
-
if (
|
|
1974
|
-
|
|
1977
|
+
const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null), d = F(null), m = F(e.onZoneChange);
|
|
1978
|
+
m.current = e.onZoneChange;
|
|
1979
|
+
const g = v(
|
|
1980
|
+
(f) => {
|
|
1981
|
+
const N = f.active.id;
|
|
1982
|
+
let k = null, b = null;
|
|
1983
|
+
for (const S of t) {
|
|
1984
|
+
const T = S.items.find((C) => C.id === N);
|
|
1985
|
+
if (T) {
|
|
1986
|
+
k = T, b = S.zoneKey;
|
|
1975
1987
|
break;
|
|
1976
1988
|
}
|
|
1977
1989
|
}
|
|
1978
|
-
d.current =
|
|
1990
|
+
d.current = b, n(k), s(b);
|
|
1979
1991
|
},
|
|
1980
1992
|
[t]
|
|
1981
|
-
),
|
|
1982
|
-
(
|
|
1983
|
-
if (!
|
|
1993
|
+
), y = v(
|
|
1994
|
+
(f) => {
|
|
1995
|
+
if (!f.over) {
|
|
1984
1996
|
s(d.current);
|
|
1985
1997
|
return;
|
|
1986
1998
|
}
|
|
1987
|
-
const
|
|
1988
|
-
s(
|
|
1999
|
+
const N = ae(t, f.over.id);
|
|
2000
|
+
s(N);
|
|
1989
2001
|
},
|
|
1990
2002
|
[t]
|
|
1991
|
-
),
|
|
1992
|
-
(
|
|
1993
|
-
const { active:
|
|
2003
|
+
), w = v(
|
|
2004
|
+
(f) => {
|
|
2005
|
+
const { active: N, over: k } = f, b = () => {
|
|
1994
2006
|
d.current = null, n(null), s(null);
|
|
1995
2007
|
};
|
|
1996
|
-
if (!
|
|
1997
|
-
|
|
2008
|
+
if (!k) {
|
|
2009
|
+
b();
|
|
1998
2010
|
return;
|
|
1999
2011
|
}
|
|
2000
|
-
const
|
|
2001
|
-
if (!
|
|
2002
|
-
|
|
2012
|
+
const S = U(t, N.id), T = ae(t, k.id);
|
|
2013
|
+
if (!S || !T) {
|
|
2014
|
+
b();
|
|
2003
2015
|
return;
|
|
2004
2016
|
}
|
|
2005
|
-
let
|
|
2006
|
-
if (
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2009
|
-
...
|
|
2010
|
-
items: Ue(
|
|
2017
|
+
let C = t.map((p) => ({ ...p, items: [...p.items] }));
|
|
2018
|
+
if (S === T) {
|
|
2019
|
+
const p = C.findIndex((x) => x.zoneKey === S), c = C[p], D = c.items.findIndex((x) => x.id === N.id), h = c.items.findIndex((x) => x.id === k.id), I = h >= 0 ? h : c.items.length - 1;
|
|
2020
|
+
C[p] = {
|
|
2021
|
+
...c,
|
|
2022
|
+
items: Ue(c.items, D, I)
|
|
2011
2023
|
};
|
|
2012
2024
|
} else {
|
|
2013
|
-
const
|
|
2014
|
-
let Q =
|
|
2015
|
-
if (
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2025
|
+
const p = C.findIndex((_) => _.zoneKey === S), c = C.findIndex((_) => _.zoneKey === T), D = C[p], h = C[c], I = D.items.find((_) => _.id === N.id), x = D.items.filter((_) => _.id !== N.id), E = h.items.findIndex((_) => _.id === k.id), G = E >= 0 ? E : h.items.length;
|
|
2026
|
+
let Q = x, L = [...h.items];
|
|
2027
|
+
if (h.maxItems !== void 0 && L.length >= h.maxItems) {
|
|
2028
|
+
const _ = L[L.length - 1];
|
|
2029
|
+
L = L.slice(0, h.maxItems - 1), Q = [...x, _];
|
|
2018
2030
|
}
|
|
2019
|
-
const X = Math.min(G,
|
|
2020
|
-
...
|
|
2031
|
+
const X = Math.min(G, L.length), me = [
|
|
2032
|
+
...L.slice(0, X),
|
|
2021
2033
|
I,
|
|
2022
|
-
...
|
|
2034
|
+
...L.slice(X)
|
|
2023
2035
|
];
|
|
2024
|
-
|
|
2036
|
+
C[p] = { ...D, items: Q }, C[c] = { ...h, items: me };
|
|
2025
2037
|
}
|
|
2026
|
-
r(
|
|
2038
|
+
r(C), m.current?.(C), b();
|
|
2027
2039
|
},
|
|
2028
2040
|
[t]
|
|
2029
|
-
),
|
|
2030
|
-
(
|
|
2031
|
-
id:
|
|
2032
|
-
"data-zone-key":
|
|
2041
|
+
), l = v(
|
|
2042
|
+
(f) => ({
|
|
2043
|
+
id: f,
|
|
2044
|
+
"data-zone-key": f
|
|
2033
2045
|
}),
|
|
2034
2046
|
[]
|
|
2035
|
-
), i =
|
|
2036
|
-
(
|
|
2037
|
-
const
|
|
2047
|
+
), i = v(
|
|
2048
|
+
(f) => {
|
|
2049
|
+
const N = U(t, f.id) ?? "";
|
|
2038
2050
|
return {
|
|
2039
|
-
id:
|
|
2040
|
-
"data-item-id":
|
|
2041
|
-
"data-zone-key":
|
|
2051
|
+
id: f.id,
|
|
2052
|
+
"data-item-id": f.id,
|
|
2053
|
+
"data-zone-key": N
|
|
2042
2054
|
};
|
|
2043
2055
|
},
|
|
2044
2056
|
[t]
|
|
@@ -2047,11 +2059,11 @@ function je(e) {
|
|
|
2047
2059
|
zones: t,
|
|
2048
2060
|
activeZone: o,
|
|
2049
2061
|
activeItem: a,
|
|
2050
|
-
getZoneProps:
|
|
2062
|
+
getZoneProps: l,
|
|
2051
2063
|
getItemProps: i,
|
|
2052
2064
|
handleDragStart: g,
|
|
2053
|
-
handleDragOver:
|
|
2054
|
-
handleDragEnd:
|
|
2065
|
+
handleDragOver: y,
|
|
2066
|
+
handleDragEnd: w
|
|
2055
2067
|
};
|
|
2056
2068
|
}
|
|
2057
2069
|
let $ = null, z = null, re = !1;
|
|
@@ -2074,16 +2086,16 @@ function Qe() {
|
|
|
2074
2086
|
})(), z);
|
|
2075
2087
|
}
|
|
2076
2088
|
function Xe(e) {
|
|
2077
|
-
const { zones: t, onZoneChange: r, renderZone: a, renderItem: n, renderDragOverlay: o } = e, s = je({ zones: t, onZoneChange: r }), [d,
|
|
2078
|
-
return
|
|
2089
|
+
const { zones: t, onZoneChange: r, renderZone: a, renderItem: n, renderDragOverlay: o } = e, s = je({ zones: t, onZoneChange: r }), [d, m] = P.useState($);
|
|
2090
|
+
return P.useEffect(() => {
|
|
2079
2091
|
if (d) return;
|
|
2080
2092
|
let g = !0;
|
|
2081
|
-
return Qe().then((
|
|
2082
|
-
g &&
|
|
2093
|
+
return Qe().then((y) => {
|
|
2094
|
+
g && m(y);
|
|
2083
2095
|
}), () => {
|
|
2084
2096
|
g = !1;
|
|
2085
2097
|
};
|
|
2086
|
-
}, [d]), d ? /* @__PURE__ */
|
|
2098
|
+
}, [d]), d ? /* @__PURE__ */ u(
|
|
2087
2099
|
ce,
|
|
2088
2100
|
{
|
|
2089
2101
|
state: s,
|
|
@@ -2092,9 +2104,9 @@ function Xe(e) {
|
|
|
2092
2104
|
renderItem: n,
|
|
2093
2105
|
renderDragOverlay: o
|
|
2094
2106
|
}
|
|
2095
|
-
) : /* @__PURE__ */
|
|
2096
|
-
const
|
|
2097
|
-
return /* @__PURE__ */
|
|
2107
|
+
) : /* @__PURE__ */ u("div", { "data-sortable-zones-passive": "true", children: s.zones.map((g) => {
|
|
2108
|
+
const y = g.items.map((w) => /* @__PURE__ */ u(P.Fragment, { children: n(w) }, w.id));
|
|
2109
|
+
return /* @__PURE__ */ u("div", { ...s.getZoneProps(g.zoneKey), children: a(g.zoneKey, g.items, y) }, g.zoneKey);
|
|
2098
2110
|
}) });
|
|
2099
2111
|
}
|
|
2100
2112
|
Xe.displayName = "SortableZones";
|
|
@@ -2105,64 +2117,64 @@ function ce({
|
|
|
2105
2117
|
renderItem: a,
|
|
2106
2118
|
renderDragOverlay: n
|
|
2107
2119
|
}) {
|
|
2108
|
-
const { core: o, sortable: s, utilities: d } = t, { DndContext:
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
),
|
|
2120
|
+
const { core: o, sortable: s, utilities: d } = t, { DndContext: m, DragOverlay: g, useSensors: y, useSensor: w, PointerSensor: l, KeyboardSensor: i, closestCenter: f } = o, { SortableContext: N, verticalListSortingStrategy: k } = s, b = y(
|
|
2121
|
+
w(l, { activationConstraint: { distance: 5 } }),
|
|
2122
|
+
w(i)
|
|
2123
|
+
), S = m, T = g, C = N;
|
|
2112
2124
|
return /* @__PURE__ */ R(
|
|
2113
|
-
|
|
2125
|
+
S,
|
|
2114
2126
|
{
|
|
2115
|
-
sensors:
|
|
2116
|
-
collisionDetection:
|
|
2127
|
+
sensors: b,
|
|
2128
|
+
collisionDetection: f,
|
|
2117
2129
|
onDragStart: e.handleDragStart,
|
|
2118
2130
|
onDragOver: e.handleDragOver,
|
|
2119
2131
|
onDragEnd: e.handleDragEnd,
|
|
2120
2132
|
children: [
|
|
2121
|
-
e.zones.map((
|
|
2122
|
-
const
|
|
2133
|
+
e.zones.map((p) => {
|
|
2134
|
+
const c = p.items.map((h) => h.id), D = p.items.map((h) => /* @__PURE__ */ u(
|
|
2123
2135
|
ue,
|
|
2124
2136
|
{
|
|
2125
|
-
id:
|
|
2137
|
+
id: h.id,
|
|
2126
2138
|
useSortable: s.useSortable,
|
|
2127
2139
|
cssHelper: d.CSS,
|
|
2128
|
-
children: a(
|
|
2140
|
+
children: a(h)
|
|
2129
2141
|
},
|
|
2130
|
-
|
|
2142
|
+
h.id
|
|
2131
2143
|
));
|
|
2132
|
-
return /* @__PURE__ */
|
|
2144
|
+
return /* @__PURE__ */ u("div", { ...e.getZoneProps(p.zoneKey), children: /* @__PURE__ */ u(C, { items: c, strategy: k, children: r(p.zoneKey, p.items, D) }) }, p.zoneKey);
|
|
2133
2145
|
}),
|
|
2134
|
-
/* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ u(T, { children: e.activeItem ? n?.(e.activeItem) ?? a(e.activeItem) : null })
|
|
2135
2147
|
]
|
|
2136
2148
|
}
|
|
2137
2149
|
);
|
|
2138
2150
|
}
|
|
2139
2151
|
ce.displayName = "SortableZonesInner";
|
|
2140
2152
|
function ue({ id: e, useSortable: t, cssHelper: r, children: a }) {
|
|
2141
|
-
const { attributes: n, listeners: o, setNodeRef: s, transform: d, transition:
|
|
2153
|
+
const { attributes: n, listeners: o, setNodeRef: s, transform: d, transition: m, isDragging: g } = t({ id: e }), y = {
|
|
2142
2154
|
transform: r?.Transform?.toString(d) ?? void 0,
|
|
2143
|
-
transition:
|
|
2155
|
+
transition: m,
|
|
2144
2156
|
opacity: g ? 0.5 : 1
|
|
2145
2157
|
};
|
|
2146
|
-
return /* @__PURE__ */
|
|
2158
|
+
return /* @__PURE__ */ u("div", { ref: s, style: y, "data-sortable-item-id": e, ...n, ...o, children: a });
|
|
2147
2159
|
}
|
|
2148
2160
|
ue.displayName = "SortableItem";
|
|
2149
|
-
const Je =
|
|
2161
|
+
const Je = P.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
|
|
2150
2162
|
const n = { ...r };
|
|
2151
|
-
return delete n.className, delete n.style, /* @__PURE__ */
|
|
2163
|
+
return delete n.className, delete n.style, /* @__PURE__ */ u("div", { ref: a, className: "gloss-container-toolbar", role: "toolbar", ...n, children: /* @__PURE__ */ u(j, { region: "toolbar", density: e, children: t }) });
|
|
2152
2164
|
});
|
|
2153
2165
|
Je.displayName = "ContainerToolbar";
|
|
2154
|
-
const et =
|
|
2166
|
+
const et = P.forwardRef(({ legend: e, description: t, density: r = "default", children: a, ...n }, o) => {
|
|
2155
2167
|
const s = { ...n };
|
|
2156
2168
|
return delete s.className, delete s.style, /* @__PURE__ */ R("fieldset", { ref: o, className: "gloss-container-form-section", ...s, children: [
|
|
2157
|
-
e && /* @__PURE__ */
|
|
2158
|
-
t && /* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2169
|
+
e && /* @__PURE__ */ u("legend", { className: "gloss-container-form-section__legend", children: e }),
|
|
2170
|
+
t && /* @__PURE__ */ u("p", { className: "gloss-container-form-section__description", children: t }),
|
|
2171
|
+
/* @__PURE__ */ u(j, { region: "form-section", density: r, children: a })
|
|
2160
2172
|
] });
|
|
2161
2173
|
});
|
|
2162
2174
|
et.displayName = "ContainerFormSection";
|
|
2163
|
-
const tt =
|
|
2175
|
+
const tt = P.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
|
|
2164
2176
|
const n = { ...r };
|
|
2165
|
-
return delete n.className, delete n.style, /* @__PURE__ */
|
|
2177
|
+
return delete n.className, delete n.style, /* @__PURE__ */ u("div", { ref: a, className: "gloss-container-table", ...n, children: /* @__PURE__ */ u(j, { region: "table", density: e, children: t }) });
|
|
2166
2178
|
});
|
|
2167
2179
|
tt.displayName = "ContainerTable";
|
|
2168
2180
|
export {
|
|
@@ -2197,8 +2209,8 @@ export {
|
|
|
2197
2209
|
xa as Chip,
|
|
2198
2210
|
ka as ColorPicker,
|
|
2199
2211
|
Ia as ComparisonCard,
|
|
2200
|
-
|
|
2201
|
-
|
|
2212
|
+
Pa as ContactForm,
|
|
2213
|
+
_a as ContainerCard,
|
|
2202
2214
|
Ma as ContainerCardActions,
|
|
2203
2215
|
Ra as ContainerCardBody,
|
|
2204
2216
|
Fa as ContainerCardFooter,
|
|
@@ -2260,8 +2272,8 @@ export {
|
|
|
2260
2272
|
xr as MaskPresets,
|
|
2261
2273
|
kr as MaskedInput,
|
|
2262
2274
|
Ir as Menu,
|
|
2263
|
-
|
|
2264
|
-
|
|
2275
|
+
Pr as MenuDivider,
|
|
2276
|
+
_r as MenuGroup,
|
|
2265
2277
|
Mr as MenuItem,
|
|
2266
2278
|
Rr as MergePrompt,
|
|
2267
2279
|
Fr as MetricCard,
|
|
@@ -2323,8 +2335,8 @@ export {
|
|
|
2323
2335
|
xn as Toggle,
|
|
2324
2336
|
kn as Tooltip,
|
|
2325
2337
|
In as Transition,
|
|
2326
|
-
|
|
2327
|
-
|
|
2338
|
+
Pn as TransitionGroup,
|
|
2339
|
+
_n as TrendCard,
|
|
2328
2340
|
Mn as TrendIndicator,
|
|
2329
2341
|
po as UIContext,
|
|
2330
2342
|
j as UIContextProvider,
|
|
@@ -2351,11 +2363,11 @@ export {
|
|
|
2351
2363
|
$n as destructiveModalMetadata,
|
|
2352
2364
|
Hn as durations,
|
|
2353
2365
|
zn as easings,
|
|
2354
|
-
|
|
2366
|
+
_e as emptyFixture,
|
|
2355
2367
|
Ce as entityChip,
|
|
2356
2368
|
Be as entityNameActions,
|
|
2357
2369
|
ct as entityTabGroup,
|
|
2358
|
-
|
|
2370
|
+
Pe as errorFixture,
|
|
2359
2371
|
Mt as filteredState,
|
|
2360
2372
|
wo as findPreset,
|
|
2361
2373
|
No as formatDateRange,
|
|
@@ -2366,16 +2378,16 @@ export {
|
|
|
2366
2378
|
ko as generateMarketId,
|
|
2367
2379
|
Kn as generateTabId,
|
|
2368
2380
|
Io as getAllPresets,
|
|
2369
|
-
|
|
2381
|
+
Po as getDateRangeForPreset,
|
|
2370
2382
|
Wn as getMenuActions,
|
|
2371
|
-
|
|
2383
|
+
_o as getPresetLabel,
|
|
2372
2384
|
Zn as getTransitionStyle,
|
|
2373
2385
|
zt as gridCards,
|
|
2374
2386
|
Yn as interpolate,
|
|
2375
2387
|
Mo as isInRange,
|
|
2376
2388
|
Ro as isMarketActive,
|
|
2377
2389
|
Fo as isSameDay,
|
|
2378
|
-
|
|
2390
|
+
_t as itemColumns,
|
|
2379
2391
|
It as itemRows,
|
|
2380
2392
|
Ie as loadingFixture,
|
|
2381
2393
|
qn as loginFormMetadata,
|
|
@@ -2388,7 +2400,7 @@ export {
|
|
|
2388
2400
|
qt as mixedTabs,
|
|
2389
2401
|
Oo as normalizePresetId,
|
|
2390
2402
|
$e as numericActions,
|
|
2391
|
-
|
|
2403
|
+
Pt as orderColumns,
|
|
2392
2404
|
Ge as orderIdActions,
|
|
2393
2405
|
kt as orderRows,
|
|
2394
2406
|
Yt as ordersTabs,
|