@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-38445.1 → 0.0.0-bugfix-dev-kb-67792.0
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-0a690675.js} +2 -2
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-d6d5db6d.js} +5 -8
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-96b0f549.js} +13 -9
- package/dist/cjs/{IExporterProvider-597949f9.js → SnkMultiSelectionListDataSource-f79d220c.js} +6 -96
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
- package/dist/cjs/{index-1dfc7a6e.js → index-0922807b.js} +0 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-688d3f05.js → pesquisa-fetcher-cba1b3d0.js} +181 -88
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -7
- package/dist/cjs/snk-application.cjs.entry.js +15 -38
- package/dist/cjs/snk-attach.cjs.entry.js +49 -74
- package/dist/cjs/snk-crud.cjs.entry.js +13 -99
- package/dist/cjs/snk-data-exporter.cjs.entry.js +88 -318
- package/dist/cjs/snk-data-unit-559ac55c.js +462 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -12
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -51
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +14 -9
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-view.cjs.entry.js +0 -67
- package/dist/cjs/snk-form.cjs.entry.js +9 -54
- package/dist/cjs/snk-grid.cjs.entry.js +112 -169
- package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-bfcad2d6.js} +10 -38
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -11
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +40 -267
- package/dist/cjs/snk-taskbar.cjs.entry.js +3 -4
- package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-3ecd1278.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +11 -35
- package/dist/collection/components/snk-attach/snk-attach.js +44 -67
- package/dist/collection/components/snk-crud/snk-crud.js +7 -249
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +0 -135
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -161
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +5 -112
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -54
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +52 -59
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -64
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +214 -507
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +11 -23
- package/dist/collection/components/snk-form/snk-form.js +5 -102
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -6
- package/dist/collection/components/snk-grid/snk-grid.css +0 -2
- package/dist/collection/components/snk-grid/snk-grid.js +102 -241
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +18 -386
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
- package/dist/collection/lib/@types/index.js +0 -5
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +3 -7
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +0 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +0 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +13 -11
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +4 -53
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +34 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
- package/dist/collection/lib/message/SnkMessageBuilder.js +12 -5
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +0 -2
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +0 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
- package/dist/components/DataFetcher.js +8 -3
- package/dist/components/SnkFormConfigManager.js +3 -6
- package/dist/components/SnkMessageBuilder.js +13 -9
- package/dist/components/dataunit-fetcher.js +182 -84
- package/dist/components/{IExporterProvider.js → field-search.js} +6 -93
- package/dist/components/index2.js +33 -198
- package/dist/components/index3.js +199 -0
- package/dist/components/snk-actions-button2.js +11 -4
- package/dist/components/snk-application2.js +9 -31
- package/dist/components/snk-attach2.js +41 -65
- package/dist/components/snk-crud.js +11 -103
- package/dist/components/snk-data-exporter2.js +87 -311
- package/dist/components/snk-data-unit2.js +212 -470
- package/dist/components/snk-detail-view2.js +10 -87
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +11 -7
- package/dist/components/snk-form-view2.js +1 -72
- package/dist/components/snk-form.js +6 -53
- package/dist/components/snk-grid2.js +108 -170
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +23 -259
- package/dist/components/snk-taskbar2.js +5 -6
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-8c2ddac8.js} +2 -2
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-c01b9d9d.js} +5 -8
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-72423074.js} +13 -9
- package/dist/esm/{IExporterProvider-63a188b6.js → SnkMultiSelectionListDataSource-a4805051.js} +7 -95
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
- package/dist/esm/{index-3aa4977a.js → index-0ece87a6.js} +1 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → pesquisa-fetcher-34a8b8be.js} +182 -84
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -7
- package/dist/esm/snk-application.entry.js +14 -37
- package/dist/esm/snk-attach.entry.js +44 -69
- package/dist/esm/snk-crud.entry.js +13 -99
- package/dist/esm/snk-data-exporter.entry.js +89 -319
- package/dist/esm/snk-data-unit-44215df7.js +460 -0
- package/dist/esm/snk-data-unit.entry.js +2 -12
- package/dist/esm/snk-detail-view.entry.js +10 -51
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +14 -9
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form-view.entry.js +0 -67
- package/dist/esm/snk-form.entry.js +9 -54
- package/dist/esm/snk-grid.entry.js +110 -167
- package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-edeac29f.js} +10 -38
- package/dist/esm/snk-guides-viewer.entry.js +9 -11
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +28 -255
- package/dist/esm/snk-taskbar.entry.js +3 -4
- package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-2473c8ac.js} +3 -3
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +1 -0
- package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/p-176c3491.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
- package/dist/sankhyablocks/p-37e5d563.js +65 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-41c2c191.entry.js} +1 -1
- package/dist/sankhyablocks/p-46e55a95.entry.js +1 -0
- package/dist/sankhyablocks/p-4e728357.entry.js +1 -0
- package/dist/sankhyablocks/p-5571bdfe.js +1 -0
- package/dist/sankhyablocks/p-5630574e.js +1 -0
- package/dist/sankhyablocks/p-594bc21d.js +1 -0
- package/dist/sankhyablocks/p-5f8c0426.entry.js +1 -0
- package/dist/sankhyablocks/p-80c64add.entry.js +1 -0
- package/dist/sankhyablocks/p-86af4cc2.js +1 -0
- package/dist/sankhyablocks/p-8b690717.js +1 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-96621231.js} +1 -1
- package/dist/sankhyablocks/p-a1832166.entry.js +1 -0
- package/dist/sankhyablocks/p-a809d944.entry.js +1 -0
- package/dist/sankhyablocks/p-a97226f6.entry.js +1 -0
- package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
- package/dist/sankhyablocks/{p-7e7a7473.js → p-ae4fc9a9.js} +1 -1
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-c2ae0fab.entry.js} +1 -1
- package/dist/sankhyablocks/p-c5a9a5d9.entry.js +1 -0
- package/dist/sankhyablocks/p-c5aa7d70.entry.js +11 -0
- package/dist/sankhyablocks/p-cb0147ab.entry.js +1 -0
- package/dist/sankhyablocks/p-f0145e3b.js +1 -0
- package/dist/sankhyablocks/{p-14a08904.entry.js → p-f03e4199.entry.js} +1 -1
- package/dist/sankhyablocks/p-f607db63.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +3 -7
- package/dist/types/components/snk-attach/snk-attach.d.ts +9 -11
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -36
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -23
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +3 -28
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -19
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +4 -24
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -4
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +0 -21
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +2 -61
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -4
- package/dist/types/components/snk-form/snk-form.d.ts +0 -14
- package/dist/types/components/snk-grid/snk-grid.d.ts +6 -46
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -58
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +4 -220
- package/dist/types/lib/@types/index.d.ts +0 -5
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +0 -6
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +0 -3
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/RecordIDUtils-3735135c.js +0 -43
- package/dist/cjs/pesquisa-fetcher-680e198f.js +0 -166
- package/dist/cjs/snk-data-unit-685272e7.js +0 -679
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +0 -1
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +0 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +0 -97
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +0 -74
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +0 -1
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +0 -58
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +0 -55
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +0 -88
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +0 -20
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +0 -38
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +0 -24
- package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +0 -18
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +0 -35
- package/dist/collection/lib/dataUnit/ValueFormatter.js +0 -4
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +0 -22
- package/dist/components/ISave.js +0 -47
- package/dist/components/pesquisa-fetcher.js +0 -164
- package/dist/esm/RecordIDUtils-87d02110.js +0 -41
- package/dist/esm/pesquisa-fetcher-03c8f919.js +0 -164
- package/dist/esm/snk-data-unit-63f83504.js +0 -677
- package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
- package/dist/sankhyablocks/p-19c18d06.entry.js +0 -1
- package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-30cf616e.js +0 -1
- package/dist/sankhyablocks/p-3a212712.js +0 -1
- package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
- package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
- package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-82a0bfb0.entry.js +0 -11
- package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
- package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-af8efd95.js +0 -6
- package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
- package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
- package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
- package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
- package/dist/sankhyablocks/p-cefba299.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
- package/dist/sankhyablocks/p-fe79f83a.js +0 -60
- package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +0 -4
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +0 -4
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -14
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +0 -12
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +0 -5
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +0 -17
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +0 -17
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +0 -77
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +0 -4
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +0 -3
- package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +0 -3
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +0 -11
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +0 -2
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +0 -3
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +0 -10
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +0 -20
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { ApplicationContext, ObjectUtils,
|
|
2
|
+
import { ApplicationContext, ObjectUtils, 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 DataExporterFormat, b as DataExporterType } from './index2.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';
|
|
14
8
|
import { d as defineCustomElement$1 } from './snk-exporter-email-sender2.js';
|
|
15
9
|
|
|
16
10
|
class ItemBuilder {
|
|
@@ -33,9 +27,6 @@ class ItemBuilder {
|
|
|
33
27
|
items.push(this.getExportToXLS(groupName));
|
|
34
28
|
}
|
|
35
29
|
this.setExportCurrentPage(option, items);
|
|
36
|
-
if (this._selectedNumber > 0) {
|
|
37
|
-
this.setExportAllRecords(option, items);
|
|
38
|
-
}
|
|
39
30
|
this.setExportByEmail(option, items);
|
|
40
31
|
}
|
|
41
32
|
/**
|
|
@@ -66,34 +57,6 @@ class ItemBuilder {
|
|
|
66
57
|
}
|
|
67
58
|
}
|
|
68
59
|
}
|
|
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
|
-
}
|
|
97
60
|
/**
|
|
98
61
|
* Método responsável por inserir os itens de exportação por e-mail.
|
|
99
62
|
* @param option - Nome da opção que será inserida no array.
|
|
@@ -124,7 +87,7 @@ class ItemBuilder {
|
|
|
124
87
|
getExportToXLS(groupName) {
|
|
125
88
|
return {
|
|
126
89
|
id: DataExporterOption.EXPORT_TO_XLS,
|
|
127
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
90
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
|
128
91
|
group: groupName
|
|
129
92
|
};
|
|
130
93
|
}
|
|
@@ -139,17 +102,6 @@ class ItemBuilder {
|
|
|
139
102
|
group: this._getMessage("snkDataExporter.group.custom")
|
|
140
103
|
};
|
|
141
104
|
}
|
|
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
|
-
}
|
|
153
105
|
/**
|
|
154
106
|
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
|
155
107
|
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
|
@@ -167,27 +119,7 @@ class ItemBuilder {
|
|
|
167
119
|
getExportPageToXLS() {
|
|
168
120
|
return {
|
|
169
121
|
id: DataExporterOption.EXPORT_PAGE_TO_XLS,
|
|
170
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
171
|
-
};
|
|
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)`
|
|
122
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
|
191
123
|
};
|
|
192
124
|
}
|
|
193
125
|
/**
|
|
@@ -215,6 +147,38 @@ class ItemBuilder {
|
|
|
215
147
|
}
|
|
216
148
|
}
|
|
217
149
|
|
|
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
|
+
|
|
218
182
|
function getMessage(application, key, params) {
|
|
219
183
|
var _a;
|
|
220
184
|
return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
|
@@ -243,196 +207,17 @@ function getFormatResponse(result) {
|
|
|
243
207
|
return ObjectUtils.stringToObject(response);
|
|
244
208
|
}
|
|
245
209
|
|
|
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
|
-
|
|
428
210
|
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}";
|
|
429
211
|
|
|
212
|
+
const LIMIT_PER_EXPORT = 5000;
|
|
430
213
|
const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
431
214
|
constructor() {
|
|
432
215
|
super();
|
|
433
216
|
this.__registerHost();
|
|
434
217
|
this._selectedNumber = 0;
|
|
435
218
|
this._customPrefix = "$custom$";
|
|
219
|
+
this._items = [];
|
|
220
|
+
this._showDropdown = false;
|
|
436
221
|
this._releasedToExport = [
|
|
437
222
|
DataExporterOption.EXPORT_TO_PDF,
|
|
438
223
|
DataExporterOption.EXPORT_TO_XLS,
|
|
@@ -440,12 +225,8 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
440
225
|
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
441
226
|
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
442
227
|
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
443
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
444
|
-
DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
|
445
|
-
DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
|
228
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
446
229
|
];
|
|
447
|
-
this._items = [];
|
|
448
|
-
this._showDropdown = false;
|
|
449
230
|
this.provider = null;
|
|
450
231
|
this.messagesBuilder = undefined;
|
|
451
232
|
}
|
|
@@ -516,7 +297,31 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
516
297
|
if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
|
|
517
298
|
return;
|
|
518
299
|
}
|
|
519
|
-
this.
|
|
300
|
+
const filters = this.provider.getFilters();
|
|
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)
|
|
520
325
|
.then((result) => callbackResolver(result))
|
|
521
326
|
.catch((exception) => {
|
|
522
327
|
console.error(exception);
|
|
@@ -524,26 +329,14 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
524
329
|
ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
|
|
525
330
|
});
|
|
526
331
|
}
|
|
527
|
-
getExporterStrategy() {
|
|
528
|
-
return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
|
|
529
|
-
}
|
|
530
332
|
getOptionKey(option) {
|
|
531
333
|
return Object.keys(DataExporterOption)
|
|
532
334
|
.find((key) => {
|
|
533
335
|
return DataExporterOption[key] === option;
|
|
534
336
|
});
|
|
535
337
|
}
|
|
536
|
-
|
|
537
|
-
|
|
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;
|
|
338
|
+
dispatchExporter(option) {
|
|
339
|
+
var _a;
|
|
547
340
|
const optionKey = this.getOptionKey(option);
|
|
548
341
|
const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
|
|
549
342
|
const isDownload = DataExporterType[optionKey] === DataExporterType.EXPORT_TO_XLS;
|
|
@@ -552,21 +345,15 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
552
345
|
fileName: this._appLabel,
|
|
553
346
|
titleGrid: this._appLabel,
|
|
554
347
|
exportOption: option,
|
|
555
|
-
limit:
|
|
556
|
-
type: this.getExportType(option),
|
|
348
|
+
limit: LIMIT_PER_EXPORT
|
|
557
349
|
};
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
isDownload }));
|
|
562
|
-
}
|
|
563
|
-
else {
|
|
564
|
-
ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
|
565
|
-
}
|
|
350
|
+
this.resolveExporter(params, (response) => {
|
|
351
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
|
352
|
+
isDownload }));
|
|
566
353
|
});
|
|
567
354
|
}
|
|
568
355
|
async processExporter(evt) {
|
|
569
|
-
var _a, _b, _c, _d
|
|
356
|
+
var _a, _b, _c, _d;
|
|
570
357
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
571
358
|
const exportCurrentPageOptions = [DataExporterOption.EXPORT_PAGE_TO_PDF, DataExporterOption.EXPORT_PAGE_TO_XLS];
|
|
572
359
|
const isCustomReport = (_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix);
|
|
@@ -574,19 +361,18 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
574
361
|
return;
|
|
575
362
|
const selectedRecords = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getSelectedIDs();
|
|
576
363
|
const totalRecords = (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getTotalRecords();
|
|
577
|
-
const totalPerPage = (
|
|
578
|
-
const exportLimit = (_g = (_f = this.provider) === null || _f === void 0 ? void 0 : _f.getExportLimit) === null || _g === void 0 ? void 0 : _g.call(_f);
|
|
364
|
+
const totalPerPage = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getLimit();
|
|
579
365
|
let limitExceeded = false;
|
|
580
|
-
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <=
|
|
366
|
+
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= LIMIT_PER_EXPORT) || isCustomReport) {
|
|
581
367
|
limitExceeded = false;
|
|
582
368
|
}
|
|
583
369
|
else if (selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) {
|
|
584
|
-
limitExceeded = selectedRecords.length >
|
|
370
|
+
limitExceeded = selectedRecords.length > LIMIT_PER_EXPORT;
|
|
585
371
|
}
|
|
586
|
-
else if (totalRecords >
|
|
372
|
+
else if (totalRecords > LIMIT_PER_EXPORT)
|
|
587
373
|
limitExceeded = true;
|
|
588
374
|
if (limitExceeded) {
|
|
589
|
-
const formattedLimit =
|
|
375
|
+
const formattedLimit = LIMIT_PER_EXPORT.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
|
|
590
376
|
const limitModalMessages = {
|
|
591
377
|
title: this.getMessage("snkDataExporter.limitExceeded.title"),
|
|
592
378
|
description: `
|
|
@@ -611,7 +397,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
611
397
|
this._showDropdown = false;
|
|
612
398
|
return;
|
|
613
399
|
}
|
|
614
|
-
if (!this.
|
|
400
|
+
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
615
401
|
return;
|
|
616
402
|
}
|
|
617
403
|
if (item.id === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
@@ -622,20 +408,9 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
622
408
|
}
|
|
623
409
|
this._showDropdown = false;
|
|
624
410
|
}
|
|
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
|
-
}
|
|
636
411
|
loadItems() {
|
|
637
412
|
const items = [];
|
|
638
|
-
this.
|
|
413
|
+
this._releasedToExport
|
|
639
414
|
.forEach((option) => {
|
|
640
415
|
var _a;
|
|
641
416
|
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
|
@@ -643,8 +418,8 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
643
418
|
this.loadPersonalizedItems(items);
|
|
644
419
|
}
|
|
645
420
|
async loadPersonalizedItems(items) {
|
|
646
|
-
var _a
|
|
647
|
-
const recordID = (
|
|
421
|
+
var _a;
|
|
422
|
+
const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
|
|
648
423
|
if (recordID == undefined) {
|
|
649
424
|
this._items = items;
|
|
650
425
|
return;
|
|
@@ -660,10 +435,10 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
660
435
|
this._items = items;
|
|
661
436
|
}
|
|
662
437
|
openPersonalizedReports(option) {
|
|
663
|
-
var _a
|
|
438
|
+
var _a;
|
|
664
439
|
const pkObject = [];
|
|
665
440
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
|
666
|
-
(
|
|
441
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
|
667
442
|
const fields = {};
|
|
668
443
|
fields['fields'] = [];
|
|
669
444
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
|
@@ -688,8 +463,8 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
688
463
|
}
|
|
689
464
|
}
|
|
690
465
|
loadDropdown() {
|
|
691
|
-
var _a;
|
|
692
|
-
this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.
|
|
466
|
+
var _a, _b;
|
|
467
|
+
this._selectedNumber = ((_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs()) === null || _b === void 0 ? void 0 : _b.length) || 0;
|
|
693
468
|
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
|
694
469
|
this.loadItems();
|
|
695
470
|
}
|
|
@@ -745,7 +520,8 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
745
520
|
"provider": [16],
|
|
746
521
|
"messagesBuilder": [1040],
|
|
747
522
|
"_items": [32],
|
|
748
|
-
"_showDropdown": [32]
|
|
523
|
+
"_showDropdown": [32],
|
|
524
|
+
"_releasedToExport": [32]
|
|
749
525
|
}]);
|
|
750
526
|
function defineCustomElement() {
|
|
751
527
|
if (typeof customElements === "undefined") {
|