@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-38445.0 → 0.0.0-bugfix-dev-KB-68300.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-942ce74b.js → ConfigStorage-a343e418.js} +1 -0
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-166cbd1f.js} +6 -8
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-eb7e29ca.js} +5 -4
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -5
- package/dist/cjs/snk-filter-bar.cjs.entry.js +1 -1
- 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.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid.cjs.entry.js +3 -3
- package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-bdc41281.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +1 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +5 -4
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +5 -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 +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +2 -2
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/SnkFormConfigManager.js +5 -7
- package/dist/components/snk-data-unit2.js +5 -4
- package/dist/components/snk-detail-view2.js +2 -3
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-grid2.js +2 -2
- package/dist/components/snk-simple-crud2.js +2 -2
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-3806514e.js} +1 -0
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-31b24066.js} +6 -8
- package/dist/esm/snk-actions-button_4.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-2e5021e9.js} +5 -4
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +4 -5
- package/dist/esm/snk-filter-bar.entry.js +1 -1
- 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.entry.js +2 -2
- package/dist/esm/snk-grid.entry.js +3 -3
- package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-dda0fede.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +4 -4
- package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-045eae4d.entry.js} +1 -1
- 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-450c60e4.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-47db7e88.entry.js} +1 -1
- package/dist/sankhyablocks/{p-bad55caa.entry.js → p-4e5e1313.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c053256c.entry.js → p-4f3717df.entry.js} +1 -1
- package/dist/sankhyablocks/{p-aff76a53.js → p-52920496.js} +1 -1
- package/dist/sankhyablocks/p-61bf5b79.js +1 -0
- package/dist/sankhyablocks/{p-8fc470e5.entry.js → p-62ba211a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-941bf3ef.entry.js → p-70791b3c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-14b9f964.entry.js → p-75e674ed.entry.js} +1 -1
- package/dist/sankhyablocks/{p-19c18d06.entry.js → p-7a85fd49.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c5268346.entry.js → p-8fb7d19d.entry.js} +1 -1
- package/dist/sankhyablocks/p-c1d57831.entry.js +1 -0
- package/dist/sankhyablocks/{p-47b60deb.entry.js → p-d6e26ea8.entry.js} +1 -1
- package/dist/sankhyablocks/p-fa4d8cb4.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -1
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/package.json +1 -1
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
- package/dist/sankhyablocks/p-cefba299.js +0 -1
- package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
|
@@ -425,6 +425,7 @@ class ConfigStorage {
|
|
|
425
425
|
if (config == undefined) {
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
428
429
|
await this.deleteGridConfigCache(name, resourceID);
|
|
429
430
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
430
431
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
3
|
+
const ConfigStorage = require('./ConfigStorage-a343e418.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
5
|
const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
|
|
6
6
|
|
|
@@ -76,10 +76,8 @@ class SnkFormConfigManager {
|
|
|
76
76
|
if (fields != undefined && fields.length > 0) {
|
|
77
77
|
return fields.map(({ label, name, readOnly, visible, required }) => {
|
|
78
78
|
if (label == undefined) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
visible,
|
|
82
|
-
required });
|
|
79
|
+
const currentField = dataUnit.getField(name);
|
|
80
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required });
|
|
83
81
|
}
|
|
84
82
|
return { name, label, readOnly, visible, required };
|
|
85
83
|
})
|
|
@@ -103,7 +101,7 @@ class SnkFormConfigManager {
|
|
|
103
101
|
const normalizedFilter = core.StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
104
102
|
return normalizedText.includes(normalizedFilter);
|
|
105
103
|
}
|
|
106
|
-
|
|
104
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
107
105
|
let fields = this.getFieldsList(dataUnit);
|
|
108
106
|
if (ignoreReadOnlyFormFields) {
|
|
109
107
|
fields = fields.filter(field => {
|
|
@@ -135,8 +133,8 @@ class SnkFormConfigManager {
|
|
|
135
133
|
this._onConfigChange(Object.assign({}, this._config));
|
|
136
134
|
}
|
|
137
135
|
}
|
|
138
|
-
getConfig(
|
|
139
|
-
return
|
|
136
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
137
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
|
|
140
138
|
}
|
|
141
139
|
getFormConfigFetcher() {
|
|
142
140
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -17,7 +17,7 @@ require('./form-config-fetcher-2dd00e5b.js');
|
|
|
17
17
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
18
18
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
19
19
|
const CheckMode = require('@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode');
|
|
20
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
20
|
+
const ConfigStorage = require('./ConfigStorage-a343e418.js');
|
|
21
21
|
const constants = require('./constants-35ddd366.js');
|
|
22
22
|
require('./PrintUtils-bcaeb82f.js');
|
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-a343e418.js');
|
|
9
9
|
const DataFetcher = require('./DataFetcher-313debd8.js');
|
|
10
10
|
const authFetcher = require('./auth-fetcher-54f5ff9d.js');
|
|
11
11
|
const dataunitFetcher = require('./dataunit-fetcher-688d3f05.js');
|
|
@@ -8,7 +8,7 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
|
8
8
|
const index = require('./index-1dfc7a6e.js');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
10
|
const DataFetcher = require('./DataFetcher-313debd8.js');
|
|
11
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
11
|
+
const snkDataUnit = require('./snk-data-unit-eb7e29ca.js');
|
|
12
12
|
require('./pesquisa-fetcher-680e198f.js');
|
|
13
13
|
require('./ISave-e91b70a7.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
@@ -73,7 +73,7 @@ const SnkDataUnit = class {
|
|
|
73
73
|
this._application.updateDataunitCache(oldValue, this.dataUnitName, this.dataUnit);
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
this.loadDataUnit();
|
|
76
|
+
this.loadDataUnit(true);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ const SnkDataUnit = class {
|
|
|
81
81
|
if (oldValue != newValue) {
|
|
82
82
|
this.dataUnit = undefined;
|
|
83
83
|
this.entityName = newValue;
|
|
84
|
-
this.loadDataUnit();
|
|
84
|
+
this.loadDataUnit(true);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
observeDataState(newValue, oldValue) {
|
|
@@ -542,7 +542,7 @@ const SnkDataUnit = class {
|
|
|
542
542
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
async loadDataUnit() {
|
|
545
|
+
async loadDataUnit(forceMetadataLoad = false) {
|
|
546
546
|
var _a;
|
|
547
547
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
548
548
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -552,7 +552,8 @@ const SnkDataUnit = class {
|
|
|
552
552
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
553
553
|
this.dataUnit.addInterceptor(this);
|
|
554
554
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
555
|
-
|
|
555
|
+
if (forceMetadataLoad || !this.dataUnit.metadata)
|
|
556
|
+
await this.dataUnit.loadMetadata();
|
|
556
557
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
557
558
|
this.getMetadataByRow(this.dataUnit);
|
|
558
559
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
5
|
+
const snkDataUnit = require('./snk-data-unit-eb7e29ca.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
|
@@ -4,7 +4,7 @@ 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-166cbd1f.js');
|
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
9
9
|
require('./DataFetcher-313debd8.js');
|
|
10
10
|
require('./pesquisa-fetcher-680e198f.js');
|
|
@@ -17,9 +17,9 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
|
17
17
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
18
18
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
19
19
|
const constants = require('./constants-35ddd366.js');
|
|
20
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
20
|
+
const snkGuidesViewer = require('./snk-guides-viewer-bdc41281.js');
|
|
21
21
|
const SnkMessageBuilder = require('./SnkMessageBuilder-722b104e.js');
|
|
22
|
-
require('./ConfigStorage-
|
|
22
|
+
require('./ConfigStorage-a343e418.js');
|
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
|
24
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
25
25
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
@@ -227,14 +227,13 @@ const SnkDetailView = class {
|
|
|
227
227
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
|
228
228
|
}
|
|
229
229
|
loadMetadata() {
|
|
230
|
-
var _a;
|
|
231
230
|
if (!this.dataUnit) {
|
|
232
231
|
return;
|
|
233
232
|
}
|
|
234
233
|
if (!this.formConfigManager.isLoaded) {
|
|
235
234
|
return;
|
|
236
235
|
}
|
|
237
|
-
const formConfig = this.formConfigManager.getConfig(
|
|
236
|
+
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
238
237
|
//this._cardsState = formConfig?.cardsState;
|
|
239
238
|
this._formMetadata = form.buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
240
239
|
}
|
|
@@ -5,7 +5,7 @@ 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-a343e418.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');
|
|
@@ -6,7 +6,7 @@ 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-a343e418.js');
|
|
10
10
|
const filterType_enum = require('./filter-type.enum-b14ce507.js');
|
|
11
11
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
12
12
|
require('./DataFetcher-313debd8.js');
|
|
@@ -80,7 +80,7 @@ const SnkFormConfig = class {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
getConfig() {
|
|
83
|
-
let config = this.configManager.getConfig(
|
|
83
|
+
let config = this.configManager.getConfig(this.dataUnit);
|
|
84
84
|
if (config.fields && config.fields.length === 0) {
|
|
85
85
|
config = undefined;
|
|
86
86
|
}
|
|
@@ -4,9 +4,9 @@ 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-166cbd1f.js');
|
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
9
|
-
require('./ConfigStorage-
|
|
9
|
+
require('./ConfigStorage-a343e418.js');
|
|
10
10
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
11
11
|
require('./DataFetcher-313debd8.js');
|
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -5,7 +5,7 @@ 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-9ad1f9c0.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-a343e418.js');
|
|
9
9
|
const index$1 = require('./index-1dfc7a6e.js');
|
|
10
10
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
@@ -80,7 +80,7 @@ class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px
|
|
83
|
+
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
|
84
84
|
|
|
85
85
|
const SnkGrid = class {
|
|
86
86
|
constructor(hostRef) {
|
|
@@ -489,7 +489,7 @@ const SnkGrid = class {
|
|
|
489
489
|
if (!this._dataUnit) {
|
|
490
490
|
return undefined;
|
|
491
491
|
}
|
|
492
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
492
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
493
493
|
index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
494
494
|
}
|
|
495
495
|
get _element() { return index.getElement(this); }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-166cbd1f.js');
|
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
7
7
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
8
8
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
@@ -129,7 +129,7 @@ const SnkGuidesViewer = class {
|
|
|
129
129
|
}
|
|
130
130
|
onContentCardChanged(evt) {
|
|
131
131
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
|
132
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
|
132
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-bdc41281.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
|
-
require('./SnkFormConfigManager-
|
|
9
|
-
require('./ConfigStorage-
|
|
8
|
+
require('./SnkFormConfigManager-166cbd1f.js');
|
|
9
|
+
require('./ConfigStorage-a343e418.js');
|
|
10
10
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
11
11
|
require('./DataFetcher-313debd8.js');
|
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-a343e418.js');
|
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
@@ -18,8 +18,8 @@ const dataunitFetcher = require('./dataunit-fetcher-688d3f05.js');
|
|
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
19
|
const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
|
|
20
20
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
21
|
+
const ConfigStorage = require('./ConfigStorage-a343e418.js');
|
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-166cbd1f.js');
|
|
23
23
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -752,8 +752,8 @@ const SnkSimpleCrud = class {
|
|
|
752
752
|
return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
|
753
753
|
}
|
|
754
754
|
getFormConfig() {
|
|
755
|
-
var _a
|
|
756
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(
|
|
755
|
+
var _a;
|
|
756
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
757
757
|
if (!this.configName && !configFromManager) {
|
|
758
758
|
return this.formConfig;
|
|
759
759
|
}
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
|
@@ -158,14 +158,13 @@ export class SnkDetailView {
|
|
|
158
158
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
|
159
159
|
}
|
|
160
160
|
loadMetadata() {
|
|
161
|
-
var _a;
|
|
162
161
|
if (!this.dataUnit) {
|
|
163
162
|
return;
|
|
164
163
|
}
|
|
165
164
|
if (!this.formConfigManager.isLoaded) {
|
|
166
165
|
return;
|
|
167
166
|
}
|
|
168
|
-
const formConfig = this.formConfigManager.getConfig(
|
|
167
|
+
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
169
168
|
//this._cardsState = formConfig?.cardsState;
|
|
170
169
|
this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
171
170
|
}
|
|
@@ -113,7 +113,7 @@ export class SnkGuidesViewer {
|
|
|
113
113
|
}
|
|
114
114
|
onContentCardChanged(evt) {
|
|
115
115
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
|
116
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
|
116
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -66,7 +66,7 @@ export class SnkDataUnit {
|
|
|
66
66
|
this._application.updateDataunitCache(oldValue, this.dataUnitName, this.dataUnit);
|
|
67
67
|
}
|
|
68
68
|
else {
|
|
69
|
-
this.loadDataUnit();
|
|
69
|
+
this.loadDataUnit(true);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -74,7 +74,7 @@ export class SnkDataUnit {
|
|
|
74
74
|
if (oldValue != newValue) {
|
|
75
75
|
this.dataUnit = undefined;
|
|
76
76
|
this.entityName = newValue;
|
|
77
|
-
this.loadDataUnit();
|
|
77
|
+
this.loadDataUnit(true);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
observeDataState(newValue, oldValue) {
|
|
@@ -535,7 +535,7 @@ export class SnkDataUnit {
|
|
|
535
535
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
async loadDataUnit() {
|
|
538
|
+
async loadDataUnit(forceMetadataLoad = false) {
|
|
539
539
|
var _a;
|
|
540
540
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
541
541
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -545,7 +545,8 @@ export class SnkDataUnit {
|
|
|
545
545
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
546
546
|
this.dataUnit.addInterceptor(this);
|
|
547
547
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
548
|
-
|
|
548
|
+
if (forceMetadataLoad || !this.dataUnit.metadata)
|
|
549
|
+
await this.dataUnit.loadMetadata();
|
|
549
550
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
550
551
|
this.getMetadataByRow(this.dataUnit);
|
|
551
552
|
}
|
|
@@ -73,10 +73,8 @@ export class SnkFormConfigManager {
|
|
|
73
73
|
if (fields != undefined && fields.length > 0) {
|
|
74
74
|
return fields.map(({ label, name, readOnly, visible, required }) => {
|
|
75
75
|
if (label == undefined) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
visible,
|
|
79
|
-
required });
|
|
76
|
+
const currentField = dataUnit.getField(name);
|
|
77
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required });
|
|
80
78
|
}
|
|
81
79
|
return { name, label, readOnly, visible, required };
|
|
82
80
|
})
|
|
@@ -100,7 +98,7 @@ export class SnkFormConfigManager {
|
|
|
100
98
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
101
99
|
return normalizedText.includes(normalizedFilter);
|
|
102
100
|
}
|
|
103
|
-
|
|
101
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
104
102
|
let fields = this.getFieldsList(dataUnit);
|
|
105
103
|
if (ignoreReadOnlyFormFields) {
|
|
106
104
|
fields = fields.filter(field => {
|
|
@@ -132,8 +130,8 @@ export class SnkFormConfigManager {
|
|
|
132
130
|
this._onConfigChange(Object.assign({}, this._config));
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
|
-
getConfig(
|
|
136
|
-
return
|
|
133
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
134
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
|
|
137
135
|
}
|
|
138
136
|
getFormConfigFetcher() {
|
|
139
137
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -67,7 +67,7 @@ export class SnkFormConfig {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
getConfig() {
|
|
70
|
-
let config = this.configManager.getConfig(
|
|
70
|
+
let config = this.configManager.getConfig(this.dataUnit);
|
|
71
71
|
if (config.fields && config.fields.length === 0) {
|
|
72
72
|
config = undefined;
|
|
73
73
|
}
|
|
@@ -415,7 +415,7 @@ export class SnkGrid {
|
|
|
415
415
|
if (!this._dataUnit) {
|
|
416
416
|
return undefined;
|
|
417
417
|
}
|
|
418
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
418
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
419
419
|
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
420
420
|
}
|
|
421
421
|
static get is() { return "snk-grid"; }
|
|
@@ -672,8 +672,8 @@ export class SnkSimpleCrud {
|
|
|
672
672
|
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
|
673
673
|
}
|
|
674
674
|
getFormConfig() {
|
|
675
|
-
var _a
|
|
676
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(
|
|
675
|
+
var _a;
|
|
676
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
677
677
|
if (!this.configName && !configFromManager) {
|
|
678
678
|
return this.formConfig;
|
|
679
679
|
}
|
|
@@ -71,6 +71,7 @@ export class ConfigStorage {
|
|
|
71
71
|
if (config == undefined) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
74
75
|
await this.deleteGridConfigCache(name, resourceID);
|
|
75
76
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
76
77
|
}
|
|
@@ -423,6 +423,7 @@ class ConfigStorage {
|
|
|
423
423
|
if (config == undefined) {
|
|
424
424
|
return;
|
|
425
425
|
}
|
|
426
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
426
427
|
await this.deleteGridConfigCache(name, resourceID);
|
|
427
428
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
428
429
|
}
|
|
@@ -74,10 +74,8 @@ class SnkFormConfigManager {
|
|
|
74
74
|
if (fields != undefined && fields.length > 0) {
|
|
75
75
|
return fields.map(({ label, name, readOnly, visible, required }) => {
|
|
76
76
|
if (label == undefined) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
visible,
|
|
80
|
-
required });
|
|
77
|
+
const currentField = dataUnit.getField(name);
|
|
78
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required });
|
|
81
79
|
}
|
|
82
80
|
return { name, label, readOnly, visible, required };
|
|
83
81
|
})
|
|
@@ -101,7 +99,7 @@ class SnkFormConfigManager {
|
|
|
101
99
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
102
100
|
return normalizedText.includes(normalizedFilter);
|
|
103
101
|
}
|
|
104
|
-
|
|
102
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
105
103
|
let fields = this.getFieldsList(dataUnit);
|
|
106
104
|
if (ignoreReadOnlyFormFields) {
|
|
107
105
|
fields = fields.filter(field => {
|
|
@@ -133,8 +131,8 @@ class SnkFormConfigManager {
|
|
|
133
131
|
this._onConfigChange(Object.assign({}, this._config));
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
|
-
getConfig(
|
|
137
|
-
return
|
|
134
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
135
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
|
|
138
136
|
}
|
|
139
137
|
getFormConfigFetcher() {
|
|
140
138
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -109,7 +109,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
109
109
|
this._application.updateDataunitCache(oldValue, this.dataUnitName, this.dataUnit);
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
this.loadDataUnit();
|
|
112
|
+
this.loadDataUnit(true);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -117,7 +117,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
117
117
|
if (oldValue != newValue) {
|
|
118
118
|
this.dataUnit = undefined;
|
|
119
119
|
this.entityName = newValue;
|
|
120
|
-
this.loadDataUnit();
|
|
120
|
+
this.loadDataUnit(true);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
observeDataState(newValue, oldValue) {
|
|
@@ -578,7 +578,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
578
578
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
async loadDataUnit() {
|
|
581
|
+
async loadDataUnit(forceMetadataLoad = false) {
|
|
582
582
|
var _a;
|
|
583
583
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
584
584
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -588,7 +588,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
588
588
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
589
589
|
this.dataUnit.addInterceptor(this);
|
|
590
590
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
591
|
-
|
|
591
|
+
if (forceMetadataLoad || !this.dataUnit.metadata)
|
|
592
|
+
await this.dataUnit.loadMetadata();
|
|
592
593
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
593
594
|
this.getMetadataByRow(this.dataUnit);
|
|
594
595
|
}
|
|
@@ -156,7 +156,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
156
156
|
}
|
|
157
157
|
onContentCardChanged(evt) {
|
|
158
158
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
|
159
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
|
159
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -938,14 +938,13 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
938
938
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
|
939
939
|
}
|
|
940
940
|
loadMetadata() {
|
|
941
|
-
var _a;
|
|
942
941
|
if (!this.dataUnit) {
|
|
943
942
|
return;
|
|
944
943
|
}
|
|
945
944
|
if (!this.formConfigManager.isLoaded) {
|
|
946
945
|
return;
|
|
947
946
|
}
|
|
948
|
-
const formConfig = this.formConfigManager.getConfig(
|
|
947
|
+
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
949
948
|
//this._cardsState = formConfig?.cardsState;
|
|
950
949
|
this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
951
950
|
}
|
|
@@ -76,7 +76,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
getConfig() {
|
|
79
|
-
let config = this.configManager.getConfig(
|
|
79
|
+
let config = this.configManager.getConfig(this.dataUnit);
|
|
80
80
|
if (config.fields && config.fields.length === 0) {
|
|
81
81
|
config = undefined;
|
|
82
82
|
}
|
|
@@ -86,7 +86,7 @@ class ServerSideExporterProvider extends CommonsExporter {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px
|
|
89
|
+
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
|
90
90
|
|
|
91
91
|
const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
92
92
|
constructor() {
|
|
@@ -496,7 +496,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
496
496
|
if (!this._dataUnit) {
|
|
497
497
|
return undefined;
|
|
498
498
|
}
|
|
499
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
499
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
500
500
|
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
501
501
|
}
|
|
502
502
|
get _element() { return this; }
|