@sankhyalabs/sankhyablocks 8.15.1 → 8.16.0-dev.1
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/{SnkMultiSelectionListDataSource-303e85d1.js → IExporterProvider-c78cb1b8.js} +94 -4
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-f9dc0d28.js → SnkFormConfigManager-1b13bacd.js} +6 -3
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-722b104e.js} +8 -12
- package/dist/cjs/{pesquisa-fetcher-213797ec.js → dataunit-fetcher-620b29a1.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 +4 -2
- package/dist/cjs/snk-application.cjs.entry.js +34 -11
- package/dist/cjs/snk-attach.cjs.entry.js +71 -46
- package/dist/cjs/snk-crud.cjs.entry.js +96 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +315 -85
- package/dist/cjs/snk-data-unit-82dea87e.js +679 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +12 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +48 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +5 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +51 -6
- package/dist/cjs/snk-grid.cjs.entry.js +164 -107
- package/dist/cjs/{snk-guides-viewer-4b6ecda8.js → snk-guides-viewer-05a1ba27.js} +36 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
- package/dist/cjs/snk-simple-crud.cjs.entry.js +264 -37
- 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 +249 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +135 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +112 -5
- 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 +507 -214
- 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 +6 -3
- package/dist/collection/components/snk-grid/snk-grid.js +240 -101
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +386 -18
- 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/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 +1 -0
- package/dist/components/{field-search.js → IExporterProvider.js} +93 -6
- package/dist/components/ISave.js +47 -0
- package/dist/components/SnkFormConfigManager.js +6 -3
- package/dist/components/SnkMessageBuilder.js +8 -12
- 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 +103 -11
- package/dist/components/snk-data-exporter2.js +309 -85
- package/dist/components/snk-data-unit2.js +470 -212
- package/dist/components/snk-detail-view2.js +87 -10
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +6 -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 +259 -23
- package/dist/components/snk-taskbar2.js +6 -5
- package/dist/esm/{SnkMultiSelectionListDataSource-36918dbf.js → IExporterProvider-343272b3.js} +93 -5
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-f53f9f87.js → SnkFormConfigManager-d4554df9.js} +6 -3
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-89925609.js} +8 -12
- package/dist/esm/{pesquisa-fetcher-fe6f3826.js → dataunit-fetcher-3fbf9d12.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 +4 -2
- package/dist/esm/snk-application.entry.js +33 -10
- package/dist/esm/snk-attach.entry.js +66 -41
- package/dist/esm/snk-crud.entry.js +96 -10
- package/dist/esm/snk-data-exporter.entry.js +316 -86
- package/dist/esm/snk-data-unit-8f98b45f.js +677 -0
- package/dist/esm/snk-data-unit.entry.js +12 -2
- package/dist/esm/snk-detail-view.entry.js +48 -7
- package/dist/esm/snk-filter-bar.entry.js +5 -1
- package/dist/esm/snk-form-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +51 -6
- package/dist/esm/snk-grid.entry.js +162 -105
- package/dist/esm/{snk-guides-viewer-113be3fd.js → snk-guides-viewer-aee2cafe.js} +36 -8
- package/dist/esm/snk-guides-viewer.entry.js +8 -6
- package/dist/esm/snk-simple-crud.entry.js +252 -25
- 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-0d91b10f.entry.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-26394a01.entry.js +1 -0
- package/dist/sankhyablocks/p-2d649237.entry.js +1 -0
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-44767378.entry.js +1 -0
- package/dist/sankhyablocks/p-47b60deb.entry.js +1 -0
- package/dist/sankhyablocks/p-4f72727a.entry.js +1 -0
- package/dist/sankhyablocks/p-550fee49.entry.js +1 -0
- package/dist/sankhyablocks/p-5539ecb4.entry.js +1 -0
- package/dist/sankhyablocks/p-672302c3.js +60 -0
- package/dist/sankhyablocks/p-7a337364.js +1 -0
- package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
- package/dist/sankhyablocks/p-829d4045.js +1 -0
- package/dist/sankhyablocks/p-8a5910a7.entry.js +1 -0
- package/dist/sankhyablocks/p-8cc64963.entry.js +1 -0
- package/dist/sankhyablocks/p-8fc470e5.entry.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/p-9e99a92a.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-be603a24.js +1 -0
- package/dist/sankhyablocks/p-d09feef1.js +1 -0
- package/dist/sankhyablocks/p-e95b3b93.entry.js +11 -0
- package/dist/sankhyablocks/p-f2809746.entry.js +1 -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 +36 -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 +19 -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 +61 -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-grid/snk-grid.d.ts +46 -6
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +58 -4
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +220 -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-07a61550.entry.js +0 -1
- package/dist/sankhyablocks/p-0899e0b5.entry.js +0 -1
- package/dist/sankhyablocks/p-154a7f33.entry.js +0 -1
- package/dist/sankhyablocks/p-15802c59.entry.js +0 -1
- package/dist/sankhyablocks/p-164666b1.js +0 -65
- package/dist/sankhyablocks/p-32556aa6.js +0 -1
- package/dist/sankhyablocks/p-328585d0.entry.js +0 -1
- package/dist/sankhyablocks/p-38289a55.js +0 -1
- package/dist/sankhyablocks/p-52c8e589.js +0 -1
- package/dist/sankhyablocks/p-5cb07080.js +0 -1
- package/dist/sankhyablocks/p-74d349c3.entry.js +0 -1
- package/dist/sankhyablocks/p-7fe120b8.entry.js +0 -11
- package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
- package/dist/sankhyablocks/p-af1ac81f.entry.js +0 -1
- package/dist/sankhyablocks/p-b4525fc0.entry.js +0 -1
- package/dist/sankhyablocks/p-cce0865d.js +0 -1
- package/dist/sankhyablocks/p-dec65f6c.entry.js +0 -1
- package/dist/sankhyablocks/p-ee9536bc.entry.js +0 -1
- package/dist/sankhyablocks/p-f13f7616.entry.js +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -4,25 +4,82 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const
|
8
|
-
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
7
|
+
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
9
8
|
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
10
|
-
const index$1 = require('./index-
|
9
|
+
const index$1 = require('./index-1dfc7a6e.js');
|
11
10
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
12
11
|
const index$2 = require('./index-102ba62d.js');
|
13
|
-
const
|
12
|
+
const IExporterProvider = require('./IExporterProvider-c78cb1b8.js');
|
14
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
15
14
|
require('./DataFetcher-313debd8.js');
|
16
|
-
require('./pesquisa-fetcher-
|
15
|
+
require('./pesquisa-fetcher-680e198f.js');
|
17
16
|
require('./ISave-e91b70a7.js');
|
18
17
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
18
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
19
|
+
require('./dataunit-fetcher-620b29a1.js');
|
19
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
20
21
|
require('./form-config-fetcher-2dd00e5b.js');
|
22
|
+
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
21
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
22
24
|
require('./PrintUtils-bcaeb82f.js');
|
23
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
26
|
+
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
24
27
|
require('./ResourceIDUtils-5ff86aa7.js');
|
25
28
|
|
29
|
+
class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
|
30
|
+
getFilters() {
|
31
|
+
var _a;
|
32
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
|
33
|
+
}
|
34
|
+
getOrders() {
|
35
|
+
var _a;
|
36
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
|
37
|
+
}
|
38
|
+
getResourceURI() {
|
39
|
+
var _a;
|
40
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
41
|
+
}
|
42
|
+
getSelectedNumber() {
|
43
|
+
return this.dataUnit.getSelectionInfo().length;
|
44
|
+
}
|
45
|
+
getTotalRecords() {
|
46
|
+
var _a, _b, _c;
|
47
|
+
const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
48
|
+
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
49
|
+
}
|
50
|
+
getSelectedIDs() {
|
51
|
+
return RecordIDUtils.getSelectedIDs(this.dataUnit);
|
52
|
+
}
|
53
|
+
getOffset() {
|
54
|
+
return this.getExporterOffset(this.getPaginationInfo());
|
55
|
+
}
|
56
|
+
getPageSize() {
|
57
|
+
var _a;
|
58
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
|
59
|
+
}
|
60
|
+
getExportLimit() {
|
61
|
+
return 5000;
|
62
|
+
}
|
63
|
+
getRecordID() {
|
64
|
+
var _a, _b, _c;
|
65
|
+
return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
66
|
+
}
|
67
|
+
getPaginationInfo() {
|
68
|
+
var _a;
|
69
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
70
|
+
}
|
71
|
+
getExporterOffset(paginationInfo) {
|
72
|
+
if (paginationInfo == undefined) {
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
const offset = paginationInfo.firstRecord;
|
76
|
+
if (offset > 0) {
|
77
|
+
return (offset - 1);
|
78
|
+
}
|
79
|
+
return offset;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
26
83
|
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
27
84
|
|
28
85
|
const SnkGrid = class {
|
@@ -30,6 +87,8 @@ const SnkGrid = class {
|
|
30
87
|
index.registerInstance(this, hostRef);
|
31
88
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
32
89
|
this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
|
90
|
+
this._customEditors = new Map();
|
91
|
+
this._customRenders = new Map();
|
33
92
|
this._topTaskbarProcessor = new fieldSearch.TaskbarProcessor({
|
34
93
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
35
94
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -49,12 +108,20 @@ const SnkGrid = class {
|
|
49
108
|
"snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
|
50
109
|
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
51
110
|
});
|
111
|
+
this.dataUnitInterceptor = {
|
112
|
+
interceptAction: async (action) => {
|
113
|
+
if (action.type === core.Action.METADATA_LOADED) {
|
114
|
+
return await this.interceptMetadataLoaded(action);
|
115
|
+
}
|
116
|
+
return action;
|
117
|
+
}
|
118
|
+
};
|
52
119
|
this._dataUnit = undefined;
|
53
120
|
this._dataState = undefined;
|
54
121
|
this._gridConfig = undefined;
|
55
122
|
this._popUpGridConfig = false;
|
56
123
|
this._showSnkFilterBar = true;
|
57
|
-
this.columnFilterDataSource = new
|
124
|
+
this.columnFilterDataSource = new IExporterProvider.SnkMultiSelectionListDataSource();
|
58
125
|
this.configName = undefined;
|
59
126
|
this.filterBarTitle = undefined;
|
60
127
|
this.resourceID = undefined;
|
@@ -75,6 +142,8 @@ const SnkGrid = class {
|
|
75
142
|
this.disablePersonalizedFilter = undefined;
|
76
143
|
this.gridLegacyConfigName = undefined;
|
77
144
|
this.filterBarLegacyConfigName = undefined;
|
145
|
+
this.autoLoad = undefined;
|
146
|
+
this.autoFocus = true;
|
78
147
|
}
|
79
148
|
/**
|
80
149
|
* Exibe a janela de configurações da grade.
|
@@ -119,6 +188,42 @@ const SnkGrid = class {
|
|
119
188
|
async findColumn() {
|
120
189
|
await fieldSearch.openFieldSearch(this._moreOptions, this._columnSearch);
|
121
190
|
}
|
191
|
+
/**
|
192
|
+
* Registra um editor customizado para campos da grade e formulário
|
193
|
+
*/
|
194
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
195
|
+
if (this._grid) {
|
196
|
+
this._grid.addCustomEditor(fieldName, customEditor, detailContext);
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
const newCustomEditors = new Map(this._customEditors);
|
200
|
+
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
201
|
+
this._customEditors = newCustomEditors;
|
202
|
+
}
|
203
|
+
/**
|
204
|
+
* Registra um render customizado para colunas da grid.
|
205
|
+
*/
|
206
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
207
|
+
if (this._grid) {
|
208
|
+
this._grid.addGridCustomRender(fieldName, customRender, detailContext);
|
209
|
+
return;
|
210
|
+
}
|
211
|
+
const newCustomRenders = new Map(this._customRenders);
|
212
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
213
|
+
this._customRenders = newCustomRenders;
|
214
|
+
}
|
215
|
+
/**
|
216
|
+
* Registra um formatador de valores para uma coluna da grid.
|
217
|
+
*/
|
218
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
219
|
+
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
220
|
+
}
|
221
|
+
/**
|
222
|
+
* Remove o formatador de valores de uma coluna da grid.
|
223
|
+
*/
|
224
|
+
async removeCustomValueFormatter(columnName) {
|
225
|
+
this._grid.removeCustomValueFormatter(columnName);
|
226
|
+
}
|
122
227
|
/**
|
123
228
|
* Atribui o foco para a grade.
|
124
229
|
*/
|
@@ -148,7 +253,7 @@ const SnkGrid = class {
|
|
148
253
|
}
|
149
254
|
setGridConfig(config) {
|
150
255
|
this._gridConfig = config;
|
151
|
-
|
256
|
+
IExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
152
257
|
}
|
153
258
|
loadConfig() {
|
154
259
|
ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
@@ -179,113 +284,56 @@ const SnkGrid = class {
|
|
179
284
|
});
|
180
285
|
evt.stopPropagation();
|
181
286
|
}
|
182
|
-
buildColumnsMetadata(gridColumns) {
|
183
|
-
const columnsMetadata = [];
|
184
|
-
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
185
|
-
var _a, _b;
|
186
|
-
/**
|
187
|
-
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
188
|
-
*/
|
189
|
-
if (column.hidden && column.name !== "RECDESP") {
|
190
|
-
return;
|
191
|
-
}
|
192
|
-
const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
193
|
-
const columnData = {
|
194
|
-
label: column.label,
|
195
|
-
id: column.name,
|
196
|
-
width: column.width,
|
197
|
-
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
198
|
-
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
199
|
-
};
|
200
|
-
columnsMetadata.push(columnData);
|
201
|
-
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
202
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
203
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
204
|
-
const descriptionColumn = {
|
205
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
206
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
207
|
-
width: 200,
|
208
|
-
type: core.DataType.TEXT,
|
209
|
-
userInterface: UnitMetadata.UserInterface.LONGTEXT
|
210
|
-
};
|
211
|
-
columnsMetadata.push(descriptionColumn);
|
212
|
-
}
|
213
|
-
});
|
214
|
-
return columnsMetadata || [];
|
215
|
-
}
|
216
|
-
getPaginationInfo() {
|
217
|
-
var _a;
|
218
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
219
|
-
}
|
220
|
-
getExporterOffset(paginationInfo) {
|
221
|
-
if (paginationInfo == undefined) {
|
222
|
-
return;
|
223
|
-
}
|
224
|
-
const offset = paginationInfo.firstRecord;
|
225
|
-
if (offset > 0) {
|
226
|
-
return (offset - 1);
|
227
|
-
}
|
228
|
-
return offset;
|
229
|
-
}
|
230
287
|
async dataExporterProviderStore() {
|
231
|
-
|
232
|
-
const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
|
233
|
-
const dataExporterProvider = {
|
234
|
-
getFilters: () => {
|
235
|
-
var _a;
|
236
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
|
237
|
-
},
|
238
|
-
getColumnsMetadata: async () => {
|
239
|
-
var _a;
|
240
|
-
const columnsState = await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState());
|
241
|
-
return this.buildColumnsMetadata(columnsState);
|
242
|
-
},
|
243
|
-
getOrders: () => {
|
244
|
-
var _a;
|
245
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
|
246
|
-
},
|
247
|
-
getResourceURI: () => {
|
248
|
-
var _a;
|
249
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
250
|
-
},
|
251
|
-
getSelectedNumber: () => {
|
252
|
-
var _a, _b;
|
253
|
-
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.length;
|
254
|
-
},
|
255
|
-
getTotalRecords: () => {
|
256
|
-
var _a, _b, _c;
|
257
|
-
const { total } = ((_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
258
|
-
return total !== null && total !== void 0 ? total : (_c = (_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
259
|
-
},
|
260
|
-
getSelectedIDs: () => {
|
261
|
-
return selectedIDs || [];
|
262
|
-
},
|
263
|
-
getOffset: () => {
|
264
|
-
return this.getExporterOffset(this.getPaginationInfo());
|
265
|
-
},
|
266
|
-
getLimit: () => {
|
267
|
-
var _a;
|
268
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
|
269
|
-
},
|
270
|
-
getRecordID: () => {
|
271
|
-
var _a, _b, _c;
|
272
|
-
return (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
273
|
-
}
|
274
|
-
};
|
288
|
+
const dataExporterProvider = new ServerSideExporterProvider(this._dataUnit, this._grid);
|
275
289
|
index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
276
290
|
}
|
277
291
|
addElementID() {
|
278
292
|
const dataInfo = { dataUnit: this._dataUnit };
|
279
293
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
280
294
|
}
|
281
|
-
|
282
|
-
|
295
|
+
loadGridCustomFormatters(fields) {
|
296
|
+
if (!fields || !this._grid) {
|
297
|
+
return;
|
298
|
+
}
|
299
|
+
fields.forEach((field) => {
|
300
|
+
var _a;
|
301
|
+
if ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) {
|
302
|
+
this.addCustomValueFormatter(field.name, this._rmPrecisionCustomValueFormatter);
|
303
|
+
}
|
304
|
+
});
|
305
|
+
}
|
306
|
+
async interceptMetadataLoaded(action) {
|
307
|
+
this.loadGridCustomFormatters(action.payload.fields);
|
308
|
+
return action;
|
309
|
+
}
|
310
|
+
finishLoading() {
|
311
|
+
this._dataUnit.addInterceptor(this.dataUnitInterceptor);
|
312
|
+
IExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
283
313
|
this.addElementID();
|
284
314
|
if (this.columnFilterDataSource != undefined) {
|
285
315
|
this.columnFilterDataSource.setApplication(this._application);
|
286
316
|
this.columnFilterDataSource.setDataUnit(this._dataUnit);
|
287
317
|
}
|
288
318
|
}
|
319
|
+
setCustomRenders() {
|
320
|
+
if (!this._grid) {
|
321
|
+
return;
|
322
|
+
}
|
323
|
+
for (const [fieldName, customRenderProps] of this._customRenders) {
|
324
|
+
this._grid.addGridCustomRender(fieldName, customRenderProps.customRender, customRenderProps.detailContext);
|
325
|
+
this._customRenders.delete(fieldName);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
setCustomEditors() {
|
329
|
+
if (!this._grid) {
|
330
|
+
return;
|
331
|
+
}
|
332
|
+
for (const [fieldName, customEditorProps] of this._customEditors) {
|
333
|
+
this._grid.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
|
334
|
+
this._customEditors.delete(fieldName);
|
335
|
+
}
|
336
|
+
}
|
289
337
|
componentWillLoad() {
|
290
338
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
291
339
|
//TODO: substituir pelo metodo nativo closest
|
@@ -297,17 +345,15 @@ const SnkGrid = class {
|
|
297
345
|
if (!this._dataUnit) {
|
298
346
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
299
347
|
this._dataUnit = evt.detail;
|
300
|
-
this.
|
348
|
+
this.finishLoading();
|
301
349
|
});
|
302
350
|
}
|
303
351
|
else {
|
304
|
-
this.
|
352
|
+
this.finishLoading();
|
305
353
|
}
|
306
354
|
if (!this.messagesBuilder)
|
307
355
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
308
|
-
this._snkDataUnit.addEventListener("dataStateChange", (
|
309
|
-
this._dataState = evt.detail;
|
310
|
-
});
|
356
|
+
this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
|
311
357
|
this._snkDataUnit.addEventListener("cancelEdition", () => {
|
312
358
|
var _a;
|
313
359
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
@@ -318,9 +364,20 @@ const SnkGrid = class {
|
|
318
364
|
}
|
319
365
|
parent = parent.parentElement;
|
320
366
|
}
|
367
|
+
this._rmPrecisionCustomValueFormatter = new IExporterProvider.RmPrecisionCustomValueFormatter();
|
321
368
|
this.addGridLegacyConfigName();
|
322
369
|
this.loadConfig();
|
323
370
|
}
|
371
|
+
componentDidRender() {
|
372
|
+
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
373
|
+
this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
|
374
|
+
this.setCustomRenders();
|
375
|
+
this.setCustomEditors();
|
376
|
+
}
|
377
|
+
async handleDataStateChange(evt) {
|
378
|
+
this._dataState = evt.detail;
|
379
|
+
this._rmPrecisionCustomValueFormatter.setDataState(this._dataState);
|
380
|
+
}
|
324
381
|
getHeaderDisabledButtons() {
|
325
382
|
var _a;
|
326
383
|
const disabledButtons = [];
|
@@ -433,7 +490,7 @@ const SnkGrid = class {
|
|
433
490
|
return undefined;
|
434
491
|
}
|
435
492
|
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
436
|
-
index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
493
|
+
index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
437
494
|
}
|
438
495
|
get _element() { return index.getElement(this); }
|
439
496
|
static get watchers() { return {
|
@@ -2,17 +2,18 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
10
|
require('./DataFetcher-313debd8.js');
|
11
|
-
require('./pesquisa-fetcher-
|
12
|
-
const index$1 = require('./index-
|
11
|
+
require('./pesquisa-fetcher-680e198f.js');
|
12
|
+
const index$1 = require('./index-1dfc7a6e.js');
|
13
13
|
require('./ISave-e91b70a7.js');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
|
+
require('./dataunit-fetcher-620b29a1.js');
|
16
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
18
|
require('./form-config-fetcher-2dd00e5b.js');
|
18
19
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
@@ -48,6 +49,9 @@ const SnkGuidesViewer = class {
|
|
48
49
|
this._formEditorConfigManager = undefined;
|
49
50
|
this._formEditorDataUnit = undefined;
|
50
51
|
this._fieldToGetFocus = undefined;
|
52
|
+
this._customEditors = undefined;
|
53
|
+
this._customRenders = undefined;
|
54
|
+
this._fieldsProps = {};
|
51
55
|
}
|
52
56
|
observeDataUnit() {
|
53
57
|
this.loadGuides(true);
|
@@ -78,6 +82,28 @@ const SnkGuidesViewer = class {
|
|
78
82
|
async findField() {
|
79
83
|
await fieldSearch.openFieldSearch(this._moreOptions, this._fieldSearch);
|
80
84
|
}
|
85
|
+
/**
|
86
|
+
* Registra um editor customizado para campos da grade e formulário
|
87
|
+
*/
|
88
|
+
async addCustomEditor(fieldName, customEditor) {
|
89
|
+
this._customEditors = Object.assign(Object.assign({}, this._customEditors), { [fieldName]: customEditor });
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* Registra um render customizado para colunas da grid.
|
93
|
+
*/
|
94
|
+
async addGridCustomRender(fieldName, customRender) {
|
95
|
+
this._customRenders = Object.assign(Object.assign({}, this._customRenders), { [fieldName]: customRender });
|
96
|
+
}
|
97
|
+
;
|
98
|
+
/**
|
99
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
100
|
+
*/
|
101
|
+
async setFieldProp(fieldName, propName, value) {
|
102
|
+
const newFieldsProps = {
|
103
|
+
[fieldName]: Object.assign(Object.assign({}, this._fieldsProps[fieldName]), { [propName]: value })
|
104
|
+
};
|
105
|
+
this._fieldsProps = Object.assign(Object.assign({}, this._fieldsProps), newFieldsProps);
|
106
|
+
}
|
81
107
|
/**
|
82
108
|
* Atribui o foco para o componente.
|
83
109
|
*/
|
@@ -226,7 +252,7 @@ const SnkGuidesViewer = class {
|
|
226
252
|
if (sheet == undefined) {
|
227
253
|
return;
|
228
254
|
}
|
229
|
-
return index.h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); } });
|
255
|
+
return index.h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps });
|
230
256
|
})));
|
231
257
|
}
|
232
258
|
wrapDetail(levels, content) {
|
@@ -268,14 +294,14 @@ const SnkGuidesViewer = class {
|
|
268
294
|
else {
|
269
295
|
detailBranch = this.selectedGuide;
|
270
296
|
}
|
271
|
-
content = this.wrapDetail(levels, index.h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId }));
|
297
|
+
content = this.wrapDetail(levels, index.h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders }));
|
272
298
|
}
|
273
299
|
else {
|
274
300
|
const cardId = this.selectedGuide.id;
|
275
301
|
const sheet = this._masterFormMetadata.getSheet(cardId);
|
276
302
|
if (sheet) {
|
277
303
|
const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
|
278
|
-
content = index.h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler() }, this.presentationMode == index$1.PresentationMode.SECONDARY && this.buildTaskBar());
|
304
|
+
content = index.h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps }, this.presentationMode == index$1.PresentationMode.SECONDARY && this.buildTaskBar());
|
279
305
|
}
|
280
306
|
}
|
281
307
|
return content;
|
@@ -478,7 +504,9 @@ const SnkGuidesViewer = class {
|
|
478
504
|
dataUnit: this.dataUnit,
|
479
505
|
recordsValidator: this.recordsValidator,
|
480
506
|
fieldToFocus: this._fieldToGetFocus,
|
481
|
-
onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this)
|
507
|
+
onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
|
508
|
+
propsCustomEditor: this._customEditors,
|
509
|
+
fieldsProps: this._fieldsProps
|
482
510
|
}), this.getContent())), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
|
483
511
|
}
|
484
512
|
static get watchers() { return {
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-05a1ba27.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
8
|
+
require('./SnkFormConfigManager-1b13bacd.js');
|
9
9
|
require('./ConfigStorage-942ce74b.js');
|
10
10
|
require('./form-config-fetcher-2dd00e5b.js');
|
11
11
|
require('./DataFetcher-313debd8.js');
|
@@ -14,15 +14,17 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
16
16
|
require('./field-search-f56aa7d6.js');
|
17
|
-
require('./taskbar-elements-
|
18
|
-
require('./index-
|
17
|
+
require('./taskbar-elements-9ad1f9c0.js');
|
18
|
+
require('./index-1dfc7a6e.js');
|
19
19
|
require('./index-102ba62d.js');
|
20
20
|
require('./constants-35ddd366.js');
|
21
|
-
require('./pesquisa-fetcher-
|
21
|
+
require('./pesquisa-fetcher-680e198f.js');
|
22
|
+
require('./ISave-e91b70a7.js');
|
22
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
24
|
+
require('./dataunit-fetcher-620b29a1.js');
|
23
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
26
|
+
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
24
27
|
require('./ResourceIDUtils-5ff86aa7.js');
|
25
|
-
require('./ISave-e91b70a7.js');
|
26
28
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
27
29
|
|
28
30
|
|