@zeedhi/common 1.99.0 → 1.100.1

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.
@@ -1889,6 +1889,10 @@ class Input extends ComponentRender {
1889
1889
  * Input validations.
1890
1890
  */
1891
1891
  this.validations = {};
1892
+ /**
1893
+ * Defines if the input should be automatically registered in the closest parent Form
1894
+ */
1895
+ this.autoRegister = true;
1892
1896
  /**
1893
1897
  * Parsed field rules.
1894
1898
  */
@@ -1924,8 +1928,9 @@ class Input extends ComponentRender {
1924
1928
  this.storePath = this.getInitValue('storePath', props.storePath, this.storePath);
1925
1929
  this.value = this.getInitValue('value', props.value, this.value);
1926
1930
  this.validations = this.getInitValue('validations', props.validations, this.validations);
1931
+ this.autoRegister = this.getInitValue('autoRegister', props.autoRegister, this.autoRegister);
1927
1932
  this.parseValidations(props.validations || {});
1928
- if (this.formParent) {
1933
+ if (this.autoRegister && this.formParent) {
1929
1934
  this.formParent.registerInput(this);
1930
1935
  }
1931
1936
  this.createAccessors();
@@ -4107,6 +4112,11 @@ class Date$1 extends TextInput {
4107
4112
  this.showDatePicker = false;
4108
4113
  }
4109
4114
  }
4115
+ onMounted() {
4116
+ if (this.value) {
4117
+ this.setDateValue(this.formatter(this.value));
4118
+ }
4119
+ }
4110
4120
  focus(event, element) {
4111
4121
  this.addDateMask();
4112
4122
  super.focus(event, element);
@@ -5811,7 +5821,7 @@ class GridColumn extends Column {
5811
5821
  FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, row, componentProps, }) => {
5812
5822
  if (value === null || value === undefined)
5813
5823
  return '';
5814
- const { dataText, formatterDataText, dataTextSeparator, dataValue, } = componentProps;
5824
+ const { dataText, formatterDataText, dataTextSeparator, dataValue, dataTextDiscrete, } = componentProps;
5815
5825
  let currentRow = row;
5816
5826
  if (dataValue) {
5817
5827
  const dataTextColumns = Array.isArray(dataText) ? dataText : [dataText];
@@ -5832,7 +5842,7 @@ FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, r
5832
5842
  }
5833
5843
  if (!Object.keys(currentRow).length)
5834
5844
  return typeof value === 'object' ? '' : value;
5835
- const textColumn = formatterDataText || dataText;
5845
+ const textColumn = formatterDataText || dataTextDiscrete || dataText;
5836
5846
  if (!textColumn)
5837
5847
  return value;
5838
5848
  if (typeof textColumn === 'string') {
@@ -6019,6 +6029,7 @@ class Grid extends Iterable {
6019
6029
  * @public
6020
6030
  */
6021
6031
  this.preventRowClick = false;
6032
+ this.preventRowDoubleClick = false;
6022
6033
  /**
6023
6034
  * Enables column dragging
6024
6035
  * @public
@@ -6228,6 +6239,9 @@ class Grid extends Iterable {
6228
6239
  this.preventRowClick = this.callEvent('cellClick', {
6229
6240
  event, element, row, column, component: this,
6230
6241
  });
6242
+ this.preventRowDoubleClick = this.callEvent('cellClick', {
6243
+ event, element, row, column, component: this,
6244
+ });
6231
6245
  }
6232
6246
  selectCell(row, column) {
6233
6247
  this.datasource.currentRow = row;
@@ -6424,6 +6438,7 @@ class Grid extends Iterable {
6424
6438
  props.children = newChildren;
6425
6439
  props.name = instanceName;
6426
6440
  props.allowDuplicate = true;
6441
+ props.autoRegister = false;
6427
6442
  let instance = null;
6428
6443
  try {
6429
6444
  instance = this.updateActionInstance(instanceName, props);
@@ -6446,8 +6461,15 @@ class Grid extends Iterable {
6446
6461
  }
6447
6462
  return { props, instance };
6448
6463
  }
6464
+ filterObject(obj, callback) {
6465
+ return Object.fromEntries(Object.entries(obj).filter(([key, value]) => callback(key, value)));
6466
+ }
6467
+ deleteAccessorProps(newComponent) {
6468
+ const filteredProps = this.filterObject(newComponent, (_key, value) => !Accessor.isAccessorDefinition(value));
6469
+ return filteredProps;
6470
+ }
6449
6471
  updateActionInstance(instanceName, newComponent) {
6450
- const updatedComponent = Object.assign({}, newComponent);
6472
+ const updatedComponent = this.deleteAccessorProps(newComponent);
6451
6473
  delete updatedComponent.datasource;
6452
6474
  delete updatedComponent.events;
6453
6475
  const instance = Metadata.updateInstance(instanceName, updatedComponent);
@@ -6638,6 +6660,22 @@ class GridEditable extends Grid {
6638
6660
  }
6639
6661
  this.cellClickEvent(row, column, event, element);
6640
6662
  }
6663
+ /**
6664
+ * Dispatches cellDoubleClick event
6665
+ * @param row Grid row
6666
+ * @param column Grid column
6667
+ * @param event DOM event
6668
+ * @param element DOM Element
6669
+ */
6670
+ cellDoubleClick(row, column, event, element, canEdit = true) {
6671
+ if (column.editable && canEdit) {
6672
+ this.preventRowDoubleClick = true;
6673
+ this.datasource.currentRow = row;
6674
+ this.inlineEdit(row, column, event, element);
6675
+ return;
6676
+ }
6677
+ this.cellDoubleClickEvent(row, column, event, element);
6678
+ }
6641
6679
  /**
6642
6680
  * Enables editing mode
6643
6681
  * @param row Grid row
@@ -6658,6 +6696,11 @@ class GridEditable extends Grid {
6658
6696
  event, element, row, column, component: this,
6659
6697
  });
6660
6698
  }
6699
+ cellDoubleClickEvent(row, column, event, element) {
6700
+ this.preventRowDoubleClick = this.callEvent('cellDoubleClick', {
6701
+ event, element, row, column, component: this,
6702
+ });
6703
+ }
6661
6704
  /**
6662
6705
  * Dispatches select/unselect event
6663
6706
  * @param row Grid row
@@ -6743,32 +6786,39 @@ class GridEditable extends Grid {
6743
6786
  }
6744
6787
  } });
6745
6788
  this.updateOriginalRow(key, row);
6746
- return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true });
6789
+ return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true, autoRegister: false });
6747
6790
  }
6791
+ /**
6792
+ * Pushes lookup values into the column's datasource
6793
+ * If the row[column.name] has a selected value, pushes it
6794
+ */
6748
6795
  checkLookupData(column, row, componentProps) {
6749
- if (row[column.name] && column.lookupData && componentProps.datasource) {
6750
- componentProps.datasource.data = componentProps.datasource.data || [];
6751
- const colValue = row[column.name];
6752
- if (Array.isArray(colValue)) {
6753
- colValue.forEach((item) => {
6754
- const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
6755
- if (column.lookupData[value]) {
6756
- componentProps.datasource.data.push(column.lookupData[value]);
6757
- }
6758
- });
6759
- return;
6760
- }
6761
- if (colValue && typeof colValue === 'object'
6762
- && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
6763
- const value = colValue[componentProps.dataValue];
6796
+ if (!row[column.name] || !column.lookupData || !componentProps.datasource)
6797
+ return;
6798
+ componentProps.datasource.data = componentProps.datasource.data || [];
6799
+ // prevent pushing lookup values when using accessor in data
6800
+ if (!Array.isArray(componentProps.datasource.data))
6801
+ return;
6802
+ const colValue = row[column.name];
6803
+ if (Array.isArray(colValue)) {
6804
+ colValue.forEach((item) => {
6805
+ const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
6764
6806
  if (column.lookupData[value]) {
6765
6807
  componentProps.datasource.data.push(column.lookupData[value]);
6766
6808
  }
6767
- return;
6768
- }
6769
- if (column.lookupData[colValue]) {
6770
- componentProps.datasource.data.push(column.lookupData[colValue]);
6809
+ });
6810
+ return;
6811
+ }
6812
+ if (colValue && typeof colValue === 'object'
6813
+ && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
6814
+ const value = colValue[componentProps.dataValue];
6815
+ if (column.lookupData[value]) {
6816
+ componentProps.datasource.data.push(column.lookupData[value]);
6771
6817
  }
6818
+ return;
6819
+ }
6820
+ if (column.lookupData[colValue]) {
6821
+ componentProps.datasource.data.push(column.lookupData[colValue]);
6772
6822
  }
6773
6823
  }
6774
6824
  checkCompValidity(component) {
@@ -8044,8 +8094,10 @@ class BaseReport {
8044
8094
  description: col.label,
8045
8095
  sequence: index,
8046
8096
  size: `${size}%`,
8047
- xlsType: col.xlsType,
8048
8097
  };
8098
+ if (col.xlsType) {
8099
+ row.xlsType = col.xlsType;
8100
+ }
8049
8101
  return Object.assign(Object.assign({}, result), { [col.name]: row });
8050
8102
  }, {});
8051
8103
  }
@@ -14764,36 +14816,43 @@ class TreeGridEditable extends TreeGrid {
14764
14816
  }
14765
14817
  } });
14766
14818
  this.updateOriginalRow(key, row);
14767
- return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true });
14819
+ return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true, autoRegister: false });
14768
14820
  }
