@sankhyalabs/sankhyablocks 8.15.1 → 8.16.0-dev.2
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-9479f618.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-0c7106a0.js} +88 -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-16791a2f.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-d82746e8.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 +8 -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 +85 -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-5a858363.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-f7e0ffc0.js} +84 -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-a327d22c.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-874da66f.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-0046959e.entry.js +1 -0
- package/dist/sankhyablocks/p-0e11ee18.entry.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-47b60deb.entry.js +1 -0
- package/dist/sankhyablocks/p-60e46675.entry.js +11 -0
- package/dist/sankhyablocks/p-6d4f4614.js +60 -0
- package/dist/sankhyablocks/p-6ded2076.entry.js +1 -0
- package/dist/sankhyablocks/p-7a337364.js +1 -0
- package/dist/sankhyablocks/p-7d9baaf4.entry.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-8c6b44ea.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-a4b1f1eb.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-b7c4feeb.entry.js +1 -0
- package/dist/sankhyablocks/p-b8cde0d8.entry.js +1 -0
- package/dist/sankhyablocks/p-c7cbad38.js +1 -0
- package/dist/sankhyablocks/p-e0b9f59a.entry.js +1 -0
- package/dist/sankhyablocks/p-e6210aec.js +1 -0
- package/dist/sankhyablocks/p-e9bbc3d5.entry.js +1 -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
@@ -1,24 +1,81 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import { ElementIDUtils, ApplicationContext, StringUtils
|
3
|
-
import {
|
4
|
-
import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
|
2
|
+
import { Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
|
3
|
+
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
5
4
|
import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
|
6
|
-
import { P as PresentationMode } from './index-
|
5
|
+
import { P as PresentationMode } from './index-3aa4977a.js';
|
7
6
|
import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
|
8
7
|
import { s as store } from './index-bdf75557.js';
|
9
|
-
import { S as SnkMultiSelectionListDataSource,
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter } from './IExporterProvider-5a858363.js';
|
10
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
10
|
import './DataFetcher-c1baf61d.js';
|
12
|
-
import './pesquisa-fetcher-
|
11
|
+
import './pesquisa-fetcher-03c8f919.js';
|
13
12
|
import './ISave-d8c8bc59.js';
|
14
13
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
14
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
15
|
+
import './dataunit-fetcher-f7e0ffc0.js';
|
15
16
|
import './filter-item-type.enum-d45e026f.js';
|
16
17
|
import './form-config-fetcher-30fb808f.js';
|
18
|
+
import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
|
17
19
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
18
20
|
import './PrintUtils-3e4ff0f5.js';
|
19
21
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
22
|
+
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
20
23
|
import './ResourceIDUtils-a114189a.js';
|
21
24
|
|
25
|
+
class ServerSideExporterProvider extends CommonsExporter {
|
26
|
+
getFilters() {
|
27
|
+
var _a;
|
28
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
|
29
|
+
}
|
30
|
+
getOrders() {
|
31
|
+
var _a;
|
32
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
|
33
|
+
}
|
34
|
+
getResourceURI() {
|
35
|
+
var _a;
|
36
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
37
|
+
}
|
38
|
+
getSelectedNumber() {
|
39
|
+
return this.dataUnit.getSelectionInfo().length;
|
40
|
+
}
|
41
|
+
getTotalRecords() {
|
42
|
+
var _a, _b, _c;
|
43
|
+
const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
44
|
+
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;
|
45
|
+
}
|
46
|
+
getSelectedIDs() {
|
47
|
+
return getSelectedIDs(this.dataUnit);
|
48
|
+
}
|
49
|
+
getOffset() {
|
50
|
+
return this.getExporterOffset(this.getPaginationInfo());
|
51
|
+
}
|
52
|
+
getPageSize() {
|
53
|
+
var _a;
|
54
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
|
55
|
+
}
|
56
|
+
getExportLimit() {
|
57
|
+
return 5000;
|
58
|
+
}
|
59
|
+
getRecordID() {
|
60
|
+
var _a, _b, _c;
|
61
|
+
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__;
|
62
|
+
}
|
63
|
+
getPaginationInfo() {
|
64
|
+
var _a;
|
65
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
66
|
+
}
|
67
|
+
getExporterOffset(paginationInfo) {
|
68
|
+
if (paginationInfo == undefined) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
const offset = paginationInfo.firstRecord;
|
72
|
+
if (offset > 0) {
|
73
|
+
return (offset - 1);
|
74
|
+
}
|
75
|
+
return offset;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
22
79
|
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}";
|
23
80
|
|
24
81
|
const SnkGrid = class {
|
@@ -26,6 +83,8 @@ const SnkGrid = class {
|
|
26
83
|
registerInstance(this, hostRef);
|
27
84
|
this.actionClick = createEvent(this, "actionClick", 7);
|
28
85
|
this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
|
86
|
+
this._customEditors = new Map();
|
87
|
+
this._customRenders = new Map();
|
29
88
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
30
89
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
31
90
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -45,6 +104,14 @@ const SnkGrid = class {
|
|
45
104
|
"snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
|
46
105
|
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
47
106
|
});
|
107
|
+
this.dataUnitInterceptor = {
|
108
|
+
interceptAction: async (action) => {
|
109
|
+
if (action.type === Action.METADATA_LOADED) {
|
110
|
+
return await this.interceptMetadataLoaded(action);
|
111
|
+
}
|
112
|
+
return action;
|
113
|
+
}
|
114
|
+
};
|
48
115
|
this._dataUnit = undefined;
|
49
116
|
this._dataState = undefined;
|
50
117
|
this._gridConfig = undefined;
|
@@ -71,6 +138,8 @@ const SnkGrid = class {
|
|
71
138
|
this.disablePersonalizedFilter = undefined;
|
72
139
|
this.gridLegacyConfigName = undefined;
|
73
140
|
this.filterBarLegacyConfigName = undefined;
|
141
|
+
this.autoLoad = undefined;
|
142
|
+
this.autoFocus = true;
|
74
143
|
}
|
75
144
|
/**
|
76
145
|
* Exibe a janela de configurações da grade.
|
@@ -115,6 +184,42 @@ const SnkGrid = class {
|
|
115
184
|
async findColumn() {
|
116
185
|
await openFieldSearch(this._moreOptions, this._columnSearch);
|
117
186
|
}
|
187
|
+
/**
|
188
|
+
* Registra um editor customizado para campos da grade e formulário
|
189
|
+
*/
|
190
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
191
|
+
if (this._grid) {
|
192
|
+
this._grid.addCustomEditor(fieldName, customEditor, detailContext);
|
193
|
+
return;
|
194
|
+
}
|
195
|
+
const newCustomEditors = new Map(this._customEditors);
|
196
|
+
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
197
|
+
this._customEditors = newCustomEditors;
|
198
|
+
}
|
199
|
+
/**
|
200
|
+
* Registra um render customizado para colunas da grid.
|
201
|
+
*/
|
202
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
203
|
+
if (this._grid) {
|
204
|
+
this._grid.addGridCustomRender(fieldName, customRender, detailContext);
|
205
|
+
return;
|
206
|
+
}
|
207
|
+
const newCustomRenders = new Map(this._customRenders);
|
208
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
209
|
+
this._customRenders = newCustomRenders;
|
210
|
+
}
|
211
|
+
/**
|
212
|
+
* Registra um formatador de valores para uma coluna da grid.
|
213
|
+
*/
|
214
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
215
|
+
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
216
|
+
}
|
217
|
+
/**
|
218
|
+
* Remove o formatador de valores de uma coluna da grid.
|
219
|
+
*/
|
220
|
+
async removeCustomValueFormatter(columnName) {
|
221
|
+
this._grid.removeCustomValueFormatter(columnName);
|
222
|
+
}
|
118
223
|
/**
|
119
224
|
* Atribui o foco para a grade.
|
120
225
|
*/
|
@@ -175,106 +280,31 @@ const SnkGrid = class {
|
|
175
280
|
});
|
176
281
|
evt.stopPropagation();
|
177
282
|
}
|
178
|
-
buildColumnsMetadata(gridColumns) {
|
179
|
-
const columnsMetadata = [];
|
180
|
-
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
181
|
-
var _a, _b;
|
182
|
-
/**
|
183
|
-
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
184
|
-
*/
|
185
|
-
if (column.hidden && column.name !== "RECDESP") {
|
186
|
-
return;
|
187
|
-
}
|
188
|
-
const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
189
|
-
const columnData = {
|
190
|
-
label: column.label,
|
191
|
-
id: column.name,
|
192
|
-
width: column.width,
|
193
|
-
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
194
|
-
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
195
|
-
};
|
196
|
-
columnsMetadata.push(columnData);
|
197
|
-
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
198
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
199
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
200
|
-
const descriptionColumn = {
|
201
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
202
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
203
|
-
width: 200,
|
204
|
-
type: DataType.TEXT,
|
205
|
-
userInterface: UserInterface.LONGTEXT
|
206
|
-
};
|
207
|
-
columnsMetadata.push(descriptionColumn);
|
208
|
-
}
|
209
|
-
});
|
210
|
-
return columnsMetadata || [];
|
211
|
-
}
|
212
|
-
getPaginationInfo() {
|
213
|
-
var _a;
|
214
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
215
|
-
}
|
216
|
-
getExporterOffset(paginationInfo) {
|
217
|
-
if (paginationInfo == undefined) {
|
218
|
-
return;
|
219
|
-
}
|
220
|
-
const offset = paginationInfo.firstRecord;
|
221
|
-
if (offset > 0) {
|
222
|
-
return (offset - 1);
|
223
|
-
}
|
224
|
-
return offset;
|
225
|
-
}
|
226
283
|
async dataExporterProviderStore() {
|
227
|
-
|
228
|
-
const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
|
229
|
-
const dataExporterProvider = {
|
230
|
-
getFilters: () => {
|
231
|
-
var _a;
|
232
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
|
233
|
-
},
|
234
|
-
getColumnsMetadata: async () => {
|
235
|
-
var _a;
|
236
|
-
const columnsState = await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState());
|
237
|
-
return this.buildColumnsMetadata(columnsState);
|
238
|
-
},
|
239
|
-
getOrders: () => {
|
240
|
-
var _a;
|
241
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
|
242
|
-
},
|
243
|
-
getResourceURI: () => {
|
244
|
-
var _a;
|
245
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
246
|
-
},
|
247
|
-
getSelectedNumber: () => {
|
248
|
-
var _a, _b;
|
249
|
-
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.length;
|
250
|
-
},
|
251
|
-
getTotalRecords: () => {
|
252
|
-
var _a, _b, _c;
|
253
|
-
const { total } = ((_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
254
|
-
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;
|
255
|
-
},
|
256
|
-
getSelectedIDs: () => {
|
257
|
-
return selectedIDs || [];
|
258
|
-
},
|
259
|
-
getOffset: () => {
|
260
|
-
return this.getExporterOffset(this.getPaginationInfo());
|
261
|
-
},
|
262
|
-
getLimit: () => {
|
263
|
-
var _a;
|
264
|
-
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
|
265
|
-
},
|
266
|
-
getRecordID: () => {
|
267
|
-
var _a, _b, _c;
|
268
|
-
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__;
|
269
|
-
}
|
270
|
-
};
|
284
|
+
const dataExporterProvider = new ServerSideExporterProvider(this._dataUnit, this._grid);
|
271
285
|
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
272
286
|
}
|
273
287
|
addElementID() {
|
274
288
|
const dataInfo = { dataUnit: this._dataUnit };
|
275
289
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
276
290
|
}
|
277
|
-
|
291
|
+
loadGridCustomFormatters(fields) {
|
292
|
+
if (!fields || !this._grid) {
|
293
|
+
return;
|
294
|
+
}
|
295
|
+
fields.forEach((field) => {
|
296
|
+
var _a;
|
297
|
+
if ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) {
|
298
|
+
this.addCustomValueFormatter(field.name, this._rmPrecisionCustomValueFormatter);
|
299
|
+
}
|
300
|
+
});
|
301
|
+
}
|
302
|
+
async interceptMetadataLoaded(action) {
|
303
|
+
this.loadGridCustomFormatters(action.payload.fields);
|
304
|
+
return action;
|
305
|
+
}
|
306
|
+
finishLoading() {
|
307
|
+
this._dataUnit.addInterceptor(this.dataUnitInterceptor);
|
278
308
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
279
309
|
this.addElementID();
|
280
310
|
if (this.columnFilterDataSource != undefined) {
|
@@ -282,6 +312,24 @@ const SnkGrid = class {
|
|
282
312
|
this.columnFilterDataSource.setDataUnit(this._dataUnit);
|
283
313
|
}
|
284
314
|
}
|
315
|
+
setCustomRenders() {
|
316
|
+
if (!this._grid) {
|
317
|
+
return;
|
318
|
+
}
|
319
|
+
for (const [fieldName, customRenderProps] of this._customRenders) {
|
320
|
+
this._grid.addGridCustomRender(fieldName, customRenderProps.customRender, customRenderProps.detailContext);
|
321
|
+
this._customRenders.delete(fieldName);
|
322
|
+
}
|
323
|
+
}
|
324
|
+
setCustomEditors() {
|
325
|
+
if (!this._grid) {
|
326
|
+
return;
|
327
|
+
}
|
328
|
+
for (const [fieldName, customEditorProps] of this._customEditors) {
|
329
|
+
this._grid.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
|
330
|
+
this._customEditors.delete(fieldName);
|
331
|
+
}
|
332
|
+
}
|
285
333
|
componentWillLoad() {
|
286
334
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
287
335
|
//TODO: substituir pelo metodo nativo closest
|
@@ -293,17 +341,15 @@ const SnkGrid = class {
|
|
293
341
|
if (!this._dataUnit) {
|
294
342
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
295
343
|
this._dataUnit = evt.detail;
|
296
|
-
this.
|
344
|
+
this.finishLoading();
|
297
345
|
});
|
298
346
|
}
|
299
347
|
else {
|
300
|
-
this.
|
348
|
+
this.finishLoading();
|
301
349
|
}
|
302
350
|
if (!this.messagesBuilder)
|
303
351
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
304
|
-
this._snkDataUnit.addEventListener("dataStateChange", (
|
305
|
-
this._dataState = evt.detail;
|
306
|
-
});
|
352
|
+
this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
|
307
353
|
this._snkDataUnit.addEventListener("cancelEdition", () => {
|
308
354
|
var _a;
|
309
355
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
@@ -314,9 +360,20 @@ const SnkGrid = class {
|
|
314
360
|
}
|
315
361
|
parent = parent.parentElement;
|
316
362
|
}
|
363
|
+
this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
|
317
364
|
this.addGridLegacyConfigName();
|
318
365
|
this.loadConfig();
|
319
366
|
}
|
367
|
+
componentDidRender() {
|
368
|
+
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
369
|
+
this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
|
370
|
+
this.setCustomRenders();
|
371
|
+
this.setCustomEditors();
|
372
|
+
}
|
373
|
+
async handleDataStateChange(evt) {
|
374
|
+
this._dataState = evt.detail;
|
375
|
+
this._rmPrecisionCustomValueFormatter.setDataState(this._dataState);
|
376
|
+
}
|
320
377
|
getHeaderDisabledButtons() {
|
321
378
|
var _a;
|
322
379
|
const disabledButtons = [];
|
@@ -429,7 +486,7 @@ const SnkGrid = class {
|
|
429
486
|
return undefined;
|
430
487
|
}
|
431
488
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
432
|
-
h(Fragment, null, 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 }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), 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' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === 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 }, 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 }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
489
|
+
h(Fragment, null, 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 }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), 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' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === 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 }, 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 }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
433
490
|
}
|
434
491
|
get _element() { return getElement(this); }
|
435
492
|
static get watchers() { return {
|
@@ -1,16 +1,17 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-d4554df9.js';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-efbe307f.js';
|
6
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
6
|
+
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
7
7
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
8
8
|
import './DataFetcher-c1baf61d.js';
|
9
|
-
import './pesquisa-fetcher-
|
10
|
-
import { P as PresentationMode } from './index-
|
9
|
+
import './pesquisa-fetcher-03c8f919.js';
|
10
|
+
import { P as PresentationMode } from './index-3aa4977a.js';
|
11
11
|
import './ISave-d8c8bc59.js';
|
12
12
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
|
+
import './dataunit-fetcher-f7e0ffc0.js';
|
14
15
|
import './filter-item-type.enum-d45e026f.js';
|
15
16
|
import './form-config-fetcher-30fb808f.js';
|
16
17
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
@@ -46,6 +47,9 @@ const SnkGuidesViewer = class {
|
|
46
47
|
this._formEditorConfigManager = undefined;
|
47
48
|
this._formEditorDataUnit = undefined;
|
48
49
|
this._fieldToGetFocus = undefined;
|
50
|
+
this._customEditors = undefined;
|
51
|
+
this._customRenders = undefined;
|
52
|
+
this._fieldsProps = {};
|
49
53
|
}
|
50
54
|
observeDataUnit() {
|
51
55
|
this.loadGuides(true);
|
@@ -76,6 +80,28 @@ const SnkGuidesViewer = class {
|
|
76
80
|
async findField() {
|
77
81
|
await openFieldSearch(this._moreOptions, this._fieldSearch);
|
78
82
|
}
|
83
|
+
/**
|
84
|
+
* Registra um editor customizado para campos da grade e formulário
|
85
|
+
*/
|
86
|
+
async addCustomEditor(fieldName, customEditor) {
|
87
|
+
this._customEditors = Object.assign(Object.assign({}, this._customEditors), { [fieldName]: customEditor });
|
88
|
+
}
|
89
|
+
/**
|
90
|
+
* Registra um render customizado para colunas da grid.
|
91
|
+
*/
|
92
|
+
async addGridCustomRender(fieldName, customRender) {
|
93
|
+
this._customRenders = Object.assign(Object.assign({}, this._customRenders), { [fieldName]: customRender });
|
94
|
+
}
|
95
|
+
;
|
96
|
+
/**
|
97
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
98
|
+
*/
|
99
|
+
async setFieldProp(fieldName, propName, value) {
|
100
|
+
const newFieldsProps = {
|
101
|
+
[fieldName]: Object.assign(Object.assign({}, this._fieldsProps[fieldName]), { [propName]: value })
|
102
|
+
};
|
103
|
+
this._fieldsProps = Object.assign(Object.assign({}, this._fieldsProps), newFieldsProps);
|
104
|
+
}
|
79
105
|
/**
|
80
106
|
* Atribui o foco para o componente.
|
81
107
|
*/
|
@@ -224,7 +250,7 @@ const SnkGuidesViewer = class {
|
|
224
250
|
if (sheet == undefined) {
|
225
251
|
return;
|
226
252
|
}
|
227
|
-
return 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); } });
|
253
|
+
return 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 });
|
228
254
|
})));
|
229
255
|
}
|
230
256
|
wrapDetail(levels, content) {
|
@@ -266,14 +292,14 @@ const SnkGuidesViewer = class {
|
|
266
292
|
else {
|
267
293
|
detailBranch = this.selectedGuide;
|
268
294
|
}
|
269
|
-
content = this.wrapDetail(levels, 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 }));
|
295
|
+
content = this.wrapDetail(levels, 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 }));
|
270
296
|
}
|
271
297
|
else {
|
272
298
|
const cardId = this.selectedGuide.id;
|
273
299
|
const sheet = this._masterFormMetadata.getSheet(cardId);
|
274
300
|
if (sheet) {
|
275
301
|
const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
|
276
|
-
content = 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 == PresentationMode.SECONDARY && this.buildTaskBar());
|
302
|
+
content = 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 == PresentationMode.SECONDARY && this.buildTaskBar());
|
277
303
|
}
|
278
304
|
}
|
279
305
|
return content;
|
@@ -476,7 +502,9 @@ const SnkGuidesViewer = class {
|
|
476
502
|
dataUnit: this.dataUnit,
|
477
503
|
recordsValidator: this.recordsValidator,
|
478
504
|
fieldToFocus: this._fieldToGetFocus,
|
479
|
-
onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this)
|
505
|
+
onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
|
506
|
+
propsCustomEditor: this._customEditors,
|
507
|
+
fieldsProps: this._fieldsProps
|
480
508
|
}), this.getContent())), 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 })));
|
481
509
|
}
|
482
510
|
static get watchers() { return {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-874da66f.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
|
-
import './SnkFormConfigManager-
|
4
|
+
import './SnkFormConfigManager-d4554df9.js';
|
5
5
|
import './ConfigStorage-86187da3.js';
|
6
6
|
import './form-config-fetcher-30fb808f.js';
|
7
7
|
import './DataFetcher-c1baf61d.js';
|
@@ -10,13 +10,15 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
10
10
|
import './filter-item-type.enum-d45e026f.js';
|
11
11
|
import '@sankhyalabs/ezui/dist/collection/utils/form';
|
12
12
|
import './field-search-efbe307f.js';
|
13
|
-
import './taskbar-elements-
|
14
|
-
import './index-
|
13
|
+
import './taskbar-elements-d59867f1.js';
|
14
|
+
import './index-3aa4977a.js';
|
15
15
|
import './index-bdf75557.js';
|
16
16
|
import './constants-8457af36.js';
|
17
|
-
import './pesquisa-fetcher-
|
17
|
+
import './pesquisa-fetcher-03c8f919.js';
|
18
|
+
import './ISave-d8c8bc59.js';
|
18
19
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
20
|
+
import './dataunit-fetcher-f7e0ffc0.js';
|
19
21
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
22
|
+
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
20
23
|
import './ResourceIDUtils-a114189a.js';
|
21
|
-
import './ISave-d8c8bc59.js';
|
22
24
|
import '@sankhyalabs/core/dist/dataunit/DataUnit';
|