@sankhyalabs/sankhyablocks 1.3.34 → 1.4.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/SnkMessageBuilder-d8215915.js +221 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-b8158822.js +6 -0
- package/dist/cjs/dom-36862b77.js +75 -0
- package/dist/cjs/filter-item-type.enum-3daf58d3.js +16 -0
- package/dist/cjs/index-84fe3b86.js +20 -0
- package/dist/cjs/index-93965c41.js +141 -0
- package/dist/cjs/index-b0b676c5.js +3298 -0
- package/dist/cjs/index-e90ae303.js +2408 -0
- package/dist/cjs/loader.cjs.js +19 -3
- package/dist/cjs/sankhyablocks.cjs.js +117 -5
- package/dist/cjs/shadow-css-346c0795.js +389 -0
- package/dist/cjs/snk-application.cjs.entry.js +744 -174
- package/dist/cjs/snk-crud.cjs.entry.js +70 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +272 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +466 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
- package/dist/cjs/snk-filter-detail.cjs.entry.js +84 -0
- package/dist/cjs/snk-filter-item.cjs.entry.js +177 -0
- package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
- package/dist/cjs/snk-filter-modal.cjs.entry.js +37 -0
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
- package/dist/cjs/snk-filter-number.cjs.entry.js +24 -0
- package/dist/cjs/snk-filter-period.cjs.entry.js +37 -0
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
- package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
- package/dist/cjs/snk-form.cjs.entry.js +133 -0
- package/dist/cjs/snk-grid.cjs.entry.js +79 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-taskbar.cjs.entry.js +160 -0
- package/dist/cjs/taskbar-elements-283c737e.js +93 -0
- package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +19 -2
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +9 -2
- package/dist/collection/components/snk-application/snk-application.js +1179 -627
- package/dist/collection/components/snk-crud/snk-crud.css +6 -0
- package/dist/collection/components/snk-crud/snk-crud.js +201 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +517 -0
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +65 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +78 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +161 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +12 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +153 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +278 -0
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +233 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +196 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +136 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +452 -0
- package/dist/collection/components/snk-form/snk-form.css +34 -0
- package/dist/collection/components/snk-form/snk-form.js +258 -0
- package/dist/collection/components/snk-grid/snk-grid.css +18 -0
- package/dist/collection/components/snk-grid/snk-grid.js +203 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -79
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +86 -0
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +307 -0
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +37 -12
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +62 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
- package/dist/collection/lib/index.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +121 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +23 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +30 -0
- package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
- package/dist/components/SnkMessageBuilder.js +199 -0
- package/dist/components/filter-item-type.enum.js +14 -0
- package/dist/components/index.d.ts +20 -5
- package/dist/components/index.js +24 -0
- package/dist/components/index2.js +2394 -0
- package/dist/components/index3.js +139 -0
- package/dist/components/snk-application2.js +727 -146
- package/dist/components/snk-crud.d.ts +11 -0
- package/dist/components/snk-crud.js +139 -0
- package/dist/components/snk-data-unit.d.ts +11 -0
- package/dist/components/snk-data-unit.js +294 -0
- package/dist/components/snk-filter-bar.d.ts +11 -0
- package/dist/components/snk-filter-bar.js +6 -0
- package/dist/components/snk-filter-bar2.js +504 -0
- package/dist/components/snk-filter-binary-select.d.ts +11 -0
- package/dist/components/snk-filter-binary-select.js +63 -0
- package/dist/components/snk-filter-detail.d.ts +11 -0
- package/dist/components/snk-filter-detail.js +6 -0
- package/dist/components/snk-filter-detail2.js +98 -0
- package/dist/components/snk-filter-item.d.ts +11 -0
- package/dist/components/snk-filter-item.js +6 -0
- package/dist/components/snk-filter-item2.js +198 -0
- package/dist/components/snk-filter-list.d.ts +11 -0
- package/dist/components/snk-filter-list.js +6 -0
- package/dist/components/snk-filter-list2.js +111 -0
- package/dist/components/snk-filter-modal.d.ts +11 -0
- package/dist/components/snk-filter-modal.js +6 -0
- package/dist/components/snk-filter-modal2.js +73 -0
- package/dist/components/snk-filter-multi-select.d.ts +11 -0
- package/dist/components/snk-filter-multi-select.js +39 -0
- package/dist/components/snk-filter-number.d.ts +11 -0
- package/dist/components/snk-filter-number.js +40 -0
- package/dist/components/snk-filter-period.d.ts +11 -0
- package/dist/components/snk-filter-period.js +53 -0
- package/dist/components/snk-filter-personalized.d.ts +11 -0
- package/dist/components/snk-filter-personalized.js +107 -0
- package/dist/components/snk-filter-search.d.ts +11 -0
- package/dist/components/snk-filter-search.js +62 -0
- package/dist/components/snk-filter-text.d.ts +11 -0
- package/dist/components/snk-filter-text.js +38 -0
- package/dist/components/snk-form.d.ts +11 -0
- package/dist/components/snk-form.js +6 -0
- package/dist/components/snk-form2.js +159 -0
- package/dist/components/snk-grid.d.ts +11 -0
- package/dist/components/snk-grid.js +6 -0
- package/dist/components/snk-grid2.js +133 -0
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-taskbar.d.ts +11 -0
- package/dist/components/snk-taskbar.js +6 -0
- package/dist/components/snk-taskbar2.js +264 -0
- package/dist/components/taskbar-processor.js +45 -0
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/esm/SnkMessageBuilder-35a20271.js +199 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-b3f2ee8d.js +4 -0
- package/dist/esm/dom-665d6011.js +73 -0
- package/dist/esm/filter-item-type.enum-a79b2fa8.js +14 -0
- package/dist/esm/index-2b4d2d14.js +3262 -0
- package/dist/esm/index-5992b7e6.js +139 -0
- package/dist/esm/index-c683b2b0.js +2394 -0
- package/dist/esm/index-c71285cb.js +17 -0
- package/dist/esm/loader.js +19 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/sankhyablocks.js +117 -5
- package/dist/esm/shadow-css-b18e99d7.js +387 -0
- package/dist/esm/snk-application.entry.js +717 -147
- package/dist/esm/snk-crud.entry.js +66 -0
- package/dist/esm/snk-data-unit.entry.js +268 -0
- package/dist/esm/snk-filter-bar.entry.js +462 -0
- package/dist/esm/snk-filter-binary-select.entry.js +43 -0
- package/dist/esm/snk-filter-detail.entry.js +80 -0
- package/dist/esm/snk-filter-item.entry.js +173 -0
- package/dist/esm/snk-filter-list.entry.js +87 -0
- package/dist/esm/snk-filter-modal.entry.js +33 -0
- package/dist/esm/snk-filter-multi-select.entry.js +19 -0
- package/dist/esm/snk-filter-number.entry.js +20 -0
- package/dist/esm/snk-filter-period.entry.js +33 -0
- package/dist/esm/snk-filter-personalized.entry.js +85 -0
- package/dist/esm/snk-filter-search.entry.js +40 -0
- package/dist/esm/snk-filter-text.entry.js +18 -0
- package/dist/esm/snk-form.entry.js +129 -0
- package/dist/esm/snk-grid.entry.js +75 -0
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/snk-taskbar.entry.js +156 -0
- package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
- package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/SnkMessageBuilder-35a20271.js +199 -0
- package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
- package/dist/sankhyablocks/dom-665d6011.js +73 -0
- package/dist/sankhyablocks/filter-item-type.enum-a79b2fa8.js +14 -0
- package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
- package/dist/sankhyablocks/index-5992b7e6.js +139 -0
- package/dist/sankhyablocks/index-c683b2b0.js +2394 -0
- package/dist/sankhyablocks/index-c71285cb.js +17 -0
- package/dist/sankhyablocks/index.esm.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
- package/dist/sankhyablocks/snk-application.entry.js +8166 -0
- package/dist/sankhyablocks/snk-crud.entry.js +66 -0
- package/dist/sankhyablocks/snk-data-unit.entry.js +268 -0
- package/dist/sankhyablocks/snk-filter-bar.entry.js +462 -0
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
- package/dist/sankhyablocks/snk-filter-detail.entry.js +80 -0
- package/dist/sankhyablocks/snk-filter-item.entry.js +173 -0
- package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
- package/dist/sankhyablocks/snk-filter-modal.entry.js +33 -0
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
- package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
- package/dist/sankhyablocks/snk-filter-period.entry.js +33 -0
- package/dist/sankhyablocks/snk-filter-personalized.entry.js +85 -0
- package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
- package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
- package/dist/sankhyablocks/snk-form.entry.js +129 -0
- package/dist/sankhyablocks/snk-grid.entry.js +75 -0
- package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
- package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
- package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
- package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
- package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
- package/dist/types/components/snk-application/snk-application.d.ts +149 -16
- package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +14 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +23 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +11 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +16 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +23 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +84 -0
- package/dist/types/components.d.ts +744 -8
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
- package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +15 -4
- package/loader/package.json +1 -0
- package/package.json +5 -5
- package/react/components.d.ts +0 -2
- package/react/components.js +0 -2
- package/react/components.js.map +1 -1
- package/dist/cjs/index-1133bc2a.js +0 -1235
- package/dist/esm/index-ffda6382.js +0 -1208
- package/dist/sankhyablocks/p-2a7b4cb3.entry.js +0 -1
- package/dist/sankhyablocks/p-9520d78a.entry.js +0 -1
- package/dist/sankhyablocks/p-98e8490d.entry.js +0 -69
- package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
|
@@ -2,23 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
5
|
+
const index$2 = require('./index-b0b676c5.js');
|
|
6
|
+
const index$1 = require('./index-e90ae303.js');
|
|
7
|
+
const index$3 = require('./index-93965c41.js');
|
|
8
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-d8215915.js');
|
|
9
9
|
|
|
10
10
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
11
11
|
|
|
12
|
+
function getDefaultExportFromCjs (x) {
|
|
13
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
function createCommonjsModule(fn, basedir, module) {
|
|
13
17
|
return module = {
|
|
14
18
|
path: basedir,
|
|
15
19
|
exports: {},
|
|
16
20
|
require: function (path, base) {
|
|
17
|
-
return commonjsRequire();
|
|
21
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
18
22
|
}
|
|
19
23
|
}, fn(module, module.exports), module.exports;
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
27
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
31
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getAugmentedNamespace(n) {
|
|
35
|
+
if (n.__esModule) return n;
|
|
36
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
37
|
+
Object.keys(n).forEach(function (k) {
|
|
38
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
39
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return n[k];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
return a;
|
|
47
|
+
}
|
|
48
|
+
|
|
22
49
|
function commonjsRequire () {
|
|
23
50
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
24
51
|
}
|
|
@@ -35,7 +62,7 @@ return new F();
|
|
|
35
62
|
})();
|
|
36
63
|
(function(self) {
|
|
37
64
|
|
|
38
|
-
(
|
|
65
|
+
var irrelevant = (function (exports) {
|
|
39
66
|
|
|
40
67
|
var support = {
|
|
41
68
|
searchParams: 'URLSearchParams' in self,
|
|
@@ -563,7 +590,7 @@ return new F();
|
|
|
563
590
|
|
|
564
591
|
return exports;
|
|
565
592
|
|
|
566
|
-
})
|
|
593
|
+
})({});
|
|
567
594
|
})(__self__);
|
|
568
595
|
__self__.fetch.ponyfill = true;
|
|
569
596
|
// Remove "polyfill" property added by whatwg-fetch
|
|
@@ -580,7 +607,10 @@ exports.Response = ctx.Response;
|
|
|
580
607
|
module.exports = exports;
|
|
581
608
|
});
|
|
582
609
|
|
|
610
|
+
const browserPonyfill$1 = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill);
|
|
611
|
+
|
|
583
612
|
var isObjectLike_1 = createCommonjsModule(function (module, exports) {
|
|
613
|
+
'use strict';
|
|
584
614
|
|
|
585
615
|
Object.defineProperty(exports, '__esModule', {
|
|
586
616
|
value: true,
|
|
@@ -596,7 +626,10 @@ function isObjectLike(value) {
|
|
|
596
626
|
}
|
|
597
627
|
});
|
|
598
628
|
|
|
629
|
+
const isObjectLike = /*@__PURE__*/getDefaultExportFromCjs(isObjectLike_1);
|
|
630
|
+
|
|
599
631
|
var invariant_1 = createCommonjsModule(function (module, exports) {
|
|
632
|
+
'use strict';
|
|
600
633
|
|
|
601
634
|
Object.defineProperty(exports, '__esModule', {
|
|
602
635
|
value: true,
|
|
@@ -614,7 +647,10 @@ function invariant(condition, message) {
|
|
|
614
647
|
}
|
|
615
648
|
});
|
|
616
649
|
|
|
650
|
+
const invariant = /*@__PURE__*/getDefaultExportFromCjs(invariant_1);
|
|
651
|
+
|
|
617
652
|
var location_1 = createCommonjsModule(function (module, exports) {
|
|
653
|
+
'use strict';
|
|
618
654
|
|
|
619
655
|
Object.defineProperty(exports, '__esModule', {
|
|
620
656
|
value: true,
|
|
@@ -654,7 +690,10 @@ function getLocation(source, position) {
|
|
|
654
690
|
}
|
|
655
691
|
});
|
|
656
692
|
|
|
693
|
+
const location$1 = /*@__PURE__*/getDefaultExportFromCjs(location_1);
|
|
694
|
+
|
|
657
695
|
var printLocation_1 = createCommonjsModule(function (module, exports) {
|
|
696
|
+
'use strict';
|
|
658
697
|
|
|
659
698
|
Object.defineProperty(exports, '__esModule', {
|
|
660
699
|
value: true,
|
|
@@ -730,7 +769,10 @@ function printPrefixedLines(lines) {
|
|
|
730
769
|
}
|
|
731
770
|
});
|
|
732
771
|
|
|
772
|
+
const printLocation = /*@__PURE__*/getDefaultExportFromCjs(printLocation_1);
|
|
773
|
+
|
|
733
774
|
var GraphQLError_1 = createCommonjsModule(function (module, exports) {
|
|
775
|
+
'use strict';
|
|
734
776
|
|
|
735
777
|
Object.defineProperty(exports, '__esModule', {
|
|
736
778
|
value: true,
|
|
@@ -999,7 +1041,10 @@ function formatError(error) {
|
|
|
999
1041
|
}
|
|
1000
1042
|
});
|
|
1001
1043
|
|
|
1044
|
+
const GraphQLError = /*@__PURE__*/getDefaultExportFromCjs(GraphQLError_1);
|
|
1045
|
+
|
|
1002
1046
|
var syntaxError_1 = createCommonjsModule(function (module, exports) {
|
|
1047
|
+
'use strict';
|
|
1003
1048
|
|
|
1004
1049
|
Object.defineProperty(exports, '__esModule', {
|
|
1005
1050
|
value: true,
|
|
@@ -1020,7 +1065,10 @@ function syntaxError(source, position, description) {
|
|
|
1020
1065
|
}
|
|
1021
1066
|
});
|
|
1022
1067
|
|
|
1068
|
+
const syntaxError = /*@__PURE__*/getDefaultExportFromCjs(syntaxError_1);
|
|
1069
|
+
|
|
1023
1070
|
var ast = createCommonjsModule(function (module, exports) {
|
|
1071
|
+
'use strict';
|
|
1024
1072
|
|
|
1025
1073
|
Object.defineProperty(exports, '__esModule', {
|
|
1026
1074
|
value: true,
|
|
@@ -1236,7 +1284,7 @@ function isNode(maybeNode) {
|
|
|
1236
1284
|
}
|
|
1237
1285
|
/** Name */
|
|
1238
1286
|
|
|
1239
|
-
|
|
1287
|
+
var OperationTypeNode;
|
|
1240
1288
|
exports.OperationTypeNode = OperationTypeNode;
|
|
1241
1289
|
|
|
1242
1290
|
(function (OperationTypeNode) {
|
|
@@ -1246,7 +1294,10 @@ exports.OperationTypeNode = OperationTypeNode;
|
|
|
1246
1294
|
})(OperationTypeNode || (exports.OperationTypeNode = OperationTypeNode = {}));
|
|
1247
1295
|
});
|
|
1248
1296
|
|
|
1297
|
+
const ast$1 = /*@__PURE__*/getDefaultExportFromCjs(ast);
|
|
1298
|
+
|
|
1249
1299
|
var directiveLocation = createCommonjsModule(function (module, exports) {
|
|
1300
|
+
'use strict';
|
|
1250
1301
|
|
|
1251
1302
|
Object.defineProperty(exports, '__esModule', {
|
|
1252
1303
|
value: true,
|
|
@@ -1256,13 +1307,7 @@ exports.DirectiveLocation = void 0;
|
|
|
1256
1307
|
/**
|
|
1257
1308
|
* The set of allowed directive location values.
|
|
1258
1309
|
*/
|
|
1259
|
-
|
|
1260
|
-
/**
|
|
1261
|
-
* The enum type representing the directive location values.
|
|
1262
|
-
*
|
|
1263
|
-
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1264
|
-
*/
|
|
1265
|
-
|
|
1310
|
+
var DirectiveLocation;
|
|
1266
1311
|
exports.DirectiveLocation = DirectiveLocation;
|
|
1267
1312
|
|
|
1268
1313
|
(function (DirectiveLocation) {
|
|
@@ -1286,9 +1331,17 @@ exports.DirectiveLocation = DirectiveLocation;
|
|
|
1286
1331
|
DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';
|
|
1287
1332
|
DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';
|
|
1288
1333
|
})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {}));
|
|
1334
|
+
/**
|
|
1335
|
+
* The enum type representing the directive location values.
|
|
1336
|
+
*
|
|
1337
|
+
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1338
|
+
*/
|
|
1289
1339
|
});
|
|
1290
1340
|
|
|
1341
|
+
const directiveLocation$1 = /*@__PURE__*/getDefaultExportFromCjs(directiveLocation);
|
|
1342
|
+
|
|
1291
1343
|
var kinds = createCommonjsModule(function (module, exports) {
|
|
1344
|
+
'use strict';
|
|
1292
1345
|
|
|
1293
1346
|
Object.defineProperty(exports, '__esModule', {
|
|
1294
1347
|
value: true,
|
|
@@ -1298,13 +1351,7 @@ exports.Kind = void 0;
|
|
|
1298
1351
|
/**
|
|
1299
1352
|
* The set of allowed kind values for AST nodes.
|
|
1300
1353
|
*/
|
|
1301
|
-
|
|
1302
|
-
/**
|
|
1303
|
-
* The enum type representing the possible kind values of AST nodes.
|
|
1304
|
-
*
|
|
1305
|
-
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1306
|
-
*/
|
|
1307
|
-
|
|
1354
|
+
var Kind;
|
|
1308
1355
|
exports.Kind = Kind;
|
|
1309
1356
|
|
|
1310
1357
|
(function (Kind) {
|
|
@@ -1352,9 +1399,17 @@ exports.Kind = Kind;
|
|
|
1352
1399
|
Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';
|
|
1353
1400
|
Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';
|
|
1354
1401
|
})(Kind || (exports.Kind = Kind = {}));
|
|
1402
|
+
/**
|
|
1403
|
+
* The enum type representing the possible kind values of AST nodes.
|
|
1404
|
+
*
|
|
1405
|
+
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1406
|
+
*/
|
|
1355
1407
|
});
|
|
1356
1408
|
|
|
1409
|
+
const kinds$1 = /*@__PURE__*/getDefaultExportFromCjs(kinds);
|
|
1410
|
+
|
|
1357
1411
|
var characterClasses = createCommonjsModule(function (module, exports) {
|
|
1412
|
+
'use strict';
|
|
1358
1413
|
|
|
1359
1414
|
Object.defineProperty(exports, '__esModule', {
|
|
1360
1415
|
value: true,
|
|
@@ -1431,7 +1486,10 @@ function isNameContinue(code) {
|
|
|
1431
1486
|
}
|
|
1432
1487
|
});
|
|
1433
1488
|
|
|
1489
|
+
const characterClasses$1 = /*@__PURE__*/getDefaultExportFromCjs(characterClasses);
|
|
1490
|
+
|
|
1434
1491
|
var blockString = createCommonjsModule(function (module, exports) {
|
|
1492
|
+
'use strict';
|
|
1435
1493
|
|
|
1436
1494
|
Object.defineProperty(exports, '__esModule', {
|
|
1437
1495
|
value: true,
|
|
@@ -1628,7 +1686,10 @@ function printBlockString(value, options) {
|
|
|
1628
1686
|
}
|
|
1629
1687
|
});
|
|
1630
1688
|
|
|
1689
|
+
const blockString$1 = /*@__PURE__*/getDefaultExportFromCjs(blockString);
|
|
1690
|
+
|
|
1631
1691
|
var tokenKind = createCommonjsModule(function (module, exports) {
|
|
1692
|
+
'use strict';
|
|
1632
1693
|
|
|
1633
1694
|
Object.defineProperty(exports, '__esModule', {
|
|
1634
1695
|
value: true,
|
|
@@ -1639,13 +1700,7 @@ exports.TokenKind = void 0;
|
|
|
1639
1700
|
* An exported enum describing the different kinds of tokens that the
|
|
1640
1701
|
* lexer emits.
|
|
1641
1702
|
*/
|
|
1642
|
-
|
|
1643
|
-
/**
|
|
1644
|
-
* The enum type representing the token kinds values.
|
|
1645
|
-
*
|
|
1646
|
-
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1647
|
-
*/
|
|
1648
|
-
|
|
1703
|
+
var TokenKind;
|
|
1649
1704
|
exports.TokenKind = TokenKind;
|
|
1650
1705
|
|
|
1651
1706
|
(function (TokenKind) {
|
|
@@ -1672,9 +1727,17 @@ exports.TokenKind = TokenKind;
|
|
|
1672
1727
|
TokenKind['BLOCK_STRING'] = 'BlockString';
|
|
1673
1728
|
TokenKind['COMMENT'] = 'Comment';
|
|
1674
1729
|
})(TokenKind || (exports.TokenKind = TokenKind = {}));
|
|
1730
|
+
/**
|
|
1731
|
+
* The enum type representing the token kinds values.
|
|
1732
|
+
*
|
|
1733
|
+
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1734
|
+
*/
|
|
1675
1735
|
});
|
|
1676
1736
|
|
|
1737
|
+
const tokenKind$1 = /*@__PURE__*/getDefaultExportFromCjs(tokenKind);
|
|
1738
|
+
|
|
1677
1739
|
var lexer = createCommonjsModule(function (module, exports) {
|
|
1740
|
+
'use strict';
|
|
1678
1741
|
|
|
1679
1742
|
Object.defineProperty(exports, '__esModule', {
|
|
1680
1743
|
value: true,
|
|
@@ -2682,7 +2745,10 @@ function readName(lexer, start) {
|
|
|
2682
2745
|
}
|
|
2683
2746
|
});
|
|
2684
2747
|
|
|
2748
|
+
const lexer$1 = /*@__PURE__*/getDefaultExportFromCjs(lexer);
|
|
2749
|
+
|
|
2685
2750
|
var devAssert_1 = createCommonjsModule(function (module, exports) {
|
|
2751
|
+
'use strict';
|
|
2686
2752
|
|
|
2687
2753
|
Object.defineProperty(exports, '__esModule', {
|
|
2688
2754
|
value: true,
|
|
@@ -2698,7 +2764,10 @@ function devAssert(condition, message) {
|
|
|
2698
2764
|
}
|
|
2699
2765
|
});
|
|
2700
2766
|
|
|
2767
|
+
const devAssert = /*@__PURE__*/getDefaultExportFromCjs(devAssert_1);
|
|
2768
|
+
|
|
2701
2769
|
var inspect_1 = createCommonjsModule(function (module, exports) {
|
|
2770
|
+
'use strict';
|
|
2702
2771
|
|
|
2703
2772
|
Object.defineProperty(exports, '__esModule', {
|
|
2704
2773
|
value: true,
|
|
@@ -2821,7 +2890,10 @@ function getObjectTag(object) {
|
|
|
2821
2890
|
}
|
|
2822
2891
|
});
|
|
2823
2892
|
|
|
2893
|
+
const inspect = /*@__PURE__*/getDefaultExportFromCjs(inspect_1);
|
|
2894
|
+
|
|
2824
2895
|
var instanceOf_1 = createCommonjsModule(function (module, exports) {
|
|
2896
|
+
'use strict';
|
|
2825
2897
|
|
|
2826
2898
|
Object.defineProperty(exports, '__esModule', {
|
|
2827
2899
|
value: true,
|
|
@@ -2840,14 +2912,54 @@ const instanceOf =
|
|
|
2840
2912
|
/* c8 ignore next 6 */
|
|
2841
2913
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
2842
2914
|
// eslint-disable-next-line no-undef
|
|
2843
|
-
|
|
2915
|
+
"development" === 'production'
|
|
2916
|
+
? function instanceOf(value, constructor) {
|
|
2844
2917
|
return value instanceof constructor;
|
|
2845
2918
|
}
|
|
2846
|
-
|
|
2919
|
+
: function instanceOf(value, constructor) {
|
|
2920
|
+
if (value instanceof constructor) {
|
|
2921
|
+
return true;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
if (typeof value === 'object' && value !== null) {
|
|
2925
|
+
var _value$constructor;
|
|
2926
|
+
|
|
2927
|
+
// Prefer Symbol.toStringTag since it is immune to minification.
|
|
2928
|
+
const className = constructor.prototype[Symbol.toStringTag];
|
|
2929
|
+
const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
2930
|
+
Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009
|
|
2931
|
+
? value[Symbol.toStringTag]
|
|
2932
|
+
: (_value$constructor = value.constructor) === null ||
|
|
2933
|
+
_value$constructor === void 0
|
|
2934
|
+
? void 0
|
|
2935
|
+
: _value$constructor.name;
|
|
2936
|
+
|
|
2937
|
+
if (className === valueClassName) {
|
|
2938
|
+
const stringifiedValue = (0, inspect_1.inspect)(value);
|
|
2939
|
+
throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm.
|
|
2940
|
+
|
|
2941
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
2942
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
2943
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
2944
|
+
|
|
2945
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
2946
|
+
|
|
2947
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
2948
|
+
versions may have different capabilities and behavior. The data from one
|
|
2949
|
+
version used in the function from another could produce confusing and
|
|
2950
|
+
spurious results.`);
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
return false;
|
|
2955
|
+
};
|
|
2847
2956
|
exports.instanceOf = instanceOf;
|
|
2848
2957
|
});
|
|
2849
2958
|
|
|
2959
|
+
const instanceOf = /*@__PURE__*/getDefaultExportFromCjs(instanceOf_1);
|
|
2960
|
+
|
|
2850
2961
|
var source = createCommonjsModule(function (module, exports) {
|
|
2962
|
+
'use strict';
|
|
2851
2963
|
|
|
2852
2964
|
Object.defineProperty(exports, '__esModule', {
|
|
2853
2965
|
value: true,
|
|
@@ -2914,7 +3026,10 @@ function isSource(source) {
|
|
|
2914
3026
|
}
|
|
2915
3027
|
});
|
|
2916
3028
|
|
|
3029
|
+
const source$1 = /*@__PURE__*/getDefaultExportFromCjs(source);
|
|
3030
|
+
|
|
2917
3031
|
var parser = createCommonjsModule(function (module, exports) {
|
|
3032
|
+
'use strict';
|
|
2918
3033
|
|
|
2919
3034
|
Object.defineProperty(exports, '__esModule', {
|
|
2920
3035
|
value: true,
|
|
@@ -3008,12 +3123,13 @@ function parseType(source, options) {
|
|
|
3008
3123
|
*/
|
|
3009
3124
|
|
|
3010
3125
|
class Parser {
|
|
3011
|
-
constructor(source$1, options) {
|
|
3126
|
+
constructor(source$1, options = {}) {
|
|
3012
3127
|
const sourceObj = (0, source.isSource)(source$1)
|
|
3013
3128
|
? source$1
|
|
3014
3129
|
: new source.Source(source$1);
|
|
3015
3130
|
this._lexer = new lexer.Lexer(sourceObj);
|
|
3016
3131
|
this._options = options;
|
|
3132
|
+
this._tokenCounter = 0;
|
|
3017
3133
|
}
|
|
3018
3134
|
/**
|
|
3019
3135
|
* Converts a name lex token into a name parse node.
|
|
@@ -3348,18 +3464,12 @@ class Parser {
|
|
|
3348
3464
|
*/
|
|
3349
3465
|
|
|
3350
3466
|
parseFragmentDefinition() {
|
|
3351
|
-
var _this$_options;
|
|
3352
|
-
|
|
3353
3467
|
const start = this._lexer.token;
|
|
3354
3468
|
this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes
|
|
3355
3469
|
// the grammar of FragmentDefinition:
|
|
3356
3470
|
// - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet
|
|
3357
3471
|
|
|
3358
|
-
if (
|
|
3359
|
-
((_this$_options = this._options) === null || _this$_options === void 0
|
|
3360
|
-
? void 0
|
|
3361
|
-
: _this$_options.allowLegacyFragmentVariables) === true
|
|
3362
|
-
) {
|
|
3472
|
+
if (this._options.allowLegacyFragmentVariables === true) {
|
|
3363
3473
|
return this.node(start, {
|
|
3364
3474
|
kind: kinds.Kind.FRAGMENT_DEFINITION,
|
|
3365
3475
|
name: this.parseFragmentName(),
|
|
@@ -3420,16 +3530,14 @@ class Parser {
|
|
|
3420
3530
|
return this.parseObject(isConst);
|
|
3421
3531
|
|
|
3422
3532
|
case tokenKind.TokenKind.INT:
|
|
3423
|
-
this.
|
|
3424
|
-
|
|
3533
|
+
this.advanceLexer();
|
|
3425
3534
|
return this.node(token, {
|
|
3426
3535
|
kind: kinds.Kind.INT,
|
|
3427
3536
|
value: token.value,
|
|
3428
3537
|
});
|
|
3429
3538
|
|
|
3430
3539
|
case tokenKind.TokenKind.FLOAT:
|
|
3431
|
-
this.
|
|
3432
|
-
|
|
3540
|
+
this.advanceLexer();
|
|
3433
3541
|
return this.node(token, {
|
|
3434
3542
|
kind: kinds.Kind.FLOAT,
|
|
3435
3543
|
value: token.value,
|
|
@@ -3440,7 +3548,7 @@ class Parser {
|
|
|
3440
3548
|
return this.parseStringLiteral();
|
|
3441
3549
|
|
|
3442
3550
|
case tokenKind.TokenKind.NAME:
|
|
3443
|
-
this.
|
|
3551
|
+
this.advanceLexer();
|
|
3444
3552
|
|
|
3445
3553
|
switch (token.value) {
|
|
3446
3554
|
case 'true':
|
|
@@ -3496,9 +3604,7 @@ class Parser {
|
|
|
3496
3604
|
|
|
3497
3605
|
parseStringLiteral() {
|
|
3498
3606
|
const token = this._lexer.token;
|
|
3499
|
-
|
|
3500
|
-
this._lexer.advance();
|
|
3501
|
-
|
|
3607
|
+
this.advanceLexer();
|
|
3502
3608
|
return this.node(token, {
|
|
3503
3609
|
kind: kinds.Kind.STRING,
|
|
3504
3610
|
value: token.value,
|
|
@@ -4289,13 +4395,7 @@ class Parser {
|
|
|
4289
4395
|
*/
|
|
4290
4396
|
|
|
4291
4397
|
node(startToken, node) {
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
if (
|
|
4295
|
-
((_this$_options2 = this._options) === null || _this$_options2 === void 0
|
|
4296
|
-
? void 0
|
|
4297
|
-
: _this$_options2.noLocation) !== true
|
|
4298
|
-
) {
|
|
4398
|
+
if (this._options.noLocation !== true) {
|
|
4299
4399
|
node.loc = new ast.Location(
|
|
4300
4400
|
startToken,
|
|
4301
4401
|
this._lexer.lastToken,
|
|
@@ -4321,8 +4421,7 @@ class Parser {
|
|
|
4321
4421
|
const token = this._lexer.token;
|
|
4322
4422
|
|
|
4323
4423
|
if (token.kind === kind) {
|
|
4324
|
-
this.
|
|
4325
|
-
|
|
4424
|
+
this.advanceLexer();
|
|
4326
4425
|
return token;
|
|
4327
4426
|
}
|
|
4328
4427
|
|
|
@@ -4341,8 +4440,7 @@ class Parser {
|
|
|
4341
4440
|
const token = this._lexer.token;
|
|
4342
4441
|
|
|
4343
4442
|
if (token.kind === kind) {
|
|
4344
|
-
this.
|
|
4345
|
-
|
|
4443
|
+
this.advanceLexer();
|
|
4346
4444
|
return true;
|
|
4347
4445
|
}
|
|
4348
4446
|
|
|
@@ -4357,7 +4455,7 @@ class Parser {
|
|
|
4357
4455
|
const token = this._lexer.token;
|
|
4358
4456
|
|
|
4359
4457
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4360
|
-
this.
|
|
4458
|
+
this.advanceLexer();
|
|
4361
4459
|
} else {
|
|
4362
4460
|
throw (0, syntaxError_1.syntaxError)(
|
|
4363
4461
|
this._lexer.source,
|
|
@@ -4375,8 +4473,7 @@ class Parser {
|
|
|
4375
4473
|
const token = this._lexer.token;
|
|
4376
4474
|
|
|
4377
4475
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4378
|
-
this.
|
|
4379
|
-
|
|
4476
|
+
this.advanceLexer();
|
|
4380
4477
|
return true;
|
|
4381
4478
|
}
|
|
4382
4479
|
|
|
@@ -4463,6 +4560,24 @@ class Parser {
|
|
|
4463
4560
|
|
|
4464
4561
|
return nodes;
|
|
4465
4562
|
}
|
|
4563
|
+
|
|
4564
|
+
advanceLexer() {
|
|
4565
|
+
const { maxTokens } = this._options;
|
|
4566
|
+
|
|
4567
|
+
const token = this._lexer.advance();
|
|
4568
|
+
|
|
4569
|
+
if (maxTokens !== undefined && token.kind !== tokenKind.TokenKind.EOF) {
|
|
4570
|
+
++this._tokenCounter;
|
|
4571
|
+
|
|
4572
|
+
if (this._tokenCounter > maxTokens) {
|
|
4573
|
+
throw (0, syntaxError_1.syntaxError)(
|
|
4574
|
+
this._lexer.source,
|
|
4575
|
+
token.start,
|
|
4576
|
+
`Document contains more that ${maxTokens} tokens. Parsing aborted.`,
|
|
4577
|
+
);
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4466
4581
|
}
|
|
4467
4582
|
/**
|
|
4468
4583
|
* A helper function to describe a token as a string for debugging.
|
|
@@ -4483,7 +4598,10 @@ function getTokenKindDesc(kind) {
|
|
|
4483
4598
|
}
|
|
4484
4599
|
});
|
|
4485
4600
|
|
|
4601
|
+
const parser$1 = /*@__PURE__*/getDefaultExportFromCjs(parser);
|
|
4602
|
+
|
|
4486
4603
|
var printString_1 = createCommonjsModule(function (module, exports) {
|
|
4604
|
+
'use strict';
|
|
4487
4605
|
|
|
4488
4606
|
Object.defineProperty(exports, '__esModule', {
|
|
4489
4607
|
value: true,
|
|
@@ -4668,7 +4786,10 @@ const escapeSequences = [
|
|
|
4668
4786
|
];
|
|
4669
4787
|
});
|
|
4670
4788
|
|
|
4789
|
+
const printString = /*@__PURE__*/getDefaultExportFromCjs(printString_1);
|
|
4790
|
+
|
|
4671
4791
|
var visitor = createCommonjsModule(function (module, exports) {
|
|
4792
|
+
'use strict';
|
|
4672
4793
|
|
|
4673
4794
|
Object.defineProperty(exports, '__esModule', {
|
|
4674
4795
|
value: true,
|
|
@@ -5047,7 +5168,10 @@ function getVisitFn(visitor, kind, isLeaving) {
|
|
|
5047
5168
|
}
|
|
5048
5169
|
});
|
|
5049
5170
|
|
|
5171
|
+
const visitor$1 = /*@__PURE__*/getDefaultExportFromCjs(visitor);
|
|
5172
|
+
|
|
5050
5173
|
var printer = createCommonjsModule(function (module, exports) {
|
|
5174
|
+
'use strict';
|
|
5051
5175
|
|
|
5052
5176
|
Object.defineProperty(exports, '__esModule', {
|
|
5053
5177
|
value: true,
|
|
@@ -5400,6 +5524,10 @@ function hasMultilineItems(maybeArray) {
|
|
|
5400
5524
|
}
|
|
5401
5525
|
});
|
|
5402
5526
|
|
|
5527
|
+
const printer$1 = /*@__PURE__*/getDefaultExportFromCjs(printer);
|
|
5528
|
+
|
|
5529
|
+
'use strict';
|
|
5530
|
+
|
|
5403
5531
|
var ReactNativeFile$1 = function ReactNativeFile(_ref) {
|
|
5404
5532
|
var uri = _ref.uri,
|
|
5405
5533
|
name = _ref.name,
|
|
@@ -5409,6 +5537,10 @@ var ReactNativeFile$1 = function ReactNativeFile(_ref) {
|
|
|
5409
5537
|
this.type = type;
|
|
5410
5538
|
};
|
|
5411
5539
|
|
|
5540
|
+
'use strict';
|
|
5541
|
+
|
|
5542
|
+
|
|
5543
|
+
|
|
5412
5544
|
var isExtractableFile$1 = function isExtractableFile(value) {
|
|
5413
5545
|
return (
|
|
5414
5546
|
(typeof File !== 'undefined' && value instanceof File) ||
|
|
@@ -5417,6 +5549,10 @@ var isExtractableFile$1 = function isExtractableFile(value) {
|
|
|
5417
5549
|
);
|
|
5418
5550
|
};
|
|
5419
5551
|
|
|
5552
|
+
'use strict';
|
|
5553
|
+
|
|
5554
|
+
|
|
5555
|
+
|
|
5420
5556
|
var extractFiles$1 = function extractFiles(value, path, isExtractableFile) {
|
|
5421
5557
|
if (path === void 0) {
|
|
5422
5558
|
path = '';
|
|
@@ -5468,6 +5604,8 @@ var extractFiles$1 = function extractFiles(value, path, isExtractableFile) {
|
|
|
5468
5604
|
};
|
|
5469
5605
|
};
|
|
5470
5606
|
|
|
5607
|
+
'use strict';
|
|
5608
|
+
|
|
5471
5609
|
var ReactNativeFile = ReactNativeFile$1;
|
|
5472
5610
|
var extractFiles = extractFiles$1;
|
|
5473
5611
|
var isExtractableFile = isExtractableFile$1;
|
|
@@ -5482,6 +5620,7 @@ var _public = {
|
|
|
5482
5620
|
var browser = typeof self == 'object' ? self.FormData : window.FormData;
|
|
5483
5621
|
|
|
5484
5622
|
var defaultJsonSerializer = createCommonjsModule(function (module, exports) {
|
|
5623
|
+
"use strict";
|
|
5485
5624
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5486
5625
|
exports.defaultJsonSerializer = void 0;
|
|
5487
5626
|
exports.defaultJsonSerializer = {
|
|
@@ -5491,7 +5630,10 @@ exports.defaultJsonSerializer = {
|
|
|
5491
5630
|
//# sourceMappingURL=defaultJsonSerializer.js.map
|
|
5492
5631
|
});
|
|
5493
5632
|
|
|
5633
|
+
const defaultJsonSerializer$1 = /*@__PURE__*/getDefaultExportFromCjs(defaultJsonSerializer);
|
|
5634
|
+
|
|
5494
5635
|
var createRequestBody_1 = createCommonjsModule(function (module, exports) {
|
|
5636
|
+
"use strict";
|
|
5495
5637
|
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5496
5638
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5497
5639
|
};
|
|
@@ -5548,7 +5690,10 @@ exports.default = createRequestBody;
|
|
|
5548
5690
|
//# sourceMappingURL=createRequestBody.js.map
|
|
5549
5691
|
});
|
|
5550
5692
|
|
|
5693
|
+
const createRequestBody = /*@__PURE__*/getDefaultExportFromCjs(createRequestBody_1);
|
|
5694
|
+
|
|
5551
5695
|
var parseArgs = createCommonjsModule(function (module, exports) {
|
|
5696
|
+
"use strict";
|
|
5552
5697
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5553
5698
|
exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
|
|
5554
5699
|
function parseRequestArgs(documentOrOptions, variables, requestHeaders) {
|
|
@@ -5621,7 +5766,10 @@ exports.parseBatchRequestsExtendedArgs = parseBatchRequestsExtendedArgs;
|
|
|
5621
5766
|
//# sourceMappingURL=parseArgs.js.map
|
|
5622
5767
|
});
|
|
5623
5768
|
|
|
5769
|
+
const parseArgs$1 = /*@__PURE__*/getDefaultExportFromCjs(parseArgs);
|
|
5770
|
+
|
|
5624
5771
|
var types = createCommonjsModule(function (module, exports) {
|
|
5772
|
+
"use strict";
|
|
5625
5773
|
var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
|
|
5626
5774
|
var extendStatics = function (d, b) {
|
|
5627
5775
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -5671,7 +5819,10 @@ exports.ClientError = ClientError;
|
|
|
5671
5819
|
//# sourceMappingURL=types.js.map
|
|
5672
5820
|
});
|
|
5673
5821
|
|
|
5822
|
+
const types$1 = /*@__PURE__*/getDefaultExportFromCjs(types);
|
|
5823
|
+
|
|
5674
5824
|
var graphqlWs = createCommonjsModule(function (module, exports) {
|
|
5825
|
+
"use strict";
|
|
5675
5826
|
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
5676
5827
|
__assign = Object.assign || function(t) {
|
|
5677
5828
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -5851,6 +6002,8 @@ var GraphQLWebSocketClient = /** @class */ (function () {
|
|
|
5851
6002
|
if (message.payload.errors) {
|
|
5852
6003
|
subscriber.error && subscriber.error(new types.ClientError(__assign(__assign({}, message.payload), { status: 200 }), { query: query, variables: variables }));
|
|
5853
6004
|
}
|
|
6005
|
+
else {
|
|
6006
|
+
}
|
|
5854
6007
|
return;
|
|
5855
6008
|
}
|
|
5856
6009
|
case ERROR: {
|
|
@@ -5945,7 +6098,10 @@ function Complete(id) {
|
|
|
5945
6098
|
//# sourceMappingURL=graphql-ws.js.map
|
|
5946
6099
|
});
|
|
5947
6100
|
|
|
6101
|
+
const graphqlWs$1 = /*@__PURE__*/getDefaultExportFromCjs(graphqlWs);
|
|
6102
|
+
|
|
5948
6103
|
var dist = createCommonjsModule(function (module, exports) {
|
|
6104
|
+
"use strict";
|
|
5949
6105
|
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
5950
6106
|
__assign = Object.assign || function(t) {
|
|
5951
6107
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -6270,7 +6426,7 @@ exports.GraphQLClient = GraphQLClient;
|
|
|
6270
6426
|
function makeRequest(_a) {
|
|
6271
6427
|
var url = _a.url, query = _a.query, variables = _a.variables, headers = _a.headers, operationName = _a.operationName, fetch = _a.fetch, _b = _a.method, method = _b === void 0 ? 'POST' : _b, fetchOptions = _a.fetchOptions;
|
|
6272
6428
|
return __awaiter(this, void 0, void 0, function () {
|
|
6273
|
-
var fetcher, isBathchingQuery, response, result, successfullyReceivedData, successfullyPassedErrorPolicy, headers_1, status_1, rest, data, errorResult;
|
|
6429
|
+
var fetcher, isBathchingQuery, response, result, successfullyReceivedData, successfullyPassedErrorPolicy, headers_1, status_1, errors, rest, data, errorResult;
|
|
6274
6430
|
return __generator(this, function (_c) {
|
|
6275
6431
|
switch (_c.label) {
|
|
6276
6432
|
case 0:
|
|
@@ -6297,7 +6453,7 @@ function makeRequest(_a) {
|
|
|
6297
6453
|
successfullyPassedErrorPolicy = !result.errors || fetchOptions.errorPolicy === 'all' || fetchOptions.errorPolicy === 'ignore';
|
|
6298
6454
|
if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {
|
|
6299
6455
|
headers_1 = response.headers, status_1 = response.status;
|
|
6300
|
-
rest = __rest(result, ["errors"]);
|
|
6456
|
+
errors = result.errors, rest = __rest(result, ["errors"]);
|
|
6301
6457
|
data = fetchOptions.errorPolicy === 'ignore' ? rest : result;
|
|
6302
6458
|
return [2 /*return*/, __assign(__assign({}, (isBathchingQuery ? { data: data } : data)), { headers: headers_1, status: status_1 })];
|
|
6303
6459
|
}
|
|
@@ -6305,6 +6461,7 @@ function makeRequest(_a) {
|
|
|
6305
6461
|
errorResult = typeof result === 'string' ? { error: result } : result;
|
|
6306
6462
|
throw new types.ClientError(__assign(__assign({}, errorResult), { status: response.status, headers: response.headers }), { query: query, variables: variables });
|
|
6307
6463
|
}
|
|
6464
|
+
return [2 /*return*/];
|
|
6308
6465
|
}
|
|
6309
6466
|
});
|
|
6310
6467
|
});
|
|
@@ -6434,6 +6591,8 @@ Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get
|
|
|
6434
6591
|
//# sourceMappingURL=index.js.map
|
|
6435
6592
|
});
|
|
6436
6593
|
|
|
6594
|
+
const index = /*@__PURE__*/getDefaultExportFromCjs(dist);
|
|
6595
|
+
|
|
6437
6596
|
class UrlUtils {
|
|
6438
6597
|
static getQueryParams(queryString) {
|
|
6439
6598
|
const params = new Map();
|
|
@@ -6491,6 +6650,27 @@ class DataFetcher {
|
|
|
6491
6650
|
DataFetcher.requestListener.splice(index, 1);
|
|
6492
6651
|
}
|
|
6493
6652
|
}
|
|
6653
|
+
processErrorInfo(errors) {
|
|
6654
|
+
var _a, _b;
|
|
6655
|
+
const POSITION_ERROR_INFO = 0;
|
|
6656
|
+
const errorTitle = "Falha detectada";
|
|
6657
|
+
const error = errors[POSITION_ERROR_INFO];
|
|
6658
|
+
if (error.length > 0) { //As informações do erro vem no primeiro indice de um array
|
|
6659
|
+
const errorInfo = error[POSITION_ERROR_INFO];
|
|
6660
|
+
const errorMessage = (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.message) ? errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.message : "Não há mensagem de erro";
|
|
6661
|
+
const errorLevel = ((_a = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _a === void 0 ? void 0 : _a.level) ? errorInfo.extensions.level : "ERROR";
|
|
6662
|
+
const errorCode = ((_b = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _b === void 0 ? void 0 : _b.code) ? errorInfo.extensions.code : "";
|
|
6663
|
+
switch (errorLevel) {
|
|
6664
|
+
case "WARNING":
|
|
6665
|
+
return new index$1.WarningException(errorTitle, errorMessage, errorCode);
|
|
6666
|
+
default:
|
|
6667
|
+
return new index$1.ErrorException(errorTitle, errorMessage, errorCode);
|
|
6668
|
+
}
|
|
6669
|
+
}
|
|
6670
|
+
else {
|
|
6671
|
+
return new index$1.ErrorException(errorTitle, "Não há informações sobre o erro");
|
|
6672
|
+
}
|
|
6673
|
+
}
|
|
6494
6674
|
async callGraphQL(req) {
|
|
6495
6675
|
var _a;
|
|
6496
6676
|
const reqKey = this.getReqKey(req);
|
|
@@ -6501,7 +6681,8 @@ class DataFetcher {
|
|
|
6501
6681
|
let query = this.getQueryTemplate(req);
|
|
6502
6682
|
const res = await this.fecthGrapql([{ document: query, variables: req.values }]);
|
|
6503
6683
|
if (res.errors.length > 0) {
|
|
6504
|
-
|
|
6684
|
+
const error = this.processErrorInfo(res.errors);
|
|
6685
|
+
reject(error);
|
|
6505
6686
|
}
|
|
6506
6687
|
else {
|
|
6507
6688
|
resolve(res.data[0][reqKey]);
|
|
@@ -6518,23 +6699,26 @@ class DataFetcher {
|
|
|
6518
6699
|
resolveURL() {
|
|
6519
6700
|
return UrlUtils.getUrlBase();
|
|
6520
6701
|
}
|
|
6521
|
-
getContext() {
|
|
6702
|
+
getContext(module) {
|
|
6522
6703
|
const urlParams = UrlUtils.getQueryParams(location.search);
|
|
6523
6704
|
return {
|
|
6524
|
-
baseUrl: `${this.resolveURL()}/
|
|
6705
|
+
baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
|
|
6525
6706
|
appName: "SankhyaBlocks",
|
|
6526
6707
|
mgeSession: `${window['skw_session'] || urlParams.mgeSession}`,
|
|
6527
6708
|
globalID: "85C0093DFA240EAB699B4E47A10215BD",
|
|
6709
|
+
//FIXME: Precisamos ajustar para buscar o resourceId pela aplicação
|
|
6528
6710
|
resourceID: "br.com.sankhya.mov.bancaria"
|
|
6529
6711
|
};
|
|
6530
6712
|
}
|
|
6531
6713
|
async callServiceBroker(serviceName, payload) {
|
|
6532
6714
|
return new Promise((accept, reject) => {
|
|
6533
|
-
const
|
|
6534
|
-
const
|
|
6715
|
+
const parts = serviceName.split("@");
|
|
6716
|
+
const [module, name] = parts.length === 2 ? parts : ['mge', serviceName];
|
|
6717
|
+
const ctx = this.getContext(module);
|
|
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`;
|
|
6535
6719
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6536
6720
|
const http = new XMLHttpRequest();
|
|
6537
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6721
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6538
6722
|
http.open("POST", url, true);
|
|
6539
6723
|
http.withCredentials = true;
|
|
6540
6724
|
http.send(payload);
|
|
@@ -6553,17 +6737,17 @@ class DataFetcher {
|
|
|
6553
6737
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
6554
6738
|
reject(this.responseText);
|
|
6555
6739
|
}
|
|
6556
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6740
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6557
6741
|
}
|
|
6558
6742
|
else if (this.readyState == 4 && this.status != 200) {
|
|
6559
6743
|
reject(this.responseText);
|
|
6560
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6744
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6561
6745
|
}
|
|
6562
6746
|
};
|
|
6563
6747
|
});
|
|
6564
6748
|
}
|
|
6565
6749
|
getReqKey(req) {
|
|
6566
|
-
return window.btoa(
|
|
6750
|
+
return window.btoa(index$1.StringUtils.hashCode(`${req.query}${JSON.stringify(req.values || "")}`)).replace(/=/g, "");
|
|
6567
6751
|
}
|
|
6568
6752
|
getQueryTemplate(re) {
|
|
6569
6753
|
return (re.query || "").replaceAll("$queryAlias$", re.queryID);
|
|
@@ -6592,7 +6776,7 @@ class DataFetcher {
|
|
|
6592
6776
|
errorsResponse.forEach((errorResponse) => {
|
|
6593
6777
|
Object.entries(errorResponse).forEach(([_key, val]) => {
|
|
6594
6778
|
var _a;
|
|
6595
|
-
(((_a = this.getWatingRequest(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new
|
|
6779
|
+
(((_a = this.getWatingRequest(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new index$1.ErrorException("Falha detectada", val.message));
|
|
6596
6780
|
});
|
|
6597
6781
|
});
|
|
6598
6782
|
//Resolve promises with data from query
|
|
@@ -6613,7 +6797,7 @@ class DataFetcher {
|
|
|
6613
6797
|
if (window['skw_session']) {
|
|
6614
6798
|
url += `?mgeSession=${window['skw_session']}`;
|
|
6615
6799
|
}
|
|
6616
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6800
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
6617
6801
|
try {
|
|
6618
6802
|
res = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6619
6803
|
res.forEach((resItem, index) => {
|
|
@@ -6644,11 +6828,11 @@ class DataFetcher {
|
|
|
6644
6828
|
});
|
|
6645
6829
|
}
|
|
6646
6830
|
else {
|
|
6647
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6648
|
-
throw new
|
|
6831
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6832
|
+
throw new index$1.ErrorException("Falha de comunicação", err.message);
|
|
6649
6833
|
}
|
|
6650
6834
|
}
|
|
6651
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6835
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6652
6836
|
return { data: dataResponse, errors: errorsResponse };
|
|
6653
6837
|
}
|
|
6654
6838
|
isHttpError(err) {
|
|
@@ -6695,6 +6879,7 @@ class WaitingRequest {
|
|
|
6695
6879
|
class DataUnitFetcher {
|
|
6696
6880
|
constructor() {
|
|
6697
6881
|
this.templateByQuery = new Map();
|
|
6882
|
+
this._loadDataTimeout = {};
|
|
6698
6883
|
this.buldTemplates();
|
|
6699
6884
|
}
|
|
6700
6885
|
buldTemplates() {
|
|
@@ -6723,9 +6908,9 @@ class DataUnitFetcher {
|
|
|
6723
6908
|
}
|
|
6724
6909
|
}
|
|
6725
6910
|
}`);
|
|
6726
|
-
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $
|
|
6911
|
+
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
|
|
6727
6912
|
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
6728
|
-
data(limit: $limit offset: $offset filters: $
|
|
6913
|
+
data(limit: $limit offset: $offset filters: $filters sort: $sort){
|
|
6729
6914
|
limit
|
|
6730
6915
|
offset
|
|
6731
6916
|
total
|
|
@@ -6752,9 +6937,9 @@ class DataUnitFetcher {
|
|
|
6752
6937
|
}`);
|
|
6753
6938
|
}
|
|
6754
6939
|
getDataUnit(entityName, resourceID) {
|
|
6755
|
-
const dataUnit = new
|
|
6940
|
+
const dataUnit = new index$1.DataUnit(`dd://${entityName}/${resourceID}`);
|
|
6756
6941
|
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
6757
|
-
dataUnit.dataLoader = (dataUnit,
|
|
6942
|
+
dataUnit.dataLoader = (dataUnit, request) => this.loadData(dataUnit, request);
|
|
6758
6943
|
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
6759
6944
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
6760
6945
|
return dataUnit;
|
|
@@ -6791,25 +6976,39 @@ class DataUnitFetcher {
|
|
|
6791
6976
|
});
|
|
6792
6977
|
});
|
|
6793
6978
|
}
|
|
6794
|
-
loadData(dataUnit,
|
|
6979
|
+
loadData(dataUnit, request) {
|
|
6980
|
+
const duName = dataUnit.name;
|
|
6981
|
+
if (this._loadDataTimeout[duName]) {
|
|
6982
|
+
clearTimeout(this._loadDataTimeout[duName]);
|
|
6983
|
+
delete this._loadDataTimeout[duName];
|
|
6984
|
+
}
|
|
6795
6985
|
return new Promise((resolve, reject) => {
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
}
|
|
6802
|
-
|
|
6986
|
+
this._loadDataTimeout[duName] = setTimeout(() => {
|
|
6987
|
+
delete this._loadDataTimeout[duName];
|
|
6988
|
+
this.doLoadData(dataUnit, request)
|
|
6989
|
+
.then(result => resolve(result))
|
|
6990
|
+
.catch(reason => reject(reason));
|
|
6991
|
+
}, 200);
|
|
6992
|
+
});
|
|
6993
|
+
}
|
|
6994
|
+
doLoadData(dataUnit, request) {
|
|
6995
|
+
return new Promise((resolve, reject) => {
|
|
6996
|
+
var _a;
|
|
6997
|
+
const { sort, filters, limit, offset, quickFilter } = request;
|
|
6998
|
+
const variables = { dataunit: dataUnit.name, sort, filters };
|
|
6999
|
+
variables.limit = limit;
|
|
7000
|
+
variables.offset = offset;
|
|
7001
|
+
if (!index$1.StringUtils.isEmpty(quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.term)) {
|
|
6803
7002
|
if (variables.filter === undefined) {
|
|
6804
7003
|
variables.filter = [];
|
|
6805
7004
|
}
|
|
6806
7005
|
const quickFilterCriteria = {
|
|
6807
7006
|
name: "__QUICK_FILTER__",
|
|
6808
7007
|
expression: "__QUICK_FILTER__",
|
|
6809
|
-
params: [{ name: "term", dataType:
|
|
7008
|
+
params: [{ name: "term", dataType: index$1.DataType.TEXT, value: quickFilter.term }]
|
|
6810
7009
|
};
|
|
6811
|
-
if (((
|
|
6812
|
-
quickFilterCriteria.params.push({ name: "fields", dataType:
|
|
7010
|
+
if (((_a = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.fields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
7011
|
+
quickFilterCriteria.params.push({ name: "fields", dataType: index$1.DataType.OBJECT, value: quickFilter.fields });
|
|
6813
7012
|
}
|
|
6814
7013
|
variables.filter.push(quickFilterCriteria);
|
|
6815
7014
|
}
|
|
@@ -6819,16 +7018,32 @@ class DataUnitFetcher {
|
|
|
6819
7018
|
query: this.templateByQuery.get("fetchData"),
|
|
6820
7019
|
})
|
|
6821
7020
|
.then((resp) => {
|
|
6822
|
-
const
|
|
6823
|
-
|
|
6824
|
-
|
|
7021
|
+
const { limit, offset, total, hasMore, records } = resp.data;
|
|
7022
|
+
let paginationInfo;
|
|
7023
|
+
if (limit) {
|
|
7024
|
+
const firstRecord = total == 0 ? 0 : offset + 1;
|
|
7025
|
+
const lastRecord = offset + Math.min(records.length, limit);
|
|
7026
|
+
const currentPage = offset / limit;
|
|
7027
|
+
paginationInfo = {
|
|
7028
|
+
firstRecord,
|
|
7029
|
+
lastRecord,
|
|
7030
|
+
total,
|
|
7031
|
+
currentPage,
|
|
7032
|
+
hasMore
|
|
7033
|
+
};
|
|
7034
|
+
}
|
|
7035
|
+
const processedRecords = [];
|
|
7036
|
+
records.forEach((responseRecord) => {
|
|
6825
7037
|
const duRecord = { __record__id__: responseRecord.id };
|
|
6826
7038
|
responseRecord.fields.forEach(({ name, value }) => {
|
|
6827
7039
|
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
6828
7040
|
});
|
|
6829
|
-
|
|
7041
|
+
processedRecords.push(duRecord);
|
|
7042
|
+
});
|
|
7043
|
+
resolve({
|
|
7044
|
+
paginationInfo,
|
|
7045
|
+
records: processedRecords
|
|
6830
7046
|
});
|
|
6831
|
-
resolve(Object.assign(Object.assign({}, pageResult), { records }));
|
|
6832
7047
|
})
|
|
6833
7048
|
.catch((error) => {
|
|
6834
7049
|
reject(error);
|
|
@@ -6842,7 +7057,7 @@ class DataUnitFetcher {
|
|
|
6842
7057
|
if (updatingFields) {
|
|
6843
7058
|
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
6844
7059
|
const descriptor = dataUnit.getField(fieldName);
|
|
6845
|
-
const dataType = descriptor ? descriptor.dataType :
|
|
7060
|
+
const dataType = descriptor ? descriptor.dataType : index$1.DataType.TEXT;
|
|
6846
7061
|
return { fieldName, dataType, value: dataUnit.valueToString(fieldName, value) };
|
|
6847
7062
|
});
|
|
6848
7063
|
}
|
|
@@ -6879,7 +7094,7 @@ class DataUnitFetcher {
|
|
|
6879
7094
|
}
|
|
6880
7095
|
removeRecords(dataUnit, recordIds) {
|
|
6881
7096
|
const changes = recordIds.map((recordId) => {
|
|
6882
|
-
return { dataUnit: dataUnit.name, operation:
|
|
7097
|
+
return { dataUnit: dataUnit.name, operation: index$1.ChangeOperation.DELETE, recordId };
|
|
6883
7098
|
});
|
|
6884
7099
|
return new Promise((resolve, reject) => {
|
|
6885
7100
|
DataFetcher.get()
|
|
@@ -6944,7 +7159,7 @@ class ParametersFetcher {
|
|
|
6944
7159
|
}
|
|
6945
7160
|
async asDate(name, resourceID) {
|
|
6946
7161
|
const paramArr = await this.getParam(name, resourceID);
|
|
6947
|
-
return
|
|
7162
|
+
return index$1.DateUtils.strToDate(this.getValue(paramArr));
|
|
6948
7163
|
}
|
|
6949
7164
|
async getBatchParams(names, resourceID) {
|
|
6950
7165
|
const paramArr = await this.getParam(names.join(","), resourceID);
|
|
@@ -6957,7 +7172,7 @@ class ParametersFetcher {
|
|
|
6957
7172
|
if (Array.isArray(obj) && obj.length > 0) {
|
|
6958
7173
|
obj = obj[0];
|
|
6959
7174
|
}
|
|
6960
|
-
if (
|
|
7175
|
+
if (index$1.StringUtils.isEmpty(obj.resource))
|
|
6961
7176
|
return "";
|
|
6962
7177
|
return obj.resource;
|
|
6963
7178
|
}
|
|
@@ -7054,15 +7269,16 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7054
7269
|
super(...arguments);
|
|
7055
7270
|
this.GRID_CONFIG_VERSION = "V3:";
|
|
7056
7271
|
}
|
|
7057
|
-
getConfig(resourceID) {
|
|
7272
|
+
getConfig(_gridName, resourceID) {
|
|
7058
7273
|
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
7059
7274
|
return new Promise((resolve, reject) => {
|
|
7060
7275
|
this.loadResource(completePath)
|
|
7061
7276
|
.then(loadedResource => {
|
|
7277
|
+
let config = undefined;
|
|
7062
7278
|
if (loadedResource) {
|
|
7063
|
-
|
|
7064
|
-
resolve(config);
|
|
7279
|
+
config = JSON.parse(loadedResource);
|
|
7065
7280
|
}
|
|
7281
|
+
resolve(config);
|
|
7066
7282
|
}).catch((error) => {
|
|
7067
7283
|
reject(error);
|
|
7068
7284
|
});
|
|
@@ -7156,9 +7372,9 @@ function convertParamType(dataType) {
|
|
|
7156
7372
|
//atual da pesquisa... em geral, somente inteiros,
|
|
7157
7373
|
//data (com ou sem hora) e string são realmente relevantes
|
|
7158
7374
|
switch (dataType) {
|
|
7159
|
-
case
|
|
7375
|
+
case index$1.DataType.NUMBER:
|
|
7160
7376
|
return "I";
|
|
7161
|
-
case
|
|
7377
|
+
case index$1.DataType.DATE:
|
|
7162
7378
|
return "D";
|
|
7163
7379
|
default:
|
|
7164
7380
|
return "S";
|
|
@@ -7171,7 +7387,7 @@ class AuthFetcher extends ResourceFetcher {
|
|
|
7171
7387
|
return new Promise((resolve, reject) => {
|
|
7172
7388
|
this.loadResource(completePath)
|
|
7173
7389
|
.then((loadedResource) => {
|
|
7174
|
-
let auth =
|
|
7390
|
+
let auth = index$1.ObjectUtils.stringToObject(loadedResource);
|
|
7175
7391
|
if (auth && typeof (auth) === 'object') {
|
|
7176
7392
|
resolve(auth);
|
|
7177
7393
|
}
|
|
@@ -7205,7 +7421,7 @@ class SnkErrorHandler {
|
|
|
7205
7421
|
const reason = evt.reason;
|
|
7206
7422
|
//Promisse rejeitada com WaitingChangeException, não precisam
|
|
7207
7423
|
//ser notificadas pelo usuário.
|
|
7208
|
-
if (!(reason instanceof
|
|
7424
|
+
if (!(reason instanceof index$1.WaitingChangeException)) {
|
|
7209
7425
|
if (reason) {
|
|
7210
7426
|
this.processException(reason);
|
|
7211
7427
|
}
|
|
@@ -7221,14 +7437,21 @@ class SnkErrorHandler {
|
|
|
7221
7437
|
errorHandler(evt) {
|
|
7222
7438
|
this.processException(evt.error);
|
|
7223
7439
|
}
|
|
7440
|
+
buildErrorCodeHTML(exception) {
|
|
7441
|
+
const onclick = 'try{window.workspace.openHelp(\'_tbcode:' + exception.errorCode + '\')} catch(e){alert(\'Não é possível abrir a ajuda fora do workspace Sankhya\');}';
|
|
7442
|
+
return '<br><a href="#" onclick="' + onclick + '">Código: ' + exception.errorCode + '</a>';
|
|
7443
|
+
}
|
|
7224
7444
|
processException(exception) {
|
|
7225
|
-
if (exception
|
|
7445
|
+
if (exception.errorCode != "") {
|
|
7446
|
+
exception.message += this.buildErrorCodeHTML(exception);
|
|
7447
|
+
}
|
|
7448
|
+
if (exception instanceof index$1.WaitingChangeException) {
|
|
7226
7449
|
this._app.alert(exception.title, exception.message);
|
|
7227
7450
|
}
|
|
7228
|
-
else if (exception instanceof
|
|
7451
|
+
else if (exception instanceof index$1.WarningException) {
|
|
7229
7452
|
this._app.alert(exception.title, exception.message);
|
|
7230
7453
|
}
|
|
7231
|
-
else if (exception instanceof
|
|
7454
|
+
else if (exception instanceof index$1.ErrorException) {
|
|
7232
7455
|
this._app.error(exception.title, exception.message);
|
|
7233
7456
|
}
|
|
7234
7457
|
else {
|
|
@@ -7239,7 +7462,7 @@ class SnkErrorHandler {
|
|
|
7239
7462
|
}
|
|
7240
7463
|
else {
|
|
7241
7464
|
const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
|
|
7242
|
-
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${exception}"`;
|
|
7465
|
+
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${index$1.ObjectUtils.objectToString(exception)}"`;
|
|
7243
7466
|
this._app.error(title, message);
|
|
7244
7467
|
}
|
|
7245
7468
|
}
|
|
@@ -7250,13 +7473,124 @@ class SnkErrorHandler {
|
|
|
7250
7473
|
|
|
7251
7474
|
function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
|
|
7252
7475
|
|
|
7476
|
+
class TotalsFetcher {
|
|
7477
|
+
constructor() {
|
|
7478
|
+
this.templateByQuery = new Map();
|
|
7479
|
+
this.buldTemplates();
|
|
7480
|
+
}
|
|
7481
|
+
buldTemplates() {
|
|
7482
|
+
this.templateByQuery.set("fetchTotals", dist.gql `query($filters: [InputFilter!] $name: String!) {
|
|
7483
|
+
$queryAlias$: fetchTotals(name: $name, filters: $filters ){
|
|
7484
|
+
name
|
|
7485
|
+
value
|
|
7486
|
+
}
|
|
7487
|
+
}`);
|
|
7488
|
+
}
|
|
7489
|
+
async getTotals(name, resourceID, filters) {
|
|
7490
|
+
const path = `totals://${name}/${resourceID}`;
|
|
7491
|
+
let variables = {
|
|
7492
|
+
name: path,
|
|
7493
|
+
filters: filters
|
|
7494
|
+
};
|
|
7495
|
+
return DataFetcher.get().callGraphQL({
|
|
7496
|
+
values: variables,
|
|
7497
|
+
query: this.templateByQuery.get("fetchTotals"),
|
|
7498
|
+
});
|
|
7499
|
+
}
|
|
7500
|
+
fetchTotals(name, resourceID, filters = []) {
|
|
7501
|
+
return new Promise((accept, reject) => {
|
|
7502
|
+
this.getTotals(name, resourceID, filters)
|
|
7503
|
+
.then((result) => {
|
|
7504
|
+
if (result.length > 0) {
|
|
7505
|
+
const totalsData = new Map();
|
|
7506
|
+
result.forEach(total => {
|
|
7507
|
+
totalsData.set(total.name, parseFloat(total.value));
|
|
7508
|
+
});
|
|
7509
|
+
accept(totalsData);
|
|
7510
|
+
}
|
|
7511
|
+
else {
|
|
7512
|
+
reject(`Não foi possível recuperar os totalizadores`);
|
|
7513
|
+
}
|
|
7514
|
+
})
|
|
7515
|
+
.catch((error) => {
|
|
7516
|
+
reject(error);
|
|
7517
|
+
});
|
|
7518
|
+
});
|
|
7519
|
+
}
|
|
7520
|
+
}
|
|
7521
|
+
|
|
7522
|
+
function normalizeValue(value) {
|
|
7523
|
+
if (value == undefined) {
|
|
7524
|
+
return value;
|
|
7525
|
+
}
|
|
7526
|
+
if (value instanceof Date) {
|
|
7527
|
+
return value.toISOString();
|
|
7528
|
+
}
|
|
7529
|
+
if (typeof value === "object") {
|
|
7530
|
+
if (value instanceof Array) {
|
|
7531
|
+
return value.map(item => normalizeValue(item));
|
|
7532
|
+
}
|
|
7533
|
+
else {
|
|
7534
|
+
const normalized = Object.assign({}, value);
|
|
7535
|
+
Object.keys(value).forEach(prop => {
|
|
7536
|
+
if (value[prop]) {
|
|
7537
|
+
normalized[prop] = normalizeValue(value[prop]);
|
|
7538
|
+
}
|
|
7539
|
+
else {
|
|
7540
|
+
delete normalized[prop];
|
|
7541
|
+
}
|
|
7542
|
+
});
|
|
7543
|
+
return normalized;
|
|
7544
|
+
}
|
|
7545
|
+
}
|
|
7546
|
+
return value;
|
|
7547
|
+
}
|
|
7548
|
+
class FilterBarConfigFetcher extends ResourceFetcher {
|
|
7549
|
+
saveConfig(items, resourceID, configName) {
|
|
7550
|
+
const state = items.map(item => {
|
|
7551
|
+
const { id, value, fixed, visible } = item;
|
|
7552
|
+
const stateItem = { id };
|
|
7553
|
+
if (value) {
|
|
7554
|
+
stateItem["value"] = normalizeValue(value);
|
|
7555
|
+
}
|
|
7556
|
+
if (fixed) {
|
|
7557
|
+
stateItem["fixed"] = fixed;
|
|
7558
|
+
}
|
|
7559
|
+
if (visible) {
|
|
7560
|
+
stateItem["visible"] = true;
|
|
7561
|
+
}
|
|
7562
|
+
return stateItem;
|
|
7563
|
+
});
|
|
7564
|
+
return this.saveResource(state, `cfg://filter/FilterBarState:${resourceID}/${configName}`);
|
|
7565
|
+
}
|
|
7566
|
+
getConfig(resourceID, configName) {
|
|
7567
|
+
return new Promise((accept, reject) => {
|
|
7568
|
+
this.loadResource(`cfg://filter/FilterBarState:${resourceID}/${configName}`)
|
|
7569
|
+
.then((configAsString) => {
|
|
7570
|
+
let fieldsList;
|
|
7571
|
+
if (configAsString) {
|
|
7572
|
+
const filterBarConfig = JSON.parse(configAsString);
|
|
7573
|
+
fieldsList = filterBarConfig.items;
|
|
7574
|
+
}
|
|
7575
|
+
accept(fieldsList || []);
|
|
7576
|
+
})
|
|
7577
|
+
.catch((error) => {
|
|
7578
|
+
reject(error);
|
|
7579
|
+
});
|
|
7580
|
+
});
|
|
7581
|
+
}
|
|
7582
|
+
}
|
|
7583
|
+
|
|
7253
7584
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
7254
7585
|
|
|
7255
7586
|
const SnkApplication = class {
|
|
7256
7587
|
constructor(hostRef) {
|
|
7257
|
-
index.registerInstance(this, hostRef);
|
|
7258
|
-
this.applicationLoaded = index.createEvent(this, "applicationLoaded", 7);
|
|
7259
|
-
this.applicationLoading = index.createEvent(this, "applicationLoading", 7);
|
|
7588
|
+
index$2.registerInstance(this, hostRef);
|
|
7589
|
+
this.applicationLoaded = index$2.createEvent(this, "applicationLoaded", 7);
|
|
7590
|
+
this.applicationLoading = index$2.createEvent(this, "applicationLoading", 7);
|
|
7591
|
+
this._authPromises = [];
|
|
7592
|
+
this._duCache = new Map();
|
|
7593
|
+
this._duPromises = new Map();
|
|
7260
7594
|
this._requestListener = new RequestListenerLoadingBar();
|
|
7261
7595
|
}
|
|
7262
7596
|
get parameters() {
|
|
@@ -7275,18 +7609,31 @@ const SnkApplication = class {
|
|
|
7275
7609
|
return this._resourceID;
|
|
7276
7610
|
}
|
|
7277
7611
|
get auth() {
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
this.
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7612
|
+
if (this._auth) {
|
|
7613
|
+
return Promise.resolve(this._auth);
|
|
7614
|
+
}
|
|
7615
|
+
else {
|
|
7616
|
+
return new Promise((resolve, reject) => {
|
|
7617
|
+
const waitingAuth = this._authPromises.length > 0;
|
|
7618
|
+
this._authPromises.push(new PendingPromise(resolve, reject));
|
|
7619
|
+
if (!waitingAuth) {
|
|
7620
|
+
this.authFetcher.getData(this.resourceID).then((authList) => {
|
|
7621
|
+
this._auth = authList;
|
|
7622
|
+
while (this._authPromises.length > 0) {
|
|
7623
|
+
this._authPromises.pop().resolve(this._auth);
|
|
7624
|
+
}
|
|
7625
|
+
}).catch(error => {
|
|
7626
|
+
while (this._authPromises.length > 0) {
|
|
7627
|
+
this._authPromises.pop().reject(error);
|
|
7628
|
+
}
|
|
7629
|
+
});
|
|
7630
|
+
}
|
|
7631
|
+
});
|
|
7632
|
+
}
|
|
7289
7633
|
}
|
|
7634
|
+
/**
|
|
7635
|
+
* Caso o usuário logado seja o SUP.
|
|
7636
|
+
*/
|
|
7290
7637
|
async isUserSup() {
|
|
7291
7638
|
return new Promise((resolve, reject) => {
|
|
7292
7639
|
this.auth.then((authorization) => {
|
|
@@ -7296,6 +7643,9 @@ const SnkApplication = class {
|
|
|
7296
7643
|
});
|
|
7297
7644
|
});
|
|
7298
7645
|
}
|
|
7646
|
+
/**
|
|
7647
|
+
* Se o usuário logado tem permissão pra determinada ação.
|
|
7648
|
+
*/
|
|
7299
7649
|
async hasAccess(access) {
|
|
7300
7650
|
return new Promise((resolve, reject) => {
|
|
7301
7651
|
this.auth.then((authorization) => {
|
|
@@ -7305,6 +7655,9 @@ const SnkApplication = class {
|
|
|
7305
7655
|
});
|
|
7306
7656
|
});
|
|
7307
7657
|
}
|
|
7658
|
+
/**
|
|
7659
|
+
* Retorna todos os acessos do usuário logado.
|
|
7660
|
+
*/
|
|
7308
7661
|
async getAllAccess() {
|
|
7309
7662
|
return new Promise((resolve, reject) => {
|
|
7310
7663
|
this.auth.then((authorization) => {
|
|
@@ -7319,33 +7672,63 @@ const SnkApplication = class {
|
|
|
7319
7672
|
});
|
|
7320
7673
|
});
|
|
7321
7674
|
}
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7675
|
+
/**
|
|
7676
|
+
* Retorna o valor de um parâmetro do tipo string.
|
|
7677
|
+
*/
|
|
7325
7678
|
async getStringParam(name) {
|
|
7326
7679
|
return this.parameters.asString(name, this.resourceID);
|
|
7327
7680
|
}
|
|
7681
|
+
/**
|
|
7682
|
+
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
7683
|
+
*/
|
|
7328
7684
|
async getIntParam(name) {
|
|
7329
7685
|
return this.parameters.asInteger(name, this.resourceID);
|
|
7330
7686
|
}
|
|
7687
|
+
/**
|
|
7688
|
+
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
7689
|
+
*/
|
|
7331
7690
|
async getFloatParam(name) {
|
|
7332
7691
|
return this.parameters.asFloat(name, this.resourceID);
|
|
7333
7692
|
}
|
|
7693
|
+
/**
|
|
7694
|
+
* Retorna o valor de um parâmetro do tipo booleano.
|
|
7695
|
+
*/
|
|
7334
7696
|
async getBooleanParam(name) {
|
|
7335
7697
|
return this.parameters.asBoolean(name, this.resourceID);
|
|
7336
7698
|
}
|
|
7699
|
+
/**
|
|
7700
|
+
* Retorna o valor de um parâmetro do tipo data.
|
|
7701
|
+
*/
|
|
7337
7702
|
async getDateParam(name) {
|
|
7338
7703
|
return this.parameters.asDate(name, this.resourceID);
|
|
7339
7704
|
}
|
|
7705
|
+
/**
|
|
7706
|
+
* Mostra o conteúdo passado em um Popup
|
|
7707
|
+
*/
|
|
7340
7708
|
async showPopUp(content) {
|
|
7341
|
-
this.
|
|
7709
|
+
this.clearContent(this._popUp);
|
|
7342
7710
|
this._popUp.appendChild(content);
|
|
7343
7711
|
this._popUp.opened = true;
|
|
7344
7712
|
}
|
|
7713
|
+
async showModal(content) {
|
|
7714
|
+
this.clearContent(this._rightModal);
|
|
7715
|
+
this._rightModal.appendChild(content);
|
|
7716
|
+
this._rightModal.opened = true;
|
|
7717
|
+
}
|
|
7718
|
+
async closeModal() {
|
|
7719
|
+
this.clearContent(this._rightModal);
|
|
7720
|
+
this._rightModal.opened = false;
|
|
7721
|
+
}
|
|
7722
|
+
/**
|
|
7723
|
+
* Fecha o popup, liberando o conteúdo.
|
|
7724
|
+
*/
|
|
7345
7725
|
async closePopUp() {
|
|
7346
|
-
this.
|
|
7726
|
+
this.clearContent(this._popUp);
|
|
7347
7727
|
this._popUp.opened = false;
|
|
7348
7728
|
}
|
|
7729
|
+
/**
|
|
7730
|
+
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
7731
|
+
*/
|
|
7349
7732
|
async temOpcional(opcional) {
|
|
7350
7733
|
const opts = opcional.split(",");
|
|
7351
7734
|
return new Promise((resolve, reject) => {
|
|
@@ -7369,6 +7752,10 @@ const SnkApplication = class {
|
|
|
7369
7752
|
});
|
|
7370
7753
|
});
|
|
7371
7754
|
}
|
|
7755
|
+
/**
|
|
7756
|
+
* Retorna a configuração de um recurso por service broker
|
|
7757
|
+
* Veja também o método "loadConfig"
|
|
7758
|
+
*/
|
|
7372
7759
|
async getConfig(key) {
|
|
7373
7760
|
let payload = {
|
|
7374
7761
|
"serviceName": "SystemUtilsSP.getConf",
|
|
@@ -7386,6 +7773,9 @@ const SnkApplication = class {
|
|
|
7386
7773
|
.catch(error => reject(error));
|
|
7387
7774
|
});
|
|
7388
7775
|
}
|
|
7776
|
+
/**
|
|
7777
|
+
* Salva a configuração de determinado recurso.
|
|
7778
|
+
*/
|
|
7389
7779
|
async saveConfig(key, data) {
|
|
7390
7780
|
let payload = {
|
|
7391
7781
|
"serviceName": "SystemUtilsSP.saveConf",
|
|
@@ -7404,42 +7794,166 @@ const SnkApplication = class {
|
|
|
7404
7794
|
.catch(error => reject(error));
|
|
7405
7795
|
});
|
|
7406
7796
|
}
|
|
7797
|
+
/**
|
|
7798
|
+
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
7799
|
+
*/
|
|
7407
7800
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
7408
7801
|
return Promise.resolve(window[attribName]);
|
|
7409
7802
|
}
|
|
7803
|
+
/**
|
|
7804
|
+
* Abre determinada tela, repassando pkObject
|
|
7805
|
+
*/
|
|
7410
7806
|
async openApp(resourceId, pkObject) {
|
|
7411
7807
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
7412
7808
|
}
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7809
|
+
getDuPromissesStack(dataUnitName) {
|
|
7810
|
+
let stack;
|
|
7811
|
+
if (dataUnitName) {
|
|
7812
|
+
stack = this._duPromises.get(dataUnitName);
|
|
7813
|
+
if (!stack) {
|
|
7814
|
+
stack = [];
|
|
7815
|
+
this._duPromises.set(dataUnitName, stack);
|
|
7816
|
+
}
|
|
7817
|
+
}
|
|
7818
|
+
return stack || [];
|
|
7819
|
+
}
|
|
7820
|
+
/**
|
|
7821
|
+
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
|
7822
|
+
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado
|
|
7823
|
+
*/
|
|
7824
|
+
async createDataunit(entityName, dataUnitName) {
|
|
7825
|
+
return new Promise((resolve, reject) => {
|
|
7826
|
+
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
|
7827
|
+
const waitingDu = duPromisses.length > 0;
|
|
7828
|
+
duPromisses.push(new PendingPromise(resolve, reject));
|
|
7829
|
+
if (!waitingDu) {
|
|
7830
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
7831
|
+
dataUnit.loadMetadata().then(() => {
|
|
7832
|
+
if (dataUnitName) {
|
|
7833
|
+
this._duCache.set(dataUnitName, dataUnit);
|
|
7834
|
+
}
|
|
7835
|
+
while (duPromisses.length > 0) {
|
|
7836
|
+
duPromisses.pop().resolve(dataUnit);
|
|
7837
|
+
}
|
|
7838
|
+
}).catch(reason => {
|
|
7839
|
+
while (duPromisses.length > 0) {
|
|
7840
|
+
duPromisses.pop().reject(reason);
|
|
7841
|
+
}
|
|
7842
|
+
});
|
|
7843
|
+
}
|
|
7844
|
+
});
|
|
7845
|
+
}
|
|
7846
|
+
/**
|
|
7847
|
+
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
|
7848
|
+
*/
|
|
7849
|
+
async getDataUnit(entityName, dataUnitName) {
|
|
7850
|
+
return new Promise((resolve, reject) => {
|
|
7851
|
+
const dataUnit = this._duCache.get(dataUnitName);
|
|
7852
|
+
if (dataUnit) {
|
|
7853
|
+
resolve(dataUnit);
|
|
7854
|
+
}
|
|
7855
|
+
else {
|
|
7856
|
+
this.createDataunit(entityName, dataUnitName).then(dataUnit => {
|
|
7857
|
+
resolve(dataUnit);
|
|
7858
|
+
}).catch(reason => reject(reason));
|
|
7859
|
+
}
|
|
7417
7860
|
});
|
|
7418
7861
|
}
|
|
7862
|
+
/**
|
|
7863
|
+
* Retorna o resourceID da tela em questão.
|
|
7864
|
+
*/
|
|
7419
7865
|
async getResourceID() {
|
|
7420
7866
|
return Promise.resolve(this.resourceID);
|
|
7421
7867
|
}
|
|
7868
|
+
/**
|
|
7869
|
+
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
7870
|
+
*/
|
|
7422
7871
|
async alert(title, message, icon, options) {
|
|
7423
|
-
return
|
|
7872
|
+
return index$3.ApplicationUtils.alert(title, message, icon, options);
|
|
7424
7873
|
}
|
|
7874
|
+
/**
|
|
7875
|
+
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
7876
|
+
*/
|
|
7425
7877
|
async error(title, message, icon, options) {
|
|
7426
|
-
return
|
|
7878
|
+
return index$3.ApplicationUtils.error(title, message, icon, options);
|
|
7427
7879
|
}
|
|
7428
|
-
|
|
7429
|
-
|
|
7880
|
+
/**
|
|
7881
|
+
* Mostra o diálogo de sucesso de acordo com os parâmetros passados.
|
|
7882
|
+
*/
|
|
7883
|
+
async success(title, message, icon, options) {
|
|
7884
|
+
return index$3.ApplicationUtils.success(title, message, icon, options);
|
|
7885
|
+
}
|
|
7886
|
+
/**
|
|
7887
|
+
* Exibe um diálogo de mensagem comum
|
|
7888
|
+
*/
|
|
7889
|
+
async message(title, message, icon, options) {
|
|
7890
|
+
return index$3.ApplicationUtils.message(title, message, icon, options);
|
|
7430
7891
|
}
|
|
7892
|
+
/**
|
|
7893
|
+
* Exibe um diálogo de confirmação
|
|
7894
|
+
*/
|
|
7895
|
+
async confirm(title, message, icon, dialogType, options) {
|
|
7896
|
+
return index$3.ApplicationUtils.confirm(title, message, icon, dialogType, options);
|
|
7897
|
+
}
|
|
7898
|
+
/**
|
|
7899
|
+
* Mostra uma informação efêmera (de segundo plano).
|
|
7900
|
+
*/
|
|
7431
7901
|
async info(message, options) {
|
|
7432
|
-
return
|
|
7902
|
+
return index$3.ApplicationUtils.info(message, options);
|
|
7433
7903
|
}
|
|
7904
|
+
/**
|
|
7905
|
+
* Busca a configuração de formulário.
|
|
7906
|
+
*/
|
|
7434
7907
|
async loadFormConfig(name) {
|
|
7435
7908
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7436
7909
|
}
|
|
7437
|
-
|
|
7438
|
-
|
|
7910
|
+
/**
|
|
7911
|
+
* Busca a configuração de grade.
|
|
7912
|
+
*/
|
|
7913
|
+
async loadGridConfig(name) {
|
|
7914
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7915
|
+
}
|
|
7916
|
+
/**
|
|
7917
|
+
* Busca os totalizadores da grade.
|
|
7918
|
+
*/
|
|
7919
|
+
async loadTotals(name, resourceID, filters) {
|
|
7920
|
+
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
|
7439
7921
|
}
|
|
7922
|
+
/**
|
|
7923
|
+
* Salva a configuração de grade.
|
|
7924
|
+
*/
|
|
7440
7925
|
async saveGridConfig(config) {
|
|
7441
7926
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7442
7927
|
}
|
|
7928
|
+
/**
|
|
7929
|
+
* Obtém as configurações da barra de filtros
|
|
7930
|
+
*/
|
|
7931
|
+
async getFilterBarConfig(name) {
|
|
7932
|
+
return new Promise((accept, reject) => {
|
|
7933
|
+
if (this.configName === name && this._filterBarConfig) {
|
|
7934
|
+
accept(this._filterBarConfig);
|
|
7935
|
+
}
|
|
7936
|
+
else if (this.configName === name && this._filterConfigPromise != undefined) {
|
|
7937
|
+
Promise.all([this._filterConfigPromise])
|
|
7938
|
+
.then(result => accept(result[0]))
|
|
7939
|
+
.catch(reason => reject(reason[0]));
|
|
7940
|
+
}
|
|
7941
|
+
else {
|
|
7942
|
+
this.filterBarConfigFetcher.getConfig(this.resourceID, name)
|
|
7943
|
+
.then(config => accept(config))
|
|
7944
|
+
.catch(reason => reject(reason));
|
|
7945
|
+
}
|
|
7946
|
+
});
|
|
7947
|
+
}
|
|
7948
|
+
/**
|
|
7949
|
+
* Salva as configurações da barra de filtros
|
|
7950
|
+
*/
|
|
7951
|
+
async saveFilterBarConfig(config, name) {
|
|
7952
|
+
return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
|
|
7953
|
+
}
|
|
7954
|
+
async getAuthList(_auth) {
|
|
7955
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7956
|
+
}
|
|
7443
7957
|
get urlParams() {
|
|
7444
7958
|
if (!this._urlParams) {
|
|
7445
7959
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -7464,6 +7978,12 @@ const SnkApplication = class {
|
|
|
7464
7978
|
}
|
|
7465
7979
|
return this._gridConfigFetcher;
|
|
7466
7980
|
}
|
|
7981
|
+
get totalsFetcher() {
|
|
7982
|
+
if (!this._totalsFetcher) {
|
|
7983
|
+
this._totalsFetcher = new TotalsFetcher();
|
|
7984
|
+
}
|
|
7985
|
+
return this._totalsFetcher;
|
|
7986
|
+
}
|
|
7467
7987
|
get pesquisaFetcher() {
|
|
7468
7988
|
if (!this._pesquisaFetcher) {
|
|
7469
7989
|
this._pesquisaFetcher = new PesquisaFetcher();
|
|
@@ -7476,9 +7996,17 @@ const SnkApplication = class {
|
|
|
7476
7996
|
}
|
|
7477
7997
|
return this._authFetcher;
|
|
7478
7998
|
}
|
|
7999
|
+
get filterBarConfigFetcher() {
|
|
8000
|
+
if (!this._filterBarConfigFetcher) {
|
|
8001
|
+
this._filterBarConfigFetcher = new FilterBarConfigFetcher();
|
|
8002
|
+
}
|
|
8003
|
+
return this._filterBarConfigFetcher;
|
|
8004
|
+
}
|
|
7479
8005
|
async executeSearch(searchArgument, fieldName, dataUnit) {
|
|
7480
8006
|
const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
|
|
7481
|
-
if (!descriptor)
|
|
8007
|
+
if (!descriptor) {
|
|
8008
|
+
//TODO: Implementar mensagem de erro
|
|
8009
|
+
}
|
|
7482
8010
|
else {
|
|
7483
8011
|
const { mode, argument } = searchArgument;
|
|
7484
8012
|
const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
|
|
@@ -7492,13 +8020,13 @@ const SnkApplication = class {
|
|
|
7492
8020
|
};
|
|
7493
8021
|
dependencies === null || dependencies === void 0 ? void 0 : dependencies.filter(dep => { var _a; return (_a = dep.masterFields) === null || _a === void 0 ? void 0 : _a.every(f => { var _a; return (_a = dataUnit.getField(f)) === null || _a === void 0 ? void 0 : _a.visible; }); }).forEach(dependency => {
|
|
7494
8022
|
var _a;
|
|
7495
|
-
if (dependency.type ===
|
|
8023
|
+
if (dependency.type === index$1.DependencyType.SEARCHING) {
|
|
7496
8024
|
if (((_a = dependency.masterFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
7497
8025
|
criteria = {
|
|
7498
8026
|
expression: dependency.expression,
|
|
7499
8027
|
params: dependency.masterFields.map(fieldName => {
|
|
7500
8028
|
const masterDescriptor = dataUnit.getField(fieldName);
|
|
7501
|
-
const dataType = (masterDescriptor === null || masterDescriptor === void 0 ? void 0 : masterDescriptor.dataType) ||
|
|
8029
|
+
const dataType = (masterDescriptor === null || masterDescriptor === void 0 ? void 0 : masterDescriptor.dataType) || index$1.DataType.TEXT;
|
|
7502
8030
|
const value = dataUnit.getFieldValue(fieldName);
|
|
7503
8031
|
if (value == undefined) {
|
|
7504
8032
|
this.alert("Erro ao pesquisar", `É necessario informar o campo ${masterDescriptor.label} para executar a pesquisa.`);
|
|
@@ -7510,23 +8038,27 @@ const SnkApplication = class {
|
|
|
7510
8038
|
}
|
|
7511
8039
|
}
|
|
7512
8040
|
});
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
8041
|
+
return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
|
|
8042
|
+
}
|
|
8043
|
+
}
|
|
8044
|
+
async executePreparedSearch(mode, argument, options) {
|
|
8045
|
+
const { entity, entityDescription, criteria, searchOptions } = options;
|
|
8046
|
+
if (mode === "ADVANCED") {
|
|
8047
|
+
return new Promise(accept => {
|
|
8048
|
+
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
8049
|
+
pesquisaContent.argument = argument;
|
|
8050
|
+
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
|
|
8051
|
+
pesquisaContent.selectItem = (option) => {
|
|
8052
|
+
accept(option);
|
|
8053
|
+
this.clearPopUpTitle();
|
|
8054
|
+
this.closePopUp();
|
|
8055
|
+
};
|
|
8056
|
+
this.setPopUpTitle(entityDescription);
|
|
8057
|
+
this.showPopUp(pesquisaContent);
|
|
8058
|
+
});
|
|
8059
|
+
}
|
|
8060
|
+
else {
|
|
8061
|
+
return this.pesquisaFetcher.loadSearchOptions(entity, argument, criteria, searchOptions);
|
|
7530
8062
|
}
|
|
7531
8063
|
}
|
|
7532
8064
|
async isDebugMode() {
|
|
@@ -7534,10 +8066,10 @@ const SnkApplication = class {
|
|
|
7534
8066
|
accept(window['isDebugMode']);
|
|
7535
8067
|
});
|
|
7536
8068
|
}
|
|
7537
|
-
|
|
7538
|
-
if (
|
|
7539
|
-
Array.from(
|
|
7540
|
-
|
|
8069
|
+
clearContent(container) {
|
|
8070
|
+
if (container) {
|
|
8071
|
+
Array.from(container.children).forEach(child => {
|
|
8072
|
+
container.removeChild(child);
|
|
7541
8073
|
});
|
|
7542
8074
|
}
|
|
7543
8075
|
}
|
|
@@ -7549,14 +8081,26 @@ const SnkApplication = class {
|
|
|
7549
8081
|
}
|
|
7550
8082
|
componentWillLoad() {
|
|
7551
8083
|
this._errorHandler = new SnkErrorHandler(this);
|
|
7552
|
-
|
|
7553
|
-
|
|
8084
|
+
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
|
|
8085
|
+
index$1.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
|
|
8086
|
+
index$1.ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
|
|
7554
8087
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
7555
8088
|
});
|
|
7556
|
-
|
|
7557
|
-
|
|
8089
|
+
index$1.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
8090
|
+
if (this.configName) {
|
|
8091
|
+
this._filterConfigPromise = new Promise((accept, reject) => {
|
|
8092
|
+
this.filterBarConfigFetcher.getConfig(this.resourceID, this.configName)
|
|
8093
|
+
.then(config => {
|
|
8094
|
+
this._filterBarConfig = config;
|
|
8095
|
+
accept(config);
|
|
8096
|
+
})
|
|
8097
|
+
.catch(reason => reject(reason));
|
|
8098
|
+
});
|
|
8099
|
+
}
|
|
8100
|
+
index$1.ErrorTracking.init();
|
|
7558
8101
|
}
|
|
7559
8102
|
connectedCallback() {
|
|
8103
|
+
index$1.ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
7560
8104
|
DataFetcher.addRequestListener(this._requestListener);
|
|
7561
8105
|
}
|
|
7562
8106
|
disconnectedCallback() {
|
|
@@ -7569,23 +8113,30 @@ const SnkApplication = class {
|
|
|
7569
8113
|
});
|
|
7570
8114
|
}
|
|
7571
8115
|
render() {
|
|
7572
|
-
return (index.h("div", null, index.h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), index.h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() })));
|
|
8116
|
+
return (index$2.h("div", null, index$2.h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), index$2.h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), index$2.h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "col col--sd-3", closeOutsideClick: true })));
|
|
7573
8117
|
}
|
|
7574
8118
|
};
|
|
7575
8119
|
class RequestListenerLoadingBar {
|
|
7576
8120
|
constructor() {
|
|
7577
8121
|
this._debounceTime = 1000;
|
|
8122
|
+
this._ignoredNameTypes = ["totals"];
|
|
7578
8123
|
this._countRequest = 0;
|
|
7579
8124
|
}
|
|
7580
|
-
onRequestStart() {
|
|
7581
|
-
this.
|
|
8125
|
+
onRequestStart(param) {
|
|
8126
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8127
|
+
return;
|
|
8128
|
+
}
|
|
7582
8129
|
this._countRequest++;
|
|
8130
|
+
this.loadingBar.show();
|
|
7583
8131
|
if (this._timerLoading) {
|
|
7584
8132
|
clearTimeout(this._timerLoading);
|
|
7585
8133
|
}
|
|
7586
8134
|
}
|
|
7587
8135
|
;
|
|
7588
|
-
onRequestEnd() {
|
|
8136
|
+
onRequestEnd(param) {
|
|
8137
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8138
|
+
return;
|
|
8139
|
+
}
|
|
7589
8140
|
this._countRequest--;
|
|
7590
8141
|
this._timerLoading = setTimeout(() => {
|
|
7591
8142
|
if (this._countRequest <= 0) {
|
|
@@ -7594,6 +8145,25 @@ class RequestListenerLoadingBar {
|
|
|
7594
8145
|
}, this._debounceTime);
|
|
7595
8146
|
}
|
|
7596
8147
|
;
|
|
8148
|
+
isIgnoreLoadingOnRequest(param) {
|
|
8149
|
+
var _a;
|
|
8150
|
+
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
8151
|
+
const { name } = param.requestBody[0].variables;
|
|
8152
|
+
if (name) {
|
|
8153
|
+
const nameParts = name.split(":");
|
|
8154
|
+
const nameType = nameParts[0];
|
|
8155
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
8156
|
+
}
|
|
8157
|
+
}
|
|
8158
|
+
return false;
|
|
8159
|
+
}
|
|
8160
|
+
;
|
|
8161
|
+
}
|
|
8162
|
+
class PendingPromise {
|
|
8163
|
+
constructor(resolve, reject) {
|
|
8164
|
+
this.resolve = resolve;
|
|
8165
|
+
this.reject = reject;
|
|
8166
|
+
}
|
|
7597
8167
|
}
|
|
7598
8168
|
SnkApplication.style = snkApplicationCss;
|
|
7599
8169
|
|