@sankhyalabs/sankhyablocks 8.15.0-dev.81 → 8.15.0-dev.83

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 (84) hide show
  1. package/dist/cjs/{IExporterProvider-0c814e9a.js → IExporterProvider-c78cb1b8.js} +3 -3
  2. package/dist/cjs/{SnkMessageBuilder-4a95fe86.js → SnkMessageBuilder-722b104e.js} +2 -0
  3. package/dist/cjs/{index-0922807b.js → index-1dfc7a6e.js} +5 -0
  4. package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
  5. package/dist/cjs/snk-application.cjs.entry.js +10 -15
  6. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  7. package/dist/cjs/snk-crud.cjs.entry.js +2 -2
  8. package/dist/cjs/snk-data-exporter.cjs.entry.js +114 -11
  9. package/dist/cjs/{snk-data-unit-eca53cfc.js → snk-data-unit-56babf28.js} +7 -3
  10. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
  12. package/dist/cjs/snk-grid.cjs.entry.js +3 -3
  13. package/dist/cjs/{snk-guides-viewer-5d5f0f25.js → snk-guides-viewer-9867335b.js} +2 -2
  14. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  15. package/dist/cjs/snk-simple-crud.cjs.entry.js +3 -3
  16. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
  17. package/dist/cjs/{taskbar-elements-d9392685.js → taskbar-elements-9ad1f9c0.js} +1 -1
  18. package/dist/collection/components/snk-application/snk-application.js +11 -28
  19. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +7 -1
  20. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +7 -1
  21. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +2 -2
  22. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +23 -6
  23. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
  24. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +13 -0
  25. package/dist/collection/components/snk-data-unit/snk-data-unit.js +6 -2
  26. package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +18 -0
  27. package/dist/collection/lib/@types/index.js +5 -0
  28. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
  29. package/dist/components/IExporterProvider.js +2 -2
  30. package/dist/components/ISave.js +5 -0
  31. package/dist/components/SnkMessageBuilder.js +2 -0
  32. package/dist/components/snk-application2.js +9 -14
  33. package/dist/components/snk-data-exporter2.js +111 -8
  34. package/dist/components/snk-data-unit2.js +6 -2
  35. package/dist/esm/{IExporterProvider-c0194569.js → IExporterProvider-1deb5d0a.js} +3 -3
  36. package/dist/esm/{SnkMessageBuilder-3a767111.js → SnkMessageBuilder-89925609.js} +2 -0
  37. package/dist/esm/{index-0ece87a6.js → index-88d0c8ad.js} +5 -0
  38. package/dist/esm/snk-actions-button_4.entry.js +1 -1
  39. package/dist/esm/snk-application.entry.js +10 -15
  40. package/dist/esm/snk-attach.entry.js +2 -2
  41. package/dist/esm/snk-crud.entry.js +2 -2
  42. package/dist/esm/snk-data-exporter.entry.js +114 -11
  43. package/dist/esm/{snk-data-unit-49b898f7.js → snk-data-unit-56b5efc4.js} +7 -3
  44. package/dist/esm/snk-data-unit.entry.js +2 -2
  45. package/dist/esm/snk-detail-view.entry.js +4 -4
  46. package/dist/esm/snk-grid.entry.js +3 -3
  47. package/dist/esm/{snk-guides-viewer-ef8c4eec.js → snk-guides-viewer-7ae1b358.js} +2 -2
  48. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  49. package/dist/esm/snk-simple-crud.entry.js +3 -3
  50. package/dist/esm/snk-taskbar.entry.js +2 -2
  51. package/dist/esm/{taskbar-elements-ad766858.js → taskbar-elements-da72aae0.js} +1 -1
  52. package/dist/sankhyablocks/{p-5fa1576b.entry.js → p-0f4de966.entry.js} +2 -2
  53. package/dist/sankhyablocks/{p-294df368.entry.js → p-26e34ba3.entry.js} +1 -1
  54. package/dist/sankhyablocks/{p-3f1efb97.entry.js → p-32097e8a.entry.js} +1 -1
  55. package/dist/sankhyablocks/p-6071f6b4.entry.js +1 -0
  56. package/dist/sankhyablocks/p-7a337364.js +1 -0
  57. package/dist/sankhyablocks/{p-2ac8bd11.entry.js → p-8323db5f.entry.js} +1 -1
  58. package/dist/sankhyablocks/p-88a77075.js +1 -0
  59. package/dist/sankhyablocks/{p-039c7148.entry.js → p-9bdd4e27.entry.js} +1 -1
  60. package/dist/sankhyablocks/{p-8322ccdb.entry.js → p-9cb8a77b.entry.js} +1 -1
  61. package/dist/sankhyablocks/{p-58687027.entry.js → p-a0edbed5.entry.js} +1 -1
  62. package/dist/sankhyablocks/{p-babe7665.js → p-a7717247.js} +1 -1
  63. package/dist/sankhyablocks/{p-e5c25e0b.entry.js → p-b1ee6b27.entry.js} +1 -1
  64. package/dist/sankhyablocks/p-b9e318a8.js +1 -0
  65. package/dist/sankhyablocks/{p-a64baa0f.entry.js → p-c5b18d02.entry.js} +1 -1
  66. package/dist/sankhyablocks/{p-d26365ad.js → p-c65bbb31.js} +1 -1
  67. package/dist/sankhyablocks/{p-61dd89eb.js → p-ef402237.js} +1 -1
  68. package/dist/sankhyablocks/{p-04821c60.entry.js → p-f9815cc4.entry.js} +1 -1
  69. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  70. package/dist/types/components/snk-application/snk-application.d.ts +2 -5
  71. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +1 -0
  72. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
  73. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -0
  74. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
  75. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +2 -0
  76. package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
  77. package/dist/types/components.d.ts +2 -2
  78. package/dist/types/lib/@types/index.d.ts +5 -0
  79. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
  80. package/package.json +1 -1
  81. package/dist/sankhyablocks/p-38289a55.js +0 -1
  82. package/dist/sankhyablocks/p-4ce73e88.js +0 -1
  83. package/dist/sankhyablocks/p-ba05fdb8.entry.js +0 -1
  84. package/dist/sankhyablocks/p-f88cfc3c.js +0 -1
