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