@sankhyalabs/sankhyablocks 3.4.0 → 3.4.1
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-8b5e3261.js → ConfigStorage-0a2db8e7.js} +61 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +49 -2
- package/dist/collection/lib/http/data-fetcher/interfaces/IClientEventResponse.js +1 -0
- package/dist/collection/lib/http/data-fetcher/recaller/DataFetcherRecaller.js +14 -0
- package/dist/components/DataFetcher.js +62 -2
- package/dist/esm/{ConfigStorage-4654f57b.js → ConfigStorage-f9eaa4bc.js} +62 -2
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +1 -1
- package/dist/esm/snk-data-exporter_8.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/sankhyablocks/{p-e906ba66.entry.js → p-231da738.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b326cf51.entry.js → p-24a74ea9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a2ea13ed.entry.js → p-445ff0af.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f559c71a.entry.js → p-943b9c98.entry.js} +1 -1
- package/dist/sankhyablocks/{p-93d8ea09.js → p-a0258616.js} +6 -6
- package/dist/sankhyablocks/{p-125c2d01.entry.js → p-bb445357.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -1
- package/dist/types/lib/http/data-fetcher/interfaces/IClientEventResponse.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/recaller/DataFetcherRecaller.d.ts +7 -0
- package/package.json +1 -1
|
@@ -6437,6 +6437,20 @@ class UrlUtils {
|
|
|
6437
6437
|
}
|
|
6438
6438
|
}
|
|
6439
6439
|
|
|
6440
|
+
class DataFetcherRecaller {
|
|
6441
|
+
constructor(serviceName, requestBody, callback) {
|
|
6442
|
+
this.serviceName = serviceName;
|
|
6443
|
+
this.requestBody = requestBody;
|
|
6444
|
+
this.callback = callback;
|
|
6445
|
+
}
|
|
6446
|
+
reCall(requestBody) {
|
|
6447
|
+
if (requestBody) {
|
|
6448
|
+
this.requestBody = requestBody;
|
|
6449
|
+
}
|
|
6450
|
+
DataFetcher.get().callServiceBroker(this.serviceName, this.requestBody);
|
|
6451
|
+
}
|
|
6452
|
+
}
|
|
6453
|
+
|
|
6440
6454
|
class DataFetcher {
|
|
6441
6455
|
constructor() {
|
|
6442
6456
|
this.GRAPHQL_PATH = "/mge/graphql";
|
|
@@ -6536,14 +6550,44 @@ class DataFetcher {
|
|
|
6536
6550
|
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`;
|
|
6537
6551
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6538
6552
|
const http = new XMLHttpRequest();
|
|
6553
|
+
var payloadJson = {};
|
|
6554
|
+
if ('string' == typeof payload) {
|
|
6555
|
+
payload = core.ObjectUtils.stringToObject(payload);
|
|
6556
|
+
}
|
|
6557
|
+
if (!payload.hasOwnProperty('requestBody')) {
|
|
6558
|
+
payloadJson['requestBody'] = payload;
|
|
6559
|
+
}
|
|
6560
|
+
else {
|
|
6561
|
+
payloadJson = payload;
|
|
6562
|
+
}
|
|
6563
|
+
for (let [key] of DataFetcher.clientEventsByID) {
|
|
6564
|
+
if (!payloadJson['requestBody'].hasOwnProperty('clientEventList')) {
|
|
6565
|
+
payloadJson['requestBody']['clientEventList'] = {
|
|
6566
|
+
clientEvent: []
|
|
6567
|
+
};
|
|
6568
|
+
}
|
|
6569
|
+
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
|
6570
|
+
}
|
|
6539
6571
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6540
6572
|
http.open("POST", url, true);
|
|
6541
6573
|
http.withCredentials = true;
|
|
6542
|
-
http.send(
|
|
6574
|
+
http.send(core.ObjectUtils.objectToString(payloadJson));
|
|
6543
6575
|
http.onreadystatechange = function () {
|
|
6544
6576
|
if (this.readyState == 4 && this.status == 200) {
|
|
6545
6577
|
try {
|
|
6546
6578
|
const jsonResp = JSON.parse(this.responseText);
|
|
6579
|
+
if (jsonResp.hasOwnProperty('clientEvents')) {
|
|
6580
|
+
jsonResp.clientEvents.forEach(clientEvent => {
|
|
6581
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
|
6582
|
+
var handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
|
6583
|
+
handlers.forEach(handler => {
|
|
6584
|
+
handler({ id: clientEvent.id, content: clientEvent }, new DataFetcherRecaller(serviceName, payloadJson, accept));
|
|
6585
|
+
});
|
|
6586
|
+
}
|
|
6587
|
+
});
|
|
6588
|
+
if (jsonResp.status == 4)
|
|
6589
|
+
return;
|
|
6590
|
+
}
|
|
6547
6591
|
if (jsonResp.status == 1) {
|
|
6548
6592
|
accept(jsonResp.responseBody);
|
|
6549
6593
|
}
|
|
@@ -6666,9 +6710,25 @@ class DataFetcher {
|
|
|
6666
6710
|
error.index = Number(requestIndex);
|
|
6667
6711
|
return error;
|
|
6668
6712
|
}
|
|
6713
|
+
static addClientEvent(eventID, handler) {
|
|
6714
|
+
let clientEvent = DataFetcher.clientEventsByID.get(eventID);
|
|
6715
|
+
if (clientEvent != undefined) {
|
|
6716
|
+
clientEvent.push(handler);
|
|
6717
|
+
}
|
|
6718
|
+
else {
|
|
6719
|
+
DataFetcher.clientEventsByID.set(eventID, [handler]);
|
|
6720
|
+
}
|
|
6721
|
+
}
|
|
6722
|
+
static hasClientEvent(eventID) {
|
|
6723
|
+
return DataFetcher.clientEventsByID.has(eventID);
|
|
6724
|
+
}
|
|
6725
|
+
static removeClientEvent(eventID) {
|
|
6726
|
+
return DataFetcher.clientEventsByID.delete(eventID);
|
|
6727
|
+
}
|
|
6669
6728
|
}
|
|
6670
6729
|
DataFetcher.appTagName = "snk-application";
|
|
6671
6730
|
DataFetcher.requestListener = [];
|
|
6731
|
+
DataFetcher.clientEventsByID = new Map();
|
|
6672
6732
|
class WaitingRequest {
|
|
6673
6733
|
constructor(req) {
|
|
6674
6734
|
this._resolve = () => { };
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
7
|
+
const ConfigStorage = require('./ConfigStorage-0a2db8e7.js');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
const SnkMessageBuilder = require('./SnkMessageBuilder-e6dee2c2.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const constants = require('./constants-8f3504ec.js');
|
|
8
8
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
9
9
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
10
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
10
|
+
const ConfigStorage = require('./ConfigStorage-0a2db8e7.js');
|
|
11
11
|
const index$1 = require('./index-f400b1d6.js');
|
|
12
12
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
13
13
|
const index$2 = require('./index-fc7ca86c.js');
|
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const index = require('./index-f400b1d6.js');
|
|
9
9
|
const constants = require('./constants-8f3504ec.js');
|
|
10
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
10
|
+
const ConfigStorage = require('./ConfigStorage-0a2db8e7.js');
|
|
11
11
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
|
12
12
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
13
13
|
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
|
@@ -7,7 +7,7 @@ const draggable_bundle = require('./draggable.bundle-82a25c06.js');
|
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
9
|
const constants = require('./constants-8f3504ec.js');
|
|
10
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
10
|
+
const ConfigStorage = require('./ConfigStorage-0a2db8e7.js');
|
|
11
11
|
require('./_commonjsHelpers-537d719a.js');
|
|
12
12
|
|
|
13
13
|
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config--z-index:var(--more-visible, 2);--snk-form-config--background-color:var(--background--xlight, #fff);--snk-form-config__icon--color:var(--text--disable, #AFB6C0);--snk-form-config__label-counter--font-weight:var(--text-weight--extra-small, 200);--snk-form-config__add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__add-group-container--background-color:var(--background--medium, #d2dce9);--snk-form-config__add-group-container--padding:var(--space--small, 6px);--snk-form-config__add-group-content--border:2px dashed var(--color-strokes, #DCE0E8);--snk-form-config__add-group-content--border-radius:var(--border--radius-small, 6px);--snk-form-config__add-group-label--padding:var(--space--large, 24px);--snk-form-config__btn-add-group--padding:var(--space--large, 24px) var(--space--medium, 12px) 0;--snk-form-config__btn-add-group-container--padding:var(--space--medium, 12px);--snk-form-config__btn-add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__btn-add-group-container--border:2px solid var(--color-strokes, #DCE0E8);--snk-form-config__btn-add-group-container--background-color:var(--background--body, #fafcff);display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--snk-form-config--z-index);background-color:var(--snk-form-config--background-color)}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--snk-form-config__icon--color)}.ez-box__label-counter.sc-snk-form-config{margin-top:-7px;font-weight:var(--snk-form-config__label-counter--font-weight)}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:var(--snk-form-config--background-color)}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--snk-form-config--z-index)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--snk-form-config__add-group-container--border-radius);background-color:var(--snk-form-config__add-group-container--background-color);padding:var(--snk-form-config__add-group-container--padding)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:var(--snk-form-config__add-group-content--border);border-radius:var(--snk-form-config__add-group-content--border-radius)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--snk-form-config__add-group-label--padding)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--snk-form-config__btn-add-group--padding)}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--snk-form-config__btn-add-group-container--padding);border-radius:var(--snk-form-config__btn-add-group-container--border-radius);border:var(--snk-form-config__btn-add-group-container--border);background-color:var(--snk-form-config__btn-add-group-container--background-color)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:var(--snk-form-config--background-color)}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -1))}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -2))}}";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
7
|
+
const ConfigStorage = require('./ConfigStorage-0a2db8e7.js');
|
|
8
8
|
const index$1 = require('./index-f400b1d6.js');
|
|
9
9
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ErrorException, WarningException } from '@sankhyalabs/core';
|
|
1
|
+
import { ErrorException, ObjectUtils, WarningException } from '@sankhyalabs/core';
|
|
2
2
|
import { batchRequests } from 'graphql-request';
|
|
3
3
|
import UrlUtils from "../../../lib/utils/urlutils";
|
|
4
4
|
import { StringUtils } from '@sankhyalabs/core';
|
|
5
|
+
import { DataFetcherRecaller } from './recaller/DataFetcherRecaller';
|
|
5
6
|
export class DataFetcher {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.GRAPHQL_PATH = "/mge/graphql";
|
|
@@ -101,14 +102,44 @@ export class DataFetcher {
|
|
|
101
102
|
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
103
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
103
104
|
const http = new XMLHttpRequest();
|
|
105
|
+
var payloadJson = {};
|
|
106
|
+
if ('string' == typeof payload) {
|
|
107
|
+
payload = ObjectUtils.stringToObject(payload);
|
|
108
|
+
}
|
|
109
|
+
if (!payload.hasOwnProperty('requestBody')) {
|
|
110
|
+
payloadJson['requestBody'] = payload;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
payloadJson = payload;
|
|
114
|
+
}
|
|
115
|
+
for (let [key] of DataFetcher.clientEventsByID) {
|
|
116
|
+
if (!payloadJson['requestBody'].hasOwnProperty('clientEventList')) {
|
|
117
|
+
payloadJson['requestBody']['clientEventList'] = {
|
|
118
|
+
clientEvent: []
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
|
122
|
+
}
|
|
104
123
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
105
124
|
http.open("POST", url, true);
|
|
106
125
|
http.withCredentials = true;
|
|
107
|
-
http.send(
|
|
126
|
+
http.send(ObjectUtils.objectToString(payloadJson));
|
|
108
127
|
http.onreadystatechange = function () {
|
|
109
128
|
if (this.readyState == 4 && this.status == 200) {
|
|
110
129
|
try {
|
|
111
130
|
const jsonResp = JSON.parse(this.responseText);
|
|
131
|
+
if (jsonResp.hasOwnProperty('clientEvents')) {
|
|
132
|
+
jsonResp.clientEvents.forEach(clientEvent => {
|
|
133
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
|
134
|
+
var handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
|
135
|
+
handlers.forEach(handler => {
|
|
136
|
+
handler({ id: clientEvent.id, content: clientEvent }, new DataFetcherRecaller(serviceName, payloadJson, accept));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
if (jsonResp.status == 4)
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
112
143
|
if (jsonResp.status == 1) {
|
|
113
144
|
accept(jsonResp.responseBody);
|
|
114
145
|
}
|
|
@@ -231,9 +262,25 @@ export class DataFetcher {
|
|
|
231
262
|
error.index = Number(requestIndex);
|
|
232
263
|
return error;
|
|
233
264
|
}
|
|
265
|
+
static addClientEvent(eventID, handler) {
|
|
266
|
+
let clientEvent = DataFetcher.clientEventsByID.get(eventID);
|
|
267
|
+
if (clientEvent != undefined) {
|
|
268
|
+
clientEvent.push(handler);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
DataFetcher.clientEventsByID.set(eventID, [handler]);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
static hasClientEvent(eventID) {
|
|
275
|
+
return DataFetcher.clientEventsByID.has(eventID);
|
|
276
|
+
}
|
|
277
|
+
static removeClientEvent(eventID) {
|
|
278
|
+
return DataFetcher.clientEventsByID.delete(eventID);
|
|
279
|
+
}
|
|
234
280
|
}
|
|
235
281
|
DataFetcher.appTagName = "snk-application";
|
|
236
282
|
DataFetcher.requestListener = [];
|
|
283
|
+
DataFetcher.clientEventsByID = new Map();
|
|
237
284
|
class WaitingRequest {
|
|
238
285
|
constructor(req) {
|
|
239
286
|
this._resolve = () => { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataFetcher } from "../DataFetcher";
|
|
2
|
+
export class DataFetcherRecaller {
|
|
3
|
+
constructor(serviceName, requestBody, callback) {
|
|
4
|
+
this.serviceName = serviceName;
|
|
5
|
+
this.requestBody = requestBody;
|
|
6
|
+
this.callback = callback;
|
|
7
|
+
}
|
|
8
|
+
reCall(requestBody) {
|
|
9
|
+
if (requestBody) {
|
|
10
|
+
this.requestBody = requestBody;
|
|
11
|
+
}
|
|
12
|
+
DataFetcher.get().callServiceBroker(this.serviceName, this.requestBody);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorException, WarningException, StringUtils } from '@sankhyalabs/core';
|
|
1
|
+
import { ErrorException, WarningException, ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
|
|
3
3
|
|
|
4
4
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
|
@@ -6435,6 +6435,20 @@ class UrlUtils {
|
|
|
6435
6435
|
}
|
|
6436
6436
|
}
|
|
6437
6437
|
|
|
6438
|
+
class DataFetcherRecaller {
|
|
6439
|
+
constructor(serviceName, requestBody, callback) {
|
|
6440
|
+
this.serviceName = serviceName;
|
|
6441
|
+
this.requestBody = requestBody;
|
|
6442
|
+
this.callback = callback;
|
|
6443
|
+
}
|
|
6444
|
+
reCall(requestBody) {
|
|
6445
|
+
if (requestBody) {
|
|
6446
|
+
this.requestBody = requestBody;
|
|
6447
|
+
}
|
|
6448
|
+
DataFetcher.get().callServiceBroker(this.serviceName, this.requestBody);
|
|
6449
|
+
}
|
|
6450
|
+
}
|
|
6451
|
+
|
|
6438
6452
|
class DataFetcher {
|
|
6439
6453
|
constructor() {
|
|
6440
6454
|
this.GRAPHQL_PATH = "/mge/graphql";
|
|
@@ -6534,14 +6548,44 @@ class DataFetcher {
|
|
|
6534
6548
|
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`;
|
|
6535
6549
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6536
6550
|
const http = new XMLHttpRequest();
|
|
6551
|
+
var payloadJson = {};
|
|
6552
|
+
if ('string' == typeof payload) {
|
|
6553
|
+
payload = ObjectUtils.stringToObject(payload);
|
|
6554
|
+
}
|
|
6555
|
+
if (!payload.hasOwnProperty('requestBody')) {
|
|
6556
|
+
payloadJson['requestBody'] = payload;
|
|
6557
|
+
}
|
|
6558
|
+
else {
|
|
6559
|
+
payloadJson = payload;
|
|
6560
|
+
}
|
|
6561
|
+
for (let [key] of DataFetcher.clientEventsByID) {
|
|
6562
|
+
if (!payloadJson['requestBody'].hasOwnProperty('clientEventList')) {
|
|
6563
|
+
payloadJson['requestBody']['clientEventList'] = {
|
|
6564
|
+
clientEvent: []
|
|
6565
|
+
};
|
|
6566
|
+
}
|
|
6567
|
+
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
|
6568
|
+
}
|
|
6537
6569
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6538
6570
|
http.open("POST", url, true);
|
|
6539
6571
|
http.withCredentials = true;
|
|
6540
|
-
http.send(
|
|
6572
|
+
http.send(ObjectUtils.objectToString(payloadJson));
|
|
6541
6573
|
http.onreadystatechange = function () {
|
|
6542
6574
|
if (this.readyState == 4 && this.status == 200) {
|
|
6543
6575
|
try {
|
|
6544
6576
|
const jsonResp = JSON.parse(this.responseText);
|
|
6577
|
+
if (jsonResp.hasOwnProperty('clientEvents')) {
|
|
6578
|
+
jsonResp.clientEvents.forEach(clientEvent => {
|
|
6579
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
|
6580
|
+
var handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
|
6581
|
+
handlers.forEach(handler => {
|
|
6582
|
+
handler({ id: clientEvent.id, content: clientEvent }, new DataFetcherRecaller(serviceName, payloadJson, accept));
|
|
6583
|
+
});
|
|
6584
|
+
}
|
|
6585
|
+
});
|
|
6586
|
+
if (jsonResp.status == 4)
|
|
6587
|
+
return;
|
|
6588
|
+
}
|
|
6545
6589
|
if (jsonResp.status == 1) {
|
|
6546
6590
|
accept(jsonResp.responseBody);
|
|
6547
6591
|
}
|
|
@@ -6664,9 +6708,25 @@ class DataFetcher {
|
|
|
6664
6708
|
error.index = Number(requestIndex);
|
|
6665
6709
|
return error;
|
|
6666
6710
|
}
|
|
6711
|
+
static addClientEvent(eventID, handler) {
|
|
6712
|
+
let clientEvent = DataFetcher.clientEventsByID.get(eventID);
|
|
6713
|
+
if (clientEvent != undefined) {
|
|
6714
|
+
clientEvent.push(handler);
|
|
6715
|
+
}
|
|
6716
|
+
else {
|
|
6717
|
+
DataFetcher.clientEventsByID.set(eventID, [handler]);
|
|
6718
|
+
}
|
|
6719
|
+
}
|
|
6720
|
+
static hasClientEvent(eventID) {
|
|
6721
|
+
return DataFetcher.clientEventsByID.has(eventID);
|
|
6722
|
+
}
|
|
6723
|
+
static removeClientEvent(eventID) {
|
|
6724
|
+
return DataFetcher.clientEventsByID.delete(eventID);
|
|
6725
|
+
}
|
|
6667
6726
|
}
|
|
6668
6727
|
DataFetcher.appTagName = "snk-application";
|
|
6669
6728
|
DataFetcher.requestListener = [];
|
|
6729
|
+
DataFetcher.clientEventsByID = new Map();
|
|
6670
6730
|
class WaitingRequest {
|
|
6671
6731
|
constructor(req) {
|
|
6672
6732
|
this._resolve = () => { };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorException, WarningException,
|
|
1
|
+
import { ErrorException, WarningException, ObjectUtils, StringUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
2
2
|
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-9943807e.js';
|
|
3
3
|
|
|
4
4
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
|
@@ -6435,6 +6435,20 @@ class UrlUtils {
|
|
|
6435
6435
|
}
|
|
6436
6436
|
}
|
|
6437
6437
|
|
|
6438
|
+
class DataFetcherRecaller {
|
|
6439
|
+
constructor(serviceName, requestBody, callback) {
|
|
6440
|
+
this.serviceName = serviceName;
|
|
6441
|
+
this.requestBody = requestBody;
|
|
6442
|
+
this.callback = callback;
|
|
6443
|
+
}
|
|
6444
|
+
reCall(requestBody) {
|
|
6445
|
+
if (requestBody) {
|
|
6446
|
+
this.requestBody = requestBody;
|
|
6447
|
+
}
|
|
6448
|
+
DataFetcher.get().callServiceBroker(this.serviceName, this.requestBody);
|
|
6449
|
+
}
|
|
6450
|
+
}
|
|
6451
|
+
|
|
6438
6452
|
class DataFetcher {
|
|
6439
6453
|
constructor() {
|
|
6440
6454
|
this.GRAPHQL_PATH = "/mge/graphql";
|
|
@@ -6534,14 +6548,44 @@ class DataFetcher {
|
|
|
6534
6548
|
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`;
|
|
6535
6549
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6536
6550
|
const http = new XMLHttpRequest();
|
|
6551
|
+
var payloadJson = {};
|
|
6552
|
+
if ('string' == typeof payload) {
|
|
6553
|
+
payload = ObjectUtils.stringToObject(payload);
|
|
6554
|
+
}
|
|
6555
|
+
if (!payload.hasOwnProperty('requestBody')) {
|
|
6556
|
+
payloadJson['requestBody'] = payload;
|
|
6557
|
+
}
|
|
6558
|
+
else {
|
|
6559
|
+
payloadJson = payload;
|
|
6560
|
+
}
|
|
6561
|
+
for (let [key] of DataFetcher.clientEventsByID) {
|
|
6562
|
+
if (!payloadJson['requestBody'].hasOwnProperty('clientEventList')) {
|
|
6563
|
+
payloadJson['requestBody']['clientEventList'] = {
|
|
6564
|
+
clientEvent: []
|
|
6565
|
+
};
|
|
6566
|
+
}
|
|
6567
|
+
payloadJson['requestBody']['clientEventList'].clientEvent.push({ $: key });
|
|
6568
|
+
}
|
|
6537
6569
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6538
6570
|
http.open("POST", url, true);
|
|
6539
6571
|
http.withCredentials = true;
|
|
6540
|
-
http.send(
|
|
6572
|
+
http.send(ObjectUtils.objectToString(payloadJson));
|
|
6541
6573
|
http.onreadystatechange = function () {
|
|
6542
6574
|
if (this.readyState == 4 && this.status == 200) {
|
|
6543
6575
|
try {
|
|
6544
6576
|
const jsonResp = JSON.parse(this.responseText);
|
|
6577
|
+
if (jsonResp.hasOwnProperty('clientEvents')) {
|
|
6578
|
+
jsonResp.clientEvents.forEach(clientEvent => {
|
|
6579
|
+
if (DataFetcher.hasClientEvent(clientEvent.id)) {
|
|
6580
|
+
var handlers = DataFetcher.clientEventsByID.get(clientEvent.id);
|
|
6581
|
+
handlers.forEach(handler => {
|
|
6582
|
+
handler({ id: clientEvent.id, content: clientEvent }, new DataFetcherRecaller(serviceName, payloadJson, accept));
|
|
6583
|
+
});
|
|
6584
|
+
}
|
|
6585
|
+
});
|
|
6586
|
+
if (jsonResp.status == 4)
|
|
6587
|
+
return;
|
|
6588
|
+
}
|
|
6545
6589
|
if (jsonResp.status == 1) {
|
|
6546
6590
|
accept(jsonResp.responseBody);
|
|
6547
6591
|
}
|
|
@@ -6664,9 +6708,25 @@ class DataFetcher {
|
|
|
6664
6708
|
error.index = Number(requestIndex);
|
|
6665
6709
|
return error;
|
|
6666
6710
|
}
|
|
6711
|
+
static addClientEvent(eventID, handler) {
|
|
6712
|
+
let clientEvent = DataFetcher.clientEventsByID.get(eventID);
|
|
6713
|
+
if (clientEvent != undefined) {
|
|
6714
|
+
clientEvent.push(handler);
|
|
6715
|
+
}
|
|
6716
|
+
else {
|
|
6717
|
+
DataFetcher.clientEventsByID.set(eventID, [handler]);
|
|
6718
|
+
}
|
|
6719
|
+
}
|
|
6720
|
+
static hasClientEvent(eventID) {
|
|
6721
|
+
return DataFetcher.clientEventsByID.has(eventID);
|
|
6722
|
+
}
|
|
6723
|
+
static removeClientEvent(eventID) {
|
|
6724
|
+
return DataFetcher.clientEventsByID.delete(eventID);
|
|
6725
|
+
}
|
|
6667
6726
|
}
|
|
6668
6727
|
DataFetcher.appTagName = "snk-application";
|
|
6669
6728
|
DataFetcher.requestListener = [];
|
|
6729
|
+
DataFetcher.clientEventsByID = new Map();
|
|
6670
6730
|
class WaitingRequest {
|
|
6671
6731
|
constructor(req) {
|
|
6672
6732
|
this._resolve = () => { };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
|
|
2
2
|
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ElementIDUtils, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
|
-
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher, G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage-
|
|
3
|
+
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher, G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage-f9eaa4bc.js';
|
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-f0d50bd6.js';
|
|
6
6
|
import './_commonjsHelpers-9943807e.js';
|
|
@@ -3,7 +3,7 @@ import { ApplicationContext, ElementIDUtils, DataType } from '@sankhyalabs/core'
|
|
|
3
3
|
import { c as VIEW_MODE, A as ACTION_CONFIG } from './constants-965d7a7f.js';
|
|
4
4
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
|
5
5
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
6
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
6
|
+
import { C as ConfigStorage } from './ConfigStorage-f9eaa4bc.js';
|
|
7
7
|
import { P as PresentationMode } from './index-bd13bdcf.js';
|
|
8
8
|
import { T as TaskbarProcessor } from './taskbar-processor-c2a99aba.js';
|
|
9
9
|
import { s as store } from './index-e467ade5.js';
|
|
@@ -3,7 +3,7 @@ import { ObjectUtils, ApplicationContext, ElementIDUtils, DataType, StringUtils,
|
|
|
3
3
|
import { ApplicationUtils, DialogType, CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { D as DataExporterOption, d as DataExporterFormat, e as DataExporterType, P as PresentationMode } from './index-bd13bdcf.js';
|
|
5
5
|
import { d as KEY_PORT_EXPORT, W as WEB_CONNECTION, R as REPORT_LAUNCHER_RESOURCE_ID, O as ORDER_VALUES } from './constants-965d7a7f.js';
|
|
6
|
-
import { D as DataFetcher, C as ConfigStorage } from './ConfigStorage-
|
|
6
|
+
import { D as DataFetcher, C as ConfigStorage } from './ConfigStorage-f9eaa4bc.js';
|
|
7
7
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
|
8
8
|
import { F as FilterItemType } from './filter-item-type.enum-a79b2fa8.js';
|
|
9
9
|
import { ModalAction, ModalButtonStatus } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
@@ -3,7 +3,7 @@ import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
|
|
|
3
3
|
import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { C as CONFIG_EVENTS, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-965d7a7f.js';
|
|
6
|
-
import { a as UserConfigType, C as ConfigStorage } from './ConfigStorage-
|
|
6
|
+
import { a as UserConfigType, C as ConfigStorage } from './ConfigStorage-f9eaa4bc.js';
|
|
7
7
|
import './_commonjsHelpers-9943807e.js';
|
|
8
8
|
|
|
9
9
|
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config--z-index:var(--more-visible, 2);--snk-form-config--background-color:var(--background--xlight, #fff);--snk-form-config__icon--color:var(--text--disable, #AFB6C0);--snk-form-config__label-counter--font-weight:var(--text-weight--extra-small, 200);--snk-form-config__add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__add-group-container--background-color:var(--background--medium, #d2dce9);--snk-form-config__add-group-container--padding:var(--space--small, 6px);--snk-form-config__add-group-content--border:2px dashed var(--color-strokes, #DCE0E8);--snk-form-config__add-group-content--border-radius:var(--border--radius-small, 6px);--snk-form-config__add-group-label--padding:var(--space--large, 24px);--snk-form-config__btn-add-group--padding:var(--space--large, 24px) var(--space--medium, 12px) 0;--snk-form-config__btn-add-group-container--padding:var(--space--medium, 12px);--snk-form-config__btn-add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__btn-add-group-container--border:2px solid var(--color-strokes, #DCE0E8);--snk-form-config__btn-add-group-container--background-color:var(--background--body, #fafcff);display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--snk-form-config--z-index);background-color:var(--snk-form-config--background-color)}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--snk-form-config__icon--color)}.ez-box__label-counter.sc-snk-form-config{margin-top:-7px;font-weight:var(--snk-form-config__label-counter--font-weight)}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:var(--snk-form-config--background-color)}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--snk-form-config--z-index)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--snk-form-config__add-group-container--border-radius);background-color:var(--snk-form-config__add-group-container--background-color);padding:var(--snk-form-config__add-group-container--padding)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:var(--snk-form-config__add-group-content--border);border-radius:var(--snk-form-config__add-group-content--border-radius)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--snk-form-config__add-group-label--padding)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--snk-form-config__btn-add-group--padding)}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--snk-form-config__btn-add-group-container--padding);border-radius:var(--snk-form-config__btn-add-group-container--border-radius);border:var(--snk-form-config__btn-add-group-container--border);background-color:var(--snk-form-config__btn-add-group-container--background-color)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:var(--snk-form-config--background-color)}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -1))}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -2))}}";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
|
|
2
2
|
import { DateUtils, ObjectUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
3
|
+
import { C as ConfigStorage } from './ConfigStorage-f9eaa4bc.js';
|
|
4
4
|
import { P as PresentationMode } from './index-bd13bdcf.js';
|
|
5
5
|
import { T as TaskbarProcessor } from './taskbar-processor-c2a99aba.js';
|
|
6
6
|
import './_commonjsHelpers-9943807e.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,g as i}from"./p-b9667fbe.js";import{WaitingChangeException as r,WarningException as n,ErrorException as a,ObjectUtils as o,DataType as c,DataUnit as h,StringUtils as u,ChangeOperation as l,DateUtils as d,DependencyType as p,ElementIDUtils as m,ApplicationContext as f,ErrorTracking as y}from"@sankhyalabs/core";import{d as g,D as w,R as v,U as I,F as $,G as _,C as P}from"./p-
|
|
1
|
+
import{r as t,c as e,h as s,g as i}from"./p-b9667fbe.js";import{WaitingChangeException as r,WarningException as n,ErrorException as a,ObjectUtils as o,DataType as c,DataUnit as h,StringUtils as u,ChangeOperation as l,DateUtils as d,DependencyType as p,ElementIDUtils as m,ApplicationContext as f,ErrorTracking as y}from"@sankhyalabs/core";import{d as g,D as w,R as v,U as I,F as $,G as _,C as P}from"./p-a0258616.js";import{ApplicationUtils as D}from"@sankhyalabs/ezui/dist/collection/utils";import{S}from"./p-32d02fa4.js";import"./p-112455b1.js";class C{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const e=t.reason;e instanceof r||(e?this.processException(e):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t.errorCode+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t.errorCode+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t)),t instanceof r||t instanceof n?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((e=>{if(e)if(t instanceof Error)this._app.error(t.name,t.message);else{const e=(null==t?void 0:t.title)||"Erro detectado",s="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(e,s)}}))}}class A{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",g.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
|
2
2
|
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
|
3
3
|
value
|
|
4
4
|
label
|