14769
14821
  updateOriginalRow(key, row) {
14770
14822
  if (this.editedRows[key] !== undefined)
14771
14823
  this.editedRows[key].originalRow = omit(row, 'originalRow');
14772
14824
  }
14825
+ /**
14826
+ * Pushes lookup values into the column's datasource
14827
+ * If the row[column.name] has a selected value, pushes it
14828
+ */
14773
14829
  checkLookupData(column, row, componentProps) {
14774
- if (row[column.name] && column.lookupData && componentProps.datasource) {
14775
- componentProps.datasource.data = componentProps.datasource.data || [];
14776
- const colValue = row[column.name];
14777
- if (Array.isArray(colValue)) {
14778
- colValue.forEach((item) => {
14779
- const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
14780
- if (column.lookupData[value]) {
14781
- componentProps.datasource.data.push(column.lookupData[value]);
14782
- }
14783
- });
14784
- return;
14785
- }
14786
- if (colValue && typeof colValue === 'object'
14787
- && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
14788
- const value = colValue[componentProps.dataValue];
14830
+ if (!row[column.name] || !column.lookupData || !componentProps.datasource)
14831
+ return;
14832
+ componentProps.datasource.data = componentProps.datasource.data || [];
14833
+ // prevent pushing lookup values when using accessor in data
14834
+ if (!Array.isArray(componentProps.datasource.data))
14835
+ return;
14836
+ const colValue = row[column.name];
14837
+ if (Array.isArray(colValue)) {
14838
+ colValue.forEach((item) => {
14839
+ const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
14789
14840
  if (column.lookupData[value]) {
14790
14841
  componentProps.datasource.data.push(column.lookupData[value]);
14791
14842
  }
14792
- return;
14793
- }
14794
- if (column.lookupData[colValue]) {
14795
- componentProps.datasource.data.push(column.lookupData[colValue]);
14843
+ });
14844
+ return;
14845
+ }
14846
+ if (colValue && typeof colValue === 'object'
14847
+ && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
14848
+ const value = colValue[componentProps.dataValue];
14849
+ if (column.lookupData[value]) {
14850
+ componentProps.datasource.data.push(column.lookupData[value]);
14796
14851
  }
14852
+ return;
14853
+ }
14854
+ if (column.lookupData[colValue]) {
14855
+ componentProps.datasource.data.push(column.lookupData[colValue]);
14797
14856
  }
14798
14857
  }
14799
14858
  checkCompValidity(component) {
@@ -1896,6 +1896,10 @@
1896
1896
  * Input validations.
1897
1897
  */
1898
1898
  this.validations = {};
1899
+ /**
1900
+ * Defines if the input should be automatically registered in the closest parent Form
1901
+ */
1902
+ this.autoRegister = true;
1899
1903
  /**
1900
1904
  * Parsed field rules.
1901
1905
  */
@@ -1931,8 +1935,9 @@
1931
1935
  this.storePath = this.getInitValue('storePath', props.storePath, this.storePath);
1932
1936
  this.value = this.getInitValue('value', props.value, this.value);
1933
1937
  this.validations = this.getInitValue('validations', props.validations, this.validations);
1938
+ this.autoRegister = this.getInitValue('autoRegister', props.autoRegister, this.autoRegister);
1934
1939
  this.parseValidations(props.validations || {});
1935
- if (this.formParent) {
1940
+ if (this.autoRegister && this.formParent) {
1936
1941
  this.formParent.registerInput(this);
1937
1942
  }
1938
1943
  this.createAccessors();
@@ -4114,6 +4119,11 @@
4114
4119
  this.showDatePicker = false;
4115
4120
  }
4116
4121
  }
4122
+ onMounted() {
4123
+ if (this.value) {
4124
+ this.setDateValue(this.formatter(this.value));
4125
+ }
4126
+ }
4117
4127
  focus(event, element) {
4118
4128
  this.addDateMask();
4119
4129
  super.focus(event, element);
@@ -5818,7 +5828,7 @@
5818
5828
  core.FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, row, componentProps, }) => {
5819
5829
  if (value === null || value === undefined)
5820
5830
  return '';
5821
- const { dataText, formatterDataText, dataTextSeparator, dataValue, } = componentProps;
5831
+ const { dataText, formatterDataText, dataTextSeparator, dataValue, dataTextDiscrete, } = componentProps;
5822
5832
  let currentRow = row;
5823
5833
  if (dataValue) {
5824
5834
  const dataTextColumns = Array.isArray(dataText) ? dataText : [dataText];
@@ -5839,7 +5849,7 @@
5839
5849
  }
5840
5850
  if (!Object.keys(currentRow).length)
5841
5851
  return typeof value === 'object' ? '' : value;
5842
- const textColumn = formatterDataText || dataText;
5852
+ const textColumn = formatterDataText || dataTextDiscrete || dataText;
5843
5853
  if (!textColumn)
5844
5854
  return value;
5845
5855
  if (typeof textColumn === 'string') {
@@ -6026,6 +6036,7 @@
6026
6036
  * @public
6027
6037
  */
6028
6038
  this.preventRowClick = false;
6039
+ this.preventRowDoubleClick = false;
6029
6040
  /**
6030
6041
  * Enables column dragging
6031
6042
  * @public
@@ -6235,6 +6246,9 @@
6235
6246
  this.preventRowClick = this.callEvent('cellClick', {
6236
6247
  event, element, row, column, component: this,
6237
6248
  });
6249
+ this.preventRowDoubleClick = this.callEvent('cellClick', {
6250
+ event, element, row, column, component: this,
6251
+ });
6238
6252
  }
6239
6253
  selectCell(row, column) {
6240
6254
  this.datasource.currentRow = row;
@@ -6431,6 +6445,7 @@
6431
6445
  props.children = newChildren;
6432
6446
  props.name = instanceName;
6433
6447
  props.allowDuplicate = true;
6448
+ props.autoRegister = false;
6434
6449
  let instance = null;
6435
6450
  try {
6436
6451
  instance = this.updateActionInstance(instanceName, props);
@@ -6453,8 +6468,15 @@
6453
6468
  }
6454
6469
  return { props, instance };
6455
6470
  }
6471
+ filterObject(obj, callback) {
6472
+ return Object.fromEntries(Object.entries(obj).filter(([key, value]) => callback(key, value)));
6473
+ }
6474
+ deleteAccessorProps(newComponent) {
6475
+ const filteredProps = this.filterObject(newComponent, (_key, value) => !core.Accessor.isAccessorDefinition(value));
6476
+ return filteredProps;
6477
+ }
6456
6478
  updateActionInstance(instanceName, newComponent) {
6457
- const updatedComponent = Object.assign({}, newComponent);
6479
+ const updatedComponent = this.deleteAccessorProps(newComponent);
6458
6480
  delete updatedComponent.datasource;
6459
6481
  delete updatedComponent.events;
6460
6482
  const instance = core.Metadata.updateInstance(instanceName, updatedComponent);
@@ -6645,6 +6667,22 @@
6645
6667
  }
6646
6668
  this.cellClickEvent(row, column, event, element);
6647
6669
  }
6670
+ /**
6671
+ * Dispatches cellDoubleClick event
6672
+ * @param row Grid row
6673
+ * @param column Grid column
6674
+ * @param event DOM event
6675
+ * @param element DOM Element
6676
+ */
6677
+ cellDoubleClick(row, column, event, element, canEdit = true) {
6678
+ if (column.editable && canEdit) {
6679
+ this.preventRowDoubleClick = true;
6680
+ this.datasource.currentRow = row;
6681
+ this.inlineEdit(row, column, event, element);
6682
+ return;
6683
+ }
6684
+ this.cellDoubleClickEvent(row, column, event, element);
6685
+ }
6648
6686
  /**
6649
6687
  * Enables editing mode
6650
6688
  * @param row Grid row
@@ -6665,6 +6703,11 @@
6665
6703
  event, element, row, column, component: this,
6666
6704
  });
6667
6705
  }
6706
+ cellDoubleClickEvent(row, column, event, element) {
6707
+ this.preventRowDoubleClick = this.callEvent('cellDoubleClick', {
6708
+ event, element, row, column, component: this,
6709
+ });
6710
+ }
6668
6711
  /**
6669
6712
  * Dispatches select/unselect event
6670
6713
  * @param row Grid row
@@ -6750,32 +6793,39 @@
6750
6793
  }
6751
6794
  } });
6752
6795
  this.updateOriginalRow(key, row);
6753
- return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true });
6796
+ return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true, autoRegister: false });
6754
6797
  }
6798
+ /**
6799
+ * Pushes lookup values into the column's datasource
6800
+ * If the row[column.name] has a selected value, pushes it
6801
+ */
6755
6802
  checkLookupData(column, row, componentProps) {
6756
- if (row[column.name] && column.lookupData && componentProps.datasource) {
6757
- componentProps.datasource.data = componentProps.datasource.data || [];
6758
- const colValue = row[column.name];
6759
- if (Array.isArray(colValue)) {
6760
- colValue.forEach((item) => {
6761
- const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
6762
- if (column.lookupData[value]) {
6763
- componentProps.datasource.data.push(column.lookupData[value]);
6764
- }
6765
- });
6766
- return;
6767
- }
6768
- if (colValue && typeof colValue === 'object'
6769
- && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
6770
- const value = colValue[componentProps.dataValue];
6803
+ if (!row[column.name] || !column.lookupData || !componentProps.datasource)
6804
+ return;
6805
+ componentProps.datasource.data = componentProps.datasource.data || [];
6806
+ // prevent pushing lookup values when using accessor in data
6807
+ if (!Array.isArray(componentProps.datasource.data))
6808
+ return;
6809
+ const colValue = row[column.name];
6810
+ if (Array.isArray(colValue)) {
6811
+ colValue.forEach((item) => {
6812
+ const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
6771
6813
  if (column.lookupData[value]) {
6772
6814
  componentProps.datasource.data.push(column.lookupData[value]);
6773
6815
  }
6774
- return;
6775
- }
6776
- if (column.lookupData[colValue]) {
6777
- componentProps.datasource.data.push(column.lookupData[colValue]);
6816
+ });
6817
+ return;
6818
+ }
6819
+ if (colValue && typeof colValue === 'object'
6820
+ && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
6821
+ const value = colValue[componentProps.dataValue];
6822
+ if (column.lookupData[value]) {
6823
+ componentProps.datasource.data.push(column.lookupData[value]);
6778
6824
  }
6825
+ return;
6826
+ }
6827
+ if (column.lookupData[colValue]) {
6828
+ componentProps.datasource.data.push(column.lookupData[colValue]);
6779
6829
  }
6780
6830
  }
6781
6831
  checkCompValidity(component) {
@@ -8051,8 +8101,10 @@
8051
8101
  description: col.label,
8052
8102
  sequence: index,
8053
8103
  size: `${size}%`,
8054
- xlsType: col.xlsType,
8055
8104
  };
8105
+ if (col.xlsType) {
8106
+ row.xlsType = col.xlsType;
8107
+ }
8056
8108
  return Object.assign(Object.assign({}, result), { [col.name]: row });
8057
8109
  }, {});
8058
8110
  }
@@ -14771,36 +14823,43 @@
14771
14823
  }
14772
14824
  } });
