@zeedhi/common 1.110.0 → 1.111.0

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.
@@ -6820,6 +6820,10 @@ class GridEditable extends Grid {
6820
6820
  };
6821
6821
  this.viewEnterEdit = null;
6822
6822
  this.showCancelColumn = false;
6823
+ /**
6824
+ * Define se o evento rowClick deve ser chamado ao clicar em uma célula editável
6825
+ */
6826
+ this.preventRowClickOnEditing = true;
6823
6827
  this.newRowIdentifier = '__added_row';
6824
6828
  this.positionIdentifier = '__position';
6825
6829
  this.pageIdentifier = '__page';
@@ -6829,6 +6833,7 @@ class GridEditable extends Grid {
6829
6833
  this.editingNewRows = this.getInitValue('editingNewRows', props.editingNewRows, this.editingNewRows);
6830
6834
  this.singleEdit = this.getInitValue('singleEdit', props.singleEdit, this.singleEdit);
6831
6835
  this.showCancelColumn = this.getInitValue('showCancelColumn', props.showCancelColumn, this.showCancelColumn);
6836
+ this.preventRowClickOnEditing = this.getInitValue('preventRowClickOnEditing', props.preventRowClickOnEditing, this.preventRowClickOnEditing);
6832
6837
  this.createAccessors();
6833
6838
  this.addCancelColumn();
6834
6839
  this.registerDatasourceCallback();
@@ -6957,7 +6962,7 @@ class GridEditable extends Grid {
6957
6962
  */
6958
6963
  cellClick(row, column, event, element, canEdit = true) {
6959
6964
  if (column.editable && canEdit) {
6960
- this.preventRowClick = true;
6965
+ this.preventRowClick = (this.preventRowClickOnEditing !== false);
6961
6966
  this.datasource.currentRow = row;
6962
6967
  this.inlineEdit(row, column, event, element);
6963
6968
  return;
@@ -7088,6 +7093,15 @@ class GridEditable extends Grid {
7088
7093
  component, event, element, row, column,
7089
7094
  });
7090
7095
  }
7096
+ }, click: ({ event, element, component }) => {
7097
+ if (this.preventRowClickOnEditing === false) {
7098
+ this.rowClick(row, event, element);
7099
+ }
7100
+ if (compEvents.click) {
7101
+ compEvents.click({
7102
+ component, event, element,
7103
+ });
7104
+ }
7091
7105
  } });
7092
7106
  this.updateOriginalRow(key, row);
7093
7107
  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 });
@@ -12909,6 +12923,9 @@ class SelectMultiple extends Select {
12909
12923
  };
12910
12924
  return modalSelectionDef;
12911
12925
  }
12926
+ changeCheckboxAll(event, element) {
12927
+ this.callEvent('changeCheckboxAll', { event, element, component: this });
12928
+ }
12912
12929
  }
12913
12930
  FormatterParserProvider.registerFormatter('ZdSelectMultiple', (value, props) => {
12914
12931
  const { dataDisabled, dataValue } = props;
@@ -6827,6 +6827,10 @@
6827
6827
  };
6828
6828
  this.viewEnterEdit = null;
6829
6829
  this.showCancelColumn = false;
6830
+ /**
6831
+ * Define se o evento rowClick deve ser chamado ao clicar em uma célula editável
6832
+ */
6833
+ this.preventRowClickOnEditing = true;
6830
6834
  this.newRowIdentifier = '__added_row';
6831
6835
  this.positionIdentifier = '__position';
6832
6836
  this.pageIdentifier = '__page';
@@ -6836,6 +6840,7 @@
6836
6840
  this.editingNewRows = this.getInitValue('editingNewRows', props.editingNewRows, this.editingNewRows);
6837
6841
  this.singleEdit = this.getInitValue('singleEdit', props.singleEdit, this.singleEdit);
6838
6842
  this.showCancelColumn = this.getInitValue('showCancelColumn', props.showCancelColumn, this.showCancelColumn);
6843
+ this.preventRowClickOnEditing = this.getInitValue('preventRowClickOnEditing', props.preventRowClickOnEditing, this.preventRowClickOnEditing);
6839
6844
  this.createAccessors();
6840
6845
  this.addCancelColumn();
6841
6846
  this.registerDatasourceCallback();
@@ -6964,7 +6969,7 @@
6964
6969
  */
6965
6970
  cellClick(row, column, event, element, canEdit = true) {
6966
6971
  if (column.editable && canEdit) {
6967
- this.preventRowClick = true;
6972
+ this.preventRowClick = (this.preventRowClickOnEditing !== false);
6968
6973
  this.datasource.currentRow = row;
6969
6974
  this.inlineEdit(row, column, event, element);
6970
6975
  return;
@@ -7095,6 +7100,15 @@
7095
7100
  component, event, element, row, column,
7096
7101
  });
7097
7102
  }
