@azrico/reactgrid 1.1.15 → 1.1.17

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.
@@ -36,13 +36,13 @@ type customColumnData = {
36
36
  };
37
37
  type GridOptions = Partial<TypeDataGridProps>;
38
38
  export type AzGridProps = {
39
- columns?: columnOrString[];
40
39
  dataSource?: any[] | ((args: any) => any[] | Promise<any[] | any>);
41
40
  licenseKey?: string;
42
41
  gridOptions?: GridOptions;
42
+ columns?: columnOrString[];
43
43
  columnExtensions?: Array<{
44
44
  name: string;
45
- } & Partial<ColumnDefinition>>;
45
+ } & Partial<LooseColumnDefinition>>;
46
46
  editableColumns?: string[];
47
47
  leftColumns?: string[];
48
48
  rightColumns?: string[];
@@ -13,6 +13,8 @@ require("../themes/grid.css");
13
13
  var _controls = require("@azrico/controls");
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _helpers = require("../func/helpers");
16
+ var _BoolEditor = _interopRequireDefault(require("@inovua/reactdatagrid-community/BoolEditor"));
17
+ var _NumericEditor = _interopRequireDefault(require("@inovua/reactdatagrid-community/NumericEditor"));
16
18
  var _reactdatagridEnterprise = _interopRequireDefault(require("@inovua/reactdatagrid-enterprise"));
17
19
  var _SelectEditor = _interopRequireDefault(require("@inovua/reactdatagrid-community/SelectEditor"));
18
20
  var _clsx = _interopRequireDefault(require("clsx"));
@@ -49,7 +51,8 @@ const forcedOptions = {
49
51
  };
50
52
  const defaultColumnOptions = {
51
53
  draggable: false,
52
- lockable: false
54
+ lockable: false,
55
+ editable: false
53
56
  };
54
57
  const dynamic_option_names = ['selected', 'loading', 'limit', 'skip'];
55
58
  /* -------------------------------------------------------------------------- */
@@ -294,10 +297,7 @@ function ApplyColumnData(props) {
294
297
  const r = get_col_name(editableColumns[index]);
295
298
  const mcol = final_columns.find(s => get_col_name(s) === r);
296
299
  if (mcol) {
297
- // mcol.editor = editorWrapper;
298
- // mcol.editorOptions = {
299
- // editOnClick: true,
300
- // };
300
+ mcol.editable = true;
301
301
  }
302
302
  }
303
303
  }
@@ -310,16 +310,18 @@ function ApplyColumnData(props) {
310
310
  //@ts-ignore
311
311
  col.editor = _SelectEditor.default;
312
312
  break;
313
- //case 'number':
314
- //case 'numberic':
315
- // col.editor = NumericEditor;
316
- // break;
317
- //case 'truefalse':
318
- //case 'bool':
319
- // col.editor = BoolEditor;
320
- // break;
313
+ case 'number':
314
+ case 'numberic':
315
+ //@ts-ignore
316
+ col.editor = _NumericEditor.default;
317
+ break;
318
+ case 'truefalse':
319
+ case 'bool':
320
+ //@ts-ignore
321
+ col.editor = _BoolEditor.default;
322
+ break;
321
323
  }
322
-
324
+ if (col.editable != false) col.editable = true;
323
325
  delete col.type;
324
326
  }
325
327
  //@ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -65,14 +65,15 @@ type customColumnData = {
65
65
  type GridOptions = Partial<TypeDataGridProps>;
66
66
  /* -------------------------------------------------------------------------- */
67
67
  export type AzGridProps = {
68
- columns?: columnOrString[];
69
68
  dataSource?: any[] | ((args: any) => any[] | Promise<any[] | any>);
70
69
 
71
70
  licenseKey?: string;
72
71
 
73
72
  gridOptions?: GridOptions;
74
73
 
75
- columnExtensions?: Array<{ name: string } & Partial<ColumnDefinition>>;
74
+ columns?: columnOrString[];
75
+ columnExtensions?: Array<{ name: string } & Partial<LooseColumnDefinition>>;
76
+
76
77
  editableColumns?: string[];
77
78
  leftColumns?: string[];
78
79
  rightColumns?: string[];
@@ -143,6 +144,7 @@ const forcedOptions: GridOptions = {
143
144
  const defaultColumnOptions: ColumnDefinition = {
144
145
  draggable: false,
145
146
  lockable: false,
147
+ editable: false,
146
148
  };
147
149
  const dynamic_option_names = ['selected', 'loading', 'limit', 'skip'];
148
150
  /* -------------------------------------------------------------------------- */
@@ -427,16 +429,12 @@ function ApplyColumnData(props: any): ColumnDefinition[] {
427
429
  const r = get_col_name(editableColumns[index]);
428
430
  const mcol = final_columns.find((s) => get_col_name(s) === r);
429
431
  if (mcol) {
430
- // mcol.editor = editorWrapper;
431
- // mcol.editorOptions = {
432
- // editOnClick: true,
433
- // };
432
+ mcol.editable = true;
434
433
  }
435
434
  }
436
435
  }
437
436
  for (let index = 0; index < final_columns.length; index++) {
438
437
  const col = final_columns[index];
439
-
440
438
  if (col.type) {
441
439
  switch (col.type) {
442
440
  case 'combo':
@@ -444,15 +442,18 @@ function ApplyColumnData(props: any): ColumnDefinition[] {
444
442
  //@ts-ignore
445
443
  col.editor = SelectEditor;
446
444
  break;
447
- //case 'number':
448
- //case 'numberic':
449
- // col.editor = NumericEditor;
450
- // break;
451
- //case 'truefalse':
452
- //case 'bool':
453
- // col.editor = BoolEditor;
454
- // break;
445
+ case 'number':
446
+ case 'numberic':
447
+ //@ts-ignore
448
+ col.editor = NumericEditor;
449
+ break;
450
+ case 'truefalse':
451
+ case 'bool':
452
+ //@ts-ignore
453
+ col.editor = BoolEditor;
454
+ break;
455
455
  }
456
+ if (col.editable != false) col.editable = true;
456
457
  delete col.type;
457
458
  }
458
459
  //@ts-ignore