@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-68300.0 → 0.0.0-bugfix-dev-KB-38445.1
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-a343e418.js → ConfigStorage-942ce74b.js} +0 -1
- package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-1b13bacd.js} +8 -6
- 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-eb7e29ca.js → snk-data-unit-685272e7.js} +4 -5
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -4
- 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-bdc41281.js → snk-guides-viewer-67605336.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 +2 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +4 -5
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +7 -5
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- 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 +0 -1
- package/dist/components/ConfigStorage.js +0 -1
- package/dist/components/SnkFormConfigManager.js +7 -5
- package/dist/components/snk-data-unit2.js +4 -5
- package/dist/components/snk-detail-view2.js +3 -2
- 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-3806514e.js → ConfigStorage-86187da3.js} +0 -1
- package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-d4554df9.js} +8 -6
- 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-2e5021e9.js → snk-data-unit-63f83504.js} +4 -5
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +5 -4
- 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-dda0fede.js → snk-guides-viewer-151f6091.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-14a08904.entry.js +1 -0
- package/dist/sankhyablocks/{p-75e674ed.entry.js → p-14b9f964.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7a85fd49.entry.js → p-19c18d06.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d6e26ea8.entry.js → p-47b60deb.entry.js} +1 -1
- package/dist/sankhyablocks/p-829d4045.js +1 -0
- package/dist/sankhyablocks/{p-045eae4d.entry.js → p-82a0bfb0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-62ba211a.entry.js → p-8fc470e5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-70791b3c.entry.js → p-941bf3ef.entry.js} +1 -1
- package/dist/sankhyablocks/{p-47db7e88.entry.js → p-a1d72395.entry.js} +1 -1
- package/dist/sankhyablocks/{p-52920496.js → p-aff76a53.js} +1 -1
- package/dist/sankhyablocks/p-b4b21558.entry.js +1 -0
- package/dist/sankhyablocks/{p-4e5e1313.entry.js → p-bad55caa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4f3717df.entry.js → p-c053256c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8fb7d19d.entry.js → p-c5268346.entry.js} +1 -1
- package/dist/sankhyablocks/p-cefba299.js +1 -0
- package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-eae7a817.entry.js} +1 -1
- package/dist/sankhyablocks/p-fcac4dfc.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 +2 -2
- package/dist/sankhyablocks/p-2a408684.js +0 -1
- package/dist/sankhyablocks/p-450c60e4.entry.js +0 -1
- package/dist/sankhyablocks/p-61bf5b79.js +0 -1
- package/dist/sankhyablocks/p-c1d57831.entry.js +0 -1
- package/dist/sankhyablocks/p-fa4d8cb4.js +0 -1
|
@@ -425,7 +425,6 @@ class ConfigStorage {
|
|
|
425
425
|
if (config == undefined) {
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
|
-
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
429
428
|
await this.deleteGridConfigCache(name, resourceID);
|
|
430
429
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
431
430
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
3
|
+
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
5
|
const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
|
|
6
6
|
|
|
@@ -76,8 +76,10 @@ 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
|
-
|
|
79
|
+
return Object.assign(Object.assign({}, dataUnit.getField(name)), { name,
|
|
80
|
+
readOnly,
|
|
81
|
+
visible,
|
|
82
|
+
required });
|
|
81
83
|
}
|
|
82
84
|
return { name, label, readOnly, visible, required };
|
|
83
85
|
})
|
|
@@ -101,7 +103,7 @@ class SnkFormConfigManager {
|
|
|
101
103
|
const normalizedFilter = core.StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
102
104
|
return normalizedText.includes(normalizedFilter);
|
|
103
105
|
}
|
|
104
|
-
|
|
106
|
+
getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
105
107
|
let fields = this.getFieldsList(dataUnit);
|
|
106
108
|
if (ignoreReadOnlyFormFields) {
|
|
107
109
|
fields = fields.filter(field => {
|
|
@@ -133,8 +135,8 @@ class SnkFormConfigManager {
|
|
|
133
135
|
this._onConfigChange(Object.assign({}, this._config));
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
|
-
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
137
|
-
return this.
|
|
138
|
+
getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
|
|
139
|
+
return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
|
|
138
140
|
}
|
|
139
141
|
getFormConfigFetcher() {
|
|
140
142
|
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-942ce74b.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-942ce74b.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-685272e7.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();
|
|
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();
|
|
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() {
|
|
546
546
|
var _a;
|
|
547
547
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
548
548
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -552,8 +552,7 @@ const SnkDataUnit = class {
|
|
|
552
552
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
553
553
|
this.dataUnit.addInterceptor(this);
|
|
554
554
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
555
|
-
|
|
556
|
-
await this.dataUnit.loadMetadata();
|
|
555
|
+
await this.dataUnit.loadMetadata();
|
|
557
556
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
558
557
|
this.getMetadataByRow(this.dataUnit);
|
|
559
558
|
}
|
|
@@ -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-685272e7.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-1b13bacd.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-67605336.js');
|
|
21
21
|
const SnkMessageBuilder = require('./SnkMessageBuilder-722b104e.js');
|
|
22
|
-
require('./ConfigStorage-
|
|
22
|
+
require('./ConfigStorage-942ce74b.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,13 +227,14 @@ const SnkDetailView = class {
|
|
|
227
227
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
|
228
228
|
}
|
|
229
229
|
loadMetadata() {
|
|
230
|
+
var _a;
|
|
230
231
|
if (!this.dataUnit) {
|
|
231
232
|
return;
|
|
232
233
|
}
|
|
233
234
|
if (!this.formConfigManager.isLoaded) {
|
|
234
235
|
return;
|
|
235
236
|
}
|
|
236
|
-
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
237
|
+
const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
|
|
237
238
|
//this._cardsState = formConfig?.cardsState;
|
|
238
239
|
this._formMetadata = form.buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
239
240
|
}
|
|
@@ -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-942ce74b.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-942ce74b.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(this.dataUnit);
|
|
83
|
+
let config = this.configManager.getConfig(false, 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-1b13bacd.js');
|
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
9
|
-
require('./ConfigStorage-
|
|
9
|
+
require('./ConfigStorage-942ce74b.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-942ce74b.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}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100
|
|
83
|
+
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--lg)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.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
|
|
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 &&
|
|
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-1b13bacd.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.dataUnit));
|
|
132
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataState.insertionMode, 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-67605336.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
|
-
require('./SnkFormConfigManager-
|
|
9
|
-
require('./ConfigStorage-
|
|
8
|
+
require('./SnkFormConfigManager-1b13bacd.js');
|
|
9
|
+
require('./ConfigStorage-942ce74b.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-942ce74b.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-942ce74b.js');
|
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.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(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
755
|
+
var _a, _b;
|
|
756
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
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,13 +158,14 @@ export class SnkDetailView {
|
|
|
158
158
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
|
159
159
|
}
|
|
160
160
|
loadMetadata() {
|
|
161
|
+
var _a;
|
|
161
162
|
if (!this.dataUnit) {
|
|
162
163
|
return;
|
|
163
164
|
}
|
|
164
165
|
if (!this.formConfigManager.isLoaded) {
|
|
165
166
|
return;
|
|
166
167
|
}
|
|
167
|
-
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
168
|
+
const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
|
|
168
169
|
//this._cardsState = formConfig?.cardsState;
|
|
169
170
|
this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
170
171
|
}
|
|
@@ -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.dataUnit));
|
|
116
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataState.insertionMode, 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();
|
|
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();
|
|
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() {
|
|
539
539
|
var _a;
|
|
540
540
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
541
541
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -545,8 +545,7 @@ export class SnkDataUnit {
|
|
|
545
545
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
546
546
|
this.dataUnit.addInterceptor(this);
|
|
547
547
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
548
|
-
|
|
549
|
-
await this.dataUnit.loadMetadata();
|
|
548
|
+
await this.dataUnit.loadMetadata();
|
|
550
549
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
551
550
|
this.getMetadataByRow(this.dataUnit);
|
|
552
551
|
}
|
|
@@ -73,8 +73,10 @@ 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
|
-
|
|
76
|
+
return Object.assign(Object.assign({}, dataUnit.getField(name)), { name,
|
|
77
|
+
readOnly,
|
|
78
|
+
visible,
|
|
79
|
+
required });
|
|
78
80
|
}
|
|
79
81
|
return { name, label, readOnly, visible, required };
|
|
80
82
|
})
|
|
@@ -98,7 +100,7 @@ export class SnkFormConfigManager {
|
|
|
98
100
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
99
101
|
return normalizedText.includes(normalizedFilter);
|
|
100
102
|
}
|
|
101
|
-
|
|
103
|
+
getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
102
104
|
let fields = this.getFieldsList(dataUnit);
|
|
103
105
|
if (ignoreReadOnlyFormFields) {
|
|
104
106
|
fields = fields.filter(field => {
|
|
@@ -130,8 +132,8 @@ export class SnkFormConfigManager {
|
|
|
130
132
|
this._onConfigChange(Object.assign({}, this._config));
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
|
-
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
134
|
-
return this.
|
|
135
|
+
getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
|
|
136
|
+
return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
|
|
135
137
|
}
|
|
136
138
|
getFormConfigFetcher() {
|
|
137
139
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -67,7 +67,7 @@ export class SnkFormConfig {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
getConfig() {
|
|
70
|
-
let config = this.configManager.getConfig(this.dataUnit);
|
|
70
|
+
let config = this.configManager.getConfig(false, 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
|
|
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 &&
|
|
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(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
675
|
+
var _a, _b;
|
|
676
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
677
677
|
if (!this.configName && !configFromManager) {
|
|
678
678
|
return this.formConfig;
|
|
679
679
|
}
|
|
@@ -71,7 +71,6 @@ export class ConfigStorage {
|
|
|
71
71
|
if (config == undefined) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
75
74
|
await this.deleteGridConfigCache(name, resourceID);
|
|
76
75
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
77
76
|
}
|
|
@@ -423,7 +423,6 @@ class ConfigStorage {
|
|
|
423
423
|
if (config == undefined) {
|
|
424
424
|
return;
|
|
425
425
|
}
|
|
426
|
-
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
427
426
|
await this.deleteGridConfigCache(name, resourceID);
|
|
428
427
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
429
428
|
}
|
|
@@ -74,8 +74,10 @@ 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
|
-
|
|
77
|
+
return Object.assign(Object.assign({}, dataUnit.getField(name)), { name,
|
|
78
|
+
readOnly,
|
|
79
|
+
visible,
|
|
80
|
+
required });
|
|
79
81
|
}
|
|
80
82
|
return { name, label, readOnly, visible, required };
|
|
81
83
|
})
|
|
@@ -99,7 +101,7 @@ class SnkFormConfigManager {
|
|
|
99
101
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
100
102
|
return normalizedText.includes(normalizedFilter);
|
|
101
103
|
}
|
|
102
|
-
|
|
104
|
+
getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
103
105
|
let fields = this.getFieldsList(dataUnit);
|
|
104
106
|
if (ignoreReadOnlyFormFields) {
|
|
105
107
|
fields = fields.filter(field => {
|
|
@@ -131,8 +133,8 @@ class SnkFormConfigManager {
|
|
|
131
133
|
this._onConfigChange(Object.assign({}, this._config));
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
|
-
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
135
|
-
return this.
|
|
136
|
+
getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
|
|
137
|
+
return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
|
|
136
138
|
}
|
|
137
139
|
getFormConfigFetcher() {
|
|
138
140
|
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();
|
|
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();
|
|
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() {
|
|
582
582
|
var _a;
|
|
583
583
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
584
584
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
@@ -588,8 +588,7 @@ 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
|
-
|
|
592
|
-
await this.dataUnit.loadMetadata();
|
|
591
|
+
await this.dataUnit.loadMetadata();
|
|
593
592
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
|
594
593
|
this.getMetadataByRow(this.dataUnit);
|
|
595
594
|
}
|
|
@@ -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.dataUnit));
|
|
159
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataState.insertionMode, this.dataUnit));
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -938,13 +938,14 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
938
938
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
|
939
939
|
}
|
|
940
940
|
loadMetadata() {
|
|
941
|
+
var _a;
|
|
941
942
|
if (!this.dataUnit) {
|
|
942
943
|
return;
|
|
943
944
|
}
|
|
944
945
|
if (!this.formConfigManager.isLoaded) {
|
|
945
946
|
return;
|
|
946
947
|
}
|
|
947
|
-
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
948
|
+
const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
|
|
948
949
|
//this._cardsState = formConfig?.cardsState;
|
|
949
950
|
this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
950
951
|
}
|
|
@@ -76,7 +76,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
getConfig() {
|
|
79
|
-
let config = this.configManager.getConfig(this.dataUnit);
|
|
79
|
+
let config = this.configManager.getConfig(false, 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}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100
|
|
89
|
+
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--lg)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.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
|
|
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 &&
|
|
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; }
|