@sankhyalabs/sankhyablocks 8.15.3 → 8.16.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-a343e418.js} +1 -0
- package/dist/cjs/{SnkMultiSelectionListDataSource-3c08d25c.js → IExporterProvider-597949f9.js} +94 -4
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-f9dc0d28.js → SnkFormConfigManager-166cbd1f.js} +8 -7
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-897ffd08.js} +9 -13
- package/dist/cjs/{pesquisa-fetcher-562d281f.js → dataunit-fetcher-688d3f05.js} +87 -180
- package/dist/cjs/{index-0922807b.js → index-1dfc7a6e.js} +5 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-fetcher-680e198f.js +166 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -3
- package/dist/cjs/snk-application.cjs.entry.js +35 -12
- package/dist/cjs/snk-attach.cjs.entry.js +71 -46
- package/dist/cjs/snk-crud.cjs.entry.js +101 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +315 -85
- package/dist/cjs/snk-data-unit-8fa7917a.js +689 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +12 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +50 -10
- package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -2
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +52 -7
- package/dist/cjs/snk-grid.cjs.entry.js +165 -108
- package/dist/cjs/{snk-guides-viewer-bb6087cd.js → snk-guides-viewer-9c682034.js} +43 -10
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +268 -40
- package/dist/cjs/snk-taskbar.cjs.entry.js +4 -3
- package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-9ad1f9c0.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +35 -11
- package/dist/collection/components/snk-attach/snk-attach.js +67 -44
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +305 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +136 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +134 -7
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +97 -0
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +74 -0
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +54 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +58 -0
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +59 -52
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +20 -0
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +538 -218
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
- package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +18 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
- package/dist/collection/components/snk-form/snk-form.js +102 -5
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +7 -6
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +240 -101
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +406 -20
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
- package/dist/collection/lib/@types/index.js +5 -0
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +7 -3
- package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +53 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
- package/dist/collection/lib/message/SnkMessageBuilder.js +5 -12
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +2 -1
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/{field-search.js → IExporterProvider.js} +93 -6
- package/dist/components/ISave.js +47 -0
- package/dist/components/SnkFormConfigManager.js +7 -6
- package/dist/components/SnkMessageBuilder.js +9 -13
- package/dist/components/dataunit-fetcher.js +84 -182
- package/dist/components/index2.js +198 -33
- package/dist/components/pesquisa-fetcher.js +164 -0
- package/dist/components/snk-actions-button2.js +4 -11
- package/dist/components/snk-application2.js +31 -9
- package/dist/components/snk-attach2.js +65 -41
- package/dist/components/snk-crud.js +110 -11
- package/dist/components/snk-data-exporter2.js +309 -85
- package/dist/components/snk-data-unit2.js +485 -216
- package/dist/components/snk-detail-view2.js +96 -14
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +6 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form-view2.js +72 -1
- package/dist/components/snk-form.js +53 -6
- package/dist/components/snk-grid2.js +168 -106
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +263 -25
- package/dist/components/snk-taskbar2.js +6 -5
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-3806514e.js} +1 -0
- package/dist/esm/{SnkMultiSelectionListDataSource-6a879955.js → IExporterProvider-63a188b6.js} +93 -5
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-f53f9f87.js → SnkFormConfigManager-31b24066.js} +8 -7
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-571462fb.js} +9 -13
- package/dist/esm/{pesquisa-fetcher-c7ce8ee7.js → dataunit-fetcher-264191b2.js} +83 -181
- package/dist/esm/{index-0ece87a6.js → index-3aa4977a.js} +6 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-fetcher-03c8f919.js +164 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -3
- package/dist/esm/snk-application.entry.js +34 -11
- package/dist/esm/snk-attach.entry.js +66 -41
- package/dist/esm/snk-crud.entry.js +101 -10
- package/dist/esm/snk-data-exporter.entry.js +316 -86
- package/dist/esm/snk-data-unit-f5cbe64b.js +687 -0
- package/dist/esm/snk-data-unit.entry.js +12 -2
- package/dist/esm/snk-detail-view.entry.js +50 -10
- package/dist/esm/snk-filter-bar.entry.js +6 -2
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +52 -7
- package/dist/esm/snk-grid.entry.js +163 -106
- package/dist/esm/{snk-guides-viewer-1d95ebf2.js → snk-guides-viewer-8f6960a2.js} +43 -10
- package/dist/esm/snk-guides-viewer.entry.js +9 -7
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +256 -28
- package/dist/esm/snk-taskbar.entry.js +4 -3
- package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-d59867f1.js} +3 -3
- package/dist/sankhyablocks/p-17def7cd.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-28ee0972.js +1 -0
- package/dist/sankhyablocks/p-2a408684.js +1 -0
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-2c68b3ae.entry.js} +1 -1
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-3a212712.js +1 -0
- package/dist/sankhyablocks/p-450c60e4.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-47db7e88.entry.js} +1 -1
- package/dist/sankhyablocks/p-4e5e1313.entry.js +1 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-52920496.js} +1 -1
- package/dist/sankhyablocks/p-62ba211a.entry.js +1 -0
- package/dist/sankhyablocks/p-6bb2f3e9.entry.js +1 -0
- package/dist/sankhyablocks/p-7505da04.entry.js +1 -0
- package/dist/sankhyablocks/p-7619bdb1.entry.js +11 -0
- package/dist/sankhyablocks/p-7a85fd49.entry.js +1 -0
- package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
- package/dist/sankhyablocks/p-7ef9c55c.js +1 -0
- package/dist/sankhyablocks/p-80042dc6.entry.js +1 -0
- package/dist/sankhyablocks/p-8c59edd7.entry.js +1 -0
- package/dist/sankhyablocks/p-9606509c.entry.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/p-ae93d46a.entry.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-d6e26ea8.entry.js +1 -0
- package/dist/sankhyablocks/p-f2809746.entry.js +1 -0
- package/dist/sankhyablocks/p-f4450320.entry.js +1 -0
- package/dist/sankhyablocks/p-fe79f83a.js +60 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +7 -3
- package/dist/types/components/snk-attach/snk-attach.d.ts +11 -9
- package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +45 -1
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +24 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +14 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +12 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +24 -4
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -1
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +66 -2
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
- package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/snk-form.d.ts +14 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +46 -6
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +62 -4
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +261 -4
- package/dist/types/lib/@types/index.d.ts +5 -0
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/snk-data-unit-41c29713.js +0 -462
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
- package/dist/components/index3.js +0 -199
- package/dist/esm/snk-data-unit-de1d140d.js +0 -460
- package/dist/sankhyablocks/p-032fe52e.js +0 -1
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
- package/dist/sankhyablocks/p-0594db5a.entry.js +0 -1
- package/dist/sankhyablocks/p-06e13db2.js +0 -1
- package/dist/sankhyablocks/p-07a61550.entry.js +0 -1
- package/dist/sankhyablocks/p-1403a4b6.entry.js +0 -1
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-15802c59.entry.js +0 -1
- package/dist/sankhyablocks/p-235dc7b1.js +0 -65
- package/dist/sankhyablocks/p-32556aa6.js +0 -1
- package/dist/sankhyablocks/p-38289a55.js +0 -1
- package/dist/sankhyablocks/p-3c632d48.js +0 -1
- package/dist/sankhyablocks/p-3f833983.entry.js +0 -1
- package/dist/sankhyablocks/p-52c8e589.js +0 -1
- package/dist/sankhyablocks/p-5e1502b6.entry.js +0 -11
- package/dist/sankhyablocks/p-74d349c3.entry.js +0 -1
- package/dist/sankhyablocks/p-93167e28.entry.js +0 -1
- package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
- package/dist/sankhyablocks/p-bd47dd16.entry.js +0 -1
- package/dist/sankhyablocks/p-c1f88236.entry.js +0 -1
- package/dist/sankhyablocks/p-ccdd5332.entry.js +0 -1
- package/dist/sankhyablocks/p-ee9536bc.entry.js +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -9,8 +9,11 @@ export var DataExporterOption;
|
|
9
9
|
DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
|
10
10
|
DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
|
11
11
|
DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
|
12
|
+
DataExporterOption["EXPORT_ALL_RECORDS"] = "exportAllRecords";
|
12
13
|
DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
|
13
14
|
DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
|
15
|
+
DataExporterOption["EXPORT_ALL_RECORDS_TO_PDF"] = "exportAllRecordsToPDF";
|
16
|
+
DataExporterOption["EXPORT_ALL_RECORDS_TO_XLS"] = "exportAllRecordsToXLS";
|
14
17
|
DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
|
15
18
|
DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
|
16
19
|
DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
|
@@ -27,6 +30,8 @@ export var DataExporterType;
|
|
27
30
|
DataExporterType["EXPORT_TO_XLS"] = "XLS";
|
28
31
|
DataExporterType["EXPORT_PAGE_TO_PDF"] = "PDF";
|
29
32
|
DataExporterType["EXPORT_PAGE_TO_XLS"] = "XLS";
|
33
|
+
DataExporterType["EXPORT_ALL_RECORDS_TO_PDF"] = "PDF";
|
34
|
+
DataExporterType["EXPORT_ALL_RECORDS_TO_XLS"] = "XLS";
|
30
35
|
DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
|
31
36
|
DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
|
32
37
|
})(DataExporterType || (DataExporterType = {}));
|
@@ -0,0 +1,35 @@
|
|
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
|
+
}
|
@@ -71,6 +71,7 @@ export class ConfigStorage {
|
|
71
71
|
if (config == undefined) {
|
72
72
|
return;
|
73
73
|
}
|
74
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
74
75
|
await this.deleteGridConfigCache(name, resourceID);
|
75
76
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
76
77
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ChangeOperation, DataType, DataUnit, DateUtils, StringUtils, } from '@sankhyalabs/core';
|
2
2
|
import { applyFilter, applySorting, buildPaginationInfo } from './dataUnitInMemoryUtils';
|
3
3
|
export default class InMemoryLoader {
|
4
|
-
constructor(metadata, records) {
|
4
|
+
constructor(metadata, records, config) {
|
5
5
|
this.metadata = metadata;
|
6
6
|
this.records = records;
|
7
7
|
this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
@@ -10,7 +10,11 @@ export default class InMemoryLoader {
|
|
10
10
|
this._dataUnit.dataLoader = (dataUnit, request) => this.inMemoryLoader(dataUnit, request, this.getRecordsToLoad());
|
11
11
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
12
12
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
13
|
-
this.dataUnit.loadMetadata().then(() =>
|
13
|
+
this.dataUnit.loadMetadata().then(() => {
|
14
|
+
if ((config === null || config === void 0 ? void 0 : config.autoLoad) !== false) {
|
15
|
+
this.dataUnit.loadData();
|
16
|
+
}
|
17
|
+
});
|
14
18
|
}
|
15
19
|
getRecordsToLoad() {
|
16
20
|
if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
|
@@ -62,7 +66,7 @@ export default class InMemoryLoader {
|
|
62
66
|
this._initialRecords = newRecords;
|
63
67
|
if (this._dataUnit) {
|
64
68
|
//Isso força o refresh internamente no datunit
|
65
|
-
this._dataUnit.
|
69
|
+
this._dataUnit.loadData();
|
66
70
|
}
|
67
71
|
}
|
68
72
|
get metadata() {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -21,6 +21,9 @@ export default class DataUnitDataLoader {
|
|
21
21
|
});
|
22
22
|
});
|
23
23
|
}
|
24
|
+
static getCachedRecords(dataUnit) {
|
25
|
+
return PreloadManager.getCachedRecords(dataUnit);
|
26
|
+
}
|
24
27
|
static async loadFromServer(dataUnit, request, loadingInfo) {
|
25
28
|
try {
|
26
29
|
//Registramos a request com as informações de carga para determinarmos a última.
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ObjectUtils } from "@sankhyalabs/core";
|
1
2
|
export class ArrayRepository {
|
2
3
|
constructor(equalsFunction) {
|
3
4
|
this._list = [];
|
@@ -77,4 +78,7 @@ export class ArrayRepository {
|
|
77
78
|
async count() {
|
78
79
|
return Promise.resolve(this._list.length);
|
79
80
|
}
|
81
|
+
getFromCache() {
|
82
|
+
return ObjectUtils.copy(this._list);
|
83
|
+
}
|
80
84
|
}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { DataUnit
|
1
|
+
import { DataUnit } from "@sankhyalabs/core";
|
2
2
|
import { ArrayRepository } from "./ArrayRepository";
|
3
3
|
import { ColumnFilterManager } from "@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";
|
4
|
+
import SortingUtils from "@sankhyalabs/core/dist/utils/SortingUtils";
|
4
5
|
export default class PreloadManager {
|
5
6
|
static setLoadingStatus(dataUnit, loadingInProgress) {
|
6
7
|
this._loadingStatus.set(dataUnit.name, loadingInProgress);
|
@@ -20,17 +21,7 @@ export default class PreloadManager {
|
|
20
21
|
}
|
21
22
|
}
|
22
23
|
static getSortingFunction(dataUnit, sorting) {
|
23
|
-
|
24
|
-
return undefined;
|
25
|
-
}
|
26
|
-
return (recordA, recordB) => {
|
27
|
-
for (const sort of sorting) {
|
28
|
-
const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
|
29
|
-
if (result != 0) {
|
30
|
-
return result;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
};
|
24
|
+
return SortingUtils.getSortingFunction(dataUnit, sorting);
|
34
25
|
}
|
35
26
|
static async getDistinct(dataUnit, fieldName) {
|
36
27
|
if (!PreloadManager.isCacheEnabled(dataUnit)) {
|
@@ -67,7 +58,11 @@ export default class PreloadManager {
|
|
67
58
|
static async loadData(dataUnit, request, loadFromServer) {
|
68
59
|
try {
|
69
60
|
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
70
|
-
|
61
|
+
const useCache = [
|
62
|
+
"EZ_GRID_LOADING_SOURCE",
|
63
|
+
DataUnit.CHANGING_PAGE_LOADING_SOURCE,
|
64
|
+
DataUnit.ALL_RECORDS_SELECTION_SOURCE
|
65
|
+
].includes(request.source);
|
71
66
|
if (useCache) {
|
72
67
|
const isCacheEmpty = await PreloadManager.getRepository(dataUnit).isEmpty();
|
73
68
|
if (!isCacheEmpty) {
|
@@ -134,6 +129,9 @@ export default class PreloadManager {
|
|
134
129
|
.catch(reason => reject(reason));
|
135
130
|
});
|
136
131
|
}
|
132
|
+
static getCachedRecords(dataUnit) {
|
133
|
+
return PreloadManager.getRepository(dataUnit).getFromCache();
|
134
|
+
}
|
137
135
|
}
|
138
136
|
PreloadManager._repositories = new Map();
|
139
137
|
PreloadManager._loadingStatus = new Map();
|
@@ -111,6 +111,7 @@ export default class DataUnitFetcher {
|
|
111
111
|
dataUnit.saveLoader = (_dataUnit, changes) => this.saveData(dataUnit, changes);
|
112
112
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
113
113
|
dataUnit.recordLoader = (dataUnit, recordIds) => this.loadRecord(dataUnit, recordIds);
|
114
|
+
dataUnit.allRecordsLoader = (dataUnit) => DataUnitDataLoader.getCachedRecords(dataUnit);
|
114
115
|
return dataUnit;
|
115
116
|
}
|
116
117
|
loadMetadata(dataUnit) {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js
CHANGED
@@ -2,11 +2,13 @@ import { ApplicationContext, StringUtils, UserInterface, } from '@sankhyalabs/co
|
|
2
2
|
import { DataFetcher } from "../../../DataFetcher";
|
3
3
|
import DataUnitFetcher from "../dataunit-fetcher";
|
4
4
|
import InMemoryLoader from "../../../../../dataUnit/InMemoryLoader";
|
5
|
+
import { getRecordValue } from '../../../../../dataUnit/ValueFormatter';
|
5
6
|
export class DatasetStrategy {
|
6
7
|
canSlice() {
|
7
8
|
return false;
|
8
9
|
}
|
9
10
|
processSortingSide(request, dataUnit, serverSideFilters) {
|
11
|
+
var _a;
|
10
12
|
const localSorting = [];
|
11
13
|
const serverSorting = [];
|
12
14
|
if (request.sort != undefined) {
|
@@ -15,9 +17,7 @@ export class DatasetStrategy {
|
|
15
17
|
}
|
16
18
|
for (const sort of request.sort) {
|
17
19
|
const descriptor = dataUnit.getField(sort.field);
|
18
|
-
const local = descriptor
|
19
|
-
&& descriptor.properties != undefined
|
20
|
-
&& descriptor.properties.calculated === "true";
|
20
|
+
const local = ((_a = descriptor === null || descriptor === void 0 ? void 0 : descriptor.properties) === null || _a === void 0 ? void 0 : _a.calculated) === "true" || (descriptor === null || descriptor === void 0 ? void 0 : descriptor.userInterface) === UserInterface.LONGTEXT;
|
21
21
|
if (local) {
|
22
22
|
localSorting.push(sort);
|
23
23
|
}
|
@@ -57,6 +57,53 @@ export class DatasetStrategy {
|
|
57
57
|
return Promise.reject(error);
|
58
58
|
}
|
59
59
|
}
|
60
|
+
async loadRowMetadata(snkDataUnit, fieldName, metadataName, updatedFields = {}) {
|
61
|
+
try {
|
62
|
+
const serviceName = "DatasetSP.loadRowMetadata";
|
63
|
+
const parsedRequestBody = await this.buildRequestBodyLoadRowMetadata({ snkDataUnit, fieldName, metadataName, serviceName, updatedFields });
|
64
|
+
const response = await DataFetcher.get().callServiceBroker(serviceName, parsedRequestBody);
|
65
|
+
return response;
|
66
|
+
}
|
67
|
+
catch (error) {
|
68
|
+
console.error(error);
|
69
|
+
return Promise.reject(error);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
async buildRequestBodyLoadRowMetadata({ snkDataUnit, serviceName, fieldName, metadataName, updatedFields, }) {
|
73
|
+
const dataUnit = snkDataUnit.dataUnit;
|
74
|
+
const entityName = DataUnitFetcher.parseDataUnitName(dataUnit.name).entityName;
|
75
|
+
const recordIdInfo = await snkDataUnit.getSelectedRecordsIDsInfo();
|
76
|
+
const pk = recordIdInfo.reduce((accumulator, currentValue) => {
|
77
|
+
accumulator[currentValue.name] = currentValue.value;
|
78
|
+
return accumulator;
|
79
|
+
}, {});
|
80
|
+
const record = dataUnit.getSelectedRecord();
|
81
|
+
const fields = dataUnit.metadata.fields.filter(({ standAlone, name }) => !standAlone && !name.includes(".")).map(({ name }) => name);
|
82
|
+
const values = fields.reduce((accumulator, currentValue, currentIndex) => {
|
83
|
+
const recordValue = getRecordValue(record, currentValue);
|
84
|
+
const updatedFieldValue = getRecordValue(updatedFields, currentValue);
|
85
|
+
accumulator[currentIndex] = updatedFieldValue !== undefined ? updatedFieldValue : recordValue;
|
86
|
+
return accumulator;
|
87
|
+
}, {});
|
88
|
+
const requestBody = {
|
89
|
+
serviceName,
|
90
|
+
requestBody: {
|
91
|
+
dataSetID: dataUnit.dataUnitId,
|
92
|
+
entityName,
|
93
|
+
standAlone: false,
|
94
|
+
metadataName,
|
95
|
+
fieldName,
|
96
|
+
fields,
|
97
|
+
record: {
|
98
|
+
pk,
|
99
|
+
oldPk: pk,
|
100
|
+
values,
|
101
|
+
},
|
102
|
+
}
|
103
|
+
};
|
104
|
+
const parsedRequestBody = JSON.stringify(requestBody);
|
105
|
+
return parsedRequestBody;
|
106
|
+
}
|
60
107
|
getFieldsList(dataUnit) {
|
61
108
|
let fields = ["__record__id__", "__record__label__"];
|
62
109
|
dataUnit.metadata.fields.forEach((descriptor) => {
|
@@ -136,9 +183,11 @@ export class DatasetStrategy {
|
|
136
183
|
}
|
137
184
|
processRecords(dataUnit, fields, responseRecords) {
|
138
185
|
return responseRecords.map((dataFrame) => {
|
186
|
+
const lastElement = dataFrame[dataFrame.length - 1];
|
139
187
|
const duRecord = {
|
140
188
|
__record__id__: dataFrame[0],
|
141
|
-
__record__label__: dataFrame[1]
|
189
|
+
__record__label__: dataFrame[1],
|
190
|
+
__record__metadata__: lastElement['_rmd'],
|
142
191
|
};
|
143
192
|
dataUnit.metadata.fields.forEach(fieldDescriptor => {
|
144
193
|
duRecord[fieldDescriptor.name] = this.buildFieldValue(fieldDescriptor, fields, dataFrame);
|
@@ -0,0 +1,22 @@
|
|
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;
|
@@ -50,12 +50,12 @@ export class PesquisaFetcher {
|
|
50
50
|
});
|
51
51
|
}
|
52
52
|
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
53
|
-
var _a, _b, _c, _d;
|
53
|
+
var _a, _b, _c, _d, _e;
|
54
54
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
55
55
|
const values = {
|
56
56
|
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
57
57
|
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
58
|
-
searchOptions: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions)
|
58
|
+
searchOptions: Object.assign(Object.assign({}, searchOptions), listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions),
|
59
59
|
};
|
60
60
|
const serviceName = "PesquisaSP.getSuggestion";
|
61
61
|
const externalCriteria = {
|
@@ -86,11 +86,11 @@ export class PesquisaFetcher {
|
|
86
86
|
};
|
87
87
|
}
|
88
88
|
const options = searchOptions != undefined
|
89
|
-
? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
89
|
+
? Object.assign(Object.assign({}, values === null || values === void 0 ? void 0 : values.searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
90
90
|
const reqBody = {
|
91
91
|
"serviceName": serviceName,
|
92
92
|
"requestBody": {
|
93
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (
|
93
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": (_d = options === null || options === void 0 ? void 0 : options.ignoreEntityCriteria) !== null && _d !== void 0 ? _d : false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_e = values.searchOptions) === null || _e === void 0 ? void 0 : _e.rootEntity }, { options }),
|
94
94
|
"clientEventList": {
|
95
95
|
"clientEvent": []
|
96
96
|
}
|
@@ -55,7 +55,7 @@ export class SnkMessageBuilder {
|
|
55
55
|
this.loadAppMessages().then((msgs) => {
|
56
56
|
this._appMessages = msgs;
|
57
57
|
}, error => {
|
58
|
-
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages
|
58
|
+
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
|
59
59
|
});
|
60
60
|
}
|
61
61
|
/**
|
@@ -147,17 +147,10 @@ export class SnkMessageBuilder {
|
|
147
147
|
return message;
|
148
148
|
}
|
149
149
|
}
|
150
|
-
loadAppMessages() {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
.then(module => {
|
155
|
-
accept(module.default);
|
156
|
-
})
|
157
|
-
.catch(reason => {
|
158
|
-
reject(reason);
|
159
|
-
});
|
160
|
-
});
|
150
|
+
async loadAppMessages() {
|
151
|
+
const messagesUrl = await this._application.getApplicationPath();
|
152
|
+
const module = await import(/* webpackIgnore: true */ `${messagesUrl}/messages/appmessages.js`);
|
153
|
+
return module.default;
|
161
154
|
}
|
162
155
|
}
|
163
156
|
export var OperationMap;
|
@@ -10,6 +10,7 @@ export const snkDataExporterMessages = {
|
|
10
10
|
},
|
11
11
|
label: {
|
12
12
|
currentPage: "Somente a página atual",
|
13
|
+
allRecords: "Todos os registros",
|
13
14
|
spreadsheet: "Planilha",
|
14
15
|
cube: "Cubo",
|
15
16
|
sendByEmail: "Enviar por email",
|
@@ -22,6 +23,7 @@ export const snkDataExporterMessages = {
|
|
22
23
|
},
|
23
24
|
title: {
|
24
25
|
error: "Erro",
|
26
|
+
permission: "Falha detectada",
|
25
27
|
},
|
26
28
|
limitExceeded: {
|
27
29
|
title: "Atenção",
|
@@ -6,7 +6,7 @@ const snkDataUnitMessages = {
|
|
6
6
|
},
|
7
7
|
cancelInfo: {
|
8
8
|
clone: "Duplicação descartada!",
|
9
|
-
insert: "A inclusão descartada!",
|
9
|
+
insert: "A inclusão foi descartada!",
|
10
10
|
update: "A edição foi descartada!"
|
11
11
|
},
|
12
12
|
confirm: {
|
@@ -27,5 +27,6 @@ const snkDataUnitMessages = {
|
|
27
27
|
forbiddenRemove: "Não é possível remover. Verifique as permissões de acesso.",
|
28
28
|
removeAllConfirmation: "Os <strong>{{size}} registros selecionados</strong> serão excluídos.<br/><br/><strong>Você realmente gostaria de continuar?</strong>",
|
29
29
|
removeAllInfo: "Os {{size}} registros foram removidos com sucesso!",
|
30
|
+
fieldNameRequired: "É necessário informar o nome da coluna."
|
30
31
|
};
|
31
32
|
export default snkDataUnitMessages;
|
@@ -423,6 +423,7 @@ class ConfigStorage {
|
|
423
423
|
if (config == undefined) {
|
424
424
|
return;
|
425
425
|
}
|
426
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
426
427
|
await this.deleteGridConfigCache(name, resourceID);
|
427
428
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
428
429
|
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { D as DataFetcher } from './DataFetcher.js';
|
2
|
-
import
|
3
|
-
import { SortMode, ApplicationContext, UserInterface, DateUtils } from '@sankhyalabs/core';
|
4
|
-
import './
|
5
|
-
import './snk-actions-button2.js';
|
2
|
+
import './pesquisa-fetcher.js';
|
3
|
+
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, NumberUtils, DataType } from '@sankhyalabs/core';
|
4
|
+
import './ISave.js';
|
6
5
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
7
|
-
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
6
|
+
import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
7
|
+
import { P as PreloadManager } from './dataunit-fetcher.js';
|
8
8
|
import './filter-item-type.enum.js';
|
9
9
|
import './form-config-fetcher.js';
|
10
10
|
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
@@ -208,4 +208,91 @@ const openFieldSearch = async (moreOptions, field) => {
|
|
208
208
|
await moreOptions.showActions();
|
209
209
|
};
|
210
210
|
|
211
|
-
|
211
|
+
class RmPrecisionCustomValueFormatter {
|
212
|
+
setGrid(grid) {
|
213
|
+
if (this._grid) {
|
214
|
+
return;
|
215
|
+
}
|
216
|
+
this._grid = grid;
|
217
|
+
this.refreshSelectedRows();
|
218
|
+
}
|
219
|
+
setDataState(dataState) {
|
220
|
+
if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
|
221
|
+
return;
|
222
|
+
}
|
223
|
+
this._dataState = dataState;
|
224
|
+
this.refreshSelectedRows();
|
225
|
+
}
|
226
|
+
format(currentValue, column, recordId) {
|
227
|
+
var _a;
|
228
|
+
if (!currentValue) {
|
229
|
+
return currentValue;
|
230
|
+
}
|
231
|
+
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
232
|
+
const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
|
233
|
+
if (rmPrecision || rmPrecision === 0) {
|
234
|
+
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
235
|
+
}
|
236
|
+
else {
|
237
|
+
return currentValue;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
refreshSelectedRows() {
|
241
|
+
var _a;
|
242
|
+
(_a = this._grid) === null || _a === void 0 ? void 0 : _a.refreshSelectedRows();
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
class CommonsExporter {
|
247
|
+
constructor(dataUnit, grid) {
|
248
|
+
this.dataUnit = dataUnit;
|
249
|
+
this.grid = grid;
|
250
|
+
}
|
251
|
+
async getColumnsMetadata() {
|
252
|
+
var _a;
|
253
|
+
this.columnsState = await ((_a = this.grid) === null || _a === void 0 ? void 0 : _a.getColumnsState()) || [];
|
254
|
+
return await this.buildColumnsMetadata(this.columnsState);
|
255
|
+
}
|
256
|
+
getColumnsState() {
|
257
|
+
return this.columnsState;
|
258
|
+
}
|
259
|
+
async buildColumnsMetadata(gridColumns) {
|
260
|
+
var _a, _b;
|
261
|
+
const columnsMetadata = [];
|
262
|
+
for (const column of gridColumns) {
|
263
|
+
/**
|
264
|
+
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
265
|
+
*/
|
266
|
+
if (column.hidden && column.name !== "RECDESP") {
|
267
|
+
continue;
|
268
|
+
}
|
269
|
+
const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
270
|
+
const customFormatter = await this.grid.getCustomValueFormatter(column.name);
|
271
|
+
const columnData = {
|
272
|
+
label: column.label,
|
273
|
+
id: column.name,
|
274
|
+
width: column.width,
|
275
|
+
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
276
|
+
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
277
|
+
customFormatter
|
278
|
+
};
|
279
|
+
columnsMetadata.push(columnData);
|
280
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
281
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
282
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
283
|
+
const descriptionColumn = {
|
284
|
+
label: fieldData.properties.DESCRIPTIONENTITY,
|
285
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
286
|
+
width: column.width,
|
287
|
+
type: DataType.TEXT,
|
288
|
+
userInterface: UserInterface$1.LONGTEXT,
|
289
|
+
descriptionFrom: fieldData.name
|
290
|
+
};
|
291
|
+
columnsMetadata.push(descriptionColumn);
|
292
|
+
}
|
293
|
+
}
|
294
|
+
return columnsMetadata || [];
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
export { CommonsExporter as C, RmPrecisionCustomValueFormatter as R, SnkMultiSelectionListDataSource as S, TaskbarProcessor as T, CrudUtils as a, buildFieldSearch as b, openFieldSearch as o };
|
@@ -0,0 +1,47 @@
|
|
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 };
|
@@ -72,11 +72,12 @@ class SnkFormConfigManager {
|
|
72
72
|
var _a;
|
73
73
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
74
74
|
if (fields != undefined && fields.length > 0) {
|
75
|
-
return fields.map(({ label, name, readOnly }) => {
|
75
|
+
return fields.map(({ label, name, readOnly, visible, required }) => {
|
76
76
|
if (label == undefined) {
|
77
|
-
|
77
|
+
const currentField = dataUnit.getField(name);
|
78
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required });
|
78
79
|
}
|
79
|
-
return { name, label, readOnly };
|
80
|
+
return { name, label, readOnly, visible, required };
|
80
81
|
})
|
81
82
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
82
83
|
}
|
@@ -98,7 +99,7 @@ class SnkFormConfigManager {
|
|
98
99
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
99
100
|
return normalizedText.includes(normalizedFilter);
|
100
101
|
}
|
101
|
-
|
102
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
|
102
103
|
let fields = this.getFieldsList(dataUnit);
|
103
104
|
if (ignoreReadOnlyFormFields) {
|
104
105
|
fields = fields.filter(field => {
|
@@ -130,8 +131,8 @@ class SnkFormConfigManager {
|
|
130
131
|
this._onConfigChange(Object.assign({}, this._config));
|
131
132
|
}
|
132
133
|
}
|
133
|
-
getConfig(
|
134
|
-
return
|
134
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
135
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
|
135
136
|
}
|
136
137
|
getFormConfigFetcher() {
|
137
138
|
if (this._formConfigFetcher == undefined) {
|