@sankhyalabs/sankhyablocks 8.15.0-dev.71 → 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 (43) hide show
  1. package/dist/cjs/{IExporterProvider-853e5efc.js → IExporterProvider-0c814e9a.js} +1 -1
  2. package/dist/cjs/snk-attach.cjs.entry.js +18 -20
  3. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  4. package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
  5. package/dist/cjs/{snk-data-unit-e9681eea.js → snk-data-unit-eca53cfc.js} +2 -1
  6. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-form.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-grid.cjs.entry.js +1 -1
  9. package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
  10. package/dist/collection/components/snk-attach/snk-attach.js +18 -20
  11. package/dist/collection/components/snk-crud/snk-crud.js +1 -1
  12. package/dist/collection/components/snk-data-unit/snk-data-unit.js +2 -1
  13. package/dist/collection/components/snk-form/snk-form.js +1 -1
  14. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
  15. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +1 -1
  16. package/dist/components/IExporterProvider.js +1 -1
  17. package/dist/components/snk-attach2.js +18 -20
  18. package/dist/components/snk-crud.js +1 -1
  19. package/dist/components/snk-data-unit2.js +2 -1
  20. package/dist/components/snk-form.js +1 -1
  21. package/dist/components/snk-simple-crud2.js +1 -1
  22. package/dist/esm/{IExporterProvider-cdcbe084.js → IExporterProvider-c0194569.js} +1 -1
  23. package/dist/esm/snk-attach.entry.js +18 -20
  24. package/dist/esm/snk-crud.entry.js +1 -1
  25. package/dist/esm/snk-data-exporter.entry.js +1 -1
  26. package/dist/esm/{snk-data-unit-3bf015c8.js → snk-data-unit-49b898f7.js} +2 -1
  27. package/dist/esm/snk-data-unit.entry.js +1 -1
  28. package/dist/esm/snk-form.entry.js +1 -1
  29. package/dist/esm/snk-grid.entry.js +1 -1
  30. package/dist/esm/snk-simple-crud.entry.js +2 -2
  31. package/dist/sankhyablocks/{p-8f1811e4.entry.js → p-034c0efb.entry.js} +1 -1
  32. package/dist/sankhyablocks/{p-4aa7b6be.entry.js → p-0c846b5a.entry.js} +1 -1
  33. package/dist/sankhyablocks/{p-a2b65c4a.entry.js → p-32062be4.entry.js} +1 -1
  34. package/dist/sankhyablocks/{p-5c87db90.entry.js → p-96f1fdf8.entry.js} +1 -1
  35. package/dist/sankhyablocks/p-b8577312.entry.js +1 -0
  36. package/dist/sankhyablocks/{p-834eea71.entry.js → p-ba05fdb8.entry.js} +1 -1
  37. package/dist/sankhyablocks/{p-5bcb06df.js → p-babe7665.js} +1 -1
  38. package/dist/sankhyablocks/{p-7d8c818c.entry.js → p-e5c25e0b.entry.js} +1 -1
  39. package/dist/sankhyablocks/p-f88cfc3c.js +1 -0
  40. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  41. package/package.json +1 -1
  42. package/dist/sankhyablocks/p-94a495d9.js +0 -1
  43. package/dist/sankhyablocks/p-d27c85fa.entry.js +0 -1
@@ -159,7 +159,7 @@ class RmPrecisionCustomValueFormatter {
159
159
  }
160
160
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
161
161
  const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
