@gridui/data-explorer 1.3.0 → 1.5.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.
Files changed (41) hide show
  1. package/README.md +79 -12
  2. package/dist/data-explorer/data-explorer.d.ts +1 -0
  3. package/dist/data-explorer-bulk-actions/data-explorer-bulk-actions.d.ts +4 -2
  4. package/dist/data-explorer-column-visibility/data-explorer-column-visibility.d.ts +11 -0
  5. package/dist/data-explorer-filter-control/data-explorer-filter-control.d.ts +11 -0
  6. package/dist/data-explorer-filters/data-explorer-filters.d.ts +11 -0
  7. package/dist/{data-explorer-toolbar → data-explorer-filters}/filter-editor.d.ts +1 -1
  8. package/dist/data-explorer-pagination/data-explorer-pagination.d.ts +4 -2
  9. package/dist/data-explorer-provider/data-explorer-provider.d.ts +13 -0
  10. package/dist/data-explorer-search/data-explorer-search.d.ts +11 -0
  11. package/dist/data-explorer-sort/data-explorer-sort.d.ts +11 -0
  12. package/dist/data-explorer-table/data-explorer-table.d.ts +4 -2
  13. package/dist/data-explorer-toolbar/data-explorer-toolbar.d.ts +5 -3
  14. package/dist/data-explorer-view/data-explorer-view.d.ts +12 -0
  15. package/dist/{data-explorer → data-explorer-view}/style.d.ts +1 -1
  16. package/dist/index.d.ts +17 -0
  17. package/dist/index.js +314 -372
  18. package/dist/index.js.map +4 -4
  19. package/dist/shared/controller.d.ts +32 -0
  20. package/dist/shared/explorer-context.d.ts +126 -71
  21. package/dist/shared/explorer-options.d.ts +22 -18
  22. package/dist/{data-explorer-toolbar/style.d.ts → shared/label-style.d.ts} +2 -2
  23. package/dist/shared/labels.d.ts +8 -0
  24. package/dist/styled.js +8 -0
  25. package/dist/styles.css +2911 -0
  26. package/dist/styles.local.css +114 -0
  27. package/docs/catalog.json +99 -1
  28. package/docs/reference/README.md +7 -0
  29. package/docs/reference/data-explorer-bulk-actions.md +4 -0
  30. package/docs/reference/data-explorer-column-visibility.md +27 -0
  31. package/docs/reference/data-explorer-filter-control.md +27 -0
  32. package/docs/reference/data-explorer-filters.md +23 -0
  33. package/docs/reference/data-explorer-pagination.md +4 -0
  34. package/docs/reference/data-explorer-provider.md +97 -0
  35. package/docs/reference/data-explorer-search.md +27 -0
  36. package/docs/reference/data-explorer-sort.md +27 -0
  37. package/docs/reference/data-explorer-table.md +4 -0
  38. package/docs/reference/data-explorer-toolbar.md +6 -0
  39. package/docs/reference/data-explorer-view.md +59 -0
  40. package/docs/reference/data-explorer.md +1 -1
  41. package/package.json +33 -15
@@ -4,11 +4,35 @@
4
4
  * @namespace Shared
5
5
  * @description Explorer Context
6
6
  */
