@sankhyalabs/sankhyablocks 8.15.3 → 8.16.0-dev.10
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/{ConfigStorage-942ce74b.js → ConfigStorage-a343e418.js} +1 -0
- package/dist/cjs/{SnkMultiSelectionListDataSource-3c08d25c.js → IExporterProvider-597949f9.js} +94 -4
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-f9dc0d28.js → SnkFormConfigManager-166cbd1f.js} +8 -7
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-897ffd08.js} +9 -13
- package/dist/cjs/{pesquisa-fetcher-562d281f.js → dataunit-fetcher-688d3f05.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 +5 -3
- package/dist/cjs/snk-application.cjs.entry.js +35 -12
- package/dist/cjs/snk-attach.cjs.entry.js +71 -46
- package/dist/cjs/snk-crud.cjs.entry.js +101 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +315 -85
- package/dist/cjs/snk-data-unit-8fa7917a.js +689 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +12 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +50 -10
- package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -2
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +52 -7
- package/dist/cjs/snk-grid.cjs.entry.js +165 -108
- package/dist/cjs/{snk-guides-viewer-bb6087cd.js → snk-guides-viewer-9c682034.js} +43 -10
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +268 -40
- 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 +305 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +136 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +134 -7
- 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 +538 -218
- 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 +7 -6
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +240 -101
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +406 -20
- 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/configs/ConfigStorage.js +1 -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 +2 -1
- package/dist/components/ConfigStorage.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 +7 -6
- package/dist/components/SnkMessageBuilder.js +9 -13
- 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 +110 -11
- package/dist/components/snk-data-exporter2.js +309 -85
- package/dist/components/snk-data-unit2.js +485 -216
- package/dist/components/snk-detail-view2.js +96 -14
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +6 -1
- package/dist/components/snk-form-config2.js +1 -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 +263 -25
- package/dist/components/snk-taskbar2.js +6 -5
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-3806514e.js} +1 -0
- package/dist/esm/{SnkMultiSelectionListDataSource-6a879955.js → IExporterProvider-63a188b6.js} +93 -5
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-f53f9f87.js → SnkFormConfigManager-31b24066.js} +8 -7
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-571462fb.js} +9 -13
- package/dist/esm/{pesquisa-fetcher-c7ce8ee7.js → dataunit-fetcher-264191b2.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 +5 -3
- package/dist/esm/snk-application.entry.js +34 -11
- package/dist/esm/snk-attach.entry.js +66 -41
- package/dist/esm/snk-crud.entry.js +101 -10
- package/dist/esm/snk-data-exporter.entry.js +316 -86
- package/dist/esm/snk-data-unit-f5cbe64b.js +687 -0
- package/dist/esm/snk-data-unit.entry.js +12 -2
- package/dist/esm/snk-detail-view.entry.js +50 -10
- package/dist/esm/snk-filter-bar.entry.js +6 -2
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +52 -7
- package/dist/esm/snk-grid.entry.js +163 -106
- package/dist/esm/{snk-guides-viewer-1d95ebf2.js → snk-guides-viewer-8f6960a2.js} +43 -10
- package/dist/esm/snk-guides-viewer.entry.js +9 -7
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +256 -28
- 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-17def7cd.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-28ee0972.js +1 -0
- package/dist/sankhyablocks/p-2a408684.js +1 -0
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-2c68b3ae.entry.js} +1 -1
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-3a212712.js +1 -0
- package/dist/sankhyablocks/p-450c60e4.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-47db7e88.entry.js} +1 -1
- package/dist/sankhyablocks/p-4e5e1313.entry.js +1 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-52920496.js} +1 -1
- package/dist/sankhyablocks/p-62ba211a.entry.js +1 -0
- package/dist/sankhyablocks/p-6bb2f3e9.entry.js +1 -0
- package/dist/sankhyablocks/p-7505da04.entry.js +1 -0
- package/dist/sankhyablocks/p-7619bdb1.entry.js +11 -0
- package/dist/sankhyablocks/p-7a85fd49.entry.js +1 -0
- package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
- package/dist/sankhyablocks/p-7ef9c55c.js +1 -0
- package/dist/sankhyablocks/p-80042dc6.entry.js +1 -0
- package/dist/sankhyablocks/p-8c59edd7.entry.js +1 -0
- package/dist/sankhyablocks/p-9606509c.entry.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/p-ae93d46a.entry.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-d6e26ea8.entry.js +1 -0
- package/dist/sankhyablocks/p-f2809746.entry.js +1 -0
- package/dist/sankhyablocks/p-f4450320.entry.js +1 -0
- package/dist/sankhyablocks/p-fe79f83a.js +60 -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 +45 -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 +24 -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 +66 -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-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +46 -6
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +62 -4
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +261 -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-0594db5a.entry.js +0 -1
- package/dist/sankhyablocks/p-06e13db2.js +0 -1
- package/dist/sankhyablocks/p-07a61550.entry.js +0 -1
- package/dist/sankhyablocks/p-1403a4b6.entry.js +0 -1
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-15802c59.entry.js +0 -1
- package/dist/sankhyablocks/p-235dc7b1.js +0 -65
- package/dist/sankhyablocks/p-32556aa6.js +0 -1
- package/dist/sankhyablocks/p-38289a55.js +0 -1
- package/dist/sankhyablocks/p-3c632d48.js +0 -1
- package/dist/sankhyablocks/p-3f833983.entry.js +0 -1
- package/dist/sankhyablocks/p-52c8e589.js +0 -1
- package/dist/sankhyablocks/p-5e1502b6.entry.js +0 -11
- package/dist/sankhyablocks/p-74d349c3.entry.js +0 -1
- package/dist/sankhyablocks/p-93167e28.entry.js +0 -1
- package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
- package/dist/sankhyablocks/p-bd47dd16.entry.js +0 -1
- package/dist/sankhyablocks/p-c1f88236.entry.js +0 -1
- package/dist/sankhyablocks/p-ccdd5332.entry.js +0 -1
- package/dist/sankhyablocks/p-ee9536bc.entry.js +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -5,13 +5,24 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index$1 = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
|
-
const index = require('./index-
|
8
|
+
const index = require('./index-1dfc7a6e.js');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
10
|
const DataFetcher = require('./DataFetcher-313debd8.js');
|
11
|
-
const snkDataUnit = require('./snk-data-unit-
|
12
|
-
require('./
|
11
|
+
const snkDataUnit = require('./snk-data-unit-8fa7917a.js');
|
12
|
+
require('./pesquisa-fetcher-680e198f.js');
|
13
|
+
require('./ISave-e91b70a7.js');
|
14
|
+
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
13
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
-
require('./
|
16
|
+
require('./dataunit-fetcher-688d3f05.js');
|
17
|
+
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
|
+
require('./form-config-fetcher-2dd00e5b.js');
|
19
|
+
require('./PrintUtils-bcaeb82f.js');
|
20
|
+
require('./SnkMessageBuilder-897ffd08.js');
|
21
|
+
require('./RecordIDUtils-3735135c.js');
|
22
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
23
|
+
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
24
|
+
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
25
|
+
require('./ResourceIDUtils-5ff86aa7.js');
|
15
26
|
|
16
27
|
class ItemBuilder {
|
17
28
|
constructor(getMessage, selectedNumber) {
|
@@ -33,6 +44,9 @@ class ItemBuilder {
|
|
33
44
|
items.push(this.getExportToXLS(groupName));
|
34
45
|
}
|
35
46
|
this.setExportCurrentPage(option, items);
|
47
|
+
if (this._selectedNumber > 0) {
|
48
|
+
this.setExportAllRecords(option, items);
|
49
|
+
}
|
36
50
|
this.setExportByEmail(option, items);
|
37
51
|
}
|
38
52
|
/**
|
@@ -63,6 +77,34 @@ class ItemBuilder {
|
|
63
77
|
}
|
64
78
|
}
|
65
79
|
}
|
80
|
+
/**
|
81
|
+
* Método responsável por inserir os itens de exportação para todos os registros.
|
82
|
+
* @param option - Nome da opção que será inserida no array.
|
83
|
+
* @param items - Array que será alimentado com as opções permitidas.
|
84
|
+
*/
|
85
|
+
setExportAllRecords(option, items) {
|
86
|
+
var _a;
|
87
|
+
const pageOptions = [index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF, index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS];
|
88
|
+
if (option === index.DataExporterOption.EXPORT_ALL_RECORDS) {
|
89
|
+
items.push(this.getAllRecords());
|
90
|
+
}
|
91
|
+
if (pageOptions.includes(option)) {
|
92
|
+
let item = items.find((item) => item.id === index.DataExporterOption.EXPORT_ALL_RECORDS);
|
93
|
+
if (item == undefined) {
|
94
|
+
items.push(this.getAllRecords());
|
95
|
+
item = items.find((item) => item.id === index.DataExporterOption.EXPORT_ALL_RECORDS);
|
96
|
+
}
|
97
|
+
if (!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
98
|
+
item.children = [];
|
99
|
+
}
|
100
|
+
if (option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF) {
|
101
|
+
item.children.push(this.getExportAllRecordsToPDF());
|
102
|
+
}
|
103
|
+
if (option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
104
|
+
item.children.push(this.getExportAllRecordsToXLS());
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
66
108
|
/**
|
67
109
|
* Método responsável por inserir os itens de exportação por e-mail.
|
68
110
|
* @param option - Nome da opção que será inserida no array.
|
@@ -108,6 +150,17 @@ class ItemBuilder {
|
|
108
150
|
group: this._getMessage("snkDataExporter.group.custom")
|
109
151
|
};
|
110
152
|
}
|
153
|
+
/**
|
154
|
+
* Método responsável por capturar o objeto com todos os dados de exportação.
|
155
|
+
* @returns Retorna o objeto com todos os dados de exportação.
|
156
|
+
*/
|
157
|
+
getAllRecords() {
|
158
|
+
return {
|
159
|
+
id: index.DataExporterOption.EXPORT_ALL_RECORDS,
|
160
|
+
label: this._getMessage("snkDataExporter.label.allRecords"),
|
161
|
+
group: this._getMessage("snkDataExporter.group.custom")
|
162
|
+
};
|
163
|
+
}
|
111
164
|
/**
|
112
165
|
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
113
166
|
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
@@ -128,6 +181,26 @@ class ItemBuilder {
|
|
128
181
|
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
129
182
|
};
|
130
183
|
}
|
184
|
+
/**
|
185
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em PDF.
|
186
|
+
* @returns Retorna o objeto com todos os dados de exportação em PDF.
|
187
|
+
*/
|
188
|
+
getExportAllRecordsToPDF() {
|
189
|
+
return {
|
190
|
+
id: index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
191
|
+
label: "PDF (.pdf)"
|
192
|
+
};
|
193
|
+
}
|
194
|
+
/**
|
195
|
+
* Método responsável por capturar o objeto com todos os dados de exportação em XLS.
|
196
|
+
* @returns Retorna o objeto com todos os dados de exportação em XLS.
|
197
|
+
*/
|
198
|
+
getExportAllRecordsToXLS() {
|
199
|
+
return {
|
200
|
+
id: index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
201
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
202
|
+
};
|
203
|
+
}
|
131
204
|
/**
|
132
205
|
* Método responsável por capturar o objeto com os dados de exportação por e-mail.
|
133
206
|
* @returns Retorna o objeto com os dados de exportação por e-mail.
|
@@ -153,38 +226,6 @@ class ItemBuilder {
|
|
153
226
|
}
|
154
227
|
}
|
155
228
|
|
156
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
157
|
-
var t = {};
|
158
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
159
|
-
t[p] = s[p];
|
160
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
161
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
162
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
163
|
-
t[p[i]] = s[p[i]];
|
164
|
-
}
|
165
|
-
return t;
|
166
|
-
};
|
167
|
-
function fetchDataExporter(_a) {
|
168
|
-
var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
169
|
-
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
170
|
-
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
171
|
-
const payload = { serviceName, requestBody };
|
172
|
-
return new Promise((resolve, reject) => {
|
173
|
-
DataFetcher.DataFetcher.get()
|
174
|
-
.callServiceBroker(serviceName, core.ObjectUtils.objectToString(payload))
|
175
|
-
.then(result => resolve(getFormatResponse$1(result)))
|
176
|
-
.catch(error => reject(error));
|
177
|
-
});
|
178
|
-
}
|
179
|
-
function getFormatResponse$1(result) {
|
180
|
-
var _a;
|
181
|
-
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
182
|
-
if (response == undefined) {
|
183
|
-
return;
|
184
|
-
}
|
185
|
-
return core.ObjectUtils.stringToObject(response);
|
186
|
-
}
|
187
|
-
|
188
229
|
function getMessage(application, key, params) {
|
189
230
|
var _a;
|
190
231
|
return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
@@ -213,16 +254,195 @@ function getFormatResponse(result) {
|
|
213
254
|
return core.ObjectUtils.stringToObject(response);
|
214
255
|
}
|
215
256
|
|
257
|
+
const DOC_MAX_WIDTH = 800;
|
258
|
+
function getVisibleColumns(columns) {
|
259
|
+
const visibleColumns = [];
|
260
|
+
let totalWidth = 0;
|
261
|
+
for (const column of columns) {
|
262
|
+
totalWidth += column.width;
|
263
|
+
if (totalWidth >= DOC_MAX_WIDTH) {
|
264
|
+
break;
|
265
|
+
}
|
266
|
+
visibleColumns.push(column);
|
267
|
+
}
|
268
|
+
return visibleColumns;
|
269
|
+
}
|
270
|
+
function getOptionKey(option) {
|
271
|
+
return Object.keys(index.DataExporterOption)
|
272
|
+
.find((key) => {
|
273
|
+
return index.DataExporterOption[key] === option;
|
274
|
+
});
|
275
|
+
}
|
276
|
+
|
277
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
278
|
+
var t = {};
|
279
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
280
|
+
t[p] = s[p];
|
281
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
282
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
283
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
284
|
+
t[p[i]] = s[p[i]];
|
285
|
+
}
|
286
|
+
return t;
|
287
|
+
};
|
288
|
+
class ServerSideExporterStrategy {
|
289
|
+
constructor(provider) {
|
290
|
+
this._provider = provider;
|
291
|
+
}
|
292
|
+
async getParsedColumns() {
|
293
|
+
const columns = await this._provider.getColumnsMetadata();
|
294
|
+
const visibleColumns = getVisibleColumns(columns);
|
295
|
+
return visibleColumns;
|
296
|
+
}
|
297
|
+
async getParams(resolveProps) {
|
298
|
+
var _a, _b, _c, _d, _e, _f;
|
299
|
+
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
300
|
+
const columns = [index.DataExporterType.EXPORT_TO_PDF, index.DataExporterType.EXPORT_PAGE_TO_PDF, index.DataExporterType.EXPORT_PDF_TO_EMAIL, index.DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
301
|
+
const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
|
302
|
+
const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
|
303
|
+
const selectedIDs = this._provider.getSelectedIDs();
|
304
|
+
const option = resolveProps.exportOption;
|
305
|
+
const currentPageOptions = [
|
306
|
+
index.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
307
|
+
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
308
|
+
];
|
309
|
+
delete resolveProps.exportOption;
|
310
|
+
let params = Object.assign({ filters,
|
311
|
+
columns,
|
312
|
+
sort,
|
313
|
+
resourceURI, selectedIDs: selectedIDs.slice(0, this._provider.getExportLimit()) }, resolveProps);
|
314
|
+
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
315
|
+
const offset = this._provider.getOffset();
|
316
|
+
const limit = this._provider.getPageSize();
|
317
|
+
params = Object.assign(Object.assign({}, params), { offset,
|
318
|
+
limit, selectedIDs: [] });
|
319
|
+
}
|
320
|
+
else if (resolveProps.type == "all") {
|
321
|
+
params = Object.assign(Object.assign({}, params), { offset: 0, limit: this._provider.getExportLimit(), selectedIDs: [] });
|
322
|
+
}
|
323
|
+
return Promise.resolve(params);
|
324
|
+
}
|
325
|
+
async executeExport(resolveProps) {
|
326
|
+
const _a = await this.getParams(resolveProps), { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
327
|
+
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
328
|
+
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
329
|
+
const payload = { serviceName, requestBody };
|
330
|
+
return new Promise((resolve, reject) => {
|
331
|
+
DataFetcher.DataFetcher.get()
|
332
|
+
.callServiceBroker(serviceName, core.ObjectUtils.objectToString(payload))
|
333
|
+
.then(result => resolve(this.getFormatResponse(result)))
|
334
|
+
.catch(error => reject(error));
|
335
|
+
});
|
336
|
+
}
|
337
|
+
getFormatResponse(result) {
|
338
|
+
var _a;
|
339
|
+
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
340
|
+
if (response == undefined) {
|
341
|
+
return;
|
342
|
+
}
|
343
|
+
return core.ObjectUtils.stringToObject(response);
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
class ClientSideExporterStrategy {
|
348
|
+
constructor(provider) {
|
349
|
+
this._provider = provider;
|
350
|
+
}
|
351
|
+
async getParsedColumns() {
|
352
|
+
const columns = await this._provider.getColumnsMetadata();
|
353
|
+
const visibleColumns = getVisibleColumns(columns);
|
354
|
+
return visibleColumns;
|
355
|
+
}
|
356
|
+
async executeExport(resolveProps) {
|
357
|
+
const { methodName, titleGrid } = resolveProps;
|
358
|
+
const records = await this._provider.getRecords();
|
359
|
+
const columns = [index.DataExporterType.EXPORT_TO_PDF, index.DataExporterType.EXPORT_PAGE_TO_PDF, index.DataExporterType.EXPORT_PDF_TO_EMAIL, index.DataExporterType.EXPORT_ALL_RECORDS_TO_PDF].includes(getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
360
|
+
const [serviceName, processor] = this.getExecutor(methodName);
|
361
|
+
const payload = {
|
362
|
+
serviceName,
|
363
|
+
requestBody: {
|
364
|
+
grid: {
|
365
|
+
titleGrid,
|
366
|
+
columns: this.buildColumnsObject(columns),
|
367
|
+
rows: this.buildRowsObject(columns, records),
|
368
|
+
customOptions: { xlsxExtension: false }
|
369
|
+
}
|
370
|
+
}
|
371
|
+
};
|
372
|
+
return new Promise((resolve, reject) => {
|
373
|
+
DataFetcher.DataFetcher.get()
|
374
|
+
.callServiceBroker(serviceName, payload)
|
375
|
+
.then(result => resolve(processor(result)))
|
376
|
+
.catch(error => reject(error));
|
377
|
+
});
|
378
|
+
}
|
379
|
+
getExecutor(methodName) {
|
380
|
+
if (methodName === "exportToPDF") {
|
381
|
+
return [
|
382
|
+
"GridPDFBuilderSP.buildPDFFromJson",
|
383
|
+
responseBody => ({
|
384
|
+
fileSessionKey: responseBody.chavePDF.valor,
|
385
|
+
canPrint: responseBody.permiteImprimir.valor === "S",
|
386
|
+
canExport: responseBody.permiteExportar.valor === "S",
|
387
|
+
canSendEmail: responseBody.canSendEmail.valor === "S",
|
388
|
+
useAppPrint: true
|
389
|
+
})
|
390
|
+
];
|
391
|
+
}
|
392
|
+
return [
|
393
|
+
"GridXLSBuilderSP.buildXLSFromJson",
|
394
|
+
responseBody => ({
|
395
|
+
fileSessionKey: responseBody.chaveXLS.valor,
|
396
|
+
canPrint: false,
|
397
|
+
canExport: false,
|
398
|
+
useAppPrint: false,
|
399
|
+
canSendEmail: false
|
400
|
+
})
|
401
|
+
];
|
402
|
+
}
|
403
|
+
buildColumnsObject(columns) {
|
404
|
+
return {
|
405
|
+
column: columns.map((column, index) => {
|
406
|
+
const { label, id, width, userInterface } = column;
|
407
|
+
return Object.assign({ index: index + 1, id,
|
408
|
+
label,
|
409
|
+
width, presentationType: "P" }, (TYPE_MAP[userInterface] || { type: "S", align: "left" }));
|
410
|
+
})
|
411
|
+
};
|
412
|
+
}
|
413
|
+
buildRowsObject(columns, records) {
|
414
|
+
return {
|
415
|
+
row: records.map(rawRecord => {
|
416
|
+
const record = {};
|
417
|
+
columns.forEach((column, index) => record["c" + (index + 1)] = { $: this.formatValue(rawRecord, column) });
|
418
|
+
return record;
|
419
|
+
})
|
420
|
+
};
|
421
|
+
}
|
422
|
+
formatValue(record, column) {
|
423
|
+
if (this._provider.formatValue != undefined) {
|
424
|
+
return this._provider.formatValue(record, column);
|
425
|
+
}
|
426
|
+
return record[column.id] || "";
|
427
|
+
}
|
428
|
+
}
|
429
|
+
const TYPE_MAP = {
|
430
|
+
[core.UserInterface.DATE]: { type: "D", align: "center" },
|
431
|
+
[core.UserInterface.DATETIME]: { type: "H", align: "center" },
|
432
|
+
[core.UserInterface.TIME]: { type: "I", align: "right" },
|
433
|
+
[core.UserInterface.ELAPSEDTIME]: { type: "I", align: "right" },
|
434
|
+
[core.UserInterface.DECIMALNUMBER]: { type: "F", align: "right" },
|
435
|
+
[core.UserInterface.INTEGERNUMBER]: { type: "I", align: "right" },
|
436
|
+
[core.UserInterface.SEARCH]: { type: "S", align: "right" }
|
437
|
+
};
|
438
|
+
|
216
439
|
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}";
|
217
440
|
|
218
|
-
const LIMIT_PER_EXPORT = 5000;
|
219
441
|
const SnkDataExporter = class {
|
220
442
|
constructor(hostRef) {
|
221
443
|
index$1.registerInstance(this, hostRef);
|
222
444
|
this._selectedNumber = 0;
|
223
445
|
this._customPrefix = "$custom$";
|
224
|
-
this._items = [];
|
225
|
-
this._showDropdown = false;
|
226
446
|
this._releasedToExport = [
|
227
447
|
index.DataExporterOption.EXPORT_TO_PDF,
|
228
448
|
index.DataExporterOption.EXPORT_TO_XLS,
|
@@ -230,8 +450,12 @@ const SnkDataExporter = class {
|
|
230
450
|
index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
231
451
|
index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
232
452
|
index.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
233
|
-
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
453
|
+
index.DataExporterOption.EXPORT_PAGE_TO_XLS,
|
454
|
+
index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
455
|
+
index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
234
456
|
];
|
457
|
+
this._items = [];
|
458
|
+
this._showDropdown = false;
|
235
459
|
this.provider = null;
|
236
460
|
this.messagesBuilder = undefined;
|
237
461
|
}
|
@@ -302,31 +526,7 @@ const SnkDataExporter = class {
|
|
302
526
|
if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
|
303
527
|
return;
|
304
528
|
}
|
305
|
-
|
306
|
-
const columns = await this.provider.getColumnsMetadata();
|
307
|
-
const sort = this.provider.getOrders();
|
308
|
-
const resourceURI = this.provider.getResourceURI();
|
309
|
-
const selectedIDs = this.provider.getSelectedIDs();
|
310
|
-
const option = resolveProps.exportOption;
|
311
|
-
const currentPageOptions = [
|
312
|
-
index.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
313
|
-
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
314
|
-
];
|
315
|
-
delete resolveProps.exportOption;
|
316
|
-
let params = Object.assign({ filters,
|
317
|
-
columns,
|
318
|
-
sort,
|
319
|
-
resourceURI, selectedIDs: selectedIDs.slice(0, LIMIT_PER_EXPORT) }, resolveProps);
|
320
|
-
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
321
|
-
const offset = this.provider.getOffset();
|
322
|
-
const limit = this.provider.getLimit();
|
323
|
-
params = Object.assign(Object.assign({}, params), { offset,
|
324
|
-
limit, selectedIDs: [] });
|
325
|
-
}
|
326
|
-
else if (resolveProps.type == "all") {
|
327
|
-
params = Object.assign(Object.assign({}, params), { offset: 0, limit: LIMIT_PER_EXPORT, selectedIDs: [] });
|
328
|
-
}
|
329
|
-
fetchDataExporter(params)
|
529
|
+
this.getExporterStrategy().executeExport(resolveProps)
|
330
530
|
.then((result) => callbackResolver(result))
|
331
531
|
.catch((exception) => {
|
332
532
|
console.error(exception);
|
@@ -334,14 +534,26 @@ const SnkDataExporter = class {
|
|
334
534
|
utils.ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
|
335
535
|
});
|
336
536
|
}
|
537
|
+
getExporterStrategy() {
|
538
|
+
return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
|
539
|
+
}
|
337
540
|
getOptionKey(option) {
|
338
541
|
return Object.keys(index.DataExporterOption)
|
339
542
|
.find((key) => {
|
340
543
|
return index.DataExporterOption[key] === option;
|
341
544
|
});
|
342
545
|
}
|
343
|
-
|
344
|
-
|
546
|
+
getExportType(option) {
|
547
|
+
if (option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
|
548
|
+
return 'all';
|
549
|
+
}
|
550
|
+
if (option === index.DataExporterOption.EXPORT_PAGE_TO_PDF || option === index.DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
551
|
+
return 'page';
|
552
|
+
}
|
553
|
+
return 'selection';
|
554
|
+
}
|
555
|
+
async dispatchExporter(option) {
|
556
|
+
var _a, _b, _c;
|
345
557
|
const optionKey = this.getOptionKey(option);
|
346
558
|
const fileType = (_a = index.DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : index.DataExporterType.EXPORT_TO_PDF;
|
347
559
|
const isDownload = index.DataExporterType[optionKey] === index.DataExporterType.EXPORT_TO_XLS;
|
@@ -350,15 +562,21 @@ const SnkDataExporter = class {
|
|
350
562
|
fileName: this._appLabel,
|
351
563
|
titleGrid: this._appLabel,
|
352
564
|
exportOption: option,
|
353
|
-
limit:
|
565
|
+
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
566
|
+
type: this.getExportType(option),
|
354
567
|
};
|
355
|
-
this.resolveExporter(params, (response) => {
|
356
|
-
|
357
|
-
|
568
|
+
await this.resolveExporter(params, (response) => {
|
569
|
+
if (response.canExport || fileType === index.DataExporterType.EXPORT_TO_PDF) {
|
570
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
571
|
+
isDownload }));
|
572
|
+
}
|
573
|
+
else {
|
574
|
+
utils.ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
575
|
+
}
|
358
576
|
});
|
359
577
|
}
|
360
578
|
async processExporter(evt) {
|
361
|
-
var _a, _b, _c, _d;
|
579
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
362
580
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
363
581
|
const exportCurrentPageOptions = [index.DataExporterOption.EXPORT_PAGE_TO_PDF, index.DataExporterOption.EXPORT_PAGE_TO_XLS];
|
364
582
|
const isCustomReport = (_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix);
|
@@ -366,18 +584,19 @@ const SnkDataExporter = class {
|
|
366
584
|
return;
|
367
585
|
const selectedRecords = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getSelectedIDs();
|
368
586
|
const totalRecords = (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getTotalRecords();
|
369
|
-
const totalPerPage = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.
|
587
|
+
const totalPerPage = (_e = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getPageSize) === null || _e === void 0 ? void 0 : _e.call(_d);
|
588
|
+
const exportLimit = (_g = (_f = this.provider) === null || _f === void 0 ? void 0 : _f.getExportLimit) === null || _g === void 0 ? void 0 : _g.call(_f);
|
370
589
|
let limitExceeded = false;
|
371
|
-
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <=
|
590
|
+
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= exportLimit) || isCustomReport) {
|
372
591
|
limitExceeded = false;
|
373
592
|
}
|
374
593
|
else if (selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) {
|
375
|
-
limitExceeded = selectedRecords.length >
|
594
|
+
limitExceeded = selectedRecords.length > exportLimit;
|
376
595
|
}
|
377
|
-
else if (totalRecords >
|
596
|
+
else if (totalRecords > exportLimit)
|
378
597
|
limitExceeded = true;
|
379
598
|
if (limitExceeded) {
|
380
|
-
const formattedLimit =
|
599
|
+
const formattedLimit = exportLimit.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
|
381
600
|
const limitModalMessages = {
|
382
601
|
title: this.getMessage("snkDataExporter.limitExceeded.title"),
|
383
602
|
description: `
|
@@ -402,7 +621,7 @@ const SnkDataExporter = class {
|
|
402
621
|
this._showDropdown = false;
|
403
622
|
return;
|
404
623
|
}
|
405
|
-
if (!this.
|
624
|
+
if (!this.getFilteredReleasedToExport().includes(item === null || item === void 0 ? void 0 : item.id)) {
|
406
625
|
return;
|
407
626
|
}
|
408
627
|
if (item.id === index.DataExporterOption.EXPORT_BY_EMAIL) {
|
@@ -413,9 +632,20 @@ const SnkDataExporter = class {
|
|
413
632
|
}
|
414
633
|
this._showDropdown = false;
|
415
634
|
}
|
635
|
+
getFilteredReleasedToExport() {
|
636
|
+
var _a, _b;
|
637
|
+
if (this.provider == undefined) {
|
638
|
+
return this._releasedToExport;
|
639
|
+
}
|
640
|
+
const hiddenOptions = (_b = (_a = this.provider).getHiddenOptions) === null || _b === void 0 ? void 0 : _b.call(_a);
|
641
|
+
if (hiddenOptions == undefined) {
|
642
|
+
return this._releasedToExport;
|
643
|
+
}
|
644
|
+
return this._releasedToExport.filter(option => !hiddenOptions.includes(option));
|
645
|
+
}
|
416
646
|
loadItems() {
|
417
647
|
const items = [];
|
418
|
-
this.
|
648
|
+
this.getFilteredReleasedToExport()
|
419
649
|
.forEach((option) => {
|
420
650
|
var _a;
|
421
651
|
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
@@ -423,8 +653,8 @@ const SnkDataExporter = class {
|
|
423
653
|
this.loadPersonalizedItems(items);
|
424
654
|
}
|
425
655
|
async loadPersonalizedItems(items) {
|
426
|
-
var _a;
|
427
|
-
const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
|
656
|
+
var _a, _b;
|
657
|
+
const recordID = (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID) === null || _b === void 0 ? void 0 : _b.call(_a);
|
428
658
|
if (recordID == undefined) {
|
429
659
|
this._items = items;
|
430
660
|
return;
|
@@ -440,10 +670,10 @@ const SnkDataExporter = class {
|
|
440
670
|
this._items = items;
|
441
671
|
}
|
442
672
|
openPersonalizedReports(option) {
|
443
|
-
var _a;
|
673
|
+
var _a, _b;
|
444
674
|
const pkObject = [];
|
445
675
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
446
|
-
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
676
|
+
(_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) => {
|
447
677
|
const fields = {};
|
448
678
|
fields['fields'] = [];
|
449
679
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
@@ -468,8 +698,8 @@ const SnkDataExporter = class {
|
|
468
698
|
}
|
469
699
|
}
|
470
700
|
loadDropdown() {
|
471
|
-
var _a
|
472
|
-
this._selectedNumber = ((
|
701
|
+
var _a;
|
702
|
+
this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedNumber()) || 0;
|
473
703
|
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
474
704
|
this.loadItems();
|
475
705
|
}
|