@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-57523.0 → 0.0.0-bugfix-dev-59880.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-7df9d3bb.js → ConfigStorage-9a53a42c.js} +12 -11
- package/dist/cjs/{form-config-fetcher-3c4daeb5.js → DataFetcher-515bda03.js} +0 -251
- package/dist/cjs/{IExporterProvider-c307e2b1.js → IExporterProvider-e286ef6a.js} +55 -12
- package/dist/cjs/{SnkFormConfigManager-4259edbe.js → SnkFormConfigManager-7b222c78.js} +4 -4
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-4a95fe86.js} +6 -12
- package/dist/cjs/{auth-fetcher-e6112be7.js → auth-fetcher-5acb0335.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-cbdaba63.js → dataunit-fetcher-7a08e4dd.js} +74 -175
- package/dist/cjs/form-config-fetcher-3f430aee.js +256 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-fetcher-916a935c.js +166 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +10 -8
- package/dist/cjs/snk-application.cjs.entry.js +49 -39
- package/dist/cjs/snk-attach.cjs.entry.js +19 -17
- package/dist/cjs/snk-crud.cjs.entry.js +95 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +11 -9
- package/dist/cjs/snk-data-unit-3718477f.js +670 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +10 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +48 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +8 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -2
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +53 -7
- package/dist/cjs/snk-grid.cjs.entry.js +103 -11
- package/dist/cjs/{snk-guides-viewer-b0c44e0c.js → snk-guides-viewer-66dd6949.js} +36 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +153 -14
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +37 -17
- 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 +230 -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/interfaces/IExporterProvider.js +14 -8
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +5 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +499 -176
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
- package/dist/collection/components/snk-form/snk-form.js +101 -4
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +2 -2
- package/dist/collection/components/snk-grid/snk-grid.js +219 -8
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +283 -9
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +6 -2
- 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/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 +51 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +25 -32
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -0
- package/dist/components/ConfigStorage.js +2 -1
- package/dist/components/DataFetcher.js +7024 -0
- package/dist/components/IExporterProvider.js +54 -12
- package/dist/components/SnkFormConfigManager.js +2 -2
- package/dist/components/SnkMessageBuilder.js +6 -12
- package/dist/components/dataunit-fetcher.js +64 -166
- package/dist/components/form-config-fetcher.js +3 -7023
- package/dist/components/pesquisa-fetcher.js +164 -0
- package/dist/components/snk-actions-button2.js +4 -2
- package/dist/components/snk-application2.js +26 -17
- package/dist/components/snk-attach2.js +4 -2
- package/dist/components/snk-crud.js +101 -10
- package/dist/components/snk-data-exporter2.js +6 -4
- package/dist/components/snk-data-unit2.js +424 -177
- package/dist/components/snk-detail-view2.js +87 -9
- 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 +52 -5
- package/dist/components/snk-grid2.js +109 -12
- package/dist/components/snk-simple-crud2.js +157 -11
- package/dist/esm/{ConfigStorage-928c3bf4.js → ConfigStorage-174101b9.js} +2 -1
- package/dist/esm/{form-config-fetcher-e3094014.js → DataFetcher-4b4b7beb.js} +1 -250
- package/dist/esm/{IExporterProvider-e2a1195d.js → IExporterProvider-cf5a56ee.js} +54 -12
- package/dist/esm/{SnkFormConfigManager-a87ade7a.js → SnkFormConfigManager-3bdb3e1f.js} +4 -4
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-3a767111.js} +6 -12
- package/dist/esm/{auth-fetcher-e1cb288f.js → auth-fetcher-9f86c346.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-6d8e50bb.js → dataunit-fetcher-f3fa35b9.js} +63 -165
- package/dist/esm/form-config-fetcher-5d72aaf1.js +253 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-fetcher-9cfab836.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 +30 -20
- package/dist/esm/snk-attach.entry.js +5 -3
- package/dist/esm/snk-crud.entry.js +95 -10
- package/dist/esm/snk-data-exporter.entry.js +8 -6
- package/dist/esm/snk-data-unit-8d6afa43.js +668 -0
- package/dist/esm/snk-data-unit.entry.js +10 -2
- package/dist/esm/snk-detail-view.entry.js +48 -7
- package/dist/esm/snk-filter-bar.entry.js +8 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -2
- package/dist/esm/snk-form-config.entry.js +2 -1
- package/dist/esm/snk-form-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +53 -7
- package/dist/esm/snk-grid.entry.js +104 -12
- package/dist/esm/{snk-guides-viewer-1fd41a25.js → snk-guides-viewer-11cf8dc7.js} +36 -7
- package/dist/esm/snk-guides-viewer.entry.js +8 -6
- package/dist/esm/snk-personalized-filter.entry.js +3 -2
- package/dist/esm/snk-simple-crud.entry.js +153 -14
- package/dist/sankhyablocks/p-010d475f.js +1 -0
- package/dist/sankhyablocks/p-0a28cb19.entry.js +1 -0
- package/dist/sankhyablocks/p-188e1432.entry.js +1 -0
- package/dist/sankhyablocks/p-1c6debe6.entry.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-2a84e45b.entry.js +1 -0
- package/dist/sankhyablocks/p-2cc2d8fd.entry.js +1 -0
- package/dist/sankhyablocks/p-3e4c2cfe.entry.js +11 -0
- package/dist/sankhyablocks/p-4a8a149d.entry.js +1 -0
- package/dist/sankhyablocks/p-4ce73e88.js +1 -0
- package/dist/sankhyablocks/p-50e72d6c.js +1 -0
- package/dist/sankhyablocks/{p-e27496ed.js → p-566f5f50.js} +6 -6
- package/dist/sankhyablocks/p-59dccb7a.entry.js +1 -0
- package/dist/sankhyablocks/p-5bd78e4c.entry.js +1 -0
- package/dist/sankhyablocks/p-6b2be902.js +6 -0
- package/dist/sankhyablocks/p-8171e586.entry.js +1 -0
- package/dist/sankhyablocks/p-a6dfa396.js +1 -0
- package/dist/sankhyablocks/p-a97060b0.js +1 -0
- package/dist/sankhyablocks/p-aa854fa8.entry.js +1 -0
- package/dist/sankhyablocks/p-b27114c4.js +1 -0
- package/dist/sankhyablocks/p-b643f746.entry.js +1 -0
- package/dist/sankhyablocks/p-b68918fc.entry.js +1 -0
- package/dist/sankhyablocks/p-da7c81d6.entry.js +1 -0
- package/dist/sankhyablocks/p-e0c27486.js +26 -0
- package/dist/sankhyablocks/p-e238279a.entry.js +1 -0
- package/dist/sankhyablocks/p-eae66367.js +1 -0
- package/dist/sankhyablocks/p-fde91811.js +60 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +6 -2
- 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 +32 -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/interfaces/IExporterProvider.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-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 +42 -3
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +40 -2
- package/dist/types/components.d.ts +180 -4
- 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/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 +2 -0
- package/package.json +1 -1
- package/dist/cjs/snk-data-unit-abd2113f.js +0 -427
- package/dist/esm/snk-data-unit-29eba11a.js +0 -425
- package/dist/sankhyablocks/p-029bfc09.js +0 -1
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
- package/dist/sankhyablocks/p-07825198.js +0 -1
- package/dist/sankhyablocks/p-0e8702f0.js +0 -1
- package/dist/sankhyablocks/p-13ea113d.entry.js +0 -1
- package/dist/sankhyablocks/p-314e2d1a.entry.js +0 -1
- package/dist/sankhyablocks/p-32556aa6.js +0 -1
- package/dist/sankhyablocks/p-3357af48.js +0 -1
- package/dist/sankhyablocks/p-3c2a1f4d.js +0 -65
- package/dist/sankhyablocks/p-3e7167dd.js +0 -1
- package/dist/sankhyablocks/p-536eeb16.js +0 -26
- package/dist/sankhyablocks/p-587f9dcf.entry.js +0 -1
- package/dist/sankhyablocks/p-61984566.entry.js +0 -1
- package/dist/sankhyablocks/p-61b6126e.entry.js +0 -1
- package/dist/sankhyablocks/p-65b6dba3.entry.js +0 -1
- package/dist/sankhyablocks/p-6a7bc5c8.entry.js +0 -1
- package/dist/sankhyablocks/p-6c9edfd8.entry.js +0 -1
- package/dist/sankhyablocks/p-89bde7d3.entry.js +0 -1
- package/dist/sankhyablocks/p-91dceecf.entry.js +0 -1
- package/dist/sankhyablocks/p-a40cbad8.entry.js +0 -1
- package/dist/sankhyablocks/p-b86ea293.entry.js +0 -1
- package/dist/sankhyablocks/p-d8ddb2a4.entry.js +0 -11
- package/dist/sankhyablocks/p-f92f1f5f.entry.js +0 -1
- package/dist/sankhyablocks/p-fa84e72f.entry.js +0 -1
|
@@ -4,20 +4,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-7b222c78.js');
|
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
9
|
-
require('./
|
|
10
|
-
require('./pesquisa-fetcher-
|
|
9
|
+
require('./DataFetcher-515bda03.js');
|
|
10
|
+
require('./pesquisa-fetcher-916a935c.js');
|
|
11
11
|
const index$1 = require('./index-0922807b.js');
|
|
12
12
|
require('./ISave-e91b70a7.js');
|
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
15
|
+
require('./dataunit-fetcher-7a08e4dd.js');
|
|
15
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
17
|
+
require('./form-config-fetcher-3f430aee.js');
|
|
16
18
|
const taskbarElements = require('./taskbar-elements-d9392685.js');
|
|
17
19
|
const constants = require('./constants-35ddd366.js');
|
|
18
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
19
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
20
|
-
require('./ConfigStorage-
|
|
20
|
+
const snkGuidesViewer = require('./snk-guides-viewer-66dd6949.js');
|
|
21
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-4a95fe86.js');
|
|
22
|
+
require('./ConfigStorage-9a53a42c.js');
|
|
21
23
|
require('./PrintUtils-bcaeb82f.js');
|
|
22
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
23
25
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
@@ -93,6 +95,8 @@ const SnkDetailView = class {
|
|
|
93
95
|
this.branchGuide = undefined;
|
|
94
96
|
this.canEdit = true;
|
|
95
97
|
this.taskbarCustomContainerId = undefined;
|
|
98
|
+
this.customEditors = undefined;
|
|
99
|
+
this.customRenders = undefined;
|
|
96
100
|
}
|
|
97
101
|
observeDataUnit(newDataUnit, oldDataUnit) {
|
|
98
102
|
newDataUnit === null || newDataUnit === void 0 ? void 0 : newDataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
|
@@ -160,10 +164,38 @@ const SnkDetailView = class {
|
|
|
160
164
|
this._snkGrid.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
161
165
|
}
|
|
162
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
169
|
+
*/
|
|
170
|
+
async addCustomEditor(fieldName, customEditor) {
|
|
171
|
+
var _a;
|
|
172
|
+
const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
|
|
173
|
+
this._snkGrid.addCustomEditor(fieldName, customEditor, detailContext);
|
|
174
|
+
this._snkFormView.addCustomEditor(fieldName, customEditor, detailContext);
|
|
175
|
+
}
|
|
176
|
+
async observerPropsCustomEditor(newValue) {
|
|
177
|
+
for (const fieldName in newValue) {
|
|
178
|
+
await this.addCustomEditor(fieldName, newValue[fieldName]);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Registra um render customizado para colunas da grid.
|
|
183
|
+
*/
|
|
184
|
+
async addGridCustomRender(fieldName, customRender) {
|
|
185
|
+
var _a;
|
|
186
|
+
const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
|
|
187
|
+
await this._snkGrid.addGridCustomRender(fieldName, customRender, detailContext);
|
|
188
|
+
}
|
|
163
189
|
onContentCardChanged(evt) {
|
|
164
190
|
snkGuidesViewer.SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this.formConfigManager).then(() => index.forceUpdate(this));
|
|
165
191
|
evt.stopPropagation();
|
|
166
192
|
}
|
|
193
|
+
async observeCustomRenders(newValue) {
|
|
194
|
+
for (const field in newValue) {
|
|
195
|
+
const customRender = newValue[field];
|
|
196
|
+
await this.addGridCustomRender(field, customRender);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
167
199
|
updateLabel() {
|
|
168
200
|
const guideItemPathSize = this.guideItemPath ? this.guideItemPath.length : 0;
|
|
169
201
|
if (guideItemPathSize > 0) {
|
|
@@ -266,6 +298,10 @@ const SnkDetailView = class {
|
|
|
266
298
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
|
267
299
|
}
|
|
268
300
|
}
|
|
301
|
+
async componentDidLoad() {
|
|
302
|
+
await this.observerPropsCustomEditor(this.customEditors);
|
|
303
|
+
await this.observeCustomRenders(this.customRenders);
|
|
304
|
+
}
|
|
269
305
|
async dataUnitActionHandler(action) {
|
|
270
306
|
if (action.type === core.Action.FIELD_INVALIDATED) {
|
|
271
307
|
this.addErrorBadgeToBranchGuide();
|
|
@@ -275,6 +311,9 @@ const SnkDetailView = class {
|
|
|
275
311
|
this.branchGuide = Object.assign(Object.assign({}, this.branchGuide), { badge: 'error' });
|
|
276
312
|
this.snkDetailGuidesChange.emit(new GuideBuilder(this.branchGuide, this._formMetadata, this.dataUnit));
|
|
277
313
|
}
|
|
314
|
+
normalizeBranchGuideId(id) {
|
|
315
|
+
return id === null || id === void 0 ? void 0 : id.replace(/child\[(.*?)\]/g, '$1').replace(/::/g, '>');
|
|
316
|
+
}
|
|
278
317
|
render() {
|
|
279
318
|
this.updateLabel();
|
|
280
319
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
|
@@ -282,7 +321,9 @@ const SnkDetailView = class {
|
|
|
282
321
|
}
|
|
283
322
|
static get watchers() { return {
|
|
284
323
|
"dataUnit": ["observeDataUnit"],
|
|
285
|
-
"dataState": ["observerDataState"]
|
|
324
|
+
"dataState": ["observerDataState"],
|
|
325
|
+
"customEditors": ["observerPropsCustomEditor"],
|
|
326
|
+
"customRenders": ["observeCustomRenders"]
|
|
286
327
|
}; }
|
|
287
328
|
};
|
|
288
329
|
SnkDetailView.REGEX_FORM_ID = /__FORM:[^:]+/g;
|
|
@@ -5,14 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index$1 = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-9a53a42c.js');
|
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
|
11
11
|
const index = require('./index-c5771aba.js');
|
|
12
12
|
const filterNumberVariation = require('./filterNumberVariation-d65332da.js');
|
|
13
13
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
14
14
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
|
15
|
-
require('./form-config-fetcher-
|
|
15
|
+
require('./form-config-fetcher-3f430aee.js');
|
|
16
|
+
require('./DataFetcher-515bda03.js');
|
|
16
17
|
require('./PrintUtils-bcaeb82f.js');
|
|
17
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
18
19
|
|
|
@@ -285,6 +286,7 @@ const SnkFilterBar = class {
|
|
|
285
286
|
this.messagesBuilder = undefined;
|
|
286
287
|
this.disablePersonalizedFilter = undefined;
|
|
287
288
|
this.filterBarLegacyConfigName = undefined;
|
|
289
|
+
this.autoLoad = undefined;
|
|
288
290
|
this.allowDefault = undefined;
|
|
289
291
|
this.scrollerLocked = false;
|
|
290
292
|
this.showPersonalizedFilter = false;
|
|
@@ -431,7 +433,10 @@ const SnkFilterBar = class {
|
|
|
431
433
|
}
|
|
432
434
|
async doLoadData(forceReload = false) {
|
|
433
435
|
try {
|
|
434
|
-
if (this._firstLoad &&
|
|
436
|
+
if (this._firstLoad && this.autoLoad === false) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
if (this._firstLoad && !forceReload && this.autoLoad === undefined) {
|
|
435
440
|
let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
|
|
436
441
|
if (!autoLoad) {
|
|
437
442
|
return;
|
|
@@ -6,9 +6,10 @@ const index = require('./index-f9e81701.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
|
8
8
|
const presentationMode = require('./presentationMode-52ec3bdd.js');
|
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
9
|
+
const ConfigStorage = require('./ConfigStorage-9a53a42c.js');
|
|
10
10
|
const filterType_enum = require('./filter-type.enum-b14ce507.js');
|
|
11
|
-
require('./form-config-fetcher-
|
|
11
|
+
require('./form-config-fetcher-3f430aee.js');
|
|
12
|
+
require('./DataFetcher-515bda03.js');
|
|
12
13
|
require('./PrintUtils-bcaeb82f.js');
|
|
13
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
15
|
|
|
@@ -7,8 +7,9 @@ const Sortable = require('./Sortable-fb1c4cbb.js');
|
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
10
|
+
const formConfigFetcher = require('./form-config-fetcher-3f430aee.js');
|
|
11
11
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
12
|
+
require('./DataFetcher-515bda03.js');
|
|
12
13
|
require('./PrintUtils-bcaeb82f.js');
|
|
13
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
15
|
|
|
@@ -14,6 +14,8 @@ const SnkFormView = class {
|
|
|
14
14
|
this.snkContentCardChanged = index.createEvent(this, "snkContentCardChanged", 7);
|
|
15
15
|
this.snkRequestClearFieldToFocus = index.createEvent(this, "snkRequestClearFieldToFocus", 7);
|
|
16
16
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
17
|
+
this._customEditors = new Map();
|
|
18
|
+
this._fieldProps = new Map();
|
|
17
19
|
this.levelPath = undefined;
|
|
18
20
|
this.label = undefined;
|
|
19
21
|
this.name = undefined;
|
|
@@ -27,12 +29,47 @@ const SnkFormView = class {
|
|
|
27
29
|
this.canFix = true;
|
|
28
30
|
this.recordsValidator = undefined;
|
|
29
31
|
this.fieldToFocus = undefined;
|
|
32
|
+
this.customEditors = undefined;
|
|
33
|
+
this.fieldsProps = undefined;
|
|
30
34
|
}
|
|
31
35
|
async showUp() {
|
|
32
36
|
if (this._formView) {
|
|
33
37
|
this._formView.showUp();
|
|
34
38
|
}
|
|
35
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Registra um editor customizado para campos da grade e formulário
|
|
42
|
+
*/
|
|
43
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
44
|
+
if (this._formView) {
|
|
45
|
+
this._formView.addCustomEditor(fieldName, customEditor, detailContext);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const newCustomEditors = new Map(this._customEditors);
|
|
49
|
+
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
|
50
|
+
this._customEditors = newCustomEditors;
|
|
51
|
+
}
|
|
52
|
+
observePropsCustomEditor(newValue) {
|
|
53
|
+
for (const fieldName in newValue) {
|
|
54
|
+
this.addCustomEditor(fieldName, newValue[fieldName]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
59
|
+
*/
|
|
60
|
+
async setFieldProp(fieldName, propName, value) {
|
|
61
|
+
const props = this._fieldProps.get(fieldName) || [];
|
|
62
|
+
this._fieldProps.set(fieldName, [...props, { propName, value }]);
|
|
63
|
+
}
|
|
64
|
+
async observeFieldsProps(newValue) {
|
|
65
|
+
for (const field in newValue) {
|
|
66
|
+
const fieldProps = newValue[field];
|
|
67
|
+
const propNames = Object.keys(fieldProps);
|
|
68
|
+
for (const propName of propNames) {
|
|
69
|
+
await this.setFieldProp(field, propName, fieldProps[propName]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
36
73
|
changeFix() {
|
|
37
74
|
this.fixed = !this.fixed;
|
|
38
75
|
this.emitEvent("fixed");
|
|
@@ -91,7 +128,13 @@ const SnkFormView = class {
|
|
|
91
128
|
this._dataBinder.onDisconnectedCallback();
|
|
92
129
|
}
|
|
93
130
|
}
|
|
131
|
+
componentDidLoad() {
|
|
132
|
+
this.observePropsCustomEditor(this.customEditors);
|
|
133
|
+
this.observeFieldsProps(this.fieldsProps);
|
|
134
|
+
}
|
|
94
135
|
componentDidRender() {
|
|
136
|
+
this.setCustomEditors();
|
|
137
|
+
this.setFieldProps();
|
|
95
138
|
if (this.fieldToFocus == undefined) {
|
|
96
139
|
return;
|
|
97
140
|
}
|
|
@@ -103,6 +146,26 @@ const SnkFormView = class {
|
|
|
103
146
|
this.snkRequestClearFieldToFocus.emit();
|
|
104
147
|
});
|
|
105
148
|
}
|
|
149
|
+
setCustomEditors() {
|
|
150
|
+
if (!this._formView) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
for (const [fieldName, customEditorProps] of this._customEditors) {
|
|
154
|
+
this._formView.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
|
|
155
|
+
this._customEditors.delete(fieldName);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
setFieldProps() {
|
|
159
|
+
if (!this._formView) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
for (const [fieldName, propsToChange] of this._fieldProps) {
|
|
163
|
+
propsToChange.forEach(prop => {
|
|
164
|
+
this._formView.setFieldProp(fieldName, prop.propName, prop.value);
|
|
165
|
+
this._fieldProps.delete(fieldName);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
106
169
|
render() {
|
|
107
170
|
return (index.h(index.Host, { class: "ez-box__container" }, index.h("div", { class: "summary-header ez-flex ez-size-width--full" }, index.h("div", { class: "ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9" }, this.levelPath ? index.h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), index.h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
|
|
108
171
|
index.h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.fixed ? "un-pin" : "push-pin", "data-element-id": core.ElementIDUtils.getInternalIDInfo("toggleFixed_ezFormCard"), onClick: () => this.changeFix(), title: this.fixed ? "Desafixar" : "Fixar" }), this.canExpand &&
|
|
@@ -112,6 +175,10 @@ const SnkFormView = class {
|
|
|
112
175
|
:
|
|
113
176
|
index.h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
|
|
114
177
|
}
|
|
178
|
+
static get watchers() { return {
|
|
179
|
+
"customEditors": ["observePropsCustomEditor"],
|
|
180
|
+
"fieldsProps": ["observeFieldsProps"]
|
|
181
|
+
}; }
|
|
115
182
|
};
|
|
116
183
|
SnkFormView.style = snkFormViewCss;
|
|
117
184
|
|
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-7b222c78.js');
|
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
9
|
-
require('./ConfigStorage-
|
|
10
|
-
require('./form-config-fetcher-
|
|
9
|
+
require('./ConfigStorage-9a53a42c.js');
|
|
10
|
+
require('./form-config-fetcher-3f430aee.js');
|
|
11
|
+
require('./DataFetcher-515bda03.js');
|
|
11
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
12
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
13
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
@@ -20,6 +21,7 @@ const SnkForm = class {
|
|
|
20
21
|
this.exit = index.createEvent(this, "exit", 7);
|
|
21
22
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
22
23
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
24
|
+
this._customEditors = new Map();
|
|
23
25
|
this._dataUnit = undefined;
|
|
24
26
|
this._dataState = undefined;
|
|
25
27
|
this._showFormConfig = false;
|
|
@@ -42,6 +44,24 @@ const SnkForm = class {
|
|
|
42
44
|
async hideConfig() {
|
|
43
45
|
this._showFormConfig = false;
|
|
44
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
49
|
+
*/
|
|
50
|
+
async addCustomEditor(fieldName, customEditor) {
|
|
51
|
+
if (this._form) {
|
|
52
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const newCustomEditors = new Map(this._customEditors);
|
|
56
|
+
newCustomEditors.set(fieldName, customEditor);
|
|
57
|
+
this._customEditors = newCustomEditors;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
61
|
+
*/
|
|
62
|
+
async setFieldProp(fieldName, propName, value) {
|
|
63
|
+
await this._form.setFieldProp(fieldName, propName, value);
|
|
64
|
+
}
|
|
45
65
|
closeConfig() {
|
|
46
66
|
this.hideConfig();
|
|
47
67
|
}
|
|
@@ -49,6 +69,18 @@ const SnkForm = class {
|
|
|
49
69
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
50
70
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
51
71
|
}
|
|
72
|
+
setCustomEditors() {
|
|
73
|
+
if (!this._form) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
for (const [fieldName, customEditor] of this._customEditors) {
|
|
77
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
|
78
|
+
this._customEditors.delete(fieldName);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async componentDidRender() {
|
|
82
|
+
this.setCustomEditors();
|
|
83
|
+
}
|
|
52
84
|
async componentWillLoad() {
|
|
53
85
|
let parent = this._element.parentElement;
|
|
54
86
|
while (parent) {
|
|
@@ -64,9 +96,7 @@ const SnkForm = class {
|
|
|
64
96
|
this._dataUnit = evt.detail;
|
|
65
97
|
});
|
|
66
98
|
}
|
|
67
|
-
this._snkDataUnit.addEventListener("dataStateChange", (
|
|
68
|
-
this._dataState = evt.detail;
|
|
69
|
-
});
|
|
99
|
+
this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
|
|
70
100
|
break;
|
|
71
101
|
}
|
|
72
102
|
parent = parent.parentElement;
|
|
@@ -78,6 +108,22 @@ const SnkForm = class {
|
|
|
78
108
|
this.addFormLegacyConfig();
|
|
79
109
|
this._configManager.loadConfig();
|
|
80
110
|
}
|
|
111
|
+
async handleDataStateChange(evt) {
|
|
112
|
+
var _a;
|
|
113
|
+
this._dataState = evt.detail;
|
|
114
|
+
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
|
115
|
+
for (const field of fieldsWithRmPrecision || []) {
|
|
116
|
+
if (!field) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
|
|
120
|
+
if (!rmPrecision && rmPrecision !== 0) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
await this.setFieldProp(field, 'precision', rmPrecision);
|
|
124
|
+
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
81
127
|
addFormLegacyConfig() {
|
|
82
128
|
if (this.formLegacyConfigName) {
|
|
83
129
|
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
|
@@ -87,7 +133,7 @@ const SnkForm = class {
|
|
|
87
133
|
if (!this._dataUnit || !this._dataState) {
|
|
88
134
|
return undefined;
|
|
89
135
|
}
|
|
90
|
-
return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
|
136
|
+
return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
|
91
137
|
index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
|
|
92
138
|
}
|
|
93
139
|
get _element() { return index.getElement(this); }
|
|
@@ -5,18 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const taskbarElements = require('./taskbar-elements-d9392685.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-9a53a42c.js');
|
|
9
9
|
const index$1 = require('./index-0922807b.js');
|
|
10
10
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
|
12
|
+
const IExporterProvider = require('./IExporterProvider-e286ef6a.js');
|
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
14
|
-
require('./
|
|
15
|
-
require('./pesquisa-fetcher-
|
|
14
|
+
require('./DataFetcher-515bda03.js');
|
|
15
|
+
require('./pesquisa-fetcher-916a935c.js');
|
|
16
16
|
require('./ISave-e91b70a7.js');
|
|
17
17
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
19
|
+
require('./dataunit-fetcher-7a08e4dd.js');
|
|
19
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
21
|
+
require('./form-config-fetcher-3f430aee.js');
|
|
20
22
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
|
21
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
22
24
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -85,6 +87,8 @@ const SnkGrid = class {
|
|
|
85
87
|
index.registerInstance(this, hostRef);
|
|
86
88
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
87
89
|
this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
|
|
90
|
+
this._customEditors = new Map();
|
|
91
|
+
this._customRenders = new Map();
|
|
88
92
|
this._topTaskbarProcessor = new fieldSearch.TaskbarProcessor({
|
|
89
93
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
|
90
94
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
|
@@ -104,6 +108,14 @@ const SnkGrid = class {
|
|
|
104
108
|
"snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
|
|
105
109
|
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
106
110
|
});
|
|
111
|
+
this.dataUnitInterceptor = {
|
|
112
|
+
interceptAction: async (action) => {
|
|
113
|
+
if (action.type === core.Action.METADATA_LOADED) {
|
|
114
|
+
return await this.interceptMetadataLoaded(action);
|
|
115
|
+
}
|
|
116
|
+
return action;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
107
119
|
this._dataUnit = undefined;
|
|
108
120
|
this._dataState = undefined;
|
|
109
121
|
this._gridConfig = undefined;
|
|
@@ -130,6 +142,7 @@ const SnkGrid = class {
|
|
|
130
142
|
this.disablePersonalizedFilter = undefined;
|
|
131
143
|
this.gridLegacyConfigName = undefined;
|
|
132
144
|
this.filterBarLegacyConfigName = undefined;
|
|
145
|
+
this.autoLoad = undefined;
|
|
133
146
|
}
|
|
134
147
|
/**
|
|
135
148
|
* Exibe a janela de configurações da grade.
|
|
@@ -174,6 +187,42 @@ const SnkGrid = class {
|
|
|
174
187
|
async findColumn() {
|
|
175
188
|
await fieldSearch.openFieldSearch(this._moreOptions, this._columnSearch);
|
|
176
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Registra um editor customizado para campos da grade e formulário
|
|
192
|
+
*/
|
|
193
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
194
|
+
if (this._grid) {
|
|
195
|
+
this._grid.addCustomEditor(fieldName, customEditor, detailContext);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const newCustomEditors = new Map(this._customEditors);
|
|
199
|
+
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
|
200
|
+
this._customEditors = newCustomEditors;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Registra um render customizado para colunas da grid.
|
|
204
|
+
*/
|
|
205
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
|
206
|
+
if (this._grid) {
|
|
207
|
+
this._grid.addGridCustomRender(fieldName, customRender, detailContext);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const newCustomRenders = new Map(this._customRenders);
|
|
211
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
|
212
|
+
this._customRenders = newCustomRenders;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Registra um formatador de valores para uma coluna da grid.
|
|
216
|
+
*/
|
|
217
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
|
218
|
+
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Remove o formatador de valores de uma coluna da grid.
|
|
222
|
+
*/
|
|
223
|
+
async removeCustomValueFormatter(columnName) {
|
|
224
|
+
this._grid.removeCustomValueFormatter(columnName);
|
|
225
|
+
}
|
|
177
226
|
async handleGridLegacyConfigName(newLegacyConfig, oldLegacyConfig) {
|
|
178
227
|
if (!newLegacyConfig) {
|
|
179
228
|
return;
|
|
@@ -236,7 +285,23 @@ const SnkGrid = class {
|
|
|
236
285
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
237
286
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
238
287
|
}
|
|
239
|
-
|
|
288
|
+
loadGridCustomFormatters(fields) {
|
|
289
|
+
if (!fields || !this._grid) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
fields.forEach((field) => {
|
|
293
|
+
var _a;
|
|
294
|
+
if ((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) {
|
|
295
|
+
this.addCustomValueFormatter(field.name, this._rmPrecisionCustomValueFormatter);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
async interceptMetadataLoaded(action) {
|
|
300
|
+
this.loadGridCustomFormatters(action.payload.fields);
|
|
301
|
+
return action;
|
|
302
|
+
}
|
|
303
|
+
finishLoading() {
|
|
304
|
+
this._dataUnit.addInterceptor(this.dataUnitInterceptor);
|
|
240
305
|
IExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
241
306
|
this.addElementID();
|
|
242
307
|
if (this.columnFilterDataSource != undefined) {
|
|
@@ -244,6 +309,24 @@ const SnkGrid = class {
|
|
|
244
309
|
this.columnFilterDataSource.setDataUnit(this._dataUnit);
|
|
245
310
|
}
|
|
246
311
|
}
|
|
312
|
+
setCustomRenders() {
|
|
313
|
+
if (!this._grid) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
for (const [fieldName, customRenderProps] of this._customRenders) {
|
|
317
|
+
this._grid.addGridCustomRender(fieldName, customRenderProps.customRender, customRenderProps.detailContext);
|
|
318
|
+
this._customRenders.delete(fieldName);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
setCustomEditors() {
|
|
322
|
+
if (!this._grid) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
for (const [fieldName, customEditorProps] of this._customEditors) {
|
|
326
|
+
this._grid.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
|
|
327
|
+
this._customEditors.delete(fieldName);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
247
330
|
componentWillLoad() {
|
|
248
331
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
249
332
|
//TODO: substituir pelo metodo nativo closest
|
|
@@ -255,17 +338,15 @@ const SnkGrid = class {
|
|
|
255
338
|
if (!this._dataUnit) {
|
|
256
339
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
257
340
|
this._dataUnit = evt.detail;
|
|
258
|
-
this.
|
|
341
|
+
this.finishLoading();
|
|
259
342
|
});
|
|
260
343
|
}
|
|
261
344
|
else {
|
|
262
|
-
this.
|
|
345
|
+
this.finishLoading();
|
|
263
346
|
}
|
|
264
347
|
if (!this.messagesBuilder)
|
|
265
348
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
|
266
|
-
this._snkDataUnit.addEventListener("dataStateChange", (
|
|
267
|
-
this._dataState = evt.detail;
|
|
268
|
-
});
|
|
349
|
+
this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
|
|
269
350
|
this._snkDataUnit.addEventListener("cancelEdition", () => {
|
|
270
351
|
var _a;
|
|
271
352
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
|
@@ -276,9 +357,20 @@ const SnkGrid = class {
|
|
|
276
357
|
}
|
|
277
358
|
parent = parent.parentElement;
|
|
278
359
|
}
|
|
360
|
+
this._rmPrecisionCustomValueFormatter = new IExporterProvider.RmPrecisionCustomValueFormatter();
|
|
279
361
|
this.addGridLegacyConfigName();
|
|
280
362
|
this.loadConfig();
|
|
281
363
|
}
|
|
364
|
+
componentDidRender() {
|
|
365
|
+
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
|
366
|
+
this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
|
|
367
|
+
this.setCustomRenders();
|
|
368
|
+
this.setCustomEditors();
|
|
369
|
+
}
|
|
370
|
+
async handleDataStateChange(evt) {
|
|
371
|
+
this._dataState = evt.detail;
|
|
372
|
+
this._rmPrecisionCustomValueFormatter.setDataState(this._dataState);
|
|
373
|
+
}
|
|
282
374
|
getHeaderDisabledButtons() {
|
|
283
375
|
var _a;
|
|
284
376
|
const disabledButtons = [];
|
|
@@ -391,7 +483,7 @@ const SnkGrid = class {
|
|
|
391
483
|
return undefined;
|
|
392
484
|
}
|
|
393
485
|
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
394
|
-
index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
486
|
+
index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
395
487
|
}
|
|
396
488
|
get _element() { return index.getElement(this); }
|
|
397
489
|
static get watchers() { return {
|