@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
|
@@ -5,24 +5,13 @@ 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-0922807b.js');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
|
-
const DataFetcher = require('./DataFetcher-
|
|
11
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
12
|
-
require('./pesquisa-fetcher-680e198f.js');
|
|
13
|
-
require('./ISave-e91b70a7.js');
|
|
14
|
-
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
16
|
-
require('./dataunit-fetcher-688d3f05.js');
|
|
17
|
-
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
18
|
-
require('./form-config-fetcher-2dd00e5b.js');
|
|
10
|
+
const DataFetcher = require('./DataFetcher-77729a93.js');
|
|
11
|
+
const snkDataUnit = require('./snk-data-unit-559ac55c.js');
|
|
19
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
20
|
-
require('
|
|
21
|
-
require('./
|
|
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');
|
|
13
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
|
+
require('./SnkMessageBuilder-96b0f549.js');
|
|
26
15
|
|
|
27
16
|
class ItemBuilder {
|
|
28
17
|
constructor(getMessage, selectedNumber) {
|
|
@@ -44,9 +33,6 @@ class ItemBuilder {
|
|
|
44
33
|
items.push(this.getExportToXLS(groupName));
|
|
45
34
|
}
|
|
46
35
|
this.setExportCurrentPage(option, items);
|
|
47
|
-
if (this._selectedNumber > 0) {
|
|
48
|
-
this.setExportAllRecords(option, items);
|
|
49
|
-
}
|
|
50
36
|
this.setExportByEmail(option, items);
|
|
51
37
|
}
|
|
52
38
|
/**
|
|
@@ -77,34 +63,6 @@ class ItemBuilder {
|
|
|
77
63
|
}
|
|
78
64
|
}
|
|
79
65
|
}
|
|
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
|
-
}
|
|
108
66
|
/**
|
|
109
67
|
* Método responsável por inserir os itens de exportação por e-mail.
|
|
110
68
|
* @param option - Nome da opção que será inserida no array.
|
|
@@ -135,7 +93,7 @@ class ItemBuilder {
|
|
|
135
93
|
getExportToXLS(groupName) {
|
|
136
94
|
return {
|
|
137
95
|
id: index.DataExporterOption.EXPORT_TO_XLS,
|
|
138
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
96
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
|
139
97
|
group: groupName
|
|
140
98
|
};
|
|
141
99
|
}
|
|
@@ -150,17 +108,6 @@ class ItemBuilder {
|
|
|
150
108
|
group: this._getMessage("snkDataExporter.group.custom")
|
|
151
109
|
};
|
|
152
110
|
}
|
|
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
|
-
}
|
|
164
111
|
/**
|
|
165
112
|
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
|
166
113
|
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
|
@@ -178,27 +125,7 @@ class ItemBuilder {
|
|
|
178
125
|
getExportPageToXLS() {
|
|
179
126
|
return {
|
|
180
127
|
id: index.DataExporterOption.EXPORT_PAGE_TO_XLS,
|
|
181
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
|
182
|
-
};
|
|
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)`
|
|
128
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
|
202
129
|
};
|
|
203
130
|
}
|
|
204
131
|
/**
|
|
@@ -226,6 +153,38 @@ class ItemBuilder {
|
|
|
226
153
|
}
|
|
227
154
|
}
|
|
228
155
|
|
|
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
|
+
|
|
229
188
|
function getMessage(application, key, params) {
|
|
230
189
|
var _a;
|
|
231
190
|
return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
|
@@ -254,195 +213,16 @@ function getFormatResponse(result) {
|
|
|
254
213
|
return core.ObjectUtils.stringToObject(response);
|
|
255
214
|
}
|
|
256
215
|
|
|
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
|
-
|
|
439
216
|
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}";
|
|
440
217
|
|
|
218
|
+
const LIMIT_PER_EXPORT = 5000;
|
|
441
219
|
const SnkDataExporter = class {
|
|
442
220
|
constructor(hostRef) {
|
|
443
221
|
index$1.registerInstance(this, hostRef);
|
|
444
222
|
this._selectedNumber = 0;
|
|
445
223
|
this._customPrefix = "$custom$";
|
|
224
|
+
this._items = [];
|
|
225
|
+
this._showDropdown = false;
|
|
446
226
|
this._releasedToExport = [
|
|
447
227
|
index.DataExporterOption.EXPORT_TO_PDF,
|
|
448
228
|
index.DataExporterOption.EXPORT_TO_XLS,
|
|
@@ -450,12 +230,8 @@ const SnkDataExporter = class {
|
|
|
450
230
|
index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
451
231
|
index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
452
232
|
index.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
453
|
-
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
454
|
-
index.DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF,
|
|
455
|
-
index.DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS,
|
|
233
|
+
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
456
234
|
];
|
|
457
|
-
this._items = [];
|
|
458
|
-
this._showDropdown = false;
|
|
459
235
|
this.provider = null;
|
|
460
236
|
this.messagesBuilder = undefined;
|
|
461
237
|
}
|
|
@@ -526,7 +302,31 @@ const SnkDataExporter = class {
|
|
|
526
302
|
if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
|
|
527
303
|
return;
|
|
528
304
|
}
|
|
529
|
-
this.
|
|
305
|
+
const filters = this.provider.getFilters();
|
|
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)
|
|
530
330
|
.then((result) => callbackResolver(result))
|
|
531
331
|
.catch((exception) => {
|
|
532
332
|
console.error(exception);
|
|
@@ -534,26 +334,14 @@ const SnkDataExporter = class {
|
|
|
534
334
|
utils.ApplicationUtils.error(title || this.getMessage("snkDataExporter.message.exportError"), statusMessage || message || this.getMessage("snkDataExporter.message.unknownFailure"));
|
|
535
335
|
});
|
|
536
336
|
}
|
|
537
|
-
getExporterStrategy() {
|
|
538
|
-
return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
|
|
539
|
-
}
|
|
540
337
|
getOptionKey(option) {
|
|
541
338
|
return Object.keys(index.DataExporterOption)
|
|
542
339
|
.find((key) => {
|
|
543
340
|
return index.DataExporterOption[key] === option;
|
|
544
341
|
});
|
|
545
342
|
}
|
|
546
|
-
|
|
547
|
-
|
|
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;
|
|
343
|
+
dispatchExporter(option) {
|
|
344
|
+
var _a;
|
|
557
345
|
const optionKey = this.getOptionKey(option);
|
|
558
346
|
const fileType = (_a = index.DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : index.DataExporterType.EXPORT_TO_PDF;
|
|
559
347
|
const isDownload = index.DataExporterType[optionKey] === index.DataExporterType.EXPORT_TO_XLS;
|
|
@@ -562,21 +350,15 @@ const SnkDataExporter = class {
|
|
|
562
350
|
fileName: this._appLabel,
|
|
563
351
|
titleGrid: this._appLabel,
|
|
564
352
|
exportOption: option,
|
|
565
|
-
limit:
|
|
566
|
-
type: this.getExportType(option),
|
|
353
|
+
limit: LIMIT_PER_EXPORT
|
|
567
354
|
};
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
isDownload }));
|
|
572
|
-
}
|
|
573
|
-
else {
|
|
574
|
-
utils.ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
|
|
575
|
-
}
|
|
355
|
+
this.resolveExporter(params, (response) => {
|
|
356
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
|
357
|
+
isDownload }));
|
|
576
358
|
});
|
|
577
359
|
}
|
|
578
360
|
async processExporter(evt) {
|
|
579
|
-
var _a, _b, _c, _d
|
|
361
|
+
var _a, _b, _c, _d;
|
|
580
362
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
581
363
|
const exportCurrentPageOptions = [index.DataExporterOption.EXPORT_PAGE_TO_PDF, index.DataExporterOption.EXPORT_PAGE_TO_XLS];
|
|
582
364
|
const isCustomReport = (_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix);
|
|
@@ -584,19 +366,18 @@ const SnkDataExporter = class {
|
|
|
584
366
|
return;
|
|
585
367
|
const selectedRecords = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getSelectedIDs();
|
|
586
368
|
const totalRecords = (_c = this.provider) === null || _c === void 0 ? void 0 : _c.getTotalRecords();
|
|
587
|
-
const totalPerPage = (
|
|
588
|
-
const exportLimit = (_g = (_f = this.provider) === null || _f === void 0 ? void 0 : _f.getExportLimit) === null || _g === void 0 ? void 0 : _g.call(_f);
|
|
369
|
+
const totalPerPage = (_d = this.provider) === null || _d === void 0 ? void 0 : _d.getLimit();
|
|
589
370
|
let limitExceeded = false;
|
|
590
|
-
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <=
|
|
371
|
+
if ((exportCurrentPageOptions.includes(item === null || item === void 0 ? void 0 : item.id) && totalPerPage <= LIMIT_PER_EXPORT) || isCustomReport) {
|
|
591
372
|
limitExceeded = false;
|
|
592
373
|
}
|
|
593
374
|
else if (selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) {
|
|
594
|
-
limitExceeded = selectedRecords.length >
|
|
375
|
+
limitExceeded = selectedRecords.length > LIMIT_PER_EXPORT;
|
|
595
376
|
}
|
|
596
|
-
else if (totalRecords >
|
|
377
|
+
else if (totalRecords > LIMIT_PER_EXPORT)
|
|
597
378
|
limitExceeded = true;
|
|
598
379
|
if (limitExceeded) {
|
|
599
|
-
const formattedLimit =
|
|
380
|
+
const formattedLimit = LIMIT_PER_EXPORT.toLocaleString('pt-BR', { minimumFractionDigits: 0 });
|
|
600
381
|
const limitModalMessages = {
|
|
601
382
|
title: this.getMessage("snkDataExporter.limitExceeded.title"),
|
|
602
383
|
description: `
|
|
@@ -621,7 +402,7 @@ const SnkDataExporter = class {
|
|
|
621
402
|
this._showDropdown = false;
|
|
622
403
|
return;
|
|
623
404
|
}
|
|
624
|
-
if (!this.
|
|
405
|
+
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
625
406
|
return;
|
|
626
407
|
}
|
|
627
408
|
if (item.id === index.DataExporterOption.EXPORT_BY_EMAIL) {
|
|
@@ -632,20 +413,9 @@ const SnkDataExporter = class {
|
|
|
632
413
|
}
|
|
633
414
|
this._showDropdown = false;
|
|
634
415
|
}
|
|
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
|
-
}
|
|
646
416
|
loadItems() {
|
|
647
417
|
const items = [];
|
|
648
|
-
this.
|
|
418
|
+
this._releasedToExport
|
|
649
419
|
.forEach((option) => {
|
|
650
420
|
var _a;
|
|
651
421
|
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
|
@@ -653,8 +423,8 @@ const SnkDataExporter = class {
|
|
|
653
423
|
this.loadPersonalizedItems(items);
|
|
654
424
|
}
|
|
655
425
|
async loadPersonalizedItems(items) {
|
|
656
|
-
var _a
|
|
657
|
-
const recordID = (
|
|
426
|
+
var _a;
|
|
427
|
+
const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
|
|
658
428
|
if (recordID == undefined) {
|
|
659
429
|
this._items = items;
|
|
660
430
|
return;
|
|
@@ -670,10 +440,10 @@ const SnkDataExporter = class {
|
|
|
670
440
|
this._items = items;
|
|
671
441
|
}
|
|
672
442
|
openPersonalizedReports(option) {
|
|
673
|
-
var _a
|
|
443
|
+
var _a;
|
|
674
444
|
const pkObject = [];
|
|
675
445
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
|
676
|
-
(
|
|
446
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
|
677
447
|
const fields = {};
|
|
678
448
|
fields['fields'] = [];
|
|
679
449
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
|
@@ -698,8 +468,8 @@ const SnkDataExporter = class {
|
|
|
698
468
|
}
|
|
699
469
|
}
|
|
700
470
|
loadDropdown() {
|
|
701
|
-
var _a;
|
|
702
|
-
this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.
|
|
471
|
+
var _a, _b;
|
|
472
|
+
this._selectedNumber = ((_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs()) === null || _b === void 0 ? void 0 : _b.length) || 0;
|
|
703
473
|
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
|
704
474
|
this.loadItems();
|
|
705
475
|
}
|