7
- import type { ExplorerOptions } from "./explorer-options";
8
- import { type DataExplorerState } from "./model";
9
- export declare const useExplorerController: (options: ExplorerOptions) => {
10
- busy: boolean;
7
+ import type { DataExplorerOptions } from "./explorer-options";
8
+ export declare const useExplorerController: (options: DataExplorerOptions) => {
11
9
  tableId: string;
10
+ controller: {
11
+ busy: boolean;
12
+ state: import("./model").DataExplorerState;
13
+ columns: readonly import("./model").DataExplorerColumn[];
14
+ visibleColumns: import("./model").DataExplorerColumn[];
15
+ view: {
16
+ rows: import("./model").DataExplorerRow[];
17
+ total: number;
18
+ page: number;
19
+ pageCount: number;
20
+ };
21
+ selectedRowIds: string[];
22
+ selectedRowIdSet: Set<string>;
23
+ pageIds: string[];
24
+ selectedPageCount: number;
25
+ updateState: (changes: Partial<import("./model").DataExplorerState>) => void;
26
+ setQuery: (query: string) => undefined;
27
+ setFilterValue: (filterValue: string) => undefined;
28
+ setSort: (sort: import("./model").DataExplorerState["sort"]) => undefined;
29
+ setFilters: (filters: NonNullable<import("./model").DataExplorerState["filters"]>) => undefined;
30
+ updateSelection: (ids: readonly string[]) => void;
31
+ };
32
+ busy: boolean;
33
+ state: import("./model").DataExplorerState;
34
+ columns: readonly import("./model").DataExplorerColumn[];
35
+ visibleColumns: import("./model").DataExplorerColumn[];
12
36
  view: {
13
37
  rows: import("./model").DataExplorerRow[];
14
38
  total: number;
@@ -19,12 +43,14 @@ export declare const useExplorerController: (options: ExplorerOptions) => {
19
43
  selectedRowIdSet: Set<string>;
20
44
  pageIds: string[];
21
45
  selectedPageCount: number;
22
- updateState: (changes: Partial<DataExplorerState>) => void;
23
- visibleColumns: import("./model").DataExplorerColumn[];
46
+ updateState: (changes: Partial<import("./model").DataExplorerState>) => void;
47
+ setQuery: (query: string) => undefined;
48
+ setFilterValue: (filterValue: string) => undefined;
49
+ setSort: (sort: import("./model").DataExplorerState["sort"]) => undefined;
50
+ setFilters: (filters: NonNullable<import("./model").DataExplorerState["filters"]>) => undefined;
51
+ updateSelection: (ids: readonly string[]) => void;
24
52
  rows: readonly import("./model").DataExplorerRow[];
25
- columns: readonly import("./model").DataExplorerColumn[];
26
- state: DataExplorerState;
27
- onStateChange: (state: DataExplorerState) => void;
53
+ onStateChange: (state: import("./model").DataExplorerState) => void;
28
54
  filter?: import("./model").DataExplorerFilter | undefined;
29
55
  columnSettings?: import("./features").DataExplorerColumnSettings | undefined;
30
56
  columnSizing?: import("./features").DataExplorerColumnSizing | undefined;
@@ -40,27 +66,36 @@ export declare const useExplorerController: (options: ExplorerOptions) => {
40
66
  }[] | undefined;
41
67
  renderCell?: ((value: import("./model").DataExplorerValue | undefined, row: import("./model").DataExplorerRow, column: import("./model").DataExplorerColumn) => import("react").ReactNode) | undefined;
42
68
  notice?: import("react").ReactNode;
43
- labels: {
44
- readonly table: string;
45
- readonly search: string;
46
- readonly sort: string;
47
- readonly unsorted: string;
48
- readonly ascending: string;
49
- readonly descending: string;
50
- readonly all: string;
51
- readonly selection: string;
52
- readonly selectPage: string;
53
- readonly selectRow: (row: import("./model").DataExplorerRow) => string;
54
- readonly selected: (count: number) => string;
55
- readonly previous: string;
56
- readonly next: string;
57
- readonly page: (page: number, pages: number, total: number) => string;
58
- readonly empty: string;
59
- };
69
+ labels?: Partial<import("./explorer-options").DataExplorerLabels> | undefined;
60
70
  };
61
71
  export declare const explorerContext: import("react").Context<{
62
- busy: boolean;
63
72
  tableId: string;
73
+ controller: {
74
+ busy: boolean;
75
+ state: import("./model").DataExplorerState;
76
+ columns: readonly import("./model").DataExplorerColumn[];
77
+ visibleColumns: import("./model").DataExplorerColumn[];
78
+ view: {
79
+ rows: import("./model").DataExplorerRow[];
80
+ total: number;
81
+ page: number;
82
+ pageCount: number;
83
+ };
84
+ selectedRowIds: string[];
85
+ selectedRowIdSet: Set<string>;
86
+ pageIds: string[];
87
+ selectedPageCount: number;
88
+ updateState: (changes: Partial<import("./model").DataExplorerState>) => void;
89
+ setQuery: (query: string) => undefined;
90
+ setFilterValue: (filterValue: string) => undefined;
91
+ setSort: (sort: import("./model").DataExplorerState["sort"]) => undefined;
92
+ setFilters: (filters: NonNullable<import("./model").DataExplorerState["filters"]>) => undefined;
93
+ updateSelection: (ids: readonly string[]) => void;
94
+ };
95
+ busy: boolean;
96
+ state: import("./model").DataExplorerState;
97
+ columns: readonly import("./model").DataExplorerColumn[];
98
+ visibleColumns: import("./model").DataExplorerColumn[];
64
99
  view: {
65
100
  rows: import("./model").DataExplorerRow[];
66
101
  total: number;
@@ -71,12 +106,14 @@ export declare const explorerContext: import("react").Context<{
71
106
  selectedRowIdSet: Set<string>;
72
107
  pageIds: string[];
73
108
  selectedPageCount: number;
74
- updateState: (changes: Partial<DataExplorerState>) => void;
75
- visibleColumns: import("./model").DataExplorerColumn[];
109
+ updateState: (changes: Partial<import("./model").DataExplorerState>) => void;
110
+ setQuery: (query: string) => undefined;
111
+ setFilterValue: (filterValue: string) => undefined;
112
+ setSort: (sort: import("./model").DataExplorerState["sort"]) => undefined;
113
+ setFilters: (filters: NonNullable<import("./model").DataExplorerState["filters"]>) => undefined;
114
+ updateSelection: (ids: readonly string[]) => void;
76
115
  rows: readonly import("./model").DataExplorerRow[];
77
- columns: readonly import("./model").DataExplorerColumn[];
78
- state: DataExplorerState;
79
- onStateChange: (state: DataExplorerState) => void;
116
+ onStateChange: (state: import("./model").DataExplorerState) => void;
80
117
  filter?: import("./model").DataExplorerFilter | undefined;
81
118
  columnSettings?: import("./features").DataExplorerColumnSettings | undefined;
82
119
  columnSizing?: import("./features").DataExplorerColumnSizing | undefined;
@@ -92,27 +129,36 @@ export declare const explorerContext: import("react").Context<{
92
129
  }[] | undefined;
93
130
  renderCell?: ((value: import("./model").DataExplorerValue | undefined, row: import("./model").DataExplorerRow, column: import("./model").DataExplorerColumn) => import("react").ReactNode) | undefined;
94
131
  notice?: import("react").ReactNode;
95
- labels: {
96
- readonly table: string;
97
- readonly search: string;
98
- readonly sort: string;
99
- readonly unsorted: string;
100
- readonly ascending: string;
101
- readonly descending: string;
102
- readonly all: string;
103
- readonly selection: string;
104
- readonly selectPage: string;
105
- readonly selectRow: (row: import("./model").DataExplorerRow) => string;
106
- readonly selected: (count: number) => string;
107
- readonly previous: string;
108
- readonly next: string;
109
- readonly page: (page: number, pages: number, total: number) => string;
110
- readonly empty: string;
111
- };
132
+ labels?: Partial<import("./explorer-options").DataExplorerLabels> | undefined;
112
133
  } | null>;
113
134
  export declare const useExplorer: () => {
114
- busy: boolean;
115
135
  tableId: string;
136
+ controller: {
137
+ busy: boolean;
138
+ state: import("./model").DataExplorerState;
139
+ columns: readonly import("./model").DataExplorerColumn[];
140
+ visibleColumns: import("./model").DataExplorerColumn[];
141
+ view: {
142
+ rows: import("./model").DataExplorerRow[];
143
+ total: number;
144
+ page: number;
145
+ pageCount: number;
146
+ };
147
+ selectedRowIds: string[];
148
+ selectedRowIdSet: Set<string>;
149
+ pageIds: string[];
150
+ selectedPageCount: number;
151
+ updateState: (changes: Partial<import("./model").DataExplorerState>) => void;
152
+ setQuery: (query: string) => undefined;
153
+ setFilterValue: (filterValue: string) => undefined;
154
+ setSort: (sort: import("./model").DataExplorerState["sort"]) => undefined;
155
+ setFilters: (filters: NonNullable<import("./model").DataExplorerState["filters"]>) => undefined;
156
+ updateSelection: (ids: readonly string[]) => void;
157
+ };
158
+ busy: boolean;
159
+ state: import("./model").DataExplorerState;
160
+ columns: readonly import("./model").DataExplorerColumn[];
161
+ visibleColumns: import("./model").DataExplorerColumn[];
116
162
  view: {
117
163
  rows: import("./model").DataExplorerRow[];
118
164
  total: number;
@@ -123,12 +169,14 @@ export declare const useExplorer: () => {
123
169
  selectedRowIdSet: Set<string>;
124
170
  pageIds: string[];
125
171
  selectedPageCount: number;
126
- updateState: (changes: Partial<DataExplorerState>) => void;
127
- visibleColumns: import("./model").DataExplorerColumn[];
172
+ updateState: (changes: Partial<import("./model").DataExplorerState>) => void;
173
+ setQuery: (query: string) => undefined;
174
+ setFilterValue: (filterValue: string) => undefined;
175
+ setSort: (sort: import("./model").DataExplorerState["sort"]) => undefined;
176
+ setFilters: (filters: NonNullable<import("./model").DataExplorerState["filters"]>) => undefined;
177
+ updateSelection: (ids: readonly string[]) => void;
128
178
  rows: readonly import("./model").DataExplorerRow[];
129
- columns: readonly import("./model").DataExplorerColumn[];
130
- state: DataExplorerState;
131
- onStateChange: (state: DataExplorerState) => void;
179
+ onStateChange: (state: import("./model").DataExplorerState) => void;
132
180
  filter?: import("./model").DataExplorerFilter | undefined;
133
181
  columnSettings?: import("./features").DataExplorerColumnSettings | undefined;
134
182
  columnSizing?: import("./features").DataExplorerColumnSizing | undefined;
@@ -144,21 +192,28 @@ export declare const useExplorer: () => {
144
192
  }[] | undefined;
145
193
  renderCell?: ((value: import("./model").DataExplorerValue | undefined, row: import("./model").DataExplorerRow, column: import("./model").DataExplorerColumn) => import("react").ReactNode) | undefined;
146
194
  notice?: import("react").ReactNode;
147
- labels: {
148
- readonly table: string;
149
- readonly search: string;
150
- readonly sort: string;
151
- readonly unsorted: string;
152
- readonly ascending: string;
153
- readonly descending: string;
154
- readonly all: string;
155
- readonly selection: string;
156
- readonly selectPage: string;
157
- readonly selectRow: (row: import("./model").DataExplorerRow) => string;
158
- readonly selected: (count: number) => string;
159
- readonly previous: string;
160
- readonly next: string;
161
- readonly page: (page: number, pages: number, total: number) => string;
162
- readonly empty: string;
195
+ labels?: Partial<import("./explorer-options").DataExplorerLabels> | undefined;
196
+ };
197
+ /** Share accepted state, derived rows and guarded commands with custom controls. */
198
+ export declare const useDataExplorer: () => {
199
+ busy: boolean;
200
+ state: import("./model").DataExplorerState;
201
+ columns: readonly import("./model").DataExplorerColumn[];
202
+ visibleColumns: import("./model").DataExplorerColumn[];
203
+ view: {
204
+ rows: import("./model").DataExplorerRow[];
205
+ total: number;
206
+ page: number;
207
+ pageCount: number;
163
208
  };
209
+ selectedRowIds: string[];
210
+ selectedRowIdSet: Set<string>;
211
+ pageIds: string[];
212
+ selectedPageCount: number;
213
+ updateState: (changes: Partial<import("./model").DataExplorerState>) => void;
214
+ setQuery: (query: string) => undefined;
215
+ setFilterValue: (filterValue: string) => undefined;
216
+ setSort: (sort: import("./model").DataExplorerState["sort"]) => undefined;
217
+ setFilters: (filters: NonNullable<import("./model").DataExplorerState["filters"]>) => undefined;
218
+ updateSelection: (ids: readonly string[]) => void;
164
219
  };
@@ -7,7 +7,7 @@
7
7
  import type { DataExplorerColumnSettings, DataExplorerColumnSizing, DataExplorerDetails, DataExplorerFiltering } from "./features";
8
8
  import type { DataExplorerColumn, DataExplorerFilter, DataExplorerRow, DataExplorerState, DataExplorerValue } from "./model";
9
9
  import type { ReactNode } from "react";
10
- export type ExplorerOptions = {
10
+ export type DataExplorerOptions = {
11
11
  readonly rows: readonly DataExplorerRow[];
12
12
  readonly columns: readonly DataExplorerColumn[];
13
13
  readonly state: DataExplorerState;
@@ -28,23 +28,27 @@ export type ExplorerOptions = {
28
28
  readonly renderCell?: ((value: DataExplorerValue | undefined, row: DataExplorerRow, column: DataExplorerColumn) => ReactNode) | undefined;
29
29
  readonly busy?: boolean | undefined;
30
30
  readonly notice?: ReactNode;
31
- readonly labels: {
32
- readonly table: string;
33
- readonly search: string;
34
- readonly sort: string;
35
- readonly unsorted: string;
36
- readonly ascending: string;
37
- readonly descending: string;
38
- readonly all: string;
39
- readonly selection: string;
40
- readonly selectPage: string;
41
- readonly selectRow: (row: DataExplorerRow) => string;
42
- readonly selected: (count: number) => string;
43
- readonly previous: string;
44
- readonly next: string;
45
- readonly page: (page: number, pages: number, total: number) => string;
46
- readonly empty: string;
47
- };
31
+ readonly labels?: Partial<DataExplorerLabels> | undefined;
32
+ };
33
+ export type DataExplorerLabels = {
34
+ readonly table: string;
35
+ readonly search: string;
36
+ readonly sort: string;
37
+ readonly unsorted: string;
38
+ readonly ascending: string;
39
+ readonly descending: string;
40
+ readonly all: string;
41
+ readonly selection: string;
42
+ readonly selectPage: string;
43
+ readonly selectRow: (row: DataExplorerRow) => string;
44
+ readonly selected: (count: number) => string;
45
+ readonly previous: string;
46
+ readonly next: string;
47
+ readonly page: (page: number, pages: number, total: number) => string;
48
+ readonly empty: string;
49
+ };
50
+ export type ExplorerOptions = DataExplorerOptions & {
51
+ readonly labels: DataExplorerLabels;
48
52
  };
49
53
  export type ExplorerPartOptions = {
50
54
  readonly className?: string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Data Explorer
4
- * @namespace DataExplorerToolbar
5
- * @description Style
4
+ * @namespace Shared
5
+ * @description Label Style
6
6
  */
7
7
  export declare const explorerLabelStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Data Explorer
4
+ * @namespace Shared
5
+ * @description Labels
6
+ */
7
+ import type { DataExplorerLabels } from "./explorer-options";
8
+ export declare const explorerLabel: <Key extends keyof DataExplorerLabels>(labels: Partial<DataExplorerLabels> | undefined, key: Key) => DataExplorerLabels[Key];
package/dist/styled.js ADDED
@@ -0,0 +1,8 @@
1
+ import "@gridui/button/styled";
2
+ import "@gridui/choice/styled";
3
+ import "@gridui/grid/styled";
4
+ import "@gridui/input/styled";
5
+ import "@gridui/select/styled";
6
+ import "@gridui/table/styled";
7
+ import "./styles.local.css";
8
+ export * from "./index.js";