@gridui/data-explorer 1.2.2 → 1.3.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gridui/data-explorer
2
2
 
3
- Dashboard family. Public API: `DataExplorer`, `DataExplorerToolbar`, `DataExplorerBulkActions`, `DataExplorerTable`, `DataExplorerPagination`, `DataExplorerColumn`, `DataExplorerFilter`, `DataExplorerProps`, `DataExplorerRow`, `DataExplorerState`, `DataExplorerValue`.
3
+ Data family. Public API: `DataExplorer`, `DataExplorerToolbar`, `DataExplorerBulkActions`, `DataExplorerTable`, `DataExplorerPagination`, `DataExplorerColumn`, `DataExplorerFilter`, `DataExplorerProps`, `DataExplorerRow`, `DataExplorerState`, `DataExplorerValue`.
4
4
 
5
5
  Import components from `@gridui/data-explorer` and load `@gridui/data-explorer/styles.css` after Theme.
6
6
  Load the complete family stylesheet set in dependency order:
@@ -20,12 +20,13 @@ Load the complete family stylesheet set in dependency order:
20
20
 
21
21
  Applications own routes, labels, state persistence, and branding.
22
22
 
23
- 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).
23
+ 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-data/data-explorer/.changeset/history).
24
24
 
25
- ## Task compositions and lower-package APIs
25
+ ## Data exploration and supporting APIs
26
26
 
27
- DataExplorer, Composer, and ApprovalPanel belong to Dashboard because they
28
- coordinate multiple lower-package contracts. See
27
+ DataExplorer belongs to Data because it coordinates generic dataset exploration
28
+ through Core controls, Layout regions, and DataTable. Composer and ApprovalPanel
29
+ remain Dashboard task compositions. See
29
30
  [task workspace compositions](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/task-workspace.md) for controlled state,
30
31
  callbacks, and application responsibilities.
31
32
 
@@ -85,3 +86,7 @@ All optional feature labels are caller-owned. Remote paging, authorization,
85
86
  query serialization and persistence remain application responsibilities.
86
87
 
87
88
  [Component reference](docs/reference/README.md) contains focused API pages for each public component.
89
+
90
+ DataExplorerTable accepts DataTable's independent rowLines, columnLines, density,
91
+ headerSurface, rowHeaderSurface and striped presentation options. Controlled
92
+ selectedIds also drive row highlighting; sorting and pagination keep record IDs.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Data Explorer
4
+ * @namespace DataExplorerTable
5
+ * @description Column Layout
6
+ */
7
+ import { type DataExplorerColumn } from "../shared/model";
8
+ type ColumnLayoutOptions = {
9
+ readonly columns: readonly DataExplorerColumn[];
10
+ readonly columnWidths: Readonly<Record<string, number>> | undefined;
11
+ readonly hasSelection: boolean;
12
+ readonly hasDetails: boolean;
13
+ };
14
+ type SizedColumn = {
15
+ readonly column: DataExplorerColumn;
16
+ readonly width: number;
17
+ };
18
+ type ColumnLayout = {
19
+ readonly columns: readonly (SizedColumn & {
20
+ readonly stickyOffset: number;
21
+ })[];
22
+ readonly fixedWidths: boolean;
23
+ readonly selectionWidth: number;
24
+ readonly detailsWidth: number;
25
+ readonly tableWidth: number;
26
+ };
27
+ export declare const calculateColumnLayout: (options: ColumnLayoutOptions) => ColumnLayout;
28
+ export {};
@@ -5,6 +5,7 @@
5
5
  * @description Data Explorer Table
6
6
  */
7
7
  import type { ExplorerPartOptions } from "../shared/explorer-options";
8
+ import { type DataTablePresentation } from "@gridui/table";
8
9
  import { type FC } from "react";
9
- export type DataExplorerTableProps = ExplorerPartOptions;
10
+ export type DataExplorerTableProps = ExplorerPartOptions & DataTablePresentation;
10
11
  export declare const DataExplorerTable: FC<DataExplorerTableProps>;
