@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-74224.0 → 0.0.0-bugfix-dev-KB-75070.0
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/{ConfigStorage-ecc0ed20.js → ConfigStorage-f079f5fd.js} +2 -2
- package/dist/cjs/{ContinuousInsertUtils-29b65619.js → ContinuousInsertUtils-64e47516.js} +29 -20
- package/dist/cjs/{DataFetcher-cadeef8e.js → DataFetcher-e059eb72.js} +7 -5
- package/dist/cjs/{SnkFormConfigManager-f1c92f79.js → SnkFormConfigManager-63369164.js} +2 -2
- package/dist/cjs/{auth-fetcher-d68841bc.js → auth-fetcher-4f853233.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-f89461c1.js → dataunit-fetcher-228016f4.js} +3 -3
- package/dist/cjs/{form-config-fetcher-ed497282.js → form-config-fetcher-39397ac5.js} +1 -1
- package/dist/cjs/index-f9e81701.js +8 -28
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-ca89181c.js → pesquisa-fetcher-a9bfeb22.js} +7 -2
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +6 -6
- package/dist/cjs/snk-application.cjs.entry.js +111 -59
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +365 -3
- package/dist/cjs/snk-crud.cjs.entry.js +13 -7
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-668dc5e8.js → snk-data-unit-3d9b6ed4.js} +26 -14
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
- package/dist/cjs/{snk-filter-bar.cjs.entry.js → snk-filter-bar_4.cjs.entry.js} +691 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +16 -8
- package/dist/cjs/{snk-guides-viewer-4236cb9d.js → snk-guides-viewer-eee43c8b.js} +8 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +45 -10
- package/dist/cjs/snk-taskbar.cjs.entry.js +37 -35
- package/dist/collection/collection-manifest.json +11 -31
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +1 -1
- package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +28 -0
- package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +16 -0
- package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +52 -0
- package/dist/collection/components/snk-application/snk-application.js +44 -54
- package/dist/collection/components/snk-crud/snk-crud.js +26 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +3 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +25 -13
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +18 -0
- package/dist/collection/components/snk-grid/snk-grid.js +28 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +57 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +38 -36
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -6
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +6 -1
- package/dist/collection/lib/utils/CrudUtils.js +25 -16
- package/dist/collection/sw.js +46 -0
- package/dist/components/ContinuousInsertUtils.js +25 -16
- package/dist/components/DataFetcher.js +7 -5
- package/dist/components/dataunit-fetcher.js +2 -2
- package/dist/components/pesquisa-fetcher.js +6 -1
- package/dist/components/snk-actions-button2.js +1 -1
- package/dist/components/snk-application2.js +107 -54
- package/dist/components/snk-crud.js +9 -2
- package/dist/components/snk-data-unit2.js +25 -13
- package/dist/components/snk-detail-view2.js +3 -0
- package/dist/components/snk-filter-bar2.js +4 -0
- package/dist/components/snk-grid2.js +11 -2
- package/dist/components/snk-simple-crud2.js +40 -4
- package/dist/components/snk-taskbar2.js +38 -36
- package/dist/esm/{ConfigStorage-7b36d041.js → ConfigStorage-6514d66e.js} +2 -2
- package/dist/esm/{ContinuousInsertUtils-30caa626.js → ContinuousInsertUtils-b62906f9.js} +29 -20
- package/dist/esm/{DataFetcher-a9c598f2.js → DataFetcher-5034df59.js} +7 -5
- package/dist/esm/{SnkFormConfigManager-139f09fa.js → SnkFormConfigManager-b409c745.js} +3 -3
- package/dist/esm/{auth-fetcher-749d880f.js → auth-fetcher-ca5d3a49.js} +1 -1
- package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
- package/dist/esm/{dataunit-fetcher-c24c76c6.js → dataunit-fetcher-56cb648b.js} +3 -3
- package/dist/esm/{form-config-fetcher-adbe5d34.js → form-config-fetcher-a7d3e277.js} +1 -1
- package/dist/esm/index-a7d3d3f1.js +8 -28
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-8edaa8cd.js → pesquisa-fetcher-6bc2e41a.js} +7 -2
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +7 -7
- package/dist/esm/snk-application.entry.js +111 -59
- package/dist/esm/snk-attach.entry.js +6 -6
- package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +366 -6
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +14 -8
- package/dist/esm/snk-data-exporter.entry.js +6 -6
- package/dist/esm/{snk-data-unit-0fdfb6c2.js → snk-data-unit-9fa7d2b9.js} +26 -14
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +8 -8
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/{snk-filter-bar.entry.js → snk-filter-bar_4.entry.js} +690 -5
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +16 -8
- package/dist/esm/{snk-guides-viewer-8934c537.js → snk-guides-viewer-e8ca764a.js} +9 -6
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +47 -12
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +38 -36
- package/dist/sankhyablocks/{p-f3434fc4.js → p-00278e07.js} +1 -1
- package/dist/sankhyablocks/{p-b9c67e45.entry.js → p-0d2a2e9e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-afbb070d.js → p-0e206e62.js} +1 -1
- package/dist/sankhyablocks/{p-06421fdb.js → p-126c58ea.js} +1 -1
- package/dist/sankhyablocks/p-200a5481.entry.js +11 -0
- package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
- package/dist/sankhyablocks/p-30ebcbe0.entry.js +1 -0
- package/dist/sankhyablocks/{p-1bf06cd3.js → p-341465ce.js} +2 -2
- package/dist/sankhyablocks/p-342eeb3b.js +1 -0
- package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
- package/dist/sankhyablocks/p-42130213.entry.js +1 -0
- package/dist/sankhyablocks/{p-be5d8fcb.entry.js → p-43353d86.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7ac7932c.js → p-47d24ac8.js} +2 -2
- package/dist/sankhyablocks/p-520c7c38.entry.js +1 -0
- package/dist/sankhyablocks/{p-430e4d3c.entry.js → p-7075b789.entry.js} +1 -1
- package/dist/sankhyablocks/p-83e71703.entry.js +1 -0
- package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
- package/dist/sankhyablocks/{p-4d9549cf.js → p-9ffd9fc7.js} +1 -1
- package/dist/sankhyablocks/{p-dcead955.entry.js → p-a2c790ac.entry.js} +1 -1
- package/dist/sankhyablocks/p-a3fadd0b.entry.js +1 -0
- package/dist/sankhyablocks/{p-212213d9.entry.js → p-aa003d4e.entry.js} +1 -1
- package/dist/sankhyablocks/p-aaf94476.js +1 -0
- package/dist/sankhyablocks/p-ac26df7a.entry.js +1 -0
- package/dist/sankhyablocks/{p-4f35399c.entry.js → p-af7f7b3e.entry.js} +1 -1
- package/dist/sankhyablocks/p-c51ad0e7.entry.js +1 -0
- package/dist/sankhyablocks/{p-16869f77.js → p-e3a285a2.js} +1 -1
- package/dist/sankhyablocks/p-e4391e16.js +1 -0
- package/dist/sankhyablocks/{p-fb34e0cf.entry.js → p-fca0e5cc.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +11 -0
- package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +12 -0
- package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +13 -0
- package/dist/types/components/snk-application/snk-application.d.ts +9 -13
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +2 -0
- package/dist/types/components.d.ts +30 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/dist/types/lib/utils/CrudUtils.d.ts +1 -0
- package/package.json +3 -2
- package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
- package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
- package/dist/cjs/snk-form.cjs.entry.js +0 -144
- package/dist/esm/snk-config-options.entry.js +0 -235
- package/dist/esm/snk-filter-item.entry.js +0 -308
- package/dist/esm/snk-filter-list.entry.js +0 -148
- package/dist/esm/snk-filter-modal.entry.js +0 -245
- package/dist/esm/snk-form.entry.js +0 -140
- package/dist/sankhyablocks/p-01086ff7.entry.js +0 -1
- package/dist/sankhyablocks/p-2923c1b5.js +0 -1
- package/dist/sankhyablocks/p-2aae03a1.entry.js +0 -1
- package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
- package/dist/sankhyablocks/p-5dd8cf4f.js +0 -1
- package/dist/sankhyablocks/p-60b29483.entry.js +0 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
- package/dist/sankhyablocks/p-92eadb1c.entry.js +0 -1
- package/dist/sankhyablocks/p-a42e7a1e.entry.js +0 -11
- package/dist/sankhyablocks/p-a724e798.entry.js +0 -1
- package/dist/sankhyablocks/p-a75d242d.entry.js +0 -1
- package/dist/sankhyablocks/p-b9679243.entry.js +0 -1
- package/dist/sankhyablocks/p-ca5ec380.js +0 -1
- package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
- package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
- package/dist/sankhyablocks/p-feba9d4b.entry.js +0 -1
|
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
6
6
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
7
7
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
8
8
|
};
|
|
9
|
-
import { ApplicationContext, ErrorException,
|
|
9
|
+
import { ApplicationContext, ErrorException, ObjectUtils, ServiceCanceledException, StringUtils, WarningException } from '@sankhyalabs/core';
|
|
10
10
|
import { batchRequests } from 'graphql-request';
|
|
11
11
|
import UrlUtils from "../../../lib/utils/urlutils";
|
|
12
12
|
import { PrintUtils } from '../../utils/PrintUtils';
|
|
@@ -266,7 +266,8 @@ export class DataFetcher {
|
|
|
266
266
|
}
|
|
267
267
|
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
|
268
268
|
}
|
|
269
|
-
|
|
269
|
+
const requestId = StringUtils.generateUUID();
|
|
270
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
|
|
270
271
|
http.open("POST", url, true);
|
|
271
272
|
http.withCredentials = true;
|
|
272
273
|
http.send(ObjectUtils.objectToString(payloadJson));
|
|
@@ -306,7 +307,7 @@ export class DataFetcher {
|
|
|
306
307
|
else if (http.readyState == 4 && http.status != 200) {
|
|
307
308
|
reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
|
|
308
309
|
}
|
|
309
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
310
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
|
|
310
311
|
};
|
|
311
312
|
});
|
|
312
313
|
}
|
|
@@ -411,7 +412,8 @@ export class DataFetcher {
|
|
|
411
412
|
const errorsResponse = [];
|
|
412
413
|
const responseExtensions = [];
|
|
413
414
|
const url = this.buildGraphQlURL(quietMode);
|
|
414
|
-
|
|
415
|
+
const requestId = StringUtils.generateUUID();
|
|
416
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
|
415
417
|
try {
|
|
416
418
|
const response = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
417
419
|
response.forEach((resItem, index) => {
|
|
@@ -445,11 +447,11 @@ export class DataFetcher {
|
|
|
445
447
|
});
|
|
446
448
|
}
|
|
447
449
|
else {
|
|
448
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
|
450
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
|
449
451
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
450
452
|
}
|
|
451
453
|
}
|
|
452
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
|
454
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
|
453
455
|
return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
|
|
454
456
|
}
|
|
455
457
|
isHttpError(err) {
|
|
@@ -73,7 +73,7 @@ export default class DataUnitDataLoader {
|
|
|
73
73
|
}
|
|
74
74
|
const count = loadingInfo.count;
|
|
75
75
|
if (loadingInfo.loadingInProgress) {
|
|
76
|
-
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
|
|
76
|
+
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count, loadingInProgress: true }));
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
if (loadingInfo.needReload) {
|
|
@@ -81,7 +81,7 @@ export default class DataUnitDataLoader {
|
|
|
81
81
|
dataUnit.gotoPage(0);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
|
|
84
|
+
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count, loadingInProgress: false }));
|
|
85
85
|
}
|
|
86
86
|
static registryLoading(dataUnit, loadingInfo) {
|
|
87
87
|
if (loadingInfo == undefined) {
|
|
@@ -96,9 +96,14 @@ export class PesquisaFetcher {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
+
const urlOptions = {
|
|
100
|
+
urlParams: {
|
|
101
|
+
"quietMode": true
|
|
102
|
+
}
|
|
103
|
+
};
|
|
99
104
|
return new Promise((resolve, reject) => {
|
|
100
105
|
DataFetcher.get()
|
|
101
|
-
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
|
|
106
|
+
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody), urlOptions)
|
|
102
107
|
.then(result => resolve(result))
|
|
103
108
|
.catch(error => reject(error));
|
|
104
109
|
});
|
|
@@ -13,6 +13,28 @@ export class CrudUtils {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
static parseCrudResults(entities, onlyFirst) {
|
|
17
|
+
if (!Array.isArray(entities)) {
|
|
18
|
+
entities = [entities];
|
|
19
|
+
}
|
|
20
|
+
const crudFindResults = [];
|
|
21
|
+
for (const entity of entities) {
|
|
22
|
+
let crudFindResult = {
|
|
23
|
+
fields: new Map()
|
|
24
|
+
};
|
|
25
|
+
for (let key in entity) {
|
|
26
|
+
let fieldValue = entity[key];
|
|
27
|
+
if (fieldValue.hasOwnProperty('$')) {
|
|
28
|
+
crudFindResult.fields.set(key, fieldValue.$);
|
|
29
|
+
}
|
|
30
|
+
if (onlyFirst) {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
crudFindResults.push(crudFindResult);
|
|
35
|
+
}
|
|
36
|
+
return crudFindResults.length > 1 ? crudFindResults : crudFindResults[0];
|
|
37
|
+
}
|
|
16
38
|
static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
|
|
17
39
|
const SERVICE_CRUD_FIND = "mge@crud.find";
|
|
18
40
|
let parsedFields = [];
|
|
@@ -61,24 +83,11 @@ export class CrudUtils {
|
|
|
61
83
|
DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
|
|
62
84
|
var _a;
|
|
63
85
|
let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
|
|
64
|
-
if (entities
|
|
65
|
-
let crudFindResult = {
|
|
66
|
-
fields: new Map()
|
|
67
|
-
};
|
|
68
|
-
for (let key in entities) {
|
|
69
|
-
let fieldValue = entities[key];
|
|
70
|
-
if (fieldValue.hasOwnProperty('$')) {
|
|
71
|
-
crudFindResult.fields.set(key, fieldValue.$);
|
|
72
|
-
}
|
|
73
|
-
if (onlyFirst) {
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
resolve(crudFindResult);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
86
|
+
if (!entities) {
|
|
80
87
|
resolve(null);
|
|
81
88
|
}
|
|
89
|
+
const crudFindResults = this.parseCrudResults(entities, onlyFirst);
|
|
90
|
+
resolve(crudFindResults);
|
|
82
91
|
});
|
|
83
92
|
});
|
|
84
93
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching';
|
|
2
|
+
import { registerRoute } from 'workbox-routing';
|
|
3
|
+
import { StaleWhileRevalidate, CacheFirst } from 'workbox-strategies';
|
|
4
|
+
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
|
|
5
|
+
import { ExpirationPlugin } from 'workbox-expiration';
|
|
6
|
+
|
|
7
|
+
// Placeholder for Workbox to inject the precache manifest
|
|
8
|
+
precacheAndRoute([]);
|
|
9
|
+
|
|
10
|
+
// Additional custom logic follows...
|
|
11
|
+
registerRoute(
|
|
12
|
+
({ url }) =>
|
|
13
|
+
url.pathname.endsWith('/service.sbr') &&
|
|
14
|
+
url.searchParams.has('serviceName'),
|
|
15
|
+
new StaleWhileRevalidate({
|
|
16
|
+
cacheName: 'api-cache',
|
|
17
|
+
plugins: [new CacheableResponsePlugin({ statuses: [200] })],
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
registerRoute(
|
|
22
|
+
({ request }) =>
|
|
23
|
+
['image', 'font', 'style'].includes(request.destination),
|
|
24
|
+
new CacheFirst({
|
|
25
|
+
cacheName: 'assets-cache',
|
|
26
|
+
plugins: [
|
|
27
|
+
new CacheableResponsePlugin({ statuses: [0, 200] }),
|
|
28
|
+
new ExpirationPlugin({ maxEntries: 50, maxAgeSeconds: 30 * 24 * 60 * 60 }),
|
|
29
|
+
],
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
registerRoute(
|
|
34
|
+
({ request }) => request.mode === 'navigate',
|
|
35
|
+
createHandlerBoundToURL('/index.html')
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
self.addEventListener('install', (event) => {
|
|
39
|
+
console.log('Service Worker installing.');
|
|
40
|
+
self.skipWaiting();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
self.addEventListener('activate', (event) => {
|
|
44
|
+
console.log('Service Worker activating.');
|
|
45
|
+
clients.claim();
|
|
46
|
+
});
|
|
@@ -23,6 +23,28 @@ class CrudUtils {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
static parseCrudResults(entities, onlyFirst) {
|
|
27
|
+
if (!Array.isArray(entities)) {
|
|
28
|
+
entities = [entities];
|
|
29
|
+
}
|
|
30
|
+
const crudFindResults = [];
|
|
31
|
+
for (const entity of entities) {
|
|
32
|
+
let crudFindResult = {
|
|
33
|
+
fields: new Map()
|
|
34
|
+
};
|
|
35
|
+
for (let key in entity) {
|
|
36
|
+
let fieldValue = entity[key];
|
|
37
|
+
if (fieldValue.hasOwnProperty('$')) {
|
|
38
|
+
crudFindResult.fields.set(key, fieldValue.$);
|
|
39
|
+
}
|
|
40
|
+
if (onlyFirst) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
crudFindResults.push(crudFindResult);
|
|
45
|
+
}
|
|
46
|
+
return crudFindResults.length > 1 ? crudFindResults : crudFindResults[0];
|
|
47
|
+
}
|
|
26
48
|
static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
|
|
27
49
|
const SERVICE_CRUD_FIND = "mge@crud.find";
|
|
28
50
|
let parsedFields = [];
|
|
@@ -70,24 +92,11 @@ class CrudUtils {
|
|
|
70
92
|
DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
|
|
71
93
|
var _a;
|
|
72
94
|
let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
|
|
73
|
-
if (entities
|
|
74
|
-
let crudFindResult = {
|
|
75
|
-
fields: new Map()
|
|
76
|
-
};
|
|
77
|
-
for (let key in entities) {
|
|
78
|
-
let fieldValue = entities[key];
|
|
79
|
-
if (fieldValue.hasOwnProperty('$')) {
|
|
80
|
-
crudFindResult.fields.set(key, fieldValue.$);
|
|
81
|
-
}
|
|
82
|
-
if (onlyFirst) {
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
resolve(crudFindResult);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
95
|
+
if (!entities) {
|
|
89
96
|
resolve(null);
|
|
90
97
|
}
|
|
98
|
+
const crudFindResults = this.parseCrudResults(entities, onlyFirst);
|
|
99
|
+
resolve(crudFindResults);
|
|
91
100
|
});
|
|
92
101
|
});
|
|
93
102
|
}
|
|
@@ -6777,7 +6777,8 @@ class DataFetcher {
|
|
|
6777
6777
|
}
|
|
6778
6778
|
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
|
6779
6779
|
}
|
|
6780
|
-
|
|
6780
|
+
const requestId = StringUtils.generateUUID();
|
|
6781
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload, requestId }));
|
|
6781
6782
|
http.open("POST", url, true);
|
|
6782
6783
|
http.withCredentials = true;
|
|
6783
6784
|
http.send(ObjectUtils.objectToString(payloadJson));
|
|
@@ -6817,7 +6818,7 @@ class DataFetcher {
|
|
|
6817
6818
|
else if (http.readyState == 4 && http.status != 200) {
|
|
6818
6819
|
reject(new ErrorException(`Erro ao executar serviço: ${serviceName}`, http.responseText));
|
|
6819
6820
|
}
|
|
6820
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6821
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload, requestId }));
|
|
6821
6822
|
};
|
|
6822
6823
|
});
|
|
6823
6824
|
}
|
|
@@ -6922,7 +6923,8 @@ class DataFetcher {
|
|
|
6922
6923
|
const errorsResponse = [];
|
|
6923
6924
|
const responseExtensions = [];
|
|
6924
6925
|
const url = this.buildGraphQlURL(quietMode);
|
|
6925
|
-
|
|
6926
|
+
const requestId = StringUtils.generateUUID();
|
|
6927
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
|
6926
6928
|
try {
|
|
6927
6929
|
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6928
6930
|
response.forEach((resItem, index) => {
|
|
@@ -6956,11 +6958,11 @@ class DataFetcher {
|
|
|
6956
6958
|
});
|
|
6957
6959
|
}
|
|
6958
6960
|
else {
|
|
6959
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
|
6961
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
|
6960
6962
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
6961
6963
|
}
|
|
6962
6964
|
}
|
|
6963
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request }));
|
|
6965
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url, requestBody: request, requestId }));
|
|
6964
6966
|
return { data: dataResponse, errors: errorsResponse, extensions: responseExtensions };
|
|
6965
6967
|
}
|
|
6966
6968
|
isHttpError(err) {
|
|
@@ -712,7 +712,7 @@ class DataUnitDataLoader {
|
|
|
712
712
|
}
|
|
713
713
|
const count = loadingInfo.count;
|
|
714
714
|
if (loadingInfo.loadingInProgress) {
|
|
715
|
-
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
|
|
715
|
+
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count, loadingInProgress: true }));
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
if (loadingInfo.needReload) {
|
|
@@ -720,7 +720,7 @@ class DataUnitDataLoader {
|
|
|
720
720
|
dataUnit.gotoPage(0);
|
|
721
721
|
return;
|
|
722
722
|
}
|
|
723
|
-
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
|
|
723
|
+
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count, loadingInProgress: false }));
|
|
724
724
|
}
|
|
725
725
|
static registryLoading(dataUnit, loadingInfo) {
|
|
726
726
|
if (loadingInfo == undefined) {
|
|
@@ -96,9 +96,14 @@ class PesquisaFetcher {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
+
const urlOptions = {
|
|
100
|
+
urlParams: {
|
|
101
|
+
"quietMode": true
|
|
102
|
+
}
|
|
103
|
+
};
|
|
99
104
|
return new Promise((resolve, reject) => {
|
|
100
105
|
DataFetcher.get()
|
|
101
|
-
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
|
|
106
|
+
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody), urlOptions)
|
|
102
107
|
.then(result => resolve(result))
|
|
103
108
|
.catch(error => reject(error));
|
|
104
109
|
});
|
|
@@ -620,7 +620,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
620
620
|
};
|
|
621
621
|
const result = await DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param);
|
|
622
622
|
return ((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action) || [];
|
|
623
|
-
}, StorageType.
|
|
623
|
+
}, StorageType.IN_MEMORY_CACHE);
|
|
624
624
|
this._actions = SnkActionsButton.parameters.isOrderActions
|
|
625
625
|
? ArrayUtils.sortAlphabetically(actions, 'description')
|
|
626
626
|
: actions;
|
|
@@ -4,7 +4,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
|
|
6
6
|
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
|
|
7
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher.js';
|
|
7
|
+
import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js';
|
|
8
8
|
import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
|
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
10
10
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
|
@@ -274,6 +274,99 @@ class SnkErrorHandler {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
class DebouncedRequestListener {
|
|
278
|
+
constructor() {
|
|
279
|
+
this._debounceTime = 1500;
|
|
280
|
+
this.requests = new Map();
|
|
281
|
+
this.requestsLoadingBar = [];
|
|
282
|
+
}
|
|
283
|
+
onRequestStart(param) {
|
|
284
|
+
if (param.url.includes("quietMode=true")) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this.requestsLoadingBar.push(param.requestId);
|
|
288
|
+
const timeout = setTimeout(() => {
|
|
289
|
+
this.ezLoadingBar.show();
|
|
290
|
+
}, this._debounceTime);
|
|
291
|
+
this.requests.set(param.requestId, timeout);
|
|
292
|
+
}
|
|
293
|
+
;
|
|
294
|
+
onRequestEnd(param) {
|
|
295
|
+
const timeoutId = this.requests.get(param.requestId);
|
|
296
|
+
clearTimeout(timeoutId);
|
|
297
|
+
if (this.requestsLoadingBar.includes(param.requestId)) {
|
|
298
|
+
this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
|
|
299
|
+
!this.requestsLoadingBar.length && this.ezLoadingBar.hide();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
class RequestListenerLoadingBar {
|
|
306
|
+
constructor() {
|
|
307
|
+
this._debounceTime = 1000;
|
|
308
|
+
this._ignoredNameTypes = ["totals"];
|
|
309
|
+
this._countRequest = 0;
|
|
310
|
+
}
|
|
311
|
+
onRequestStart(param) {
|
|
312
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
this._countRequest++;
|
|
316
|
+
this.ezLoadingBar.show();
|
|
317
|
+
if (this._timerLoading) {
|
|
318
|
+
clearTimeout(this._timerLoading);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
;
|
|
322
|
+
onRequestEnd(param) {
|
|
323
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
this._countRequest--;
|
|
327
|
+
this._timerLoading = setTimeout(() => {
|
|
328
|
+
if (this._countRequest <= 0) {
|
|
329
|
+
this.ezLoadingBar.hide();
|
|
330
|
+
}
|
|
331
|
+
}, this._debounceTime);
|
|
332
|
+
}
|
|
333
|
+
;
|
|
334
|
+
isIgnoreLoadingOnRequest(param) {
|
|
335
|
+
if (param == undefined) {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
if (param.url.includes("quietMode=true")) {
|
|
339
|
+
return true;
|
|
340
|
+
}
|
|
341
|
+
if (param.requestBody == undefined) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
if (param.requestBody.length == 1) {
|
|
345
|
+
const { name } = param.requestBody[0].variables;
|
|
346
|
+
if (name) {
|
|
347
|
+
const nameParts = name.split(":");
|
|
348
|
+
const nameType = nameParts[0];
|
|
349
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
class RequestListenerFactory {
|
|
358
|
+
static create({ strategy }) {
|
|
359
|
+
switch (strategy) {
|
|
360
|
+
case 'request_name':
|
|
361
|
+
return new RequestListenerLoadingBar();
|
|
362
|
+
case 'request_time':
|
|
363
|
+
return new DebouncedRequestListener();
|
|
364
|
+
default:
|
|
365
|
+
throw new Error('Strategy not found');
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
277
370
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
278
371
|
|
|
279
372
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -288,7 +381,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
288
381
|
this._waitingAppReady = new Array();
|
|
289
382
|
this._duCache = new Map();
|
|
290
383
|
this._duPromises = new Map();
|
|
291
|
-
this._requestListener =
|
|
384
|
+
this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
|
|
292
385
|
this._pendingActions = new Map;
|
|
293
386
|
this._loadPkParameter = null;
|
|
294
387
|
this._isLoadedByPk = false;
|
|
@@ -776,6 +869,16 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
776
869
|
async isLoadedByPk() {
|
|
777
870
|
return Promise.resolve(this._isLoadedByPk);
|
|
778
871
|
}
|
|
872
|
+
/**
|
|
873
|
+
* Remove registro do cache do PreLoader do dataunit.
|
|
874
|
+
* Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
|
|
875
|
+
*/
|
|
876
|
+
async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
|
|
877
|
+
const records = recordsIDs.map(id => {
|
|
878
|
+
return { "__record__id__": id };
|
|
879
|
+
});
|
|
880
|
+
PreloadManager.removeRecords(dataUnit, records);
|
|
881
|
+
}
|
|
779
882
|
async getAuthList(auth) {
|
|
780
883
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
|
781
884
|
}
|
|
@@ -1262,7 +1365,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1262
1365
|
.unbind("F1");
|
|
1263
1366
|
}
|
|
1264
1367
|
render() {
|
|
1265
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.
|
|
1368
|
+
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
|
1266
1369
|
}
|
|
1267
1370
|
get _element() { return this; }
|
|
1268
1371
|
static get watchers() { return {
|
|
@@ -1314,6 +1417,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1314
1417
|
"info": [64],
|
|
1315
1418
|
"loadTotals": [64],
|
|
1316
1419
|
"isLoadedByPk": [64],
|
|
1420
|
+
"preloadMangerRemoveRecord": [64],
|
|
1317
1421
|
"executeSearch": [64],
|
|
1318
1422
|
"executePreparedSearch": [64],
|
|
1319
1423
|
"isDebugMode": [64],
|
|
@@ -1326,57 +1430,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1326
1430
|
"whenApplicationReady": [64],
|
|
1327
1431
|
"setSearchFilterContext": [64]
|
|
1328
1432
|
}]);
|
|
1329
|
-
class RequestListenerLoadingBar {
|
|
1330
|
-
constructor() {
|
|
1331
|
-
this._debounceTime = 1000;
|
|
1332
|
-
this._ignoredNameTypes = ["totals"];
|
|
1333
|
-
this._countRequest = 0;
|
|
1334
|
-
}
|
|
1335
|
-
onRequestStart(param) {
|
|
1336
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
1337
|
-
return;
|
|
1338
|
-
}
|
|
1339
|
-
this._countRequest++;
|
|
1340
|
-
this.loadingBar.show();
|
|
1341
|
-
if (this._timerLoading) {
|
|
1342
|
-
clearTimeout(this._timerLoading);
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
;
|
|
1346
|
-
onRequestEnd(param) {
|
|
1347
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
1348
|
-
return;
|
|
1349
|
-
}
|
|
1350
|
-
this._countRequest--;
|
|
1351
|
-
this._timerLoading = setTimeout(() => {
|
|
1352
|
-
if (this._countRequest <= 0) {
|
|
1353
|
-
this.loadingBar.hide();
|
|
1354
|
-
}
|
|
1355
|
-
}, this._debounceTime);
|
|
1356
|
-
}
|
|
1357
|
-
;
|
|
1358
|
-
isIgnoreLoadingOnRequest(param) {
|
|
1359
|
-
if (param == undefined) {
|
|
1360
|
-
return false;
|
|
1361
|
-
}
|
|
1362
|
-
if (param.url.includes("quietMode=true")) {
|
|
1363
|
-
return true;
|
|
1364
|
-
}
|
|
1365
|
-
if (param.requestBody == undefined) {
|
|
1366
|
-
return false;
|
|
1367
|
-
}
|
|
1368
|
-
if (param.requestBody.length == 1) {
|
|
1369
|
-
const { name } = param.requestBody[0].variables;
|
|
1370
|
-
if (name) {
|
|
1371
|
-
const nameParts = name.split(":");
|
|
1372
|
-
const nameType = nameParts[0];
|
|
1373
|
-
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
return false;
|
|
1377
|
-
}
|
|
1378
|
-
;
|
|
1379
|
-
}
|
|
1380
1433
|
class PendingPromise {
|
|
1381
1434
|
constructor(resolve, reject) {
|
|
1382
1435
|
this.resolve = resolve;
|
|
@@ -83,6 +83,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
83
83
|
this.enableGridInsert = false;
|
|
84
84
|
this.domainMessagesBuilder = undefined;
|
|
85
85
|
this.ignoreReadOnlyFormFields = undefined;
|
|
86
|
+
this.enableLockManger = false;
|
|
86
87
|
this.setCustomFormTitle = undefined;
|
|
87
88
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
88
89
|
}
|
|
@@ -323,11 +324,16 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
323
324
|
if (!isDocumentBody)
|
|
324
325
|
element.focus();
|
|
325
326
|
}
|
|
327
|
+
async function handleAddRecord() {
|
|
328
|
+
if (!dataUnit.hasNewRecord()) {
|
|
329
|
+
dataUnit.addRecord();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
326
332
|
keyboardManager
|
|
327
333
|
.bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
|
|
328
334
|
.bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
329
335
|
.bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
330
|
-
.bind("F8",
|
|
336
|
+
.bind("F8", handleAddRecord.bind(this), { description: "Adiciona um novo registro.", element: this._element })
|
|
331
337
|
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
332
338
|
.bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
333
339
|
.bind("ctrl + .", () => {
|
|
@@ -424,7 +430,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
424
430
|
return;
|
|
425
431
|
}
|
|
426
432
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
427
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
433
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManger: this.enableLockManger }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
428
434
|
}
|
|
429
435
|
get _element() { return this; }
|
|
430
436
|
static get watchers() { return {
|
|
@@ -453,6 +459,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
453
459
|
"enableGridInsert": [4, "enable-grid-insert"],
|
|
454
460
|
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
|
455
461
|
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
|
462
|
+
"enableLockManger": [4, "enable-lock-manger"],
|
|
456
463
|
"setCustomFormTitle": [16],
|
|
457
464
|
"_dataUnit": [32],
|
|
458
465
|
"_dataState": [32],
|