@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-50122.0 → 0.0.0-bugfix-dev-KB-53946.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-8d4e9d53.js → ConfigStorage-085c7117.js} +11 -12
- package/dist/cjs/{SnkMultiSelectionListDataSource-1438f8f2.js → IExporterProvider-f50b6846.js} +52 -5
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-33995e92.js → SnkFormConfigManager-8986431f.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-141aa18d.js → SnkMessageBuilder-66aa2557.js} +4 -0
- package/dist/cjs/{auth-fetcher-bb8e9ae4.js → auth-fetcher-eddaf17f.js} +1 -1
- package/dist/cjs/{DataFetcher-99f0f6ed.js → form-config-fetcher-cdd644a7.js} +251 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-94f6b316.js → pesquisa-fetcher-90b801fb.js} +79 -55
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +9 -9
- package/dist/cjs/snk-application.cjs.entry.js +24 -24
- package/dist/cjs/snk-attach.cjs.entry.js +73 -52
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +199 -81
- package/dist/cjs/{snk-data-unit-6026a9f7.js → snk-data-unit-abd2113f.js} +3 -38
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
- package/dist/cjs/snk-filter-bar.cjs.entry.js +23 -7
- package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +10 -6
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -2
- package/dist/cjs/snk-form.cjs.entry.js +3 -4
- package/dist/cjs/snk-grid.cjs.entry.js +66 -102
- package/dist/cjs/{snk-guides-viewer-25721856.js → snk-guides-viewer-e4c8ee66.js} +4 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +144 -36
- package/dist/cjs/snk-taskbar.cjs.entry.js +3 -2
- package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-d9392685.js} +2 -2
- package/dist/collection/components/snk-attach/snk-attach.js +39 -24
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +29 -22
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +90 -0
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +48 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +53 -0
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +37 -47
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -42
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +20 -3
- package/dist/collection/components/snk-grid/snk-grid.js +3 -94
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +126 -14
- 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/dataUnit/InMemoryLoader.js +10 -41
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -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 +10 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
- package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
- package/dist/components/ConfigStorage.js +1 -2
- package/dist/components/{field-search.js → IExporterProvider.js} +52 -7
- package/dist/components/ISave.js +42 -0
- package/dist/components/SnkMessageBuilder.js +4 -0
- package/dist/components/dataunit-fetcher.js +61 -44
- package/dist/components/form-config-fetcher.js +7022 -3
- package/dist/components/index2.js +198 -33
- package/dist/components/snk-actions-button2.js +3 -12
- package/dist/components/snk-application2.js +1 -1
- package/dist/components/snk-attach2.js +64 -44
- package/dist/components/snk-crud.js +3 -4
- package/dist/components/snk-data-exporter2.js +194 -81
- package/dist/components/snk-data-unit2.js +41 -39
- package/dist/components/snk-detail-view2.js +4 -5
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +21 -4
- package/dist/components/snk-filter-detail2.js +5 -1
- package/dist/components/snk-filter-item2.js +11 -6
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-grid2.js +63 -100
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +133 -23
- package/dist/components/snk-taskbar2.js +6 -5
- package/dist/esm/{ConfigStorage-6e241cd7.js → ConfigStorage-cc3f3dd3.js} +1 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-aad5d4ff.js → IExporterProvider-9e6e0071.js} +52 -6
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-7a4e678f.js → SnkFormConfigManager-7edda7eb.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-9747ddd2.js → SnkMessageBuilder-0a4becdd.js} +4 -0
- package/dist/esm/{auth-fetcher-8ec448b0.js → auth-fetcher-11dd9cae.js} +1 -1
- package/dist/esm/{DataFetcher-a650ae58.js → form-config-fetcher-13cd3285.js} +250 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-f05a12ca.js → pesquisa-fetcher-d785663b.js} +61 -44
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +4 -4
- package/dist/esm/snk-application.entry.js +6 -6
- package/dist/esm/snk-attach.entry.js +65 -44
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +199 -81
- package/dist/esm/{snk-data-unit-4c343635.js → snk-data-unit-29eba11a.js} +4 -39
- package/dist/esm/snk-data-unit.entry.js +3 -2
- package/dist/esm/snk-detail-view.entry.js +8 -8
- package/dist/esm/snk-filter-bar.entry.js +23 -7
- package/dist/esm/snk-filter-detail.entry.js +4 -1
- package/dist/esm/snk-filter-item.entry.js +10 -6
- package/dist/esm/snk-filter-modal-item.entry.js +2 -3
- package/dist/esm/snk-form-config.entry.js +1 -2
- package/dist/esm/snk-form.entry.js +3 -4
- package/dist/esm/snk-grid.entry.js +64 -100
- package/dist/esm/{snk-guides-viewer-b94752f2.js → snk-guides-viewer-8fc16590.js} +4 -5
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +2 -3
- package/dist/esm/snk-simple-crud.entry.js +132 -24
- package/dist/esm/snk-taskbar.entry.js +3 -2
- package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-ad766858.js} +2 -2
- package/dist/sankhyablocks/p-07825198.js +1 -0
- package/dist/sankhyablocks/p-0ba97458.js +65 -0
- package/dist/sankhyablocks/p-1650f66b.entry.js +1 -0
- package/dist/sankhyablocks/p-1d1aa052.js +1 -0
- package/dist/sankhyablocks/p-1d9d07b4.entry.js +1 -0
- package/dist/sankhyablocks/p-250149af.entry.js +1 -0
- package/dist/sankhyablocks/p-2cfa05b0.entry.js +1 -0
- package/dist/sankhyablocks/{p-400097f2.entry.js → p-2daa70f9.entry.js} +3 -3
- package/dist/sankhyablocks/p-32556aa6.js +1 -0
- package/dist/sankhyablocks/p-33a6728e.js +26 -0
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-5b6c4f46.entry.js +1 -0
- package/dist/sankhyablocks/p-5d9456dc.js +1 -0
- package/dist/sankhyablocks/{p-0624f62d.js → p-8a4c4b54.js} +6 -6
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/{p-125bb902.js → p-99b51d06.js} +1 -1
- package/dist/sankhyablocks/p-9c283890.entry.js +1 -0
- package/dist/sankhyablocks/p-9ee96756.entry.js +1 -0
- package/dist/sankhyablocks/p-a4c94582.entry.js +1 -0
- package/dist/sankhyablocks/p-c2e3a71c.entry.js +1 -0
- package/dist/sankhyablocks/p-c2f3ebf3.entry.js +1 -0
- package/dist/sankhyablocks/p-ce37e3d3.entry.js +1 -0
- package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
- package/dist/sankhyablocks/{p-efeca7ba.js → p-d24c9dc6.js} +1 -1
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/p-edd9dd1c.entry.js +1 -0
- package/dist/sankhyablocks/p-f51af6dd.entry.js +1 -0
- package/dist/sankhyablocks/p-fa84e72f.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +2 -1
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +10 -1
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +5 -4
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +21 -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 +3 -1
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +6 -2
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +3 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -3
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +17 -2
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +33 -0
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -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/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/form-config-fetcher-d73f4449.js +0 -256
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
- package/dist/components/DataFetcher.js +0 -7023
- package/dist/components/index3.js +0 -199
- package/dist/esm/form-config-fetcher-765b8498.js +0 -253
- package/dist/sankhyablocks/p-004c356e.js +0 -26
- package/dist/sankhyablocks/p-0bba5c9f.entry.js +0 -1
- package/dist/sankhyablocks/p-1048bd26.entry.js +0 -1
- package/dist/sankhyablocks/p-20b46647.entry.js +0 -1
- package/dist/sankhyablocks/p-24ed6ad6.entry.js +0 -1
- package/dist/sankhyablocks/p-2936303b.js +0 -1
- package/dist/sankhyablocks/p-2d919e32.entry.js +0 -1
- package/dist/sankhyablocks/p-6c9adfca.js +0 -1
- package/dist/sankhyablocks/p-85ba3d6b.entry.js +0 -1
- package/dist/sankhyablocks/p-86801b08.entry.js +0 -1
- package/dist/sankhyablocks/p-88b29791.js +0 -1
- package/dist/sankhyablocks/p-9a5d1b39.js +0 -1
- package/dist/sankhyablocks/p-9e8618ec.entry.js +0 -1
- package/dist/sankhyablocks/p-a043314f.entry.js +0 -1
- package/dist/sankhyablocks/p-a1642e7c.entry.js +0 -1
- package/dist/sankhyablocks/p-ac77949b.entry.js +0 -1
- package/dist/sankhyablocks/p-b10b9934.entry.js +0 -1
- package/dist/sankhyablocks/p-b47c2963.entry.js +0 -1
- package/dist/sankhyablocks/p-be75153c.js +0 -1
- package/dist/sankhyablocks/p-bf39bdb8.entry.js +0 -1
- package/dist/sankhyablocks/p-d5cb4b5a.entry.js +0 -1
- package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
- package/dist/sankhyablocks/p-d78d4062.js +0 -65
- package/dist/sankhyablocks/p-e7dbe53a.entry.js +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
- /package/dist/sankhyablocks/{p-ae4fc9a9.js → p-61dd89eb.js} +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { DataType } from "@sankhyalabs/core";
|
|
2
|
+
import { IResolveExporterParams } from "../../../../lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams";
|
|
3
|
+
export declare const testMetadata: {
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
fields: {
|
|
7
|
+
name: string;
|
|
8
|
+
label: string;
|
|
9
|
+
dataType: DataType;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
export declare const recordId1: string;
|
|
13
|
+
export declare const recordId2: string;
|
|
14
|
+
export declare const testRecords: {
|
|
15
|
+
__record__id__: string;
|
|
16
|
+
TESTFIELD: string;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const dataFetcherPDFResponse: {
|
|
19
|
+
chavePDF: {
|
|
20
|
+
valor: string;
|
|
21
|
+
};
|
|
22
|
+
permiteImprimir: {
|
|
23
|
+
valor: string;
|
|
24
|
+
};
|
|
25
|
+
permiteExportar: {
|
|
26
|
+
valor: string;
|
|
27
|
+
};
|
|
28
|
+
canSendEmail: {
|
|
29
|
+
valor: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const dataFetcherXLSResponse: {
|
|
33
|
+
chaveXLS: {
|
|
34
|
+
valor: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare const exportPDFParams: IResolveExporterParams;
|
|
38
|
+
export declare const exportXLSParams: IResolveExporterParams;
|
|
39
|
+
export declare const serviceNamePDF = "GridPDFBuilderSP.buildPDFFromJson";
|
|
40
|
+
export declare const serviceNameXLS = "GridXLSBuilderSP.buildXLSFromJson";
|
|
41
|
+
interface ExpectedPayload {
|
|
42
|
+
serviceName: string;
|
|
43
|
+
titleGrid: string;
|
|
44
|
+
value: any;
|
|
45
|
+
align?: string;
|
|
46
|
+
type?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function buildExpectedResponse({ serviceName, titleGrid, value, align, type }: ExpectedPayload): {
|
|
49
|
+
serviceName: string;
|
|
50
|
+
requestBody: {
|
|
51
|
+
grid: {
|
|
52
|
+
titleGrid: string;
|
|
53
|
+
columns: {
|
|
54
|
+
column: {
|
|
55
|
+
align: string;
|
|
56
|
+
id: string;
|
|
57
|
+
index: number;
|
|
58
|
+
label: string;
|
|
59
|
+
presentationType: string;
|
|
60
|
+
type: string;
|
|
61
|
+
width: any;
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
64
|
+
customOptions: {
|
|
65
|
+
xlsxExtension: boolean;
|
|
66
|
+
};
|
|
67
|
+
rows: {
|
|
68
|
+
row: {
|
|
69
|
+
c1: {
|
|
70
|
+
$: any;
|
|
71
|
+
};
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
export {};
|
|
@@ -15,6 +15,10 @@ export declare class SnkFilterDetail {
|
|
|
15
15
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
|
16
16
|
*/
|
|
17
17
|
getMessage: (key: string, props?: any) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Controla a visibilidade do botão de fixar elemento
|
|
20
|
+
*/
|
|
21
|
+
showHardFixed: boolean;
|
|
18
22
|
/**
|
|
19
23
|
* Emitido quando há uma alteração nos filtros.
|
|
20
24
|
*/
|
|
@@ -20,6 +20,10 @@ export declare class SnkFilterItem {
|
|
|
20
20
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
|
21
21
|
*/
|
|
22
22
|
getMessage: (key: string, props?: any) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Usado para controlar a visibilidade dos chips de filtros
|
|
25
|
+
*/
|
|
26
|
+
showChips: boolean;
|
|
23
27
|
/**
|
|
24
28
|
* Emitido quando o detalhe de um item da lista é aberto ou fechado.
|
|
25
29
|
*/
|
|
@@ -35,8 +39,8 @@ export declare class SnkFilterItem {
|
|
|
35
39
|
showUp(open?: boolean): Promise<void>;
|
|
36
40
|
private updatePosition;
|
|
37
41
|
private getFloatOptions;
|
|
38
|
-
private
|
|
39
|
-
private
|
|
42
|
+
private getOffsetLeft;
|
|
43
|
+
private getOffsetTop;
|
|
40
44
|
private controlScrollPage;
|
|
41
45
|
private getConfigChanges;
|
|
42
46
|
/**
|
|
@@ -64,6 +64,7 @@ export declare class SnkFilterBar implements FilterProvider {
|
|
|
64
64
|
showPersonalizedFilter: boolean;
|
|
65
65
|
personalizedFilterId: string;
|
|
66
66
|
observeFilterConfig(newValue: Array<SnkFilterItemConfig>, oldValue: Array<SnkFilterItemConfig>): void;
|
|
67
|
+
private handleFilterConfigsChanged;
|
|
67
68
|
/**
|
|
68
69
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
|
69
70
|
*/
|
|
@@ -109,6 +110,8 @@ export declare class SnkFilterBar implements FilterProvider {
|
|
|
109
110
|
private registryFilterProvider;
|
|
110
111
|
private itemFocused;
|
|
111
112
|
private filterActiveFilter;
|
|
113
|
+
private filterPersonalizedItems;
|
|
114
|
+
private getPersonalizedFilterVariableItems;
|
|
112
115
|
private getFilterItems;
|
|
113
116
|
private calculateUpdateSequence;
|
|
114
117
|
private normalizeItem;
|
|
@@ -151,9 +151,6 @@ export declare class SnkGrid {
|
|
|
151
151
|
private addGridLegacyConfigName;
|
|
152
152
|
private gridConfigChangeHandler;
|
|
153
153
|
private modalConfigChangeHandler;
|
|
154
|
-
private buildColumnsMetadata;
|
|
155
|
-
private getPaginationInfo;
|
|
156
|
-
private getExporterOffset;
|
|
157
154
|
private dataExporterProviderStore;
|
|
158
155
|
private addElementID;
|
|
159
156
|
private finshLoading;
|
|
@@ -39,6 +39,10 @@ export declare class SnkSimpleCrud {
|
|
|
39
39
|
_customContainerId: string;
|
|
40
40
|
dataState: DataState;
|
|
41
41
|
dataUnit: DataUnit;
|
|
42
|
+
/**
|
|
43
|
+
* Define o nome da entidade que o componente vai utilizar para fazer as operações de CRUD
|
|
44
|
+
*/
|
|
45
|
+
entityName: string;
|
|
42
46
|
mode: SIMPLE_CRUD_MODE;
|
|
43
47
|
gridConfig: IGridConfig;
|
|
44
48
|
formConfig: IFormConfig;
|
|
@@ -49,8 +53,12 @@ export declare class SnkSimpleCrud {
|
|
|
49
53
|
multipleSelection: boolean;
|
|
50
54
|
useCancelConfirm: boolean;
|
|
51
55
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
* Determina quantas linhas são retornadas por página.
|
|
57
|
+
*/
|
|
58
|
+
pageSize: number;
|
|
59
|
+
/**
|
|
60
|
+
* Identificador de recursos como configurações e acesso.
|
|
61
|
+
*/
|
|
54
62
|
resourceID: string;
|
|
55
63
|
/**
|
|
56
64
|
* Emitido quando há qualquer mudança de estado no DataUnit.
|
|
@@ -124,6 +132,7 @@ export declare class SnkSimpleCrud {
|
|
|
124
132
|
*/
|
|
125
133
|
goToView(view: VIEW_MODE): Promise<void>;
|
|
126
134
|
actionClickListener(evt: CustomEvent): void;
|
|
135
|
+
onChangeEntityName(newValue: string): Promise<void>;
|
|
127
136
|
onModeChange(): void;
|
|
128
137
|
observeDataState(newValue: DataState, oldValue: DataState): void;
|
|
129
138
|
observeFormLegacy(newValue: string, oldValue: string): Promise<void>;
|
|
@@ -139,6 +148,7 @@ export declare class SnkSimpleCrud {
|
|
|
139
148
|
private loadFormConfig;
|
|
140
149
|
componentWillRender(): Promise<void>;
|
|
141
150
|
componentWillLoad(): void;
|
|
151
|
+
componentDidLoad(): void;
|
|
142
152
|
configDatasource(): void;
|
|
143
153
|
getTaskBarId(): string;
|
|
144
154
|
initInMemoryDataUnit(): void;
|
|
@@ -153,6 +163,7 @@ export declare class SnkSimpleCrud {
|
|
|
153
163
|
* Usado para fechar o configurator do CRUD
|
|
154
164
|
*/
|
|
155
165
|
closeConfigurator(): Promise<void>;
|
|
166
|
+
updateConfig(): Promise<void>;
|
|
156
167
|
processMetadata(): void;
|
|
157
168
|
onDataStateChange(evt: any): void;
|
|
158
169
|
getTaskBarDisabledButtons(): Array<string>;
|
|
@@ -175,11 +186,15 @@ export declare class SnkSimpleCrud {
|
|
|
175
186
|
disconnectedCallback(): void;
|
|
176
187
|
private gridConfigChangeHandler;
|
|
177
188
|
private modalConfigChangeHandler;
|
|
189
|
+
private dataExporterProviderStore;
|
|
190
|
+
private getDataExporterStoreKey;
|
|
178
191
|
private setGridConfig;
|
|
179
192
|
private setFormConfig;
|
|
180
193
|
private closeGridConfig;
|
|
181
194
|
private closeFormConfig;
|
|
195
|
+
private getPageSize;
|
|
182
196
|
private handleShowFormConfig;
|
|
183
197
|
private resolveResourceID;
|
|
198
|
+
private getFormConfig;
|
|
184
199
|
render(): any;
|
|
185
200
|
}
|
|
@@ -30,4 +30,4 @@ export declare enum VisibleWhenForbidden {
|
|
|
30
30
|
CONFIGURATOR = "CONFIGURATOR"
|
|
31
31
|
}
|
|
32
32
|
export declare const buildCustomButton: (def: CustomButton, className: string, dataElementId: string, action: (name: string) => void, isEnabled: (name: string) => boolean) => HTMLElement;
|
|
33
|
-
export declare const buildElem: (element: TaskbarElement, className: string, dataElementId: string, getTitle: (name: string) => string, action: (name: string) => void, isEnabled: (name: string) => boolean, actions: Array<Action>,
|
|
33
|
+
export declare const buildElem: (element: TaskbarElement, className: string, dataElementId: string, getTitle: (name: string) => string, action: (name: string) => void, isEnabled: (name: string) => boolean, actions: Array<Action>, dataExporterStoreKey: string, presentationMode: PresentationMode) => HTMLElement;
|
|
@@ -852,6 +852,10 @@ export namespace Components {
|
|
|
852
852
|
* Exibe o componente snk-filter-detail.
|
|
853
853
|
*/
|
|
854
854
|
"show": () => Promise<void>;
|
|
855
|
+
/**
|
|
856
|
+
* Controla a visibilidade do botão de fixar elemento
|
|
857
|
+
*/
|
|
858
|
+
"showHardFixed": boolean;
|
|
855
859
|
}
|
|
856
860
|
interface SnkFilterFieldSearch {
|
|
857
861
|
/**
|
|
@@ -888,6 +892,10 @@ export namespace Components {
|
|
|
888
892
|
* Oculta os detalhes de um item da lista.
|
|
889
893
|
*/
|
|
890
894
|
"hideDetail": () => Promise<void>;
|
|
895
|
+
/**
|
|
896
|
+
* Usado para controlar a visibilidade dos chips de filtros
|
|
897
|
+
*/
|
|
898
|
+
"showChips": boolean;
|
|
891
899
|
/**
|
|
892
900
|
* Exibe os detalhes de um item da lista.
|
|
893
901
|
*/
|
|
@@ -1483,6 +1491,10 @@ export namespace Components {
|
|
|
1483
1491
|
"configName": string;
|
|
1484
1492
|
"dataState": DataState1;
|
|
1485
1493
|
"dataUnit": DataUnit;
|
|
1494
|
+
/**
|
|
1495
|
+
* Define o nome da entidade que o componente vai utilizar para fazer as operações de CRUD
|
|
1496
|
+
*/
|
|
1497
|
+
"entityName": string;
|
|
1486
1498
|
"formConfig": IFormConfig;
|
|
1487
1499
|
/**
|
|
1488
1500
|
* Chave da configuração legado do formulário.
|
|
@@ -1515,6 +1527,10 @@ export namespace Components {
|
|
|
1515
1527
|
* Usado para abrir o configurator do CRUD
|
|
1516
1528
|
*/
|
|
1517
1529
|
"openConfigurator": () => Promise<void>;
|
|
1530
|
+
/**
|
|
1531
|
+
* Determina quantas linhas são retornadas por página.
|
|
1532
|
+
*/
|
|
1533
|
+
"pageSize": number;
|
|
1518
1534
|
/**
|
|
1519
1535
|
* Identificador de recursos como configurações e acesso.
|
|
1520
1536
|
*/
|
|
@@ -1529,6 +1545,7 @@ export namespace Components {
|
|
|
1529
1545
|
* Gerenciador das barras de tarefas. É possível determinar botões específicos ou mesmo gerenciar o estado dos botões.
|
|
1530
1546
|
*/
|
|
1531
1547
|
"taskbarManager": TaskbarManager;
|
|
1548
|
+
"updateConfig": () => Promise<void>;
|
|
1532
1549
|
"useCancelConfirm": boolean;
|
|
1533
1550
|
/**
|
|
1534
1551
|
* Quando verdadeiro, o ENTER fará a navegação como se fosse a tecla TAB na grade.
|
|
@@ -2780,6 +2797,10 @@ declare namespace LocalJSX {
|
|
|
2780
2797
|
* Emitido quando há uma alteração nos filtros.
|
|
2781
2798
|
*/
|
|
2782
2799
|
"onFilterChange"?: (event: SnkFilterDetailCustomEvent<SnkFilterItemConfig>) => void;
|
|
2800
|
+
/**
|
|
2801
|
+
* Controla a visibilidade do botão de fixar elemento
|
|
2802
|
+
*/
|
|
2803
|
+
"showHardFixed"?: boolean;
|
|
2783
2804
|
}
|
|
2784
2805
|
interface SnkFilterFieldSearch {
|
|
2785
2806
|
/**
|
|
@@ -2813,6 +2834,10 @@ declare namespace LocalJSX {
|
|
|
2813
2834
|
* Emitido quando o detalhe de um item da lista é aberto ou fechado.
|
|
2814
2835
|
*/
|
|
2815
2836
|
"onVisibleChanged"?: (event: SnkFilterItemCustomEvent<boolean>) => void;
|
|
2837
|
+
/**
|
|
2838
|
+
* Usado para controlar a visibilidade dos chips de filtros
|
|
2839
|
+
*/
|
|
2840
|
+
"showChips"?: boolean;
|
|
2816
2841
|
}
|
|
2817
2842
|
interface SnkFilterList {
|
|
2818
2843
|
/**
|
|
@@ -3433,6 +3458,10 @@ declare namespace LocalJSX {
|
|
|
3433
3458
|
"configName"?: string;
|
|
3434
3459
|
"dataState"?: DataState1;
|
|
3435
3460
|
"dataUnit"?: DataUnit;
|
|
3461
|
+
/**
|
|
3462
|
+
* Define o nome da entidade que o componente vai utilizar para fazer as operações de CRUD
|
|
3463
|
+
*/
|
|
3464
|
+
"entityName"?: string;
|
|
3436
3465
|
"formConfig"?: IFormConfig;
|
|
3437
3466
|
/**
|
|
3438
3467
|
* Chave da configuração legado do formulário.
|
|
@@ -3480,6 +3509,10 @@ declare namespace LocalJSX {
|
|
|
3480
3509
|
* Responsável por notificar quando ocorrer a renderização de itens do formulário.
|
|
3481
3510
|
*/
|
|
3482
3511
|
"onFormItemsReady"?: (event: SnkSimpleCrudCustomEvent<Array<HTMLElement>>) => void;
|
|
3512
|
+
/**
|
|
3513
|
+
* Determina quantas linhas são retornadas por página.
|
|
3514
|
+
*/
|
|
3515
|
+
"pageSize"?: number;
|
|
3483
3516
|
/**
|
|
3484
3517
|
* Identificador de recursos como configurações e acesso.
|
|
3485
3518
|
*/
|
|
@@ -14,8 +14,6 @@ export default class InMemoryLoader {
|
|
|
14
14
|
set metadata(metadata: UnitMetadata);
|
|
15
15
|
private generateUniqueId;
|
|
16
16
|
private inMemoryLoader;
|
|
17
|
-
private applyFilter;
|
|
18
|
-
private applySorting;
|
|
19
17
|
private metadaLoader;
|
|
20
18
|
private saveLoader;
|
|
21
19
|
removeLoader(_dataUnit: DataUnit, recordIds: Array<string>): Promise<Array<string>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataUnit, Filter, PaginationInfo, Record, Sort } from '@sankhyalabs/core';
|
|
2
|
+
export declare function applyFilter(records: Array<Record>, dataUnit: DataUnit, filters: Array<Filter>): Array<Record>;
|
|
3
|
+
export declare function applySorting(records: Array<Record>, dataUnit: DataUnit, sorting: Array<Sort>): Array<Record>;
|
|
4
|
+
export declare function buildPaginationInfo(records: Array<Record>, offset?: number, limit?: number): PaginationInfo | undefined;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { DataUnit, LoadDataRequest, LoadDataResponse } from "@sankhyalabs/core";
|
|
1
|
+
import { DataUnit, LoadDataRequest, LoadDataResponse, Record } from "@sankhyalabs/core";
|
|
2
2
|
export default class DataUnitDataLoader {
|
|
3
3
|
private static _requestTimeByDataUnit;
|
|
4
4
|
private static _debouncingTimeouts;
|
|
5
5
|
private static debounce;
|
|
6
6
|
static loadData(dataUnit: DataUnit, request: LoadDataRequest): Promise<LoadDataResponse>;
|
|
7
|
+
static getCachedRecords(dataUnit: DataUnit): Array<Record>;
|
|
7
8
|
private static loadFromServer;
|
|
8
9
|
private static callLoader;
|
|
9
10
|
private static afterLoadingPage;
|
|
@@ -16,6 +16,7 @@ export default class PreloadManager {
|
|
|
16
16
|
static countRecords(dataUnit: DataUnit): Promise<number>;
|
|
17
17
|
private static getRepository;
|
|
18
18
|
private static loadFromCache;
|
|
19
|
+
static getCachedRecords(dataUnit: DataUnit): Array<Record>;
|
|
19
20
|
}
|
|
20
21
|
export interface DataLoader {
|
|
21
22
|
(dataUnit: DataUnit, request: LoadDataRequest): Promise<LoadDataResponse>;
|
package/package.json
CHANGED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const DataFetcher = require('./DataFetcher-99f0f6ed.js');
|
|
4
|
-
const core = require('@sankhyalabs/core');
|
|
5
|
-
|
|
6
|
-
class ResourceFetcher {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.templateByQuery = new Map();
|
|
9
|
-
this.buldTemplates();
|
|
10
|
-
}
|
|
11
|
-
buldTemplates() {
|
|
12
|
-
this.templateByQuery.set("fetchResource", DataFetcher.dist.gql `query($name: String!) {
|
|
13
|
-
$queryAlias$: fetchResource(name: $name){
|
|
14
|
-
resource
|
|
15
|
-
}
|
|
16
|
-
}`);
|
|
17
|
-
this.templateByQuery.set("saveResource", DataFetcher.dist.gql `mutation($resource: InputResource!) {
|
|
18
|
-
$queryAlias$: saveResource(resource: $resource){
|
|
19
|
-
name
|
|
20
|
-
resource
|
|
21
|
-
}
|
|
22
|
-
}`);
|
|
23
|
-
}
|
|
24
|
-
loadResource(name) {
|
|
25
|
-
if (ResourceFetcher._loadingResource.has(name)) {
|
|
26
|
-
return ResourceFetcher._loadingResource.get(name);
|
|
27
|
-
}
|
|
28
|
-
const promiseLoadResource = new Promise((resolve, reject) => {
|
|
29
|
-
DataFetcher.DataFetcher.get()
|
|
30
|
-
.callGraphQL({
|
|
31
|
-
values: { name },
|
|
32
|
-
query: this.templateByQuery.get("fetchResource"),
|
|
33
|
-
})
|
|
34
|
-
.then((result) => {
|
|
35
|
-
resolve(result === null || result === void 0 ? void 0 : result.resource);
|
|
36
|
-
ResourceFetcher._loadingResource.delete(name);
|
|
37
|
-
})
|
|
38
|
-
.catch((error) => {
|
|
39
|
-
reject(error);
|
|
40
|
-
ResourceFetcher._loadingResource.delete(name);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
ResourceFetcher._loadingResource.set(name, promiseLoadResource);
|
|
44
|
-
return promiseLoadResource;
|
|
45
|
-
}
|
|
46
|
-
saveResource(resource, name) {
|
|
47
|
-
return new Promise((resolve, reject) => {
|
|
48
|
-
DataFetcher.DataFetcher.get()
|
|
49
|
-
.callGraphQL({
|
|
50
|
-
values: {
|
|
51
|
-
resource: {
|
|
52
|
-
name: name,
|
|
53
|
-
resource: JSON.stringify(resource)
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
query: this.templateByQuery.get("saveResource")
|
|
57
|
-
})
|
|
58
|
-
.then((resp) => {
|
|
59
|
-
resolve(resp);
|
|
60
|
-
})
|
|
61
|
-
.catch((error) => {
|
|
62
|
-
reject(error);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
ResourceFetcher._loadingResource = new Map();
|
|
68
|
-
|
|
69
|
-
class FormConfigFetcher extends ResourceFetcher {
|
|
70
|
-
constructor() {
|
|
71
|
-
super();
|
|
72
|
-
this.queryConfig = new Map();
|
|
73
|
-
this.buildTemplatesConfig();
|
|
74
|
-
}
|
|
75
|
-
buildTemplatesConfig() {
|
|
76
|
-
this.queryConfig.set("fetchUserAvailableConfigs", DataFetcher.dist.gql `query($name: String!) {
|
|
77
|
-
$queryAlias$: fetchUserAvailableConfigs(name: $name){
|
|
78
|
-
name
|
|
79
|
-
origin
|
|
80
|
-
key
|
|
81
|
-
}
|
|
82
|
-
}`);
|
|
83
|
-
this.queryConfig.set("fetchLegacyConfig", DataFetcher.dist.gql `query($name: String!) {
|
|
84
|
-
$queryAlias$: fetchLegacyConfig(name: $name){
|
|
85
|
-
name
|
|
86
|
-
resource
|
|
87
|
-
}
|
|
88
|
-
}`);
|
|
89
|
-
this.queryConfig.set("fetchDefaultConfig", DataFetcher.dist.gql `query($name: String!) {
|
|
90
|
-
$queryAlias$: fetchDefaultConfig(name: $name){
|
|
91
|
-
name
|
|
92
|
-
resource
|
|
93
|
-
}
|
|
94
|
-
}`);
|
|
95
|
-
}
|
|
96
|
-
loadFormConfig(formName, resourceID) {
|
|
97
|
-
return new Promise((accept, reject) => {
|
|
98
|
-
Promise.all([
|
|
99
|
-
this.loadResource(this.getPath(resourceID, formName)),
|
|
100
|
-
this.loadResource(this.getPath(`FormCardState:${resourceID}`, formName, "form-card")),
|
|
101
|
-
this.loadResource(this.getPath(resourceID, formName, "summary")),
|
|
102
|
-
this.loadResource(this.getPath(resourceID, formName, "defaultValues"))
|
|
103
|
-
])
|
|
104
|
-
.then(([configAsString, formCardState, summary, defaultValues]) => {
|
|
105
|
-
let config;
|
|
106
|
-
if (configAsString != undefined) {
|
|
107
|
-
config = Object.assign(Object.assign({}, JSON.parse(configAsString)), { emptyConfig: false });
|
|
108
|
-
const { tabs, fields } = config;
|
|
109
|
-
if (tabs) {
|
|
110
|
-
const allTabs = new Map(tabs.map(t => [t.label, t]));
|
|
111
|
-
fields === null || fields === void 0 ? void 0 : fields.forEach(f => { var _a; return f.tab = ((_a = allTabs.get(this.getTabName(f.tab))) === null || _a === void 0 ? void 0 : _a.label) || allTabs.get(this.getTabName(f.tab)); });
|
|
112
|
-
}
|
|
113
|
-
config.fields = fields === null || fields === void 0 ? void 0 : fields.map((field) => {
|
|
114
|
-
if ("readonly" in field) {
|
|
115
|
-
const readOnly = field['readonly'] === true;
|
|
116
|
-
delete field['readonly'];
|
|
117
|
-
field.readOnly = readOnly;
|
|
118
|
-
}
|
|
119
|
-
return field;
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
if (formCardState != undefined) {
|
|
123
|
-
if (config == undefined) {
|
|
124
|
-
config = { emptyConfig: true, fields: [] };
|
|
125
|
-
}
|
|
126
|
-
config.cardsState = new Map(JSON.parse(formCardState));
|
|
127
|
-
}
|
|
128
|
-
if (summary != undefined) {
|
|
129
|
-
if (config == undefined) {
|
|
130
|
-
config = { emptyConfig: true, fields: [] };
|
|
131
|
-
}
|
|
132
|
-
config.summary = new Map(Object.entries(JSON.parse(summary)));
|
|
133
|
-
}
|
|
134
|
-
if (defaultValues != undefined) {
|
|
135
|
-
if (config == undefined) {
|
|
136
|
-
config = { emptyConfig: true, fields: [] };
|
|
137
|
-
}
|
|
138
|
-
config.defaultVars = new Map(Object.entries(JSON.parse(defaultValues)));
|
|
139
|
-
}
|
|
140
|
-
accept(config);
|
|
141
|
-
})
|
|
142
|
-
.catch((error) => {
|
|
143
|
-
reject(error);
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
getTabName(tab) {
|
|
148
|
-
if (typeof tab === 'object') { // ITabConfig type
|
|
149
|
-
return tab.label;
|
|
150
|
-
}
|
|
151
|
-
return tab; //string type
|
|
152
|
-
}
|
|
153
|
-
saveCardState(cardsState, formName, resourceID) {
|
|
154
|
-
const completePath = this.getPath(`FormCardState:${resourceID}`, formName, "form-card");
|
|
155
|
-
return new Promise((resolve, reject) => {
|
|
156
|
-
this.saveResource(Array.from(cardsState.entries()), completePath)
|
|
157
|
-
.then((resp) => {
|
|
158
|
-
resolve(new Map(JSON.parse(resp.resource)));
|
|
159
|
-
})
|
|
160
|
-
.catch((error) => {
|
|
161
|
-
reject(error);
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
saveConfig(config, formName, resourceID) {
|
|
166
|
-
//Essas informações não devem ser salvas na configuração
|
|
167
|
-
delete config.cardsState;
|
|
168
|
-
delete config.defaultVars;
|
|
169
|
-
delete config.summary;
|
|
170
|
-
const completePath = this.getPath(resourceID, formName);
|
|
171
|
-
return new Promise((resolve, reject) => {
|
|
172
|
-
this.saveResource(config, completePath)
|
|
173
|
-
.then((resp) => {
|
|
174
|
-
resolve(JSON.parse(resp.resource));
|
|
175
|
-
})
|
|
176
|
-
.catch((error) => {
|
|
177
|
-
reject(error);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
fetchUserAvailableConfigs(formName, resourceID) {
|
|
182
|
-
const name = this.getPath(resourceID, formName);
|
|
183
|
-
return new Promise((resolve, reject) => {
|
|
184
|
-
DataFetcher.DataFetcher.get()
|
|
185
|
-
.callGraphQL({
|
|
186
|
-
values: { name },
|
|
187
|
-
query: this.queryConfig.get("fetchUserAvailableConfigs"),
|
|
188
|
-
})
|
|
189
|
-
.then((result) => {
|
|
190
|
-
resolve(result);
|
|
191
|
-
})
|
|
192
|
-
.catch((error) => {
|
|
193
|
-
reject(error);
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
fetchLegacyConfig(formName, resourceID) {
|
|
198
|
-
const name = this.getPath(resourceID, formName);
|
|
199
|
-
return new Promise((resolve, reject) => {
|
|
200
|
-
DataFetcher.DataFetcher.get()
|
|
201
|
-
.callGraphQL({
|
|
202
|
-
values: { name },
|
|
203
|
-
query: this.queryConfig.get("fetchLegacyConfig"),
|
|
204
|
-
})
|
|
205
|
-
.then((result) => {
|
|
206
|
-
resolve(core.ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
|
207
|
-
})
|
|
208
|
-
.catch((error) => {
|
|
209
|
-
reject(error);
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
fetchDefaultConfig(formName, resourceID) {
|
|
214
|
-
const name = this.getPath(resourceID, formName);
|
|
215
|
-
return new Promise((resolve, reject) => {
|
|
216
|
-
DataFetcher.DataFetcher.get()
|
|
217
|
-
.callGraphQL({
|
|
218
|
-
values: { name },
|
|
219
|
-
query: this.queryConfig.get("fetchDefaultConfig"),
|
|
220
|
-
})
|
|
221
|
-
.then((result) => {
|
|
222
|
-
resolve(core.ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
|
223
|
-
})
|
|
224
|
-
.catch((error) => {
|
|
225
|
-
reject(error);
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
getPath(resourceID, name, authority = "form") {
|
|
230
|
-
if (name) {
|
|
231
|
-
return `cfg://${authority}/${resourceID}/${name}`;
|
|
232
|
-
}
|
|
233
|
-
return `cfg://${authority}/${resourceID}`;
|
|
234
|
-
}
|
|
235
|
-
async fetchLegacyConfigurableForm(configName) {
|
|
236
|
-
const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
|
|
237
|
-
const response = await DataFetcher.DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
|
|
238
|
-
if (core.ObjectUtils.isEmpty(response))
|
|
239
|
-
return undefined;
|
|
240
|
-
return this.buildLegacyConfigurableForm(response);
|
|
241
|
-
}
|
|
242
|
-
buildLegacyConfigurableForm(config) {
|
|
243
|
-
var _a, _b, _c;
|
|
244
|
-
const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
|
|
245
|
-
return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
exports.UserConfigType = void 0;
|
|
249
|
-
(function (UserConfigType) {
|
|
250
|
-
UserConfigType["USER"] = "USER";
|
|
251
|
-
UserConfigType["DEFAULT"] = "DEFAULT";
|
|
252
|
-
UserConfigType["SHARED"] = "SHARED";
|
|
253
|
-
})(exports.UserConfigType || (exports.UserConfigType = {}));
|
|
254
|
-
|
|
255
|
-
exports.FormConfigFetcher = FormConfigFetcher;
|
|
256
|
-
exports.ResourceFetcher = ResourceFetcher;
|
|
@@ -1,34 +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 '../../DataFetcher';
|
|
15
|
-
export default function fetchDataExporter(_a) {
|
|
16
|
-
var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
|
17
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
18
|
-
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
|
19
|
-
const payload = { serviceName, requestBody };
|
|
20
|
-
return new Promise((resolve, reject) => {
|
|
21
|
-
DataFetcher.get()
|
|
22
|
-
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
|
23
|
-
.then(result => resolve(getFormatResponse(result)))
|
|
24
|
-
.catch(error => reject(error));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function getFormatResponse(result) {
|
|
28
|
-
var _a;
|
|
29
|
-
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
|
30
|
-
if (response == undefined) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
return ObjectUtils.stringToObject(response);
|
|
34
|
-
}
|