@sankhyalabs/sankhyablocks 8.16.0-dev.4 → 8.16.0-dev.6
Sign up to get free protection for your applications and to get access to all the features.
- 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-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 +1 -1
- 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-form-config/SnkFormConfigManager.js +5 -7
- package/dist/collection/components/snk-form-config/snk-form-config.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-detail-view2.js +2 -3
- package/dist/components/snk-form-config2.js +1 -1
- 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-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 +1 -1
- 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-8fc470e5.entry.js → p-62ba211a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-14b9f964.entry.js → p-75e674ed.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3a216b81.entry.js → p-7a85fd49.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-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
@@ -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');
|
@@ -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');
|
@@ -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
|
@@ -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
|
}
|
@@ -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) {
|
@@ -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
|
}
|
@@ -753,8 +753,8 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
753
753
|
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
754
754
|
}
|
755
755
|
getFormConfig() {
|
756
|
-
var _a
|
757
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(
|
756
|
+
var _a;
|
757
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
758
758
|
if (!this.configName && !configFromManager) {
|
759
759
|
return this.formConfig;
|
760
760
|
}
|
@@ -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
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
|
4
4
|
|
@@ -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) {
|
@@ -13,7 +13,7 @@ import './form-config-fetcher-30fb808f.js';
|
|
13
13
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
14
14
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
15
15
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
|
16
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
16
|
+
import { C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
17
17
|
import { O as ORDER_VALUES } from './constants-8457af36.js';
|
18
18
|
import './PrintUtils-3e4ff0f5.js';
|
19
19
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-c1baf61d.js';
|
6
6
|
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-039abba3.js';
|
7
7
|
import { D as DataUnitFetcher } from './dataunit-fetcher-264191b2.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
|
2
2
|
import { Action } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-31b24066.js';
|
4
4
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import './DataFetcher-c1baf61d.js';
|
6
6
|
import './pesquisa-fetcher-03c8f919.js';
|
@@ -13,9 +13,9 @@ import './filter-item-type.enum-d45e026f.js';
|
|
13
13
|
import './form-config-fetcher-30fb808f.js';
|
14
14
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
15
15
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-dda0fede.js';
|
17
17
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-89925609.js';
|
18
|
-
import './ConfigStorage-
|
18
|
+
import './ConfigStorage-3806514e.js';
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
21
21
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
@@ -223,14 +223,13 @@ const SnkDetailView = class {
|
|
223
223
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
224
224
|
}
|
225
225
|
loadMetadata() {
|
226
|
-
var _a;
|
227
226
|
if (!this.dataUnit) {
|
228
227
|
return;
|
229
228
|
}
|
230
229
|
if (!this.formConfigManager.isLoaded) {
|
231
230
|
return;
|
232
231
|
}
|
233
|
-
const formConfig = this.formConfigManager.getConfig(
|
232
|
+
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
234
233
|
//this._cardsState = formConfig?.cardsState;
|
235
234
|
this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
236
235
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
7
7
|
import { F as FilterOperand } from './index-ae591a44.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
6
6
|
import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
|
7
7
|
import './form-config-fetcher-30fb808f.js';
|
8
8
|
import './DataFetcher-c1baf61d.js';
|
@@ -76,7 +76,7 @@ const SnkFormConfig = class {
|
|
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
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-31b24066.js';
|
4
4
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
5
|
-
import './ConfigStorage-
|
5
|
+
import './ConfigStorage-3806514e.js';
|
6
6
|
import './form-config-fetcher-30fb808f.js';
|
7
7
|
import './DataFetcher-c1baf61d.js';
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
5
5
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
6
6
|
import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
|
7
7
|
import { s as store } from './index-bdf75557.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-31b24066.js';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-efbe307f.js';
|
6
6
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
@@ -127,7 +127,7 @@ const SnkGuidesViewer = class {
|
|
127
127
|
}
|
128
128
|
onContentCardChanged(evt) {
|
129
129
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
130
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
130
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
131
131
|
}
|
132
132
|
/**
|
133
133
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-dda0fede.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
|
-
import './SnkFormConfigManager-
|
5
|
-
import './ConfigStorage-
|
4
|
+
import './SnkFormConfigManager-31b24066.js';
|
5
|
+
import './ConfigStorage-3806514e.js';
|
6
6
|
import './form-config-fetcher-30fb808f.js';
|
7
7
|
import './DataFetcher-c1baf61d.js';
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a7d3d3f1.js';
|
2
2
|
import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
|
4
|
-
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-3806514e.js';
|
5
5
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
6
6
|
import { a as FilterGroupCondition } from './index-ae591a44.js';
|
7
7
|
import { s as store } from './index-bdf75557.js';
|