@sankhyalabs/sankhyablocks 8.16.0-dev.1 → 8.16.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-a343e418.js} +1 -0
- package/dist/cjs/{IExporterProvider-c78cb1b8.js → IExporterProvider-597949f9.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-166cbd1f.js} +6 -8
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-897ffd08.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-620b29a1.js → dataunit-fetcher-688d3f05.js} +8 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +3 -3
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +7 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-82dea87e.js → snk-data-unit-8fa7917a.js} +17 -7
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -7
- 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-05a1ba27.js → snk-guides-viewer-9c682034.js} +9 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -4
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -7
- package/dist/collection/components/snk-crud/snk-crud.js +57 -1
- 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 +22 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +32 -5
- 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 +21 -3
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -0
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +7 -3
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/SnkFormConfigManager.js +5 -7
- package/dist/components/SnkMessageBuilder.js +1 -1
- package/dist/components/dataunit-fetcher.js +8 -3
- package/dist/components/snk-crud.js +8 -1
- package/dist/components/snk-data-unit2.js +16 -5
- package/dist/components/snk-detail-view2.js +9 -4
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-simple-crud2.js +5 -3
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-3806514e.js} +1 -0
- package/dist/esm/{IExporterProvider-343272b3.js → IExporterProvider-63a188b6.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-31b24066.js} +6 -8
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-571462fb.js} +1 -1
- package/dist/esm/{dataunit-fetcher-3fbf9d12.js → dataunit-fetcher-264191b2.js} +8 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +2 -2
- package/dist/esm/snk-application.entry.js +3 -3
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +7 -2
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-8f98b45f.js → snk-data-unit-f5cbe64b.js} +17 -7
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +6 -7
- 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-aee2cafe.js → snk-guides-viewer-8f6960a2.js} +9 -4
- package/dist/esm/snk-guides-viewer.entry.js +4 -4
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +8 -7
- package/dist/sankhyablocks/p-17def7cd.js +1 -0
- package/dist/sankhyablocks/p-28ee0972.js +1 -0
- 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-9e99a92a.js → p-3a212712.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-4f72727a.entry.js → p-4e5e1313.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-44767378.entry.js → p-6bb2f3e9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2d649237.entry.js → p-7505da04.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e95b3b93.entry.js → p-7619bdb1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8a5910a7.entry.js → p-7a85fd49.entry.js} +1 -1
- package/dist/sankhyablocks/p-7ef9c55c.js +1 -0
- package/dist/sankhyablocks/p-80042dc6.entry.js +1 -0
- package/dist/sankhyablocks/{p-5539ecb4.entry.js → p-8c59edd7.entry.js} +1 -1
- package/dist/sankhyablocks/p-9606509c.entry.js +1 -0
- package/dist/sankhyablocks/p-ae93d46a.entry.js +1 -0
- package/dist/sankhyablocks/{p-47b60deb.entry.js → p-d6e26ea8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-26394a01.entry.js → p-f4450320.entry.js} +1 -1
- package/dist/sankhyablocks/{p-672302c3.js → p-fe79f83a.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +5 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components.d.ts +41 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-0d91b10f.entry.js +0 -1
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-550fee49.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-8cc64963.entry.js +0 -1
- package/dist/sankhyablocks/p-be603a24.js +0 -1
- package/dist/sankhyablocks/p-d09feef1.js +0 -1
@@ -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');
|
@@ -12,14 +12,14 @@ const index$1 = require('./index-1dfc7a6e.js');
|
|
12
12
|
require('./ISave-e91b70a7.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
require('./dataunit-fetcher-
|
15
|
+
require('./dataunit-fetcher-688d3f05.js');
|
16
16
|
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-
|
21
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
22
|
-
require('./ConfigStorage-
|
20
|
+
const snkGuidesViewer = require('./snk-guides-viewer-9c682034.js');
|
21
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-897ffd08.js');
|
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,18 +5,18 @@ 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');
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
12
|
+
const IExporterProvider = require('./IExporterProvider-597949f9.js');
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
14
14
|
require('./DataFetcher-313debd8.js');
|
15
15
|
require('./pesquisa-fetcher-680e198f.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-688d3f05.js');
|
20
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
21
21
|
require('./form-config-fetcher-2dd00e5b.js');
|
22
22
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.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');
|
@@ -13,7 +13,7 @@ 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-688d3f05.js');
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
18
|
require('./form-config-fetcher-2dd00e5b.js');
|
19
19
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
@@ -43,6 +43,7 @@ const SnkGuidesViewer = class {
|
|
43
43
|
this.resourceID = undefined;
|
44
44
|
this.detailTaskbarCustomContainerId = undefined;
|
45
45
|
this.formLegacyConfigName = undefined;
|
46
|
+
this.getCustomTitle = undefined;
|
46
47
|
this._hasToCreateFieldSearch = true;
|
47
48
|
this._breadcrumbItems = [];
|
48
49
|
this._guides = undefined;
|
@@ -129,7 +130,7 @@ const SnkGuidesViewer = class {
|
|
129
130
|
}
|
130
131
|
onContentCardChanged(evt) {
|
131
132
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
132
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
133
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
133
134
|
}
|
134
135
|
/**
|
135
136
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -480,6 +481,10 @@ const SnkGuidesViewer = class {
|
|
480
481
|
}
|
481
482
|
return "";
|
482
483
|
}
|
484
|
+
getTitle() {
|
485
|
+
var _a, _b;
|
486
|
+
return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
|
487
|
+
}
|
483
488
|
componentDidLoad() {
|
484
489
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
485
490
|
}
|
@@ -493,7 +498,7 @@ const SnkGuidesViewer = class {
|
|
493
498
|
}
|
494
499
|
this.loadTaskbarProcessor();
|
495
500
|
const showGuides = this._guides && (this._guides.length > 1);
|
496
|
-
return (index.h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, index.h("div", { class: "ez-row snk-guides-viewer__header" }, index.h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, index.h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), index.h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.
|
501
|
+
return (index.h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, index.h("div", { class: "ez-row snk-guides-viewer__header" }, index.h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, index.h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), index.h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
497
502
|
index.h("div", { class: "ez-margin-top--extra-small" }, index.h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != index$1.PresentationMode.SECONDARY && this.buildTaskBar()), index.h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
498
503
|
index.h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
499
504
|
:
|
@@ -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-9c682034.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');
|
@@ -21,7 +21,7 @@ require('./constants-35ddd366.js');
|
|
21
21
|
require('./pesquisa-fetcher-680e198f.js');
|
22
22
|
require('./ISave-e91b70a7.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
24
|
-
require('./dataunit-fetcher-
|
24
|
+
require('./dataunit-fetcher-688d3f05.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,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');
|
@@ -9,17 +9,17 @@ const constants = require('./constants-35ddd366.js');
|
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
10
10
|
require('./DataFetcher-313debd8.js');
|
11
11
|
require('./pesquisa-fetcher-680e198f.js');
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
12
|
+
const IExporterProvider = require('./IExporterProvider-597949f9.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-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');
|
@@ -137,6 +137,7 @@ const SnkSimpleCrud = class {
|
|
137
137
|
this.formLegacyConfigName = undefined;
|
138
138
|
this.ignoreReadOnlyFormFields = false;
|
139
139
|
this.autoFocus = true;
|
140
|
+
this.domainMessagesBuilder = undefined;
|
140
141
|
this.autoLoad = undefined;
|
141
142
|
}
|
142
143
|
/**
|
@@ -752,8 +753,8 @@ const SnkSimpleCrud = class {
|
|
752
753
|
return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
753
754
|
}
|
754
755
|
getFormConfig() {
|
755
|
-
var _a
|
756
|
-
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);
|
757
758
|
if (!this.configName && !configFromManager) {
|
758
759
|
return this.formConfig;
|
759
760
|
}
|
@@ -773,7 +774,7 @@ const SnkSimpleCrud = class {
|
|
773
774
|
if (this.dataUnit == undefined) {
|
774
775
|
return;
|
775
776
|
}
|
776
|
-
return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this) }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
777
|
+
return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
777
778
|
? undefined
|
778
779
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.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.resolveResourceID() }))));
|
779
780
|
}
|
@@ -39,6 +39,8 @@ export class SnkCrud {
|
|
39
39
|
this.disablePersonalizedFilter = undefined;
|
40
40
|
this.autoLoad = undefined;
|
41
41
|
this.autoFocus = true;
|
42
|
+
this.domainMessagesBuilder = undefined;
|
43
|
+
this.setCustomFormTitle = undefined;
|
42
44
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
43
45
|
}
|
44
46
|
/**
|
@@ -147,6 +149,7 @@ export class SnkCrud {
|
|
147
149
|
else if (viewMode === VIEW_MODE.FORM) {
|
148
150
|
this._guidesViewer.setFocus();
|
149
151
|
}
|
152
|
+
this.viewModeChanged.emit(viewMode);
|
150
153
|
}
|
151
154
|
openConfig(viewMode) {
|
152
155
|
this._snkConfigurator.close();
|
@@ -210,6 +213,7 @@ export class SnkCrud {
|
|
210
213
|
this._snkDataUnit = parent;
|
211
214
|
this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
|
212
215
|
this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
|
216
|
+
this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
|
213
217
|
this._dataUnit = this._snkDataUnit.dataUnit;
|
214
218
|
this._dataState = this._snkDataUnit.dataState;
|
215
219
|
if (!this._dataUnit) {
|
@@ -376,7 +380,7 @@ export class SnkCrud {
|
|
376
380
|
return;
|
377
381
|
}
|
378
382
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
379
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
383
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, getCustomTitle: this.setCustomFormTitle }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
380
384
|
}
|
381
385
|
static get is() { return "snk-crud"; }
|
382
386
|
static get encapsulation() { return "scoped"; }
|
@@ -732,6 +736,38 @@ export class SnkCrud {
|
|
732
736
|
"attribute": "auto-focus",
|
733
737
|
"reflect": false,
|
734
738
|
"defaultValue": "true"
|
739
|
+
},
|
740
|
+
"domainMessagesBuilder": {
|
741
|
+
"type": "string",
|
742
|
+
"mutable": false,
|
743
|
+
"complexType": {
|
744
|
+
"original": "string",
|
745
|
+
"resolved": "string",
|
746
|
+
"references": {}
|
747
|
+
},
|
748
|
+
"required": false,
|
749
|
+
"optional": false,
|
750
|
+
"docs": {
|
751
|
+
"tags": [],
|
752
|
+
"text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
|
753
|
+
},
|
754
|
+
"attribute": "domain-messages-builder",
|
755
|
+
"reflect": false
|
756
|
+
},
|
757
|
+
"setCustomFormTitle": {
|
758
|
+
"type": "unknown",
|
759
|
+
"mutable": false,
|
760
|
+
"complexType": {
|
761
|
+
"original": "() => string",
|
762
|
+
"resolved": "() => string",
|
763
|
+
"references": {}
|
764
|
+
},
|
765
|
+
"required": false,
|
766
|
+
"optional": false,
|
767
|
+
"docs": {
|
768
|
+
"tags": [],
|
769
|
+
"text": "Define uma fun\u00E7\u00E3o para configurar um t\u00EDtulo cusotmizado no modo formul\u00E1rio."
|
770
|
+
}
|
735
771
|
}
|
736
772
|
};
|
737
773
|
}
|
@@ -814,6 +850,26 @@ export class SnkCrud {
|
|
814
850
|
}
|
815
851
|
}
|
816
852
|
}
|
853
|
+
}, {
|
854
|
+
"method": "viewModeChanged",
|
855
|
+
"name": "viewModeChanged",
|
856
|
+
"bubbles": true,
|
857
|
+
"cancelable": true,
|
858
|
+
"composed": true,
|
859
|
+
"docs": {
|
860
|
+
"tags": [],
|
861
|
+
"text": ""
|
862
|
+
},
|
863
|
+
"complexType": {
|
864
|
+
"original": "VIEW_MODE",
|
865
|
+
"resolved": "VIEW_MODE.ATTACHMENT | VIEW_MODE.FORM | VIEW_MODE.GRID",
|
866
|
+
"references": {
|
867
|
+
"VIEW_MODE": {
|
868
|
+
"location": "import",
|
869
|
+
"path": "../../lib/utils/constants"
|
870
|
+
}
|
871
|
+
}
|
872
|
+
}
|
817
873
|
}];
|
818
874
|
}
|
819
875
|
static get methods() {
|
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
|
}
|
@@ -27,6 +27,7 @@ export class SnkGuidesViewer {
|
|
27
27
|
this.resourceID = undefined;
|
28
28
|
this.detailTaskbarCustomContainerId = undefined;
|
29
29
|
this.formLegacyConfigName = undefined;
|
30
|
+
this.getCustomTitle = undefined;
|
30
31
|
this._hasToCreateFieldSearch = true;
|
31
32
|
this._breadcrumbItems = [];
|
32
33
|
this._guides = undefined;
|
@@ -113,7 +114,7 @@ export class SnkGuidesViewer {
|
|
113
114
|
}
|
114
115
|
onContentCardChanged(evt) {
|
115
116
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
116
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
117
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
117
118
|
}
|
118
119
|
/**
|
119
120
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -464,6 +465,10 @@ export class SnkGuidesViewer {
|
|
464
465
|
}
|
465
466
|
return "";
|
466
467
|
}
|
468
|
+
getTitle() {
|
469
|
+
var _a, _b;
|
470
|
+
return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
|
471
|
+
}
|
467
472
|
componentDidLoad() {
|
468
473
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
469
474
|
}
|
@@ -477,7 +482,7 @@ export class SnkGuidesViewer {
|
|
477
482
|
}
|
478
483
|
this.loadTaskbarProcessor();
|
479
484
|
const showGuides = this._guides && (this._guides.length > 1);
|
480
|
-
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.
|
485
|
+
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
481
486
|
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
482
487
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
483
488
|
:
|
@@ -794,6 +799,21 @@ export class SnkGuidesViewer {
|
|
794
799
|
},
|
795
800
|
"attribute": "form-legacy-config-name",
|
796
801
|
"reflect": false
|
802
|
+
},
|
803
|
+
"getCustomTitle": {
|
804
|
+
"type": "unknown",
|
805
|
+
"mutable": false,
|
806
|
+
"complexType": {
|
807
|
+
"original": "() => string",
|
808
|
+
"resolved": "() => string",
|
809
|
+
"references": {}
|
810
|
+
},
|
811
|
+
"required": false,
|
812
|
+
"optional": false,
|
813
|
+
"docs": {
|
814
|
+
"tags": [],
|
815
|
+
"text": "Fornece uma fun\u00E7\u00E3o para obter um t\u00EDtulo customizado do formul\u00E1rio."
|
816
|
+
}
|
797
817
|
}
|
798
818
|
};
|
799
819
|
}
|
@@ -54,6 +54,7 @@ export class SnkDataUnit {
|
|
54
54
|
this.ignoreSaveMessage = undefined;
|
55
55
|
this.configName = undefined;
|
56
56
|
this.resourceID = undefined;
|
57
|
+
this.domainMessagesBuilder = undefined;
|
57
58
|
}
|
58
59
|
observePageSize() {
|
59
60
|
if (this.dataUnit) {
|
@@ -470,7 +471,8 @@ export class SnkDataUnit {
|
|
470
471
|
if (this.ignoreSaveMessage) {
|
471
472
|
return;
|
472
473
|
}
|
473
|
-
const
|
474
|
+
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
475
|
+
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
474
476
|
if (msg != undefined) {
|
475
477
|
this.showSuccessMessage(msg);
|
476
478
|
}
|
@@ -501,10 +503,13 @@ export class SnkDataUnit {
|
|
501
503
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
502
504
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
503
505
|
*/
|
504
|
-
getMessage(key, params = undefined) {
|
506
|
+
getMessage(key, params = undefined, customOperation) {
|
505
507
|
if (!params) {
|
506
508
|
params = this.getMessageParams();
|
507
509
|
}
|
510
|
+
if (customOperation) {
|
511
|
+
this.messagesBuilder.currentOperation = customOperation;
|
512
|
+
}
|
508
513
|
return this.messagesBuilder.getMessage(key, params);
|
509
514
|
}
|
510
515
|
getMessageParams() {
|
@@ -611,6 +616,13 @@ export class SnkDataUnit {
|
|
611
616
|
parent = parent.parentElement;
|
612
617
|
}
|
613
618
|
}
|
619
|
+
instanceMessagesBuilder() {
|
620
|
+
var _a;
|
621
|
+
if (this.messagesBuilder) {
|
622
|
+
return;
|
623
|
+
}
|
624
|
+
this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
|
625
|
+
}
|
614
626
|
//---------------------------------------------
|
615
627
|
// Lifecycle web component
|
616
628
|
//---------------------------------------------
|
@@ -618,9 +630,7 @@ export class SnkDataUnit {
|
|
618
630
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
619
631
|
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
620
632
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
621
|
-
|
622
|
-
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
623
|
-
}
|
633
|
+
this.instanceMessagesBuilder();
|
624
634
|
}
|
625
635
|
disconnectedCallback() {
|
626
636
|
if (this.dataUnit) {
|
@@ -860,6 +870,23 @@ export class SnkDataUnit {
|
|
860
870
|
},
|
861
871
|
"attribute": "resource-i-d",
|
862
872
|
"reflect": false
|
873
|
+
},
|
874
|
+
"domainMessagesBuilder": {
|
875
|
+
"type": "string",
|
876
|
+
"mutable": false,
|
877
|
+
"complexType": {
|
878
|
+
"original": "string",
|
879
|
+
"resolved": "string",
|
880
|
+
"references": {}
|
881
|
+
},
|
882
|
+
"required": false,
|
883
|
+
"optional": false,
|
884
|
+
"docs": {
|
885
|
+
"tags": [],
|
886
|
+
"text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
|
887
|
+
},
|
888
|
+
"attribute": "domain-messages-builder",
|
889
|
+
"reflect": false
|
863
890
|
}
|
864
891
|
};
|
865
892
|
}
|
@@ -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
|
}
|