@gridui/data-explorer 1.0.0 → 1.0.3
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 +19 -7
- package/dist/data-explorer/data-explorer.d.ts +1 -1
- package/dist/index.js +234 -214
- package/dist/index.js.map +2 -2
- package/dist/styles.css +23 -103
- package/package.json +13 -10
package/README.md
CHANGED
|
@@ -5,16 +5,28 @@ Dashboard family. Public API: `DataExplorer`, `DataExplorerColumn`, `DataExplore
|
|
|
5
5
|
Import components from `@gridui/data-explorer` and load `@gridui/data-explorer/styles.css` after Theme.
|
|
6
6
|
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
|
-
See [component ownership](
|
|
8
|
+
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-dashboard/data-explorer/.changeset/history).
|
|
9
9
|
|
|
10
10
|
## Task compositions and lower-package APIs
|
|
11
11
|
|
|
12
|
-
DataExplorer, Composer, and ApprovalPanel
|
|
12
|
+
DataExplorer, Composer, and ApprovalPanel belong to Dashboard because they
|
|
13
13
|
coordinate multiple lower-package contracts. See
|
|
14
|
-
[task workspace compositions](
|
|
14
|
+
[task workspace compositions](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/task-workspace.md) for controlled state,
|
|
15
15
|
callbacks, and application responsibilities.
|
|
16
16
|
|
|
17
|
-
Standalone [InlineNotice](
|
|
18
|
-
[Collection items](
|
|
19
|
-
[FollowScroll](
|
|
20
|
-
[Breadcrumb/Pagination](
|
|
17
|
+
Standalone [InlineNotice](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/inline-notice/docs/inline-notice.md) comes from its Core family.
|
|
18
|
+
[Collection items](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/collection/docs/collection.md),
|
|
19
|
+
[FollowScroll](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/follow-scroll/docs/follow-scroll.md), and
|
|
20
|
+
[Breadcrumb/Pagination](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/navigation.md) come from their Core families.
|
|
21
|
+
|
|
22
|
+
Grid owns the structural seams between the header, content, selection toolbar,
|
|
23
|
+
and footer through `Split`. Load `@gridui/grid/styles.css` before this family.
|
|
24
|
+
|
|
25
|
+
DataTable receives `blockEdges="none"` and `inlineEdges="none"`: the enclosing
|
|
26
|
+
Explorer frame and Grid regions own those edges. Table retains internal column,
|
|
27
|
+
header/body and body-row lines. Optional notices and empty-result messages are
|
|
28
|
+
separate Split regions, so their separators also belong to Grid.
|
|
29
|
+
|
|
30
|
+
Toolbar fields use a single flex sizing declaration with a 10rem basis and wrap
|
|
31
|
+
to the available container width. Loading other family styles afterward does not
|
|
32
|
+
reset that basis or compress Select labels into character-wide columns.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @description Data Explorer
|
|
6
6
|
*/
|
|
7
7
|
import { type DataExplorerColumn, type DataExplorerFilter, type DataExplorerRow, type DataExplorerState, type DataExplorerValue } from "./model";
|
|
8
|
-
import type
|
|
8
|
+
import { type ComponentPropsWithRef, type FC, type ReactNode } from "react";
|
|
9
9
|
export type DataExplorerProps = Omit<ComponentPropsWithRef<"section">, "children"> & {
|
|
10
10
|
readonly rows: readonly DataExplorerRow[];
|
|
11
11
|
readonly columns: readonly DataExplorerColumn[];
|
package/dist/index.js
CHANGED
|
@@ -71,18 +71,20 @@ var selectExplorerPage = (selectedIds, pageIds, checked) => {
|
|
|
71
71
|
|
|
72
72
|
// src/data-explorer/style.ts
|
|
73
73
|
import { cva } from "class-variance-authority";
|
|
74
|
-
var explorerStyles = cva("min-w-0 border border-border bg-background text-foreground");
|
|
75
|
-
var explorerToolbarStyles = cva("flex min-w-0 flex-wrap items-end gap-gridui-16
|
|
76
|
-
var explorerLabelStyles = cva("flex min-w-0 flex-
|
|
77
|
-
var explorerFooterStyles = cva("flex flex-wrap items-center justify-between gap-gridui-8
|
|
74
|
+
var explorerStyles = cva("gridui-u-min-w-0 gridui-u-border gridui-u-border-border gridui-u-bg-background gridui-u-text-foreground");
|
|
75
|
+
var explorerToolbarStyles = cva("gridui-u-flex gridui-u-min-w-0 gridui-u-flex-wrap gridui-u-items-end gridui-u-gap-gridui-16 gridui-u-p-gridui-16 gridui-u-[&_label]:min-h-11");
|
|
76
|
+
var explorerLabelStyles = cva("gridui-u-flex gridui-u-min-w-0 gridui-u-flex-[1_1_10rem] gridui-u-flex-col gridui-u-gap-gridui-4 gridui-u-text-muted gridui-u-type-caption");
|
|
77
|
+
var explorerFooterStyles = cva("gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-8 gridui-u-p-gridui-16");
|
|
78
78
|
|
|
79
79
|
// src/data-explorer/data-explorer.tsx
|
|
80
80
|
import { Button } from "@gridui/button";
|
|
81
81
|
import { Checkbox } from "@gridui/choice";
|
|
82
|
+
import { Split } from "@gridui/grid";
|
|
82
83
|
import { Input } from "@gridui/input";
|
|
83
84
|
import { Select } from "@gridui/select";
|
|
84
85
|
import { cn } from "@gridui/style-utils";
|
|
85
86
|
import { DataTable } from "@gridui/table";
|
|
87
|
+
import { Children } from "react";
|
|
86
88
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
87
89
|
var DataExplorer = (props) => {
|
|
88
90
|
const {
|
|
@@ -102,6 +104,9 @@ var DataExplorer = (props) => {
|
|
|
102
104
|
className,
|
|
103
105
|
...restProps
|
|
104
106
|
} = props;
|
|
107
|
+
const hasNotice = Children.toArray(notice).some((child) => {
|
|
108
|
+
return child !== "";
|
|
109
|
+
});
|
|
105
110
|
const view = selectExplorerRows(rows, columns, state, pageSize, filter);
|
|
106
111
|
const existingRowIds = new Set(rows.map((row) => {
|
|
107
112
|
return row.id;
|
|
@@ -157,233 +162,248 @@ var DataExplorer = (props) => {
|
|
|
157
162
|
}
|
|
158
163
|
return cells;
|
|
159
164
|
});
|
|
160
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ jsx(
|
|
161
166
|
"section",
|
|
162
167
|
{
|
|
163
168
|
...restProps,
|
|
164
169
|
"aria-label": labels.table,
|
|
165
170
|
className: cn(explorerStyles(), className),
|
|
166
|
-
children:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
query,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
171
|
+
children: /* @__PURE__ */ jsxs(
|
|
172
|
+
Split,
|
|
173
|
+
{
|
|
174
|
+
direction: "column",
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ jsxs(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
className: explorerToolbarStyles(),
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ jsxs(
|
|
182
|
+
"label",
|
|
183
|
+
{
|
|
184
|
+
className: explorerLabelStyles(),
|
|
185
|
+
children: [
|
|
186
|
+
labels.search,
|
|
187
|
+
/* @__PURE__ */ jsx(
|
|
188
|
+
Input,
|
|
189
|
+
{
|
|
190
|
+
type: "search",
|
|
191
|
+
value: state.query,
|
|
192
|
+
disabled: busy,
|
|
193
|
+
onValueChange: (query) => {
|
|
194
|
+
updateState({
|
|
195
|
+
query,
|
|
196
|
+
page: 0
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
filter && /* @__PURE__ */ jsxs(
|
|
205
|
+
"label",
|
|
206
|
+
{
|
|
207
|
+
className: explorerLabelStyles(),
|
|
208
|
+
children: [
|
|
209
|
+
filter.label,
|
|
210
|
+
/* @__PURE__ */ jsx(
|
|
211
|
+
Select,
|
|
212
|
+
{
|
|
213
|
+
"aria-label": filter.label,
|
|
214
|
+
value: state.filterValue,
|
|
215
|
+
disabled: busy,
|
|
216
|
+
options: [
|
|
217
|
+
{
|
|
218
|
+
value: "",
|
|
219
|
+
label: labels.all
|
|
220
|
+
},
|
|
221
|
+
...filter.options
|
|
222
|
+
],
|
|
223
|
+
onValueChange: (filterValue) => {
|
|
224
|
+
updateState({
|
|
225
|
+
filterValue,
|
|
226
|
+
page: 0
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ jsxs(
|
|
235
|
+
"label",
|
|
236
|
+
{
|
|
237
|
+
className: explorerLabelStyles(),
|
|
238
|
+
children: [
|
|
239
|
+
labels.sort,
|
|
240
|
+
/* @__PURE__ */ jsx(
|
|
241
|
+
Select,
|
|
208
242
|
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
243
|
+
"aria-label": labels.sort,
|
|
244
|
+
value: state.sort?.key ?? "",
|
|
245
|
+
disabled: busy,
|
|
246
|
+
options: [
|
|
247
|
+
{
|
|
248
|
+
value: "",
|
|
249
|
+
label: labels.unsorted
|
|
250
|
+
},
|
|
251
|
+
...columns.map((column) => {
|
|
252
|
+
return {
|
|
253
|
+
value: column.key,
|
|
254
|
+
label: column.label
|
|
255
|
+
};
|
|
256
|
+
})
|
|
257
|
+
],
|
|
258
|
+
onValueChange: (key) => {
|
|
259
|
+
updateState({
|
|
260
|
+
sort: key ? {
|
|
261
|
+
key,
|
|
262
|
+
direction: "ascending"
|
|
263
|
+
} : null,
|
|
264
|
+
page: 0
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ jsx(
|
|
273
|
+
Button,
|
|
274
|
+
{
|
|
275
|
+
variant: "secondary",
|
|
276
|
+
disabled: busy || !state.sort,
|
|
277
|
+
onClick: () => {
|
|
278
|
+
if (state.sort) {
|
|
215
279
|
updateState({
|
|
216
|
-
|
|
280
|
+
sort: {
|
|
281
|
+
...state.sort,
|
|
282
|
+
direction: state.sort.direction === "ascending" ? "descending" : "ascending"
|
|
283
|
+
},
|
|
217
284
|
page: 0
|
|
218
285
|
});
|
|
219
286
|
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
287
|
+
},
|
|
288
|
+
children: state.sort?.direction === "descending" ? labels.descending : labels.ascending
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
),
|
|
294
|
+
onSelectionChange && /* @__PURE__ */ jsxs(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
className: explorerToolbarStyles(),
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
231
300
|
/* @__PURE__ */ jsx(
|
|
232
|
-
|
|
301
|
+
Checkbox,
|
|
233
302
|
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
disabled: busy,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
value: "",
|
|
240
|
-
label: labels.unsorted
|
|
241
|
-
},
|
|
242
|
-
...columns.map((column) => {
|
|
243
|
-
return {
|
|
244
|
-
value: column.key,
|
|
245
|
-
label: column.label
|
|
246
|
-
};
|
|
247
|
-
})
|
|
248
|
-
],
|
|
249
|
-
onValueChange: (key) => {
|
|
250
|
-
updateState({
|
|
251
|
-
sort: key ? {
|
|
252
|
-
key,
|
|
253
|
-
direction: "ascending"
|
|
254
|
-
} : null,
|
|
255
|
-
page: 0
|
|
256
|
-
});
|
|
303
|
+
checked: pageIds.length > 0 && selectedPageCount === pageIds.length,
|
|
304
|
+
indeterminate: selectedPageCount > 0 && selectedPageCount < pageIds.length,
|
|
305
|
+
disabled: busy || pageIds.length === 0,
|
|
306
|
+
onCheckedChange: (checked) => {
|
|
307
|
+
onSelectionChange(selectExplorerPage(selectedRowIds, pageIds, checked));
|
|
257
308
|
}
|
|
258
309
|
}
|
|
259
|
-
)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
310
|
+
),
|
|
311
|
+
" ",
|
|
312
|
+
labels.selectPage
|
|
313
|
+
] }),
|
|
314
|
+
/* @__PURE__ */ jsx(
|
|
315
|
+
"span",
|
|
316
|
+
{
|
|
317
|
+
role: "status",
|
|
318
|
+
children: labels.selected(selectedRowIds.length)
|
|
319
|
+
}
|
|
320
|
+
),
|
|
321
|
+
actions.map((action) => {
|
|
322
|
+
return /* @__PURE__ */ jsx(
|
|
323
|
+
Button,
|
|
324
|
+
{
|
|
325
|
+
variant: "secondary",
|
|
326
|
+
disabled: busy || selectedRowIds.length === 0 || action.disabled,
|
|
327
|
+
onClick: () => {
|
|
328
|
+
action.onAction(selectedRowIds);
|
|
274
329
|
},
|
|
275
|
-
|
|
276
|
-
}
|
|
330
|
+
children: action.label
|
|
331
|
+
},
|
|
332
|
+
action.label
|
|
333
|
+
);
|
|
334
|
+
})
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
hasNotice && /* @__PURE__ */ jsx("div", { children: notice }),
|
|
339
|
+
/* @__PURE__ */ jsxs(
|
|
340
|
+
Split,
|
|
341
|
+
{
|
|
342
|
+
direction: "column",
|
|
343
|
+
"aria-busy": busy,
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
346
|
+
DataTable,
|
|
347
|
+
{
|
|
348
|
+
label: labels.table,
|
|
349
|
+
variant: "structured",
|
|
350
|
+
blockEdges: "none",
|
|
351
|
+
inlineEdges: "none",
|
|
352
|
+
columns: tableColumns,
|
|
353
|
+
rows: tableRows,
|
|
354
|
+
rowKeys: pageIds
|
|
277
355
|
}
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
),
|
|
285
|
-
onSelectionChange && /* @__PURE__ */ jsxs(
|
|
286
|
-
"div",
|
|
287
|
-
{
|
|
288
|
-
className: explorerToolbarStyles(),
|
|
289
|
-
children: [
|
|
290
|
-
/* @__PURE__ */ jsxs("label", { children: [
|
|
291
|
-
/* @__PURE__ */ jsx(
|
|
292
|
-
Checkbox,
|
|
293
|
-
{
|
|
294
|
-
checked: pageIds.length > 0 && selectedPageCount === pageIds.length,
|
|
295
|
-
indeterminate: selectedPageCount > 0 && selectedPageCount < pageIds.length,
|
|
296
|
-
disabled: busy || pageIds.length === 0,
|
|
297
|
-
onCheckedChange: (checked) => {
|
|
298
|
-
onSelectionChange(selectExplorerPage(selectedRowIds, pageIds, checked));
|
|
356
|
+
) }),
|
|
357
|
+
view.rows.length === 0 && !busy && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
358
|
+
"p",
|
|
359
|
+
{
|
|
360
|
+
className: "gridui-u-m-0 gridui-u-p-gridui-16",
|
|
361
|
+
children: labels.empty
|
|
299
362
|
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
),
|
|
345
|
-
view.rows.length === 0 && !busy && /* @__PURE__ */ jsx("p", { children: labels.empty })
|
|
346
|
-
]
|
|
347
|
-
}
|
|
348
|
-
),
|
|
349
|
-
/* @__PURE__ */ jsxs(
|
|
350
|
-
"div",
|
|
351
|
-
{
|
|
352
|
-
className: explorerFooterStyles(),
|
|
353
|
-
children: [
|
|
354
|
-
/* @__PURE__ */ jsx(
|
|
355
|
-
Button,
|
|
356
|
-
{
|
|
357
|
-
variant: "secondary",
|
|
358
|
-
disabled: busy || view.page === 0,
|
|
359
|
-
onClick: () => {
|
|
360
|
-
updateState({ page: view.page - 1 });
|
|
361
|
-
},
|
|
362
|
-
children: labels.previous
|
|
363
|
-
}
|
|
364
|
-
),
|
|
365
|
-
/* @__PURE__ */ jsx(
|
|
366
|
-
"span",
|
|
367
|
-
{
|
|
368
|
-
role: "status",
|
|
369
|
-
children: labels.page(view.page + 1, view.pageCount, view.total)
|
|
370
|
-
}
|
|
371
|
-
),
|
|
372
|
-
/* @__PURE__ */ jsx(
|
|
373
|
-
Button,
|
|
374
|
-
{
|
|
375
|
-
variant: "secondary",
|
|
376
|
-
disabled: busy || view.page + 1 >= view.pageCount,
|
|
377
|
-
onClick: () => {
|
|
378
|
-
updateState({ page: view.page + 1 });
|
|
379
|
-
},
|
|
380
|
-
children: labels.next
|
|
381
|
-
}
|
|
382
|
-
)
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
)
|
|
386
|
-
]
|
|
363
|
+
) })
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ jsxs(
|
|
368
|
+
"div",
|
|
369
|
+
{
|
|
370
|
+
className: explorerFooterStyles(),
|
|
371
|
+
children: [
|
|
372
|
+
/* @__PURE__ */ jsx(
|
|
373
|
+
Button,
|
|
374
|
+
{
|
|
375
|
+
variant: "secondary",
|
|
376
|
+
disabled: busy || view.page === 0,
|
|
377
|
+
onClick: () => {
|
|
378
|
+
updateState({ page: view.page - 1 });
|
|
379
|
+
},
|
|
380
|
+
children: labels.previous
|
|
381
|
+
}
|
|
382
|
+
),
|
|
383
|
+
/* @__PURE__ */ jsx(
|
|
384
|
+
"span",
|
|
385
|
+
{
|
|
386
|
+
role: "status",
|
|
387
|
+
children: labels.page(view.page + 1, view.pageCount, view.total)
|
|
388
|
+
}
|
|
389
|
+
),
|
|
390
|
+
/* @__PURE__ */ jsx(
|
|
391
|
+
Button,
|
|
392
|
+
{
|
|
393
|
+
variant: "secondary",
|
|
394
|
+
disabled: busy || view.page + 1 >= view.pageCount,
|
|
395
|
+
onClick: () => {
|
|
396
|
+
updateState({ page: view.page + 1 });
|
|
397
|
+
},
|
|
398
|
+
children: labels.next
|
|
399
|
+
}
|
|
400
|
+
)
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
)
|
|
404
|
+
]
|
|
405
|
+
}
|
|
406
|
+
)
|
|
387
407
|
}
|
|
388
408
|
);
|
|
389
409
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/data-explorer/model.ts", "../src/data-explorer/style.ts", "../src/data-explorer/data-explorer.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Model\n */\n\nexport type DataExplorerValue = string | number | null;\n\nexport type DataExplorerRow = {\n readonly id: string;\n readonly values: Readonly<Record<string, DataExplorerValue>>;\n};\n\nexport type DataExplorerColumn = {\n readonly key: string;\n readonly label: string;\n readonly numeric?: boolean;\n};\n\nexport type DataExplorerState = {\n readonly query: string;\n readonly filterValue: string;\n readonly sort: {\n readonly key: string;\n readonly direction: \"ascending\" | \"descending\";\n } | null;\n readonly page: number;\n};\n\nexport type DataExplorerFilter = {\n readonly key: string;\n readonly label: string;\n readonly options: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n};\n\nconst compareValues = (\n left: DataExplorerValue | undefined,\n right: DataExplorerValue | undefined,\n direction: \"ascending\" | \"descending\",\n): number => {\n // Missing values stay last in either direction; equal values preserve input order.\n if (left === null || left === undefined) {\n return right === null || right === undefined ? 0 : 1;\n }\n if (right === null || right === undefined) {\n return -1;\n }\n let comparison = 0;\n if (typeof left === \"number\" && typeof right === \"number\") {\n comparison = left - right;\n } else if (String(left) < String(right)) {\n comparison = -1;\n } else if (String(left) > String(right)) {\n comparison = 1;\n }\n return direction === \"ascending\" ? comparison : -comparison;\n};\n\nexport const selectExplorerRows = (\n rows: readonly DataExplorerRow[],\n columns: readonly DataExplorerColumn[],\n state: DataExplorerState,\n pageSize: number,\n filter?: DataExplorerFilter,\n) => {\n const validPageSize = Number.isInteger(pageSize) && pageSize > 0;\n const validPage = Number.isInteger(state.page) && state.page >= 0;\n if (!validPageSize || !validPage) {\n throw new RangeError(\"DataExplorer needs a positive integer pageSize and a non-negative integer page.\");\n }\n const rowIds = rows.map(row => {\n return row.id;\n });\n const columnKeys = columns.map(column => {\n return column.key;\n });\n const hasDuplicateRows = new Set(rowIds).size !== rows.length;\n const hasDuplicateColumns = new Set(columnKeys).size !== columns.length;\n if (hasDuplicateRows || hasDuplicateColumns) {\n throw new Error(\"DataExplorer row ids and column keys must be unique.\");\n }\n const query = state.query.trim().toLowerCase();\n const filtered = rows.filter(row => {\n const matchesQuery = !query || columns.some(column => {\n const cellText = String(row.values[column.key] ?? \"\").toLowerCase();\n return cellText.includes(query);\n });\n const matchesFilter = !filter || !state.filterValue\n || String(row.values[filter.key] ?? \"\") === state.filterValue;\n return matchesQuery && matchesFilter;\n });\n const sort = state.sort;\n if (sort && columnKeys.includes(sort.key)) {\n filtered.sort((left, right) => {\n return compareValues(left.values[sort.key], right.values[sort.key], sort.direction);\n });\n }\n const pageCount = Math.max(1, Math.ceil(filtered.length / pageSize));\n const page = Math.min(state.page, pageCount - 1);\n return {\n rows: filtered.slice(page * pageSize, (page + 1) * pageSize),\n total: filtered.length,\n page,\n pageCount,\n };\n};\n\nexport const selectExplorerPage = (\n selectedIds: readonly string[],\n pageIds: readonly string[],\n checked: boolean,\n): string[] => {\n const selected = new Set(selectedIds);\n for (const id of pageIds) {\n if (checked) {\n selected.add(id);\n } else {\n selected.delete(id);\n }\n }\n return [...selected];\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerStyles = cva(\"min-w-0 border border-border bg-background text-foreground\");\n\nexport const explorerToolbarStyles = cva(\"flex min-w-0 flex-wrap items-end gap-gridui-16 border-b border-border p-gridui-16 [&_label]:min-h-11\");\n\nexport const explorerLabelStyles = cva(\"flex min-w-0 flex-1 basis-40 flex-col gap-gridui-4 text-muted type-caption\");\n\nexport const explorerFooterStyles = cva(\"flex flex-wrap items-center justify-between gap-gridui-8 border-t border-border p-gridui-16\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Data Explorer\n */\n\nimport { type DataExplorerColumn, type DataExplorerFilter, type DataExplorerRow, type DataExplorerState, type DataExplorerValue, selectExplorerPage, selectExplorerRows } from \"./model\";\nimport { explorerFooterStyles, explorerLabelStyles, explorerStyles, explorerToolbarStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { Input } from \"@gridui/input\";\nimport { Select } from \"@gridui/select\";\nimport { cn } from \"@gridui/style-utils\";\nimport { DataTable } from \"@gridui/table\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type DataExplorerProps = Omit<ComponentPropsWithRef<\"section\">, \"children\"> & {\n readonly rows: readonly DataExplorerRow[];\n readonly columns: readonly DataExplorerColumn[];\n readonly state: DataExplorerState;\n readonly onStateChange: (state: DataExplorerState) => void;\n readonly filter?: DataExplorerFilter;\n readonly pageSize?: number;\n readonly selectedIds?: readonly string[];\n readonly onSelectionChange?: (ids: readonly string[]) => void;\n readonly actions?: readonly {\n readonly label: string;\n readonly onAction: (ids: readonly string[]) => void;\n readonly disabled?: boolean;\n }[];\n readonly renderCell?: (\n value: DataExplorerValue | undefined,\n row: DataExplorerRow,\n column: DataExplorerColumn,\n ) => ReactNode;\n readonly busy?: boolean;\n readonly notice?: ReactNode;\n readonly labels: {\n readonly table: string;\n readonly search: string;\n readonly sort: string;\n readonly unsorted: string;\n readonly ascending: string;\n readonly descending: string;\n readonly all: string;\n readonly selection: string;\n readonly selectPage: string;\n readonly selectRow: (row: DataExplorerRow) => string;\n readonly selected: (count: number) => string;\n readonly previous: string;\n readonly next: string;\n readonly page: (page: number, pages: number, total: number) => string;\n readonly empty: string;\n };\n};\n\nexport const DataExplorer: FC<DataExplorerProps> = (props: DataExplorerProps) => {\n const {\n rows,\n columns,\n state,\n onStateChange,\n filter,\n pageSize = 10,\n selectedIds = [],\n onSelectionChange,\n actions = [],\n renderCell,\n busy = false,\n notice,\n labels,\n className,\n ...restProps\n } = props;\n const view = selectExplorerRows(rows, columns, state, pageSize, filter);\n const existingRowIds = new Set(rows.map(row => {\n return row.id;\n }));\n const selectedRowIds = [...new Set(selectedIds)].filter(id => {\n return existingRowIds.has(id);\n });\n const pageIds = view.rows.map(row => {\n return row.id;\n });\n const selectedPageCount = pageIds.filter(id => {\n return selectedRowIds.includes(id);\n }).length;\n const updateState = (changes: Partial<DataExplorerState>) => {\n if (!busy) {\n onStateChange({\n ...state,\n ...changes,\n });\n }\n };\n const tableColumns = columns.map(column => {\n return {\n label: column.label,\n ...(column.numeric !== undefined ? { numeric: column.numeric } : {}),\n };\n });\n if (onSelectionChange) {\n tableColumns.unshift({ label: labels.selection });\n }\n const tableRows = view.rows.map(row => {\n const cells = columns.map(column => {\n const value = row.values[column.key];\n if (renderCell) {\n return renderCell(value, row, column);\n }\n return value ?? \"\";\n });\n if (onSelectionChange) {\n cells.unshift((<Checkbox\n key=\"select\"\n aria-label={labels.selectRow(row)}\n checked={selectedRowIds.includes(row.id)}\n disabled={busy}\n onCheckedChange={checked => {\n const nextSelection = selectExplorerPage(selectedRowIds, [row.id], checked);\n onSelectionChange(nextSelection);\n }}\n />));\n }\n return cells;\n });\n return (<section\n {...restProps}\n aria-label={labels.table}\n className={cn(explorerStyles(), className)}\n >\n <div\n className={explorerToolbarStyles()}\n >\n <label\n className={explorerLabelStyles()}\n >\n {labels.search}\n <Input\n type=\"search\"\n value={state.query}\n disabled={busy}\n onValueChange={query => {\n updateState({\n query,\n page: 0,\n });\n }}\n />\n </label>\n {filter && (<label\n className={explorerLabelStyles()}\n >\n {filter.label}\n <Select\n aria-label={filter.label}\n value={state.filterValue}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.all,\n },\n ...filter.options,\n ]}\n onValueChange={filterValue => {\n updateState({\n filterValue,\n page: 0,\n });\n }}\n />\n </label>)}\n <label\n className={explorerLabelStyles()}\n >\n {labels.sort}\n <Select\n aria-label={labels.sort}\n value={state.sort?.key ?? \"\"}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.unsorted,\n },\n ...columns.map(column => {\n return {\n value: column.key,\n label: column.label,\n };\n }),\n ]}\n onValueChange={key => {\n updateState({\n sort: key ? {\n key,\n direction: \"ascending\",\n } : null,\n page: 0,\n });\n }}\n />\n </label>\n <Button\n variant=\"secondary\"\n disabled={busy || !state.sort}\n onClick={() => {\n if (state.sort) {\n updateState({\n sort: {\n ...state.sort,\n direction: state.sort.direction === \"ascending\" ? \"descending\" : \"ascending\",\n },\n page: 0,\n });\n }\n }}\n >\n {state.sort?.direction === \"descending\" ? labels.descending : labels.ascending}\n </Button>\n </div>\n {onSelectionChange && (<div\n className={explorerToolbarStyles()}\n >\n <label>\n <Checkbox\n checked={pageIds.length > 0 && selectedPageCount === pageIds.length}\n indeterminate={selectedPageCount > 0 && selectedPageCount < pageIds.length}\n disabled={busy || pageIds.length === 0}\n onCheckedChange={checked => {\n onSelectionChange(selectExplorerPage(selectedRowIds, pageIds, checked));\n }}\n />\n {\" \"}\n {labels.selectPage}\n </label>\n <span\n role=\"status\"\n >\n {labels.selected(selectedRowIds.length)}\n </span>\n {actions.map(action => {\n return (<Button\n key={action.label}\n variant=\"secondary\"\n disabled={busy || selectedRowIds.length === 0 || action.disabled}\n onClick={() => {\n action.onAction(selectedRowIds);\n }}\n >\n {action.label}\n </Button>);\n })}\n </div>)}\n {notice}\n <div\n aria-busy={busy}\n >\n <DataTable\n label={labels.table}\n variant=\"structured\"\n columns={tableColumns}\n rows={tableRows}\n rowKeys={pageIds}\n />\n {view.rows.length === 0 && !busy && (<p>\n {labels.empty}\n </p>)}\n </div>\n <div\n className={explorerFooterStyles()}\n >\n <Button\n variant=\"secondary\"\n disabled={busy || view.page === 0}\n onClick={() => {\n updateState({ page: view.page - 1 });\n }}\n >\n {labels.previous}\n </Button>\n <span\n role=\"status\"\n >\n {labels.page(view.page + 1, view.pageCount, view.total)}\n </span>\n <Button\n variant=\"secondary\"\n disabled={busy || view.page + 1 >= view.pageCount}\n onClick={() => {\n updateState({ page: view.page + 1 });\n }}\n >\n {labels.next}\n </Button>\n </div>\n </section>);\n};\n"],
|
|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,OAAO,GAAG,KAAK,EAAE,EAAE,YAAY;AAClE,aAAO,SAAS,SAAS,KAAK;AAAA,IAClC,CAAC;AACD,UAAM,gBAAgB,CAAC,UAAU,CAAC,MAAM,eACjC,OAAO,IAAI,OAAO,OAAO,GAAG,KAAK,EAAE,MAAM,MAAM;AACtD,WAAO,gBAAgB;AAAA,EAC3B,CAAC;AACD,QAAM,OAAO,MAAM;AACnB,MAAI,QAAQ,WAAW,SAAS,KAAK,GAAG,GAAG;AACvC,aAAS,KAAK,CAAC,MAAM,UAAU;AAC3B,aAAO,cAAc,KAAK,OAAO,KAAK,GAAG,GAAG,MAAM,OAAO,KAAK,GAAG,GAAG,KAAK,SAAS;AAAA,IACtF,CAAC;AAAA,EACL;AACA,QAAM,YAAY,KAAK,IAAI,GAAG,KAAK,KAAK,SAAS,SAAS,QAAQ,CAAC;AACnE,QAAM,OAAO,KAAK,IAAI,MAAM,MAAM,YAAY,CAAC;AAC/C,SAAO;AAAA,IACH,MAAM,SAAS,MAAM,OAAO,WAAW,OAAO,KAAK,QAAQ;AAAA,IAC3D,OAAO,SAAS;AAAA,IAChB;AAAA,IACA;AAAA,EACJ;AACJ;AAEO,IAAM,qBAAqB,CAC9B,aACA,SACA,YACW;AACX,QAAM,WAAW,IAAI,IAAI,WAAW;AACpC,aAAW,MAAM,SAAS;AACtB,QAAI,SAAS;AACT,eAAS,IAAI,EAAE;AAAA,IACnB,OAAO;AACH,eAAS,OAAO,EAAE;AAAA,IACtB;AAAA,EACJ;AACA,SAAO,CAAC,GAAG,QAAQ;AACvB;;;ACtHA,SAAS,WAAW;AAEb,IAAM,iBAAiB,IAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Model\n */\n\nexport type DataExplorerValue = string | number | null;\n\nexport type DataExplorerRow = {\n readonly id: string;\n readonly values: Readonly<Record<string, DataExplorerValue>>;\n};\n\nexport type DataExplorerColumn = {\n readonly key: string;\n readonly label: string;\n readonly numeric?: boolean;\n};\n\nexport type DataExplorerState = {\n readonly query: string;\n readonly filterValue: string;\n readonly sort: {\n readonly key: string;\n readonly direction: \"ascending\" | \"descending\";\n } | null;\n readonly page: number;\n};\n\nexport type DataExplorerFilter = {\n readonly key: string;\n readonly label: string;\n readonly options: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n};\n\nconst compareValues = (\n left: DataExplorerValue | undefined,\n right: DataExplorerValue | undefined,\n direction: \"ascending\" | \"descending\",\n): number => {\n // Missing values stay last in either direction; equal values preserve input order.\n if (left === null || left === undefined) {\n return right === null || right === undefined ? 0 : 1;\n }\n if (right === null || right === undefined) {\n return -1;\n }\n let comparison = 0;\n if (typeof left === \"number\" && typeof right === \"number\") {\n comparison = left - right;\n } else if (String(left) < String(right)) {\n comparison = -1;\n } else if (String(left) > String(right)) {\n comparison = 1;\n }\n return direction === \"ascending\" ? comparison : -comparison;\n};\n\nexport const selectExplorerRows = (\n rows: readonly DataExplorerRow[],\n columns: readonly DataExplorerColumn[],\n state: DataExplorerState,\n pageSize: number,\n filter?: DataExplorerFilter,\n) => {\n const validPageSize = Number.isInteger(pageSize) && pageSize > 0;\n const validPage = Number.isInteger(state.page) && state.page >= 0;\n if (!validPageSize || !validPage) {\n throw new RangeError(\"DataExplorer needs a positive integer pageSize and a non-negative integer page.\");\n }\n const rowIds = rows.map(row => {\n return row.id;\n });\n const columnKeys = columns.map(column => {\n return column.key;\n });\n const hasDuplicateRows = new Set(rowIds).size !== rows.length;\n const hasDuplicateColumns = new Set(columnKeys).size !== columns.length;\n if (hasDuplicateRows || hasDuplicateColumns) {\n throw new Error(\"DataExplorer row ids and column keys must be unique.\");\n }\n const query = state.query.trim().toLowerCase();\n const filtered = rows.filter(row => {\n const matchesQuery = !query || columns.some(column => {\n const cellText = String(row.values[column.key] ?? \"\").toLowerCase();\n return cellText.includes(query);\n });\n const matchesFilter = !filter || !state.filterValue\n || String(row.values[filter.key] ?? \"\") === state.filterValue;\n return matchesQuery && matchesFilter;\n });\n const sort = state.sort;\n if (sort && columnKeys.includes(sort.key)) {\n filtered.sort((left, right) => {\n return compareValues(left.values[sort.key], right.values[sort.key], sort.direction);\n });\n }\n const pageCount = Math.max(1, Math.ceil(filtered.length / pageSize));\n const page = Math.min(state.page, pageCount - 1);\n return {\n rows: filtered.slice(page * pageSize, (page + 1) * pageSize),\n total: filtered.length,\n page,\n pageCount,\n };\n};\n\nexport const selectExplorerPage = (\n selectedIds: readonly string[],\n pageIds: readonly string[],\n checked: boolean,\n): string[] => {\n const selected = new Set(selectedIds);\n for (const id of pageIds) {\n if (checked) {\n selected.add(id);\n } else {\n selected.delete(id);\n }\n }\n return [...selected];\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerStyles = cva(\"gridui-u-min-w-0 gridui-u-border gridui-u-border-border gridui-u-bg-background gridui-u-text-foreground\");\n\nexport const explorerToolbarStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-wrap gridui-u-items-end gridui-u-gap-gridui-16 gridui-u-p-gridui-16 gridui-u-[&_label]:min-h-11\");\n\nexport const explorerLabelStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-[1_1_10rem] gridui-u-flex-col gridui-u-gap-gridui-4 gridui-u-text-muted gridui-u-type-caption\");\n\nexport const explorerFooterStyles = cva(\"gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-8 gridui-u-p-gridui-16\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Data Explorer\n */\n\nimport { type DataExplorerColumn, type DataExplorerFilter, type DataExplorerRow, type DataExplorerState, type DataExplorerValue, selectExplorerPage, selectExplorerRows } from \"./model\";\nimport { explorerFooterStyles, explorerLabelStyles, explorerStyles, explorerToolbarStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { Split } from \"@gridui/grid\";\nimport { Input } from \"@gridui/input\";\nimport { Select } from \"@gridui/select\";\nimport { cn } from \"@gridui/style-utils\";\nimport { DataTable } from \"@gridui/table\";\nimport { Children, type ComponentPropsWithRef, type FC, type ReactNode } from \"react\";\n\nexport type DataExplorerProps = Omit<ComponentPropsWithRef<\"section\">, \"children\"> & {\n readonly rows: readonly DataExplorerRow[];\n readonly columns: readonly DataExplorerColumn[];\n readonly state: DataExplorerState;\n readonly onStateChange: (state: DataExplorerState) => void;\n readonly filter?: DataExplorerFilter;\n readonly pageSize?: number;\n readonly selectedIds?: readonly string[];\n readonly onSelectionChange?: (ids: readonly string[]) => void;\n readonly actions?: readonly {\n readonly label: string;\n readonly onAction: (ids: readonly string[]) => void;\n readonly disabled?: boolean;\n }[];\n readonly renderCell?: (\n value: DataExplorerValue | undefined,\n row: DataExplorerRow,\n column: DataExplorerColumn,\n ) => ReactNode;\n readonly busy?: boolean;\n readonly notice?: ReactNode;\n readonly labels: {\n readonly table: string;\n readonly search: string;\n readonly sort: string;\n readonly unsorted: string;\n readonly ascending: string;\n readonly descending: string;\n readonly all: string;\n readonly selection: string;\n readonly selectPage: string;\n readonly selectRow: (row: DataExplorerRow) => string;\n readonly selected: (count: number) => string;\n readonly previous: string;\n readonly next: string;\n readonly page: (page: number, pages: number, total: number) => string;\n readonly empty: string;\n };\n};\n\nexport const DataExplorer: FC<DataExplorerProps> = (props: DataExplorerProps) => {\n const {\n rows,\n columns,\n state,\n onStateChange,\n filter,\n pageSize = 10,\n selectedIds = [],\n onSelectionChange,\n actions = [],\n renderCell,\n busy = false,\n notice,\n labels,\n className,\n ...restProps\n } = props;\n const hasNotice = Children.toArray(notice).some(child => {\n return child !== \"\";\n });\n const view = selectExplorerRows(rows, columns, state, pageSize, filter);\n const existingRowIds = new Set(rows.map(row => {\n return row.id;\n }));\n const selectedRowIds = [...new Set(selectedIds)].filter(id => {\n return existingRowIds.has(id);\n });\n const pageIds = view.rows.map(row => {\n return row.id;\n });\n const selectedPageCount = pageIds.filter(id => {\n return selectedRowIds.includes(id);\n }).length;\n const updateState = (changes: Partial<DataExplorerState>) => {\n if (!busy) {\n onStateChange({\n ...state,\n ...changes,\n });\n }\n };\n const tableColumns = columns.map(column => {\n return {\n label: column.label,\n ...(column.numeric !== undefined ? { numeric: column.numeric } : {}),\n };\n });\n if (onSelectionChange) {\n tableColumns.unshift({ label: labels.selection });\n }\n const tableRows = view.rows.map(row => {\n const cells = columns.map(column => {\n const value = row.values[column.key];\n if (renderCell) {\n return renderCell(value, row, column);\n }\n return value ?? \"\";\n });\n if (onSelectionChange) {\n cells.unshift((<Checkbox\n key=\"select\"\n aria-label={labels.selectRow(row)}\n checked={selectedRowIds.includes(row.id)}\n disabled={busy}\n onCheckedChange={checked => {\n const nextSelection = selectExplorerPage(selectedRowIds, [row.id], checked);\n onSelectionChange(nextSelection);\n }}\n />));\n }\n return cells;\n });\n return (<section\n {...restProps}\n aria-label={labels.table}\n className={cn(explorerStyles(), className)}\n >\n <Split\n direction=\"column\"\n >\n <div\n className={explorerToolbarStyles()}\n >\n <label\n className={explorerLabelStyles()}\n >\n {labels.search}\n <Input\n type=\"search\"\n value={state.query}\n disabled={busy}\n onValueChange={query => {\n updateState({\n query,\n page: 0,\n });\n }}\n />\n </label>\n {filter && (<label\n className={explorerLabelStyles()}\n >\n {filter.label}\n <Select\n aria-label={filter.label}\n value={state.filterValue}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.all,\n },\n ...filter.options,\n ]}\n onValueChange={filterValue => {\n updateState({\n filterValue,\n page: 0,\n });\n }}\n />\n </label>)}\n <label\n className={explorerLabelStyles()}\n >\n {labels.sort}\n <Select\n aria-label={labels.sort}\n value={state.sort?.key ?? \"\"}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.unsorted,\n },\n ...columns.map(column => {\n return {\n value: column.key,\n label: column.label,\n };\n }),\n ]}\n onValueChange={key => {\n updateState({\n sort: key ? {\n key,\n direction: \"ascending\",\n } : null,\n page: 0,\n });\n }}\n />\n </label>\n <Button\n variant=\"secondary\"\n disabled={busy || !state.sort}\n onClick={() => {\n if (state.sort) {\n updateState({\n sort: {\n ...state.sort,\n direction: state.sort.direction === \"ascending\" ? \"descending\" : \"ascending\",\n },\n page: 0,\n });\n }\n }}\n >\n {state.sort?.direction === \"descending\" ? labels.descending : labels.ascending}\n </Button>\n </div>\n {onSelectionChange && (<div\n className={explorerToolbarStyles()}\n >\n <label>\n <Checkbox\n checked={pageIds.length > 0 && selectedPageCount === pageIds.length}\n indeterminate={selectedPageCount > 0 && selectedPageCount < pageIds.length}\n disabled={busy || pageIds.length === 0}\n onCheckedChange={checked => {\n onSelectionChange(selectExplorerPage(selectedRowIds, pageIds, checked));\n }}\n />\n {\" \"}\n {labels.selectPage}\n </label>\n <span\n role=\"status\"\n >\n {labels.selected(selectedRowIds.length)}\n </span>\n {actions.map(action => {\n return (<Button\n key={action.label}\n variant=\"secondary\"\n disabled={busy || selectedRowIds.length === 0 || action.disabled}\n onClick={() => {\n action.onAction(selectedRowIds);\n }}\n >\n {action.label}\n </Button>);\n })}\n </div>)}\n {hasNotice && (<div>\n {notice}\n </div>)}\n <Split\n direction=\"column\"\n aria-busy={busy}\n >\n <div>\n <DataTable\n label={labels.table}\n variant=\"structured\"\n blockEdges=\"none\"\n inlineEdges=\"none\"\n columns={tableColumns}\n rows={tableRows}\n rowKeys={pageIds}\n />\n </div>\n {view.rows.length === 0 && !busy && (<div>\n <p\n className=\"gridui-u-m-0 gridui-u-p-gridui-16\"\n >\n {labels.empty}\n </p>\n </div>)}\n </Split>\n <div\n className={explorerFooterStyles()}\n >\n <Button\n variant=\"secondary\"\n disabled={busy || view.page === 0}\n onClick={() => {\n updateState({ page: view.page - 1 });\n }}\n >\n {labels.previous}\n </Button>\n <span\n role=\"status\"\n >\n {labels.page(view.page + 1, view.pageCount, view.total)}\n </span>\n <Button\n variant=\"secondary\"\n disabled={busy || view.page + 1 >= view.pageCount}\n onClick={() => {\n updateState({ page: view.page + 1 });\n }}\n >\n {labels.next}\n </Button>\n </div>\n </Split>\n </section>);\n};\n"],
|
|
5
|
+
"mappings": ";AAuCA,IAAM,gBAAgB,CAClB,MACA,OACA,cACS;AAET,MAAI,SAAS,QAAQ,SAAS,QAAW;AACrC,WAAO,UAAU,QAAQ,UAAU,SAAY,IAAI;AAAA,EACvD;AACA,MAAI,UAAU,QAAQ,UAAU,QAAW;AACvC,WAAO;AAAA,EACX;AACA,MAAI,aAAa;AACjB,MAAI,OAAO,SAAS,YAAY,OAAO,UAAU,UAAU;AACvD,iBAAa,OAAO;AAAA,EACxB,WAAW,OAAO,IAAI,IAAI,OAAO,KAAK,GAAG;AACrC,iBAAa;AAAA,EACjB,WAAW,OAAO,IAAI,IAAI,OAAO,KAAK,GAAG;AACrC,iBAAa;AAAA,EACjB;AACA,SAAO,cAAc,cAAc,aAAa,CAAC;AACrD;AAEO,IAAM,qBAAqB,CAC9B,MACA,SACA,OACA,UACA,WACC;AACD,QAAM,gBAAgB,OAAO,UAAU,QAAQ,KAAK,WAAW;AAC/D,QAAM,YAAY,OAAO,UAAU,MAAM,IAAI,KAAK,MAAM,QAAQ;AAChE,MAAI,CAAC,iBAAiB,CAAC,WAAW;AAC9B,UAAM,IAAI,WAAW,iFAAiF;AAAA,EAC1G;AACA,QAAM,SAAS,KAAK,IAAI,SAAO;AAC3B,WAAO,IAAI;AAAA,EACf,CAAC;AACD,QAAM,aAAa,QAAQ,IAAI,YAAU;AACrC,WAAO,OAAO;AAAA,EAClB,CAAC;AACD,QAAM,mBAAmB,IAAI,IAAI,MAAM,EAAE,SAAS,KAAK;AACvD,QAAM,sBAAsB,IAAI,IAAI,UAAU,EAAE,SAAS,QAAQ;AACjE,MAAI,oBAAoB,qBAAqB;AACzC,UAAM,IAAI,MAAM,sDAAsD;AAAA,EAC1E;AACA,QAAM,QAAQ,MAAM,MAAM,KAAK,EAAE,YAAY;AAC7C,QAAM,WAAW,KAAK,OA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|
-
.
|
|
11
|
-
|
|
10
|
+
.gridui-u-m-0 {
|
|
11
|
+
margin: 0px;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
14
|
-
display:
|
|
13
|
+
.gridui-u-flex {
|
|
14
|
+
display: flex;
|
|
15
15
|
}
|
|
16
|
-
.min-w-0 {
|
|
16
|
+
.gridui-u-min-w-0 {
|
|
17
17
|
min-width: 0px;
|
|
18
18
|
}
|
|
19
|
-
.flex
|
|
20
|
-
flex: 1;
|
|
21
|
-
}
|
|
22
|
-
.basis-40 {
|
|
23
|
-
flex-basis: calc(var(--spacing) * 40);
|
|
19
|
+
.gridui-u-flex-\[1_1_10rem\] {
|
|
20
|
+
flex: 1 1 10rem;
|
|
24
21
|
}
|
|
25
|
-
.flex-col {
|
|
22
|
+
.gridui-u-flex-col {
|
|
26
23
|
flex-direction: column;
|
|
27
24
|
}
|
|
28
|
-
.flex-wrap {
|
|
25
|
+
.gridui-u-flex-wrap {
|
|
29
26
|
flex-wrap: wrap;
|
|
30
27
|
}
|
|
31
|
-
.items-center {
|
|
28
|
+
.gridui-u-items-center {
|
|
32
29
|
align-items: center;
|
|
33
30
|
}
|
|
34
|
-
.items-end {
|
|
31
|
+
.gridui-u-items-end {
|
|
35
32
|
align-items: flex-end;
|
|
36
33
|
}
|
|
37
|
-
.justify-between {
|
|
34
|
+
.gridui-u-justify-between {
|
|
38
35
|
justify-content: space-between;
|
|
39
36
|
}
|
|
40
|
-
.gap-gridui-4 {
|
|
37
|
+
.gridui-u-gap-gridui-4 {
|
|
41
38
|
gap: var(--gridui-space-4);
|
|
42
39
|
}
|
|
43
|
-
.gap-gridui-8 {
|
|
40
|
+
.gridui-u-gap-gridui-8 {
|
|
44
41
|
gap: var(--gridui-space-8);
|
|
45
42
|
}
|
|
46
|
-
.gap-gridui-16 {
|
|
43
|
+
.gridui-u-gap-gridui-16 {
|
|
47
44
|
gap: var(--gridui-space-16);
|
|
48
45
|
}
|
|
49
|
-
.border {
|
|
46
|
+
.gridui-u-border {
|
|
50
47
|
border-style: var(--tw-border-style);
|
|
51
48
|
border-width: 1px;
|
|
52
49
|
}
|
|
53
|
-
.border-
|
|
54
|
-
border-top-style: var(--tw-border-style);
|
|
55
|
-
border-top-width: 1px;
|
|
56
|
-
}
|
|
57
|
-
.border-b {
|
|
58
|
-
border-bottom-style: var(--tw-border-style);
|
|
59
|
-
border-bottom-width: 1px;
|
|
60
|
-
}
|
|
61
|
-
.border-border {
|
|
50
|
+
.gridui-u-border-border {
|
|
62
51
|
border-color: var(--gridui-border);
|
|
63
52
|
}
|
|
64
|
-
.bg-background {
|
|
53
|
+
.gridui-u-bg-background {
|
|
65
54
|
background-color: var(--gridui-background);
|
|
66
55
|
}
|
|
67
|
-
.p-gridui-16 {
|
|
56
|
+
.gridui-u-p-gridui-16 {
|
|
68
57
|
padding: var(--gridui-space-16);
|
|
69
58
|
}
|
|
70
|
-
.type-caption {
|
|
59
|
+
.gridui-u-type-caption {
|
|
71
60
|
font: var(--gridui-type-caption);
|
|
72
61
|
letter-spacing: normal;
|
|
73
62
|
}
|
|
74
|
-
.text-foreground {
|
|
63
|
+
.gridui-u-text-foreground {
|
|
75
64
|
color: var(--gridui-foreground);
|
|
76
65
|
}
|
|
77
|
-
.text-muted {
|
|
66
|
+
.gridui-u-text-muted {
|
|
78
67
|
color: var(--gridui-muted);
|
|
79
68
|
}
|
|
80
|
-
|
|
81
|
-
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,) !important;
|
|
82
|
-
}
|
|
83
|
-
.\[\&_label\]\:min-h-11 label {
|
|
69
|
+
.gridui-u-\[\&_label\]\:min-h-11 label {
|
|
84
70
|
min-height: calc(var(--spacing) * 11);
|
|
85
71
|
}
|
|
86
72
|
}
|
|
@@ -89,76 +75,10 @@
|
|
|
89
75
|
inherits: false;
|
|
90
76
|
initial-value: solid;
|
|
91
77
|
}
|
|
92
|
-
@property --tw-blur {
|
|
93
|
-
syntax: "*";
|
|
94
|
-
inherits: false;
|
|
95
|
-
}
|
|
96
|
-
@property --tw-brightness {
|
|
97
|
-
syntax: "*";
|
|
98
|
-
inherits: false;
|
|
99
|
-
}
|
|
100
|
-
@property --tw-contrast {
|
|
101
|
-
syntax: "*";
|
|
102
|
-
inherits: false;
|
|
103
|
-
}
|
|
104
|
-
@property --tw-grayscale {
|
|
105
|
-
syntax: "*";
|
|
106
|
-
inherits: false;
|
|
107
|
-
}
|
|
108
|
-
@property --tw-hue-rotate {
|
|
109
|
-
syntax: "*";
|
|
110
|
-
inherits: false;
|
|
111
|
-
}
|
|
112
|
-
@property --tw-invert {
|
|
113
|
-
syntax: "*";
|
|
114
|
-
inherits: false;
|
|
115
|
-
}
|
|
116
|
-
@property --tw-opacity {
|
|
117
|
-
syntax: "*";
|
|
118
|
-
inherits: false;
|
|
119
|
-
}
|
|
120
|
-
@property --tw-saturate {
|
|
121
|
-
syntax: "*";
|
|
122
|
-
inherits: false;
|
|
123
|
-
}
|
|
124
|
-
@property --tw-sepia {
|
|
125
|
-
syntax: "*";
|
|
126
|
-
inherits: false;
|
|
127
|
-
}
|
|
128
|
-
@property --tw-drop-shadow {
|
|
129
|
-
syntax: "*";
|
|
130
|
-
inherits: false;
|
|
131
|
-
}
|
|
132
|
-
@property --tw-drop-shadow-color {
|
|
133
|
-
syntax: "*";
|
|
134
|
-
inherits: false;
|
|
135
|
-
}
|
|
136
|
-
@property --tw-drop-shadow-alpha {
|
|
137
|
-
syntax: "<percentage>";
|
|
138
|
-
inherits: false;
|
|
139
|
-
initial-value: 100%;
|
|
140
|
-
}
|
|
141
|
-
@property --tw-drop-shadow-size {
|
|
142
|
-
syntax: "*";
|
|
143
|
-
inherits: false;
|
|
144
|
-
}
|
|
145
78
|
@layer properties {
|
|
146
79
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
147
80
|
*, ::before, ::after, ::backdrop {
|
|
148
81
|
--tw-border-style: solid;
|
|
149
|
-
--tw-blur: initial;
|
|
150
|
-
--tw-brightness: initial;
|
|
151
|
-
--tw-contrast: initial;
|
|
152
|
-
--tw-grayscale: initial;
|
|
153
|
-
--tw-hue-rotate: initial;
|
|
154
|
-
--tw-invert: initial;
|
|
155
|
-
--tw-opacity: initial;
|
|
156
|
-
--tw-saturate: initial;
|
|
157
|
-
--tw-sepia: initial;
|
|
158
|
-
--tw-drop-shadow: initial;
|
|
159
|
-
--tw-drop-shadow-color: initial;
|
|
160
|
-
--tw-drop-shadow-alpha: 100%;
|
|
161
|
-
--tw-drop-shadow-size: initial;
|
|
162
82
|
}
|
|
163
83
|
}
|
|
164
84
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/data-explorer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "GridUI React data explorer",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -26,20 +26,23 @@
|
|
|
26
26
|
"react-dom": "^19.2.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@gridui/button": "^2.
|
|
30
|
-
"@gridui/choice": "^1.
|
|
31
|
-
"@gridui/
|
|
32
|
-
"@gridui/
|
|
33
|
-
"@gridui/
|
|
34
|
-
"@gridui/
|
|
35
|
-
"@gridui/
|
|
29
|
+
"@gridui/button": "^2.2.0",
|
|
30
|
+
"@gridui/choice": "^1.1.0",
|
|
31
|
+
"@gridui/grid": "^2.3.1",
|
|
32
|
+
"@gridui/input": "^1.1.2",
|
|
33
|
+
"@gridui/select": "^1.0.3",
|
|
34
|
+
"@gridui/style-utils": "^2.1.4",
|
|
35
|
+
"@gridui/table": "^1.0.2",
|
|
36
|
+
"@gridui/theme": "^2.3.2",
|
|
36
37
|
"class-variance-authority": "0.7.1"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@gridui-internal/configuration": "0.0.0",
|
|
40
|
+
"@gridui-internal/configuration": "0.0.0-internal",
|
|
41
|
+
"@gridui/inline-notice": "1.0.2",
|
|
40
42
|
"@jest/globals": "30.5.2",
|
|
43
|
+
"@storybook/react-vite": "10.6.5",
|
|
41
44
|
"@types/jest": "30.0.0",
|
|
42
|
-
"@types/node": "26.6.
|
|
45
|
+
"@types/node": "26.6.6",
|
|
43
46
|
"@types/react": "19.3.0",
|
|
44
47
|
"@types/react-dom": "19.3.0",
|
|
45
48
|
"jest": "30.5.2",
|