14773
14825
  this.updateOriginalRow(key, row);
14774
- return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true });
14826
+ return Object.assign(Object.assign({}, componentProps), { name: compName, parent: this, align: column.align, showLabel: false, showHelper: false, dense: true, value: colValue, events: newEvents, autofill: false, allowDuplicate: true, autoRegister: false });
14775
14827
  }
14776
14828
  updateOriginalRow(key, row) {
14777
14829
  if (this.editedRows[key] !== undefined)
14778
14830
  this.editedRows[key].originalRow = omit__default["default"](row, 'originalRow');
14779
14831
  }
14832
+ /**
14833
+ * Pushes lookup values into the column's datasource
14834
+ * If the row[column.name] has a selected value, pushes it
14835
+ */
14780
14836
  checkLookupData(column, row, componentProps) {
14781
- if (row[column.name] && column.lookupData && componentProps.datasource) {
14782
- componentProps.datasource.data = componentProps.datasource.data || [];
14783
- const colValue = row[column.name];
14784
- if (Array.isArray(colValue)) {
14785
- colValue.forEach((item) => {
14786
- const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
14787
- if (column.lookupData[value]) {
14788
- componentProps.datasource.data.push(column.lookupData[value]);
14789
- }
14790
- });
14791
- return;
14792
- }
14793
- if (colValue && typeof colValue === 'object'
14794
- && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
14795
- const value = colValue[componentProps.dataValue];
14837
+ if (!row[column.name] || !column.lookupData || !componentProps.datasource)
14838
+ return;
14839
+ componentProps.datasource.data = componentProps.datasource.data || [];
14840
+ // prevent pushing lookup values when using accessor in data
14841
+ if (!Array.isArray(componentProps.datasource.data))
14842
+ return;
14843
+ const colValue = row[column.name];
14844
+ if (Array.isArray(colValue)) {
14845
+ colValue.forEach((item) => {
14846
+ const value = typeof item === 'object' ? item[componentProps.dataValue] : item;
14796
14847
  if (column.lookupData[value]) {
14797
14848
  componentProps.datasource.data.push(column.lookupData[value]);
14798
14849
  }
14799
- return;
14800
- }
14801
- if (column.lookupData[colValue]) {
14802
- componentProps.datasource.data.push(column.lookupData[colValue]);
14850
+ });
14851
+ return;
14852
+ }
14853
+ if (colValue && typeof colValue === 'object'
14854
+ && Object.prototype.hasOwnProperty.call(colValue, componentProps.dataValue)) {
14855
+ const value = colValue[componentProps.dataValue];
14856
+ if (column.lookupData[value]) {
14857
+ componentProps.datasource.data.push(column.lookupData[value]);
14803
14858
  }
14859
+ return;
14860
+ }
14861
+ if (column.lookupData[colValue]) {
14862
+ componentProps.datasource.data.push(column.lookupData[colValue]);
14804
14863
  }
14805
14864
  }
14806
14865
  checkCompValidity(component) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/common",
3
- "version": "1.99.0",
3
+ "version": "1.100.1",
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": "230b088efbf1325beaeea92f4b80d0fdf23df4d0"
46
+ "gitHead": "1209ae3b06d2feb2b969f42ec7100f68ac8c55e0"
47
47
  }
@@ -119,6 +119,7 @@ export declare class Date extends TextInput implements IDate {
119
119
  dateValidation(): boolean | string;
120
120
  click(event?: Event, element?: any): void;
121
121
  blur(event: Event, element: any): void;
122
+ onMounted(): void;
122
123
  focus(event: Event, element: any): void;
123
124
  /**
124
125
  * Add date mask
@@ -76,6 +76,14 @@ export declare class GridEditable extends Grid implements IGridEditable {
76
76
  * @param element DOM Element
77
77
  */
78
78
  cellClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any, canEdit?: boolean): void;
79
+ /**
80
+ * Dispatches cellDoubleClick event
81
+ * @param row Grid row
82
+ * @param column Grid column
83
+ * @param event DOM event
84
+ * @param element DOM Element
85
+ */
86
+ cellDoubleClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any, canEdit?: boolean): void;
79
87
  /**
80
88
  * Enables editing mode
81
89
  * @param row Grid row
@@ -85,6 +93,7 @@ export declare class GridEditable extends Grid implements IGridEditable {
85
93
  */
