@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,24 +1,13 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
|
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 './index-0ece87a6.js';
|
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-8457af36.js';
|
|
6
|
-
import { D as DataFetcher } from './DataFetcher-
|
|
7
|
-
import { S as SnkDataUnit } from './snk-data-unit-
|
|
8
|
-
import './pesquisa-fetcher-03c8f919.js';
|
|
9
|
-
import './ISave-d8c8bc59.js';
|
|
10
|
-
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
11
|
-
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
12
|
-
import './dataunit-fetcher-264191b2.js';
|
|
13
|
-
import './filter-item-type.enum-d45e026f.js';
|
|
14
|
-
import './form-config-fetcher-30fb808f.js';
|
|
6
|
+
import { D as DataFetcher } from './DataFetcher-773a3e4b.js';
|
|
7
|
+
import { S as SnkDataUnit } from './snk-data-unit-44215df7.js';
|
|
15
8
|
import './PrintUtils-3e4ff0f5.js';
|
|
16
|
-
import '
|
|
17
|
-
import './
|
|
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';
|
|
9
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
10
|
+
import './SnkMessageBuilder-72423074.js';
|
|
22
11
|
|
|
23
12
|
class ItemBuilder {
|
|
24
13
|
constructor(getMessage, selectedNumber) {
|
|
@@ -40,9 +29,6 @@ class ItemBuilder {
|
|
|
40
29
|
items.push(this.getExportToXLS(groupName));
|
|
41
30
|
}
|
|
42
31
|
this.setExportCurrentPage(option, items);
|
|
43
|
-
if (this._selectedNumber > 0) {
|
|
44
|
-
this.setExportAllRecords(option, items);
|
|
45
|
-
}
|
|
46
32
|
this.setExportByEmail(option, items);
|
|
47
33
|
}
|
|
48
34
|
/**
|
|
@@ -73,34 +59,6 @@ class ItemBuilder {
|
|
|
73
59
|
}
|
|
74
60
|
}
|
|
75
61
|
}
|
|
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
|
-
}
|
|
104
62
|
/**
|
|
105
63
|
* Método responsável por inserir os itens de exportação por e-mail.
|
|
106
64
|
* @param option - Nome da opção que será inserida no array.
|
|
@@ -131,7 +89,7 @@ class ItemBuilder {
|
|
|
131
89
|
getExportToXLS(groupName) {
|
|
132
90
|
return {
|
|
133
91
|
id: DataExporterOption.EXPORT_TO_XLS,
|
|
134
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
92
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
|
135
93
|
group: groupName
|
|
136
94
|
};
|
|
137
95
|
}
|
|
@@ -146,17 +104,6 @@ class ItemBuilder {
|
|
|
146
104
|
group: this._getMessage("snkDataExporter.group.custom")
|
|
147
105
|
};
|
|
148
106
|
}
|
|
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
|
-
}
|
|
160
107
|
/**
|
|
161
108
|
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
|
162
109
|
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
|
@@ -174,27 +121,7 @@ class ItemBuilder {
|
|
|
174
121
|
getExportPageToXLS() {
|
|
175
122
|
return {
|
|
176
123
|
id: DataExporterOption.EXPORT_PAGE_TO_XLS,
|
|
177
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
178
|
-
};
|
|
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)`
|
|
124
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
|
198
125
|
};
|
|
199
126
|
}
|
|
200
127
|
/**
|
|
@@ -222,6 +149,38 @@ class ItemBuilder {
|
|
|
222
149
|
}
|
|
223
150
|
}
|
|
224
151
|
|
|
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
|
+
|
|
225
184
|
function getMessage(application, key, params) {
|
|
226
185
|
var _a;
|
|
227
186
|
return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
|
@@ -250,195 +209,16 @@ function getFormatResponse(result) {
|
|
|
250
209
|
return ObjectUtils.stringToObject(response);
|
|
251
210
|
}
|
|
252
211
|
|
|
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
|
-
|
|
435
212
|
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}";
|
|
436
213
|
|
|
214
|
+
const LIMIT_PER_EXPORT = 5000;
|
|
437
215
|
const SnkDataExporter = class {
|
|
438
216
|
constructor(hostRef) {
|
|
439
217
|
registerInstance(this, hostRef);
|
|
440
218
|
this._selectedNumber = 0;
|
|
441
219
|
this._customPrefix = "$custom$";
|
|
220
|
+
this._items = [];
|
|
221
|
+
this._showDropdown = false;
|
|
442
222
|
this._releasedToExport = [
|
|
443
223
|
DataExporterOption.EXPORT_TO_PDF,
|
|
444
224
|
DataExporterOption.EXPORT_TO_XLS,
|
|
@@ -446,12 +226,8 @@ const SnkDataExporter = class {
|
|
|
446
226
|
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
447
227
|
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
448
228
|
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
449
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
450
|
-
DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
|
451
|
-
DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
|
229
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
452
230
|
];
|
|
453
|
-
this._items = [];
|
|
454
|
-
this._showDropdown = false;
|
|
455
231
|
this.provider = null;
|
|
456
232
|
this.messagesBuilder = undefined;
|
|
457
233
|
}
|
|
@@ -522,7 +298,31 @@ const SnkDataExporter = class {
|
|
|
522
298
|
if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
|
|
523
299
|
return;
|
|
524
300
|
}
|
|
525
|
-
this.
|
|
301
|
+
const filters = this.provider.getFilters();
|
|
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)
|
|
526
326
|
.then((result) => callbackResolver(result))
|
|
527
327
|
.catch((exception) => {
|
|
528
328
|
console.error(exception);
|
|
@@ -530,26 +330,14 @@ const SnkDataExporter = class {
|
|
|
530
330
|
ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
|
|
531
331
|
});
|
|
532
332
|
}
|
|
533
|
-
getExporterStrategy() {
|
|
534
|
-
return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
|
|
535
|
-
}
|
|
536
333
|
getOptionKey(option) {
|
|
537
334
|
return Object.keys(DataExporterOption)
|
|
538
335
|
.find((key) => {
|
|
539
336
|
return DataExporterOption[key] === option;
|
|
540
337
|
});
|
|
541
338
|
}
|
|
542
|
-
|
|
543
|
-
|
|
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;
|
|
339
|
+
dispatchExporter(option) {
|
|
340
|
+
var _a;
|
|
553
341
|
const optionKey = this.getOptionKey(option);
|
|
554
342
|
const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
|
|
555
343
|
const isDownload = DataExporterType[optionKey] === DataExporterType.EXPORT_TO_XLS;
|
|
@@ -558,21 +346,15 @@ const SnkDataExporter = class {
|
|
|
558
346
|
fileName: this._appLabel,
|
|
559
347
|
titleGrid: this._appLabel,
|
|
560
348
|
exportOption: option,
|
|
561
|
-
limit:
|
|
562
|
-
type: this.getExportType(option),
|
|
349
|
+
limit: LIMIT_PER_EXPORT
|
|
563
350
|
};
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
isDownload }));
|
|
568
|
-
}
|
|
569
|
-
else {
|
|
570
|
-
ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
|
571
|
-
}
|
|
351
|
+
this.resolveExporter(params, (response) => {
|
|
352
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
|
353
|
+
isDownload }));
|
|
572
354
|
});
|
|
573
355
|
}
|
|
574
356
|
async processExporter(evt) {
|
|
575
|
-
var _a, _b, _c, _d
|
|
357
|
+
var _a, _b, _c, _d;
|
|
576
358
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
577
359
|
const exportCurrentPageOptions = [DataExporterOption.EXPORT_PAGE_TO_PDF, DataExporterOption.EXPORT_PAGE_TO_XLS];
|
|
578
360
|
const isCustomReport = (_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix);
|
|
@@ -580,19 +362,18 @@ const SnkDataExporter = class {
|
|
|
580
362
|
return;
|
|
581
363
|
const selectedRecords = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getSelectedIDs();
|
|
582
364
|
const totalRecords = (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getTotalRecords();
|
|
583
|
-
const totalPerPage = (
|
|
584
|
-
const exportLimit = (_g = (_f = this.provider) === null || _f === void 0 ? void 0 : _f.getExportLimit) === null || _g === void 0 ? void 0 : _g.call(_f);
|
|
365
|
+
const totalPerPage = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getLimit();
|
|
585
366
|
let limitExceeded = false;
|
|
586
|
-
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <=
|
|
367
|
+
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= LIMIT_PER_EXPORT) || isCustomReport) {
|
|
587
368
|
limitExceeded = false;
|
|
588
369
|
}
|
|
589
370
|
else if (selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) {
|
|
590
|
-
limitExceeded = selectedRecords.length >
|
|
371
|
+
limitExceeded = selectedRecords.length > LIMIT_PER_EXPORT;
|
|
591
372
|
}
|
|
592
|
-
else if (totalRecords >
|
|
373
|
+
else if (totalRecords > LIMIT_PER_EXPORT)
|
|
593
374
|
limitExceeded = true;
|
|
594
375
|
if (limitExceeded) {
|
|
595
|
-
const formattedLimit =
|
|
376
|
+
const formattedLimit = LIMIT_PER_EXPORT.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
|
|
596
377
|
const limitModalMessages = {
|
|
597
378
|
title: this.getMessage("snkDataExporter.limitExceeded.title"),
|
|
598
379
|
description: `
|
|
@@ -617,7 +398,7 @@ const SnkDataExporter = class {
|
|
|
617
398
|
this._showDropdown = false;
|
|
618
399
|
return;
|
|
619
400
|
}
|
|
620
|
-
if (!this.
|
|
401
|
+
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
621
402
|
return;
|
|
622
403
|
}
|
|
623
404
|
if (item.id === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
@@ -628,20 +409,9 @@ const SnkDataExporter = class {
|
|
|
628
409
|
}
|
|
629
410
|
this._showDropdown = false;
|
|
630
411
|
}
|
|
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
|
-
}
|
|
642
412
|
loadItems() {
|
|
643
413
|
const items = [];
|
|
644
|
-
this.
|
|
414
|
+
this._releasedToExport
|
|
645
415
|
.forEach((option) => {
|
|
646
416
|
var _a;
|
|
647
417
|
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
|
@@ -649,8 +419,8 @@ const SnkDataExporter = class {
|
|
|
649
419
|
this.loadPersonalizedItems(items);
|
|
650
420
|
}
|
|
651
421
|
async loadPersonalizedItems(items) {
|
|
652
|
-
var _a
|
|
653
|
-
const recordID = (
|
|
422
|
+
var _a;
|
|
423
|
+
const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
|
|
654
424
|
if (recordID == undefined) {
|
|
655
425
|
this._items = items;
|
|
656
426
|
return;
|
|
@@ -666,10 +436,10 @@ const SnkDataExporter = class {
|
|
|
666
436
|
this._items = items;
|
|
667
437
|
}
|
|
668
438
|
openPersonalizedReports(option) {
|
|
669
|
-
var _a
|
|
439
|
+
var _a;
|
|
670
440
|
const pkObject = [];
|
|
671
441
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
|
672
|
-
(
|
|
442
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
|
673
443
|
const fields = {};
|
|
674
444
|
fields['fields'] = [];
|
|
675
445
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
|
@@ -694,8 +464,8 @@ const SnkDataExporter = class {
|
|
|
694
464
|
}
|
|
695
465
|
}
|
|
696
466
|
loadDropdown() {
|
|
697
|
-
var _a;
|
|
698
|
-
this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.
|
|
467
|
+
var _a, _b;
|
|
468
|
+
this._selectedNumber = ((_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs()) === null || _b === void 0 ? void 0 : _b.length) || 0;
|
|
699
469
|
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
|
700
470
|
this.loadItems();
|
|
701
471
|
}
|