@azrico/reactgrid 1.2.11 → 1.2.13
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/CHANGELOG.md +4 -0
- package/dist/src/views/DataGrid.d.ts +2 -2
- package/package.json +1 -1
- package/src/views/DataGrid.tsx +14 -14
- package/yarn-error.log +0 -9253
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.2.13](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.12...v1.2.13) (2023-04-01)
|
|
6
|
+
|
|
7
|
+
### [1.2.12](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.11...v1.2.12) (2023-03-31)
|
|
8
|
+
|
|
5
9
|
### 1.2.11 (2023-03-31)
|
|
6
10
|
|
|
7
11
|
|
|
@@ -34,7 +34,7 @@ type customColumnData = {
|
|
|
34
34
|
name: string;
|
|
35
35
|
render: (cell: any, formatterParams: any, onRendered: any) => React.ReactNode | undefined | null;
|
|
36
36
|
};
|
|
37
|
-
type
|
|
37
|
+
export type AzGridOptions = Partial<TypeDataGridProps>;
|
|
38
38
|
export type AzGridProps = {
|
|
39
39
|
dataSource?: any[] | ((args: any) => any[] | Promise<any[] | any>);
|
|
40
40
|
details_dataSource?: any[] | ((args: any) => any[] | Promise<any[] | any>);
|
|
@@ -42,7 +42,7 @@ export type AzGridProps = {
|
|
|
42
42
|
details_filter?: FilterValues;
|
|
43
43
|
licenseKey?: string;
|
|
44
44
|
gridRef?: any;
|
|
45
|
-
gridOptions?:
|
|
45
|
+
gridOptions?: AzGridOptions;
|
|
46
46
|
columns?: LooseColumnDefinition[];
|
|
47
47
|
columnExtensions?: Partial<LooseColumnDefinition>;
|
|
48
48
|
editableColumns?: string[];
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -66,7 +66,7 @@ type customColumnData = {
|
|
|
66
66
|
name: string;
|
|
67
67
|
render: (cell: any, formatterParams, onRendered) => React.ReactNode | undefined | null;
|
|
68
68
|
};
|
|
69
|
-
type
|
|
69
|
+
export type AzGridOptions = Partial<TypeDataGridProps>;
|
|
70
70
|
/* -------------------------------------------------------------------------- */
|
|
71
71
|
export type AzGridProps = {
|
|
72
72
|
dataSource?: any[] | ((args: any) => any[] | Promise<any[] | any>);
|
|
@@ -77,7 +77,7 @@ export type AzGridProps = {
|
|
|
77
77
|
licenseKey?: string;
|
|
78
78
|
|
|
79
79
|
gridRef?: any;
|
|
80
|
-
gridOptions?:
|
|
80
|
+
gridOptions?: AzGridOptions;
|
|
81
81
|
|
|
82
82
|
columns?: LooseColumnDefinition[];
|
|
83
83
|
columnExtensions?: Partial<LooseColumnDefinition>;
|
|
@@ -126,14 +126,14 @@ type DataGridProps = ModifyFields<
|
|
|
126
126
|
type DataGridWrapperProps = ModifyFields<
|
|
127
127
|
DataGridProps,
|
|
128
128
|
{
|
|
129
|
-
static_gridOptions:
|
|
130
|
-
dynamic_gridOptions:
|
|
129
|
+
static_gridOptions: AzGridOptions;
|
|
130
|
+
dynamic_gridOptions: AzGridOptions;
|
|
131
131
|
children?: React.ReactNode;
|
|
132
132
|
}
|
|
133
133
|
>;
|
|
134
134
|
/* -------------------------------------------------------------------------- */
|
|
135
135
|
|
|
136
|
-
const defaultOptions:
|
|
136
|
+
const defaultOptions: AzGridOptions = {
|
|
137
137
|
//filterTypes: defaultfilterTypes,
|
|
138
138
|
remoteFilter: false,
|
|
139
139
|
remoteSort: false,
|
|
@@ -144,7 +144,7 @@ const defaultOptions: GridOptions = {
|
|
|
144
144
|
rowIndexColumn: true,
|
|
145
145
|
rowHeight: 35,
|
|
146
146
|
};
|
|
147
|
-
const forcedOptions:
|
|
147
|
+
const forcedOptions: AzGridOptions = {
|
|
148
148
|
idProperty: '__table_id',
|
|
149
149
|
nodesProperty: '__children',
|
|
150
150
|
};
|
|
@@ -186,15 +186,15 @@ export function AzGrid(props: AzGridProps) {
|
|
|
186
186
|
[props.dataSource]
|
|
187
187
|
);
|
|
188
188
|
|
|
189
|
-
const base_gridOptions = React.useMemo<
|
|
189
|
+
const base_gridOptions = React.useMemo<AzGridOptions>(() => {
|
|
190
190
|
const firstcolumn = cached_columns[0];
|
|
191
191
|
const licenseKey = props.licenseKey || get_default_key();
|
|
192
|
-
const events:
|
|
192
|
+
const events: AzGridOptions = {
|
|
193
193
|
onSkipChange: props.onSkipChange,
|
|
194
194
|
onLimitChange: props.onLimitChange,
|
|
195
195
|
onEditComplete: props.onEditComplete,
|
|
196
196
|
};
|
|
197
|
-
const extra_ops:
|
|
197
|
+
const extra_ops: AzGridOptions = {
|
|
198
198
|
onSelectionChange: props.onSelectionChange,
|
|
199
199
|
licenseKey: licenseKey,
|
|
200
200
|
editable: props.editable as any, //bug in types of the plugin
|
|
@@ -211,11 +211,11 @@ export function AzGrid(props: AzGridProps) {
|
|
|
211
211
|
props.onEditComplete,
|
|
212
212
|
]);
|
|
213
213
|
|
|
214
|
-
const static_gridOptions = React.useMemo<
|
|
214
|
+
const static_gridOptions = React.useMemo<AzGridOptions>(() => {
|
|
215
215
|
return { ...base_gridOptions, ...props.gridOptions, ...forcedOptions };
|
|
216
216
|
}, [props.gridOptions, base_gridOptions, forcedOptions]);
|
|
217
217
|
|
|
218
|
-
const dynamic_gridOptions = React.useMemo<
|
|
218
|
+
const dynamic_gridOptions = React.useMemo<AzGridOptions>(
|
|
219
219
|
() => {
|
|
220
220
|
const res = {};
|
|
221
221
|
dynamic_option_names.map((r) => {
|
|
@@ -302,8 +302,8 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
302
302
|
/**
|
|
303
303
|
* Merge click events into grid options
|
|
304
304
|
*/
|
|
305
|
-
const static_gridOptions = React.useMemo<
|
|
306
|
-
const events:
|
|
305
|
+
const static_gridOptions = React.useMemo<AzGridOptions>(() => {
|
|
306
|
+
const events: AzGridOptions = {
|
|
307
307
|
onRowClick: onRowClick,
|
|
308
308
|
onRowContextMenu: onRowContextMenu,
|
|
309
309
|
};
|
|
@@ -370,7 +370,7 @@ function DataGridDetailsWrapper(props: DataGridWrapperProps) {
|
|
|
370
370
|
/**
|
|
371
371
|
* Merge details into grid
|
|
372
372
|
*/
|
|
373
|
-
const static_gridOptions = React.useMemo<
|
|
373
|
+
const static_gridOptions = React.useMemo<AzGridOptions>(() => {
|
|
374
374
|
const finalresult = props.static_gridOptions || {};
|
|
375
375
|
finalresult['renderDetailsGrid'] = renderDetailsGrid;
|
|
376
376
|
return finalresult;
|