package/dist/index.js CHANGED
@@ -123,14 +123,15 @@ var useExplorerController = (options) => {
123
123
  const existingRowIds = new Set(rows.map((row) => {
124
124
  return row.id;
125
125
  }));
126
- const selectedRowIds = [...new Set(selectedIds)].filter((id) => {
126
+ const selectedRowIdSet = new Set(selectedIds.filter((id) => {
127
127
  return existingRowIds.has(id);
128
- });
128
+ }));
129
+ const selectedRowIds = [...selectedRowIdSet];
129
130
  const pageIds = view.rows.map((row) => {
130
131
  return row.id;
131
132
  });
132
133
  const selectedPageCount = pageIds.filter((id) => {
133
- return selectedRowIds.includes(id);
134
+ return selectedRowIdSet.has(id);
134
135
  }).length;
135
136
  const updateState = (changes) => {
136
137
  if (!busy) {
@@ -152,6 +153,7 @@ var useExplorerController = (options) => {
152
153
  tableId,
153
154
  view,
154
155
  selectedRowIds,
156
+ selectedRowIdSet,
155
157
  pageIds,
156
158
  selectedPageCount,
157
159
  updateState,
@@ -270,6 +272,53 @@ var DataExplorerPagination = (props) => {
270
272
  );
271
273
  };
272
274
 
275
+ // src/data-explorer-table/column-layout.ts
276
+ var calculateStickyOffset = (columns, index) => {
277
+ const side = columns[index].column.sticky;
278
+ if (side === void 0) {
279
+ return 0;
280
+ }
281
+ return columns.reduce((offset, current, currentIndex) => {
282
+ if (current.column.sticky !== side) {
283
+ return offset;
284
+ }
285
+ const contributes = side === "start" ? currentIndex < index : currentIndex > index;
286
+ if (contributes) {
287
+ return offset + current.width;
288
+ }
289
+ return offset;
290
+ }, 0);
291
+ };
292
+ var calculateColumnLayout = (options) => {
293
+ const { columns, columnWidths, hasSelection, hasDetails } = options;
294
+ const fixedWidths = columnWidths !== void 0 || columns.some((column) => {
295
+ return column.width !== void 0 || column.sticky !== void 0;
296
+ });
297
+ const sizedColumns = columns.map((column) => {
298
+ return {
299
+ column,
300
+ width: resolveExplorerWidth(column, columnWidths?.[column.key] ?? column.width)
301
+ };
302
+ });
303
+ const selectionWidth = hasSelection ? 56 : 0;
304
+ const detailsWidth = hasDetails ? 96 : 0;
305
+ const dataWidth = sizedColumns.reduce((total, column) => {
306
+ return total + column.width;
307
+ }, 0);
308
+ return {
309
+ columns: sizedColumns.map((column, index) => {
310
+ return {
311
+ ...column,
312
+ stickyOffset: calculateStickyOffset(sizedColumns, index)
313
+ };
314
+ }),
315
+ fixedWidths,
316
+ selectionWidth,
317
+ detailsWidth,
318
+ tableWidth: dataWidth + selectionWidth + detailsWidth
319
+ };
320
+ };
321
+
273
322
  // src/data-explorer-table/column-resize-handle.tsx
274
323
  import { isComposingKeyEvent, listenForDragCancellation } from "@gridui/interaction";
275
324
  import { useEffect, useLayoutEffect, useRef } from "react";
@@ -404,21 +453,31 @@ import { DataTable } from "@gridui/table";
404
453
  import { Children } from "react";
405
454
  import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
406
455
  var DataExplorerTable = (props) => {
407
- const { busy, columnSizing, details, labels, notice, onSelectionChange, renderCell, selectedRowIds, tableId, view, visibleColumns } = useExplorer();
456
+ const { className, ...presentation } = props;
457
+ const {
458
+ busy,
459
+ columnSizing,
460
+ details,
461
+ labels,
462
+ notice,
463
+ onSelectionChange,
464
+ renderCell,
465
+ selectedRowIds,
466
+ selectedRowIdSet,
467
+ tableId,
468
+ view,
469
+ visibleColumns
470
+ } = useExplorer();
408
471
  const hasNotice = Children.toArray(notice).some((child) => {
409
472
  return child !== "";
410
473
  });
411
- const fixedWidths = columnSizing !== void 0 || visibleColumns.some((column) => {
412
- return column.width !== void 0 || column.sticky !== void 0;
413
- });
414
- const widths = visibleColumns.map((column) => {
415
- return resolveExplorerWidth(column, columnSizing?.widths[column.key] ?? column.width);
474
+ const { columns, fixedWidths, selectionWidth, detailsWidth, tableWidth } = calculateColumnLayout({
475
+ columns: visibleColumns,
476
+ columnWidths: columnSizing?.widths,
477
+ hasSelection: onSelectionChange !== void 0,
478
+ hasDetails: details !== void 0
416
479
  });
417
- const tableColumns = visibleColumns.map((column, index) => {
418
- const width = widths[index];
419
- const stickyOffset = visibleColumns.reduce((offset, current, currentIndex) => {
420
- return current.sticky === column.sticky && (column.sticky === "start" ? currentIndex < index : currentIndex > index) ? offset + widths[currentIndex] : offset;
421
- }, 0);
480
+ const tableColumns = columns.map(({ column, width, stickyOffset }) => {
422
481
  return {
423
482
  key: `column:${column.key}`,
424
483
  label: column.label,
@@ -466,19 +525,16 @@ var DataExplorerTable = (props) => {
466
525
  tableColumns.unshift({
467
526
  key: "control:selection",
468
527
  label: labels.selection,
469
- ...fixedWidths ? { sizing: { width: 56 } } : {}
528
+ ...fixedWidths ? { sizing: { width: selectionWidth } } : {}
470
529
  });
471
530
  }
472
531
  if (details) {
473
532
  tableColumns.unshift({
474
533
  key: "control:details",
475
534
  label: details.columnLabel,
476
- ...fixedWidths ? { sizing: { width: 96 } } : {}
535
+ ...fixedWidths ? { sizing: { width: detailsWidth } } : {}
477
536
  });
478
537
  }
479
- const tableWidth = widths.reduce((total, width) => {
480
- return total + width;
481
- }, 0) + (onSelectionChange ? 56 : 0) + (details ? 96 : 0);
482
538
  const detailId = (row) => {
483
539
  return `${tableId}-details-${encodeURIComponent(row.id)}`;
484
540
  };
@@ -495,7 +551,7 @@ var DataExplorerTable = (props) => {
495
551
  Checkbox2,
496
552
  {
497
553
  "aria-label": labels.selectRow(row),
498
- checked: selectedRowIds.includes(row.id),
554
+ checked: selectedRowIdSet.has(row.id),
499
555
  disabled: busy,
500
556
  onCheckedChange: (checked) => {
501
557
  const nextSelection = selectExplorerPage(selectedRowIds, [row.id], checked);
@@ -535,6 +591,7 @@ var DataExplorerTable = (props) => {
535
591
  } : void 0;
536
592
  return {
537
593
  key: row.id,
594
+ selected: selectedRowIdSet.has(row.id),
538
595
  cells,
539
596
  ...detail ? { detail } : {}
540
597
  };
@@ -546,11 +603,12 @@ var DataExplorerTable = (props) => {
546
603
  {
547
604
  direction: "column",
548
605
  "aria-busy": busy,
549
- className: cn3(props.className),
606
+ className: cn3(className),
550
607
  children: [
551
608
  /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
552
609
  DataTable,
553
610
  {
611
+ ...presentation,
554
612
  label: labels.table,
555
613
  variant: "structured",
556
614
  blockEdges: "none",
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/shared/control-row-style.ts", "../src/shared/model.ts", "../src/shared/explorer-context.ts", "../src/data-explorer-bulk-actions/data-explorer-bulk-actions.tsx", "../src/data-explorer-pagination/data-explorer-pagination.tsx", "../src/data-explorer-table/column-resize-handle.tsx", "../src/data-explorer-table/data-explorer-table.tsx", "../src/data-explorer-toolbar/style.ts", "../src/data-explorer-toolbar/filter-editor.tsx", "../src/data-explorer-toolbar/data-explorer-toolbar.tsx", "../src/data-explorer/style.ts", "../src/data-explorer/data-explorer.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\n * @description Control Row Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerControlRowStyles = cva(\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-w-0 gridui-u-data-explorer--flex-wrap gridui-u-data-explorer--items-end gridui-u-data-explorer--gap-gridui-16 gridui-u-data-explorer--p-gridui-16 gridui-u-data-explorer--[&_label]:min-h-11\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\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 readonly width?: number;\n readonly minWidth?: number;\n readonly maxWidth?: number;\n readonly sticky?: \"start\" | \"end\";\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 readonly filters?: readonly DataExplorerCondition[];\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 && (state.filters ?? []).every(condition => {\n return matchesExplorerCondition(row, condition);\n });\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\nexport type DataExplorerFilterOperator = \"contains\" | \"equals\" | \"not-equals\" | \"greater-than\" | \"less-than\" | \"empty\";\n\nexport type DataExplorerCondition = {\n readonly id: string;\n readonly key: string;\n readonly operator: DataExplorerFilterOperator;\n readonly value?: string | number;\n};\n\nexport type DataExplorerFilterDefinition = {\n readonly key: string;\n readonly label: string;\n readonly type: \"text\" | \"number\" | \"enum\";\n readonly options?: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n};\n\nexport const matchesExplorerCondition = (row: DataExplorerRow, condition: DataExplorerCondition): boolean => {\n const value = row.values[condition.key];\n if (condition.operator === \"empty\") {\n return value === null || value === undefined || value === \"\";\n }\n if (condition.value === undefined || condition.value === \"\") {\n return true;\n }\n if (condition.operator === \"contains\") {\n return String(value ?? \"\").normalize(\"NFKC\")\n .toLowerCase()\n .includes(String(condition.value).normalize(\"NFKC\")\n .toLowerCase());\n }\n if (condition.operator === \"equals\") {\n return value === condition.value;\n }\n if (condition.operator === \"not-equals\") {\n return value !== condition.value;\n }\n if (typeof condition.value !== \"number\" || !Number.isFinite(condition.value)) {\n throw new RangeError(\"Numeric filter comparisons require a finite numeric value.\");\n }\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n return false;\n }\n return condition.operator === \"greater-than\" ? value > condition.value : value < condition.value;\n};\n\nexport const resolveExplorerWidth = (column: DataExplorerColumn, width = column.width ?? 200): number => {\n const min = column.minWidth ?? 80;\n const max = column.maxWidth ?? 1200;\n if (![\n width,\n min,\n max,\n ].every(value => {\n return Number.isFinite(value) && value > 0;\n }) || max < min) {\n throw new RangeError(\"Explorer column widths must be positive and finite with ordered bounds.\");\n }\n return Math.max(min, Math.min(max, width));\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\n * @description Explorer Context\n */\n\nimport type { ExplorerOptions } from \"./explorer-options\";\nimport { type DataExplorerState, selectExplorerRows } from \"./model\";\nimport { createContext, useContext, useId } from \"react\";\n\nexport const useExplorerController = (options: ExplorerOptions) => {\n const { rows, columns, state, onStateChange, filter, pageSize = 10, selectedIds = [], busy = false, columnSettings } = options;\n const tableId = useId();\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 visibleColumns = columns.filter(column => {\n return !columnSettings?.hiddenKeys.includes(column.key);\n });\n if (columns.length > 0 && visibleColumns.length === 0) {\n throw new RangeError(\"DataExplorer needs at least one visible column.\");\n }\n\n return {\n ...options,\n busy,\n tableId,\n view,\n selectedRowIds,\n pageIds,\n selectedPageCount,\n updateState,\n visibleColumns,\n };\n};\n\nexport const explorerContext = createContext<ReturnType<typeof useExplorerController> | null>(null);\n\nexport const useExplorer = () => {\n const explorer = useContext(explorerContext);\n if (!explorer) {\n throw new Error(\"DataExplorer parts require a DataExplorer.\");\n }\n return explorer;\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerBulkActions\n * @description Data Explorer Bulk Actions\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { selectExplorerPage } from \"../shared/model\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DataExplorerBulkActionsProps = ExplorerPartOptions;\n\nexport const DataExplorerBulkActions: FC<DataExplorerBulkActionsProps> = (props: DataExplorerBulkActionsProps) => {\n const { actions = [], busy, labels, onSelectionChange, pageIds, selectedPageCount, selectedRowIds } = useExplorer();\n if (!onSelectionChange) {\n return null;\n }\n return (<div\n className={cn(explorerControlRowStyles(), props.className)}\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};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerPagination\n * @description Data Explorer Pagination\n */\n\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\nimport type { FC } from \"react\";\n\nexport type DataExplorerPaginationProps = ExplorerPartOptions;\n\nconst explorerFooterStyles = cva(\"gridui-u-data-explorer--flex gridui-u-data-explorer--flex-wrap gridui-u-data-explorer--items-center gridui-u-data-explorer--justify-between gridui-u-data-explorer--gap-gridui-8 gridui-u-data-explorer--p-gridui-16\");\n\nexport const DataExplorerPagination: FC<DataExplorerPaginationProps> = (props: DataExplorerPaginationProps) => {\n const { busy, labels, updateState, view } = useExplorer();\n return (<div\n className={cn(explorerFooterStyles(), props.className)}\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};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerTable\n * @description Column Resize Handle\n */\n\nimport { type DataExplorerColumn, resolveExplorerWidth } from \"../shared/model\";\nimport { isComposingKeyEvent, listenForDragCancellation } from \"@gridui/interaction\";\nimport { type FC, useEffect, useLayoutEffect, useRef } from \"react\";\n\nexport type ColumnResizeHandleProps = {\n readonly column: DataExplorerColumn;\n readonly width: number;\n readonly label: string;\n readonly disabled: boolean;\n readonly onChange: (width: number) => void;\n};\n\nexport const ColumnResizeHandle: FC<ColumnResizeHandleProps> = (props: ColumnResizeHandleProps) => {\n const { column, width, label, disabled, onChange } = props;\n const handle = useRef<HTMLDivElement>(null);\n const drag = useRef<{\n readonly pointer: number;\n readonly x: number;\n readonly width: number;\n readonly direction: number;\n readonly cleanup: () => void;\n } | null>(null);\n const min = column.minWidth ?? 80;\n const max = column.maxWidth ?? 1200;\n const change = (next: number) => {\n onChange(resolveExplorerWidth(column, Math.max(min, Math.min(max, next))));\n };\n const cancelDrag = () => {\n const current = drag.current;\n drag.current = null;\n if (current) {\n current.cleanup();\n change(current.width);\n if (handle.current?.hasPointerCapture(current.pointer)) {\n handle.current.releasePointerCapture(current.pointer);\n }\n }\n };\n const cancelLatest = useRef(cancelDrag);\n useLayoutEffect(() => {\n cancelLatest.current = cancelDrag;\n });\n useEffect(() => {\n if (disabled) {\n cancelLatest.current();\n }\n }, [disabled]);\n useEffect(() => {\n const element = handle.current;\n return () => {\n const current = drag.current;\n drag.current = null;\n current?.cleanup();\n if (current && element?.hasPointerCapture(current.pointer)) {\n element.releasePointerCapture(current.pointer);\n }\n };\n }, []);\n return (<div\n ref={handle}\n role=\"separator\"\n tabIndex={disabled ? -1 : 0}\n aria-orientation=\"vertical\"\n aria-label={label}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={width}\n aria-disabled={disabled || undefined}\n className=\"gridui-explorer-resize gridui-u-data-explorer--min-h-11 gridui-u-data-explorer--w-gridui-16 gridui-u-data-explorer--shrink-0 gridui-u-data-explorer--cursor-col-resize gridui-u-data-explorer--touch-none gridui-u-data-explorer--border-s gridui-u-data-explorer--border-solid gridui-u-data-explorer--border-border\"\n onPointerDown={(event) => {\n if (disabled || event.button !== 0 || !event.isPrimary || drag.current) {\n return;\n }\n event.preventDefault();\n event.currentTarget.focus();\n drag.current = {\n pointer: event.pointerId,\n x: event.clientX,\n width,\n direction: getComputedStyle(event.currentTarget).direction === \"rtl\" ? -1 : 1,\n cleanup: listenForDragCancellation(event.currentTarget, () => {\n cancelLatest.current();\n }),\n };\n event.currentTarget.setPointerCapture(event.pointerId);\n }}\n onPointerMove={(event) => {\n const current = drag.current;\n if (!disabled && current?.pointer === event.pointerId) {\n change(current.width + (event.clientX - current.x) * current.direction);\n }\n }}\n onPointerUp={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n const current = drag.current;\n drag.current = null;\n current.cleanup();\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }\n }}\n onPointerCancel={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n cancelDrag();\n }\n }}\n onLostPointerCapture={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n cancelDrag();\n }\n }}\n onKeyDown={(event) => {\n if (disabled || isComposingKeyEvent(event.nativeEvent) || ![\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n ].includes(event.key)) {\n return;\n }\n event.preventDefault();\n const direction = getComputedStyle(event.currentTarget).direction === \"rtl\" ? -1 : 1;\n const step = (event.shiftKey ? 50 : 10) * direction;\n let next = width + (event.key === \"ArrowRight\" ? step : -step);\n if (event.key === \"Home\") {\n next = min;\n }\n if (event.key === \"End\") {\n next = max;\n }\n change(next);\n }}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerTable\n * @description Data Explorer Table\n */\n\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { type DataExplorerRow, resolveExplorerWidth, selectExplorerPage } from \"../shared/model\";\nimport { ColumnResizeHandle } from \"./column-resize-handle\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { Split } from \"@gridui/grid\";\nimport { cn } from \"@gridui/style-utils\";\nimport { DataTable, type DataTableColumn } from \"@gridui/table\";\nimport { Children, type FC } from \"react\";\n\nexport type DataExplorerTableProps = ExplorerPartOptions;\n\nexport const DataExplorerTable: FC<DataExplorerTableProps> = (props: DataExplorerTableProps) => {\n const { busy, columnSizing, details, labels, notice, onSelectionChange, renderCell, selectedRowIds, tableId, view, visibleColumns } = useExplorer();\n const hasNotice = Children.toArray(notice).some(child => {\n return child !== \"\";\n });\n const fixedWidths = columnSizing !== undefined || visibleColumns.some(column => {\n return column.width !== undefined || column.sticky !== undefined;\n });\n const widths = visibleColumns.map(column => {\n return resolveExplorerWidth(column, columnSizing?.widths[column.key] ?? column.width);\n });\n const tableColumns: DataTableColumn[] = visibleColumns.map((column, index) => {\n const width = widths[index]!;\n const stickyOffset = visibleColumns.reduce((offset, current, currentIndex) => {\n return current.sticky === column.sticky && (column.sticky === \"start\" ? currentIndex < index : currentIndex > index) ? offset + widths[currentIndex]! : offset;\n }, 0);\n return {\n key: `column:${column.key}`,\n label: column.label,\n ...(column.numeric !== undefined ? { numeric: column.numeric } : {}),\n ...(fixedWidths ? {\n sizing: {\n width,\n minWidth: width,\n maxWidth: width,\n },\n } : {}),\n ...(column.sticky ? {\n sticky: column.sticky,\n stickyOffset,\n } : {}),\n ...(columnSizing ? {\n header: (<div\n className=\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-w-0 gridui-u-data-explorer--items-center gridui-u-data-explorer--justify-between gridui-u-data-explorer--gap-gridui-8\"\n >\n <span>\n {column.label}\n </span>\n <ColumnResizeHandle\n column={column}\n width={width}\n label={columnSizing.resizeLabel(column)}\n disabled={busy}\n onChange={(nextWidth) => {\n columnSizing.onWidthsChange({\n ...columnSizing.widths,\n [column.key]: nextWidth,\n });\n }}\n />\n </div>),\n } : {}),\n };\n });\n if (onSelectionChange) {\n tableColumns.unshift({\n key: \"control:selection\",\n label: labels.selection,\n ...(fixedWidths ? { sizing: { width: 56 } } : {}),\n });\n }\n if (details) {\n tableColumns.unshift({\n key: \"control:details\",\n label: details.columnLabel,\n ...(fixedWidths ? { sizing: { width: 96 } } : {}),\n });\n }\n const tableWidth = widths.reduce((total, width) => {\n return total + width;\n }, 0) + (onSelectionChange ? 56 : 0) + (details ? 96 : 0);\n const detailId = (row: DataExplorerRow) => {\n return `${tableId}-details-${encodeURIComponent(row.id)}`;\n };\n const tableRows = view.rows.map(row => {\n const cells = visibleColumns.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 if (details) {\n const expanded = details.expandedIds.includes(row.id);\n cells.unshift((<Button\n key=\"details\"\n variant=\"quiet\"\n disabled={busy}\n aria-expanded={expanded}\n aria-controls={expanded ? detailId(row) : undefined}\n onClick={() => {\n details.onExpandedIdsChange(expanded ? details.expandedIds.filter(key => {\n return key !== row.id;\n }) : [\n ...new Set([\n ...details.expandedIds,\n row.id,\n ]),\n ]);\n }}\n >\n {expanded ? details.collapseLabel(row) : details.expandLabel(row)}\n </Button>));\n }\n const detail = details?.expandedIds.includes(row.id) ? {\n id: detailId(row),\n content: details.render(row),\n } : undefined;\n return {\n key: row.id,\n cells,\n ...(detail ? { detail } : {}),\n };\n });\n return (<>\n {hasNotice && (<div>\n {notice}\n </div>)}\n <Split\n direction=\"column\"\n aria-busy={busy}\n className={cn(props.className)}\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 {...(fixedWidths ? {\n style: {\n width: tableWidth,\n tableLayout: \"fixed\" as const,\n },\n minWidth: tableWidth,\n } : {})}\n />\n </div>\n {view.rows.length === 0 && !busy && (<div>\n <p\n className=\"gridui-u-data-explorer--m-0 gridui-u-data-explorer--p-gridui-16\"\n >\n {labels.empty}\n </p>\n </div>)}\n </Split>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerLabelStyles = cva(\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-w-0 gridui-u-data-explorer--flex-[1_1_10rem] gridui-u-data-explorer--flex-col gridui-u-data-explorer--gap-gridui-4 gridui-u-data-explorer--text-muted gridui-u-data-explorer--type-caption\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Filter Editor\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport type { DataExplorerFiltering } from \"../shared/features\";\nimport type { DataExplorerCondition, DataExplorerFilterOperator } from \"../shared/model\";\nimport { explorerLabelStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Input } from \"@gridui/input\";\nimport { Select } from \"@gridui/select\";\nimport { type FC, useId, useRef } from \"react\";\n\nexport type FilterEditorProps = {\n readonly filtering: DataExplorerFiltering;\n readonly conditions: readonly DataExplorerCondition[];\n readonly disabled: boolean;\n readonly onChange: (conditions: readonly DataExplorerCondition[]) => void;\n};\n\nexport const FilterEditor: FC<FilterEditorProps> = (props: FilterEditorProps) => {\n const { filtering, conditions, disabled, onChange } = props;\n const id = useId();\n const sequence = useRef(0);\n const addButton = useRef<HTMLButtonElement>(null);\n const { definitions, labels } = filtering;\n const first = definitions[0];\n const change = (index: number, condition: DataExplorerCondition) => {\n onChange(conditions.map((current, currentIndex) => {\n return currentIndex === index ? condition : current;\n }));\n };\n return (<div>\n {conditions.map((condition, index) => {\n const definition = definitions.find(entry => {\n return entry.key === condition.key;\n });\n let operators: readonly DataExplorerFilterOperator[] = [\n \"contains\",\n \"equals\",\n \"not-equals\",\n \"empty\",\n ];\n if (definition?.type === \"number\") {\n operators = [\n \"equals\",\n \"not-equals\",\n \"greater-than\",\n \"less-than\",\n \"empty\",\n ];\n }\n if (definition?.type === \"enum\") {\n operators = [\n \"equals\",\n \"not-equals\",\n \"empty\",\n ];\n }\n return (<div\n key={condition.id}\n className={explorerControlRowStyles()}\n >\n <label\n className={explorerLabelStyles()}\n >\n {labels.field}\n <Select\n aria-label={labels.field}\n disabled={disabled}\n value={condition.key}\n options={definitions.map(field => {\n return {\n value: field.key,\n label: field.label,\n };\n })}\n onValueChange={(key) => {\n const field = definitions.find(entry => {\n return entry.key === key;\n });\n change(index, {\n id: condition.id,\n key,\n operator: field?.type === \"text\" ? \"contains\" : \"equals\",\n value: \"\",\n });\n }}\n />\n </label>\n <label\n className={explorerLabelStyles()}\n >\n {labels.operator}\n <Select\n aria-label={labels.operator}\n disabled={disabled}\n value={condition.operator}\n options={operators.map(operator => {\n return {\n value: operator,\n label: labels.operators[operator],\n };\n })}\n onValueChange={(operator) => {\n const next = operators.find(value => {\n return value === operator;\n });\n if (next) {\n change(index, {\n ...condition,\n operator: next,\n });\n }\n }}\n />\n </label>\n {condition.operator !== \"empty\" && (<label\n className={explorerLabelStyles()}\n >\n {labels.value}\n {definition?.type === \"enum\" ? (<Select\n aria-label={labels.value}\n disabled={disabled}\n value={String(condition.value ?? \"\")}\n placeholder={labels.value}\n options={definition.options ?? []}\n onValueChange={(value) => {\n change(index, {\n ...condition,\n value,\n });\n }}\n />) : (<Input\n aria-label={labels.value}\n disabled={disabled}\n type={definition?.type === \"number\" ? \"number\" : \"text\"}\n value={condition.value ?? \"\"}\n onValueChange={(text) => {\n const value = definition?.type === \"number\" && text !== \"\" ? Number(text) : text;\n change(index, {\n ...condition,\n value,\n });\n }}\n />)}\n </label>)}\n <Button\n variant=\"quiet\"\n disabled={disabled}\n onClick={() => {\n onChange(conditions.filter(entry => {\n return entry.id !== condition.id;\n }));\n addButton.current?.focus();\n }}\n >\n {labels.remove(index)}\n </Button>\n </div>);\n })}\n <div\n className={explorerControlRowStyles()}\n >\n <Button\n ref={addButton}\n variant=\"secondary\"\n disabled={disabled || !first}\n onClick={() => {\n if (!first) {\n return;\n }\n sequence.current += 1;\n onChange([\n ...conditions,\n {\n id: `${id}-${sequence.current}`,\n key: first.key,\n operator: first.type === \"text\" ? \"contains\" : \"equals\",\n value: \"\",\n },\n ]);\n }}\n >\n {labels.add}\n </Button>\n </div>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Data Explorer Toolbar\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { FilterEditor } from \"./filter-editor\";\nimport { explorerLabelStyles } 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 type { FC } from \"react\";\n\nexport type DataExplorerToolbarProps = ExplorerPartOptions;\n\nexport const DataExplorerToolbar: FC<DataExplorerToolbarProps> = (props: DataExplorerToolbarProps) => {\n const { busy, columnSettings, columns, filter, filtering, labels, state, updateState, visibleColumns } = useExplorer();\n return (<>\n <div\n className={cn(explorerControlRowStyles(), props.className)}\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 {columnSettings && (<details\n className=\"gridui-u-data-explorer--p-gridui-16\"\n >\n <summary\n className=\"gridui-u-data-explorer--cursor-pointer gridui-u-data-explorer--type-caption\"\n >\n {columnSettings.label}\n </summary>\n <div\n className=\"gridui-u-data-explorer--flex gridui-u-data-explorer--flex-wrap gridui-u-data-explorer--gap-gridui-16 gridui-u-data-explorer--pt-gridui-16\"\n >\n {columns.map(column => {\n const visible = !columnSettings.hiddenKeys.includes(column.key);\n return (<label\n key={column.key}\n className=\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-h-11 gridui-u-data-explorer--items-center gridui-u-data-explorer--gap-gridui-8\"\n >\n <Checkbox\n checked={visible}\n disabled={busy || (visible && visibleColumns.length === 1)}\n onCheckedChange={(checked) => {\n columnSettings.onHiddenKeysChange(checked ? columnSettings.hiddenKeys.filter(key => {\n return key !== column.key;\n }) : [\n ...new Set([\n ...columnSettings.hiddenKeys,\n column.key,\n ]),\n ]);\n }}\n />\n {column.label}\n </label>);\n })}\n </div>\n </details>)}\n {filtering && (<FilterEditor\n filtering={filtering}\n conditions={state.filters ?? []}\n disabled={busy}\n onChange={(filters) => {\n updateState({\n filters,\n page: 0,\n });\n }}\n />)}\n </>);\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-data-explorer--min-w-0 gridui-u-data-explorer--border gridui-u-data-explorer--border-border gridui-u-data-explorer--bg-background gridui-u-data-explorer--text-foreground\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Data Explorer\n */\n\nimport { DataExplorerBulkActions } from \"../data-explorer-bulk-actions/data-explorer-bulk-actions\";\nimport { DataExplorerPagination } from \"../data-explorer-pagination/data-explorer-pagination\";\nimport { DataExplorerTable } from \"../data-explorer-table/data-explorer-table\";\nimport { DataExplorerToolbar } from \"../data-explorer-toolbar/data-explorer-toolbar\";\nimport { explorerContext, useExplorerController } from \"../shared/explorer-context\";\nimport type { ExplorerOptions } from \"../shared/explorer-options\";\nimport { explorerStyles } from \"./style\";\nimport { Split } from \"@gridui/grid\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DataExplorerProps = ComponentPropsWithRef<\"section\"> & ExplorerOptions;\n\nexport const DataExplorer: FC<DataExplorerProps> = (props: DataExplorerProps) => {\n const { rows, columns, state, onStateChange, filter, columnSettings, columnSizing, details, filtering,\n pageSize, selectedIds, onSelectionChange, actions, renderCell, busy, notice, labels, className, children, ...restProps } = props;\n const explorer = useExplorerController({\n rows,\n columns,\n state,\n onStateChange,\n filter,\n columnSettings,\n columnSizing,\n details,\n filtering,\n pageSize,\n selectedIds,\n onSelectionChange,\n actions,\n renderCell,\n busy,\n notice,\n labels,\n });\n return (<explorerContext.Provider\n value={explorer}\n >\n <section\n {...restProps}\n aria-label={labels.table}\n className={cn(explorerStyles(), className)}\n >\n <Split\n direction=\"column\"\n >\n {children ?? (<>\n <DataExplorerToolbar />\n <DataExplorerBulkActions />\n <DataExplorerTable />\n <DataExplorerPagination />\n </>)}\n </Split>\n </section>\n </explorerContext.Provider>);\n};\n"],
5
- "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,2BAA2B,IAAI,uPAAuP;;;ACmCnS,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,QAA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AAA;AAAA,UACJ;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
3
+ "sources": ["../src/shared/control-row-style.ts", "../src/shared/model.ts", "../src/shared/explorer-context.ts", "../src/data-explorer-bulk-actions/data-explorer-bulk-actions.tsx", "../src/data-explorer-pagination/data-explorer-pagination.tsx", "../src/data-explorer-table/column-layout.ts", "../src/data-explorer-table/column-resize-handle.tsx", "../src/data-explorer-table/data-explorer-table.tsx", "../src/data-explorer-toolbar/style.ts", "../src/data-explorer-toolbar/filter-editor.tsx", "../src/data-explorer-toolbar/data-explorer-toolbar.tsx", "../src/data-explorer/style.ts", "../src/data-explorer/data-explorer.tsx"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\n * @description Control Row Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerControlRowStyles = cva(\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-w-0 gridui-u-data-explorer--flex-wrap gridui-u-data-explorer--items-end gridui-u-data-explorer--gap-gridui-16 gridui-u-data-explorer--p-gridui-16 gridui-u-data-explorer--[&_label]:min-h-11\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\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 readonly width?: number;\n readonly minWidth?: number;\n readonly maxWidth?: number;\n readonly sticky?: \"start\" | \"end\";\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 readonly filters?: readonly DataExplorerCondition[];\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 && (state.filters ?? []).every(condition => {\n return matchesExplorerCondition(row, condition);\n });\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\nexport type DataExplorerFilterOperator = \"contains\" | \"equals\" | \"not-equals\" | \"greater-than\" | \"less-than\" | \"empty\";\n\nexport type DataExplorerCondition = {\n readonly id: string;\n readonly key: string;\n readonly operator: DataExplorerFilterOperator;\n readonly value?: string | number;\n};\n\nexport type DataExplorerFilterDefinition = {\n readonly key: string;\n readonly label: string;\n readonly type: \"text\" | \"number\" | \"enum\";\n readonly options?: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n};\n\nexport const matchesExplorerCondition = (row: DataExplorerRow, condition: DataExplorerCondition): boolean => {\n const value = row.values[condition.key];\n if (condition.operator === \"empty\") {\n return value === null || value === undefined || value === \"\";\n }\n if (condition.value === undefined || condition.value === \"\") {\n return true;\n }\n if (condition.operator === \"contains\") {\n return String(value ?? \"\").normalize(\"NFKC\")\n .toLowerCase()\n .includes(String(condition.value).normalize(\"NFKC\")\n .toLowerCase());\n }\n if (condition.operator === \"equals\") {\n return value === condition.value;\n }\n if (condition.operator === \"not-equals\") {\n return value !== condition.value;\n }\n if (typeof condition.value !== \"number\" || !Number.isFinite(condition.value)) {\n throw new RangeError(\"Numeric filter comparisons require a finite numeric value.\");\n }\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n return false;\n }\n return condition.operator === \"greater-than\" ? value > condition.value : value < condition.value;\n};\n\nexport const resolveExplorerWidth = (column: DataExplorerColumn, width = column.width ?? 200): number => {\n const min = column.minWidth ?? 80;\n const max = column.maxWidth ?? 1200;\n if (![\n width,\n min,\n max,\n ].every(value => {\n return Number.isFinite(value) && value > 0;\n }) || max < min) {\n throw new RangeError(\"Explorer column widths must be positive and finite with ordered bounds.\");\n }\n return Math.max(min, Math.min(max, width));\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\n * @description Explorer Context\n */\n\nimport type { ExplorerOptions } from \"./explorer-options\";\nimport { type DataExplorerState, selectExplorerRows } from \"./model\";\nimport { createContext, useContext, useId } from \"react\";\n\nexport const useExplorerController = (options: ExplorerOptions) => {\n const { rows, columns, state, onStateChange, filter, pageSize = 10, selectedIds = [], busy = false, columnSettings } = options;\n const tableId = useId();\n const view = selectExplorerRows(rows, columns, state, pageSize, filter);\n const existingRowIds = new Set(rows.map(row => {\n return row.id;\n }));\n const selectedRowIdSet = new Set(selectedIds.filter(id => {\n return existingRowIds.has(id);\n }));\n const selectedRowIds = [...selectedRowIdSet];\n const pageIds = view.rows.map(row => {\n return row.id;\n });\n const selectedPageCount = pageIds.filter(id => {\n return selectedRowIdSet.has(id);\n }).length;\n const updateState = (changes: Partial<DataExplorerState>) => {\n if (!busy) {\n onStateChange({\n ...state,\n ...changes,\n });\n }\n };\n const visibleColumns = columns.filter(column => {\n return !columnSettings?.hiddenKeys.includes(column.key);\n });\n if (columns.length > 0 && visibleColumns.length === 0) {\n throw new RangeError(\"DataExplorer needs at least one visible column.\");\n }\n\n return {\n ...options,\n busy,\n tableId,\n view,\n selectedRowIds,\n selectedRowIdSet,\n pageIds,\n selectedPageCount,\n updateState,\n visibleColumns,\n };\n};\n\nexport const explorerContext = createContext<ReturnType<typeof useExplorerController> | null>(null);\n\nexport const useExplorer = () => {\n const explorer = useContext(explorerContext);\n if (!explorer) {\n throw new Error(\"DataExplorer parts require a DataExplorer.\");\n }\n return explorer;\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerBulkActions\n * @description Data Explorer Bulk Actions\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { selectExplorerPage } from \"../shared/model\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DataExplorerBulkActionsProps = ExplorerPartOptions;\n\nexport const DataExplorerBulkActions: FC<DataExplorerBulkActionsProps> = (props: DataExplorerBulkActionsProps) => {\n const { actions = [], busy, labels, onSelectionChange, pageIds, selectedPageCount, selectedRowIds } = useExplorer();\n if (!onSelectionChange) {\n return null;\n }\n return (<div\n className={cn(explorerControlRowStyles(), props.className)}\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};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerPagination\n * @description Data Explorer Pagination\n */\n\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\nimport type { FC } from \"react\";\n\nexport type DataExplorerPaginationProps = ExplorerPartOptions;\n\nconst explorerFooterStyles = cva(\"gridui-u-data-explorer--flex gridui-u-data-explorer--flex-wrap gridui-u-data-explorer--items-center gridui-u-data-explorer--justify-between gridui-u-data-explorer--gap-gridui-8 gridui-u-data-explorer--p-gridui-16\");\n\nexport const DataExplorerPagination: FC<DataExplorerPaginationProps> = (props: DataExplorerPaginationProps) => {\n const { busy, labels, updateState, view } = useExplorer();\n return (<div\n className={cn(explorerFooterStyles(), props.className)}\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};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerTable\n * @description Column Layout\n */\n\nimport { type DataExplorerColumn, resolveExplorerWidth } from \"../shared/model\";\n\ntype ColumnLayoutOptions = {\n readonly columns: readonly DataExplorerColumn[];\n readonly columnWidths: Readonly<Record<string, number>> | undefined;\n readonly hasSelection: boolean;\n readonly hasDetails: boolean;\n};\n\ntype SizedColumn = {\n readonly column: DataExplorerColumn;\n readonly width: number;\n};\n\ntype ColumnLayout = {\n readonly columns: readonly (SizedColumn & {\n readonly stickyOffset: number;\n })[];\n readonly fixedWidths: boolean;\n readonly selectionWidth: number;\n readonly detailsWidth: number;\n readonly tableWidth: number;\n};\n\nconst calculateStickyOffset = (columns: readonly SizedColumn[], index: number): number => {\n const side = columns[index]!.column.sticky;\n if (side === undefined) {\n return 0;\n }\n return columns.reduce((offset, current, currentIndex) => {\n if (current.column.sticky !== side) {\n return offset;\n }\n const contributes = side === \"start\" ? currentIndex < index : currentIndex > index;\n if (contributes) {\n return offset + current.width;\n }\n return offset;\n }, 0);\n};\n\nexport const calculateColumnLayout = (options: ColumnLayoutOptions): ColumnLayout => {\n const { columns, columnWidths, hasSelection, hasDetails } = options;\n const fixedWidths = columnWidths !== undefined || columns.some(column => {\n return column.width !== undefined || column.sticky !== undefined;\n });\n const sizedColumns = columns.map(column => {\n return {\n column,\n width: resolveExplorerWidth(column, columnWidths?.[column.key] ?? column.width),\n };\n });\n const selectionWidth = hasSelection ? 56 : 0;\n const detailsWidth = hasDetails ? 96 : 0;\n const dataWidth = sizedColumns.reduce((total, column) => {\n return total + column.width;\n }, 0);\n return {\n columns: sizedColumns.map((column, index) => {\n return {\n ...column,\n stickyOffset: calculateStickyOffset(sizedColumns, index),\n };\n }),\n fixedWidths,\n selectionWidth,\n detailsWidth,\n tableWidth: dataWidth + selectionWidth + detailsWidth,\n };\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerTable\n * @description Column Resize Handle\n */\n\nimport { type DataExplorerColumn, resolveExplorerWidth } from \"../shared/model\";\nimport { isComposingKeyEvent, listenForDragCancellation } from \"@gridui/interaction\";\nimport { type FC, useEffect, useLayoutEffect, useRef } from \"react\";\n\nexport type ColumnResizeHandleProps = {\n readonly column: DataExplorerColumn;\n readonly width: number;\n readonly label: string;\n readonly disabled: boolean;\n readonly onChange: (width: number) => void;\n};\n\nexport const ColumnResizeHandle: FC<ColumnResizeHandleProps> = (props: ColumnResizeHandleProps) => {\n const { column, width, label, disabled, onChange } = props;\n const handle = useRef<HTMLDivElement>(null);\n const drag = useRef<{\n readonly pointer: number;\n readonly x: number;\n readonly width: number;\n readonly direction: number;\n readonly cleanup: () => void;\n } | null>(null);\n const min = column.minWidth ?? 80;\n const max = column.maxWidth ?? 1200;\n const change = (next: number) => {\n onChange(resolveExplorerWidth(column, Math.max(min, Math.min(max, next))));\n };\n const cancelDrag = () => {\n const current = drag.current;\n drag.current = null;\n if (current) {\n current.cleanup();\n change(current.width);\n if (handle.current?.hasPointerCapture(current.pointer)) {\n handle.current.releasePointerCapture(current.pointer);\n }\n }\n };\n const cancelLatest = useRef(cancelDrag);\n useLayoutEffect(() => {\n cancelLatest.current = cancelDrag;\n });\n useEffect(() => {\n if (disabled) {\n cancelLatest.current();\n }\n }, [disabled]);\n useEffect(() => {\n const element = handle.current;\n return () => {\n const current = drag.current;\n drag.current = null;\n current?.cleanup();\n if (current && element?.hasPointerCapture(current.pointer)) {\n element.releasePointerCapture(current.pointer);\n }\n };\n }, []);\n return (<div\n ref={handle}\n role=\"separator\"\n tabIndex={disabled ? -1 : 0}\n aria-orientation=\"vertical\"\n aria-label={label}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={width}\n aria-disabled={disabled || undefined}\n className=\"gridui-explorer-resize gridui-u-data-explorer--min-h-11 gridui-u-data-explorer--w-gridui-16 gridui-u-data-explorer--shrink-0 gridui-u-data-explorer--cursor-col-resize gridui-u-data-explorer--touch-none gridui-u-data-explorer--border-s gridui-u-data-explorer--border-solid gridui-u-data-explorer--border-border\"\n onPointerDown={(event) => {\n if (disabled || event.button !== 0 || !event.isPrimary || drag.current) {\n return;\n }\n event.preventDefault();\n event.currentTarget.focus();\n drag.current = {\n pointer: event.pointerId,\n x: event.clientX,\n width,\n direction: getComputedStyle(event.currentTarget).direction === \"rtl\" ? -1 : 1,\n cleanup: listenForDragCancellation(event.currentTarget, () => {\n cancelLatest.current();\n }),\n };\n event.currentTarget.setPointerCapture(event.pointerId);\n }}\n onPointerMove={(event) => {\n const current = drag.current;\n if (!disabled && current?.pointer === event.pointerId) {\n change(current.width + (event.clientX - current.x) * current.direction);\n }\n }}\n onPointerUp={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n const current = drag.current;\n drag.current = null;\n current.cleanup();\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }\n }}\n onPointerCancel={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n cancelDrag();\n }\n }}\n onLostPointerCapture={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n cancelDrag();\n }\n }}\n onKeyDown={(event) => {\n if (disabled || isComposingKeyEvent(event.nativeEvent) || ![\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n ].includes(event.key)) {\n return;\n }\n event.preventDefault();\n const direction = getComputedStyle(event.currentTarget).direction === \"rtl\" ? -1 : 1;\n const step = (event.shiftKey ? 50 : 10) * direction;\n let next = width + (event.key === \"ArrowRight\" ? step : -step);\n if (event.key === \"Home\") {\n next = min;\n }\n if (event.key === \"End\") {\n next = max;\n }\n change(next);\n }}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerTable\n * @description Data Explorer Table\n */\n\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { type DataExplorerRow, selectExplorerPage } from \"../shared/model\";\nimport { calculateColumnLayout } from \"./column-layout\";\nimport { ColumnResizeHandle } from \"./column-resize-handle\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { Split } from \"@gridui/grid\";\nimport { cn } from \"@gridui/style-utils\";\nimport { DataTable, type DataTableColumn, type DataTablePresentation } from \"@gridui/table\";\nimport { Children, type FC } from \"react\";\n\nexport type DataExplorerTableProps = ExplorerPartOptions & DataTablePresentation;\n\nexport const DataExplorerTable: FC<DataExplorerTableProps> = (props: DataExplorerTableProps) => {\n const { className, ...presentation } = props;\n const { busy, columnSizing, details, labels, notice, onSelectionChange, renderCell,\n selectedRowIds, selectedRowIdSet, tableId, view, visibleColumns } = useExplorer();\n const hasNotice = Children.toArray(notice).some(child => {\n return child !== \"\";\n });\n const { columns, fixedWidths, selectionWidth, detailsWidth, tableWidth } = calculateColumnLayout({\n columns: visibleColumns,\n columnWidths: columnSizing?.widths,\n hasSelection: onSelectionChange !== undefined,\n hasDetails: details !== undefined,\n });\n const tableColumns: DataTableColumn[] = columns.map(({ column, width, stickyOffset }) => {\n return {\n key: `column:${column.key}`,\n label: column.label,\n ...(column.numeric !== undefined ? { numeric: column.numeric } : {}),\n ...(fixedWidths ? {\n sizing: {\n width,\n minWidth: width,\n maxWidth: width,\n },\n } : {}),\n ...(column.sticky ? {\n sticky: column.sticky,\n stickyOffset,\n } : {}),\n ...(columnSizing ? {\n header: (<div\n className=\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-w-0 gridui-u-data-explorer--items-center gridui-u-data-explorer--justify-between gridui-u-data-explorer--gap-gridui-8\"\n >\n <span>\n {column.label}\n </span>\n <ColumnResizeHandle\n column={column}\n width={width}\n label={columnSizing.resizeLabel(column)}\n disabled={busy}\n onChange={(nextWidth) => {\n columnSizing.onWidthsChange({\n ...columnSizing.widths,\n [column.key]: nextWidth,\n });\n }}\n />\n </div>),\n } : {}),\n };\n });\n if (onSelectionChange) {\n tableColumns.unshift({\n key: \"control:selection\",\n label: labels.selection,\n ...(fixedWidths ? { sizing: { width: selectionWidth } } : {}),\n });\n }\n if (details) {\n tableColumns.unshift({\n key: \"control:details\",\n label: details.columnLabel,\n ...(fixedWidths ? { sizing: { width: detailsWidth } } : {}),\n });\n }\n const detailId = (row: DataExplorerRow) => {\n return `${tableId}-details-${encodeURIComponent(row.id)}`;\n };\n const tableRows = view.rows.map(row => {\n const cells = visibleColumns.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={selectedRowIdSet.has(row.id)}\n disabled={busy}\n onCheckedChange={checked => {\n const nextSelection = selectExplorerPage(selectedRowIds, [row.id], checked);\n onSelectionChange(nextSelection);\n }}\n />));\n }\n if (details) {\n const expanded = details.expandedIds.includes(row.id);\n cells.unshift((<Button\n key=\"details\"\n variant=\"quiet\"\n disabled={busy}\n aria-expanded={expanded}\n aria-controls={expanded ? detailId(row) : undefined}\n onClick={() => {\n details.onExpandedIdsChange(expanded ? details.expandedIds.filter(key => {\n return key !== row.id;\n }) : [\n ...new Set([\n ...details.expandedIds,\n row.id,\n ]),\n ]);\n }}\n >\n {expanded ? details.collapseLabel(row) : details.expandLabel(row)}\n </Button>));\n }\n const detail = details?.expandedIds.includes(row.id) ? {\n id: detailId(row),\n content: details.render(row),\n } : undefined;\n return {\n key: row.id,\n selected: selectedRowIdSet.has(row.id),\n cells,\n ...(detail ? { detail } : {}),\n };\n });\n return (<>\n {hasNotice && (<div>\n {notice}\n </div>)}\n <Split\n direction=\"column\"\n aria-busy={busy}\n className={cn(className)}\n >\n <div>\n <DataTable\n {...presentation}\n label={labels.table}\n variant=\"structured\"\n blockEdges=\"none\"\n inlineEdges=\"none\"\n columns={tableColumns}\n rows={tableRows}\n {...(fixedWidths ? {\n style: {\n width: tableWidth,\n tableLayout: \"fixed\" as const,\n },\n minWidth: tableWidth,\n } : {})}\n />\n </div>\n {view.rows.length === 0 && !busy && (<div>\n <p\n className=\"gridui-u-data-explorer--m-0 gridui-u-data-explorer--p-gridui-16\"\n >\n {labels.empty}\n </p>\n </div>)}\n </Split>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerLabelStyles = cva(\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-w-0 gridui-u-data-explorer--flex-[1_1_10rem] gridui-u-data-explorer--flex-col gridui-u-data-explorer--gap-gridui-4 gridui-u-data-explorer--text-muted gridui-u-data-explorer--type-caption\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Filter Editor\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport type { DataExplorerFiltering } from \"../shared/features\";\nimport type { DataExplorerCondition, DataExplorerFilterOperator } from \"../shared/model\";\nimport { explorerLabelStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Input } from \"@gridui/input\";\nimport { Select } from \"@gridui/select\";\nimport { type FC, useId, useRef } from \"react\";\n\nexport type FilterEditorProps = {\n readonly filtering: DataExplorerFiltering;\n readonly conditions: readonly DataExplorerCondition[];\n readonly disabled: boolean;\n readonly onChange: (conditions: readonly DataExplorerCondition[]) => void;\n};\n\nexport const FilterEditor: FC<FilterEditorProps> = (props: FilterEditorProps) => {\n const { filtering, conditions, disabled, onChange } = props;\n const id = useId();\n const sequence = useRef(0);\n const addButton = useRef<HTMLButtonElement>(null);\n const { definitions, labels } = filtering;\n const first = definitions[0];\n const change = (index: number, condition: DataExplorerCondition) => {\n onChange(conditions.map((current, currentIndex) => {\n return currentIndex === index ? condition : current;\n }));\n };\n return (<div>\n {conditions.map((condition, index) => {\n const definition = definitions.find(entry => {\n return entry.key === condition.key;\n });\n let operators: readonly DataExplorerFilterOperator[] = [\n \"contains\",\n \"equals\",\n \"not-equals\",\n \"empty\",\n ];\n if (definition?.type === \"number\") {\n operators = [\n \"equals\",\n \"not-equals\",\n \"greater-than\",\n \"less-than\",\n \"empty\",\n ];\n }\n if (definition?.type === \"enum\") {\n operators = [\n \"equals\",\n \"not-equals\",\n \"empty\",\n ];\n }\n return (<div\n key={condition.id}\n className={explorerControlRowStyles()}\n >\n <label\n className={explorerLabelStyles()}\n >\n {labels.field}\n <Select\n aria-label={labels.field}\n disabled={disabled}\n value={condition.key}\n options={definitions.map(field => {\n return {\n value: field.key,\n label: field.label,\n };\n })}\n onValueChange={(key) => {\n const field = definitions.find(entry => {\n return entry.key === key;\n });\n change(index, {\n id: condition.id,\n key,\n operator: field?.type === \"text\" ? \"contains\" : \"equals\",\n value: \"\",\n });\n }}\n />\n </label>\n <label\n className={explorerLabelStyles()}\n >\n {labels.operator}\n <Select\n aria-label={labels.operator}\n disabled={disabled}\n value={condition.operator}\n options={operators.map(operator => {\n return {\n value: operator,\n label: labels.operators[operator],\n };\n })}\n onValueChange={(operator) => {\n const next = operators.find(value => {\n return value === operator;\n });\n if (next) {\n change(index, {\n ...condition,\n operator: next,\n });\n }\n }}\n />\n </label>\n {condition.operator !== \"empty\" && (<label\n className={explorerLabelStyles()}\n >\n {labels.value}\n {definition?.type === \"enum\" ? (<Select\n aria-label={labels.value}\n disabled={disabled}\n value={String(condition.value ?? \"\")}\n placeholder={labels.value}\n options={definition.options ?? []}\n onValueChange={(value) => {\n change(index, {\n ...condition,\n value,\n });\n }}\n />) : (<Input\n aria-label={labels.value}\n disabled={disabled}\n type={definition?.type === \"number\" ? \"number\" : \"text\"}\n value={condition.value ?? \"\"}\n onValueChange={(text) => {\n const value = definition?.type === \"number\" && text !== \"\" ? Number(text) : text;\n change(index, {\n ...condition,\n value,\n });\n }}\n />)}\n </label>)}\n <Button\n variant=\"quiet\"\n disabled={disabled}\n onClick={() => {\n onChange(conditions.filter(entry => {\n return entry.id !== condition.id;\n }));\n addButton.current?.focus();\n }}\n >\n {labels.remove(index)}\n </Button>\n </div>);\n })}\n <div\n className={explorerControlRowStyles()}\n >\n <Button\n ref={addButton}\n variant=\"secondary\"\n disabled={disabled || !first}\n onClick={() => {\n if (!first) {\n return;\n }\n sequence.current += 1;\n onChange([\n ...conditions,\n {\n id: `${id}-${sequence.current}`,\n key: first.key,\n operator: first.type === \"text\" ? \"contains\" : \"equals\",\n value: \"\",\n },\n ]);\n }}\n >\n {labels.add}\n </Button>\n </div>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Data Explorer Toolbar\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { FilterEditor } from \"./filter-editor\";\nimport { explorerLabelStyles } 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 type { FC } from \"react\";\n\nexport type DataExplorerToolbarProps = ExplorerPartOptions;\n\nexport const DataExplorerToolbar: FC<DataExplorerToolbarProps> = (props: DataExplorerToolbarProps) => {\n const { busy, columnSettings, columns, filter, filtering, labels, state, updateState, visibleColumns } = useExplorer();\n return (<>\n <div\n className={cn(explorerControlRowStyles(), props.className)}\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 {columnSettings && (<details\n className=\"gridui-u-data-explorer--p-gridui-16\"\n >\n <summary\n className=\"gridui-u-data-explorer--cursor-pointer gridui-u-data-explorer--type-caption\"\n >\n {columnSettings.label}\n </summary>\n <div\n className=\"gridui-u-data-explorer--flex gridui-u-data-explorer--flex-wrap gridui-u-data-explorer--gap-gridui-16 gridui-u-data-explorer--pt-gridui-16\"\n >\n {columns.map(column => {\n const visible = !columnSettings.hiddenKeys.includes(column.key);\n return (<label\n key={column.key}\n className=\"gridui-u-data-explorer--flex gridui-u-data-explorer--min-h-11 gridui-u-data-explorer--items-center gridui-u-data-explorer--gap-gridui-8\"\n >\n <Checkbox\n checked={visible}\n disabled={busy || (visible && visibleColumns.length === 1)}\n onCheckedChange={(checked) => {\n columnSettings.onHiddenKeysChange(checked ? columnSettings.hiddenKeys.filter(key => {\n return key !== column.key;\n }) : [\n ...new Set([\n ...columnSettings.hiddenKeys,\n column.key,\n ]),\n ]);\n }}\n />\n {column.label}\n </label>);\n })}\n </div>\n </details>)}\n {filtering && (<FilterEditor\n filtering={filtering}\n conditions={state.filters ?? []}\n disabled={busy}\n onChange={(filters) => {\n updateState({\n filters,\n page: 0,\n });\n }}\n />)}\n </>);\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-data-explorer--min-w-0 gridui-u-data-explorer--border gridui-u-data-explorer--border-border gridui-u-data-explorer--bg-background gridui-u-data-explorer--text-foreground\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Data Explorer\n */\n\nimport { DataExplorerBulkActions } from \"../data-explorer-bulk-actions/data-explorer-bulk-actions\";\nimport { DataExplorerPagination } from \"../data-explorer-pagination/data-explorer-pagination\";\nimport { DataExplorerTable } from \"../data-explorer-table/data-explorer-table\";\nimport { DataExplorerToolbar } from \"../data-explorer-toolbar/data-explorer-toolbar\";\nimport { explorerContext, useExplorerController } from \"../shared/explorer-context\";\nimport type { ExplorerOptions } from \"../shared/explorer-options\";\nimport { explorerStyles } from \"./style\";\nimport { Split } from \"@gridui/grid\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DataExplorerProps = ComponentPropsWithRef<\"section\"> & ExplorerOptions;\n\nexport const DataExplorer: FC<DataExplorerProps> = (props: DataExplorerProps) => {\n const { rows, columns, state, onStateChange, filter, columnSettings, columnSizing, details, filtering,\n pageSize, selectedIds, onSelectionChange, actions, renderCell, busy, notice, labels, className, children, ...restProps } = props;\n const explorer = useExplorerController({\n rows,\n columns,\n state,\n onStateChange,\n filter,\n columnSettings,\n columnSizing,\n details,\n filtering,\n pageSize,\n selectedIds,\n onSelectionChange,\n actions,\n renderCell,\n busy,\n notice,\n labels,\n });\n return (<explorerContext.Provider\n value={explorer}\n >\n <section\n {...restProps}\n aria-label={labels.table}\n className={cn(explorerStyles(), className)}\n >\n <Split\n direction=\"column\"\n >\n {children ?? (<>\n <DataExplorerToolbar />\n <DataExplorerBulkActions />\n <DataExplorerTable />\n <DataExplorerPagination />\n </>)}\n </Split>\n </section>\n </explorerContext.Provider>);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,2BAA2B,IAAI,uPAAuP;;;ACmCnS,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,S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AAAA,IAAc;AAAA,IAAS;AAAA,IACxF;AAAA,IAAU;AAAA,IAAa;AAAA,IAAmB;AAAA,IAAS;AAAA,IAAY;AAAA,IAAM;AAAA,IAAQ;AAAA,IAAQ;AAAA,IAAW;AAAA,IAAU,GAAG;AAAA,EAAU,IAAI;AAC/H,QAAM,WAAW,sBAAsB;AAAA,IACnC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAC;AACD,SAAQ,gBAAAD;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACL,OAAO;AAAA,MAEP,0BAAAA;AAAA,QAAC;AAAA;AAAA,UACI,GAAG;AAAA,UACJ,cAAY,OAAO;AAAA,UACnB,WAAWF,IAAG,eAAe,GAAG,SAAS;AAAA,UAEzC,0BAAAE;AAAA,YAACH;AAAA,YAAA;AAAA,cACG,WAAU;AAAA,cAET,sBAAa,gBAAAI,MAAAF,WAAA,EACV;AAAA,gCAAAC,KAAC,uBAAoB;AAAA,gBACrB,gBAAAA,KAAC,2BAAwB;AAAA,gBACzB,gBAAAA,KAAC,qBAAkB;AAAA,gBACnB,gBAAAA,KAAC,0BAAuB;AAAA,iBAC5B;AAAA;AAAA,UACJ;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
6
6
  "names": ["Button", "cn", "cva", "jsx", "jsxs", "jsx", "Button", "Checkbox", "cn", "jsx", "jsxs", "cva", "Button", "useId", "useRef", "jsx", "jsxs", "Button", "Checkbox", "Input", "Select", "cn", "Fragment", "jsx", "jsxs", "cva", "Split", "cn", "Fragment", "jsx", "jsxs"]
7
7
  }
@@ -16,6 +16,7 @@ export declare const useExplorerController: (options: ExplorerOptions) => {
16
16
  pageCount: number;
17
17
  };
18
18
  selectedRowIds: string[];
19
+ selectedRowIdSet: Set<string>;
19
20
  pageIds: string[];
20
21
  selectedPageCount: number;
21
22
  updateState: (changes: Partial<DataExplorerState>) => void;
@@ -67,6 +68,7 @@ export declare const explorerContext: import("react").Context<{
67
68
  pageCount: number;
68
69
  };
69
70
  selectedRowIds: string[];
71
+ selectedRowIdSet: Set<string>;
70
72
  pageIds: string[];
71
73
  selectedPageCount: number;
72
74
  updateState: (changes: Partial<DataExplorerState>) => void;
@@ -118,6 +120,7 @@ export declare const useExplorer: () => {
118
120
  pageCount: number;
119
121
  };
120
122
  selectedRowIds: string[];
123
+ selectedRowIdSet: Set<string>;
121
124
  pageIds: string[];
122
125
  selectedPageCount: number;
123
126
  updateState: (changes: Partial<DataExplorerState>) => void;
package/docs/catalog.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/data-explorer",
4
- "version": "1.2.2",
5
- "category": "dashboard",
4
+ "version": "1.3.0",
5
+ "category": "data",
6
6
  "description": "GridUI React data explorer",
7
- "usage": "DataExplorer, Composer, and ApprovalPanel belong to Dashboard because they coordinate multiple lower-package contracts. See task workspace compositions for controlled state, callbacks, and application responsibilities.",
7
+ "usage": "DataExplorer belongs to Data because it coordinates generic dataset exploration through Core controls, Layout regions, and DataTable. Composer and ApprovalPanel remain Dashboard task compositions. See task workspace compositions for controlled state, callbacks, and application responsibilities.",
8
8
  "documentation": [
9
9
  "README.md",
10
10
  "docs/reference/README.md",
@@ -139,6 +139,11 @@
139
139
  "@gridui/data-explorer/styles.css"
140
140
  ],
141
141
  "examples": [
142
- "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/data-explorer/stories/data-explorer.stories.tsx"
142
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/stories/bulk-actions.mdx",
143
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/stories/columns-details.mdx",
144
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/stories/conditions.mdx",
145
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/stories/getting-started.mdx",
146
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/stories/local-data.mdx",
147
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/stories/data-explorer.stories.tsx"
143
148
  ]
144
149
  }
@@ -11,7 +11,7 @@ import "@gridui/theme/styles.css";
11
11
  import "@gridui/data-explorer/styles.css";
12
12
  ```
13
13
 
14
- Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/data-explorer/README.md) for shared behavior and stylesheet dependencies.
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/README.md) for shared behavior and stylesheet dependencies.
15
15
 
16
16
  ## API
17
17
 
@@ -11,7 +11,7 @@ import "@gridui/theme/styles.css";
11
11
  import "@gridui/data-explorer/styles.css";
12
12
  ```
13
13
 
14
- Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/data-explorer/README.md) for shared behavior and stylesheet dependencies.
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/README.md) for shared behavior and stylesheet dependencies.
15
15
 
16
16
  ## API
17
17
 
@@ -11,7 +11,7 @@ import "@gridui/theme/styles.css";
11
11
  import "@gridui/data-explorer/styles.css";
12
12
  ```
13
13
 
14
- Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/data-explorer/README.md) for shared behavior and stylesheet dependencies.
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/README.md) for shared behavior and stylesheet dependencies.
15
15
 
16
16
  ## API
17
17
 
@@ -21,3 +21,27 @@ The public Props type is the source of these signatures. Defaults below are expl
21
21
 
22
22
  ``string | undefined`` · Optional
23
23
 
24
+ ### rowLines
25
+
26
+ ``boolean | undefined`` · Optional
27
+
28
+ ### columnLines
29
+
30
+ ``boolean | undefined`` · Optional
31
+
32
+ ### density
33
+
34
+ ``"compact" | "comfortable" | undefined`` · Optional
35
+
36
+ ### headerSurface
37
+
38
+ ``"plain" | "muted" | undefined`` · Optional
39
+
40
+ ### rowHeaderSurface
41
+
42
+ ``"plain" | "muted" | undefined`` · Optional
43
+
44
+ ### striped
45
+
46
+ ``boolean | undefined`` · Optional
47
+
@@ -11,7 +11,7 @@ import "@gridui/theme/styles.css";
11
11
  import "@gridui/data-explorer/styles.css";
12
12
  ```
13
13
 
14
- Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/data-explorer/README.md) for shared behavior and stylesheet dependencies.
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/README.md) for shared behavior and stylesheet dependencies.
15
15
 
16
16
  ## API
17
17
 
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
11
11
  import "@gridui/data-explorer/styles.css";
12
12
  ```
13
13
 
14
- Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/data-explorer/README.md) for shared behavior and stylesheet dependencies.
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/README.md) for shared behavior and stylesheet dependencies.
15
15
 
16
- The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/data-explorer/stories/data-explorer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-explorer/stories/data-explorer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
17
 
18
18
  ## API
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/data-explorer",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "GridUI React data explorer",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,20 +27,20 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/button": "^4.0.0",
31
- "@gridui/choice": "^1.2.5",
32
- "@gridui/grid": "^2.3.6",
33
- "@gridui/input": "^3.0.0",
30
+ "@gridui/button": "^5.0.0",
31
+ "@gridui/choice": "^1.2.6",
32
+ "@gridui/grid": "^3.0.0",
33
+ "@gridui/input": "^4.0.0",
34
34
  "@gridui/interaction": "^1.2.1",
35
- "@gridui/select": "^1.2.0",
36
- "@gridui/style-utils": "^3.0.0",
37
- "@gridui/table": "^2.0.1",
38
- "@gridui/theme": "^2.5.3",
35
+ "@gridui/select": "^1.2.2",
36
+ "@gridui/style-utils": "^4.0.0",
37
+ "@gridui/table": "^3.1.0",
38
+ "@gridui/theme": "^2.5.4",
39
39
  "class-variance-authority": "0.7.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@gridui-internal/configuration": "0.0.0-internal",
43
- "@gridui/inline-notice": "1.0.6",
43
+ "@gridui/inline-notice": "1.0.7",
44
44
  "@jest/globals": "30.5.2",
45
45
  "@storybook/react-vite": "10.6.6",
46
46
  "@types/jest": "30.0.0",