@sankhyalabs/sankhyablocks 8.15.0-dev.70 → 8.15.0-dev.72

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.
Files changed (96) hide show
  1. package/dist/cjs/{ConfigStorage-9a53a42c.js → ConfigStorage-942ce74b.js} +2 -2
  2. package/dist/cjs/{DataFetcher-515bda03.js → DataFetcher-313debd8.js} +11 -4
  3. package/dist/cjs/{IExporterProvider-90690372.js → IExporterProvider-0c814e9a.js} +5 -5
  4. package/dist/cjs/{SnkFormConfigManager-7b222c78.js → SnkFormConfigManager-52f99b4d.js} +2 -2
  5. package/dist/cjs/{auth-fetcher-5acb0335.js → auth-fetcher-54f5ff9d.js} +1 -1
  6. package/dist/cjs/{dataunit-fetcher-7a08e4dd.js → dataunit-fetcher-620b29a1.js} +1 -1
  7. package/dist/cjs/{form-config-fetcher-3f430aee.js → form-config-fetcher-2dd00e5b.js} +1 -1
  8. package/dist/cjs/{pesquisa-fetcher-916a935c.js → pesquisa-fetcher-680e198f.js} +1 -1
  9. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
  10. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  11. package/dist/cjs/snk-attach.cjs.entry.js +23 -25
  12. package/dist/cjs/snk-crud.cjs.entry.js +6 -6
  13. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  14. package/dist/cjs/{snk-data-unit-3718477f.js → snk-data-unit-eca53cfc.js} +3 -2
  15. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  16. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  17. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
  18. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  19. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  20. package/dist/cjs/snk-form.cjs.entry.js +5 -5
  21. package/dist/cjs/snk-grid.cjs.entry.js +6 -6
  22. package/dist/cjs/{snk-guides-viewer-7fb9e5a1.js → snk-guides-viewer-5d5f0f25.js} +5 -5
  23. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  24. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  25. package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -8
  26. package/dist/collection/components/snk-attach/snk-attach.js +18 -20
  27. package/dist/collection/components/snk-crud/snk-crud.js +1 -1
  28. package/dist/collection/components/snk-data-unit/snk-data-unit.js +2 -1
  29. package/dist/collection/components/snk-form/snk-form.js +1 -1
  30. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
  31. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +1 -1
  32. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +11 -4
  33. package/dist/components/DataFetcher.js +11 -4
  34. package/dist/components/IExporterProvider.js +1 -1
  35. package/dist/components/snk-attach2.js +18 -20
  36. package/dist/components/snk-crud.js +1 -1
  37. package/dist/components/snk-data-unit2.js +2 -1
  38. package/dist/components/snk-form.js +1 -1
  39. package/dist/components/snk-simple-crud2.js +1 -1
  40. package/dist/esm/{ConfigStorage-174101b9.js → ConfigStorage-86187da3.js} +2 -2
  41. package/dist/esm/{DataFetcher-4b4b7beb.js → DataFetcher-c1baf61d.js} +11 -4
  42. package/dist/esm/{IExporterProvider-ce2ca127.js → IExporterProvider-c0194569.js} +5 -5
  43. package/dist/esm/{SnkFormConfigManager-3bdb3e1f.js → SnkFormConfigManager-5b0d69cd.js} +2 -2
  44. package/dist/esm/{auth-fetcher-9f86c346.js → auth-fetcher-039abba3.js} +1 -1
  45. package/dist/esm/{dataunit-fetcher-f3fa35b9.js → dataunit-fetcher-3fbf9d12.js} +1 -1
  46. package/dist/esm/{form-config-fetcher-5d72aaf1.js → form-config-fetcher-30fb808f.js} +1 -1
  47. package/dist/esm/{pesquisa-fetcher-9cfab836.js → pesquisa-fetcher-03c8f919.js} +1 -1
  48. package/dist/esm/snk-actions-button_4.entry.js +5 -5
  49. package/dist/esm/snk-application.entry.js +6 -6
  50. package/dist/esm/snk-attach.entry.js +23 -25
  51. package/dist/esm/snk-crud.entry.js +6 -6
  52. package/dist/esm/snk-data-exporter.entry.js +5 -5
  53. package/dist/esm/{snk-data-unit-8d6afa43.js → snk-data-unit-49b898f7.js} +3 -2
  54. package/dist/esm/snk-data-unit.entry.js +3 -3
  55. package/dist/esm/snk-detail-view.entry.js +7 -7
  56. package/dist/esm/snk-filter-bar.entry.js +3 -3
  57. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  58. package/dist/esm/snk-form-config.entry.js +2 -2
  59. package/dist/esm/snk-form.entry.js +5 -5
  60. package/dist/esm/snk-grid.entry.js +6 -6
  61. package/dist/esm/{snk-guides-viewer-dabd574c.js → snk-guides-viewer-ef8c4eec.js} +5 -5
  62. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  63. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  64. package/dist/esm/snk-simple-crud.entry.js +8 -8
  65. package/dist/sankhyablocks/{p-2acc8816.entry.js → p-034c0efb.entry.js} +1 -1
  66. package/dist/sankhyablocks/{p-b27114c4.js → p-060fdb6c.js} +1 -1
  67. package/dist/sankhyablocks/p-0c846b5a.entry.js +1 -0
  68. package/dist/sankhyablocks/{p-2a84e45b.entry.js → p-14a08904.entry.js} +1 -1
  69. package/dist/sankhyablocks/{p-1c628fb2.entry.js → p-294df368.entry.js} +1 -1
  70. package/dist/sankhyablocks/p-2ac8bd11.entry.js +1 -0
  71. package/dist/sankhyablocks/{p-2c9ea7b6.entry.js → p-32062be4.entry.js} +1 -1
  72. package/dist/sankhyablocks/{p-5bd78e4c.entry.js → p-47b60deb.entry.js} +1 -1
  73. package/dist/sankhyablocks/{p-fde91811.js → p-672302c3.js} +1 -1
  74. package/dist/sankhyablocks/{p-3e4c2cfe.entry.js → p-7259f903.entry.js} +2 -2
  75. package/dist/sankhyablocks/p-913a9979.js +1 -0
  76. package/dist/sankhyablocks/{p-19ba2e08.entry.js → p-96f1fdf8.entry.js} +1 -1
  77. package/dist/sankhyablocks/{p-59dccb7a.entry.js → p-a1d72395.entry.js} +1 -1
  78. package/dist/sankhyablocks/{p-b643f746.entry.js → p-a64baa0f.entry.js} +1 -1
  79. package/dist/sankhyablocks/{p-6b2be902.js → p-af8efd95.js} +1 -1
  80. package/dist/sankhyablocks/{p-566f5f50.js → p-aff76a53.js} +1 -1
  81. package/dist/sankhyablocks/p-b8577312.entry.js +1 -0
  82. package/dist/sankhyablocks/{p-4a8a149d.entry.js → p-ba05fdb8.entry.js} +1 -1
  83. package/dist/sankhyablocks/{p-109e0551.js → p-babe7665.js} +1 -1
  84. package/dist/sankhyablocks/{p-1918789e.js → p-d26365ad.js} +1 -1
  85. package/dist/sankhyablocks/{p-010d475f.js → p-dc7c9047.js} +1 -1
  86. package/dist/sankhyablocks/{p-e0c27486.js → p-df5451c7.js} +1 -1
  87. package/dist/sankhyablocks/{p-e238279a.entry.js → p-e5c25e0b.entry.js} +1 -1
  88. package/dist/sankhyablocks/{p-aa854fa8.entry.js → p-eae7a817.entry.js} +1 -1
  89. package/dist/sankhyablocks/p-f88cfc3c.js +1 -0
  90. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  91. package/package.json +1 -1
  92. package/dist/sankhyablocks/p-1e9c3f95.entry.js +0 -1
  93. package/dist/sankhyablocks/p-52df8935.entry.js +0 -1
  94. package/dist/sankhyablocks/p-a6dfa396.js +0 -1
  95. package/dist/sankhyablocks/p-aa9c4099.entry.js +0 -1
  96. package/dist/sankhyablocks/p-eae66367.js +0 -1
