@gridui/data-explorer 1.0.4 → 1.2.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 +55 -2
- package/dist/data-explorer/data-explorer.d.ts +3 -37
- package/dist/data-explorer/style.d.ts +0 -3
- package/dist/data-explorer-bulk-actions/data-explorer-bulk-actions.d.ts +10 -0
- package/dist/data-explorer-pagination/data-explorer-pagination.d.ts +10 -0
- package/dist/data-explorer-table/column-resize-handle.d.ts +16 -0
- package/dist/data-explorer-table/data-explorer-table.d.ts +10 -0
- package/dist/data-explorer-toolbar/data-explorer-toolbar.d.ts +10 -0
- package/dist/data-explorer-toolbar/filter-editor.d.ts +16 -0
- package/dist/data-explorer-toolbar/style.d.ts +7 -0
- package/dist/index.d.ts +15 -5
- package/dist/index.js +919 -256
- package/dist/index.js.map +4 -4
- package/dist/shared/control-row-style.d.ts +7 -0
- package/dist/shared/explorer-context.d.ts +161 -0
- package/dist/shared/explorer-options.d.ts +51 -0
- package/dist/shared/features.d.ts +37 -0
- package/dist/{data-explorer → shared}/model.d.ts +24 -1
- package/dist/styles.css +31 -2
- package/docs/catalog.json +139 -0
- package/package.json +14 -12
package/README.md
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
# @gridui/data-explorer
|
|
2
2
|
|
|
3
|
-
Dashboard family. Public API: `DataExplorer`, `DataExplorerColumn`, `DataExplorerFilter`, `DataExplorerProps`, `DataExplorerRow`, `DataExplorerState`, `DataExplorerValue`.
|
|
3
|
+
Dashboard 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
|
-
Load
|
|
6
|
+
Load the complete family stylesheet set in dependency order:
|
|
7
|
+
```css
|
|
8
|
+
@import "@gridui/theme/styles.css";
|
|
9
|
+
@import "@gridui/button/styles.css";
|
|
10
|
+
@import "@gridui/form/styles.css";
|
|
11
|
+
@import "@gridui/choice/styles.css";
|
|
12
|
+
@import "@gridui/grid/styles.css";
|
|
13
|
+
@import "@gridui/overlay/styles.css";
|
|
14
|
+
@import "@gridui/input/styles.css";
|
|
15
|
+
@import "@gridui/dropdown-menu/styles.css";
|
|
16
|
+
@import "@gridui/select/styles.css";
|
|
17
|
+
@import "@gridui/table/styles.css";
|
|
18
|
+
@import "@gridui/data-explorer/styles.css";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Applications own routes, labels, state persistence, and branding.
|
|
7
22
|
|
|
8
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).
|
|
9
24
|
|
|
@@ -30,3 +45,41 @@ separate Split regions, so their separators also belong to Grid.
|
|
|
30
45
|
Toolbar fields use a single flex sizing declaration with a 10rem basis and wrap
|
|
31
46
|
to the available container width. Loading other family styles afterward does not
|
|
32
47
|
reset that basis or compress Select labels into character-wide columns.
|
|
48
|
+
|
|
49
|
+
## Optional controlled features
|
|
50
|
+
|
|
51
|
+
Existing search, sorting, single filtering, pagination and page selection keep
|
|
52
|
+
their defaults. New features are opt-in and use the same native table and styles.
|
|
53
|
+
|
|
54
|
+
- `columnSettings: { hiddenKeys, onHiddenKeysChange, label }` adds a native
|
|
55
|
+
disclosure with column visibility checkboxes. The last visible column cannot
|
|
56
|
+
be hidden. Hidden columns remain searchable and sortable because the full
|
|
57
|
+
declared schema still owns query semantics. Omitting this config shows all columns.
|
|
58
|
+
Stable column identities preserve state in surviving custom cells when other
|
|
59
|
+
columns are hidden or reordered; a hidden column unmounts its own cells.
|
|
60
|
+
- `columnSizing: { widths, onWidthsChange, resizeLabel }` adds resize handles to
|
|
61
|
+
headers. Each handle supports pointer capture, RTL-aware arrow keys (10px,
|
|
62
|
+
Shift for 50px), Home/End, and separator value semantics. Pointer cancellation, unexpected capture loss, or becoming busy
|
|
63
|
+
restores the starting width. IME key processing never changes a column width. Applications persist the controlled width map.
|
|
64
|
+
- Columns accept pixel `width`, `minWidth`, `maxWidth` and logical `sticky`
|
|
65
|
+
(`start` or `end`). Defaults are 200px, 80px and 1200px. Explicit widths or
|
|
66
|
+
resizing use fixed table geometry; pinned offsets include preceding pinned
|
|
67
|
+
columns and recompute after hiding or resizing. Other tables retain fluid sizing.
|
|
68
|
+
- `details: { expandedIds, onExpandedIdsChange, render, columnLabel, expandLabel,
|
|
69
|
+
collapseLabel }` adds expansion buttons and full-width detail rows. IDs refer
|
|
70
|
+
to records, so selection/expansion survives sorting and pagination. Applications
|
|
71
|
+
own detail requests, loading content and error recovery.
|
|
72
|
+
- `filtering: { definitions, labels }` adds multiple AND conditions in
|
|
73
|
+
`state.filters`. Definitions specify `key`, `label`, `type` (`text`, `number`,
|
|
74
|
+
`enum`) and optional enum options. Labels include `add`, `remove(index)`,
|
|
75
|
+
`field`, `operator`, `value` and every supported operator label. Conditions
|
|
76
|
+
have a unique `id`, field `key`, `operator` and optional scalar `value`.
|
|
77
|
+
Operators are `contains`, `equals`, `not-equals`, `greater-than`, `less-than`,
|
|
78
|
+
and `empty`. Numeric comparisons require finite numbers; equals is exact,
|
|
79
|
+
contains is normalized and case-insensitive, and empty matches null/missing/
|
|
80
|
+
empty text. An incomplete value is ignored until entered. Changing filters
|
|
81
|
+
returns to page one. This is an in-memory filter editor, not a query language
|
|
82
|
+
or a backend request planner.
|
|
83
|
+
|
|
84
|
+
All optional feature labels are caller-owned. Remote paging, authorization,
|
|
85
|
+
query serialization and persistence remain application responsibilities.
|
|
@@ -4,41 +4,7 @@
|
|
|
4
4
|
* @namespace DataExplorer
|
|
5
5
|
* @description Data Explorer
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
export type DataExplorerProps =
|
|
10
|
-
readonly rows: readonly DataExplorerRow[];
|
|
11
|
-
readonly columns: readonly DataExplorerColumn[];
|
|
12
|
-
readonly state: DataExplorerState;
|
|
13
|
-
readonly onStateChange: (state: DataExplorerState) => void;
|
|
14
|
-
readonly filter?: DataExplorerFilter;
|
|
15
|
-
readonly pageSize?: number;
|
|
16
|
-
readonly selectedIds?: readonly string[];
|
|
17
|
-
readonly onSelectionChange?: (ids: readonly string[]) => void;
|
|
18
|
-
readonly actions?: readonly {
|
|
19
|
-
readonly label: string;
|
|
20
|
-
readonly onAction: (ids: readonly string[]) => void;
|
|
21
|
-
readonly disabled?: boolean;
|
|
22
|
-
}[];
|
|
23
|
-
readonly renderCell?: (value: DataExplorerValue | undefined, row: DataExplorerRow, column: DataExplorerColumn) => ReactNode;
|
|
24
|
-
readonly busy?: boolean;
|
|
25
|
-
readonly notice?: ReactNode;
|
|
26
|
-
readonly labels: {
|
|
27
|
-
readonly table: string;
|
|
28
|
-
readonly search: string;
|
|
29
|
-
readonly sort: string;
|
|
30
|
-
readonly unsorted: string;
|
|
31
|
-
readonly ascending: string;
|
|
32
|
-
readonly descending: string;
|
|
33
|
-
readonly all: string;
|
|
34
|
-
readonly selection: string;
|
|
35
|
-
readonly selectPage: string;
|
|
36
|
-
readonly selectRow: (row: DataExplorerRow) => string;
|
|
37
|
-
readonly selected: (count: number) => string;
|
|
38
|
-
readonly previous: string;
|
|
39
|
-
readonly next: string;
|
|
40
|
-
readonly page: (page: number, pages: number, total: number) => string;
|
|
41
|
-
readonly empty: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
7
|
+
import type { ExplorerOptions } from "../shared/explorer-options";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type DataExplorerProps = ComponentPropsWithRef<"section"> & ExplorerOptions;
|
|
44
10
|
export declare const DataExplorer: FC<DataExplorerProps>;
|
|
@@ -5,6 +5,3 @@
|
|
|
5
5
|
* @description Style
|
|
6
6
|
*/
|
|
7
7
|
export declare const explorerStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
-
export declare const explorerToolbarStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
|
-
export declare const explorerLabelStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
|
-
export declare const explorerFooterStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Data Explorer
|
|
4
|
+
* @namespace DataExplorerBulkActions
|
|
5
|
+
* @description Data Explorer Bulk Actions
|
|
6
|
+
*/
|
|
7
|
+
import type { ExplorerPartOptions } from "../shared/explorer-options";
|
|
8
|
+
import type { FC } from "react";
|
|
9
|
+
export type DataExplorerBulkActionsProps = ExplorerPartOptions;
|
|
10
|
+
export declare const DataExplorerBulkActions: FC<DataExplorerBulkActionsProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Data Explorer
|
|
4
|
+
* @namespace DataExplorerPagination
|
|
5
|
+
* @description Data Explorer Pagination
|
|
6
|
+
*/
|
|
7
|
+
import type { ExplorerPartOptions } from "../shared/explorer-options";
|
|
8
|
+
import type { FC } from "react";
|
|
9
|
+
export type DataExplorerPaginationProps = ExplorerPartOptions;
|
|
10
|
+
export declare const DataExplorerPagination: FC<DataExplorerPaginationProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Data Explorer
|
|
4
|
+
* @namespace DataExplorerTable
|
|
5
|
+
* @description Column Resize Handle
|
|
6
|
+
*/
|
|
7
|
+
import { type DataExplorerColumn } from "../shared/model";
|
|
8
|
+
import { type FC } from "react";
|
|
9
|
+
export type ColumnResizeHandleProps = {
|
|
10
|
+
readonly column: DataExplorerColumn;
|
|
11
|
+
readonly width: number;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly disabled: boolean;
|
|
14
|
+
readonly onChange: (width: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const ColumnResizeHandle: FC<ColumnResizeHandleProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Data Explorer
|
|
4
|
+
* @namespace DataExplorerTable
|
|
5
|
+
* @description Data Explorer Table
|
|
6
|
+
*/
|
|
7
|
+
import type { ExplorerPartOptions } from "../shared/explorer-options";
|
|
8
|
+
import { type FC } from "react";
|
|
9
|
+
export type DataExplorerTableProps = ExplorerPartOptions;
|
|
10
|
+
export declare const DataExplorerTable: FC<DataExplorerTableProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Data Explorer
|
|
4
|
+
* @namespace DataExplorerToolbar
|
|
5
|
+
* @description Data Explorer Toolbar
|
|
6
|
+
*/
|
|
7
|
+
import type { ExplorerPartOptions } from "../shared/explorer-options";
|
|
8
|
+
import type { FC } from "react";
|
|
9
|
+
export type DataExplorerToolbarProps = ExplorerPartOptions;
|
|
10
|
+
export declare const DataExplorerToolbar: FC<DataExplorerToolbarProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Data Explorer
|
|
4
|
+
* @namespace DataExplorerToolbar
|
|
5
|
+
* @description Filter Editor
|
|
6
|
+
*/
|
|
7
|
+
import type { DataExplorerFiltering } from "../shared/features";
|
|
8
|
+
import type { DataExplorerCondition } from "../shared/model";
|
|
9
|
+
import { type FC } from "react";
|
|
10
|
+
export type FilterEditorProps = {
|
|
11
|
+
readonly filtering: DataExplorerFiltering;
|
|
12
|
+
readonly conditions: readonly DataExplorerCondition[];
|
|
13
|
+
readonly disabled: boolean;
|
|
14
|
+
readonly onChange: (conditions: readonly DataExplorerCondition[]) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const FilterEditor: FC<FilterEditorProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type { DataExplorerProps } from "./data-explorer/data-explorer";
|
|
8
8
|
export { DataExplorer } from "./data-explorer/data-explorer";
|
|
9
|
-
export type {
|
|
10
|
-
export
|
|
11
|
-
export type {
|
|
12
|
-
export
|
|
13
|
-
export type {
|
|
9
|
+
export type { DataExplorerBulkActionsProps } from "./data-explorer-bulk-actions/data-explorer-bulk-actions";
|
|
10
|
+
export { DataExplorerBulkActions } from "./data-explorer-bulk-actions/data-explorer-bulk-actions";
|
|
11
|
+
export type { DataExplorerPaginationProps } from "./data-explorer-pagination/data-explorer-pagination";
|
|
12
|
+
export { DataExplorerPagination } from "./data-explorer-pagination/data-explorer-pagination";
|
|
13
|
+
export type { DataExplorerTableProps } from "./data-explorer-table/data-explorer-table";
|
|
14
|
+
export { DataExplorerTable } from "./data-explorer-table/data-explorer-table";
|
|
15
|
+
export type { DataExplorerToolbarProps } from "./data-explorer-toolbar/data-explorer-toolbar";
|
|
16
|
+
export { DataExplorerToolbar } from "./data-explorer-toolbar/data-explorer-toolbar";
|
|
17
|
+
export type { DataExplorerColumnSettings, DataExplorerColumnSizing, DataExplorerDetails, DataExplorerFiltering } from "./shared/features";
|
|
18
|
+
export type { DataExplorerColumn } from "./shared/model";
|
|
19
|
+
export type { DataExplorerFilter } from "./shared/model";
|
|
20
|
+
export type { DataExplorerRow } from "./shared/model";
|
|
21
|
+
export type { DataExplorerState } from "./shared/model";
|
|
22
|
+
export type { DataExplorerValue } from "./shared/model";
|
|
23
|
+
export type { DataExplorerCondition, DataExplorerFilterDefinition, DataExplorerFilterOperator } from "./shared/model";
|