@sankhyalabs/sankhyablocks 1.3.31-beta.18 → 1.3.31-beta.19
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/snk-application.cjs.entry.js +29 -9
- package/dist/cjs/snk-filter-bar.cjs.entry.js +21 -3
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +23 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +21 -3
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +6 -6
- package/dist/components/snk-application2.js +29 -9
- package/dist/components/snk-filter-bar2.js +21 -3
- package/dist/components/snk-filter-binary-select.js +1 -1
- package/dist/components/snk-filter-detail2.js +1 -1
- package/dist/components/snk-filter-item2.js +1 -1
- package/dist/esm/snk-application.entry.js +29 -9
- package/dist/esm/snk-filter-bar.entry.js +21 -3
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-item.entry.js +1 -1
- package/dist/sankhyablocks/snk-application.entry.js +29 -9
- package/dist/sankhyablocks/snk-filter-bar.entry.js +21 -3
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +1 -1
- package/dist/sankhyablocks/snk-filter-detail.entry.js +1 -1
- package/dist/sankhyablocks/snk-filter-item.entry.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +5 -3
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6718,7 +6718,7 @@ class DataFetcher {
|
|
|
6718
6718
|
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
6719
6719
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6720
6720
|
const http = new XMLHttpRequest();
|
|
6721
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6721
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6722
6722
|
http.open("POST", url, true);
|
|
6723
6723
|
http.withCredentials = true;
|
|
6724
6724
|
http.send(payload);
|
|
@@ -6737,11 +6737,11 @@ class DataFetcher {
|
|
|
6737
6737
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
6738
6738
|
reject(this.responseText);
|
|
6739
6739
|
}
|
|
6740
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6740
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6741
6741
|
}
|
|
6742
6742
|
else if (this.readyState == 4 && this.status != 200) {
|
|
6743
6743
|
reject(this.responseText);
|
|
6744
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6744
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6745
6745
|
}
|
|
6746
6746
|
};
|
|
6747
6747
|
});
|
|
@@ -6797,7 +6797,7 @@ class DataFetcher {
|
|
|
6797
6797
|
if (window['skw_session']) {
|
|
6798
6798
|
url += `?mgeSession=${window['skw_session']}`;
|
|
6799
6799
|
}
|
|
6800
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6800
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
6801
6801
|
try {
|
|
6802
6802
|
res = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6803
6803
|
res.forEach((resItem, index) => {
|
|
@@ -6828,11 +6828,11 @@ class DataFetcher {
|
|
|
6828
6828
|
});
|
|
6829
6829
|
}
|
|
6830
6830
|
else {
|
|
6831
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6831
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6832
6832
|
throw new index$1.ErrorException("Falha de comunicação", err.message);
|
|
6833
6833
|
}
|
|
6834
6834
|
}
|
|
6835
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6835
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6836
6836
|
return { data: dataResponse, errors: errorsResponse };
|
|
6837
6837
|
}
|
|
6838
6838
|
isHttpError(err) {
|
|
@@ -8399,17 +8399,24 @@ const SnkApplication = class {
|
|
|
8399
8399
|
class RequestListenerLoadingBar {
|
|
8400
8400
|
constructor() {
|
|
8401
8401
|
this._debounceTime = 1000;
|
|
8402
|
+
this._ignoredNameTypes = ["totals"];
|
|
8402
8403
|
this._countRequest = 0;
|
|
8403
8404
|
}
|
|
8404
|
-
onRequestStart() {
|
|
8405
|
-
this.
|
|
8405
|
+
onRequestStart(param) {
|
|
8406
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8407
|
+
return;
|
|
8408
|
+
}
|
|
8406
8409
|
this._countRequest++;
|
|
8410
|
+
this.loadingBar.show();
|
|
8407
8411
|
if (this._timerLoading) {
|
|
8408
8412
|
clearTimeout(this._timerLoading);
|
|
8409
8413
|
}
|
|
8410
8414
|
}
|
|
8411
8415
|
;
|
|
8412
|
-
onRequestEnd() {
|
|
8416
|
+
onRequestEnd(param) {
|
|
8417
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8418
|
+
return;
|
|
8419
|
+
}
|
|
8413
8420
|
this._countRequest--;
|
|
8414
8421
|
this._timerLoading = setTimeout(() => {
|
|
8415
8422
|
if (this._countRequest <= 0) {
|
|
@@ -8418,6 +8425,19 @@ class RequestListenerLoadingBar {
|
|
|
8418
8425
|
}, this._debounceTime);
|
|
8419
8426
|
}
|
|
8420
8427
|
;
|
|
8428
|
+
isIgnoreLoadingOnRequest(param) {
|
|
8429
|
+
var _a;
|
|
8430
|
+
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
8431
|
+
const { name } = param.requestBody[0].variables;
|
|
8432
|
+
if (name) {
|
|
8433
|
+
const nameParts = name.split(":");
|
|
8434
|
+
const nameType = nameParts[0];
|
|
8435
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
8436
|
+
}
|
|
8437
|
+
}
|
|
8438
|
+
return false;
|
|
8439
|
+
}
|
|
8440
|
+
;
|
|
8421
8441
|
}
|
|
8422
8442
|
class PendingPromise {
|
|
8423
8443
|
constructor(resolve, reject) {
|
|
@@ -135,7 +135,7 @@ const SnkFilterBar = class {
|
|
|
135
135
|
.filter(item => item.visible)
|
|
136
136
|
.sort((a, b) => this._filtersComparator(a, b))
|
|
137
137
|
.forEach((item, index$1) => {
|
|
138
|
-
const filterItem = (index.h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index$1 > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
138
|
+
const filterItem = (index.h("snk-filter-item", { id: `filter-${item.id}`, config: this.normalizeItem(item), class: index$1 > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
139
139
|
if (item.fixed || item.hardFixed) {
|
|
140
140
|
pinnedItems.push(filterItem);
|
|
141
141
|
}
|
|
@@ -161,19 +161,37 @@ const SnkFilterBar = class {
|
|
|
161
161
|
filterChangeListener(evt) {
|
|
162
162
|
this.updateFilter(evt.detail);
|
|
163
163
|
}
|
|
164
|
+
normalizeItem(item) {
|
|
165
|
+
const normalized = Object.assign({}, item);
|
|
166
|
+
const optionals = ["props", "value", "hardFixed", "fixed"];
|
|
167
|
+
optionals.forEach(prop => {
|
|
168
|
+
if (normalized[prop] == undefined) {
|
|
169
|
+
delete normalized[prop];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
if (item.value === "") {
|
|
173
|
+
delete item.value;
|
|
174
|
+
}
|
|
175
|
+
return normalized;
|
|
176
|
+
}
|
|
164
177
|
updateFilter(newItem, clear = false) {
|
|
165
|
-
this.calculateUpdateSequence(newItem);
|
|
166
178
|
let upToDate = false;
|
|
167
179
|
this.filterConfig = this.filterConfig.map(item => {
|
|
168
180
|
if (clear) {
|
|
169
181
|
if (item.value != undefined) {
|
|
182
|
+
this.calculateUpdateSequence(item);
|
|
170
183
|
upToDate = true;
|
|
171
184
|
}
|
|
172
185
|
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
173
186
|
}
|
|
174
187
|
else {
|
|
175
188
|
if (item.id === newItem.id) {
|
|
176
|
-
|
|
189
|
+
const normalizedOne = this.normalizeItem(item);
|
|
190
|
+
const normalizedTwo = this.normalizeItem(newItem);
|
|
191
|
+
if (index$1.ObjectUtils.objectToString(normalizedOne) != index$1.ObjectUtils.objectToString(normalizedTwo)) {
|
|
192
|
+
this.calculateUpdateSequence(item);
|
|
193
|
+
}
|
|
194
|
+
upToDate = index$1.ObjectUtils.objectToString(normalizedOne.value) !== index$1.ObjectUtils.objectToString(normalizedTwo.value);
|
|
177
195
|
return newItem;
|
|
178
196
|
}
|
|
179
197
|
}
|
|
@@ -10,7 +10,7 @@ const SnkFilterBinarySelect = class {
|
|
|
10
10
|
index.registerInstance(this, hostRef);
|
|
11
11
|
}
|
|
12
12
|
isSelected(option) {
|
|
13
|
-
return this.
|
|
13
|
+
return this.value == undefined || this.value === option;
|
|
14
14
|
}
|
|
15
15
|
ezChangeListener(evt) {
|
|
16
16
|
if (!evt.detail) {
|
|
@@ -42,7 +42,7 @@ const SnkFilterDetail = class {
|
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
44
|
const ContentEditor = this.getContentEditor();
|
|
45
|
-
return (index.h(index.Host, null, index.h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, index.h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), index.h(ContentEditor, { ref: ref => this._editor = ref, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), index.h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, index.h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), index.h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
45
|
+
return (index.h(index.Host, null, index.h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, index.h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), index.h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), index.h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, index.h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), index.h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -103,7 +103,7 @@ const SnkFilterItem = class {
|
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
105
|
if (period.start) {
|
|
106
|
-
return `${label}: A partir de ${dateFormater.format(period.
|
|
106
|
+
return `${label}: A partir de ${dateFormater.format(period.start)}`;
|
|
107
107
|
}
|
|
108
108
|
else {
|
|
109
109
|
return `${label}: Até ${dateFormater.format(period.end)}`;
|
|
@@ -1332,17 +1332,24 @@ export class SnkApplication {
|
|
|
1332
1332
|
class RequestListenerLoadingBar {
|
|
1333
1333
|
constructor() {
|
|
1334
1334
|
this._debounceTime = 1000;
|
|
1335
|
+
this._ignoredNameTypes = ["totals"];
|
|
1335
1336
|
this._countRequest = 0;
|
|
1336
1337
|
}
|
|
1337
|
-
onRequestStart() {
|
|
1338
|
-
this.
|
|
1338
|
+
onRequestStart(param) {
|
|
1339
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1339
1342
|
this._countRequest++;
|
|
1343
|
+
this.loadingBar.show();
|
|
1340
1344
|
if (this._timerLoading) {
|
|
1341
1345
|
clearTimeout(this._timerLoading);
|
|
1342
1346
|
}
|
|
1343
1347
|
}
|
|
1344
1348
|
;
|
|
1345
|
-
onRequestEnd() {
|
|
1349
|
+
onRequestEnd(param) {
|
|
1350
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1346
1353
|
this._countRequest--;
|
|
1347
1354
|
this._timerLoading = setTimeout(() => {
|
|
1348
1355
|
if (this._countRequest <= 0) {
|
|
@@ -1351,6 +1358,19 @@ class RequestListenerLoadingBar {
|
|
|
1351
1358
|
}, this._debounceTime);
|
|
1352
1359
|
}
|
|
1353
1360
|
;
|
|
1361
|
+
isIgnoreLoadingOnRequest(param) {
|
|
1362
|
+
var _a;
|
|
1363
|
+
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
1364
|
+
const { name } = param.requestBody[0].variables;
|
|
1365
|
+
if (name) {
|
|
1366
|
+
const nameParts = name.split(":");
|
|
1367
|
+
const nameType = nameParts[0];
|
|
1368
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
return false;
|
|
1372
|
+
}
|
|
1373
|
+
;
|
|
1354
1374
|
}
|
|
1355
1375
|
class PendingPromise {
|
|
1356
1376
|
constructor(resolve, reject) {
|
package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js
CHANGED
|
@@ -2,7 +2,7 @@ import { h, Host } from '@stencil/core';
|
|
|
2
2
|
import FilterItemType from '../filter-item-type.enum';
|
|
3
3
|
export class SnkFilterBinarySelect {
|
|
4
4
|
isSelected(option) {
|
|
5
|
-
return this.
|
|
5
|
+
return this.value == undefined || this.value === option;
|
|
6
6
|
}
|
|
7
7
|
ezChangeListener(evt) {
|
|
8
8
|
if (!evt.detail) {
|
|
@@ -33,7 +33,7 @@ export class SnkFilterDetail {
|
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
35
|
const ContentEditor = this.getContentEditor();
|
|
36
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
36
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
37
37
|
}
|
|
38
38
|
static get is() { return "snk-filter-detail"; }
|
|
39
39
|
static get properties() {
|
|
@@ -96,7 +96,7 @@ export class SnkFilterItem {
|
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
98
|
if (period.start) {
|
|
99
|
-
return `${label}: A partir de ${dateFormater.format(period.
|
|
99
|
+
return `${label}: A partir de ${dateFormater.format(period.start)}`;
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
102
|
return `${label}: Até ${dateFormater.format(period.end)}`;
|
|
@@ -128,7 +128,7 @@ export class SnkFilterBar {
|
|
|
128
128
|
.filter(item => item.visible)
|
|
129
129
|
.sort((a, b) => this._filtersComparator(a, b))
|
|
130
130
|
.forEach((item, index) => {
|
|
131
|
-
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
131
|
+
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: this.normalizeItem(item), class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
132
132
|
if (item.fixed || item.hardFixed) {
|
|
133
133
|
pinnedItems.push(filterItem);
|
|
134
134
|
}
|
|
@@ -154,19 +154,37 @@ export class SnkFilterBar {
|
|
|
154
154
|
filterChangeListener(evt) {
|
|
155
155
|
this.updateFilter(evt.detail);
|
|
156
156
|
}
|
|
157
|
+
normalizeItem(item) {
|
|
158
|
+
const normalized = Object.assign({}, item);
|
|
159
|
+
const optionals = ["props", "value", "hardFixed", "fixed"];
|
|
160
|
+
optionals.forEach(prop => {
|
|
161
|
+
if (normalized[prop] == undefined) {
|
|
162
|
+
delete normalized[prop];
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
if (item.value === "") {
|
|
166
|
+
delete item.value;
|
|
167
|
+
}
|
|
168
|
+
return normalized;
|
|
169
|
+
}
|
|
157
170
|
updateFilter(newItem, clear = false) {
|
|
158
|
-
this.calculateUpdateSequence(newItem);
|
|
159
171
|
let upToDate = false;
|
|
160
172
|
this.filterConfig = this.filterConfig.map(item => {
|
|
161
173
|
if (clear) {
|
|
162
174
|
if (item.value != undefined) {
|
|
175
|
+
this.calculateUpdateSequence(item);
|
|
163
176
|
upToDate = true;
|
|
164
177
|
}
|
|
165
178
|
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
166
179
|
}
|
|
167
180
|
else {
|
|
168
181
|
if (item.id === newItem.id) {
|
|
169
|
-
|
|
182
|
+
const normalizedOne = this.normalizeItem(item);
|
|
183
|
+
const normalizedTwo = this.normalizeItem(newItem);
|
|
184
|
+
if (ObjectUtils.objectToString(normalizedOne) != ObjectUtils.objectToString(normalizedTwo)) {
|
|
185
|
+
this.calculateUpdateSequence(item);
|
|
186
|
+
}
|
|
187
|
+
upToDate = ObjectUtils.objectToString(normalizedOne.value) !== ObjectUtils.objectToString(normalizedTwo.value);
|
|
170
188
|
return newItem;
|
|
171
189
|
}
|
|
172
190
|
}
|
|
@@ -101,7 +101,7 @@ export class DataFetcher {
|
|
|
101
101
|
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
102
102
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
103
103
|
const http = new XMLHttpRequest();
|
|
104
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
104
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
105
105
|
http.open("POST", url, true);
|
|
106
106
|
http.withCredentials = true;
|
|
107
107
|
http.send(payload);
|
|
@@ -120,11 +120,11 @@ export class DataFetcher {
|
|
|
120
120
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
121
121
|
reject(this.responseText);
|
|
122
122
|
}
|
|
123
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
123
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
124
124
|
}
|
|
125
125
|
else if (this.readyState == 4 && this.status != 200) {
|
|
126
126
|
reject(this.responseText);
|
|
127
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
127
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
});
|
|
@@ -180,7 +180,7 @@ export class DataFetcher {
|
|
|
180
180
|
if (window['skw_session']) {
|
|
181
181
|
url += `?mgeSession=${window['skw_session']}`;
|
|
182
182
|
}
|
|
183
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
183
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
184
184
|
try {
|
|
185
185
|
res = await batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
186
186
|
res.forEach((resItem, index) => {
|
|
@@ -211,11 +211,11 @@ export class DataFetcher {
|
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
214
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
215
215
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
218
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
219
219
|
return { data: dataResponse, errors: errorsResponse };
|
|
220
220
|
}
|
|
221
221
|
isHttpError(err) {
|
|
@@ -6715,7 +6715,7 @@ class DataFetcher {
|
|
|
6715
6715
|
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
6716
6716
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6717
6717
|
const http = new XMLHttpRequest();
|
|
6718
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6718
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6719
6719
|
http.open("POST", url, true);
|
|
6720
6720
|
http.withCredentials = true;
|
|
6721
6721
|
http.send(payload);
|
|
@@ -6734,11 +6734,11 @@ class DataFetcher {
|
|
|
6734
6734
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
6735
6735
|
reject(this.responseText);
|
|
6736
6736
|
}
|
|
6737
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6737
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6738
6738
|
}
|
|
6739
6739
|
else if (this.readyState == 4 && this.status != 200) {
|
|
6740
6740
|
reject(this.responseText);
|
|
6741
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6741
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6742
6742
|
}
|
|
6743
6743
|
};
|
|
6744
6744
|
});
|
|
@@ -6794,7 +6794,7 @@ class DataFetcher {
|
|
|
6794
6794
|
if (window['skw_session']) {
|
|
6795
6795
|
url += `?mgeSession=${window['skw_session']}`;
|
|
6796
6796
|
}
|
|
6797
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6797
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
6798
6798
|
try {
|
|
6799
6799
|
res = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6800
6800
|
res.forEach((resItem, index) => {
|
|
@@ -6825,11 +6825,11 @@ class DataFetcher {
|
|
|
6825
6825
|
});
|
|
6826
6826
|
}
|
|
6827
6827
|
else {
|
|
6828
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6828
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6829
6829
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
6830
6830
|
}
|
|
6831
6831
|
}
|
|
6832
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6832
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6833
6833
|
return { data: dataResponse, errors: errorsResponse };
|
|
6834
6834
|
}
|
|
6835
6835
|
isHttpError(err) {
|
|
@@ -8431,17 +8431,24 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
8431
8431
|
class RequestListenerLoadingBar {
|
|
8432
8432
|
constructor() {
|
|
8433
8433
|
this._debounceTime = 1000;
|
|
8434
|
+
this._ignoredNameTypes = ["totals"];
|
|
8434
8435
|
this._countRequest = 0;
|
|
8435
8436
|
}
|
|
8436
|
-
onRequestStart() {
|
|
8437
|
-
this.
|
|
8437
|
+
onRequestStart(param) {
|
|
8438
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8439
|
+
return;
|
|
8440
|
+
}
|
|
8438
8441
|
this._countRequest++;
|
|
8442
|
+
this.loadingBar.show();
|
|
8439
8443
|
if (this._timerLoading) {
|
|
8440
8444
|
clearTimeout(this._timerLoading);
|
|
8441
8445
|
}
|
|
8442
8446
|
}
|
|
8443
8447
|
;
|
|
8444
|
-
onRequestEnd() {
|
|
8448
|
+
onRequestEnd(param) {
|
|
8449
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8450
|
+
return;
|
|
8451
|
+
}
|
|
8445
8452
|
this._countRequest--;
|
|
8446
8453
|
this._timerLoading = setTimeout(() => {
|
|
8447
8454
|
if (this._countRequest <= 0) {
|
|
@@ -8450,6 +8457,19 @@ class RequestListenerLoadingBar {
|
|
|
8450
8457
|
}, this._debounceTime);
|
|
8451
8458
|
}
|
|
8452
8459
|
;
|
|
8460
|
+
isIgnoreLoadingOnRequest(param) {
|
|
8461
|
+
var _a;
|
|
8462
|
+
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
8463
|
+
const { name } = param.requestBody[0].variables;
|
|
8464
|
+
if (name) {
|
|
8465
|
+
const nameParts = name.split(":");
|
|
8466
|
+
const nameType = nameParts[0];
|
|
8467
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
8468
|
+
}
|
|
8469
|
+
}
|
|
8470
|
+
return false;
|
|
8471
|
+
}
|
|
8472
|
+
;
|
|
8453
8473
|
}
|
|
8454
8474
|
class PendingPromise {
|
|
8455
8475
|
constructor(resolve, reject) {
|
|
@@ -135,7 +135,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
135
135
|
.filter(item => item.visible)
|
|
136
136
|
.sort((a, b) => this._filtersComparator(a, b))
|
|
137
137
|
.forEach((item, index) => {
|
|
138
|
-
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
138
|
+
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: this.normalizeItem(item), class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
139
139
|
if (item.fixed || item.hardFixed) {
|
|
140
140
|
pinnedItems.push(filterItem);
|
|
141
141
|
}
|
|
@@ -161,19 +161,37 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
161
161
|
filterChangeListener(evt) {
|
|
162
162
|
this.updateFilter(evt.detail);
|
|
163
163
|
}
|
|
164
|
+
normalizeItem(item) {
|
|
165
|
+
const normalized = Object.assign({}, item);
|
|
166
|
+
const optionals = ["props", "value", "hardFixed", "fixed"];
|
|
167
|
+
optionals.forEach(prop => {
|
|
168
|
+
if (normalized[prop] == undefined) {
|
|
169
|
+
delete normalized[prop];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
if (item.value === "") {
|
|
173
|
+
delete item.value;
|
|
174
|
+
}
|
|
175
|
+
return normalized;
|
|
176
|
+
}
|
|
164
177
|
updateFilter(newItem, clear = false) {
|
|
165
|
-
this.calculateUpdateSequence(newItem);
|
|
166
178
|
let upToDate = false;
|
|
167
179
|
this.filterConfig = this.filterConfig.map(item => {
|
|
168
180
|
if (clear) {
|
|
169
181
|
if (item.value != undefined) {
|
|
182
|
+
this.calculateUpdateSequence(item);
|
|
170
183
|
upToDate = true;
|
|
171
184
|
}
|
|
172
185
|
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
173
186
|
}
|
|
174
187
|
else {
|
|
175
188
|
if (item.id === newItem.id) {
|
|
176
|
-
|
|
189
|
+
const normalizedOne = this.normalizeItem(item);
|
|
190
|
+
const normalizedTwo = this.normalizeItem(newItem);
|
|
191
|
+
if (ObjectUtils.objectToString(normalizedOne) != ObjectUtils.objectToString(normalizedTwo)) {
|
|
192
|
+
this.calculateUpdateSequence(item);
|
|
193
|
+
}
|
|
194
|
+
upToDate = ObjectUtils.objectToString(normalizedOne.value) !== ObjectUtils.objectToString(normalizedTwo.value);
|
|
177
195
|
return newItem;
|
|
178
196
|
}
|
|
179
197
|
}
|
|
@@ -7,7 +7,7 @@ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
7
7
|
this.__registerHost();
|
|
8
8
|
}
|
|
9
9
|
isSelected(option) {
|
|
10
|
-
return this.
|
|
10
|
+
return this.value == undefined || this.value === option;
|
|
11
11
|
}
|
|
12
12
|
ezChangeListener(evt) {
|
|
13
13
|
if (!evt.detail) {
|
|
@@ -39,7 +39,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
41
|
const ContentEditor = this.getContentEditor();
|
|
42
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
42
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
43
43
|
}
|
|
44
44
|
}, [0, "snk-filter-detail", {
|
|
45
45
|
"config": [1040],
|
|
@@ -101,7 +101,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
101
101
|
}
|
|
102
102
|
else {
|
|
103
103
|
if (period.start) {
|
|
104
|
-
return `${label}: A partir de ${dateFormater.format(period.
|
|
104
|
+
return `${label}: A partir de ${dateFormater.format(period.start)}`;
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
107
|
return `${label}: Até ${dateFormater.format(period.end)}`;
|
|
@@ -6714,7 +6714,7 @@ class DataFetcher {
|
|
|
6714
6714
|
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
6715
6715
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6716
6716
|
const http = new XMLHttpRequest();
|
|
6717
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6717
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6718
6718
|
http.open("POST", url, true);
|
|
6719
6719
|
http.withCredentials = true;
|
|
6720
6720
|
http.send(payload);
|
|
@@ -6733,11 +6733,11 @@ class DataFetcher {
|
|
|
6733
6733
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
6734
6734
|
reject(this.responseText);
|
|
6735
6735
|
}
|
|
6736
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6736
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6737
6737
|
}
|
|
6738
6738
|
else if (this.readyState == 4 && this.status != 200) {
|
|
6739
6739
|
reject(this.responseText);
|
|
6740
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6740
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6741
6741
|
}
|
|
6742
6742
|
};
|
|
6743
6743
|
});
|
|
@@ -6793,7 +6793,7 @@ class DataFetcher {
|
|
|
6793
6793
|
if (window['skw_session']) {
|
|
6794
6794
|
url += `?mgeSession=${window['skw_session']}`;
|
|
6795
6795
|
}
|
|
6796
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6796
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
6797
6797
|
try {
|
|
6798
6798
|
res = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6799
6799
|
res.forEach((resItem, index) => {
|
|
@@ -6824,11 +6824,11 @@ class DataFetcher {
|
|
|
6824
6824
|
});
|
|
6825
6825
|
}
|
|
6826
6826
|
else {
|
|
6827
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6827
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6828
6828
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
6829
6829
|
}
|
|
6830
6830
|
}
|
|
6831
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6831
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6832
6832
|
return { data: dataResponse, errors: errorsResponse };
|
|
6833
6833
|
}
|
|
6834
6834
|
isHttpError(err) {
|
|
@@ -8395,17 +8395,24 @@ const SnkApplication = class {
|
|
|
8395
8395
|
class RequestListenerLoadingBar {
|
|
8396
8396
|
constructor() {
|
|
8397
8397
|
this._debounceTime = 1000;
|
|
8398
|
+
this._ignoredNameTypes = ["totals"];
|
|
8398
8399
|
this._countRequest = 0;
|
|
8399
8400
|
}
|
|
8400
|
-
onRequestStart() {
|
|
8401
|
-
this.
|
|
8401
|
+
onRequestStart(param) {
|
|
8402
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8403
|
+
return;
|
|
8404
|
+
}
|
|
8402
8405
|
this._countRequest++;
|
|
8406
|
+
this.loadingBar.show();
|
|
8403
8407
|
if (this._timerLoading) {
|
|
8404
8408
|
clearTimeout(this._timerLoading);
|
|
8405
8409
|
}
|
|
8406
8410
|
}
|
|
8407
8411
|
;
|
|
8408
|
-
onRequestEnd() {
|
|
8412
|
+
onRequestEnd(param) {
|
|
8413
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8414
|
+
return;
|
|
8415
|
+
}
|
|
8409
8416
|
this._countRequest--;
|
|
8410
8417
|
this._timerLoading = setTimeout(() => {
|
|
8411
8418
|
if (this._countRequest <= 0) {
|
|
@@ -8414,6 +8421,19 @@ class RequestListenerLoadingBar {
|
|
|
8414
8421
|
}, this._debounceTime);
|
|
8415
8422
|
}
|
|
8416
8423
|
;
|
|
8424
|
+
isIgnoreLoadingOnRequest(param) {
|
|
8425
|
+
var _a;
|
|
8426
|
+
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
8427
|
+
const { name } = param.requestBody[0].variables;
|
|
8428
|
+
if (name) {
|
|
8429
|
+
const nameParts = name.split(":");
|
|
8430
|
+
const nameType = nameParts[0];
|
|
8431
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
return false;
|
|
8435
|
+
}
|
|
8436
|
+
;
|
|
8417
8437
|
}
|
|
8418
8438
|
class PendingPromise {
|
|
8419
8439
|
constructor(resolve, reject) {
|
|
@@ -131,7 +131,7 @@ const SnkFilterBar = class {
|
|
|
131
131
|
.filter(item => item.visible)
|
|
132
132
|
.sort((a, b) => this._filtersComparator(a, b))
|
|
133
133
|
.forEach((item, index) => {
|
|
134
|
-
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
134
|
+
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: this.normalizeItem(item), class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
135
135
|
if (item.fixed || item.hardFixed) {
|
|
136
136
|
pinnedItems.push(filterItem);
|
|
137
137
|
}
|
|
@@ -157,19 +157,37 @@ const SnkFilterBar = class {
|
|
|
157
157
|
filterChangeListener(evt) {
|
|
158
158
|
this.updateFilter(evt.detail);
|
|
159
159
|
}
|
|
160
|
+
normalizeItem(item) {
|
|
161
|
+
const normalized = Object.assign({}, item);
|
|
162
|
+
const optionals = ["props", "value", "hardFixed", "fixed"];
|
|
163
|
+
optionals.forEach(prop => {
|
|
164
|
+
if (normalized[prop] == undefined) {
|
|
165
|
+
delete normalized[prop];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
if (item.value === "") {
|
|
169
|
+
delete item.value;
|
|
170
|
+
}
|
|
171
|
+
return normalized;
|
|
172
|
+
}
|
|
160
173
|
updateFilter(newItem, clear = false) {
|
|
161
|
-
this.calculateUpdateSequence(newItem);
|
|
162
174
|
let upToDate = false;
|
|
163
175
|
this.filterConfig = this.filterConfig.map(item => {
|
|
164
176
|
if (clear) {
|
|
165
177
|
if (item.value != undefined) {
|
|
178
|
+
this.calculateUpdateSequence(item);
|
|
166
179
|
upToDate = true;
|
|
167
180
|
}
|
|
168
181
|
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
169
182
|
}
|
|
170
183
|
else {
|
|
171
184
|
if (item.id === newItem.id) {
|
|
172
|
-
|
|
185
|
+
const normalizedOne = this.normalizeItem(item);
|
|
186
|
+
const normalizedTwo = this.normalizeItem(newItem);
|
|
187
|
+
if (ObjectUtils.objectToString(normalizedOne) != ObjectUtils.objectToString(normalizedTwo)) {
|
|
188
|
+
this.calculateUpdateSequence(item);
|
|
189
|
+
}
|
|
190
|
+
upToDate = ObjectUtils.objectToString(normalizedOne.value) !== ObjectUtils.objectToString(normalizedTwo.value);
|
|
173
191
|
return newItem;
|
|
174
192
|
}
|
|
175
193
|
}
|
|
@@ -6,7 +6,7 @@ const SnkFilterBinarySelect = class {
|
|
|
6
6
|
registerInstance(this, hostRef);
|
|
7
7
|
}
|
|
8
8
|
isSelected(option) {
|
|
9
|
-
return this.
|
|
9
|
+
return this.value == undefined || this.value === option;
|
|
10
10
|
}
|
|
11
11
|
ezChangeListener(evt) {
|
|
12
12
|
if (!evt.detail) {
|
|
@@ -38,7 +38,7 @@ const SnkFilterDetail = class {
|
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
40
|
const ContentEditor = this.getContentEditor();
|
|
41
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
41
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -99,7 +99,7 @@ const SnkFilterItem = class {
|
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
101
|
if (period.start) {
|
|
102
|
-
return `${label}: A partir de ${dateFormater.format(period.
|
|
102
|
+
return `${label}: A partir de ${dateFormater.format(period.start)}`;
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
105
|
return `${label}: Até ${dateFormater.format(period.end)}`;
|
|
@@ -6714,7 +6714,7 @@ class DataFetcher {
|
|
|
6714
6714
|
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
6715
6715
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6716
6716
|
const http = new XMLHttpRequest();
|
|
6717
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6717
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6718
6718
|
http.open("POST", url, true);
|
|
6719
6719
|
http.withCredentials = true;
|
|
6720
6720
|
http.send(payload);
|
|
@@ -6733,11 +6733,11 @@ class DataFetcher {
|
|
|
6733
6733
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
6734
6734
|
reject(this.responseText);
|
|
6735
6735
|
}
|
|
6736
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6736
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6737
6737
|
}
|
|
6738
6738
|
else if (this.readyState == 4 && this.status != 200) {
|
|
6739
6739
|
reject(this.responseText);
|
|
6740
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6740
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6741
6741
|
}
|
|
6742
6742
|
};
|
|
6743
6743
|
});
|
|
@@ -6793,7 +6793,7 @@ class DataFetcher {
|
|
|
6793
6793
|
if (window['skw_session']) {
|
|
6794
6794
|
url += `?mgeSession=${window['skw_session']}`;
|
|
6795
6795
|
}
|
|
6796
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6796
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
6797
6797
|
try {
|
|
6798
6798
|
res = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6799
6799
|
res.forEach((resItem, index) => {
|
|
@@ -6824,11 +6824,11 @@ class DataFetcher {
|
|
|
6824
6824
|
});
|
|
6825
6825
|
}
|
|
6826
6826
|
else {
|
|
6827
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6827
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6828
6828
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
6829
6829
|
}
|
|
6830
6830
|
}
|
|
6831
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6831
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6832
6832
|
return { data: dataResponse, errors: errorsResponse };
|
|
6833
6833
|
}
|
|
6834
6834
|
isHttpError(err) {
|
|
@@ -8395,17 +8395,24 @@ const SnkApplication = class {
|
|
|
8395
8395
|
class RequestListenerLoadingBar {
|
|
8396
8396
|
constructor() {
|
|
8397
8397
|
this._debounceTime = 1000;
|
|
8398
|
+
this._ignoredNameTypes = ["totals"];
|
|
8398
8399
|
this._countRequest = 0;
|
|
8399
8400
|
}
|
|
8400
|
-
onRequestStart() {
|
|
8401
|
-
this.
|
|
8401
|
+
onRequestStart(param) {
|
|
8402
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8403
|
+
return;
|
|
8404
|
+
}
|
|
8402
8405
|
this._countRequest++;
|
|
8406
|
+
this.loadingBar.show();
|
|
8403
8407
|
if (this._timerLoading) {
|
|
8404
8408
|
clearTimeout(this._timerLoading);
|
|
8405
8409
|
}
|
|
8406
8410
|
}
|
|
8407
8411
|
;
|
|
8408
|
-
onRequestEnd() {
|
|
8412
|
+
onRequestEnd(param) {
|
|
8413
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8414
|
+
return;
|
|
8415
|
+
}
|
|
8409
8416
|
this._countRequest--;
|
|
8410
8417
|
this._timerLoading = setTimeout(() => {
|
|
8411
8418
|
if (this._countRequest <= 0) {
|
|
@@ -8414,6 +8421,19 @@ class RequestListenerLoadingBar {
|
|
|
8414
8421
|
}, this._debounceTime);
|
|
8415
8422
|
}
|
|
8416
8423
|
;
|
|
8424
|
+
isIgnoreLoadingOnRequest(param) {
|
|
8425
|
+
var _a;
|
|
8426
|
+
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
8427
|
+
const { name } = param.requestBody[0].variables;
|
|
8428
|
+
if (name) {
|
|
8429
|
+
const nameParts = name.split(":");
|
|
8430
|
+
const nameType = nameParts[0];
|
|
8431
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
return false;
|
|
8435
|
+
}
|
|
8436
|
+
;
|
|
8417
8437
|
}
|
|
8418
8438
|
class PendingPromise {
|
|
8419
8439
|
constructor(resolve, reject) {
|
|
@@ -131,7 +131,7 @@ const SnkFilterBar = class {
|
|
|
131
131
|
.filter(item => item.visible)
|
|
132
132
|
.sort((a, b) => this._filtersComparator(a, b))
|
|
133
133
|
.forEach((item, index) => {
|
|
134
|
-
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
134
|
+
const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: this.normalizeItem(item), class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
|
135
135
|
if (item.fixed || item.hardFixed) {
|
|
136
136
|
pinnedItems.push(filterItem);
|
|
137
137
|
}
|
|
@@ -157,19 +157,37 @@ const SnkFilterBar = class {
|
|
|
157
157
|
filterChangeListener(evt) {
|
|
158
158
|
this.updateFilter(evt.detail);
|
|
159
159
|
}
|
|
160
|
+
normalizeItem(item) {
|
|
161
|
+
const normalized = Object.assign({}, item);
|
|
162
|
+
const optionals = ["props", "value", "hardFixed", "fixed"];
|
|
163
|
+
optionals.forEach(prop => {
|
|
164
|
+
if (normalized[prop] == undefined) {
|
|
165
|
+
delete normalized[prop];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
if (item.value === "") {
|
|
169
|
+
delete item.value;
|
|
170
|
+
}
|
|
171
|
+
return normalized;
|
|
172
|
+
}
|
|
160
173
|
updateFilter(newItem, clear = false) {
|
|
161
|
-
this.calculateUpdateSequence(newItem);
|
|
162
174
|
let upToDate = false;
|
|
163
175
|
this.filterConfig = this.filterConfig.map(item => {
|
|
164
176
|
if (clear) {
|
|
165
177
|
if (item.value != undefined) {
|
|
178
|
+
this.calculateUpdateSequence(item);
|
|
166
179
|
upToDate = true;
|
|
167
180
|
}
|
|
168
181
|
return Object.assign(Object.assign({}, item), { value: undefined });
|
|
169
182
|
}
|
|
170
183
|
else {
|
|
171
184
|
if (item.id === newItem.id) {
|
|
172
|
-
|
|
185
|
+
const normalizedOne = this.normalizeItem(item);
|
|
186
|
+
const normalizedTwo = this.normalizeItem(newItem);
|
|
187
|
+
if (ObjectUtils.objectToString(normalizedOne) != ObjectUtils.objectToString(normalizedTwo)) {
|
|
188
|
+
this.calculateUpdateSequence(item);
|
|
189
|
+
}
|
|
190
|
+
upToDate = ObjectUtils.objectToString(normalizedOne.value) !== ObjectUtils.objectToString(normalizedTwo.value);
|
|
173
191
|
return newItem;
|
|
174
192
|
}
|
|
175
193
|
}
|
|
@@ -6,7 +6,7 @@ const SnkFilterBinarySelect = class {
|
|
|
6
6
|
registerInstance(this, hostRef);
|
|
7
7
|
}
|
|
8
8
|
isSelected(option) {
|
|
9
|
-
return this.
|
|
9
|
+
return this.value == undefined || this.value === option;
|
|
10
10
|
}
|
|
11
11
|
ezChangeListener(evt) {
|
|
12
12
|
if (!evt.detail) {
|
|
@@ -38,7 +38,7 @@ const SnkFilterDetail = class {
|
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
40
|
const ContentEditor = this.getContentEditor();
|
|
41
|
-
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
41
|
+
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -99,7 +99,7 @@ const SnkFilterItem = class {
|
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
101
|
if (period.start) {
|
|
102
|
-
return `${label}: A partir de ${dateFormater.format(period.
|
|
102
|
+
return `${label}: A partir de ${dateFormater.format(period.start)}`;
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
105
|
return `${label}: Até ${dateFormater.format(period.end)}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
2
|
import { DataUnit } from "@sankhyalabs/core";
|
|
3
3
|
import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/dataunit-fetcher";
|
|
4
|
-
import { RequestListener } from "../../lib/http/data-fetcher/DataFetcher";
|
|
4
|
+
import { RequestListener, RequestListenerParams } from "../../lib/http/data-fetcher/DataFetcher";
|
|
5
5
|
import ParametersFetcher from "../../lib/http/data-fetcher/fetchers/parameters-fecher";
|
|
6
6
|
import { MessageOptions, DialogType } from "@sankhyalabs/ezui/dist/collection/utils";
|
|
7
7
|
import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
|
|
@@ -189,11 +189,13 @@ export declare class SnkApplication {
|
|
|
189
189
|
}
|
|
190
190
|
declare class RequestListenerLoadingBar implements RequestListener {
|
|
191
191
|
readonly _debounceTime: number;
|
|
192
|
+
readonly _ignoredNameTypes: string[];
|
|
192
193
|
_timerLoading: any;
|
|
193
194
|
_countRequest: number;
|
|
194
195
|
loadingBar: HTMLEzLoadingBarElement;
|
|
195
|
-
onRequestStart(): void;
|
|
196
|
-
onRequestEnd(): void;
|
|
196
|
+
onRequestStart(param: RequestListenerParams): void;
|
|
197
|
+
onRequestEnd(param: RequestListenerParams): void;
|
|
198
|
+
private isIgnoreLoadingOnRequest;
|
|
197
199
|
}
|
|
198
200
|
declare class PendingPromise {
|
|
199
201
|
resolve: Function;
|
|
@@ -35,6 +35,7 @@ export declare class SnkFilterBar implements FilterProvider {
|
|
|
35
35
|
getFilterItems(): Array<HTMLElement>;
|
|
36
36
|
calculateUpdateSequence(item: SnkFilterItemConfig): void;
|
|
37
37
|
filterChangeListener(evt: CustomEvent): void;
|
|
38
|
+
normalizeItem(item: SnkFilterItemConfig): SnkFilterItemConfig;
|
|
38
39
|
updateFilter(newItem: SnkFilterItemConfig, clear?: boolean): boolean;
|
|
39
40
|
getAddListItems(): Array<ListItem>;
|
|
40
41
|
getActiveClass(): "" | "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active";
|