@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.
- package/dist/cjs/{IExporterProvider-0c814e9a.js → IExporterProvider-c78cb1b8.js} +3 -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 +10 -15
- 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 +114 -11
- package/dist/cjs/{snk-data-unit-eca53cfc.js → snk-data-unit-56babf28.js} +7 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +3 -3
- package/dist/cjs/{snk-guides-viewer-5d5f0f25.js → snk-guides-viewer-9867335b.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +3 -3
- 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-application/snk-application.js +11 -28
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +7 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +7 -1
- 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 +13 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +6 -2
- package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +18 -0
- 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 +5 -0
- package/dist/components/SnkMessageBuilder.js +2 -0
- package/dist/components/snk-application2.js +9 -14
- package/dist/components/snk-data-exporter2.js +111 -8
- package/dist/components/snk-data-unit2.js +6 -2
- package/dist/esm/{IExporterProvider-c0194569.js → IExporterProvider-1deb5d0a.js} +3 -3
- package/dist/esm/{SnkMessageBuilder-3a767111.js → SnkMessageBuilder-89925609.js} +2 -0
- package/dist/esm/{index-0ece87a6.js → index-88d0c8ad.js} +5 -0
- package/dist/esm/snk-actions-button_4.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +10 -15
- 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 +114 -11
- package/dist/esm/{snk-data-unit-49b898f7.js → snk-data-unit-56b5efc4.js} +7 -3
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +3 -3
- package/dist/esm/{snk-guides-viewer-ef8c4eec.js → snk-guides-viewer-7ae1b358.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +3 -3
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-ad766858.js → taskbar-elements-da72aae0.js} +1 -1
- package/dist/sankhyablocks/{p-5fa1576b.entry.js → p-0f4de966.entry.js} +2 -2
- package/dist/sankhyablocks/{p-294df368.entry.js → p-26e34ba3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3f1efb97.entry.js → p-32097e8a.entry.js} +1 -1
- package/dist/sankhyablocks/p-6071f6b4.entry.js +1 -0
- package/dist/sankhyablocks/p-7a337364.js +1 -0
- package/dist/sankhyablocks/{p-2ac8bd11.entry.js → p-8323db5f.entry.js} +1 -1
- package/dist/sankhyablocks/p-88a77075.js +1 -0
- package/dist/sankhyablocks/{p-039c7148.entry.js → p-9bdd4e27.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8322ccdb.entry.js → p-9cb8a77b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-58687027.entry.js → p-a0edbed5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-babe7665.js → p-a7717247.js} +1 -1
- package/dist/sankhyablocks/{p-e5c25e0b.entry.js → p-b1ee6b27.entry.js} +1 -1
- package/dist/sankhyablocks/p-b9e318a8.js +1 -0
- package/dist/sankhyablocks/{p-a64baa0f.entry.js → p-c5b18d02.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d26365ad.js → p-c65bbb31.js} +1 -1
- package/dist/sankhyablocks/{p-61dd89eb.js → p-ef402237.js} +1 -1
- package/dist/sankhyablocks/{p-04821c60.entry.js → p-f9815cc4.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +2 -5
- 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 +2 -0
- package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
- package/dist/types/components.d.ts +2 -2
- 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-38289a55.js +0 -1
- package/dist/sankhyablocks/p-4ce73e88.js +0 -1
- package/dist/sankhyablocks/p-ba05fdb8.entry.js +0 -1
- package/dist/sankhyablocks/p-f88cfc3c.js +0 -1
@@ -285,6 +285,7 @@ const snkDataExporterMessages = {
|
|
285
285
|
},
|
286
286
|
label: {
|
287
287
|
currentPage: "Somente a página atual",
|
288
|
+
allRecords: "Todos os registros",
|
288
289
|
spreadsheet: "Planilha",
|
289
290
|
cube: "Cubo",
|
290
291
|
sendByEmail: "Enviar por email",
|
@@ -297,6 +298,7 @@ const snkDataExporterMessages = {
|
|
297
298
|
},
|
298
299
|
title: {
|
299
300
|
error: "Erro",
|
301
|
+
permission: "Falha detectada",
|
300
302
|
},
|
301
303
|
limitExceeded: {
|
302
304
|
title: "Atenção",
|
@@ -9,8 +9,11 @@ var DataExporterOption;
|
|
9
9
|
DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
|
10
10
|
DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
|
11
11
|
DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
|
12
|
+
DataExporterOption["EXPORT_ALL_RECORDS"] = "exportAllRecords";
|
12
13
|
DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
|
13
14
|
DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
|
15
|
+
DataExporterOption["EXPORT_ALL_RECORDS_TO_PDF"] = "exportAllRecordsToPDF";
|
16
|
+
DataExporterOption["EXPORT_ALL_RECORDS_TO_XLS"] = "exportAllRecordsToXLS";
|
14
17
|
DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
|
15
18
|
DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
|
16
19
|
DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
|
@@ -27,6 +30,8 @@ var DataExporterType;
|
|
27
30
|
DataExporterType["EXPORT_TO_XLS"] = "XLS";
|
28
31
|
DataExporterType["EXPORT_PAGE_TO_PDF"] = "PDF";
|
29
32
|
DataExporterType["EXPORT_PAGE_TO_XLS"] = "XLS";
|
33
|
+
DataExporterType["EXPORT_ALL_RECORDS_TO_PDF"] = "PDF";
|
34
|
+
DataExporterType["EXPORT_ALL_RECORDS_TO_XLS"] = "XLS";
|
30
35
|
DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
|
31
36
|
DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
|
32
37
|
})(DataExporterType || (DataExporterType = {}));
|
@@ -3,7 +3,7 @@ import { ApplicationContext, StringUtils, ErrorException, WarningException, Obje
|
|
3
3
|
import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
5
|
import './pesquisa-fetcher-03c8f919.js';
|
6
|
-
import './index-
|
6
|
+
import './index-88d0c8ad.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -6,7 +6,7 @@ import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-c1baf6
|
|
6
6
|
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-039abba3.js';
|
7
7
|
import { D as DataUnitFetcher } from './dataunit-fetcher-3fbf9d12.js';
|
8
8
|
import { P as PesquisaFetcher } from './pesquisa-fetcher-03c8f919.js';
|
9
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
9
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-89925609.js';
|
10
10
|
import './form-config-fetcher-30fb808f.js';
|
11
11
|
import './filter-item-type.enum-d45e026f.js';
|
12
12
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -620,7 +620,7 @@ const SnkApplication = class {
|
|
620
620
|
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
621
621
|
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
|
622
622
|
*/
|
623
|
-
async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID
|
623
|
+
async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
|
624
624
|
if (resourceID == undefined) {
|
625
625
|
resourceID = this.applicationResourceID;
|
626
626
|
}
|
@@ -630,18 +630,13 @@ const SnkApplication = class {
|
|
630
630
|
duPromisses.push(new PendingPromise(resolve, reject));
|
631
631
|
if (!waitingDu) {
|
632
632
|
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
|
633
|
-
|
633
|
+
dataUnit.loadMetadata().then(() => {
|
634
634
|
this.processResolveDataUnit(dataUnit, dataUnitName, duPromisses);
|
635
|
-
}
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
while (duPromisses.length > 0) {
|
641
|
-
duPromisses.pop().reject(reason);
|
642
|
-
}
|
643
|
-
});
|
644
|
-
}
|
635
|
+
}).catch(reason => {
|
636
|
+
while (duPromisses.length > 0) {
|
637
|
+
duPromisses.pop().reject(reason);
|
638
|
+
}
|
639
|
+
});
|
645
640
|
}
|
646
641
|
});
|
647
642
|
}
|
@@ -668,14 +663,14 @@ const SnkApplication = class {
|
|
668
663
|
/**
|
669
664
|
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
670
665
|
*/
|
671
|
-
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID
|
666
|
+
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
|
672
667
|
return new Promise((resolve, reject) => {
|
673
668
|
const dataUnit = this._duCache.get(dataUnitName);
|
674
669
|
if (dataUnit) {
|
675
670
|
resolve(dataUnit);
|
676
671
|
}
|
677
672
|
else {
|
678
|
-
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID
|
673
|
+
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID).then(dataUnit => {
|
679
674
|
resolve(dataUnit);
|
680
675
|
}).catch(reason => reject(reason));
|
681
676
|
}
|
@@ -2,14 +2,14 @@ import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js'
|
|
2
2
|
import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
|
3
3
|
import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
|
4
4
|
import './pesquisa-fetcher-03c8f919.js';
|
5
|
-
import './index-
|
5
|
+
import './index-88d0c8ad.js';
|
6
6
|
import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
|
7
7
|
import { P as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-3fbf9d12.js';
|
8
8
|
import './filter-item-type.enum-d45e026f.js';
|
9
9
|
import './form-config-fetcher-30fb808f.js';
|
10
10
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
11
11
|
import { A as AutorizationType } from './auth-fetcher-039abba3.js';
|
12
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
12
|
+
import { T as TaskbarElement } from './taskbar-elements-da72aae0.js';
|
13
13
|
import './PrintUtils-3e4ff0f5.js';
|
14
14
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
15
15
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
|
3
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
3
|
+
import { T as TaskbarElement } from './taskbar-elements-da72aae0.js';
|
4
4
|
import './DataFetcher-c1baf61d.js';
|
5
5
|
import './pesquisa-fetcher-03c8f919.js';
|
6
|
-
import { P as PresentationMode } from './index-
|
6
|
+
import { P as PresentationMode } from './index-88d0c8ad.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, ObjectUtils, UserInterface, DataType, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-
|
4
|
+
import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-88d0c8ad.js';
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-8457af36.js';
|
6
6
|
import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
|
7
|
-
import { S as SnkDataUnit } from './snk-data-unit-
|
7
|
+
import { S as SnkDataUnit } from './snk-data-unit-56b5efc4.js';
|
8
8
|
import './pesquisa-fetcher-03c8f919.js';
|
9
9
|
import './ISave-d8c8bc59.js';
|
10
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
@@ -13,7 +13,7 @@ import './dataunit-fetcher-3fbf9d12.js';
|
|
13
13
|
import './filter-item-type.enum-d45e026f.js';
|
14
14
|
import './form-config-fetcher-30fb808f.js';
|
15
15
|
import './PrintUtils-3e4ff0f5.js';
|
16
|
-
import './SnkMessageBuilder-
|
16
|
+
import './SnkMessageBuilder-89925609.js';
|
17
17
|
import './RecordIDUtils-87d02110.js';
|
18
18
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
19
19
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
@@ -39,6 +39,9 @@ class ItemBuilder {
|
|
39
39
|
items.push(this.getExportToXLS(groupName));
|
40
40
|
}
|
41
41
|
this.setExportCurrentPage(option, items);
|
42
|
+
if (this._selectedNumber > 0) {
|
43
|
+
this.setExportAllRecords(option, items);
|
44
|
+
}
|
42
45
|
this.setExportByEmail(option, items);
|
43
46
|
}
|
44
47
|
/**
|
@@ -69,6 +72,34 @@ class ItemBuilder {
|
|
69
72
|
}
|
70
73
|
}
|
71
74
|
}
|
75
|
+
/**
|
76
|
+
* Método responsável por inserir os itens de exportação para todos os registros.
|
77
|
+
* @param option - Nome da opção que será inserida no array.
|
78
|
+
* @param items - Array que será alimentado com as opções permitidas.
|
79
|
+
*/
|
80
|
+
setExportAllRecords(option, items) {
|
81
|
+
var _a;
|
82
|
+
const pageOptions = [DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF, DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS];
|
83
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS) {
|
84
|
+
items.push(this.getAllRecords());
|
85
|
+
}
|
86
|
+
if (pageOptions.includes(option)) {
|
87
|
+
let item = items.find((item) => item.id === DataExporterOption.EXPORT_ALL_RECORDS);
|
88
|
+
if (item == undefined) {
|
89
|
+
items.push(this.getAllRecords());
|
90
|
+
item = items.find((item) => item.id === DataExporterOption.EXPORT_ALL_RECORDS);
|
91
|
+
}
|
92
|
+
if (!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
93
|
+
item.children = [];
|
94
|
+
}
|
95
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF) {
|
96
|
+
item.children.push(this.getExportAllRecordsToPDF());
|
97
|
+
}
|
98
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
99
|
+
item.children.push(this.getExportAllRecordsToXLS());
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
72
103
|
/**
|
73
104
|
* Método responsável por inserir os itens de exportação por e-mail.
|
74
105
|
* @param option - Nome da opção que será inserida no array.
|
@@ -114,6 +145,17 @@ class ItemBuilder {
|
|
114
145
|
group: this._getMessage("snkDataExporter.group.custom")
|
115
146
|
};
|
116
147
|
}
|
148
|
+
/**
|
149
|
+
* Método responsável por capturar o objeto com todos os dados de exportação.
|
150
|
+
* @returns Retorna o objeto com todos os dados de exportação.
|
151
|
+
*/
|
152
|
+
getAllRecords() {
|
153
|
+
return {
|
154
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS,
|
155
|
+
label: this._getMessage("snkDataExporter.label.allRecords"),
|
156
|
+
group: this._getMessage("snkDataExporter.group.custom")
|
157
|
+
};
|
158
|
+
}
|
117
159
|
/**
|
118
160
|
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
119
161
|
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
@@ -134,6 +176,26 @@ class ItemBuilder {
|
|
134
176
|
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
135
177
|
};
|
136
178
|
}
|
179
|
+
/**
|
180
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em PDF.
|
181
|
+
* @returns Retorna o objeto com todos os dados de exportação em PDF.
|
182
|
+
*/
|
183
|
+
getExportAllRecordsToPDF() {
|
184
|
+
return {
|
185
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
186
|
+
label: "PDF (.pdf)"
|
187
|
+
};
|
188
|
+
}
|
189
|
+
/**
|
190
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em XLS.
|
191
|
+
* @returns Retorna o objeto com todos os dados de exportação em XLS.
|
192
|
+
*/
|
193
|
+
getExportAllRecordsToXLS() {
|
194
|
+
return {
|
195
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
196
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
197
|
+
};
|
198
|
+
}
|
137
199
|
/**
|
138
200
|
* Método responsável por capturar o objeto com os dados de exportação por e-mail.
|
139
201
|
* @returns Retorna o objeto com os dados de exportação por e-mail.
|
@@ -187,6 +249,20 @@ function getFormatResponse(result) {
|
|
187
249
|
return ObjectUtils.stringToObject(response);
|
188
250
|
}
|
189
251
|
|
252
|
+
const DOC_MAX_WIDTH = 800;
|
253
|
+
function getVisibleColumns(columns) {
|
254
|
+
const visibleColumns = [];
|
255
|
+
let totalWidth = 0;
|
256
|
+
for (const column of columns) {
|
257
|
+
totalWidth += column.width;
|
258
|
+
if (totalWidth >= DOC_MAX_WIDTH) {
|
259
|
+
break;
|
260
|
+
}
|
261
|
+
visibleColumns.push(column);
|
262
|
+
}
|
263
|
+
return visibleColumns;
|
264
|
+
}
|
265
|
+
|
190
266
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
191
267
|
var t = {};
|
192
268
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
@@ -202,10 +278,15 @@ class ServerSideExporterStrategy {
|
|
202
278
|
constructor(provider) {
|
203
279
|
this._provider = provider;
|
204
280
|
}
|
281
|
+
async getParsedColumns() {
|
282
|
+
const columns = await this._provider.getColumnsMetadata();
|
283
|
+
const visibleColumns = getVisibleColumns(columns);
|
284
|
+
return visibleColumns;
|
285
|
+
}
|
205
286
|
async getParams(resolveProps) {
|
206
287
|
var _a, _b, _c, _d, _e, _f;
|
207
288
|
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
208
|
-
const columns = await this.
|
289
|
+
const columns = await this.getParsedColumns();
|
209
290
|
const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
|
210
291
|
const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
|
211
292
|
const selectedIDs = this._provider.getSelectedIDs();
|
@@ -256,10 +337,15 @@ class ClientSideExporterStrategy {
|
|
256
337
|
constructor(provider) {
|
257
338
|
this._provider = provider;
|
258
339
|
}
|
340
|
+
async getParsedColumns() {
|
341
|
+
const columns = await this._provider.getColumnsMetadata();
|
342
|
+
const visibleColumns = getVisibleColumns(columns);
|
343
|
+
return visibleColumns;
|
344
|
+
}
|
259
345
|
async executeExport(resolveProps) {
|
260
346
|
const { methodName, titleGrid } = resolveProps;
|
261
347
|
const records = await this._provider.getRecords();
|
262
|
-
const columns = await this.
|
348
|
+
const columns = await this.getParsedColumns();
|
263
349
|
const [serviceName, processor] = this.getExecutor(methodName);
|
264
350
|
const payload = {
|
265
351
|
serviceName,
|
@@ -353,7 +439,9 @@ const SnkDataExporter = class {
|
|
353
439
|
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
354
440
|
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
355
441
|
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
356
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
442
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS,
|
443
|
+
DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
444
|
+
DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
357
445
|
];
|
358
446
|
this._items = [];
|
359
447
|
this._showDropdown = false;
|
@@ -444,7 +532,16 @@ const SnkDataExporter = class {
|
|
444
532
|
return DataExporterOption[key] === option;
|
445
533
|
});
|
446
534
|
}
|
447
|
-
|
535
|
+
getExportType(option) {
|
536
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
537
|
+
return 'all';
|
538
|
+
}
|
539
|
+
if (option === DataExporterOption.EXPORT_PAGE_TO_PDF || option === DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
540
|
+
return 'page';
|
541
|
+
}
|
542
|
+
return 'selection';
|
543
|
+
}
|
544
|
+
async dispatchExporter(option) {
|
448
545
|
var _a, _b, _c;
|
449
546
|
const optionKey = this.getOptionKey(option);
|
450
547
|
const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
|
@@ -454,11 +551,17 @@ const SnkDataExporter = class {
|
|
454
551
|
fileName: this._appLabel,
|
455
552
|
titleGrid: this._appLabel,
|
456
553
|
exportOption: option,
|
457
|
-
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b)
|
554
|
+
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
555
|
+
type: this.getExportType(option),
|
458
556
|
};
|
459
|
-
this.resolveExporter(params, (response) => {
|
460
|
-
|
461
|
-
|
557
|
+
await this.resolveExporter(params, (response) => {
|
558
|
+
if (response.canExport) {
|
559
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
560
|
+
isDownload }));
|
561
|
+
}
|
562
|
+
else {
|
563
|
+
ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
564
|
+
}
|
462
565
|
});
|
463
566
|
}
|
464
567
|
async processExporter(evt) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-
|
4
|
+
import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-89925609.js';
|
5
5
|
import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-3fbf9d12.js';
|
6
6
|
import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
|
7
7
|
|
@@ -39,6 +39,10 @@ const SnkDataUnit = class {
|
|
39
39
|
case Action.RECORDS_REMOVED:
|
40
40
|
this.handleRecordsRemoved(action);
|
41
41
|
break;
|
42
|
+
case Action.METADATA_LOADED:
|
43
|
+
this.fillFieldsWithRmp(this.dataUnit.metadata);
|
44
|
+
this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
|
45
|
+
break;
|
42
46
|
}
|
43
47
|
};
|
44
48
|
this.fieldsToLink = [];
|
@@ -526,10 +530,10 @@ const SnkDataUnit = class {
|
|
526
530
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
527
531
|
if (this._parentSnkDataUnit) {
|
528
532
|
this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
|
529
|
-
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID
|
533
|
+
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
|
530
534
|
}
|
531
535
|
else {
|
532
|
-
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID
|
536
|
+
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
533
537
|
}
|
534
538
|
}
|
535
539
|
async loadDataUnit() {
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { S as snk_data_unit } from './snk-data-unit-
|
1
|
+
export { S as snk_data_unit } from './snk-data-unit-56b5efc4.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
4
|
import '@sankhyalabs/ezui/dist/collection/utils';
|
5
|
-
import './SnkMessageBuilder-
|
5
|
+
import './SnkMessageBuilder-89925609.js';
|
6
6
|
import './dataunit-fetcher-3fbf9d12.js';
|
7
7
|
import './DataFetcher-c1baf61d.js';
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -4,17 +4,17 @@ import { S as SnkFormConfigManager } from './SnkFormConfigManager-5b0d69cd.js';
|
|
4
4
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import './DataFetcher-c1baf61d.js';
|
6
6
|
import './pesquisa-fetcher-03c8f919.js';
|
7
|
-
import { P as PresentationMode } from './index-
|
7
|
+
import { P as PresentationMode } from './index-88d0c8ad.js';
|
8
8
|
import './ISave-d8c8bc59.js';
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
import './dataunit-fetcher-3fbf9d12.js';
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|
13
13
|
import './form-config-fetcher-30fb808f.js';
|
14
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
14
|
+
import { T as TaskbarElement } from './taskbar-elements-da72aae0.js';
|
15
15
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
17
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-7ae1b358.js';
|
17
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-89925609.js';
|
18
18
|
import './ConfigStorage-86187da3.js';
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
|
3
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
3
|
+
import { T as TaskbarElement } from './taskbar-elements-da72aae0.js';
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
|
5
|
-
import { P as PresentationMode } from './index-
|
5
|
+
import { P as PresentationMode } from './index-88d0c8ad.js';
|
6
6
|
import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
|
7
7
|
import { s as store } from './index-bdf75557.js';
|
8
|
-
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter } from './IExporterProvider-
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter } from './IExporterProvider-1deb5d0a.js';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
10
|
import './DataFetcher-c1baf61d.js';
|
11
11
|
import './pesquisa-fetcher-03c8f919.js';
|
@@ -3,11 +3,11 @@ import { Action, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { S as SnkFormConfigManager } from './SnkFormConfigManager-5b0d69cd.js';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-efbe307f.js';
|
6
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
6
|
+
import { T as TaskbarElement } from './taskbar-elements-da72aae0.js';
|
7
7
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
8
8
|
import './DataFetcher-c1baf61d.js';
|
9
9
|
import './pesquisa-fetcher-03c8f919.js';
|
10
|
-
import { P as PresentationMode } from './index-
|
10
|
+
import { P as PresentationMode } from './index-88d0c8ad.js';
|
11
11
|
import './ISave-d8c8bc59.js';
|
12
12
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-7ae1b358.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
4
|
import './SnkFormConfigManager-5b0d69cd.js';
|
@@ -10,8 +10,8 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
10
10
|
import './filter-item-type.enum-d45e026f.js';
|
11
11
|
import '@sankhyalabs/ezui/dist/collection/utils/form';
|
12
12
|
import './field-search-efbe307f.js';
|
13
|
-
import './taskbar-elements-
|
14
|
-
import './index-
|
13
|
+
import './taskbar-elements-da72aae0.js';
|
14
|
+
import './index-88d0c8ad.js';
|
15
15
|
import './index-bdf75557.js';
|
16
16
|
import './constants-8457af36.js';
|
17
17
|
import './pesquisa-fetcher-03c8f919.js';
|
@@ -2,11 +2,11 @@ import { r as registerInstance, c as createEvent, h, g as getElement } from './i
|
|
2
2
|
import { UserInterface, StringUtils, ApplicationContext, ObjectUtils, DataType, JSUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
|
5
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
5
|
+
import { T as TaskbarElement } from './taskbar-elements-da72aae0.js';
|
6
6
|
import './DataFetcher-c1baf61d.js';
|
7
7
|
import './pesquisa-fetcher-03c8f919.js';
|
8
|
-
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, a as CrudUtils } from './IExporterProvider-
|
9
|
-
import { D as DataExporterOption, P as PresentationMode } from './index-
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, a as CrudUtils } from './IExporterProvider-1deb5d0a.js';
|
9
|
+
import { D as DataExporterOption, P as PresentationMode } from './index-88d0c8ad.js';
|
10
10
|
import './ISave-d8c8bc59.js';
|
11
11
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
12
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
4
|
-
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-
|
5
|
-
import { P as PresentationMode } from './index-
|
4
|
+
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-da72aae0.js';
|
5
|
+
import { P as PresentationMode } from './index-88d0c8ad.js';
|
6
6
|
import './index-bdf75557.js';
|
7
7
|
|
8
8
|
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}";
|