86
94
  inlineEdit(row: IDictionary, column: GridColumnEditable, event: Event, element: any): void;
87
95
  cellClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any): void;
96
+ cellDoubleClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: any): void;
88
97
  /**
89
98
  * Dispatches select/unselect event
90
99
  * @param row Grid row
@@ -119,7 +128,12 @@ export declare class GridEditable extends Grid implements IGridEditable {
119
128
  events: any;
120
129
  autofill: boolean;
121
130
  allowDuplicate: boolean;
131
+ autoRegister: boolean;
122
132
  };
133
+ /**
134
+ * Pushes lookup values into the column's datasource
135
+ * If the row[column.name] has a selected value, pushes it
136
+ */
123
137
  private checkLookupData;
124
138
  private checkCompValidity;
125
139
  /**
@@ -111,6 +111,7 @@ export declare class Grid extends Iterable implements IGrid {
111
111
  * @public
112
112
  */
113
113
  preventRowClick: boolean;
114
+ preventRowDoubleClick: boolean;
114
115
  /**
115
116
  * Enables column dragging
116
117
  * @public
@@ -224,6 +225,8 @@ export declare class Grid extends Iterable implements IGrid {
224
225
  props: IComponent;
225
226
  instance: Component | null;
226
227
  };
228
+ private filterObject;
229
+ private deleteAccessorProps;
227
230
  protected updateActionInstance(instanceName: string, newComponent: IComponent): Component;
228
231
  getActionComponent(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath?: string): IComponent;
229
232
  protected changeDefaultSlotNames(slot: IComponentRender[]): any;
@@ -99,6 +99,10 @@ export declare class Input extends ComponentRender implements IInput {
99
99
  * Input validations.
100
100
  */
