@sankhyalabs/sankhyablocks 1.3.31-beta.1 → 1.3.31-beta.11
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/{index-1133bc2a.js → index-c6671817.js} +416 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +283 -108
- package/dist/cjs/snk-crud.cjs.entry.js +64 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +277 -0
- package/dist/cjs/snk-form_2.cjs.entry.js +177 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -3
- package/dist/cjs/snk-taskbar.cjs.entry.js +159 -0
- package/dist/cjs/taskbar-elements-73d524e5.js +70 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +2 -2
- package/dist/collection/components/snk-application/snk-application.js +267 -63
- package/dist/collection/components/snk-crud/snk-crud.css +5 -0
- package/dist/collection/components/snk-crud/snk-crud.js +137 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +528 -0
- package/dist/collection/components/snk-form/snk-form.css +34 -0
- package/dist/collection/components/snk-form/snk-form.js +220 -0
- package/dist/collection/components/snk-grid/snk-grid.css +5 -0
- package/dist/collection/components/snk-grid/snk-grid.js +148 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +56 -13
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +5 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +65 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +271 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +2 -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 +284 -107
- package/dist/components/snk-crud.d.ts +11 -0
- package/dist/components/snk-crud.js +101 -0
- package/dist/components/snk-data-unit.d.ts +11 -0
- package/dist/components/snk-data-unit.js +300 -0
- package/dist/components/snk-form.d.ts +11 -0
- package/dist/components/snk-form.js +6 -0
- package/dist/components/snk-form2.js +140 -0
- package/dist/components/snk-grid.d.ts +11 -0
- package/dist/components/snk-grid.js +6 -0
- package/dist/components/snk-grid2.js +91 -0
- package/dist/components/snk-pesquisa2.js +5 -2
- package/dist/components/snk-taskbar.d.ts +11 -0
- package/dist/components/snk-taskbar.js +6 -0
- package/dist/components/snk-taskbar2.js +240 -0
- package/dist/esm/SnkMessageBuilder-3835f9d8.js +166 -0
- package/dist/esm/{index-ffda6382.js → index-6a83ac96.js} +416 -10
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +283 -108
- package/dist/esm/snk-crud.entry.js +60 -0
- package/dist/esm/snk-data-unit.entry.js +273 -0
- package/dist/esm/snk-form_2.entry.js +172 -0
- package/dist/esm/snk-pesquisa.entry.js +6 -3
- package/dist/esm/snk-taskbar.entry.js +155 -0
- package/dist/esm/taskbar-elements-6d01a640.js +68 -0
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-4c7b32d6.entry.js +1 -0
- package/dist/sankhyablocks/p-5e1b7e51.entry.js +1 -0
- package/dist/sankhyablocks/p-72bccbb6.js +1 -0
- package/dist/sankhyablocks/p-8c74d163.entry.js +1 -0
- package/dist/sankhyablocks/p-bab507ad.entry.js +1 -0
- package/dist/sankhyablocks/p-cd1dc099.js +2 -0
- package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-d25637c9.entry.js} +1 -1
- package/dist/sankhyablocks/p-dd10a5e3.js +1 -0
- package/dist/sankhyablocks/p-e942c604.entry.js +69 -0
- package/dist/sankhyablocks/p-f4d0394b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +109 -15
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +25 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +53 -0
- package/dist/types/components.d.ts +372 -6
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -3
- 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 +5 -5
- package/react/components.d.ts +5 -0
- package/react/components.js +5 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-d62412bb.entry.js +0 -1
- package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
- package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Component, h, Method, Event } from "@stencil/core";
|
|
1
|
+
import { Component, h, Method, Event, Prop } from "@stencil/core";
|
|
2
2
|
import { DataType, ErrorTracking } from "@sankhyalabs/core";
|
|
3
|
+
import { DependencyType } from "@sankhyalabs/core";
|
|
3
4
|
import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/dataunit-fetcher";
|
|
4
5
|
import { DataFetcher } from "../../lib/http/data-fetcher/DataFetcher";
|
|
5
6
|
import UrlUtils from "../../lib/utils/urlutils";
|
|
@@ -10,13 +11,21 @@ import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-con
|
|
|
10
11
|
import { ApplicationContext } from "@sankhyalabs/core";
|
|
11
12
|
import GridConfigFetcher from "../../lib/http/data-fetcher/fetchers/grid-config-fetcher";
|
|
12
13
|
import { PesquisaFetcher } from "../../lib/http/data-fetcher/fetchers/pesquisa-fetcher";
|
|
13
|
-
import { DependencyType } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
|
|
14
14
|
import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
|
|
15
15
|
import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
|
|
16
16
|
import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
|
|
17
17
|
import { agGridLicense } from '../../lib/licenses/sankhyalicense.module';
|
|
18
|
+
import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
|
|
19
|
+
/**
|
|
20
|
+
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
|
21
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
22
|
+
* Para conhecer os detalhes do módulo, vide os arquivos neste projeto "/src/lib/message/resources/*.msg.ts"
|
|
23
|
+
*/
|
|
18
24
|
export class SnkApplication {
|
|
19
25
|
constructor() {
|
|
26
|
+
this._authPromises = [];
|
|
27
|
+
this._duCache = new Map();
|
|
28
|
+
this._duPromises = new Map();
|
|
20
29
|
this._requestListener = new RequestListenerLoadingBar();
|
|
21
30
|
}
|
|
22
31
|
get parameters() {
|
|
@@ -35,18 +44,31 @@ export class SnkApplication {
|
|
|
35
44
|
return this._resourceID;
|
|
36
45
|
}
|
|
37
46
|
get auth() {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
if (this._auth) {
|
|
48
|
+
return Promise.resolve(this._auth);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
const waitingAuth = this._authPromises.length > 0;
|
|
53
|
+
this._authPromises.push(new PendingPromise(resolve, reject));
|
|
54
|
+
if (!waitingAuth) {
|
|
55
|
+
this.authFetcher.getData(this._resourceID).then((authList) => {
|
|
56
|
+
this._auth = authList;
|
|
57
|
+
while (this._authPromises.length > 0) {
|
|
58
|
+
this._authPromises.pop().resolve(this._auth);
|
|
59
|
+
}
|
|
60
|
+
}).catch(error => {
|
|
61
|
+
while (this._authPromises.length > 0) {
|
|
62
|
+
this._authPromises.pop().reject(error);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
49
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Caso o usuário logado seja o SUP.
|
|
71
|
+
*/
|
|
50
72
|
async isUserSup() {
|
|
51
73
|
return new Promise((resolve, reject) => {
|
|
52
74
|
this.auth.then((authorization) => {
|
|
@@ -56,6 +78,9 @@ export class SnkApplication {
|
|
|
56
78
|
});
|
|
57
79
|
});
|
|
58
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Se o usuário logado tem permissão pra determinada ação.
|
|
83
|
+
*/
|
|
59
84
|
async hasAccess(access) {
|
|
60
85
|
return new Promise((resolve, reject) => {
|
|
61
86
|
this.auth.then((authorization) => {
|
|
@@ -65,6 +90,9 @@ export class SnkApplication {
|
|
|
65
90
|
});
|
|
66
91
|
});
|
|
67
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Retorna todos os acessos do usuário logado.
|
|
95
|
+
*/
|
|
68
96
|
async getAllAccess() {
|
|
69
97
|
return new Promise((resolve, reject) => {
|
|
70
98
|
this.auth.then((authorization) => {
|
|
@@ -79,34 +107,54 @@ export class SnkApplication {
|
|
|
79
107
|
});
|
|
80
108
|
});
|
|
81
109
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Retorna o valor de um parâmetro do tipo string.
|
|
112
|
+
*/
|
|
85
113
|
async getStringParam(name) {
|
|
86
114
|
return this.parameters.asString(name, this.resourceID);
|
|
87
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
118
|
+
*/
|
|
88
119
|
async getIntParam(name) {
|
|
89
120
|
return this.parameters.asInteger(name, this.resourceID);
|
|
90
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
124
|
+
*/
|
|
91
125
|
async getFloatParam(name) {
|
|
92
126
|
return this.parameters.asFloat(name, this.resourceID);
|
|
93
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Retorna o valor de um parâmetro do tipo booleano.
|
|
130
|
+
*/
|
|
94
131
|
async getBooleanParam(name) {
|
|
95
132
|
return this.parameters.asBoolean(name, this.resourceID);
|
|
96
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Retorna o valor de um parâmetro do tipo data.
|
|
136
|
+
*/
|
|
97
137
|
async getDateParam(name) {
|
|
98
138
|
return this.parameters.asDate(name, this.resourceID);
|
|
99
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Mostra o conteúdo passado em um Popup
|
|
142
|
+
*/
|
|
100
143
|
async showPopUp(content) {
|
|
144
|
+
this.clearPopUpContent();
|
|
101
145
|
this._popUp.appendChild(content);
|
|
102
|
-
this._popUp
|
|
146
|
+
this._popUp.opened = true;
|
|
103
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Fecha o popup, liberando o conteúdo.
|
|
150
|
+
*/
|
|
104
151
|
async closePopUp() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
-
this._popUp["opened"] = false;
|
|
152
|
+
this.clearPopUpContent();
|
|
153
|
+
this._popUp.opened = false;
|
|
109
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
157
|
+
*/
|
|
110
158
|
async temOpcional(opcional) {
|
|
111
159
|
const opts = opcional.split(",");
|
|
112
160
|
return new Promise((resolve, reject) => {
|
|
@@ -130,6 +178,10 @@ export class SnkApplication {
|
|
|
130
178
|
});
|
|
131
179
|
});
|
|
132
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Retorna a configuração de um recurso por service broker
|
|
183
|
+
* Veja também o método "loadConfig"
|
|
184
|
+
*/
|
|
133
185
|
async getConfig(key) {
|
|
134
186
|
let payload = {
|
|
135
187
|
"serviceName": "SystemUtilsSP.getConf",
|
|
@@ -147,6 +199,9 @@ export class SnkApplication {
|
|
|
147
199
|
.catch(error => reject(error));
|
|
148
200
|
});
|
|
149
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Salva a configuração de determinado recurso.
|
|
204
|
+
*/
|
|
150
205
|
async saveConfig(key, data) {
|
|
151
206
|
let payload = {
|
|
152
207
|
"serviceName": "SystemUtilsSP.saveConf",
|
|
@@ -165,42 +220,122 @@ export class SnkApplication {
|
|
|
165
220
|
.catch(error => reject(error));
|
|
166
221
|
});
|
|
167
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
225
|
+
*/
|
|
168
226
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
169
227
|
return Promise.resolve(window[attribName]);
|
|
170
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Abre determinada tela, repassando pkObject
|
|
231
|
+
*/
|
|
171
232
|
async openApp(resourceId, pkObject) {
|
|
172
233
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
173
234
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
235
|
+
getDuPromissesStack(dataUnitName) {
|
|
236
|
+
let stack;
|
|
237
|
+
if (dataUnitName) {
|
|
238
|
+
stack = this._duPromises.get(dataUnitName);
|
|
239
|
+
if (!stack) {
|
|
240
|
+
stack = [];
|
|
241
|
+
this._duPromises.set(dataUnitName, stack);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return stack || [];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
|
248
|
+
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado
|
|
249
|
+
*/
|
|
250
|
+
async createDataunit(entityName, dataUnitName) {
|
|
251
|
+
return new Promise((resolve, reject) => {
|
|
252
|
+
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
|
253
|
+
const waitingDu = duPromisses.length > 0;
|
|
254
|
+
duPromisses.push(new PendingPromise(resolve, reject));
|
|
255
|
+
if (!waitingDu) {
|
|
256
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
257
|
+
dataUnit.loadMetadata().then(() => {
|
|
258
|
+
if (dataUnitName) {
|
|
259
|
+
this._duCache.set(dataUnitName, dataUnit);
|
|
260
|
+
}
|
|
261
|
+
while (duPromisses.length > 0) {
|
|
262
|
+
duPromisses.pop().resolve(dataUnit);
|
|
263
|
+
}
|
|
264
|
+
}).catch(reason => {
|
|
265
|
+
while (duPromisses.length > 0) {
|
|
266
|
+
duPromisses.pop().reject(reason);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
178
270
|
});
|
|
179
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
|
274
|
+
*/
|
|
275
|
+
async getDataUnit(entityName, dataUnitName) {
|
|
276
|
+
return new Promise((resolve, reject) => {
|
|
277
|
+
const dataUnit = this._duCache.get(dataUnitName);
|
|
278
|
+
if (dataUnit) {
|
|
279
|
+
resolve(dataUnit);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
this.createDataunit(entityName, dataUnitName).then(dataUnit => {
|
|
283
|
+
resolve(dataUnit);
|
|
284
|
+
}).catch(reason => reject(reason));
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Retorna o resourceID da tela em questão.
|
|
290
|
+
*/
|
|
180
291
|
async getResourceID() {
|
|
181
292
|
return Promise.resolve(this.resourceID);
|
|
182
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
296
|
+
*/
|
|
183
297
|
async alert(title, message, icon, options) {
|
|
184
298
|
return ApplicationUtils.alert(title, message, icon, options);
|
|
185
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
302
|
+
*/
|
|
186
303
|
async error(title, message, icon, options) {
|
|
187
304
|
return ApplicationUtils.error(title, message, icon, options);
|
|
188
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Exibe um diálogo de confirmação
|
|
308
|
+
*/
|
|
189
309
|
async confirm(title, message, icon, critical, options) {
|
|
190
310
|
return ApplicationUtils.confirm(title, message, icon, critical, options);
|
|
191
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Mostra uma informação efêmera (de segundo plano).
|
|
314
|
+
*/
|
|
192
315
|
async info(message, options) {
|
|
193
316
|
return ApplicationUtils.info(message, options);
|
|
194
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Busca a configuração de formulário.
|
|
320
|
+
*/
|
|
195
321
|
async loadFormConfig(name) {
|
|
196
322
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
197
323
|
}
|
|
198
|
-
|
|
199
|
-
|
|
324
|
+
/**
|
|
325
|
+
* Busca a configuração de grade.
|
|
326
|
+
*/
|
|
327
|
+
async loadGridConfig(name) {
|
|
328
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
200
329
|
}
|
|
330
|
+
/**
|
|
331
|
+
* Salva a configuração de grade.
|
|
332
|
+
*/
|
|
201
333
|
async saveGridConfig(config) {
|
|
202
334
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
203
335
|
}
|
|
336
|
+
async getAuthList(_auth) {
|
|
337
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
338
|
+
}
|
|
204
339
|
get urlParams() {
|
|
205
340
|
if (!this._urlParams) {
|
|
206
341
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -280,7 +415,7 @@ export class SnkApplication {
|
|
|
280
415
|
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
|
|
281
416
|
pesquisaContent.selectItem = (option) => {
|
|
282
417
|
accept(option);
|
|
283
|
-
this.
|
|
418
|
+
this.clearPopUpTitle();
|
|
284
419
|
this.closePopUp();
|
|
285
420
|
};
|
|
286
421
|
this.setPopUpTitle(DESCRIPTIONENTITY);
|
|
@@ -297,14 +432,22 @@ export class SnkApplication {
|
|
|
297
432
|
accept(window['isDebugMode']);
|
|
298
433
|
});
|
|
299
434
|
}
|
|
300
|
-
|
|
301
|
-
this._popUp
|
|
435
|
+
clearPopUpContent() {
|
|
436
|
+
if (this._popUp) {
|
|
437
|
+
Array.from(this._popUp.children).forEach(c => {
|
|
438
|
+
this._popUp.removeChild(c);
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
clearPopUpTitle() {
|
|
443
|
+
this._popUp.ezTitle = "";
|
|
302
444
|
}
|
|
303
445
|
setPopUpTitle(title) {
|
|
304
|
-
this._popUp
|
|
446
|
+
this._popUp.ezTitle = title;
|
|
305
447
|
}
|
|
306
448
|
componentWillLoad() {
|
|
307
449
|
this._errorHandler = new SnkErrorHandler(this);
|
|
450
|
+
this.messagesBuilder = new SnkMessageBuilder();
|
|
308
451
|
ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
|
|
309
452
|
ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
|
|
310
453
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
@@ -313,6 +456,7 @@ export class SnkApplication {
|
|
|
313
456
|
ErrorTracking.init();
|
|
314
457
|
}
|
|
315
458
|
connectedCallback() {
|
|
459
|
+
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
316
460
|
DataFetcher.addRequestListener(this._requestListener);
|
|
317
461
|
}
|
|
318
462
|
disconnectedCallback() {
|
|
@@ -337,6 +481,28 @@ export class SnkApplication {
|
|
|
337
481
|
static get styleUrls() { return {
|
|
338
482
|
"$": ["snk-application.css"]
|
|
339
483
|
}; }
|
|
484
|
+
static get properties() { return {
|
|
485
|
+
"messagesBuilder": {
|
|
486
|
+
"type": "unknown",
|
|
487
|
+
"mutable": true,
|
|
488
|
+
"complexType": {
|
|
489
|
+
"original": "SnkMessageBuilder",
|
|
490
|
+
"resolved": "SnkMessageBuilder",
|
|
491
|
+
"references": {
|
|
492
|
+
"SnkMessageBuilder": {
|
|
493
|
+
"location": "import",
|
|
494
|
+
"path": "../../lib/message/SnkMessageBuilder"
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
"required": false,
|
|
499
|
+
"optional": false,
|
|
500
|
+
"docs": {
|
|
501
|
+
"tags": [],
|
|
502
|
+
"text": "messagesBuilder \u00E9 um utilit\u00E1rio respons\u00E1vel por flexibilizar e padronizar\no uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}; }
|
|
340
506
|
static get events() { return [{
|
|
341
507
|
"method": "applicationLoaded",
|
|
342
508
|
"name": "applicationLoaded",
|
|
@@ -360,7 +526,7 @@ export class SnkApplication {
|
|
|
360
526
|
"composed": true,
|
|
361
527
|
"docs": {
|
|
362
528
|
"tags": [],
|
|
363
|
-
"text": "Evento"
|
|
529
|
+
"text": "Evento disparado ao iniciar a carga do componente"
|
|
364
530
|
},
|
|
365
531
|
"complexType": {
|
|
366
532
|
"original": "boolean",
|
|
@@ -381,7 +547,7 @@ export class SnkApplication {
|
|
|
381
547
|
"return": "Promise<boolean>"
|
|
382
548
|
},
|
|
383
549
|
"docs": {
|
|
384
|
-
"text": "",
|
|
550
|
+
"text": "Caso o usu\u00E1rio logado seja o SUP.",
|
|
385
551
|
"tags": []
|
|
386
552
|
}
|
|
387
553
|
},
|
|
@@ -404,7 +570,7 @@ export class SnkApplication {
|
|
|
404
570
|
"return": "Promise<boolean>"
|
|
405
571
|
},
|
|
406
572
|
"docs": {
|
|
407
|
-
"text": "",
|
|
573
|
+
"text": "Se o usu\u00E1rio logado tem permiss\u00E3o pra determinada a\u00E7\u00E3o.",
|
|
408
574
|
"tags": []
|
|
409
575
|
}
|
|
410
576
|
},
|
|
@@ -420,7 +586,7 @@ export class SnkApplication {
|
|
|
420
586
|
"return": "Promise<any>"
|
|
421
587
|
},
|
|
422
588
|
"docs": {
|
|
423
|
-
"text": "",
|
|
589
|
+
"text": "Retorna todos os acessos do usu\u00E1rio logado.",
|
|
424
590
|
"tags": []
|
|
425
591
|
}
|
|
426
592
|
},
|
|
@@ -439,7 +605,7 @@ export class SnkApplication {
|
|
|
439
605
|
"return": "Promise<string>"
|
|
440
606
|
},
|
|
441
607
|
"docs": {
|
|
442
|
-
"text": "",
|
|
608
|
+
"text": "Retorna o valor de um par\u00E2metro do tipo string.",
|
|
443
609
|
"tags": []
|
|
444
610
|
}
|
|
445
611
|
},
|
|
@@ -458,7 +624,7 @@ export class SnkApplication {
|
|
|
458
624
|
"return": "Promise<number>"
|
|
459
625
|
},
|
|
460
626
|
"docs": {
|
|
461
|
-
"text": "",
|
|
627
|
+
"text": "Retorna o valor de um par\u00E2metro do tipo Inteiro.",
|
|
462
628
|
"tags": []
|
|
463
629
|
}
|
|
464
630
|
},
|
|
@@ -477,7 +643,7 @@ export class SnkApplication {
|
|
|
477
643
|
"return": "Promise<number>"
|
|
478
644
|
},
|
|
479
645
|
"docs": {
|
|
480
|
-
"text": "",
|
|
646
|
+
"text": "Retorna o valor de um par\u00E2metro do tipo Decimal.",
|
|
481
647
|
"tags": []
|
|
482
648
|
}
|
|
483
649
|
},
|
|
@@ -496,7 +662,7 @@ export class SnkApplication {
|
|
|
496
662
|
"return": "Promise<boolean>"
|
|
497
663
|
},
|
|
498
664
|
"docs": {
|
|
499
|
-
"text": "",
|
|
665
|
+
"text": "Retorna o valor de um par\u00E2metro do tipo booleano.",
|
|
500
666
|
"tags": []
|
|
501
667
|
}
|
|
502
668
|
},
|
|
@@ -518,7 +684,7 @@ export class SnkApplication {
|
|
|
518
684
|
"return": "Promise<Date>"
|
|
519
685
|
},
|
|
520
686
|
"docs": {
|
|
521
|
-
"text": "",
|
|
687
|
+
"text": "Retorna o valor de um par\u00E2metro do tipo data.",
|
|
522
688
|
"tags": []
|
|
523
689
|
}
|
|
524
690
|
},
|
|
@@ -540,7 +706,7 @@ export class SnkApplication {
|
|
|
540
706
|
"return": "Promise<void>"
|
|
541
707
|
},
|
|
542
708
|
"docs": {
|
|
543
|
-
"text": "",
|
|
709
|
+
"text": "Mostra o conte\u00FAdo passado em um Popup",
|
|
544
710
|
"tags": []
|
|
545
711
|
}
|
|
546
712
|
},
|
|
@@ -556,7 +722,7 @@ export class SnkApplication {
|
|
|
556
722
|
"return": "Promise<void>"
|
|
557
723
|
},
|
|
558
724
|
"docs": {
|
|
559
|
-
"text": "",
|
|
725
|
+
"text": "Fecha o popup, liberando o conte\u00FAdo.",
|
|
560
726
|
"tags": []
|
|
561
727
|
}
|
|
562
728
|
},
|
|
@@ -575,7 +741,7 @@ export class SnkApplication {
|
|
|
575
741
|
"return": "Promise<boolean>"
|
|
576
742
|
},
|
|
577
743
|
"docs": {
|
|
578
|
-
"text": "",
|
|
744
|
+
"text": "Verifica se a licen\u00E7a do cliente tem determinado opcional (produto)",
|
|
579
745
|
"tags": []
|
|
580
746
|
}
|
|
581
747
|
},
|
|
@@ -594,7 +760,7 @@ export class SnkApplication {
|
|
|
594
760
|
"return": "Promise<any>"
|
|
595
761
|
},
|
|
596
762
|
"docs": {
|
|
597
|
-
"text": "",
|
|
763
|
+
"text": "Retorna a configura\u00E7\u00E3o de um recurso por service broker\nVeja tamb\u00E9m o m\u00E9todo \"loadConfig\"",
|
|
598
764
|
"tags": []
|
|
599
765
|
}
|
|
600
766
|
},
|
|
@@ -619,7 +785,7 @@ export class SnkApplication {
|
|
|
619
785
|
"return": "Promise<any>"
|
|
620
786
|
},
|
|
621
787
|
"docs": {
|
|
622
|
-
"text": "",
|
|
788
|
+
"text": "Salva a configura\u00E7\u00E3o de determinado recurso.",
|
|
623
789
|
"tags": []
|
|
624
790
|
}
|
|
625
791
|
},
|
|
@@ -638,7 +804,7 @@ export class SnkApplication {
|
|
|
638
804
|
"return": "Promise<string>"
|
|
639
805
|
},
|
|
640
806
|
"docs": {
|
|
641
|
-
"text": "",
|
|
807
|
+
"text": "Acessa informa\u00E7\u00F5es de contexto \"empurrados\" na abertura da tela",
|
|
642
808
|
"tags": []
|
|
643
809
|
}
|
|
644
810
|
},
|
|
@@ -663,16 +829,19 @@ export class SnkApplication {
|
|
|
663
829
|
"return": "Promise<void>"
|
|
664
830
|
},
|
|
665
831
|
"docs": {
|
|
666
|
-
"text": "",
|
|
832
|
+
"text": "Abre determinada tela, repassando pkObject",
|
|
667
833
|
"tags": []
|
|
668
834
|
}
|
|
669
835
|
},
|
|
670
836
|
"createDataunit": {
|
|
671
837
|
"complexType": {
|
|
672
|
-
"signature": "(entityName: string) => Promise<DataUnit>",
|
|
838
|
+
"signature": "(entityName: string, dataUnitName?: string) => Promise<DataUnit>",
|
|
673
839
|
"parameters": [{
|
|
674
840
|
"tags": [],
|
|
675
841
|
"text": ""
|
|
842
|
+
}, {
|
|
843
|
+
"tags": [],
|
|
844
|
+
"text": ""
|
|
676
845
|
}],
|
|
677
846
|
"references": {
|
|
678
847
|
"Promise": {
|
|
@@ -686,7 +855,33 @@ export class SnkApplication {
|
|
|
686
855
|
"return": "Promise<DataUnit>"
|
|
687
856
|
},
|
|
688
857
|
"docs": {
|
|
689
|
-
"text": "",
|
|
858
|
+
"text": "Cria o DataUnit a partir do nome da entidade. \u00C9 poss\u00EDvel armazen\u00E1-lo no cache\npassando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit ser\u00E1 usado",
|
|
859
|
+
"tags": []
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
"getDataUnit": {
|
|
863
|
+
"complexType": {
|
|
864
|
+
"signature": "(entityName: string, dataUnitName: string) => Promise<DataUnit>",
|
|
865
|
+
"parameters": [{
|
|
866
|
+
"tags": [],
|
|
867
|
+
"text": ""
|
|
868
|
+
}, {
|
|
869
|
+
"tags": [],
|
|
870
|
+
"text": ""
|
|
871
|
+
}],
|
|
872
|
+
"references": {
|
|
873
|
+
"Promise": {
|
|
874
|
+
"location": "global"
|
|
875
|
+
},
|
|
876
|
+
"DataUnit": {
|
|
877
|
+
"location": "import",
|
|
878
|
+
"path": "@sankhyalabs/core"
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
"return": "Promise<DataUnit>"
|
|
882
|
+
},
|
|
883
|
+
"docs": {
|
|
884
|
+
"text": "Obtem um DataUnit do cache ou cria um caso ainda n\u00E3o tenha sido criado.",
|
|
690
885
|
"tags": []
|
|
691
886
|
}
|
|
692
887
|
},
|
|
@@ -702,7 +897,7 @@ export class SnkApplication {
|
|
|
702
897
|
"return": "Promise<string>"
|
|
703
898
|
},
|
|
704
899
|
"docs": {
|
|
705
|
-
"text": "",
|
|
900
|
+
"text": "Retorna o resourceID da tela em quest\u00E3o.",
|
|
706
901
|
"tags": []
|
|
707
902
|
}
|
|
708
903
|
},
|
|
@@ -734,7 +929,7 @@ export class SnkApplication {
|
|
|
734
929
|
"return": "Promise<boolean>"
|
|
735
930
|
},
|
|
736
931
|
"docs": {
|
|
737
|
-
"text": "",
|
|
932
|
+
"text": "Mostra o di\u00E1logo de alerta de acordo com os par\u00E2metros passados.",
|
|
738
933
|
"tags": []
|
|
739
934
|
}
|
|
740
935
|
},
|
|
@@ -766,7 +961,7 @@ export class SnkApplication {
|
|
|
766
961
|
"return": "Promise<boolean>"
|
|
767
962
|
},
|
|
768
963
|
"docs": {
|
|
769
|
-
"text": "",
|
|
964
|
+
"text": "Mostra o di\u00E1logo de erro de acordo com os par\u00E2metros passados.",
|
|
770
965
|
"tags": []
|
|
771
966
|
}
|
|
772
967
|
},
|
|
@@ -801,7 +996,7 @@ export class SnkApplication {
|
|
|
801
996
|
"return": "Promise<boolean>"
|
|
802
997
|
},
|
|
803
998
|
"docs": {
|
|
804
|
-
"text": "",
|
|
999
|
+
"text": "Exibe um di\u00E1logo de confirma\u00E7\u00E3o",
|
|
805
1000
|
"tags": []
|
|
806
1001
|
}
|
|
807
1002
|
},
|
|
@@ -827,7 +1022,7 @@ export class SnkApplication {
|
|
|
827
1022
|
"return": "Promise<void>"
|
|
828
1023
|
},
|
|
829
1024
|
"docs": {
|
|
830
|
-
"text": "",
|
|
1025
|
+
"text": "Mostra uma informa\u00E7\u00E3o ef\u00EAmera (de segundo plano).",
|
|
831
1026
|
"tags": []
|
|
832
1027
|
}
|
|
833
1028
|
},
|
|
@@ -853,33 +1048,36 @@ export class SnkApplication {
|
|
|
853
1048
|
"return": "Promise<FieldConfig[]>"
|
|
854
1049
|
},
|
|
855
1050
|
"docs": {
|
|
856
|
-
"text": "",
|
|
1051
|
+
"text": "Busca a configura\u00E7\u00E3o de formul\u00E1rio.",
|
|
857
1052
|
"tags": []
|
|
858
1053
|
}
|
|
859
1054
|
},
|
|
860
1055
|
"loadGridConfig": {
|
|
861
1056
|
"complexType": {
|
|
862
|
-
"signature": "() => Promise<
|
|
863
|
-
"parameters": [
|
|
1057
|
+
"signature": "(name: string) => Promise<IGridConfig>",
|
|
1058
|
+
"parameters": [{
|
|
1059
|
+
"tags": [],
|
|
1060
|
+
"text": ""
|
|
1061
|
+
}],
|
|
864
1062
|
"references": {
|
|
865
1063
|
"Promise": {
|
|
866
1064
|
"location": "global"
|
|
867
1065
|
},
|
|
868
|
-
"
|
|
1066
|
+
"IGridConfig": {
|
|
869
1067
|
"location": "import",
|
|
870
1068
|
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
|
|
871
1069
|
}
|
|
872
1070
|
},
|
|
873
|
-
"return": "Promise<
|
|
1071
|
+
"return": "Promise<IGridConfig>"
|
|
874
1072
|
},
|
|
875
1073
|
"docs": {
|
|
876
|
-
"text": "",
|
|
1074
|
+
"text": "Busca a configura\u00E7\u00E3o de grade.",
|
|
877
1075
|
"tags": []
|
|
878
1076
|
}
|
|
879
1077
|
},
|
|
880
1078
|
"saveGridConfig": {
|
|
881
1079
|
"complexType": {
|
|
882
|
-
"signature": "(config:
|
|
1080
|
+
"signature": "(config: IGridConfig) => Promise<boolean>",
|
|
883
1081
|
"parameters": [{
|
|
884
1082
|
"tags": [],
|
|
885
1083
|
"text": ""
|
|
@@ -888,7 +1086,7 @@ export class SnkApplication {
|
|
|
888
1086
|
"Promise": {
|
|
889
1087
|
"location": "global"
|
|
890
1088
|
},
|
|
891
|
-
"
|
|
1089
|
+
"IGridConfig": {
|
|
892
1090
|
"location": "import",
|
|
893
1091
|
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
|
|
894
1092
|
}
|
|
@@ -896,7 +1094,7 @@ export class SnkApplication {
|
|
|
896
1094
|
"return": "Promise<boolean>"
|
|
897
1095
|
},
|
|
898
1096
|
"docs": {
|
|
899
|
-
"text": "",
|
|
1097
|
+
"text": "Salva a configura\u00E7\u00E3o de grade.",
|
|
900
1098
|
"tags": []
|
|
901
1099
|
}
|
|
902
1100
|
},
|
|
@@ -984,3 +1182,9 @@ class RequestListenerLoadingBar {
|
|
|
984
1182
|
}
|
|
985
1183
|
;
|
|
986
1184
|
}
|
|
1185
|
+
class PendingPromise {
|
|
1186
|
+
constructor(resolve, reject) {
|
|
1187
|
+
this.resolve = resolve;
|
|
1188
|
+
this.reject = reject;
|
|
1189
|
+
}
|
|
1190
|
+
}
|