@sankhyalabs/sankhyablocks 8.16.0-rc.1 → 8.16.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-e49214c6.js} +2 -2
  2. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
  3. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  4. package/dist/cjs/{IExporterProvider-597949f9.js → IExporterProvider-8c030a7e.js} +5 -5
  5. package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-beebf47a.js} +2 -2
  6. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-cceebbae.js} +2 -2
  7. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-d4873076.js} +1 -1
  9. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-a1d0353f.js} +1 -1
  12. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  13. package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
  14. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  15. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  16. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -9
  18. package/dist/cjs/{snk-data-unit-04df81bf.js → snk-data-unit-c7dcfa19.js} +18 -10
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
  21. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +19 -11
  23. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  24. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  25. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  26. package/dist/cjs/snk-grid.cjs.entry.js +9 -9
  27. package/dist/cjs/{snk-guides-viewer-bdc41281.js → snk-guides-viewer-69ec61af.js} +5 -5
  28. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  29. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  30. package/dist/cjs/snk-simple-crud.cjs.entry.js +9 -10
  31. package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
  32. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  33. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +1 -1
  34. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  35. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  36. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  37. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  38. package/dist/collection/components/snk-data-unit/snk-data-unit.js +16 -8
  39. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +16 -8
  40. package/dist/collection/components/snk-grid/snk-grid.js +1 -1
  41. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -20
  42. package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
  43. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +2 -2
  44. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
  45. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  46. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  47. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  48. package/dist/components/DataFetcher.js +8 -3
  49. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  50. package/dist/components/IExporterProvider.js +2 -2
  51. package/dist/components/SnkMessageBuilder.js +2 -2
  52. package/dist/components/snk-actions-button2.js +12 -9
  53. package/dist/components/snk-data-exporter2.js +2 -2
  54. package/dist/components/snk-data-unit2.js +18 -47
  55. package/dist/components/snk-detail-view2.js +1 -1
  56. package/dist/components/snk-exporter-email-sender2.js +1 -1
  57. package/dist/components/snk-filter-bar2.js +16 -8
  58. package/dist/components/snk-grid2.js +3 -3
  59. package/dist/components/snk-simple-crud2.js +3 -3
  60. package/dist/components/snk-taskbar2.js +24 -2
  61. package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-e476378d.js} +2 -2
  62. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
  63. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  64. package/dist/esm/{IExporterProvider-63a188b6.js → IExporterProvider-f86019db.js} +6 -6
  65. package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-298cd647.js} +2 -2
  66. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-ae87b754.js} +2 -2
  67. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
  68. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-3d2ec959.js} +1 -1
  69. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
  70. package/dist/esm/loader.js +1 -1
  71. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-a87445a0.js} +1 -1
  72. package/dist/esm/sankhyablocks.js +1 -1
  73. package/dist/esm/snk-actions-button_4.entry.js +17 -14
  74. package/dist/esm/snk-application.entry.js +7 -7
  75. package/dist/esm/snk-attach.entry.js +5 -5
  76. package/dist/esm/snk-crud.entry.js +5 -5
  77. package/dist/esm/snk-data-exporter.entry.js +9 -9
  78. package/dist/esm/{snk-data-unit-8eec78bd.js → snk-data-unit-3276e55e.js} +18 -10
  79. package/dist/esm/snk-data-unit.entry.js +5 -5
  80. package/dist/esm/snk-detail-view.entry.js +9 -9
  81. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  82. package/dist/esm/snk-filter-bar.entry.js +19 -11
  83. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  84. package/dist/esm/snk-form-config.entry.js +2 -2
  85. package/dist/esm/snk-form.entry.js +4 -4
  86. package/dist/esm/snk-grid.entry.js +9 -9
  87. package/dist/esm/{snk-guides-viewer-dda0fede.js → snk-guides-viewer-43f21b03.js} +5 -5
  88. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  89. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  90. package/dist/esm/snk-simple-crud.entry.js +9 -10
  91. package/dist/esm/snk-taskbar.entry.js +23 -1
  92. package/dist/sankhyablocks/{p-fe79f83a.js → p-091ce761.js} +1 -1
  93. package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
  94. package/dist/sankhyablocks/{p-045eae4d.entry.js → p-162b9a59.entry.js} +2 -2
  95. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  96. package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
  97. package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
  98. package/dist/sankhyablocks/p-1a21b61a.entry.js +1 -0
  99. package/dist/sankhyablocks/p-1e596b15.entry.js +1 -0
  100. package/dist/sankhyablocks/{p-fa4d8cb4.js → p-1f35c795.js} +1 -1
  101. package/dist/sankhyablocks/{p-af8efd95.js → p-25f1fc39.js} +1 -1
  102. package/dist/sankhyablocks/{p-62ba211a.entry.js → p-2e9c764c.entry.js} +1 -1
  103. package/dist/sankhyablocks/{p-52920496.js → p-3287a6cc.js} +1 -1
  104. package/dist/sankhyablocks/{p-7505da04.entry.js → p-42f7b05d.entry.js} +1 -1
  105. package/dist/sankhyablocks/p-4e1b47a4.js +1 -0
  106. package/dist/sankhyablocks/{p-b05d8893.entry.js → p-53412c1d.entry.js} +1 -1
  107. package/dist/sankhyablocks/p-594bc21d.js +1 -0
  108. package/dist/sankhyablocks/p-5b26cc7c.entry.js +1 -0
  109. package/dist/sankhyablocks/{p-2a408684.js → p-5f016aed.js} +1 -1
  110. package/dist/sankhyablocks/p-6d55957a.js +1 -0
  111. package/dist/sankhyablocks/p-7b8f7242.entry.js +1 -0
  112. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  113. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  114. package/dist/sankhyablocks/p-92ed1d24.entry.js +1 -0
  115. package/dist/sankhyablocks/{p-450c60e4.entry.js → p-939e15d3.entry.js} +1 -1
  116. package/dist/sankhyablocks/{p-47db7e88.entry.js → p-9dfda04a.entry.js} +1 -1
  117. package/dist/sankhyablocks/p-aa5b3b2c.entry.js +1 -0
  118. package/dist/sankhyablocks/{p-7a85fd49.entry.js → p-aa6d510d.entry.js} +1 -1
  119. package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-bd008859.entry.js} +1 -1
  120. package/dist/sankhyablocks/{p-c1d57831.entry.js → p-fd8a58ff.entry.js} +1 -1
  121. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  122. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  123. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  124. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
  125. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -4
  126. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  127. package/dist/types/components.d.ts +10 -2
  128. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  129. package/package.json +2 -2
  130. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  131. package/dist/sankhyablocks/p-3a212712.js +0 -1
  132. package/dist/sankhyablocks/p-46d38387.entry.js +0 -1
  133. package/dist/sankhyablocks/p-4e5e1313.entry.js +0 -1
  134. package/dist/sankhyablocks/p-547eeac8.entry.js +0 -1
  135. package/dist/sankhyablocks/p-75e674ed.entry.js +0 -1
  136. package/dist/sankhyablocks/p-7a337364.js +0 -1
  137. package/dist/sankhyablocks/p-7b08d0f8.entry.js +0 -1
  138. package/dist/sankhyablocks/p-9863d682.js +0 -1
  139. package/dist/sankhyablocks/p-d6e26ea8.entry.js +0 -1
  140. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  141. package/dist/sankhyablocks/p-e549f7d1.js +0 -1
  142. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  143. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -110,7 +110,7 @@ export class ItemBuilder {
110
110
  getExportToXLS(groupName) {
111
111
  return {
112
112
  id: DataExporterOption.EXPORT_TO_XLS,
113
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,
113
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
114
114
  group: groupName
115
115
  };
116
116
  }
@@ -153,7 +153,7 @@ export class ItemBuilder {
153
153
  getExportPageToXLS() {
154
154
  return {
155
155
  id: DataExporterOption.EXPORT_PAGE_TO_XLS,
156
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
156
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
157
157
  };
158
158
  }
159
159
  /**
@@ -4,8 +4,8 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
4
4
  import { OperationMap, SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
5
5
  import { DatasetStrategy } from '../../lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy';
6
6
  import { getRecordValue } from '../../lib/dataUnit/ValueFormatter';
7
- import { getSelectedIDs } from '../snk-data-exporter/utils/RecordIDUtils';
8
7
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
8
+ import { getSelectedRecordsIDsInfo } from '../../lib/utils/GetSelectedRecordsIDsInfo';
9
9
  export class SnkDataUnit {
10
10
  constructor() {
11
11
  this._onDataUnitResolve = [];
@@ -110,7 +110,7 @@ export class SnkDataUnit {
110
110
  * @returns Retorna a lista de IDs dos registros selecionados.
111
111
  */
112
112
  async getSelectedRecordsIDsInfo() {
113
- return Promise.resolve(getSelectedIDs(this.dataUnit));
113
+ return getSelectedRecordsIDsInfo(this.dataUnit);
114
114
  }
115
115
  /**
116
116
  * Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
@@ -540,18 +540,26 @@ export class SnkDataUnit {
540
540
  return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
541
541
  }
542
542
  }
543
+ updateMetadataWithRMP() {
544
+ this.fillFieldsWithRmp(this.dataUnit.metadata);
545
+ this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
546
+ const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
547
+ this.dataUnit.metadata = dataUnitUpdatedMetadata;
548
+ }
543
549
  async loadDataUnit() {
544
- var _a;
550
+ var _a, _b;
545
551
  if (this.dataUnit == null && this._application && this.entityName) {
546
552
  this.dataUnit = await this.getDataUnitParentOrChild();
547
553
  }
548
554
  if (this.dataUnit) {
549
555
  this.dataUnit.pageSize = this.pageSize;
550
556
  this.dataUnit.unsubscribe(this._dataUnitObserver);
551
- this.dataUnit.addInterceptor(this);
552
557
  this.dataUnit.subscribe(this._dataUnitObserver);
553
- await this.dataUnit.loadMetadata();
554
- if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
558
+ if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
559
+ this.updateMetadataWithRMP();
560
+ }
561
+ this.dataUnit.addInterceptor(this);
562
+ if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
555
563
  this.getMetadataByRow(this.dataUnit);
556
564
  }
557
565
  this.dataState = this.buildDataState();
@@ -617,11 +625,11 @@ export class SnkDataUnit {
617
625
  }
618
626
  }
619
627
  instanceMessagesBuilder() {
620
- var _a, _b;
628
+ var _a;
621
629
  if (this.messagesBuilder) {
622
630
  return;
623
631
  }
624
- this.messagesBuilder = new SnkMessageBuilder((_b = (_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName) !== null && _b !== void 0 ? _b : 'InMemoryDomain');
632
+ this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
625
633
  }
626
634
  //---------------------------------------------
627
635
  // Lifecycle web component
@@ -15,13 +15,13 @@ export class SnkFilterBar {
15
15
  this._pendingVariables = false;
16
16
  this._customfiltersToBeUpdated = [];
17
17
  this._calculateSortIndex = (item) => {
18
- let index = item.hardFixed ? 1000000 : 0;
19
- //campos Hard Fixed não variam a ordem
20
- if (!item.hardFixed) {
21
- index += item.fixed ? 100000 : 0;
22
- index += item.value == undefined ? 0 : 10000;
23
- index += this._updateSequence.lastIndexOf(item.id) + 1;
24
- }
18
+ if (!item.visible)
19
+ return 0;
20
+ if (item.hardFixed)
21
+ return 1000000; //campos Hard Fixed não variam a ordem
22
+ let index = item.fixed ? 100000 : 0;
23
+ index += this.hasValidValue(item) ? 10000 : 0;
24
+ index += this._updateSequence.lastIndexOf(item.id) + 1;
25
25
  return index;
26
26
  };
27
27
  this._filtersComparator = (a, b) => {
@@ -42,6 +42,13 @@ export class SnkFilterBar {
42
42
  this.showPersonalizedFilter = false;
43
43
  this.personalizedFilterId = undefined;
44
44
  }
45
+ hasValidValue(item) {
46
+ if (item.value === undefined || item.value === null)
47
+ return false;
48
+ if (!Array.isArray(item.value))
49
+ return true;
50
+ return item.value.some(filterItem => filterItem.check === true);
51
+ }
45
52
  observeFilterConfig(newValue, oldValue) {
46
53
  if (ObjectUtils.equals(newValue, oldValue))
47
54
  return;
@@ -268,7 +275,7 @@ export class SnkFilterBar {
268
275
  getFilterItems() {
269
276
  const pinnedItems = [];
270
277
  const unpinnedItems = [];
271
- this.filterConfig
278
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
272
279
  .filter(this.filterActiveFilter)
273
280
  .forEach((item, index) => {
274
281
  item = ObjectUtils.copy(item);
@@ -338,6 +345,7 @@ export class SnkFilterBar {
338
345
  .then((filters) => {
339
346
  accept();
340
347
  this.filterConfig = filters.map(item => this.normalizeItem(item));
348
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
341
349
  })
342
350
  .catch(reason => {
343
351
  throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
@@ -309,7 +309,7 @@ export class SnkGrid {
309
309
  const disabledButtons = [];
310
310
  if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) {
311
311
  if (this._dataState.selectionInfo.length > 1) {
312
- disabledButtons.push(TaskbarElement.CLONE, "ATTACH");
312
+ disabledButtons.push(TaskbarElement.CLONE, "ATTACH", TaskbarElement.UPDATE);
313
313
  }
314
314
  if (this._dataState.selectionInfo.isAllRecords()) {
315
315
  disabledButtons.push("REMOVE");
@@ -57,7 +57,6 @@ export class SnkSimpleCrud {
57
57
  this.ignoreReadOnlyFormFields = false;
58
58
  this.autoFocus = true;
59
59
  this.domainMessagesBuilder = undefined;
60
- this.domainMessagesBuilder = 'InMemoryDomain';
61
60
  this.autoLoad = undefined;
62
61
  }
63
62
  /**
@@ -1100,29 +1099,11 @@ export class SnkSimpleCrud {
1100
1099
  "optional": false,
1101
1100
  "docs": {
1102
1101
  "tags": [],
1103
- "text": "Ignora os campos \"somente leitura\" no modo de inser\u00E7\u00E3o.\nDefine a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
1102
+ "text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
1104
1103
  },
1105
1104
  "attribute": "domain-messages-builder",
1106
1105
  "reflect": false
1107
1106
  },
1108
- "domainMessagesBuilder": {
1109
- "type": "string",
1110
- "mutable": false,
1111
- "complexType": {
1112
- "original": "string",
1113
- "resolved": "string",
1114
- "references": {}
1115
- },
1116
- "required": false,
1117
- "optional": false,
1118
- "docs": {
1119
- "tags": [],
1120
- "text": "Ignora os campos \"somente leitura\" no modo de inser\u00E7\u00E3o.\nDefine a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
1121
- },
1122
- "attribute": "domain-messages-builder",
1123
- "reflect": false,
1124
- "defaultValue": "'InMemoryDomain'"
1125
- },
1126
1107
  "autoLoad": {
1127
1108
  "type": "boolean",
1128
1109
  "mutable": false,
@@ -29,6 +29,7 @@ export class SnkTaskbar {
29
29
  this.onSaveEvent = (action) => {
30
30
  switch (action.type) {
31
31
  case DUAction.FIELD_INVALIDATED:
32
+ case DUAction.INVALIDATE_CLEAN:
32
33
  case DUAction.DATA_SAVED:
33
34
  case DUAction.SAVING_ERROR:
34
35
  this._isWaitingForSave = false;
@@ -67,6 +68,16 @@ export class SnkTaskbar {
67
68
  this.getCustomElements(true);
68
69
  }
69
70
  }
71
+ handleTaskbarSaveLocker() {
72
+ if (this._isWaitingForSave !== true) {
73
+ this._isWaitingForSave = true;
74
+ }
75
+ }
76
+ handleTaskbarSaveUnlocker() {
77
+ if (this._isWaitingForSave === true) {
78
+ this._isWaitingForSave = false;
79
+ }
80
+ }
70
81
  hasToSearchCustomElements(event) {
71
82
  return this.customSlotId === event.detail && !this._slotContainer;
72
83
  }
@@ -85,6 +96,14 @@ export class SnkTaskbar {
85
96
  this._hasToUpdateOverFlow = true;
86
97
  }
87
98
  }
99
+ observeIsWaitingForSave(newValue, oldValue) {
100
+ if (newValue == true && oldValue == false) {
101
+ this.taskbarSaveLocker.emit();
102
+ }
103
+ if (newValue == false && oldValue == true) {
104
+ this.taskbarSaveUnlocker.emit();
105
+ }
106
+ }
88
107
  // Internal methods
89
108
  elementsFromString(strButtons) {
90
109
  const elements = [];
@@ -719,6 +738,36 @@ export class SnkTaskbar {
719
738
  "resolved": "string",
720
739
  "references": {}
721
740
  }
741
+ }, {
742
+ "method": "taskbarSaveLocker",
743
+ "name": "taskbarSaveLocker",
744
+ "bubbles": true,
745
+ "cancelable": true,
746
+ "composed": true,
747
+ "docs": {
748
+ "tags": [],
749
+ "text": "Emitido sempre que um save \u00E9 iniciado pela taskbar."
750
+ },
751
+ "complexType": {
752
+ "original": "void",
753
+ "resolved": "void",
754
+ "references": {}
755
+ }
756
+ }, {
757
+ "method": "taskbarSaveUnlocker",
758
+ "name": "taskbarSaveUnlocker",
759
+ "bubbles": true,
760
+ "cancelable": true,
761
+ "composed": true,
762
+ "docs": {
763
+ "tags": [],
764
+ "text": "Emitido sempre que o ocorre alguma action que libera o save."
765
+ },
766
+ "complexType": {
767
+ "original": "void",
768
+ "resolved": "void",
769
+ "references": {}
770
+ }
722
771
  }];
723
772
  }
724
773
  static get elementRef() { return "_element"; }
@@ -732,6 +781,9 @@ export class SnkTaskbar {
732
781
  }, {
733
782
  "propName": "_lastWidth",
734
783
  "methodName": "observeLastWidth"
784
+ }, {
785
+ "propName": "_isWaitingForSave",
786
+ "methodName": "observeIsWaitingForSave"
735
787
  }];
736
788
  }
737
789
  static get listeners() {
@@ -741,6 +793,18 @@ export class SnkTaskbar {
741
793
  "target": "window",
742
794
  "capture": false,
743
795
  "passive": false
796
+ }, {
797
+ "name": "taskbarSaveLocker",
798
+ "method": "handleTaskbarSaveLocker",
799
+ "target": "window",
800
+ "capture": false,
801
+ "passive": false
802
+ }, {
803
+ "name": "taskbarSaveUnlocker",
804
+ "method": "handleTaskbarSaveUnlocker",
805
+ "target": "window",
806
+ "capture": false,
807
+ "passive": false
744
808
  }];
745
809
  }
746
810
  }
@@ -1,4 +1,4 @@
1
- import { NumberUtils, ObjectUtils } from "@sankhyalabs/core";
1
+ import { NumberUtils, ObjectUtils, StringUtils } from "@sankhyalabs/core";
2
2
  export default class RmPrecisionCustomValueFormatter {
3
3
  setGrid(grid) {
4
4
  if (this._grid) {
@@ -16,7 +16,7 @@ export default class RmPrecisionCustomValueFormatter {
16
16
  }
17
17
  format(currentValue, column, recordId) {
18
18
  var _a;
19
- if (!currentValue) {
19
+ if (StringUtils.isEmpty(currentValue)) {
20
20
  return currentValue;
21
21
  }
22
22
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
6
6
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
7
7
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
8
8
  };
9
- import { ApplicationContext, ErrorException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
9
+ import { ApplicationContext, ErrorException, ServiceCanceledException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
10
10
  import { batchRequests } from 'graphql-request';
11
11
  import UrlUtils from "../../../lib/utils/urlutils";
12
12
  import { PrintUtils } from '../../utils/PrintUtils';
@@ -372,9 +372,14 @@ export class DataFetcher {
372
372
  resolve(false);
373
373
  })
374
374
  ]).then((data) => {
375
- var _a;
375
+ var _a, _b;
376
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));
377
+ if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
378
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ServiceCanceledException("Service canceled", val.message));
379
+ }
380
+ else {
381
+ (((_b = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
382
+ }
378
383
  }
379
384
  });
380
385
  });
@@ -6,7 +6,7 @@ const snkDataUnitMessages = {
6
6
  },
7
7
  cancelInfo: {
8
8
  clone: "Duplicação descartada!",
9
- insert: "A inclusão descartada!",
9
+ insert: "A inclusão foi descartada!",
10
10
  update: "A edição foi descartada!"
11
11
  },
12
12
  confirm: {
@@ -7,7 +7,7 @@ const snkExporterMessages = {
7
7
  emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
8
8
  emailSenderOptStep_lblFormat: "Formato:",
9
9
  emailSenderOptStep_formatPDF: "PDF (.pdf)",
10
- emailSenderOptStep_formatXLSX: "Planilha (.xlsx)",
10
+ emailSenderOptStep_formatXLS: "Planilha (.xls)",
11
11
  emailSenderOptStep_export: "Exportar:",
12
12
  emailSenderOptStep_allData: "Toda a grade",
13
13
  emailSenderOptStep_currentPage: "Somente a página atual",
@@ -1,29 +1,29 @@
1
1
  import { DataType, JSUtils } from "@sankhyalabs/core";
2
- export const getSelectedIDs = (dataUnit) => {
3
- const selectionInfo = dataUnit.getSelectionInfo();
2
+ export function getSelectedRecordsIDsInfo(dataUnit) {
3
+ const selectionInfo = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo();
4
4
  if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
5
5
  return [];
6
6
  }
7
7
  const selectedRecordsIDsInfo = [];
8
- const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.recordIds;
8
+ const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.records;
9
9
  if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
10
- selectedRecords.forEach(recordId => {
11
- if (!dataUnit.isNewRecord(recordId)) {
10
+ selectedRecords.forEach(({ __record__id__ }) => {
11
+ if (!dataUnit.isNewRecord(__record__id__)) {
12
12
  /*
13
13
  Esse if foi necessário para tratar corretamente o ID
14
14
  do record quando está sendo utilizado no modo standAlone
15
15
  isso não faz a exportação da grid funcionar no modo standAlone
16
16
  mas deixa de causar erro nas oprações de CRUD.
17
17
  */
18
- if (!JSUtils.isBase64(recordId)) {
18
+ if (!JSUtils.isBase64(__record__id__)) {
19
19
  selectedRecordsIDsInfo.push({
20
20
  name: "__record__id__",
21
21
  type: DataType.TEXT,
22
- value: recordId
22
+ value: __record__id__
23
23
  });
24
24
  return;
25
25
  }
26
- const revertBase64ToObject = JSON.parse(window.atob(recordId));
26
+ const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
27
27
  Object.entries(revertBase64ToObject).forEach(([name, value]) => {
28
28
  const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
29
29
  if (metadataField == undefined) {
@@ -35,4 +35,4 @@ export const getSelectedIDs = (dataUnit) => {
35
35
  });
36
36
  }
37
37
  return selectedRecordsIDsInfo;
38
- };
38
+ }
@@ -1,4 +1,4 @@
1
- import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils } from '@sankhyalabs/core';
1
+ import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, ServiceCanceledException } from '@sankhyalabs/core';
2
2
  import { P as PrintUtils } from './PrintUtils.js';
