@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
@@ -0,0 +1,41 @@
|
|
1
|
+
import { JSUtils, DataType } from '@sankhyalabs/core';
|
2
|
+
|
3
|
+
const getSelectedIDs = (dataUnit) => {
|
4
|
+
const selectionInfo = dataUnit.getSelectionInfo();
|
5
|
+
if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
|
6
|
+
return [];
|
7
|
+
}
|
8
|
+
const selectedRecordsIDsInfo = [];
|
9
|
+
const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.recordIds;
|
10
|
+
if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
|
11
|
+
selectedRecords.forEach(recordId => {
|
12
|
+
if (!dataUnit.isNewRecord(recordId)) {
|
13
|
+
/*
|
14
|
+
Esse if foi necessário para tratar corretamente o ID
|
15
|
+
do record quando está sendo utilizado no modo standAlone
|
16
|
+
isso não faz a exportação da grid funcionar no modo standAlone
|
17
|
+
mas deixa de causar erro nas oprações de CRUD.
|
18
|
+
*/
|
19
|
+
if (!JSUtils.isBase64(recordId)) {
|
20
|
+
selectedRecordsIDsInfo.push({
|
21
|
+
name: "__record__id__",
|
22
|
+
type: DataType.TEXT,
|
23
|
+
value: recordId
|
24
|
+
});
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
const revertBase64ToObject = JSON.parse(window.atob(recordId));
|
28
|
+
Object.entries(revertBase64ToObject).forEach(([name, value]) => {
|
29
|
+
const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
|
30
|
+
if (metadataField == undefined) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
|
34
|
+
});
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
return selectedRecordsIDsInfo;
|
39
|
+
};
|
40
|
+
|
41
|
+
export { getSelectedIDs as g };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
|
4
4
|
|
@@ -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) {
|
@@ -8,7 +8,7 @@ const snkDataUnitMessages = {
|
|
8
8
|
},
|
9
9
|
cancelInfo: {
|
10
10
|
clone: "Duplicação descartada!",
|
11
|
-
insert: "A inclusão descartada!",
|
11
|
+
insert: "A inclusão foi descartada!",
|
12
12
|
update: "A edição foi descartada!"
|
13
13
|
},
|
14
14
|
confirm: {
|
@@ -29,6 +29,7 @@ const snkDataUnitMessages = {
|
|
29
29
|
forbiddenRemove: "Não é possível remover. Verifique as permissões de acesso.",
|
30
30
|
removeAllConfirmation: "Os <strong>{{size}} registros selecionados</strong> serão excluídos.<br/><br/><strong>Você realmente gostaria de continuar?</strong>",
|
31
31
|
removeAllInfo: "Os {{size}} registros foram removidos com sucesso!",
|
32
|
+
fieldNameRequired: "É necessário informar o nome da coluna."
|
32
33
|
};
|
33
34
|
|
34
35
|
const snkFilterBarMessages = {
|
@@ -284,6 +285,7 @@ const snkDataExporterMessages = {
|
|
284
285
|
},
|
285
286
|
label: {
|
286
287
|
currentPage: "Somente a página atual",
|
288
|
+
allRecords: "Todos os registros",
|
287
289
|
spreadsheet: "Planilha",
|
288
290
|
cube: "Cubo",
|
289
291
|
sendByEmail: "Enviar por email",
|
@@ -296,6 +298,7 @@ const snkDataExporterMessages = {
|
|
296
298
|
},
|
297
299
|
title: {
|
298
300
|
error: "Erro",
|
301
|
+
permission: "Falha detectada",
|
299
302
|
},
|
300
303
|
limitExceeded: {
|
301
304
|
title: "Atenção",
|
@@ -552,7 +555,7 @@ class SnkMessageBuilder {
|
|
552
555
|
this.loadAppMessages().then((msgs) => {
|
553
556
|
this._appMessages = msgs;
|
554
557
|
}, error => {
|
555
|
-
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages
|
558
|
+
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
|
556
559
|
});
|
557
560
|
}
|
558
561
|
/**
|
@@ -644,17 +647,10 @@ class SnkMessageBuilder {
|
|
644
647
|
return message;
|
645
648
|
}
|
646
649
|
}
|
647
|
-
loadAppMessages() {
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
.then(module => {
|
652
|
-
accept(module.default);
|
653
|
-
})
|
654
|
-
.catch(reason => {
|
655
|
-
reject(reason);
|
656
|
-
});
|
657
|
-
});
|
650
|
+
async loadAppMessages() {
|
651
|
+
const messagesUrl = await this._application.getApplicationPath();
|
652
|
+
const module = await import(/* webpackIgnore: true */ `${messagesUrl}/messages/appmessages.js`);
|
653
|
+
return module.default;
|
658
654
|
}
|
659
655
|
}
|
660
656
|
var OperationMap;
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { ObjectUtils, DataUnit, DataType, DateUtils, StringUtils, ChangeOperation, ApplicationContext, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
2
2
|
import { D as DataFetcher, d as dist } from './DataFetcher-c1baf61d.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
5
5
|
import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
6
|
+
import SortingUtils from '@sankhyalabs/core/dist/utils/SortingUtils';
|
6
7
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
7
8
|
|
8
9
|
class ArrayRepository {
|
@@ -84,6 +85,9 @@ class ArrayRepository {
|
|
84
85
|
async count() {
|
85
86
|
return Promise.resolve(this._list.length);
|
86
87
|
}
|
88
|
+
getFromCache() {
|
89
|
+
return ObjectUtils.copy(this._list);
|
90
|
+
}
|
87
91
|
}
|
88
92
|
|
89
93
|
class PreloadManager {
|
@@ -105,17 +109,7 @@ class PreloadManager {
|
|
105
109
|
}
|
106
110
|
}
|
107
111
|
static getSortingFunction(dataUnit, sorting) {
|
108
|
-
|
109
|
-
return undefined;
|
110
|
-
}
|
111
|
-
return (recordA, recordB) => {
|
112
|
-
for (const sort of sorting) {
|
113
|
-
const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
|
114
|
-
if (result != 0) {
|
115
|
-
return result;
|
116
|
-
}
|
117
|
-
}
|
118
|
-
};
|
112
|
+
return SortingUtils.getSortingFunction(dataUnit, sorting);
|
119
113
|
}
|
120
114
|
static async getDistinct(dataUnit, fieldName) {
|
121
115
|
if (!PreloadManager.isCacheEnabled(dataUnit)) {
|
@@ -152,7 +146,11 @@ class PreloadManager {
|
|
152
146
|
static async loadData(dataUnit, request, loadFromServer) {
|
153
147
|
try {
|
154
148
|
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
155
|
-
|
149
|
+
const useCache = [
|
150
|
+
"EZ_GRID_LOADING_SOURCE",
|
151
|
+
DataUnit.CHANGING_PAGE_LOADING_SOURCE,
|
152
|
+
DataUnit.ALL_RECORDS_SELECTION_SOURCE
|
153
|
+
].includes(request.source);
|
156
154
|
if (useCache) {
|
157
155
|
const isCacheEmpty = await PreloadManager.getRepository(dataUnit).isEmpty();
|
158
156
|
if (!isCacheEmpty) {
|
@@ -219,6 +217,9 @@ class PreloadManager {
|
|
219
217
|
.catch(reason => reject(reason));
|
220
218
|
});
|
221
219
|
}
|
220
|
+
static getCachedRecords(dataUnit) {
|
221
|
+
return PreloadManager.getRepository(dataUnit).getFromCache();
|
222
|
+
}
|
222
223
|
}
|
223
224
|
PreloadManager._repositories = new Map();
|
224
225
|
PreloadManager._loadingStatus = new Map();
|
@@ -260,7 +261,7 @@ function buildPaginationInfo(records, offset = 0, limit = 0) {
|
|
260
261
|
}
|
261
262
|
|
262
263
|
class InMemoryLoader {
|
263
|
-
constructor(metadata, records) {
|
264
|
+
constructor(metadata, records, config) {
|
264
265
|
this.metadata = metadata;
|
265
266
|
this.records = records;
|
266
267
|
this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
@@ -269,7 +270,11 @@ class InMemoryLoader {
|
|
269
270
|
this._dataUnit.dataLoader = (dataUnit, request) => this.inMemoryLoader(dataUnit, request, this.getRecordsToLoad());
|
270
271
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
271
272
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
272
|
-
this.dataUnit.loadMetadata().then(() =>
|
273
|
+
this.dataUnit.loadMetadata().then(() => {
|
274
|
+
if ((config === null || config === void 0 ? void 0 : config.autoLoad) !== false) {
|
275
|
+
this.dataUnit.loadData();
|
276
|
+
}
|
277
|
+
});
|
273
278
|
}
|
274
279
|
getRecordsToLoad() {
|
275
280
|
if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
|
@@ -321,7 +326,7 @@ class InMemoryLoader {
|
|
321
326
|
this._initialRecords = newRecords;
|
322
327
|
if (this._dataUnit) {
|
323
328
|
//Isso força o refresh internamente no datunit
|
324
|
-
this._dataUnit.
|
329
|
+
this._dataUnit.loadData();
|
325
330
|
}
|
326
331
|
}
|
327
332
|
get metadata() {
|
@@ -373,11 +378,17 @@ class InMemoryLoader {
|
|
373
378
|
}
|
374
379
|
InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
|
375
380
|
|
381
|
+
function getRecordValue(record, fieldName) {
|
382
|
+
var _a, _b;
|
383
|
+
return ((_a = record[fieldName]) === null || _a === void 0 ? void 0 : _a.value) !== undefined ? (_b = record[fieldName]) === null || _b === void 0 ? void 0 : _b.value : record[fieldName];
|
384
|
+
}
|
385
|
+
|
376
386
|
class DatasetStrategy {
|
377
387
|
canSlice() {
|
378
388
|
return false;
|
379
389
|
}
|
380
390
|
processSortingSide(request, dataUnit, serverSideFilters) {
|
391
|
+
var _a;
|
381
392
|
const localSorting = [];
|
382
393
|
const serverSorting = [];
|
383
394
|
if (request.sort != undefined) {
|
@@ -386,9 +397,7 @@ class DatasetStrategy {
|
|
386
397
|
}
|
387
398
|
for (const sort of request.sort) {
|
388
399
|
const descriptor = dataUnit.getField(sort.field);
|
389
|
-
const local = descriptor
|
390
|
-
&& descriptor.properties != undefined
|
391
|
-
&& descriptor.properties.calculated === "true";
|
400
|
+
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;
|
392
401
|
if (local) {
|
393
402
|
localSorting.push(sort);
|
394
403
|
}
|
@@ -428,6 +437,53 @@ class DatasetStrategy {
|
|
428
437
|
return Promise.reject(error);
|
429
438
|
}
|
430
439
|
}
|
440
|
+
async loadRowMetadata(snkDataUnit, fieldName, metadataName, updatedFields = {}) {
|
441
|
+
try {
|
442
|
+
const serviceName = "DatasetSP.loadRowMetadata";
|
443
|
+
const parsedRequestBody = await this.buildRequestBodyLoadRowMetadata({ snkDataUnit, fieldName, metadataName, serviceName, updatedFields });
|
444
|
+
const response = await DataFetcher.get().callServiceBroker(serviceName, parsedRequestBody);
|
445
|
+
return response;
|
446
|
+
}
|
447
|
+
catch (error) {
|
448
|
+
console.error(error);
|
449
|
+
return Promise.reject(error);
|
450
|
+
}
|
451
|
+
}
|
452
|
+
async buildRequestBodyLoadRowMetadata({ snkDataUnit, serviceName, fieldName, metadataName, updatedFields, }) {
|
453
|
+
const dataUnit = snkDataUnit.dataUnit;
|
454
|
+
const entityName = DataUnitFetcher.parseDataUnitName(dataUnit.name).entityName;
|
455
|
+
const recordIdInfo = await snkDataUnit.getSelectedRecordsIDsInfo();
|
456
|
+
const pk = recordIdInfo.reduce((accumulator, currentValue) => {
|
457
|
+
accumulator[currentValue.name] = currentValue.value;
|
458
|
+
return accumulator;
|
459
|
+
}, {});
|
460
|
+
const record = dataUnit.getSelectedRecord();
|
461
|
+
const fields = dataUnit.metadata.fields.filter(({ standAlone, name }) => !standAlone && !name.includes(".")).map(({ name }) => name);
|
462
|
+
const values = fields.reduce((accumulator, currentValue, currentIndex) => {
|
463
|
+
const recordValue = getRecordValue(record, currentValue);
|
464
|
+
const updatedFieldValue = getRecordValue(updatedFields, currentValue);
|
465
|
+
accumulator[currentIndex] = updatedFieldValue !== undefined ? updatedFieldValue : recordValue;
|
466
|
+
return accumulator;
|
467
|
+
}, {});
|
468
|
+
const requestBody = {
|
469
|
+
serviceName,
|
470
|
+
requestBody: {
|
471
|
+
dataSetID: dataUnit.dataUnitId,
|
472
|
+
entityName,
|
473
|
+
standAlone: false,
|
474
|
+
metadataName,
|
475
|
+
fieldName,
|
476
|
+
fields,
|
477
|
+
record: {
|
478
|
+
pk,
|
479
|
+
oldPk: pk,
|
480
|
+
values,
|
481
|
+
},
|
482
|
+
}
|
483
|
+
};
|
484
|
+
const parsedRequestBody = JSON.stringify(requestBody);
|
485
|
+
return parsedRequestBody;
|
486
|
+
}
|
431
487
|
getFieldsList(dataUnit) {
|
432
488
|
let fields = ["__record__id__", "__record__label__"];
|
433
489
|
dataUnit.metadata.fields.forEach((descriptor) => {
|
@@ -507,9 +563,11 @@ class DatasetStrategy {
|
|
507
563
|
}
|
508
564
|
processRecords(dataUnit, fields, responseRecords) {
|
509
565
|
return responseRecords.map((dataFrame) => {
|
566
|
+
const lastElement = dataFrame[dataFrame.length - 1];
|
510
567
|
const duRecord = {
|
511
568
|
__record__id__: dataFrame[0],
|
512
|
-
__record__label__: dataFrame[1]
|
569
|
+
__record__label__: dataFrame[1],
|
570
|
+
__record__metadata__: lastElement['_rmd'],
|
513
571
|
};
|
514
572
|
dataUnit.metadata.fields.forEach(fieldDescriptor => {
|
515
573
|
duRecord[fieldDescriptor.name] = this.buildFieldValue(fieldDescriptor, fields, dataFrame);
|
@@ -572,6 +630,9 @@ class DataUnitDataLoader {
|
|
572
630
|
});
|
573
631
|
});
|
574
632
|
}
|
633
|
+
static getCachedRecords(dataUnit) {
|
634
|
+
return PreloadManager.getCachedRecords(dataUnit);
|
635
|
+
}
|
575
636
|
static async loadFromServer(dataUnit, request, loadingInfo) {
|
576
637
|
try {
|
577
638
|
//Registramos a request com as informações de carga para determinarmos a última.
|
@@ -772,6 +833,7 @@ class DataUnitFetcher {
|
|
772
833
|
dataUnit.saveLoader = (_dataUnit, changes) => this.saveData(dataUnit, changes);
|
773
834
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
774
835
|
dataUnit.recordLoader = (dataUnit, recordIds) => this.loadRecord(dataUnit, recordIds);
|
836
|
+
dataUnit.allRecordsLoader = (dataUnit) => DataUnitDataLoader.getCachedRecords(dataUnit);
|
775
837
|
return dataUnit;
|
776
838
|
}
|
777
839
|
loadMetadata(dataUnit) {
|
@@ -990,164 +1052,4 @@ class DataUnitFetcher {
|
|
990
1052
|
}
|
991
1053
|
}
|
992
1054
|
|
993
|
-
|
994
|
-
constructor() {
|
995
|
-
this._defaultPageSize = 100;
|
996
|
-
this._templateByQuery = new Map();
|
997
|
-
this._searchListenersByDataUnit = new Map();
|
998
|
-
this.buldTemplates();
|
999
|
-
}
|
1000
|
-
buldTemplates() {
|
1001
|
-
this._templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
1002
|
-
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
1003
|
-
value
|
1004
|
-
label
|
1005
|
-
}
|
1006
|
-
}`);
|
1007
|
-
}
|
1008
|
-
loadSearchOptions(entityName, argument, criteria, options) {
|
1009
|
-
var _a;
|
1010
|
-
const cleanText = (argument === null || argument === void 0 ? void 0 : argument.toString().trim()) || undefined;
|
1011
|
-
argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
|
1012
|
-
criteria === null || criteria === void 0 ? void 0 : criteria.params.forEach(param => {
|
1013
|
-
if (param.dataType === DataType.OBJECT) {
|
1014
|
-
param.value = JSON.stringify(param.value);
|
1015
|
-
}
|
1016
|
-
});
|
1017
|
-
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, options);
|
1018
|
-
const values = {
|
1019
|
-
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
1020
|
-
entityName,
|
1021
|
-
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
1022
|
-
options: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || options,
|
1023
|
-
};
|
1024
|
-
if (values.options) {
|
1025
|
-
(_a = values.options) === null || _a === void 0 ? true : delete _a.dataUnitId;
|
1026
|
-
}
|
1027
|
-
return new Promise((resolve, reject) => {
|
1028
|
-
DataFetcher.get()
|
1029
|
-
.callGraphQL({
|
1030
|
-
values,
|
1031
|
-
query: this._templateByQuery.get("search"),
|
1032
|
-
})
|
1033
|
-
.then((result) => {
|
1034
|
-
resolve(result);
|
1035
|
-
})
|
1036
|
-
.catch((error) => {
|
1037
|
-
reject(error);
|
1038
|
-
});
|
1039
|
-
});
|
1040
|
-
}
|
1041
|
-
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
1042
|
-
var _a, _b, _c, _d;
|
1043
|
-
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
1044
|
-
const values = {
|
1045
|
-
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
1046
|
-
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
1047
|
-
searchOptions: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || searchOptions,
|
1048
|
-
};
|
1049
|
-
const serviceName = "PesquisaSP.getSuggestion";
|
1050
|
-
const externalCriteria = {
|
1051
|
-
query: {
|
1052
|
-
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
1053
|
-
}
|
1054
|
-
};
|
1055
|
-
if (((_c = (_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
1056
|
-
externalCriteria.params = {
|
1057
|
-
param: values.criteria.params.map(param => {
|
1058
|
-
let value = param.value;
|
1059
|
-
if (typeof value === "string") {
|
1060
|
-
const match = /CTX\{([^}]+)\}/.exec(value);
|
1061
|
-
if (match) {
|
1062
|
-
value = ApplicationContext.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${match[1]})__`);
|
1063
|
-
}
|
1064
|
-
}
|
1065
|
-
let type = param.dataType;
|
1066
|
-
if (type === DataType.OBJECT) {
|
1067
|
-
value = value.value;
|
1068
|
-
type = "S";
|
1069
|
-
}
|
1070
|
-
else {
|
1071
|
-
type = convertParamType(param.dataType);
|
1072
|
-
}
|
1073
|
-
return { $: value, type };
|
1074
|
-
})
|
1075
|
-
};
|
1076
|
-
}
|
1077
|
-
const options = searchOptions != undefined
|
1078
|
-
? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
1079
|
-
const reqBody = {
|
1080
|
-
"serviceName": serviceName,
|
1081
|
-
"requestBody": {
|
1082
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_d = values.searchOptions) === null || _d === void 0 ? void 0 : _d.rootEntity }, { options }),
|
1083
|
-
"clientEventList": {
|
1084
|
-
"clientEvent": []
|
1085
|
-
}
|
1086
|
-
}
|
1087
|
-
};
|
1088
|
-
return new Promise((resolve, reject) => {
|
1089
|
-
DataFetcher.get()
|
1090
|
-
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
|
1091
|
-
.then(result => resolve(result))
|
1092
|
-
.catch(error => reject(error));
|
1093
|
-
});
|
1094
|
-
}
|
1095
|
-
addSearchListener(entityName, dataUnitID, listener) {
|
1096
|
-
var _a;
|
1097
|
-
const dataUnitSearchListeners = this._searchListenersByDataUnit.get(dataUnitID) || [];
|
1098
|
-
const entityListener = dataUnitSearchListeners.find(currentListener => currentListener.entity === entityName);
|
1099
|
-
if (!entityListener) {
|
1100
|
-
this._searchListenersByDataUnit.set(dataUnitID, [...dataUnitSearchListeners, { entity: entityName, listener }]);
|
1101
|
-
}
|
1102
|
-
else {
|
1103
|
-
for (const type of Object.keys(listener)) {
|
1104
|
-
if (type in entityListener.listener) {
|
1105
|
-
const listenerFunctionIsEquals = ((_a = entityListener.listener[type]) === null || _a === void 0 ? void 0 : _a.toString()) === listener[type].toString();
|
1106
|
-
if (listenerFunctionIsEquals)
|
1107
|
-
continue;
|
1108
|
-
entityListener.listener[type] = listener[type];
|
1109
|
-
}
|
1110
|
-
}
|
1111
|
-
}
|
1112
|
-
return () => {
|
1113
|
-
const newListeners = dataUnitSearchListeners.filter(currentListener => currentListener.entity !== entityName);
|
1114
|
-
if (!newListeners.length) {
|
1115
|
-
this._searchListenersByDataUnit.delete(dataUnitID);
|
1116
|
-
return;
|
1117
|
-
}
|
1118
|
-
this._searchListenersByDataUnit.set(dataUnitID, newListeners);
|
1119
|
-
};
|
1120
|
-
}
|
1121
|
-
applySearchListener(listenerType, entityName, argument, criteria, searchOptions) {
|
1122
|
-
var _a;
|
1123
|
-
const dataUnitId = searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.dataUnitId;
|
1124
|
-
if (!dataUnitId)
|
1125
|
-
return;
|
1126
|
-
const entityListener = (_a = this._searchListenersByDataUnit.get(dataUnitId)) === null || _a === void 0 ? void 0 : _a.find(({ entity }) => entity === entityName);
|
1127
|
-
if (!entityListener)
|
1128
|
-
return;
|
1129
|
-
const { listener } = entityListener;
|
1130
|
-
if (!(listenerType in listener))
|
1131
|
-
return;
|
1132
|
-
return listener[listenerType]({ argument, criteria, searchOptions });
|
1133
|
-
}
|
1134
|
-
}
|
1135
|
-
function convertParamType(dataType) {
|
1136
|
-
//Alerta: Cuidado pra não contaminar o DataType com a implementação
|
1137
|
-
//atual da pesquisa... em geral, somente inteiros,
|
1138
|
-
//data (com ou sem hora) e string são realmente relevantes
|
1139
|
-
switch (dataType) {
|
1140
|
-
case DataType.NUMBER:
|
1141
|
-
return "I";
|
1142
|
-
case DataType.DATE:
|
1143
|
-
return "D";
|
1144
|
-
default:
|
1145
|
-
return "S";
|
1146
|
-
}
|
1147
|
-
}
|
1148
|
-
var SearchListenerType;
|
1149
|
-
(function (SearchListenerType) {
|
1150
|
-
SearchListenerType["beforeSearch"] = "beforeSearch";
|
1151
|
-
})(SearchListenerType || (SearchListenerType = {}));
|
1152
|
-
|
1153
|
-
export { DataUnitFetcher as D, InMemoryLoader as I, PesquisaFetcher as P, PreloadManager as a, applyFilter as b, applySorting as c, buildPaginationInfo as d };
|
1055
|
+
export { DataUnitFetcher as D, InMemoryLoader as I, PreloadManager as P, DatasetStrategy as a, applyFilter as b, applySorting as c, buildPaginationInfo as d, getRecordValue as g };
|
@@ -9,8 +9,11 @@ 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,8 +30,10 @@ 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 = {}));
|
33
38
|
|
34
|
-
export { DataExporterOption as D, PresentationMode as P,
|
39
|
+
export { DataExporterOption as D, PresentationMode as P, DataExporterType as a, DataExporterFormat as b };
|