@sankhyalabs/sankhyablocks 8.16.0-rc.1 → 8.16.0-rc.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-ecc0ed20.js} +2 -2
- package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-807730a8.js} +39 -6
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
- package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
- package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-f1c92f79.js} +72 -16
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-f89461c1.js} +46 -18
- package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-ca89181c.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +37 -28
- package/dist/cjs/snk-crud.cjs.entry.js +12 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -9
- package/dist/cjs/{snk-data-unit-04df81bf.js → snk-data-unit-47202e42.js} +20 -11
- package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
- package/dist/cjs/snk-detail-view.cjs.entry.js +11 -11
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +37 -25
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +15 -4
- package/dist/cjs/snk-form.cjs.entry.js +7 -6
- package/dist/cjs/snk-grid.cjs.entry.js +61 -21
- package/dist/cjs/{snk-guides-viewer-bdc41281.js → snk-guides-viewer-68777d37.js} +23 -11
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +53 -21
- package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
- package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
- package/dist/collection/components/snk-attach/snk-attach.js +24 -15
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
- package/dist/collection/components/snk-crud/snk-crud.js +59 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +50 -5
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +18 -9
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
- package/dist/collection/components/snk-form/snk-form.js +2 -2
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +70 -14
- package/dist/collection/components/snk-form-config/snk-form-config.js +13 -2
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +68 -8
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +62 -29
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
- package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
- package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
- package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +40 -5
- package/dist/components/DataFetcher.js +22 -16
- package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
- package/dist/components/SnkFormConfigManager.js +70 -14
- package/dist/components/SnkMessageBuilder.js +7 -3
- package/dist/components/dataunit-fetcher.js +45 -15
- package/dist/components/form-config-fetcher.js +4 -1
- package/dist/components/snk-actions-button2.js +12 -9
- package/dist/components/snk-attach2.js +33 -24
- package/dist/components/snk-crud.js +9 -1
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-data-unit2.js +21 -49
- package/dist/components/snk-detail-view2.js +22 -8
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +35 -22
- package/dist/components/snk-filter-checkbox-list.js +1 -1
- package/dist/components/snk-form-config2.js +13 -2
- package/dist/components/snk-form.js +2 -2
- package/dist/components/snk-grid2.js +53 -11
- package/dist/components/snk-simple-bar2.js +1 -1
- package/dist/components/snk-simple-crud2.js +45 -10
- package/dist/components/snk-taskbar2.js +24 -2
- package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-7b36d041.js} +2 -2
- package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-1a82a768.js} +40 -8
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
- package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
- package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-139f09fa.js} +72 -16
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-c24c76c6.js} +46 -16
- package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +17 -14
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +37 -28
- package/dist/esm/snk-crud.entry.js +12 -6
- package/dist/esm/snk-data-exporter.entry.js +9 -9
- package/dist/esm/{snk-data-unit-8eec78bd.js → snk-data-unit-de45e0e1.js} +20 -11
- package/dist/esm/snk-data-unit.entry.js +5 -5
- package/dist/esm/snk-detail-view.entry.js +11 -11
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +37 -25
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +15 -4
- package/dist/esm/snk-form.entry.js +7 -6
- package/dist/esm/snk-grid.entry.js +56 -16
- package/dist/esm/{snk-guides-viewer-dda0fede.js → snk-guides-viewer-b5dd30e6.js} +23 -11
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-bar.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +49 -17
- package/dist/esm/snk-taskbar.entry.js +23 -1
- package/dist/sankhyablocks/p-0035ad6e.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
- package/dist/sankhyablocks/p-0911e61a.entry.js +1 -0
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/p-17425c72.js +1 -0
- package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
- package/dist/sankhyablocks/{p-af8efd95.js → p-1bf06cd3.js} +2 -2
- package/dist/sankhyablocks/{p-47db7e88.entry.js → p-212213d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-23736d75.js +1 -0
- package/dist/sankhyablocks/p-3ae9d08a.js +1 -0
- package/dist/sankhyablocks/p-3e3cc017.js +1 -0
- package/dist/sankhyablocks/{p-52920496.js → p-4d9549cf.js} +1 -1
- package/dist/sankhyablocks/p-50779ad3.entry.js +1 -0
- package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
- package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
- package/dist/sankhyablocks/p-62e048c6.entry.js +1 -0
- package/dist/sankhyablocks/{p-c1d57831.entry.js → p-694e1c4a.entry.js} +1 -1
- package/dist/sankhyablocks/p-73185e58.entry.js +1 -0
- package/dist/sankhyablocks/p-7ac7932c.js +60 -0
- package/dist/sankhyablocks/p-7dd49d15.js +1 -0
- package/dist/sankhyablocks/p-7eef0898.entry.js +1 -0
- package/dist/sankhyablocks/{p-045eae4d.entry.js → p-a42e7a1e.entry.js} +2 -2
- package/dist/sankhyablocks/p-afbb070d.js +1 -0
- package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
- package/dist/sankhyablocks/p-bccfc262.js +1 -0
- package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
- package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
- package/dist/sankhyablocks/p-da34270e.entry.js +1 -0
- package/dist/sankhyablocks/p-e16e87fc.entry.js +1 -0
- package/dist/sankhyablocks/p-eb9f0407.entry.js +1 -0
- package/dist/sankhyablocks/p-f3434fc4.js +1 -0
- package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-fb34e0cf.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +7 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +12 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -4
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +67 -2
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
- package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
- package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
- package/package.json +2 -2
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-2a408684.js +0 -1
- package/dist/sankhyablocks/p-3a212712.js +0 -1
- package/dist/sankhyablocks/p-450c60e4.entry.js +0 -1
- package/dist/sankhyablocks/p-46d38387.entry.js +0 -1
- package/dist/sankhyablocks/p-4e5e1313.entry.js +0 -1
- package/dist/sankhyablocks/p-547eeac8.entry.js +0 -1
- package/dist/sankhyablocks/p-62ba211a.entry.js +0 -1
- package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
- package/dist/sankhyablocks/p-75e674ed.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-7a85fd49.entry.js +0 -1
- package/dist/sankhyablocks/p-7b08d0f8.entry.js +0 -1
- package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-b05d8893.entry.js +0 -1
- package/dist/sankhyablocks/p-c2495304.js +0 -1
- package/dist/sankhyablocks/p-d6e26ea8.entry.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-e549f7d1.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/sankhyablocks/p-fa4d8cb4.js +0 -1
- package/dist/sankhyablocks/p-fe79f83a.js +0 -60
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -15,6 +15,8 @@ const SnkTaskbar = class {
|
|
15
15
|
constructor(hostRef) {
|
16
16
|
index.registerInstance(this, hostRef);
|
17
17
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
18
|
+
this.taskbarSaveLocker = index.createEvent(this, "taskbarSaveLocker", 7);
|
19
|
+
this.taskbarSaveUnlocker = index.createEvent(this, "taskbarSaveUnlocker", 7);
|
18
20
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
19
21
|
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
20
22
|
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
@@ -38,6 +40,7 @@ const SnkTaskbar = class {
|
|
38
40
|
this.onSaveEvent = (action) => {
|
39
41
|
switch (action.type) {
|
40
42
|
case core.Action.FIELD_INVALIDATED:
|
43
|
+
case core.Action.INVALIDATE_CLEAN:
|
41
44
|
case core.Action.DATA_SAVED:
|
42
45
|
case core.Action.SAVING_ERROR:
|
43
46
|
this._isWaitingForSave = false;
|
@@ -76,6 +79,16 @@ const SnkTaskbar = class {
|
|
76
79
|
this.getCustomElements(true);
|
77
80
|
}
|
78
81
|
}
|
82
|
+
handleTaskbarSaveLocker() {
|
83
|
+
if (this._isWaitingForSave !== true) {
|
84
|
+
this._isWaitingForSave = true;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
handleTaskbarSaveUnlocker() {
|
88
|
+
if (this._isWaitingForSave === true) {
|
89
|
+
this._isWaitingForSave = false;
|
90
|
+
}
|
91
|
+
}
|
79
92
|
hasToSearchCustomElements(event) {
|
80
93
|
return this.customSlotId === event.detail && !this._slotContainer;
|
81
94
|
}
|
@@ -94,6 +107,14 @@ const SnkTaskbar = class {
|
|
94
107
|
this._hasToUpdateOverFlow = true;
|
95
108
|
}
|
96
109
|
}
|
110
|
+
observeIsWaitingForSave(newValue, oldValue) {
|
111
|
+
if (newValue == true && oldValue == false) {
|
112
|
+
this.taskbarSaveLocker.emit();
|
113
|
+
}
|
114
|
+
if (newValue == false && oldValue == true) {
|
115
|
+
this.taskbarSaveUnlocker.emit();
|
116
|
+
}
|
117
|
+
}
|
97
118
|
// Internal methods
|
98
119
|
elementsFromString(strButtons) {
|
99
120
|
const elements = [];
|
@@ -422,7 +443,8 @@ const SnkTaskbar = class {
|
|
422
443
|
static get watchers() { return {
|
423
444
|
"buttons": ["observeButtons"],
|
424
445
|
"disabledButtons": ["observeDisabledButtons"],
|
425
|
-
"_lastWidth": ["observeLastWidth"]
|
446
|
+
"_lastWidth": ["observeLastWidth"],
|
447
|
+
"_isWaitingForSave": ["observeIsWaitingForSave"]
|
426
448
|
}; }
|
427
449
|
};
|
428
450
|
SnkTaskbar.style = snkTaskbarCss;
|
@@ -3,9 +3,9 @@ import { RefreshType } from "./enum/RefreshType";
|
|
3
3
|
import { ParamType } from "./enum/ParamType";
|
4
4
|
import { DataFetcher } from "../../../lib";
|
5
5
|
import { ActionsType } from "./enum/ActionsType";
|
6
|
+
import { getSelectedRecordsIDsInfo } from "../../../lib/utils/GetSelectedRecordsIDsInfo";
|
6
7
|
const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
|
7
8
|
const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
|
8
|
-
const NUFIN_COLUMN = 'NUFIN';
|
9
9
|
const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
|
10
10
|
export default class Actions {
|
11
11
|
constructor(actionsExecuteInterface, dataUnit, appResourceId) {
|
@@ -17,6 +17,10 @@ export default class Actions {
|
|
17
17
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
18
18
|
this._appResourceId = appResourceId;
|
19
19
|
}
|
20
|
+
getPrimaryKeys() {
|
21
|
+
const ids = getSelectedRecordsIDsInfo(this._dataUnit);
|
22
|
+
return ids.map(({ name }) => name);
|
23
|
+
}
|
20
24
|
apply(action, hasParamsToSave) {
|
21
25
|
this._application.closePopUp();
|
22
26
|
this._actionsExecuteInterface.execute(action, this._dataUnit)
|
@@ -285,6 +289,7 @@ export default class Actions {
|
|
285
289
|
executeAction(execSource);
|
286
290
|
}
|
287
291
|
addRows(execSource) {
|
292
|
+
const primaryKeys = this.getPrimaryKeys();
|
288
293
|
const rows = {
|
289
294
|
row: []
|
290
295
|
};
|
@@ -298,15 +303,13 @@ export default class Actions {
|
|
298
303
|
delete sourceRow[MASTER_ROW_PROPERTY];
|
299
304
|
delete sourceRow[ENTITY_NAME_PROPERTY];
|
300
305
|
}
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
row.field = [];
|
306
|
-
}
|
306
|
+
if (!row.field) {
|
307
|
+
row.field = [];
|
308
|
+
}
|
309
|
+
for (const primaryKey of primaryKeys) {
|
307
310
|
row.field.push({
|
308
|
-
fieldName:
|
309
|
-
$: sourceRow[
|
311
|
+
fieldName: primaryKey,
|
312
|
+
$: sourceRow[primaryKey]
|
310
313
|
});
|
311
314
|
}
|
312
315
|
rows.row.push(row);
|
@@ -46,11 +46,20 @@ export class SnkAttach {
|
|
46
46
|
this.loadAttachmentDataUnit();
|
47
47
|
}
|
48
48
|
if (oldRegisterKey !== newRegisterKey) {
|
49
|
+
if (this._currentFetcher instanceof AnexoSistemaFetcher) {
|
50
|
+
this._currentFetcher.registerKey = newRegisterKey;
|
51
|
+
}
|
49
52
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
|
50
53
|
}
|
51
54
|
}
|
55
|
+
getAnexoSistemaFetcherInstance() {
|
56
|
+
var _a;
|
57
|
+
const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
58
|
+
anexoSistemaFetcher.registerKey = this.registerKey;
|
59
|
+
return anexoSistemaFetcher;
|
60
|
+
}
|
52
61
|
async initAttach() {
|
53
|
-
var _a, _b, _c, _d, _e
|
62
|
+
var _a, _b, _c, _d, _e;
|
54
63
|
if (!this.fetcherType && !this.registerKey)
|
55
64
|
return;
|
56
65
|
if (!this.fetcherType) {
|
@@ -58,18 +67,18 @@ export class SnkAttach {
|
|
58
67
|
}
|
59
68
|
this.returnToGridMode();
|
60
69
|
if (this.fetcherType === "AnexoSistema") {
|
61
|
-
this._currentFetcher =
|
62
|
-
(
|
63
|
-
await ((
|
70
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
71
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
72
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
64
73
|
return;
|
65
74
|
}
|
66
75
|
if (this.fetcherType === "Attach") {
|
67
|
-
const hasMoreOneItem = ((
|
76
|
+
const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
|
68
77
|
if (hasMoreOneItem)
|
69
78
|
return;
|
70
79
|
}
|
71
|
-
await ((
|
72
|
-
await ((
|
80
|
+
await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
|
81
|
+
await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
|
73
82
|
}
|
74
83
|
/**
|
75
84
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -128,11 +137,11 @@ export class SnkAttach {
|
|
128
137
|
}
|
129
138
|
}
|
130
139
|
async loadAnexoSistema() {
|
131
|
-
var _a, _b
|
140
|
+
var _a, _b;
|
132
141
|
this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
133
|
-
this._currentFetcher =
|
142
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
134
143
|
if (!this._currentDataUnit.metadata) {
|
135
|
-
await ((
|
144
|
+
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
136
145
|
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
137
146
|
}
|
138
147
|
this.initDataUnitLoaders();
|
@@ -142,7 +151,7 @@ export class SnkAttach {
|
|
142
151
|
this._currentDataUnit.addInterceptor({
|
143
152
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
144
153
|
});
|
145
|
-
await ((
|
154
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
146
155
|
this.disableEditFieldsNotInForm();
|
147
156
|
}
|
148
157
|
async loadAttach() {
|
@@ -168,16 +177,16 @@ export class SnkAttach {
|
|
168
177
|
}
|
169
178
|
}
|
170
179
|
initDataUnitLoaders() {
|
171
|
-
var _a, _b
|
180
|
+
var _a, _b;
|
172
181
|
if (this.fetcherType === "AnexoSistema") {
|
173
|
-
this._currentFetcher =
|
182
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
174
183
|
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
175
|
-
(
|
184
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
176
185
|
}
|
177
186
|
if (this.fetcherType === "Attach") {
|
178
187
|
this._currentFetcher = new AttachFetcher();
|
179
188
|
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
180
|
-
(
|
189
|
+
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
181
190
|
this.returnToGridMode();
|
182
191
|
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
183
192
|
});
|
@@ -3,7 +3,7 @@ import { SaveErrorsEnum } from '../../../../../lib/http/data-fetcher/fetchers/At
|
|
3
3
|
import { AutorizationType } from '../../../../../lib/http/data-fetcher/fetchers/auth-fetcher';
|
4
4
|
import { attachFetcherMetadataBuilder } from '../../builder/attach-crud-config.builder';
|
5
5
|
import { VIEW_MODE } from '../../../../../lib/utils/constants';
|
6
|
-
import {
|
6
|
+
import { buildLoadDataResponse } from '../../../../../lib/dataUnit/dataUnitInMemoryUtils';
|
7
7
|
const SERVICE_LOAD = "Attach.load";
|
8
8
|
export class AttachFetcherDataUnitFactory {
|
9
9
|
constructor(getMessage) {
|
@@ -49,9 +49,7 @@ export class AttachFetcherDataUnitFactory {
|
|
49
49
|
});
|
50
50
|
this._records = records;
|
51
51
|
}
|
52
|
-
|
53
|
-
records = applySorting(records, dataUnit, request.sort);
|
54
|
-
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
52
|
+
return buildLoadDataResponse(this._records, dataUnit, request);
|
55
53
|
}
|
56
54
|
saveLoader(changes, fetcher) {
|
57
55
|
return new Promise((resolve) => {
|
@@ -39,7 +39,9 @@ export class SnkCrud {
|
|
39
39
|
this.disablePersonalizedFilter = undefined;
|
40
40
|
this.autoLoad = undefined;
|
41
41
|
this.autoFocus = true;
|
42
|
+
this.enableGridInsert = false;
|
42
43
|
this.domainMessagesBuilder = undefined;
|
44
|
+
this.setCustomFormTitle = undefined;
|
43
45
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
44
46
|
}
|
45
47
|
/**
|
@@ -148,6 +150,7 @@ export class SnkCrud {
|
|
148
150
|
else if (viewMode === VIEW_MODE.FORM) {
|
149
151
|
this._guidesViewer.setFocus();
|
150
152
|
}
|
153
|
+
this.viewModeChanged.emit(viewMode);
|
151
154
|
}
|
152
155
|
openConfig(viewMode) {
|
153
156
|
this._snkConfigurator.close();
|
@@ -163,6 +166,8 @@ export class SnkCrud {
|
|
163
166
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
164
167
|
}
|
165
168
|
insertionModeHandler() {
|
169
|
+
if (this.enableGridInsert)
|
170
|
+
return;
|
166
171
|
this.gridToForm();
|
167
172
|
}
|
168
173
|
cancelHandler() {
|
@@ -378,7 +383,7 @@ export class SnkCrud {
|
|
378
383
|
return;
|
379
384
|
}
|
380
385
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
381
|
-
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" }))));
|
386
|
+
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, enableGridInsert: this.enableGridInsert }, 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, enableGridInsert: this.enableGridInsert, 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" }))));
|
382
387
|
}
|
383
388
|
static get is() { return "snk-crud"; }
|
384
389
|
static get encapsulation() { return "scoped"; }
|
@@ -735,6 +740,24 @@ export class SnkCrud {
|
|
735
740
|
"reflect": false,
|
736
741
|
"defaultValue": "true"
|
737
742
|
},
|
743
|
+
"enableGridInsert": {
|
744
|
+
"type": "boolean",
|
745
|
+
"mutable": false,
|
746
|
+
"complexType": {
|
747
|
+
"original": "boolean",
|
748
|
+
"resolved": "boolean",
|
749
|
+
"references": {}
|
750
|
+
},
|
751
|
+
"required": false,
|
752
|
+
"optional": true,
|
753
|
+
"docs": {
|
754
|
+
"tags": [],
|
755
|
+
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
756
|
+
},
|
757
|
+
"attribute": "enable-grid-insert",
|
758
|
+
"reflect": false,
|
759
|
+
"defaultValue": "false"
|
760
|
+
},
|
738
761
|
"domainMessagesBuilder": {
|
739
762
|
"type": "string",
|
740
763
|
"mutable": false,
|
@@ -751,6 +774,21 @@ export class SnkCrud {
|
|
751
774
|
},
|
752
775
|
"attribute": "domain-messages-builder",
|
753
776
|
"reflect": false
|
777
|
+
},
|
778
|
+
"setCustomFormTitle": {
|
779
|
+
"type": "unknown",
|
780
|
+
"mutable": false,
|
781
|
+
"complexType": {
|
782
|
+
"original": "() => string",
|
783
|
+
"resolved": "() => string",
|
784
|
+
"references": {}
|
785
|
+
},
|
786
|
+
"required": false,
|
787
|
+
"optional": false,
|
788
|
+
"docs": {
|
789
|
+
"tags": [],
|
790
|
+
"text": "Define uma fun\u00E7\u00E3o para configurar um t\u00EDtulo cusotmizado no modo formul\u00E1rio."
|
791
|
+
}
|
754
792
|
}
|
755
793
|
};
|
756
794
|
}
|
@@ -833,6 +871,26 @@ export class SnkCrud {
|
|
833
871
|
}
|
834
872
|
}
|
835
873
|
}
|
874
|
+
}, {
|
875
|
+
"method": "viewModeChanged",
|
876
|
+
"name": "viewModeChanged",
|
877
|
+
"bubbles": true,
|
878
|
+
"cancelable": true,
|
879
|
+
"composed": true,
|
880
|
+
"docs": {
|
881
|
+
"tags": [],
|
882
|
+
"text": ""
|
883
|
+
},
|
884
|
+
"complexType": {
|
885
|
+
"original": "VIEW_MODE",
|
886
|
+
"resolved": "VIEW_MODE.ATTACHMENT | VIEW_MODE.FORM | VIEW_MODE.GRID",
|
887
|
+
"references": {
|
888
|
+
"VIEW_MODE": {
|
889
|
+
"location": "import",
|
890
|
+
"path": "../../lib/utils/constants"
|
891
|
+
}
|
892
|
+
}
|
893
|
+
}
|
836
894
|
}];
|
837
895
|
}
|
838
896
|
static get methods() {
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
@@ -198,7 +198,7 @@ export class SnkDetailView {
|
|
198
198
|
this.emitSwitchEvent(VIEW_MODE.GRID);
|
199
199
|
evt.stopPropagation();
|
200
200
|
}
|
201
|
-
if (evt.detail === TaskbarElement.FORM_MODE) {
|
201
|
+
if (evt.detail === TaskbarElement.FORM_MODE || evt.detail === TaskbarElement.UPDATE) {
|
202
202
|
this.emitSwitchEvent(VIEW_MODE.FORM);
|
203
203
|
evt.stopPropagation();
|
204
204
|
}
|
@@ -222,7 +222,7 @@ export class SnkDetailView {
|
|
222
222
|
}
|
223
223
|
componentWillLoad() {
|
224
224
|
this._configName = `dynaform.${this.entityName}`;
|
225
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
|
225
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata(), this.dataUnit);
|
226
226
|
this.formConfigManager.loadConfig();
|
227
227
|
if (this.messagesBuilder == undefined) {
|
228
228
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
@@ -27,6 +27,8 @@ export class SnkGuidesViewer {
|
|
27
27
|
this.resourceID = undefined;
|
28
28
|
this.detailTaskbarCustomContainerId = undefined;
|
29
29
|
this.formLegacyConfigName = undefined;
|
30
|
+
this.enableGridInsert = false;
|
31
|
+
this.getCustomTitle = undefined;
|
30
32
|
this._hasToCreateFieldSearch = true;
|
31
33
|
this._breadcrumbItems = [];
|
32
34
|
this._guides = undefined;
|
@@ -95,7 +97,7 @@ export class SnkGuidesViewer {
|
|
95
97
|
this._container.focus();
|
96
98
|
}
|
97
99
|
exitViewer() {
|
98
|
-
if (this.dataUnit.isDirty()) {
|
100
|
+
if (!this.enableGridInsert && this.dataUnit.isDirty()) {
|
99
101
|
this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
100
102
|
}
|
101
103
|
else {
|
@@ -204,10 +206,13 @@ export class SnkGuidesViewer {
|
|
204
206
|
const invisibleButtons = this.getInvisibleButtons();
|
205
207
|
this._taskbarProcessor = new TaskbarProcessor({
|
206
208
|
"snkGuideViewer.regular": btnsRegularMode,
|
207
|
-
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"],
|
209
|
+
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE", this.handleAddGridMode()],
|
208
210
|
});
|
209
211
|
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this.dataState, disabledButtons, invisibleButtons);
|
210
212
|
}
|
213
|
+
handleAddGridMode() {
|
214
|
+
return this.enableGridInsert ? TaskbarElement.GRID_MODE : "";
|
215
|
+
}
|
211
216
|
getInvisibleButtons() {
|
212
217
|
const invisibleButtons = [];
|
213
218
|
if (this.dataState && this.dataState.selectionInfo.mode === SelectionMode.ALL_RECORDS)
|
@@ -360,11 +365,14 @@ export class SnkGuidesViewer {
|
|
360
365
|
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
361
366
|
}
|
362
367
|
}
|
368
|
+
setMasterFormConfig(config) {
|
369
|
+
this.masterFormConfig = config;
|
370
|
+
}
|
363
371
|
componentWillLoad() {
|
364
372
|
if (this.resourceID == undefined) {
|
365
373
|
throw new Error("Erro interno: resourceID não informado");
|
366
374
|
}
|
367
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID,
|
375
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
|
368
376
|
this.addFormLegacyConfigName();
|
369
377
|
this._configManager.loadConfig();
|
370
378
|
}
|
@@ -392,7 +400,7 @@ export class SnkGuidesViewer {
|
|
392
400
|
return this._fieldSearch;
|
393
401
|
}
|
394
402
|
fieldsOptionLoader(argument) {
|
395
|
-
return Promise.resolve(this._configManager.getFieldsList(
|
403
|
+
return Promise.resolve(this._configManager.getFieldsList(argument)
|
396
404
|
.map(field => ({ value: field.name, label: field.label })));
|
397
405
|
}
|
398
406
|
onSelectField(option, actionButton) {
|
@@ -464,6 +472,10 @@ export class SnkGuidesViewer {
|
|
464
472
|
}
|
465
473
|
return "";
|
466
474
|
}
|
475
|
+
getTitle() {
|
476
|
+
var _a, _b;
|
477
|
+
return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
|
478
|
+
}
|
467
479
|
componentDidLoad() {
|
468
480
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
469
481
|
}
|
@@ -477,7 +489,7 @@ export class SnkGuidesViewer {
|
|
477
489
|
}
|
478
490
|
this.loadTaskbarProcessor();
|
479
491
|
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.
|
492
|
+
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
493
|
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
494
|
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
495
|
:
|
@@ -794,6 +806,39 @@ export class SnkGuidesViewer {
|
|
794
806
|
},
|
795
807
|
"attribute": "form-legacy-config-name",
|
796
808
|
"reflect": false
|
809
|
+
},
|
810
|
+
"enableGridInsert": {
|
811
|
+
"type": "boolean",
|
812
|
+
"mutable": false,
|
813
|
+
"complexType": {
|
814
|
+
"original": "boolean",
|
815
|
+
"resolved": "boolean",
|
816
|
+
"references": {}
|
817
|
+
},
|
818
|
+
"required": false,
|
819
|
+
"optional": true,
|
820
|
+
"docs": {
|
821
|
+
"tags": [],
|
822
|
+
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
823
|
+
},
|
824
|
+
"attribute": "enable-grid-insert",
|
825
|
+
"reflect": false,
|
826
|
+
"defaultValue": "false"
|
827
|
+
},
|
828
|
+
"getCustomTitle": {
|
829
|
+
"type": "unknown",
|
830
|
+
"mutable": false,
|
831
|
+
"complexType": {
|
832
|
+
"original": "() => string",
|
833
|
+
"resolved": "() => string",
|
834
|
+
"references": {}
|
835
|
+
},
|
836
|
+
"required": false,
|
837
|
+
"optional": false,
|
838
|
+
"docs": {
|
839
|
+
"tags": [],
|
840
|
+
"text": "Fornece uma fun\u00E7\u00E3o para obter um t\u00EDtulo customizado do formul\u00E1rio."
|
841
|
+
}
|
797
842
|
}
|
798
843
|
};
|
799
844
|
}
|
@@ -4,7 +4,7 @@ export const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
4
4
|
const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
|
5
5
|
const formatOptions = [
|
6
6
|
{ label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
|
7
|
-
{ label: getMessage("snkExporter.
|
7
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
|
8
8
|
];
|
9
9
|
const typeOptions = [
|
10
10
|
{ label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
|
package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
2
2
|
import { UserInterface } from "@sankhyalabs/core";
|
3
|
-
import { getSelectedIDs } from
|
3
|
+
import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
|
4
4
|
import { DataExporterOption } from "../../../lib/@types";
|
5
5
|
export default class ClientSideExporterProvider extends CommonsExporter {
|
6
6
|
getSelectedNumber() {
|
package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
2
|
-
import { getSelectedIDs } from
|
2
|
+
import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
|
3
3
|
export default class ServerSideExporterProvider extends CommonsExporter {
|
4
4
|
getFilters() {
|
5
5
|
var _a;
|
@@ -110,7 +110,7 @@ export class ItemBuilder {
|
|
110
110
|
getExportToXLS(groupName) {
|
111
111
|
return {
|
112
112
|
id: DataExporterOption.EXPORT_TO_XLS,
|
113
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
113
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
114
114
|
group: groupName
|
115
115
|
};
|
116
116
|
}
|
@@ -153,7 +153,7 @@ export class ItemBuilder {
|
|
153
153
|
getExportPageToXLS() {
|
154
154
|
return {
|
155
155
|
id: DataExporterOption.EXPORT_PAGE_TO_XLS,
|
156
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
156
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
157
157
|
};
|
158
158
|
}
|
159
159
|
/**
|
@@ -4,8 +4,8 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
|
|
4
4
|
import { OperationMap, SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
|
5
5
|
import { DatasetStrategy } from '../../lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy';
|
6
6
|
import { getRecordValue } from '../../lib/dataUnit/ValueFormatter';
|
7
|
-
import { getSelectedIDs } from '../snk-data-exporter/utils/RecordIDUtils';
|
8
7
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
8
|
+
import { getSelectedRecordsIDsInfo } from '../../lib/utils/GetSelectedRecordsIDsInfo';
|
9
9
|
export class SnkDataUnit {
|
10
10
|
constructor() {
|
11
11
|
this._onDataUnitResolve = [];
|
@@ -110,7 +110,7 @@ export class SnkDataUnit {
|
|
110
110
|
* @returns Retorna a lista de IDs dos registros selecionados.
|
111
111
|
*/
|
112
112
|
async getSelectedRecordsIDsInfo() {
|
113
|
-
return
|
113
|
+
return getSelectedRecordsIDsInfo(this.dataUnit);
|
114
114
|
}
|
115
115
|
/**
|
116
116
|
* Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
|
@@ -540,19 +540,28 @@ export class SnkDataUnit {
|
|
540
540
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
541
541
|
}
|
542
542
|
}
|
543
|
+
updateMetadataWithRMP() {
|
544
|
+
this.fillFieldsWithRmp(this.dataUnit.metadata);
|
545
|
+
this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
|
546
|
+
const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
|
547
|
+
this.dataUnit.metadata = dataUnitUpdatedMetadata;
|
548
|
+
}
|
543
549
|
async loadDataUnit() {
|
544
|
-
var _a;
|
550
|
+
var _a, _b;
|
545
551
|
if (this.dataUnit == null && this._application && this.entityName) {
|
546
552
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
547
553
|
}
|
548
554
|
if (this.dataUnit) {
|
549
555
|
this.dataUnit.pageSize = this.pageSize;
|
550
556
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
551
|
-
this.dataUnit.addInterceptor(this);
|
552
557
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
553
|
-
|
554
|
-
|
555
|
-
|
558
|
+
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
|
559
|
+
this.updateMetadataWithRMP();
|
560
|
+
}
|
561
|
+
this.dataUnit.addInterceptor(this);
|
562
|
+
if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
|
563
|
+
const { records } = this.getMetadataByRow(this.dataUnit);
|
564
|
+
this.dataUnit.records = records;
|
556
565
|
}
|
557
566
|
this.dataState = this.buildDataState();
|
558
567
|
let resolver;
|
@@ -617,11 +626,11 @@ export class SnkDataUnit {
|
|
617
626
|
}
|
618
627
|
}
|
619
628
|
instanceMessagesBuilder() {
|
620
|
-
var _a
|
629
|
+
var _a;
|
621
630
|
if (this.messagesBuilder) {
|
622
631
|
return;
|
623
632
|
}
|
624
|
-
this.messagesBuilder = new SnkMessageBuilder((
|
633
|
+
this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
|
625
634
|
}
|
626
635
|
//---------------------------------------------
|
627
636
|
// Lifecycle web component
|
package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js
CHANGED
@@ -19,7 +19,7 @@ export class SnkFilterCheckboxList {
|
|
19
19
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
20
20
|
}
|
21
21
|
renderOptions() {
|
22
|
-
return this.optionsList.map(option => (h("ez-check", { label: option.label,
|
22
|
+
return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
|
23
23
|
}
|
24
24
|
isChecked(itemName) {
|
25
25
|
var _a;
|