@sankhyalabs/sankhyablocks 8.15.1 → 8.16.0-dev.1
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-c78cb1b8.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-620b29a1.js} +87 -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-82dea87e.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-05a1ba27.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 +7 -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 +84 -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-343272b3.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-3fbf9d12.js} +83 -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-8f98b45f.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-aee2cafe.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-0d91b10f.entry.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-26394a01.entry.js +1 -0
- package/dist/sankhyablocks/p-2d649237.entry.js +1 -0
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-44767378.entry.js +1 -0
- package/dist/sankhyablocks/p-47b60deb.entry.js +1 -0
- package/dist/sankhyablocks/p-4f72727a.entry.js +1 -0
- package/dist/sankhyablocks/p-550fee49.entry.js +1 -0
- package/dist/sankhyablocks/p-5539ecb4.entry.js +1 -0
- package/dist/sankhyablocks/p-672302c3.js +60 -0
- package/dist/sankhyablocks/p-7a337364.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-8a5910a7.entry.js +1 -0
- package/dist/sankhyablocks/p-8cc64963.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-9e99a92a.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-be603a24.js +1 -0
- package/dist/sankhyablocks/p-d09feef1.js +1 -0
- package/dist/sankhyablocks/p-e95b3b93.entry.js +11 -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,13 +1,24 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
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 './index-3aa4977a.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-
|
8
|
-
import './
|
7
|
+
import { S as SnkDataUnit } from './snk-data-unit-8f98b45f.js';
|
8
|
+
import './pesquisa-fetcher-03c8f919.js';
|
9
|
+
import './ISave-d8c8bc59.js';
|
10
|
+
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
|
-
import './
|
12
|
+
import './dataunit-fetcher-3fbf9d12.js';
|
13
|
+
import './filter-item-type.enum-d45e026f.js';
|
14
|
+
import './form-config-fetcher-30fb808f.js';
|
15
|
+
import './PrintUtils-3e4ff0f5.js';
|
16
|
+
import './SnkMessageBuilder-89925609.js';
|
17
|
+
import './RecordIDUtils-87d02110.js';
|
18
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
19
|
+
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
20
|
+
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
21
|
+
import './ResourceIDUtils-a114189a.js';
|
11
22
|
|
12
23
|
class ItemBuilder {
|
13
24
|
constructor(getMessage, selectedNumber) {
|
@@ -29,6 +40,9 @@ class ItemBuilder {
|
|
29
40
|
items.push(this.getExportToXLS(groupName));
|
30
41
|
}
|
31
42
|
this.setExportCurrentPage(option, items);
|
43
|
+
if (this._selectedNumber > 0) {
|
44
|
+
this.setExportAllRecords(option, items);
|
45
|
+
}
|
32
46
|
this.setExportByEmail(option, items);
|
33
47
|
}
|
34
48
|
/**
|
@@ -59,6 +73,34 @@ class ItemBuilder {
|
|
59
73
|
}
|
60
74
|
}
|
61
75
|
}
|
76
|
+
/**
|
77
|
+
* Método responsável por inserir os itens de exportação para todos os registros.
|
78
|
+
* @param option - Nome da opção que será inserida no array.
|
79
|
+
* @param items - Array que será alimentado com as opções permitidas.
|
80
|
+
*/
|
81
|
+
setExportAllRecords(option, items) {
|
82
|
+
var _a;
|
83
|
+
const pageOptions = [DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF, DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS];
|
84
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS) {
|
85
|
+
items.push(this.getAllRecords());
|
86
|
+
}
|
87
|
+
if (pageOptions.includes(option)) {
|
88
|
+
let item = items.find((item) => item.id === DataExporterOption.EXPORT_ALL_RECORDS);
|
89
|
+
if (item == undefined) {
|
90
|
+
items.push(this.getAllRecords());
|
91
|
+
item = items.find((item) => item.id === DataExporterOption.EXPORT_ALL_RECORDS);
|
92
|
+
}
|
93
|
+
if (!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
94
|
+
item.children = [];
|
95
|
+
}
|
96
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF) {
|
97
|
+
item.children.push(this.getExportAllRecordsToPDF());
|
98
|
+
}
|
99
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
100
|
+
item.children.push(this.getExportAllRecordsToXLS());
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
62
104
|
/**
|
63
105
|
* Método responsável por inserir os itens de exportação por e-mail.
|
64
106
|
* @param option - Nome da opção que será inserida no array.
|
@@ -104,6 +146,17 @@ class ItemBuilder {
|
|
104
146
|
group: this._getMessage("snkDataExporter.group.custom")
|
105
147
|
};
|
106
148
|
}
|
149
|
+
/**
|
150
|
+
* Método responsável por capturar o objeto com todos os dados de exportação.
|
151
|
+
* @returns Retorna o objeto com todos os dados de exportação.
|
152
|
+
*/
|
153
|
+
getAllRecords() {
|
154
|
+
return {
|
155
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS,
|
156
|
+
label: this._getMessage("snkDataExporter.label.allRecords"),
|
157
|
+
group: this._getMessage("snkDataExporter.group.custom")
|
158
|
+
};
|
159
|
+
}
|
107
160
|
/**
|
108
161
|
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
109
162
|
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
@@ -124,6 +177,26 @@ class ItemBuilder {
|
|
124
177
|
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
125
178
|
};
|
126
179
|
}
|
180
|
+
/**
|
181
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em PDF.
|
182
|
+
* @returns Retorna o objeto com todos os dados de exportação em PDF.
|
183
|
+
*/
|
184
|
+
getExportAllRecordsToPDF() {
|
185
|
+
return {
|
186
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
187
|
+
label: "PDF (.pdf)"
|
188
|
+
};
|
189
|
+
}
|
190
|
+
/**
|
191
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em XLS.
|
192
|
+
* @returns Retorna o objeto com todos os dados de exportação em XLS.
|
193
|
+
*/
|
194
|
+
getExportAllRecordsToXLS() {
|
195
|
+
return {
|
196
|
+
id: DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
197
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
198
|
+
};
|
199
|
+
}
|
127
200
|
/**
|
128
201
|
* Método responsável por capturar o objeto com os dados de exportação por e-mail.
|
129
202
|
* @returns Retorna o objeto com os dados de exportação por e-mail.
|
@@ -149,38 +222,6 @@ class ItemBuilder {
|
|
149
222
|
}
|
150
223
|
}
|
151
224
|
|
152
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
153
|
-
var t = {};
|
154
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
155
|
-
t[p] = s[p];
|
156
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
157
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
158
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
159
|
-
t[p[i]] = s[p[i]];
|
160
|
-
}
|
161
|
-
return t;
|
162
|
-
};
|
163
|
-
function fetchDataExporter(_a) {
|
164
|
-
var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
165
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
166
|
-
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
167
|
-
const payload = { serviceName, requestBody };
|
168
|
-
return new Promise((resolve, reject) => {
|
169
|
-
DataFetcher.get()
|
170
|
-
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
171
|
-
.then(result => resolve(getFormatResponse$1(result)))
|
172
|
-
.catch(error => reject(error));
|
173
|
-
});
|
174
|
-
}
|
175
|
-
function getFormatResponse$1(result) {
|
176
|
-
var _a;
|
177
|
-
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
178
|
-
if (response == undefined) {
|
179
|
-
return;
|
180
|
-
}
|
181
|
-
return ObjectUtils.stringToObject(response);
|
182
|
-
}
|
183
|
-
|
184
225
|
function getMessage(application, key, params) {
|
185
226
|
var _a;
|
186
227
|
return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
@@ -209,16 +250,195 @@ function getFormatResponse(result) {
|
|
209
250
|
return ObjectUtils.stringToObject(response);
|
210
251
|
}
|
211
252
|
|
253
|
+
const DOC_MAX_WIDTH = 800;
|
254
|
+
function getVisibleColumns(columns) {
|
255
|
+
const visibleColumns = [];
|
256
|
+
let totalWidth = 0;
|
257
|
+
for (const column of columns) {
|
258
|
+
totalWidth += column.width;
|
259
|
+
if (totalWidth >= DOC_MAX_WIDTH) {
|
260
|
+
break;
|
261
|
+
}
|
262
|
+
visibleColumns.push(column);
|
263
|
+
}
|
264
|
+
return visibleColumns;
|
265
|
+
}
|
266
|
+
function getOptionKey(option) {
|
267
|
+
return Object.keys(DataExporterOption)
|
268
|
+
.find((key) => {
|
269
|
+
return DataExporterOption[key] === option;
|
270
|
+
});
|
271
|
+
}
|
272
|
+
|
273
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
274
|
+
var t = {};
|
275
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
276
|
+
t[p] = s[p];
|
277
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
278
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
279
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
280
|
+
t[p[i]] = s[p[i]];
|
281
|
+
}
|
282
|
+
return t;
|
283
|
+
};
|
284
|
+
class ServerSideExporterStrategy {
|
285
|
+
constructor(provider) {
|
286
|
+
this._provider = provider;
|
287
|
+
}
|
288
|
+
async getParsedColumns() {
|
289
|
+
const columns = await this._provider.getColumnsMetadata();
|
290
|
+
const visibleColumns = getVisibleColumns(columns);
|
291
|
+
return visibleColumns;
|
292
|
+
}
|
293
|
+
async getParams(resolveProps) {
|
294
|
+
var _a, _b, _c, _d, _e, _f;
|
295
|
+
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
296
|
+
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();
|
297
|
+
const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
|
298
|
+
const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
|
299
|
+
const selectedIDs = this._provider.getSelectedIDs();
|
300
|
+
const option = resolveProps.exportOption;
|
301
|
+
const currentPageOptions = [
|
302
|
+
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
303
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS
|
304
|
+
];
|
305
|
+
delete resolveProps.exportOption;
|
306
|
+
let params = Object.assign({ filters,
|
307
|
+
columns,
|
308
|
+
sort,
|
309
|
+
resourceURI, selectedIDs: selectedIDs.slice(0, this._provider.getExportLimit()) }, resolveProps);
|
310
|
+
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
311
|
+
const offset = this._provider.getOffset();
|
312
|
+
const limit = this._provider.getPageSize();
|
313
|
+
params = Object.assign(Object.assign({}, params), { offset,
|
314
|
+
limit, selectedIDs: [] });
|
315
|
+
}
|
316
|
+
else if (resolveProps.type == "all") {
|
317
|
+
params = Object.assign(Object.assign({}, params), { offset: 0, limit: this._provider.getExportLimit(), selectedIDs: [] });
|
318
|
+
}
|
319
|
+
return Promise.resolve(params);
|
320
|
+
}
|
321
|
+
async executeExport(resolveProps) {
|
322
|
+
const _a = await this.getParams(resolveProps), { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
323
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
324
|
+
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
325
|
+
const payload = { serviceName, requestBody };
|
326
|
+
return new Promise((resolve, reject) => {
|
327
|
+
DataFetcher.get()
|
328
|
+
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
329
|
+
.then(result => resolve(this.getFormatResponse(result)))
|
330
|
+
.catch(error => reject(error));
|
331
|
+
});
|
332
|
+
}
|
333
|
+
getFormatResponse(result) {
|
334
|
+
var _a;
|
335
|
+
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
336
|
+
if (response == undefined) {
|
337
|
+
return;
|
338
|
+
}
|
339
|
+
return ObjectUtils.stringToObject(response);
|
340
|
+
}
|
341
|
+
}
|
342
|
+
|
343
|
+
class ClientSideExporterStrategy {
|
344
|
+
constructor(provider) {
|
345
|
+
this._provider = provider;
|
346
|
+
}
|
347
|
+
async getParsedColumns() {
|
348
|
+
const columns = await this._provider.getColumnsMetadata();
|
349
|
+
const visibleColumns = getVisibleColumns(columns);
|
350
|
+
return visibleColumns;
|
351
|
+
}
|
352
|
+
async executeExport(resolveProps) {
|
353
|
+
const { methodName, titleGrid } = resolveProps;
|
354
|
+
const records = await this._provider.getRecords();
|
355
|
+
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();
|
356
|
+
const [serviceName, processor] = this.getExecutor(methodName);
|
357
|
+
const payload = {
|
358
|
+
serviceName,
|
359
|
+
requestBody: {
|
360
|
+
grid: {
|
361
|
+
titleGrid,
|
362
|
+
columns: this.buildColumnsObject(columns),
|
363
|
+
rows: this.buildRowsObject(columns, records),
|
364
|
+
customOptions: { xlsxExtension: false }
|
365
|
+
}
|
366
|
+
}
|
367
|
+
};
|
368
|
+
return new Promise((resolve, reject) => {
|
369
|
+
DataFetcher.get()
|
370
|
+
.callServiceBroker(serviceName, payload)
|
371
|
+
.then(result => resolve(processor(result)))
|
372
|
+
.catch(error => reject(error));
|
373
|
+
});
|
374
|
+
}
|
375
|
+
getExecutor(methodName) {
|
376
|
+
if (methodName === "exportToPDF") {
|
377
|
+
return [
|
378
|
+
"GridPDFBuilderSP.buildPDFFromJson",
|
379
|
+
responseBody => ({
|
380
|
+
fileSessionKey: responseBody.chavePDF.valor,
|
381
|
+
canPrint: responseBody.permiteImprimir.valor === "S",
|
382
|
+
canExport: responseBody.permiteExportar.valor === "S",
|
383
|
+
canSendEmail: responseBody.canSendEmail.valor === "S",
|
384
|
+
useAppPrint: true
|
385
|
+
})
|
386
|
+
];
|
387
|
+
}
|
388
|
+
return [
|
389
|
+
"GridXLSBuilderSP.buildXLSFromJson",
|
390
|
+
responseBody => ({
|
391
|
+
fileSessionKey: responseBody.chaveXLS.valor,
|
392
|
+
canPrint: false,
|
393
|
+
canExport: false,
|
394
|
+
useAppPrint: false,
|
395
|
+
canSendEmail: false
|
396
|
+
})
|
397
|
+
];
|
398
|
+
}
|
399
|
+
buildColumnsObject(columns) {
|
400
|
+
return {
|
401
|
+
column: columns.map((column, index) => {
|
402
|
+
const { label, id, width, userInterface } = column;
|
403
|
+
return Object.assign({ index: index + 1, id,
|
404
|
+
label,
|
405
|
+
width, presentationType: "P" }, (TYPE_MAP[userInterface] || { type: "S", align: "left" }));
|
406
|
+
})
|
407
|
+
};
|
408
|
+
}
|
409
|
+
buildRowsObject(columns, records) {
|
410
|
+
return {
|
411
|
+
row: records.map(rawRecord => {
|
412
|
+
const record = {};
|
413
|
+
columns.forEach((column, index) => record["c" + (index + 1)] = { $: this.formatValue(rawRecord, column) });
|
414
|
+
return record;
|
415
|
+
})
|
416
|
+
};
|
417
|
+
}
|
418
|
+
formatValue(record, column) {
|
419
|
+
if (this._provider.formatValue != undefined) {
|
420
|
+
return this._provider.formatValue(record, column);
|
421
|
+
}
|
422
|
+
return record[column.id] || "";
|
423
|
+
}
|
424
|
+
}
|
425
|
+
const TYPE_MAP = {
|
426
|
+
[UserInterface.DATE]: { type: "D", align: "center" },
|
427
|
+
[UserInterface.DATETIME]: { type: "H", align: "center" },
|
428
|
+
[UserInterface.TIME]: { type: "I", align: "right" },
|
429
|
+
[UserInterface.ELAPSEDTIME]: { type: "I", align: "right" },
|
430
|
+
[UserInterface.DECIMALNUMBER]: { type: "F", align: "right" },
|
431
|
+
[UserInterface.INTEGERNUMBER]: { type: "I", align: "right" },
|
432
|
+
[UserInterface.SEARCH]: { type: "S", align: "right" }
|
433
|
+
};
|
434
|
+
|
212
435
|
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}";
|
213
436
|
|
214
|
-
const LIMIT_PER_EXPORT = 5000;
|
215
437
|
const SnkDataExporter = class {
|
216
438
|
constructor(hostRef) {
|
217
439
|
registerInstance(this, hostRef);
|
218
440
|
this._selectedNumber = 0;
|
219
441
|
this._customPrefix = "$custom$";
|
220
|
-
this._items = [];
|
221
|
-
this._showDropdown = false;
|
222
442
|
this._releasedToExport = [
|
223
443
|
DataExporterOption.EXPORT_TO_PDF,
|
224
444
|
DataExporterOption.EXPORT_TO_XLS,
|
@@ -226,8 +446,12 @@ const SnkDataExporter = class {
|
|
226
446
|
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
227
447
|
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
228
448
|
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
229
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
449
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS,
|
450
|
+
DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
451
|
+
DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
230
452
|
];
|
453
|
+
this._items = [];
|
454
|
+
this._showDropdown = false;
|
231
455
|
this.provider = null;
|
232
456
|
this.messagesBuilder = undefined;
|
233
457
|
}
|
@@ -298,31 +522,7 @@ const SnkDataExporter = class {
|
|
298
522
|
if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
|
299
523
|
return;
|
300
524
|
}
|
301
|
-
|
302
|
-
const columns = await this.provider.getColumnsMetadata();
|
303
|
-
const sort = this.provider.getOrders();
|
304
|
-
const resourceURI = this.provider.getResourceURI();
|
305
|
-
const selectedIDs = this.provider.getSelectedIDs();
|
306
|
-
const option = resolveProps.exportOption;
|
307
|
-
const currentPageOptions = [
|
308
|
-
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
309
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
310
|
-
];
|
311
|
-
delete resolveProps.exportOption;
|
312
|
-
let params = Object.assign({ filters,
|
313
|
-
columns,
|
314
|
-
sort,
|
315
|
-
resourceURI, selectedIDs: selectedIDs.slice(0, LIMIT_PER_EXPORT) }, resolveProps);
|
316
|
-
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
317
|
-
const offset = this.provider.getOffset();
|
318
|
-
const limit = this.provider.getLimit();
|
319
|
-
params = Object.assign(Object.assign({}, params), { offset,
|
320
|
-
limit, selectedIDs: [] });
|
321
|
-
}
|
322
|
-
else if (resolveProps.type == "all") {
|
323
|
-
params = Object.assign(Object.assign({}, params), { offset: 0, limit: LIMIT_PER_EXPORT, selectedIDs: [] });
|
324
|
-
}
|
325
|
-
fetchDataExporter(params)
|
525
|
+
this.getExporterStrategy().executeExport(resolveProps)
|
326
526
|
.then((result) => callbackResolver(result))
|
327
527
|
.catch((exception) => {
|
328
528
|
console.error(exception);
|
@@ -330,14 +530,26 @@ const SnkDataExporter = class {
|
|
330
530
|
ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
|
331
531
|
});
|
332
532
|
}
|
533
|
+
getExporterStrategy() {
|
534
|
+
return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
|
535
|
+
}
|
333
536
|
getOptionKey(option) {
|
334
537
|
return Object.keys(DataExporterOption)
|
335
538
|
.find((key) => {
|
336
539
|
return DataExporterOption[key] === option;
|
337
540
|
});
|
338
541
|
}
|
339
|
-
|
340
|
-
|
542
|
+
getExportType(option) {
|
543
|
+
if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
544
|
+
return 'all';
|
545
|
+
}
|
546
|
+
if (option === DataExporterOption.EXPORT_PAGE_TO_PDF || option === DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
547
|
+
return 'page';
|
548
|
+
}
|
549
|
+
return 'selection';
|
550
|
+
}
|
551
|
+
async dispatchExporter(option) {
|
552
|
+
var _a, _b, _c;
|
341
553
|
const optionKey = this.getOptionKey(option);
|
342
554
|
const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
|
343
555
|
const isDownload = DataExporterType[optionKey] === DataExporterType.EXPORT_TO_XLS;
|
@@ -346,15 +558,21 @@ const SnkDataExporter = class {
|
|
346
558
|
fileName: this._appLabel,
|
347
559
|
titleGrid: this._appLabel,
|
348
560
|
exportOption: option,
|
349
|
-
limit:
|
561
|
+
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
562
|
+
type: this.getExportType(option),
|
350
563
|
};
|
351
|
-
this.resolveExporter(params, (response) => {
|
352
|
-
|
353
|
-
|
564
|
+
await this.resolveExporter(params, (response) => {
|
565
|
+
if (response.canExport || fileType === DataExporterType.EXPORT_TO_PDF) {
|
566
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
567
|
+
isDownload }));
|
568
|
+
}
|
569
|
+
else {
|
570
|
+
ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
571
|
+
}
|
354
572
|
});
|
355
573
|
}
|
356
574
|
async processExporter(evt) {
|
357
|
-
var _a, _b, _c, _d;
|
575
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
358
576
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
359
577
|
const exportCurrentPageOptions = [DataExporterOption.EXPORT_PAGE_TO_PDF, DataExporterOption.EXPORT_PAGE_TO_XLS];
|
360
578
|
const isCustomReport = (_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix);
|
@@ -362,18 +580,19 @@ const SnkDataExporter = class {
|
|
362
580
|
return;
|
363
581
|
const selectedRecords = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getSelectedIDs();
|
364
582
|
const totalRecords = (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getTotalRecords();
|
365
|
-
const totalPerPage = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.
|
583
|
+
const totalPerPage = (_e = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getPageSize) === null || _e === void 0 ? void 0 : _e.call(_d);
|
584
|
+
const exportLimit = (_g = (_f = this.provider) === null || _f === void 0 ? void 0 : _f.getExportLimit) === null || _g === void 0 ? void 0 : _g.call(_f);
|
366
585
|
let limitExceeded = false;
|
367
|
-
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <=
|
586
|
+
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= exportLimit) || isCustomReport) {
|
368
587
|
limitExceeded = false;
|
369
588
|
}
|
370
589
|
else if (selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) {
|
371
|
-
limitExceeded = selectedRecords.length >
|
590
|
+
limitExceeded = selectedRecords.length > exportLimit;
|
372
591
|
}
|
373
|
-
else if (totalRecords >
|
592
|
+
else if (totalRecords > exportLimit)
|
374
593
|
limitExceeded = true;
|
375
594
|
if (limitExceeded) {
|
376
|
-
const formattedLimit =
|
595
|
+
const formattedLimit = exportLimit.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
|
377
596
|
const limitModalMessages = {
|
378
597
|
title: this.getMessage("snkDataExporter.limitExceeded.title"),
|
379
598
|
description: `
|
@@ -398,7 +617,7 @@ const SnkDataExporter = class {
|
|
398
617
|
this._showDropdown = false;
|
399
618
|
return;
|
400
619
|
}
|
401
|
-
if (!this.
|
620
|
+
if (!this.getFilteredReleasedToExport().includes(item === null || item === void 0 ? void 0 : item.id)) {
|
402
621
|
return;
|
403
622
|
}
|
404
623
|
if (item.id === DataExporterOption.EXPORT_BY_EMAIL) {
|
@@ -409,9 +628,20 @@ const SnkDataExporter = class {
|
|
409
628
|
}
|
410
629
|
this._showDropdown = false;
|
411
630
|
}
|
631
|
+
getFilteredReleasedToExport() {
|
632
|
+
var _a, _b;
|
633
|
+
if (this.provider == undefined) {
|
634
|
+
return this._releasedToExport;
|
635
|
+
}
|
636
|
+
const hiddenOptions = (_b = (_a = this.provider).getHiddenOptions) === null || _b === void 0 ? void 0 : _b.call(_a);
|
637
|
+
if (hiddenOptions == undefined) {
|
638
|
+
return this._releasedToExport;
|
639
|
+
}
|
640
|
+
return this._releasedToExport.filter(option => !hiddenOptions.includes(option));
|
641
|
+
}
|
412
642
|
loadItems() {
|
413
643
|
const items = [];
|
414
|
-
this.
|
644
|
+
this.getFilteredReleasedToExport()
|
415
645
|
.forEach((option) => {
|
416
646
|
var _a;
|
417
647
|
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
@@ -419,8 +649,8 @@ const SnkDataExporter = class {
|
|
419
649
|
this.loadPersonalizedItems(items);
|
420
650
|
}
|
421
651
|
async loadPersonalizedItems(items) {
|
422
|
-
var _a;
|
423
|
-
const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
|
652
|
+
var _a, _b;
|
653
|
+
const recordID = (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID) === null || _b === void 0 ? void 0 : _b.call(_a);
|
424
654
|
if (recordID == undefined) {
|
425
655
|
this._items = items;
|
426
656
|
return;
|
@@ -436,10 +666,10 @@ const SnkDataExporter = class {
|
|
436
666
|
this._items = items;
|
437
667
|
}
|
438
668
|
openPersonalizedReports(option) {
|
439
|
-
var _a;
|
669
|
+
var _a, _b;
|
440
670
|
const pkObject = [];
|
441
671
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
442
|
-
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
672
|
+
(_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) => {
|
443
673
|
const fields = {};
|
444
674
|
fields['fields'] = [];
|
445
675
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
@@ -464,8 +694,8 @@ const SnkDataExporter = class {
|
|
464
694
|
}
|
465
695
|
}
|
466
696
|
loadDropdown() {
|
467
|
-
var _a
|
468
|
-
this._selectedNumber = ((
|
697
|
+
var _a;
|
698
|
+
this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedNumber()) || 0;
|
469
699
|
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
470
700
|
this.loadItems();
|
471
701
|
}
|