@@ -3,7 +3,7 @@
3
3
  const DataFetcher = require('./DataFetcher-313debd8.js');
4
4
  require('./pesquisa-fetcher-680e198f.js');
5
5
  const core = require('@sankhyalabs/core');
6
- require('./index-0922807b.js');
6
+ require('./index-1dfc7a6e.js');
7
7
  require('./ISave-e91b70a7.js');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
9
9
  const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -200,7 +200,7 @@ class CommonsExporter {
200
200
  const columnData = {
201
201
  label: column.label,
202
202
  id: column.name,
203
- width: (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UnitMetadata.UserInterface.SEARCH ? 30 : column.width,
203
+ width: column.width,
204
204
  type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
205
205
  userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
206
206
  customFormatter
@@ -212,7 +212,7 @@ class CommonsExporter {
212
212
  const descriptionColumn = {
213
213
  label: fieldData.properties.DESCRIPTIONENTITY,
214
214
  id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
215
- width: 200,
215
+ width: column.width,
216
216
  type: core.DataType.TEXT,
217
217
  userInterface: UnitMetadata.UserInterface.LONGTEXT,
218
218
  descriptionFrom: fieldData.name
@@ -307,6 +307,7 @@ const snkDataExporterMessages = {
307
307
  },
308
308
  label: {
309
309
  currentPage: "Somente a página atual",
310
+ allRecords: "Todos os registros",
310
311
  spreadsheet: "Planilha",
311
312
  cube: "Cubo",
312
313
  sendByEmail: "Enviar por email",
@@ -319,6 +320,7 @@ const snkDataExporterMessages = {
319
320
  },
320
321
  title: {
321
322
  error: "Erro",
323
+ permission: "Falha detectada",
322
324
  },
323
325
  limitExceeded: {
324
326
  title: "Atenção",
@@ -11,8 +11,11 @@ exports.DataExporterOption = void 0;
11
11
  DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
12
12
  DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
13
13
  DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
14
+ DataExporterOption["EXPORT_ALL_RECORDS"] = "exportAllRecords";
14
15
  DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
15
16
  DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
17
+ DataExporterOption["EXPORT_ALL_RECORDS_TO_PDF"] = "exportAllRecordsToPDF";
18
+ DataExporterOption["EXPORT_ALL_RECORDS_TO_XLS"] = "exportAllRecordsToXLS";
16
19
  DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
17
20
  DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
18
21
  DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
@@ -29,6 +32,8 @@ exports.DataExporterType = void 0;
29
32
  DataExporterType["EXPORT_TO_XLS"] = "XLS";
30
33
  DataExporterType["EXPORT_PAGE_TO_PDF"] = "PDF";
31
34
  DataExporterType["EXPORT_PAGE_TO_XLS"] = "XLS";
35
+ DataExporterType["EXPORT_ALL_RECORDS_TO_PDF"] = "PDF";
36
+ DataExporterType["EXPORT_ALL_RECORDS_TO_XLS"] = "XLS";
32
37
  DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
33
38
  DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
34
39
  })(exports.DataExporterType || (exports.DataExporterType = {}));
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
7
7
  const DataFetcher = require('./DataFetcher-313debd8.js');
8
8
  const ParamType = require('./ParamType-90b440a0.js');
9
9
  require('./pesquisa-fetcher-680e198f.js');
10
- require('./index-0922807b.js');
10
+ require('./index-1dfc7a6e.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -10,7 +10,7 @@ const DataFetcher = require('./DataFetcher-313debd8.js');
10
10
  const authFetcher = require('./auth-fetcher-54f5ff9d.js');
11
11
  const dataunitFetcher = require('./dataunit-fetcher-620b29a1.js');
12
12
  const pesquisaFetcher = require('./pesquisa-fetcher-680e198f.js');
13
- const SnkMessageBuilder = require('./SnkMessageBuilder-4a95fe86.js');
13
+ const SnkMessageBuilder = require('./SnkMessageBuilder-722b104e.js');
14
14
  require('./form-config-fetcher-2dd00e5b.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
16
  require('./PrintUtils-bcaeb82f.js');
@@ -624,7 +624,7 @@ const SnkApplication = class {
624
624
  * Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
625
625
  * passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
626
626
  */
627
- async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options) {
627
+ async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
628
628
  if (resourceID == undefined) {
629
629
  resourceID = this.applicationResourceID;
630
630
  }
@@ -634,18 +634,13 @@ const SnkApplication = class {
634
634
  duPromisses.push(new PendingPromise(resolve, reject));
635
635
  if (!waitingDu) {
636
636
  const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
637
- if (options === null || options === void 0 ? void 0 : options.skipLoadMetadata) {
637
+ dataUnit.loadMetadata().then(() => {
638
638
  this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
639
- }
640
- else {
641
- dataUnit.loadMetadata().then(() => {
642
- this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
643
- }).catch(reason => {
644
- while (duPromisses.length > 0) {
645
- duPromisses.pop().reject(reason);
646
- }
647
- });
648
- }
639
+ }).catch(reason => {
640
+ while (duPromisses.length > 0) {
641
+ duPromisses.pop().reject(reason);
642
+ }
643
+ });
649
644
  }
650
645
  });
651
646
  }
@@ -672,14 +667,14 @@ const SnkApplication = class {
672
667
  /**
673
668
  * Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
674
669
  */
675
- async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options) {
670
+ async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
676
671
  return new Promise((resolve, reject) => {
677
672
  const dataUnit = this._duCache.get(dataUnitName);
678
673
  if (dataUnit) {
679
674
  resolve(dataUnit);
680
675
  }
681
676
  else {
682
- this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options).then(dataUnit => {
677
+ this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID).then(dataUnit => {
683
678
  resolve(dataUnit);
684
679
  }).catch(reason => reject(reason));
685
680
  }
@@ -6,14 +6,14 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataFetcher = require('./DataFetcher-313debd8.js');
8
8
  require('./pesquisa-fetcher-680e198f.js');
9
- require('./index-0922807b.js');
9
+ require('./index-1dfc7a6e.js');
10
10
  const ISave = require('./ISave-e91b70a7.js');
11
11
  const dataunitFetcher = require('./dataunit-fetcher-620b29a1.js');
12
12
  require('./filter-item-type.enum-a7ffdaa6.js');
13
13
  require('./form-config-fetcher-2dd00e5b.js');
14
14
  const constants = require('./constants-35ddd366.js');
15
15
  const authFetcher = require('./auth-fetcher-54f5ff9d.js');
16
- const taskbarElements = require('./taskbar-elements-d9392685.js');
16
+ const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
17
17
  require('./PrintUtils-bcaeb82f.js');
18
18
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
19
19
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const taskbarElements = require('./taskbar-elements-d9392685.js');
7
+ const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
8
8
  require('./DataFetcher-313debd8.js');
9
9
  require('./pesquisa-fetcher-680e198f.js');
10
- const index$1 = require('./index-0922807b.js');
10
+ const index$1 = require('./index-1dfc7a6e.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index$1 = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const index = require('./index-0922807b.js');
8
+ const index = require('./index-1dfc7a6e.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  const DataFetcher = require('./DataFetcher-313debd8.js');
11
- const snkDataUnit = require('./snk-data-unit-eca53cfc.js');
11
+ const snkDataUnit = require('./snk-data-unit-56babf28.js');
12
12
  require('./pesquisa-fetcher-680e198f.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -17,7 +17,7 @@ require('./dataunit-fetcher-620b29a1.js');
17
17
  require('./filter-item-type.enum-a7ffdaa6.js');
18
18
  require('./form-config-fetcher-2dd00e5b.js');
19
19
  require('./PrintUtils-bcaeb82f.js');
20
- require('./SnkMessageBuilder-4a95fe86.js');
20
+ require('./SnkMessageBuilder-722b104e.js');
21
21
  require('./RecordIDUtils-3735135c.js');
22
22
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
23
23
  require('@sankhyalabs/core/dist/utils/SortingUtils');
@@ -43,6 +43,9 @@ class ItemBuilder {
43
43
  items.push(this.getExportToXLS(groupName));
44
44
  }
45
45
  this.setExportCurrentPage(option, items);
46
+ if (this._selectedNumber > 0) {
47
+ this.setExportAllRecords(option, items);
48
+ }
46
49
  this.setExportByEmail(option, items);
47
50
  }
48
51
  /**
@@ -73,6 +76,34 @@ class ItemBuilder {
73
76
  }
74
77
  }
75
78
  }
79
+ /**
80
+ * Método responsável por inserir os itens de exportação para todos os registros.
81
+ * @param option - Nome da opção que será inserida no array.
82
+ * @param items - Array que será alimentado com as opções permitidas.
83
+ */
84
+ setExportAllRecords(option, items) {
85
+ var _a;
86
+ const pageOptions = [index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF, index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS];
87
+ if (option === index.DataExporterOption.EXPORT_ALL_RECORDS) {
88
+ items.push(this.getAllRecords());
89
+ }
90
+ if (pageOptions.includes(option)) {
91
+ let item = items.find((item) => item.id === index.DataExporterOption.EXPORT_ALL_RECORDS);
92
+ if (item == undefined) {
93
+ items.push(this.getAllRecords());
94
+ item = items.find((item) => item.id === index.DataExporterOption.EXPORT_ALL_RECORDS);
95
+ }
96
+ if (!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)) {
97
+ item.children = [];
98
+ }
99
+ if (option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF) {
100
+ item.children.push(this.getExportAllRecordsToPDF());
101
+ }
102
+ if (option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
103
+ item.children.push(this.getExportAllRecordsToXLS());
104
+ }
105
+ }
106
+ }
76
107
  /**
77
108
  * Método responsável por inserir os itens de exportação por e-mail.
78
109
  * @param option - Nome da opção que será inserida no array.
@@ -118,6 +149,17 @@ class ItemBuilder {
118
149
  group: this._getMessage("snkDataExporter.group.custom")
119
150
  };
120
151
  }
152
+ /**
153
+ * Método responsável por capturar o objeto com todos os dados de exportação.
154
+ * @returns Retorna o objeto com todos os dados de exportação.
155
+ */
156
+ getAllRecords() {
157
+ return {
158
+ id: index.DataExporterOption.EXPORT_ALL_RECORDS,
159
+ label: this._getMessage("snkDataExporter.label.allRecords"),
160
+ group: this._getMessage("snkDataExporter.group.custom")
161
+ };
162
+ }
121
163
  /**
122
164
  * Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
123
165
  * @returns Retorna o objeto com os dados de exportação personalizada em PDF.
@@ -138,6 +180,26 @@ class ItemBuilder {
138
180
  label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
139
181
  };
140
182
  }
183
+ /**
184
+ * Método responsável por capturar o objeto com todos os dados de exportação em PDF.
185
+ * @returns Retorna o objeto com todos os dados de exportação em PDF.
186
+ */
187
+ getExportAllRecordsToPDF() {
188
+ return {
189
+ id: index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
190
+ label: "PDF (.pdf)"
191
+ };
192
+ }
193
+ /**
194
+ * Método responsável por capturar o objeto com todos os dados de exportação em XLS.
195
+ * @returns Retorna o objeto com todos os dados de exportação em XLS.
196
+ */
197
+ getExportAllRecordsToXLS() {
198
+ return {
199
+ id: index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
200
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
201
+ };
202
+ }
141
203
  /**
142
204
  * Método responsável por capturar o objeto com os dados de exportação por e-mail.
143
205
  * @returns Retorna o objeto com os dados de exportação por e-mail.
@@ -191,6 +253,20 @@ function getFormatResponse(result) {
191
253
  return core.ObjectUtils.stringToObject(response);
192
254
  }
193
255
 
256
+ const DOC_MAX_WIDTH = 800;
257
+ function getVisibleColumns(columns) {
258
+ const visibleColumns = [];
259
+ let totalWidth = 0;
260
+ for (const column of columns) {
261
+ totalWidth += column.width;
262
+ if (totalWidth >= DOC_MAX_WIDTH) {
263
+ break;
264
+ }
265
+ visibleColumns.push(column);
266
+ }
267
+ return visibleColumns;
268
+ }
269
+
194
270
  var __rest = (undefined && undefined.__rest) || function (s, e) {
195
271
  var t = {};
196
272
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -206,10 +282,15 @@ class ServerSideExporterStrategy {
206
282
  constructor(provider) {
207
283
  this._provider = provider;
208
284
  }
285
+ async getParsedColumns() {
286
+ const columns = await this._provider.getColumnsMetadata();
287
+ const visibleColumns = getVisibleColumns(columns);
288
+ return visibleColumns;
289
+ }
209
290
  async getParams(resolveProps) {
210
291
  var _a, _b, _c, _d, _e, _f;
211
292
  const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
212
- const columns = await this._provider.getColumnsMetadata();
293
+ const columns = await this.getParsedColumns();
213
294
  const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
214
295
  const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
215
296
  const selectedIDs = this._provider.getSelectedIDs();
@@ -260,10 +341,15 @@ class ClientSideExporterStrategy {
260
341
  constructor(provider) {
261
342
  this._provider = provider;
262
343
  }
344
+ async getParsedColumns() {
345
+ const columns = await this._provider.getColumnsMetadata();
346
+ const visibleColumns = getVisibleColumns(columns);
347
+ return visibleColumns;
348
+ }
263
349
  async executeExport(resolveProps) {
264
350
  const { methodName, titleGrid } = resolveProps;
265
351
  const records = await this._provider.getRecords();
266
- const columns = await this._provider.getColumnsMetadata();
352
+ const columns = await this.getParsedColumns();
267
353
  const [serviceName, processor] = this.getExecutor(methodName);
268
354
  const payload = {
269
355
  serviceName,
@@ -357,7 +443,9 @@ const SnkDataExporter = class {
357
443
  index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
358
444
  index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
359
445
  index.DataExporterOption.EXPORT_PAGE_TO_PDF,
360
- index.DataExporterOption.EXPORT_PAGE_TO_XLS
446
+ index.DataExporterOption.EXPORT_PAGE_TO_XLS,
447
+ index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
448
+ index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
361
449
  ];
362
450
  this._items = [];
363
451
  this._showDropdown = false;
@@ -448,7 +536,16 @@ const SnkDataExporter = class {
448
536
  return index.DataExporterOption[key] === option;
449
537
  });
450
538
  }
451
- dispatchExporter(option) {
539
+ getExportType(option) {
540
+ if (option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
541
+ return 'all';
542
+ }
543
+ if (option === index.DataExporterOption.EXPORT_PAGE_TO_PDF || option === index.DataExporterOption.EXPORT_PAGE_TO_XLS) {
544
+ return 'page';
545
+ }
546
+ return 'selection';
547
+ }
548
+ async dispatchExporter(option) {
452
549
  var _a, _b, _c;
453
550
  const optionKey = this.getOptionKey(option);
454
551
  const fileType = (_a = index.DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : index.DataExporterType.EXPORT_TO_PDF;
@@ -458,11 +555,17 @@ const SnkDataExporter = class {
458
555
  fileName: this._appLabel,
459
556
  titleGrid: this._appLabel,
460
557
  exportOption: option,
461
- limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b)
558
+ limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
559
+ type: this.getExportType(option),
462
560
  };
463
- this.resolveExporter(params, (response) => {
464
- fileViewer(Object.assign(Object.assign({}, response), { fileType,
465
- isDownload }));
561
+ await this.resolveExporter(params, (response) => {
562
+ if (response.canExport) {
563
+ fileViewer(Object.assign(Object.assign({}, response), { fileType,
564
+ isDownload }));
565
+ }
566
+ else {
567
+ utils.ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
568
+ }
466
569
  });
467
570
  }
468
571
  async processExporter(evt) {
@@ -3,7 +3,7 @@
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
5
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
6
- const SnkMessageBuilder = require('./SnkMessageBuilder-4a95fe86.js');
6
+ const SnkMessageBuilder = require('./SnkMessageBuilder-722b104e.js');
7
7
  const dataunitFetcher = require('./dataunit-fetcher-620b29a1.js');
8
8
  const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
9
9
 
@@ -41,6 +41,10 @@ const SnkDataUnit = class {
41
41
  case core.Action.RECORDS_REMOVED:
42
42
  this.handleRecordsRemoved(action);
43
43
  break;
44
+ case core.Action.METADATA_LOADED:
45
+ this.fillFieldsWithRmp(this.dataUnit.metadata);
46
+ this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
47
+ break;
44
48
  }
45
49
  };
46
50
  this.fieldsToLink = [];
@@ -528,10 +532,10 @@ const SnkDataUnit = class {
528
532
  const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
529
533
  if (this._parentSnkDataUnit) {
530
534
  this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
531
- return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID, { skipLoadMetadata: true });
535
+ return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
532
536
  }
533
537
  else {
534
- return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID, { skipLoadMetadata: true });
538
+ return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
535
539
  }
536
540
  }
537
541
  async loadDataUnit() {
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-eca53cfc.js');
5
+ const snkDataUnit = require('./snk-data-unit-56babf28.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils');
9
- require('./SnkMessageBuilder-4a95fe86.js');
9
+ require('./SnkMessageBuilder-722b104e.js');
10
10
  require('./dataunit-fetcher-620b29a1.js');
11
11
  require('./DataFetcher-313debd8.js');
12
12
  require('./PrintUtils-bcaeb82f.js');
@@ -8,17 +8,17 @@ const SnkFormConfigManager = require('./SnkFormConfigManager-52f99b4d.js');
8
8
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
9
9
  require('./DataFetcher-313debd8.js');
10
10
  require('./pesquisa-fetcher-680e198f.js');
11
- const index$1 = require('./index-0922807b.js');
11
+ const index$1 = require('./index-1dfc7a6e.js');
12
12
  require('./ISave-e91b70a7.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
15
  require('./dataunit-fetcher-620b29a1.js');
16
16
  require('./filter-item-type.enum-a7ffdaa6.js');
17
17
  require('./form-config-fetcher-2dd00e5b.js');
18
- const taskbarElements = require('./taskbar-elements-d9392685.js');
18
+ const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
19
19
  const constants = require('./constants-35ddd366.js');
20
- const snkGuidesViewer = require('./snk-guides-viewer-5d5f0f25.js');
21
- const SnkMessageBuilder = require('./SnkMessageBuilder-4a95fe86.js');
20
+ const snkGuidesViewer = require('./snk-guides-viewer-9867335b.js');
21
+ const SnkMessageBuilder = require('./SnkMessageBuilder-722b104e.js');
22
22
  require('./ConfigStorage-942ce74b.js');
23
23
  require('./PrintUtils-bcaeb82f.js');
24
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const taskbarElements = require('./taskbar-elements-d9392685.js');
7
+ const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
8
8
  const ConfigStorage = require('./ConfigStorage-942ce74b.js');
9
- const index$1 = require('./index-0922807b.js');
9
+ const index$1 = require('./index-1dfc7a6e.js');
10
10
  const fieldSearch = require('./field-search-f56aa7d6.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const IExporterProvider = require('./IExporterProvider-0c814e9a.js');
12
+ const IExporterProvider = require('./IExporterProvider-c78cb1b8.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
14
  require('./DataFetcher-313debd8.js');
15
15
  require('./pesquisa-fetcher-680e198f.js');
@@ -5,11 +5,11 @@ const core = require('@sankhyalabs/core');
5
5
  const SnkFormConfigManager = require('./SnkFormConfigManager-52f99b4d.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const fieldSearch = require('./field-search-f56aa7d6.js');
8
- const taskbarElements = require('./taskbar-elements-d9392685.js');
8
+ const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  require('./DataFetcher-313debd8.js');
11
11
  require('./pesquisa-fetcher-680e198f.js');
12
- const index$1 = require('./index-0922807b.js');
12
+ const index$1 = require('./index-1dfc7a6e.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-5d5f0f25.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-9867335b.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-52f99b4d.js');
@@ -14,8 +14,8 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./filter-item-type.enum-a7ffdaa6.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/form');
16
16
  require('./field-search-f56aa7d6.js');
17
- require('./taskbar-elements-d9392685.js');
18
- require('./index-0922807b.js');
17
+ require('./taskbar-elements-9ad1f9c0.js');
18
+ require('./index-1dfc7a6e.js');
19
19
  require('./index-102ba62d.js');
20
20
  require('./constants-35ddd366.js');
21
21
  require('./pesquisa-fetcher-680e198f.js');
@@ -6,11 +6,11 @@ const index$1 = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const constants = require('./constants-35ddd366.js');
9
- const taskbarElements = require('./taskbar-elements-d9392685.js');
9
+ const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
10
10
  require('./DataFetcher-313debd8.js');
11
11
  require('./pesquisa-fetcher-680e198f.js');
12
- const IExporterProvider = require('./IExporterProvider-0c814e9a.js');
13
- const index = require('./index-0922807b.js');
12
+ const IExporterProvider = require('./IExporterProvider-c78cb1b8.js');
13
+ const index = require('./index-1dfc7a6e.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
8
- const taskbarElements = require('./taskbar-elements-d9392685.js');
9
- const index$1 = require('./index-0922807b.js');
8
+ const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
9
+ const index$1 = require('./index-1dfc7a6e.js');
10
10
  require('./index-102ba62d.js');
11
11
 
12
12
  const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
- const index$2 = require('./index-0922807b.js');
4
+ const index$2 = require('./index-1dfc7a6e.js');
5
5
  const index$1 = require('./index-102ba62d.js');
6
6
 
7
7
  exports.TaskbarElement = void 0;
@@ -354,7 +354,7 @@ export class SnkApplication {
354
354
  * Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
355
355
  * passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
356
356
  */
357
- async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options) {
357
+ async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
358
358
  if (resourceID == undefined) {
359
359
  resourceID = this.applicationResourceID;
360
360
  }
@@ -364,18 +364,13 @@ export class SnkApplication {
364
364
  duPromisses.push(new PendingPromise(resolve, reject));
365
365
  if (!waitingDu) {
366
366
  const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
367
- if (options === null || options === void 0 ? void 0 : options.skipLoadMetadata) {
367
+ dataUnit.loadMetadata().then(() => {
368
368
  this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
369
- }
370
- else {
371
- dataUnit.loadMetadata().then(() => {
372
- this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
373
- }).catch(reason => {
374
- while (duPromisses.length > 0) {
375
- duPromisses.pop().reject(reason);
376
- }
377
- });
378
- }
369
+ }).catch(reason => {
370
+ while (duPromisses.length > 0) {
371
+ duPromisses.pop().reject(reason);
372
+ }
373
+ });
379
374
  }
380
375
  });
381
376
  }
@@ -402,14 +397,14 @@ export class SnkApplication {
402
397
  /**
403
398
  * Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
404
399
  */
405
- async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options) {
400
+ async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
406
401
  return new Promise((resolve, reject) => {
407
402
  const dataUnit = this._duCache.get(dataUnitName);
408
403
  if (dataUnit) {
409
404
  resolve(dataUnit);
410
405
  }
411
406
  else {
412
- this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID, options).then(dataUnit => {
407
+ this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID).then(dataUnit => {
413
408
  resolve(dataUnit);
414
409
  }).catch(reason => reject(reason));
415
410
  }
@@ -1701,7 +1696,7 @@ export class SnkApplication {
1701
1696
  },
1702
1697
  "createDataunit": {
1703
1698
  "complexType": {
1704
- "signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string, options?: GetDataUnitOptions) => Promise<DataUnit>",
1699
+ "signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>",
1705
1700
  "parameters": [{
1706
1701
  "tags": [],
1707
1702
  "text": ""
@@ -1717,9 +1712,6 @@ export class SnkApplication {
1717
1712
  }, {
1718
1713
  "tags": [],
1719
1714
  "text": ""
1720
- }, {
1721
- "tags": [],
1722
- "text": ""
1723
1715
  }],
1724
1716
  "references": {
1725
1717
  "Promise": {
@@ -1728,9 +1720,6 @@ export class SnkApplication {
1728
1720
  "DataUnit": {
1729
1721
  "location": "import",
1730
1722
  "path": "@sankhyalabs/core"
1731
- },
1732
- "GetDataUnitOptions": {
1733
- "location": "global"
1734
1723
  }
1735
1724
  },
1736
1725
  "return": "Promise<DataUnit>"
@@ -1789,7 +1778,7 @@ export class SnkApplication {
1789
1778
  },
1790
1779
  "getDataUnit": {
1791
1780
  "complexType": {
1792
- "signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string, options?: GetDataUnitOptions) => Promise<DataUnit>",
1781
+ "signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>",
1793
1782
  "parameters": [{
1794
1783
  "tags": [],
1795
1784
  "text": ""
@@ -1805,9 +1794,6 @@ export class SnkApplication {
1805
1794
  }, {
1806
1795
  "tags": [],
1807
1796
  "text": ""
1808
- }, {
1809
- "tags": [],
1810
- "text": ""
1811
1797
  }],
1812
1798
  "references": {
1813
1799
  "Promise": {
@@ -1816,9 +1802,6 @@ export class SnkApplication {
1816
1802
  "DataUnit": {
1817
1803
  "location": "import",
1818
1804
  "path": "@sankhyalabs/core"
1819
- },
1820
- "GetDataUnitOptions": {
1821
- "location": "global"
1822
1805
  }
1823
1806
  },
1824
1807
  "return": "Promise<DataUnit>"