@sankhyalabs/sankhyablocks 8.0.2 → 8.1.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/README.md +1 -1
- package/dist/cjs/{ConfigStorage-e044fff2.js → ConfigStorage-e32e1391.js} +4 -4
- package/dist/cjs/{DataFetcher-62b9b2c8.js → DataFetcher-d2c6ae38.js} +42 -0
- package/dist/cjs/{SnkFormConfigManager-5d4b4765.js → SnkFormConfigManager-5e61b0a9.js} +2 -2
- package/dist/cjs/auth-fetcher-da975ac5.js +34 -0
- package/dist/cjs/{dataunit-fetcher-2a3c86b1.js → dataunit-fetcher-58ad78a7.js} +1 -1
- package/dist/cjs/{filter-bar-config-fetcher-71119171.js → filter-bar-config-fetcher-80b033ce.js} +1 -1
- package/dist/cjs/{form-config-fetcher-2b32c782.js → form-config-fetcher-761994b9.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-ee74ae40.js → pesquisa-fetcher-bb0bb679.js} +1 -1
- package/dist/cjs/{resource-fetcher-18c2d5ad.js → resource-fetcher-95d24dff.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +3 -2
- package/dist/cjs/snk-application.cjs.entry.js +21 -38
- package/dist/cjs/snk-attach.cjs.entry.js +3 -3
- package/dist/cjs/snk-crud.cjs.entry.js +12 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
- package/dist/cjs/{snk-data-unit-807a8684.js → snk-data-unit-e89e07bd.js} +4 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +15 -10
- package/dist/cjs/snk-filter-bar.cjs.entry.js +7 -6
- package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +4 -3
- package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
- package/dist/cjs/snk-form.cjs.entry.js +8 -6
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
- package/dist/cjs/snk-grid.cjs.entry.js +13 -9
- package/dist/cjs/{snk-guides-viewer-263de371.js → snk-guides-viewer-eb0a79a4.js} +6 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +6 -5
- package/dist/cjs/snk-print-selector.cjs.entry.js +2 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +18 -72
- package/dist/collection/components/snk-application/snk-application.js +60 -0
- package/dist/collection/components/snk-crud/snk-crud.js +49 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +46 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +42 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
- package/dist/collection/components/snk-form/snk-form.js +22 -0
- package/dist/collection/components/snk-grid/snk-grid.js +84 -4
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +43 -2
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.css +1 -1
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -59
- package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js +14 -0
- package/dist/collection/lib/utils/urlutils.js +29 -0
- package/dist/components/DataFetcher.js +43 -1
- package/dist/components/auth-fetcher.js +32 -0
- package/dist/components/snk-application2.js +12 -29
- package/dist/components/snk-crud.js +10 -2
- package/dist/components/snk-data-unit2.js +5 -0
- package/dist/components/snk-detail-view2.js +12 -3
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/snk-form-view2.js +6 -1
- package/dist/components/snk-form.js +1 -0
- package/dist/components/snk-grid2.js +13 -5
- package/dist/components/snk-simple-crud2.js +7 -61
- package/dist/esm/{ConfigStorage-6ec80135.js → ConfigStorage-b6aefe42.js} +4 -4
- package/dist/esm/{DataFetcher-f7cf7302.js → DataFetcher-aaaff866.js} +43 -1
- package/dist/esm/{SnkFormConfigManager-b8091dec.js → SnkFormConfigManager-80901f2d.js} +2 -2
- package/dist/esm/auth-fetcher-7860d777.js +32 -0
- package/dist/esm/{dataunit-fetcher-06e70d4c.js → dataunit-fetcher-9dfcdb1d.js} +1 -1
- package/dist/esm/{filter-bar-config-fetcher-efd7ab4e.js → filter-bar-config-fetcher-317cb6bf.js} +1 -1
- package/dist/esm/{form-config-fetcher-a5b23cd9.js → form-config-fetcher-4a34b86a.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-f06f4883.js → pesquisa-fetcher-01d058e6.js} +1 -1
- package/dist/esm/{resource-fetcher-92640c2f.js → resource-fetcher-b36ac145.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +3 -2
- package/dist/esm/snk-application.entry.js +19 -36
- package/dist/esm/snk-attach.entry.js +3 -3
- package/dist/esm/snk-crud.entry.js +12 -4
- package/dist/esm/snk-data-exporter.entry.js +3 -2
- package/dist/esm/{snk-data-unit-351ef08f.js → snk-data-unit-8c4d944d.js} +4 -0
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +15 -10
- package/dist/esm/snk-filter-bar.entry.js +7 -6
- package/dist/esm/snk-filter-detail.entry.js +4 -3
- package/dist/esm/snk-filter-modal-item.entry.js +6 -5
- package/dist/esm/snk-form-config.entry.js +4 -3
- package/dist/esm/snk-form-view.entry.js +6 -1
- package/dist/esm/snk-form.entry.js +8 -6
- package/dist/esm/snk-grid-config.entry.js +6 -5
- package/dist/esm/snk-grid.entry.js +13 -9
- package/dist/esm/{snk-guides-viewer-a6743bd9.js → snk-guides-viewer-ee42eb53.js} +6 -4
- package/dist/esm/snk-guides-viewer.entry.js +9 -8
- package/dist/esm/snk-personalized-filter.entry.js +6 -5
- package/dist/esm/snk-print-selector.entry.js +2 -1
- package/dist/esm/snk-simple-crud.entry.js +9 -63
- package/dist/sankhyablocks/p-05bcad8a.entry.js +1 -0
- package/dist/sankhyablocks/p-0b64f036.entry.js +1 -0
- package/dist/sankhyablocks/p-0e97ec46.entry.js +1 -0
- package/dist/sankhyablocks/{p-6785e5c9.entry.js → p-1b81c379.entry.js} +1 -1
- package/dist/sankhyablocks/{p-10a1b3a6.js → p-2dd0f891.js} +2 -2
- package/dist/sankhyablocks/p-330f584a.entry.js +1 -0
- package/dist/sankhyablocks/p-35ecafcb.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d8f5882.js → p-42843f0e.js} +1 -1
- package/dist/sankhyablocks/p-459d4267.entry.js +1 -0
- package/dist/sankhyablocks/p-557affc8.entry.js +1 -0
- package/dist/sankhyablocks/p-564efc43.js +1 -0
- package/dist/sankhyablocks/p-60791bb6.js +1 -0
- package/dist/sankhyablocks/p-6295424d.entry.js +1 -0
- package/dist/sankhyablocks/p-64c2cec3.js +1 -0
- package/dist/sankhyablocks/p-77ecc583.entry.js +1 -0
- package/dist/sankhyablocks/p-803b79d6.js +1 -0
- package/dist/sankhyablocks/p-80729c9b.entry.js +11 -0
- package/dist/sankhyablocks/{p-a54bdcc8.js → p-85affa29.js} +2 -2
- package/dist/sankhyablocks/p-95fa8af6.entry.js +1 -0
- package/dist/sankhyablocks/p-96c1ae78.entry.js +1 -0
- package/dist/sankhyablocks/p-b556fadc.entry.js +1 -0
- package/dist/sankhyablocks/{p-70b8e4a4.js → p-bee6b5d7.js} +1 -1
- package/dist/sankhyablocks/p-bf3bd954.entry.js +1 -0
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +1 -0
- package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
- package/dist/sankhyablocks/{p-bdcfbe10.js → p-dd1fa35d.js} +1 -1
- package/dist/sankhyablocks/{p-e7aefd06.js → p-e42f1f2a.js} +1 -1
- package/dist/sankhyablocks/p-f24c4bc7.entry.js +1 -0
- package/dist/sankhyablocks/{p-49b24449.js → p-f737f7e1.js} +1 -1
- package/dist/sankhyablocks/p-fd69eab9.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +9 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +8 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
- package/dist/types/components/snk-form/snk-form.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +14 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +8 -0
- package/dist/types/components.d.ts +98 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/recaller/GraphQLRecaller.d.ts +1 -0
- package/dist/types/lib/utils/urlutils.d.ts +14 -0
- package/package.json +3 -3
- package/dist/sankhyablocks/p-0e8136f6.entry.js +0 -1
- package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
- package/dist/sankhyablocks/p-29683966.entry.js +0 -1
- package/dist/sankhyablocks/p-2a57f7e1.entry.js +0 -1
- package/dist/sankhyablocks/p-3940f1e9.entry.js +0 -1
- package/dist/sankhyablocks/p-3e8e3025.entry.js +0 -1
- package/dist/sankhyablocks/p-3ef191cf.entry.js +0 -1
- package/dist/sankhyablocks/p-424a673f.entry.js +0 -1
- package/dist/sankhyablocks/p-5438f093.entry.js +0 -1
- package/dist/sankhyablocks/p-5807b3aa.entry.js +0 -1
- package/dist/sankhyablocks/p-5932777e.entry.js +0 -1
- package/dist/sankhyablocks/p-610e2459.js +0 -1
- package/dist/sankhyablocks/p-75cfc68e.entry.js +0 -1
- package/dist/sankhyablocks/p-7a43351d.entry.js +0 -11
- package/dist/sankhyablocks/p-829ebd26.entry.js +0 -1
- package/dist/sankhyablocks/p-8cf9c9ce.entry.js +0 -1
- package/dist/sankhyablocks/p-a304b0f3.entry.js +0 -1
- package/dist/sankhyablocks/p-a63aedf3.entry.js +0 -1
- package/dist/sankhyablocks/p-b8350ecf.entry.js +0 -1
- package/dist/sankhyablocks/p-cbc28ca6.js +0 -1
- package/dist/sankhyablocks/p-d23356a6.js +0 -1
@@ -4,16 +4,16 @@ 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 constants
|
7
|
+
const constants = require('./constants-d187e03e.js');
|
8
8
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
|
-
require('./DataFetcher-
|
10
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./DataFetcher-d2c6ae38.js');
|
10
|
+
require('./pesquisa-fetcher-bb0bb679.js');
|
11
11
|
const index$1 = require('./index-0e663819.js');
|
12
12
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
13
|
-
const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
13
|
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
|
15
14
|
require('./index-102ba62d.js');
|
16
15
|
require('./_commonjsHelpers-537d719a.js');
|
16
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
17
|
|
18
18
|
class InMemoryLoader {
|
19
19
|
constructor(metadata, records) {
|
@@ -21,7 +21,7 @@ class InMemoryLoader {
|
|
21
21
|
this.metadata = metadata;
|
22
22
|
this._dataUnit = new core.DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
23
23
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
24
|
-
this._dataUnit.dataLoader = (dataUnit, request) =>
|
24
|
+
this._dataUnit.dataLoader = (dataUnit, request) => core.defaultDataLoader(dataUnit, request, this._records);
|
25
25
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
26
26
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
27
27
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
@@ -58,62 +58,6 @@ class InMemoryLoader {
|
|
58
58
|
metadaLoader() {
|
59
59
|
return Promise.resolve(this._metadata);
|
60
60
|
}
|
61
|
-
dataLoader(dataUnit, request) {
|
62
|
-
const filters = this.getColumnFilters(dataUnit);
|
63
|
-
let records = this.applyFilters(filters);
|
64
|
-
if (request.sort) {
|
65
|
-
request.sort.forEach(sort => {
|
66
|
-
records = records.sort((recordA, recordB) => {
|
67
|
-
const fieldA = recordA[sort.field];
|
68
|
-
const fieldB = recordB[sort.field];
|
69
|
-
const sortFn = this.getSortFn(sort.dataType);
|
70
|
-
return sortFn(fieldA, fieldB) * (sort.mode == core.SortMode.ASC ? 1 : -1);
|
71
|
-
});
|
72
|
-
});
|
73
|
-
}
|
74
|
-
return Promise.resolve({ records: records });
|
75
|
-
}
|
76
|
-
applyFilters(filters) {
|
77
|
-
let records = [...this._records];
|
78
|
-
filters.forEach(filter => {
|
79
|
-
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
80
|
-
});
|
81
|
-
return records;
|
82
|
-
}
|
83
|
-
getColumnFilters(dataUnit) {
|
84
|
-
var _a, _b;
|
85
|
-
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
86
|
-
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(constants.DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
87
|
-
return columnFilters.map(filter => {
|
88
|
-
var _a, _b;
|
89
|
-
return {
|
90
|
-
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(constants.DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
91
|
-
values: filter.params.map(param => param.value),
|
92
|
-
};
|
93
|
-
});
|
94
|
-
}
|
95
|
-
getSortFn(type) {
|
96
|
-
switch (type) {
|
97
|
-
case core.DataType.NUMBER:
|
98
|
-
return this.sortNumber;
|
99
|
-
case core.DataType.DATE:
|
100
|
-
return this.sortDate;
|
101
|
-
case core.DataType.OBJECT:
|
102
|
-
return this.sortObject;
|
103
|
-
default:
|
104
|
-
return core.StringUtils.compare;
|
105
|
-
}
|
106
|
-
}
|
107
|
-
sortObject(a, b) {
|
108
|
-
return core.StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
|
109
|
-
}
|
110
|
-
sortNumber(a, b) {
|
111
|
-
return a - b;
|
112
|
-
}
|
113
|
-
sortDate(a, b) {
|
114
|
-
let timeA = a.getTime(), timeB = b.getTime();
|
115
|
-
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
116
|
-
}
|
117
61
|
saveLoader(_dataUnit, changes) {
|
118
62
|
return new Promise((resolve) => {
|
119
63
|
let dataUnitRecords = [];
|
@@ -156,6 +100,7 @@ const SnkSimpleCrud = class {
|
|
156
100
|
this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
|
157
101
|
this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
|
158
102
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
103
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
159
104
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
|
160
105
|
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
|
161
106
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
@@ -166,21 +111,22 @@ const SnkSimpleCrud = class {
|
|
166
111
|
"snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
|
167
112
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
168
113
|
});
|
169
|
-
this._currentViewMode = constants
|
114
|
+
this._currentViewMode = constants.VIEW_MODE.GRID;
|
170
115
|
this._config = undefined;
|
171
116
|
this.dataState = undefined;
|
172
117
|
this.dataUnit = undefined;
|
173
|
-
this.mode = constants
|
118
|
+
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
174
119
|
this.gridConfig = undefined;
|
175
120
|
this.formConfig = undefined;
|
176
121
|
this.multipleSelection = undefined;
|
177
122
|
this.useCancelConfirm = true;
|
178
123
|
this.taskbarManager = undefined;
|
179
124
|
this.messagesBuilder = undefined;
|
125
|
+
this.useEnterLikeTab = false;
|
180
126
|
}
|
181
127
|
resolveInMemoryBtns(taskbarButtons) {
|
182
128
|
const newTaskBarConfig = [...taskbarButtons];
|
183
|
-
if (this.mode === constants
|
129
|
+
if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
184
130
|
newTaskBarConfig.splice(1, 1);
|
185
131
|
}
|
186
132
|
return newTaskBarConfig;
|
@@ -197,15 +143,15 @@ const SnkSimpleCrud = class {
|
|
197
143
|
actionClickListener(evt) {
|
198
144
|
const act = evt.detail;
|
199
145
|
if (act === taskbarElements.TaskbarElement.GRID_MODE) {
|
200
|
-
this.goToView(constants
|
146
|
+
this.goToView(constants.VIEW_MODE.GRID);
|
201
147
|
}
|
202
148
|
else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
|
203
|
-
this.goToView(constants
|
149
|
+
this.goToView(constants.VIEW_MODE.FORM);
|
204
150
|
}
|
205
151
|
evt.stopPropagation();
|
206
152
|
}
|
207
153
|
onModeChange() {
|
208
|
-
if (this.mode == constants
|
154
|
+
if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
209
155
|
this.initInMemoryDataUnit();
|
210
156
|
}
|
211
157
|
}
|
@@ -235,9 +181,9 @@ const SnkSimpleCrud = class {
|
|
235
181
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
236
182
|
!this.dataState.selectionInfo.isAllRecords() &&
|
237
183
|
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
238
|
-
return this._currentViewMode === constants
|
184
|
+
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
239
185
|
}
|
240
|
-
return this._currentViewMode === constants
|
186
|
+
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
241
187
|
}
|
242
188
|
initInMemoryDataUnit() {
|
243
189
|
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
@@ -315,15 +261,15 @@ const SnkSimpleCrud = class {
|
|
315
261
|
handleCancelEdit() {
|
316
262
|
var _a;
|
317
263
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
318
|
-
this.goToView(constants
|
264
|
+
this.goToView(constants.VIEW_MODE.GRID);
|
319
265
|
this.dataUnit.clearSelection();
|
320
266
|
}
|
321
267
|
}
|
322
268
|
render() {
|
323
269
|
var _a;
|
324
|
-
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants
|
270
|
+
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), 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 }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
325
271
|
? undefined
|
326
|
-
: this._multiSelectionListDataSource }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
272
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
327
273
|
}
|
328
274
|
get _element() { return index.getElement(this); }
|
329
275
|
static get watchers() { return {
|
@@ -368,6 +368,16 @@ export class SnkApplication {
|
|
368
368
|
resolve(DataFetcher.hasClientEvent(eventID));
|
369
369
|
});
|
370
370
|
}
|
371
|
+
/**
|
372
|
+
* Realiza a chamada ao Service Broker conforme o nome do serviço.
|
373
|
+
*
|
374
|
+
* @param serviceName - Nome do serviço
|
375
|
+
* @param payload - Dados que serão processados na ação
|
376
|
+
* @param options - Parâmetros de URL
|
377
|
+
*/
|
378
|
+
async callServiceBroker(serviceName, payload, options) {
|
379
|
+
return DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
380
|
+
}
|
371
381
|
/**
|
372
382
|
* Obtém o resourceID da tela em questão.
|
373
383
|
*/
|
@@ -1355,6 +1365,56 @@ export class SnkApplication {
|
|
1355
1365
|
}]
|
1356
1366
|
}
|
1357
1367
|
},
|
1368
|
+
"callServiceBroker": {
|
1369
|
+
"complexType": {
|
1370
|
+
"signature": "(serviceName: string, payload: string | Object, options?: Options) => Promise<any>",
|
1371
|
+
"parameters": [{
|
1372
|
+
"tags": [{
|
1373
|
+
"name": "param",
|
1374
|
+
"text": "serviceName - Nome do servi\u00E7o"
|
1375
|
+
}],
|
1376
|
+
"text": "- Nome do servi\u00E7o"
|
1377
|
+
}, {
|
1378
|
+
"tags": [{
|
1379
|
+
"name": "param",
|
1380
|
+
"text": "payload - Dados que ser\u00E3o processados na a\u00E7\u00E3o"
|
1381
|
+
}],
|
1382
|
+
"text": "- Dados que ser\u00E3o processados na a\u00E7\u00E3o"
|
1383
|
+
}, {
|
1384
|
+
"tags": [{
|
1385
|
+
"name": "param",
|
1386
|
+
"text": "options - Par\u00E2metros de URL"
|
1387
|
+
}],
|
1388
|
+
"text": "- Par\u00E2metros de URL"
|
1389
|
+
}],
|
1390
|
+
"references": {
|
1391
|
+
"Promise": {
|
1392
|
+
"location": "global"
|
1393
|
+
},
|
1394
|
+
"Object": {
|
1395
|
+
"location": "global"
|
1396
|
+
},
|
1397
|
+
"Options": {
|
1398
|
+
"location": "import",
|
1399
|
+
"path": "../../lib/http/data-fetcher/DataFetcher"
|
1400
|
+
}
|
1401
|
+
},
|
1402
|
+
"return": "Promise<any>"
|
1403
|
+
},
|
1404
|
+
"docs": {
|
1405
|
+
"text": "Realiza a chamada ao Service Broker conforme o nome do servi\u00E7o.",
|
1406
|
+
"tags": [{
|
1407
|
+
"name": "param",
|
1408
|
+
"text": "serviceName - Nome do servi\u00E7o"
|
1409
|
+
}, {
|
1410
|
+
"name": "param",
|
1411
|
+
"text": "payload - Dados que ser\u00E3o processados na a\u00E7\u00E3o"
|
1412
|
+
}, {
|
1413
|
+
"name": "param",
|
1414
|
+
"text": "options - Par\u00E2metros de URL"
|
1415
|
+
}]
|
1416
|
+
}
|
1417
|
+
},
|
1358
1418
|
"getResourceID": {
|
1359
1419
|
"complexType": {
|
1360
1420
|
"signature": "() => Promise<string>",
|
@@ -3,6 +3,7 @@ import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
4
4
|
import { PresentationMode } from '../../lib';
|
5
5
|
import { VIEW_MODE } from '../../lib/utils/constants';
|
6
|
+
import { AutorizationType } from '../../lib/http/data-fetcher/fetchers/auth-fetcher';
|
6
7
|
/**
|
7
8
|
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
8
9
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
@@ -15,6 +16,7 @@ export class SnkCrud {
|
|
15
16
|
this._dataState = undefined;
|
16
17
|
this.attachmentRegisterKey = undefined;
|
17
18
|
this._currentViewMode = VIEW_MODE.GRID;
|
19
|
+
this._canEdit = undefined;
|
18
20
|
this.configName = undefined;
|
19
21
|
this.selectionToastConfig = undefined;
|
20
22
|
this.showActionButtons = false;
|
@@ -25,6 +27,7 @@ export class SnkCrud {
|
|
25
27
|
this.multipleSelection = true;
|
26
28
|
this.presentationMode = PresentationMode.PRIMARY;
|
27
29
|
this.messagesBuilder = undefined;
|
30
|
+
this.useEnterLikeTab = false;
|
28
31
|
}
|
29
32
|
/**
|
30
33
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
@@ -107,6 +110,8 @@ export class SnkCrud {
|
|
107
110
|
return joinedPrimaryKeys;
|
108
111
|
}
|
109
112
|
componentWillLoad() {
|
113
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
114
|
+
application.hasAccess(AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
|
110
115
|
let parent = this._element.parentElement;
|
111
116
|
while (parent) {
|
112
117
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -135,7 +140,6 @@ export class SnkCrud {
|
|
135
140
|
parent = parent.parentElement;
|
136
141
|
}
|
137
142
|
if (!this.configName) {
|
138
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
139
143
|
this.configName = application.configName;
|
140
144
|
}
|
141
145
|
}
|
@@ -154,7 +158,8 @@ export class SnkCrud {
|
|
154
158
|
this.configuratorCancel.emit();
|
155
159
|
}
|
156
160
|
render() {
|
157
|
-
|
161
|
+
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
162
|
+
return (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, "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, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit }, 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 }, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
158
163
|
}
|
159
164
|
static get is() { return "snk-crud"; }
|
160
165
|
static get encapsulation() { return "scoped"; }
|
@@ -372,6 +377,24 @@ export class SnkCrud {
|
|
372
377
|
"tags": [],
|
373
378
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
374
379
|
}
|
380
|
+
},
|
381
|
+
"useEnterLikeTab": {
|
382
|
+
"type": "boolean",
|
383
|
+
"mutable": false,
|
384
|
+
"complexType": {
|
385
|
+
"original": "boolean",
|
386
|
+
"resolved": "boolean",
|
387
|
+
"references": {}
|
388
|
+
},
|
389
|
+
"required": false,
|
390
|
+
"optional": false,
|
391
|
+
"docs": {
|
392
|
+
"tags": [],
|
393
|
+
"text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
|
394
|
+
},
|
395
|
+
"attribute": "use-enter-like-tab",
|
396
|
+
"reflect": false,
|
397
|
+
"defaultValue": "false"
|
375
398
|
}
|
376
399
|
};
|
377
400
|
}
|
@@ -380,7 +403,8 @@ export class SnkCrud {
|
|
380
403
|
"_dataUnit": {},
|
381
404
|
"_dataState": {},
|
382
405
|
"attachmentRegisterKey": {},
|
383
|
-
"_currentViewMode": {}
|
406
|
+
"_currentViewMode": {},
|
407
|
+
"_canEdit": {}
|
384
408
|
};
|
385
409
|
}
|
386
410
|
static get events() {
|
@@ -429,6 +453,28 @@ export class SnkCrud {
|
|
429
453
|
"resolved": "any",
|
430
454
|
"references": {}
|
431
455
|
}
|
456
|
+
}, {
|
457
|
+
"method": "formItemsReady",
|
458
|
+
"name": "formItemsReady",
|
459
|
+
"bubbles": true,
|
460
|
+
"cancelable": true,
|
461
|
+
"composed": true,
|
462
|
+
"docs": {
|
463
|
+
"tags": [],
|
464
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
465
|
+
},
|
466
|
+
"complexType": {
|
467
|
+
"original": "Array<HTMLElement>",
|
468
|
+
"resolved": "HTMLElement[]",
|
469
|
+
"references": {
|
470
|
+
"Array": {
|
471
|
+
"location": "global"
|
472
|
+
},
|
473
|
+
"HTMLElement": {
|
474
|
+
"location": "global"
|
475
|
+
}
|
476
|
+
}
|
477
|
+
}
|
432
478
|
}];
|
433
479
|
}
|
434
480
|
static get methods() {
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
@@ -10,6 +10,7 @@ import { GuideBuilder } from '../GuideBuilder';
|
|
10
10
|
export class SnkDetailView {
|
11
11
|
constructor() {
|
12
12
|
this._disabledButtons = undefined;
|
13
|
+
this._currentView = undefined;
|
13
14
|
this.attachmentRegisterKey = undefined;
|
14
15
|
this.formConfigManager = undefined;
|
15
16
|
this.dataUnitName = undefined;
|
@@ -21,6 +22,7 @@ export class SnkDetailView {
|
|
21
22
|
this.dataState = undefined;
|
22
23
|
this.messagesBuilder = undefined;
|
23
24
|
this.branchGuide = undefined;
|
25
|
+
this.canEdit = true;
|
24
26
|
}
|
25
27
|
observerDataState(newValue, oldValue) {
|
26
28
|
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
@@ -134,7 +136,8 @@ export class SnkDetailView {
|
|
134
136
|
updateViewStack(viewStack) {
|
135
137
|
var _a, _b;
|
136
138
|
this._viewStack = viewStack;
|
137
|
-
|
139
|
+
this._currentView = this.selectedForm ? 1 : 0;
|
140
|
+
(_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this._currentView);
|
138
141
|
}
|
139
142
|
getFormFields() {
|
140
143
|
if (this.selectedForm && this._formMetadata) {
|
@@ -189,7 +192,7 @@ export class SnkDetailView {
|
|
189
192
|
render() {
|
190
193
|
this.updateLabel();
|
191
194
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
192
|
-
return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
195
|
+
return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
193
196
|
}
|
194
197
|
static get is() { return "snk-detail-view"; }
|
195
198
|
static get encapsulation() { return "scoped"; }
|
@@ -395,12 +398,31 @@ export class SnkDetailView {
|
|
395
398
|
"tags": [],
|
396
399
|
"text": ""
|
397
400
|
}
|
401
|
+
},
|
402
|
+
"canEdit": {
|
403
|
+
"type": "boolean",
|
404
|
+
"mutable": false,
|
405
|
+
"complexType": {
|
406
|
+
"original": "boolean",
|
407
|
+
"resolved": "boolean",
|
408
|
+
"references": {}
|
409
|
+
},
|
410
|
+
"required": false,
|
411
|
+
"optional": false,
|
412
|
+
"docs": {
|
413
|
+
"tags": [],
|
414
|
+
"text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
|
415
|
+
},
|
416
|
+
"attribute": "can-edit",
|
417
|
+
"reflect": false,
|
418
|
+
"defaultValue": "true"
|
398
419
|
}
|
399
420
|
};
|
400
421
|
}
|
401
422
|
static get states() {
|
402
423
|
return {
|
403
424
|
"_disabledButtons": {},
|
425
|
+
"_currentView": {},
|
404
426
|
"attachmentRegisterKey": {}
|
405
427
|
};
|
406
428
|
}
|
@@ -440,6 +462,28 @@ export class SnkDetailView {
|
|
440
462
|
"resolved": "string",
|
441
463
|
"references": {}
|
442
464
|
}
|
465
|
+
}, {
|
466
|
+
"method": "formItemsReady",
|
467
|
+
"name": "formItemsReady",
|
468
|
+
"bubbles": true,
|
469
|
+
"cancelable": true,
|
470
|
+
"composed": true,
|
471
|
+
"docs": {
|
472
|
+
"tags": [],
|
473
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
474
|
+
},
|
475
|
+
"complexType": {
|
476
|
+
"original": "Array<HTMLElement>",
|
477
|
+
"resolved": "HTMLElement[]",
|
478
|
+
"references": {
|
479
|
+
"Array": {
|
480
|
+
"location": "global"
|
481
|
+
},
|
482
|
+
"HTMLElement": {
|
483
|
+
"location": "global"
|
484
|
+
}
|
485
|
+
}
|
486
|
+
}
|
443
487
|
}];
|
444
488
|
}
|
445
489
|
static get methods() {
|
@@ -70,6 +70,10 @@ export class SnkFormView {
|
|
70
70
|
this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
|
71
71
|
}
|
72
72
|
}
|
73
|
+
handleFormItemsReady(event) {
|
74
|
+
event.stopPropagation();
|
75
|
+
this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
|
76
|
+
}
|
73
77
|
disconnectedCallback() {
|
74
78
|
if (this._dataBinder != undefined) {
|
75
79
|
this._dataBinder.onDisconnectedCallback();
|
@@ -82,7 +86,7 @@ export class SnkFormView {
|
|
82
86
|
?
|
83
87
|
h("snk-form-summary", { summary: this.getCardSummary() })
|
84
88
|
:
|
85
|
-
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
|
89
|
+
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
|
86
90
|
}
|
87
91
|
static get is() { return "snk-form-view"; }
|
88
92
|
static get encapsulation() { return "scoped"; }
|
@@ -351,6 +355,28 @@ export class SnkFormView {
|
|
351
355
|
}
|
352
356
|
}
|
353
357
|
}
|
358
|
+
}, {
|
359
|
+
"method": "formItemsReady",
|
360
|
+
"name": "formItemsReady",
|
361
|
+
"bubbles": true,
|
362
|
+
"cancelable": true,
|
363
|
+
"composed": true,
|
364
|
+
"docs": {
|
365
|
+
"tags": [],
|
366
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
367
|
+
},
|
368
|
+
"complexType": {
|
369
|
+
"original": "Array<HTMLElement>",
|
370
|
+
"resolved": "HTMLElement[]",
|
371
|
+
"references": {
|
372
|
+
"Array": {
|
373
|
+
"location": "global"
|
374
|
+
},
|
375
|
+
"HTMLElement": {
|
376
|
+
"location": "global"
|
377
|
+
}
|
378
|
+
}
|
379
|
+
}
|
354
380
|
}];
|
355
381
|
}
|
356
382
|
static get methods() {
|
@@ -21,6 +21,7 @@ export class SnkGuidesViewer {
|
|
21
21
|
this.selectedGuide = undefined;
|
22
22
|
this.taskbarManager = undefined;
|
23
23
|
this.messagesBuilder = undefined;
|
24
|
+
this.canEdit = true;
|
24
25
|
this.presentationMode = undefined;
|
25
26
|
this._breadcrumbItems = [];
|
26
27
|
this._guides = undefined;
|
@@ -223,7 +224,7 @@ export class SnkGuidesViewer {
|
|
223
224
|
else {
|
224
225
|
detailBranch = this.selectedGuide;
|
225
226
|
}
|
226
|
-
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
|
227
|
+
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
|
227
228
|
}
|
228
229
|
else {
|
229
230
|
const cardId = this.selectedGuide.id;
|
@@ -547,6 +548,24 @@ export class SnkGuidesViewer {
|
|
547
548
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
548
549
|
}
|
549
550
|
},
|
551
|
+
"canEdit": {
|
552
|
+
"type": "boolean",
|
553
|
+
"mutable": false,
|
554
|
+
"complexType": {
|
555
|
+
"original": "boolean",
|
556
|
+
"resolved": "boolean",
|
557
|
+
"references": {}
|
558
|
+
},
|
559
|
+
"required": false,
|
560
|
+
"optional": false,
|
561
|
+
"docs": {
|
562
|
+
"tags": [],
|
563
|
+
"text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
|
564
|
+
},
|
565
|
+
"attribute": "can-edit",
|
566
|
+
"reflect": false,
|
567
|
+
"defaultValue": "true"
|
568
|
+
},
|
550
569
|
"presentationMode": {
|
551
570
|
"type": "string",
|
552
571
|
"mutable": false,
|
@@ -610,6 +629,28 @@ export class SnkGuidesViewer {
|
|
610
629
|
"resolved": "string",
|
611
630
|
"references": {}
|
612
631
|
}
|
632
|
+
}, {
|
633
|
+
"method": "formItemsReady",
|
634
|
+
"name": "formItemsReady",
|
635
|
+
"bubbles": true,
|
636
|
+
"cancelable": true,
|
637
|
+
"composed": true,
|
638
|
+
"docs": {
|
639
|
+
"tags": [],
|
640
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
641
|
+
},
|
642
|
+
"complexType": {
|
643
|
+
"original": "Array<HTMLElement>",
|
644
|
+
"resolved": "HTMLElement[]",
|
645
|
+
"references": {
|
646
|
+
"Array": {
|
647
|
+
"location": "global"
|
648
|
+
},
|
649
|
+
"HTMLElement": {
|
650
|
+
"location": "global"
|
651
|
+
}
|
652
|
+
}
|
653
|
+
}
|
613
654
|
}];
|
614
655
|
}
|
615
656
|
static get methods() {
|
@@ -11,6 +11,9 @@ export class SnkDataUnit {
|
|
11
11
|
const duState = this.buildDataState();
|
12
12
|
this.dataState = duState;
|
13
13
|
if (action.type === Action.DATA_SAVED) {
|
14
|
+
if (this.ignoreSaveMessage) {
|
15
|
+
return;
|
16
|
+
}
|
14
17
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
15
18
|
if (msg != undefined) {
|
16
19
|
this.showSuccessMessage(msg);
|
@@ -56,6 +59,7 @@ export class SnkDataUnit {
|
|
56
59
|
this.beforeSave = undefined;
|
57
60
|
this.afterSave = undefined;
|
58
61
|
this.useCancelConfirm = true;
|
62
|
+
this.ignoreSaveMessage = undefined;
|
59
63
|
this.configName = undefined;
|
60
64
|
}
|
61
65
|
observePageSize() {
|
@@ -587,6 +591,23 @@ export class SnkDataUnit {
|
|
587
591
|
"reflect": false,
|
588
592
|
"defaultValue": "true"
|
589
593
|
},
|
594
|
+
"ignoreSaveMessage": {
|
595
|
+
"type": "boolean",
|
596
|
+
"mutable": false,
|
597
|
+
"complexType": {
|
598
|
+
"original": "boolean",
|
599
|
+
"resolved": "boolean",
|
600
|
+
"references": {}
|
601
|
+
},
|
602
|
+
"required": false,
|
603
|
+
"optional": false,
|
604
|
+
"docs": {
|
605
|
+
"tags": [],
|
606
|
+
"text": "Respons\u00E1vel por evitar a mensagem de sucesso ao salvar."
|
607
|
+
},
|
608
|
+
"attribute": "ignore-save-message",
|
609
|
+
"reflect": false
|
610
|
+
},
|
590
611
|
"configName": {
|
591
612
|
"type": "string",
|
592
613
|
"mutable": false,
|