@sankhyalabs/sankhyablocks 8.15.3 → 8.16.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-a343e418.js} +1 -0
- package/dist/cjs/{SnkMultiSelectionListDataSource-3c08d25c.js → IExporterProvider-597949f9.js} +94 -4
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-f9dc0d28.js → SnkFormConfigManager-166cbd1f.js} +8 -7
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-897ffd08.js} +9 -13
- package/dist/cjs/{pesquisa-fetcher-562d281f.js → dataunit-fetcher-688d3f05.js} +87 -180
- package/dist/cjs/{index-0922807b.js → index-1dfc7a6e.js} +5 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-fetcher-680e198f.js +166 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -3
- package/dist/cjs/snk-application.cjs.entry.js +35 -12
- package/dist/cjs/snk-attach.cjs.entry.js +71 -46
- package/dist/cjs/snk-crud.cjs.entry.js +101 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +315 -85
- package/dist/cjs/snk-data-unit-8fa7917a.js +689 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +12 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +50 -10
- package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -2
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +52 -7
- package/dist/cjs/snk-grid.cjs.entry.js +165 -108
- package/dist/cjs/{snk-guides-viewer-bb6087cd.js → snk-guides-viewer-9c682034.js} +43 -10
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +268 -40
- package/dist/cjs/snk-taskbar.cjs.entry.js +4 -3
- package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-9ad1f9c0.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +35 -11
- package/dist/collection/components/snk-attach/snk-attach.js +67 -44
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +305 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +136 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +134 -7
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +97 -0
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +74 -0
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +54 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +58 -0
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +59 -52
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +62 -0
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +20 -0
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +538 -218
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
- package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +18 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
- package/dist/collection/components/snk-form/snk-form.js +102 -5
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +7 -6
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +240 -101
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +406 -20
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
- package/dist/collection/lib/@types/index.js +5 -0
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +7 -3
- package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +53 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
- package/dist/collection/lib/message/SnkMessageBuilder.js +5 -12
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +2 -1
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/{field-search.js → IExporterProvider.js} +93 -6
- package/dist/components/ISave.js +47 -0
- package/dist/components/SnkFormConfigManager.js +7 -6
- package/dist/components/SnkMessageBuilder.js +9 -13
- package/dist/components/dataunit-fetcher.js +84 -182
- package/dist/components/index2.js +198 -33
- package/dist/components/pesquisa-fetcher.js +164 -0
- package/dist/components/snk-actions-button2.js +4 -11
- package/dist/components/snk-application2.js +31 -9
- package/dist/components/snk-attach2.js +65 -41
- package/dist/components/snk-crud.js +110 -11
- package/dist/components/snk-data-exporter2.js +309 -85
- package/dist/components/snk-data-unit2.js +485 -216
- package/dist/components/snk-detail-view2.js +96 -14
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +6 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form-view2.js +72 -1
- package/dist/components/snk-form.js +53 -6
- package/dist/components/snk-grid2.js +168 -106
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +263 -25
- package/dist/components/snk-taskbar2.js +6 -5
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-3806514e.js} +1 -0
- package/dist/esm/{SnkMultiSelectionListDataSource-6a879955.js → IExporterProvider-63a188b6.js} +93 -5
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-f53f9f87.js → SnkFormConfigManager-31b24066.js} +8 -7
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-571462fb.js} +9 -13
- package/dist/esm/{pesquisa-fetcher-c7ce8ee7.js → dataunit-fetcher-264191b2.js} +83 -181
- package/dist/esm/{index-0ece87a6.js → index-3aa4977a.js} +6 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-fetcher-03c8f919.js +164 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -3
- package/dist/esm/snk-application.entry.js +34 -11
- package/dist/esm/snk-attach.entry.js +66 -41
- package/dist/esm/snk-crud.entry.js +101 -10
- package/dist/esm/snk-data-exporter.entry.js +316 -86
- package/dist/esm/snk-data-unit-f5cbe64b.js +687 -0
- package/dist/esm/snk-data-unit.entry.js +12 -2
- package/dist/esm/snk-detail-view.entry.js +50 -10
- package/dist/esm/snk-filter-bar.entry.js +6 -2
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +52 -7
- package/dist/esm/snk-grid.entry.js +163 -106
- package/dist/esm/{snk-guides-viewer-1d95ebf2.js → snk-guides-viewer-8f6960a2.js} +43 -10
- package/dist/esm/snk-guides-viewer.entry.js +9 -7
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +256 -28
- package/dist/esm/snk-taskbar.entry.js +4 -3
- package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-d59867f1.js} +3 -3
- package/dist/sankhyablocks/p-17def7cd.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-28ee0972.js +1 -0
- package/dist/sankhyablocks/p-2a408684.js +1 -0
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-2c68b3ae.entry.js} +1 -1
- package/dist/sankhyablocks/p-30cf616e.js +1 -0
- package/dist/sankhyablocks/p-3a212712.js +1 -0
- package/dist/sankhyablocks/p-450c60e4.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-47db7e88.entry.js} +1 -1
- package/dist/sankhyablocks/p-4e5e1313.entry.js +1 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-52920496.js} +1 -1
- package/dist/sankhyablocks/p-62ba211a.entry.js +1 -0
- package/dist/sankhyablocks/p-6bb2f3e9.entry.js +1 -0
- package/dist/sankhyablocks/p-7505da04.entry.js +1 -0
- package/dist/sankhyablocks/p-7619bdb1.entry.js +11 -0
- package/dist/sankhyablocks/p-7a85fd49.entry.js +1 -0
- package/dist/sankhyablocks/{p-ae4fc9a9.js → p-7e7a7473.js} +1 -1
- package/dist/sankhyablocks/p-7ef9c55c.js +1 -0
- package/dist/sankhyablocks/p-80042dc6.entry.js +1 -0
- package/dist/sankhyablocks/p-8c59edd7.entry.js +1 -0
- package/dist/sankhyablocks/p-9606509c.entry.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/p-ae93d46a.entry.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-d6e26ea8.entry.js +1 -0
- package/dist/sankhyablocks/p-f2809746.entry.js +1 -0
- package/dist/sankhyablocks/p-f4450320.entry.js +1 -0
- package/dist/sankhyablocks/p-fe79f83a.js +60 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +7 -3
- package/dist/types/components/snk-attach/snk-attach.d.ts +11 -9
- package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +45 -1
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +24 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +14 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +12 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +24 -4
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -1
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +21 -0
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +66 -2
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
- package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/snk-form.d.ts +14 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +46 -6
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +62 -4
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +261 -4
- package/dist/types/lib/@types/index.d.ts +5 -0
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/snk-data-unit-41c29713.js +0 -462
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
- package/dist/components/index3.js +0 -199
- package/dist/esm/snk-data-unit-de1d140d.js +0 -460
- package/dist/sankhyablocks/p-032fe52e.js +0 -1
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
- package/dist/sankhyablocks/p-0594db5a.entry.js +0 -1
- package/dist/sankhyablocks/p-06e13db2.js +0 -1
- package/dist/sankhyablocks/p-07a61550.entry.js +0 -1
- package/dist/sankhyablocks/p-1403a4b6.entry.js +0 -1
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-15802c59.entry.js +0 -1
- package/dist/sankhyablocks/p-235dc7b1.js +0 -65
- package/dist/sankhyablocks/p-32556aa6.js +0 -1
- package/dist/sankhyablocks/p-38289a55.js +0 -1
- package/dist/sankhyablocks/p-3c632d48.js +0 -1
- package/dist/sankhyablocks/p-3f833983.entry.js +0 -1
- package/dist/sankhyablocks/p-52c8e589.js +0 -1
- package/dist/sankhyablocks/p-5e1502b6.entry.js +0 -11
- package/dist/sankhyablocks/p-74d349c3.entry.js +0 -1
- package/dist/sankhyablocks/p-93167e28.entry.js +0 -1
- package/dist/sankhyablocks/p-add17f6a.entry.js +0 -1
- package/dist/sankhyablocks/p-bd47dd16.entry.js +0 -1
- package/dist/sankhyablocks/p-c1f88236.entry.js +0 -1
- package/dist/sankhyablocks/p-ccdd5332.entry.js +0 -1
- package/dist/sankhyablocks/p-ee9536bc.entry.js +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
@@ -2,15 +2,16 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
2
2
|
import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
|
4
4
|
import './DataFetcher.js';
|
5
|
-
import './
|
6
|
-
import { P as PresentationMode } from './
|
7
|
-
import { d as defineCustomElement$w } from './snk-actions-button2.js';
|
5
|
+
import './pesquisa-fetcher.js';
|
6
|
+
import { P as PresentationMode } from './ISave.js';
|
8
7
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
8
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
9
|
+
import './dataunit-fetcher.js';
|
10
10
|
import './filter-item-type.enum.js';
|
11
11
|
import './form-config-fetcher.js';
|
12
12
|
import { V as VIEW_MODE } from './constants.js';
|
13
13
|
import { A as AutorizationType } from './auth-fetcher.js';
|
14
|
+
import { d as defineCustomElement$w } from './snk-actions-button2.js';
|
14
15
|
import { d as defineCustomElement$v } from './snk-attach2.js';
|
15
16
|
import { d as defineCustomElement$u } from './snk-config-options2.js';
|
16
17
|
import { d as defineCustomElement$t } from './snk-configurator2.js';
|
@@ -50,8 +51,11 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
50
51
|
this.configuratorSave = createEvent(this, "configuratorSave", 7);
|
51
52
|
this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
|
52
53
|
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
54
|
+
this.viewModeChanged = createEvent(this, "viewModeChanged", 7);
|
53
55
|
this._keyDownHandler = async (event) => this.keyDownListener(event);
|
54
56
|
this._viewHistory = [];
|
57
|
+
this._customEditors = new Map();
|
58
|
+
this._customRenders = new Map();
|
55
59
|
this._dataUnit = undefined;
|
56
60
|
this._dataState = undefined;
|
57
61
|
this.attachmentRegisterKey = undefined;
|
@@ -74,6 +78,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
74
78
|
this.filterBarLegacyConfigName = undefined;
|
75
79
|
this.formLegacyConfigName = undefined;
|
76
80
|
this.disablePersonalizedFilter = undefined;
|
81
|
+
this.autoLoad = undefined;
|
82
|
+
this.autoFocus = true;
|
83
|
+
this.domainMessagesBuilder = undefined;
|
84
|
+
this.setCustomFormTitle = undefined;
|
77
85
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
78
86
|
}
|
79
87
|
/**
|
@@ -109,6 +117,49 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
109
117
|
async getFilterBar() {
|
110
118
|
return await this._snkGrid.getFilterBar();
|
111
119
|
}
|
120
|
+
/**
|
121
|
+
* Registra um editor customizado para campos da grade e formulário.
|
122
|
+
*/
|
123
|
+
async addCustomEditor(fieldName, customEditor) {
|
124
|
+
if (this._guidesViewer && this._snkGrid) {
|
125
|
+
this._guidesViewer.addCustomEditor(fieldName, customEditor);
|
126
|
+
this._snkGrid.addCustomEditor(fieldName, customEditor);
|
127
|
+
return;
|
128
|
+
}
|
129
|
+
const newCustomEditors = new Map(this._customEditors);
|
130
|
+
newCustomEditors.set(fieldName, customEditor);
|
131
|
+
this._customEditors = newCustomEditors;
|
132
|
+
}
|
133
|
+
/**
|
134
|
+
* Registra um render customizado para colunas da grid.
|
135
|
+
*/
|
136
|
+
async addGridCustomRender(fieldName, customRender) {
|
137
|
+
if (this._snkGrid) {
|
138
|
+
this._snkGrid.addGridCustomRender(fieldName, customRender);
|
139
|
+
return;
|
140
|
+
}
|
141
|
+
const newCustomRenders = new Map(this._customRenders);
|
142
|
+
newCustomRenders.set(fieldName, customRender);
|
143
|
+
this._customRenders = newCustomRenders;
|
144
|
+
}
|
145
|
+
/**
|
146
|
+
* Registra um formatador de valores para uma coluna da grid.
|
147
|
+
*/
|
148
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
149
|
+
this._snkGrid.addCustomValueFormatter(columnName, customFormatter);
|
150
|
+
}
|
151
|
+
/**
|
152
|
+
* Remove o formatador de valores de uma coluna da grid.
|
153
|
+
*/
|
154
|
+
async removeCustomValueFormatter(columnName) {
|
155
|
+
this._snkGrid.removeCustomValueFormatter(columnName);
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
159
|
+
*/
|
160
|
+
async setFieldProp(fieldName, propName, value) {
|
161
|
+
await this._guidesViewer.setFieldProp(fieldName, propName, value);
|
162
|
+
}
|
112
163
|
currentViewModeWatcher(currentView) {
|
113
164
|
this._viewHistory = [...this._viewHistory.slice(-1), currentView];
|
114
165
|
}
|
@@ -139,6 +190,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
139
190
|
else if (viewMode === VIEW_MODE.FORM) {
|
140
191
|
this._guidesViewer.setFocus();
|
141
192
|
}
|
193
|
+
this.viewModeChanged.emit(viewMode);
|
142
194
|
}
|
143
195
|
openConfig(viewMode) {
|
144
196
|
this._snkConfigurator.close();
|
@@ -168,6 +220,29 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
168
220
|
const joinedPrimaryKeys = recordCriteria.map(({ value }) => value).join('_');
|
169
221
|
return joinedPrimaryKeys;
|
170
222
|
}
|
223
|
+
setCustomRenders() {
|
224
|
+
if (!this._snkGrid) {
|
225
|
+
return;
|
226
|
+
}
|
227
|
+
for (const [fieldName, customRender] of this._customRenders) {
|
228
|
+
this._snkGrid.addGridCustomRender(fieldName, customRender);
|
229
|
+
this._customRenders.delete(fieldName);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
setCustomEditors() {
|
233
|
+
if (!this._snkGrid || !this._guidesViewer) {
|
234
|
+
return;
|
235
|
+
}
|
236
|
+
for (const [fieldName, customEditor] of this._customEditors) {
|
237
|
+
this._guidesViewer.addCustomEditor(fieldName, customEditor);
|
238
|
+
this._snkGrid.addCustomEditor(fieldName, customEditor);
|
239
|
+
this._customEditors.delete(fieldName);
|
240
|
+
}
|
241
|
+
}
|
242
|
+
componentDidRender() {
|
243
|
+
this.setCustomRenders();
|
244
|
+
this.setCustomEditors();
|
245
|
+
}
|
171
246
|
componentWillLoad() {
|
172
247
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
173
248
|
let parent = this._element.parentElement;
|
@@ -179,6 +254,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
179
254
|
this._snkDataUnit = parent;
|
180
255
|
this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
|
181
256
|
this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
|
257
|
+
this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
|
182
258
|
this._dataUnit = this._snkDataUnit.dataUnit;
|
183
259
|
this._dataState = this._snkDataUnit.dataState;
|
184
260
|
if (!this._dataUnit) {
|
@@ -190,12 +266,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
190
266
|
else {
|
191
267
|
this.initDataUnit();
|
192
268
|
}
|
193
|
-
this._snkDataUnit.addEventListener("dataStateChange",
|
194
|
-
this._dataState = dataState;
|
195
|
-
if (dataState.selectedRecord !== undefined) {
|
196
|
-
this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
|
197
|
-
}
|
198
|
-
});
|
269
|
+
this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
|
199
270
|
break;
|
200
271
|
}
|
201
272
|
parent = parent.parentElement;
|
@@ -211,6 +282,25 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
211
282
|
this.removeShortcuts();
|
212
283
|
window.removeEventListener("keydown", this._keyDownHandler);
|
213
284
|
}
|
285
|
+
async handleDataStateChange(evt) {
|
286
|
+
var _a;
|
287
|
+
this._dataState = evt.detail;
|
288
|
+
if (this._dataState.selectedRecord !== undefined) {
|
289
|
+
this.attachmentRegisterKey = await this.getAttachmentRegisterKey();
|
290
|
+
}
|
291
|
+
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
292
|
+
for (const field of fieldsWithRmPrecision || []) {
|
293
|
+
if (!field) {
|
294
|
+
continue;
|
295
|
+
}
|
296
|
+
const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
|
297
|
+
if (!rmPrecision && rmPrecision !== 0) {
|
298
|
+
continue;
|
299
|
+
}
|
300
|
+
await this.setFieldProp(field, 'precision', rmPrecision);
|
301
|
+
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
302
|
+
}
|
303
|
+
}
|
214
304
|
async initKeyboardManager() {
|
215
305
|
var _a;
|
216
306
|
const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
|
@@ -330,7 +420,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
330
420
|
return;
|
331
421
|
}
|
332
422
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
333
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
423
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, getCustomTitle: this.setCustomFormTitle }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
334
424
|
}
|
335
425
|
get _element() { return this; }
|
336
426
|
static get watchers() { return {
|
@@ -354,6 +444,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
354
444
|
"filterBarLegacyConfigName": [1, "filter-bar-legacy-config-name"],
|
355
445
|
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
356
446
|
"disablePersonalizedFilter": [4, "disable-personalized-filter"],
|
447
|
+
"autoLoad": [4, "auto-load"],
|
448
|
+
"autoFocus": [4, "auto-focus"],
|
449
|
+
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
450
|
+
"setCustomFormTitle": [16],
|
357
451
|
"_dataUnit": [32],
|
358
452
|
"_dataState": [32],
|
359
453
|
"attachmentRegisterKey": [32],
|
@@ -365,7 +459,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
365
459
|
"openConfigurator": [64],
|
366
460
|
"closeConfigurator": [64],
|
367
461
|
"reloadFilterBar": [64],
|
368
|
-
"getFilterBar": [64]
|
462
|
+
"getFilterBar": [64],
|
463
|
+
"addCustomEditor": [64],
|
464
|
+
"addGridCustomRender": [64],
|
465
|
+
"addCustomValueFormatter": [64],
|
466
|
+
"removeCustomValueFormatter": [64],
|
467
|
+
"setFieldProp": [64]
|
369
468
|
}]);
|
370
469
|
function defineCustomElement$1() {
|
371
470
|
if (typeof customElements === "undefined") {
|