@mechane-ai/elements 0.64.0 → 0.67.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 +39 -27
- package/dist/ai.js +285 -203
- package/dist/{article-BopqPz1K.js → article-anMy8fA5.js} +6 -6
- package/dist/article.js +1 -1
- package/dist/catalog.json +137 -46
- package/dist/{categorical-values-8LA9KXhi.js → categorical-values-Bh7ZkEQn.js} +1 -1
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +3 -3
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +2 -2
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +2 -2
- package/dist/{code-block-BjQUIvvw.js → code-block-DbW_t9U4.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/{commands-BI9rWGpb.js → commands-C7Zrp-tG.js} +2 -2
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-C3RAJ2kP.js → content-link-BN4NPp0u.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-D1v_jiva.js → dates-OTq-xU33.js} +2 -2
- package/dist/{dumbbell-plot-QGjFMk0X.js → dumbbell-plot-BQDGe0sQ.js} +3 -3
- package/dist/{embedding-map-D_RNxsCD.js → embedding-map-DmmknG7A.js} +6 -6
- package/dist/feedback.js +1 -1
- package/dist/{figure-frame-CF3298LZ.js → figure-frame-DlyNTDzh.js} +22 -21
- package/dist/forms/dates.js +1 -1
- package/dist/{forms-DlKhXUlc.js → forms-iAOjGRTO.js} +1 -1
- package/dist/forms.js +2 -2
- package/dist/{image-grid-BXsgVBnB.js → image-grid-CxEAQvTf.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +13 -13
- package/dist/kits/interpretability.js +47 -43
- package/dist/kits/operations.js +80 -79
- package/dist/kits/research.js +364 -520
- package/dist/kits/training.js +108 -107
- package/dist/layout.js +1 -1
- package/dist/lesson.js +3 -3
- package/dist/{markdown-B92daSMP.js → markdown-Diffqqm7.js} +2 -2
- package/dist/mdx.js +6 -6
- package/dist/navigation/commands.js +1 -1
- package/dist/{navigation-D3vnWiVv.js → navigation-CTnYtVD8.js} +1 -1
- package/dist/navigation.js +4 -4
- package/dist/packages/ai/src/index.d.ts +2 -0
- package/dist/packages/ai/src/message-reactions.d.ts +51 -0
- package/dist/packages/ai/src/message.d.ts +3 -1
- package/dist/packages/collections/src/card-columns-model.d.ts +50 -0
- package/dist/packages/collections/src/card-columns.d.ts +30 -0
- package/dist/packages/collections/src/collection-page.d.ts +43 -0
- package/dist/packages/collections/src/column-card.d.ts +15 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +2 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +4 -3
- package/dist/packages/collections/src/data-table.d.ts +2 -2
- package/dist/packages/collections/src/index.d.ts +5 -0
- package/dist/packages/collections/src/table-query.d.ts +13 -4
- package/dist/packages/collections/src/use-collection-controls.d.ts +6 -0
- package/dist/packages/feedback/src/feedback.d.ts +0 -4
- package/dist/packages/feedback/src/index.d.ts +1 -1
- package/dist/packages/kits/src/research/index.d.ts +0 -2
- package/dist/packages/layout/src/app-shell.d.ts +3 -1
- package/dist/packages/layout/src/index.d.ts +4 -4
- package/dist/packages/layout/src/page-inset.d.ts +5 -0
- package/dist/packages/layout/src/page-layout.d.ts +4 -9
- package/dist/packages/layout/src/page-toolbar.d.ts +1 -2
- package/dist/packages/layout/src/reading-column.d.ts +4 -0
- package/dist/packages/layout/src/record-page.d.ts +4 -6
- package/dist/packages/layout/src/sidebar.d.ts +3 -1
- package/dist/packages/layout/src/workbench.d.ts +2 -6
- package/dist/packages/navigation/src/current-page-click.d.ts +3 -0
- package/dist/packages/navigation/src/index.d.ts +1 -0
- package/dist/{param-DfOYi9wL.js → param-CKr8EYxF.js} +1 -1
- package/dist/{pierre-diff-DP_TXXIt.js → pierre-diff-DXVIwW7o.js} +1 -1
- package/dist/{plot-layout-BfXmAi71.js → plot-layout-CVzSbcU7.js} +24 -23
- package/dist/{plot-surface-UQgDiTVe.js → plot-surface-CBhI1alw.js} +1 -1
- package/dist/{reference-lines-BRHB78Wb.js → reference-lines-C970JwWZ.js} +1 -1
- package/dist/{scene-DlVQupfw.js → scene-C3dCxckI.js} +6 -6
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-CjXcvoRJ.js → slope-chart-DekEJxsy.js} +4 -4
- package/dist/{src-DojhQZKX.js → src-BCAelv4f.js} +376 -399
- package/dist/{src-BYmv3_AL.js → src-Bkov5TTa.js} +204 -191
- package/dist/{src-BdQGb362.js → src-BsqbWDxS.js} +4 -4
- package/dist/{src-DPcnDU5H.js → src-CIyuaSCi.js} +101 -107
- package/dist/src-Dc1t1ugL.js +2612 -0
- package/dist/{src-BYnmQkDq.js → src-DceyVyL0.js} +2 -2
- package/dist/{src-BI1xQE7D.js → src-Dlh99sPD.js} +46 -32
- package/dist/styles2.css +35 -41
- package/dist/{time-series-Dg3DZRGx.js → time-series-BSNnijxf.js} +8 -8
- package/dist/{timeline-C2IVroD3.js → timeline-CnxfYSIg.js} +4 -4
- package/dist/{token-heatmap-CZtIPU60.js → token-heatmap-CJaXo56P.js} +3 -3
- package/dist/{token-predictions-BJ5L-Lrm.js → token-predictions-Bi7aKPnh.js} +3 -3
- package/dist/{transport-D9e0H2we.js → transport-CXj0DV6o.js} +4 -4
- package/dist/{tree-diagram-DRAJiqjW.js → tree-diagram-BxOZsjr1.js} +4 -4
- package/dist/{treemap-BdELCV7E.js → treemap-B2yOAetT.js} +4 -4
- package/dist/{use-tween-COV8bEYL.js → use-tween-C1TWJwce.js} +1 -1
- package/dist/{violin-plot-DuxqWnuD.js → violin-plot-W2L_2JRo.js} +3 -3
- package/dist/{waterfall-D4ewGb4u.js → waterfall-Bt73N2Ng.js} +4 -4
- package/package.json +1 -1
- package/recipes/allocation-report.tsx +4 -4
- package/recipes/calendar-workspace.tsx +14 -10
- package/recipes/consequential-form.tsx +4 -4
- package/recipes/searchable-collection.tsx +66 -58
- package/recipes/sectioned-report.tsx +17 -18
- package/recipes/session-timeline.tsx +59 -0
- package/recipes/tabbed-workspace.tsx +7 -8
- package/recipes/workspace-files.tsx +94 -0
- package/recipes/workspace-report.tsx +130 -0
- package/skills/extend-elements/SKILL.md +21 -0
- package/skills/review-elements/SKILL.md +20 -13
- package/skills/upgrade-elements/SKILL.md +3 -1
- package/skills/upgrade-elements/references/releases.md +36 -0
- package/skills/use-elements/SKILL.md +13 -7
- package/skills/use-elements/references/collections.md +67 -14
- package/skills/use-elements/references/conversations.md +32 -0
- package/skills/use-elements/references/editorial-restraint.md +17 -34
- package/skills/use-elements/references/figures.md +6 -2
- package/skills/use-elements/references/reports.md +4 -1
- package/skills/use-elements/references/workspace.md +18 -14
- package/dist/packages/kits/src/research/collection-page.d.ts +0 -72
- package/dist/packages/layout/src/detail-page.d.ts +0 -9
- package/dist/packages/layout/src/page-content.d.ts +0 -5
- package/dist/src-P19zz_aO.js +0 -2235
|
@@ -0,0 +1,2612 @@
|
|
|
1
|
+
import { E as e, O as t, c as n, i as r, j as i, l as a, m as o, u as s, v as c } from "./src-Bkov5TTa.js";
|
|
2
|
+
import { d as l, t as u } from "./src-CIyuaSCi.js";
|
|
3
|
+
import { _ as d, n as f } from "./src-BCAelv4f.js";
|
|
4
|
+
import { i as p, r as m, t as h } from "./src-na2DdkKI.js";
|
|
5
|
+
import { c as g } from "./src-DceyVyL0.js";
|
|
6
|
+
import { t as _ } from "./accessibility-P89UG9-r.js";
|
|
7
|
+
import { l as v, t as y } from "./constants.stylex-CqhVl0uU.js";
|
|
8
|
+
import { t as b } from "./use-scroll-tab-index-Dxpdh4W7.js";
|
|
9
|
+
import { n as x } from "./forms-iAOjGRTO.js";
|
|
10
|
+
import * as S from "@stylexjs/stylex";
|
|
11
|
+
import { Button as C } from "@ui-sdk/react/button";
|
|
12
|
+
import { createParts as w, mergeProps as T, usePart as E, usePrimitive as D } from "@ui-sdk/react/primitive";
|
|
13
|
+
import { Children as O, Fragment as ee, createContext as k, useContext as A, useEffect as j, useId as M, useLayoutEffect as N, useMemo as P, useRef as F, useState as I, useSyncExternalStore as te } from "react";
|
|
14
|
+
import { byCell as ne, createChange as re, createGridFocus as ie, createSelection as ae, createVirtualizer as oe, definePrimitive as L, dispatch as R, selects as se } from "@ui-sdk/core";
|
|
15
|
+
import { Fragment as ce, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
16
|
+
import { ArrowDown as le, ArrowRightLeft as ue, ArrowUp as V, ArrowUpDown as de, ChevronLeft as fe, ChevronRight as H, CircleAlert as pe, CircleDashed as me, ListFilter as U, Search as he, Settings2 as W, X as ge } from "lucide-react";
|
|
17
|
+
import { useShortcut as _e } from "@ui-sdk/react/shortcuts";
|
|
18
|
+
import { Toolbar as ve, ToolbarButton as G, ToolbarGroup as ye, ToolbarInput as K } from "@ui-sdk/react/toolbar";
|
|
19
|
+
import { createColumnHelper as be, tableFeatures as xe, useTable as Se } from "@tanstack/react-table";
|
|
20
|
+
import { Timeline as Ce, TimelineDescription as we, TimelineItem as Te, TimelineMarker as Ee, TimelineTime as De, TimelineTitle as Oe } from "@ui-sdk/react/timeline";
|
|
21
|
+
// packages/collections/src/control-toolbar.tsx
|
|
22
|
+
var ke = k(!1);
|
|
23
|
+
function Ae(e) {
|
|
24
|
+
return A(ke) ? /* @__PURE__ */ z(ye, { ...e }) : /* @__PURE__ */ z(ke, {
|
|
25
|
+
value: !0,
|
|
26
|
+
children: /* @__PURE__ */ z(ve, { ...e })
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function je(e) {
|
|
30
|
+
return A(ke) ? /* @__PURE__ */ z(G, { render: e }) : e;
|
|
31
|
+
}
|
|
32
|
+
// packages/collections/src/collection-controls.tsx
|
|
33
|
+
var Me = {
|
|
34
|
+
toolbar: {
|
|
35
|
+
kOIVth: "x1hnptsi",
|
|
36
|
+
kMwMTN: "xbixft",
|
|
37
|
+
kMv6JI: "x1hz01jw",
|
|
38
|
+
kGuDYH: "xtqrqnz",
|
|
39
|
+
kLWn49: "x1778rvt",
|
|
40
|
+
kbsrmU: "xjl7jj",
|
|
41
|
+
$$css: !0
|
|
42
|
+
},
|
|
43
|
+
remove: {
|
|
44
|
+
kmuXW: "x2lah0s",
|
|
45
|
+
$$css: !0
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
function q({ label: e, children: t, actions: n }) {
|
|
49
|
+
let r = O.toArray(t).length > 0, i = O.toArray(n).length > 0;
|
|
50
|
+
return !r && !i ? null : /* @__PURE__ */ B(Ae, {
|
|
51
|
+
"aria-label": e,
|
|
52
|
+
...S.props(s.row, s.blockEnd, Me.toolbar),
|
|
53
|
+
children: [t, i && /* @__PURE__ */ z("div", {
|
|
54
|
+
className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli xvc5jky",
|
|
55
|
+
children: n
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function Ne({ filters: e, onRemove: n, label: r = "Applied filters" }) {
|
|
60
|
+
return e.length === 0 ? null : /* @__PURE__ */ z(Ae, {
|
|
61
|
+
"aria-label": r,
|
|
62
|
+
className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli",
|
|
63
|
+
children: e.map((e) => /* @__PURE__ */ B("span", {
|
|
64
|
+
className: "x1n2onr6 x9f619 x3nfvp2 x6s0dn4 xunmzkg x1f9pz31 x992rv9 xyibt8p x1ok0vyi xeuugli x193iq5w xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt x1s928wv x1j6awrg xarstr8 x5hscyn x86avzo x10z0kkz x1k48kgn x2q1x1w",
|
|
65
|
+
children: [/* @__PURE__ */ z("span", {
|
|
66
|
+
title: e.label,
|
|
67
|
+
className: "xeuugli xb3r6kr xlyipyv xuxw1ft",
|
|
68
|
+
children: e.label
|
|
69
|
+
}), /* @__PURE__ */ z(G, {
|
|
70
|
+
render: /* @__PURE__ */ z(t, {
|
|
71
|
+
"aria-label": `Remove ${e.label}`,
|
|
72
|
+
variant: "ghost",
|
|
73
|
+
xstyle: Me.remove
|
|
74
|
+
}),
|
|
75
|
+
onClick: (t) => {
|
|
76
|
+
R({ options: () => ({ onRemove: n }) }, "onRemove", e.id, {
|
|
77
|
+
reason: "remove-press",
|
|
78
|
+
event: t.nativeEvent
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
children: /* @__PURE__ */ z(ge, {
|
|
82
|
+
size: 14,
|
|
83
|
+
"aria-hidden": "true"
|
|
84
|
+
})
|
|
85
|
+
})]
|
|
86
|
+
}, e.id))
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function Pe({ options: n, onChange: r, onReset: i, label: a = "Display options" }) {
|
|
90
|
+
let o = je(/* @__PURE__ */ z(t, {
|
|
91
|
+
"aria-label": a,
|
|
92
|
+
title: a
|
|
93
|
+
}));
|
|
94
|
+
return /* @__PURE__ */ B(m.Root, { children: [/* @__PURE__ */ z(m.Trigger, {
|
|
95
|
+
render: o,
|
|
96
|
+
children: /* @__PURE__ */ z(W, {
|
|
97
|
+
size: 14,
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
})
|
|
100
|
+
}), /* @__PURE__ */ B(m.Popup, {
|
|
101
|
+
align: "end",
|
|
102
|
+
children: [/* @__PURE__ */ z(m.Title, { children: "Display" }), /* @__PURE__ */ B("div", {
|
|
103
|
+
className: "xrvj5dj x1n8ia3y xfb3i0g",
|
|
104
|
+
children: [n.map((e) => /* @__PURE__ */ B("label", {
|
|
105
|
+
className: "x78zum5 x6s0dn4 x1hnptsi xbixft xtqrqnz x1hz01jw x1778rvt xeuugli xj0a0fe",
|
|
106
|
+
children: [/* @__PURE__ */ z(g.Root, {
|
|
107
|
+
checked: e.isChecked,
|
|
108
|
+
onCheckedChange: (t) => r(e.id, t),
|
|
109
|
+
disabled: e.isRequired === !0,
|
|
110
|
+
children: /* @__PURE__ */ z(g.Indicator, {})
|
|
111
|
+
}), e.label]
|
|
112
|
+
}, e.id)), i !== void 0 && /* @__PURE__ */ z(e, {
|
|
113
|
+
type: "button",
|
|
114
|
+
variant: "ghost",
|
|
115
|
+
onClick: i,
|
|
116
|
+
children: "Reset defaults"
|
|
117
|
+
})]
|
|
118
|
+
})]
|
|
119
|
+
})] });
|
|
120
|
+
}
|
|
121
|
+
function Fe({ label: t, description: r, previous: i, next: a }) {
|
|
122
|
+
return /* @__PURE__ */ B("nav", {
|
|
123
|
+
"aria-label": t === void 0 ? "Pagination" : `${t} pagination`,
|
|
124
|
+
className: "x78zum5 x6s0dn4 x1qughib x1a02dak xaml1ju xeuugli",
|
|
125
|
+
children: [/* @__PURE__ */ z(n, { children: r }), /* @__PURE__ */ B("div", {
|
|
126
|
+
className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli xvc5jky",
|
|
127
|
+
children: [/* @__PURE__ */ B(e, {
|
|
128
|
+
variant: "outline",
|
|
129
|
+
"aria-label": t === void 0 ? void 0 : `Previous page of ${t}`,
|
|
130
|
+
disabled: i.disabled,
|
|
131
|
+
onClick: i.onClick,
|
|
132
|
+
children: [/* @__PURE__ */ z(fe, {
|
|
133
|
+
size: 16,
|
|
134
|
+
"aria-hidden": "true"
|
|
135
|
+
}), "Previous"]
|
|
136
|
+
}), /* @__PURE__ */ B(e, {
|
|
137
|
+
variant: "outline",
|
|
138
|
+
"aria-label": t === void 0 ? void 0 : `Next page of ${t}`,
|
|
139
|
+
disabled: a.disabled,
|
|
140
|
+
onClick: a.onClick,
|
|
141
|
+
children: ["Next", /* @__PURE__ */ z(H, {
|
|
142
|
+
size: 16,
|
|
143
|
+
"aria-hidden": "true"
|
|
144
|
+
})]
|
|
145
|
+
})]
|
|
146
|
+
})]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
// packages/collections/src/data-table-styles.ts
|
|
150
|
+
var Ie = {
|
|
151
|
+
kmVPX3: "x1717udv",
|
|
152
|
+
kMzoRj: "xc342km",
|
|
153
|
+
$$css: !0
|
|
154
|
+
}, Le = {
|
|
155
|
+
kVAEAm: "x10l6tqk",
|
|
156
|
+
k87sOh: "x13vifvy",
|
|
157
|
+
kLqNvP: "x1o0tod",
|
|
158
|
+
kzqmXN: "x1i1rx1s",
|
|
159
|
+
k33iCy: "xlshs6z",
|
|
160
|
+
kfzvcC: "x47corl",
|
|
161
|
+
$$css: !0
|
|
162
|
+
}, J = {
|
|
163
|
+
frame: {
|
|
164
|
+
k7Eaqz: "xeuugli",
|
|
165
|
+
kMv6JI: "x1hz01jw",
|
|
166
|
+
kGuDYH: "xtqrqnz",
|
|
167
|
+
kLWn49: "x1778rvt",
|
|
168
|
+
k63SB2: "xj57cvi",
|
|
169
|
+
kMwMTN: "xbixft",
|
|
170
|
+
khiITx: "xvmahel",
|
|
171
|
+
$$css: !0
|
|
172
|
+
},
|
|
173
|
+
content: { $$css: !0 },
|
|
174
|
+
placeholder: {
|
|
175
|
+
kfzvcC: "x47corl",
|
|
176
|
+
$$css: !0
|
|
177
|
+
},
|
|
178
|
+
fillFrame: {
|
|
179
|
+
k1xSpc: "x78zum5",
|
|
180
|
+
kXwgrk: "xdt5ytf",
|
|
181
|
+
kUk6DE: "x98rzlu",
|
|
182
|
+
kAzted: "x2lwn1j",
|
|
183
|
+
$$css: !0
|
|
184
|
+
},
|
|
185
|
+
viewport: {
|
|
186
|
+
kVAEAm: "x1n2onr6",
|
|
187
|
+
k7Eaqz: "xeuugli",
|
|
188
|
+
k9g6sI: "x12h1iku",
|
|
189
|
+
kVQacm: "xysyzu8",
|
|
190
|
+
kacamN: "xy5w88m",
|
|
191
|
+
k3XXqK: "x1t137rt",
|
|
192
|
+
kPJHz1: "x13qnu6",
|
|
193
|
+
k7shQP: "x9v5kkp",
|
|
194
|
+
kZs9gx: "x19rmrnh",
|
|
195
|
+
kiEn40: "x1bqaal",
|
|
196
|
+
$$css: !0
|
|
197
|
+
},
|
|
198
|
+
fillViewport: {
|
|
199
|
+
kUk6DE: "x98rzlu",
|
|
200
|
+
kAzted: "x2lwn1j",
|
|
201
|
+
$$css: !0
|
|
202
|
+
},
|
|
203
|
+
virtual: (e) => [{
|
|
204
|
+
kskxy: e == null ? e : "x1jols5v",
|
|
205
|
+
$$css: !0
|
|
206
|
+
}, { "--x-maxHeight": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }],
|
|
207
|
+
table: {
|
|
208
|
+
kzqmXN: "xh8yej3",
|
|
209
|
+
kLvRdT: "x1mwwwfo",
|
|
210
|
+
kcqcaj: "xss6m8b",
|
|
211
|
+
k9WMMc: "xdpxx8g",
|
|
212
|
+
kMwMTN: "xbixft",
|
|
213
|
+
kWkggS: "xpvm0e4",
|
|
214
|
+
$$css: !0
|
|
215
|
+
},
|
|
216
|
+
fixed: {
|
|
217
|
+
kPzzVL: "x140o2bo",
|
|
218
|
+
$$css: !0
|
|
219
|
+
},
|
|
220
|
+
minimumWidth: (e, t) => [{
|
|
221
|
+
k7Eaqz: (e == null ? e : "x7w7ha4 ") + (t == null ? t : "x18ie477"),
|
|
222
|
+
$$css: !0
|
|
223
|
+
}, {
|
|
224
|
+
"--x-1utbgw4": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
225
|
+
"--x-1wqfzdf": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
|
|
226
|
+
}],
|
|
227
|
+
caption: {
|
|
228
|
+
k9WMMc: "xdpxx8g",
|
|
229
|
+
kmVPX3: "xg7ukam",
|
|
230
|
+
kMwMTN: "x153jb6y",
|
|
231
|
+
kGuDYH: "xy8obcc",
|
|
232
|
+
kLWn49: "xas2l8k",
|
|
233
|
+
$$css: !0
|
|
234
|
+
},
|
|
235
|
+
header: {
|
|
236
|
+
kB7OPa: "x9f619",
|
|
237
|
+
kVAEAm: "x7wzq59",
|
|
238
|
+
k87sOh: "x13vifvy",
|
|
239
|
+
kY2c9j: "x11ru5tl",
|
|
240
|
+
kZKoxP: "x1krvmzm",
|
|
241
|
+
k8WAf4: "xt970qd",
|
|
242
|
+
kg3NbH: "x1dc62k6",
|
|
243
|
+
kt9PQ7: "xso031l",
|
|
244
|
+
kfdmCh: "x1q0q8m5",
|
|
245
|
+
kL6WhQ: "x1qndepd",
|
|
246
|
+
kMwMTN: "x153jb6y",
|
|
247
|
+
kWkggS: "xpvm0e4",
|
|
248
|
+
k63SB2: "xj57cvi",
|
|
249
|
+
kGuDYH: "xy8obcc",
|
|
250
|
+
kLWn49: "xas2l8k",
|
|
251
|
+
khDVqt: "xuxw1ft",
|
|
252
|
+
$$css: !0
|
|
253
|
+
},
|
|
254
|
+
headerLabel: {
|
|
255
|
+
k1xSpc: "x1lliihq",
|
|
256
|
+
k7Eaqz: "xeuugli",
|
|
257
|
+
kVQacm: "xb3r6kr",
|
|
258
|
+
kg5iWk: "xlyipyv",
|
|
259
|
+
khDVqt: "xuxw1ft",
|
|
260
|
+
$$css: !0
|
|
261
|
+
},
|
|
262
|
+
sort: {
|
|
263
|
+
k1xSpc: "x3nfvp2",
|
|
264
|
+
kGNEyG: "x6s0dn4",
|
|
265
|
+
kOIVth: "x1hnptsi",
|
|
266
|
+
ks0D6T: "x193iq5w",
|
|
267
|
+
k7Eaqz: "xeuugli",
|
|
268
|
+
kAzted: "x2zujid x17oiadl",
|
|
269
|
+
kmVPX3: "x1717udv",
|
|
270
|
+
kMzoRj: "xc342km",
|
|
271
|
+
kMwMTN: "x1heor9g",
|
|
272
|
+
kWkggS: "xjbqb8w",
|
|
273
|
+
kMv6JI: "xjb2p0i",
|
|
274
|
+
kGuDYH: "x1qlqyl8",
|
|
275
|
+
k63SB2: "x1pd3egz",
|
|
276
|
+
kLWn49: "x15bjb6t",
|
|
277
|
+
kkrTdU: "x1ypdohk",
|
|
278
|
+
kDPRdz: "xp9636p",
|
|
279
|
+
kSReZ0: "x1s9zmfe",
|
|
280
|
+
kPJHz1: "x13qnu6",
|
|
281
|
+
k7shQP: "x9v5kkp",
|
|
282
|
+
kZs9gx: "x19rmrnh",
|
|
283
|
+
kiEn40: "x7s97pk",
|
|
284
|
+
$$css: !0
|
|
285
|
+
},
|
|
286
|
+
sortIcon: {
|
|
287
|
+
kmuXW: "x2lah0s",
|
|
288
|
+
$$css: !0
|
|
289
|
+
},
|
|
290
|
+
row: {
|
|
291
|
+
kVAEAm: "x1n2onr6",
|
|
292
|
+
kHBbk8: "xc8icb0",
|
|
293
|
+
kZKoxP: "x1wtzb06",
|
|
294
|
+
kt9PQ7: "xso031l",
|
|
295
|
+
kfdmCh: "x1q0q8m5",
|
|
296
|
+
kL6WhQ: "x1qndepd",
|
|
297
|
+
ko0ZBZ: "x19k386i",
|
|
298
|
+
kx8K5S: "x1t1lzn6",
|
|
299
|
+
$$css: !0
|
|
300
|
+
},
|
|
301
|
+
selected: {
|
|
302
|
+
kWkggS: "x1r8u7ye",
|
|
303
|
+
$$css: !0
|
|
304
|
+
},
|
|
305
|
+
actionable: {
|
|
306
|
+
kkrTdU: "x1ypdohk",
|
|
307
|
+
kSReZ0: "x1ecmtor",
|
|
308
|
+
$$css: !0
|
|
309
|
+
},
|
|
310
|
+
trigger: {
|
|
311
|
+
kO7zv1: "x1rh3ycu",
|
|
312
|
+
kfSwDN: "x1hx0egp",
|
|
313
|
+
k1xSpc: "x78zum5",
|
|
314
|
+
kGNEyG: "x6s0dn4",
|
|
315
|
+
kzqmXN: "xh8yej3",
|
|
316
|
+
k7Eaqz: "xeuugli",
|
|
317
|
+
kAzted: "x17tes2r x17oiadl",
|
|
318
|
+
kmVPX3: "x1717udv",
|
|
319
|
+
kMzoRj: "xc342km",
|
|
320
|
+
kaIpWk: "x1ok0vyi",
|
|
321
|
+
kMwMTN: "x1heor9g",
|
|
322
|
+
kWkggS: "xjbqb8w",
|
|
323
|
+
kMv6JI: "xjb2p0i",
|
|
324
|
+
kGuDYH: "x1qlqyl8",
|
|
325
|
+
k63SB2: "x1pd3egz",
|
|
326
|
+
kLWn49: "x15bjb6t",
|
|
327
|
+
k9WMMc: "x16tdsg8",
|
|
328
|
+
kybGjl: "x1hl2dhg",
|
|
329
|
+
kkrTdU: "x1ypdohk",
|
|
330
|
+
k3XXqK: "x1t137rt",
|
|
331
|
+
k5JduY: "x1s928wv",
|
|
332
|
+
kwXMNM: "x1j6awrg",
|
|
333
|
+
kv0HGH: "xarstr8",
|
|
334
|
+
kIHVmn: "x11q50lq",
|
|
335
|
+
kEbOEz: "xa2q2qx",
|
|
336
|
+
kQSxdi: "x1x5eltu",
|
|
337
|
+
kUivIt: "x1jdy9wv",
|
|
338
|
+
kYPGJ8: "xtgyt42",
|
|
339
|
+
kWC4TW: "x19mxcj1",
|
|
340
|
+
$$css: !0
|
|
341
|
+
},
|
|
342
|
+
cell: {
|
|
343
|
+
kB7OPa: "x9f619",
|
|
344
|
+
k8WAf4: "xt970qd",
|
|
345
|
+
kg3NbH: "x1dc62k6",
|
|
346
|
+
kXLuUW: "xxymvpz",
|
|
347
|
+
kHjlTd: "xj0a0fe",
|
|
348
|
+
$$css: !0
|
|
349
|
+
},
|
|
350
|
+
start: {
|
|
351
|
+
k9WMMc: "x1yc453h",
|
|
352
|
+
$$css: !0
|
|
353
|
+
},
|
|
354
|
+
end: {
|
|
355
|
+
k9WMMc: "xp4054r",
|
|
356
|
+
$$css: !0
|
|
357
|
+
},
|
|
358
|
+
width: (e) => [{
|
|
359
|
+
kzqmXN: e == null ? e : "x5lhr3w",
|
|
360
|
+
k7Eaqz: e == null ? e : "xkj4a21",
|
|
361
|
+
$$css: !0
|
|
362
|
+
}, {
|
|
363
|
+
"--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
|
|
364
|
+
"--x-minWidth": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e)
|
|
365
|
+
}],
|
|
366
|
+
secondary: {
|
|
367
|
+
k1xSpc: "xqxxu6g",
|
|
368
|
+
$$css: !0
|
|
369
|
+
},
|
|
370
|
+
truncated: {
|
|
371
|
+
kVQacm: "xb3r6kr",
|
|
372
|
+
khDVqt: "xuxw1ft",
|
|
373
|
+
kg5iWk: "xlyipyv",
|
|
374
|
+
$$css: !0
|
|
375
|
+
},
|
|
376
|
+
cellContent: {
|
|
377
|
+
k1xSpc: "x1lliihq",
|
|
378
|
+
k7Eaqz: "xeuugli",
|
|
379
|
+
kzqmXN: "xh8yej3",
|
|
380
|
+
ks0D6T: "x193iq5w",
|
|
381
|
+
k8hWNX: "xkfz77",
|
|
382
|
+
kDUsi3: "x1ljc890",
|
|
383
|
+
$$css: !0
|
|
384
|
+
},
|
|
385
|
+
rowControl: {
|
|
386
|
+
kVAEAm: "x1n2onr6",
|
|
387
|
+
kY2c9j: "x1vjfegm",
|
|
388
|
+
$$css: !0
|
|
389
|
+
},
|
|
390
|
+
text: {
|
|
391
|
+
k1xSpc: "x1lliihq",
|
|
392
|
+
k7Eaqz: "xeuugli",
|
|
393
|
+
kzqmXN: "xh8yej3",
|
|
394
|
+
$$css: !0
|
|
395
|
+
},
|
|
396
|
+
textColumn: {
|
|
397
|
+
kUk6DE: "x98rzlu",
|
|
398
|
+
k7Eaqz: "xeuugli",
|
|
399
|
+
$$css: !0
|
|
400
|
+
},
|
|
401
|
+
textRow: {
|
|
402
|
+
k1xSpc: "x78zum5",
|
|
403
|
+
kGNEyG: "x6s0dn4",
|
|
404
|
+
kOIVth: "x1n8ia3y",
|
|
405
|
+
k7Eaqz: "xeuugli",
|
|
406
|
+
kzqmXN: "xh8yej3",
|
|
407
|
+
kMv6JI: "x1hz01jw",
|
|
408
|
+
kGuDYH: "xtqrqnz",
|
|
409
|
+
kLWn49: "x1778rvt",
|
|
410
|
+
k63SB2: "xj57cvi",
|
|
411
|
+
$$css: !0
|
|
412
|
+
},
|
|
413
|
+
primaryRow: {
|
|
414
|
+
k1xSpc: "x78zum5",
|
|
415
|
+
kGNEyG: "x6s0dn4",
|
|
416
|
+
kOIVth: "x1hnptsi",
|
|
417
|
+
k7Eaqz: "xeuugli",
|
|
418
|
+
$$css: !0
|
|
419
|
+
},
|
|
420
|
+
primaryText: {
|
|
421
|
+
kzqmXN: "x14atkfc",
|
|
422
|
+
kmuXW: "xs83m0k",
|
|
423
|
+
$$css: !0
|
|
424
|
+
},
|
|
425
|
+
mono: {
|
|
426
|
+
kMv6JI: "xiard35",
|
|
427
|
+
kcqcaj: "xss6m8b",
|
|
428
|
+
$$css: !0
|
|
429
|
+
},
|
|
430
|
+
adornment: {
|
|
431
|
+
k1xSpc: "x3nfvp2",
|
|
432
|
+
kGNEyG: "x6s0dn4",
|
|
433
|
+
kmuXW: "x2lah0s",
|
|
434
|
+
$$css: !0
|
|
435
|
+
},
|
|
436
|
+
secondaryText: {
|
|
437
|
+
kMwMTN: "x153jb6y",
|
|
438
|
+
kGuDYH: "xy8obcc",
|
|
439
|
+
kLWn49: "xas2l8k",
|
|
440
|
+
$$css: !0
|
|
441
|
+
},
|
|
442
|
+
cellViewport: {
|
|
443
|
+
k1xSpc: "x78zum5",
|
|
444
|
+
kGNEyG: "x6s0dn4",
|
|
445
|
+
k7Eaqz: "xeuugli",
|
|
446
|
+
kzqmXN: "xh8yej3",
|
|
447
|
+
kZKoxP: "xw3im37",
|
|
448
|
+
$$css: !0
|
|
449
|
+
},
|
|
450
|
+
fixedContent: {
|
|
451
|
+
kskxy: "x1l6neo7",
|
|
452
|
+
$$css: !0
|
|
453
|
+
},
|
|
454
|
+
readable: {
|
|
455
|
+
khDVqt: "xuxw1ft",
|
|
456
|
+
$$css: !0
|
|
457
|
+
},
|
|
458
|
+
contentCell: {
|
|
459
|
+
k8WAf4: "xn9t2bk",
|
|
460
|
+
$$css: !0
|
|
461
|
+
},
|
|
462
|
+
contentViewport: {
|
|
463
|
+
kZKoxP: "xt7dq6l",
|
|
464
|
+
$$css: !0
|
|
465
|
+
},
|
|
466
|
+
selection: {
|
|
467
|
+
kzqmXN: "x1d7z9mz",
|
|
468
|
+
k7Eaqz: "xeuugli",
|
|
469
|
+
kg3NbH: "x1dc62k6",
|
|
470
|
+
$$css: !0
|
|
471
|
+
},
|
|
472
|
+
spacer: (e) => [
|
|
473
|
+
Ie,
|
|
474
|
+
{
|
|
475
|
+
kZKoxP: e == null ? e : "x16ye13r",
|
|
476
|
+
$$css: !0
|
|
477
|
+
},
|
|
478
|
+
{ "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
|
|
479
|
+
],
|
|
480
|
+
sizer: (e) => [
|
|
481
|
+
Le,
|
|
482
|
+
{
|
|
483
|
+
kZKoxP: e == null ? e : "x16ye13r",
|
|
484
|
+
$$css: !0
|
|
485
|
+
},
|
|
486
|
+
{ "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
|
|
487
|
+
],
|
|
488
|
+
emptyCell: {
|
|
489
|
+
kmVPX3: "x1717udv",
|
|
490
|
+
$$css: !0
|
|
491
|
+
},
|
|
492
|
+
empty: {
|
|
493
|
+
kB7OPa: "x9f619",
|
|
494
|
+
kVAEAm: "x7wzq59",
|
|
495
|
+
kLqNvP: "x1o0tod",
|
|
496
|
+
kzqmXN: "xzfn7dr",
|
|
497
|
+
ks0D6T: "x193iq5w",
|
|
498
|
+
kmVPX3: "x1ttojsm",
|
|
499
|
+
k9WMMc: "x2b8uid",
|
|
500
|
+
khDVqt: "xeaf4i8",
|
|
501
|
+
kHjlTd: "xj0a0fe",
|
|
502
|
+
kMwMTN: "x153jb6y",
|
|
503
|
+
$$css: !0
|
|
504
|
+
},
|
|
505
|
+
footer: {
|
|
506
|
+
kmVPX3: "xg7ukam",
|
|
507
|
+
kEafiO: "x178xt8z",
|
|
508
|
+
kPef9Z: "x13fuv20",
|
|
509
|
+
kLZC3w: "xhjagg4",
|
|
510
|
+
$$css: !0
|
|
511
|
+
},
|
|
512
|
+
endContent: {
|
|
513
|
+
kAzted: "xid9utz",
|
|
514
|
+
kmVPX3: "xg7ukam",
|
|
515
|
+
kMwMTN: "x153jb6y",
|
|
516
|
+
kGuDYH: "xy8obcc",
|
|
517
|
+
kLWn49: "xas2l8k",
|
|
518
|
+
kefpsp: "x15x95ik",
|
|
519
|
+
kyjxKa: "x1az1eml",
|
|
520
|
+
$$css: !0
|
|
521
|
+
}
|
|
522
|
+
}, Re = y.compactTable.slice(7), ze = /* @__PURE__ */ new Set(["string", "number"]), Y = {
|
|
523
|
+
primary: {
|
|
524
|
+
minimumWidth: 240,
|
|
525
|
+
isFlexible: !0,
|
|
526
|
+
shouldTruncate: !0
|
|
527
|
+
},
|
|
528
|
+
text: {
|
|
529
|
+
minimumWidth: 160,
|
|
530
|
+
isFlexible: !1,
|
|
531
|
+
shouldTruncate: !0
|
|
532
|
+
},
|
|
533
|
+
status: {
|
|
534
|
+
minimumWidth: 160,
|
|
535
|
+
isFlexible: !1,
|
|
536
|
+
shouldTruncate: !1
|
|
537
|
+
},
|
|
538
|
+
number: {
|
|
539
|
+
minimumWidth: 112,
|
|
540
|
+
isFlexible: !1,
|
|
541
|
+
shouldTruncate: !1
|
|
542
|
+
},
|
|
543
|
+
timestamp: {
|
|
544
|
+
minimumWidth: 160,
|
|
545
|
+
isFlexible: !1,
|
|
546
|
+
shouldTruncate: !1
|
|
547
|
+
},
|
|
548
|
+
actions: {
|
|
549
|
+
minimumWidth: 112,
|
|
550
|
+
isFlexible: !1,
|
|
551
|
+
shouldTruncate: !1
|
|
552
|
+
}
|
|
553
|
+
}, Be = {
|
|
554
|
+
fixed: J.content,
|
|
555
|
+
content: J.contentCell
|
|
556
|
+
}, Ve = {
|
|
557
|
+
primary: J.start,
|
|
558
|
+
text: J.start,
|
|
559
|
+
status: J.start,
|
|
560
|
+
number: J.end,
|
|
561
|
+
timestamp: J.end,
|
|
562
|
+
actions: J.end
|
|
563
|
+
}, He = {
|
|
564
|
+
content: J.content,
|
|
565
|
+
fill: J.fillFrame
|
|
566
|
+
}, Ue = {
|
|
567
|
+
content: J.content,
|
|
568
|
+
fill: J.fillViewport
|
|
569
|
+
};
|
|
570
|
+
function We(e) {
|
|
571
|
+
return e.map((e) => {
|
|
572
|
+
let t = Y[e.role], n = e.width ?? (t.isFlexible ? void 0 : t.minimumWidth);
|
|
573
|
+
return {
|
|
574
|
+
...e,
|
|
575
|
+
...n === void 0 ? {} : { width: n }
|
|
576
|
+
};
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
function Ge(e, t = 0) {
|
|
580
|
+
return {
|
|
581
|
+
minimumWidth: e.reduce((e, t) => e + (t.width ?? Y[t.role].minimumWidth), t),
|
|
582
|
+
compactWidth: e.filter((e) => e.isSecondary !== !0).reduce((e, t) => e + (t.width ?? Y[t.role].minimumWidth), t)
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
function Ke(e) {
|
|
586
|
+
let t = globalThis.matchMedia(Re);
|
|
587
|
+
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
588
|
+
}
|
|
589
|
+
function qe() {
|
|
590
|
+
return globalThis.matchMedia(Re).matches;
|
|
591
|
+
}
|
|
592
|
+
function Je({ columns: e, canSelect: t = !1 }) {
|
|
593
|
+
return /* @__PURE__ */ B("colgroup", { children: [t && /* @__PURE__ */ z("col", { ...S.props(J.selection) }), e.map((e) => /* @__PURE__ */ z("col", { ...S.props(e.width !== void 0 && J.width(e.width), e.isSecondary === !0 && J.secondary) }, e.id))] });
|
|
594
|
+
}
|
|
595
|
+
function Ye({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
|
|
596
|
+
let i = Y[e], a = t && i.shouldTruncate, o = n === !0 || typeof r == "string" && (n ?? a);
|
|
597
|
+
return /* @__PURE__ */ z("span", {
|
|
598
|
+
...S.props(J.cellViewport, !t && J.contentViewport),
|
|
599
|
+
children: /* @__PURE__ */ z("span", {
|
|
600
|
+
"data-record-text": ze.has(typeof r) || void 0,
|
|
601
|
+
title: typeof r == "string" ? r : void 0,
|
|
602
|
+
...S.props(J.cellContent, t && J.fixedContent, t && !i.shouldTruncate && J.readable, o && J.truncated),
|
|
603
|
+
children: r
|
|
604
|
+
})
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
// packages/collections/src/table-results.tsx
|
|
608
|
+
function Xe({ status: e, sort: t, selected: n, pagination: r, isPlaceholder: i }) {
|
|
609
|
+
return {
|
|
610
|
+
status: e,
|
|
611
|
+
pending: e === "pending",
|
|
612
|
+
sort: t,
|
|
613
|
+
selected: n === null ? [] : [...n],
|
|
614
|
+
page: r?.description ?? null,
|
|
615
|
+
hasPreviousPage: r !== void 0 && !r.previous.disabled,
|
|
616
|
+
hasNextPage: r !== void 0 && !r.next.disabled,
|
|
617
|
+
isPlaceholder: i
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
var Ze = "[hidden], [inert], [aria-hidden=\"true\"], [data-agent-hidden], [data-agent-secret]";
|
|
621
|
+
function Qe(e) {
|
|
622
|
+
let t = e instanceof HTMLTableElement ? e.tBodies[0] : void 0;
|
|
623
|
+
if (t !== void 0 && t.closest(Ze) === null) return new Map(Array.from(t.rows).flatMap((e) => {
|
|
624
|
+
let t = e.dataset.rowId, n = Array.from(e.cells).find((e) => e.dataset.recordLabel !== void 0);
|
|
625
|
+
if (t === void 0 || n === void 0) return [];
|
|
626
|
+
if (n.closest(Ze) !== null || n.querySelector("[data-agent-secret], [data-agent-hidden]") !== null || !n.checkVisibility({ visibilityProperty: !0 })) return [[t, null]];
|
|
627
|
+
let r = n.querySelector("[data-row-action][aria-label]") ?? n.querySelector("[data-record-text]");
|
|
628
|
+
if (r !== null && r.closest(Ze) !== null || r?.checkVisibility({ visibilityProperty: !0 }) === !1) return [[t, null]];
|
|
629
|
+
let i = r?.getAttribute("aria-label") ?? r?.textContent.trim();
|
|
630
|
+
return [[t, i === void 0 || i.length === 0 ? t : i]];
|
|
631
|
+
}));
|
|
632
|
+
}
|
|
633
|
+
var $e = {
|
|
634
|
+
none: "ascending",
|
|
635
|
+
ascending: "descending",
|
|
636
|
+
descending: "none"
|
|
637
|
+
}, et = /* @__PURE__ */ new Set(["ascending", "descending"]), tt = /* @__PURE__ */ new Set(["Home", "End"]), nt = L({
|
|
638
|
+
name: "collection-results",
|
|
639
|
+
options: {
|
|
640
|
+
status: "string",
|
|
641
|
+
sort: "value",
|
|
642
|
+
onSortChange: "callback",
|
|
643
|
+
sortable: "list",
|
|
644
|
+
selected: "value",
|
|
645
|
+
onSelectedChange: "callback",
|
|
646
|
+
pagination: "value",
|
|
647
|
+
rowIds: "list",
|
|
648
|
+
rowLabel: "callback",
|
|
649
|
+
isActionable: "boolean",
|
|
650
|
+
reveal: "callback",
|
|
651
|
+
onOpen: "callback",
|
|
652
|
+
isPlaceholder: "boolean"
|
|
653
|
+
},
|
|
654
|
+
state: (e) => ({
|
|
655
|
+
...Xe(e),
|
|
656
|
+
active: null
|
|
657
|
+
}),
|
|
658
|
+
sync: Xe,
|
|
659
|
+
controlled: [
|
|
660
|
+
"status",
|
|
661
|
+
"sort",
|
|
662
|
+
"selected",
|
|
663
|
+
"page",
|
|
664
|
+
"hasPreviousPage",
|
|
665
|
+
"hasNextPage"
|
|
666
|
+
],
|
|
667
|
+
api: (e) => {
|
|
668
|
+
let t = re(e), n = ie(e, {
|
|
669
|
+
key: "active",
|
|
670
|
+
rows: () => e.options().rowIds.length,
|
|
671
|
+
cols: () => 1,
|
|
672
|
+
disabled: () => !e.options().isActionable,
|
|
673
|
+
reveal: (t) => e.options().reveal(t.row)
|
|
674
|
+
}), r = { rowIds: e.options().rowIds };
|
|
675
|
+
e.onOptions((t) => {
|
|
676
|
+
let i = n.active(), a = i === null ? void 0 : r.rowIds[i.row];
|
|
677
|
+
if (r.rowIds = t.rowIds, i === null || t.rowIds[i.row] === a) return;
|
|
678
|
+
let o = a === void 0 ? -1 : t.rowIds.indexOf(a);
|
|
679
|
+
e.store.set({ active: o === -1 ? null : {
|
|
680
|
+
row: o,
|
|
681
|
+
col: 0
|
|
682
|
+
} });
|
|
683
|
+
});
|
|
684
|
+
let i = ae(e, {
|
|
685
|
+
key: "selected",
|
|
686
|
+
set: (e, n) => t("selected", e, n),
|
|
687
|
+
order: () => e.options().rowIds,
|
|
688
|
+
multiple: () => !0
|
|
689
|
+
});
|
|
690
|
+
function a() {
|
|
691
|
+
if (e.options().selected === null) throw Error("This table has no row selection.");
|
|
692
|
+
}
|
|
693
|
+
function o(t) {
|
|
694
|
+
let { sortable: n } = e.options(), r = n.find((e) => e.id === t || e.label === t);
|
|
695
|
+
if (r === void 0) {
|
|
696
|
+
let e = n.map((e) => e.label).join(", ");
|
|
697
|
+
throw Error(e.length === 0 ? "This table has no sortable column." : `Sort by one of: ${e}.`);
|
|
698
|
+
}
|
|
699
|
+
return r.id;
|
|
700
|
+
}
|
|
701
|
+
function s(t) {
|
|
702
|
+
let n = e.options().pagination?.[t];
|
|
703
|
+
if (n === void 0 || n.disabled) throw Error(`There is no ${t} page.`);
|
|
704
|
+
return n.onClick(), !0;
|
|
705
|
+
}
|
|
706
|
+
return {
|
|
707
|
+
grid: n,
|
|
708
|
+
rowKeydown(t) {
|
|
709
|
+
t.shiftKey || (t.metaKey || t.ctrlKey || !tt.has(t.key) ? n.keydown(t) : (t.preventDefault(), n.focus({
|
|
710
|
+
row: t.key === "Home" ? 0 : e.options().rowIds.length - 1,
|
|
711
|
+
col: 0
|
|
712
|
+
}, {
|
|
713
|
+
reason: "list-navigation",
|
|
714
|
+
event: t
|
|
715
|
+
})));
|
|
716
|
+
},
|
|
717
|
+
focusRow: (e) => n.focus({
|
|
718
|
+
row: e,
|
|
719
|
+
col: 0
|
|
720
|
+
}),
|
|
721
|
+
toggleSort(n, r) {
|
|
722
|
+
let { sort: i } = e.options(), a = $e[i?.columnId === n ? i.direction : "none"];
|
|
723
|
+
return t("sort", a === "none" ? null : {
|
|
724
|
+
columnId: n,
|
|
725
|
+
direction: a
|
|
726
|
+
}, {
|
|
727
|
+
reason: "trigger-press",
|
|
728
|
+
event: r
|
|
729
|
+
});
|
|
730
|
+
},
|
|
731
|
+
toggleRow(e, t) {
|
|
732
|
+
let n = t === void 0 ? { reason: "item-press" } : {
|
|
733
|
+
reason: "item-press",
|
|
734
|
+
event: t
|
|
735
|
+
};
|
|
736
|
+
t instanceof MouseEvent && t.shiftKey ? i.extend(e, n) : i.toggle(e, n);
|
|
737
|
+
},
|
|
738
|
+
toggleAll(e) {
|
|
739
|
+
i.toggleAll(e === void 0 ? { reason: "item-press" } : {
|
|
740
|
+
reason: "item-press",
|
|
741
|
+
event: e
|
|
742
|
+
});
|
|
743
|
+
},
|
|
744
|
+
sort(e, n = "ascending") {
|
|
745
|
+
if (n === "none") return t("sort", null, { reason: "imperative" });
|
|
746
|
+
if (!et.has(n)) throw Error("The direction is ascending, descending or none.");
|
|
747
|
+
return t("sort", {
|
|
748
|
+
columnId: o(e),
|
|
749
|
+
direction: n === "descending" ? "descending" : "ascending"
|
|
750
|
+
}, { reason: "imperative" });
|
|
751
|
+
},
|
|
752
|
+
select(n) {
|
|
753
|
+
a();
|
|
754
|
+
let { rowIds: r } = e.options(), i = (Array.isArray(n) ? n : [n]).map(String), o = i.find((e) => !r.includes(e));
|
|
755
|
+
if (o !== void 0) throw Error(`No row "${o}" is in this table.`);
|
|
756
|
+
return t("selected", i, { reason: "imperative" });
|
|
757
|
+
},
|
|
758
|
+
open(t) {
|
|
759
|
+
let n = e.options().rowIds.indexOf(String(t));
|
|
760
|
+
if (n === -1 || !e.options().isActionable) throw Error(n === -1 ? `No row "${String(t)}" is in this table.` : "The rows have no action now.");
|
|
761
|
+
return e.options().onOpen(n), !0;
|
|
762
|
+
},
|
|
763
|
+
previousPage: () => s("previous"),
|
|
764
|
+
nextPage: () => s("next"),
|
|
765
|
+
records() {
|
|
766
|
+
let t = Qe(e.element("root")), { rowIds: n, rowLabel: r } = e.options();
|
|
767
|
+
if (t === void 0) return [];
|
|
768
|
+
let i = Array.from(t.values()).includes(null);
|
|
769
|
+
return n.flatMap((e, n) => {
|
|
770
|
+
let a = t.has(e) ? t.get(e) : r(n);
|
|
771
|
+
return !t.has(e) && i || a == null ? [] : [{
|
|
772
|
+
value: e,
|
|
773
|
+
label: a
|
|
774
|
+
}];
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
},
|
|
779
|
+
slots: (e) => ({
|
|
780
|
+
root: e({}),
|
|
781
|
+
trigger: e({
|
|
782
|
+
props: {
|
|
783
|
+
value: "string",
|
|
784
|
+
row: "number",
|
|
785
|
+
col: "number"
|
|
786
|
+
},
|
|
787
|
+
selects: se({ active: ne }),
|
|
788
|
+
attrs: (e, { props: t, api: n }) => ({ tabindex: n.grid.tabIndex(e, t) }),
|
|
789
|
+
on: {
|
|
790
|
+
keydown: (e, { api: t }) => t.rowKeydown(e),
|
|
791
|
+
focus: (e, { api: t, props: n }) => {
|
|
792
|
+
t.grid.focus(n, {
|
|
793
|
+
reason: "item-press",
|
|
794
|
+
event: e
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
bind: (e, { api: t, props: n }) => t.grid.bind(e, n)
|
|
799
|
+
})
|
|
800
|
+
}),
|
|
801
|
+
agent: {
|
|
802
|
+
actions: [
|
|
803
|
+
"sort",
|
|
804
|
+
"select",
|
|
805
|
+
"open",
|
|
806
|
+
"previousPage",
|
|
807
|
+
"nextPage"
|
|
808
|
+
],
|
|
809
|
+
items: (e) => e.records(),
|
|
810
|
+
shown: (e) => !e.isPlaceholder
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
function rt(e, t) {
|
|
814
|
+
let n = D(nt, e), r = E(n, "root", {}, t(n.api), "table");
|
|
815
|
+
return {
|
|
816
|
+
api: n.api,
|
|
817
|
+
element: r
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
var it = w(nt, {
|
|
821
|
+
root: "table",
|
|
822
|
+
trigger: "a"
|
|
823
|
+
}).Trigger, at = w(nt, {
|
|
824
|
+
root: "table",
|
|
825
|
+
trigger: "button"
|
|
826
|
+
}).Trigger;
|
|
827
|
+
// packages/collections/src/data-table-trigger.tsx
|
|
828
|
+
function ot(e) {
|
|
829
|
+
if (e.defaultPrevented || e.button !== 0) return !1;
|
|
830
|
+
let t = e.metaKey || e.ctrlKey, n = e.altKey || e.shiftKey;
|
|
831
|
+
return t || n ? !1 : e.detail === 0 || e.currentTarget.ownerDocument.getSelection()?.isCollapsed !== !1;
|
|
832
|
+
}
|
|
833
|
+
function st({ index: e, recordId: t, row: n, action: r, isActive: i, children: a }) {
|
|
834
|
+
let o = r.label?.(n), s = r.href === void 0 ? /* @__PURE__ */ z(at, {
|
|
835
|
+
value: t,
|
|
836
|
+
row: e,
|
|
837
|
+
col: 0,
|
|
838
|
+
type: "button",
|
|
839
|
+
disabled: r.disabled === !0,
|
|
840
|
+
"aria-label": o,
|
|
841
|
+
"aria-pressed": i,
|
|
842
|
+
"data-row-action": !0,
|
|
843
|
+
onClick: (e) => {
|
|
844
|
+
ot(e) && r.onActivate(n);
|
|
845
|
+
},
|
|
846
|
+
...S.props(J.trigger),
|
|
847
|
+
children: a
|
|
848
|
+
}) : /* @__PURE__ */ z(it, {
|
|
849
|
+
value: t,
|
|
850
|
+
row: e,
|
|
851
|
+
col: 0,
|
|
852
|
+
"aria-label": o,
|
|
853
|
+
href: r.href(n),
|
|
854
|
+
"data-row-action": !0,
|
|
855
|
+
onClick: (e) => {
|
|
856
|
+
r.onActivate !== void 0 && ot(e) && (e.preventDefault(), r.onActivate(n));
|
|
857
|
+
},
|
|
858
|
+
...S.props(J.trigger),
|
|
859
|
+
children: a
|
|
860
|
+
});
|
|
861
|
+
return o === void 0 || r.showTooltip !== !0 ? s : /* @__PURE__ */ B(h.Root, { children: [/* @__PURE__ */ z(h.Trigger, { render: s }), /* @__PURE__ */ z(h.Popup, {
|
|
862
|
+
side: "top",
|
|
863
|
+
align: "start",
|
|
864
|
+
children: o
|
|
865
|
+
})] });
|
|
866
|
+
}
|
|
867
|
+
// packages/collections/src/use-end-reached.ts
|
|
868
|
+
function ct({ end: e, viewport: t, onEndReached: n, content: r }) {
|
|
869
|
+
j(() => {
|
|
870
|
+
if (n === void 0 || e.current === null) return;
|
|
871
|
+
let r = new IntersectionObserver((e) => {
|
|
872
|
+
e.some((e) => e.isIntersecting) && n();
|
|
873
|
+
}, { root: t?.current ?? null });
|
|
874
|
+
return r.observe(e.current), () => r.disconnect();
|
|
875
|
+
}, [
|
|
876
|
+
e,
|
|
877
|
+
t,
|
|
878
|
+
n,
|
|
879
|
+
r
|
|
880
|
+
]);
|
|
881
|
+
}
|
|
882
|
+
// packages/collections/src/use-table-window.ts
|
|
883
|
+
var lt = [];
|
|
884
|
+
function ut(e) {
|
|
885
|
+
let t = F(e), [{ rows: n, subscribe: r, readItems: i, scrollToIndex: a }] = I(() => {
|
|
886
|
+
let e = oe({
|
|
887
|
+
count: () => t.current.count,
|
|
888
|
+
estimate: () => t.current.estimate,
|
|
889
|
+
key: (e) => t.current.keyOf(e),
|
|
890
|
+
overscan: 6,
|
|
891
|
+
keep: () => t.current.keep(),
|
|
892
|
+
onEnd: () => t.current.onEnd?.(),
|
|
893
|
+
endThreshold: 0,
|
|
894
|
+
get scrollMargin() {
|
|
895
|
+
return t.current.margin;
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
return {
|
|
899
|
+
rows: e,
|
|
900
|
+
subscribe: (t) => e.subscribe(t),
|
|
901
|
+
readItems: () => e.items(),
|
|
902
|
+
scrollToIndex: (t) => e.scrollToIndex(t)
|
|
903
|
+
};
|
|
904
|
+
}), [o] = I(() => /* @__PURE__ */ new Map()), { isEnabled: s, viewport: c } = e;
|
|
905
|
+
return N(() => {
|
|
906
|
+
t.current = e, n.refresh();
|
|
907
|
+
}), N(() => {
|
|
908
|
+
let e = c.current;
|
|
909
|
+
if (s && e !== null) return n.connect(e);
|
|
910
|
+
}, [
|
|
911
|
+
s,
|
|
912
|
+
n,
|
|
913
|
+
c
|
|
914
|
+
]), {
|
|
915
|
+
items: te(r, i, () => lt),
|
|
916
|
+
size: n.size(),
|
|
917
|
+
scrollToIndex: a,
|
|
918
|
+
measure(e) {
|
|
919
|
+
let t = o.get(e);
|
|
920
|
+
if (t !== void 0) return t;
|
|
921
|
+
let r = (t) => n.measure(e, t);
|
|
922
|
+
return o.set(e, r), r;
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
// packages/collections/src/data-table-rows.tsx
|
|
927
|
+
var dt = xe({}), ft = {
|
|
928
|
+
ascending: V,
|
|
929
|
+
descending: le,
|
|
930
|
+
none: de
|
|
931
|
+
};
|
|
932
|
+
function pt(e, t) {
|
|
933
|
+
let n = F(void 0);
|
|
934
|
+
j(() => {
|
|
935
|
+
if (t === void 0) {
|
|
936
|
+
n.current = void 0;
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
if (n.current !== void 0 && n.current.id === e) return;
|
|
940
|
+
let r = { isCurrent: !0 };
|
|
941
|
+
return queueMicrotask(() => {
|
|
942
|
+
r.isCurrent && (n.current = { id: e }, t(e));
|
|
943
|
+
}), () => {
|
|
944
|
+
r.isCurrent = !1;
|
|
945
|
+
};
|
|
946
|
+
}, [e, t]);
|
|
947
|
+
}
|
|
948
|
+
function X({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: a, onSortChange: o, selectedIds: s, onSelectionChange: c, selectionLabel: l, rowAction: u, activeRowId: d, focusRowId: f, onRowHighlightChange: p, hideCaption: m = !1, hideHeaders: h = !1, rowSizing: y = "fixed", window: x, endContent: w, onEndReached: T, footer: E, pagination: D, resultStatus: O = "ready", isPlaceholder: k = !1, hasSelectionColumn: A = s !== void 0 }) {
|
|
949
|
+
let M = P(() => We(t), [t]), ne = te(Ke, qe, () => !1), re = P(() => {
|
|
950
|
+
let e = be();
|
|
951
|
+
return e.columns(M.map((t) => e.display({
|
|
952
|
+
id: t.id,
|
|
953
|
+
header: t.label
|
|
954
|
+
})));
|
|
955
|
+
}, [M]), ie = Se({
|
|
956
|
+
features: dt,
|
|
957
|
+
columns: re,
|
|
958
|
+
data: e,
|
|
959
|
+
getRowId: n
|
|
960
|
+
}), ae = b(), oe = ae.viewport, L = F(null), R = F(null), se = F(null), [le, ue] = I(0), [V, de] = I(), [fe, H] = I(), pe = F(void 0), me = F(void 0), U = P(() => e.map(n), [e, n]), he = V === void 0 ? -1 : U.indexOf(V.id), W = V?.isWithin === !0 ? he : -1, ge = W === -1 ? void 0 : V?.id, _e = M.findIndex((e) => e.role === "primary" && e.isSecondary !== !0), ve = _e === -1 ? M.findIndex((e) => e.isSecondary !== !0) : _e, G = typeof x?.height == "string" ? x.height : "content", ye = u !== void 0 && u.disabled !== !0;
|
|
961
|
+
ct({
|
|
962
|
+
end: L,
|
|
963
|
+
onEndReached: x === void 0 ? T : void 0,
|
|
964
|
+
content: e.length
|
|
965
|
+
}), j(() => {
|
|
966
|
+
let e = R.current, t = se.current;
|
|
967
|
+
if (x === void 0 || e === null || t === null) return;
|
|
968
|
+
let n = new ResizeObserver(() => ue(e.offsetHeight + t.offsetHeight));
|
|
969
|
+
return n.observe(e), n.observe(t), () => n.disconnect();
|
|
970
|
+
}, [
|
|
971
|
+
x,
|
|
972
|
+
m,
|
|
973
|
+
h
|
|
974
|
+
]);
|
|
975
|
+
let K = ut({
|
|
976
|
+
isEnabled: x !== void 0,
|
|
977
|
+
viewport: oe,
|
|
978
|
+
count: e.length,
|
|
979
|
+
keyOf: (e) => U[e] ?? String(e),
|
|
980
|
+
estimate: y === "fixed" ? v.rowHeight : x?.estimatedRowHeight ?? v.rowHeight,
|
|
981
|
+
margin: le,
|
|
982
|
+
keep: () => [
|
|
983
|
+
Math.max(0, he),
|
|
984
|
+
W - 1,
|
|
985
|
+
W,
|
|
986
|
+
W + 1
|
|
987
|
+
],
|
|
988
|
+
onEnd: T
|
|
989
|
+
});
|
|
990
|
+
j(() => {
|
|
991
|
+
x !== void 0 && e.length === 0 && T?.();
|
|
992
|
+
}, [
|
|
993
|
+
x,
|
|
994
|
+
e.length,
|
|
995
|
+
T
|
|
996
|
+
]);
|
|
997
|
+
function xe(e) {
|
|
998
|
+
return oe.current?.querySelector(`[data-row-id="${CSS.escape(e)}"] [data-row-action]`) ?? null;
|
|
999
|
+
}
|
|
1000
|
+
let Ce = P(() => o === void 0 ? [] : M.filter((e) => e.canSort === !0).map(({ id: e, label: t }) => ({
|
|
1001
|
+
id: e,
|
|
1002
|
+
label: t
|
|
1003
|
+
})), [M, o]), we = P(() => s === void 0 ? null : Array.from(s), [s]), Te = {
|
|
1004
|
+
status: O,
|
|
1005
|
+
sort: a ?? null,
|
|
1006
|
+
onSortChange: o === void 0 ? void 0 : (e, t) => o(e ?? void 0, t),
|
|
1007
|
+
sortable: Ce,
|
|
1008
|
+
selected: we,
|
|
1009
|
+
onSelectedChange: c === void 0 ? void 0 : (e, t) => c(new Set(e), t),
|
|
1010
|
+
pagination: D,
|
|
1011
|
+
rowIds: U,
|
|
1012
|
+
rowLabel: (t) => {
|
|
1013
|
+
let n = e[t];
|
|
1014
|
+
return n === void 0 ? void 0 : u?.label?.(n) ?? l?.(n);
|
|
1015
|
+
},
|
|
1016
|
+
isActionable: ye,
|
|
1017
|
+
reveal: (e) => {
|
|
1018
|
+
x !== void 0 && K.scrollToIndex(e);
|
|
1019
|
+
},
|
|
1020
|
+
onOpen: (e) => {
|
|
1021
|
+
let t = U[e], n = t === void 0 ? null : xe(t);
|
|
1022
|
+
n === null ? (me.current = t, K.scrollToIndex(e)) : n.click();
|
|
1023
|
+
},
|
|
1024
|
+
isPlaceholder: k
|
|
1025
|
+
};
|
|
1026
|
+
N(() => {
|
|
1027
|
+
let e = me.current;
|
|
1028
|
+
e !== void 0 && (me.current = void 0, xe(e)?.click());
|
|
1029
|
+
});
|
|
1030
|
+
let Ee = x === void 0 ? ie.getRowModel().rows.map((e, t) => ({
|
|
1031
|
+
row: e,
|
|
1032
|
+
index: t,
|
|
1033
|
+
spacerHeight: 0
|
|
1034
|
+
})) : K.items.flatMap((e, t, n) => {
|
|
1035
|
+
let r = ie.getRowModel().rows[e.index], i = n[t - 1];
|
|
1036
|
+
if (r === void 0) return [];
|
|
1037
|
+
let a = i === void 0 ? 0 : i.start + i.size;
|
|
1038
|
+
return [{
|
|
1039
|
+
row: r,
|
|
1040
|
+
index: e.index,
|
|
1041
|
+
spacerHeight: e.start - a
|
|
1042
|
+
}];
|
|
1043
|
+
}), De = Ee.some(({ row: e }) => e.id === fe) ? fe : void 0;
|
|
1044
|
+
fe !== void 0 && De === void 0 && H(void 0), pt(De ?? ge, p);
|
|
1045
|
+
let Oe = M.filter((e) => !ne || e.isSecondary !== !0).length + +!!A, ke = A ? 76 : 0, Ae = E != null && typeof E != "boolean" || D !== void 0, { minimumWidth: je, compactWidth: Me } = Ge(M, ke), q = K.items.at(-1), Ne = K.size - (q === void 0 ? 0 : q.start + q.size), Pe = s === void 0 ? 0 : U.filter((e) => s.has(e)).length, Ie = U.length > 0 && Pe === U.length, Le = Pe > 0 && !Ie;
|
|
1046
|
+
function Re(t) {
|
|
1047
|
+
return /* @__PURE__ */ B(ce, { children: [
|
|
1048
|
+
/* @__PURE__ */ z("caption", {
|
|
1049
|
+
ref: R,
|
|
1050
|
+
"aria-label": r,
|
|
1051
|
+
...S.props(J.caption, m && _.hidden),
|
|
1052
|
+
children: r
|
|
1053
|
+
}),
|
|
1054
|
+
/* @__PURE__ */ z(Je, {
|
|
1055
|
+
columns: M,
|
|
1056
|
+
canSelect: A
|
|
1057
|
+
}),
|
|
1058
|
+
/* @__PURE__ */ z("thead", {
|
|
1059
|
+
ref: se,
|
|
1060
|
+
...S.props(h && _.hidden),
|
|
1061
|
+
children: /* @__PURE__ */ B("tr", { children: [A && /* @__PURE__ */ z("th", {
|
|
1062
|
+
scope: "col",
|
|
1063
|
+
"aria-label": "Select",
|
|
1064
|
+
...S.props(J.header, J.selection, J.rowControl),
|
|
1065
|
+
children: !k && /* @__PURE__ */ z(g.Root, {
|
|
1066
|
+
"aria-label": `Select every row of ${r}`,
|
|
1067
|
+
checked: Ie,
|
|
1068
|
+
indeterminate: Le,
|
|
1069
|
+
disabled: U.length === 0,
|
|
1070
|
+
onCheckedChange: (e, n) => t.toggleAll(n.event),
|
|
1071
|
+
children: /* @__PURE__ */ z(g.Indicator, {})
|
|
1072
|
+
})
|
|
1073
|
+
}), M.map((e) => {
|
|
1074
|
+
let n = a?.columnId === e.id ? a.direction : void 0, i = ft[n ?? "none"];
|
|
1075
|
+
return /* @__PURE__ */ z("th", {
|
|
1076
|
+
scope: "col",
|
|
1077
|
+
title: e.label,
|
|
1078
|
+
"aria-sort": n,
|
|
1079
|
+
...S.props(J.header, Ve[e.role], e.width !== void 0 && J.width(e.width), e.isSecondary === !0 && J.secondary),
|
|
1080
|
+
children: e.canSort === !0 && o !== void 0 ? /* @__PURE__ */ B(C, {
|
|
1081
|
+
type: "button",
|
|
1082
|
+
"aria-label": `Sort ${r} by ${e.label}`,
|
|
1083
|
+
...S.props(J.sort),
|
|
1084
|
+
onClick: (n) => t.toggleSort(e.id, n.nativeEvent),
|
|
1085
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1086
|
+
...S.props(J.headerLabel),
|
|
1087
|
+
children: e.label
|
|
1088
|
+
}), /* @__PURE__ */ z(i, {
|
|
1089
|
+
size: 14,
|
|
1090
|
+
"aria-hidden": "true",
|
|
1091
|
+
...S.props(J.sortIcon)
|
|
1092
|
+
})]
|
|
1093
|
+
}) : /* @__PURE__ */ z("span", {
|
|
1094
|
+
...S.props(J.headerLabel),
|
|
1095
|
+
children: e.label
|
|
1096
|
+
})
|
|
1097
|
+
}, e.id);
|
|
1098
|
+
})] })
|
|
1099
|
+
}),
|
|
1100
|
+
/* @__PURE__ */ B("tbody", {
|
|
1101
|
+
onPointerLeave: () => H(void 0),
|
|
1102
|
+
onKeyDownCapture: () => H(void 0),
|
|
1103
|
+
onBlur: (e) => {
|
|
1104
|
+
e.currentTarget.contains(e.relatedTarget) || de((e) => e === void 0 ? void 0 : {
|
|
1105
|
+
id: e.id,
|
|
1106
|
+
isWithin: !1
|
|
1107
|
+
});
|
|
1108
|
+
},
|
|
1109
|
+
children: [
|
|
1110
|
+
Ee.map(({ row: e, index: n, spacerHeight: r }) => /* @__PURE__ */ B(ee, { children: [r > 0 && /* @__PURE__ */ z("tr", {
|
|
1111
|
+
"aria-hidden": "true",
|
|
1112
|
+
children: /* @__PURE__ */ z("td", {
|
|
1113
|
+
colSpan: Oe,
|
|
1114
|
+
...S.props(J.spacer(r))
|
|
1115
|
+
})
|
|
1116
|
+
}), /* @__PURE__ */ B("tr", {
|
|
1117
|
+
"data-index": n,
|
|
1118
|
+
"data-row-id": e.id,
|
|
1119
|
+
"aria-rowindex": x === void 0 ? void 0 : n + 2,
|
|
1120
|
+
ref: x === void 0 || y === "fixed" ? void 0 : K.measure(n),
|
|
1121
|
+
onPointerMove: (t) => {
|
|
1122
|
+
t.pointerType === "mouse" && H(e.id);
|
|
1123
|
+
},
|
|
1124
|
+
onPointerEnter: (t) => {
|
|
1125
|
+
t.pointerType === "mouse" && H(e.id);
|
|
1126
|
+
},
|
|
1127
|
+
onPointerLeave: () => {
|
|
1128
|
+
H((t) => t === e.id ? void 0 : t);
|
|
1129
|
+
},
|
|
1130
|
+
onPointerDown: (e) => {
|
|
1131
|
+
e.pointerType !== "mouse" && H(void 0);
|
|
1132
|
+
},
|
|
1133
|
+
onFocus: () => {
|
|
1134
|
+
H(void 0), de({
|
|
1135
|
+
id: e.id,
|
|
1136
|
+
isWithin: !0
|
|
1137
|
+
});
|
|
1138
|
+
},
|
|
1139
|
+
...S.props(J.row, ye && J.actionable, (s?.has(e.id) === !0 || d === e.id) && J.selected),
|
|
1140
|
+
children: [A && /* @__PURE__ */ z("td", {
|
|
1141
|
+
...S.props(J.cell, J.selection, J.rowControl),
|
|
1142
|
+
children: s !== void 0 && /* @__PURE__ */ z(g.Root, {
|
|
1143
|
+
"aria-label": l(e.original),
|
|
1144
|
+
checked: s.has(e.id),
|
|
1145
|
+
onCheckedChange: (n, r) => t.toggleRow(e.id, r.event),
|
|
1146
|
+
children: /* @__PURE__ */ z(g.Indicator, {})
|
|
1147
|
+
})
|
|
1148
|
+
}), M.map((t, r) => {
|
|
1149
|
+
let i = /* @__PURE__ */ z(Ye, {
|
|
1150
|
+
role: t.role,
|
|
1151
|
+
isFixed: y === "fixed",
|
|
1152
|
+
shouldTruncate: t.shouldTruncate,
|
|
1153
|
+
children: t.cell(e.original)
|
|
1154
|
+
});
|
|
1155
|
+
return /* @__PURE__ */ z("td", {
|
|
1156
|
+
"data-record-label": r === ve || void 0,
|
|
1157
|
+
...S.props(J.cell, Be[y], Ve[t.role], t.width !== void 0 && J.width(t.width), t.isSecondary === !0 && J.secondary),
|
|
1158
|
+
children: u !== void 0 && r === ve ? /* @__PURE__ */ z(st, {
|
|
1159
|
+
index: n,
|
|
1160
|
+
recordId: e.id,
|
|
1161
|
+
row: e.original,
|
|
1162
|
+
action: u,
|
|
1163
|
+
isActive: d === e.id,
|
|
1164
|
+
children: i
|
|
1165
|
+
}) : i
|
|
1166
|
+
}, t.id);
|
|
1167
|
+
})]
|
|
1168
|
+
})] }, e.id)),
|
|
1169
|
+
x !== void 0 && Ne > 0 && /* @__PURE__ */ z("tr", {
|
|
1170
|
+
"aria-hidden": "true",
|
|
1171
|
+
children: /* @__PURE__ */ z("td", {
|
|
1172
|
+
colSpan: Oe,
|
|
1173
|
+
...S.props(J.spacer(Ne))
|
|
1174
|
+
})
|
|
1175
|
+
}),
|
|
1176
|
+
e.length === 0 && /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", {
|
|
1177
|
+
colSpan: Oe,
|
|
1178
|
+
...S.props(J.emptyCell),
|
|
1179
|
+
children: /* @__PURE__ */ z("div", {
|
|
1180
|
+
...S.props(J.empty),
|
|
1181
|
+
children: i
|
|
1182
|
+
})
|
|
1183
|
+
}) })
|
|
1184
|
+
]
|
|
1185
|
+
})
|
|
1186
|
+
] });
|
|
1187
|
+
}
|
|
1188
|
+
let { api: ze, element: Y } = rt(Te, (t) => ({
|
|
1189
|
+
"aria-label": r,
|
|
1190
|
+
"aria-busy": O === "pending" || void 0,
|
|
1191
|
+
"aria-rowcount": x === void 0 ? void 0 : Math.max(1, e.length) + 1,
|
|
1192
|
+
...S.props(J.table, J.fixed, J.minimumWidth(je, Me)),
|
|
1193
|
+
children: Re(t)
|
|
1194
|
+
}));
|
|
1195
|
+
return N(() => {
|
|
1196
|
+
if (f === void 0) {
|
|
1197
|
+
pe.current = void 0;
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
let e = U.indexOf(f);
|
|
1201
|
+
if (pe.current === f || e === -1) return;
|
|
1202
|
+
let t = requestAnimationFrame(() => {
|
|
1203
|
+
ze.focusRow(e) && (pe.current = f);
|
|
1204
|
+
});
|
|
1205
|
+
return () => cancelAnimationFrame(t);
|
|
1206
|
+
}, [
|
|
1207
|
+
U,
|
|
1208
|
+
f,
|
|
1209
|
+
ye,
|
|
1210
|
+
ze
|
|
1211
|
+
]), /* @__PURE__ */ B("div", {
|
|
1212
|
+
...S.props(J.frame, He[G]),
|
|
1213
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1214
|
+
ref: ae.ref,
|
|
1215
|
+
"data-table-viewport": !0,
|
|
1216
|
+
role: "region",
|
|
1217
|
+
"aria-label": r,
|
|
1218
|
+
tabIndex: ae.tabIndex,
|
|
1219
|
+
...S.props(J.viewport, Ue[G], typeof x?.height == "number" && J.virtual(x.height)),
|
|
1220
|
+
children: [
|
|
1221
|
+
Y,
|
|
1222
|
+
x !== void 0 && /* @__PURE__ */ z("div", {
|
|
1223
|
+
"aria-hidden": !0,
|
|
1224
|
+
...S.props(J.sizer(le + K.size))
|
|
1225
|
+
}),
|
|
1226
|
+
/* @__PURE__ */ z("div", {
|
|
1227
|
+
ref: L,
|
|
1228
|
+
...S.props(w !== void 0 && J.endContent),
|
|
1229
|
+
children: w
|
|
1230
|
+
})
|
|
1231
|
+
]
|
|
1232
|
+
}), Ae && /* @__PURE__ */ B("div", {
|
|
1233
|
+
...S.props(J.footer),
|
|
1234
|
+
children: [E, D !== void 0 && /* @__PURE__ */ z(Fe, {
|
|
1235
|
+
...D,
|
|
1236
|
+
label: r
|
|
1237
|
+
})]
|
|
1238
|
+
})]
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
// packages/collections/src/table-query.tsx
|
|
1242
|
+
var mt = k(void 0);
|
|
1243
|
+
function Z(e) {
|
|
1244
|
+
if (e.reason.trim().length === 0) throw Error("A table query exception requires a reason.");
|
|
1245
|
+
}
|
|
1246
|
+
function ht({ search: e, filters: t, children: n, isFiltered: r = !1 }) {
|
|
1247
|
+
return e === void 0 ? /* @__PURE__ */ z(mt, {
|
|
1248
|
+
value: void 0,
|
|
1249
|
+
children: n
|
|
1250
|
+
}) : (e !== !0 && Z(e), t !== !0 && Z(t), /* @__PURE__ */ z(mt, {
|
|
1251
|
+
value: r,
|
|
1252
|
+
children: n
|
|
1253
|
+
}));
|
|
1254
|
+
}
|
|
1255
|
+
function gt(e) {
|
|
1256
|
+
if ("reason" in e) Z(e);
|
|
1257
|
+
else {
|
|
1258
|
+
if (e.length === 0) throw Error("Supply filter dimensions or explain why the table has none.");
|
|
1259
|
+
if (new Set(e.map((e) => e.id)).size !== e.length) throw Error("Each table filter must have a unique ID.");
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
var _t = [];
|
|
1263
|
+
function vt(e, t) {
|
|
1264
|
+
let [n, r] = I(""), [i, a] = I(/* @__PURE__ */ new Map()), o = typeof t.search == "function" ? t.search : void 0;
|
|
1265
|
+
typeof t.search != "function" && Z(t.search), gt(t.filters);
|
|
1266
|
+
let s = "reason" in t.filters ? _t : t.filters, c = o === void 0 ? void 0 : {
|
|
1267
|
+
value: n,
|
|
1268
|
+
onChange: r
|
|
1269
|
+
}, l = n.trim().toLowerCase(), u = P(() => s.map((t) => {
|
|
1270
|
+
let n = new Set(e.map(t.value)), r = i.get(t.id);
|
|
1271
|
+
r !== void 0 && n.add(r);
|
|
1272
|
+
let o = Array.from(n, (e) => ({
|
|
1273
|
+
value: `value:${e}`,
|
|
1274
|
+
label: t.formatLabel?.(e) ?? (e === "" ? "Unspecified" : e)
|
|
1275
|
+
}));
|
|
1276
|
+
return {
|
|
1277
|
+
id: t.id,
|
|
1278
|
+
label: t.label,
|
|
1279
|
+
options: [{
|
|
1280
|
+
value: "",
|
|
1281
|
+
label: "All"
|
|
1282
|
+
}, ...o],
|
|
1283
|
+
defaultValue: "",
|
|
1284
|
+
value: r === void 0 ? "" : `value:${r}`,
|
|
1285
|
+
onChange(e) {
|
|
1286
|
+
a((n) => {
|
|
1287
|
+
let r = new Map(n);
|
|
1288
|
+
return e === "" ? r.delete(t.id) : r.set(t.id, e.slice(6)), r;
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
|
+
}), [
|
|
1293
|
+
s,
|
|
1294
|
+
i,
|
|
1295
|
+
e
|
|
1296
|
+
]), d = l !== "" && o !== void 0, f = u.some((e) => e.value !== e.defaultValue);
|
|
1297
|
+
return {
|
|
1298
|
+
rows: d || f ? e.filter((e) => d && !o(e).toLowerCase().includes(l) ? !1 : s.every((t) => !i.has(t.id) || t.value(e) === i.get(t.id))) : e,
|
|
1299
|
+
search: c,
|
|
1300
|
+
filters: u,
|
|
1301
|
+
isFiltered: d || f
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1304
|
+
function yt() {
|
|
1305
|
+
let e = A(mt);
|
|
1306
|
+
if (e === void 0) throw Error("A frame-owned table requires its enclosing collection to supply TableQueryFrame.");
|
|
1307
|
+
return e;
|
|
1308
|
+
}
|
|
1309
|
+
function bt(e) {
|
|
1310
|
+
"reason" in e.search && Z(e.search), gt(e.filters);
|
|
1311
|
+
let t = "reason" in e.search ? void 0 : e.search, n = "reason" in e.filters ? [] : e.filters, r = (e.chips?.length ?? 0) > 0;
|
|
1312
|
+
return {
|
|
1313
|
+
search: t,
|
|
1314
|
+
filters: n,
|
|
1315
|
+
...e.chips !== void 0 && { chips: e.chips },
|
|
1316
|
+
isFiltered: !!t?.value.trim() || n.some((e) => e.value !== e.defaultValue) || r
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
// packages/collections/src/collection-filters.tsx
|
|
1320
|
+
var xt = {
|
|
1321
|
+
search: {
|
|
1322
|
+
kzqmXN: "xh8yej3",
|
|
1323
|
+
k1K539: "x1kk91vl",
|
|
1324
|
+
$$css: !0
|
|
1325
|
+
},
|
|
1326
|
+
icon: {
|
|
1327
|
+
k1xSpc: "x78zum5",
|
|
1328
|
+
kMwMTN: "x153jb6y",
|
|
1329
|
+
$$css: !0
|
|
1330
|
+
},
|
|
1331
|
+
positive: {
|
|
1332
|
+
kMwMTN: "x7ixh4y",
|
|
1333
|
+
$$css: !0
|
|
1334
|
+
},
|
|
1335
|
+
warning: {
|
|
1336
|
+
kMwMTN: "x1f9ixgr",
|
|
1337
|
+
$$css: !0
|
|
1338
|
+
},
|
|
1339
|
+
negative: {
|
|
1340
|
+
kMwMTN: "xr5kp14",
|
|
1341
|
+
$$css: !0
|
|
1342
|
+
}
|
|
1343
|
+
}, St = {
|
|
1344
|
+
positive: xt.positive,
|
|
1345
|
+
negative: xt.negative,
|
|
1346
|
+
warning: xt.warning,
|
|
1347
|
+
neutral: void 0
|
|
1348
|
+
}, Ct = /* @__PURE__ */ new Set([
|
|
1349
|
+
"Home",
|
|
1350
|
+
"End",
|
|
1351
|
+
"ArrowLeft",
|
|
1352
|
+
"ArrowRight",
|
|
1353
|
+
"Backspace",
|
|
1354
|
+
"Delete"
|
|
1355
|
+
]);
|
|
1356
|
+
function wt({ option: e }) {
|
|
1357
|
+
return /* @__PURE__ */ z("span", {
|
|
1358
|
+
...S.props(xt.icon, St[e.tone ?? "neutral"]),
|
|
1359
|
+
children: e.icon ?? /* @__PURE__ */ z(me, {
|
|
1360
|
+
size: 14,
|
|
1361
|
+
"aria-hidden": !0
|
|
1362
|
+
})
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
function Tt({ groups: e }) {
|
|
1366
|
+
let [n, i] = I(""), a = e.filter((e) => e.label.toLowerCase().includes(n.toLowerCase())), o = e.length === 1 && e[0] !== void 0 ? `Filter by ${e[0].label.toLowerCase()}` : "Filters", s = je(/* @__PURE__ */ z(t, {
|
|
1367
|
+
"aria-label": o,
|
|
1368
|
+
title: "Filters"
|
|
1369
|
+
}));
|
|
1370
|
+
return /* @__PURE__ */ B(p.Root, {
|
|
1371
|
+
onOpenChange: (e) => {
|
|
1372
|
+
e || i("");
|
|
1373
|
+
},
|
|
1374
|
+
children: [/* @__PURE__ */ z(p.Trigger, {
|
|
1375
|
+
render: s,
|
|
1376
|
+
children: /* @__PURE__ */ z(U, {
|
|
1377
|
+
size: 14,
|
|
1378
|
+
"aria-hidden": !0
|
|
1379
|
+
})
|
|
1380
|
+
}), /* @__PURE__ */ B(p.Popup, {
|
|
1381
|
+
align: "end",
|
|
1382
|
+
children: [
|
|
1383
|
+
/* @__PURE__ */ z(Et, {
|
|
1384
|
+
label: "Find a filter",
|
|
1385
|
+
value: n,
|
|
1386
|
+
onChange: i
|
|
1387
|
+
}),
|
|
1388
|
+
a.map((e) => /* @__PURE__ */ z(Dt, { group: e }, e.id)),
|
|
1389
|
+
a.length === 0 && /* @__PURE__ */ z("div", {
|
|
1390
|
+
className: "x1hmw7ec x5g2kb4",
|
|
1391
|
+
children: /* @__PURE__ */ z(r, { children: "No filters found" })
|
|
1392
|
+
})
|
|
1393
|
+
]
|
|
1394
|
+
})]
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
function Et({ label: e, value: t, onChange: n }) {
|
|
1398
|
+
return /* @__PURE__ */ z(x, {
|
|
1399
|
+
type: "search",
|
|
1400
|
+
"aria-label": e,
|
|
1401
|
+
placeholder: "Filter…",
|
|
1402
|
+
autoFocus: !0,
|
|
1403
|
+
value: t,
|
|
1404
|
+
onValueChange: n,
|
|
1405
|
+
onKeyDown: (e) => {
|
|
1406
|
+
(e.key.length === 1 || Ct.has(e.key)) && e.stopPropagation();
|
|
1407
|
+
},
|
|
1408
|
+
xstyle: xt.search
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
function Dt({ group: e }) {
|
|
1412
|
+
let [t, n] = I(""), i = e.options.filter((e) => e.label.toLowerCase().includes(t.toLowerCase()));
|
|
1413
|
+
return /* @__PURE__ */ B(p.SubmenuRoot, {
|
|
1414
|
+
onOpenChange: (e) => {
|
|
1415
|
+
e || n("");
|
|
1416
|
+
},
|
|
1417
|
+
children: [/* @__PURE__ */ B(p.SubmenuTrigger, { children: [
|
|
1418
|
+
e.icon ?? /* @__PURE__ */ z(U, {
|
|
1419
|
+
size: 14,
|
|
1420
|
+
"aria-hidden": !0
|
|
1421
|
+
}),
|
|
1422
|
+
/* @__PURE__ */ z("span", {
|
|
1423
|
+
className: "x98rzlu xeuugli xj0a0fe",
|
|
1424
|
+
children: e.label
|
|
1425
|
+
}),
|
|
1426
|
+
/* @__PURE__ */ z("span", {
|
|
1427
|
+
className: "xazcve0 xb3r6kr xuxw1ft xlyipyv x153jb6y xy8obcc xas2l8k",
|
|
1428
|
+
children: e.options.find((t) => t.value === e.value)?.label
|
|
1429
|
+
}),
|
|
1430
|
+
/* @__PURE__ */ z(H, {
|
|
1431
|
+
size: 14,
|
|
1432
|
+
"aria-hidden": !0
|
|
1433
|
+
})
|
|
1434
|
+
] }), /* @__PURE__ */ B(p.Popup, {
|
|
1435
|
+
align: "start",
|
|
1436
|
+
"aria-label": e.label,
|
|
1437
|
+
children: [
|
|
1438
|
+
/* @__PURE__ */ z(Et, {
|
|
1439
|
+
label: `Find ${e.label.toLowerCase()}`,
|
|
1440
|
+
value: t,
|
|
1441
|
+
onChange: n
|
|
1442
|
+
}),
|
|
1443
|
+
/* @__PURE__ */ z(p.RadioGroup, {
|
|
1444
|
+
value: e.value,
|
|
1445
|
+
onValueChange: e.onChange,
|
|
1446
|
+
children: i.map((e) => /* @__PURE__ */ B(p.RadioItem, {
|
|
1447
|
+
value: e.value,
|
|
1448
|
+
closeOnSelect: !0,
|
|
1449
|
+
children: [/* @__PURE__ */ z(wt, { option: e }), /* @__PURE__ */ z("span", {
|
|
1450
|
+
className: "x98rzlu xeuugli xj0a0fe",
|
|
1451
|
+
children: e.label
|
|
1452
|
+
})]
|
|
1453
|
+
}, e.value))
|
|
1454
|
+
}),
|
|
1455
|
+
i.length === 0 && /* @__PURE__ */ z("div", {
|
|
1456
|
+
className: "x1hmw7ec x5g2kb4",
|
|
1457
|
+
children: /* @__PURE__ */ z(r, { children: "No options found" })
|
|
1458
|
+
})
|
|
1459
|
+
]
|
|
1460
|
+
})]
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
// packages/collections/src/query-controls.tsx
|
|
1464
|
+
function Ot(e) {
|
|
1465
|
+
return {
|
|
1466
|
+
value: e.search?.value ?? "",
|
|
1467
|
+
filters: e.selections,
|
|
1468
|
+
disabled: e.isDisabled,
|
|
1469
|
+
available: e.search !== void 0 || e.groups.length > 0
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
function kt(e) {
|
|
1473
|
+
let t = JSON.parse(e);
|
|
1474
|
+
if (Array.isArray(t) && t.length === 2) {
|
|
1475
|
+
let e = t[0], n = t[1];
|
|
1476
|
+
if (typeof e == "string" && typeof n == "string") return [e, n];
|
|
1477
|
+
}
|
|
1478
|
+
throw Error("Select a listed filter option, or provide a filter ID and value.");
|
|
1479
|
+
}
|
|
1480
|
+
var At = L({
|
|
1481
|
+
name: "collection-query",
|
|
1482
|
+
options: {
|
|
1483
|
+
search: "value",
|
|
1484
|
+
groups: "list",
|
|
1485
|
+
selections: "value",
|
|
1486
|
+
isDisabled: "boolean"
|
|
1487
|
+
},
|
|
1488
|
+
state: Ot,
|
|
1489
|
+
sync: Ot,
|
|
1490
|
+
controlled: ["value", "filters"],
|
|
1491
|
+
api: ({ options: e }) => ({
|
|
1492
|
+
get setQuery() {
|
|
1493
|
+
let { search: t, isDisabled: n } = e();
|
|
1494
|
+
return n || t === void 0 ? null : (e) => {
|
|
1495
|
+
if (typeof e != "string") throw TypeError("The search term must be a string.");
|
|
1496
|
+
R({ options: () => t }, "onChange", e, { reason: "imperative" });
|
|
1497
|
+
};
|
|
1498
|
+
},
|
|
1499
|
+
get submitSearch() {
|
|
1500
|
+
let { search: t, isDisabled: n } = e();
|
|
1501
|
+
return n || t?.onSubmit === void 0 ? null : () => {
|
|
1502
|
+
R({ options: () => t }, "onSubmit", t.value, { reason: "imperative" });
|
|
1503
|
+
};
|
|
1504
|
+
},
|
|
1505
|
+
get setFilter() {
|
|
1506
|
+
let { groups: t, isDisabled: n } = e();
|
|
1507
|
+
return n || t.length === 0 ? null : (e, n) => {
|
|
1508
|
+
let [r, i] = n === void 0 ? kt(e) : [e, n], a = t.find((e) => e.id === r);
|
|
1509
|
+
if (a === void 0 || !a.options.some((e) => e.value === i)) throw Error("Unknown filter or option. Choose one of the listed filter options.");
|
|
1510
|
+
R({ options: () => a }, "onChange", i, { reason: "imperative" });
|
|
1511
|
+
};
|
|
1512
|
+
},
|
|
1513
|
+
items() {
|
|
1514
|
+
return e().groups.flatMap((e) => e.options.map((t) => ({
|
|
1515
|
+
value: JSON.stringify([e.id, t.value]),
|
|
1516
|
+
label: `${e.label} · ${t.label}`
|
|
1517
|
+
})));
|
|
1518
|
+
}
|
|
1519
|
+
}),
|
|
1520
|
+
agent: {
|
|
1521
|
+
actions: [
|
|
1522
|
+
"setQuery",
|
|
1523
|
+
"submitSearch",
|
|
1524
|
+
"setFilter"
|
|
1525
|
+
],
|
|
1526
|
+
items: (e) => e.items(),
|
|
1527
|
+
shown: (e) => e.available && !e.disabled
|
|
1528
|
+
},
|
|
1529
|
+
slots: (e) => ({ root: e({}) })
|
|
1530
|
+
}), jt = w(At, { root: "div" }).Root, Mt = { input: {
|
|
1531
|
+
k7Eaqz: "xeuugli",
|
|
1532
|
+
kUk6DE: "x98rzlu",
|
|
1533
|
+
$$css: !0
|
|
1534
|
+
} };
|
|
1535
|
+
function Nt({ label: e = "Collection controls", search: n, filters: r = [], filterContent: i, chips: a = [], viewActions: o, display: s, isPlaceholder: c = !1, isReady: l }) {
|
|
1536
|
+
let [u, d] = I(null), [f, p] = I(!1), [h, g] = I(!1), _ = F(null), v = F(null), y = F(null), b = P(() => Object.fromEntries(r.map((e) => [e.id, e.value])), [r]), S = c || !l, C = n !== void 0 && (f || n.value.length > 0);
|
|
1537
|
+
N(() => {
|
|
1538
|
+
f && !c && l && (y.current?.focus(), y.current?.select());
|
|
1539
|
+
}, [
|
|
1540
|
+
f,
|
|
1541
|
+
c,
|
|
1542
|
+
l
|
|
1543
|
+
]);
|
|
1544
|
+
function w() {
|
|
1545
|
+
(_.current ?? v.current?.querySelector("button"))?.focus();
|
|
1546
|
+
}
|
|
1547
|
+
function T() {
|
|
1548
|
+
n !== void 0 && !c && l && (y.current?.focus(), y.current?.select(), p(!0));
|
|
1549
|
+
}
|
|
1550
|
+
function E(e, t) {
|
|
1551
|
+
n !== void 0 && R({ options: () => n }, "onChange", "", {
|
|
1552
|
+
reason: e,
|
|
1553
|
+
event: t
|
|
1554
|
+
}), p(!1), w();
|
|
1555
|
+
}
|
|
1556
|
+
function D(e) {
|
|
1557
|
+
C && !e.defaultPrevented && e.key === "Escape" && e.target instanceof Element && e.target.closest("[role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"], [data-native-find], input:not([data-view-find]), textarea, select") === null && (e.preventDefault(), e.stopPropagation(), E("escape-key", e.nativeEvent));
|
|
1558
|
+
}
|
|
1559
|
+
let ee = {
|
|
1560
|
+
description: `Find in ${e}`,
|
|
1561
|
+
...u !== null && { layer: u },
|
|
1562
|
+
when: () => {
|
|
1563
|
+
if (u === null) return !1;
|
|
1564
|
+
let e = u.ownerDocument.activeElement, t = u.ownerDocument.getSelection();
|
|
1565
|
+
return e === null || t?.isCollapsed === !1 || e.closest("[data-native-find], article, pre, code, textarea, select, input:not([data-view-find]), [contenteditable=\"true\"], [role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"]") !== null ? !1 : e.closest("[data-table-query]") === u || e === u.ownerDocument.body && u.ownerDocument.querySelectorAll("[data-view-find-trigger]").length === 1;
|
|
1566
|
+
}
|
|
1567
|
+
}, k = u !== null && n !== void 0 && !S;
|
|
1568
|
+
_e(k ? "/" : null, T, ee), _e(k ? "mod+f" : null, T, ee);
|
|
1569
|
+
let A = r.filter((e) => e.value !== e.defaultValue).map((e) => ({
|
|
1570
|
+
id: `filter:${e.id}`,
|
|
1571
|
+
label: e.options.find((t) => t.value === e.value)?.label ?? e.value,
|
|
1572
|
+
onRemove: (t) => e.onChange(e.defaultValue, t)
|
|
1573
|
+
}));
|
|
1574
|
+
for (let e of a) A.push({
|
|
1575
|
+
...e,
|
|
1576
|
+
id: `chip:${e.id}`
|
|
1577
|
+
});
|
|
1578
|
+
let j = i !== void 0 || r.length > 0, M = O.toArray([o, s]).length > 0, te = n !== void 0 || j || M, ne = n?.label ?? "Search this view", re = n?.placeholder ?? "Find in view…", ie = te ? /* @__PURE__ */ B(Ae, {
|
|
1579
|
+
"aria-label": e,
|
|
1580
|
+
render: /* @__PURE__ */ z(jt, {
|
|
1581
|
+
search: n,
|
|
1582
|
+
groups: r,
|
|
1583
|
+
selections: b,
|
|
1584
|
+
isDisabled: S,
|
|
1585
|
+
ref: v,
|
|
1586
|
+
"aria-hidden": S,
|
|
1587
|
+
inert: S,
|
|
1588
|
+
className: "x78zum5 x6s0dn4 x1a02dak x13a6bvl x1hnptsi xeuugli x193iq5w"
|
|
1589
|
+
}),
|
|
1590
|
+
children: [
|
|
1591
|
+
n !== void 0 && /* @__PURE__ */ z(G, {
|
|
1592
|
+
disabled: c,
|
|
1593
|
+
render: /* @__PURE__ */ z(t, {
|
|
1594
|
+
ref: _,
|
|
1595
|
+
type: "button",
|
|
1596
|
+
"aria-label": "Find in view",
|
|
1597
|
+
title: "Find in view",
|
|
1598
|
+
"data-view-find-trigger": !0,
|
|
1599
|
+
"aria-expanded": C,
|
|
1600
|
+
onClick: T
|
|
1601
|
+
}),
|
|
1602
|
+
children: /* @__PURE__ */ z(he, {
|
|
1603
|
+
size: 14,
|
|
1604
|
+
"aria-hidden": !0
|
|
1605
|
+
})
|
|
1606
|
+
}),
|
|
1607
|
+
C && /* @__PURE__ */ B("div", {
|
|
1608
|
+
className: "x78zum5 x6s0dn4 xunmzkg xdl07me x193iq5w",
|
|
1609
|
+
children: [/* @__PURE__ */ z(K, {
|
|
1610
|
+
disabled: c,
|
|
1611
|
+
render: /* @__PURE__ */ z(x, {
|
|
1612
|
+
ref: y,
|
|
1613
|
+
type: "search",
|
|
1614
|
+
"data-view-find": !0,
|
|
1615
|
+
"aria-label": ne,
|
|
1616
|
+
placeholder: re,
|
|
1617
|
+
value: n.value,
|
|
1618
|
+
onValueChange: n.onChange,
|
|
1619
|
+
onKeyDown: (e) => {
|
|
1620
|
+
e.key === "Enter" && n.onSubmit !== void 0 && (e.preventDefault(), R({ options: () => n }, "onSubmit", n.value, {
|
|
1621
|
+
reason: "enter-key",
|
|
1622
|
+
event: e.nativeEvent
|
|
1623
|
+
})), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), E("escape-key", e.nativeEvent));
|
|
1624
|
+
},
|
|
1625
|
+
xstyle: Mt.input
|
|
1626
|
+
})
|
|
1627
|
+
}), /* @__PURE__ */ z(G, {
|
|
1628
|
+
render: /* @__PURE__ */ z(t, {
|
|
1629
|
+
type: "button",
|
|
1630
|
+
variant: "ghost",
|
|
1631
|
+
"data-view-find-close": !0,
|
|
1632
|
+
"aria-label": "Close search",
|
|
1633
|
+
title: "Close search (Esc)",
|
|
1634
|
+
onClick: (e) => E("clear-press", e.nativeEvent)
|
|
1635
|
+
}),
|
|
1636
|
+
children: /* @__PURE__ */ z(ge, {
|
|
1637
|
+
size: 14,
|
|
1638
|
+
"aria-hidden": !0
|
|
1639
|
+
})
|
|
1640
|
+
})]
|
|
1641
|
+
}),
|
|
1642
|
+
i === void 0 ? r.length > 0 ? /* @__PURE__ */ z(Tt, { groups: r }) : null : /* @__PURE__ */ B(m.Root, {
|
|
1643
|
+
open: h,
|
|
1644
|
+
onOpenChange: g,
|
|
1645
|
+
children: [/* @__PURE__ */ z(m.Trigger, {
|
|
1646
|
+
render: /* @__PURE__ */ z(G, { render: /* @__PURE__ */ z(t, {
|
|
1647
|
+
"aria-label": "Filters",
|
|
1648
|
+
title: "Filters"
|
|
1649
|
+
}) }),
|
|
1650
|
+
children: /* @__PURE__ */ z(U, {
|
|
1651
|
+
size: 14,
|
|
1652
|
+
"aria-hidden": !0
|
|
1653
|
+
})
|
|
1654
|
+
}), /* @__PURE__ */ B(m.Popup, {
|
|
1655
|
+
align: "end",
|
|
1656
|
+
className: "x1m258z3 xw7nakj",
|
|
1657
|
+
children: [/* @__PURE__ */ z(m.Title, { children: "Filters" }), i(() => g(!1))]
|
|
1658
|
+
})]
|
|
1659
|
+
}),
|
|
1660
|
+
o,
|
|
1661
|
+
s
|
|
1662
|
+
]
|
|
1663
|
+
}) : void 0;
|
|
1664
|
+
return {
|
|
1665
|
+
findRegion: {
|
|
1666
|
+
ref: d,
|
|
1667
|
+
"data-table-query": "",
|
|
1668
|
+
onKeyDown: D
|
|
1669
|
+
},
|
|
1670
|
+
openSearch: T,
|
|
1671
|
+
onKeyDown: D,
|
|
1672
|
+
actions: ie,
|
|
1673
|
+
chips: A.length > 0 && /* @__PURE__ */ z("div", {
|
|
1674
|
+
"aria-hidden": S,
|
|
1675
|
+
inert: S,
|
|
1676
|
+
className: "xjp7ctv",
|
|
1677
|
+
children: /* @__PURE__ */ z(Ne, {
|
|
1678
|
+
filters: A,
|
|
1679
|
+
onRemove: (e, t) => {
|
|
1680
|
+
w(), A.find((t) => t.id === e)?.onRemove(t);
|
|
1681
|
+
}
|
|
1682
|
+
})
|
|
1683
|
+
})
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
// packages/collections/src/data-table.tsx
|
|
1687
|
+
function Pt({ columns: e, rows: t = 3, hideCaption: n = !0, ...r }) {
|
|
1688
|
+
let i = typeof r.window?.height == "string" ? r.window.height : "content", a = Array.from({ length: t }, (e, t) => ({ id: String(t) })), o = e.map(({ placeholder: e, ...t }) => ({
|
|
1689
|
+
...t,
|
|
1690
|
+
cell: () => e ?? /* @__PURE__ */ z(l, { width: "60%" })
|
|
1691
|
+
}));
|
|
1692
|
+
return /* @__PURE__ */ z("div", {
|
|
1693
|
+
"aria-hidden": !0,
|
|
1694
|
+
inert: !0,
|
|
1695
|
+
...S.props(He[i], J.placeholder),
|
|
1696
|
+
children: /* @__PURE__ */ z(X, {
|
|
1697
|
+
...r,
|
|
1698
|
+
hideCaption: n,
|
|
1699
|
+
isPlaceholder: !0,
|
|
1700
|
+
rows: a,
|
|
1701
|
+
getRowId: (e) => e.id,
|
|
1702
|
+
columns: o,
|
|
1703
|
+
empty: null
|
|
1704
|
+
})
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
function Ft({ query: e, ...t }) {
|
|
1708
|
+
switch (e.mode) {
|
|
1709
|
+
case "local":
|
|
1710
|
+
if (t.onEndReached !== void 0 || t.pagination !== void 0) throw Error("Local table queries require all rows. Use a controlled or frame query for a paged source.");
|
|
1711
|
+
return /* @__PURE__ */ z(Lt, {
|
|
1712
|
+
query: e,
|
|
1713
|
+
table: t
|
|
1714
|
+
});
|
|
1715
|
+
case "controlled": return /* @__PURE__ */ z(Rt, {
|
|
1716
|
+
table: {
|
|
1717
|
+
...t,
|
|
1718
|
+
filteredEmpty: t.filteredEmpty ?? t.empty
|
|
1719
|
+
},
|
|
1720
|
+
...bt(e)
|
|
1721
|
+
});
|
|
1722
|
+
case "frame": return /* @__PURE__ */ z(It, { table: t });
|
|
1723
|
+
case "static": return Z(e), /* @__PURE__ */ z(ht, { children: /* @__PURE__ */ z(X, { ...t }) });
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
function It({ table: e }) {
|
|
1727
|
+
let t = yt();
|
|
1728
|
+
return /* @__PURE__ */ z(ht, { children: /* @__PURE__ */ z(X, {
|
|
1729
|
+
...e,
|
|
1730
|
+
empty: t ? e.filteredEmpty ?? "No matching records." : e.empty
|
|
1731
|
+
}) });
|
|
1732
|
+
}
|
|
1733
|
+
function Lt({ query: e, table: t }) {
|
|
1734
|
+
let { rows: n, search: r, filters: i, isFiltered: a } = vt(t.rows, e);
|
|
1735
|
+
return /* @__PURE__ */ z(Rt, {
|
|
1736
|
+
table: {
|
|
1737
|
+
...t,
|
|
1738
|
+
rows: n
|
|
1739
|
+
},
|
|
1740
|
+
search: r,
|
|
1741
|
+
filters: i,
|
|
1742
|
+
isFiltered: a
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
function Rt({ table: e, search: t, filters: n, chips: r, isFiltered: i }) {
|
|
1746
|
+
let a = Nt({
|
|
1747
|
+
...t !== void 0 && { search: t },
|
|
1748
|
+
filters: n,
|
|
1749
|
+
...r !== void 0 && { chips: r },
|
|
1750
|
+
isReady: !0,
|
|
1751
|
+
label: e.caption
|
|
1752
|
+
}), o = t !== void 0 || n.length > 0 || a.chips !== !1;
|
|
1753
|
+
return /* @__PURE__ */ z(ht, { children: /* @__PURE__ */ B("div", {
|
|
1754
|
+
...a.findRegion,
|
|
1755
|
+
...S.props(He[typeof e.window?.height == "string" ? e.window.height : "content"]),
|
|
1756
|
+
children: [o && /* @__PURE__ */ z(q, {
|
|
1757
|
+
label: `${e.caption} controls`,
|
|
1758
|
+
actions: a.actions,
|
|
1759
|
+
children: a.chips
|
|
1760
|
+
}), /* @__PURE__ */ z(X, {
|
|
1761
|
+
...e,
|
|
1762
|
+
empty: i ? e.filteredEmpty ?? "No matching records." : e.empty
|
|
1763
|
+
})]
|
|
1764
|
+
}) });
|
|
1765
|
+
}
|
|
1766
|
+
// packages/collections/src/collection-page.tsx
|
|
1767
|
+
var zt = [];
|
|
1768
|
+
function Bt({ navigation: e, ...t }) {
|
|
1769
|
+
return /* @__PURE__ */ z(Ht, {
|
|
1770
|
+
...t,
|
|
1771
|
+
surface: {
|
|
1772
|
+
kind: "page",
|
|
1773
|
+
navigation: e
|
|
1774
|
+
}
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
function Vt({ id: e, meta: t, ...n }) {
|
|
1778
|
+
return /* @__PURE__ */ z(Ht, {
|
|
1779
|
+
...n,
|
|
1780
|
+
surface: {
|
|
1781
|
+
kind: "section",
|
|
1782
|
+
id: e,
|
|
1783
|
+
meta: t
|
|
1784
|
+
}
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
function Ht(e) {
|
|
1788
|
+
let t = e.read.rows ?? zt;
|
|
1789
|
+
if (e.query.mode === "local") return /* @__PURE__ */ z(Ut, {
|
|
1790
|
+
collection: e,
|
|
1791
|
+
rows: t,
|
|
1792
|
+
query: e.query,
|
|
1793
|
+
surface: e.surface
|
|
1794
|
+
});
|
|
1795
|
+
let n = {
|
|
1796
|
+
...bt(e.query),
|
|
1797
|
+
rows: t
|
|
1798
|
+
};
|
|
1799
|
+
return /* @__PURE__ */ z(Wt, {
|
|
1800
|
+
collection: e,
|
|
1801
|
+
result: n,
|
|
1802
|
+
surface: e.surface
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
function Ut({ collection: e, rows: t, query: n, surface: r }) {
|
|
1806
|
+
let i = vt(t, n);
|
|
1807
|
+
return /* @__PURE__ */ z(Wt, {
|
|
1808
|
+
collection: e,
|
|
1809
|
+
result: i,
|
|
1810
|
+
surface: r
|
|
1811
|
+
});
|
|
1812
|
+
}
|
|
1813
|
+
function Wt({ collection: e, result: n, surface: r }) {
|
|
1814
|
+
let { title: i, caption: o = i, read: s, actions: c, placeholderRows: l, empty: p, filteredEmpty: h, query: g, window: _, ...v } = e, y = _ ?? (r.kind === "page" ? { height: "fill" } : void 0), b = y === void 0 ? {} : { window: y }, x = s.rows !== void 0, S = x || g.mode === "controlled", C = Nt({
|
|
1815
|
+
label: `${i} controls`,
|
|
1816
|
+
...n.search !== void 0 && { search: n.search },
|
|
1817
|
+
filters: n.filters,
|
|
1818
|
+
...n.chips !== void 0 && { chips: n.chips },
|
|
1819
|
+
isReady: S,
|
|
1820
|
+
isPlaceholder: !S && s.state === "pending"
|
|
1821
|
+
}), w = /* @__PURE__ */ B(ce, { children: [
|
|
1822
|
+
C.actions,
|
|
1823
|
+
c,
|
|
1824
|
+
x && s.state === "failed" && /* @__PURE__ */ B(m.Root, { children: [/* @__PURE__ */ z(m.Trigger, {
|
|
1825
|
+
render: /* @__PURE__ */ z(t, { "aria-label": `Could not refresh ${i}` }),
|
|
1826
|
+
children: /* @__PURE__ */ z(pe, {
|
|
1827
|
+
size: 16,
|
|
1828
|
+
"aria-hidden": !0
|
|
1829
|
+
})
|
|
1830
|
+
}), /* @__PURE__ */ B(m.Popup, {
|
|
1831
|
+
align: "end",
|
|
1832
|
+
children: [/* @__PURE__ */ z(m.Title, { children: "Refresh failed" }), s.failure]
|
|
1833
|
+
})] })
|
|
1834
|
+
] }), T = /* @__PURE__ */ z(Pt, {
|
|
1835
|
+
caption: o,
|
|
1836
|
+
columns: v.columns,
|
|
1837
|
+
hasSelectionColumn: v.selectedIds !== void 0,
|
|
1838
|
+
footer: v.footer,
|
|
1839
|
+
...v.pagination !== void 0 && { pagination: v.pagination },
|
|
1840
|
+
...v.hideHeaders !== void 0 && { hideHeaders: v.hideHeaders },
|
|
1841
|
+
...l !== void 0 && { rows: l },
|
|
1842
|
+
...v.rowSizing !== void 0 && { rowSizing: v.rowSizing },
|
|
1843
|
+
...b
|
|
1844
|
+
}), E = !x && s.state === "pending" ? { state: "pending" } : !x && s.state === "failed" ? {
|
|
1845
|
+
state: "failed",
|
|
1846
|
+
children: s.failure
|
|
1847
|
+
} : {
|
|
1848
|
+
state: "ready",
|
|
1849
|
+
children: /* @__PURE__ */ z(X, {
|
|
1850
|
+
...v,
|
|
1851
|
+
...b,
|
|
1852
|
+
caption: o,
|
|
1853
|
+
hideCaption: !0,
|
|
1854
|
+
rows: n.rows,
|
|
1855
|
+
resultStatus: s.state,
|
|
1856
|
+
empty: n.isFiltered ? h ?? "No matching records." : p
|
|
1857
|
+
})
|
|
1858
|
+
}, D = C.chips !== !1 && /* @__PURE__ */ z(q, {
|
|
1859
|
+
label: "Applied filters",
|
|
1860
|
+
children: C.chips
|
|
1861
|
+
}), O = /* @__PURE__ */ z(u, {
|
|
1862
|
+
label: `Loading ${i}`,
|
|
1863
|
+
placeholder: T,
|
|
1864
|
+
...E
|
|
1865
|
+
});
|
|
1866
|
+
return r.kind === "page" ? /* @__PURE__ */ z("div", {
|
|
1867
|
+
...C.findRegion,
|
|
1868
|
+
className: "x78zum5 xdt5ytf x12lumcd xeuugli x2lwn1j",
|
|
1869
|
+
children: /* @__PURE__ */ z(d, {
|
|
1870
|
+
title: i,
|
|
1871
|
+
actions: w,
|
|
1872
|
+
navigation: r.navigation,
|
|
1873
|
+
children: /* @__PURE__ */ z(f, {
|
|
1874
|
+
header: D,
|
|
1875
|
+
children: O
|
|
1876
|
+
})
|
|
1877
|
+
})
|
|
1878
|
+
}) : /* @__PURE__ */ B("div", {
|
|
1879
|
+
...C.findRegion,
|
|
1880
|
+
className: "xeuugli",
|
|
1881
|
+
children: [
|
|
1882
|
+
/* @__PURE__ */ z(a, {
|
|
1883
|
+
id: r.id,
|
|
1884
|
+
title: i,
|
|
1885
|
+
meta: r.meta,
|
|
1886
|
+
actions: w
|
|
1887
|
+
}),
|
|
1888
|
+
D,
|
|
1889
|
+
O
|
|
1890
|
+
]
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
// packages/collections/src/data-table-text.tsx
|
|
1894
|
+
function Gt({ children: e, leading: t, isDecorative: n = !1 }) {
|
|
1895
|
+
let r = O.toArray(t).length > 0;
|
|
1896
|
+
return /* @__PURE__ */ B("span", {
|
|
1897
|
+
"aria-hidden": n || void 0,
|
|
1898
|
+
inert: n || void 0,
|
|
1899
|
+
...S.props(J.textRow),
|
|
1900
|
+
children: [r && /* @__PURE__ */ z("span", {
|
|
1901
|
+
"aria-hidden": !0,
|
|
1902
|
+
...S.props(J.adornment),
|
|
1903
|
+
children: t
|
|
1904
|
+
}), /* @__PURE__ */ z("span", {
|
|
1905
|
+
...S.props(J.textColumn),
|
|
1906
|
+
children: e
|
|
1907
|
+
})]
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
function Kt({ children: e, secondary: t, leading: n, trailing: r, isMono: i = !1 }) {
|
|
1911
|
+
let a = O.toArray(r).length > 0;
|
|
1912
|
+
return /* @__PURE__ */ B(Gt, {
|
|
1913
|
+
leading: n,
|
|
1914
|
+
children: [/* @__PURE__ */ B("span", {
|
|
1915
|
+
...S.props(J.primaryRow),
|
|
1916
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1917
|
+
"data-record-text": !0,
|
|
1918
|
+
title: typeof e == "string" ? e : void 0,
|
|
1919
|
+
...S.props(J.text, J.primaryText, J.truncated, i && J.mono),
|
|
1920
|
+
children: e
|
|
1921
|
+
}), a && /* @__PURE__ */ z("span", {
|
|
1922
|
+
...S.props(J.adornment),
|
|
1923
|
+
children: r
|
|
1924
|
+
})]
|
|
1925
|
+
}), t !== void 0 && /* @__PURE__ */ z("span", {
|
|
1926
|
+
title: t,
|
|
1927
|
+
...S.props(J.text, J.truncated, J.secondaryText),
|
|
1928
|
+
children: t
|
|
1929
|
+
})]
|
|
1930
|
+
});
|
|
1931
|
+
}
|
|
1932
|
+
function qt({ leading: e, isSecondary: t = !1 }) {
|
|
1933
|
+
return /* @__PURE__ */ B(Gt, {
|
|
1934
|
+
leading: e,
|
|
1935
|
+
isDecorative: !0,
|
|
1936
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1937
|
+
...S.props(J.text),
|
|
1938
|
+
children: /* @__PURE__ */ z(l, { width: "70%" })
|
|
1939
|
+
}), t && /* @__PURE__ */ z("span", {
|
|
1940
|
+
...S.props(J.text, J.secondaryText),
|
|
1941
|
+
children: /* @__PURE__ */ z(l, { width: "45%" })
|
|
1942
|
+
})]
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
// packages/collections/src/card-columns-model.ts
|
|
1946
|
+
var Jt = {
|
|
1947
|
+
moveCard: "Move",
|
|
1948
|
+
moveTo: "Move to",
|
|
1949
|
+
empty: "No cards",
|
|
1950
|
+
loading: "Loading",
|
|
1951
|
+
failed: "Could not load"
|
|
1952
|
+
};
|
|
1953
|
+
// packages/collections/src/column-card.tsx
|
|
1954
|
+
function Yt({ title: e, destinations: n, labels: r, onMove: i }) {
|
|
1955
|
+
return /* @__PURE__ */ B(p.Root, { children: [/* @__PURE__ */ z(p.Trigger, { render: /* @__PURE__ */ z(t, {
|
|
1956
|
+
variant: "ghost",
|
|
1957
|
+
density: "compact",
|
|
1958
|
+
"aria-label": `${r.moveCard} ${e}`,
|
|
1959
|
+
children: /* @__PURE__ */ z(ue, { size: 14 })
|
|
1960
|
+
}) }), /* @__PURE__ */ z(p.Popup, {
|
|
1961
|
+
align: "end",
|
|
1962
|
+
children: /* @__PURE__ */ B(p.Group, { children: [/* @__PURE__ */ z(p.GroupLabel, { children: r.moveTo }), n.map((e) => /* @__PURE__ */ z(p.Item, {
|
|
1963
|
+
onSelect: () => i(e.id),
|
|
1964
|
+
children: e.title
|
|
1965
|
+
}, e.id))] })
|
|
1966
|
+
})] });
|
|
1967
|
+
}
|
|
1968
|
+
function Xt({ title: e, href: t }) {
|
|
1969
|
+
return t === void 0 ? e : /* @__PURE__ */ z(i, {
|
|
1970
|
+
href: t,
|
|
1971
|
+
children: e
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
function Zt({ summary: e, destinations: t, labels: n, onMove: r }) {
|
|
1975
|
+
let i = t.length > 0, a = e.status !== void 0 && e.status !== null, o = e.meta !== void 0 && e.meta !== null, s = e.actions !== void 0 && e.actions !== null;
|
|
1976
|
+
return /* @__PURE__ */ B("li", {
|
|
1977
|
+
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x9f619 x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi",
|
|
1978
|
+
children: [
|
|
1979
|
+
/* @__PURE__ */ B("div", {
|
|
1980
|
+
className: "x78zum5 x1cy8zhl x1hnptsi xeuugli",
|
|
1981
|
+
children: [
|
|
1982
|
+
e.leading !== void 0 && /* @__PURE__ */ z("span", {
|
|
1983
|
+
className: "x3nfvp2 x2lah0s",
|
|
1984
|
+
children: e.leading
|
|
1985
|
+
}),
|
|
1986
|
+
/* @__PURE__ */ z("span", {
|
|
1987
|
+
className: "x1cqoux5 xeuugli xk4h15q xj0a0fe",
|
|
1988
|
+
children: /* @__PURE__ */ z(Xt, {
|
|
1989
|
+
title: e.title,
|
|
1990
|
+
href: e.href
|
|
1991
|
+
})
|
|
1992
|
+
}),
|
|
1993
|
+
i && /* @__PURE__ */ z("span", {
|
|
1994
|
+
className: "x2lah0s",
|
|
1995
|
+
children: /* @__PURE__ */ z(Yt, {
|
|
1996
|
+
title: e.title,
|
|
1997
|
+
destinations: t,
|
|
1998
|
+
labels: n,
|
|
1999
|
+
onMove: r
|
|
2000
|
+
})
|
|
2001
|
+
})
|
|
2002
|
+
]
|
|
2003
|
+
}),
|
|
2004
|
+
a && /* @__PURE__ */ z("div", {
|
|
2005
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
|
|
2006
|
+
children: e.status
|
|
2007
|
+
}),
|
|
2008
|
+
o && /* @__PURE__ */ z("div", {
|
|
2009
|
+
className: "x78zum5 x1a02dak x6s0dn4 x8zbtdt x1hm1d26 xeuugli x153jb6y xy8obcc xas2l8k xss6m8b xj0a0fe",
|
|
2010
|
+
children: e.meta
|
|
2011
|
+
}),
|
|
2012
|
+
s && /* @__PURE__ */ z("div", {
|
|
2013
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
|
|
2014
|
+
children: e.actions
|
|
2015
|
+
})
|
|
2016
|
+
]
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
// packages/collections/src/card-columns.tsx
|
|
2020
|
+
var Qt = 3, $t = "—", Q = {
|
|
2021
|
+
board: {
|
|
2022
|
+
k1xSpc: "x78zum5",
|
|
2023
|
+
kGNEyG: "x1qjc9v5",
|
|
2024
|
+
kOIVth: "x1n8ia3y",
|
|
2025
|
+
k7Eaqz: "xeuugli",
|
|
2026
|
+
ks0D6T: "x193iq5w",
|
|
2027
|
+
kXHlph: "xw2csxc",
|
|
2028
|
+
kvh3hx: "x7p5m3t",
|
|
2029
|
+
k3XXqK: "x1t137rt",
|
|
2030
|
+
kPJHz1: "x13qnu6",
|
|
2031
|
+
k7shQP: "x9v5kkp",
|
|
2032
|
+
kZs9gx: "x19rmrnh",
|
|
2033
|
+
kiEn40: "x1bqaal",
|
|
2034
|
+
$$css: !0
|
|
2035
|
+
},
|
|
2036
|
+
natural: { $$css: !0 },
|
|
2037
|
+
fill: {
|
|
2038
|
+
kZKoxP: "x5yr21d",
|
|
2039
|
+
$$css: !0
|
|
2040
|
+
},
|
|
2041
|
+
column: {
|
|
2042
|
+
k1xSpc: "x78zum5",
|
|
2043
|
+
kXwgrk: "xdt5ytf",
|
|
2044
|
+
kUk6DE: "xwgdodg",
|
|
2045
|
+
kOIVth: "x1hnptsi",
|
|
2046
|
+
k7Eaqz: "xeuugli",
|
|
2047
|
+
kB7OPa: "x9f619",
|
|
2048
|
+
kmVPX3: "x69ldcm",
|
|
2049
|
+
kaIpWk: "xy32g2j",
|
|
2050
|
+
kWkggS: "x1r7kqkb",
|
|
2051
|
+
$$css: !0
|
|
2052
|
+
},
|
|
2053
|
+
columnNatural: { $$css: !0 },
|
|
2054
|
+
columnFill: {
|
|
2055
|
+
kAzted: "x2lwn1j",
|
|
2056
|
+
$$css: !0
|
|
2057
|
+
},
|
|
2058
|
+
scroll: {
|
|
2059
|
+
k1xSpc: "x78zum5",
|
|
2060
|
+
kXwgrk: "xdt5ytf",
|
|
2061
|
+
k7Eaqz: "xeuugli",
|
|
2062
|
+
kORKVm: "x1odjw0f",
|
|
2063
|
+
kacamN: "x1e4zzel",
|
|
2064
|
+
k3XXqK: "x1t137rt",
|
|
2065
|
+
kPJHz1: "x13qnu6",
|
|
2066
|
+
k7shQP: "x9v5kkp",
|
|
2067
|
+
kZs9gx: "x19rmrnh",
|
|
2068
|
+
kiEn40: "x1bqaal",
|
|
2069
|
+
$$css: !0
|
|
2070
|
+
},
|
|
2071
|
+
bounded: {
|
|
2072
|
+
kskxy: "x1mpjnf3",
|
|
2073
|
+
$$css: !0
|
|
2074
|
+
},
|
|
2075
|
+
scrollFill: {
|
|
2076
|
+
kUk6DE: "x1cqoux5",
|
|
2077
|
+
kAzted: "x2lwn1j",
|
|
2078
|
+
$$css: !0
|
|
2079
|
+
}
|
|
2080
|
+
}, en = {
|
|
2081
|
+
bounded: Q.bounded,
|
|
2082
|
+
fill: Q.scrollFill
|
|
2083
|
+
}, tn = {
|
|
2084
|
+
bounded: Q.columnNatural,
|
|
2085
|
+
fill: Q.columnFill
|
|
2086
|
+
}, nn = {
|
|
2087
|
+
bounded: Q.natural,
|
|
2088
|
+
fill: Q.fill
|
|
2089
|
+
};
|
|
2090
|
+
function rn({ column: e, status: t, words: n, children: r }) {
|
|
2091
|
+
return e.items.length > 0 ? /* @__PURE__ */ z("ul", {
|
|
2092
|
+
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1ghz6dp x1717udv xe8uvvx",
|
|
2093
|
+
children: r
|
|
2094
|
+
}) : t === "pending" ? /* @__PURE__ */ B("div", {
|
|
2095
|
+
role: "status",
|
|
2096
|
+
className: "x1ghz6dp x1qokhjc x14w6jbu x153jb6y x1hz01jw xy8obcc xas2l8k xj0a0fe",
|
|
2097
|
+
children: [/* @__PURE__ */ z("span", {
|
|
2098
|
+
...S.props(_.hidden),
|
|
2099
|
+
children: n.loading
|
|
2100
|
+
}), /* @__PURE__ */ z(l, { lines: Qt })]
|
|
2101
|
+
}) : t === "failed" ? /* @__PURE__ */ z("p", {
|
|
2102
|
+
role: "alert",
|
|
2103
|
+
className: "x1ghz6dp x1qokhjc x14w6jbu x1hz01jw xy8obcc xas2l8k xj0a0fe xr5kp14",
|
|
2104
|
+
children: n.failed
|
|
2105
|
+
}) : /* @__PURE__ */ z("p", {
|
|
2106
|
+
className: "x1ghz6dp x1qokhjc x14w6jbu x153jb6y x1hz01jw xy8obcc xas2l8k xj0a0fe",
|
|
2107
|
+
children: e.empty ?? n.empty
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
function an({ count: e, isAvailable: t, locale: n }) {
|
|
2111
|
+
return t ? new Intl.NumberFormat(n).format(e) : $t;
|
|
2112
|
+
}
|
|
2113
|
+
function on({ columns: e, fromColumnId: t, summary: n, isMovable: r }) {
|
|
2114
|
+
if (!r) return [];
|
|
2115
|
+
let { moveTargets: i } = n;
|
|
2116
|
+
return e.filter((e) => e.id === t ? !1 : i === void 0 || i.includes(e.id));
|
|
2117
|
+
}
|
|
2118
|
+
function sn({ column: e, columns: t, status: n, words: r, columnHeight: i, locale: a, getCardId: o, getCard: s, onMoveCard: c }) {
|
|
2119
|
+
let l = M(), u = b(), d = e.items.length > 0 || n === "ready", f = an({
|
|
2120
|
+
count: e.items.length,
|
|
2121
|
+
isAvailable: d,
|
|
2122
|
+
locale: a
|
|
2123
|
+
});
|
|
2124
|
+
return /* @__PURE__ */ B("div", {
|
|
2125
|
+
...S.props(Q.column, tn[i]),
|
|
2126
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2127
|
+
className: "x78zum5 x1pha0wt x1qughib x1hnptsi xeuugli x14w6jbu",
|
|
2128
|
+
children: [/* @__PURE__ */ z("h3", {
|
|
2129
|
+
id: l,
|
|
2130
|
+
className: "xeuugli x1ghz6dp x1hz01jw xtqrqnz x1778rvt xk4h15q xbixft xj0a0fe",
|
|
2131
|
+
children: e.title
|
|
2132
|
+
}), /* @__PURE__ */ z("span", {
|
|
2133
|
+
className: "x2lah0s x153jb6y x1hz01jw xy8obcc xas2l8k xss6m8b",
|
|
2134
|
+
children: f
|
|
2135
|
+
})]
|
|
2136
|
+
}), /* @__PURE__ */ z("div", {
|
|
2137
|
+
ref: u.ref,
|
|
2138
|
+
role: "region",
|
|
2139
|
+
"aria-labelledby": l,
|
|
2140
|
+
tabIndex: u.tabIndex,
|
|
2141
|
+
...S.props(Q.scroll, en[i]),
|
|
2142
|
+
children: /* @__PURE__ */ z(rn, {
|
|
2143
|
+
column: e,
|
|
2144
|
+
status: n,
|
|
2145
|
+
words: r,
|
|
2146
|
+
children: e.items.map((n) => {
|
|
2147
|
+
let i = s(n), a = on({
|
|
2148
|
+
columns: t,
|
|
2149
|
+
fromColumnId: e.id,
|
|
2150
|
+
summary: i,
|
|
2151
|
+
isMovable: c !== void 0
|
|
2152
|
+
});
|
|
2153
|
+
return /* @__PURE__ */ z(Zt, {
|
|
2154
|
+
summary: i,
|
|
2155
|
+
destinations: a,
|
|
2156
|
+
labels: r,
|
|
2157
|
+
onMove: (t) => c?.({
|
|
2158
|
+
item: n,
|
|
2159
|
+
fromColumnId: e.id,
|
|
2160
|
+
toColumnId: t
|
|
2161
|
+
})
|
|
2162
|
+
}, o(n));
|
|
2163
|
+
})
|
|
2164
|
+
})
|
|
2165
|
+
})]
|
|
2166
|
+
});
|
|
2167
|
+
}
|
|
2168
|
+
function cn({ label: e, columns: t, status: n = "ready", columnHeight: r = "bounded", labels: i, ...a }) {
|
|
2169
|
+
let o = b(), s = {
|
|
2170
|
+
...Jt,
|
|
2171
|
+
...i
|
|
2172
|
+
};
|
|
2173
|
+
return /* @__PURE__ */ z("div", {
|
|
2174
|
+
ref: o.ref,
|
|
2175
|
+
role: "region",
|
|
2176
|
+
"aria-label": e,
|
|
2177
|
+
"aria-busy": n === "pending",
|
|
2178
|
+
tabIndex: o.tabIndex,
|
|
2179
|
+
...S.props(Q.board, nn[r]),
|
|
2180
|
+
children: t.map((e) => /* @__PURE__ */ z(sn, {
|
|
2181
|
+
...a,
|
|
2182
|
+
column: e,
|
|
2183
|
+
columns: t,
|
|
2184
|
+
status: n,
|
|
2185
|
+
words: s,
|
|
2186
|
+
columnHeight: r
|
|
2187
|
+
}, e.id))
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
// packages/collections/src/collection-scroll.tsx
|
|
2191
|
+
function ln(t) {
|
|
2192
|
+
switch (t.status) {
|
|
2193
|
+
case "loading": return /* @__PURE__ */ z(n, {
|
|
2194
|
+
role: "status",
|
|
2195
|
+
variant: "caption",
|
|
2196
|
+
tone: "muted",
|
|
2197
|
+
children: t.message ?? "Loading…"
|
|
2198
|
+
});
|
|
2199
|
+
case "complete": return t.message === void 0 ? null : /* @__PURE__ */ z(n, {
|
|
2200
|
+
variant: "caption",
|
|
2201
|
+
tone: "muted",
|
|
2202
|
+
children: t.message
|
|
2203
|
+
});
|
|
2204
|
+
case "ready": return /* @__PURE__ */ z(e, {
|
|
2205
|
+
onClick: t.onLoadMore,
|
|
2206
|
+
children: t.message ?? "Load more"
|
|
2207
|
+
});
|
|
2208
|
+
case "error": return /* @__PURE__ */ B(o, {
|
|
2209
|
+
role: "status",
|
|
2210
|
+
children: [/* @__PURE__ */ z(n, {
|
|
2211
|
+
variant: "caption",
|
|
2212
|
+
tone: "muted",
|
|
2213
|
+
children: t.message ?? "More records could not be loaded."
|
|
2214
|
+
}), /* @__PURE__ */ z(e, {
|
|
2215
|
+
onClick: t.onLoadMore,
|
|
2216
|
+
children: "Retry"
|
|
2217
|
+
})]
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
function un({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, endPosition: i = "end", label: a = "Collection" }) {
|
|
2222
|
+
let o = b(), s = o.viewport, c = F(null);
|
|
2223
|
+
ct({
|
|
2224
|
+
end: c,
|
|
2225
|
+
viewport: r ? s : void 0,
|
|
2226
|
+
onEndReached: n,
|
|
2227
|
+
content: e
|
|
2228
|
+
});
|
|
2229
|
+
let l = /* @__PURE__ */ z("div", {
|
|
2230
|
+
ref: c,
|
|
2231
|
+
...{
|
|
2232
|
+
0: {},
|
|
2233
|
+
1: { className: "x15x95ik x1az1eml xid9utz x1c8xbx5 x153jb6y xy8obcc x1hz01jw xas2l8k x2b8uid" }
|
|
2234
|
+
}[t !== void 0 | 0],
|
|
2235
|
+
children: t
|
|
2236
|
+
});
|
|
2237
|
+
return /* @__PURE__ */ B("div", {
|
|
2238
|
+
ref: o.ref,
|
|
2239
|
+
role: r ? "region" : void 0,
|
|
2240
|
+
"aria-label": r ? a : void 0,
|
|
2241
|
+
tabIndex: o.tabIndex,
|
|
2242
|
+
...{
|
|
2243
|
+
0: { className: "xeuugli" },
|
|
2244
|
+
1: { className: "xeuugli x98rzlu x2lwn1j x1odjw0f xy5w88m x1t137rt x13qnu6 x9v5kkp x19rmrnh x1bqaal" }
|
|
2245
|
+
}[!!r | 0],
|
|
2246
|
+
children: [
|
|
2247
|
+
i === "start" && l,
|
|
2248
|
+
e,
|
|
2249
|
+
i === "end" && l
|
|
2250
|
+
]
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
// packages/collections/src/inspector.tsx
|
|
2254
|
+
var dn = 860, fn = k(void 0);
|
|
2255
|
+
function pn({ reading: e }) {
|
|
2256
|
+
return { value: e };
|
|
2257
|
+
}
|
|
2258
|
+
var mn = L({
|
|
2259
|
+
name: "detail-field",
|
|
2260
|
+
options: { reading: "string" },
|
|
2261
|
+
state: pn,
|
|
2262
|
+
sync: pn,
|
|
2263
|
+
api: () => ({}),
|
|
2264
|
+
agent: { actions: [] },
|
|
2265
|
+
slots: (e) => ({ root: e({}) })
|
|
2266
|
+
}), hn = w(mn, { root: "dd" }).Root;
|
|
2267
|
+
function gn({ master: t, detail: n, label: r, masterLabel: i, revealKey: a, returnFocusRef: o, ...s }) {
|
|
2268
|
+
let c = M(), l = F(null), u = F(null), d = F(null);
|
|
2269
|
+
N(() => {
|
|
2270
|
+
a !== void 0 && l.current !== null && d.current !== null && l.current.clientWidth <= dn && (d.current.focus({ preventScroll: !0 }), d.current.scrollIntoView({
|
|
2271
|
+
block: "start",
|
|
2272
|
+
behavior: "instant"
|
|
2273
|
+
}));
|
|
2274
|
+
}, [a]);
|
|
2275
|
+
function f() {
|
|
2276
|
+
let e = o?.current ?? u.current;
|
|
2277
|
+
e?.focus({ preventScroll: !0 }), e?.scrollIntoView({
|
|
2278
|
+
block: "nearest",
|
|
2279
|
+
behavior: "instant"
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
return /* @__PURE__ */ z("div", {
|
|
2283
|
+
...T({ className: "x9vvk8s x12h1iku xeuugli xbixft x1hz01jw xtqrqnz x1778rvt" }, s),
|
|
2284
|
+
children: /* @__PURE__ */ B("div", {
|
|
2285
|
+
ref: l,
|
|
2286
|
+
className: "xrvj5dj x4ruv2j x1y7acmc x7a106z x1j825kq xeuugli",
|
|
2287
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2288
|
+
ref: u,
|
|
2289
|
+
role: "group",
|
|
2290
|
+
"aria-label": i,
|
|
2291
|
+
"aria-details": c,
|
|
2292
|
+
tabIndex: -1,
|
|
2293
|
+
className: "xeuugli",
|
|
2294
|
+
children: t
|
|
2295
|
+
}), /* @__PURE__ */ B("aside", {
|
|
2296
|
+
ref: d,
|
|
2297
|
+
id: c,
|
|
2298
|
+
"aria-label": r,
|
|
2299
|
+
tabIndex: -1,
|
|
2300
|
+
className: "x7wzq59 x7cfggw xqfmuo8 xeuugli x1sbza1b xhuqrux xexx8yu xdz7uhd xpilrb4 xdctr63 x1t7ytsu x97x49r x972fbf x1mg79u0 x13fuv20 xhjagg4 x14ijc3v x13qnu6 x9v5kkp x19rmrnh x12ijfkc",
|
|
2301
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2302
|
+
className: "x1s85apg x1yamub6 x1xxlxpq",
|
|
2303
|
+
children: /* @__PURE__ */ B(e, {
|
|
2304
|
+
variant: "ghost",
|
|
2305
|
+
onClick: f,
|
|
2306
|
+
children: ["Back to ", i.toLowerCase()]
|
|
2307
|
+
})
|
|
2308
|
+
}), /* @__PURE__ */ z(fn.Provider, {
|
|
2309
|
+
value: r,
|
|
2310
|
+
children: n
|
|
2311
|
+
})]
|
|
2312
|
+
})]
|
|
2313
|
+
})
|
|
2314
|
+
});
|
|
2315
|
+
}
|
|
2316
|
+
function _n({ value: e, label: t }) {
|
|
2317
|
+
let n = typeof e == "number" ? String(e) : e;
|
|
2318
|
+
return typeof n == "string" ? /* @__PURE__ */ z(hn, {
|
|
2319
|
+
"aria-label": t,
|
|
2320
|
+
reading: n,
|
|
2321
|
+
className: "xeuugli x1ghz6dp xbixft xj0a0fe xss6m8b",
|
|
2322
|
+
children: n
|
|
2323
|
+
}) : /* @__PURE__ */ z("dd", {
|
|
2324
|
+
className: "xeuugli x1ghz6dp xbixft xj0a0fe xss6m8b",
|
|
2325
|
+
children: e
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
function vn({ items: e, ...t }) {
|
|
2329
|
+
let n = A(fn), r = t["aria-label"] ?? n;
|
|
2330
|
+
return /* @__PURE__ */ z("dl", {
|
|
2331
|
+
...T({ className: "x1ghz6dp xrvj5dj xezdspq x1i3977y xuytk5h x1hz01jw xvmahel xtqrqnz x1778rvt" }, t),
|
|
2332
|
+
children: e.map(({ label: e, value: t }) => /* @__PURE__ */ B("div", {
|
|
2333
|
+
className: "xjp7ctv",
|
|
2334
|
+
children: [/* @__PURE__ */ z("dt", {
|
|
2335
|
+
className: "xeuugli x153jb6y xj0a0fe",
|
|
2336
|
+
children: e
|
|
2337
|
+
}), /* @__PURE__ */ z(_n, {
|
|
2338
|
+
value: t,
|
|
2339
|
+
label: r === void 0 ? e : `${r} · ${e}`
|
|
2340
|
+
})]
|
|
2341
|
+
}, e))
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
// packages/collections/src/list-footer.tsx
|
|
2345
|
+
function yn({ children: e, actions: t, ...n }) {
|
|
2346
|
+
return /* @__PURE__ */ B("div", {
|
|
2347
|
+
...T({ className: "x78zum5 x6s0dn4 x1qughib x1a02dak xeuugli x1n8ia3y x1qokhjc x1m92p3w x178xt8z x13fuv20 xhjagg4 x153jb6y x1hz01jw xvmahel xtqrqnz x1778rvt" }, n),
|
|
2348
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2349
|
+
className: "xeuugli xj0a0fe",
|
|
2350
|
+
children: e
|
|
2351
|
+
}), t != null && /* @__PURE__ */ z("div", {
|
|
2352
|
+
className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli",
|
|
2353
|
+
children: t
|
|
2354
|
+
})]
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
// packages/collections/src/metrics.tsx
|
|
2358
|
+
var $ = {
|
|
2359
|
+
grid: {
|
|
2360
|
+
k1xSpc: "x78zum5",
|
|
2361
|
+
kwnvtZ: "x1a02dak",
|
|
2362
|
+
khm7nJ: "xpb3s3w",
|
|
2363
|
+
k1C7PZ: "x1i3977y",
|
|
2364
|
+
k7Eaqz: "xeuugli",
|
|
2365
|
+
kogj98: "x1ghz6dp",
|
|
2366
|
+
$$css: !0
|
|
2367
|
+
},
|
|
2368
|
+
columns: {
|
|
2369
|
+
k1xSpc: "xrvj5dj",
|
|
2370
|
+
kumcoG: "xpuu00s",
|
|
2371
|
+
kOIVth: "x1j825kq",
|
|
2372
|
+
k7Eaqz: "xeuugli",
|
|
2373
|
+
kogj98: "x1ghz6dp",
|
|
2374
|
+
$$css: !0
|
|
2375
|
+
},
|
|
2376
|
+
metric: {
|
|
2377
|
+
k1xSpc: "x3nfvp2",
|
|
2378
|
+
kGNEyG: "x1pha0wt",
|
|
2379
|
+
kwnvtZ: "x1a02dak",
|
|
2380
|
+
kOIVth: "xunmzkg",
|
|
2381
|
+
k7Eaqz: "xeuugli",
|
|
2382
|
+
kMv6JI: "x1hz01jw",
|
|
2383
|
+
khiITx: "xvmahel",
|
|
2384
|
+
kGuDYH: "xtqrqnz",
|
|
2385
|
+
kLWn49: "x1778rvt",
|
|
2386
|
+
$$css: !0
|
|
2387
|
+
},
|
|
2388
|
+
label: {
|
|
2389
|
+
k7Eaqz: "xeuugli",
|
|
2390
|
+
kMwMTN: "x153jb6y",
|
|
2391
|
+
kayTVb: "x9ek82g",
|
|
2392
|
+
kHjlTd: "xj0a0fe",
|
|
2393
|
+
$$css: !0
|
|
2394
|
+
},
|
|
2395
|
+
value: {
|
|
2396
|
+
k7Eaqz: "xeuugli",
|
|
2397
|
+
kogj98: "x1ghz6dp",
|
|
2398
|
+
kMwMTN: "xbixft",
|
|
2399
|
+
k63SB2: "xk4h15q",
|
|
2400
|
+
kcqcaj: "xss6m8b",
|
|
2401
|
+
kHjlTd: "xj0a0fe",
|
|
2402
|
+
$$css: !0
|
|
2403
|
+
},
|
|
2404
|
+
statistic: {
|
|
2405
|
+
kXwgrk: "xdt5ytf",
|
|
2406
|
+
kGNEyG: "x1cy8zhl",
|
|
2407
|
+
$$css: !0
|
|
2408
|
+
},
|
|
2409
|
+
stackedLabel: {
|
|
2410
|
+
kayTVb: "x1g77sc7",
|
|
2411
|
+
$$css: !0
|
|
2412
|
+
},
|
|
2413
|
+
statisticValue: {
|
|
2414
|
+
kGuDYH: "x71lla1",
|
|
2415
|
+
kLWn49: "xgkpprq",
|
|
2416
|
+
k63SB2: "x1b5ytql",
|
|
2417
|
+
kb6lSQ: "x1wjjqco",
|
|
2418
|
+
$$css: !0
|
|
2419
|
+
},
|
|
2420
|
+
headline: {
|
|
2421
|
+
k1C7PZ: "xa2sdi0",
|
|
2422
|
+
$$css: !0
|
|
2423
|
+
},
|
|
2424
|
+
headlineLabel: {
|
|
2425
|
+
kayTVb: "x1g77sc7",
|
|
2426
|
+
kCS8Yb: "x1l7klhg",
|
|
2427
|
+
kGuDYH: "xy8obcc",
|
|
2428
|
+
$$css: !0
|
|
2429
|
+
},
|
|
2430
|
+
headlineValue: {
|
|
2431
|
+
kGuDYH: "xc0f4dz",
|
|
2432
|
+
kLWn49: "xzju6ct",
|
|
2433
|
+
k63SB2: "xtjd4bd",
|
|
2434
|
+
kb6lSQ: "x1wjjqco",
|
|
2435
|
+
$$css: !0
|
|
2436
|
+
},
|
|
2437
|
+
detail: {
|
|
2438
|
+
k7Eaqz: "xeuugli",
|
|
2439
|
+
kogj98: "x1ghz6dp",
|
|
2440
|
+
kMwMTN: "x153jb6y",
|
|
2441
|
+
kGuDYH: "xy8obcc",
|
|
2442
|
+
kLWn49: "xas2l8k",
|
|
2443
|
+
kAzted: "x1mqbd49",
|
|
2444
|
+
kHjlTd: "xj0a0fe",
|
|
2445
|
+
$$css: !0
|
|
2446
|
+
},
|
|
2447
|
+
inlineDetail: {
|
|
2448
|
+
kCS8Yb: "x1l7klhg",
|
|
2449
|
+
$$css: !0
|
|
2450
|
+
},
|
|
2451
|
+
change: {
|
|
2452
|
+
k1xSpc: "x3nfvp2",
|
|
2453
|
+
kGNEyG: "x6s0dn4",
|
|
2454
|
+
k8WAf4: "x10dazmo",
|
|
2455
|
+
kg3NbH: "x5g2kb4",
|
|
2456
|
+
kaIpWk: "x1ok0vyi",
|
|
2457
|
+
kGuDYH: "xy8obcc",
|
|
2458
|
+
kLWn49: "xas2l8k",
|
|
2459
|
+
k63SB2: "xk4h15q",
|
|
2460
|
+
kb6lSQ: "x1i21sxh",
|
|
2461
|
+
kcqcaj: "xss6m8b",
|
|
2462
|
+
kWkggS: "x1r7kqkb",
|
|
2463
|
+
kMwMTN: "x153jb6y",
|
|
2464
|
+
$$css: !0
|
|
2465
|
+
},
|
|
2466
|
+
changePositive: {
|
|
2467
|
+
kWkggS: "x1r8u7ye",
|
|
2468
|
+
kMwMTN: "x7ixh4y",
|
|
2469
|
+
$$css: !0
|
|
2470
|
+
},
|
|
2471
|
+
changeNegative: {
|
|
2472
|
+
kWkggS: "xcqwzn",
|
|
2473
|
+
kMwMTN: "xr5kp14",
|
|
2474
|
+
$$css: !0
|
|
2475
|
+
}
|
|
2476
|
+
}, bn = {
|
|
2477
|
+
inline: {
|
|
2478
|
+
metric: void 0,
|
|
2479
|
+
label: void 0,
|
|
2480
|
+
value: void 0,
|
|
2481
|
+
detail: $.inlineDetail,
|
|
2482
|
+
valueWidth: "5ch"
|
|
2483
|
+
},
|
|
2484
|
+
statistic: {
|
|
2485
|
+
metric: $.statistic,
|
|
2486
|
+
label: $.stackedLabel,
|
|
2487
|
+
value: $.statisticValue,
|
|
2488
|
+
detail: void 0,
|
|
2489
|
+
valueWidth: "5ch"
|
|
2490
|
+
},
|
|
2491
|
+
headline: {
|
|
2492
|
+
metric: $.headline,
|
|
2493
|
+
label: $.headlineLabel,
|
|
2494
|
+
value: $.headlineValue,
|
|
2495
|
+
detail: void 0,
|
|
2496
|
+
valueWidth: "9ch"
|
|
2497
|
+
}
|
|
2498
|
+
}, xn = {
|
|
2499
|
+
inline: $.grid,
|
|
2500
|
+
columns: $.columns
|
|
2501
|
+
};
|
|
2502
|
+
function Sn({ layout: e = "inline", ...t }) {
|
|
2503
|
+
return /* @__PURE__ */ z("dl", { ...T(S.props(xn[e]), t) });
|
|
2504
|
+
}
|
|
2505
|
+
function Cn({ label: e, value: t, detail: n, change: r, target: i, isLoading: a = !1, hasDetail: o = !1, variant: s = "inline", trend: c, ...u }) {
|
|
2506
|
+
let d = bn[s], f = a && o || n !== void 0, p = r?.tone === "positive" ? $.changePositive : r?.tone === "negative" ? $.changeNegative : void 0;
|
|
2507
|
+
return /* @__PURE__ */ B("div", {
|
|
2508
|
+
...T(S.props($.metric, d.metric), u),
|
|
2509
|
+
children: [
|
|
2510
|
+
/* @__PURE__ */ z("dt", {
|
|
2511
|
+
...S.props($.label, d.label),
|
|
2512
|
+
children: e
|
|
2513
|
+
}),
|
|
2514
|
+
/* @__PURE__ */ z("dd", {
|
|
2515
|
+
...S.props($.value, d.value),
|
|
2516
|
+
children: /* @__PURE__ */ B("span", {
|
|
2517
|
+
className: "x78zum5 x1pha0wt x1a02dak x1hnptsi xeuugli",
|
|
2518
|
+
children: [/* @__PURE__ */ z("span", { children: a ? /* @__PURE__ */ z(l, { width: d.valueWidth }) : t ?? "—" }), !a && r !== void 0 && /* @__PURE__ */ z("span", {
|
|
2519
|
+
...S.props($.change, p),
|
|
2520
|
+
children: r.value
|
|
2521
|
+
})]
|
|
2522
|
+
})
|
|
2523
|
+
}),
|
|
2524
|
+
f && /* @__PURE__ */ z("dd", {
|
|
2525
|
+
...S.props($.detail, d.detail),
|
|
2526
|
+
children: a ? /* @__PURE__ */ z(l, { width: "24ch" }) : n
|
|
2527
|
+
}),
|
|
2528
|
+
!a && i !== void 0 && /* @__PURE__ */ z("dd", {
|
|
2529
|
+
className: "x1ghz6dp xeuugli xy8obcc xas2l8k x153jb6y xss6m8b",
|
|
2530
|
+
children: i
|
|
2531
|
+
}),
|
|
2532
|
+
c !== void 0 && /* @__PURE__ */ z("dd", {
|
|
2533
|
+
className: "x1ghz6dp xeuugli xh8yej3 xkh2ocl",
|
|
2534
|
+
children: c
|
|
2535
|
+
})
|
|
2536
|
+
]
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
// packages/collections/src/timestamp.tsx
|
|
2540
|
+
function wn({ dateTime: e, label: t, title: n }) {
|
|
2541
|
+
return n === void 0 ? /* @__PURE__ */ z("time", {
|
|
2542
|
+
dateTime: e,
|
|
2543
|
+
className: "x1hz01jw xy8obcc xas2l8k x153jb6y xss6m8b xj0a0fe x13qnu6 x9v5kkp x19rmrnh x7s97pk",
|
|
2544
|
+
children: t
|
|
2545
|
+
}) : /* @__PURE__ */ B(h.Root, { children: [/* @__PURE__ */ z(h.Trigger, {
|
|
2546
|
+
render: /* @__PURE__ */ z("time", {
|
|
2547
|
+
dateTime: e,
|
|
2548
|
+
tabIndex: 0,
|
|
2549
|
+
"aria-label": n,
|
|
2550
|
+
className: "x1hz01jw xy8obcc xas2l8k x153jb6y xss6m8b xj0a0fe x13qnu6 x9v5kkp x19rmrnh x7s97pk"
|
|
2551
|
+
}),
|
|
2552
|
+
children: t
|
|
2553
|
+
}), /* @__PURE__ */ z(h.Popup, { children: n })] });
|
|
2554
|
+
}
|
|
2555
|
+
// packages/collections/src/timeline.tsx
|
|
2556
|
+
function Tn({ label: e, children: t }) {
|
|
2557
|
+
return /* @__PURE__ */ z(Ce, {
|
|
2558
|
+
"aria-label": e,
|
|
2559
|
+
render: /* @__PURE__ */ z("ol", {}),
|
|
2560
|
+
className: "xe8uvvx x1ghz6dp x1717udv xeuugli",
|
|
2561
|
+
children: t
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
function En({ icon: e, title: t, time: n, metadata: r, children: i, details: a, defaultOpen: o = !1 }) {
|
|
2565
|
+
let [s, l] = I(o), u = /* @__PURE__ */ B("div", {
|
|
2566
|
+
className: "x78zum5 x1pha0wt x1hnptsi x1a02dak xeuugli",
|
|
2567
|
+
children: [/* @__PURE__ */ z(Oe, {
|
|
2568
|
+
className: "xeuugli xk4h15q xj0a0fe",
|
|
2569
|
+
children: a === void 0 ? t : /* @__PURE__ */ z(c.Trigger, {
|
|
2570
|
+
className: "x14atkfc x16exltd x17oiadl xt970qd xlqzeqv",
|
|
2571
|
+
children: t
|
|
2572
|
+
})
|
|
2573
|
+
}), n != null && /* @__PURE__ */ z(De, {
|
|
2574
|
+
render: /* @__PURE__ */ z("div", {}),
|
|
2575
|
+
className: "xeuugli x153jb6y xy8obcc xas2l8k xss6m8b xj0a0fe",
|
|
2576
|
+
children: n
|
|
2577
|
+
})]
|
|
2578
|
+
}), d = /* @__PURE__ */ B(ce, { children: [
|
|
2579
|
+
u,
|
|
2580
|
+
i != null && (!s || a === void 0) && /* @__PURE__ */ z(we, {
|
|
2581
|
+
className: "xeuugli x1ewvobj xj0a0fe",
|
|
2582
|
+
children: i
|
|
2583
|
+
}),
|
|
2584
|
+
r != null && /* @__PURE__ */ z("div", {
|
|
2585
|
+
className: "xeuugli x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
2586
|
+
children: r
|
|
2587
|
+
}),
|
|
2588
|
+
a !== void 0 && /* @__PURE__ */ z(c.Panel, { children: a })
|
|
2589
|
+
] });
|
|
2590
|
+
return /* @__PURE__ */ B(Te, {
|
|
2591
|
+
render: /* @__PURE__ */ z("li", {}),
|
|
2592
|
+
className: "x1n2onr6 xrvj5dj x1eqwfih x1y1mm1b xhlx3wy xeuugli x1hz01jw xvmahel xtqrqnz x1778rvt xbixft x1cpjm7i x1hmns74 x1lk18uv x1gi6gvw x1jw5pjq x1vgi0k x1mi36wk x1wse844 xup0pd7 x1t137rt x13qnu6 x9v5kkp x19rmrnh x7s97pk",
|
|
2593
|
+
children: [/* @__PURE__ */ z(Ee, {
|
|
2594
|
+
render: /* @__PURE__ */ z("span", {}),
|
|
2595
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1b1e0sl x153jb6y",
|
|
2596
|
+
children: e
|
|
2597
|
+
}), a === void 0 ? /* @__PURE__ */ z("div", {
|
|
2598
|
+
className: "xrvj5dj x1hnptsi xeuugli",
|
|
2599
|
+
children: d
|
|
2600
|
+
}) : /* @__PURE__ */ z(c.Root, {
|
|
2601
|
+
open: s,
|
|
2602
|
+
onOpenChange: l,
|
|
2603
|
+
className: "xrvj5dj x1hnptsi xeuugli xh8yej3",
|
|
2604
|
+
children: d
|
|
2605
|
+
})]
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
var Dn = {
|
|
2609
|
+
Root: Tn,
|
|
2610
|
+
Item: En
|
|
2611
|
+
};
|
|
2612
|
+
export { Pe as C, q as S, Nt as _, yn as a, vt as b, ln as c, Kt as d, qt as f, Pt as g, Ft as h, Sn as i, un as l, Vt as m, wn as n, vn as o, Bt as p, Cn as r, gn as s, Dn as t, cn as u, Tt as v, Ne as w, Fe as x, ht as y };
|