7103
+ }, click: ({ event, element, component }) => {
7104
+ if (this.preventRowClickOnEditing === false) {
7105
+ this.rowClick(row, event, element);
7106
+ }
7107
+ if (compEvents.click) {
7108
+ compEvents.click({
7109
+ component, event, element,
7110
+ });
7111
+ }
7098
7112
  } });
7099
7113
  this.updateOriginalRow(key, row);
7100
7114
  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 });
@@ -12916,6 +12930,9 @@
12916
12930
  };
12917
12931
  return modalSelectionDef;
12918
12932
  }
12933
+ changeCheckboxAll(event, element) {
12934
+ this.callEvent('changeCheckboxAll', { event, element, component: this });
12935
+ }
12919
12936
  }
12920
12937
  core.FormatterParserProvider.registerFormatter('ZdSelectMultiple', (value, props) => {
12921
12938
  const { dataDisabled, dataValue } = props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/common",
3
- "version": "1.110.0",
3
+ "version": "1.111.0",
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": "fc3c2ff25bee46c565577b6749a4d0539762407f"
46
+ "gitHead": "f75c602a03ad29224ec2058a01a9b02f2e37cc6f"
47
47
  }
@@ -48,6 +48,10 @@ export declare class GridEditable extends Grid implements IGridEditable {
48
48
  protected viewEnterEdit: ((rowKey: string, columnName: string) => void) | null;
49
49
  setViewEnterEdit(viewEnterEdit: (rowKey: string, columnName: string) => void): void;
50
50
  showCancelColumn: boolean;
51
+ /**
52
+ * Define se o evento rowClick deve ser chamado ao clicar em uma célula editável
53
+ */
54
+ preventRowClickOnEditing: boolean;
51
55
  constructor(props: IGridEditable);
52
56
  onMounted(element: any): void;
53
57
  onBeforeDestroy(): void;
@@ -6,6 +6,7 @@ export declare type ISelectMultipleEvent = IEventParam<SelectMultiple>;
6
6
  export interface ISelectMultipleEvents<T = IEventParam<any>> extends IComponentEvents<T> {
7
7
  selectedAll?: EventDef<T>;
8
8
  unselectedAll?: EventDef<T>;
9
+ changeCheckboxAll?: EventDef<T>;
9
10
  }
10
11
  export interface ISelectMultiple extends ISelect {
11
12
  moreChip?: number;
@@ -112,4 +112,5 @@ export declare class SelectMultiple extends Select implements ISelectMultiple {
112
112
  protected updateRules(): void;
113
113
  private confirmModalSelection;
114
114
  protected getModalSelectionDef(): IModal;
115
+ changeCheckboxAll(event: Event, element: any): void;
115
116
  }
@@ -1,12 +0,0 @@
1
- export interface IJSONObject {
2
- path: string;
3
- }
4
- export declare class JsonCacheService {
5
- /**
6
- * jsons collection
7
- */
8
- static jsonCollection: IJSONObject[];
9
- static saveJSONCache(jsonCollection: IJSONObject[]): Promise<void>;
10
- static getJSONCache(path: string): any;
11
- static clearJSONCache(jsonCollection: IJSONObject[]): void;
12
- }