@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
package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { UserInterface } from "@sankhyalabs/core";
|
|
2
|
-
import { DataFetcher } from "../../../lib";
|
|
3
|
-
import { getOptionKey, getVisibleColumns } from "../utils/ParserExport";
|
|
4
|
-
import { DataExporterType } from "../../../lib/@types";
|
|
5
|
-
export default class ClientSideExporterStrategy {
|
|
6
|
-
constructor(provider) {
|
|
7
|
-
this._provider = provider;
|
|
8
|
-
}
|
|
9
|
-
async getParsedColumns() {
|
|
10
|
-
const columns = await this._provider.getColumnsMetadata();
|
|
11
|
-
const visibleColumns = getVisibleColumns(columns);
|
|
12
|
-
return visibleColumns;
|
|
13
|
-
}
|
|
14
|
-
async executeExport(resolveProps) {
|
|
15
|
-
const { methodName, titleGrid } = resolveProps;
|
|
16
|
-
const records = await this._provider.getRecords();
|
|
17
|
-
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();
|
|
18
|
-
const [serviceName, processor] = this.getExecutor(methodName);
|
|
19
|
-
const payload = {
|
|
20
|
-
serviceName,
|
|
21
|
-
requestBody: {
|
|
22
|
-
grid: {
|
|
23
|
-
titleGrid,
|
|
24
|
-
columns: this.buildColumnsObject(columns),
|
|
25
|
-
rows: this.buildRowsObject(columns, records),
|
|
26
|
-
customOptions: { xlsxExtension: false }
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return new Promise((resolve, reject) => {
|
|
31
|
-
DataFetcher.get()
|
|
32
|
-
.callServiceBroker(serviceName, payload)
|
|
33
|
-
.then(result => resolve(processor(result)))
|
|
34
|
-
.catch(error => reject(error));
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
getExecutor(methodName) {
|
|
38
|
-
if (methodName === "exportToPDF") {
|
|
39
|
-
return [
|
|
40
|
-
"GridPDFBuilderSP.buildPDFFromJson",
|
|
41
|
-
responseBody => ({
|
|
42
|
-
fileSessionKey: responseBody.chavePDF.valor,
|
|
43
|
-
canPrint: responseBody.permiteImprimir.valor === "S",
|
|
44
|
-
canExport: responseBody.permiteExportar.valor === "S",
|
|
45
|
-
canSendEmail: responseBody.canSendEmail.valor === "S",
|
|
46
|
-
useAppPrint: true
|
|
47
|
-
})
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
return [
|
|
51
|
-
"GridXLSBuilderSP.buildXLSFromJson",
|
|
52
|
-
responseBody => ({
|
|
53
|
-
fileSessionKey: responseBody.chaveXLS.valor,
|
|
54
|
-
canPrint: false,
|
|
55
|
-
canExport: false,
|
|
56
|
-
useAppPrint: false,
|
|
57
|
-
canSendEmail: false
|
|
58
|
-
})
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
buildColumnsObject(columns) {
|
|
62
|
-
return {
|
|
63
|
-
column: columns.map((column, index) => {
|
|
64
|
-
const { label, id, width, userInterface } = column;
|
|
65
|
-
return Object.assign({ index: index + 1, id,
|
|
66
|
-
label,
|
|
67
|
-
width, presentationType: "P" }, (TYPE_MAP[userInterface] || { type: "S", align: "left" }));
|
|
68
|
-
})
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
buildRowsObject(columns, records) {
|
|
72
|
-
return {
|
|
73
|
-
row: records.map(rawRecord => {
|
|
74
|
-
const record = {};
|
|
75
|
-
columns.forEach((column, index) => record["c" + (index + 1)] = { $: this.formatValue(rawRecord, column) });
|
|
76
|
-
return record;
|
|
77
|
-
})
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
formatValue(record, column) {
|
|
81
|
-
if (this._provider.formatValue != undefined) {
|
|
82
|
-
return this._provider.formatValue(record, column);
|
|
83
|
-
}
|
|
84
|
-
return record[column.id] || "";
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
class FormatedRecord {
|
|
88
|
-
}
|
|
89
|
-
const TYPE_MAP = {
|
|
90
|
-
[UserInterface.DATE]: { type: "D", align: "center" },
|
|
91
|
-
[UserInterface.DATETIME]: { type: "H", align: "center" },
|
|
92
|
-
[UserInterface.TIME]: { type: "I", align: "right" },
|
|
93
|
-
[UserInterface.ELAPSEDTIME]: { type: "I", align: "right" },
|
|
94
|
-
[UserInterface.DECIMALNUMBER]: { type: "F", align: "right" },
|
|
95
|
-
[UserInterface.INTEGERNUMBER]: { type: "I", align: "right" },
|
|
96
|
-
[UserInterface.SEARCH]: { type: "S", align: "right" }
|
|
97
|
-
};
|
package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s)
|
|
4
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import { ApplicationContext, ObjectUtils } from "@sankhyalabs/core";
|
|
14
|
-
import { DataFetcher } from '../../../lib/http/data-fetcher/DataFetcher';
|
|
15
|
-
import { DataExporterOption, DataExporterType } from "../../../lib/@types";
|
|
16
|
-
import { getOptionKey, getVisibleColumns } from "../utils/ParserExport";
|
|
17
|
-
export default class ServerSideExporterStrategy {
|
|
18
|
-
constructor(provider) {
|
|
19
|
-
this._provider = provider;
|
|
20
|
-
}
|
|
21
|
-
async getParsedColumns() {
|
|
22
|
-
const columns = await this._provider.getColumnsMetadata();
|
|
23
|
-
const visibleColumns = getVisibleColumns(columns);
|
|
24
|
-
return visibleColumns;
|
|
25
|
-
}
|
|
26
|
-
async getParams(resolveProps) {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f;
|
|
28
|
-
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
29
|
-
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();
|
|
30
|
-
const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
31
|
-
const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
32
|
-
const selectedIDs = this._provider.getSelectedIDs();
|
|
33
|
-
const option = resolveProps.exportOption;
|
|
34
|
-
const currentPageOptions = [
|
|
35
|
-
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
36
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
37
|
-
];
|
|
38
|
-
delete resolveProps.exportOption;
|
|
39
|
-
let params = Object.assign({ filters,
|
|
40
|
-
columns,
|
|
41
|
-
sort,
|
|
42
|
-
resourceURI, selectedIDs: selectedIDs.slice(0, this._provider.getExportLimit()) }, resolveProps);
|
|
43
|
-
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
|
44
|
-
const offset = this._provider.getOffset();
|
|
45
|
-
const limit = this._provider.getPageSize();
|
|
46
|
-
params = Object.assign(Object.assign({}, params), { offset,
|
|
47
|
-
limit, selectedIDs: [] });
|
|
48
|
-
}
|
|
49
|
-
else if (resolveProps.type == "all") {
|
|
50
|
-
params = Object.assign(Object.assign({}, params), { offset: 0, limit: this._provider.getExportLimit(), selectedIDs: [] });
|
|
51
|
-
}
|
|
52
|
-
return Promise.resolve(params);
|
|
53
|
-
}
|
|
54
|
-
async executeExport(resolveProps) {
|
|
55
|
-
const _a = await this.getParams(resolveProps), { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
|
56
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
57
|
-
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
|
58
|
-
const payload = { serviceName, requestBody };
|
|
59
|
-
return new Promise((resolve, reject) => {
|
|
60
|
-
DataFetcher.get()
|
|
61
|
-
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
|
62
|
-
.then(result => resolve(this.getFormatResponse(result)))
|
|
63
|
-
.catch(error => reject(error));
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
getFormatResponse(result) {
|
|
67
|
-
var _a;
|
|
68
|
-
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
|
69
|
-
if (response == undefined) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
return ObjectUtils.stringToObject(response);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
|
2
|
-
import { UserInterface } from "@sankhyalabs/core";
|
|
3
|
-
import { getSelectedIDs } from "../utils/RecordIDUtils";
|
|
4
|
-
import { DataExporterOption } from "../../../lib/@types";
|
|
5
|
-
export default class ClientSideExporterProvider extends CommonsExporter {
|
|
6
|
-
getSelectedNumber() {
|
|
7
|
-
return this.dataUnit.getSelectionInfo().length;
|
|
8
|
-
}
|
|
9
|
-
getTotalRecords() {
|
|
10
|
-
var _a, _b, _c;
|
|
11
|
-
const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
|
12
|
-
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
|
13
|
-
}
|
|
14
|
-
getSelectedIDs() {
|
|
15
|
-
return getSelectedIDs(this.dataUnit);
|
|
16
|
-
}
|
|
17
|
-
getRecordID() {
|
|
18
|
-
var _a, _b, _c;
|
|
19
|
-
return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
20
|
-
}
|
|
21
|
-
async getRecords() {
|
|
22
|
-
if (this.dataUnit.records.length === 0) {
|
|
23
|
-
return Promise.resolve([]);
|
|
24
|
-
}
|
|
25
|
-
const selectionInfo = this.dataUnit.getSelectionInfo();
|
|
26
|
-
const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
|
|
27
|
-
return Promise.resolve(records == undefined ? [] : records);
|
|
28
|
-
}
|
|
29
|
-
getHiddenOptions() {
|
|
30
|
-
return [
|
|
31
|
-
DataExporterOption.EXPORT_BY_EMAIL,
|
|
32
|
-
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
33
|
-
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
34
|
-
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
35
|
-
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
formatValue(record, column) {
|
|
39
|
-
const { id, descriptionFrom } = column;
|
|
40
|
-
const value = record[descriptionFrom || id];
|
|
41
|
-
if (value == undefined) {
|
|
42
|
-
return "";
|
|
43
|
-
}
|
|
44
|
-
if (descriptionFrom != undefined) {
|
|
45
|
-
return value.label;
|
|
46
|
-
}
|
|
47
|
-
const fieldDescriptor = this.dataUnit.getField(id);
|
|
48
|
-
if (fieldDescriptor.userInterface === UserInterface.SEARCH) {
|
|
49
|
-
return value.value;
|
|
50
|
-
}
|
|
51
|
-
if (column.customFormatter) {
|
|
52
|
-
const ezGridColumn = this.getColumnsState().find(columnState => column.id === columnState.name);
|
|
53
|
-
const formattedValue = column.customFormatter.format(value, ezGridColumn, record.__record__id__);
|
|
54
|
-
return formattedValue;
|
|
55
|
-
}
|
|
56
|
-
return this.dataUnit.getFormattedValue(id, value);
|
|
57
|
-
}
|
|
58
|
-
}
|
package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
|
2
|
-
import { getSelectedIDs } from "../utils/RecordIDUtils";
|
|
3
|
-
export default class ServerSideExporterProvider extends CommonsExporter {
|
|
4
|
-
getFilters() {
|
|
5
|
-
var _a;
|
|
6
|
-
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
|
|
7
|
-
}
|
|
8
|
-
getOrders() {
|
|
9
|
-
var _a;
|
|
10
|
-
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
|
|
11
|
-
}
|
|
12
|
-
getResourceURI() {
|
|
13
|
-
var _a;
|
|
14
|
-
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
|
15
|
-
}
|
|
16
|
-
getSelectedNumber() {
|
|
17
|
-
return this.dataUnit.getSelectionInfo().length;
|
|
18
|
-
}
|
|
19
|
-
getTotalRecords() {
|
|
20
|
-
var _a, _b, _c;
|
|
21
|
-
const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
|
22
|
-
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
|
23
|
-
}
|
|
24
|
-
getSelectedIDs() {
|
|
25
|
-
return getSelectedIDs(this.dataUnit);
|
|
26
|
-
}
|
|
27
|
-
getOffset() {
|
|
28
|
-
return this.getExporterOffset(this.getPaginationInfo());
|
|
29
|
-
}
|
|
30
|
-
getPageSize() {
|
|
31
|
-
var _a;
|
|
32
|
-
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
|
|
33
|
-
}
|
|
34
|
-
getExportLimit() {
|
|
35
|
-
return 5000;
|
|
36
|
-
}
|
|
37
|
-
getRecordID() {
|
|
38
|
-
var _a, _b, _c;
|
|
39
|
-
return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
40
|
-
}
|
|
41
|
-
getPaginationInfo() {
|
|
42
|
-
var _a;
|
|
43
|
-
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
|
44
|
-
}
|
|
45
|
-
getExporterOffset(paginationInfo) {
|
|
46
|
-
if (paginationInfo == undefined) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const offset = paginationInfo.firstRecord;
|
|
50
|
-
if (offset > 0) {
|
|
51
|
-
return (offset - 1);
|
|
52
|
-
}
|
|
53
|
-
return offset;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { DataType, StringUtils } from "@sankhyalabs/core";
|
|
2
|
-
export const testMetadata = {
|
|
3
|
-
name: 'metadataName',
|
|
4
|
-
label: 'metadataLabel',
|
|
5
|
-
fields: [{
|
|
6
|
-
name: 'TESTFIELD',
|
|
7
|
-
label: 'Test label',
|
|
8
|
-
dataType: DataType.TEXT,
|
|
9
|
-
}]
|
|
10
|
-
};
|
|
11
|
-
export const recordId1 = StringUtils.generateUUID();
|
|
12
|
-
export const recordId2 = StringUtils.generateUUID();
|
|
13
|
-
export const testRecords = [
|
|
14
|
-
{
|
|
15
|
-
__record__id__: recordId1,
|
|
16
|
-
TESTFIELD: 'TESTVALUE'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
__record__id__: recordId2,
|
|
20
|
-
TESTFIELD: 'TESTVALUE2'
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
export const dataFetcherPDFResponse = {
|
|
24
|
-
chavePDF: {
|
|
25
|
-
valor: 'KEYPDF'
|
|
26
|
-
},
|
|
27
|
-
permiteImprimir: {
|
|
28
|
-
valor: "S"
|
|
29
|
-
},
|
|
30
|
-
permiteExportar: {
|
|
31
|
-
valor: "S"
|
|
32
|
-
},
|
|
33
|
-
canSendEmail: {
|
|
34
|
-
valor: "S"
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
export const dataFetcherXLSResponse = {
|
|
38
|
-
chaveXLS: {
|
|
39
|
-
valor: 'KEYXLS'
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
export const exportPDFParams = {
|
|
43
|
-
methodName: 'exportToPDF',
|
|
44
|
-
fileName: '',
|
|
45
|
-
titleGrid: '',
|
|
46
|
-
};
|
|
47
|
-
export const exportXLSParams = {
|
|
48
|
-
methodName: 'exportToXLS',
|
|
49
|
-
fileName: '',
|
|
50
|
-
titleGrid: '',
|
|
51
|
-
};
|
|
52
|
-
export const serviceNamePDF = "GridPDFBuilderSP.buildPDFFromJson";
|
|
53
|
-
export const serviceNameXLS = "GridXLSBuilderSP.buildXLSFromJson";
|
|
54
|
-
export function buildExpectedResponse({ serviceName, titleGrid, value, align = 'left', type = 'S' }) {
|
|
55
|
-
return {
|
|
56
|
-
serviceName: serviceName,
|
|
57
|
-
requestBody: {
|
|
58
|
-
grid: {
|
|
59
|
-
titleGrid: titleGrid,
|
|
60
|
-
columns: {
|
|
61
|
-
column: [
|
|
62
|
-
{
|
|
63
|
-
align: align,
|
|
64
|
-
id: "TESTFIELD",
|
|
65
|
-
index: 1,
|
|
66
|
-
label: "Test label",
|
|
67
|
-
presentationType: "P",
|
|
68
|
-
type: type,
|
|
69
|
-
width: undefined,
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
customOptions: {
|
|
74
|
-
xlsxExtension: false
|
|
75
|
-
},
|
|
76
|
-
rows: {
|
|
77
|
-
row: [
|
|
78
|
-
{
|
|
79
|
-
c1: {
|
|
80
|
-
$: value
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { DataExporterOption } from "../../../lib/@types";
|
|
2
|
-
const DOC_MAX_WIDTH = 800;
|
|
3
|
-
export function getVisibleColumns(columns) {
|
|
4
|
-
const visibleColumns = [];
|
|
5
|
-
let totalWidth = 0;
|
|
6
|
-
for (const column of columns) {
|
|
7
|
-
totalWidth += column.width;
|
|
8
|
-
if (totalWidth >= DOC_MAX_WIDTH) {
|
|
9
|
-
break;
|
|
10
|
-
}
|
|
11
|
-
visibleColumns.push(column);
|
|
12
|
-
}
|
|
13
|
-
return visibleColumns;
|
|
14
|
-
}
|
|
15
|
-
export function getOptionKey(option) {
|
|
16
|
-
return Object.keys(DataExporterOption)
|
|
17
|
-
.find((key) => {
|
|
18
|
-
return DataExporterOption[key] === option;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { DataType, JSUtils } from "@sankhyalabs/core";
|
|
2
|
-
export const getSelectedIDs = (dataUnit) => {
|
|
3
|
-
const selectionInfo = dataUnit.getSelectionInfo();
|
|
4
|
-
if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
|
|
5
|
-
return [];
|
|
6
|
-
}
|
|
7
|
-
const selectedRecordsIDsInfo = [];
|
|
8
|
-
const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.recordIds;
|
|
9
|
-
if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
|
|
10
|
-
selectedRecords.forEach(recordId => {
|
|
11
|
-
if (!dataUnit.isNewRecord(recordId)) {
|
|
12
|
-
/*
|
|
13
|
-
Esse if foi necessário para tratar corretamente o ID
|
|
14
|
-
do record quando está sendo utilizado no modo standAlone
|
|
15
|
-
isso não faz a exportação da grid funcionar no modo standAlone
|
|
16
|
-
mas deixa de causar erro nas oprações de CRUD.
|
|
17
|
-
*/
|
|
18
|
-
if (!JSUtils.isBase64(recordId)) {
|
|
19
|
-
selectedRecordsIDsInfo.push({
|
|
20
|
-
name: "__record__id__",
|
|
21
|
-
type: DataType.TEXT,
|
|
22
|
-
value: recordId
|
|
23
|
-
});
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const revertBase64ToObject = JSON.parse(window.atob(recordId));
|
|
27
|
-
Object.entries(revertBase64ToObject).forEach(([name, value]) => {
|
|
28
|
-
const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
|
|
29
|
-
if (metadataField == undefined) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return selectedRecordsIDsInfo;
|
|
38
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { DataType } from "@sankhyalabs/core";
|
|
2
|
-
const metadataMock = {
|
|
3
|
-
label: 'metadataMock',
|
|
4
|
-
name: 'metadataMock',
|
|
5
|
-
fields: [
|
|
6
|
-
{
|
|
7
|
-
name: 'TESTE',
|
|
8
|
-
label: 'Teste',
|
|
9
|
-
dataType: DataType.TEXT,
|
|
10
|
-
properties: {
|
|
11
|
-
rm_precision: 'TESTERMP.PRODUTORMP.decVlr'
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'TESTERMP',
|
|
16
|
-
label: 'Teste com RMP',
|
|
17
|
-
dataType: DataType.TEXT,
|
|
18
|
-
properties: {
|
|
19
|
-
rmp: 'PRODUTORMP'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
};
|
|
24
|
-
export default metadataMock;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DataType } from "@sankhyalabs/core";
|
|
2
|
-
const parentMetadataMock = {
|
|
3
|
-
label: 'parentMetadataMock',
|
|
4
|
-
name: 'parentMetadataMock',
|
|
5
|
-
fields: [
|
|
6
|
-
{
|
|
7
|
-
name: 'PARENT',
|
|
8
|
-
label: 'Parent',
|
|
9
|
-
dataType: DataType.TEXT,
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: 'TESTEPARENT',
|
|
13
|
-
label: 'Teste com Parent',
|
|
14
|
-
dataType: DataType.TEXT,
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
};
|
|
18
|
-
export default parentMetadataMock;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { NumberUtils, ObjectUtils } from "@sankhyalabs/core";
|
|
2
|
-
export default class RmPrecisionCustomValueFormatter {
|
|
3
|
-
setGrid(grid) {
|
|
4
|
-
if (this._grid) {
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
this._grid = grid;
|
|
8
|
-
this.refreshSelectedRows();
|
|
9
|
-
}
|
|
10
|
-
setDataState(dataState) {
|
|
11
|
-
if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
this._dataState = dataState;
|
|
15
|
-
this.refreshSelectedRows();
|
|
16
|
-
}
|
|
17
|
-
format(currentValue, column, recordId) {
|
|
18
|
-
var _a;
|
|
19
|
-
if (!currentValue) {
|
|
20
|
-
return currentValue;
|
|
21
|
-
}
|
|
22
|
-
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
|
23
|
-
const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
|
|
24
|
-
if (rmPrecision || rmPrecision === 0) {
|
|
25
|
-
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return currentValue;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
refreshSelectedRows() {
|
|
32
|
-
var _a;
|
|
33
|
-
(_a = this._grid) === null || _a === void 0 ? void 0 : _a.refreshSelectedRows();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const metadataMock = {
|
|
2
|
-
"label": "metadataMock",
|
|
3
|
-
"name": "metadataMock",
|
|
4
|
-
"fields": [
|
|
5
|
-
{
|
|
6
|
-
"name": "TESTE",
|
|
7
|
-
"label": "Teste",
|
|
8
|
-
"dataType": "TEXT"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "TESTERMP",
|
|
12
|
-
"label": "Teste com RMP",
|
|
13
|
-
"dataType": "TEXT",
|
|
14
|
-
"properties": {
|
|
15
|
-
"rmp": {
|
|
16
|
-
"value": "PRODUTORMP"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
};
|
|
22
|
-
export default metadataMock;
|
package/dist/components/ISave.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var PresentationMode;
|
|
2
|
-
(function (PresentationMode) {
|
|
3
|
-
PresentationMode["PRIMARY"] = "primary";
|
|
4
|
-
PresentationMode["SECONDARY"] = "secondary";
|
|
5
|
-
PresentationMode["SINGLE_TASKBAR"] = "singleTaskbar";
|
|
6
|
-
})(PresentationMode || (PresentationMode = {}));
|
|
7
|
-
var DataExporterOption;
|
|
8
|
-
(function (DataExporterOption) {
|
|
9
|
-
DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
|
|
10
|
-
DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
|
|
11
|
-
DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
|
|
12
|
-
DataExporterOption["EXPORT_ALL_RECORDS"] = "exportAllRecords";
|
|
13
|
-
DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
|
|
14
|
-
DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
|
|
15
|
-
DataExporterOption["EXPORT_ALL_RECORDS_TO_PDF"] = "exportAllRecordsToPDF";
|
|
16
|
-
DataExporterOption["EXPORT_ALL_RECORDS_TO_XLS"] = "exportAllRecordsToXLS";
|
|
17
|
-
DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
|
|
18
|
-
DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
|
|
19
|
-
DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
|
|
20
|
-
})(DataExporterOption || (DataExporterOption = {}));
|
|
21
|
-
var DataExporterFormat;
|
|
22
|
-
(function (DataExporterFormat) {
|
|
23
|
-
DataExporterFormat["PDF"] = "exportPDFToEmail";
|
|
24
|
-
DataExporterFormat["XLS"] = "exportXLSToEmail";
|
|
25
|
-
DataExporterFormat["XLSX"] = "exportXLSToEmail";
|
|
26
|
-
})(DataExporterFormat || (DataExporterFormat = {}));
|
|
27
|
-
var DataExporterType;
|
|
28
|
-
(function (DataExporterType) {
|
|
29
|
-
DataExporterType["EXPORT_TO_PDF"] = "PDF";
|
|
30
|
-
DataExporterType["EXPORT_TO_XLS"] = "XLS";
|
|
31
|
-
DataExporterType["EXPORT_PAGE_TO_PDF"] = "PDF";
|
|
32
|
-
DataExporterType["EXPORT_PAGE_TO_XLS"] = "XLS";
|
|
33
|
-
DataExporterType["EXPORT_ALL_RECORDS_TO_PDF"] = "PDF";
|
|
34
|
-
DataExporterType["EXPORT_ALL_RECORDS_TO_XLS"] = "XLS";
|
|
35
|
-
DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
|
|
36
|
-
DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
|
|
37
|
-
})(DataExporterType || (DataExporterType = {}));
|
|
38
|
-
|
|
39
|
-
var SaveErrorsEnum;
|
|
40
|
-
(function (SaveErrorsEnum) {
|
|
41
|
-
SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
|
|
42
|
-
SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
|
|
43
|
-
SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
|
|
44
|
-
SaveErrorsEnum["DESCRIPTION_CANNOT_BE_CHANGED"] = "DESCRIPTION_CANNOT_BE_CHANGED";
|
|
45
|
-
})(SaveErrorsEnum || (SaveErrorsEnum = {}));
|
|
46
|
-
|
|
47
|
-
export { DataExporterOption as D, PresentationMode as P, SaveErrorsEnum as S, DataExporterType as a, DataExporterFormat as b };
|