@sankhyalabs/sankhyablocks 8.15.0-rc.6 → 8.15.0-rc.8
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-302bbbd4.js → ConfigStorage-d4c99a5e.js} +2 -2
- package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
- package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-3621bfc4.js} +2 -2
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5161d082.js} +1 -1
- package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-9f1a13ca.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-c790ffb7.js → pesquisa-fetcher-8bbee432.js} +2 -9
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +3 -3
- package/dist/cjs/snk-application.cjs.entry.js +5 -5
- package/dist/cjs/snk-attach.cjs.entry.js +4 -4
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +41 -27
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +3 -3
- package/dist/cjs/{snk-guides-viewer-3a359685.js → snk-guides-viewer-100c3098.js} +4 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -6
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +3 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +39 -25
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -8
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/dataunit-fetcher.js +1 -8
- package/dist/components/snk-form-config2.js +39 -25
- package/dist/components/snk-personalized-filter-editor.js +3 -1
- package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-39ed8aeb.js} +2 -2
- package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
- package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-692e20c7.js} +2 -2
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-17dc5b5e.js} +1 -1
- package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-f121f880.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-4000d0b8.js → pesquisa-fetcher-5a8cae10.js} +2 -9
- package/dist/esm/snk-actions-button_2.entry.js +3 -3
- package/dist/esm/snk-application.entry.js +5 -5
- package/dist/esm/snk-attach.entry.js +4 -4
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +6 -6
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +41 -27
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +3 -3
- package/dist/esm/{snk-guides-viewer-fd8e4f30.js → snk-guides-viewer-36a01f1c.js} +4 -4
- package/dist/esm/snk-guides-viewer.entry.js +6 -6
- package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +3 -3
- package/dist/sankhyablocks/{p-0554ba80.entry.js → p-11ad137d.entry.js} +1 -1
- package/dist/sankhyablocks/p-2ae395fe.entry.js +1 -0
- package/dist/sankhyablocks/{p-1cbd8267.entry.js → p-3e2e2424.entry.js} +1 -1
- package/dist/sankhyablocks/p-3e91d5ea.entry.js +1 -0
- package/dist/sankhyablocks/{p-87d1c664.entry.js → p-453c01a8.entry.js} +1 -1
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/{p-0eb1ff03.js → p-5e681b7b.js} +2 -2
- package/dist/sankhyablocks/{p-aa95fb2c.js → p-67aedbe0.js} +1 -1
- package/dist/sankhyablocks/{p-573a07c5.js → p-725d04ba.js} +1 -1
- package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-827e4b01.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-9d608b62.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
- package/dist/sankhyablocks/{p-db4edd06.entry.js → p-bf658a8a.entry.js} +2 -2
- package/dist/sankhyablocks/{p-d869185c.js → p-c143a240.js} +1 -1
- package/dist/sankhyablocks/{p-71227faa.entry.js → p-d0844d18.entry.js} +1 -1
- package/dist/sankhyablocks/{p-87b1b7cf.entry.js → p-d7cda92f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3dfc05e9.entry.js → p-d7d85fa9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-761ed32f.entry.js → p-e3bd000e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ca78f461.entry.js → p-ee619e29.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1d75d9f9.entry.js → p-fcdcb0e2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-40915359.entry.js → p-fdc4cb9b.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-37d100d6.entry.js +0 -1
- package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
- package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
- package/dist/sankhyablocks/p-e6380c60.js +0 -1
@@ -55,8 +55,10 @@ export class SnkFilterPersonalized {
|
|
55
55
|
return this.presentationMode === EPresentationMode.MODAL;
|
56
56
|
}
|
57
57
|
doSearch(mode, argument, param) {
|
58
|
+
const context = Object.assign({}, param.searchContext);
|
59
|
+
context.searchOptions = Object.assign(Object.assign({}, context.searchOptions), { showInactives: "true" });
|
58
60
|
return new Promise((resolve, reject) => {
|
59
|
-
this._application.executePreparedSearch(mode, argument,
|
61
|
+
this._application.executePreparedSearch(mode, argument, context)
|
60
62
|
.then(result => {
|
61
63
|
resolve(result);
|
62
64
|
}).catch(reason => {
|
package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js
CHANGED
@@ -25,6 +25,7 @@ export class SnkFormConfig {
|
|
25
25
|
this._formFieldsStyle = "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding-right--small ez-padding-bottom--medium sc-snk-form-config";
|
26
26
|
this._fieldsAvailableStyle = "ez-col ez-col--sd-12 ez-col--tb-12 ez-margin-bottom--medium ez-margin-right--medium sc-snk-form-config";
|
27
27
|
this._fieldFloatingStyle = "form-config__field-config--dragged";
|
28
|
+
this._sortableTimer = 100;
|
28
29
|
this._formConfigOptions = [];
|
29
30
|
this._fieldConfigSelected = undefined;
|
30
31
|
this._layoutFormConfig = undefined;
|
@@ -39,20 +40,27 @@ export class SnkFormConfig {
|
|
39
40
|
this.messagesBuilder = undefined;
|
40
41
|
}
|
41
42
|
observeConfigManager() {
|
42
|
-
this.loadConfig();
|
43
|
+
this.loadConfig(this._sortableTimer);
|
43
44
|
}
|
44
|
-
loadFields() {
|
45
|
+
loadFields(updateTimer = 0) {
|
45
46
|
this._layoutFormConfig = [];
|
46
|
-
|
47
|
+
if (updateTimer > 0) {
|
48
|
+
setTimeout(() => {
|
49
|
+
this.buildFields();
|
50
|
+
}, updateTimer);
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
this.buildFields();
|
54
|
+
}
|
47
55
|
}
|
48
56
|
buildFields() {
|
49
57
|
this.buildFormConfig();
|
50
58
|
this.buildAvailableFields();
|
51
59
|
}
|
52
|
-
loadFormConfig() {
|
60
|
+
loadFormConfig(updateTimer) {
|
53
61
|
var _a;
|
54
62
|
this._formConfig = this.getConfig();
|
55
|
-
this.loadFields();
|
63
|
+
this.loadFields(updateTimer);
|
56
64
|
this.controlFieldConfig();
|
57
65
|
if (((_a = this._filterFieldsAvailable) === null || _a === void 0 ? void 0 : _a.value) != undefined) {
|
58
66
|
this._filterFieldsAvailable.value = "";
|
@@ -95,12 +103,12 @@ export class SnkFormConfig {
|
|
95
103
|
}
|
96
104
|
}
|
97
105
|
resetChangeConfig() {
|
98
|
-
this.loadFormConfig();
|
106
|
+
this.loadFormConfig(this._sortableTimer);
|
99
107
|
this.clearTempGroups();
|
100
108
|
}
|
101
109
|
resetChangeOptionConfig() {
|
102
110
|
this._formConfigChanged = false;
|
103
|
-
this.loadConfig();
|
111
|
+
this.loadConfig(this._sortableTimer);
|
104
112
|
this.clearTempGroups();
|
105
113
|
}
|
106
114
|
getTabsToSave() {
|
@@ -318,7 +326,9 @@ export class SnkFormConfig {
|
|
318
326
|
&& oldContainer.id === newContainer.id) {
|
319
327
|
evt.cancel();
|
320
328
|
this._fieldsAvailable = [];
|
321
|
-
|
329
|
+
setTimeout(() => {
|
330
|
+
this.buildAvailableFields();
|
331
|
+
}, this._sortableTimer);
|
322
332
|
return true;
|
323
333
|
}
|
324
334
|
return false;
|
@@ -361,7 +371,11 @@ export class SnkFormConfig {
|
|
361
371
|
if (isNewGroup) {
|
362
372
|
this.clearTempGroups(true);
|
363
373
|
}
|
364
|
-
|
374
|
+
const sortableTimer = oldContainer.dataset.groupName !== newContainer.dataset.groupName
|
375
|
+
|| (newContainer.id === CONTAINER_ID.withoutGroup && oldContainer.id === CONTAINER_ID.fieldsAvailable)
|
376
|
+
? this._sortableTimer
|
377
|
+
: 0;
|
378
|
+
this.updateFieldsToSave(sortableTimer);
|
365
379
|
}, this._renderTimer);
|
366
380
|
return true;
|
367
381
|
}
|
@@ -391,12 +405,12 @@ export class SnkFormConfig {
|
|
391
405
|
return;
|
392
406
|
}
|
393
407
|
}
|
394
|
-
updateFieldsToSave() {
|
408
|
+
updateFieldsToSave(updateTimer = 0) {
|
395
409
|
const fields = this.getFieldsToSave();
|
396
410
|
if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
|
397
411
|
this._formConfig.fields = fields;
|
398
412
|
}
|
399
|
-
this.loadFields();
|
413
|
+
this.loadFields(updateTimer);
|
400
414
|
this._formConfigChanged = true;
|
401
415
|
}
|
402
416
|
controlSortableField() {
|
@@ -426,7 +440,7 @@ export class SnkFormConfig {
|
|
426
440
|
controlStopDraggingGroup(evt) {
|
427
441
|
if (evt.data.newIndex !== evt.data.oldIndex) {
|
428
442
|
setTimeout(() => {
|
429
|
-
this.updateFieldsToSave();
|
443
|
+
this.updateFieldsToSave(this._sortableTimer);
|
430
444
|
}, this._renderTimer);
|
431
445
|
}
|
432
446
|
}
|
@@ -499,7 +513,7 @@ export class SnkFormConfig {
|
|
499
513
|
});
|
500
514
|
if (tabs.length > 0) {
|
501
515
|
this._formConfig.tabs = tabs;
|
502
|
-
this.loadFields();
|
516
|
+
this.loadFields(this._sortableTimer);
|
503
517
|
this.controlFieldConfig();
|
504
518
|
this._formConfigChanged = true;
|
505
519
|
}
|
@@ -523,13 +537,13 @@ export class SnkFormConfig {
|
|
523
537
|
if (config != undefined) {
|
524
538
|
this._formConfig = config;
|
525
539
|
this._tabSelected = 1;
|
526
|
-
this.loadFields();
|
540
|
+
this.loadFields(this._sortableTimer);
|
527
541
|
this.controlFieldConfig();
|
528
542
|
this.clearTempGroups();
|
529
543
|
}
|
530
544
|
}
|
531
|
-
loadConfig() {
|
532
|
-
this.loadFormConfig();
|
545
|
+
loadConfig(updateTimer = 0) {
|
546
|
+
this.loadFormConfig(updateTimer);
|
533
547
|
this.loadUserConfig();
|
534
548
|
}
|
535
549
|
addNewGroup() {
|
@@ -570,7 +584,7 @@ export class SnkFormConfig {
|
|
570
584
|
});
|
571
585
|
}
|
572
586
|
else {
|
573
|
-
this.updateFieldsToSave();
|
587
|
+
this.updateFieldsToSave(this._sortableTimer);
|
574
588
|
}
|
575
589
|
}
|
576
590
|
checkGroupExists(newLabel, indexGroup, isTempGroup = false) {
|
@@ -616,7 +630,7 @@ export class SnkFormConfig {
|
|
616
630
|
field.group = newLabel;
|
617
631
|
}
|
618
632
|
});
|
619
|
-
this.loadFields();
|
633
|
+
this.loadFields(this._sortableTimer);
|
620
634
|
this.controlFieldConfig();
|
621
635
|
this._formConfigChanged = true;
|
622
636
|
}
|
@@ -830,14 +844,14 @@ export class SnkFormConfig {
|
|
830
844
|
this._formConfigChanged = true;
|
831
845
|
this.resetSortables();
|
832
846
|
}
|
833
|
-
controlRemoveFieldConfig(fieldConfig) {
|
847
|
+
controlRemoveFieldConfig(fieldConfig, updateTimer) {
|
834
848
|
var _a;
|
835
849
|
this._formConfigChanged = false;
|
836
850
|
if (fieldConfig == undefined) {
|
837
851
|
return;
|
838
852
|
}
|
839
853
|
this._formConfig.fields = (_a = this._formConfig.fields) === null || _a === void 0 ? void 0 : _a.filter((field) => field.name !== fieldConfig.name);
|
840
|
-
this.loadFields();
|
854
|
+
this.loadFields(updateTimer);
|
841
855
|
this.controlFieldConfig();
|
842
856
|
this._formConfigChanged = true;
|
843
857
|
this.resetSortables();
|
@@ -846,14 +860,14 @@ export class SnkFormConfig {
|
|
846
860
|
this.controlSortableField();
|
847
861
|
this.controlSortableGroup();
|
848
862
|
}
|
849
|
-
handleFieldConfigChange(evt) {
|
863
|
+
handleFieldConfigChange(evt, updateTimer = 0) {
|
850
864
|
const { field: fieldConfig, type: actionType } = evt.detail;
|
851
865
|
if (actionType === ACTION_CONFIG.configuration) {
|
852
866
|
this.controlFieldConfig(fieldConfig);
|
853
867
|
return;
|
854
868
|
}
|
855
869
|
if (actionType === ACTION_CONFIG.remove) {
|
856
|
-
this.controlRemoveFieldConfig(fieldConfig);
|
870
|
+
this.controlRemoveFieldConfig(fieldConfig, updateTimer);
|
857
871
|
return;
|
858
872
|
}
|
859
873
|
if (actionType === ACTION_CONFIG.add) {
|
@@ -874,7 +888,7 @@ export class SnkFormConfig {
|
|
874
888
|
tab.label = newLabel;
|
875
889
|
}
|
876
890
|
});
|
877
|
-
this.loadFields();
|
891
|
+
this.loadFields(this._sortableTimer);
|
878
892
|
this.controlFieldConfig();
|
879
893
|
this._formConfigChanged = true;
|
880
894
|
}
|
@@ -894,7 +908,7 @@ export class SnkFormConfig {
|
|
894
908
|
this._formConfig.tabs = (_a = this._formConfig.tabs) === null || _a === void 0 ? void 0 : _a.filter((tab) => {
|
895
909
|
return tab.label !== tabSelected.detail.label;
|
896
910
|
});
|
897
|
-
this.loadFields();
|
911
|
+
this.loadFields(this._sortableTimer);
|
898
912
|
this.controlFieldConfig();
|
899
913
|
this._formConfigChanged = true;
|
900
914
|
}
|
@@ -907,7 +921,7 @@ export class SnkFormConfig {
|
|
907
921
|
tab.visible = !tab.visible;
|
908
922
|
}
|
909
923
|
});
|
910
|
-
this.loadFields();
|
924
|
+
this.loadFields(this._sortableTimer);
|
911
925
|
this.controlFieldConfig();
|
912
926
|
this._formConfigChanged = true;
|
913
927
|
}
|
@@ -275,7 +275,6 @@ export class DataFetcher {
|
|
275
275
|
if (http.readyState == 4 && http.status == 200) {
|
276
276
|
try {
|
277
277
|
const jsonResp = JSON.parse(http.responseText);
|
278
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
279
278
|
/**
|
280
279
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
281
280
|
*
|
@@ -286,8 +285,10 @@ export class DataFetcher {
|
|
286
285
|
if (this.isServiceBrokerError(jsonResp)) {
|
287
286
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
288
287
|
}
|
289
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
290
|
-
|
288
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
289
|
+
if (jsonResp.statusMessage) {
|
290
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
291
|
+
}
|
291
292
|
}
|
292
293
|
else {
|
293
294
|
accept(jsonResp.responseBody);
|
@@ -295,6 +296,7 @@ export class DataFetcher {
|
|
295
296
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
296
297
|
}
|
297
298
|
}
|
299
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
298
300
|
}
|
299
301
|
catch (err) {
|
300
302
|
console.warn(`Erro ao executar serviço: ${err}`);
|
@@ -86,14 +86,7 @@ export class PesquisaFetcher {
|
|
86
86
|
};
|
87
87
|
}
|
88
88
|
const options = searchOptions != undefined
|
89
|
-
? {
|
90
|
-
"pkFieldName": searchOptions.codeFieldName,
|
91
|
-
"label": searchOptions.descriptionFieldName,
|
92
|
-
"fieldName": searchOptions.codeFieldName,
|
93
|
-
"useDescriptionOptions": false,
|
94
|
-
"enableRowsCounter": true
|
95
|
-
}
|
96
|
-
: undefined;
|
89
|
+
? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
97
90
|
const reqBody = {
|
98
91
|
"serviceName": serviceName,
|
99
92
|
"requestBody": {
|
@@ -6786,7 +6786,6 @@ class DataFetcher {
|
|
6786
6786
|
if (http.readyState == 4 && http.status == 200) {
|
6787
6787
|
try {
|
6788
6788
|
const jsonResp = JSON.parse(http.responseText);
|
6789
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6790
6789
|
/**
|
6791
6790
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
6792
6791
|
*
|
@@ -6797,8 +6796,10 @@ class DataFetcher {
|
|
6797
6796
|
if (this.isServiceBrokerError(jsonResp)) {
|
6798
6797
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
6799
6798
|
}
|
6800
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
6801
|
-
|
6799
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
6800
|
+
if (jsonResp.statusMessage) {
|
6801
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
6802
|
+
}
|
6802
6803
|
}
|
6803
6804
|
else {
|
6804
6805
|
accept(jsonResp.responseBody);
|
@@ -6806,6 +6807,7 @@ class DataFetcher {
|
|
6806
6807
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
6807
6808
|
}
|
6808
6809
|
}
|
6810
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6809
6811
|
}
|
6810
6812
|
catch (err) {
|
6811
6813
|
console.warn(`Erro ao executar serviço: ${err}`);
|
@@ -90,14 +90,7 @@ class PesquisaFetcher {
|
|
90
90
|
};
|
91
91
|
}
|
92
92
|
const options = searchOptions != undefined
|
93
|
-
? {
|
94
|
-
"pkFieldName": searchOptions.codeFieldName,
|
95
|
-
"label": searchOptions.descriptionFieldName,
|
96
|
-
"fieldName": searchOptions.codeFieldName,
|
97
|
-
"useDescriptionOptions": false,
|
98
|
-
"enableRowsCounter": true
|
99
|
-
}
|
100
|
-
: undefined;
|
93
|
+
? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
101
94
|
const reqBody = {
|
102
95
|
"serviceName": serviceName,
|
103
96
|
"requestBody": {
|
@@ -34,6 +34,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
34
34
|
this._formFieldsStyle = "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding-right--small ez-padding-bottom--medium sc-snk-form-config";
|
35
35
|
this._fieldsAvailableStyle = "ez-col ez-col--sd-12 ez-col--tb-12 ez-margin-bottom--medium ez-margin-right--medium sc-snk-form-config";
|
36
36
|
this._fieldFloatingStyle = "form-config__field-config--dragged";
|
37
|
+
this._sortableTimer = 100;
|
37
38
|
this._formConfigOptions = [];
|
38
39
|
this._fieldConfigSelected = undefined;
|
39
40
|
this._layoutFormConfig = undefined;
|
@@ -48,20 +49,27 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
48
49
|
this.messagesBuilder = undefined;
|
49
50
|
}
|
50
51
|
observeConfigManager() {
|
51
|
-
this.loadConfig();
|
52
|
+
this.loadConfig(this._sortableTimer);
|
52
53
|
}
|
53
|
-
loadFields() {
|
54
|
+
loadFields(updateTimer = 0) {
|
54
55
|
this._layoutFormConfig = [];
|
55
|
-
|
56
|
+
if (updateTimer > 0) {
|
57
|
+
setTimeout(() => {
|
58
|
+
this.buildFields();
|
59
|
+
}, updateTimer);
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
this.buildFields();
|
63
|
+
}
|
56
64
|
}
|
57
65
|
buildFields() {
|
58
66
|
this.buildFormConfig();
|
59
67
|
this.buildAvailableFields();
|
60
68
|
}
|
61
|
-
loadFormConfig() {
|
69
|
+
loadFormConfig(updateTimer) {
|
62
70
|
var _a;
|
63
71
|
this._formConfig = this.getConfig();
|
64
|
-
this.loadFields();
|
72
|
+
this.loadFields(updateTimer);
|
65
73
|
this.controlFieldConfig();
|
66
74
|
if (((_a = this._filterFieldsAvailable) === null || _a === void 0 ? void 0 : _a.value) != undefined) {
|
67
75
|
this._filterFieldsAvailable.value = "";
|
@@ -104,12 +112,12 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
104
112
|
}
|
105
113
|
}
|
106
114
|
resetChangeConfig() {
|
107
|
-
this.loadFormConfig();
|
115
|
+
this.loadFormConfig(this._sortableTimer);
|
108
116
|
this.clearTempGroups();
|
109
117
|
}
|
110
118
|
resetChangeOptionConfig() {
|
111
119
|
this._formConfigChanged = false;
|
112
|
-
this.loadConfig();
|
120
|
+
this.loadConfig(this._sortableTimer);
|
113
121
|
this.clearTempGroups();
|
114
122
|
}
|
115
123
|
getTabsToSave() {
|
@@ -324,7 +332,9 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
324
332
|
&& oldContainer.id === newContainer.id) {
|
325
333
|
evt.cancel();
|
326
334
|
this._fieldsAvailable = [];
|
327
|
-
|
335
|
+
setTimeout(() => {
|
336
|
+
this.buildAvailableFields();
|
337
|
+
}, this._sortableTimer);
|
328
338
|
return true;
|
329
339
|
}
|
330
340
|
return false;
|
@@ -367,7 +377,11 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
367
377
|
if (isNewGroup) {
|
368
378
|
this.clearTempGroups(true);
|
369
379
|
}
|
370
|
-
|
380
|
+
const sortableTimer = oldContainer.dataset.groupName !== newContainer.dataset.groupName
|
381
|
+
|| (newContainer.id === CONTAINER_ID.withoutGroup && oldContainer.id === CONTAINER_ID.fieldsAvailable)
|
382
|
+
? this._sortableTimer
|
383
|
+
: 0;
|
384
|
+
this.updateFieldsToSave(sortableTimer);
|
371
385
|
}, this._renderTimer);
|
372
386
|
return true;
|
373
387
|
}
|
@@ -397,12 +411,12 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
397
411
|
return;
|
398
412
|
}
|
399
413
|
}
|
400
|
-
updateFieldsToSave() {
|
414
|
+
updateFieldsToSave(updateTimer = 0) {
|
401
415
|
const fields = this.getFieldsToSave();
|
402
416
|
if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
|
403
417
|
this._formConfig.fields = fields;
|
404
418
|
}
|
405
|
-
this.loadFields();
|
419
|
+
this.loadFields(updateTimer);
|
406
420
|
this._formConfigChanged = true;
|
407
421
|
}
|
408
422
|
controlSortableField() {
|
@@ -432,7 +446,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
432
446
|
controlStopDraggingGroup(evt) {
|
433
447
|
if (evt.data.newIndex !== evt.data.oldIndex) {
|
434
448
|
setTimeout(() => {
|
435
|
-
this.updateFieldsToSave();
|
449
|
+
this.updateFieldsToSave(this._sortableTimer);
|
436
450
|
}, this._renderTimer);
|
437
451
|
}
|
438
452
|
}
|
@@ -505,7 +519,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
505
519
|
});
|
506
520
|
if (tabs.length > 0) {
|
507
521
|
this._formConfig.tabs = tabs;
|
508
|
-
this.loadFields();
|
522
|
+
this.loadFields(this._sortableTimer);
|
509
523
|
this.controlFieldConfig();
|
510
524
|
this._formConfigChanged = true;
|
511
525
|
}
|
@@ -529,13 +543,13 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
529
543
|
if (config != undefined) {
|
530
544
|
this._formConfig = config;
|
531
545
|
this._tabSelected = 1;
|
532
|
-
this.loadFields();
|
546
|
+
this.loadFields(this._sortableTimer);
|
533
547
|
this.controlFieldConfig();
|
534
548
|
this.clearTempGroups();
|
535
549
|
}
|
536
550
|
}
|
537
|
-
loadConfig() {
|
538
|
-
this.loadFormConfig();
|
551
|
+
loadConfig(updateTimer = 0) {
|
552
|
+
this.loadFormConfig(updateTimer);
|
539
553
|
this.loadUserConfig();
|
540
554
|
}
|
541
555
|
addNewGroup() {
|
@@ -576,7 +590,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
576
590
|
});
|
577
591
|
}
|
578
592
|
else {
|
579
|
-
this.updateFieldsToSave();
|
593
|
+
this.updateFieldsToSave(this._sortableTimer);
|
580
594
|
}
|
581
595
|
}
|
582
596
|
checkGroupExists(newLabel, indexGroup, isTempGroup = false) {
|
@@ -622,7 +636,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
622
636
|
field.group = newLabel;
|
623
637
|
}
|
624
638
|
});
|
625
|
-
this.loadFields();
|
639
|
+
this.loadFields(this._sortableTimer);
|
626
640
|
this.controlFieldConfig();
|
627
641
|
this._formConfigChanged = true;
|
628
642
|
}
|
@@ -836,14 +850,14 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
836
850
|
this._formConfigChanged = true;
|
837
851
|
this.resetSortables();
|
838
852
|
}
|
839
|
-
controlRemoveFieldConfig(fieldConfig) {
|
853
|
+
controlRemoveFieldConfig(fieldConfig, updateTimer) {
|
840
854
|
var _a;
|
841
855
|
this._formConfigChanged = false;
|
842
856
|
if (fieldConfig == undefined) {
|
843
857
|
return;
|
844
858
|
}
|
845
859
|
this._formConfig.fields = (_a = this._formConfig.fields) === null || _a === void 0 ? void 0 : _a.filter((field) => field.name !== fieldConfig.name);
|
846
|
-
this.loadFields();
|
860
|
+
this.loadFields(updateTimer);
|
847
861
|
this.controlFieldConfig();
|
848
862
|
this._formConfigChanged = true;
|
849
863
|
this.resetSortables();
|
@@ -852,14 +866,14 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
852
866
|
this.controlSortableField();
|
853
867
|
this.controlSortableGroup();
|
854
868
|
}
|
855
|
-
handleFieldConfigChange(evt) {
|
869
|
+
handleFieldConfigChange(evt, updateTimer = 0) {
|
856
870
|
const { field: fieldConfig, type: actionType } = evt.detail;
|
857
871
|
if (actionType === ACTION_CONFIG.configuration) {
|
858
872
|
this.controlFieldConfig(fieldConfig);
|
859
873
|
return;
|
860
874
|
}
|
861
875
|
if (actionType === ACTION_CONFIG.remove) {
|
862
|
-
this.controlRemoveFieldConfig(fieldConfig);
|
876
|
+
this.controlRemoveFieldConfig(fieldConfig, updateTimer);
|
863
877
|
return;
|
864
878
|
}
|
865
879
|
if (actionType === ACTION_CONFIG.add) {
|
@@ -880,7 +894,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
880
894
|
tab.label = newLabel;
|
881
895
|
}
|
882
896
|
});
|
883
|
-
this.loadFields();
|
897
|
+
this.loadFields(this._sortableTimer);
|
884
898
|
this.controlFieldConfig();
|
885
899
|
this._formConfigChanged = true;
|
886
900
|
}
|
@@ -900,7 +914,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
900
914
|
this._formConfig.tabs = (_a = this._formConfig.tabs) === null || _a === void 0 ? void 0 : _a.filter((tab) => {
|
901
915
|
return tab.label !== tabSelected.detail.label;
|
902
916
|
});
|
903
|
-
this.loadFields();
|
917
|
+
this.loadFields(this._sortableTimer);
|
904
918
|
this.controlFieldConfig();
|
905
919
|
this._formConfigChanged = true;
|
906
920
|
}
|
@@ -913,7 +927,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
913
927
|
tab.visible = !tab.visible;
|
914
928
|
}
|
915
929
|
});
|
916
|
-
this.loadFields();
|
930
|
+
this.loadFields(this._sortableTimer);
|
917
931
|
this.controlFieldConfig();
|
918
932
|
this._formConfigChanged = true;
|
919
933
|
}
|
@@ -64,8 +64,10 @@ const SnkFilterPersonalized = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
64
64
|
return this.presentationMode === EPresentationMode.MODAL;
|
65
65
|
}
|
66
66
|
doSearch(mode, argument, param) {
|
67
|
+
const context = Object.assign({}, param.searchContext);
|
68
|
+
context.searchOptions = Object.assign(Object.assign({}, context.searchOptions), { showInactives: "true" });
|
67
69
|
return new Promise((resolve, reject) => {
|
68
|
-
this._application.executePreparedSearch(mode, argument,
|
70
|
+
this._application.executePreparedSearch(mode, argument, context)
|
69
71
|
.then(result => {
|
70
72
|
resolve(result);
|
71
73
|
}).catch(reason => {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-
|
1
|
+
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-f121f880.js';
|
2
2
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
3
3
|
import { ObjectUtils } from '@sankhyalabs/core';
|
4
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
4
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-a650ae58.js';
|
5
5
|
|
6
6
|
class GridConfigFetcher extends ResourceFetcher {
|
7
7
|
constructor() {
|
@@ -6786,7 +6786,6 @@ class DataFetcher {
|
|
6786
6786
|
if (http.readyState == 4 && http.status == 200) {
|
6787
6787
|
try {
|
6788
6788
|
const jsonResp = JSON.parse(http.responseText);
|
6789
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6790
6789
|
/**
|
6791
6790
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
6792
6791
|
*
|
@@ -6797,8 +6796,10 @@ class DataFetcher {
|
|
6797
6796
|
if (this.isServiceBrokerError(jsonResp)) {
|
6798
6797
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
6799
6798
|
}
|
6800
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
6801
|
-
|
6799
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
6800
|
+
if (jsonResp.statusMessage) {
|
6801
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
6802
|
+
}
|
6802
6803
|
}
|
6803
6804
|
else {
|
6804
6805
|
accept(jsonResp.responseBody);
|
@@ -6806,6 +6807,7 @@ class DataFetcher {
|
|
6806
6807
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
6807
6808
|
}
|
6808
6809
|
}
|
6810
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6809
6811
|
}
|
6810
6812
|
catch (err) {
|
6811
6813
|
console.warn(`Erro ao executar serviço: ${err}`);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-39ed8aeb.js';
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-f121f880.js';
|
4
4
|
|
5
5
|
class SnkFormConfigManager {
|
6
6
|
constructor(configName, resourceID, onConfigChange) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ObjectUtils } from '@sankhyalabs/core';
|
2
|
-
import { R as ResourceFetcher } from './form-config-fetcher-
|
2
|
+
import { R as ResourceFetcher } from './form-config-fetcher-f121f880.js';
|
3
3
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
5
5
|
getData(resourceID) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DataUnit, DataType, DateUtils, StringUtils, ChangeOperation, ApplicationContext, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
2
|
-
import { D as DataFetcher, d as dist } from './DataFetcher-
|
2
|
+
import { D as DataFetcher, d as dist } from './DataFetcher-a650ae58.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
5
5
|
import { P as PreloadManager } from './PreloadManager-c1c2f2b4.js';
|
@@ -851,14 +851,7 @@ class PesquisaFetcher {
|
|
851
851
|
};
|
852
852
|
}
|
853
853
|
const options = searchOptions != undefined
|
854
|
-
? {
|
855
|
-
"pkFieldName": searchOptions.codeFieldName,
|
856
|
-
"label": searchOptions.descriptionFieldName,
|
857
|
-
"fieldName": searchOptions.codeFieldName,
|
858
|
-
"useDescriptionOptions": false,
|
859
|
-
"enableRowsCounter": true
|
860
|
-
}
|
861
|
-
: undefined;
|
854
|
+
? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
862
855
|
const reqBody = {
|
863
856
|
"serviceName": serviceName,
|
864
857
|
"requestBody": {
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
3
|
+
import { D as DataFetcher } from './DataFetcher-a650ae58.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-5a8cae10.js';
|
6
6
|
import './index-0ece87a6.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
10
|
import './PreloadManager-c1c2f2b4.js';
|
11
11
|
import './filter-item-type.enum-d45e026f.js';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-f121f880.js';
|
13
13
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
14
14
|
import './PrintUtils-3e4ff0f5.js';
|
15
15
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
-
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-
|
6
|
-
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-
|
7
|
-
import { D as DataUnitFetcher, P as PesquisaFetcher } from './pesquisa-fetcher-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-39ed8aeb.js';
|
5
|
+
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-a650ae58.js';
|
6
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-17dc5b5e.js';
|
7
|
+
import { D as DataUnitFetcher, P as PesquisaFetcher } from './pesquisa-fetcher-5a8cae10.js';
|
8
8
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-0fb796b9.js';
|
9
|
-
import './form-config-fetcher-
|
9
|
+
import './form-config-fetcher-f121f880.js';
|
10
10
|
import './filter-item-type.enum-d45e026f.js';
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
12
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|