@sankhyalabs/sankhyablocks 8.15.0-dev.82 → 8.15.0-dev.84
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.
- package/dist/cjs/{IExporterProvider-0c814e9a.js → IExporterProvider-c78cb1b8.js} +3 -3
- package/dist/cjs/{SnkFormConfigManager-52f99b4d.js → SnkFormConfigManager-1b13bacd.js} +6 -3
- package/dist/cjs/{SnkMessageBuilder-4a95fe86.js → SnkMessageBuilder-722b104e.js} +2 -0
- package/dist/cjs/{index-0922807b.js → index-1dfc7a6e.js} +5 -0
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +2 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +120 -11
- package/dist/cjs/{snk-data-unit-5be491da.js → snk-data-unit-56babf28.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -5
- package/dist/cjs/snk-form.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid.cjs.entry.js +3 -3
- package/dist/cjs/{snk-guides-viewer-5d5f0f25.js → snk-guides-viewer-05a1ba27.js} +3 -3
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-d9392685.js → taskbar-elements-9ad1f9c0.js} +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +8 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +8 -2
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +2 -2
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +23 -6
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +20 -0
- package/dist/collection/components/snk-form/snk-form.js +1 -1
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -3
- package/dist/collection/lib/@types/index.js +5 -0
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
- package/dist/components/IExporterProvider.js +2 -2
- package/dist/components/ISave.js +6 -1
- package/dist/components/SnkFormConfigManager.js +6 -3
- package/dist/components/SnkMessageBuilder.js +2 -0
- package/dist/components/snk-data-exporter2.js +118 -9
- package/dist/components/snk-form.js +1 -1
- package/dist/esm/{IExporterProvider-c0194569.js → IExporterProvider-343272b3.js} +3 -3
- package/dist/esm/{SnkFormConfigManager-5b0d69cd.js → SnkFormConfigManager-d4554df9.js} +6 -3
- package/dist/esm/{SnkMessageBuilder-3a767111.js → SnkMessageBuilder-89925609.js} +2 -0
- package/dist/esm/{index-0ece87a6.js → index-3aa4977a.js} +6 -1
- package/dist/esm/snk-actions-button_4.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-data-exporter.entry.js +120 -11
- package/dist/esm/{snk-data-unit-9110a07b.js → snk-data-unit-56b5efc4.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +5 -5
- package/dist/esm/snk-form.entry.js +2 -2
- package/dist/esm/snk-grid.entry.js +3 -3
- package/dist/esm/{snk-guides-viewer-ef8c4eec.js → snk-guides-viewer-aee2cafe.js} +3 -3
- package/dist/esm/snk-guides-viewer.entry.js +4 -4
- package/dist/esm/snk-simple-crud.entry.js +4 -4
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-ad766858.js → taskbar-elements-d59867f1.js} +1 -1
- package/dist/sankhyablocks/{p-8322ccdb.entry.js → p-0d91b10f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9b1c0824.entry.js → p-0f4de966.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2ac8bd11.entry.js → p-26394a01.entry.js} +1 -1
- package/dist/sankhyablocks/{p-039c7148.entry.js → p-2d649237.entry.js} +1 -1
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-4e27bead.entry.js +1 -0
- package/dist/sankhyablocks/{p-a64baa0f.entry.js → p-4f72727a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-04821c60.entry.js → p-550fee49.entry.js} +1 -1
- package/dist/sankhyablocks/p-7a337364.js +1 -0
- package/dist/sankhyablocks/{p-61dd89eb.js → p-7e7a7473.js} +1 -1
- package/dist/sankhyablocks/p-829d4045.js +1 -0
- package/dist/sankhyablocks/{p-543537ca.js → p-88a77075.js} +1 -1
- package/dist/sankhyablocks/{p-3f1efb97.entry.js → p-8a5910a7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-294df368.entry.js → p-8cc64963.entry.js} +1 -1
- package/dist/sankhyablocks/p-8fc470e5.entry.js +1 -0
- package/dist/sankhyablocks/{p-babe7665.js → p-9e99a92a.js} +1 -1
- package/dist/sankhyablocks/{p-5646ee8c.entry.js → p-b1ee6b27.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d26365ad.js → p-be603a24.js} +1 -1
- package/dist/sankhyablocks/{p-58687027.entry.js → p-f2809746.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +4 -0
- package/dist/types/lib/@types/index.d.ts +5 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-060fdb6c.js +0 -1
- package/dist/sankhyablocks/p-32062be4.entry.js +0 -1
- package/dist/sankhyablocks/p-38289a55.js +0 -1
- package/dist/sankhyablocks/p-4ce73e88.js +0 -1
- 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-
|
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:
|
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:
|
215
|
+
width: column.width,
|
216
216
|
type: core.DataType.TEXT,
|
217
217
|
userInterface: UnitMetadata.UserInterface.LONGTEXT,
|
218
218
|
descriptionFrom: fieldData.name
|
@@ -74,11 +74,14 @@ class SnkFormConfigManager {
|
|
74
74
|
var _a;
|
75
75
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
76
76
|
if (fields != undefined && fields.length > 0) {
|
77
|
-
return fields.map(({ label, name, readOnly, visible }) => {
|
77
|
+
return fields.map(({ label, name, readOnly, visible, required }) => {
|
78
78
|
if (label == undefined) {
|
79
|
-
return dataUnit.getField(name)
|
79
|
+
return Object.assign(Object.assign({}, dataUnit.getField(name)), { name,
|
80
|
+
readOnly,
|
81
|
+
visible,
|
82
|
+
required });
|
80
83
|
}
|
81
|
-
return { name, label, readOnly, visible };
|
84
|
+
return { name, label, readOnly, visible, required };
|
82
85
|
})
|
83
86
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
84
87
|
}
|
@@ -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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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,26 @@ 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
|
+
function getOptionKey(option) {
|
270
|
+
return Object.keys(index.DataExporterOption)
|
271
|
+
.find((key) => {
|
272
|
+
return index.DataExporterOption[key] === option;
|
273
|
+
});
|
274
|
+
}
|
275
|
+
|
194
276
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
195
277
|
var t = {};
|
196
278
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
@@ -206,10 +288,15 @@ class ServerSideExporterStrategy {
|
|
206
288
|
constructor(provider) {
|
207
289
|
this._provider = provider;
|
208
290
|
}
|
291
|
+
async getParsedColumns() {
|
292
|
+
const columns = await this._provider.getColumnsMetadata();
|
293
|
+
const visibleColumns = getVisibleColumns(columns);
|
294
|
+
return visibleColumns;
|
295
|
+
}
|
209
296
|
async getParams(resolveProps) {
|
210
297
|
var _a, _b, _c, _d, _e, _f;
|
211
298
|
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
212
|
-
const columns = await this._provider.getColumnsMetadata();
|
299
|
+
const columns = [index.DataExporterType.EXPORT_TO_PDF, index.DataExporterType.EXPORT_PAGE_TO_PDF, index.DataExporterType.EXPORT_PDF_TO_EMAIL, index.DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
213
300
|
const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
|
214
301
|
const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
|
215
302
|
const selectedIDs = this._provider.getSelectedIDs();
|
@@ -260,10 +347,15 @@ class ClientSideExporterStrategy {
|
|
260
347
|
constructor(provider) {
|
261
348
|
this._provider = provider;
|
262
349
|
}
|
350
|
+
async getParsedColumns() {
|
351
|
+
const columns = await this._provider.getColumnsMetadata();
|
352
|
+
const visibleColumns = getVisibleColumns(columns);
|
353
|
+
return visibleColumns;
|
354
|
+
}
|
263
355
|
async executeExport(resolveProps) {
|
264
356
|
const { methodName, titleGrid } = resolveProps;
|
265
357
|
const records = await this._provider.getRecords();
|
266
|
-
const columns = await this._provider.getColumnsMetadata();
|
358
|
+
const columns = [index.DataExporterType.EXPORT_TO_PDF, index.DataExporterType.EXPORT_PAGE_TO_PDF, index.DataExporterType.EXPORT_PDF_TO_EMAIL, index.DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
267
359
|
const [serviceName, processor] = this.getExecutor(methodName);
|
268
360
|
const payload = {
|
269
361
|
serviceName,
|
@@ -357,7 +449,9 @@ const SnkDataExporter = class {
|
|
357
449
|
index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
358
450
|
index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
359
451
|
index.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
360
|
-
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
452
|
+
index.DataExporterOption.EXPORT_PAGE_TO_XLS,
|
453
|
+
index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
454
|
+
index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
361
455
|
];
|
362
456
|
this._items = [];
|
363
457
|
this._showDropdown = false;
|
@@ -448,7 +542,16 @@ const SnkDataExporter = class {
|
|
448
542
|
return index.DataExporterOption[key] === option;
|
449
543
|
});
|
450
544
|
}
|
451
|
-
|
545
|
+
getExportType(option) {
|
546
|
+
if (option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
547
|
+
return 'all';
|
548
|
+
}
|
549
|
+
if (option === index.DataExporterOption.EXPORT_PAGE_TO_PDF || option === index.DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
550
|
+
return 'page';
|
551
|
+
}
|
552
|
+
return 'selection';
|
553
|
+
}
|
554
|
+
async dispatchExporter(option) {
|
452
555
|
var _a, _b, _c;
|
453
556
|
const optionKey = this.getOptionKey(option);
|
454
557
|
const fileType = (_a = index.DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : index.DataExporterType.EXPORT_TO_PDF;
|
@@ -458,11 +561,17 @@ const SnkDataExporter = class {
|
|
458
561
|
fileName: this._appLabel,
|
459
562
|
titleGrid: this._appLabel,
|
460
563
|
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)
|
564
|
+
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
565
|
+
type: this.getExportType(option),
|
462
566
|
};
|
463
|
-
this.resolveExporter(params, (response) => {
|
464
|
-
|
465
|
-
|
567
|
+
await this.resolveExporter(params, (response) => {
|
568
|
+
if (response.canExport || fileType === index.DataExporterType.EXPORT_TO_PDF) {
|
569
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
570
|
+
isDownload }));
|
571
|
+
}
|
572
|
+
else {
|
573
|
+
utils.ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
574
|
+
}
|
466
575
|
});
|
467
576
|
}
|
468
577
|
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-
|
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-
|
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-
|
9
|
+
require('./SnkMessageBuilder-722b104e.js');
|
10
10
|
require('./dataunit-fetcher-620b29a1.js');
|
11
11
|
require('./DataFetcher-313debd8.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -4,21 +4,21 @@ 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 SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.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-
|
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-
|
18
|
+
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
19
19
|
const constants = require('./constants-35ddd366.js');
|
20
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
21
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
20
|
+
const snkGuidesViewer = require('./snk-guides-viewer-05a1ba27.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,7 +4,7 @@ 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 SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
9
9
|
require('./ConfigStorage-942ce74b.js');
|
10
10
|
require('./form-config-fetcher-2dd00e5b.js');
|
@@ -106,7 +106,7 @@ const SnkForm = class {
|
|
106
106
|
}
|
107
107
|
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID);
|
108
108
|
this.addFormLegacyConfig();
|
109
|
-
this._configManager.loadConfig();
|
109
|
+
await this._configManager.loadConfig();
|
110
110
|
}
|
111
111
|
async handleDataStateChange(evt) {
|
112
112
|
var _a;
|
@@ -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-
|
7
|
+
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
8
8
|
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
9
|
-
const index$1 = require('./index-
|
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-
|
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');
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.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-
|
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-
|
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,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-05a1ba27.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
8
|
+
require('./SnkFormConfigManager-1b13bacd.js');
|
9
9
|
require('./ConfigStorage-942ce74b.js');
|
10
10
|
require('./form-config-fetcher-2dd00e5b.js');
|
11
11
|
require('./DataFetcher-313debd8.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-
|
18
|
-
require('./index-
|
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-
|
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-
|
13
|
-
const index = require('./index-
|
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');
|
@@ -19,7 +19,7 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
19
|
const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
|
20
20
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
21
21
|
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
|
23
23
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -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-
|
9
|
-
const index$1 = require('./index-
|
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}";
|
package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js
CHANGED
@@ -1,13 +1,20 @@
|
|
1
1
|
import { UserInterface } from "@sankhyalabs/core";
|
2
2
|
import { DataFetcher } from "../../../lib";
|
3
|
+
import { getOptionKey, getVisibleColumns } from "../utils/ParserExport";
|
4
|
+
import { DataExporterType } from "../../../lib/@types";
|
3
5
|
export default class ClientSideExporterStrategy {
|
4
6
|
constructor(provider) {
|
5
7
|
this._provider = provider;
|
6
8
|
}
|
9
|
+
async getParsedColumns() {
|
10
|
+
const columns = await this._provider.getColumnsMetadata();
|
11
|
+
const visibleColumns = getVisibleColumns(columns);
|
12
|
+
return visibleColumns;
|
13
|
+
}
|
7
14
|
async executeExport(resolveProps) {
|
8
15
|
const { methodName, titleGrid } = resolveProps;
|
9
16
|
const records = await this._provider.getRecords();
|
10
|
-
const columns = await this._provider.getColumnsMetadata();
|
17
|
+
const columns = [DataExporterType.EXPORT_TO_PDF, DataExporterType.EXPORT_PAGE_TO_PDF, DataExporterType.EXPORT_PDF_TO_EMAIL, DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
11
18
|
const [serviceName, processor] = this.getExecutor(methodName);
|
12
19
|
const payload = {
|
13
20
|
serviceName,
|
package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js
CHANGED
@@ -12,15 +12,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
12
12
|
};
|
13
13
|
import { ApplicationContext, ObjectUtils } from "@sankhyalabs/core";
|
14
14
|
import { DataFetcher } from '../../../lib/http/data-fetcher/DataFetcher';
|
15
|
-
import { DataExporterOption } from "../../../lib/@types";
|
15
|
+
import { DataExporterOption, DataExporterType } from "../../../lib/@types";
|
16
|
+
import { getOptionKey, 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 = [DataExporterType.EXPORT_TO_PDF, DataExporterType.EXPORT_PAGE_TO_PDF, DataExporterType.EXPORT_PDF_TO_EMAIL, DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
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:
|
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:
|
43
|
+
width: column.width,
|
44
44
|
type: DataType.TEXT,
|
45
45
|
userInterface: UserInterface.LONGTEXT,
|
46
46
|
descriptionFrom: fieldData.name
|