@@ -41,7 +41,7 @@ export class SnkAttach {
41
41
  this.crudConfig = undefined;
42
42
  }
43
43
  async initAttach() {
44
- var _a, _b, _c, _d;
44
+ var _a, _b, _c, _d, _e, _f;
45
45
  await this.loadAttachmentDataUnit();
46
46
  this.returnToGridMode();
47
47
  if (this.fetcherType === "AnexoSistema") {
@@ -55,8 +55,7 @@ export class SnkAttach {
55
55
  if (hasMoreOneItem)
56
56
  return;
57
57
  }
58
- await this._currentDataUnit.loadMetadata();
59
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
58
+ (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
60
59
  }
61
60
  /**
62
61
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -95,14 +94,14 @@ export class SnkAttach {
95
94
  if (this._crudElement)
96
95
  this._crudElement.goToView(VIEW_MODE.GRID);
97
96
  }
98
- async loadAttachmentDataUnit() {
97
+ loadAttachmentDataUnit() {
99
98
  try {
100
99
  switch (this.fetcherType) {
101
100
  case "AnexoSistema":
102
- await this.loadAnexoSistema();
101
+ this.loadAnexoSistema();
103
102
  break;
104
103
  case "Attach":
105
- await this.loadAttach();
104
+ this.loadAttach();
106
105
  break;
107
106
  default:
108
107
  this._currentFetcher = this.fetcher;
@@ -114,13 +113,12 @@ export class SnkAttach {
114
113
  throw new Error('There was an error while creating the data unit');
115
114
  }
116
115
  }
117
- async loadAnexoSistema() {
118
- var _a;
119
- this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
120
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
116
+ loadAnexoSistema() {
117
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
121
118
  if (!this._currentDataUnit.metadata) {
122
- await this._currentDataUnit.loadMetadata();
123
- this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
119
+ this._currentDataUnit
120
+ .loadMetadata()
121
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
124
122
  }
125
123
  this.initDataUnitLoaders();
126
124
  this._currentDataUnit.addFilterProvider({
@@ -129,11 +127,10 @@ export class SnkAttach {
129
127
  this._currentDataUnit.addInterceptor({
130
128
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
131
129
  });
132
- await this._currentDataUnit.loadData();
133
- this.disableEditFieldsNotInForm();
130
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
134
131
  }
135
- async loadAttach() {
136
- this._currentFetcher = new AttachFetcher();
132
+ loadAttach() {
133
+ var _a, _b;
137
134
  this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
138
135
  this.initDataUnitLoaders();
139
136
  this._currentDataUnit.addInterceptor({
@@ -147,10 +144,11 @@ export class SnkAttach {
147
144
  }
148
145
  });
149
146
  if (!this._currentDataUnit.metadata) {
150
- await this._currentDataUnit.loadMetadata();
151
- this.crudConfig = Object.assign({}, attachCrudConfig);
152
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
153
- this.disableEditFieldsNotInForm();
147
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata()) === null || _b === void 0 ? void 0 : _b.then(() => {
148
+ var _a, _b;
149
+ this.crudConfig = Object.assign({}, attachCrudConfig);
150
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
151
+ });
154
152
  }
155
153
  }
156
154
  initDataUnitLoaders() {
@@ -248,7 +248,7 @@ export class SnkCrud {
248
248
  continue;
249
249
  }
250
250
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
251
- if (!rmPrecision) {
251
+ if (!rmPrecision && rmPrecision !== 0) {
252
252
  continue;
253
253
  }
254
254
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -184,7 +184,8 @@ export class SnkDataUnit {
184
184
  return cacheName;
185
185
  }
186
186
  updateDataStateRmp(newValue) {
187
- Object.assign(this.dataState.rowMetadata || {}, newValue);
187
+ const newRowMetadata = Object.assign({}, newValue);
188
+ this.dataState.rowMetadata = newRowMetadata;
188
189
  }
189
190
  saveCacheRmd(record) {
190
191
  const rmd = record.__record__metadata__;
@@ -100,7 +100,7 @@ export class SnkForm {
100
100
  continue;
101
101
  }
102
102
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
103
- if (!rmPrecision) {
103
+ if (!rmPrecision && rmPrecision !== 0) {
104
104
  continue;
105
105
  }
106
106
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -189,7 +189,7 @@ export class SnkSimpleCrud {
189
189
  continue;
190
190
  }
191
191
  const rmPrecision = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata) === null || _b === void 0 ? void 0 : _b.getProp('rm_precision', field);
192
- if (!rmPrecision) {
192
+ if (!rmPrecision && rmPrecision !== 0) {
193
193
  continue;
194
194
  }
195
195
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -21,7 +21,7 @@ export default class RmPrecisionCustomValueFormatter {
21
21
  }
22
22
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
23
23
  const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
24
- if (rmPrecision) {
24
+ if (rmPrecision || rmPrecision === 0) {
25
25
  return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
26
26
  }
27
27
  else {
@@ -364,12 +364,19 @@ export class DataFetcher {
364
364
  //Reject promises with errors from query
365
365
  errorsResponse.forEach((errorResponse) => {
366
366
  Object.entries(errorResponse).forEach(async ([key, val]) => {
367
- var _a;
368
367
  const waitingRequest = watingRequestsById.get(val.request.variables[val.index].queryID);
369
368
  const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
370
- if (!hasClientEvent) {
371
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
372
- }
369
+ Promise.race([
370
+ waitingRequest.promise,
371
+ new Promise((resolve) => {
372
+ resolve(false);
373
+ })
374
+ ]).then((data) => {
375
+ var _a;
376
+ if (!hasClientEvent || data === false) {
377
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
378
+ }
379
+ });
373
380
  });
374
381
  });
375
382
  //Resolve promises with data from query
@@ -6875,12 +6875,19 @@ class DataFetcher {
6875
6875
  //Reject promises with errors from query
6876
6876
  errorsResponse.forEach((errorResponse) => {
6877
6877
  Object.entries(errorResponse).forEach(async ([key, val]) => {
6878
- var _a;
6879
6878
  const waitingRequest = watingRequestsById.get(val.request.variables[val.index].queryID);
6880
6879
  const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
6881
- if (!hasClientEvent) {
6882
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6883
- }
6880
+ Promise.race([
6881
+ waitingRequest.promise,
6882
+ new Promise((resolve) => {
6883
+ resolve(false);
6884
+ })
6885
+ ]).then((data) => {
6886
+ var _a;
6887
+ if (!hasClientEvent || data === false) {
6888
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6889
+ }
6890
+ });
6884
6891
  });
6885
6892
  });
6886
6893
  //Resolve promises with data from query
@@ -230,7 +230,7 @@ class RmPrecisionCustomValueFormatter {
230
230
  }
231
231
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
232
232
  const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
233
- if (rmPrecision) {
233
+ if (rmPrecision || rmPrecision === 0) {
234
234
  return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
235
235
  }
236
236
  else {
@@ -658,7 +658,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
658
658
  this.crudConfig = undefined;
659
659
  }
660
660
  async initAttach() {
661
- var _a, _b, _c, _d;
661
+ var _a, _b, _c, _d, _e, _f;
662
662
  await this.loadAttachmentDataUnit();
663
663
  this.returnToGridMode();
664
664
  if (this.fetcherType === "AnexoSistema") {
@@ -672,8 +672,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
672
672
  if (hasMoreOneItem)
673
673
  return;
674
674
  }
675
- await this._currentDataUnit.loadMetadata();
676
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
675
+ (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
677
676
  }
678
677
  /**
679
678
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -712,14 +711,14 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
712
711
  if (this._crudElement)
713
712
  this._crudElement.goToView(VIEW_MODE.GRID);
714
713
  }
715
- async loadAttachmentDataUnit() {
714
+ loadAttachmentDataUnit() {
716
715
  try {
717
716
  switch (this.fetcherType) {
718
717
  case "AnexoSistema":
719
- await this.loadAnexoSistema();
718
+ this.loadAnexoSistema();
720
719
  break;
721
720
  case "Attach":
722
- await this.loadAttach();
721
+ this.loadAttach();
723
722
  break;
724
723
  default:
725
724
  this._currentFetcher = this.fetcher;
@@ -731,13 +730,12 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
731
730
  throw new Error('There was an error while creating the data unit');
732
731
  }
733
732
  }
734
- async loadAnexoSistema() {
735
- var _a;
736
- this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
737
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
733
+ loadAnexoSistema() {
734
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
738
735
  if (!this._currentDataUnit.metadata) {
739
- await this._currentDataUnit.loadMetadata();
740
- this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
736
+ this._currentDataUnit
737
+ .loadMetadata()
738
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
741
739
  }
742
740
  this.initDataUnitLoaders();
743
741
  this._currentDataUnit.addFilterProvider({
@@ -746,11 +744,10 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
746
744
  this._currentDataUnit.addInterceptor({
747
745
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
748
746
  });
749
- await this._currentDataUnit.loadData();
750
- this.disableEditFieldsNotInForm();
747
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
751
748
  }
752
- async loadAttach() {
753
- this._currentFetcher = new AttachFetcher();
749
+ loadAttach() {
750
+ var _a, _b;
754
751
  this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
755
752
  this.initDataUnitLoaders();
756
753
  this._currentDataUnit.addInterceptor({
@@ -764,10 +761,11 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
764
761
  }
765
762
  });
766
763
  if (!this._currentDataUnit.metadata) {
767
- await this._currentDataUnit.loadMetadata();
768
- this.crudConfig = Object.assign({}, attachCrudConfig);
769
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
770
- this.disableEditFieldsNotInForm();
764
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata()) === null || _b === void 0 ? void 0 : _b.then(() => {
765
+ var _a, _b;
766
+ this.crudConfig = Object.assign({}, attachCrudConfig);
767
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
768
+ });
771
769
  }
772
770
  }
773
771
  initDataUnitLoaders() {
@@ -288,7 +288,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
288
288
  continue;
289
289
  }
290
290
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
291
- if (!rmPrecision) {
291
+ if (!rmPrecision && rmPrecision !== 0) {
292
292
  continue;
293
293
  }
294
294
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -227,7 +227,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
227
227
  return cacheName;
228
228
  }
229
229
  updateDataStateRmp(newValue) {
230
- Object.assign(this.dataState.rowMetadata || {}, newValue);
230
+ const newRowMetadata = Object.assign({}, newValue);
231
+ this.dataState.rowMetadata = newRowMetadata;
231
232
  }
232
233
  saveCacheRmd(record) {
233
234
  const rmd = record.__record__metadata__;
@@ -112,7 +112,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
112
112
  continue;
113
113
  }
114
114
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
115
- if (!rmPrecision) {
115
+ if (!rmPrecision && rmPrecision !== 0) {
116
116
  continue;
117
117
  }
118
118
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -271,7 +271,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
271
271
  continue;
272
272
  }
273
273
  const rmPrecision = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata) === null || _b === void 0 ? void 0 : _b.getProp('rm_precision', field);
274
- if (!rmPrecision) {
274
+ if (!rmPrecision && rmPrecision !== 0) {
275
275
  continue;
276
276
  }
277
277
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -1,7 +1,7 @@
1
- import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-5d72aaf1.js';
1
+ import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
2
2
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
3
3
  import { ObjectUtils } from '@sankhyalabs/core';
4
- import { d as dist, D as DataFetcher } from './DataFetcher-4b4b7beb.js';
4
+ import { d as dist, D as DataFetcher } from './DataFetcher-c1baf61d.js';
5
5
 
6
6
  class GridConfigFetcher extends ResourceFetcher {
7
7
  constructor() {
@@ -6875,12 +6875,19 @@ class DataFetcher {
6875
6875
  //Reject promises with errors from query
6876
6876
  errorsResponse.forEach((errorResponse) => {
6877
6877
  Object.entries(errorResponse).forEach(async ([key, val]) => {
6878
- var _a;
6879
6878
  const waitingRequest = watingRequestsById.get(val.request.variables[val.index].queryID);
6880
6879
  const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
6881
- if (!hasClientEvent) {
6882
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6883
- }
6880
+ Promise.race([
6881
+ waitingRequest.promise,
6882
+ new Promise((resolve) => {
6883
+ resolve(false);
6884
+ })
6885
+ ]).then((data) => {
6886
+ var _a;
6887
+ if (!hasClientEvent || data === false) {
6888
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6889
+ }
6890
+ });
6884
6891
  });
6885
6892
  });
6886
6893
  //Resolve promises with data from query
@@ -1,13 +1,13 @@
1
- import { D as DataFetcher } from './DataFetcher-4b4b7beb.js';
2
- import './pesquisa-fetcher-9cfab836.js';
1
+ import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
2
+ import './pesquisa-fetcher-03c8f919.js';
3
3
  import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, NumberUtils, DataType } from '@sankhyalabs/core';
4
4
  import './index-0ece87a6.js';
5
5
  import './ISave-d8c8bc59.js';
6
6
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
7
7
  import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
- import { P as PreloadManager } from './dataunit-fetcher-f3fa35b9.js';
8
+ import { P as PreloadManager } from './dataunit-fetcher-3fbf9d12.js';
9
9
  import './filter-item-type.enum-d45e026f.js';
10
- import './form-config-fetcher-5d72aaf1.js';
10
+ import './form-config-fetcher-30fb808f.js';
11
11
  import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
12
12
 
13
13
  class CrudUtils {
@@ -153,7 +153,7 @@ class RmPrecisionCustomValueFormatter {
153
153
  }
154
154
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
155
155
  const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
156
- if (rmPrecision) {
156
+ if (rmPrecision || rmPrecision === 0) {
157
157
  return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
158
158
  }
159
159
  else {
@@ -1,6 +1,6 @@
1
- import { C as ConfigStorage } from './ConfigStorage-174101b9.js';
1
+ import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
2
2
  import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
3
- import { F as FormConfigFetcher } from './form-config-fetcher-5d72aaf1.js';
3
+ import { F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
4
4
 
5
5
  class SnkFormConfigManager {
6
6
  constructor(configName, resourceID, onConfigChange) {
@@ -1,5 +1,5 @@
1
1
  import { ObjectUtils } from '@sankhyalabs/core';
2
- import { R as ResourceFetcher } from './form-config-fetcher-5d72aaf1.js';
2
+ import { R as ResourceFetcher } from './form-config-fetcher-30fb808f.js';
3
3
 
4
4
  class AuthFetcher extends ResourceFetcher {
5
5
  getData(resourceID) {
@@ -1,5 +1,5 @@
1
1
  import { ObjectUtils, DataUnit, DataType, DateUtils, StringUtils, ChangeOperation, ApplicationContext, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
2
- import { D as DataFetcher, d as dist } from './DataFetcher-4b4b7beb.js';
2
+ import { D as DataFetcher, d as dist } from './DataFetcher-c1baf61d.js';
3
3
  import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
4
4
  import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
5
5
  import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -1,4 +1,4 @@
1
- import { d as dist, D as DataFetcher } from './DataFetcher-4b4b7beb.js';
1
+ import { d as dist, D as DataFetcher } from './DataFetcher-c1baf61d.js';
2
2
  import { ObjectUtils } from '@sankhyalabs/core';
3
3
 
4
4
  class ResourceFetcher {
@@ -1,5 +1,5 @@
1
1
  import { DataType, ApplicationContext } from '@sankhyalabs/core';
2
- import { d as dist, D as DataFetcher } from './DataFetcher-4b4b7beb.js';
2
+ import { d as dist, D as DataFetcher } from './DataFetcher-c1baf61d.js';
3
3
 
4
4
  class PesquisaFetcher {
5
5
  constructor() {
@@ -1,19 +1,19 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-a7d3d3f1.js';
2
2
  import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './DataFetcher-4b4b7beb.js';
3
+ import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
4
4
  import { P as ParamType } from './ParamType-d5152b06.js';
5
- import './pesquisa-fetcher-9cfab836.js';
5
+ import './pesquisa-fetcher-03c8f919.js';
6
6
  import './index-0ece87a6.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-f3fa35b9.js';
10
+ import './dataunit-fetcher-3fbf9d12.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-5d72aaf1.js';
12
+ import './form-config-fetcher-30fb808f.js';
13
13
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
14
14
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
15
15
  import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
16
- import { C as ConfigStorage } from './ConfigStorage-174101b9.js';
16
+ import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
17
17
  import { O as ORDER_VALUES } from './constants-8457af36.js';
18
18
  import './PrintUtils-3e4ff0f5.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { C as ConfigStorage } from './ConfigStorage-174101b9.js';
5
- import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-4b4b7beb.js';
6
- import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-9f86c346.js';
7
- import { D as DataUnitFetcher } from './dataunit-fetcher-f3fa35b9.js';
8
- import { P as PesquisaFetcher } from './pesquisa-fetcher-9cfab836.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
5
+ import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-c1baf61d.js';
6
+ import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-039abba3.js';
7
+ import { D as DataUnitFetcher } from './dataunit-fetcher-3fbf9d12.js';
8
+ import { P as PesquisaFetcher } from './pesquisa-fetcher-03c8f919.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-3a767111.js';
10
- import './form-config-fetcher-5d72aaf1.js';
10
+ import './form-config-fetcher-30fb808f.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './DataFetcher-4b4b7beb.js';
4
- import './pesquisa-fetcher-9cfab836.js';
3
+ import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
4
+ import './pesquisa-fetcher-03c8f919.js';
5
5
  import './index-0ece87a6.js';
6
6
  import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
7
- import { P as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-f3fa35b9.js';
7
+ import { P as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-3fbf9d12.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-5d72aaf1.js';
9
+ import './form-config-fetcher-30fb808f.js';
10
10
  import { d as VIEW_MODE } from './constants-8457af36.js';
11
- import { A as AutorizationType } from './auth-fetcher-9f86c346.js';
11
+ import { A as AutorizationType } from './auth-fetcher-039abba3.js';
12
12
  import { T as TaskbarElement } from './taskbar-elements-ad766858.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -651,7 +651,7 @@ const SnkAttach = class {
651
651
  this.crudConfig = undefined;
652
652
  }
653
653
  async initAttach() {
654
- var _a, _b, _c, _d;
654
+ var _a, _b, _c, _d, _e, _f;
655
655
  await this.loadAttachmentDataUnit();
656
656
  this.returnToGridMode();
657
657
  if (this.fetcherType === "AnexoSistema") {
@@ -665,8 +665,7 @@ const SnkAttach = class {
665
665
  if (hasMoreOneItem)
666
666
  return;
667
667
  }
668
- await this._currentDataUnit.loadMetadata();
669
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
668
+ (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
670
669
  }
671
670
  /**
672
671
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -705,14 +704,14 @@ const SnkAttach = class {
705
704
  if (this._crudElement)
706
705
  this._crudElement.goToView(VIEW_MODE.GRID);
707
706
  }
708
- async loadAttachmentDataUnit() {
707
+ loadAttachmentDataUnit() {
709
708
  try {
710
709
  switch (this.fetcherType) {
711
710
  case "AnexoSistema":
712
- await this.loadAnexoSistema();
711
+ this.loadAnexoSistema();
713
712
  break;
714
713
  case "Attach":
715
- await this.loadAttach();
714
+ this.loadAttach();
716
715
  break;
717
716
  default:
718
717
  this._currentFetcher = this.fetcher;
@@ -724,13 +723,12 @@ const SnkAttach = class {
724
723
  throw new Error('There was an error while creating the data unit');
725
724
  }
726
725
  }
727
- async loadAnexoSistema() {
728
- var _a;
729
- this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
730
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
726
+ loadAnexoSistema() {
727
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
731
728
  if (!this._currentDataUnit.metadata) {
732
- await this._currentDataUnit.loadMetadata();
733
- this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
729
+ this._currentDataUnit
730
+ .loadMetadata()
731
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
734
732
  }
735
733
  this.initDataUnitLoaders();
736
734
  this._currentDataUnit.addFilterProvider({
@@ -739,11 +737,10 @@ const SnkAttach = class {
739
737
  this._currentDataUnit.addInterceptor({
740
738
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
741
739
  });
742
- await this._currentDataUnit.loadData();
743
- this.disableEditFieldsNotInForm();
740
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
744
741
  }
745
- async loadAttach() {
746
- this._currentFetcher = new AttachFetcher();
742
+ loadAttach() {
743
+ var _a, _b;
747
744
  this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
748
745
  this.initDataUnitLoaders();
749
746
  this._currentDataUnit.addInterceptor({
@@ -757,10 +754,11 @@ const SnkAttach = class {
757
754
  }
758
755
  });
759
756
  if (!this._currentDataUnit.metadata) {
760
- await this._currentDataUnit.loadMetadata();
761
- this.crudConfig = Object.assign({}, attachCrudConfig);
762
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
763
- this.disableEditFieldsNotInForm();
757
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata()) === null || _b === void 0 ? void 0 : _b.then(() => {
758
+ var _a, _b;
759
+ this.crudConfig = Object.assign({}, attachCrudConfig);
760
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
761
+ });
764
762
  }
765
763
  }
766
764
  initDataUnitLoaders() {
@@ -1,17 +1,17 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-ad766858.js';
4
- import './DataFetcher-4b4b7beb.js';
5
- import './pesquisa-fetcher-9cfab836.js';
4
+ import './DataFetcher-c1baf61d.js';
5
+ import './pesquisa-fetcher-03c8f919.js';
6
6
  import { P as PresentationMode } from './index-0ece87a6.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-f3fa35b9.js';
10
+ import './dataunit-fetcher-3fbf9d12.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-5d72aaf1.js';
12
+ import './form-config-fetcher-30fb808f.js';
13
13
  import { d as VIEW_MODE } from './constants-8457af36.js';
14
- import { A as AutorizationType } from './auth-fetcher-9f86c346.js';
14
+ import { A as AutorizationType } from './auth-fetcher-039abba3.js';
15
15
  import './index-bdf75557.js';
16
16
  import './PrintUtils-3e4ff0f5.js';
17
17
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -264,7 +264,7 @@ const SnkCrud = class {
264
264
  continue;
265
265
  }
266
266
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
267
- if (!rmPrecision) {
267
+ if (!rmPrecision && rmPrecision !== 0) {
268
268
  continue;
269
269
  }
270
270
  await this.setFieldProp(field, 'precision', rmPrecision);