@mechane-ai/elements 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/dist/{categorical-values-Cf-zlA1u.js → categorical-values-DG0kzYxN.js} +2 -2
- package/dist/{chart-frame-Cf6LBA8M.js → chart-frame-DxAZ0h_q.js} +49 -50
- package/dist/{chart-input-BTDzeBQU.js → chart-input-Dru0GScv.js} +1 -1
- package/dist/charts/cartesian.js +276 -226
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +82 -80
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +136 -134
- package/dist/charts/timeline.js +1 -1
- package/dist/charts.js +1 -1
- package/dist/code-block-DlUwVaPP.js +182 -0
- package/dist/collections.js +227 -117
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +2 -2
- package/dist/content/markdown.js +108 -102
- package/dist/content/tree.js +41 -39
- package/dist/content.js +138 -136
- package/dist/elements.css +42 -0
- package/dist/layout.js +212 -203
- package/dist/navigation.js +0 -1
- package/dist/packages/charts/src/chart-cursor.d.ts +7 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -7
- package/dist/packages/collections/src/index.d.ts +1 -0
- package/dist/packages/collections/src/metrics.d.ts +64 -5
- package/dist/packages/foundations/src/use-scroll-tab-index.d.ts +6 -0
- package/dist/packages/layout/src/index.d.ts +2 -0
- package/dist/packages/layout/src/report-section.d.ts +6 -0
- package/dist/pierre-diff-CHQsoQSZ.js +72 -0
- package/dist/use-scroll-tab-index-Dxpdh4W7.js +45 -0
- package/package.json +1 -1
- package/dist/code-block-D1_kzPrs.js +0 -180
- package/dist/pierre-diff-hAwARDse.js +0 -71
package/dist/collections.js
CHANGED
|
@@ -4,13 +4,14 @@ import { r as o, t as s } from "./src-d7EAi61b.js";
|
|
|
4
4
|
import { d as c } from "./src-0mocxTaR.js";
|
|
5
5
|
import { t as l } from "./accessibility-C-aIZ1Yx.js";
|
|
6
6
|
import { l as u, t as d } from "./constants.stylex-BILvnwUk.js";
|
|
7
|
+
import { t as ee } from "./use-scroll-tab-index-Dxpdh4W7.js";
|
|
7
8
|
import { mergeProps as f } from "@base-ui/react/merge-props";
|
|
8
9
|
import * as p from "@stylexjs/stylex";
|
|
9
|
-
import { Children as m, Fragment as
|
|
10
|
+
import { Children as m, Fragment as te, useEffect as h, useLayoutEffect as g, useMemo as ne, useRef as _, useState as v, useSyncExternalStore as re } from "react";
|
|
10
11
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
-
import { ArrowDown as
|
|
12
|
-
import { createColumnHelper as
|
|
13
|
-
import { defaultRangeExtractor as
|
|
12
|
+
import { ArrowDown as ie, ArrowUp as ae, ArrowUpDown as oe, ChevronLeft as S, ChevronRight as C, Settings2 as w, X as T } from "lucide-react";
|
|
13
|
+
import { createColumnHelper as se, tableFeatures as E, useTable as ce } from "@tanstack/react-table";
|
|
14
|
+
import { defaultRangeExtractor as le, useVirtualizer as ue } from "@tanstack/react-virtual";
|
|
14
15
|
// packages/collections/src/collection-controls.tsx
|
|
15
16
|
var D = { remove: {
|
|
16
17
|
kmuXW: "x2lah0s",
|
|
@@ -83,7 +84,7 @@ function A({ options: t, onChange: n, onReset: r, label: s = "Display options" }
|
|
|
83
84
|
})] })
|
|
84
85
|
}) })] });
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function de({ description: n, previous: r, next: i }) {
|
|
87
88
|
return /* @__PURE__ */ x("nav", {
|
|
88
89
|
"aria-label": "Pagination",
|
|
89
90
|
className: "x78zum5 x6s0dn4 x1qughib x1a02dak xaml1ju xeuugli",
|
|
@@ -110,7 +111,7 @@ function ue({ description: n, previous: r, next: i }) {
|
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
113
|
// packages/collections/src/use-end-reached.ts
|
|
113
|
-
function
|
|
114
|
+
function fe({ end: e, viewport: t, onEndReached: n, content: r }) {
|
|
114
115
|
h(() => {
|
|
115
116
|
if (n === void 0 || e.current === null) return;
|
|
116
117
|
let r = new IntersectionObserver((e) => {
|
|
@@ -125,7 +126,7 @@ function de({ end: e, viewport: t, onEndReached: n, content: r }) {
|
|
|
125
126
|
]);
|
|
126
127
|
}
|
|
127
128
|
// packages/collections/src/data-table.tsx
|
|
128
|
-
var
|
|
129
|
+
var pe = E({}), me = 76, j = d.compactTable.slice(7), he = /* @__PURE__ */ new Map([["ArrowUp", -1], ["ArrowDown", 1]]), M = {
|
|
129
130
|
kmVPX3: "x1717udv",
|
|
130
131
|
kMzoRj: "xc342km",
|
|
131
132
|
$$css: !0
|
|
@@ -290,7 +291,7 @@ var fe = E({}), pe = 76, j = d.compactTable.slice(7), me = /* @__PURE__ */ new M
|
|
|
290
291
|
isFlexible: !1,
|
|
291
292
|
shouldTruncate: !1
|
|
292
293
|
}
|
|
293
|
-
},
|
|
294
|
+
}, ge = {
|
|
294
295
|
fixed: N.content,
|
|
295
296
|
content: N.contentCell
|
|
296
297
|
}, F = {
|
|
@@ -300,14 +301,14 @@ var fe = E({}), pe = 76, j = d.compactTable.slice(7), me = /* @__PURE__ */ new M
|
|
|
300
301
|
number: N.end,
|
|
301
302
|
timestamp: N.end,
|
|
302
303
|
actions: N.end
|
|
303
|
-
},
|
|
304
|
+
}, _e = {
|
|
304
305
|
content: N.content,
|
|
305
306
|
fill: N.fillFrame
|
|
306
307
|
}, I = {
|
|
307
308
|
content: N.content,
|
|
308
309
|
fill: N.fillViewport
|
|
309
310
|
};
|
|
310
|
-
function
|
|
311
|
+
function ve(e) {
|
|
311
312
|
return e.map((e) => {
|
|
312
313
|
let t = P[e.role], n = e.width ?? (t.isFlexible ? void 0 : t.minimumWidth);
|
|
313
314
|
return {
|
|
@@ -316,34 +317,34 @@ function L(e) {
|
|
|
316
317
|
};
|
|
317
318
|
});
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function ye(e, t = 0) {
|
|
320
321
|
return {
|
|
321
322
|
minimumWidth: e.reduce((e, t) => e + (t.width ?? P[t.role].minimumWidth), t),
|
|
322
323
|
compactWidth: e.filter((e) => e.isSecondary !== !0).reduce((e, t) => e + (t.width ?? P[t.role].minimumWidth), t)
|
|
323
324
|
};
|
|
324
325
|
}
|
|
325
|
-
function
|
|
326
|
+
function be(e) {
|
|
326
327
|
let t = globalThis.matchMedia(j);
|
|
327
328
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
+
function xe() {
|
|
330
331
|
return globalThis.matchMedia(j).matches;
|
|
331
332
|
}
|
|
332
|
-
function
|
|
333
|
+
function Se({ columns: e, canSelect: t = !1 }) {
|
|
333
334
|
return /* @__PURE__ */ x("colgroup", { children: [t && /* @__PURE__ */ b("col", { className: "x1d7z9mz xeuugli x1dc62k6" }), e.map((e) => /* @__PURE__ */ b("col", { ...p.props(e.width !== void 0 && N.width(e.width), e.isSecondary === !0 && N.secondary) }, e.id))] });
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
-
let i =
|
|
336
|
+
function L({ columns: e, sizing: t = "content", rowSizing: n = "fixed", hideHeaders: r = !1 }) {
|
|
337
|
+
let i = ve(e), { minimumWidth: a, compactWidth: o } = ye(i);
|
|
337
338
|
return /* @__PURE__ */ b("div", {
|
|
338
339
|
"aria-hidden": !0,
|
|
339
340
|
inert: !0,
|
|
340
|
-
...p.props(N.frame,
|
|
341
|
+
...p.props(N.frame, _e[t], N.placeholder),
|
|
341
342
|
children: /* @__PURE__ */ b("div", {
|
|
342
343
|
...p.props(N.viewport, I[t]),
|
|
343
344
|
children: /* @__PURE__ */ x("table", {
|
|
344
345
|
...p.props(N.table, N.fixed, N.minimumWidth(a, o)),
|
|
345
346
|
children: [
|
|
346
|
-
/* @__PURE__ */ b(
|
|
347
|
+
/* @__PURE__ */ b(Se, { columns: i }),
|
|
347
348
|
/* @__PURE__ */ b("thead", {
|
|
348
349
|
...p.props(r && l.hidden),
|
|
349
350
|
children: /* @__PURE__ */ b("tr", { children: i.map((e) => /* @__PURE__ */ b("th", {
|
|
@@ -361,8 +362,8 @@ function z({ columns: e, sizing: t = "content", rowSizing: n = "fixed", hideHead
|
|
|
361
362
|
].map((e) => /* @__PURE__ */ b("tr", {
|
|
362
363
|
className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6",
|
|
363
364
|
children: i.map((e) => /* @__PURE__ */ b("td", {
|
|
364
|
-
...p.props(N.cell,
|
|
365
|
-
children: /* @__PURE__ */ b(
|
|
365
|
+
...p.props(N.cell, ge[n], F[e.role], e.width !== void 0 && N.width(e.width), e.isSecondary === !0 && N.secondary),
|
|
366
|
+
children: /* @__PURE__ */ b(H, {
|
|
366
367
|
role: e.role,
|
|
367
368
|
isFixed: n === "fixed",
|
|
368
369
|
shouldTruncate: void 0,
|
|
@@ -375,7 +376,7 @@ function z({ columns: e, sizing: t = "content", rowSizing: n = "fixed", hideHead
|
|
|
375
376
|
})
|
|
376
377
|
});
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function R({ children: e, leading: t, isDecorative: n = !1 }) {
|
|
379
380
|
return /* @__PURE__ */ x("span", {
|
|
380
381
|
"aria-hidden": n || void 0,
|
|
381
382
|
inert: n || void 0,
|
|
@@ -390,8 +391,8 @@ function B({ children: e, leading: t, isDecorative: n = !1 }) {
|
|
|
390
391
|
})]
|
|
391
392
|
});
|
|
392
393
|
}
|
|
393
|
-
function
|
|
394
|
-
return /* @__PURE__ */ x(
|
|
394
|
+
function z({ children: e, secondary: t, leading: n, trailing: r }) {
|
|
395
|
+
return /* @__PURE__ */ x(R, {
|
|
395
396
|
leading: n,
|
|
396
397
|
children: [/* @__PURE__ */ x("span", {
|
|
397
398
|
className: "x78zum5 x6s0dn4 x1hnptsi xeuugli",
|
|
@@ -410,8 +411,8 @@ function V({ children: e, secondary: t, leading: n, trailing: r }) {
|
|
|
410
411
|
})]
|
|
411
412
|
});
|
|
412
413
|
}
|
|
413
|
-
function
|
|
414
|
-
return /* @__PURE__ */ x(
|
|
414
|
+
function B({ leading: e, isSecondary: t = !1 }) {
|
|
415
|
+
return /* @__PURE__ */ x(R, {
|
|
415
416
|
leading: e,
|
|
416
417
|
isDecorative: !0,
|
|
417
418
|
children: [/* @__PURE__ */ b("span", {
|
|
@@ -423,68 +424,68 @@ function H({ leading: e, isSecondary: t = !1 }) {
|
|
|
423
424
|
})]
|
|
424
425
|
});
|
|
425
426
|
}
|
|
426
|
-
function
|
|
427
|
-
let A =
|
|
428
|
-
let e =
|
|
427
|
+
function V({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, onSortChange: s, selectedIds: c, onSelectionChange: d, selectionLabel: f, rowAction: m, activeRowId: y, focusRowId: S, hideCaption: C = !1, hideHeaders: w = !1, rowSizing: T = "fixed", window: E, endContent: D, onEndReached: O, footer: k }) {
|
|
428
|
+
let A = ne(() => ve(t), [t]), de = re(be, xe, () => !1), j = ne(() => {
|
|
429
|
+
let e = se();
|
|
429
430
|
return e.columns(A.map((t) => e.display({
|
|
430
431
|
id: t.id,
|
|
431
432
|
header: t.label
|
|
432
433
|
})));
|
|
433
|
-
}, [A]), M =
|
|
434
|
-
features:
|
|
434
|
+
}, [A]), M = ce({
|
|
435
|
+
features: pe,
|
|
435
436
|
columns: j,
|
|
436
437
|
data: e,
|
|
437
438
|
getRowId: n
|
|
438
|
-
}), P =
|
|
439
|
+
}), P = ee(), L = P.viewport, R = _(null), z = _(null), B = _(null), [V, U] = v(0), [we, W] = v(), G = _(void 0), K = _(void 0), q = e.findIndex((e) => n(e) === we), J = A.findIndex((e) => e.role === "primary" && e.isSecondary !== !0), Y = J === -1 ? A.findIndex((e) => e.isSecondary !== !0) : J, X = typeof E?.height == "string" ? E.height : "content";
|
|
439
440
|
g(() => {
|
|
440
441
|
if (S === void 0) {
|
|
441
|
-
|
|
442
|
+
K.current = void 0;
|
|
442
443
|
return;
|
|
443
444
|
}
|
|
444
|
-
if (
|
|
445
|
-
let e =
|
|
445
|
+
if (K.current === S) return;
|
|
446
|
+
let e = L.current?.querySelector(`[data-row-id="${CSS.escape(S)}"] [data-row-action]`);
|
|
446
447
|
if (e == null) return;
|
|
447
448
|
let t = requestAnimationFrame(() => {
|
|
448
|
-
e.focus({ preventScroll: !0 }),
|
|
449
|
+
e.focus({ preventScroll: !0 }), K.current = S;
|
|
449
450
|
});
|
|
450
451
|
return () => cancelAnimationFrame(t);
|
|
451
|
-
}, [e, S]),
|
|
452
|
-
end:
|
|
452
|
+
}, [e, S]), fe({
|
|
453
|
+
end: R,
|
|
453
454
|
onEndReached: E === void 0 ? O : void 0,
|
|
454
455
|
content: e.length
|
|
455
456
|
}), h(() => {
|
|
456
|
-
let e =
|
|
457
|
+
let e = z.current, t = B.current;
|
|
457
458
|
if (E === void 0 || e === null || t === null) return;
|
|
458
|
-
let n = new ResizeObserver(() =>
|
|
459
|
+
let n = new ResizeObserver(() => U(e.offsetHeight + t.offsetHeight));
|
|
459
460
|
return n.observe(e), n.observe(t), () => n.disconnect();
|
|
460
461
|
}, [
|
|
461
462
|
E,
|
|
462
463
|
C,
|
|
463
464
|
w
|
|
464
465
|
]);
|
|
465
|
-
let Z =
|
|
466
|
+
let Z = ue({
|
|
466
467
|
count: e.length,
|
|
467
468
|
enabled: E !== void 0,
|
|
468
|
-
getScrollElement: () =>
|
|
469
|
+
getScrollElement: () => L.current,
|
|
469
470
|
getItemKey: (t) => {
|
|
470
471
|
let r = e[t];
|
|
471
472
|
if (r === void 0) throw RangeError("The virtual row is outside the supplied table page.");
|
|
472
473
|
return n(r);
|
|
473
474
|
},
|
|
474
475
|
estimateSize: () => T === "fixed" ? u.rowHeight : E?.estimatedRowHeight ?? u.rowHeight,
|
|
475
|
-
scrollMargin:
|
|
476
|
-
scrollPaddingStart:
|
|
476
|
+
scrollMargin: V,
|
|
477
|
+
scrollPaddingStart: V,
|
|
477
478
|
overscan: 6,
|
|
478
479
|
rangeExtractor: (t) => {
|
|
479
|
-
let n =
|
|
480
|
-
return
|
|
480
|
+
let n = le(t);
|
|
481
|
+
return q === -1 ? n : [.../* @__PURE__ */ new Set([
|
|
481
482
|
...n,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
483
|
+
q - 1,
|
|
484
|
+
q,
|
|
485
|
+
q + 1
|
|
485
486
|
])].filter((t) => t >= 0 && t < e.length).toSorted((e, t) => e - t);
|
|
486
487
|
}
|
|
487
|
-
}),
|
|
488
|
+
}), Te = E === void 0 ? M.getRowModel().rows.map((e, t) => ({
|
|
488
489
|
row: e,
|
|
489
490
|
index: t,
|
|
490
491
|
spacerHeight: 0
|
|
@@ -493,7 +494,7 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
493
494
|
return r === void 0 ? [] : [{
|
|
494
495
|
row: r,
|
|
495
496
|
index: e.index,
|
|
496
|
-
spacerHeight: e.start - (n[t - 1]?.end ??
|
|
497
|
+
spacerHeight: e.start - (n[t - 1]?.end ?? V)
|
|
497
498
|
}];
|
|
498
499
|
}), Q = E !== void 0 && (e.length === 0 || Z.range?.endIndex === e.length - 1);
|
|
499
500
|
h(() => {
|
|
@@ -503,43 +504,43 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
503
504
|
O,
|
|
504
505
|
e.length
|
|
505
506
|
]), g(() => {
|
|
506
|
-
if (
|
|
507
|
-
let e = Array.from(
|
|
508
|
-
e != null && (e.focus({ preventScroll: E !== void 0 }),
|
|
507
|
+
if (G.current === void 0) return;
|
|
508
|
+
let e = Array.from(L.current?.querySelectorAll("[data-row-id]") ?? []).find((e) => e.dataset.rowId === G.current)?.querySelector("[data-row-action]");
|
|
509
|
+
e != null && (e.focus({ preventScroll: E !== void 0 }), G.current = void 0);
|
|
509
510
|
});
|
|
510
|
-
function
|
|
511
|
+
function Ee(t, r) {
|
|
511
512
|
let i = t.metaKey || t.ctrlKey, a = t.altKey || t.shiftKey;
|
|
512
513
|
if (i || a) return;
|
|
513
|
-
let o =
|
|
514
|
+
let o = he.get(t.key);
|
|
514
515
|
if (o === void 0) return;
|
|
515
516
|
t.preventDefault();
|
|
516
517
|
let s = r + o, c = e[s];
|
|
517
|
-
c !== void 0 && (
|
|
518
|
+
c !== void 0 && (G.current = n(c), W(G.current), E !== void 0 && Z.scrollToIndex(s, { align: "auto" }));
|
|
518
519
|
}
|
|
519
|
-
let $ = A.filter((e) => !
|
|
520
|
+
let $ = A.filter((e) => !de || e.isSecondary !== !0).length + (c === void 0 ? 0 : 1), De = c === void 0 ? 0 : me, Oe = k != null && typeof k != "boolean", { minimumWidth: ke, compactWidth: Ae } = ye(A, De), je = Z.getTotalSize() - (Z.getVirtualItems().at(-1)?.end ?? V) + V;
|
|
520
521
|
return /* @__PURE__ */ x("div", {
|
|
521
|
-
...p.props(N.frame,
|
|
522
|
+
...p.props(N.frame, _e[X]),
|
|
522
523
|
children: [/* @__PURE__ */ x("div", {
|
|
523
|
-
ref: P,
|
|
524
|
+
ref: P.ref,
|
|
524
525
|
role: "region",
|
|
525
526
|
"aria-label": r,
|
|
526
|
-
tabIndex:
|
|
527
|
+
tabIndex: P.tabIndex,
|
|
527
528
|
...p.props(N.viewport, I[X], typeof E?.height == "number" && N.virtual(E.height)),
|
|
528
529
|
children: [/* @__PURE__ */ x("table", {
|
|
529
530
|
"aria-rowcount": E === void 0 ? void 0 : Math.max(1, e.length) + 1,
|
|
530
|
-
...p.props(N.table, N.fixed, N.minimumWidth(
|
|
531
|
+
...p.props(N.table, N.fixed, N.minimumWidth(ke, Ae)),
|
|
531
532
|
children: [
|
|
532
533
|
/* @__PURE__ */ b("caption", {
|
|
533
|
-
ref:
|
|
534
|
+
ref: z,
|
|
534
535
|
...p.props(N.caption, C && l.hidden),
|
|
535
536
|
children: r
|
|
536
537
|
}),
|
|
537
|
-
/* @__PURE__ */ b(
|
|
538
|
+
/* @__PURE__ */ b(Se, {
|
|
538
539
|
columns: A,
|
|
539
540
|
canSelect: c !== void 0
|
|
540
541
|
}),
|
|
541
542
|
/* @__PURE__ */ b("thead", {
|
|
542
|
-
ref:
|
|
543
|
+
ref: B,
|
|
543
544
|
...p.props(w && l.hidden),
|
|
544
545
|
children: /* @__PURE__ */ x("tr", { children: [c !== void 0 && /* @__PURE__ */ b("th", {
|
|
545
546
|
scope: "col",
|
|
@@ -570,7 +571,7 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
570
571
|
children: [/* @__PURE__ */ b("span", {
|
|
571
572
|
className: "x1lliihq xeuugli xb3r6kr xlyipyv xuxw1ft",
|
|
572
573
|
children: e.label
|
|
573
|
-
}), b(t === "ascending" ?
|
|
574
|
+
}), b(t === "ascending" ? ae : t === "descending" ? ie : oe, {
|
|
574
575
|
size: 14,
|
|
575
576
|
"aria-hidden": "true",
|
|
576
577
|
className: "x2lah0s"
|
|
@@ -584,10 +585,10 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
584
585
|
}),
|
|
585
586
|
/* @__PURE__ */ x("tbody", {
|
|
586
587
|
onBlur: (e) => {
|
|
587
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
588
|
+
e.currentTarget.contains(e.relatedTarget) || W(void 0);
|
|
588
589
|
},
|
|
589
590
|
children: [
|
|
590
|
-
|
|
591
|
+
Te.map(({ row: e, index: t, spacerHeight: n }) => /* @__PURE__ */ x(te, { children: [n > 0 && /* @__PURE__ */ b("tr", {
|
|
591
592
|
"aria-hidden": "true",
|
|
592
593
|
children: /* @__PURE__ */ b("td", {
|
|
593
594
|
colSpan: $,
|
|
@@ -598,7 +599,7 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
598
599
|
"data-row-id": e.id,
|
|
599
600
|
"aria-rowindex": E === void 0 ? void 0 : t + 2,
|
|
600
601
|
ref: E === void 0 || T === "fixed" ? void 0 : Z.measureElement,
|
|
601
|
-
onFocus: () =>
|
|
602
|
+
onFocus: () => W(e.id),
|
|
602
603
|
...{
|
|
603
604
|
0: { className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6" },
|
|
604
605
|
2: { className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6 x1ypdohk x1ecmtor" },
|
|
@@ -617,19 +618,19 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
617
618
|
children: /* @__PURE__ */ b(a.Indicator, {})
|
|
618
619
|
})
|
|
619
620
|
}), A.map((n, r) => /* @__PURE__ */ b("td", {
|
|
620
|
-
...p.props(N.cell,
|
|
621
|
-
children: m !== void 0 && r ===
|
|
621
|
+
...p.props(N.cell, ge[T], F[n.role], n.width !== void 0 && N.width(n.width), n.isSecondary === !0 && N.secondary),
|
|
622
|
+
children: m !== void 0 && r === Y ? /* @__PURE__ */ b(Ce, {
|
|
622
623
|
row: e.original,
|
|
623
624
|
action: m,
|
|
624
625
|
isActive: y === e.id,
|
|
625
|
-
onKeyDown: (e) =>
|
|
626
|
-
children: /* @__PURE__ */ b(
|
|
626
|
+
onKeyDown: (e) => Ee(e, t),
|
|
627
|
+
children: /* @__PURE__ */ b(H, {
|
|
627
628
|
role: n.role,
|
|
628
629
|
isFixed: T === "fixed",
|
|
629
630
|
shouldTruncate: n.shouldTruncate,
|
|
630
631
|
children: n.cell(e.original)
|
|
631
632
|
})
|
|
632
|
-
}) : /* @__PURE__ */ b(
|
|
633
|
+
}) : /* @__PURE__ */ b(H, {
|
|
633
634
|
role: n.role,
|
|
634
635
|
isFixed: T === "fixed",
|
|
635
636
|
shouldTruncate: n.shouldTruncate,
|
|
@@ -637,11 +638,11 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
637
638
|
})
|
|
638
639
|
}, n.id))]
|
|
639
640
|
})] }, e.id)),
|
|
640
|
-
E !== void 0 &&
|
|
641
|
+
E !== void 0 && je > 0 && /* @__PURE__ */ b("tr", {
|
|
641
642
|
"aria-hidden": "true",
|
|
642
643
|
children: /* @__PURE__ */ b("td", {
|
|
643
644
|
colSpan: $,
|
|
644
|
-
...p.props(N.spacer(
|
|
645
|
+
...p.props(N.spacer(je))
|
|
645
646
|
})
|
|
646
647
|
}),
|
|
647
648
|
e.length === 0 && /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
|
|
@@ -653,20 +654,20 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
653
654
|
})
|
|
654
655
|
]
|
|
655
656
|
}), /* @__PURE__ */ b("div", {
|
|
656
|
-
ref:
|
|
657
|
+
ref: R,
|
|
657
658
|
...{
|
|
658
659
|
0: {},
|
|
659
660
|
1: { className: "xid9utz xg7ukam x153jb6y xy8obcc xas2l8k x15x95ik x1az1eml" }
|
|
660
661
|
}[D !== void 0 | 0],
|
|
661
662
|
children: D
|
|
662
663
|
})]
|
|
663
|
-
}),
|
|
664
|
+
}), Oe && /* @__PURE__ */ b("div", {
|
|
664
665
|
className: "xg7ukam x178xt8z x13fuv20 xhjagg4",
|
|
665
666
|
children: k
|
|
666
667
|
})]
|
|
667
668
|
});
|
|
668
669
|
}
|
|
669
|
-
function
|
|
670
|
+
function H({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
|
|
670
671
|
let i = P[e], a = t && i.shouldTruncate, o = typeof r == "string" && (n ?? a);
|
|
671
672
|
return /* @__PURE__ */ b("span", {
|
|
672
673
|
...{
|
|
@@ -689,12 +690,12 @@ function U({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
|
|
|
689
690
|
})
|
|
690
691
|
});
|
|
691
692
|
}
|
|
692
|
-
function
|
|
693
|
+
function U(e) {
|
|
693
694
|
if (e.defaultPrevented || e.button !== 0) return !1;
|
|
694
695
|
let t = e.metaKey || e.ctrlKey, n = e.altKey || e.shiftKey;
|
|
695
696
|
return t || n ? !1 : e.detail === 0 || e.currentTarget.ownerDocument.getSelection()?.isCollapsed !== !1;
|
|
696
697
|
}
|
|
697
|
-
function
|
|
698
|
+
function Ce({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
698
699
|
let a = t.label?.(e), o = t.href === void 0 ? /* @__PURE__ */ b("button", {
|
|
699
700
|
type: "button",
|
|
700
701
|
"aria-label": a,
|
|
@@ -702,7 +703,7 @@ function xe({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
|
702
703
|
"data-row-action": !0,
|
|
703
704
|
onKeyDown: i,
|
|
704
705
|
onClick: (n) => {
|
|
705
|
-
|
|
706
|
+
U(n) && t.onActivate(e);
|
|
706
707
|
},
|
|
707
708
|
className: "x1rh3ycu x1hx0egp x78zum5 x6s0dn4 xh8yej3 xeuugli x17tes2r x17oiadl x1717udv xc342km x1ok0vyi x1heor9g xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x16tdsg8 x1hl2dhg x1ypdohk x1t137rt x1s928wv x1j6awrg xarstr8 x11q50lq xa2q2qx x1x5eltu x1jdy9wv",
|
|
708
709
|
children: r
|
|
@@ -712,7 +713,7 @@ function xe({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
|
712
713
|
"data-row-action": !0,
|
|
713
714
|
onKeyDown: i,
|
|
714
715
|
onClick: (n) => {
|
|
715
|
-
t.onActivate !== void 0 &&
|
|
716
|
+
t.onActivate !== void 0 && U(n) && (n.preventDefault(), t.onActivate(e));
|
|
716
717
|
},
|
|
717
718
|
className: "x1rh3ycu x1hx0egp x78zum5 x6s0dn4 xh8yej3 xeuugli x17tes2r x17oiadl x1717udv xc342km x1ok0vyi x1heor9g xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x16tdsg8 x1hl2dhg x1ypdohk x1t137rt x1s928wv x1j6awrg xarstr8 x11q50lq xa2q2qx x1x5eltu x1jdy9wv",
|
|
718
719
|
children: r
|
|
@@ -724,7 +725,7 @@ function xe({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
|
724
725
|
}) })] });
|
|
725
726
|
}
|
|
726
727
|
// packages/collections/src/collection-scroll.tsx
|
|
727
|
-
function
|
|
728
|
+
function we(r) {
|
|
728
729
|
switch (r.status) {
|
|
729
730
|
case "loading": return /* @__PURE__ */ b(t, {
|
|
730
731
|
role: "status",
|
|
@@ -754,16 +755,16 @@ function G(r) {
|
|
|
754
755
|
});
|
|
755
756
|
}
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
-
let o =
|
|
759
|
-
|
|
760
|
-
end:
|
|
761
|
-
viewport: r ?
|
|
758
|
+
function W({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, endPosition: i = "end", label: a = "Collection" }) {
|
|
759
|
+
let o = ee(), s = o.viewport, c = _(null);
|
|
760
|
+
fe({
|
|
761
|
+
end: c,
|
|
762
|
+
viewport: r ? s : void 0,
|
|
762
763
|
onEndReached: n,
|
|
763
764
|
content: e
|
|
764
765
|
});
|
|
765
|
-
let
|
|
766
|
-
ref:
|
|
766
|
+
let l = /* @__PURE__ */ b("div", {
|
|
767
|
+
ref: c,
|
|
767
768
|
...{
|
|
768
769
|
0: {},
|
|
769
770
|
1: { className: "x15x95ik x1az1eml xid9utz x1c8xbx5 x153jb6y xy8obcc x1hz01jw xas2l8k x2b8uid" }
|
|
@@ -771,27 +772,27 @@ function K({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, en
|
|
|
771
772
|
children: t
|
|
772
773
|
});
|
|
773
774
|
return /* @__PURE__ */ x("div", {
|
|
774
|
-
ref: o,
|
|
775
|
+
ref: o.ref,
|
|
775
776
|
role: r ? "region" : void 0,
|
|
776
777
|
"aria-label": r ? a : void 0,
|
|
777
|
-
tabIndex:
|
|
778
|
+
tabIndex: o.tabIndex,
|
|
778
779
|
...{
|
|
779
780
|
0: { className: "xeuugli" },
|
|
780
781
|
1: { className: "xeuugli x98rzlu x2lwn1j x1odjw0f x1e4zzel x1t137rt x13qnu6 x9v5kkp x19rmrnh x1bqaal" }
|
|
781
782
|
}[!!r | 0],
|
|
782
783
|
children: [
|
|
783
|
-
i === "start" &&
|
|
784
|
+
i === "start" && l,
|
|
784
785
|
e,
|
|
785
|
-
i === "end" &&
|
|
786
|
+
i === "end" && l
|
|
786
787
|
]
|
|
787
788
|
});
|
|
788
789
|
}
|
|
789
790
|
// packages/collections/src/inspector.tsx
|
|
790
|
-
var
|
|
791
|
-
function
|
|
791
|
+
var G = 860;
|
|
792
|
+
function K({ master: t, detail: n, label: r, masterLabel: i, revealKey: a, returnFocusRef: o, ...s }) {
|
|
792
793
|
let c = _(null), l = _(null), u = _(null);
|
|
793
794
|
g(() => {
|
|
794
|
-
a !== void 0 && c.current !== null && u.current !== null && c.current.clientWidth <=
|
|
795
|
+
a !== void 0 && c.current !== null && u.current !== null && c.current.clientWidth <= G && (u.current.focus({ preventScroll: !0 }), u.current.scrollIntoView({
|
|
795
796
|
block: "start",
|
|
796
797
|
behavior: "instant"
|
|
797
798
|
}));
|
|
@@ -832,7 +833,7 @@ function J({ master: t, detail: n, label: r, masterLabel: i, revealKey: a, retur
|
|
|
832
833
|
})
|
|
833
834
|
});
|
|
834
835
|
}
|
|
835
|
-
function
|
|
836
|
+
function q({ items: e, ...t }) {
|
|
836
837
|
return /* @__PURE__ */ b("dl", {
|
|
837
838
|
...f({ className: "x1ghz6dp xrvj5dj xezdspq x1i3977y xuytk5h x1hz01jw xvmahel xtqrqnz x1778rvt" }, t),
|
|
838
839
|
children: e.map(({ label: e, value: t }) => /* @__PURE__ */ x("div", {
|
|
@@ -848,7 +849,7 @@ function Y({ items: e, ...t }) {
|
|
|
848
849
|
});
|
|
849
850
|
}
|
|
850
851
|
// packages/collections/src/list-footer.tsx
|
|
851
|
-
function
|
|
852
|
+
function J({ children: e, actions: t, ...n }) {
|
|
852
853
|
return /* @__PURE__ */ x("div", {
|
|
853
854
|
...f({ className: "x78zum5 x6s0dn4 x1qughib x1a02dak xeuugli x1n8ia3y x1qokhjc x1m92p3w x178xt8z x13fuv20 xhjagg4 x153jb6y x1hz01jw xvmahel xtqrqnz x1778rvt" }, n),
|
|
854
855
|
children: [/* @__PURE__ */ b("div", {
|
|
@@ -861,7 +862,7 @@ function Se({ children: e, actions: t, ...n }) {
|
|
|
861
862
|
});
|
|
862
863
|
}
|
|
863
864
|
// packages/collections/src/metrics.tsx
|
|
864
|
-
var
|
|
865
|
+
var Y = {
|
|
865
866
|
grid: {
|
|
866
867
|
k1xSpc: "x78zum5",
|
|
867
868
|
kwnvtZ: "x1a02dak",
|
|
@@ -878,28 +879,137 @@ var X = {
|
|
|
878
879
|
k7Eaqz: "xeuugli",
|
|
879
880
|
kogj98: "x1ghz6dp",
|
|
880
881
|
$$css: !0
|
|
882
|
+
},
|
|
883
|
+
metric: {
|
|
884
|
+
k1xSpc: "x3nfvp2",
|
|
885
|
+
kGNEyG: "x1pha0wt",
|
|
886
|
+
kwnvtZ: "x1a02dak",
|
|
887
|
+
kOIVth: "xunmzkg",
|
|
888
|
+
k7Eaqz: "xeuugli",
|
|
889
|
+
kMv6JI: "x1hz01jw",
|
|
890
|
+
khiITx: "xvmahel",
|
|
891
|
+
kGuDYH: "xtqrqnz",
|
|
892
|
+
kLWn49: "x1778rvt",
|
|
893
|
+
$$css: !0
|
|
894
|
+
},
|
|
895
|
+
label: {
|
|
896
|
+
k7Eaqz: "xeuugli",
|
|
897
|
+
kMwMTN: "x153jb6y",
|
|
898
|
+
kayTVb: "x9ek82g",
|
|
899
|
+
kHjlTd: "xj0a0fe",
|
|
900
|
+
$$css: !0
|
|
901
|
+
},
|
|
902
|
+
value: {
|
|
903
|
+
k7Eaqz: "xeuugli",
|
|
904
|
+
kogj98: "x1ghz6dp",
|
|
905
|
+
kMwMTN: "xbixft",
|
|
906
|
+
k63SB2: "xk4h15q",
|
|
907
|
+
kcqcaj: "xss6m8b",
|
|
908
|
+
kHjlTd: "xj0a0fe",
|
|
909
|
+
$$css: !0
|
|
910
|
+
},
|
|
911
|
+
statistic: {
|
|
912
|
+
kXwgrk: "xdt5ytf",
|
|
913
|
+
kGNEyG: "x1cy8zhl",
|
|
914
|
+
$$css: !0
|
|
915
|
+
},
|
|
916
|
+
stackedLabel: {
|
|
917
|
+
kayTVb: "x1g77sc7",
|
|
918
|
+
$$css: !0
|
|
919
|
+
},
|
|
920
|
+
statisticValue: {
|
|
921
|
+
kGuDYH: "x71lla1",
|
|
922
|
+
kLWn49: "xgkpprq",
|
|
923
|
+
k63SB2: "x1b5ytql",
|
|
924
|
+
kb6lSQ: "x1wjjqco",
|
|
925
|
+
$$css: !0
|
|
926
|
+
},
|
|
927
|
+
headline: {
|
|
928
|
+
k1C7PZ: "xa2sdi0",
|
|
929
|
+
$$css: !0
|
|
930
|
+
},
|
|
931
|
+
headlineLabel: {
|
|
932
|
+
kayTVb: "x1g77sc7",
|
|
933
|
+
kCS8Yb: "x1l7klhg",
|
|
934
|
+
kGuDYH: "xy8obcc",
|
|
935
|
+
$$css: !0
|
|
936
|
+
},
|
|
937
|
+
headlineValue: {
|
|
938
|
+
kGuDYH: "xc0f4dz",
|
|
939
|
+
kLWn49: "xzju6ct",
|
|
940
|
+
k63SB2: "xtjd4bd",
|
|
941
|
+
kb6lSQ: "x1wjjqco",
|
|
942
|
+
$$css: !0
|
|
943
|
+
},
|
|
944
|
+
detail: {
|
|
945
|
+
k7Eaqz: "xeuugli",
|
|
946
|
+
kogj98: "x1ghz6dp",
|
|
947
|
+
kMwMTN: "x153jb6y",
|
|
948
|
+
kGuDYH: "xy8obcc",
|
|
949
|
+
kLWn49: "xas2l8k",
|
|
950
|
+
kAzted: "x1mqbd49",
|
|
951
|
+
kHjlTd: "xj0a0fe",
|
|
952
|
+
$$css: !0
|
|
953
|
+
},
|
|
954
|
+
inlineDetail: {
|
|
955
|
+
kCS8Yb: "x1l7klhg",
|
|
956
|
+
$$css: !0
|
|
957
|
+
}
|
|
958
|
+
}, X = {
|
|
959
|
+
inline: {
|
|
960
|
+
metric: void 0,
|
|
961
|
+
label: void 0,
|
|
962
|
+
value: void 0,
|
|
963
|
+
detail: Y.inlineDetail,
|
|
964
|
+
valueWidth: "5ch"
|
|
965
|
+
},
|
|
966
|
+
statistic: {
|
|
967
|
+
metric: Y.statistic,
|
|
968
|
+
label: Y.stackedLabel,
|
|
969
|
+
value: Y.statisticValue,
|
|
970
|
+
detail: void 0,
|
|
971
|
+
valueWidth: "5ch"
|
|
972
|
+
},
|
|
973
|
+
headline: {
|
|
974
|
+
metric: Y.headline,
|
|
975
|
+
label: Y.headlineLabel,
|
|
976
|
+
value: Y.headlineValue,
|
|
977
|
+
detail: void 0,
|
|
978
|
+
valueWidth: "9ch"
|
|
881
979
|
}
|
|
882
980
|
}, Z = {
|
|
883
|
-
inline:
|
|
884
|
-
columns:
|
|
981
|
+
inline: Y.grid,
|
|
982
|
+
columns: Y.columns
|
|
885
983
|
};
|
|
886
|
-
function
|
|
984
|
+
function Te({ layout: e = "inline", ...t }) {
|
|
887
985
|
return /* @__PURE__ */ b("dl", { ...f(p.props(Z[e]), t) });
|
|
888
986
|
}
|
|
889
|
-
function Q({ label: e, value: t,
|
|
987
|
+
function Q({ label: e, value: t, detail: n, isLoading: r = !1, hasDetail: i = !1, variant: a = "inline", trend: o, ...s }) {
|
|
988
|
+
let l = X[a];
|
|
890
989
|
return /* @__PURE__ */ x("div", {
|
|
891
|
-
...f(
|
|
892
|
-
children: [
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
990
|
+
...f(p.props(Y.metric, l.metric), s),
|
|
991
|
+
children: [
|
|
992
|
+
/* @__PURE__ */ b("dt", {
|
|
993
|
+
...p.props(Y.label, l.label),
|
|
994
|
+
children: e
|
|
995
|
+
}),
|
|
996
|
+
/* @__PURE__ */ b("dd", {
|
|
997
|
+
...p.props(Y.value, l.value),
|
|
998
|
+
children: r ? /* @__PURE__ */ b(c, { width: l.valueWidth }) : t
|
|
999
|
+
}),
|
|
1000
|
+
(r ? i : n !== void 0) && /* @__PURE__ */ b("dd", {
|
|
1001
|
+
...p.props(Y.detail, l.detail),
|
|
1002
|
+
children: r ? /* @__PURE__ */ b(c, { width: "24ch" }) : n
|
|
1003
|
+
}),
|
|
1004
|
+
o !== void 0 && /* @__PURE__ */ b("dd", {
|
|
1005
|
+
className: "x1ghz6dp xeuugli xh8yej3 xkh2ocl",
|
|
1006
|
+
children: o
|
|
1007
|
+
})
|
|
1008
|
+
]
|
|
899
1009
|
});
|
|
900
1010
|
}
|
|
901
1011
|
// packages/collections/src/timestamp.tsx
|
|
902
|
-
function
|
|
1012
|
+
function Ee({ dateTime: e, label: t, title: n }) {
|
|
903
1013
|
return n === void 0 ? /* @__PURE__ */ b("time", {
|
|
904
1014
|
dateTime: e,
|
|
905
1015
|
className: "x1hz01jw xy8obcc xas2l8k x153jb6y xss6m8b xj0a0fe x13qnu6 x9v5kkp x19rmrnh x7s97pk",
|
|
@@ -922,7 +1032,7 @@ function $({ label: e, children: t }) {
|
|
|
922
1032
|
children: t
|
|
923
1033
|
});
|
|
924
1034
|
}
|
|
925
|
-
function
|
|
1035
|
+
function De({ icon: e, title: t, time: n, metadata: i, children: a, details: o, defaultOpen: s = !1 }) {
|
|
926
1036
|
let [c, l] = v(s), u = /* @__PURE__ */ x("div", {
|
|
927
1037
|
className: "x78zum5 x1pha0wt x1hnptsi x1a02dak xeuugli",
|
|
928
1038
|
children: [/* @__PURE__ */ b("div", {
|
|
@@ -964,8 +1074,8 @@ function Te({ icon: e, title: t, time: n, metadata: i, children: a, details: o,
|
|
|
964
1074
|
})]
|
|
965
1075
|
});
|
|
966
1076
|
}
|
|
967
|
-
var
|
|
1077
|
+
var Oe = {
|
|
968
1078
|
Root: $,
|
|
969
|
-
Item:
|
|
1079
|
+
Item: De
|
|
970
1080
|
};
|
|
971
|
-
export {
|
|
1081
|
+
export { we as CollectionEnd, de as CollectionPagination, W as CollectionScroll, O as CollectionToolbar, V as DataTable, L as DataTablePlaceholder, z as DataTableText, B as DataTableTextPlaceholder, q as Details, A as DisplayOptions, k as FilterChips, K as Inspector, J as ListFooter, Q as Metric, Te as MetricGrid, Oe as Timeline, Ee as Timestamp };
|