101
101
  validations: IDictionary<IDictionary<string | number>>;
102
+ /**
103
+ * Defines if the input should be automatically registered in the closest parent Form
104
+ */
105
+ autoRegister: boolean;
102
106
  /**
103
107
  * Optional validation method assigned by view layer.
104
108
  */
@@ -35,4 +35,5 @@ export interface IInput extends IComponentRender {
35
35
  storePath?: string;
36
36
  validations?: IDictionary<IDictionary<string | number>>;
37
37
  value?: any;
38
+ autoRegister?: boolean;
38
39
  }
@@ -110,8 +110,13 @@ export declare class TreeGridEditable extends TreeGrid implements ITreeGridEdita
110
110
  events: any;
111
111
  autofill: boolean;
112
112
  allowDuplicate: boolean;
113
+ autoRegister: boolean;
113
114
  };
114
115
  private updateOriginalRow;
116
+ /**
117
+ * Pushes lookup values into the column's datasource
118
+ * If the row[column.name] has a selected value, pushes it
119
+ */
115
120
  private checkLookupData;
116
121
  private checkCompValidity;
117
122
  /**
@@ -43,4 +43,5 @@ export interface IMetadataObj {
43
43
  formatXLS?: 'F1' | 'F2' | 'F3';
44
44
  type?: string;
45
45
  xlsMergedCell?: any[];
46
+ xlsDefaultType?: string;
46
47
  }