@sankhyalabs/sankhyablocks 8.15.1 → 8.16.0-dev.2
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/{SnkMultiSelectionListDataSource-303e85d1.js → IExporterProvider-9479f618.js} +94 -4
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-f9dc0d28.js → SnkFormConfigManager-1b13bacd.js} +6 -3
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-722b104e.js} +8 -12
- package/dist/cjs/{pesquisa-fetcher-213797ec.js → dataunit-fetcher-0c7106a0.js} +88 -180
- package/dist/cjs/{index-0922807b.js → index-1dfc7a6e.js} +5 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-fetcher-680e198f.js +166 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +4 -2
- package/dist/cjs/snk-application.cjs.entry.js +34 -11
- package/dist/cjs/snk-attach.cjs.entry.js +71 -46
- package/dist/cjs/snk-crud.cjs.entry.js +96 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +315 -85
- package/dist/cjs/snk-data-unit-16791a2f.js +679 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +12 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +48 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +5 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +51 -6
- package/dist/cjs/snk-grid.cjs.entry.js +164 -107
- package/dist/cjs/{snk-guides-viewer-4b6ecda8.js → snk-guides-viewer-d82746e8.js} +36 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
- package/dist/cjs/snk-simple-crud.cjs.entry.js +264 -37
- package/dist/cjs/snk-taskbar.cjs.entry.js +4 -3
- package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-9ad1f9c0.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +35 -11
- package/dist/collection/components/snk-attach/snk-attach.js +67 -44
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +249 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +135 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +112 -5
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +97 -0
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +74 -0
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +54 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +58 -0
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +59 -52
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +20 -0
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +507 -214
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
- package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +18 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
- package/dist/collection/components/snk-form/snk-form.js +102 -5
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -3
- package/dist/collection/components/snk-grid/snk-grid.js +240 -101
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +386 -18
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
- package/dist/collection/lib/@types/index.js +5 -0
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +8 -3
- package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +53 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
- package/dist/collection/lib/message/SnkMessageBuilder.js +5 -12
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -0
- package/dist/components/{field-search.js → IExporterProvider.js} +93 -6
- package/dist/components/ISave.js +47 -0
- package/dist/components/SnkFormConfigManager.js +6 -3
- package/dist/components/SnkMessageBuilder.js +8 -12
- package/dist/components/dataunit-fetcher.js +85 -182
- package/dist/components/index2.js +198 -33
- package/dist/components/pesquisa-fetcher.js +164 -0
- package/dist/components/snk-actions-button2.js +4 -11
- package/dist/components/snk-application2.js +31 -9
- package/dist/components/snk-attach2.js +65 -41
- package/dist/components/snk-crud.js +103 -11
- package/dist/components/snk-data-exporter2.js +309 -85
- package/dist/components/snk-data-unit2.js +470 -212
- package/dist/components/snk-detail-view2.js +87 -10
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +6 -1
- package/dist/components/snk-form-view2.js +72 -1
- package/dist/components/snk-form.js +53 -6
- package/dist/components/snk-grid2.js +168 -106
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +259 -23
- package/dist/components/snk-taskbar2.js +6 -5
- package/dist/esm/{SnkMultiSelectionListDataSource-36918dbf.js → IExporterProvider-5a858363.js} +93 -5
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-f53f9f87.js → SnkFormConfigManager-d4554df9.js} +6 -3
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-89925609.js} +8 -12
- package/dist/esm/{pesquisa-fetcher-fe6f3826.js → dataunit-fetcher-f7e0ffc0.js} +84 -181
- package/dist/esm/{index-0ece87a6.js → index-3aa4977a.js} +6 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-fetcher-03c8f919.js +164 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +4 -2
- package/dist/esm/snk-application.entry.js +33 -10
- package/dist/esm/snk-attach.entry.js +66 -41
- package/dist/esm/snk-crud.entry.js +96 -10
- package/dist/esm/snk-data-exporter.entry.js +316 -86
- package/dist/esm/snk-data-unit-a327d22c.js +677 -0
- package/dist/esm/snk-data-unit.entry.js +12 -2
- package/dist/esm/snk-detail-view.entry.js +48 -7
- package/dist/esm/snk-filter-bar.entry.js +5 -1
- package/dist/esm/snk-form-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +51 -6
- package/dist/esm/snk-grid.entry.js +162 -105
- package/dist/esm/{snk-guides-viewer-113be3fd.js → snk-guides-viewer-874da66f.js} +36 -8
- package/dist/esm/snk-guides-viewer.entry.js +8 -6
- package/dist/esm/snk-simple-crud.entry.js +252 -25
- package/dist/esm/snk-taskbar.entry.js +4 -3
- package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-d59867f1.js} +3 -3
- package/dist/sankhyablocks/p-0046959e.entry.js +1 -0
- package/dist/sankhyablocks/p-0e11ee18.entry.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-47b60deb.entry.js +1 -0
- package/dist/sankhyablocks/p-60e46675.entry.js +11 -0
- package/dist/sankhyablocks/p-6d4f4614.js +60 -0
- package/dist/sankhyablocks/p-6ded2076.entry.js +1 -0
- package/dist/sankhyablocks/p-7a337364.js +1 -0
- package/dist/sankhyablocks/p-7d9baaf4.entry.js +1 -0
- package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
- package/dist/sankhyablocks/p-829d4045.js +1 -0
- package/dist/sankhyablocks/p-8c6b44ea.entry.js +1 -0
- package/dist/sankhyablocks/p-8fc470e5.entry.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/p-a4b1f1eb.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-b7c4feeb.entry.js +1 -0
- package/dist/sankhyablocks/p-b8cde0d8.entry.js +1 -0
- package/dist/sankhyablocks/p-c7cbad38.js +1 -0
- package/dist/sankhyablocks/p-e0b9f59a.entry.js +1 -0
- package/dist/sankhyablocks/p-e6210aec.js +1 -0
- package/dist/sankhyablocks/p-e9bbc3d5.entry.js +1 -0
- package/dist/sankhyablocks/p-f2809746.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +7 -3
- package/dist/types/components/snk-attach/snk-attach.d.ts +11 -9
- package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +36 -1
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +19 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +14 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +12 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +24 -4
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -1
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +61 -2
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
- package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/snk-form.d.ts +14 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +46 -6
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +58 -4
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +220 -4
- package/dist/types/lib/@types/index.d.ts +5 -0
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/snk-data-unit-41c29713.js +0 -462
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
- package/dist/components/index3.js +0 -199
- package/dist/esm/snk-data-unit-de1d140d.js +0 -460
- package/dist/sankhyablocks/p-032fe52e.js +0 -1
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
- package/dist/sankhyablocks/p-07a61550.entry.js +0 -1
- package/dist/sankhyablocks/p-0899e0b5.entry.js +0 -1
- package/dist/sankhyablocks/p-154a7f33.entry.js +0 -1
- package/dist/sankhyablocks/p-15802c59.entry.js +0 -1
- package/dist/sankhyablocks/p-164666b1.js +0 -65
- package/dist/sankhyablocks/p-32556aa6.js +0 -1
- package/dist/sankhyablocks/p-328585d0.entry.js +0 -1
- package/dist/sankhyablocks/p-38289a55.js +0 -1
- package/dist/sankhyablocks/p-52c8e589.js +0 -1
- package/dist/sankhyablocks/p-5cb07080.js +0 -1
- package/dist/sankhyablocks/p-74d349c3.entry.js +0 -1
- package/dist/sankhyablocks/p-7fe120b8.entry.js +0 -11
- package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
- package/dist/sankhyablocks/p-af1ac81f.entry.js +0 -1
- package/dist/sankhyablocks/p-b4525fc0.entry.js +0 -1
- package/dist/sankhyablocks/p-cce0865d.js +0 -1
- package/dist/sankhyablocks/p-dec65f6c.entry.js +0 -1
- package/dist/sankhyablocks/p-ee9536bc.entry.js +0 -1
- package/dist/sankhyablocks/p-f13f7616.entry.js +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -1,10 +1,16 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { ApplicationContext, ObjectUtils, DataType, ElementIDUtils } from '@sankhyalabs/core';
|
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
|
4
|
+
import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat } from './ISave.js';
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants.js';
|
6
6
|
import { D as DataFetcher } from './DataFetcher.js';
|
7
7
|
import { S as SnkDataUnit } from './snk-data-unit2.js';
|
8
|
+
import './pesquisa-fetcher.js';
|
9
|
+
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
|
+
import './dataunit-fetcher.js';
|
12
|
+
import './filter-item-type.enum.js';
|
13
|
+
import './form-config-fetcher.js';
|
8
14
|
import { d as defineCustomElement$1 } from './snk-exporter-email-sender2.js';
|
9
15
|
|
10
16
|
class ItemBuilder {
|
@@ -27,6 +33,9 @@ class ItemBuilder {
|
|
27
33
|
items.push(this.getExportToXLS(groupName));
|
28
34
|
}
|
29
35
|
this.setExportCurrentPage(option, items);
|
36
|
+
if (this._selectedNumber > 0) {
|
37
|
+
this.setExportAllRecords(option, items);
|
38
|
+
}
|
30
39
|
this.setExportByEmail(option, items);
|
31
40
|
}
|
32
41
|
/**
|
@@ -57,6 +66,34 @@ class ItemBuilder {
|
|
57
66
|
}
|
58
67
|
}
|
59
68
|
}
|
69
|
+
/**
|
70
|
+
* Método responsável por inserir os itens de exportação para todos os registros.
|
71
|
+
* @param option - Nome da opção que será inserida no array.
|
72
|
+
* @param items - Array que será alimentado com as opções permitidas.
|
73
|
+
*/
|
74
|
+
setExportAllRecords(option, items) {
|
75
|
+
var _a;
|
76
|
+
const pageOptions = [DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF, DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS];
|
77
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS) {
|
78
|
+
items.push(this.getAllRecords());
|
79
|
+
}
|
80
|
+
if (pageOptions.includes(option)) {
|
81
|
+
let item = items.find((item) => item.id === DataExporterOption.EXPORT_ALL_RECORDS);
|
82
|
+
if (item == undefined) {
|
83
|
+
items.push(this.getAllRecords());
|
84
|
+
item = items.find((item) => item.id === DataExporterOption.EXPORT_ALL_RECORDS);
|
85
|
+
}
|
86
|
+
if (!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
87
|
+
item.children = [];
|
88
|
+
}
|
89
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF) {
|
90
|
+
item.children.push(this.getExportAllRecordsToPDF());
|
91
|
+
}
|
92
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
93
|
+
item.children.push(this.getExportAllRecordsToXLS());
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
60
97
|
/**
|
61
98
|
* Método responsável por inserir os itens de exportação por e-mail.
|
62
99
|
* @param option - Nome da opção que será inserida no array.
|
@@ -102,6 +139,17 @@ class ItemBuilder {
|
|
102
139
|
group: this._getMessage("snkDataExporter.group.custom")
|
103
140
|
};
|
104
141
|
}
|
142
|
+
/**
|
143
|
+
* Método responsável por capturar o objeto com todos os dados de exportação.
|
144
|
+
* @returns Retorna o objeto com todos os dados de exportação.
|
145
|
+
*/
|
146
|
+
getAllRecords() {
|
147
|
+
return {
|
148
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS,
|
149
|
+
label: this._getMessage("snkDataExporter.label.allRecords"),
|
150
|
+
group: this._getMessage("snkDataExporter.group.custom")
|
151
|
+
};
|
152
|
+
}
|
105
153
|
/**
|
106
154
|
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
107
155
|
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
@@ -122,6 +170,26 @@ class ItemBuilder {
|
|
122
170
|
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
123
171
|
};
|
124
172
|
}
|
173
|
+
/**
|
174
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em PDF.
|
175
|
+
* @returns Retorna o objeto com todos os dados de exportação em PDF.
|
176
|
+
*/
|
177
|
+
getExportAllRecordsToPDF() {
|
178
|
+
return {
|
179
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
180
|
+
label: "PDF (.pdf)"
|
181
|
+
};
|
182
|
+
}
|
183
|
+
/**
|
184
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em XLS.
|
185
|
+
* @returns Retorna o objeto com todos os dados de exportação em XLS.
|
186
|
+
*/
|
187
|
+
getExportAllRecordsToXLS() {
|
188
|
+
return {
|
189
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
190
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
191
|
+
};
|
192
|
+
}
|
125
193
|
/**
|
126
194
|
* Método responsável por capturar o objeto com os dados de exportação por e-mail.
|
127
195
|
* @returns Retorna o objeto com os dados de exportação por e-mail.
|
@@ -147,38 +215,6 @@ class ItemBuilder {
|
|
147
215
|
}
|
148
216
|
}
|
149
217
|
|
150
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
151
|
-
var t = {};
|
152
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
153
|
-
t[p] = s[p];
|
154
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
155
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
156
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
157
|
-
t[p[i]] = s[p[i]];
|
158
|
-
}
|
159
|
-
return t;
|
160
|
-
};
|
161
|
-
function fetchDataExporter(_a) {
|
162
|
-
var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
163
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
164
|
-
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
165
|
-
const payload = { serviceName, requestBody };
|
166
|
-
return new Promise((resolve, reject) => {
|
167
|
-
DataFetcher.get()
|
168
|
-
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
169
|
-
.then(result => resolve(getFormatResponse$1(result)))
|
170
|
-
.catch(error => reject(error));
|
171
|
-
});
|
172
|
-
}
|
173
|
-
function getFormatResponse$1(result) {
|
174
|
-
var _a;
|
175
|
-
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
176
|
-
if (response == undefined) {
|
177
|
-
return;
|
178
|
-
}
|
179
|
-
return ObjectUtils.stringToObject(response);
|
180
|
-
}
|
181
|
-
|
182
218
|
function getMessage(application, key, params) {
|
183
219
|
var _a;
|
184
220
|
return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
@@ -207,17 +243,196 @@ function getFormatResponse(result) {
|
|
207
243
|
return ObjectUtils.stringToObject(response);
|
208
244
|
}
|
209
245
|
|
246
|
+
const DOC_MAX_WIDTH = 800;
|
247
|
+
function getVisibleColumns(columns) {
|
248
|
+
const visibleColumns = [];
|
249
|
+
let totalWidth = 0;
|
250
|
+
for (const column of columns) {
|
251
|
+
totalWidth += column.width;
|
252
|
+
if (totalWidth >= DOC_MAX_WIDTH) {
|
253
|
+
break;
|
254
|
+
}
|
255
|
+
visibleColumns.push(column);
|
256
|
+
}
|
257
|
+
return visibleColumns;
|
258
|
+
}
|
259
|
+
function getOptionKey(option) {
|
260
|
+
return Object.keys(DataExporterOption)
|
261
|
+
.find((key) => {
|
262
|
+
return DataExporterOption[key] === option;
|
263
|
+
});
|
264
|
+
}
|
265
|
+
|
266
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
267
|
+
var t = {};
|
268
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
269
|
+
t[p] = s[p];
|
270
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
271
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
272
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
273
|
+
t[p[i]] = s[p[i]];
|
274
|
+
}
|
275
|
+
return t;
|
276
|
+
};
|
277
|
+
class ServerSideExporterStrategy {
|
278
|
+
constructor(provider) {
|
279
|
+
this._provider = provider;
|
280
|
+
}
|
281
|
+
async getParsedColumns() {
|
282
|
+
const columns = await this._provider.getColumnsMetadata();
|
283
|
+
const visibleColumns = getVisibleColumns(columns);
|
284
|
+
return visibleColumns;
|
285
|
+
}
|
286
|
+
async getParams(resolveProps) {
|
287
|
+
var _a, _b, _c, _d, _e, _f;
|
288
|
+
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
289
|
+
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();
|
290
|
+
const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
|
291
|
+
const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
|
292
|
+
const selectedIDs = this._provider.getSelectedIDs();
|
293
|
+
const option = resolveProps.exportOption;
|
294
|
+
const currentPageOptions = [
|
295
|
+
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
296
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS
|
297
|
+
];
|
298
|
+
delete resolveProps.exportOption;
|
299
|
+
let params = Object.assign({ filters,
|
300
|
+
columns,
|
301
|
+
sort,
|
302
|
+
resourceURI, selectedIDs: selectedIDs.slice(0, this._provider.getExportLimit()) }, resolveProps);
|
303
|
+
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
304
|
+
const offset = this._provider.getOffset();
|
305
|
+
const limit = this._provider.getPageSize();
|
306
|
+
params = Object.assign(Object.assign({}, params), { offset,
|
307
|
+
limit, selectedIDs: [] });
|
308
|
+
}
|
309
|
+
else if (resolveProps.type == "all") {
|
310
|
+
params = Object.assign(Object.assign({}, params), { offset: 0, limit: this._provider.getExportLimit(), selectedIDs: [] });
|
311
|
+
}
|
312
|
+
return Promise.resolve(params);
|
313
|
+
}
|
314
|
+
async executeExport(resolveProps) {
|
315
|
+
const _a = await this.getParams(resolveProps), { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
316
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
317
|
+
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
318
|
+
const payload = { serviceName, requestBody };
|
319
|
+
return new Promise((resolve, reject) => {
|
320
|
+
DataFetcher.get()
|
321
|
+
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
322
|
+
.then(result => resolve(this.getFormatResponse(result)))
|
323
|
+
.catch(error => reject(error));
|
324
|
+
});
|
325
|
+
}
|
326
|
+
getFormatResponse(result) {
|
327
|
+
var _a;
|
328
|
+
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
329
|
+
if (response == undefined) {
|
330
|
+
return;
|
331
|
+
}
|
332
|
+
return ObjectUtils.stringToObject(response);
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
class ClientSideExporterStrategy {
|
337
|
+
constructor(provider) {
|
338
|
+
this._provider = provider;
|
339
|
+
}
|
340
|
+
async getParsedColumns() {
|
341
|
+
const columns = await this._provider.getColumnsMetadata();
|
342
|
+
const visibleColumns = getVisibleColumns(columns);
|
343
|
+
return visibleColumns;
|
344
|
+
}
|
345
|
+
async executeExport(resolveProps) {
|
346
|
+
const { methodName, titleGrid } = resolveProps;
|
347
|
+
const records = await this._provider.getRecords();
|
348
|
+
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();
|
349
|
+
const [serviceName, processor] = this.getExecutor(methodName);
|
350
|
+
const payload = {
|
351
|
+
serviceName,
|
352
|
+
requestBody: {
|
353
|
+
grid: {
|
354
|
+
titleGrid,
|
355
|
+
columns: this.buildColumnsObject(columns),
|
356
|
+
rows: this.buildRowsObject(columns, records),
|
357
|
+
customOptions: { xlsxExtension: false }
|
358
|
+
}
|
359
|
+
}
|
360
|
+
};
|
361
|
+
return new Promise((resolve, reject) => {
|
362
|
+
DataFetcher.get()
|
363
|
+
.callServiceBroker(serviceName, payload)
|
364
|
+
.then(result => resolve(processor(result)))
|
365
|
+
.catch(error => reject(error));
|
366
|
+
});
|
367
|
+
}
|
368
|
+
getExecutor(methodName) {
|
369
|
+
if (methodName === "exportToPDF") {
|
370
|
+
return [
|
371
|
+
"GridPDFBuilderSP.buildPDFFromJson",
|
372
|
+
responseBody => ({
|
373
|
+
fileSessionKey: responseBody.chavePDF.valor,
|
374
|
+
canPrint: responseBody.permiteImprimir.valor === "S",
|
375
|
+
canExport: responseBody.permiteExportar.valor === "S",
|
376
|
+
canSendEmail: responseBody.canSendEmail.valor === "S",
|
377
|
+
useAppPrint: true
|
378
|
+
})
|
379
|
+
];
|
380
|
+
}
|
381
|
+
return [
|
382
|
+
"GridXLSBuilderSP.buildXLSFromJson",
|
383
|
+
responseBody => ({
|
384
|
+
fileSessionKey: responseBody.chaveXLS.valor,
|
385
|
+
canPrint: false,
|
386
|
+
canExport: false,
|
387
|
+
useAppPrint: false,
|
388
|
+
canSendEmail: false
|
389
|
+
})
|
390
|
+
];
|
391
|
+
}
|
392
|
+
buildColumnsObject(columns) {
|
393
|
+
return {
|
394
|
+
column: columns.map((column, index) => {
|
395
|
+
const { label, id, width, userInterface } = column;
|
396
|
+
return Object.assign({ index: index + 1, id,
|
397
|
+
label,
|
398
|
+
width, presentationType: "P" }, (TYPE_MAP[userInterface] || { type: "S", align: "left" }));
|
399
|
+
})
|
400
|
+
};
|
401
|
+
}
|
402
|
+
buildRowsObject(columns, records) {
|
403
|
+
return {
|
404
|
+
row: records.map(rawRecord => {
|
405
|
+
const record = {};
|
406
|
+
columns.forEach((column, index) => record["c" + (index + 1)] = { $: this.formatValue(rawRecord, column) });
|
407
|
+
return record;
|
408
|
+
})
|
409
|
+
};
|
410
|
+
}
|
411
|
+
formatValue(record, column) {
|
412
|
+
if (this._provider.formatValue != undefined) {
|
413
|
+
return this._provider.formatValue(record, column);
|
414
|
+
}
|
415
|
+
return record[column.id] || "";
|
416
|
+
}
|
417
|
+
}
|
418
|
+
const TYPE_MAP = {
|
419
|
+
[UserInterface.DATE]: { type: "D", align: "center" },
|
420
|
+
[UserInterface.DATETIME]: { type: "H", align: "center" },
|
421
|
+
[UserInterface.TIME]: { type: "I", align: "right" },
|
422
|
+
[UserInterface.ELAPSEDTIME]: { type: "I", align: "right" },
|
423
|
+
[UserInterface.DECIMALNUMBER]: { type: "F", align: "right" },
|
424
|
+
[UserInterface.INTEGERNUMBER]: { type: "I", align: "right" },
|
425
|
+
[UserInterface.SEARCH]: { type: "S", align: "right" }
|
426
|
+
};
|
427
|
+
|
210
428
|
const snkDataExporterCss = ".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";
|
211
429
|
|
212
|
-
const LIMIT_PER_EXPORT = 5000;
|
213
430
|
const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
214
431
|
constructor() {
|
215
432
|
super();
|
216
433
|
this.__registerHost();
|
217
434
|
this._selectedNumber = 0;
|
218
435
|
this._customPrefix = "$custom$";
|
219
|
-
this._items = [];
|
220
|
-
this._showDropdown = false;
|
221
436
|
this._releasedToExport = [
|
222
437
|
DataExporterOption.EXPORT_TO_PDF,
|
223
438
|
DataExporterOption.EXPORT_TO_XLS,
|
@@ -225,8 +440,12 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
225
440
|
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
226
441
|
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
227
442
|
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
228
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
443
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS,
|
444
|
+
DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
445
|
+
DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
229
446
|
];
|
447
|
+
this._items = [];
|
448
|
+
this._showDropdown = false;
|
230
449
|
this.provider = null;
|
231
450
|
this.messagesBuilder = undefined;
|
232
451
|
}
|
@@ -297,31 +516,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
297
516
|
if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
|
298
517
|
return;
|
299
518
|
}
|
300
|
-
|
301
|
-
const columns = await this.provider.getColumnsMetadata();
|
302
|
-
const sort = this.provider.getOrders();
|
303
|
-
const resourceURI = this.provider.getResourceURI();
|
304
|
-
const selectedIDs = this.provider.getSelectedIDs();
|
305
|
-
const option = resolveProps.exportOption;
|
306
|
-
const currentPageOptions = [
|
307
|
-
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
308
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
309
|
-
];
|
310
|
-
delete resolveProps.exportOption;
|
311
|
-
let params = Object.assign({ filters,
|
312
|
-
columns,
|
313
|
-
sort,
|
314
|
-
resourceURI, selectedIDs: selectedIDs.slice(0, LIMIT_PER_EXPORT) }, resolveProps);
|
315
|
-
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
316
|
-
const offset = this.provider.getOffset();
|
317
|
-
const limit = this.provider.getLimit();
|
318
|
-
params = Object.assign(Object.assign({}, params), { offset,
|
319
|
-
limit, selectedIDs: [] });
|
320
|
-
}
|
321
|
-
else if (resolveProps.type == "all") {
|
322
|
-
params = Object.assign(Object.assign({}, params), { offset: 0, limit: LIMIT_PER_EXPORT, selectedIDs: [] });
|
323
|
-
}
|
324
|
-
fetchDataExporter(params)
|
519
|
+
this.getExporterStrategy().executeExport(resolveProps)
|
325
520
|
.then((result) => callbackResolver(result))
|
326
521
|
.catch((exception) => {
|
327
522
|
console.error(exception);
|
@@ -329,14 +524,26 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
329
524
|
ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
|
330
525
|
});
|
331
526
|
}
|
527
|
+
getExporterStrategy() {
|
528
|
+
return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
|
529
|
+
}
|
332
530
|
getOptionKey(option) {
|
333
531
|
return Object.keys(DataExporterOption)
|
334
532
|
.find((key) => {
|
335
533
|
return DataExporterOption[key] === option;
|
336
534
|
});
|
337
535
|
}
|
338
|
-
|
339
|
-
|
536
|
+
getExportType(option) {
|
537
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
538
|
+
return 'all';
|
539
|
+
}
|
540
|
+
if (option === DataExporterOption.EXPORT_PAGE_TO_PDF || option === DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
541
|
+
return 'page';
|
542
|
+
}
|
543
|
+
return 'selection';
|
544
|
+
}
|
545
|
+
async dispatchExporter(option) {
|
546
|
+
var _a, _b, _c;
|
340
547
|
const optionKey = this.getOptionKey(option);
|
341
548
|
const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
|
342
549
|
const isDownload = DataExporterType[optionKey] === DataExporterType.EXPORT_TO_XLS;
|
@@ -345,15 +552,21 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
345
552
|
fileName: this._appLabel,
|
346
553
|
titleGrid: this._appLabel,
|
347
554
|
exportOption: option,
|
348
|
-
limit:
|
555
|
+
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
556
|
+
type: this.getExportType(option),
|
349
557
|
};
|
350
|
-
this.resolveExporter(params, (response) => {
|
351
|
-
|
352
|
-
|
558
|
+
await this.resolveExporter(params, (response) => {
|
559
|
+
if (response.canExport || fileType === DataExporterType.EXPORT_TO_PDF) {
|
560
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
561
|
+
isDownload }));
|
562
|
+
}
|
563
|
+
else {
|
564
|
+
ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
565
|
+
}
|
353
566
|
});
|
354
567
|
}
|
355
568
|
async processExporter(evt) {
|
356
|
-
var _a, _b, _c, _d;
|
569
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
357
570
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
358
571
|
const exportCurrentPageOptions = [DataExporterOption.EXPORT_PAGE_TO_PDF, DataExporterOption.EXPORT_PAGE_TO_XLS];
|
359
572
|
const isCustomReport = (_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix);
|
@@ -361,18 +574,19 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
361
574
|
return;
|
362
575
|
const selectedRecords = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getSelectedIDs();
|
363
576
|
const totalRecords = (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getTotalRecords();
|
364
|
-
const totalPerPage = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.
|
577
|
+
const totalPerPage = (_e = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getPageSize) === null || _e === void 0 ? void 0 : _e.call(_d);
|
578
|
+
const exportLimit = (_g = (_f = this.provider) === null || _f === void 0 ? void 0 : _f.getExportLimit) === null || _g === void 0 ? void 0 : _g.call(_f);
|
365
579
|
let limitExceeded = false;
|
366
|
-
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <=
|
580
|
+
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= exportLimit) || isCustomReport) {
|
367
581
|
limitExceeded = false;
|
368
582
|
}
|
369
583
|
else if (selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) {
|
370
|
-
limitExceeded = selectedRecords.length >
|
584
|
+
limitExceeded = selectedRecords.length > exportLimit;
|
371
585
|
}
|
372
|
-
else if (totalRecords >
|
586
|
+
else if (totalRecords > exportLimit)
|
373
587
|
limitExceeded = true;
|
374
588
|
if (limitExceeded) {
|
375
|
-
const formattedLimit =
|
589
|
+
const formattedLimit = exportLimit.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
|
376
590
|
const limitModalMessages = {
|
377
591
|
title: this.getMessage("snkDataExporter.limitExceeded.title"),
|
378
592
|
description: `
|
@@ -397,7 +611,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
397
611
|
this._showDropdown = false;
|
398
612
|
return;
|
399
613
|
}
|
400
|
-
if (!this.
|
614
|
+
if (!this.getFilteredReleasedToExport().includes(item === null || item === void 0 ? void 0 : item.id)) {
|
401
615
|
return;
|
402
616
|
}
|
403
617
|
if (item.id === DataExporterOption.EXPORT_BY_EMAIL) {
|
@@ -408,9 +622,20 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
408
622
|
}
|
409
623
|
this._showDropdown = false;
|
410
624
|
}
|
625
|
+
getFilteredReleasedToExport() {
|
626
|
+
var _a, _b;
|
627
|
+
if (this.provider == undefined) {
|
628
|
+
return this._releasedToExport;
|
629
|
+
}
|
630
|
+
const hiddenOptions = (_b = (_a = this.provider).getHiddenOptions) === null || _b === void 0 ? void 0 : _b.call(_a);
|
631
|
+
if (hiddenOptions == undefined) {
|
632
|
+
return this._releasedToExport;
|
633
|
+
}
|
634
|
+
return this._releasedToExport.filter(option => !hiddenOptions.includes(option));
|
635
|
+
}
|
411
636
|
loadItems() {
|
412
637
|
const items = [];
|
413
|
-
this.
|
638
|
+
this.getFilteredReleasedToExport()
|
414
639
|
.forEach((option) => {
|
415
640
|
var _a;
|
416
641
|
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
@@ -418,8 +643,8 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
418
643
|
this.loadPersonalizedItems(items);
|
419
644
|
}
|
420
645
|
async loadPersonalizedItems(items) {
|
421
|
-
var _a;
|
422
|
-
const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
|
646
|
+
var _a, _b;
|
647
|
+
const recordID = (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID) === null || _b === void 0 ? void 0 : _b.call(_a);
|
423
648
|
if (recordID == undefined) {
|
424
649
|
this._items = items;
|
425
650
|
return;
|
@@ -435,10 +660,10 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
435
660
|
this._items = items;
|
436
661
|
}
|
437
662
|
openPersonalizedReports(option) {
|
438
|
-
var _a;
|
663
|
+
var _a, _b;
|
439
664
|
const pkObject = [];
|
440
665
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
441
|
-
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
666
|
+
(_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs) === null || _b === void 0 ? void 0 : _b.call(_a).forEach(({ name, type, value }, index) => {
|
442
667
|
const fields = {};
|
443
668
|
fields['fields'] = [];
|
444
669
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
@@ -463,8 +688,8 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
463
688
|
}
|
464
689
|
}
|
465
690
|
loadDropdown() {
|
466
|
-
var _a
|
467
|
-
this._selectedNumber = ((
|
691
|
+
var _a;
|
692
|
+
this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedNumber()) || 0;
|
468
693
|
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
469
694
|
this.loadItems();
|
470
695
|
}
|
@@ -520,8 +745,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
520
745
|
"provider": [16],
|
521
746
|
"messagesBuilder": [1040],
|
522
747
|
"_items": [32],
|
523
|
-
"_showDropdown": [32]
|
524
|
-
"_releasedToExport": [32]
|
748
|
+
"_showDropdown": [32]
|
525
749
|
}]);
|
526
750
|
function defineCustomElement() {
|
527
751
|
if (typeof customElements === "undefined") {
|