@sankhyalabs/sankhyablocks 8.16.0-dev.104 → 8.16.0-dev.105
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/{SnkMessageBuilder-bae64d0d.js → SnkMessageBuilder-aecd7c18.js} +31 -24
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +18 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-4b510d6e.js → snk-data-unit-9a463a4f.js} +225 -11
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +21 -7
- package/dist/cjs/{snk-guides-viewer-e8e5f7b4.js → snk-guides-viewer-c9e1e97b.js} +98 -43
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +65 -22
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
- package/dist/cjs/{taskbar-elements-7e19882d.js → taskbar-elements-02379452.js} +3 -0
- package/dist/collection/components/snk-crud/snk-crud.js +35 -9
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +117 -43
- package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js +128 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +107 -12
- package/dist/collection/components/snk-grid/snk-grid.js +38 -6
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +83 -22
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -2
- package/dist/collection/lib/message/SnkMessageBuilder.js +1 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +28 -23
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
- package/dist/components/SnkMessageBuilder.js +31 -24
- package/dist/components/snk-crud.js +18 -9
- package/dist/components/snk-data-unit2.js +225 -11
- package/dist/components/snk-detail-view2.js +98 -43
- package/dist/components/snk-grid2.js +21 -6
- package/dist/components/snk-simple-crud2.js +66 -22
- package/dist/components/snk-taskbar2.js +4 -0
- package/dist/esm/{SnkMessageBuilder-6fff4a4c.js → SnkMessageBuilder-12f5fe1a.js} +31 -24
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +18 -10
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-7d0ce406.js → snk-data-unit-affee080.js} +225 -11
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +21 -7
- package/dist/esm/{snk-guides-viewer-c44b3839.js → snk-guides-viewer-3befd409.js} +99 -44
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-simple-crud.entry.js +66 -23
- package/dist/esm/snk-taskbar.entry.js +2 -1
- package/dist/esm/{taskbar-elements-d2353c64.js → taskbar-elements-c62b6c66.js} +3 -0
- package/dist/sankhyablocks/{p-35f85998.entry.js → p-2101be8b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ef6f0a1b.entry.js → p-21a5acc4.entry.js} +1 -1
- package/dist/sankhyablocks/p-2d6df7e7.entry.js +1 -0
- package/dist/sankhyablocks/p-3f624cbe.js +1 -0
- package/dist/sankhyablocks/p-53e1de0a.entry.js +1 -0
- package/dist/sankhyablocks/{p-b2a2a83e.entry.js → p-624390bb.entry.js} +1 -1
- package/dist/sankhyablocks/p-80f8c22c.js +1 -0
- package/dist/sankhyablocks/p-82177c24.js +1 -0
- package/dist/sankhyablocks/{p-754559b9.entry.js → p-a5e5574c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5503e89f.entry.js → p-cbb4c043.entry.js} +1 -1
- package/dist/sankhyablocks/p-cf685cef.entry.js +1 -0
- package/dist/sankhyablocks/p-dcfc8b35.entry.js +1 -0
- package/dist/sankhyablocks/{p-38e3ffda.entry.js → p-ea55f2ab.entry.js} +1 -1
- package/dist/sankhyablocks/p-fb0f0087.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +10 -1
- package/dist/types/components/snk-data-unit/MultipleUpdateHelper.d.ts +9 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +17 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +9 -2
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +28 -0
- package/dist/types/lib/message/SnkMessageBuilder.d.ts +2 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-17425c72.js +0 -1
- package/dist/sankhyablocks/p-3fc82614.js +0 -1
- package/dist/sankhyablocks/p-460f1827.entry.js +0 -1
- package/dist/sankhyablocks/p-6e0a5314.js +0 -1
- package/dist/sankhyablocks/p-835128f5.entry.js +0 -1
- package/dist/sankhyablocks/p-92778d5a.js +0 -1
- package/dist/sankhyablocks/p-a962a3e4.entry.js +0 -1
- package/dist/sankhyablocks/p-e35fe2bd.entry.js +0 -1
@@ -3,11 +3,140 @@
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
5
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
6
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
6
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-aecd7c18.js');
|
7
7
|
const dataunitFetcher = require('./dataunit-fetcher-4a5d491a.js');
|
8
8
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
9
9
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
10
10
|
|
11
|
+
const NO_TAB_NAME = "__NO_TAB_NAME__";
|
12
|
+
const MAIN_TAB_NAME = "__main";
|
13
|
+
async function showConfirmMultipleUpdatePopup({ title, labelBtnConfirm, labelBtnCancel, message, changingFields, }) {
|
14
|
+
return new Promise((resolve) => {
|
15
|
+
const popup = builPopup(title, resolve);
|
16
|
+
const contentContainer = buildContentContainer();
|
17
|
+
contentContainer.appendChild(buildMessage(message));
|
18
|
+
contentContainer.appendChild(buildChangesContainer(changingFields));
|
19
|
+
const actionsContainer = buildActionsContainer();
|
20
|
+
actionsContainer.appendChild(buildCancelBtn(popup, labelBtnCancel, resolve));
|
21
|
+
actionsContainer.appendChild(buildConfirmBtn(popup, labelBtnConfirm, resolve));
|
22
|
+
contentContainer.appendChild(actionsContainer);
|
23
|
+
popup.appendChild(contentContainer);
|
24
|
+
document.body.appendChild(popup);
|
25
|
+
});
|
26
|
+
}
|
27
|
+
function groupChanges(changingFields) {
|
28
|
+
const changesMap = new Map();
|
29
|
+
changingFields.forEach(change => {
|
30
|
+
var _a;
|
31
|
+
const key = (_a = change.tabName) !== null && _a !== void 0 ? _a : NO_TAB_NAME;
|
32
|
+
if (!changesMap.has(key))
|
33
|
+
changesMap.set(key, []);
|
34
|
+
changesMap.get(key).push(change);
|
35
|
+
});
|
36
|
+
return changesMap;
|
37
|
+
}
|
38
|
+
function getTabName(tabName) {
|
39
|
+
switch (tabName) {
|
40
|
+
case NO_TAB_NAME:
|
41
|
+
return "";
|
42
|
+
case MAIN_TAB_NAME:
|
43
|
+
return "Principal";
|
44
|
+
default:
|
45
|
+
return tabName;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
function buildChangesDiv(tabName, changes) {
|
49
|
+
const changeLabel = document.createElement('span');
|
50
|
+
changeLabel.innerText = getTabName(tabName);
|
51
|
+
changeLabel.style.display = 'block';
|
52
|
+
changeLabel.style.fontWeight = 'var(--text-weight--large, 500)';
|
53
|
+
changeLabel.style.fontSize = 'var(--text--medium, 14px)';
|
54
|
+
changeLabel.style.marginBottom = 'var(--space--small, 6px)';
|
55
|
+
const changeDiv = document.createElement('div');
|
56
|
+
changeDiv.style.padding = 'var(--space--medium, 12px) 0';
|
57
|
+
changeDiv.style.borderTop = '1px solid var(--color--disable-secondary, #f2f5f8)';
|
58
|
+
changeDiv.appendChild(changeLabel);
|
59
|
+
changes.forEach(change => {
|
60
|
+
const changeLine = document.createElement('span');
|
61
|
+
changeLine.innerHTML = `${change.label}: <span style="color: var(--text--primary, #626e82)">${change.value}</span>`;
|
62
|
+
changeLine.style.display = 'block';
|
63
|
+
changeLine.style.marginBottom = 'var(--space--extra-small, 3px)';
|
64
|
+
changeDiv.appendChild(changeLine);
|
65
|
+
});
|
66
|
+
return changeDiv;
|
67
|
+
}
|
68
|
+
function buildChangesContainer(changingFields) {
|
69
|
+
const changesContainer = document.createElement('div');
|
70
|
+
changesContainer.style.flexDirection = 'column';
|
71
|
+
changesContainer.style.display = 'flex';
|
72
|
+
changesContainer.style.overflow = 'auto';
|
73
|
+
changesContainer.style.maxHeight = '300px';
|
74
|
+
const changesMap = groupChanges(changingFields);
|
75
|
+
changesMap.forEach((changes, key) => {
|
76
|
+
changesContainer.appendChild(buildChangesDiv(key, changes));
|
77
|
+
});
|
78
|
+
return changesContainer;
|
79
|
+
}
|
80
|
+
function buildMessage(messageContent) {
|
81
|
+
const message = document.createElement('p');
|
82
|
+
message.textContent = messageContent;
|
83
|
+
message.style.fontSize = 'var(--text--medium, 14px)';
|
84
|
+
return message;
|
85
|
+
}
|
86
|
+
function buildContentContainer() {
|
87
|
+
const contentContainer = document.createElement('div');
|
88
|
+
contentContainer.style.display = 'flex';
|
89
|
+
contentContainer.style.flexDirection = 'column';
|
90
|
+
contentContainer.style.fontFamily = 'var(--font-pattern, Roboto)';
|
91
|
+
contentContainer.style.fontSize = 'var(--text--medium, 14px)';
|
92
|
+
return contentContainer;
|
93
|
+
}
|
94
|
+
function buildActionsContainer() {
|
95
|
+
const actionsContainer = document.createElement('div');
|
96
|
+
actionsContainer.style.display = 'flex';
|
97
|
+
actionsContainer.style.flexDirection = 'row';
|
98
|
+
actionsContainer.style.justifyContent = 'flex-end';
|
99
|
+
actionsContainer.style.gap = '5px';
|
100
|
+
return actionsContainer;
|
101
|
+
}
|
102
|
+
function builPopup(title, resolve) {
|
103
|
+
const popup = document.createElement('ez-popup');
|
104
|
+
popup.opened = true;
|
105
|
+
popup.size = 'small';
|
106
|
+
popup.ezTitle = title;
|
107
|
+
popup.heightMode = 'auto';
|
108
|
+
popup.addEventListener('ezClosePopup', () => {
|
109
|
+
document.body.removeChild(popup);
|
110
|
+
resolve(false);
|
111
|
+
}, { once: true });
|
112
|
+
popup.addEventListener('ezPopupAction', () => {
|
113
|
+
document.body.removeChild(popup);
|
114
|
+
resolve(false);
|
115
|
+
}, { once: true });
|
116
|
+
return popup;
|
117
|
+
}
|
118
|
+
function buildConfirmBtn(popup, confirmBtnLabel, resolve) {
|
119
|
+
const confirmBtn = document.createElement('ez-button');
|
120
|
+
confirmBtn.label = confirmBtnLabel;
|
121
|
+
confirmBtn.size = 'medium';
|
122
|
+
confirmBtn.classList.add('ez-button--primary');
|
123
|
+
confirmBtn.onclick = () => {
|
124
|
+
document.body.removeChild(popup);
|
125
|
+
resolve(true);
|
126
|
+
};
|
127
|
+
return confirmBtn;
|
128
|
+
}
|
129
|
+
function buildCancelBtn(popup, cancelBtnLabel, resolve) {
|
130
|
+
const cancelBtn = document.createElement('ez-button');
|
131
|
+
cancelBtn.label = cancelBtnLabel;
|
132
|
+
cancelBtn.size = 'medium';
|
133
|
+
cancelBtn.onclick = () => {
|
134
|
+
document.body.removeChild(popup);
|
135
|
+
resolve(false);
|
136
|
+
};
|
137
|
+
return cancelBtn;
|
138
|
+
}
|
139
|
+
|
11
140
|
const SnkDataUnit = class {
|
12
141
|
constructor(hostRef) {
|
13
142
|
index.registerInstance(this, hostRef);
|
@@ -23,6 +152,7 @@ const SnkDataUnit = class {
|
|
23
152
|
this._fieldsWithRmPrecision = [];
|
24
153
|
this._metadataByRow = new Map();
|
25
154
|
this._rowMetadataCache = new Map();
|
155
|
+
this._formFieldsConfig = [];
|
26
156
|
this.REGEX_DATAUNIT_NAME = /dd:\/\/(.+?)\//;
|
27
157
|
this._dataUnitObserver = async (action) => {
|
28
158
|
const duState = await this.buildDataState(action.type);
|
@@ -99,6 +229,10 @@ const SnkDataUnit = class {
|
|
99
229
|
this.messagesBuilderUpdated.emit(newValue);
|
100
230
|
}
|
101
231
|
}
|
232
|
+
onMasterFormConfigChange({ detail }) {
|
233
|
+
var _a;
|
234
|
+
this._formFieldsConfig = (_a = detail === null || detail === void 0 ? void 0 : detail.fields) !== null && _a !== void 0 ? _a : [];
|
235
|
+
}
|
102
236
|
/**
|
103
237
|
* Obtém o dataUnit.
|
104
238
|
*/
|
@@ -273,9 +407,13 @@ const SnkDataUnit = class {
|
|
273
407
|
this._openedAlert = false;
|
274
408
|
}
|
275
409
|
async interceptSavingData(action) {
|
276
|
-
if (
|
277
|
-
|
410
|
+
if (this.dataUnit.isMultipleEdition) {
|
411
|
+
const confirm = await this.confirmMultipleSavingData();
|
412
|
+
if (!confirm)
|
413
|
+
return undefined;
|
278
414
|
}
|
415
|
+
if (!this.beforeSave)
|
416
|
+
return action;
|
279
417
|
const continueAction = this.beforeSave(this.dataUnit);
|
280
418
|
if (continueAction instanceof Promise) {
|
281
419
|
const result = await continueAction;
|
@@ -283,6 +421,46 @@ const SnkDataUnit = class {
|
|
283
421
|
}
|
284
422
|
return continueAction ? action : undefined;
|
285
423
|
}
|
424
|
+
async confirmMultipleSavingData() {
|
425
|
+
const selectedRecords = this.dataUnit.getSelectionInfo().records;
|
426
|
+
const title = this.getMessage('snkDataUnit.multipleUpdateConfirmationTitle');
|
427
|
+
const message = this.getMessage('snkDataUnit.multipleUpdateConfirmationMessage', { size: selectedRecords.length });
|
428
|
+
const labelBtnCancel = this.getMessage('snkDataUnit.confirm.cancel');
|
429
|
+
const labelBtnConfirm = this.getMessage('snkDataUnit.confirm.updateMultipleConfirm');
|
430
|
+
return await showConfirmMultipleUpdatePopup({
|
431
|
+
title,
|
432
|
+
message,
|
433
|
+
labelBtnConfirm,
|
434
|
+
labelBtnCancel,
|
435
|
+
changingFields: this.getChangingFields(),
|
436
|
+
});
|
437
|
+
}
|
438
|
+
getChangingFields() {
|
439
|
+
const changes = this.dataUnit.buildChangesToSave();
|
440
|
+
if (!(changes === null || changes === void 0 ? void 0 : changes.length))
|
441
|
+
return [];
|
442
|
+
const change = changes[0];
|
443
|
+
const changingFields = Object.keys(change.updatingFields).map(key => this.buildChangingField(key, change[key]));
|
444
|
+
return changingFields;
|
445
|
+
}
|
446
|
+
buildChangingField(key, value) {
|
447
|
+
const fieldLabel = this.dataUnit.getField(key).label;
|
448
|
+
const formattedValue = this.dataUnit.getFormattedValue(key, value);
|
449
|
+
return {
|
450
|
+
label: fieldLabel,
|
451
|
+
value: formattedValue,
|
452
|
+
tabName: this.getFieldTabName(key),
|
453
|
+
};
|
454
|
+
}
|
455
|
+
getFieldTabName(fieldName) {
|
456
|
+
var _a;
|
457
|
+
const tab = (_a = this._formFieldsConfig.find(f => f.name === fieldName)) === null || _a === void 0 ? void 0 : _a.tab;
|
458
|
+
if (!tab)
|
459
|
+
return undefined;
|
460
|
+
if (typeof tab === 'string')
|
461
|
+
return tab;
|
462
|
+
return tab.label;
|
463
|
+
}
|
286
464
|
interceptDataSaved(action) {
|
287
465
|
if (this.afterSave) {
|
288
466
|
this.afterSave(this.dataUnit);
|
@@ -302,7 +480,17 @@ const SnkDataUnit = class {
|
|
302
480
|
}
|
303
481
|
const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
|
304
482
|
const confirm = await utils.ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation);
|
305
|
-
|
483
|
+
if (confirm) {
|
484
|
+
let editionCanceledMessage;
|
485
|
+
if (this.dataUnit.isMultipleEdition) {
|
486
|
+
const selectedRecords = this.dataUnit.getSelectionInfo().records;
|
487
|
+
editionCanceledMessage = this.buildMultipleUpdateMessage(selectedRecords, true);
|
488
|
+
}
|
489
|
+
else {
|
490
|
+
editionCanceledMessage = this.getMessage("snkDataUnit.cancelInfo");
|
491
|
+
}
|
492
|
+
this.showSuccessMessage(editionCanceledMessage);
|
493
|
+
}
|
306
494
|
return confirm ? action : undefined;
|
307
495
|
}
|
308
496
|
async interceptRemovingRecords(action) {
|
@@ -480,24 +668,50 @@ const SnkDataUnit = class {
|
|
480
668
|
}
|
481
669
|
async handleDataSaved(action) {
|
482
670
|
var _a, _b, _c;
|
483
|
-
const
|
671
|
+
const changes = (_a = action === null || action === void 0 ? void 0 : action.payload) === null || _a === void 0 ? void 0 : _a.changes;
|
672
|
+
const affectedRecords = (_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.records;
|
673
|
+
const newRowMetadata = await this.handleLoadRowMetadata((_c = changes === null || changes === void 0 ? void 0 : changes[0]) === null || _c === void 0 ? void 0 : _c.record);
|
484
674
|
if (newRowMetadata) {
|
485
675
|
newRowMetadata.getProp = this.buildGetPropRowMetadata(newRowMetadata);
|
486
676
|
}
|
487
|
-
const recordId =
|
677
|
+
const recordId = affectedRecords[0].__record__id__;
|
488
678
|
this._metadataByRow.set(recordId, newRowMetadata);
|
489
679
|
this.dataState = await this.buildDataState();
|
490
|
-
let saveOperation =
|
491
|
-
if (saveOperation == 'copy')
|
680
|
+
let saveOperation = changes[0]._operation.toLowerCase();
|
681
|
+
if (saveOperation == 'copy') {
|
492
682
|
saveOperation = SnkMessageBuilder.OperationMap.CLONE;
|
493
|
-
if (this.ignoreSaveMessage && ![SnkMessageBuilder.OperationMap.CLONE, SnkMessageBuilder.OperationMap.INSERT].includes(saveOperation)) {
|
494
|
-
return;
|
495
683
|
}
|
496
|
-
|
684
|
+
if (this.canIgnoreOperationMessage(saveOperation))
|
685
|
+
return;
|
686
|
+
let msg = this.buildOperationMessage(saveOperation, affectedRecords);
|
497
687
|
if (msg != undefined) {
|
498
688
|
this.showSuccessMessage(msg);
|
499
689
|
}
|
500
690
|
}
|
691
|
+
canIgnoreOperationMessage(saveOperation) {
|
692
|
+
return this.ignoreSaveMessage && !this.isCloneOrInsertOperation(saveOperation);
|
693
|
+
}
|
694
|
+
isCloneOrInsertOperation(saveOperation) {
|
695
|
+
return [SnkMessageBuilder.OperationMap.CLONE, SnkMessageBuilder.OperationMap.INSERT].includes(saveOperation);
|
696
|
+
}
|
697
|
+
buildOperationMessage(saveOperation, records) {
|
698
|
+
if (this.isMultiplesUpdate(saveOperation, records)) {
|
699
|
+
return this.buildMultipleUpdateMessage(records);
|
700
|
+
}
|
701
|
+
return this.getMessage('snkDataUnit.saveInfo', records[0], saveOperation);
|
702
|
+
}
|
703
|
+
buildMultipleUpdateMessage(records, isCancel) {
|
704
|
+
/**
|
705
|
+
* FIXME: No futuro, precisamos pensar em um mecanismo para deixar as mensagens de feedback mais dinâmicas.
|
706
|
+
* Podemo ocorrer cenários onde temos mais de um registro selecionado e também cenários onde a chave primária
|
707
|
+
* de um registro se trata de uma chave composta.
|
708
|
+
*/
|
709
|
+
const key = `snkDataUnit.${isCancel ? 'cancelInfo' : 'saveInfo'}`;
|
710
|
+
return this.getMessage(key, { records: records }, SnkMessageBuilder.OperationMap.UPDATE_MULTIPLES);
|
711
|
+
}
|
712
|
+
isMultiplesUpdate(saveOperation, records) {
|
713
|
+
return saveOperation === SnkMessageBuilder.OperationMap.UPDATE && records.length > 1;
|
714
|
+
}
|
501
715
|
handleRecordsRemoved(action) {
|
502
716
|
var _a, _b;
|
503
717
|
let removeFinishMsg = this.buildRemoveFinishMessage(action);
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
5
|
+
const snkDataUnit = require('./snk-data-unit-9a463a4f.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
9
|
-
require('./SnkMessageBuilder-
|
9
|
+
require('./SnkMessageBuilder-aecd7c18.js');
|
10
10
|
require('./dataunit-fetcher-4a5d491a.js');
|
11
11
|
require('./DataFetcher-1afdb18e.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -15,9 +15,9 @@ require('./dataunit-fetcher-4a5d491a.js');
|
|
15
15
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
16
16
|
require('./form-config-fetcher-40d3f752.js');
|
17
17
|
const constants = require('./constants-77c1b8bd.js');
|
18
|
-
const taskbarElements = require('./taskbar-elements-
|
19
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
20
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
18
|
+
const taskbarElements = require('./taskbar-elements-02379452.js');
|
19
|
+
const snkGuidesViewer = require('./snk-guides-viewer-c9e1e97b.js');
|
20
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-aecd7c18.js');
|
21
21
|
require('./ConfigStorage-df09fb78.js');
|
22
22
|
require('./PrintUtils-bcaeb82f.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -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 taskbarElements = require('./taskbar-elements-
|
7
|
+
const taskbarElements = require('./taskbar-elements-02379452.js');
|
8
8
|
const ConfigStorage = require('./ConfigStorage-df09fb78.js');
|
9
9
|
const index$1 = require('./index-e3e39724.js');
|
10
10
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
@@ -100,7 +100,7 @@ const SnkGrid = class {
|
|
100
100
|
});
|
101
101
|
this._headerTaskbarProcessor = new fieldSearch.TaskbarProcessor({
|
102
102
|
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON", "MORE_OPTIONS"],
|
103
|
-
"snkGridHeaderTaskbar.selected":
|
103
|
+
"snkGridHeaderTaskbar.selected": this.getGridHeaderSelectedBtns(),
|
104
104
|
"snkGridHeaderTaskbar.detail.unselected": ["REFRESH", "MORE_OPTIONS"],
|
105
105
|
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"],
|
106
106
|
"snkGridHeaderTaskbar.singleTaskbar.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON", "MORE_OPTIONS"],
|
@@ -151,6 +151,17 @@ const SnkGrid = class {
|
|
151
151
|
this.enableGridInsert = false;
|
152
152
|
this.outlineMode = false;
|
153
153
|
this.strategyExporter = index$1.ExporterStrategy.SERVER_SIDE;
|
154
|
+
this.multipleEditionEnabled = true;
|
155
|
+
}
|
156
|
+
getGridHeaderSelectedBtns() {
|
157
|
+
const btns = [
|
158
|
+
taskbarElements.TaskbarElement.UPDATE, taskbarElements.TaskbarElement.CLONE, taskbarElements.TaskbarElement.REMOVE,
|
159
|
+
taskbarElements.TaskbarElement.MORE_OPTIONS, taskbarElements.TaskbarElement.DIVIDER, taskbarElements.TaskbarElement.ATTACH, taskbarElements.TaskbarElement.FORM_MODE,
|
160
|
+
taskbarElements.TaskbarElement.CONFIGURATOR, taskbarElements.TaskbarElement.REFRESH, taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.ACTIONS_BUTTON
|
161
|
+
];
|
162
|
+
if (this.multipleEditionEnabled)
|
163
|
+
btns.unshift(taskbarElements.TaskbarElement.UPDATE_MULTIPLE);
|
164
|
+
return btns;
|
154
165
|
}
|
155
166
|
reloadConfig() {
|
156
167
|
this.loadConfig();
|
@@ -435,20 +446,23 @@ const SnkGrid = class {
|
|
435
446
|
const disabledButtons = [];
|
436
447
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) {
|
437
448
|
if (this._dataState.selectionInfo.length > 1) {
|
438
|
-
disabledButtons.push(taskbarElements.TaskbarElement.CLONE,
|
449
|
+
disabledButtons.push(taskbarElements.TaskbarElement.CLONE, taskbarElements.TaskbarElement.ATTACH, taskbarElements.TaskbarElement.UPDATE);
|
439
450
|
}
|
440
451
|
if (this._dataState.selectionInfo.isAllRecords()) {
|
441
|
-
disabledButtons.push(
|
452
|
+
disabledButtons.push(taskbarElements.TaskbarElement.REMOVE);
|
442
453
|
}
|
443
454
|
}
|
444
455
|
return disabledButtons;
|
445
456
|
}
|
446
457
|
getInvisibleButtons() {
|
458
|
+
var _a, _b;
|
447
459
|
let invisibleButtons = [];
|
448
460
|
if (!this._dataUnit || this._dataUnit.records.length === 0)
|
449
|
-
invisibleButtons.push(
|
450
|
-
if (this._dataState
|
451
|
-
invisibleButtons.push(
|
461
|
+
invisibleButtons.push(taskbarElements.TaskbarElement.DATA_EXPORTER);
|
462
|
+
if (((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo.mode) === DataUnit.SelectionMode.ALL_RECORDS)
|
463
|
+
invisibleButtons.push(taskbarElements.TaskbarElement.ACTIONS_BUTTON);
|
464
|
+
if (((_b = this._dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo.length) === 1)
|
465
|
+
invisibleButtons.push(taskbarElements.TaskbarElement.UPDATE_MULTIPLE);
|
452
466
|
return invisibleButtons;
|
453
467
|
}
|
454
468
|
componentWillRender() {
|
@@ -5,7 +5,7 @@ const core = require('@sankhyalabs/core');
|
|
5
5
|
const SnkFormConfigManager = require('./SnkFormConfigManager-45a8d7b7.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-02379452.js');
|
9
9
|
const constants = require('./constants-77c1b8bd.js');
|
10
10
|
require('./DataFetcher-1afdb18e.js');
|
11
11
|
require('./ISave-c76e2c51.js');
|
@@ -23,6 +23,7 @@ const FORM_NAME_PREFIX = "__FORM:";
|
|
23
23
|
const SnkGuidesViewer = class {
|
24
24
|
constructor(hostRef) {
|
25
25
|
index.registerInstance(this, hostRef);
|
26
|
+
this.snkMasterFormConfigChange = index.createEvent(this, "snkMasterFormConfigChange", 7);
|
26
27
|
this.exit = index.createEvent(this, "exit", 7);
|
27
28
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
28
29
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
@@ -59,14 +60,16 @@ const SnkGuidesViewer = class {
|
|
59
60
|
this.loadGuides(true);
|
60
61
|
}
|
61
62
|
observeDataState(newValue, oldValue) {
|
62
|
-
|
63
|
-
const
|
64
|
-
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
64
|
+
const newRecordsIds = (_b = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.selectionInfo) === null || _a === void 0 ? void 0 : _a.recordIds) !== null && _b !== void 0 ? _b : (_c = newValue === null || newValue === void 0 ? void 0 : newValue.selectedRecord) === null || _c === void 0 ? void 0 : _c['__record__id__'];
|
65
|
+
const oldRecordsIds = (_e = (_d = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectionInfo) === null || _d === void 0 ? void 0 : _d.recordIds) !== null && _e !== void 0 ? _e : (_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectedRecord) === null || _f === void 0 ? void 0 : _f['__record__id__'];
|
66
|
+
if (!core.ObjectUtils.equals(newRecordsIds, oldRecordsIds)) {
|
65
67
|
this.loadGuides((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) != (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode));
|
66
68
|
}
|
67
69
|
}
|
68
70
|
observeMasterFormConfig() {
|
69
71
|
this.loadGuides(this.noGuideSelected());
|
72
|
+
this.snkMasterFormConfigChange.emit(this.masterFormConfig);
|
70
73
|
}
|
71
74
|
/**
|
72
75
|
* Abre o configurador do formulário
|
@@ -140,6 +143,11 @@ const SnkGuidesViewer = class {
|
|
140
143
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-crud.msg.ts"
|
141
144
|
*/
|
142
145
|
getMessage(key) {
|
146
|
+
var _a, _b;
|
147
|
+
if (this.dataUnit.isMultipleEdition) {
|
148
|
+
const selectedRecords = (_b = (_a = this.dataUnit.getSelectionInfo()) === null || _a === void 0 ? void 0 : _a.records) !== null && _b !== void 0 ? _b : [];
|
149
|
+
return `Editando ${selectedRecords.length} registros`;
|
150
|
+
}
|
143
151
|
return this.messagesBuilder.getMessage(key, this.dataUnit.getSelectedRecord());
|
144
152
|
}
|
145
153
|
loadGuides(changeSelection) {
|
@@ -152,12 +160,12 @@ const SnkGuidesViewer = class {
|
|
152
160
|
this._masterFormMetadata = form.buildFormMetadata(this.masterFormConfig, this.dataUnit, true);
|
153
161
|
const allSheets = this._masterFormMetadata.getAllSheets();
|
154
162
|
const currentRecord = this.dataUnit.getSelectedRecord();
|
155
|
-
const disableDetails =
|
163
|
+
const disableDetails = this.hasToDisableDetails(currentRecord);
|
156
164
|
const guides = [];
|
157
165
|
Array.from(allSheets.values()).forEach((sheet) => {
|
158
166
|
const item = { id: sheet.name, label: sheet.label };
|
159
167
|
if (this.isDetail(sheet.name) && disableDetails) {
|
160
|
-
item.tooltip = "Para alterar detalhes é necessário estar com um registro selecionado.";
|
168
|
+
item.tooltip = "Para alterar detalhes é necessário estar com um (e apenas um) registro selecionado.";
|
161
169
|
item.disabled = true;
|
162
170
|
}
|
163
171
|
guides.push(item);
|
@@ -170,6 +178,11 @@ const SnkGuidesViewer = class {
|
|
170
178
|
this.selectedGuide = this._guides.length > 0 ? this._guides[0] : undefined;
|
171
179
|
}
|
172
180
|
}
|
181
|
+
hasToDisableDetails(currentRecord) {
|
182
|
+
return !currentRecord
|
183
|
+
|| this.dataUnit.isNewRecord(currentRecord.__record__id__)
|
184
|
+
|| this.dataUnit.isMultipleEdition;
|
185
|
+
}
|
173
186
|
isDetail(formId) {
|
174
187
|
return form.FormMetadata.getDetailName(formId) != undefined;
|
175
188
|
}
|
@@ -192,47 +205,59 @@ const SnkGuidesViewer = class {
|
|
192
205
|
}
|
193
206
|
getTaskBarId() {
|
194
207
|
var _a;
|
195
|
-
|
196
|
-
|
197
|
-
loadTaskbarProcessor() {
|
198
|
-
var _a;
|
199
|
-
const taskbarId = this.getTaskBarId();
|
200
|
-
const disabledButtons = [];
|
201
|
-
if (!this.dataState || !this.dataState.hasPrevious) {
|
202
|
-
disabledButtons.push("PREVIOUS");
|
208
|
+
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
209
|
+
return TASKBAR_ID.FINISH_EDITION;
|
203
210
|
}
|
204
|
-
if (
|
205
|
-
|
211
|
+
if (this.dataUnit.isMultipleEdition) {
|
212
|
+
return TASKBAR_ID.MUTIPLE_EDITION;
|
206
213
|
}
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
+
return TASKBAR_ID.REGULAR;
|
215
|
+
}
|
216
|
+
loadTaskbarProcessor() {
|
217
|
+
const taskbarIDs = {};
|
218
|
+
taskbarIDs[TASKBAR_ID.REGULAR] = this.buildBtnsRegularMode();
|
219
|
+
taskbarIDs[TASKBAR_ID.FINISH_EDITION] = [taskbarElements.TaskbarElement.CANCEL, taskbarElements.TaskbarElement.SAVE, this.handleAddGridMode()];
|
220
|
+
taskbarIDs[TASKBAR_ID.MUTIPLE_EDITION] = [taskbarElements.TaskbarElement.CANCEL];
|
221
|
+
this._taskbarProcessor = new fieldSearch.TaskbarProcessor(taskbarIDs);
|
222
|
+
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.buildDisabledButtons(), this.buildInvisibleButtons());
|
223
|
+
}
|
224
|
+
buildBtnsRegularMode() {
|
225
|
+
var _a, _b;
|
226
|
+
const btnsRegularMode = [
|
227
|
+
taskbarElements.TaskbarElement.ATTACH, taskbarElements.TaskbarElement.CLONE, taskbarElements.TaskbarElement.REMOVE, taskbarElements.TaskbarElement.MORE_OPTIONS,
|
228
|
+
taskbarElements.TaskbarElement.ACTIONS_BUTTON, taskbarElements.TaskbarElement.DIVIDER, taskbarElements.TaskbarElement.GRID_MODE, taskbarElements.TaskbarElement.CONFIGURATOR,
|
229
|
+
];
|
230
|
+
if (((_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.length) <= 1) {
|
231
|
+
btnsRegularMode.unshift(taskbarElements.TaskbarElement.PREVIOUS, taskbarElements.TaskbarElement.NEXT, taskbarElements.TaskbarElement.DIVIDER);
|
214
232
|
}
|
215
|
-
const btnsRegularMode = ["PREVIOUS", "NEXT", "DIVIDER", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "ACTIONS_BUTTON", "DIVIDER", "GRID_MODE", "CONFIGURATOR"];
|
216
233
|
if (this.presentationMode == index$1.PresentationMode.SECONDARY) {
|
217
|
-
btnsRegularMode.unshift(
|
234
|
+
btnsRegularMode.unshift(taskbarElements.TaskbarElement.INSERT);
|
218
235
|
}
|
219
236
|
else {
|
220
|
-
btnsRegularMode.push(
|
237
|
+
btnsRegularMode.push(taskbarElements.TaskbarElement.INSERT);
|
221
238
|
}
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
239
|
+
return btnsRegularMode;
|
240
|
+
}
|
241
|
+
buildDisabledButtons() {
|
242
|
+
var _a, _b, _c, _d, _e, _f;
|
243
|
+
const disabledButtons = [];
|
244
|
+
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasPrevious))
|
245
|
+
disabledButtons.push(taskbarElements.TaskbarElement.PREVIOUS);
|
246
|
+
if (!((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.hasNext))
|
247
|
+
disabledButtons.push(taskbarElements.TaskbarElement.NEXT);
|
248
|
+
if (((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.length) > 1)
|
249
|
+
disabledButtons.push(taskbarElements.TaskbarElement.CLONE);
|
250
|
+
if ((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.isAllRecords())
|
251
|
+
disabledButtons.push(taskbarElements.TaskbarElement.REMOVE);
|
252
|
+
return disabledButtons;
|
228
253
|
}
|
229
254
|
handleAddGridMode() {
|
230
255
|
return this.enableGridInsert ? taskbarElements.TaskbarElement.GRID_MODE : "";
|
231
256
|
}
|
232
|
-
|
257
|
+
buildInvisibleButtons() {
|
233
258
|
const invisibleButtons = [];
|
234
259
|
if (this.dataState && this.dataState.selectionInfo.mode === DataUnit.SelectionMode.ALL_RECORDS)
|
235
|
-
invisibleButtons.push(
|
260
|
+
invisibleButtons.push(taskbarElements.TaskbarElement.ACTIONS_BUTTON);
|
236
261
|
return invisibleButtons;
|
237
262
|
}
|
238
263
|
static updateContentCard(formName, cardConfig, propertyChanged, configManager) {
|
@@ -445,17 +470,27 @@ const SnkGuidesViewer = class {
|
|
445
470
|
}
|
446
471
|
buildTaskBar() {
|
447
472
|
var _a;
|
448
|
-
return index.h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != index$1.PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, index.h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ?
|
473
|
+
return index.h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != index$1.PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, index.h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? taskbarElements.TaskbarElement.SAVE : taskbarElements.TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
449
474
|
}
|
450
475
|
async dataUnitActionHandler(action) {
|
451
476
|
var _a;
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
477
|
+
switch (action.type) {
|
478
|
+
case core.Action.EDITION_CANCELED:
|
479
|
+
case core.Action.DATA_SAVED:
|
480
|
+
if (this.dataUnit.isMultipleEdition) {
|
481
|
+
this.exitViewer();
|
482
|
+
this.dataUnit.isMultipleEdition = false;
|
483
|
+
}
|
484
|
+
break;
|
485
|
+
case core.Action.FIELD_INVALIDATED:
|
486
|
+
const guideName = this.getGuideName((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fieldName);
|
487
|
+
await this.addErrorBadgeToGuide(guideName);
|
488
|
+
await this.openGuideNavigator(guideName);
|
489
|
+
break;
|
490
|
+
case core.Action.METADATA_LOADED:
|
491
|
+
case core.Action.MULTIPLE_EDITION_CHANGED:
|
492
|
+
this.loadGuides(this.noGuideSelected());
|
493
|
+
break;
|
459
494
|
}
|
460
495
|
}
|
461
496
|
async addErrorBadgeToGuide(guideName) {
|
@@ -495,6 +530,20 @@ const SnkGuidesViewer = class {
|
|
495
530
|
var _a, _b;
|
496
531
|
return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
|
497
532
|
}
|
533
|
+
getTitleTooltip() {
|
534
|
+
if (!this.dataUnit.isMultipleEdition)
|
535
|
+
return;
|
536
|
+
return this.buildRecordIdsArray();
|
537
|
+
}
|
538
|
+
buildRecordIdsArray() {
|
539
|
+
var _a, _b;
|
540
|
+
const selectedRecords = (_b = (_a = this.dataUnit.getSelectionInfo()) === null || _a === void 0 ? void 0 : _a.records) !== null && _b !== void 0 ? _b : [];
|
541
|
+
if (selectedRecords.length === 0) {
|
542
|
+
return "[]";
|
543
|
+
}
|
544
|
+
const labels = selectedRecords.map(record => this.messagesBuilder.getMessage("snkCrud.title", record));
|
545
|
+
return `[${labels.join(", ")}]`;
|
546
|
+
}
|
498
547
|
componentDidLoad() {
|
499
548
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
500
549
|
}
|
@@ -508,7 +557,7 @@ const SnkGuidesViewer = class {
|
|
508
557
|
}
|
509
558
|
this.loadTaskbarProcessor();
|
510
559
|
const showGuides = this._guides && (this._guides.length > 1);
|
511
|
-
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 &&
|
560
|
+
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", title: this.getTitleTooltip() }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
512
561
|
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 ?
|
513
562
|
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) })
|
514
563
|
:
|
@@ -530,6 +579,12 @@ const SnkGuidesViewer = class {
|
|
530
579
|
"masterFormConfig": ["observeMasterFormConfig"]
|
531
580
|
}; }
|
532
581
|
};
|
582
|
+
var TASKBAR_ID;
|
583
|
+
(function (TASKBAR_ID) {
|
584
|
+
TASKBAR_ID["FINISH_EDITION"] = "snkGuideViewer.finish_edition";
|
585
|
+
TASKBAR_ID["MUTIPLE_EDITION"] = "snkGuideViewer.multiple_edition";
|
586
|
+
TASKBAR_ID["REGULAR"] = "snkGuideViewer.regular";
|
587
|
+
})(TASKBAR_ID || (TASKBAR_ID = {}));
|
533
588
|
SnkGuidesViewer.style = snkGuidesViewerCss;
|
534
589
|
|
535
590
|
exports.SnkGuidesViewer = SnkGuidesViewer;
|
@@ -2,7 +2,7 @@
|
|
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-c9e1e97b.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('./SnkFormConfigManager-45a8d7b7.js');
|
@@ -15,7 +15,7 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
15
15
|
require('./constants-77c1b8bd.js');
|
16
16
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
17
17
|
require('./field-search-68e34bf4.js');
|
18
|
-
require('./taskbar-elements-
|
18
|
+
require('./taskbar-elements-02379452.js');
|
19
19
|
require('./index-e3e39724.js');
|
20
20
|
require('./index-102ba62d.js');
|
21
21
|
require('./ISave-c76e2c51.js');
|