@sankhyalabs/sankhyablocks 8.15.0-dev.82 → 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 (75) 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 +1 -1
  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-5be491da.js → snk-data-unit-56babf28.js} +1 -1
  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-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +7 -1
  19. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +7 -1
  20. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +2 -2
  21. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +23 -6
  22. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
  23. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +13 -0
  24. package/dist/collection/lib/@types/index.js +5 -0
  25. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
  26. package/dist/components/IExporterProvider.js +2 -2
  27. package/dist/components/ISave.js +5 -0
  28. package/dist/components/SnkMessageBuilder.js +2 -0
  29. package/dist/components/snk-data-exporter2.js +111 -8
  30. package/dist/esm/{IExporterProvider-c0194569.js → IExporterProvider-1deb5d0a.js} +3 -3
  31. package/dist/esm/{SnkMessageBuilder-3a767111.js → SnkMessageBuilder-89925609.js} +2 -0
  32. package/dist/esm/{index-0ece87a6.js → index-88d0c8ad.js} +5 -0
  33. package/dist/esm/snk-actions-button_4.entry.js +1 -1
  34. package/dist/esm/snk-application.entry.js +1 -1
  35. package/dist/esm/snk-attach.entry.js +2 -2
  36. package/dist/esm/snk-crud.entry.js +2 -2
  37. package/dist/esm/snk-data-exporter.entry.js +114 -11
  38. package/dist/esm/{snk-data-unit-9110a07b.js → snk-data-unit-56b5efc4.js} +1 -1
  39. package/dist/esm/snk-data-unit.entry.js +2 -2
  40. package/dist/esm/snk-detail-view.entry.js +4 -4
  41. package/dist/esm/snk-grid.entry.js +3 -3
  42. package/dist/esm/{snk-guides-viewer-ef8c4eec.js → snk-guides-viewer-7ae1b358.js} +2 -2
  43. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  44. package/dist/esm/snk-simple-crud.entry.js +3 -3
  45. package/dist/esm/snk-taskbar.entry.js +2 -2
  46. package/dist/esm/{taskbar-elements-ad766858.js → taskbar-elements-da72aae0.js} +1 -1
  47. package/dist/sankhyablocks/{p-9b1c0824.entry.js → p-0f4de966.entry.js} +1 -1
  48. package/dist/sankhyablocks/{p-294df368.entry.js → p-26e34ba3.entry.js} +1 -1
  49. package/dist/sankhyablocks/{p-3f1efb97.entry.js → p-32097e8a.entry.js} +1 -1
  50. package/dist/sankhyablocks/p-6071f6b4.entry.js +1 -0
  51. package/dist/sankhyablocks/p-7a337364.js +1 -0
  52. package/dist/sankhyablocks/{p-2ac8bd11.entry.js → p-8323db5f.entry.js} +1 -1
  53. package/dist/sankhyablocks/{p-543537ca.js → p-88a77075.js} +1 -1
  54. package/dist/sankhyablocks/{p-039c7148.entry.js → p-9bdd4e27.entry.js} +1 -1
  55. package/dist/sankhyablocks/{p-8322ccdb.entry.js → p-9cb8a77b.entry.js} +1 -1
  56. package/dist/sankhyablocks/{p-58687027.entry.js → p-a0edbed5.entry.js} +1 -1
  57. package/dist/sankhyablocks/{p-babe7665.js → p-a7717247.js} +1 -1
  58. package/dist/sankhyablocks/{p-5646ee8c.entry.js → p-b1ee6b27.entry.js} +1 -1
  59. package/dist/sankhyablocks/p-b9e318a8.js +1 -0
  60. package/dist/sankhyablocks/{p-a64baa0f.entry.js → p-c5b18d02.entry.js} +1 -1
  61. package/dist/sankhyablocks/{p-d26365ad.js → p-c65bbb31.js} +1 -1
  62. package/dist/sankhyablocks/{p-61dd89eb.js → p-ef402237.js} +1 -1
  63. package/dist/sankhyablocks/{p-04821c60.entry.js → p-f9815cc4.entry.js} +1 -1
  64. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  65. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +1 -0
  66. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
  67. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -0
  68. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
  69. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +2 -0
  70. package/dist/types/lib/@types/index.d.ts +5 -0
  71. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
  72. package/package.json +1 -1
  73. package/dist/sankhyablocks/p-38289a55.js +0 -1
  74. package/dist/sankhyablocks/p-4ce73e88.js +0 -1
  75. package/dist/sankhyablocks/p-70a6e662.entry.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');
@@ -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-5be491da.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
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-5be491da.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;
@@ -1,13 +1,19 @@
1
1
  import { UserInterface } from "@sankhyalabs/core";
2
2
  import { DataFetcher } from "../../../lib";
