@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-65214.0 → 0.0.0-bugfix-dev-kb-67792.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-e49214c6.js → ConfigStorage-0a690675.js} +0 -1
- package/dist/cjs/{SnkFormConfigManager-beebf47a.js → SnkFormConfigManager-d6d5db6d.js} +7 -8
- package/dist/cjs/{SnkMessageBuilder-cceebbae.js → SnkMessageBuilder-96b0f549.js} +13 -9
- package/dist/cjs/{IExporterProvider-10b7fed5.js → SnkMultiSelectionListDataSource-f79d220c.js} +4 -94
- package/dist/cjs/{index-1dfc7a6e.js → index-0922807b.js} +0 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-d4873076.js → pesquisa-fetcher-cba1b3d0.js} +180 -87
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +3 -5
- package/dist/cjs/snk-application.cjs.entry.js +12 -35
- package/dist/cjs/snk-attach.cjs.entry.js +46 -71
- package/dist/cjs/snk-crud.cjs.entry.js +10 -101
- package/dist/cjs/snk-data-exporter.cjs.entry.js +85 -315
- package/dist/cjs/snk-data-unit-559ac55c.js +462 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -12
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -50
- package/dist/cjs/snk-filter-bar.cjs.entry.js +12 -7
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +0 -67
- package/dist/cjs/snk-form.cjs.entry.js +7 -52
- package/dist/cjs/snk-grid.cjs.entry.js +110 -167
- package/dist/cjs/{snk-guides-viewer-aafc3073.js → snk-guides-viewer-bfcad2d6.js} +10 -43
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +40 -268
- package/dist/cjs/snk-taskbar.cjs.entry.js +3 -4
- package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-3ecd1278.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +11 -35
- package/dist/collection/components/snk-attach/snk-attach.js +44 -67
- package/dist/collection/components/snk-crud/snk-crud.js +7 -305
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -136
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -161
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +7 -134
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -54
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +52 -59
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +0 -62
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +219 -540
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +11 -23
- package/dist/collection/components/snk-form/snk-form.js +5 -102
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -7
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.css +0 -2
- package/dist/collection/components/snk-grid/snk-grid.js +102 -241
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +20 -406
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
- package/dist/collection/lib/@types/index.js +0 -5
- package/dist/collection/lib/configs/ConfigStorage.js +0 -1
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +3 -7
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +0 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +0 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +13 -11
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +4 -53
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +34 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
- package/dist/collection/lib/message/SnkMessageBuilder.js +12 -5
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +0 -2
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -2
- package/dist/components/ConfigStorage.js +0 -1
- package/dist/components/SnkFormConfigManager.js +6 -7
- package/dist/components/SnkMessageBuilder.js +13 -9
- package/dist/components/dataunit-fetcher.js +182 -84
- package/dist/components/{IExporterProvider.js → field-search.js} +6 -93
- package/dist/components/index2.js +33 -198
- package/dist/components/index3.js +199 -0
- package/dist/components/snk-actions-button2.js +11 -4
- package/dist/components/snk-application2.js +9 -31
- package/dist/components/snk-attach2.js +41 -65
- package/dist/components/snk-crud.js +11 -110
- package/dist/components/snk-data-exporter2.js +85 -309
- package/dist/components/snk-data-unit2.js +217 -487
- package/dist/components/snk-detail-view2.js +14 -96
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +11 -7
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form-view2.js +1 -72
- package/dist/components/snk-form.js +6 -53
- package/dist/components/snk-grid2.js +108 -170
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +25 -263
- package/dist/components/snk-taskbar2.js +5 -6
- package/dist/esm/{ConfigStorage-e476378d.js → ConfigStorage-8c2ddac8.js} +0 -1
- package/dist/esm/{SnkFormConfigManager-298cd647.js → SnkFormConfigManager-c01b9d9d.js} +7 -8
- package/dist/esm/{SnkMessageBuilder-ae87b754.js → SnkMessageBuilder-72423074.js} +13 -9
- package/dist/esm/{IExporterProvider-d597f27d.js → SnkMultiSelectionListDataSource-a4805051.js} +5 -93
- package/dist/esm/{index-3aa4977a.js → index-0ece87a6.js} +1 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-3d2ec959.js → pesquisa-fetcher-34a8b8be.js} +181 -83
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +3 -5
- package/dist/esm/snk-application.entry.js +11 -34
- package/dist/esm/snk-attach.entry.js +41 -66
- package/dist/esm/snk-crud.entry.js +10 -101
- package/dist/esm/snk-data-exporter.entry.js +86 -316
- package/dist/esm/snk-data-unit-44215df7.js +460 -0
- package/dist/esm/snk-data-unit.entry.js +2 -12
- package/dist/esm/snk-detail-view.entry.js +10 -50
- package/dist/esm/snk-filter-bar.entry.js +12 -7
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +0 -67
- package/dist/esm/snk-form.entry.js +7 -52
- package/dist/esm/snk-grid.entry.js +108 -165
- package/dist/esm/{snk-guides-viewer-62124f3d.js → snk-guides-viewer-edeac29f.js} +10 -43
- package/dist/esm/snk-guides-viewer.entry.js +7 -9
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +28 -256
- package/dist/esm/snk-taskbar.entry.js +3 -4
- package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-2473c8ac.js} +3 -3
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +1 -0
- package/dist/sankhyablocks/p-176c3491.entry.js +1 -0
- package/dist/sankhyablocks/p-37e5d563.js +65 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/{p-9dfda04a.entry.js → p-41c2c191.entry.js} +1 -1
- package/dist/sankhyablocks/p-46e55a95.entry.js +1 -0
- package/dist/sankhyablocks/p-4e728357.entry.js +1 -0
- package/dist/sankhyablocks/p-5571bdfe.js +1 -0
- package/dist/sankhyablocks/p-5630574e.js +1 -0
- package/dist/sankhyablocks/p-5f8c0426.entry.js +1 -0
- package/dist/sankhyablocks/p-80c64add.entry.js +1 -0
- package/dist/sankhyablocks/p-86af4cc2.js +1 -0
- package/dist/sankhyablocks/p-8b690717.js +1 -0
- package/dist/sankhyablocks/{p-3287a6cc.js → p-96621231.js} +1 -1
- package/dist/sankhyablocks/p-a1832166.entry.js +1 -0
- package/dist/sankhyablocks/p-a809d944.entry.js +1 -0
- package/dist/sankhyablocks/p-a97226f6.entry.js +1 -0
- package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
- package/dist/sankhyablocks/{p-7e7a7473.js → p-ae4fc9a9.js} +1 -1
- package/dist/sankhyablocks/{p-bd008859.entry.js → p-c2ae0fab.entry.js} +1 -1
- package/dist/sankhyablocks/p-c5a9a5d9.entry.js +1 -0
- package/dist/sankhyablocks/p-c5aa7d70.entry.js +11 -0
- package/dist/sankhyablocks/p-cb0147ab.entry.js +1 -0
- package/dist/sankhyablocks/p-f0145e3b.js +1 -0
- package/dist/sankhyablocks/p-f03e4199.entry.js +1 -0
- package/dist/sankhyablocks/p-f607db63.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +3 -7
- package/dist/types/components/snk-attach/snk-attach.d.ts +9 -11
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -45
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -23
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +3 -28
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -24
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +4 -24
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -4
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +0 -21
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +3 -67
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -4
- package/dist/types/components/snk-form/snk-form.d.ts +0 -14
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +6 -46
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -62
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +4 -261
- package/dist/types/lib/@types/index.d.ts +0 -5
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +0 -6
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +0 -3
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/RecordIDUtils-3735135c.js +0 -43
- package/dist/cjs/pesquisa-fetcher-a1d0353f.js +0 -166
- package/dist/cjs/snk-data-unit-f0221097.js +0 -690
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +0 -1
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +0 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +0 -97
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +0 -74
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +0 -1
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +0 -58
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +0 -55
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +0 -88
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +0 -20
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +0 -38
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +0 -24
- package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +0 -18
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +0 -35
- package/dist/collection/lib/dataUnit/ValueFormatter.js +0 -4
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +0 -22
- package/dist/components/ISave.js +0 -47
- package/dist/components/pesquisa-fetcher.js +0 -164
- package/dist/esm/RecordIDUtils-87d02110.js +0 -41
- package/dist/esm/pesquisa-fetcher-a87445a0.js +0 -164
- package/dist/esm/snk-data-unit-1ef94aef.js +0 -688
- package/dist/sankhyablocks/p-091ce761.js +0 -60
- package/dist/sankhyablocks/p-0c68f40f.entry.js +0 -1
- package/dist/sankhyablocks/p-162b9a59.entry.js +0 -11
- package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
- package/dist/sankhyablocks/p-25f1fc39.js +0 -6
- package/dist/sankhyablocks/p-2e9c764c.entry.js +0 -1
- package/dist/sankhyablocks/p-30cf616e.js +0 -1
- package/dist/sankhyablocks/p-421bec84.entry.js +0 -1
- package/dist/sankhyablocks/p-42f7b05d.entry.js +0 -1
- package/dist/sankhyablocks/p-51999ab5.entry.js +0 -1
- package/dist/sankhyablocks/p-52a6a293.entry.js +0 -1
- package/dist/sankhyablocks/p-5f016aed.js +0 -1
- package/dist/sankhyablocks/p-62f34e6f.entry.js +0 -1
- package/dist/sankhyablocks/p-684a2590.entry.js +0 -1
- package/dist/sankhyablocks/p-70001ac1.js +0 -1
- package/dist/sankhyablocks/p-74c665d5.entry.js +0 -1
- package/dist/sankhyablocks/p-76a65660.js +0 -1
- package/dist/sankhyablocks/p-7c4aabe2.js +0 -1
- package/dist/sankhyablocks/p-8c1ff936.entry.js +0 -1
- package/dist/sankhyablocks/p-939e15d3.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-c273d6ee.js +0 -1
- package/dist/sankhyablocks/p-d65d98ed.entry.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +0 -4
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +0 -4
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -14
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +0 -12
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +0 -5
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +0 -17
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +0 -17
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +0 -77
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +0 -4
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +0 -3
- package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +0 -3
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +0 -11
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +0 -2
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +0 -3
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +0 -10
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +0 -20
|
@@ -11,21 +11,16 @@ import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/
|
|
|
11
11
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
|
12
12
|
import { SnkFormConfigManager } from '../snk-form-config/SnkFormConfigManager';
|
|
13
13
|
import { REGULAR_DEFAULT_BTNS, REGULAR_SELECTED_BTNS } from './regular-buttons';
|
|
14
|
-
import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
|
|
15
|
-
import ClientSideExporterProvider from '../snk-data-exporter/providers/ClientSideExporterProvider';
|
|
16
|
-
import store from "../../lib/store";
|
|
17
14
|
export class SnkSimpleCrud {
|
|
18
15
|
constructor() {
|
|
19
16
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
|
20
17
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
|
21
18
|
this._formConfigFetcher = new FormConfigFetcher();
|
|
22
|
-
this._customEditors = new Map();
|
|
23
|
-
this._customRenders = new Map();
|
|
24
19
|
this._taskbarProcessor = new TaskbarProcessor({
|
|
25
|
-
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false,
|
|
26
|
-
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false,
|
|
27
|
-
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true,
|
|
28
|
-
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true,
|
|
20
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, TaskbarElement.GRID_MODE),
|
|
21
|
+
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, TaskbarElement.FORM_MODE),
|
|
22
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, TaskbarElement.GRID_MODE),
|
|
23
|
+
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, TaskbarElement.FORM_MODE),
|
|
29
24
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
30
25
|
});
|
|
31
26
|
this._showPopUpGridConfig = false;
|
|
@@ -36,15 +31,12 @@ export class SnkSimpleCrud {
|
|
|
36
31
|
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
37
32
|
this.dataState = undefined;
|
|
38
33
|
this.dataUnit = undefined;
|
|
39
|
-
this.entityName = undefined;
|
|
40
34
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
|
41
35
|
this.gridConfig = undefined;
|
|
42
36
|
this.formConfig = undefined;
|
|
43
37
|
this._formFields = [];
|
|
44
|
-
this._fieldsProps = new Map();
|
|
45
38
|
this.multipleSelection = undefined;
|
|
46
39
|
this.useCancelConfirm = true;
|
|
47
|
-
this.pageSize = 150;
|
|
48
40
|
this.resourceID = undefined;
|
|
49
41
|
this.taskbarManager = undefined;
|
|
50
42
|
this.messagesBuilder = undefined;
|
|
@@ -55,34 +47,6 @@ export class SnkSimpleCrud {
|
|
|
55
47
|
this.gridLegacyConfigName = undefined;
|
|
56
48
|
this.formLegacyConfigName = undefined;
|
|
57
49
|
this.ignoreReadOnlyFormFields = false;
|
|
58
|
-
this.autoFocus = true;
|
|
59
|
-
this.domainMessagesBuilder = undefined;
|
|
60
|
-
this.autoLoad = undefined;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Registra um editor customizado para campos da grade e formulário.
|
|
64
|
-
*/
|
|
65
|
-
async addCustomEditor(fieldName, customEditor) {
|
|
66
|
-
if (this._grid && this._form) {
|
|
67
|
-
this._grid.addCustomEditor(fieldName, customEditor);
|
|
68
|
-
this._form.addCustomEditor(fieldName, customEditor);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const newCustomEditors = new Map(this._customEditors);
|
|
72
|
-
newCustomEditors.set(fieldName, customEditor);
|
|
73
|
-
this._customEditors = newCustomEditors;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Registra um render customizado para colunas da grid.
|
|
77
|
-
*/
|
|
78
|
-
async addGridCustomRender(fieldName, customRender) {
|
|
79
|
-
if (this._grid) {
|
|
80
|
-
this._grid.addGridCustomRender(fieldName, customRender);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const newCustomRenders = new Map(this._customRenders);
|
|
84
|
-
newCustomRenders.set(fieldName, customRender);
|
|
85
|
-
this._customRenders = newCustomRenders;
|
|
86
50
|
}
|
|
87
51
|
handleResourceIDChanged(newValue, oldValue) {
|
|
88
52
|
if (StringUtils.isEmpty(newValue)) {
|
|
@@ -94,30 +58,9 @@ export class SnkSimpleCrud {
|
|
|
94
58
|
this.loadFormConfig(true);
|
|
95
59
|
this.loadGridConfig(true);
|
|
96
60
|
}
|
|
97
|
-
|
|
98
|
-
* Registra um formatador de valores para uma coluna da grid.
|
|
99
|
-
*/
|
|
100
|
-
async addCustomValueFormatter(columnName, customFormatter) {
|
|
101
|
-
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Remove o formatador de valores de uma coluna da grid.
|
|
105
|
-
*/
|
|
106
|
-
async removeCustomValueFormatter(columnName) {
|
|
107
|
-
this._grid.removeCustomValueFormatter(columnName);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
111
|
-
*/
|
|
112
|
-
async setFieldProp(fieldName, propName, value) {
|
|
113
|
-
const newCustomFieldProps = new Map(this._fieldsProps);
|
|
114
|
-
const currentProps = this._fieldsProps.get(fieldName);
|
|
115
|
-
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
|
116
|
-
this._fieldsProps = newCustomFieldProps;
|
|
117
|
-
}
|
|
118
|
-
getButtons(selected, extraButtons) {
|
|
61
|
+
getButtons(selected, changeModeBtn) {
|
|
119
62
|
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
120
|
-
.concat(
|
|
63
|
+
.concat(changeModeBtn));
|
|
121
64
|
}
|
|
122
65
|
addConfigButton(buttons) {
|
|
123
66
|
if (this.configName === undefined) {
|
|
@@ -157,19 +100,15 @@ export class SnkSimpleCrud {
|
|
|
157
100
|
}
|
|
158
101
|
evt.stopPropagation();
|
|
159
102
|
}
|
|
160
|
-
async onChangeEntityName(newValue) {
|
|
161
|
-
if (this.dataUnit)
|
|
162
|
-
return;
|
|
163
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
164
|
-
this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
|
|
165
|
-
}
|
|
166
103
|
onModeChange() {
|
|
167
104
|
if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
|
|
168
105
|
this.initInMemoryDataUnit();
|
|
169
106
|
}
|
|
170
107
|
}
|
|
171
108
|
observeDataState(newValue, oldValue) {
|
|
172
|
-
|
|
109
|
+
if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
|
|
110
|
+
this.dataStateChange.emit(newValue);
|
|
111
|
+
}
|
|
173
112
|
}
|
|
174
113
|
async observeFormLegacy(newValue, oldValue) {
|
|
175
114
|
await this.handleUpdateFormLegacyConfig(newValue, oldValue);
|
|
@@ -177,29 +116,6 @@ export class SnkSimpleCrud {
|
|
|
177
116
|
async observeGridLegacy(newValue, oldValue) {
|
|
178
117
|
await this.handleUpdateGridLegacyConfig(newValue, oldValue);
|
|
179
118
|
}
|
|
180
|
-
async handleDataStateChange(newValue, oldValue) {
|
|
181
|
-
if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
|
|
182
|
-
this.dataStateChange.emit(newValue);
|
|
183
|
-
}
|
|
184
|
-
await this.processRmPrecision();
|
|
185
|
-
}
|
|
186
|
-
async processRmPrecision() {
|
|
187
|
-
var _a, _b;
|
|
188
|
-
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
|
189
|
-
for (const field of fieldsWithRmPrecision || []) {
|
|
190
|
-
if (!field) {
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
const rmPrecision = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata) === null || _b === void 0 ? void 0 : _b.getProp('rm_precision', field);
|
|
194
|
-
if (!rmPrecision && rmPrecision !== 0) {
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
await this.setFieldProp(field, 'precision', rmPrecision);
|
|
198
|
-
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
|
199
|
-
}
|
|
200
|
-
;
|
|
201
|
-
this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
|
|
202
|
-
}
|
|
203
119
|
async handleUpdateGridLegacyConfig(newValue, oldValue) {
|
|
204
120
|
if (newValue == undefined || newValue == oldValue) {
|
|
205
121
|
return;
|
|
@@ -296,7 +212,6 @@ export class SnkSimpleCrud {
|
|
|
296
212
|
}
|
|
297
213
|
async componentWillRender() {
|
|
298
214
|
this._resourceID = await this.application.getResourceID();
|
|
299
|
-
this.dataExporterProviderStore();
|
|
300
215
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
|
301
216
|
if (this.configName === undefined) {
|
|
302
217
|
return;
|
|
@@ -308,70 +223,32 @@ export class SnkSimpleCrud {
|
|
|
308
223
|
this.loadGridConfig();
|
|
309
224
|
this.loadFormConfig();
|
|
310
225
|
}
|
|
311
|
-
componentDidRender() {
|
|
312
|
-
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
|
313
|
-
this.addGridCustomValueFormattters();
|
|
314
|
-
this.setFieldsProps();
|
|
315
|
-
this.setCustomRenders();
|
|
316
|
-
this.setCustomEditors();
|
|
317
|
-
}
|
|
318
226
|
componentWillLoad() {
|
|
319
227
|
this.processMetadata();
|
|
320
228
|
this.onModeChange();
|
|
321
229
|
this.configDatasource();
|
|
322
|
-
this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
|
|
323
230
|
}
|
|
324
231
|
componentDidLoad() {
|
|
325
232
|
CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
|
326
233
|
}
|
|
327
|
-
setCustomRenders() {
|
|
328
|
-
if (!this._grid) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
for (const [fieldName, customRender] of this._customRenders) {
|
|
332
|
-
this._grid.addGridCustomRender(fieldName, customRender);
|
|
333
|
-
this._customRenders.delete(fieldName);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
setCustomEditors() {
|
|
337
|
-
if (!this._grid || !this._form) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
for (const [fieldName, customEditor] of this._customEditors) {
|
|
341
|
-
this._grid.addCustomEditor(fieldName, customEditor);
|
|
342
|
-
this._form.addCustomEditor(fieldName, customEditor);
|
|
343
|
-
this._customEditors.delete(fieldName);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
234
|
configDatasource() {
|
|
347
235
|
this._multiSelectionListDataSource.setApplication(this.application);
|
|
348
236
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
|
349
237
|
}
|
|
350
|
-
setFieldsProps() {
|
|
351
|
-
if (!this._form) {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
for (const [fieldName, props] of this._fieldsProps) {
|
|
355
|
-
for (const prop in props) {
|
|
356
|
-
this._form.setFieldProp(fieldName, prop, props[prop]);
|
|
357
|
-
}
|
|
358
|
-
this._fieldsProps.delete(fieldName);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
238
|
getTaskBarId() {
|
|
362
|
-
var _a, _b;
|
|
239
|
+
var _a, _b, _c;
|
|
363
240
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
|
364
241
|
return "snkSimpleCrudTaskbar.finish_edition";
|
|
365
242
|
}
|
|
366
243
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
|
367
244
|
!this.dataState.selectionInfo.isAllRecords() &&
|
|
368
|
-
this.dataState.selectionInfo.length > 0) {
|
|
245
|
+
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
369
246
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
|
370
247
|
}
|
|
371
248
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
|
372
249
|
}
|
|
373
250
|
initInMemoryDataUnit() {
|
|
374
|
-
this._inMemoryLoader = new InMemoryLoader(this._metadata
|
|
251
|
+
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
|
375
252
|
this.dataUnit = this._inMemoryLoader.dataUnit;
|
|
376
253
|
this.dataUnitReady.emit(this.dataUnit);
|
|
377
254
|
}
|
|
@@ -410,11 +287,12 @@ export class SnkSimpleCrud {
|
|
|
410
287
|
var _a;
|
|
411
288
|
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
|
412
289
|
}
|
|
413
|
-
|
|
290
|
+
updateConfig() {
|
|
414
291
|
if (this._formConfigManager == undefined) {
|
|
415
292
|
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
416
293
|
}
|
|
417
294
|
this._formConfigManager.setConfig(this.formConfig);
|
|
295
|
+
return;
|
|
418
296
|
}
|
|
419
297
|
processMetadata() {
|
|
420
298
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
|
@@ -446,28 +324,11 @@ export class SnkSimpleCrud {
|
|
|
446
324
|
};
|
|
447
325
|
}
|
|
448
326
|
}
|
|
449
|
-
addGridCustomValueFormattters() {
|
|
450
|
-
var _a, _b, _c;
|
|
451
|
-
const metadataFields = ((_a = this._metadata) === null || _a === void 0 ? void 0 : _a.fields) || ((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.fields);
|
|
452
|
-
if (!metadataFields) {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
const fieldsWithRmPrecision = [];
|
|
456
|
-
metadataFields.forEach((field) => {
|
|
457
|
-
var _a;
|
|
458
|
-
if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
|
|
459
|
-
fieldsWithRmPrecision.push(field.name);
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
fieldsWithRmPrecision.forEach(field => {
|
|
463
|
-
this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
327
|
onDataStateChange(evt) {
|
|
467
328
|
this.dataState = Object.assign({}, evt.detail);
|
|
468
329
|
}
|
|
469
330
|
getTaskBarDisabledButtons() {
|
|
470
|
-
var _a, _b, _c, _d
|
|
331
|
+
var _a, _b, _c, _d;
|
|
471
332
|
const disabledButtons = [];
|
|
472
333
|
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
|
|
473
334
|
disabledButtons.push(TaskbarElement.NEXT);
|
|
@@ -478,9 +339,6 @@ export class SnkSimpleCrud {
|
|
|
478
339
|
if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
|
|
479
340
|
disabledButtons.push(TaskbarElement.FORM_MODE);
|
|
480
341
|
}
|
|
481
|
-
if (((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.length) > 1) {
|
|
482
|
-
disabledButtons.push(TaskbarElement.CLONE);
|
|
483
|
-
}
|
|
484
342
|
return disabledButtons;
|
|
485
343
|
}
|
|
486
344
|
handleCancelEdit() {
|
|
@@ -624,23 +482,9 @@ export class SnkSimpleCrud {
|
|
|
624
482
|
.then(() => {
|
|
625
483
|
this.setGridConfig(config);
|
|
626
484
|
this.closeGridConfig();
|
|
627
|
-
this.dataExporterProviderStore();
|
|
628
485
|
});
|
|
629
486
|
evt.stopPropagation();
|
|
630
487
|
}
|
|
631
|
-
async dataExporterProviderStore() {
|
|
632
|
-
if (this.dataUnit == undefined) {
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
if (this._grid == undefined) {
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
|
|
639
|
-
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
|
|
640
|
-
}
|
|
641
|
-
getDataExporterStoreKey() {
|
|
642
|
-
return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
|
|
643
|
-
}
|
|
644
488
|
setGridConfig(config) {
|
|
645
489
|
this.gridConfig = config;
|
|
646
490
|
CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
|
@@ -656,15 +500,6 @@ export class SnkSimpleCrud {
|
|
|
656
500
|
closeFormConfig() {
|
|
657
501
|
this._showFormConfig = false;
|
|
658
502
|
}
|
|
659
|
-
getPageSize() {
|
|
660
|
-
if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
|
|
661
|
-
return 0;
|
|
662
|
-
}
|
|
663
|
-
if (this.pageSize == undefined) {
|
|
664
|
-
return 150;
|
|
665
|
-
}
|
|
666
|
-
return this.pageSize;
|
|
667
|
-
}
|
|
668
503
|
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
|
669
504
|
handleShowFormConfig() {
|
|
670
505
|
return this._showFormConfig && !this.formLegacyConfigName;
|
|
@@ -673,30 +508,22 @@ export class SnkSimpleCrud {
|
|
|
673
508
|
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
|
674
509
|
}
|
|
675
510
|
getFormConfig() {
|
|
676
|
-
var _a;
|
|
677
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
511
|
+
var _a, _b;
|
|
512
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
678
513
|
if (!this.configName && !configFromManager) {
|
|
679
514
|
return this.formConfig;
|
|
680
515
|
}
|
|
681
516
|
return configFromManager;
|
|
682
517
|
}
|
|
683
|
-
updateFormConfig() {
|
|
684
|
-
const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
|
685
|
-
this.setFormConfig(newConfig, true);
|
|
686
|
-
if (this._formConfigManager == undefined) {
|
|
687
|
-
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
688
|
-
}
|
|
689
|
-
this._formConfigManager.setConfig(this.formConfig);
|
|
690
|
-
}
|
|
691
518
|
/* istanbul ignore next */
|
|
692
519
|
render() {
|
|
693
520
|
var _a;
|
|
694
521
|
if (this.dataUnit == undefined) {
|
|
695
522
|
return;
|
|
696
523
|
}
|
|
697
|
-
return (h("snk-data-unit", {
|
|
524
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
698
525
|
? undefined
|
|
699
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab
|
|
526
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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.resolveResourceID() }))));
|
|
700
527
|
}
|
|
701
528
|
static get is() { return "snk-simple-crud"; }
|
|
702
529
|
static get encapsulation() { return "scoped"; }
|
|
@@ -752,23 +579,6 @@ export class SnkSimpleCrud {
|
|
|
752
579
|
"text": ""
|
|
753
580
|
}
|
|
754
581
|
},
|
|
755
|
-
"entityName": {
|
|
756
|
-
"type": "string",
|
|
757
|
-
"mutable": false,
|
|
758
|
-
"complexType": {
|
|
759
|
-
"original": "string",
|
|
760
|
-
"resolved": "string",
|
|
761
|
-
"references": {}
|
|
762
|
-
},
|
|
763
|
-
"required": false,
|
|
764
|
-
"optional": false,
|
|
765
|
-
"docs": {
|
|
766
|
-
"tags": [],
|
|
767
|
-
"text": "Define o nome da entidade que o componente vai utilizar para fazer as opera\u00E7\u00F5es de CRUD"
|
|
768
|
-
},
|
|
769
|
-
"attribute": "entity-name",
|
|
770
|
-
"reflect": false
|
|
771
|
-
},
|
|
772
582
|
"mode": {
|
|
773
583
|
"type": "number",
|
|
774
584
|
"mutable": false,
|
|
@@ -867,24 +677,6 @@ export class SnkSimpleCrud {
|
|
|
867
677
|
"reflect": false,
|
|
868
678
|
"defaultValue": "true"
|
|
869
679
|
},
|
|
870
|
-
"pageSize": {
|
|
871
|
-
"type": "number",
|
|
872
|
-
"mutable": false,
|
|
873
|
-
"complexType": {
|
|
874
|
-
"original": "number",
|
|
875
|
-
"resolved": "number",
|
|
876
|
-
"references": {}
|
|
877
|
-
},
|
|
878
|
-
"required": false,
|
|
879
|
-
"optional": false,
|
|
880
|
-
"docs": {
|
|
881
|
-
"tags": [],
|
|
882
|
-
"text": "Determina quantas linhas s\u00E3o retornadas por p\u00E1gina."
|
|
883
|
-
},
|
|
884
|
-
"attribute": "page-size",
|
|
885
|
-
"reflect": false,
|
|
886
|
-
"defaultValue": "150"
|
|
887
|
-
},
|
|
888
680
|
"resourceID": {
|
|
889
681
|
"type": "string",
|
|
890
682
|
"mutable": false,
|
|
@@ -1068,58 +860,6 @@ export class SnkSimpleCrud {
|
|
|
1068
860
|
"attribute": "ignore-read-only-form-fields",
|
|
1069
861
|
"reflect": false,
|
|
1070
862
|
"defaultValue": "false"
|
|
1071
|
-
},
|
|
1072
|
-
"autoFocus": {
|
|
1073
|
-
"type": "boolean",
|
|
1074
|
-
"mutable": false,
|
|
1075
|
-
"complexType": {
|
|
1076
|
-
"original": "boolean",
|
|
1077
|
-
"resolved": "boolean",
|
|
1078
|
-
"references": {}
|
|
1079
|
-
},
|
|
1080
|
-
"required": false,
|
|
1081
|
-
"optional": true,
|
|
1082
|
-
"docs": {
|
|
1083
|
-
"tags": [],
|
|
1084
|
-
"text": "Define se a grid ser\u00E1 focada ao ser carregada."
|
|
1085
|
-
},
|
|
1086
|
-
"attribute": "auto-focus",
|
|
1087
|
-
"reflect": false,
|
|
1088
|
-
"defaultValue": "true"
|
|
1089
|
-
},
|
|
1090
|
-
"domainMessagesBuilder": {
|
|
1091
|
-
"type": "string",
|
|
1092
|
-
"mutable": false,
|
|
1093
|
-
"complexType": {
|
|
1094
|
-
"original": "string",
|
|
1095
|
-
"resolved": "string",
|
|
1096
|
-
"references": {}
|
|
1097
|
-
},
|
|
1098
|
-
"required": false,
|
|
1099
|
-
"optional": false,
|
|
1100
|
-
"docs": {
|
|
1101
|
-
"tags": [],
|
|
1102
|
-
"text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
|
|
1103
|
-
},
|
|
1104
|
-
"attribute": "domain-messages-builder",
|
|
1105
|
-
"reflect": false
|
|
1106
|
-
},
|
|
1107
|
-
"autoLoad": {
|
|
1108
|
-
"type": "boolean",
|
|
1109
|
-
"mutable": false,
|
|
1110
|
-
"complexType": {
|
|
1111
|
-
"original": "boolean",
|
|
1112
|
-
"resolved": "boolean",
|
|
1113
|
-
"references": {}
|
|
1114
|
-
},
|
|
1115
|
-
"required": false,
|
|
1116
|
-
"optional": true,
|
|
1117
|
-
"docs": {
|
|
1118
|
-
"tags": [],
|
|
1119
|
-
"text": "Define se a carga dos dados ser\u00E1 feita assim que o componente for carregado."
|
|
1120
|
-
},
|
|
1121
|
-
"attribute": "auto-load",
|
|
1122
|
-
"reflect": false
|
|
1123
863
|
}
|
|
1124
864
|
};
|
|
1125
865
|
}
|
|
@@ -1131,8 +871,7 @@ export class SnkSimpleCrud {
|
|
|
1131
871
|
"_config": {},
|
|
1132
872
|
"_fieldToGetFocus": {},
|
|
1133
873
|
"_customContainerId": {},
|
|
1134
|
-
"_formFields": {}
|
|
1135
|
-
"_fieldsProps": {}
|
|
874
|
+
"_formFields": {}
|
|
1136
875
|
};
|
|
1137
876
|
}
|
|
1138
877
|
static get events() {
|
|
@@ -1247,128 +986,6 @@ export class SnkSimpleCrud {
|
|
|
1247
986
|
}
|
|
1248
987
|
static get methods() {
|
|
1249
988
|
return {
|
|
1250
|
-
"addCustomEditor": {
|
|
1251
|
-
"complexType": {
|
|
1252
|
-
"signature": "(fieldName: string, customEditor: ICustomEditor) => Promise<void>",
|
|
1253
|
-
"parameters": [{
|
|
1254
|
-
"tags": [],
|
|
1255
|
-
"text": ""
|
|
1256
|
-
}, {
|
|
1257
|
-
"tags": [],
|
|
1258
|
-
"text": ""
|
|
1259
|
-
}],
|
|
1260
|
-
"references": {
|
|
1261
|
-
"Promise": {
|
|
1262
|
-
"location": "global"
|
|
1263
|
-
},
|
|
1264
|
-
"ICustomEditor": {
|
|
1265
|
-
"location": "import",
|
|
1266
|
-
"path": "@sankhyalabs/ezui/dist/types/utils"
|
|
1267
|
-
}
|
|
1268
|
-
},
|
|
1269
|
-
"return": "Promise<void>"
|
|
1270
|
-
},
|
|
1271
|
-
"docs": {
|
|
1272
|
-
"text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
|
|
1273
|
-
"tags": []
|
|
1274
|
-
}
|
|
1275
|
-
},
|
|
1276
|
-
"addGridCustomRender": {
|
|
1277
|
-
"complexType": {
|
|
1278
|
-
"signature": "(fieldName: string, customRender: ICustomRender) => Promise<void>",
|
|
1279
|
-
"parameters": [{
|
|
1280
|
-
"tags": [],
|
|
1281
|
-
"text": ""
|
|
1282
|
-
}, {
|
|
1283
|
-
"tags": [],
|
|
1284
|
-
"text": ""
|
|
1285
|
-
}],
|
|
1286
|
-
"references": {
|
|
1287
|
-
"Promise": {
|
|
1288
|
-
"location": "global"
|
|
1289
|
-
},
|
|
1290
|
-
"ICustomRender": {
|
|
1291
|
-
"location": "import",
|
|
1292
|
-
"path": "@sankhyalabs/ezui/dist/types/utils"
|
|
1293
|
-
}
|
|
1294
|
-
},
|
|
1295
|
-
"return": "Promise<void>"
|
|
1296
|
-
},
|
|
1297
|
-
"docs": {
|
|
1298
|
-
"text": "Registra um render customizado para colunas da grid.",
|
|
1299
|
-
"tags": []
|
|
1300
|
-
}
|
|
1301
|
-
},
|
|
1302
|
-
"addCustomValueFormatter": {
|
|
1303
|
-
"complexType": {
|
|
1304
|
-
"signature": "(columnName: string, customFormatter: ICustomFormatter) => Promise<void>",
|
|
1305
|
-
"parameters": [{
|
|
1306
|
-
"tags": [],
|
|
1307
|
-
"text": ""
|
|
1308
|
-
}, {
|
|
1309
|
-
"tags": [],
|
|
1310
|
-
"text": ""
|
|
1311
|
-
}],
|
|
1312
|
-
"references": {
|
|
1313
|
-
"Promise": {
|
|
1314
|
-
"location": "global"
|
|
1315
|
-
},
|
|
1316
|
-
"ICustomFormatter": {
|
|
1317
|
-
"location": "import",
|
|
1318
|
-
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/interfaces"
|
|
1319
|
-
}
|
|
1320
|
-
},
|
|
1321
|
-
"return": "Promise<void>"
|
|
1322
|
-
},
|
|
1323
|
-
"docs": {
|
|
1324
|
-
"text": "Registra um formatador de valores para uma coluna da grid.",
|
|
1325
|
-
"tags": []
|
|
1326
|
-
}
|
|
1327
|
-
},
|
|
1328
|
-
"removeCustomValueFormatter": {
|
|
1329
|
-
"complexType": {
|
|
1330
|
-
"signature": "(columnName: string) => Promise<void>",
|
|
1331
|
-
"parameters": [{
|
|
1332
|
-
"tags": [],
|
|
1333
|
-
"text": ""
|
|
1334
|
-
}],
|
|
1335
|
-
"references": {
|
|
1336
|
-
"Promise": {
|
|
1337
|
-
"location": "global"
|
|
1338
|
-
}
|
|
1339
|
-
},
|
|
1340
|
-
"return": "Promise<void>"
|
|
1341
|
-
},
|
|
1342
|
-
"docs": {
|
|
1343
|
-
"text": "Remove o formatador de valores de uma coluna da grid.",
|
|
1344
|
-
"tags": []
|
|
1345
|
-
}
|
|
1346
|
-
},
|
|
1347
|
-
"setFieldProp": {
|
|
1348
|
-
"complexType": {
|
|
1349
|
-
"signature": "(fieldName: string, propName: string, value: any) => Promise<void>",
|
|
1350
|
-
"parameters": [{
|
|
1351
|
-
"tags": [],
|
|
1352
|
-
"text": ""
|
|
1353
|
-
}, {
|
|
1354
|
-
"tags": [],
|
|
1355
|
-
"text": ""
|
|
1356
|
-
}, {
|
|
1357
|
-
"tags": [],
|
|
1358
|
-
"text": ""
|
|
1359
|
-
}],
|
|
1360
|
-
"references": {
|
|
1361
|
-
"Promise": {
|
|
1362
|
-
"location": "global"
|
|
1363
|
-
}
|
|
1364
|
-
},
|
|
1365
|
-
"return": "Promise<void>"
|
|
1366
|
-
},
|
|
1367
|
-
"docs": {
|
|
1368
|
-
"text": "Altera/adiciona uma propriedade nos metadados do campo.",
|
|
1369
|
-
"tags": []
|
|
1370
|
-
}
|
|
1371
|
-
},
|
|
1372
989
|
"goToView": {
|
|
1373
990
|
"complexType": {
|
|
1374
991
|
"signature": "(view: VIEW_MODE) => Promise<void>",
|
|
@@ -1519,9 +1136,6 @@ export class SnkSimpleCrud {
|
|
|
1519
1136
|
return [{
|
|
1520
1137
|
"propName": "resourceID",
|
|
1521
1138
|
"methodName": "handleResourceIDChanged"
|
|
1522
|
-
}, {
|
|
1523
|
-
"propName": "entityName",
|
|
1524
|
-
"methodName": "onChangeEntityName"
|
|
1525
1139
|
}, {
|
|
1526
1140
|
"propName": "mode",
|
|
1527
1141
|
"methodName": "onModeChange"
|
|
@@ -47,7 +47,7 @@ export const buildCustomButton = (def, className, dataElementId, action, isEnabl
|
|
|
47
47
|
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions,
|
|
50
|
+
export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
|
|
51
51
|
var _a;
|
|
52
52
|
const title = getTitle(element);
|
|
53
53
|
switch (element) {
|
|
@@ -90,7 +90,7 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
|
|
|
90
90
|
case TaskbarElement.DIVIDER:
|
|
91
91
|
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
|
|
92
92
|
case TaskbarElement.DATA_EXPORTER:
|
|
93
|
-
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[
|
|
93
|
+
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
|
94
94
|
return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
|
|
95
95
|
case TaskbarElement.ATTACH:
|
|
96
96
|
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
|
@@ -184,9 +184,8 @@ export class SnkTaskbar {
|
|
|
184
184
|
className += "ez-padding-left--medium";
|
|
185
185
|
}
|
|
186
186
|
const taskbarElement = TaskbarElement[def.toString()];
|
|
187
|
-
const dataExporterStoreKey = this._element.dataset.exporterStoreKey || this.configName;
|
|
188
187
|
if (taskbarElement) {
|
|
189
|
-
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(),
|
|
188
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), this.configName, this.presentationMode);
|
|
190
189
|
}
|
|
191
190
|
else {
|
|
192
191
|
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|