@logicplanes/kaeso-ui 0.6.0-rc.4 → 0.6.0-rc.6
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/ai/component-guides.md +1 -1
- package/ai/component-registry.json +3 -3
- package/ai/component-registry.md +3 -3
- package/ai/icons.md +1 -1
- package/ai/tokens.md +1 -1
- package/dist/chunks/{data-table-FFbcwv22.js → data-table-5LgGiHdW.js} +136 -135
- package/dist/chunks/data-table-5LgGiHdW.js.map +1 -0
- package/dist/chunks/{de-DN2LX3_2.js → de-aLc0-E5B.js} +2 -1
- package/dist/chunks/{de-DN2LX3_2.js.map → de-aLc0-E5B.js.map} +1 -1
- package/dist/chunks/{identity-CFoQG_TN.js → identity-CpM7nAZ3.js} +41 -40
- package/dist/chunks/identity-CpM7nAZ3.js.map +1 -0
- package/dist/chunks/{kaeso-Cbtv7F-H.js → kaeso-D2uXs-oQ.js} +116 -115
- package/dist/chunks/kaeso-D2uXs-oQ.js.map +1 -0
- package/dist/chunks/{zh-CN-BpSGsgRh.js → zh-CN-RCSVKiQh.js} +2 -1
- package/dist/chunks/{zh-CN-BpSGsgRh.js.map → zh-CN-RCSVKiQh.js.map} +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/kaeso/identity.js +1 -1
- package/dist/components/kaeso.js +2 -2
- package/dist/components/playground.js +1 -1
- package/dist/i18n-provider.js +1 -1
- package/dist/index.js +3 -3
- package/dist/types/components/kaeso/client-button.d.ts +1 -0
- package/dist/types/components/kaeso/provider-marks.d.ts +1 -0
- package/package.json +6 -6
- package/dist/chunks/data-table-FFbcwv22.js.map +0 -1
- package/dist/chunks/identity-CFoQG_TN.js.map +0 -1
- package/dist/chunks/kaeso-Cbtv7F-H.js.map +0 -1
package/ai/component-guides.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @logicplanes/kaeso-ui component guides
|
|
2
2
|
|
|
3
|
-
Version 0.6.0-rc.
|
|
3
|
+
Version 0.6.0-rc.6. Generated from the showcase's demo modules (apps/showcase/src/demos); do not edit. For each component: what it is for, its import, keyboard, accessibility, do and don't, and every example's code. Props and variants: `component-registry.md`.
|
|
4
4
|
|
|
5
5
|
## AlertDialog
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@logicplanes/kaeso-ui",
|
|
3
|
-
"version": "0.6.0-rc.
|
|
3
|
+
"version": "0.6.0-rc.6",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"entry": "app-frame",
|
|
@@ -5335,7 +5335,7 @@
|
|
|
5335
5335
|
"components": [
|
|
5336
5336
|
{
|
|
5337
5337
|
"name": "ClientButton",
|
|
5338
|
-
"description": "An agent client's mark, such as Claude, Cursor
|
|
5338
|
+
"description": "An agent client's mark, such as Claude, Cursor, GitHub Copilot or ChatGPT, in a raised circle beside the other header buttons, as a button that opens how to connect it.",
|
|
5339
5339
|
"props": [
|
|
5340
5340
|
{
|
|
5341
5341
|
"name": "aria-label",
|
|
@@ -5346,7 +5346,7 @@
|
|
|
5346
5346
|
},
|
|
5347
5347
|
{
|
|
5348
5348
|
"name": "client",
|
|
5349
|
-
"type": "\"cursor\" | \"claude\" | \"github-copilot\"",
|
|
5349
|
+
"type": "\"cursor\" | \"claude\" | \"github-copilot\" | \"chatgpt\"",
|
|
5350
5350
|
"required": true,
|
|
5351
5351
|
"default": null,
|
|
5352
5352
|
"description": "Which client's mark it shows."
|
package/ai/component-registry.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @logicplanes/kaeso-ui component registry
|
|
2
2
|
|
|
3
|
-
Version 0.6.0-rc.
|
|
3
|
+
Version 0.6.0-rc.6. Generated from the component types, their descriptions and variants; do not edit.
|
|
4
4
|
|
|
5
5
|
## app-frame
|
|
6
6
|
|
|
@@ -1172,12 +1172,12 @@ A multi-line field: radius 14 (multi-line text cannot be a pill), the same mater
|
|
|
1172
1172
|
|
|
1173
1173
|
### ClientButton
|
|
1174
1174
|
|
|
1175
|
-
An agent client's mark, such as Claude, Cursor
|
|
1175
|
+
An agent client's mark, such as Claude, Cursor, GitHub Copilot or ChatGPT, in a raised circle beside the other header buttons, as a button that opens how to connect it.
|
|
1176
1176
|
|
|
1177
1177
|
| Prop | Type | Default | Description |
|
|
1178
1178
|
|---|---|---|---|
|
|
1179
1179
|
| `aria-label` * | `string` | | The client's name; also the tooltip. |
|
|
1180
|
-
| `client` * | `"cursor" \| "claude" \| "github-copilot"` | | Which client's mark it shows. |
|
|
1180
|
+
| `client` * | `"cursor" \| "claude" \| "github-copilot" \| "chatgpt"` | | Which client's mark it shows. |
|
|
1181
1181
|
| `className` | `string` | | Classes for the layout of the outer element: margin, width and placement, never its look. |
|
|
1182
1182
|
| `data-force` | `string` | | Forces an interaction state for state matrices: `hover`, `pressed`, `focus`, `open`. |
|
|
1183
1183
|
| `onClick` | `(() => void)` | | Opens how to connect the client. |
|
package/ai/icons.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Icon vocabulary
|
|
2
2
|
|
|
3
|
-
Version 0.6.0-rc.
|
|
3
|
+
Version 0.6.0-rc.6. Generated from `src/icons/vocabulary.ts`; do not edit. Use the name, never an icon picked by look: `icons.key` always means a key. Hugeicons, Stroke Rounded. Rules: `foundations/icons.md`.
|
|
4
4
|
|
|
5
5
|
## Kaeso objects
|
|
6
6
|
|
package/ai/tokens.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @logicplanes/kaeso-ui tokens
|
|
2
2
|
|
|
3
|
-
Version 0.6.0-rc.
|
|
3
|
+
Version 0.6.0-rc.6. Generated from `@logicplanes/kaeso-tokens`; do not edit. Components use these through role names (`bg-panel`, `text-fg-secondary`, `h-36`, `rounded-pill`); a raw value never appears in a component. How to use them: `foundations/*.md`.
|
|
4
4
|
|
|
5
5
|
## Neutrals
|
|
6
6
|
|
|
@@ -86,15 +86,15 @@ function Ae(t, n) {
|
|
|
86
86
|
return n ? e("controls-on-fill", t ? "bg-raised-pressed hover:raised-selected-hover active:raised-selected-hover" : "bg-fill-2 hover:bg-fill-3 active:bg-fill-3") : t ? "hover:bg-raised-hover active:bg-raised-pressed hover:controls-on-fill" : "hover:bg-fill-1 active:bg-fill-2 hover:controls-on-fill";
|
|
87
87
|
}
|
|
88
88
|
var je = (e) => Math.min(e.size, e.minWidth ?? 136);
|
|
89
|
-
function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowClick: l, rowMenu: u, selectable: f, canSelectRow: _, selection: v, onSelectionChange: de, sorting: w, onSortingChange: xe, manualSorting: Me, loading: D, error:
|
|
90
|
-
let
|
|
89
|
+
function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowClick: l, rowMenu: u, selectable: f, canSelectRow: _, selection: v, onSelectionChange: de, sorting: w, onSortingChange: xe, manualSorting: Me, loading: D, error: O, onRetry: k, empty: A, hasMore: Ne, loadingMore: Pe, onLoadMore: Fe, stickyFirstColumn: Ie, virtualizeAbove: Le = 100, className: Re, activeRowId: ze, freshRowIds: Be, onHiddenColumnsChange: Ve, "aria-label": He, "data-force-row": Ue }, j) {
|
|
90
|
+
let M = t(), We = r(), Ge = n(), N = i(), [Ke, qe] = x([]), [Je, Ye] = x({}), [Xe, Ze] = x(0), [Qe, P] = x("body"), [$e, et] = x(0), F = b(null), tt = w ?? Ke, I = v ?? Je, nt = fe(() => f ? [{
|
|
91
91
|
id: "__select",
|
|
92
92
|
size: 44,
|
|
93
93
|
enableSorting: !1,
|
|
94
94
|
enableResizing: !1,
|
|
95
95
|
meta: { priority: 1 },
|
|
96
96
|
header: ({ table: e }) => /* @__PURE__ */ S(te, {
|
|
97
|
-
"aria-label":
|
|
97
|
+
"aria-label": N("dataTable.selectAllRows", "Select all rows"),
|
|
98
98
|
checked: e.getIsAllRowsSelected(),
|
|
99
99
|
indeterminate: e.getIsSomeRowsSelected() && !e.getIsAllRowsSelected(),
|
|
100
100
|
onCheckedChange: (t) => e.toggleAllRowsSelected(t)
|
|
@@ -102,7 +102,7 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
102
102
|
cell: ({ row: e }) => {
|
|
103
103
|
let t = Ee(Te(o), e);
|
|
104
104
|
return /* @__PURE__ */ S(te, {
|
|
105
|
-
"aria-label": t ?
|
|
105
|
+
"aria-label": t ? N("dataTable.selectNamed", "Select {name}", { name: t }) : N("dataTable.selectRow", "Select row"),
|
|
106
106
|
checked: e.getIsSelected(),
|
|
107
107
|
disabled: !e.getCanSelect(),
|
|
108
108
|
onCheckedChange: (t) => e.toggleSelected(t)
|
|
@@ -111,21 +111,21 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
111
111
|
}, ...o] : o, [
|
|
112
112
|
o,
|
|
113
113
|
f,
|
|
114
|
-
|
|
115
|
-
]),
|
|
114
|
+
N
|
|
115
|
+
]), L = be({
|
|
116
116
|
data: a,
|
|
117
|
-
columns:
|
|
117
|
+
columns: nt,
|
|
118
118
|
state: {
|
|
119
|
-
sorting:
|
|
120
|
-
rowSelection:
|
|
119
|
+
sorting: tt,
|
|
120
|
+
rowSelection: I
|
|
121
121
|
},
|
|
122
122
|
onSortingChange: (e) => {
|
|
123
|
-
let t = typeof e == "function" ? e(
|
|
124
|
-
|
|
123
|
+
let t = typeof e == "function" ? e(tt) : e;
|
|
124
|
+
F.current = null, w || qe(t), xe?.(t);
|
|
125
125
|
},
|
|
126
126
|
onRowSelectionChange: (e) => {
|
|
127
|
-
let t = typeof e == "function" ? e(
|
|
128
|
-
v ||
|
|
127
|
+
let t = typeof e == "function" ? e(I) : e;
|
|
128
|
+
v || Ye(t), de?.(t);
|
|
129
129
|
},
|
|
130
130
|
getCoreRowModel: ve(),
|
|
131
131
|
getSortedRowModel: ye(),
|
|
@@ -138,61 +138,61 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
138
138
|
minSize: 64,
|
|
139
139
|
maxSize: 640
|
|
140
140
|
}
|
|
141
|
-
}),
|
|
141
|
+
}), R = b(null), z = b(null), B = b(null), rt = L.getVisibleLeafColumns(), it = rt.map((e) => ({
|
|
142
142
|
id: e.id,
|
|
143
143
|
size: e.getSize(),
|
|
144
144
|
priority: e.columnDef.meta?.priority ?? 2,
|
|
145
145
|
grow: !!e.columnDef.meta?.grow,
|
|
146
146
|
minWidth: e.columnDef.meta?.minWidth,
|
|
147
147
|
fixed: e.id === "__select"
|
|
148
|
-
})),
|
|
149
|
-
let t = Ce(
|
|
148
|
+
})), at = JSON.stringify(it), ot = (e) => {
|
|
149
|
+
let t = Ce(it, e, M ? 48 : 0);
|
|
150
150
|
return `${t.tight ? "!" : ""}${t.overflow ? ">" : ""}|${t.hidden.join(" ")}`;
|
|
151
|
-
},
|
|
152
|
-
|
|
151
|
+
}, st = b(ot);
|
|
152
|
+
st.current = ot;
|
|
153
153
|
let [ct, lt] = x("|");
|
|
154
154
|
y(() => {
|
|
155
|
-
let e =
|
|
156
|
-
if (e) return p([e], ([e]) => lt(
|
|
155
|
+
let e = R.current;
|
|
156
|
+
if (e) return p([e], ([e]) => lt(st.current(Math.round(e?.contentRect.width ?? 0))));
|
|
157
157
|
}, []), y(() => {
|
|
158
|
-
|
|
159
|
-
}, [
|
|
160
|
-
let [ut = "", dt = ""] = ct.split("|"), ft = ut.includes("!"), pt = ut.includes(">"), V = fe(() => new Set(dt.split(" ").filter(Boolean)), [dt]), mt = b(
|
|
161
|
-
mt.current =
|
|
158
|
+
R.current && lt(st.current(Math.round(we(R.current))));
|
|
159
|
+
}, [at]);
|
|
160
|
+
let [ut = "", dt = ""] = ct.split("|"), ft = ut.includes("!"), pt = ut.includes(">"), V = fe(() => new Set(dt.split(" ").filter(Boolean)), [dt]), mt = b(Ve);
|
|
161
|
+
mt.current = Ve, y(() => {
|
|
162
162
|
mt.current?.([...V]);
|
|
163
163
|
}, [V]);
|
|
164
|
-
let H =
|
|
164
|
+
let H = rt.filter((e) => !V.has(e.id)), ht = (e) => e.columnDef.meta?.grow && ft ? je({
|
|
165
165
|
size: e.getSize(),
|
|
166
166
|
minWidth: e.columnDef.meta.minWidth
|
|
167
167
|
}) : e.getSize(), U = {
|
|
168
168
|
gridTemplateColumns: H.map((e) => e.columnDef.meta?.grow ? `minmax(${ht(e)}px, 1fr)` : `${e.getSize()}px`).join(" "),
|
|
169
169
|
minWidth: H.reduce((e, t) => e + ht(t), 0)
|
|
170
|
-
}, gt = pt && H.length > 1 && !H[H.length - 1]?.columnDef.meta?.grow, W =
|
|
170
|
+
}, gt = pt && H.length > 1 && !H[H.length - 1]?.columnDef.meta?.grow, W = L.getRowModel().rows, _t = pt && W.length === 0 && !D && !O, G = W.length > Le, vt = Math.max(Se[c], se() ? 44 : 0), K = () => ce(R.current), yt = ue(B, K, W.length, G), q = ge({
|
|
171
171
|
count: W.length,
|
|
172
172
|
getScrollElement: K,
|
|
173
|
-
estimateSize: () =>
|
|
173
|
+
estimateSize: () => vt,
|
|
174
174
|
overscan: 16,
|
|
175
175
|
enabled: G,
|
|
176
|
-
scrollMargin:
|
|
177
|
-
}), J = (t) => e("flex min-w-0 items-center px-12",
|
|
176
|
+
scrollMargin: yt
|
|
177
|
+
}), J = (t) => e("flex min-w-0 items-center px-12", M && t === 0 && "pl-20", M && t === H.length - 1 && "pr-20"), Y = M || We, X = (t, n = !1, r = !1) => (Ie && t === 0 || gt && t === H.length - 1) && e("sticky z-10", n ? Y ? "bg-raised" : "bg-panel" : r ? "bg-inherit" : Y ? "bg-raised group-hover/tr:bg-raised-hover group-active/tr:bg-raised-pressed" : "bg-panel group-hover/tr:bg-fill-1 group-active/tr:bg-fill-2", t === 0 ? "left-0" : "right-0", !M && !n && (t === 0 ? "rounded-l-item" : "rounded-r-item")), Z = !!l || !!f, Q = Z ? "gridcell" : "cell", bt = Z && W.length > 0 && Qe === "body", xt = Math.min(Xe, Math.max(W.length - 1, 0)), St = (e) => {
|
|
178
178
|
let t = Math.max(0, Math.min(W.length - 1, e));
|
|
179
|
-
|
|
180
|
-
let n = () =>
|
|
179
|
+
P("body"), Ze(t), G && q.scrollToIndex(t, { align: "auto" });
|
|
180
|
+
let n = () => B.current?.querySelector(`[data-row-index="${t}"]`), r = n();
|
|
181
181
|
r ? r.focus() : requestAnimationFrame(() => n()?.focus());
|
|
182
|
-
},
|
|
183
|
-
let t = E(
|
|
184
|
-
return n ? (
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
let e = E(
|
|
188
|
-
for (let n of
|
|
189
|
-
let r = e.indexOf(n) === t && !
|
|
182
|
+
}, Ct = (e) => {
|
|
183
|
+
let t = E(z.current), n = t[Math.max(0, Math.min(t.length - 1, e))];
|
|
184
|
+
return n ? (P("head"), et(t.indexOf(n)), n.focus(), !0) : !1;
|
|
185
|
+
}, wt = b(() => {});
|
|
186
|
+
wt.current = () => {
|
|
187
|
+
let e = E(z.current), t = Math.min($e, e.length - 1);
|
|
188
|
+
for (let n of z.current?.querySelectorAll(De) ?? []) {
|
|
189
|
+
let r = e.indexOf(n) === t && !bt ? "0" : "-1";
|
|
190
190
|
n.getAttribute("tabindex") !== r && n.setAttribute("tabindex", r);
|
|
191
191
|
}
|
|
192
|
-
}, y(() =>
|
|
193
|
-
let e =
|
|
192
|
+
}, y(() => wt.current()), y(() => {
|
|
193
|
+
let e = z.current;
|
|
194
194
|
if (!e) return;
|
|
195
|
-
let t = new MutationObserver(() =>
|
|
195
|
+
let t = new MutationObserver(() => wt.current());
|
|
196
196
|
return t.observe(e, {
|
|
197
197
|
subtree: !0,
|
|
198
198
|
childList: !0,
|
|
@@ -200,7 +200,7 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
200
200
|
attributeFilter: ["tabindex"]
|
|
201
201
|
}), () => t.disconnect();
|
|
202
202
|
}, []), y(() => {
|
|
203
|
-
let e =
|
|
203
|
+
let e = B.current;
|
|
204
204
|
if (!e || !Z) return;
|
|
205
205
|
let t = () => {
|
|
206
206
|
for (let t of e.querySelectorAll("[data-row-index]")) for (let e of t.querySelectorAll(De)) e.getAttribute("tabindex") !== "-1" && e.setAttribute("tabindex", "-1");
|
|
@@ -213,25 +213,25 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
213
213
|
attributes: !0,
|
|
214
214
|
attributeFilter: ["tabindex"]
|
|
215
215
|
}), () => n.disconnect();
|
|
216
|
-
}, [Z]), ae(
|
|
217
|
-
let
|
|
218
|
-
let n = e ?
|
|
216
|
+
}, [Z]), ae(B, "[role=row]");
|
|
217
|
+
let Tt = (e, t) => {
|
|
218
|
+
let n = e ? L.getColumn(e) : void 0;
|
|
219
219
|
if (!n?.getCanResize()) return !1;
|
|
220
220
|
let r = n.columnDef.minSize ?? 64, i = n.columnDef.maxSize ?? 640;
|
|
221
|
-
return
|
|
221
|
+
return L.setColumnSizing((e) => ({
|
|
222
222
|
...e,
|
|
223
223
|
[n.id]: Math.max(r, Math.min(i, n.getSize() + t))
|
|
224
224
|
})), !0;
|
|
225
|
-
},
|
|
225
|
+
}, Et = (e) => {
|
|
226
226
|
if (e.altKey || e.metaKey || e.ctrlKey) return;
|
|
227
|
-
let t = E(
|
|
227
|
+
let t = E(z.current), n = t.indexOf(e.target);
|
|
228
228
|
if (n < 0) return;
|
|
229
229
|
let r = {
|
|
230
230
|
ArrowLeft: -16,
|
|
231
231
|
ArrowRight: 16
|
|
232
232
|
}[e.key];
|
|
233
233
|
if (e.shiftKey) {
|
|
234
|
-
r !== void 0 &&
|
|
234
|
+
r !== void 0 && Tt(e.target.closest("[role=columnheader]")?.dataset.col, r) && e.preventDefault();
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
let i = {
|
|
@@ -240,17 +240,17 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
240
240
|
Home: 0,
|
|
241
241
|
End: t.length - 1
|
|
242
242
|
}[e.key];
|
|
243
|
-
i === void 0 ? e.key === "ArrowDown" && Z && W.length && (e.preventDefault(), xt
|
|
244
|
-
},
|
|
245
|
-
let n =
|
|
246
|
-
n < 0 && (
|
|
243
|
+
i === void 0 ? e.key === "ArrowDown" && Z && W.length && (e.preventDefault(), St(xt)) : (e.preventDefault(), i >= 0 && i < t.length && Ct(i));
|
|
244
|
+
}, Dt = () => Math.max(1, Math.floor((K()?.clientHeight ?? 400) / vt) - 1), Ot = (e, t) => {
|
|
245
|
+
let n = F.current ? W.findIndex((e) => e.id === F.current?.id) : -1;
|
|
246
|
+
n < 0 && (F.current = {
|
|
247
247
|
id: W[e].id,
|
|
248
|
-
base:
|
|
248
|
+
base: I
|
|
249
249
|
});
|
|
250
|
-
let r = n < 0 ? e : n, i = { ...
|
|
250
|
+
let r = n < 0 ? e : n, i = { ...F.current?.base };
|
|
251
251
|
for (let e of W.slice(Math.min(r, t), Math.max(r, t) + 1)) e.getCanSelect() && (i[e.id] = !0);
|
|
252
|
-
|
|
253
|
-
},
|
|
252
|
+
L.setRowSelection(i);
|
|
253
|
+
}, kt = (e, t, n) => {
|
|
254
254
|
let r = e.currentTarget, i = e.target;
|
|
255
255
|
if (i !== r) {
|
|
256
256
|
if (e.altKey || e.metaKey || e.ctrlKey || i.closest(Oe)) return;
|
|
@@ -263,7 +263,7 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
263
263
|
}
|
|
264
264
|
if (e.altKey) return;
|
|
265
265
|
if (e.metaKey || e.ctrlKey) {
|
|
266
|
-
e.key.toLowerCase() === "a" && f && !e.shiftKey && (e.preventDefault(),
|
|
266
|
+
e.key.toLowerCase() === "a" && f && !e.shiftKey && (e.preventDefault(), F.current = null, L.toggleAllRowsSelected(!0));
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
let a = {
|
|
@@ -271,35 +271,35 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
271
271
|
ArrowUp: n - 1,
|
|
272
272
|
Home: 0,
|
|
273
273
|
End: W.length - 1,
|
|
274
|
-
PageDown: n +
|
|
275
|
-
PageUp: n -
|
|
274
|
+
PageDown: n + Dt(),
|
|
275
|
+
PageUp: n - Dt()
|
|
276
276
|
}[e.key];
|
|
277
277
|
if (a !== void 0) {
|
|
278
|
-
if (e.preventDefault(), e.key === "ArrowUp" && !e.shiftKey && a < 0 &&
|
|
278
|
+
if (e.preventDefault(), e.key === "ArrowUp" && !e.shiftKey && a < 0 && Ct($e)) return;
|
|
279
279
|
let t = Math.max(0, Math.min(W.length - 1, a));
|
|
280
|
-
e.shiftKey && f ?
|
|
280
|
+
e.shiftKey && f ? Ot(n, t) : F.current = null, St(t);
|
|
281
281
|
} else if (e.shiftKey) return;
|
|
282
282
|
else if (e.key === "ArrowRight") {
|
|
283
283
|
let t = ke(r)[0];
|
|
284
284
|
if (!t) return;
|
|
285
285
|
e.preventDefault(), t.focus();
|
|
286
|
-
} else e.key === "Enter" ? (e.preventDefault(), l?.(t.original)) : (e.key === " " || e.key === "x") && f ? (e.preventDefault(),
|
|
287
|
-
},
|
|
288
|
-
|
|
286
|
+
} else e.key === "Enter" ? (e.preventDefault(), l?.(t.original)) : (e.key === " " || e.key === "x") && f ? (e.preventDefault(), F.current = null, t.getCanSelect() && t.toggleSelected()) : e.key === "Escape" && f && Object.keys(I).length && (e.preventDefault(), F.current = null, L.toggleAllRowsSelected(!1));
|
|
287
|
+
}, At = [
|
|
288
|
+
nt,
|
|
289
289
|
H.map((e) => e.id).join(" "),
|
|
290
|
-
|
|
290
|
+
M,
|
|
291
291
|
gt,
|
|
292
|
-
|
|
292
|
+
Ie,
|
|
293
293
|
Y,
|
|
294
294
|
Q
|
|
295
295
|
], $ = b(null);
|
|
296
|
-
(!$.current ||
|
|
297
|
-
deps:
|
|
296
|
+
(!$.current || At.some((e, t) => e !== $.current?.deps[t])) && ($.current = {
|
|
297
|
+
deps: At,
|
|
298
298
|
rows: /* @__PURE__ */ new WeakMap()
|
|
299
299
|
});
|
|
300
|
-
let
|
|
301
|
-
let i = t.id ===
|
|
302
|
-
d?.state !== s &&
|
|
300
|
+
let jt = $.current.rows, Mt = (t, n, r) => {
|
|
301
|
+
let i = t.id === ze, a = !!f && t.getIsSelected(), o = i || a, s = `${i} ${a}`, d = jt.get(t), p = d?.state === s ? d.cells : Nt(t, o);
|
|
302
|
+
d?.state !== s && jt.set(t, {
|
|
303
303
|
state: s,
|
|
304
304
|
cells: p
|
|
305
305
|
});
|
|
@@ -309,27 +309,27 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
309
309
|
"aria-selected": f ? t.getIsSelected() : void 0,
|
|
310
310
|
"aria-current": i || void 0,
|
|
311
311
|
"data-active": i || void 0,
|
|
312
|
-
"data-fresh":
|
|
312
|
+
"data-fresh": Be?.has(t.id) || void 0,
|
|
313
313
|
"data-row-index": n,
|
|
314
|
-
...
|
|
315
|
-
tabIndex: Z ?
|
|
314
|
+
...Ue && n === 0 ? { "data-force": Ue } : {},
|
|
315
|
+
tabIndex: Z ? bt && n === xt ? 0 : -1 : void 0,
|
|
316
316
|
onFocus: (e) => {
|
|
317
|
-
e.target === e.currentTarget && (
|
|
317
|
+
e.target === e.currentTarget && (P("body"), n !== Xe && Ze(n));
|
|
318
318
|
},
|
|
319
319
|
onClick: (e) => {
|
|
320
|
-
|
|
320
|
+
F.current = null, !(e.target.closest("button, a, [role=checkbox]") || le(e.currentTarget)) && l?.(t.original);
|
|
321
321
|
},
|
|
322
|
-
onKeyDown: (e) =>
|
|
322
|
+
onKeyDown: (e) => kt(e, t, n),
|
|
323
323
|
style: {
|
|
324
324
|
...U,
|
|
325
325
|
...r
|
|
326
326
|
},
|
|
327
|
-
className: e("group/tr grid w-full text-body text-fg transition-control focus-ring-inset", !
|
|
327
|
+
className: e("group/tr grid w-full text-body text-fg transition-control focus-ring-inset", !M && "rounded-item", T.density[c].classes, l && "cursor-pointer", Ae(Y, o), "data-fresh:animate-row-fresh", r?.transform !== void 0 && "[transition-property:background-color,color,box-shadow,opacity]", "forced-colors:data-active:outline-2 forced-colors:data-active:-outline-offset-2 forced-colors:data-active:outline-solid"),
|
|
328
328
|
children: p
|
|
329
329
|
});
|
|
330
330
|
return u ? /* @__PURE__ */ C(h, { children: [/* @__PURE__ */ S(h.Trigger, { children: m }), /* @__PURE__ */ S(h.Content, { children: u(t.original) })] }, t.id) : /* @__PURE__ */ S("div", { children: m }, t.id);
|
|
331
331
|
};
|
|
332
|
-
function
|
|
332
|
+
function Nt(t, n) {
|
|
333
333
|
return t.getVisibleCells().filter((e) => !V.has(e.column.id)).map((r, i) => {
|
|
334
334
|
let a = r.column.columnDef.meta, o = _e(r.column.columnDef.cell, r.getContext()), s = r.getValue(), c = a?.text ? a.text(t.original) : typeof s == "string" ? s : void 0, l = a?.tone?.(t.original);
|
|
335
335
|
return /* @__PURE__ */ S("div", {
|
|
@@ -351,7 +351,7 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
351
351
|
}, r.id);
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
let
|
|
354
|
+
let Pt = (t, n) => {
|
|
355
355
|
let r = t.column.columnDef.meta, i = t.column.getCanSort(), a = t.column.getCanResize(), o = t.column.getIsSorted(), s = _e(t.column.columnDef.header, t.getContext()), c = /* @__PURE__ */ C(pe, { children: [i ? /* @__PURE__ */ C("button", {
|
|
356
356
|
type: "button",
|
|
357
357
|
onClick: t.column.getToggleSortingHandler(),
|
|
@@ -367,7 +367,7 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
367
367
|
}), a && /* @__PURE__ */ S("div", {
|
|
368
368
|
role: "separator",
|
|
369
369
|
"aria-orientation": "vertical",
|
|
370
|
-
"aria-label":
|
|
370
|
+
"aria-label": N("dataTable.resizeColumn", "Resize column"),
|
|
371
371
|
"aria-valuenow": t.column.getSize(),
|
|
372
372
|
"aria-valuemin": t.column.columnDef.minSize ?? 64,
|
|
373
373
|
"aria-valuemax": t.column.columnDef.maxSize ?? 640,
|
|
@@ -387,59 +387,60 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
387
387
|
children: c
|
|
388
388
|
}), /* @__PURE__ */ C(h.Content, { children: [
|
|
389
389
|
/* @__PURE__ */ S(h.Item, {
|
|
390
|
-
onClick: () =>
|
|
391
|
-
children:
|
|
390
|
+
onClick: () => Tt(t.column.id, 32),
|
|
391
|
+
children: N("dataTable.widenColumn", "Widen column")
|
|
392
392
|
}),
|
|
393
393
|
/* @__PURE__ */ S(h.Item, {
|
|
394
|
-
onClick: () =>
|
|
395
|
-
children:
|
|
394
|
+
onClick: () => Tt(t.column.id, -32),
|
|
395
|
+
children: N("dataTable.narrowColumn", "Narrow column")
|
|
396
396
|
}),
|
|
397
397
|
/* @__PURE__ */ S(h.Item, {
|
|
398
398
|
onClick: () => t.column.resetSize(),
|
|
399
|
-
children:
|
|
399
|
+
children: N("dataTable.resetWidth", "Reset width")
|
|
400
400
|
})
|
|
401
401
|
] })] }) : c
|
|
402
402
|
}, t.id);
|
|
403
403
|
};
|
|
404
404
|
return /* @__PURE__ */ C("div", {
|
|
405
405
|
ref: (e) => {
|
|
406
|
-
|
|
406
|
+
R.current = e, typeof j == "function" ? j(e) : j && (j.current = e);
|
|
407
407
|
},
|
|
408
|
-
className: e("relative w-full min-w-0", !
|
|
408
|
+
className: e("relative w-full min-w-0", !M && !Ge && "px-24", Re),
|
|
409
409
|
children: [/* @__PURE__ */ C("div", {
|
|
410
410
|
role: Z ? "grid" : "table",
|
|
411
|
-
"aria-label":
|
|
412
|
-
"aria-rowcount": W.length +
|
|
411
|
+
"aria-label": He,
|
|
412
|
+
"aria-rowcount": W.length + +!_t,
|
|
413
413
|
"aria-multiselectable": f || void 0,
|
|
414
414
|
"aria-busy": D || void 0,
|
|
415
|
-
className: e("w-full overflow-clip",
|
|
415
|
+
className: e("w-full overflow-clip", M && "rounded-group bg-raised shadow-xs"),
|
|
416
416
|
children: [/* @__PURE__ */ S("div", {
|
|
417
|
-
ref:
|
|
417
|
+
ref: z,
|
|
418
418
|
role: "rowgroup",
|
|
419
|
+
hidden: _t,
|
|
419
420
|
className: e("sticky top-0 z-20 overflow-hidden", Y ? "bg-raised" : "bg-panel"),
|
|
420
|
-
onKeyDown:
|
|
421
|
+
onKeyDown: Et,
|
|
421
422
|
onFocus: (e) => {
|
|
422
|
-
let t = E(
|
|
423
|
-
t < 0 || (
|
|
423
|
+
let t = E(z.current).indexOf(e.target);
|
|
424
|
+
t < 0 || (F.current = null, P("head"), et(t));
|
|
424
425
|
},
|
|
425
426
|
onScroll: (e) => {
|
|
426
|
-
|
|
427
|
+
B.current && B.current.scrollLeft !== e.currentTarget.scrollLeft && (B.current.scrollLeft = e.currentTarget.scrollLeft);
|
|
427
428
|
},
|
|
428
|
-
children:
|
|
429
|
+
children: L.getHeaderGroups().map((e) => /* @__PURE__ */ S("div", {
|
|
429
430
|
role: "row",
|
|
430
431
|
"aria-rowindex": 1,
|
|
431
432
|
className: "grid h-36 hairline-b-strong",
|
|
432
433
|
style: U,
|
|
433
|
-
children: e.headers.filter((e) => !V.has(e.column.id)).map(
|
|
434
|
+
children: e.headers.filter((e) => !V.has(e.column.id)).map(Pt)
|
|
434
435
|
}, e.id))
|
|
435
436
|
}), /* @__PURE__ */ S("div", {
|
|
436
|
-
ref:
|
|
437
|
+
ref: B,
|
|
437
438
|
role: "rowgroup",
|
|
438
439
|
className: "overflow-x-auto scrollbar-quiet scroll-fade-x",
|
|
439
440
|
onScroll: (e) => {
|
|
440
|
-
|
|
441
|
+
z.current && z.current.scrollLeft !== e.currentTarget.scrollLeft && (z.current.scrollLeft = e.currentTarget.scrollLeft);
|
|
441
442
|
},
|
|
442
|
-
children:
|
|
443
|
+
children: O ? /* @__PURE__ */ S("div", {
|
|
443
444
|
role: "row",
|
|
444
445
|
children: /* @__PURE__ */ S("div", {
|
|
445
446
|
role: Q,
|
|
@@ -449,12 +450,12 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
449
450
|
role: "alert",
|
|
450
451
|
children: /* @__PURE__ */ S(ie, {
|
|
451
452
|
size: "compact",
|
|
452
|
-
title:
|
|
453
|
-
...
|
|
454
|
-
actions:
|
|
453
|
+
title: N("dataTable.loadFailed", "Couldn't load these rows"),
|
|
454
|
+
...k ? {} : { description: N("dataTable.reloadToRetry", "Reload the page to try again.") },
|
|
455
|
+
actions: k && /* @__PURE__ */ S(ee, {
|
|
455
456
|
size: "sm",
|
|
456
|
-
onClick:
|
|
457
|
-
children:
|
|
457
|
+
onClick: k,
|
|
458
|
+
children: N("dataTable.tryAgain", "Try again")
|
|
458
459
|
})
|
|
459
460
|
})
|
|
460
461
|
})
|
|
@@ -477,39 +478,39 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
477
478
|
role: Q,
|
|
478
479
|
"aria-colspan": H.length,
|
|
479
480
|
className: "block",
|
|
480
|
-
children:
|
|
481
|
+
children: A ?? /* @__PURE__ */ S(ie, {
|
|
481
482
|
size: "compact",
|
|
482
|
-
title:
|
|
483
|
+
title: N("dataTable.noRows", "No rows")
|
|
483
484
|
})
|
|
484
485
|
})
|
|
485
486
|
}) : G ? /* @__PURE__ */ S("div", {
|
|
486
487
|
className: "relative",
|
|
487
488
|
style: { height: q.getTotalSize() },
|
|
488
|
-
children: q.getVirtualItems().map((e) =>
|
|
489
|
+
children: q.getVirtualItems().map((e) => Mt(W[e.index], e.index, {
|
|
489
490
|
position: "absolute",
|
|
490
491
|
top: 0,
|
|
491
492
|
left: 0,
|
|
492
|
-
transform: `translateY(${Math.round(e.start -
|
|
493
|
+
transform: `translateY(${Math.round(e.start - yt)}px)`
|
|
493
494
|
}))
|
|
494
|
-
}) : W.map((e, t) =>
|
|
495
|
+
}) : W.map((e, t) => Mt(e, t))
|
|
495
496
|
})]
|
|
496
497
|
}), /* @__PURE__ */ S(re, {
|
|
497
498
|
variant: "load-more",
|
|
498
|
-
hasMore: !!
|
|
499
|
-
loading:
|
|
500
|
-
onLoadMore:
|
|
499
|
+
hasMore: !!Ne,
|
|
500
|
+
loading: Pe,
|
|
501
|
+
onLoadMore: Fe
|
|
501
502
|
})]
|
|
502
503
|
});
|
|
503
504
|
}
|
|
504
505
|
var D = /* @__PURE__ */ de(Me);
|
|
505
506
|
process.env.NODE_ENV !== "production" && (D.displayName = "DataTable");
|
|
506
|
-
var
|
|
507
|
+
var O = D;
|
|
507
508
|
//#endregion
|
|
508
509
|
//#region src/components/data-table/columns.tsx
|
|
509
|
-
function
|
|
510
|
+
function k(e) {
|
|
510
511
|
return w.add(e), e;
|
|
511
512
|
}
|
|
512
|
-
function
|
|
513
|
+
function A(e, t, n, r = {}, i) {
|
|
513
514
|
return {
|
|
514
515
|
id: e.id,
|
|
515
516
|
header: () => e.header,
|
|
@@ -526,7 +527,7 @@ function k(e, t, n, r = {}, i) {
|
|
|
526
527
|
}
|
|
527
528
|
};
|
|
528
529
|
}
|
|
529
|
-
function
|
|
530
|
+
function Ne({ value: e }) {
|
|
530
531
|
let t = i()("dataTable.tokenCount", "{count} tokens", { count: s(e) });
|
|
531
532
|
return /* @__PURE__ */ S(f, {
|
|
532
533
|
content: t,
|
|
@@ -539,7 +540,7 @@ function Pe({ value: e }) {
|
|
|
539
540
|
})] })
|
|
540
541
|
});
|
|
541
542
|
}
|
|
542
|
-
function
|
|
543
|
+
function Pe({ value: e, now: t }) {
|
|
543
544
|
let n = a(e, {
|
|
544
545
|
time: !0,
|
|
545
546
|
seconds: !0
|
|
@@ -562,32 +563,32 @@ function Fe({ value: e, now: t }) {
|
|
|
562
563
|
})
|
|
563
564
|
});
|
|
564
565
|
}
|
|
565
|
-
var
|
|
566
|
-
text: (e, t) =>
|
|
567
|
-
mono: (e, t) =>
|
|
566
|
+
var Fe = {
|
|
567
|
+
text: (e, t) => A(e, t, (e) => e, { text: (e) => t(e) }),
|
|
568
|
+
mono: (e, t) => A(e, t, (e) => e, {
|
|
568
569
|
mono: !0,
|
|
569
570
|
text: (e) => t(e)
|
|
570
571
|
}),
|
|
571
|
-
number: (e, t) =>
|
|
572
|
-
money: (e, t, n = {}) =>
|
|
572
|
+
number: (e, t) => A(e, t, (e) => s(e), { align: "end" }),
|
|
573
|
+
money: (e, t, n = {}) => A(e, t, (e) => u(e, n.decimals === void 0 ? {} : { decimals: n.decimals }), {
|
|
573
574
|
align: "end",
|
|
574
575
|
mono: !1
|
|
575
576
|
}, (e, t, n) => Number(e.getValue(n)) - Number(t.getValue(n))),
|
|
576
|
-
tokens: (e, t) =>
|
|
577
|
-
duration: (e, t) =>
|
|
578
|
-
date: (e, t) =>
|
|
577
|
+
tokens: (e, t) => A(e, t, (e) => /* @__PURE__ */ S(Ne, { value: e }), { align: "end" }),
|
|
578
|
+
duration: (e, t) => A(e, t, (e) => o(e), { align: "end" }),
|
|
579
|
+
date: (e, t) => k(A(e, t, (e) => /* @__PURE__ */ S("time", {
|
|
579
580
|
dateTime: new Date(e).toISOString(),
|
|
580
581
|
children: a(e, { time: !0 })
|
|
581
582
|
}), { text: (e) => a(t(e), { time: !0 }) }, "datetime")),
|
|
582
|
-
relative: (e, t, n = {}) =>
|
|
583
|
+
relative: (e, t, n = {}) => k(A(e, t, (e) => /* @__PURE__ */ S(Pe, {
|
|
583
584
|
value: e,
|
|
584
585
|
now: n.now ?? Date.now()
|
|
585
586
|
}), { text: (e) => a(t(e), { time: !0 }) }, (e, t, n) => new Date(e.getValue(n)).getTime() - new Date(t.getValue(n)).getTime())),
|
|
586
|
-
status: (e, t) =>
|
|
587
|
+
status: (e, t) => A(e, t, (e) => /* @__PURE__ */ S(_, {
|
|
587
588
|
tone: e.tone,
|
|
588
589
|
children: e.label
|
|
589
590
|
}), { text: void 0 }),
|
|
590
|
-
avatar: (e, t) =>
|
|
591
|
+
avatar: (e, t) => A(e, t, (e) => /* @__PURE__ */ C("span", {
|
|
591
592
|
className: "inline-flex min-w-0 items-center gap-8",
|
|
592
593
|
children: [/* @__PURE__ */ S(v, {
|
|
593
594
|
name: e.name,
|
|
@@ -596,9 +597,9 @@ var Ie = {
|
|
|
596
597
|
decorative: !0
|
|
597
598
|
}), /* @__PURE__ */ S(g, { children: e.name })]
|
|
598
599
|
}), { text: (e) => t(e).name }),
|
|
599
|
-
custom: (e, t, n, r = {}) =>
|
|
600
|
+
custom: (e, t, n, r = {}) => A(e, t, n, r)
|
|
600
601
|
};
|
|
601
602
|
//#endregion
|
|
602
|
-
export { T as i,
|
|
603
|
+
export { T as i, O as n, xe as r, Fe as t };
|
|
603
604
|
|
|
604
|
-
//# sourceMappingURL=data-table-
|
|
605
|
+
//# sourceMappingURL=data-table-5LgGiHdW.js.map
|