@azrico/reactgrid 1.0.18 → 1.0.19
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/dist/src/views/DataGrid.js +7 -7
- package/package.json +1 -1
- package/src/views/DataGrid.tsx +12 -4
|
@@ -30,6 +30,7 @@ const defaultColumnOptions = {
|
|
|
30
30
|
draggable: false,
|
|
31
31
|
lockable: false
|
|
32
32
|
};
|
|
33
|
+
const dynamic_option_names = ['selected', 'loading', 'limit', 'skip'];
|
|
33
34
|
/* -------------------------------------------------------------------------- */
|
|
34
35
|
function AzGrid(props) {
|
|
35
36
|
const [pendingChanges, set_pendingChanges] = _react.default.useState(1);
|
|
@@ -216,13 +217,12 @@ function DataGrid(props) {
|
|
|
216
217
|
};
|
|
217
218
|
}, [props.gridOptions, base_gridOptions]);
|
|
218
219
|
const dynamic_gridOptions = _react.default.useMemo(() => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}, [props.selected, props.loading, props.skip]);
|
|
220
|
+
const res = {};
|
|
221
|
+
dynamic_option_names.map(r => {
|
|
222
|
+
res[r] = props[r];
|
|
223
|
+
});
|
|
224
|
+
return res;
|
|
225
|
+
}, dynamic_option_names.map(r => props[r]));
|
|
226
226
|
/* --------------------------------- events --------------------------------- */
|
|
227
227
|
function onRowContextMenu(row, ev) {
|
|
228
228
|
if (_helpers.func_selection.has_selection()) return;
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -109,7 +109,7 @@ const defaultColumnOptions: ColumnDefinition = {
|
|
|
109
109
|
draggable: false,
|
|
110
110
|
lockable: false,
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
const dynamic_option_names = ['selected', 'loading', 'limit', 'skip'];
|
|
113
113
|
/* -------------------------------------------------------------------------- */
|
|
114
114
|
export function AzGrid(props: AzGridProps) {
|
|
115
115
|
const [pendingChanges, set_pendingChanges] = React.useState<number>(1);
|
|
@@ -289,9 +289,17 @@ function DataGrid(props: DataGridProps) {
|
|
|
289
289
|
const static_gridOptions = React.useMemo<GridOptions>(() => {
|
|
290
290
|
return { ...base_gridOptions, ...props.gridOptions, ...forcedOptions };
|
|
291
291
|
}, [props.gridOptions, base_gridOptions]);
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
|
|
293
|
+
const dynamic_gridOptions = React.useMemo<GridOptions>(
|
|
294
|
+
() => {
|
|
295
|
+
const res = {};
|
|
296
|
+
dynamic_option_names.map((r) => {
|
|
297
|
+
res[r] = props[r];
|
|
298
|
+
});
|
|
299
|
+
return res;
|
|
300
|
+
},
|
|
301
|
+
dynamic_option_names.map((r) => props[r])
|
|
302
|
+
);
|
|
295
303
|
|
|
296
304
|
/* --------------------------------- events --------------------------------- */
|
|
297
305
|
function onRowContextMenu(row: TypeRowProps, ev: any) {
|