162
- if (rmPrecision) {
162
+ if (rmPrecision || rmPrecision === 0) {
163
163
  return core.NumberUtils.format(currentValue, rmPrecision, rmPrecision);
164
164
  }
165
165
  else {
@@ -655,7 +655,7 @@ const SnkAttach = class {
655
655
  this.crudConfig = undefined;
656
656
  }
657
657
  async initAttach() {
658
- var _a, _b, _c, _d;
658
+ var _a, _b, _c, _d, _e, _f;
659
659
  await this.loadAttachmentDataUnit();
660
660
  this.returnToGridMode();
661
661
  if (this.fetcherType === "AnexoSistema") {
@@ -669,8 +669,7 @@ const SnkAttach = class {
669
669
  if (hasMoreOneItem)
670
670
  return;
671
671
  }
672
- await this._currentDataUnit.loadMetadata();
673
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
672
+ (_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));
674
673
  }
675
674
  /**
676
675
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -709,14 +708,14 @@ const SnkAttach = class {
709
708
  if (this._crudElement)
710
709
  this._crudElement.goToView(constants.VIEW_MODE.GRID);
711
710
  }
712
- async loadAttachmentDataUnit() {
711
+ loadAttachmentDataUnit() {
713
712
  try {
714
713
  switch (this.fetcherType) {
715
714
  case "AnexoSistema":
716
- await this.loadAnexoSistema();
715
+ this.loadAnexoSistema();
717
716
  break;
718
717
  case "Attach":
719
- await this.loadAttach();
718
+ this.loadAttach();
720
719
  break;
721
720
  default:
722
721
  this._currentFetcher = this.fetcher;
@@ -728,13 +727,12 @@ const SnkAttach = class {
728
727
  throw new Error('There was an error while creating the data unit');
729
728
  }
730
729
  }
731
- async loadAnexoSistema() {
732
- var _a;
733
- this._currentDataUnit = new dataunitFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
734
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
730
+ loadAnexoSistema() {
731
+ this._currentDataUnit = this._currentDataUnit || new dataunitFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
735
732
  if (!this._currentDataUnit.metadata) {
736
- await this._currentDataUnit.loadMetadata();
737
- this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
733
+ this._currentDataUnit
734
+ .loadMetadata()
735
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
738
736
  }
739
737
  this.initDataUnitLoaders();
740
738
  this._currentDataUnit.addFilterProvider({
@@ -743,11 +741,10 @@ const SnkAttach = class {
743
741
  this._currentDataUnit.addInterceptor({
744
742
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
745
743
  });
746
- await this._currentDataUnit.loadData();
747
- this.disableEditFieldsNotInForm();
744
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
748
745
  }
749
- async loadAttach() {
750
- this._currentFetcher = new AttachFetcher();
746
+ loadAttach() {
747
+ var _a, _b;
751
748
  this._currentDataUnit = new core.DataUnit(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
752
749
  this.initDataUnitLoaders();
753
750
  this._currentDataUnit.addInterceptor({
@@ -761,10 +758,11 @@ const SnkAttach = class {
761
758
  }
762
759
  });
763
760
  if (!this._currentDataUnit.metadata) {
764
- await this._currentDataUnit.loadMetadata();
765
- this.crudConfig = Object.assign({}, attachCrudConfig);
766
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
767
- this.disableEditFieldsNotInForm();
761
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata()) === null || _b === void 0 ? void 0 : _b.then(() => {
762
+ var _a, _b;
763
+ this.crudConfig = Object.assign({}, attachCrudConfig);
764
+ (_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));
765
+ });
768
766
  }
769
767
  }
770
768
  initDataUnitLoaders() {
@@ -268,7 +268,7 @@ const SnkCrud = class {
268
268
  continue;
269
269
  }
270
270
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
271
- if (!rmPrecision) {
271
+ if (!rmPrecision && rmPrecision !== 0) {
272
272
  continue;
273
273
  }
274
274
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -8,7 +8,7 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const index = require('./index-0922807b.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  const DataFetcher = require('./DataFetcher-313debd8.js');
11
- const snkDataUnit = require('./snk-data-unit-e9681eea.js');
11
+ const snkDataUnit = require('./snk-data-unit-eca53cfc.js');
12
12
  require('./pesquisa-fetcher-680e198f.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -191,7 +191,8 @@ const SnkDataUnit = class {
191
191
  return cacheName;
192
192
  }
193
193
  updateDataStateRmp(newValue) {
194
- Object.assign(this.dataState.rowMetadata || {}, newValue);
194
+ const newRowMetadata = Object.assign({}, newValue);
195
+ this.dataState.rowMetadata = newRowMetadata;
195
196
  }
196
197
  saveCacheRmd(record) {
197
198
  const rmd = record.__record__metadata__;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-e9681eea.js');
5
+ const snkDataUnit = require('./snk-data-unit-eca53cfc.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils');
@@ -117,7 +117,7 @@ const SnkForm = class {
117
117
  continue;
118
118
  }
119
119
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
120
- if (!rmPrecision) {
120
+ if (!rmPrecision && rmPrecision !== 0) {
121
121
  continue;
122
122
  }
123
123
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -9,7 +9,7 @@ const ConfigStorage = require('./ConfigStorage-942ce74b.js');
9
9
  const index$1 = require('./index-0922807b.js');
10
10
  const fieldSearch = require('./field-search-f56aa7d6.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const IExporterProvider = require('./IExporterProvider-853e5efc.js');
12
+ const IExporterProvider = require('./IExporterProvider-0c814e9a.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
14
  require('./DataFetcher-313debd8.js');
15
15
  require('./pesquisa-fetcher-680e198f.js');
@@ -9,7 +9,7 @@ const constants = require('./constants-35ddd366.js');
9
9
  const taskbarElements = require('./taskbar-elements-d9392685.js');
10
10
  require('./DataFetcher-313debd8.js');
11
11
  require('./pesquisa-fetcher-680e198f.js');
12
- const IExporterProvider = require('./IExporterProvider-853e5efc.js');
12
+ const IExporterProvider = require('./IExporterProvider-0c814e9a.js');
13
13
  const index = require('./index-0922807b.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -270,7 +270,7 @@ const SnkSimpleCrud = class {
270
270
  continue;
271
271
  }
272
272
  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);
273
- if (!rmPrecision) {
273
+ if (!rmPrecision && rmPrecision !== 0) {
274
274
  continue;
275
275
  }
276
276
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -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 {
@@ -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);
@@ -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 {
@@ -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() {
@@ -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);
@@ -4,7 +4,7 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
4
4
  import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-0ece87a6.js';
5
5
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-8457af36.js';
6
6
  import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
7
- import { S as SnkDataUnit } from './snk-data-unit-3bf015c8.js';
7
+ import { S as SnkDataUnit } from './snk-data-unit-49b898f7.js';
8
8
  import './pesquisa-fetcher-03c8f919.js';
9
9
  import './ISave-d8c8bc59.js';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -189,7 +189,8 @@ const SnkDataUnit = class {
189
189
  return cacheName;
190
190
  }
191
191
  updateDataStateRmp(newValue) {
192
- Object.assign(this.dataState.rowMetadata || {}, newValue);
192
+ const newRowMetadata = Object.assign({}, newValue);
193
+ this.dataState.rowMetadata = newRowMetadata;
193
194
  }
194
195
  saveCacheRmd(record) {
195
196
  const rmd = record.__record__metadata__;
@@ -1,4 +1,4 @@
1
- export { S as snk_data_unit } from './snk-data-unit-3bf015c8.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-49b898f7.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
@@ -113,7 +113,7 @@ const SnkForm = class {
113
113
  continue;
114
114
  }
115
115
  const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
116
- if (!rmPrecision) {
116
+ if (!rmPrecision && rmPrecision !== 0) {
117
117
  continue;
118
118
  }
119
119
  await this.setFieldProp(field, 'precision', rmPrecision);
@@ -5,7 +5,7 @@ import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
5
5
  import { P as PresentationMode } from './index-0ece87a6.js';
6
6
  import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
- import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter } from './IExporterProvider-cdcbe084.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter } from './IExporterProvider-c0194569.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
10
  import './DataFetcher-c1baf61d.js';
11
11
  import './pesquisa-fetcher-03c8f919.js';
@@ -5,7 +5,7 @@ import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
5
5
  import { T as TaskbarElement } from './taskbar-elements-ad766858.js';
6
6
  import './DataFetcher-c1baf61d.js';
7
7
  import './pesquisa-fetcher-03c8f919.js';
8
- import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, a as CrudUtils } from './IExporterProvider-cdcbe084.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, a as CrudUtils } from './IExporterProvider-c0194569.js';
9
9
  import { D as DataExporterOption, P as PresentationMode } from './index-0ece87a6.js';
10
10
  import './ISave-d8c8bc59.js';
11
11
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -266,7 +266,7 @@ const SnkSimpleCrud = class {
266
266
  continue;
267
267
  }
268
268
  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);
269
- if (!rmPrecision) {
269
+ if (!rmPrecision && rmPrecision !== 0) {
270
270
  continue;
271
271
  }
272
272
  await this.setFieldProp(field, 'precision', rmPrecision);