@sankhyalabs/sankhyablocks 1.3.31-beta.10 → 1.3.31-beta.12
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-13239761.js +188 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +18 -7
- package/dist/cjs/snk-crud.cjs.entry.js +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +107 -48
- package/dist/cjs/snk-form_2.cjs.entry.js +19 -12
- package/dist/cjs/snk-taskbar.cjs.entry.js +39 -20
- package/dist/cjs/{taskbar-elements-7f99f0c9.js → taskbar-elements-73d524e5.js} +1 -1
- package/dist/collection/components/snk-application/snk-application.js +75 -4
- package/dist/collection/components/snk-crud/snk-crud.css +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +10 -23
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +108 -72
- package/dist/collection/components/snk-form/snk-form.js +20 -32
- package/dist/collection/components/snk-grid/snk-grid.js +4 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +1 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +38 -19
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -5
- package/dist/collection/lib/index.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +119 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +22 -0
- package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +16 -0
- package/dist/components/SnkMessageBuilder.js +166 -0
- package/dist/components/snk-application2.js +20 -7
- package/dist/components/snk-crud.js +3 -4
- package/dist/components/snk-data-unit.js +108 -50
- package/dist/components/snk-form2.js +18 -12
- package/dist/components/snk-grid2.js +1 -1
- package/dist/components/snk-taskbar2.js +39 -20
- package/dist/esm/SnkMessageBuilder-3835f9d8.js +166 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +18 -7
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-data-unit.entry.js +108 -49
- package/dist/esm/snk-form_2.entry.js +19 -12
- package/dist/esm/snk-taskbar.entry.js +39 -20
- package/dist/esm/{taskbar-elements-e0b8a285.js → taskbar-elements-6d01a640.js} +1 -1
- package/dist/sankhyablocks/p-2df33095.entry.js +1 -0
- package/dist/sankhyablocks/{p-c3d20542.entry.js → p-56a32417.entry.js} +1 -1
- package/dist/sankhyablocks/p-72bccbb6.js +1 -0
- package/dist/sankhyablocks/p-962d9bdd.entry.js +69 -0
- package/dist/sankhyablocks/p-9b427c4c.entry.js +1 -0
- package/dist/sankhyablocks/p-bab507ad.entry.js +1 -0
- package/dist/sankhyablocks/p-dd10a5e3.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +14 -4
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +8 -0
- package/dist/types/components.d.ts +15 -20
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +5 -6
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
- package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
- package/package.json +2 -2
- package/dist/sankhyablocks/p-18fe0469.entry.js +0 -69
- package/dist/sankhyablocks/p-5b5afdbe.entry.js +0 -1
- package/dist/sankhyablocks/p-7fe9e5c2.entry.js +0 -1
- package/dist/sankhyablocks/p-8650ae26.entry.js +0 -1
- package/dist/sankhyablocks/p-a5439706.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-6a83ac96.js';
|
|
2
2
|
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException, DependencyType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-3835f9d8.js';
|
|
4
5
|
|
|
5
6
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
7
|
|
|
@@ -6454,7 +6455,7 @@ class UrlUtils {
|
|
|
6454
6455
|
|
|
6455
6456
|
class DataFetcher {
|
|
6456
6457
|
constructor() {
|
|
6457
|
-
this.GRAPHQL_PATH =
|
|
6458
|
+
this.GRAPHQL_PATH = "/mge/graphql";
|
|
6458
6459
|
this.watingRequestsById = new Map();
|
|
6459
6460
|
}
|
|
6460
6461
|
static get() {
|
|
@@ -6510,20 +6511,23 @@ class DataFetcher {
|
|
|
6510
6511
|
resolveURL() {
|
|
6511
6512
|
return UrlUtils.getUrlBase();
|
|
6512
6513
|
}
|
|
6513
|
-
getContext() {
|
|
6514
|
+
getContext(module) {
|
|
6514
6515
|
const urlParams = UrlUtils.getQueryParams(location.search);
|
|
6515
6516
|
return {
|
|
6516
|
-
baseUrl: `${this.resolveURL()}/
|
|
6517
|
+
baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
|
|
6517
6518
|
appName: "SankhyaBlocks",
|
|
6518
6519
|
mgeSession: `${window['skw_session'] || urlParams.mgeSession}`,
|
|
6519
6520
|
globalID: "85C0093DFA240EAB699B4E47A10215BD",
|
|
6521
|
+
//FIXME: Precisamos ajustar para buscar o resourceId pela aplicação
|
|
6520
6522
|
resourceID: "br.com.sankhya.mov.bancaria"
|
|
6521
6523
|
};
|
|
6522
6524
|
}
|
|
6523
6525
|
async callServiceBroker(serviceName, payload) {
|
|
6524
6526
|
return new Promise((accept, reject) => {
|
|
6525
|
-
const
|
|
6526
|
-
const
|
|
6527
|
+
const parts = serviceName.split("@");
|
|
6528
|
+
const [module, name] = parts.length === 2 ? parts : ['mge', serviceName];
|
|
6529
|
+
const ctx = this.getContext(module);
|
|
6530
|
+
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
6527
6531
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6528
6532
|
const http = new XMLHttpRequest();
|
|
6529
6533
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
@@ -7561,11 +7565,17 @@ const SnkApplication = class {
|
|
|
7561
7565
|
async error(title, message, icon, options) {
|
|
7562
7566
|
return ApplicationUtils.error(title, message, icon, options);
|
|
7563
7567
|
}
|
|
7568
|
+
/**
|
|
7569
|
+
* Exibe um diálogo de mensagem comum
|
|
7570
|
+
*/
|
|
7571
|
+
async message(title, message, icon, options) {
|
|
7572
|
+
return ApplicationUtils.message(title, message, icon, options);
|
|
7573
|
+
}
|
|
7564
7574
|
/**
|
|
7565
7575
|
* Exibe um diálogo de confirmação
|
|
7566
7576
|
*/
|
|
7567
|
-
async confirm(title, message, icon,
|
|
7568
|
-
return ApplicationUtils.confirm(title, message, icon,
|
|
7577
|
+
async confirm(title, message, icon, dialogType, options) {
|
|
7578
|
+
return ApplicationUtils.confirm(title, message, icon, dialogType, options);
|
|
7569
7579
|
}
|
|
7570
7580
|
/**
|
|
7571
7581
|
* Mostra uma informação efêmera (de segundo plano).
|
|
@@ -7703,6 +7713,7 @@ const SnkApplication = class {
|
|
|
7703
7713
|
}
|
|
7704
7714
|
componentWillLoad() {
|
|
7705
7715
|
this._errorHandler = new SnkErrorHandler(this);
|
|
7716
|
+
this.messagesBuilder = new SnkMessageBuilder();
|
|
7706
7717
|
ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
|
|
7707
7718
|
ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
|
|
7708
7719
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-6a83ac96.js';
|
|
2
2
|
|
|
3
|
-
const snkCrudCss = ".sc-snk-crud-h{display:flex;height:100%;width:100%}";
|
|
3
|
+
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
4
4
|
|
|
5
5
|
const GRID_MODE = 0;
|
|
6
6
|
const FORM_MODE = 1;
|
|
@@ -51,7 +51,7 @@ const SnkCrud = class {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot",
|
|
54
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, onActionClick: evt => this.executeAction(evt.detail) }))));
|
|
55
55
|
}
|
|
56
56
|
get _element() { return getElement(this); }
|
|
57
57
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-6a83ac96.js';
|
|
2
2
|
import { Action, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
|
+
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { O as OperationMap } from './SnkMessageBuilder-3835f9d8.js';
|
|
4
5
|
|
|
5
6
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
6
7
|
|
|
@@ -21,19 +22,6 @@ const SnkDataUnit = class {
|
|
|
21
22
|
*/
|
|
22
23
|
this.autoLoad = true;
|
|
23
24
|
this._dataUnitObserver = (action) => {
|
|
24
|
-
let msg;
|
|
25
|
-
if (!this.isTransitionAction(action.type)) {
|
|
26
|
-
msg = this.getActionInfo(action.type);
|
|
27
|
-
}
|
|
28
|
-
if (msg) {
|
|
29
|
-
ApplicationUtils.info(msg);
|
|
30
|
-
}
|
|
31
|
-
if (action.type === Action.RECORDS_ADDED || action.type === Action.RECORDS_COPIED) {
|
|
32
|
-
this.insertionMode.emit();
|
|
33
|
-
}
|
|
34
|
-
if (action.type === Action.EDITION_CANCELED) {
|
|
35
|
-
this.cancelEdition.emit();
|
|
36
|
-
}
|
|
37
25
|
const duState = {
|
|
38
26
|
insertionMode: false,
|
|
39
27
|
hasNext: this.dataUnit.hasNext(),
|
|
@@ -50,6 +38,29 @@ const SnkDataUnit = class {
|
|
|
50
38
|
}
|
|
51
39
|
});
|
|
52
40
|
this.dataState = duState;
|
|
41
|
+
if (action.type === Action.DATA_SAVED) {
|
|
42
|
+
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
|
43
|
+
if (msg != undefined) {
|
|
44
|
+
this.showSuccessMessage(msg);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (action.type === Action.RECORDS_ADDED || action.type === Action.RECORDS_COPIED) {
|
|
48
|
+
this.insertionMode.emit();
|
|
49
|
+
}
|
|
50
|
+
if (action.type === Action.EDITION_CANCELED) {
|
|
51
|
+
this.cancelEdition.emit();
|
|
52
|
+
const cancelFinishMsg = this.getMessage("snkDataUnit.cancelInfo");
|
|
53
|
+
if (cancelFinishMsg != undefined) {
|
|
54
|
+
this.showSuccessMessage(cancelFinishMsg);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (action.type === Action.RECORDS_REMOVED) {
|
|
58
|
+
const removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
|
|
59
|
+
if (removeFinishMsg != undefined) {
|
|
60
|
+
this.showSuccessMessage(removeFinishMsg);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
this._application.messagesBuilder.currentOperation = this.getMessageOperation();
|
|
53
64
|
};
|
|
54
65
|
}
|
|
55
66
|
observePageSize() {
|
|
@@ -97,6 +108,32 @@ const SnkDataUnit = class {
|
|
|
97
108
|
async interceptAction(action) {
|
|
98
109
|
return new Promise(resolve => {
|
|
99
110
|
switch (action.type) {
|
|
111
|
+
case Action.RECORDS_ADDED:
|
|
112
|
+
if (this.isAllowed("INSERT")) {
|
|
113
|
+
resolve(action);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenInsert"));
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
case Action.RECORDS_COPIED:
|
|
120
|
+
if (this.isAllowed("CLONE")) {
|
|
121
|
+
resolve(action);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenClone"));
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
case Action.DATA_CHANGED:
|
|
128
|
+
case Action.CHANGING_DATA:
|
|
129
|
+
if (this.isAllowed("UPDATE")) {
|
|
130
|
+
resolve(action);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.dataUnit.cancelEdition();
|
|
134
|
+
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenUpdate"));
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
100
137
|
case Action.SAVING_DATA:
|
|
101
138
|
if (this.beforeSave) {
|
|
102
139
|
const continueAction = this.beforeSave(this.dataUnit);
|
|
@@ -121,52 +158,82 @@ const SnkDataUnit = class {
|
|
|
121
158
|
break;
|
|
122
159
|
case Action.EDITION_CANCELED:
|
|
123
160
|
if (this.dataState.hasDirtyRecords) {
|
|
124
|
-
|
|
125
|
-
|
|
161
|
+
const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
|
|
162
|
+
if (cancelConfirmation == undefined) {
|
|
163
|
+
resolve(action);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
|
|
167
|
+
ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation)
|
|
168
|
+
.then((result) => resolve(result ? action : undefined));
|
|
169
|
+
}
|
|
126
170
|
}
|
|
127
171
|
else {
|
|
128
172
|
resolve(action);
|
|
129
173
|
}
|
|
130
174
|
break;
|
|
131
175
|
case Action.REMOVING_RECORDS:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
176
|
+
if (this.isAllowed("REMOVE")) {
|
|
177
|
+
const removeConfirmation = this.getMessage("snkDataUnit.removeConfirmation");
|
|
178
|
+
if (removeConfirmation == undefined) {
|
|
179
|
+
resolve(action);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
183
|
+
ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.CRITICAL, { btnConfirmDanger: true })
|
|
184
|
+
.then((result) => resolve(result ? action : undefined));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenRemove"));
|
|
135
189
|
}
|
|
136
|
-
ApplicationUtils.confirm(this.i18n("components.delete"), msg || this.i18n("components.confirmRemoveRecord"), "delete", true, { btnConfirmDanger: true })
|
|
137
|
-
.then((result) => resolve(result ? action : undefined));
|
|
138
190
|
break;
|
|
139
191
|
default:
|
|
140
192
|
resolve(action);
|
|
141
193
|
}
|
|
142
194
|
});
|
|
143
195
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
196
|
+
showSuccessMessage(message) {
|
|
197
|
+
ApplicationUtils.info(message, { iconName: "check" });
|
|
198
|
+
}
|
|
199
|
+
isAllowed(flag) {
|
|
200
|
+
return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
204
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
205
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
206
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
|
207
|
+
*/
|
|
208
|
+
getMessage(key, params = undefined) {
|
|
209
|
+
if (!params) {
|
|
210
|
+
params = this.getMessageParams();
|
|
154
211
|
}
|
|
212
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
|
213
|
+
}
|
|
214
|
+
getMessageParams() {
|
|
215
|
+
//TODO: Atualmente ainda não usamos o recurso de multiseleção do dataunit, mas no futuro
|
|
216
|
+
//precisaremos criar um mecanismo para oferecer todos os registros selecionados para a
|
|
217
|
+
//mensagem
|
|
218
|
+
return this.dataState.selectedRecords ? this.dataState.selectedRecords[0] : undefined;
|
|
155
219
|
}
|
|
156
|
-
|
|
157
|
-
if (this.
|
|
158
|
-
return
|
|
220
|
+
getMessageOperation() {
|
|
221
|
+
if (this.dataState.copyMode) {
|
|
222
|
+
return OperationMap.CLONE;
|
|
159
223
|
}
|
|
160
|
-
if (
|
|
161
|
-
return
|
|
224
|
+
if (this.dataState.insertionMode) {
|
|
225
|
+
return OperationMap.INSERT;
|
|
162
226
|
}
|
|
227
|
+
if (this.dataState.isDirty) {
|
|
228
|
+
return OperationMap.UPDATE;
|
|
229
|
+
}
|
|
230
|
+
return OperationMap.CLEAN;
|
|
163
231
|
}
|
|
164
232
|
async loadDataUnit() {
|
|
165
233
|
if (!this.dataUnit) {
|
|
166
|
-
|
|
167
|
-
if (app && this.entityName) {
|
|
234
|
+
if (this._application && this.entityName) {
|
|
168
235
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
|
169
|
-
this.dataUnit = await
|
|
236
|
+
this.dataUnit = await this._application.getDataUnit(this.entityName, cacheName);
|
|
170
237
|
this.dataUnit.pageSize = this.pageSize;
|
|
171
238
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
172
239
|
this.dataUnit.addInterceptor(this);
|
|
@@ -181,20 +248,12 @@ const SnkDataUnit = class {
|
|
|
181
248
|
}
|
|
182
249
|
}
|
|
183
250
|
}
|
|
184
|
-
i18n(key) {
|
|
185
|
-
const pt_br = {
|
|
186
|
-
"components.warning": "Aviso",
|
|
187
|
-
"components.delete": "Excluir",
|
|
188
|
-
"components.confirmRemoveRecord": "Deseja realmente excluir o registro atual?",
|
|
189
|
-
"components.confirmCancelEdition": "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de sair?</b>",
|
|
190
|
-
"components.editionCanceled": "Todas as alterações foram descartadas.",
|
|
191
|
-
};
|
|
192
|
-
return pt_br[key];
|
|
193
|
-
}
|
|
194
251
|
//---------------------------------------------
|
|
195
252
|
// Lifecycle web component
|
|
196
253
|
//---------------------------------------------
|
|
197
254
|
componentWillLoad() {
|
|
255
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
256
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
|
198
257
|
this.loadDataUnit();
|
|
199
258
|
}
|
|
200
259
|
render() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-6a83ac96.js';
|
|
2
2
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
|
3
|
+
import { T as TaskbarElement } from './taskbar-elements-6d01a640.js';
|
|
4
4
|
|
|
5
5
|
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";
|
|
6
6
|
|
|
@@ -52,22 +52,29 @@ const SnkForm = class {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
57
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
58
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
59
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
|
|
60
|
+
*/
|
|
61
|
+
getMessage(key) {
|
|
62
|
+
return this._application.messagesBuilder.getMessage(key, this.getMessageParams());
|
|
63
|
+
}
|
|
64
|
+
getMessageParams() {
|
|
65
|
+
var _a;
|
|
66
|
+
return ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) ? this._dataState.selectedRecords[0] : undefined;
|
|
60
67
|
}
|
|
61
68
|
componentWillLoad() {
|
|
62
|
-
|
|
63
|
-
if (
|
|
64
|
-
|
|
69
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
70
|
+
if (this._application) {
|
|
71
|
+
this._application.loadFormConfig(this.configName).then(cfg => {
|
|
65
72
|
this._configLoaded = true;
|
|
66
73
|
this._editionFormConfig = cfg;
|
|
67
74
|
this.loadInsertionConfig();
|
|
68
75
|
});
|
|
69
76
|
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
70
|
-
|
|
77
|
+
this._application.getAllAccess();
|
|
71
78
|
}
|
|
72
79
|
let parent = this._element.parentElement;
|
|
73
80
|
while (parent) {
|
|
@@ -96,7 +103,7 @@ const SnkForm = class {
|
|
|
96
103
|
if (!this._configLoaded || !this._dataUnit || !this._dataState) {
|
|
97
104
|
return undefined;
|
|
98
105
|
}
|
|
99
|
-
return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.
|
|
106
|
+
return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", buttons: this._dataState.isDirty ? "CANCEL,SAVE" : "PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,INSERT", primaryButton: this._dataState.isDirty ? "SAVE" : "INSERT", disabledButtons: this.getDisabledButtons(), actionsList: this.actionsList, dataUnit: this._dataUnit }))), h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
|
|
100
107
|
}
|
|
101
108
|
get _element() { return getElement(this); }
|
|
102
109
|
};
|
|
@@ -156,7 +163,7 @@ const SnkGrid = class {
|
|
|
156
163
|
if (!this._configLoaded || !this._dataUnit) {
|
|
157
164
|
return undefined;
|
|
158
165
|
}
|
|
159
|
-
return (h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "ez-row ez-padding-bottom--medium ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-col--sd-9 ez-col--tb-9 ez-align--bottom" }, h("slot",
|
|
166
|
+
return (h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "ez-row ez-padding-bottom--medium ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-col--sd-9 ez-col--tb-9 ez-align--bottom" }, h("slot", { name: "SnkGridHeader" })), h("div", { class: "ez-col ez-col--sd-3 ez-col--tb-3 ez-align--right" }, h("snk-taskbar", { onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: "FORM_MODE,CONFIG_GRID,INSERT", primaryButton: "INSERT" }))), h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit() }, h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this.getHeaderButtons(), slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" }))));
|
|
160
167
|
}
|
|
161
168
|
get _element() { return getElement(this); }
|
|
162
169
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-6a83ac96.js';
|
|
2
2
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { A as AuthorizationElements, T as TaskbarElement, b as buildElem } from './taskbar-elements-
|
|
3
|
+
import { A as AuthorizationElements, T as TaskbarElement, b as buildElem } from './taskbar-elements-6d01a640.js';
|
|
4
4
|
|
|
5
5
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
|
6
6
|
|
|
@@ -31,23 +31,42 @@ const SnkTaskbar = class {
|
|
|
31
31
|
}
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
36
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
37
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
38
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-taskbar.msg.ts"
|
|
39
|
+
*/
|
|
34
40
|
getTitle(element) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
switch (element) {
|
|
42
|
+
case TaskbarElement.UPDATE:
|
|
43
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleUpdate", {});
|
|
44
|
+
case TaskbarElement.PREVIOUS:
|
|
45
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titlePrevious", {});
|
|
46
|
+
case TaskbarElement.NEXT:
|
|
47
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleNext", {});
|
|
48
|
+
case TaskbarElement.REFRESH:
|
|
49
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleRefresh", {});
|
|
50
|
+
case TaskbarElement.CLONE:
|
|
51
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleClone", {});
|
|
52
|
+
case TaskbarElement.REMOVE:
|
|
53
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleRemove", {});
|
|
54
|
+
case TaskbarElement.MORE_OPTIONS:
|
|
55
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleMoreOptions", {});
|
|
56
|
+
case TaskbarElement.INSERT:
|
|
57
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleInsert", {});
|
|
58
|
+
case TaskbarElement.CANCEL:
|
|
59
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleCancel", {});
|
|
60
|
+
case TaskbarElement.SAVE:
|
|
61
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleSave", {});
|
|
62
|
+
case TaskbarElement.GRID_MODE:
|
|
63
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleGridMode", {});
|
|
64
|
+
case TaskbarElement.CONFIG_GRID:
|
|
65
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleConfigGrid", {});
|
|
66
|
+
case TaskbarElement.FORM_MODE:
|
|
67
|
+
return this._application.messagesBuilder.getMessage("snkTaskbar.titleFormMode", {});
|
|
68
|
+
}
|
|
69
|
+
return "";
|
|
51
70
|
}
|
|
52
71
|
elementClick(elem) {
|
|
53
72
|
if (this.dataUnit) {
|
|
@@ -94,9 +113,9 @@ const SnkTaskbar = class {
|
|
|
94
113
|
}
|
|
95
114
|
// Lifecycle
|
|
96
115
|
componentWillLoad() {
|
|
97
|
-
|
|
98
|
-
if (
|
|
99
|
-
|
|
116
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
117
|
+
if (this._application) {
|
|
118
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
|
100
119
|
}
|
|
101
120
|
else {
|
|
102
121
|
this._permissions = {};
|
|
@@ -42,7 +42,7 @@ const buildElem = (element, className, getTitle, action, isEnabled, actions) =>
|
|
|
42
42
|
case TaskbarElement.INSERT:
|
|
43
43
|
return iconTextButton("plus", element, className, getTitle, action, isEnabled);
|
|
44
44
|
case TaskbarElement.CANCEL:
|
|
45
|
-
return h("ez-button", { label: getTitle(element), size: "small", enabled: isEnabled(element), onClick: () => action(element) });
|
|
45
|
+
return h("ez-button", { title: getTitle(element), label: getTitle(element), size: "small", enabled: isEnabled(element), onClick: () => action(element) });
|
|
46
46
|
case TaskbarElement.SAVE:
|
|
47
47
|
return iconTextButton("save", element, className, getTitle, action, isEnabled);
|
|
48
48
|
case TaskbarElement.GRID_MODE:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,g as e}from"./p-cd1dc099.js";import{ApplicationContext as a}from"@sankhyalabs/core";import{T as o}from"./p-dd10a5e3.js";const r=class{constructor(s){t(this,s),this.exit=i(this,"exit",7),this.actionClick=i(this,"actionClick",7)}getFormConfig(){return this._dataState&&this._dataState.insertionMode?this._insertionFormConfig:this._editionFormConfig}getInsertionHiddenFields(t){const i=[];return null==t||t.forEach((t=>{const s=this._dataUnit.getField(t.name);(null==s?void 0:s.readOnly)&&i.push(t.name)})),i}exitForm(){this._dataUnit.isDirty()?this._dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}getDisabledButtons(){const t=[];return this._dataState.hasPrevious||t.push("PREVIOUS"),this._dataState.hasNext||t.push("NEXT"),t}loadInsertionConfig(){this._dataUnit&&this._configLoaded&&(this._insertionFormConfig=this._editionFormConfig.filter((t=>{const i=this._dataUnit.getField(t.name);return!(null==i?void 0:i.readOnly)})))}getMessage(t){return this._application.messagesBuilder.getMessage(t,this.getMessageParams())}getMessageParams(){var t;return(null===(t=this._dataState)||void 0===t?void 0:t.selectedRecords)?this._dataState.selectedRecords[0]:void 0}componentWillLoad(){this._application=a.getContextValue("__SNK__APPLICATION__"),this._application&&(this._application.loadFormConfig(this.configName).then((t=>{this._configLoaded=!0,this._editionFormConfig=t,this.loadInsertionConfig()})),this._application.getAllAccess());let t=this._element.parentElement;for(;t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.loadInsertionConfig():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.loadInsertionConfig()})),this._snkDataUnit.addEventListener("dataStateChange",(t=>{this._dataState=t.detail}));break}t=t.parentElement}}render(){if(this._configLoaded&&this._dataUnit&&this._dataState)return s("section",{class:"snk-form"},s("div",{class:"snk-form__header snk-form__header--fixed ez-row"},s("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6",key:"formHeader"},s("ez-button",{title:this.getMessage("snkForm.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small",onClick:()=>this.exitForm()}),s("h1",{class:"ez-title ez-title--primary ez-title--xlarge ez-align--middle"},this.getMessage("snkForm.title"))),s("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right"},s("snk-taskbar",{key:"formTaskbar",buttons:this._dataState.isDirty?"CANCEL,SAVE":"PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,INSERT",primaryButton:this._dataState.isDirty?"SAVE":"INSERT",disabledButtons:this.getDisabledButtons(),actionsList:this.actionsList,dataUnit:this._dataUnit}))),s("section",null,s("div",{class:"ez-row"},s("div",{class:"ez-col ez-col--sd-12"},s("ez-form",{key:"ezForm"+this._snkDataUnit.entityName,dataUnit:this._dataUnit,config:this.getFormConfig(),recordsValidator:this.recordsValidator})))))}get _element(){return e(this)}};r.style=".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";const n=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7),this.gridDoubleClick=i(this,"gridDoubleClick",7)}getHeaderButtons(){return this._dataState&&this._dataState.selectedRecords.length>0?"UPDATE,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,REFRESH":"REFRESH"}actionClickHandler(t){t.detail===o.CONFIG_GRID&&this._grid&&this._grid.openGridConfig()}saveConfig(t){const i=a.getContextValue("__SNK__APPLICATION__");i&&i.saveGridConfig(t)}componentWillLoad(){const t=a.getContextValue("__SNK__APPLICATION__");t&&(t.loadGridConfig(this.configName).then((t=>{this._gridConfig=t,this._configLoaded=!0})),t.getAllAccess());let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit||this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail})),this._snkDataUnit.addEventListener("dataStateChange",(t=>{this._dataState=t.detail}));break}i=i.parentElement}}render(){if(this._configLoaded&&this._dataUnit)return s("div",{class:"ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},s("div",{class:"ez-row ez-padding-bottom--medium ez-margin-bottom--medium"},s("div",{class:"ez-col ez-col--sd-9 ez-col--tb-9 ez-align--bottom"},s("slot",{name:"SnkGridHeader"})),s("div",{class:"ez-col ez-col--sd-3 ez-col--tb-3 ez-align--right"},s("snk-taskbar",{onActionClick:t=>this.actionClickHandler(t),key:"topTaskbar",dataUnit:this._dataUnit,buttons:"FORM_MODE,CONFIG_GRID,INSERT",primaryButton:"INSERT"}))),s("ez-grid",{ref:t=>this._grid=t,dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:t=>{this.saveConfig(t.detail)},onEzDoubleClick:()=>this.gridDoubleClick.emit()},s("snk-taskbar",{dataUnit:this._dataUnit,buttons:this.getHeaderButtons(),slot:"leftButtons",actionsList:this.actionsList})),s("div",{class:"ez-col ez-col--sd-12"},s("slot",{name:"SnkGridFooter"})))}get _element(){return e(this)}};n.style=".sc-snk-grid-h{display:flex;height:100%;width:100%}";export{r as snk_form,n as snk_grid}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,g as s}from"./p-cd1dc099.js";const
|
|
1
|
+
import{r as t,h as i,g as s}from"./p-cd1dc099.js";const e=class{constructor(i){t(this,i)}async gridToForm(t=!1){this._backToGrid=!t&&0===await this._viewStack.getSelectedIndex(),this._viewStack.show(1)}async executeAction(t){"GRID_MODE"===t?this._viewStack.show(0):"FORM_MODE"!==t&&"UPDATE"!==t||this.gridToForm("UPDATE"!==t)}insertionModeHandler(){this.gridToForm()}cancelHandler(){this._backToGrid&&this._viewStack.show(0)}componentWillLoad(){let t=this._element.parentElement;for(;t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit||this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail})),this._snkDataUnit.addEventListener("dataStateChange",(t=>{this._dataState=t.detail}));break}t=t.parentElement}}render(){return i("ez-view-stack",{ref:t=>this._viewStack=t},i("stack-item",null,i("snk-grid",{configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),onActionClick:t=>this.executeAction(t.detail),actionsList:this.actionsList},i("slot",{name:"SnkGridHeader"}),i("slot",{name:"SnkGridFooter"}))),i("stack-item",null,i("snk-form",{configName:this.configName,actionsList:this.actionsList,onExit:()=>this._viewStack.show(0),recordsValidator:this.recordsValidator,onActionClick:t=>this.executeAction(t.detail)})))}get _element(){return s(this)}};e.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{e as snk_crud}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={saveInfo:{clone:"Duplicação realizada!",insert:"Inclusão realizada!",update:"Aleração realizada!"},cancelInfo:{clone:"Duplicação descartada!",insert:"A inclusão descartada!",update:"A edição foi descartada!"},removeInfo:"Registro removido com sucesso!",cancelConfirmationTitle:"Aviso",cancelConfirmation:"As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",removeConfirmationTitle:"Excluir",removeConfirmation:"Deseja realmente excluir o registro atual?",forbiddenUpdate:"Não é possível fazer alterações. Verifique as permissões de acesso.",forbiddenInsert:"Não é possível incluir. Verifique as permissões de acesso.",forbiddenClone:"Não é possível duplicar. Verifique as permissões de acesso.",forbiddenRemove:"Não é possível remover. Verifique as permissões de acesso."},s={title:{clone:"Duplicar registro",insert:"Cadastrar registro",update:"Alterar registro",clean:"{{ENTITY_NAME}}"},goBackTitle:"Voltar"},r={titleUpdate:"Editar",titlePrevious:"Anterior",titleNext:"Próximo",titleRefresh:"Atualizar",titleClone:"Duplicar",titleRemove:"Excluir",titleMoreOptions:"Mais Opções",titleInsert:"Cadastrar",titleCancel:"Cancelar",titleSave:"Salvar",titleGridMode:"Modo Grade",titleConfigGrid:"Configuração da grade",titleFormMode:"Modo Formulário"};class a{constructor(){this._defaults={snkDataUnit:e,snkForm:s,snkTaskbar:r},this._currentOperation=i.CLEAN,this.loadAppMessages().then((e=>{this._appMessages=e}),(e=>{console.info("O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages.js",e)}))}set currentOperation(e){this._currentOperation=e}getMessage(e,s){if(null==e)return;var r=e.split(".");let a=this.resolveMessage(r,this._appMessages);if(null==a&&(a=this.resolveMessage(r,this._defaults)),this.customMessageBuilder){const r=this.customMessageBuilder(e,a,s);a=r.message,s=r.params}return this.postProcess(a,s)}resolveMessage(e,s){if(null==s)return;const r=s[e[0]];return r?this.isOperationSensitive(r)?r[this._currentOperation]:1===e.length||null==r||"string"==typeof r?r:this.resolveMessage(e.slice(1),r):void 0}isOperationSensitive(e){return null!=e[i.CLONE]||null!=e[i.INSERT]||null!=e[i.UPDATE]||null!=e[i.CLEAN]}postProcess(e,s){if(e){const r=/(.*?)\{\{(.+?)\}\}/g;let a,i="",t=e;for(;null!==(a=r.exec(e));){const[r,o,n]=a,l=a.index+r.length;t=l<e.length?e.substring(l):"";let d=s?s[n]:void 0;null==d&&(d=""),i+=o+d}return i+t}return e}loadAppMessages(){return new Promise(((e,s)=>{const r="dev"!==window.applicationenv?`/${window.MGE_MODULE_NAME}/labsApps/${window.APPLICATION_NAME}/messages/appmessages.js`:"/messages/appmessages.js";import(r).then((s=>{e(s.default)})).catch((e=>{s(e)}))}))}}var i;!function(e){e.CLONE="clone",e.INSERT="insert",e.UPDATE="update",e.CLEAN="clean"}(i||(i={}));export{i as O,a as S}
|