3
3
  import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
4
 
@@ -6883,9 +6883,14 @@ class DataFetcher {
6883
6883
  resolve(false);
6884
6884
  })
6885
6885
  ]).then((data) => {
6886
- var _a;
6886
+ var _a, _b;
6887
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));
6888
+ if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
6889
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ServiceCanceledException("Service canceled", val.message));
6890
+ }
6891
+ else {
6892
+ (((_b = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6893
+ }
6889
6894
  }
6890
6895
  });
6891
6896
  });
@@ -1,30 +1,30 @@
1
1
  import { JSUtils, DataType } from '@sankhyalabs/core';
2
2
 
3
- const getSelectedIDs = (dataUnit) => {
4
- const selectionInfo = dataUnit.getSelectionInfo();
3
+ function getSelectedRecordsIDsInfo(dataUnit) {
4
+ const selectionInfo = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo();
5
5
  if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
6
6
  return [];
7
7
  }
8
8
  const selectedRecordsIDsInfo = [];
9
- const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.recordIds;
9
+ const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.records;
10
10
  if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
11
- selectedRecords.forEach(recordId => {
12
- if (!dataUnit.isNewRecord(recordId)) {
11
+ selectedRecords.forEach(({ __record__id__ }) => {
12
+ if (!dataUnit.isNewRecord(__record__id__)) {
13
13
  /*
14
14
  Esse if foi necessário para tratar corretamente o ID
15
15
  do record quando está sendo utilizado no modo standAlone
16
16
  isso não faz a exportação da grid funcionar no modo standAlone
17
17
  mas deixa de causar erro nas oprações de CRUD.
18
18
  */
19
- if (!JSUtils.isBase64(recordId)) {
19
+ if (!JSUtils.isBase64(__record__id__)) {
20
20
  selectedRecordsIDsInfo.push({
21
21
  name: "__record__id__",
22
22
  type: DataType.TEXT,
23
- value: recordId
23
+ value: __record__id__
24
24
  });
25
25
  return;
26
26
  }
27
- const revertBase64ToObject = JSON.parse(window.atob(recordId));
27
+ const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
28
28
  Object.entries(revertBase64ToObject).forEach(([name, value]) => {
29
29
  const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
30
30
  if (metadataField == undefined) {
@@ -36,6 +36,6 @@ const getSelectedIDs = (dataUnit) => {
36
36
  });
37
37
  }
38
38
  return selectedRecordsIDsInfo;
39
- };
39
+ }
40
40
 
41
- export { getSelectedIDs as g };
41
+ export { getSelectedRecordsIDsInfo as g };
@@ -1,6 +1,6 @@
1
1
  import { D as DataFetcher } from './DataFetcher.js';
2
2
  import './pesquisa-fetcher.js';
3
- import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, NumberUtils, DataType } from '@sankhyalabs/core';
3
+ import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
4
4
  import './ISave.js';
5
5
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
6
6
  import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -225,7 +225,7 @@ class RmPrecisionCustomValueFormatter {
225
225
  }
226
226
  format(currentValue, column, recordId) {
227
227
  var _a;
228
- if (!currentValue) {
228
+ if (StringUtils.isEmpty(currentValue)) {
229
229
  return currentValue;
230
230
  }
231
231
  const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
@@ -8,7 +8,7 @@ const snkDataUnitMessages = {
8
8
  },
9
9
  cancelInfo: {
10
10
  clone: "Duplicação descartada!",
11
- insert: "A inclusão descartada!",
11
+ insert: "A inclusão foi descartada!",
12
12
  update: "A edição foi descartada!"
13
13
  },
14
14
  confirm: {
@@ -122,7 +122,7 @@ const snkExporterMessages = {
122
122
  emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
123
123
  emailSenderOptStep_lblFormat: "Formato:",
124
124
  emailSenderOptStep_formatPDF: "PDF (.pdf)",
125
- emailSenderOptStep_formatXLSX: "Planilha (.xlsx)",
125
+ emailSenderOptStep_formatXLS: "Planilha (.xls)",
126
126
  emailSenderOptStep_export: "Exportar:",
127
127
  emailSenderOptStep_allData: "Toda a grade",
128
128
  emailSenderOptStep_currentPage: "Somente a página atual",
@@ -9,6 +9,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
9
  import './dataunit-fetcher.js';
10
10
  import './filter-item-type.enum.js';
11
11
  import './form-config-fetcher.js';
12
+ import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
12
13
  import { R as ResourceIDUtils } from './ResourceIDUtils.js';
13
14
 
14
15
  const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
@@ -161,7 +162,6 @@ var RefreshType;
161
162
 
162
163
  const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
163
164
  const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
164
- const NUFIN_COLUMN = 'NUFIN';
165
165
  const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
166
166
  class Actions {
167
167
  constructor(actionsExecuteInterface, dataUnit, appResourceId) {
@@ -173,6 +173,10 @@ class Actions {
173
173
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
174
174
  this._appResourceId = appResourceId;
175
175
  }
176
+ getPrimaryKeys() {
177
+ const ids = getSelectedRecordsIDsInfo(this._dataUnit);
178
+ return ids.map(({ name }) => name);
179
+ }
176
180
  apply(action, hasParamsToSave) {
177
181
  this._application.closePopUp();
178
182
  this._actionsExecuteInterface.execute(action, this._dataUnit)
@@ -441,6 +445,7 @@ class Actions {
441
445
  executeAction(execSource);
442
446
  }
443
447
  addRows(execSource) {
448
+ const primaryKeys = this.getPrimaryKeys();
444
449
  const rows = {
445
450
  row: []
446
451
  };
@@ -454,15 +459,13 @@ class Actions {
454
459
  delete sourceRow[MASTER_ROW_PROPERTY];
455
460
  delete sourceRow[ENTITY_NAME_PROPERTY];
456
461
  }
457
- for (const fieldName in sourceRow) {
458
- if (fieldName !== NUFIN_COLUMN)
459
- continue;
460
- if (!row.field) {
461
- row.field = [];
462
- }
462
+ if (!row.field) {
463
+ row.field = [];
464
+ }
465
+ for (const primaryKey of primaryKeys) {
463
466
  row.field.push({
464
- fieldName: fieldName,
465
- $: sourceRow[fieldName]
467
+ fieldName: primaryKey,
468
+ $: sourceRow[primaryKey]
466
469
  });
467
470
  }
468
471
  rows.row.push(row);
@@ -124,7 +124,7 @@ class ItemBuilder {
124
124
  getExportToXLS(groupName) {
125
125
  return {
126
126
  id: DataExporterOption.EXPORT_TO_XLS,
127
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,
127
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
128
128
  group: groupName
129
129
  };
130
130
  }
@@ -167,7 +167,7 @@ class ItemBuilder {
167
167
  getExportPageToXLS() {
168
168
  return {
169
169
  id: DataExporterOption.EXPORT_PAGE_TO_XLS,
170
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
170
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
171
171
  };
172
172
  }
173
173
  /**