@sankhyalabs/sankhyablocks 8.16.0-dev.20 → 8.16.0-dev.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-e49214c6.js → ConfigStorage-ecc0ed20.js} +2 -2
- package/dist/cjs/{DataFetcher-77729a93.js → DataFetcher-cadeef8e.js} +21 -20
- package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
- package/dist/cjs/{IExporterProvider-10b7fed5.js → IExporterProvider-9ac15aaf.js} +4 -4
- package/dist/cjs/{SnkFormConfigManager-beebf47a.js → SnkFormConfigManager-f1c92f79.js} +72 -16
- package/dist/cjs/{auth-fetcher-29bb791c.js → auth-fetcher-d68841bc.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-d4873076.js → dataunit-fetcher-4b12f70c.js} +1 -1
- package/dist/cjs/{form-config-fetcher-feb08214.js → form-config-fetcher-ed497282.js} +5 -2
- package/dist/cjs/{pesquisa-fetcher-a1d0353f.js → pesquisa-fetcher-ca89181c.js} +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
- package/dist/cjs/snk-application.cjs.entry.js +6 -6
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
- package/dist/cjs/{snk-data-unit-11e31d8d.js → snk-data-unit-2f2e6f8c.js} +3 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +15 -4
- package/dist/cjs/snk-form.cjs.entry.js +7 -6
- package/dist/cjs/snk-grid.cjs.entry.js +8 -8
- package/dist/cjs/{snk-guides-viewer-aafc3073.js → snk-guides-viewer-866447ab.js} +10 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -10
- package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +1 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +5 -2
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +2 -2
- package/dist/collection/components/snk-form/snk-form.js +2 -2
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +70 -14
- package/dist/collection/components/snk-form-config/snk-form-config.js +13 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +21 -20
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
- package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
- package/dist/components/DataFetcher.js +21 -20
- package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
- package/dist/components/SnkFormConfigManager.js +70 -14
- package/dist/components/form-config-fetcher.js +4 -1
- package/dist/components/snk-actions-button2.js +12 -9
- package/dist/components/snk-data-unit2.js +4 -41
- package/dist/components/snk-detail-view2.js +6 -3
- package/dist/components/snk-form-config2.js +13 -2
- package/dist/components/snk-form.js +2 -2
- package/dist/components/snk-grid2.js +2 -2
- package/dist/components/snk-simple-crud2.js +4 -3
- package/dist/esm/{ConfigStorage-e476378d.js → ConfigStorage-7b36d041.js} +2 -2
- package/dist/esm/{DataFetcher-773a3e4b.js → DataFetcher-a9c598f2.js} +21 -20
- package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
- package/dist/esm/{IExporterProvider-d597f27d.js → IExporterProvider-09df2e3e.js} +4 -4
- package/dist/esm/{SnkFormConfigManager-298cd647.js → SnkFormConfigManager-139f09fa.js} +72 -16
- package/dist/esm/{auth-fetcher-a411f73c.js → auth-fetcher-749d880f.js} +1 -1
- package/dist/esm/{dataunit-fetcher-3d2ec959.js → dataunit-fetcher-3aac1a53.js} +1 -1
- package/dist/esm/{form-config-fetcher-e0382e5a.js → form-config-fetcher-adbe5d34.js} +5 -2
- package/dist/esm/{pesquisa-fetcher-a87445a0.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +17 -14
- package/dist/esm/snk-application.entry.js +6 -6
- package/dist/esm/snk-attach.entry.js +5 -5
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +6 -6
- package/dist/esm/{snk-data-unit-29de836f.js → snk-data-unit-acf3dd64.js} +3 -3
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-detail-view.entry.js +8 -8
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +15 -4
- package/dist/esm/snk-form.entry.js +7 -6
- package/dist/esm/snk-grid.entry.js +8 -8
- package/dist/esm/{snk-guides-viewer-62124f3d.js → snk-guides-viewer-cb8a0b48.js} +10 -7
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +10 -10
- package/dist/sankhyablocks/{p-181975f1.js → p-06421fdb.js} +2 -2
- package/dist/sankhyablocks/{p-094eebf6.entry.js → p-0e9a872d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5b9160c6.entry.js → p-16969508.entry.js} +1 -1
- package/dist/sankhyablocks/{p-76a65660.js → p-1ab19772.js} +1 -1
- package/dist/sankhyablocks/{p-25f1fc39.js → p-1bf06cd3.js} +2 -2
- package/dist/sankhyablocks/{p-51999ab5.entry.js → p-1f47a0b2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9dfda04a.entry.js → p-212213d9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-12f45f86.entry.js → p-3757394b.entry.js} +1 -1
- package/dist/sankhyablocks/p-3d542b58.entry.js +1 -0
- package/dist/sankhyablocks/{p-3287a6cc.js → p-4d9549cf.js} +1 -1
- package/dist/sankhyablocks/p-53c1d25d.entry.js +1 -0
- package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
- package/dist/sankhyablocks/{p-162b9a59.entry.js → p-640140b3.entry.js} +2 -2
- package/dist/sankhyablocks/p-73185e58.entry.js +1 -0
- package/dist/sankhyablocks/p-7dd49d15.js +1 -0
- package/dist/sankhyablocks/{p-53949130.entry.js → p-8862ba4a.entry.js} +1 -1
- package/dist/sankhyablocks/p-8d7e2747.entry.js +1 -0
- package/dist/sankhyablocks/{p-70001ac1.js → p-a31e761f.js} +1 -1
- package/dist/sankhyablocks/p-afbb070d.js +1 -0
- package/dist/sankhyablocks/{p-5b26cc7c.entry.js → p-b2caaaf9.entry.js} +1 -1
- package/dist/sankhyablocks/p-bc4b94d2.entry.js +1 -0
- package/dist/sankhyablocks/{p-0cd3c0a9.js → p-ca5ec380.js} +1 -1
- package/dist/sankhyablocks/p-ce6eed2c.js +1 -0
- package/dist/sankhyablocks/{p-594bc21d.js → p-f3434fc4.js} +1 -1
- package/dist/sankhyablocks/{p-091ce761.js → p-f8698ad3.js} +1 -1
- package/dist/sankhyablocks/{p-bd008859.entry.js → p-fb34e0cf.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +1 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +7 -2
- package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-08c28ddd.entry.js +0 -1
- package/dist/sankhyablocks/p-2e9c764c.entry.js +0 -1
- package/dist/sankhyablocks/p-421bec84.entry.js +0 -1
- package/dist/sankhyablocks/p-5e384af4.entry.js +0 -1
- package/dist/sankhyablocks/p-5f016aed.js +0 -1
- package/dist/sankhyablocks/p-8f4e743f.js +0 -1
- package/dist/sankhyablocks/p-939e15d3.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-d65d98ed.entry.js +0 -1
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -7,9 +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-ed497282.js');
|
11
11
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
12
|
-
require('./DataFetcher-
|
12
|
+
require('./DataFetcher-cadeef8e.js');
|
13
13
|
require('./PrintUtils-bcaeb82f.js');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
15
|
|
@@ -206,6 +206,11 @@ const SnkFormConfig = class {
|
|
206
206
|
this.configManager.saveConfig(this.buildConfigToSave())
|
207
207
|
.then(savedConfig => {
|
208
208
|
utils.ApplicationUtils.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"), { iconName: "check" });
|
209
|
+
const userOption = this._formConfigOptions
|
210
|
+
.find((config) => {
|
211
|
+
return config.origin === formConfigFetcher.UserConfigType.USER;
|
212
|
+
});
|
213
|
+
this.setFormConfig(userOption);
|
209
214
|
this.configChange.emit(savedConfig);
|
210
215
|
});
|
211
216
|
}
|
@@ -539,9 +544,12 @@ const SnkFormConfig = class {
|
|
539
544
|
switch (this._optionFormConfigSelected.origin) {
|
540
545
|
case formConfigFetcher.UserConfigType.DEFAULT:
|
541
546
|
config = await this.configManager.fetchDefaultConfig();
|
547
|
+
if (!config) {
|
548
|
+
config = this.configManager.getEmptyConfig();
|
549
|
+
}
|
542
550
|
break;
|
543
|
-
|
544
|
-
config =
|
551
|
+
default:
|
552
|
+
config = this.getConfig();
|
545
553
|
break;
|
546
554
|
}
|
547
555
|
if (config != undefined) {
|
@@ -744,6 +752,9 @@ const SnkFormConfig = class {
|
|
744
752
|
if (layoutFormConfig == undefined) {
|
745
753
|
layoutFormConfig = [];
|
746
754
|
}
|
755
|
+
if (this._formConfig.defaultConfiguration) {
|
756
|
+
return layoutFormConfig;
|
757
|
+
}
|
747
758
|
return this._formConfig.tabs.map((tab) => {
|
748
759
|
return layoutFormConfig.find(config => { var _a, _b; return ((_a = tab.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = config.tab) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })
|
749
760
|
|| { tab: tab.label, groups: [], visible: tab.visible };
|
@@ -4,14 +4,15 @@ 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-f1c92f79.js');
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
9
|
-
require('./ConfigStorage-
|
10
|
-
require('./form-config-fetcher-
|
11
|
-
require('./DataFetcher-
|
9
|
+
require('./ConfigStorage-ecc0ed20.js');
|
10
|
+
require('./form-config-fetcher-ed497282.js');
|
11
|
+
require('./DataFetcher-cadeef8e.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
15
|
+
require('./constants-35ddd366.js');
|
15
16
|
|
16
17
|
const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
|
17
18
|
|
@@ -104,7 +105,7 @@ const SnkForm = class {
|
|
104
105
|
if (this.resourceID == undefined) {
|
105
106
|
this.resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
|
106
107
|
}
|
107
|
-
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID);
|
108
|
+
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
|
108
109
|
this.addFormLegacyConfig();
|
109
110
|
await this._configManager.loadConfig();
|
110
111
|
}
|
@@ -133,7 +134,7 @@ const SnkForm = class {
|
|
133
134
|
if (!this._dataUnit || !this._dataState) {
|
134
135
|
return undefined;
|
135
136
|
}
|
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.
|
137
|
+
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._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
137
138
|
index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
|
138
139
|
}
|
139
140
|
get _element() { return index.getElement(this); }
|
@@ -5,21 +5,21 @@ 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-ecc0ed20.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');
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
12
|
+
const IExporterProvider = require('./IExporterProvider-9ac15aaf.js');
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
14
|
-
require('./DataFetcher-
|
15
|
-
require('./pesquisa-fetcher-
|
14
|
+
require('./DataFetcher-cadeef8e.js');
|
15
|
+
require('./pesquisa-fetcher-ca89181c.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-
|
19
|
+
require('./dataunit-fetcher-4b12f70c.js');
|
20
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
21
|
-
require('./form-config-fetcher-
|
22
|
-
const
|
21
|
+
require('./form-config-fetcher-ed497282.js');
|
22
|
+
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
24
24
|
require('./PrintUtils-bcaeb82f.js');
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -48,7 +48,7 @@ class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
48
48
|
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
49
49
|
}
|
50
50
|
getSelectedIDs() {
|
51
|
-
return
|
51
|
+
return GetSelectedRecordsIDsInfo.getSelectedRecordsIDsInfo(this.dataUnit);
|
52
52
|
}
|
53
53
|
getOffset() {
|
54
54
|
return this.getExporterOffset(this.getPaginationInfo());
|
@@ -2,20 +2,20 @@
|
|
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-f1c92f79.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');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
10
|
+
require('./DataFetcher-cadeef8e.js');
|
11
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
12
12
|
const index$1 = require('./index-1dfc7a6e.js');
|
13
13
|
require('./ISave-e91b70a7.js');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
|
-
require('./dataunit-fetcher-
|
16
|
+
require('./dataunit-fetcher-4b12f70c.js');
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
|
-
require('./form-config-fetcher-
|
18
|
+
require('./form-config-fetcher-ed497282.js');
|
19
19
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
20
20
|
|
21
21
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
@@ -377,11 +377,14 @@ const SnkGuidesViewer = class {
|
|
377
377
|
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
378
378
|
}
|
379
379
|
}
|
380
|
+
setMasterFormConfig(config) {
|
381
|
+
this.masterFormConfig = config;
|
382
|
+
}
|
380
383
|
componentWillLoad() {
|
381
384
|
if (this.resourceID == undefined) {
|
382
385
|
throw new Error("Erro interno: resourceID não informado");
|
383
386
|
}
|
384
|
-
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID,
|
387
|
+
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
|
385
388
|
this.addFormLegacyConfigName();
|
386
389
|
this._configManager.loadConfig();
|
387
390
|
}
|
@@ -409,7 +412,7 @@ const SnkGuidesViewer = class {
|
|
409
412
|
return this._fieldSearch;
|
410
413
|
}
|
411
414
|
fieldsOptionLoader(argument) {
|
412
|
-
return Promise.resolve(this._configManager.getFieldsList(
|
415
|
+
return Promise.resolve(this._configManager.getFieldsList(argument)
|
413
416
|
.map(field => ({ value: field.name, label: field.label })));
|
414
417
|
}
|
415
418
|
onSelectField(option, actionButton) {
|
@@ -2,26 +2,26 @@
|
|
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-866447ab.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
9
|
-
require('./ConfigStorage-
|
10
|
-
require('./form-config-fetcher-
|
11
|
-
require('./DataFetcher-
|
8
|
+
require('./SnkFormConfigManager-f1c92f79.js');
|
9
|
+
require('./ConfigStorage-ecc0ed20.js');
|
10
|
+
require('./form-config-fetcher-ed497282.js');
|
11
|
+
require('./DataFetcher-cadeef8e.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
15
|
+
require('./constants-35ddd366.js');
|
15
16
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
16
17
|
require('./field-search-f56aa7d6.js');
|
17
18
|
require('./taskbar-elements-9ad1f9c0.js');
|
18
19
|
require('./index-1dfc7a6e.js');
|
19
20
|
require('./index-102ba62d.js');
|
20
|
-
require('./
|
21
|
-
require('./pesquisa-fetcher-a1d0353f.js');
|
21
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
22
22
|
require('./ISave-e91b70a7.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
24
|
-
require('./dataunit-fetcher-
|
24
|
+
require('./dataunit-fetcher-4b12f70c.js');
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
26
26
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
27
27
|
require('./ResourceIDUtils-5ff86aa7.js');
|
@@ -5,13 +5,13 @@ 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-ecc0ed20.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');
|
12
12
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
13
|
-
require('./form-config-fetcher-
|
14
|
-
require('./DataFetcher-
|
13
|
+
require('./form-config-fetcher-ed497282.js');
|
14
|
+
require('./DataFetcher-cadeef8e.js');
|
15
15
|
require('./PrintUtils-bcaeb82f.js');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
17
|
|
@@ -7,20 +7,20 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
10
|
+
require('./DataFetcher-cadeef8e.js');
|
11
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
12
|
+
const IExporterProvider = require('./IExporterProvider-9ac15aaf.js');
|
13
13
|
const index = require('./index-1dfc7a6e.js');
|
14
14
|
require('./ISave-e91b70a7.js');
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-4b12f70c.js');
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
19
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
19
|
+
const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
|
20
20
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
23
|
-
const
|
21
|
+
const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
|
23
|
+
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
26
26
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
@@ -41,7 +41,7 @@ class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
41
41
|
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
42
42
|
}
|
43
43
|
getSelectedIDs() {
|
44
|
-
return
|
44
|
+
return GetSelectedRecordsIDsInfo.getSelectedRecordsIDsInfo(this.dataUnit);
|
45
45
|
}
|
46
46
|
getRecordID() {
|
47
47
|
var _a, _b, _c;
|
@@ -359,7 +359,7 @@ const SnkSimpleCrud = class {
|
|
359
359
|
return;
|
360
360
|
}
|
361
361
|
if (this._formConfigManager == undefined) {
|
362
|
-
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
|
362
|
+
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
|
363
363
|
this._formConfigManager.setConfig(this.formConfig);
|
364
364
|
}
|
365
365
|
if (this.formConfigIsLoaded() && !forceLoad) {
|
@@ -3,9 +3,9 @@ import { RefreshType } from "./enum/RefreshType";
|
|
3
3
|
import { ParamType } from "./enum/ParamType";
|
4
4
|
import { DataFetcher } from "../../../lib";
|
5
5
|
import { ActionsType } from "./enum/ActionsType";
|
6
|
+
import { getSelectedRecordsIDsInfo } from "../../../lib/utils/GetSelectedRecordsIDsInfo";
|
6
7
|
const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
|
7
8
|
const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
|
8
|
-
const NUFIN_COLUMN = 'NUFIN';
|
9
9
|
const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
|
10
10
|
export default class Actions {
|
11
11
|
constructor(actionsExecuteInterface, dataUnit, appResourceId) {
|
@@ -17,6 +17,10 @@ export default class Actions {
|
|
17
17
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
18
18
|
this._appResourceId = appResourceId;
|
19
19
|
}
|
20
|
+
getPrimaryKeys() {
|
21
|
+
const ids = getSelectedRecordsIDsInfo(this._dataUnit);
|
22
|
+
return ids.map(({ name }) => name);
|
23
|
+
}
|
20
24
|
apply(action, hasParamsToSave) {
|
21
25
|
this._application.closePopUp();
|
22
26
|
this._actionsExecuteInterface.execute(action, this._dataUnit)
|
@@ -285,6 +289,7 @@ export default class Actions {
|
|
285
289
|
executeAction(execSource);
|
286
290
|
}
|
287
291
|
addRows(execSource) {
|
292
|
+
const primaryKeys = this.getPrimaryKeys();
|
288
293
|
const rows = {
|
289
294
|
row: []
|
290
295
|
};
|
@@ -298,15 +303,13 @@ export default class Actions {
|
|
298
303
|
delete sourceRow[MASTER_ROW_PROPERTY];
|
299
304
|
delete sourceRow[ENTITY_NAME_PROPERTY];
|
300
305
|
}
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
row.field = [];
|
306
|
-
}
|
306
|
+
if (!row.field) {
|
307
|
+
row.field = [];
|
308
|
+
}
|
309
|
+
for (const primaryKey of primaryKeys) {
|
307
310
|
row.field.push({
|
308
|
-
fieldName:
|
309
|
-
$: sourceRow[
|
311
|
+
fieldName: primaryKey,
|
312
|
+
$: sourceRow[primaryKey]
|
310
313
|
});
|
311
314
|
}
|
312
315
|
rows.row.push(row);
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
@@ -222,7 +222,7 @@ export class SnkDetailView {
|
|
222
222
|
}
|
223
223
|
componentWillLoad() {
|
224
224
|
this._configName = `dynaform.${this.entityName}`;
|
225
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
|
225
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata(), this.dataUnit);
|
226
226
|
this.formConfigManager.loadConfig();
|
227
227
|
if (this.messagesBuilder == undefined) {
|
228
228
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -361,11 +361,14 @@ export class SnkGuidesViewer {
|
|
361
361
|
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
362
362
|
}
|
363
363
|
}
|
364
|
+
setMasterFormConfig(config) {
|
365
|
+
this.masterFormConfig = config;
|
366
|
+
}
|
364
367
|
componentWillLoad() {
|
365
368
|
if (this.resourceID == undefined) {
|
366
369
|
throw new Error("Erro interno: resourceID não informado");
|
367
370
|
}
|
368
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID,
|
371
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
|
369
372
|
this.addFormLegacyConfigName();
|
370
373
|
this._configManager.loadConfig();
|
371
374
|
}
|
@@ -393,7 +396,7 @@ export class SnkGuidesViewer {
|
|
393
396
|
return this._fieldSearch;
|
394
397
|
}
|
395
398
|
fieldsOptionLoader(argument) {
|
396
|
-
return Promise.resolve(this._configManager.getFieldsList(
|
399
|
+
return Promise.resolve(this._configManager.getFieldsList(argument)
|
397
400
|
.map(field => ({ value: field.name, label: field.label })));
|
398
401
|
}
|
399
402
|
onSelectField(option, actionButton) {
|
package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
2
2
|
import { UserInterface } from "@sankhyalabs/core";
|
3
|
-
import { getSelectedIDs } from
|
3
|
+
import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
|
4
4
|
import { DataExporterOption } from "../../../lib/@types";
|
5
5
|
export default class ClientSideExporterProvider extends CommonsExporter {
|
6
6
|
getSelectedNumber() {
|
package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
2
|
-
import { getSelectedIDs } from
|
2
|
+
import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
|
3
3
|
export default class ServerSideExporterProvider extends CommonsExporter {
|
4
4
|
getFilters() {
|
5
5
|
var _a;
|
@@ -4,8 +4,8 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
|
|
4
4
|
import { OperationMap, SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
|
5
5
|
import { DatasetStrategy } from '../../lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy';
|
6
6
|
import { getRecordValue } from '../../lib/dataUnit/ValueFormatter';
|
7
|
-
import { getSelectedIDs } from '../snk-data-exporter/utils/RecordIDUtils';
|
8
7
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
8
|
+
import { getSelectedRecordsIDsInfo } from '../../lib/utils/GetSelectedRecordsIDsInfo';
|
9
9
|
export class SnkDataUnit {
|
10
10
|
constructor() {
|
11
11
|
this._onDataUnitResolve = [];
|
@@ -110,7 +110,7 @@ export class SnkDataUnit {
|
|
110
110
|
* @returns Retorna a lista de IDs dos registros selecionados.
|
111
111
|
*/
|
112
112
|
async getSelectedRecordsIDsInfo() {
|
113
|
-
return
|
113
|
+
return getSelectedRecordsIDsInfo(this.dataUnit);
|
114
114
|
}
|
115
115
|
/**
|
116
116
|
* Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
|
@@ -87,7 +87,7 @@ export class SnkForm {
|
|
87
87
|
if (this.resourceID == undefined) {
|
88
88
|
this.resourceID = await ResourceIDUtils.getResourceID();
|
89
89
|
}
|
90
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
|
90
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
|
91
91
|
this.addFormLegacyConfig();
|
92
92
|
await this._configManager.loadConfig();
|
93
93
|
}
|
@@ -117,7 +117,7 @@ export class SnkForm {
|
|
117
117
|
if (!this._dataUnit || !this._dataState) {
|
118
118
|
return undefined;
|
119
119
|
}
|
120
|
-
return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, 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.
|
120
|
+
return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, 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._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
121
121
|
h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
|
122
122
|
}
|
123
123
|
static get is() { return "snk-form"; }
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
2
2
|
import { ObjectUtils, StringUtils } from "@sankhyalabs/core";
|
3
3
|
import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
|
4
|
+
import { TAB_NAMES } from "../../lib/utils/constants";
|
4
5
|
export class SnkFormConfigManager {
|
5
|
-
constructor(configName, resourceID, onConfigChange) {
|
6
|
+
constructor(configName, resourceID, onConfigChange, dataUnit) {
|
6
7
|
this._resourceID = resourceID;
|
7
8
|
this._configName = configName;
|
8
9
|
this._onConfigChange = onConfigChange;
|
10
|
+
this._dataUnit = dataUnit;
|
9
11
|
}
|
10
12
|
addFormLegacyConfig(legacyConfigName) {
|
11
13
|
if (this._configName) {
|
@@ -16,6 +18,7 @@ export class SnkFormConfigManager {
|
|
16
18
|
return new Promise(resolve => {
|
17
19
|
ConfigStorage.loadFormConfig(this._configName, this._resourceID)
|
18
20
|
.then((config) => {
|
21
|
+
config = this.buildFormMetadataUITabs(config);
|
19
22
|
this.setConfig(config);
|
20
23
|
resolve(config);
|
21
24
|
})
|
@@ -24,6 +27,10 @@ export class SnkFormConfigManager {
|
|
24
27
|
});
|
25
28
|
});
|
26
29
|
}
|
30
|
+
getEmptyConfig() {
|
31
|
+
const config = this.buildFormMetadataUITabs({ fields: [], emptyConfig: true }, true);
|
32
|
+
return config;
|
33
|
+
}
|
27
34
|
saveConfig(config) {
|
28
35
|
const configToSave = ObjectUtils.copy(config);
|
29
36
|
return new Promise(accept => {
|
@@ -67,25 +74,36 @@ export class SnkFormConfigManager {
|
|
67
74
|
}
|
68
75
|
return updatingCardConfig;
|
69
76
|
}
|
70
|
-
|
77
|
+
hasConfig(config) {
|
78
|
+
var _a;
|
79
|
+
const currentConfig = config !== null && config !== void 0 ? config : this._config;
|
80
|
+
if (currentConfig && ((_a = currentConfig.fields) === null || _a === void 0 ? void 0 : _a.length)) {
|
81
|
+
return true;
|
82
|
+
}
|
83
|
+
return false;
|
84
|
+
}
|
85
|
+
getFieldsList(descriptionFilter, forceEmptyConfig = false) {
|
71
86
|
var _a;
|
72
87
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
73
|
-
|
74
|
-
|
88
|
+
const hasConfig = this.hasConfig();
|
89
|
+
if (hasConfig && !forceEmptyConfig) {
|
90
|
+
return fields.map(({ label, name, readOnly, visible, required, tab }) => {
|
91
|
+
var _a;
|
75
92
|
if (label == undefined) {
|
76
|
-
const currentField =
|
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 });
|
93
|
+
const currentField = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
|
94
|
+
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, tab: tab });
|
78
95
|
}
|
79
|
-
return { name, label, readOnly, visible, required };
|
96
|
+
return { name, label, readOnly, visible, required, tab };
|
80
97
|
})
|
81
98
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
82
99
|
}
|
83
|
-
if (
|
84
|
-
return
|
85
|
-
.filter(field => this.isFieldVisible(field, descriptionFilter))
|
86
|
-
.map(({ label, name, readOnly }) => { return { label, name, readOnly }; });
|
100
|
+
if (!this._dataUnit) {
|
101
|
+
return [];
|
87
102
|
}
|
88
|
-
|
103
|
+
const filteredFields = this._dataUnit.metadata.fields
|
104
|
+
.filter(field => this.isFieldVisible(field, descriptionFilter))
|
105
|
+
.map(({ label, name, readOnly, visible, required, properties }) => ({ label, name, readOnly, visible, required, tab: properties === null || properties === void 0 ? void 0 : properties.UITabName }));
|
106
|
+
return filteredFields;
|
89
107
|
}
|
90
108
|
isFieldVisible(field, descriptionFilter) {
|
91
109
|
if (field.visible === false) {
|
@@ -98,8 +116,8 @@ export class SnkFormConfigManager {
|
|
98
116
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
99
117
|
return normalizedText.includes(normalizedFilter);
|
100
118
|
}
|
101
|
-
getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
|
102
|
-
let fields = this.getFieldsList(
|
119
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields, forceEmptyConfig = false) {
|
120
|
+
let fields = this.getFieldsList(undefined, forceEmptyConfig);
|
103
121
|
if (ignoreReadOnlyFormFields) {
|
104
122
|
fields = fields.filter(field => {
|
105
123
|
if (dataUnit) {
|
@@ -152,4 +170,42 @@ export class SnkFormConfigManager {
|
|
152
170
|
async fetchDefaultConfig() {
|
153
171
|
return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
|
154
172
|
}
|
173
|
+
parseObjectList(object) {
|
174
|
+
if (!object) {
|
175
|
+
return [];
|
176
|
+
}
|
177
|
+
return Array.isArray(object) ? object : [object];
|
178
|
+
}
|
179
|
+
buildFormMetadataUITabs(config, forceEmptyConfig = false) {
|
180
|
+
var _a;
|
181
|
+
const hasConfig = this.hasConfig(config);
|
182
|
+
if (!forceEmptyConfig && (!this._dataUnit || hasConfig)) {
|
183
|
+
return config;
|
184
|
+
}
|
185
|
+
config = this.getFormConfig(this._dataUnit, false, true);
|
186
|
+
config.tabs = this.parseObjectList(config.tabs);
|
187
|
+
config.emptyConfig = false;
|
188
|
+
config.defaultConfiguration = true;
|
189
|
+
const fields = this._dataUnit.metadata.fields;
|
190
|
+
for (const currentField of fields) {
|
191
|
+
const field = config.fields.find(field => field.name === currentField.name);
|
192
|
+
const uiTabName = (_a = currentField.properties) === null || _a === void 0 ? void 0 : _a.UITabName;
|
193
|
+
if (!uiTabName || uiTabName === TAB_NAMES.main) {
|
194
|
+
continue;
|
195
|
+
}
|
196
|
+
const haveTab = config.tabs.some((tab) => tab.label === uiTabName);
|
197
|
+
if (!haveTab) {
|
198
|
+
config.tabs.push({
|
199
|
+
label: uiTabName,
|
200
|
+
name: uiTabName,
|
201
|
+
order: 0,
|
202
|
+
visible: true,
|
203
|
+
});
|
204
|
+
}
|
205
|
+
if (field) {
|
206
|
+
field.tab = uiTabName;
|
207
|
+
}
|
208
|
+
}
|
209
|
+
return config;
|
210
|
+
}
|
155
211
|
}
|
@@ -193,6 +193,11 @@ export class SnkFormConfig {
|
|
193
193
|
this.configManager.saveConfig(this.buildConfigToSave())
|
194
194
|
.then(savedConfig => {
|
195
195
|
ApplicationUtils.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"), { iconName: "check" });
|
196
|
+
const userOption = this._formConfigOptions
|
197
|
+
.find((config) => {
|
198
|
+
return config.origin === UserConfigType.USER;
|
199
|
+
});
|
200
|
+
this.setFormConfig(userOption);
|
196
201
|
this.configChange.emit(savedConfig);
|
197
202
|
});
|
198
203
|
}
|
@@ -529,9 +534,12 @@ export class SnkFormConfig {
|
|
529
534
|
switch (this._optionFormConfigSelected.origin) {
|
530
535
|
case UserConfigType.DEFAULT:
|
531
536
|
config = await this.configManager.fetchDefaultConfig();
|
537
|
+
if (!config) {
|
538
|
+
config = this.configManager.getEmptyConfig();
|
539
|
+
}
|
532
540
|
break;
|
533
|
-
|
534
|
-
config =
|
541
|
+
default:
|
542
|
+
config = this.getConfig();
|
535
543
|
break;
|
536
544
|
}
|
537
545
|
if (config != undefined) {
|
@@ -734,6 +742,9 @@ export class SnkFormConfig {
|
|
734
742
|
if (layoutFormConfig == undefined) {
|
735
743
|
layoutFormConfig = [];
|
736
744
|
}
|
745
|
+
if (this._formConfig.defaultConfiguration) {
|
746
|
+
return layoutFormConfig;
|
747
|
+
}
|
737
748
|
return this._formConfig.tabs.map((tab) => {
|
738
749
|
return layoutFormConfig.find(config => { var _a, _b; return ((_a = tab.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = config.tab) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })
|
739
750
|
|| { tab: tab.label, groups: [], visible: tab.visible };
|
@@ -279,7 +279,7 @@ export class SnkSimpleCrud {
|
|
279
279
|
return;
|
280
280
|
}
|
281
281
|
if (this._formConfigManager == undefined) {
|
282
|
-
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
282
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
|
283
283
|
this._formConfigManager.setConfig(this.formConfig);
|
284
284
|
}
|
285
285
|
if (this.formConfigIsLoaded() && !forceLoad) {
|