3
+ import { getVisibleColumns } from "../utils/ParserExport";
3
4
  export default class ClientSideExporterStrategy {
4
5
  constructor(provider) {
5
6
  this._provider = provider;
6
7
  }
8
+ async getParsedColumns() {
9
+ const columns = await this._provider.getColumnsMetadata();
10
+ const visibleColumns = getVisibleColumns(columns);
11
+ return visibleColumns;
12
+ }
7
13
  async executeExport(resolveProps) {
8
14
  const { methodName, titleGrid } = resolveProps;
9
15
  const records = await this._provider.getRecords();
10
- const columns = await this._provider.getColumnsMetadata();
16
+ const columns = await this.getParsedColumns();
11
17
  const [serviceName, processor] = this.getExecutor(methodName);
12
18
  const payload = {
13
19
  serviceName,
@@ -13,14 +13,20 @@ var __rest = (this && this.__rest) || function (s, e) {
13
13
  import { ApplicationContext, ObjectUtils } from "@sankhyalabs/core";
14
14
  import { DataFetcher } from '../../../lib/http/data-fetcher/DataFetcher';
15
15
  import { DataExporterOption } from "../../../lib/@types";
16
+ import { getVisibleColumns } from "../utils/ParserExport";
16
17
  export default class ServerSideExporterStrategy {
17
18
  constructor(provider) {
18
19
  this._provider = provider;
19
20
  }
21
+ async getParsedColumns() {
22
+ const columns = await this._provider.getColumnsMetadata();
23
+ const visibleColumns = getVisibleColumns(columns);
24
+ return visibleColumns;
25
+ }
20
26
  async getParams(resolveProps) {
21
27
  var _a, _b, _c, _d, _e, _f;
22
28
  const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
23
- const columns = await this._provider.getColumnsMetadata();
29
+ const columns = await this.getParsedColumns();
24
30
  const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
25
31
  const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
26
32
  const selectedIDs = this._provider.getSelectedIDs();
@@ -28,7 +28,7 @@ export class CommonsExporter {
28
28
  const columnData = {
29
29
  label: column.label,
30
30
  id: column.name,
31
- width: (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface.SEARCH ? 30 : column.width,
31
+ width: column.width,
32
32
  type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
33
33
  userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
34
34
  customFormatter
@@ -40,7 +40,7 @@ export class CommonsExporter {
40
40
  const descriptionColumn = {
41
41
  label: fieldData.properties.DESCRIPTIONENTITY,
42
42
  id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
43
- width: 200,
43
+ width: column.width,
44
44
  type: DataType.TEXT,
45
45
  userInterface: UserInterface.LONGTEXT,
46
46
  descriptionFrom: fieldData.name
@@ -20,7 +20,9 @@ export class SnkDataExporter {
20
20
  DataExporterOption.EXPORT_PDF_TO_EMAIL,
21
21
  DataExporterOption.EXPORT_XLS_TO_EMAIL,
22
22
  DataExporterOption.EXPORT_PAGE_TO_PDF,
23
- DataExporterOption.EXPORT_PAGE_TO_XLS
23
+ DataExporterOption.EXPORT_PAGE_TO_XLS,
24
+ DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
25
+ DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
24
26
  ];
25
27
  this._items = [];
26
28
  this._showDropdown = false;
@@ -111,7 +113,16 @@ export class SnkDataExporter {
111
113
  return DataExporterOption[key] === option;
112
114
  });
113
115
  }
114
- dispatchExporter(option) {
116
+ getExportType(option) {
117
+ if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
118
+ return 'all';
119
+ }
120
+ if (option === DataExporterOption.EXPORT_PAGE_TO_PDF || option === DataExporterOption.EXPORT_PAGE_TO_XLS) {
121
+ return 'page';
122
+ }
123
+ return 'selection';
124
+ }
125
+ async dispatchExporter(option) {
115
126
  var _a, _b, _c;
116
127
  const optionKey = this.getOptionKey(option);
117
128
  const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
@@ -121,11 +132,17 @@ export class SnkDataExporter {
121
132
  fileName: this._appLabel,
122
133
  titleGrid: this._appLabel,
123
134
  exportOption: option,
124
- limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b)
135
+ limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
136
+ type: this.getExportType(option),
125
137
  };
126
- this.resolveExporter(params, (response) => {
127
- fileViewer(Object.assign(Object.assign({}, response), { fileType,
128
- isDownload }));
138
+ await this.resolveExporter(params, (response) => {
139
+ if (response.canExport) {
140
+ fileViewer(Object.assign(Object.assign({}, response), { fileType,
141
+ isDownload }));
142
+ }
143
+ else {
144
+ ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
145
+ }
129
146
  });
130
147
  }
131
148
  async processExporter(evt) {