@zeedhi/common 1.93.0 → 1.93.2

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.
@@ -5928,18 +5928,21 @@ class Grid extends Iterable {
5928
5928
  allSelected: false,
5929
5929
  except: [],
5930
5930
  };
5931
+ this.cellSelection = false;
5932
+ this.currentColumn = null;
5933
+ this.viewNavigate = null;
5931
5934
  this.navigationKeyMapping = {
5932
5935
  up: {
5933
5936
  event: this.navigateUp.bind(this),
5934
- stop: true,
5935
- index: 99,
5936
5937
  active: true,
5938
+ index: 99,
5939
+ repeat: true,
5937
5940
  },
5938
5941
  down: {
5939
5942
  event: this.navigateDown.bind(this),
5940
- stop: true,
5941
- index: 99,
5942
5943
  active: true,
5944
+ index: 99,
5945
+ repeat: true,
5943
5946
  },
5944
5947
  pageup: {
5945
5948
  event: this.navigatePageUp.bind(this),
@@ -5953,6 +5956,48 @@ class Grid extends Iterable {
5953
5956
  index: 99,
5954
5957
  active: true,
5955
5958
  },
5959
+ left: {
5960
+ event: this.navigateLeft.bind(this),
5961
+ active: true,
5962
+ index: 99,
5963
+ repeat: true,
5964
+ },
5965
+ right: {
5966
+ event: this.navigateRight.bind(this),
5967
+ active: true,
5968
+ index: 99,
5969
+ repeat: true,
5970
+ },
5971
+ tab: {
5972
+ event: this.navigateRight.bind(this),
5973
+ prevent: true,
5974
+ active: true,
5975
+ index: 99,
5976
+ input: true,
5977
+ repeat: true,
5978
+ },
5979
+ 'shift+tab': {
5980
+ event: this.navigateLeft.bind(this),
5981
+ prevent: true,
5982
+ active: true,
5983
+ index: 99,
5984
+ input: true,
5985
+ repeat: true,
5986
+ },
5987
+ enter: {
5988
+ event: this.navigateDown.bind(this),
5989
+ active: true,
5990
+ index: 99,
5991
+ input: true,
5992
+ repeat: true,
5993
+ },
5994
+ 'shift+enter': {
5995
+ event: this.navigateUp.bind(this),
5996
+ active: true,
5997
+ index: 99,
5998
+ input: true,
5999
+ repeat: true,
6000
+ },
5956
6001
  };
5957
6002
  this.dense = this.getInitValue('dense', props.dense, this.dense);
5958
6003
  this.dark = this.getInitValue('dark', props.dark, this.dark);
@@ -5987,15 +6032,31 @@ class Grid extends Iterable {
5987
6032
  this.disableSelection = this.getInitValue('disableSelection', props.disableSelection, this.disableSelection);
5988
6033
  this.showSelectAll = this.getInitValue('showSelectAll', props.showSelectAll, this.showSelectAll);
5989
6034
  this.selectAllPages = this.getInitValue('selectAllPages', props.selectAllPages, this.selectAllPages);
6035
+ this.cellSelection = this.getInitValue('cellSelection', props.cellSelection, this.cellSelection);
5990
6036
  this.createAccessors();
5991
6037
  }
6038
+ setViewNavigate(viewNavigate) {
6039
+ this.viewNavigate = viewNavigate;
6040
+ }
6041
+ /**
6042
+ * Filters keyMap to allow user to overwrite the default navigation keyMapping
6043
+ */
6044
+ filterKeyMapping() {
6045
+ return Object.keys(this.navigationKeyMapping)
6046
+ .reduce((result, key) => {
6047
+ if (!(key in this.keyMap)) {
6048
+ result[key] = this.navigationKeyMapping[key];
6049
+ }
6050
+ return result;
6051
+ }, {});
6052
+ }
5992
6053
  onMounted(element) {
5993
6054
  super.onMounted(element);
5994
- KeyMap.bind(this.navigationKeyMapping, this, element);
6055
+ KeyMap.bind(this.filterKeyMapping(), this, element);
5995
6056
  }
5996
6057
  onBeforeDestroy() {
5997
6058
  super.onBeforeDestroy();
5998
- KeyMap.unbind(this.navigationKeyMapping, this);
6059
+ KeyMap.unbind(this.filterKeyMapping(), this);
5999
6060
  }
6000
6061
  /**
6001
6062
  * Get Grid columns objects
@@ -6055,10 +6116,16 @@ class Grid extends Iterable {
6055
6116
  * @param element DOM Element
6056
6117
  */
6057
6118
  cellClick(row, column, event, element) {
6119
+ if (this.cellSelection)
6120
+ this.currentColumn = column;
6058
6121
  this.preventRowClick = this.callEvent('cellClick', {
6059
6122
  event, element, row, column, component: this,
6060
6123
  });
6061
6124
  }
6125
+ selectCell(row, column) {
6126
+ this.datasource.currentRow = row;
6127
+ this.currentColumn = column;
6128
+ }
6062
6129
  /**
6063
6130
  * Dispatches select/unselect event
6064
6131
  * @param row Grid row
@@ -6162,31 +6229,51 @@ class Grid extends Iterable {
6162
6229
  arrSelection.splice(index, 1);
6163
6230
  }
6164
6231
  }
6232
+ navigateLeft() {
6233
+ if (!this.viewNavigate)
6234
+ return;
6235
+ this.viewNavigate('left');
6236
+ }
6237
+ navigateRight() {
6238
+ if (!this.viewNavigate)
6239
+ return;
6240
+ this.viewNavigate('right');
6241
+ }
6165
6242
  navigateUp() {
6243
+ if (this.cellSelection && this.viewNavigate) {
6244
+ this.viewNavigate('up');
6245
+ return;
6246
+ }
6166
6247
  const { uniqueKey, currentRow } = this.datasource;
6167
6248
  const rowIndex = this.datasource.data.findIndex((row) => row[uniqueKey] === currentRow[uniqueKey]);
6168
6249
  if (rowIndex === -1) {
6169
6250
  this.datasource.currentRow = this.datasource.data[this.datasource.data.length - 1];
6251
+ [this.currentColumn] = this.columns;
6252
+ return;
6170
6253
  }
6171
- else if (rowIndex > 0) {
6172
- this.datasource.currentRow = this.datasource.data[rowIndex - 1];
6173
- }
6174
- else {
6254
+ if (rowIndex === 0) {
6175
6255
  this.navigatePageDown();
6256
+ return;
6176
6257
  }
6258
+ this.datasource.currentRow = this.datasource.data[rowIndex - 1];
6177
6259
  }
6178
6260
  navigateDown() {
6261
+ if (this.cellSelection && this.viewNavigate) {
6262
+ this.viewNavigate('down');
6263
+ return;
6264
+ }
6179
6265
  const { uniqueKey, currentRow } = this.datasource;
6180
6266
  const rowIndex = this.datasource.data.findIndex((row) => row[uniqueKey] === currentRow[uniqueKey]);
6181
6267
  if (rowIndex === -1) {
6182
6268
  [this.datasource.currentRow] = this.datasource.data;
6269
+ [this.currentColumn] = this.columns;
6270
+ return;
6183
6271
  }
6184
- else if (rowIndex < this.datasource.data.length - 1) {
6185
- this.datasource.currentRow = this.datasource.data[rowIndex + 1];
6186
- }
6187
- else {
6272
+ if (rowIndex === this.datasource.data.length - 1) {
6188
6273
  this.navigatePageUp();
6274
+ return;
6189
6275
  }
6276
+ this.datasource.currentRow = this.datasource.data[rowIndex + 1];
6190
6277
  }
6191
6278
  navigatePageUp() {
6192
6279
  if (this.datasource.page < Math.ceil(this.datasource.total / this.datasource.limit)) {
@@ -6415,26 +6502,34 @@ class GridEditable extends Grid {
6415
6502
  this.preventRowClick = false;
6416
6503
  }
6417
6504
  /**
6418
- * Enables editing mode if column is editable
6505
+ * Dispatches cellClick event
6419
6506
  * @param row Grid row
6420
6507
  * @param column Grid column
6421
6508
  * @param event DOM event
6422
6509
  * @param element DOM Element
6423
6510
  */
6424
6511
  cellClick(row, column, event, element, canEdit = true) {
6425
- if (this.editing)
6426
- return;
6427
6512
  if (column.editable && canEdit) {
6428
- this.editing = true;
6429
6513
  this.preventRowClick = true;
6430
6514
  this.datasource.currentRow = row;
6431
- this.callEvent('inlineEdit', {
6432
- event, element, row, column, component: this,
6433
- });
6515
+ this.inlineEdit(row, column, event, element);
6434
6516
  return;
6435
6517
  }
6436
6518
  this.cellClickEvent(row, column, event, element);
6437
6519
  }
6520
+ /**
6521
+ * Enables editing mode
6522
+ * @param row Grid row
6523
+ * @param column Grid column
6524
+ * @param event DOM event
6525
+ * @param element DOM Element
6526
+ */
6527
+ inlineEdit(row, column, event, element) {
6528
+ this.editing = true;
6529
+ this.callEvent('inlineEdit', {
6530
+ event, element, row, column, component: this,
6531
+ });
6532
+ }
6438
6533
  cellClickEvent(row, column, event, element) {
6439
6534
  this.preventRowClick = this.callEvent('cellClick', {
6440
6535
  event, element, row, column, component: this,
@@ -12711,6 +12806,10 @@ class TreeGrid extends Grid {
12711
12806
  * Navigate upwards
12712
12807
  */
12713
12808
  navigateUp() {
12809
+ if (this.cellSelection && this.viewNavigate) {
12810
+ this.viewNavigate('up');
12811
+ return;
12812
+ }
12714
12813
  const { uniqueKey, currentRow } = this.datasource;
12715
12814
  const rowIndex = this.treeDataStructure.findDataIndex(this.datasource.data, currentRow[uniqueKey]);
12716
12815
  if (rowIndex === -1) {
@@ -12728,6 +12827,10 @@ class TreeGrid extends Grid {
12728
12827
  * Navigate downwards
12729
12828
  */
12730
12829
  navigateDown() {
12830
+ if (this.cellSelection && this.viewNavigate) {
12831
+ this.viewNavigate('down');
12832
+ return;
12833
+ }
12731
12834
  const { uniqueKey, currentRow } = this.datasource;
12732
12835
  const rowIndex = this.treeDataStructure.findDataIndex(this.datasource.data, currentRow[uniqueKey]);
12733
12836
  if (rowIndex === -1) {
@@ -12937,16 +13040,26 @@ class TreeGridEditable extends TreeGrid {
12937
13040
  if (this.editing)
12938
13041
  return;
12939
13042
  if (column.editable && canEdit) {
12940
- this.editing = true;
12941
13043
  this.preventRowClick = true;
12942
13044
  this.datasource.currentRow = row;
12943
- this.callEvent('inlineEdit', {
12944
- event, element, row, column, component: this,
12945
- });
13045
+ this.inlineEdit(row, column, event, element);
12946
13046
  return;
12947
13047
  }
12948
13048
  this.cellClickEvent(row, column, event, element);
12949
13049
  }
13050
+ /**
13051
+ * Enables editing mode
13052
+ * @param row Grid row
13053
+ * @param column Grid column
13054
+ * @param event DOM event
13055
+ * @param element DOM Element
13056
+ */
13057
+ inlineEdit(row, column, event, element) {
13058
+ this.editing = true;
13059
+ this.callEvent('inlineEdit', {
13060
+ event, element, row, column, component: this,
13061
+ });
13062
+ }
12950
13063
  cellClickEvent(row, column, event, element) {
12951
13064
  this.preventRowClick = this.callEvent('cellClick', {
12952
13065
  event, element, row, column, component: this,
@@ -5935,18 +5935,21 @@
5935
5935
  allSelected: false,
5936
5936
  except: [],
5937
5937
  };
5938
+ this.cellSelection = false;
5939
+ this.currentColumn = null;
5940
+ this.viewNavigate = null;
5938
5941
  this.navigationKeyMapping = {
5939
5942
  up: {
5940
5943
  event: this.navigateUp.bind(this),
5941
- stop: true,
5942
- index: 99,
5943
5944
  active: true,
5945
+ index: 99,
5946
+ repeat: true,
5944
5947
  },
5945
5948
  down: {
5946
5949
  event: this.navigateDown.bind(this),
5947
- stop: true,
5948
- index: 99,
5949
5950
  active: true,
5951
+ index: 99,
5952
+ repeat: true,
5950
5953
  },
5951
5954
  pageup: {
5952
5955
  event: this.navigatePageUp.bind(this),
@@ -5960,6 +5963,48 @@
5960
5963
  index: 99,
5961
5964
  active: true,
5962
5965
  },
5966
+ left: {
5967
+ event: this.navigateLeft.bind(this),
5968
+ active: true,
5969
+ index: 99,
5970
+ repeat: true,
5971
+ },
5972
+ right: {
5973
+ event: this.navigateRight.bind(this),
5974
+ active: true,
5975
+ index: 99,
5976
+ repeat: true,
5977
+ },
5978
+ tab: {
5979
+ event: this.navigateRight.bind(this),
5980
+ prevent: true,
5981
+ active: true,
5982
+ index: 99,
5983
+ input: true,
5984
+ repeat: true,
5985
+ },
5986
+ 'shift+tab': {
5987
+ event: this.navigateLeft.bind(this),
5988
+ prevent: true,
5989
+ active: true,
5990
+ index: 99,
5991
+ input: true,
5992
+ repeat: true,
5993
+ },
5994
+ enter: {
5995
+ event: this.navigateDown.bind(this),
5996
+ active: true,
5997
+ index: 99,
5998
+ input: true,
5999
+ repeat: true,
6000
+ },
6001
+ 'shift+enter': {
6002
+ event: this.navigateUp.bind(this),
6003
+ active: true,
6004
+ index: 99,
6005
+ input: true,
6006
+ repeat: true,
6007
+ },
5963
6008
  };
5964
6009
  this.dense = this.getInitValue('dense', props.dense, this.dense);
5965
6010
  this.dark = this.getInitValue('dark', props.dark, this.dark);
@@ -5994,15 +6039,31 @@
5994
6039
  this.disableSelection = this.getInitValue('disableSelection', props.disableSelection, this.disableSelection);
5995
6040
  this.showSelectAll = this.getInitValue('showSelectAll', props.showSelectAll, this.showSelectAll);
5996
6041
  this.selectAllPages = this.getInitValue('selectAllPages', props.selectAllPages, this.selectAllPages);
6042
+ this.cellSelection = this.getInitValue('cellSelection', props.cellSelection, this.cellSelection);
5997
6043
  this.createAccessors();
5998
6044
  }
6045
+ setViewNavigate(viewNavigate) {
6046
+ this.viewNavigate = viewNavigate;
6047
+ }
6048
+ /**
6049
+ * Filters keyMap to allow user to overwrite the default navigation keyMapping
6050
+ */
6051
+ filterKeyMapping() {
6052
+ return Object.keys(this.navigationKeyMapping)
6053
+ .reduce((result, key) => {
6054
+ if (!(key in this.keyMap)) {
6055
+ result[key] = this.navigationKeyMapping[key];
6056
+ }
6057
+ return result;
6058
+ }, {});
6059
+ }
5999
6060
  onMounted(element) {
6000
6061
  super.onMounted(element);
6001
- core.KeyMap.bind(this.navigationKeyMapping, this, element);
6062
+ core.KeyMap.bind(this.filterKeyMapping(), this, element);
6002
6063
  }
6003
6064
  onBeforeDestroy() {
6004
6065
  super.onBeforeDestroy();
6005
- core.KeyMap.unbind(this.navigationKeyMapping, this);
6066
+ core.KeyMap.unbind(this.filterKeyMapping(), this);
6006
6067
  }
6007
6068
  /**
6008
6069
  * Get Grid columns objects
@@ -6062,10 +6123,16 @@
6062
6123
  * @param element DOM Element
6063
6124
  */
6064
6125
  cellClick(row, column, event, element) {
6126
+ if (this.cellSelection)
6127
+ this.currentColumn = column;
6065
6128
  this.preventRowClick = this.callEvent('cellClick', {
6066
6129
  event, element, row, column, component: this,
6067
6130
  });
6068
6131
  }
6132
+ selectCell(row, column) {
6133
+ this.datasource.currentRow = row;
6134
+ this.currentColumn = column;
6135
+ }
6069
6136
  /**
6070
6137
  * Dispatches select/unselect event
6071
6138
  * @param row Grid row
@@ -6169,31 +6236,51 @@
6169
6236
  arrSelection.splice(index, 1);
6170
6237
  }
6171
6238
  }
6239
+ navigateLeft() {
6240
+ if (!this.viewNavigate)
6241
+ return;
6242
+ this.viewNavigate('left');
6243
+ }
6244
+ navigateRight() {
6245
+ if (!this.viewNavigate)
6246
+ return;
6247
+ this.viewNavigate('right');
6248
+ }
6172
6249
  navigateUp() {
6250
+ if (this.cellSelection && this.viewNavigate) {
6251
+ this.viewNavigate('up');
6252
+ return;
6253
+ }
6173
6254
  const { uniqueKey, currentRow } = this.datasource;
6174
6255
  const rowIndex = this.datasource.data.findIndex((row) => row[uniqueKey] === currentRow[uniqueKey]);
6175
6256
  if (rowIndex === -1) {
6176
6257
  this.datasource.currentRow = this.datasource.data[this.datasource.data.length - 1];
6258
+ [this.currentColumn] = this.columns;
6259
+ return;
6177
6260
  }
6178
- else if (rowIndex > 0) {
6179
- this.datasource.currentRow = this.datasource.data[rowIndex - 1];
6180
- }
6181
- else {
6261
+ if (rowIndex === 0) {
6182
6262
  this.navigatePageDown();
6263
+ return;
6183
6264
  }
6265
+ this.datasource.currentRow = this.datasource.data[rowIndex - 1];
6184
6266
  }
6185
6267
  navigateDown() {
6268
+ if (this.cellSelection && this.viewNavigate) {
6269
+ this.viewNavigate('down');
6270
+ return;
6271
+ }
6186
6272
  const { uniqueKey, currentRow } = this.datasource;
6187
6273
  const rowIndex = this.datasource.data.findIndex((row) => row[uniqueKey] === currentRow[uniqueKey]);
6188
6274
  if (rowIndex === -1) {
6189
6275
  [this.datasource.currentRow] = this.datasource.data;
6276
+ [this.currentColumn] = this.columns;
6277
+ return;
6190
6278
  }
6191
- else if (rowIndex < this.datasource.data.length - 1) {
6192
- this.datasource.currentRow = this.datasource.data[rowIndex + 1];
6193
- }
6194
- else {
6279
+ if (rowIndex === this.datasource.data.length - 1) {
6195
6280
  this.navigatePageUp();
6281
+ return;
6196
6282
  }
6283
+ this.datasource.currentRow = this.datasource.data[rowIndex + 1];
6197
6284
  }
6198
6285
  navigatePageUp() {
6199
6286
  if (this.datasource.page < Math.ceil(this.datasource.total / this.datasource.limit)) {
@@ -6422,26 +6509,34 @@
6422
6509
  this.preventRowClick = false;
6423
6510
  }
6424
6511
  /**
6425
- * Enables editing mode if column is editable
6512
+ * Dispatches cellClick event
6426
6513
  * @param row Grid row
6427
6514
  * @param column Grid column
6428
6515
  * @param event DOM event
6429
6516
  * @param element DOM Element
6430
6517
  */
6431
6518
  cellClick(row, column, event, element, canEdit = true) {
6432
- if (this.editing)
6433
- return;
6434
6519
  if (column.editable && canEdit) {
6435
- this.editing = true;
6436
6520
  this.preventRowClick = true;
6437
6521
  this.datasource.currentRow = row;
6438
- this.callEvent('inlineEdit', {
6439
- event, element, row, column, component: this,
6440
- });
6522
+ this.inlineEdit(row, column, event, element);
6441
6523
  return;
6442
6524
  }
6443
6525
  this.cellClickEvent(row, column, event, element);
6444
6526
  }
6527
+ /**
6528
+ * Enables editing mode
6529
+ * @param row Grid row
6530
+ * @param column Grid column
6531
+ * @param event DOM event
6532
+ * @param element DOM Element
6533
+ */
6534
+ inlineEdit(row, column, event, element) {
6535
+ this.editing = true;
6536
+ this.callEvent('inlineEdit', {
6537
+ event, element, row, column, component: this,
6538
+ });
6539
+ }
6445
6540
  cellClickEvent(row, column, event, element) {
6446
6541
  this.preventRowClick = this.callEvent('cellClick', {
6447
6542
  event, element, row, column, component: this,
@@ -12718,6 +12813,10 @@
12718
12813
  * Navigate upwards
12719
12814
  */
12720
12815
  navigateUp() {
12816
+ if (this.cellSelection && this.viewNavigate) {
12817
+ this.viewNavigate('up');
12818
+ return;
12819
+ }
12721
12820
  const { uniqueKey, currentRow } = this.datasource;
12722
12821
  const rowIndex = this.treeDataStructure.findDataIndex(this.datasource.data, currentRow[uniqueKey]);
12723
12822
  if (rowIndex === -1) {
@@ -12735,6 +12834,10 @@
12735
12834
  * Navigate downwards
12736
12835
  */
12737
12836
  navigateDown() {
12837
+ if (this.cellSelection && this.viewNavigate) {
12838
+ this.viewNavigate('down');
12839
+ return;
12840
+ }
12738
12841
  const { uniqueKey, currentRow } = this.datasource;
12739
12842
  const rowIndex = this.treeDataStructure.findDataIndex(this.datasource.data, currentRow[uniqueKey]);
12740
12843
  if (rowIndex === -1) {
@@ -12944,16 +13047,26 @@
12944
13047
  if (this.editing)
12945
13048
  return;
12946
13049
  if (column.editable && canEdit) {
12947
- this.editing = true;
12948
13050
  this.preventRowClick = true;
12949
13051
  this.datasource.currentRow = row;
12950
- this.callEvent('inlineEdit', {
12951
- event, element, row, column, component: this,
12952
- });
13052
+ this.inlineEdit(row, column, event, element);
12953
13053
  return;
12954
13054
  }
12955
13055
  this.cellClickEvent(row, column, event, element);
12956
13056
  }
13057
+ /**
13058
+ * Enables editing mode
13059
+ * @param row Grid row
13060
+ * @param column Grid column
13061
+ * @param event DOM event
13062
+ * @param element DOM Element
13063
+ */
13064
+ inlineEdit(row, column, event, element) {
13065
+ this.editing = true;
13066
+ this.callEvent('inlineEdit', {
13067
+ event, element, row, column, component: this,
13068
+ });
13069
+ }
12957
13070
  cellClickEvent(row, column, event, element) {
12958
13071
  this.preventRowClick = this.callEvent('cellClick', {
12959
13072
  event, element, row, column, component: this,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/common",
3
- "version": "1.93.0",
3
+ "version": "1.93.2",
4
4
  "description": "Zeedhi Common",
5
5
  "author": "Zeedhi <zeedhi@teknisa.com>",
6
6
  "license": "ISC",
@@ -43,5 +43,5 @@
43
43
  "lodash.times": "4.3.*",
44
44
  "mockdate": "3.0.*"
45
45
  },
46
- "gitHead": "5c95235cbd27394eda8d5b240dbcf151f15cd8dc"
46
+ "gitHead": "67ffcff27bd3d14cdfae802257ecab437a38b9df"
47
47
  }
@@ -66,13 +66,21 @@ export declare class GridEditable extends Grid implements IGridEditable {
66
66
  */
67
67
  rowClick(row: IDictionary<any>, event: Event, element: any): void;
68
68
  /**
69
- * Enables editing mode if column is editable
69
+ * Dispatches cellClick event
70
70
  * @param row Grid row
71
71
  * @param column Grid column
72
72
  * @param event DOM event
73
73
  * @param element DOM Element
74
74
  */
75
75
  cellClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any, canEdit?: boolean): void;
76
+ /**
77
+ * Enables editing mode
78
+ * @param row Grid row
79
+ * @param column Grid column
80
+ * @param event DOM event
81
+ * @param element DOM Element
82
+ */
83
+ inlineEdit(row: IDictionary, column: GridColumnEditable, event: Event, element: any): void;
76
84
  cellClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any): void;
77
85
  /**
78
86
  * Dispatches select/unselect event
@@ -4,6 +4,7 @@ import { IComponent, IComponentRender } from '../zd-component/interfaces';
4
4
  import { Iterable } from '../zd-iterable/iterable';
5
5
  import { GridColumn } from './grid-column';
6
6
  import { IGrid, IGridColumn, IGridEvents } from './interfaces';
7
+ import { Column } from '../zd-iterable/column';
7
8
  /**
8
9
  * Base class for Grid component
9
10
  */
@@ -140,12 +141,20 @@ export declare class Grid extends Iterable implements IGrid {
140
141
  allSelected: boolean;
141
142
  except: IDictionary<any>[];
142
143
  };
144
+ cellSelection: boolean;
145
+ currentColumn: Column | null;
146
+ protected viewNavigate: ((direction: 'up' | 'down' | 'left' | 'right') => void) | null;
147
+ setViewNavigate(viewNavigate: (up: 'up' | 'down' | 'left' | 'right') => void): void;
143
148
  /**
144
149
  * Creates a new Grid.
145
150
  * @param props Grid properties
146
151
  */
147
152
  constructor(props: IGrid);
148
153
  protected navigationKeyMapping: IKeyMap;
154
+ /**
155
+ * Filters keyMap to allow user to overwrite the default navigation keyMapping
156
+ */
157
+ private filterKeyMapping;
149
158
  onMounted(element: any): void;
150
159
  onBeforeDestroy(): void;
151
160
  /**
@@ -180,6 +189,7 @@ export declare class Grid extends Iterable implements IGrid {
180
189
  * @param element DOM Element
181
190
  */
182
191
  cellClick(row: IDictionary<any>, column: GridColumn, event: Event, element: any): void;
192
+ selectCell(row: IDictionary, column: GridColumn): void;
183
193
  /**
184
194
  * Dispatches select/unselect event
185
195
  * @param row Grid row
@@ -198,10 +208,12 @@ export declare class Grid extends Iterable implements IGrid {
198
208
  selectAll(isSelected: boolean): void;
199
209
  toggleRow(row: IDictionary): void;
200
210
  selectRow(row: IDictionary, select: boolean): void;
201
- protected navigateUp(): void;
202
- protected navigateDown(): void;
203
- protected navigatePageUp(): void;
204
- protected navigatePageDown(): void;
211
+ navigateLeft(): void;
212
+ navigateRight(): void;
213
+ navigateUp(): void;
214
+ navigateDown(): void;
215
+ navigatePageUp(): void;
216
+ navigatePageDown(): void;
205
217
  deleteRows(): Promise<any[]>;
206
218
  protected getActionProps(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath: string): {
207
219
  props: IComponent;
@@ -50,6 +50,7 @@ export interface IGrid extends IIterable {
50
50
  }) => boolean;
51
51
  showSelectAll?: boolean;
52
52
  selectAllPages?: boolean;
53
+ cellSelection?: boolean;
53
54
  }
54
55
  export interface IGridColumn extends IColumn {
55
56
  children?: IChildrenActionColumn[];
@@ -64,6 +64,14 @@ export declare class TreeGridEditable extends TreeGrid implements ITreeGridEdita
64
64
  * @param element DOM Element
65
65
  */
66
66
  cellClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any, canEdit?: boolean): void;
67
+ /**
68
+ * Enables editing mode
69
+ * @param row Grid row
70
+ * @param column Grid column
71
+ * @param event DOM event
72
+ * @param element DOM Element
73
+ */
74
+ inlineEdit(row: IDictionary, column: GridColumnEditable, event: Event, element: any): void;
67
75
  cellClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any): void;
68
76
  /**
69
77
  * Dispatches select/unselect event
@@ -83,15 +83,15 @@ export declare class TreeGrid extends Grid implements ITreeGrid {
83
83
  * Toggle expand/collapse using navigation keys
84
84
  * @param collapse Should collapse
85
85
  */
86
- private navigateToggle;
86
+ navigateToggle(collapse: boolean): void;
87
87
  /**
88
88
  * Navigate upwards
89
89
  */
90
- protected navigateUp(): void;
90
+ navigateUp(): void;
91
91
  /**
92
92
  * Navigate downwards
93
93
  */
94
- protected navigateDown(): void;
94
+ navigateDown(): void;
95
95
  private removeDuplicates;
96
96
  /**
97
97
  * Select/deselect rows