@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
|
@@ -1,21 +1,48 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException,
|
|
3
|
-
import { ApplicationUtils } from '
|
|
4
|
-
import {
|
|
2
|
+
import { E as ErrorException, W as WarningException, S as StringUtils, D as DataUnit, b as DataType, C as ChangeOperation, d as DateUtils, O as ObjectUtils, e as WaitingChangeException, f as DependencyType, A as ApplicationContext, g as ErrorTracking } from './index2.js';
|
|
3
|
+
import { A as ApplicationUtils } from './index3.js';
|
|
4
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
|
6
6
|
|
|
7
7
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
8
8
|
|
|
9
|
+
function getDefaultExportFromCjs (x) {
|
|
10
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
function createCommonjsModule(fn, basedir, module) {
|
|
10
14
|
return module = {
|
|
11
15
|
path: basedir,
|
|
12
16
|
exports: {},
|
|
13
17
|
require: function (path, base) {
|
|
14
|
-
return commonjsRequire();
|
|
18
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
15
19
|
}
|
|
16
20
|
}, fn(module, module.exports), module.exports;
|
|
17
21
|
}
|
|
18
22
|
|
|
23
|
+
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
24
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
28
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getAugmentedNamespace(n) {
|
|
32
|
+
if (n.__esModule) return n;
|
|
33
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
34
|
+
Object.keys(n).forEach(function (k) {
|
|
35
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
36
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return n[k];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return a;
|
|
44
|
+
}
|
|
45
|
+
|
|
19
46
|
function commonjsRequire () {
|
|
20
47
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
21
48
|
}
|
|
@@ -32,7 +59,7 @@ return new F();
|
|
|
32
59
|
})();
|
|
33
60
|
(function(self) {
|
|
34
61
|
|
|
35
|
-
(
|
|
62
|
+
var irrelevant = (function (exports) {
|
|
36
63
|
|
|
37
64
|
var support = {
|
|
38
65
|
searchParams: 'URLSearchParams' in self,
|
|
@@ -560,7 +587,7 @@ return new F();
|
|
|
560
587
|
|
|
561
588
|
return exports;
|
|
562
589
|
|
|
563
|
-
})
|
|
590
|
+
})({});
|
|
564
591
|
})(__self__);
|
|
565
592
|
__self__.fetch.ponyfill = true;
|
|
566
593
|
// Remove "polyfill" property added by whatwg-fetch
|
|
@@ -577,7 +604,10 @@ exports.Response = ctx.Response;
|
|
|
577
604
|
module.exports = exports;
|
|
578
605
|
});
|
|
579
606
|
|
|
607
|
+
const browserPonyfill$1 = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill);
|
|
608
|
+
|
|
580
609
|
var isObjectLike_1 = createCommonjsModule(function (module, exports) {
|
|
610
|
+
'use strict';
|
|
581
611
|
|
|
582
612
|
Object.defineProperty(exports, '__esModule', {
|
|
583
613
|
value: true,
|
|
@@ -593,7 +623,10 @@ function isObjectLike(value) {
|
|
|
593
623
|
}
|
|
594
624
|
});
|
|
595
625
|
|
|
626
|
+
const isObjectLike = /*@__PURE__*/getDefaultExportFromCjs(isObjectLike_1);
|
|
627
|
+
|
|
596
628
|
var invariant_1 = createCommonjsModule(function (module, exports) {
|
|
629
|
+
'use strict';
|
|
597
630
|
|
|
598
631
|
Object.defineProperty(exports, '__esModule', {
|
|
599
632
|
value: true,
|
|
@@ -611,7 +644,10 @@ function invariant(condition, message) {
|
|
|
611
644
|
}
|
|
612
645
|
});
|
|
613
646
|
|
|
647
|
+
const invariant = /*@__PURE__*/getDefaultExportFromCjs(invariant_1);
|
|
648
|
+
|
|
614
649
|
var location_1 = createCommonjsModule(function (module, exports) {
|
|
650
|
+
'use strict';
|
|
615
651
|
|
|
616
652
|
Object.defineProperty(exports, '__esModule', {
|
|
617
653
|
value: true,
|
|
@@ -651,7 +687,10 @@ function getLocation(source, position) {
|
|
|
651
687
|
}
|
|
652
688
|
});
|
|
653
689
|
|
|
690
|
+
const location$1 = /*@__PURE__*/getDefaultExportFromCjs(location_1);
|
|
691
|
+
|
|
654
692
|
var printLocation_1 = createCommonjsModule(function (module, exports) {
|
|
693
|
+
'use strict';
|
|
655
694
|
|
|
656
695
|
Object.defineProperty(exports, '__esModule', {
|
|
657
696
|
value: true,
|
|
@@ -727,7 +766,10 @@ function printPrefixedLines(lines) {
|
|
|
727
766
|
}
|
|
728
767
|
});
|
|
729
768
|
|
|
769
|
+
const printLocation = /*@__PURE__*/getDefaultExportFromCjs(printLocation_1);
|
|
770
|
+
|
|
730
771
|
var GraphQLError_1 = createCommonjsModule(function (module, exports) {
|
|
772
|
+
'use strict';
|
|
731
773
|
|
|
732
774
|
Object.defineProperty(exports, '__esModule', {
|
|
733
775
|
value: true,
|
|
@@ -996,7 +1038,10 @@ function formatError(error) {
|
|
|
996
1038
|
}
|
|
997
1039
|
});
|
|
998
1040
|
|
|
1041
|
+
const GraphQLError = /*@__PURE__*/getDefaultExportFromCjs(GraphQLError_1);
|
|
1042
|
+
|
|
999
1043
|
var syntaxError_1 = createCommonjsModule(function (module, exports) {
|
|
1044
|
+
'use strict';
|
|
1000
1045
|
|
|
1001
1046
|
Object.defineProperty(exports, '__esModule', {
|
|
1002
1047
|
value: true,
|
|
@@ -1017,7 +1062,10 @@ function syntaxError(source, position, description) {
|
|
|
1017
1062
|
}
|
|
1018
1063
|
});
|
|
1019
1064
|
|
|
1065
|
+
const syntaxError = /*@__PURE__*/getDefaultExportFromCjs(syntaxError_1);
|
|
1066
|
+
|
|
1020
1067
|
var ast = createCommonjsModule(function (module, exports) {
|
|
1068
|
+
'use strict';
|
|
1021
1069
|
|
|
1022
1070
|
Object.defineProperty(exports, '__esModule', {
|
|
1023
1071
|
value: true,
|
|
@@ -1233,7 +1281,7 @@ function isNode(maybeNode) {
|
|
|
1233
1281
|
}
|
|
1234
1282
|
/** Name */
|
|
1235
1283
|
|
|
1236
|
-
|
|
1284
|
+
var OperationTypeNode;
|
|
1237
1285
|
exports.OperationTypeNode = OperationTypeNode;
|
|
1238
1286
|
|
|
1239
1287
|
(function (OperationTypeNode) {
|
|
@@ -1243,7 +1291,10 @@ exports.OperationTypeNode = OperationTypeNode;
|
|
|
1243
1291
|
})(OperationTypeNode || (exports.OperationTypeNode = OperationTypeNode = {}));
|
|
1244
1292
|
});
|
|
1245
1293
|
|
|
1294
|
+
const ast$1 = /*@__PURE__*/getDefaultExportFromCjs(ast);
|
|
1295
|
+
|
|
1246
1296
|
var directiveLocation = createCommonjsModule(function (module, exports) {
|
|
1297
|
+
'use strict';
|
|
1247
1298
|
|
|
1248
1299
|
Object.defineProperty(exports, '__esModule', {
|
|
1249
1300
|
value: true,
|
|
@@ -1253,13 +1304,7 @@ exports.DirectiveLocation = void 0;
|
|
|
1253
1304
|
/**
|
|
1254
1305
|
* The set of allowed directive location values.
|
|
1255
1306
|
*/
|
|
1256
|
-
|
|
1257
|
-
/**
|
|
1258
|
-
* The enum type representing the directive location values.
|
|
1259
|
-
*
|
|
1260
|
-
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1261
|
-
*/
|
|
1262
|
-
|
|
1307
|
+
var DirectiveLocation;
|
|
1263
1308
|
exports.DirectiveLocation = DirectiveLocation;
|
|
1264
1309
|
|
|
1265
1310
|
(function (DirectiveLocation) {
|
|
@@ -1283,9 +1328,17 @@ exports.DirectiveLocation = DirectiveLocation;
|
|
|
1283
1328
|
DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';
|
|
1284
1329
|
DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';
|
|
1285
1330
|
})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {}));
|
|
1331
|
+
/**
|
|
1332
|
+
* The enum type representing the directive location values.
|
|
1333
|
+
*
|
|
1334
|
+
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1335
|
+
*/
|
|
1286
1336
|
});
|
|
1287
1337
|
|
|
1338
|
+
const directiveLocation$1 = /*@__PURE__*/getDefaultExportFromCjs(directiveLocation);
|
|
1339
|
+
|
|
1288
1340
|
var kinds = createCommonjsModule(function (module, exports) {
|
|
1341
|
+
'use strict';
|
|
1289
1342
|
|
|
1290
1343
|
Object.defineProperty(exports, '__esModule', {
|
|
1291
1344
|
value: true,
|
|
@@ -1295,13 +1348,7 @@ exports.Kind = void 0;
|
|
|
1295
1348
|
/**
|
|
1296
1349
|
* The set of allowed kind values for AST nodes.
|
|
1297
1350
|
*/
|
|
1298
|
-
|
|
1299
|
-
/**
|
|
1300
|
-
* The enum type representing the possible kind values of AST nodes.
|
|
1301
|
-
*
|
|
1302
|
-
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1303
|
-
*/
|
|
1304
|
-
|
|
1351
|
+
var Kind;
|
|
1305
1352
|
exports.Kind = Kind;
|
|
1306
1353
|
|
|
1307
1354
|
(function (Kind) {
|
|
@@ -1349,9 +1396,17 @@ exports.Kind = Kind;
|
|
|
1349
1396
|
Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';
|
|
1350
1397
|
Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';
|
|
1351
1398
|
})(Kind || (exports.Kind = Kind = {}));
|
|
1399
|
+
/**
|
|
1400
|
+
* The enum type representing the possible kind values of AST nodes.
|
|
1401
|
+
*
|
|
1402
|
+
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1403
|
+
*/
|
|
1352
1404
|
});
|
|
1353
1405
|
|
|
1406
|
+
const kinds$1 = /*@__PURE__*/getDefaultExportFromCjs(kinds);
|
|
1407
|
+
|
|
1354
1408
|
var characterClasses = createCommonjsModule(function (module, exports) {
|
|
1409
|
+
'use strict';
|
|
1355
1410
|
|
|
1356
1411
|
Object.defineProperty(exports, '__esModule', {
|
|
1357
1412
|
value: true,
|
|
@@ -1428,7 +1483,10 @@ function isNameContinue(code) {
|
|
|
1428
1483
|
}
|
|
1429
1484
|
});
|
|
1430
1485
|
|
|
1486
|
+
const characterClasses$1 = /*@__PURE__*/getDefaultExportFromCjs(characterClasses);
|
|
1487
|
+
|
|
1431
1488
|
var blockString = createCommonjsModule(function (module, exports) {
|
|
1489
|
+
'use strict';
|
|
1432
1490
|
|
|
1433
1491
|
Object.defineProperty(exports, '__esModule', {
|
|
1434
1492
|
value: true,
|
|
@@ -1625,7 +1683,10 @@ function printBlockString(value, options) {
|
|
|
1625
1683
|
}
|
|
1626
1684
|
});
|
|
1627
1685
|
|
|
1686
|
+
const blockString$1 = /*@__PURE__*/getDefaultExportFromCjs(blockString);
|
|
1687
|
+
|
|
1628
1688
|
var tokenKind = createCommonjsModule(function (module, exports) {
|
|
1689
|
+
'use strict';
|
|
1629
1690
|
|
|
1630
1691
|
Object.defineProperty(exports, '__esModule', {
|
|
1631
1692
|
value: true,
|
|
@@ -1636,13 +1697,7 @@ exports.TokenKind = void 0;
|
|
|
1636
1697
|
* An exported enum describing the different kinds of tokens that the
|
|
1637
1698
|
* lexer emits.
|
|
1638
1699
|
*/
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* The enum type representing the token kinds values.
|
|
1642
|
-
*
|
|
1643
|
-
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1644
|
-
*/
|
|
1645
|
-
|
|
1700
|
+
var TokenKind;
|
|
1646
1701
|
exports.TokenKind = TokenKind;
|
|
1647
1702
|
|
|
1648
1703
|
(function (TokenKind) {
|
|
@@ -1669,9 +1724,17 @@ exports.TokenKind = TokenKind;
|
|
|
1669
1724
|
TokenKind['BLOCK_STRING'] = 'BlockString';
|
|
1670
1725
|
TokenKind['COMMENT'] = 'Comment';
|
|
1671
1726
|
})(TokenKind || (exports.TokenKind = TokenKind = {}));
|
|
1727
|
+
/**
|
|
1728
|
+
* The enum type representing the token kinds values.
|
|
1729
|
+
*
|
|
1730
|
+
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1731
|
+
*/
|
|
1672
1732
|
});
|
|
1673
1733
|
|
|
1734
|
+
const tokenKind$1 = /*@__PURE__*/getDefaultExportFromCjs(tokenKind);
|
|
1735
|
+
|
|
1674
1736
|
var lexer = createCommonjsModule(function (module, exports) {
|
|
1737
|
+
'use strict';
|
|
1675
1738
|
|
|
1676
1739
|
Object.defineProperty(exports, '__esModule', {
|
|
1677
1740
|
value: true,
|
|
@@ -2679,7 +2742,10 @@ function readName(lexer, start) {
|
|
|
2679
2742
|
}
|
|
2680
2743
|
});
|
|
2681
2744
|
|
|
2745
|
+
const lexer$1 = /*@__PURE__*/getDefaultExportFromCjs(lexer);
|
|
2746
|
+
|
|
2682
2747
|
var devAssert_1 = createCommonjsModule(function (module, exports) {
|
|
2748
|
+
'use strict';
|
|
2683
2749
|
|
|
2684
2750
|
Object.defineProperty(exports, '__esModule', {
|
|
2685
2751
|
value: true,
|
|
@@ -2695,7 +2761,10 @@ function devAssert(condition, message) {
|
|
|
2695
2761
|
}
|
|
2696
2762
|
});
|
|
2697
2763
|
|
|
2764
|
+
const devAssert = /*@__PURE__*/getDefaultExportFromCjs(devAssert_1);
|
|
2765
|
+
|
|
2698
2766
|
var inspect_1 = createCommonjsModule(function (module, exports) {
|
|
2767
|
+
'use strict';
|
|
2699
2768
|
|
|
2700
2769
|
Object.defineProperty(exports, '__esModule', {
|
|
2701
2770
|
value: true,
|
|
@@ -2818,7 +2887,10 @@ function getObjectTag(object) {
|
|
|
2818
2887
|
}
|
|
2819
2888
|
});
|
|
2820
2889
|
|
|
2890
|
+
const inspect = /*@__PURE__*/getDefaultExportFromCjs(inspect_1);
|
|
2891
|
+
|
|
2821
2892
|
var instanceOf_1 = createCommonjsModule(function (module, exports) {
|
|
2893
|
+
'use strict';
|
|
2822
2894
|
|
|
2823
2895
|
Object.defineProperty(exports, '__esModule', {
|
|
2824
2896
|
value: true,
|
|
@@ -2837,14 +2909,54 @@ const instanceOf =
|
|
|
2837
2909
|
/* c8 ignore next 6 */
|
|
2838
2910
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
2839
2911
|
// eslint-disable-next-line no-undef
|
|
2840
|
-
|
|
2912
|
+
"development" === 'production'
|
|
2913
|
+
? function instanceOf(value, constructor) {
|
|
2841
2914
|
return value instanceof constructor;
|
|
2842
2915
|
}
|
|
2843
|
-
|
|
2916
|
+
: function instanceOf(value, constructor) {
|
|
2917
|
+
if (value instanceof constructor) {
|
|
2918
|
+
return true;
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
if (typeof value === 'object' && value !== null) {
|
|
2922
|
+
var _value$constructor;
|
|
2923
|
+
|
|
2924
|
+
// Prefer Symbol.toStringTag since it is immune to minification.
|
|
2925
|
+
const className = constructor.prototype[Symbol.toStringTag];
|
|
2926
|
+
const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
2927
|
+
Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009
|
|
2928
|
+
? value[Symbol.toStringTag]
|
|
2929
|
+
: (_value$constructor = value.constructor) === null ||
|
|
2930
|
+
_value$constructor === void 0
|
|
2931
|
+
? void 0
|
|
2932
|
+
: _value$constructor.name;
|
|
2933
|
+
|
|
2934
|
+
if (className === valueClassName) {
|
|
2935
|
+
const stringifiedValue = (0, inspect_1.inspect)(value);
|
|
2936
|
+
throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm.
|
|
2937
|
+
|
|
2938
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
2939
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
2940
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
2941
|
+
|
|
2942
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
2943
|
+
|
|
2944
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
2945
|
+
versions may have different capabilities and behavior. The data from one
|
|
2946
|
+
version used in the function from another could produce confusing and
|
|
2947
|
+
spurious results.`);
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
return false;
|
|
2952
|
+
};
|
|
2844
2953
|
exports.instanceOf = instanceOf;
|
|
2845
2954
|
});
|
|
2846
2955
|
|
|
2956
|
+
const instanceOf = /*@__PURE__*/getDefaultExportFromCjs(instanceOf_1);
|
|
2957
|
+
|
|
2847
2958
|
var source = createCommonjsModule(function (module, exports) {
|
|
2959
|
+
'use strict';
|
|
2848
2960
|
|
|
2849
2961
|
Object.defineProperty(exports, '__esModule', {
|
|
2850
2962
|
value: true,
|
|
@@ -2911,7 +3023,10 @@ function isSource(source) {
|
|
|
2911
3023
|
}
|
|
2912
3024
|
});
|
|
2913
3025
|
|
|
3026
|
+
const source$1 = /*@__PURE__*/getDefaultExportFromCjs(source);
|
|
3027
|
+
|
|
2914
3028
|
var parser = createCommonjsModule(function (module, exports) {
|
|
3029
|
+
'use strict';
|
|
2915
3030
|
|
|
2916
3031
|
Object.defineProperty(exports, '__esModule', {
|
|
2917
3032
|
value: true,
|
|
@@ -3005,12 +3120,13 @@ function parseType(source, options) {
|
|
|
3005
3120
|
*/
|
|
3006
3121
|
|
|
3007
3122
|
class Parser {
|
|
3008
|
-
constructor(source$1, options) {
|
|
3123
|
+
constructor(source$1, options = {}) {
|
|
3009
3124
|
const sourceObj = (0, source.isSource)(source$1)
|
|
3010
3125
|
? source$1
|
|
3011
3126
|
: new source.Source(source$1);
|
|
3012
3127
|
this._lexer = new lexer.Lexer(sourceObj);
|
|
3013
3128
|
this._options = options;
|
|
3129
|
+
this._tokenCounter = 0;
|
|
3014
3130
|
}
|
|
3015
3131
|
/**
|
|
3016
3132
|
* Converts a name lex token into a name parse node.
|
|
@@ -3345,18 +3461,12 @@ class Parser {
|
|
|
3345
3461
|
*/
|
|
3346
3462
|
|
|
3347
3463
|
parseFragmentDefinition() {
|
|
3348
|
-
var _this$_options;
|
|
3349
|
-
|
|
3350
3464
|
const start = this._lexer.token;
|
|
3351
3465
|
this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes
|
|
3352
3466
|
// the grammar of FragmentDefinition:
|
|
3353
3467
|
// - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet
|
|
3354
3468
|
|
|
3355
|
-
if (
|
|
3356
|
-
((_this$_options = this._options) === null || _this$_options === void 0
|
|
3357
|
-
? void 0
|
|
3358
|
-
: _this$_options.allowLegacyFragmentVariables) === true
|
|
3359
|
-
) {
|
|
3469
|
+
if (this._options.allowLegacyFragmentVariables === true) {
|
|
3360
3470
|
return this.node(start, {
|
|
3361
3471
|
kind: kinds.Kind.FRAGMENT_DEFINITION,
|
|
3362
3472
|
name: this.parseFragmentName(),
|
|
@@ -3417,16 +3527,14 @@ class Parser {
|
|
|
3417
3527
|
return this.parseObject(isConst);
|
|
3418
3528
|
|
|
3419
3529
|
case tokenKind.TokenKind.INT:
|
|
3420
|
-
this.
|
|
3421
|
-
|
|
3530
|
+
this.advanceLexer();
|
|
3422
3531
|
return this.node(token, {
|
|
3423
3532
|
kind: kinds.Kind.INT,
|
|
3424
3533
|
value: token.value,
|
|
3425
3534
|
});
|
|
3426
3535
|
|
|
3427
3536
|
case tokenKind.TokenKind.FLOAT:
|
|
3428
|
-
this.
|
|
3429
|
-
|
|
3537
|
+
this.advanceLexer();
|
|
3430
3538
|
return this.node(token, {
|
|
3431
3539
|
kind: kinds.Kind.FLOAT,
|
|
3432
3540
|
value: token.value,
|
|
@@ -3437,7 +3545,7 @@ class Parser {
|
|
|
3437
3545
|
return this.parseStringLiteral();
|
|
3438
3546
|
|
|
3439
3547
|
case tokenKind.TokenKind.NAME:
|
|
3440
|
-
this.
|
|
3548
|
+
this.advanceLexer();
|
|
3441
3549
|
|
|
3442
3550
|
switch (token.value) {
|
|
3443
3551
|
case 'true':
|
|
@@ -3493,9 +3601,7 @@ class Parser {
|
|
|
3493
3601
|
|
|
3494
3602
|
parseStringLiteral() {
|
|
3495
3603
|
const token = this._lexer.token;
|
|
3496
|
-
|
|
3497
|
-
this._lexer.advance();
|
|
3498
|
-
|
|
3604
|
+
this.advanceLexer();
|
|
3499
3605
|
return this.node(token, {
|
|
3500
3606
|
kind: kinds.Kind.STRING,
|
|
3501
3607
|
value: token.value,
|
|
@@ -4286,13 +4392,7 @@ class Parser {
|
|
|
4286
4392
|
*/
|
|
4287
4393
|
|
|
4288
4394
|
node(startToken, node) {
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
if (
|
|
4292
|
-
((_this$_options2 = this._options) === null || _this$_options2 === void 0
|
|
4293
|
-
? void 0
|
|
4294
|
-
: _this$_options2.noLocation) !== true
|
|
4295
|
-
) {
|
|
4395
|
+
if (this._options.noLocation !== true) {
|
|
4296
4396
|
node.loc = new ast.Location(
|
|
4297
4397
|
startToken,
|
|
4298
4398
|
this._lexer.lastToken,
|
|
@@ -4318,8 +4418,7 @@ class Parser {
|
|
|
4318
4418
|
const token = this._lexer.token;
|
|
4319
4419
|
|
|
4320
4420
|
if (token.kind === kind) {
|
|
4321
|
-
this.
|
|
4322
|
-
|
|
4421
|
+
this.advanceLexer();
|
|
4323
4422
|
return token;
|
|
4324
4423
|
}
|
|
4325
4424
|
|
|
@@ -4338,8 +4437,7 @@ class Parser {
|
|
|
4338
4437
|
const token = this._lexer.token;
|
|
4339
4438
|
|
|
4340
4439
|
if (token.kind === kind) {
|
|
4341
|
-
this.
|
|
4342
|
-
|
|
4440
|
+
this.advanceLexer();
|
|
4343
4441
|
return true;
|
|
4344
4442
|
}
|
|
4345
4443
|
|
|
@@ -4354,7 +4452,7 @@ class Parser {
|
|
|
4354
4452
|
const token = this._lexer.token;
|
|
4355
4453
|
|
|
4356
4454
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4357
|
-
this.
|
|
4455
|
+
this.advanceLexer();
|
|
4358
4456
|
} else {
|
|
4359
4457
|
throw (0, syntaxError_1.syntaxError)(
|
|
4360
4458
|
this._lexer.source,
|
|
@@ -4372,8 +4470,7 @@ class Parser {
|
|
|
4372
4470
|
const token = this._lexer.token;
|
|
4373
4471
|
|
|
4374
4472
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4375
|
-
this.
|
|
4376
|
-
|
|
4473
|
+
this.advanceLexer();
|
|
4377
4474
|
return true;
|
|
4378
4475
|
}
|
|
4379
4476
|
|
|
@@ -4460,6 +4557,24 @@ class Parser {
|
|
|
4460
4557
|
|
|
4461
4558
|
return nodes;
|
|
4462
4559
|
}
|
|
4560
|
+
|
|
4561
|
+
advanceLexer() {
|
|
4562
|
+
const { maxTokens } = this._options;
|
|
4563
|
+
|
|
4564
|
+
const token = this._lexer.advance();
|
|
4565
|
+
|
|
4566
|
+
if (maxTokens !== undefined && token.kind !== tokenKind.TokenKind.EOF) {
|
|
4567
|
+
++this._tokenCounter;
|
|
4568
|
+
|
|
4569
|
+
if (this._tokenCounter > maxTokens) {
|
|
4570
|
+
throw (0, syntaxError_1.syntaxError)(
|
|
4571
|
+
this._lexer.source,
|
|
4572
|
+
token.start,
|
|
4573
|
+
`Document contains more that ${maxTokens} tokens. Parsing aborted.`,
|
|
4574
|
+
);
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
}
|
|
4463
4578
|
}
|
|
4464
4579
|
/**
|
|
4465
4580
|
* A helper function to describe a token as a string for debugging.
|
|
@@ -4480,7 +4595,10 @@ function getTokenKindDesc(kind) {
|
|
|
4480
4595
|
}
|
|
4481
4596
|
});
|
|
4482
4597
|
|
|
4598
|
+
const parser$1 = /*@__PURE__*/getDefaultExportFromCjs(parser);
|
|
4599
|
+
|
|
4483
4600
|
var printString_1 = createCommonjsModule(function (module, exports) {
|
|
4601
|
+
'use strict';
|
|
4484
4602
|
|
|
4485
4603
|
Object.defineProperty(exports, '__esModule', {
|
|
4486
4604
|
value: true,
|
|
@@ -4665,7 +4783,10 @@ const escapeSequences = [
|
|
|
4665
4783
|
];
|
|
4666
4784
|
});
|
|
4667
4785
|
|
|
4786
|
+
const printString = /*@__PURE__*/getDefaultExportFromCjs(printString_1);
|
|
4787
|
+
|
|
4668
4788
|
var visitor = createCommonjsModule(function (module, exports) {
|
|
4789
|
+
'use strict';
|
|
4669
4790
|
|
|
4670
4791
|
Object.defineProperty(exports, '__esModule', {
|
|
4671
4792
|
value: true,
|
|
@@ -5044,7 +5165,10 @@ function getVisitFn(visitor, kind, isLeaving) {
|
|
|
5044
5165
|
}
|
|
5045
5166
|
});
|
|
5046
5167
|
|
|
5168
|
+
const visitor$1 = /*@__PURE__*/getDefaultExportFromCjs(visitor);
|
|
5169
|
+
|
|
5047
5170
|
var printer = createCommonjsModule(function (module, exports) {
|
|
5171
|
+
'use strict';
|
|
5048
5172
|
|
|
5049
5173
|
Object.defineProperty(exports, '__esModule', {
|
|
5050
5174
|
value: true,
|
|
@@ -5397,6 +5521,10 @@ function hasMultilineItems(maybeArray) {
|
|
|
5397
5521
|
}
|
|
5398
5522
|
});
|
|
5399
5523
|
|
|
5524
|
+
const printer$1 = /*@__PURE__*/getDefaultExportFromCjs(printer);
|
|
5525
|
+
|
|
5526
|
+
'use strict';
|
|
5527
|
+
|
|
5400
5528
|
var ReactNativeFile$1 = function ReactNativeFile(_ref) {
|
|
5401
5529
|
var uri = _ref.uri,
|
|
5402
5530
|
name = _ref.name,
|
|
@@ -5406,6 +5534,10 @@ var ReactNativeFile$1 = function ReactNativeFile(_ref) {
|
|
|
5406
5534
|
this.type = type;
|
|
5407
5535
|
};
|
|
5408
5536
|
|
|
5537
|
+
'use strict';
|
|
5538
|
+
|
|
5539
|
+
|
|
5540
|
+
|
|
5409
5541
|
var isExtractableFile$1 = function isExtractableFile(value) {
|
|
5410
5542
|
return (
|
|
5411
5543
|
(typeof File !== 'undefined' && value instanceof File) ||
|
|
@@ -5414,6 +5546,10 @@ var isExtractableFile$1 = function isExtractableFile(value) {
|
|
|
5414
5546
|
);
|
|
5415
5547
|
};
|
|
5416
5548
|
|
|
5549
|
+
'use strict';
|
|
5550
|
+
|
|
5551
|
+
|
|
5552
|
+
|
|
5417
5553
|
var extractFiles$1 = function extractFiles(value, path, isExtractableFile) {
|
|
5418
5554
|
if (path === void 0) {
|
|
5419
5555
|
path = '';
|
|
@@ -5465,6 +5601,8 @@ var extractFiles$1 = function extractFiles(value, path, isExtractableFile) {
|
|
|
5465
5601
|
};
|
|
5466
5602
|
};
|
|
5467
5603
|
|
|
5604
|
+
'use strict';
|
|
5605
|
+
|
|
5468
5606
|
var ReactNativeFile = ReactNativeFile$1;
|
|
5469
5607
|
var extractFiles = extractFiles$1;
|
|
5470
5608
|
var isExtractableFile = isExtractableFile$1;
|
|
@@ -5479,6 +5617,7 @@ var _public = {
|
|
|
5479
5617
|
var browser = typeof self == 'object' ? self.FormData : window.FormData;
|
|
5480
5618
|
|
|
5481
5619
|
var defaultJsonSerializer = createCommonjsModule(function (module, exports) {
|
|
5620
|
+
"use strict";
|
|
5482
5621
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5483
5622
|
exports.defaultJsonSerializer = void 0;
|
|
5484
5623
|
exports.defaultJsonSerializer = {
|
|
@@ -5488,7 +5627,10 @@ exports.defaultJsonSerializer = {
|
|
|
5488
5627
|
//# sourceMappingURL=defaultJsonSerializer.js.map
|
|
5489
5628
|
});
|
|
5490
5629
|
|
|
5630
|
+
const defaultJsonSerializer$1 = /*@__PURE__*/getDefaultExportFromCjs(defaultJsonSerializer);
|
|
5631
|
+
|
|
5491
5632
|
var createRequestBody_1 = createCommonjsModule(function (module, exports) {
|
|
5633
|
+
"use strict";
|
|
5492
5634
|
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5493
5635
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5494
5636
|
};
|
|
@@ -5545,7 +5687,10 @@ exports.default = createRequestBody;
|
|
|
5545
5687
|
//# sourceMappingURL=createRequestBody.js.map
|
|
5546
5688
|
});
|
|
5547
5689
|
|
|
5690
|
+
const createRequestBody = /*@__PURE__*/getDefaultExportFromCjs(createRequestBody_1);
|
|
5691
|
+
|
|
5548
5692
|
var parseArgs = createCommonjsModule(function (module, exports) {
|
|
5693
|
+
"use strict";
|
|
5549
5694
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5550
5695
|
exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
|
|
5551
5696
|
function parseRequestArgs(documentOrOptions, variables, requestHeaders) {
|
|
@@ -5618,7 +5763,10 @@ exports.parseBatchRequestsExtendedArgs = parseBatchRequestsExtendedArgs;
|
|
|
5618
5763
|
//# sourceMappingURL=parseArgs.js.map
|
|
5619
5764
|
});
|
|
5620
5765
|
|
|
5766
|
+
const parseArgs$1 = /*@__PURE__*/getDefaultExportFromCjs(parseArgs);
|
|
5767
|
+
|
|
5621
5768
|
var types = createCommonjsModule(function (module, exports) {
|
|
5769
|
+
"use strict";
|
|
5622
5770
|
var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
|
|
5623
5771
|
var extendStatics = function (d, b) {
|
|
5624
5772
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -5668,7 +5816,10 @@ exports.ClientError = ClientError;
|
|
|
5668
5816
|
//# sourceMappingURL=types.js.map
|
|
5669
5817
|
});
|
|
5670
5818
|
|
|
5819
|
+
const types$1 = /*@__PURE__*/getDefaultExportFromCjs(types);
|
|
5820
|
+
|
|
5671
5821
|
var graphqlWs = createCommonjsModule(function (module, exports) {
|
|
5822
|
+
"use strict";
|
|
5672
5823
|
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
5673
5824
|
__assign = Object.assign || function(t) {
|
|
5674
5825
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -5848,6 +5999,8 @@ var GraphQLWebSocketClient = /** @class */ (function () {
|
|
|
5848
5999
|
if (message.payload.errors) {
|
|
5849
6000
|
subscriber.error && subscriber.error(new types.ClientError(__assign(__assign({}, message.payload), { status: 200 }), { query: query, variables: variables }));
|
|
5850
6001
|
}
|
|
6002
|
+
else {
|
|
6003
|
+
}
|
|
5851
6004
|
return;
|
|
5852
6005
|
}
|
|
5853
6006
|
case ERROR: {
|
|
@@ -5942,7 +6095,10 @@ function Complete(id) {
|
|
|
5942
6095
|
//# sourceMappingURL=graphql-ws.js.map
|
|
5943
6096
|
});
|
|
5944
6097
|
|
|
6098
|
+
const graphqlWs$1 = /*@__PURE__*/getDefaultExportFromCjs(graphqlWs);
|
|
6099
|
+
|
|
5945
6100
|
var dist = createCommonjsModule(function (module, exports) {
|
|
6101
|
+
"use strict";
|
|
5946
6102
|
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
5947
6103
|
__assign = Object.assign || function(t) {
|
|
5948
6104
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -6267,7 +6423,7 @@ exports.GraphQLClient = GraphQLClient;
|
|
|
6267
6423
|
function makeRequest(_a) {
|
|
6268
6424
|
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;
|
|
6269
6425
|
return __awaiter(this, void 0, void 0, function () {
|
|
6270
|
-
var fetcher, isBathchingQuery, response, result, successfullyReceivedData, successfullyPassedErrorPolicy, headers_1, status_1, rest, data, errorResult;
|
|
6426
|
+
var fetcher, isBathchingQuery, response, result, successfullyReceivedData, successfullyPassedErrorPolicy, headers_1, status_1, errors, rest, data, errorResult;
|
|
6271
6427
|
return __generator(this, function (_c) {
|
|
6272
6428
|
switch (_c.label) {
|
|
6273
6429
|
case 0:
|
|
@@ -6294,7 +6450,7 @@ function makeRequest(_a) {
|
|
|
6294
6450
|
successfullyPassedErrorPolicy = !result.errors || fetchOptions.errorPolicy === 'all' || fetchOptions.errorPolicy === 'ignore';
|
|
6295
6451
|
if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {
|
|
6296
6452
|
headers_1 = response.headers, status_1 = response.status;
|
|
6297
|
-
rest = __rest(result, ["errors"]);
|
|
6453
|
+
errors = result.errors, rest = __rest(result, ["errors"]);
|
|
6298
6454
|
data = fetchOptions.errorPolicy === 'ignore' ? rest : result;
|
|
6299
6455
|
return [2 /*return*/, __assign(__assign({}, (isBathchingQuery ? { data: data } : data)), { headers: headers_1, status: status_1 })];
|
|
6300
6456
|
}
|
|
@@ -6302,6 +6458,7 @@ function makeRequest(_a) {
|
|
|
6302
6458
|
errorResult = typeof result === 'string' ? { error: result } : result;
|
|
6303
6459
|
throw new types.ClientError(__assign(__assign({}, errorResult), { status: response.status, headers: response.headers }), { query: query, variables: variables });
|
|
6304
6460
|
}
|
|
6461
|
+
return [2 /*return*/];
|
|
6305
6462
|
}
|
|
6306
6463
|
});
|
|
6307
6464
|
});
|
|
@@ -6431,6 +6588,8 @@ Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get
|
|
|
6431
6588
|
//# sourceMappingURL=index.js.map
|
|
6432
6589
|
});
|
|
6433
6590
|
|
|
6591
|
+
const index = /*@__PURE__*/getDefaultExportFromCjs(dist);
|
|
6592
|
+
|
|
6434
6593
|
class UrlUtils {
|
|
6435
6594
|
static getQueryParams(queryString) {
|
|
6436
6595
|
const params = new Map();
|
|
@@ -6488,6 +6647,27 @@ class DataFetcher {
|
|
|
6488
6647
|
DataFetcher.requestListener.splice(index, 1);
|
|
6489
6648
|
}
|
|
6490
6649
|
}
|
|
6650
|
+
processErrorInfo(errors) {
|
|
6651
|
+
var _a, _b;
|
|
6652
|
+
const POSITION_ERROR_INFO = 0;
|
|
6653
|
+
const errorTitle = "Falha detectada";
|
|
6654
|
+
const error = errors[POSITION_ERROR_INFO];
|
|
6655
|
+
if (error.length > 0) { //As informações do erro vem no primeiro indice de um array
|
|
6656
|
+
const errorInfo = error[POSITION_ERROR_INFO];
|
|
6657
|
+
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";
|
|
6658
|
+
const errorLevel = ((_a = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _a === void 0 ? void 0 : _a.level) ? errorInfo.extensions.level : "ERROR";
|
|
6659
|
+
const errorCode = ((_b = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _b === void 0 ? void 0 : _b.code) ? errorInfo.extensions.code : "";
|
|
6660
|
+
switch (errorLevel) {
|
|
6661
|
+
case "WARNING":
|
|
6662
|
+
return new WarningException(errorTitle, errorMessage, errorCode);
|
|
6663
|
+
default:
|
|
6664
|
+
return new ErrorException(errorTitle, errorMessage, errorCode);
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
6667
|
+
else {
|
|
6668
|
+
return new ErrorException(errorTitle, "Não há informações sobre o erro");
|
|
6669
|
+
}
|
|
6670
|
+
}
|
|
6491
6671
|
async callGraphQL(req) {
|
|
6492
6672
|
var _a;
|
|
6493
6673
|
const reqKey = this.getReqKey(req);
|
|
@@ -6498,7 +6678,8 @@ class DataFetcher {
|
|
|
6498
6678
|
let query = this.getQueryTemplate(req);
|
|
6499
6679
|
const res = await this.fecthGrapql([{ document: query, variables: req.values }]);
|
|
6500
6680
|
if (res.errors.length > 0) {
|
|
6501
|
-
|
|
6681
|
+
const error = this.processErrorInfo(res.errors);
|
|
6682
|
+
reject(error);
|
|
6502
6683
|
}
|
|
6503
6684
|
else {
|
|
6504
6685
|
resolve(res.data[0][reqKey]);
|
|
@@ -6515,23 +6696,26 @@ class DataFetcher {
|
|
|
6515
6696
|
resolveURL() {
|
|
6516
6697
|
return UrlUtils.getUrlBase();
|
|
6517
6698
|
}
|
|
6518
|
-
getContext() {
|
|
6699
|
+
getContext(module) {
|
|
6519
6700
|
const urlParams = UrlUtils.getQueryParams(location.search);
|
|
6520
6701
|
return {
|
|
6521
|
-
baseUrl: `${this.resolveURL()}/
|
|
6702
|
+
baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
|
|
6522
6703
|
appName: "SankhyaBlocks",
|
|
6523
6704
|
mgeSession: `${window['skw_session'] || urlParams.mgeSession}`,
|
|
6524
6705
|
globalID: "85C0093DFA240EAB699B4E47A10215BD",
|
|
6706
|
+
//FIXME: Precisamos ajustar para buscar o resourceId pela aplicação
|
|
6525
6707
|
resourceID: "br.com.sankhya.mov.bancaria"
|
|
6526
6708
|
};
|
|
6527
6709
|
}
|
|
6528
6710
|
async callServiceBroker(serviceName, payload) {
|
|
6529
6711
|
return new Promise((accept, reject) => {
|
|
6530
|
-
const
|
|
6531
|
-
const
|
|
6712
|
+
const parts = serviceName.split("@");
|
|
6713
|
+
const [module, name] = parts.length === 2 ? parts : ['mge', serviceName];
|
|
6714
|
+
const ctx = this.getContext(module);
|
|
6715
|
+
const url = `${ctx.baseUrl}?serviceName=${name}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
|
|
6532
6716
|
document.cookie = `JSESSIONID=${ctx.mgeSession};`;
|
|
6533
6717
|
const http = new XMLHttpRequest();
|
|
6534
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6718
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: payload }));
|
|
6535
6719
|
http.open("POST", url, true);
|
|
6536
6720
|
http.withCredentials = true;
|
|
6537
6721
|
http.send(payload);
|
|
@@ -6550,11 +6734,11 @@ class DataFetcher {
|
|
|
6550
6734
|
console.warn(`callServiceBroker error to parser response to JSON ${e}`);
|
|
6551
6735
|
reject(this.responseText);
|
|
6552
6736
|
}
|
|
6553
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6737
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6554
6738
|
}
|
|
6555
6739
|
else if (this.readyState == 4 && this.status != 200) {
|
|
6556
6740
|
reject(this.responseText);
|
|
6557
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6741
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: payload }));
|
|
6558
6742
|
}
|
|
6559
6743
|
};
|
|
6560
6744
|
});
|
|
@@ -6610,7 +6794,7 @@ class DataFetcher {
|
|
|
6610
6794
|
if (window['skw_session']) {
|
|
6611
6795
|
url += `?mgeSession=${window['skw_session']}`;
|
|
6612
6796
|
}
|
|
6613
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url }));
|
|
6797
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url: url, requestBody: request }));
|
|
6614
6798
|
try {
|
|
6615
6799
|
res = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=${window['SERVER_ENCODING'] || 'UTF-8'}` });
|
|
6616
6800
|
res.forEach((resItem, index) => {
|
|
@@ -6641,11 +6825,11 @@ class DataFetcher {
|
|
|
6641
6825
|
});
|
|
6642
6826
|
}
|
|
6643
6827
|
else {
|
|
6644
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6828
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6645
6829
|
throw new ErrorException("Falha de comunicação", err.message);
|
|
6646
6830
|
}
|
|
6647
6831
|
}
|
|
6648
|
-
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6832
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url: url, requestBody: request }));
|
|
6649
6833
|
return { data: dataResponse, errors: errorsResponse };
|
|
6650
6834
|
}
|
|
6651
6835
|
isHttpError(err) {
|
|
@@ -6692,6 +6876,7 @@ class WaitingRequest {
|
|
|
6692
6876
|
class DataUnitFetcher {
|
|
6693
6877
|
constructor() {
|
|
6694
6878
|
this.templateByQuery = new Map();
|
|
6879
|
+
this._loadDataTimeout = {};
|
|
6695
6880
|
this.buldTemplates();
|
|
6696
6881
|
}
|
|
6697
6882
|
buldTemplates() {
|
|
@@ -6720,9 +6905,9 @@ class DataUnitFetcher {
|
|
|
6720
6905
|
}
|
|
6721
6906
|
}
|
|
6722
6907
|
}`);
|
|
6723
|
-
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $
|
|
6908
|
+
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
|
|
6724
6909
|
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
6725
|
-
data(limit: $limit offset: $offset filters: $
|
|
6910
|
+
data(limit: $limit offset: $offset filters: $filters sort: $sort){
|
|
6726
6911
|
limit
|
|
6727
6912
|
offset
|
|
6728
6913
|
total
|
|
@@ -6751,7 +6936,7 @@ class DataUnitFetcher {
|
|
|
6751
6936
|
getDataUnit(entityName, resourceID) {
|
|
6752
6937
|
const dataUnit = new DataUnit(`dd://${entityName}/${resourceID}`);
|
|
6753
6938
|
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
6754
|
-
dataUnit.dataLoader = (dataUnit,
|
|
6939
|
+
dataUnit.dataLoader = (dataUnit, request) => this.loadData(dataUnit, request);
|
|
6755
6940
|
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
6756
6941
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
6757
6942
|
return dataUnit;
|
|
@@ -6788,25 +6973,39 @@ class DataUnitFetcher {
|
|
|
6788
6973
|
});
|
|
6789
6974
|
});
|
|
6790
6975
|
}
|
|
6791
|
-
loadData(dataUnit,
|
|
6976
|
+
loadData(dataUnit, request) {
|
|
6977
|
+
const duName = dataUnit.name;
|
|
6978
|
+
if (this._loadDataTimeout[duName]) {
|
|
6979
|
+
clearTimeout(this._loadDataTimeout[duName]);
|
|
6980
|
+
delete this._loadDataTimeout[duName];
|
|
6981
|
+
}
|
|
6792
6982
|
return new Promise((resolve, reject) => {
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
}
|
|
6799
|
-
|
|
6983
|
+
this._loadDataTimeout[duName] = setTimeout(() => {
|
|
6984
|
+
delete this._loadDataTimeout[duName];
|
|
6985
|
+
this.doLoadData(dataUnit, request)
|
|
6986
|
+
.then(result => resolve(result))
|
|
6987
|
+
.catch(reason => reject(reason));
|
|
6988
|
+
}, 200);
|
|
6989
|
+
});
|
|
6990
|
+
}
|
|
6991
|
+
doLoadData(dataUnit, request) {
|
|
6992
|
+
return new Promise((resolve, reject) => {
|
|
6993
|
+
var _a;
|
|
6994
|
+
const { sort, filters, limit, offset, quickFilter } = request;
|
|
6995
|
+
const variables = { dataunit: dataUnit.name, sort, filters };
|
|
6996
|
+
variables.limit = limit;
|
|
6997
|
+
variables.offset = offset;
|
|
6998
|
+
if (!StringUtils.isEmpty(quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.term)) {
|
|
6800
6999
|
if (variables.filter === undefined) {
|
|
6801
7000
|
variables.filter = [];
|
|
6802
7001
|
}
|
|
6803
7002
|
const quickFilterCriteria = {
|
|
6804
7003
|
name: "__QUICK_FILTER__",
|
|
6805
7004
|
expression: "__QUICK_FILTER__",
|
|
6806
|
-
params: [{ name: "term", dataType: DataType.TEXT, value:
|
|
7005
|
+
params: [{ name: "term", dataType: DataType.TEXT, value: quickFilter.term }]
|
|
6807
7006
|
};
|
|
6808
|
-
if (((
|
|
6809
|
-
quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value:
|
|
7007
|
+
if (((_a = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.fields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
7008
|
+
quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value: quickFilter.fields });
|
|
6810
7009
|
}
|
|
6811
7010
|
variables.filter.push(quickFilterCriteria);
|
|
6812
7011
|
}
|
|
@@ -6816,16 +7015,32 @@ class DataUnitFetcher {
|
|
|
6816
7015
|
query: this.templateByQuery.get("fetchData"),
|
|
6817
7016
|
})
|
|
6818
7017
|
.then((resp) => {
|
|
6819
|
-
const
|
|
6820
|
-
|
|
6821
|
-
|
|
7018
|
+
const { limit, offset, total, hasMore, records } = resp.data;
|
|
7019
|
+
let paginationInfo;
|
|
7020
|
+
if (limit) {
|
|
7021
|
+
const firstRecord = total == 0 ? 0 : offset + 1;
|
|
7022
|
+
const lastRecord = offset + Math.min(records.length, limit);
|
|
7023
|
+
const currentPage = offset / limit;
|
|
7024
|
+
paginationInfo = {
|
|
7025
|
+
firstRecord,
|
|
7026
|
+
lastRecord,
|
|
7027
|
+
total,
|
|
7028
|
+
currentPage,
|
|
7029
|
+
hasMore
|
|
7030
|
+
};
|
|
7031
|
+
}
|
|
7032
|
+
const processedRecords = [];
|
|
7033
|
+
records.forEach((responseRecord) => {
|
|
6822
7034
|
const duRecord = { __record__id__: responseRecord.id };
|
|
6823
7035
|
responseRecord.fields.forEach(({ name, value }) => {
|
|
6824
7036
|
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
6825
7037
|
});
|
|
6826
|
-
|
|
7038
|
+
processedRecords.push(duRecord);
|
|
7039
|
+
});
|
|
7040
|
+
resolve({
|
|
7041
|
+
paginationInfo,
|
|
7042
|
+
records: processedRecords
|
|
6827
7043
|
});
|
|
6828
|
-
resolve(Object.assign(Object.assign({}, pageResult), { records }));
|
|
6829
7044
|
})
|
|
6830
7045
|
.catch((error) => {
|
|
6831
7046
|
reject(error);
|
|
@@ -7051,15 +7266,16 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7051
7266
|
super(...arguments);
|
|
7052
7267
|
this.GRID_CONFIG_VERSION = "V3:";
|
|
7053
7268
|
}
|
|
7054
|
-
getConfig(resourceID) {
|
|
7269
|
+
getConfig(_gridName, resourceID) {
|
|
7055
7270
|
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
7056
7271
|
return new Promise((resolve, reject) => {
|
|
7057
7272
|
this.loadResource(completePath)
|
|
7058
7273
|
.then(loadedResource => {
|
|
7274
|
+
let config = undefined;
|
|
7059
7275
|
if (loadedResource) {
|
|
7060
|
-
|
|
7061
|
-
resolve(config);
|
|
7276
|
+
config = JSON.parse(loadedResource);
|
|
7062
7277
|
}
|
|
7278
|
+
resolve(config);
|
|
7063
7279
|
}).catch((error) => {
|
|
7064
7280
|
reject(error);
|
|
7065
7281
|
});
|
|
@@ -7218,7 +7434,14 @@ class SnkErrorHandler {
|
|
|
7218
7434
|
errorHandler(evt) {
|
|
7219
7435
|
this.processException(evt.error);
|
|
7220
7436
|
}
|
|
7437
|
+
buildErrorCodeHTML(exception) {
|
|
7438
|
+
const onclick = 'try{window.workspace.openHelp(\'_tbcode:' + exception.errorCode + '\')} catch(e){alert(\'Não é possível abrir a ajuda fora do workspace Sankhya\');}';
|
|
7439
|
+
return '<br><a href="#" onclick="' + onclick + '">Código: ' + exception.errorCode + '</a>';
|
|
7440
|
+
}
|
|
7221
7441
|
processException(exception) {
|
|
7442
|
+
if (exception.errorCode != "") {
|
|
7443
|
+
exception.message += this.buildErrorCodeHTML(exception);
|
|
7444
|
+
}
|
|
7222
7445
|
if (exception instanceof WaitingChangeException) {
|
|
7223
7446
|
this._app.alert(exception.title, exception.message);
|
|
7224
7447
|
}
|
|
@@ -7236,7 +7459,7 @@ class SnkErrorHandler {
|
|
|
7236
7459
|
}
|
|
7237
7460
|
else {
|
|
7238
7461
|
const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
|
|
7239
|
-
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${exception}"`;
|
|
7462
|
+
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${ObjectUtils.objectToString(exception)}"`;
|
|
7240
7463
|
this._app.error(title, message);
|
|
7241
7464
|
}
|
|
7242
7465
|
}
|
|
@@ -7247,6 +7470,114 @@ class SnkErrorHandler {
|
|
|
7247
7470
|
|
|
7248
7471
|
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);
|
|
7249
7472
|
|
|
7473
|
+
class TotalsFetcher {
|
|
7474
|
+
constructor() {
|
|
7475
|
+
this.templateByQuery = new Map();
|
|
7476
|
+
this.buldTemplates();
|
|
7477
|
+
}
|
|
7478
|
+
buldTemplates() {
|
|
7479
|
+
this.templateByQuery.set("fetchTotals", dist.gql `query($filters: [InputFilter!] $name: String!) {
|
|
7480
|
+
$queryAlias$: fetchTotals(name: $name, filters: $filters ){
|
|
7481
|
+
name
|
|
7482
|
+
value
|
|
7483
|
+
}
|
|
7484
|
+
}`);
|
|
7485
|
+
}
|
|
7486
|
+
async getTotals(name, resourceID, filters) {
|
|
7487
|
+
const path = `totals://${name}/${resourceID}`;
|
|
7488
|
+
let variables = {
|
|
7489
|
+
name: path,
|
|
7490
|
+
filters: filters
|
|
7491
|
+
};
|
|
7492
|
+
return DataFetcher.get().callGraphQL({
|
|
7493
|
+
values: variables,
|
|
7494
|
+
query: this.templateByQuery.get("fetchTotals"),
|
|
7495
|
+
});
|
|
7496
|
+
}
|
|
7497
|
+
fetchTotals(name, resourceID, filters = []) {
|
|
7498
|
+
return new Promise((accept, reject) => {
|
|
7499
|
+
this.getTotals(name, resourceID, filters)
|
|
7500
|
+
.then((result) => {
|
|
7501
|
+
if (result.length > 0) {
|
|
7502
|
+
const totalsData = new Map();
|
|
7503
|
+
result.forEach(total => {
|
|
7504
|
+
totalsData.set(total.name, parseFloat(total.value));
|
|
7505
|
+
});
|
|
7506
|
+
accept(totalsData);
|
|
7507
|
+
}
|
|
7508
|
+
else {
|
|
7509
|
+
reject(`Não foi possível recuperar os totalizadores`);
|
|
7510
|
+
}
|
|
7511
|
+
})
|
|
7512
|
+
.catch((error) => {
|
|
7513
|
+
reject(error);
|
|
7514
|
+
});
|
|
7515
|
+
});
|
|
7516
|
+
}
|
|
7517
|
+
}
|
|
7518
|
+
|
|
7519
|
+
function normalizeValue(value) {
|
|
7520
|
+
if (value == undefined) {
|
|
7521
|
+
return value;
|
|
7522
|
+
}
|
|
7523
|
+
if (value instanceof Date) {
|
|
7524
|
+
return value.toISOString();
|
|
7525
|
+
}
|
|
7526
|
+
if (typeof value === "object") {
|
|
7527
|
+
if (value instanceof Array) {
|
|
7528
|
+
return value.map(item => normalizeValue(item));
|
|
7529
|
+
}
|
|
7530
|
+
else {
|
|
7531
|
+
const normalized = Object.assign({}, value);
|
|
7532
|
+
Object.keys(value).forEach(prop => {
|
|
7533
|
+
if (value[prop]) {
|
|
7534
|
+
normalized[prop] = normalizeValue(value[prop]);
|
|
7535
|
+
}
|
|
7536
|
+
else {
|
|
7537
|
+
delete normalized[prop];
|
|
7538
|
+
}
|
|
7539
|
+
});
|
|
7540
|
+
return normalized;
|
|
7541
|
+
}
|
|
7542
|
+
}
|
|
7543
|
+
return value;
|
|
7544
|
+
}
|
|
7545
|
+
class FilterBarConfigFetcher extends ResourceFetcher {
|
|
7546
|
+
saveConfig(items, resourceID, configName) {
|
|
7547
|
+
const state = items.map(item => {
|
|
7548
|
+
const { id, value, fixed, visible } = item;
|
|
7549
|
+
const stateItem = { id };
|
|
7550
|
+
if (value) {
|
|
7551
|
+
stateItem["value"] = normalizeValue(value);
|
|
7552
|
+
}
|
|
7553
|
+
if (fixed) {
|
|
7554
|
+
stateItem["fixed"] = fixed;
|
|
7555
|
+
}
|
|
7556
|
+
if (visible) {
|
|
7557
|
+
stateItem["visible"] = true;
|
|
7558
|
+
}
|
|
7559
|
+
return stateItem;
|
|
7560
|
+
});
|
|
7561
|
+
return this.saveResource(state, `cfg://filter/FilterBarState:${resourceID}/${configName}`);
|
|
7562
|
+
}
|
|
7563
|
+
getConfig(resourceID, configName) {
|
|
7564
|
+
return new Promise((accept, reject) => {
|
|
7565
|
+
this.loadResource(`cfg://filter/FilterBarState:${resourceID}/${configName}`)
|
|
7566
|
+
.then((configAsString) => {
|
|
7567
|
+
let fieldsList;
|
|
7568
|
+
if (configAsString) {
|
|
7569
|
+
const filterBarConfig = JSON.parse(configAsString);
|
|
7570
|
+
fieldsList = filterBarConfig.items;
|
|
7571
|
+
}
|
|
7572
|
+
accept(fieldsList || []);
|
|
7573
|
+
})
|
|
7574
|
+
.catch((error) => {
|
|
7575
|
+
reject(error);
|
|
7576
|
+
});
|
|
7577
|
+
});
|
|
7578
|
+
}
|
|
7579
|
+
}
|
|
7580
|
+
|
|
7250
7581
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
7251
7582
|
|
|
7252
7583
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -7255,6 +7586,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7255
7586
|
this.__registerHost();
|
|
7256
7587
|
this.applicationLoaded = createEvent(this, "applicationLoaded", 7);
|
|
7257
7588
|
this.applicationLoading = createEvent(this, "applicationLoading", 7);
|
|
7589
|
+
this._authPromises = [];
|
|
7590
|
+
this._duCache = new Map();
|
|
7591
|
+
this._duPromises = new Map();
|
|
7258
7592
|
this._requestListener = new RequestListenerLoadingBar();
|
|
7259
7593
|
}
|
|
7260
7594
|
get parameters() {
|
|
@@ -7273,18 +7607,31 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7273
7607
|
return this._resourceID;
|
|
7274
7608
|
}
|
|
7275
7609
|
get auth() {
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
this.
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7610
|
+
if (this._auth) {
|
|
7611
|
+
return Promise.resolve(this._auth);
|
|
7612
|
+
}
|
|
7613
|
+
else {
|
|
7614
|
+
return new Promise((resolve, reject) => {
|
|
7615
|
+
const waitingAuth = this._authPromises.length > 0;
|
|
7616
|
+
this._authPromises.push(new PendingPromise(resolve, reject));
|
|
7617
|
+
if (!waitingAuth) {
|
|
7618
|
+
this.authFetcher.getData(this.resourceID).then((authList) => {
|
|
7619
|
+
this._auth = authList;
|
|
7620
|
+
while (this._authPromises.length > 0) {
|
|
7621
|
+
this._authPromises.pop().resolve(this._auth);
|
|
7622
|
+
}
|
|
7623
|
+
}).catch(error => {
|
|
7624
|
+
while (this._authPromises.length > 0) {
|
|
7625
|
+
this._authPromises.pop().reject(error);
|
|
7626
|
+
}
|
|
7627
|
+
});
|
|
7628
|
+
}
|
|
7629
|
+
});
|
|
7630
|
+
}
|
|
7287
7631
|
}
|
|
7632
|
+
/**
|
|
7633
|
+
* Caso o usuário logado seja o SUP.
|
|
7634
|
+
*/
|
|
7288
7635
|
async isUserSup() {
|
|
7289
7636
|
return new Promise((resolve, reject) => {
|
|
7290
7637
|
this.auth.then((authorization) => {
|
|
@@ -7294,6 +7641,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7294
7641
|
});
|
|
7295
7642
|
});
|
|
7296
7643
|
}
|
|
7644
|
+
/**
|
|
7645
|
+
* Se o usuário logado tem permissão pra determinada ação.
|
|
7646
|
+
*/
|
|
7297
7647
|
async hasAccess(access) {
|
|
7298
7648
|
return new Promise((resolve, reject) => {
|
|
7299
7649
|
this.auth.then((authorization) => {
|
|
@@ -7303,6 +7653,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7303
7653
|
});
|
|
7304
7654
|
});
|
|
7305
7655
|
}
|
|
7656
|
+
/**
|
|
7657
|
+
* Retorna todos os acessos do usuário logado.
|
|
7658
|
+
*/
|
|
7306
7659
|
async getAllAccess() {
|
|
7307
7660
|
return new Promise((resolve, reject) => {
|
|
7308
7661
|
this.auth.then((authorization) => {
|
|
@@ -7317,33 +7670,63 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7317
7670
|
});
|
|
7318
7671
|
});
|
|
7319
7672
|
}
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7673
|
+
/**
|
|
7674
|
+
* Retorna o valor de um parâmetro do tipo string.
|
|
7675
|
+
*/
|
|
7323
7676
|
async getStringParam(name) {
|
|
7324
7677
|
return this.parameters.asString(name, this.resourceID);
|
|
7325
7678
|
}
|
|
7679
|
+
/**
|
|
7680
|
+
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
7681
|
+
*/
|
|
7326
7682
|
async getIntParam(name) {
|
|
7327
7683
|
return this.parameters.asInteger(name, this.resourceID);
|
|
7328
7684
|
}
|
|
7685
|
+
/**
|
|
7686
|
+
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
7687
|
+
*/
|
|
7329
7688
|
async getFloatParam(name) {
|
|
7330
7689
|
return this.parameters.asFloat(name, this.resourceID);
|
|
7331
7690
|
}
|
|
7691
|
+
/**
|
|
7692
|
+
* Retorna o valor de um parâmetro do tipo booleano.
|
|
7693
|
+
*/
|
|
7332
7694
|
async getBooleanParam(name) {
|
|
7333
7695
|
return this.parameters.asBoolean(name, this.resourceID);
|
|
7334
7696
|
}
|
|
7697
|
+
/**
|
|
7698
|
+
* Retorna o valor de um parâmetro do tipo data.
|
|
7699
|
+
*/
|
|
7335
7700
|
async getDateParam(name) {
|
|
7336
7701
|
return this.parameters.asDate(name, this.resourceID);
|
|
7337
7702
|
}
|
|
7703
|
+
/**
|
|
7704
|
+
* Mostra o conteúdo passado em um Popup
|
|
7705
|
+
*/
|
|
7338
7706
|
async showPopUp(content) {
|
|
7339
|
-
this.
|
|
7707
|
+
this.clearContent(this._popUp);
|
|
7340
7708
|
this._popUp.appendChild(content);
|
|
7341
7709
|
this._popUp.opened = true;
|
|
7342
7710
|
}
|
|
7711
|
+
async showModal(content) {
|
|
7712
|
+
this.clearContent(this._rightModal);
|
|
7713
|
+
this._rightModal.appendChild(content);
|
|
7714
|
+
this._rightModal.opened = true;
|
|
7715
|
+
}
|
|
7716
|
+
async closeModal() {
|
|
7717
|
+
this.clearContent(this._rightModal);
|
|
7718
|
+
this._rightModal.opened = false;
|
|
7719
|
+
}
|
|
7720
|
+
/**
|
|
7721
|
+
* Fecha o popup, liberando o conteúdo.
|
|
7722
|
+
*/
|
|
7343
7723
|
async closePopUp() {
|
|
7344
|
-
this.
|
|
7724
|
+
this.clearContent(this._popUp);
|
|
7345
7725
|
this._popUp.opened = false;
|
|
7346
7726
|
}
|
|
7727
|
+
/**
|
|
7728
|
+
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
7729
|
+
*/
|
|
7347
7730
|
async temOpcional(opcional) {
|
|
7348
7731
|
const opts = opcional.split(",");
|
|
7349
7732
|
return new Promise((resolve, reject) => {
|
|
@@ -7367,6 +7750,10 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7367
7750
|
});
|
|
7368
7751
|
});
|
|
7369
7752
|
}
|
|
7753
|
+
/**
|
|
7754
|
+
* Retorna a configuração de um recurso por service broker
|
|
7755
|
+
* Veja também o método "loadConfig"
|
|
7756
|
+
*/
|
|
7370
7757
|
async getConfig(key) {
|
|
7371
7758
|
let payload = {
|
|
7372
7759
|
"serviceName": "SystemUtilsSP.getConf",
|
|
@@ -7384,6 +7771,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7384
7771
|
.catch(error => reject(error));
|
|
7385
7772
|
});
|
|
7386
7773
|
}
|
|
7774
|
+
/**
|
|
7775
|
+
* Salva a configuração de determinado recurso.
|
|
7776
|
+
*/
|
|
7387
7777
|
async saveConfig(key, data) {
|
|
7388
7778
|
let payload = {
|
|
7389
7779
|
"serviceName": "SystemUtilsSP.saveConf",
|
|
@@ -7402,42 +7792,166 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7402
7792
|
.catch(error => reject(error));
|
|
7403
7793
|
});
|
|
7404
7794
|
}
|
|
7795
|
+
/**
|
|
7796
|
+
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
7797
|
+
*/
|
|
7405
7798
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
7406
7799
|
return Promise.resolve(window[attribName]);
|
|
7407
7800
|
}
|
|
7801
|
+
/**
|
|
7802
|
+
* Abre determinada tela, repassando pkObject
|
|
7803
|
+
*/
|
|
7408
7804
|
async openApp(resourceId, pkObject) {
|
|
7409
7805
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
7410
7806
|
}
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7807
|
+
getDuPromissesStack(dataUnitName) {
|
|
7808
|
+
let stack;
|
|
7809
|
+
if (dataUnitName) {
|
|
7810
|
+
stack = this._duPromises.get(dataUnitName);
|
|
7811
|
+
if (!stack) {
|
|
7812
|
+
stack = [];
|
|
7813
|
+
this._duPromises.set(dataUnitName, stack);
|
|
7814
|
+
}
|
|
7815
|
+
}
|
|
7816
|
+
return stack || [];
|
|
7817
|
+
}
|
|
7818
|
+
/**
|
|
7819
|
+
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
|
7820
|
+
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado
|
|
7821
|
+
*/
|
|
7822
|
+
async createDataunit(entityName, dataUnitName) {
|
|
7823
|
+
return new Promise((resolve, reject) => {
|
|
7824
|
+
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
|
7825
|
+
const waitingDu = duPromisses.length > 0;
|
|
7826
|
+
duPromisses.push(new PendingPromise(resolve, reject));
|
|
7827
|
+
if (!waitingDu) {
|
|
7828
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
7829
|
+
dataUnit.loadMetadata().then(() => {
|
|
7830
|
+
if (dataUnitName) {
|
|
7831
|
+
this._duCache.set(dataUnitName, dataUnit);
|
|
7832
|
+
}
|
|
7833
|
+
while (duPromisses.length > 0) {
|
|
7834
|
+
duPromisses.pop().resolve(dataUnit);
|
|
7835
|
+
}
|
|
7836
|
+
}).catch(reason => {
|
|
7837
|
+
while (duPromisses.length > 0) {
|
|
7838
|
+
duPromisses.pop().reject(reason);
|
|
7839
|
+
}
|
|
7840
|
+
});
|
|
7841
|
+
}
|
|
7842
|
+
});
|
|
7843
|
+
}
|
|
7844
|
+
/**
|
|
7845
|
+
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
|
7846
|
+
*/
|
|
7847
|
+
async getDataUnit(entityName, dataUnitName) {
|
|
7848
|
+
return new Promise((resolve, reject) => {
|
|
7849
|
+
const dataUnit = this._duCache.get(dataUnitName);
|
|
7850
|
+
if (dataUnit) {
|
|
7851
|
+
resolve(dataUnit);
|
|
7852
|
+
}
|
|
7853
|
+
else {
|
|
7854
|
+
this.createDataunit(entityName, dataUnitName).then(dataUnit => {
|
|
7855
|
+
resolve(dataUnit);
|
|
7856
|
+
}).catch(reason => reject(reason));
|
|
7857
|
+
}
|
|
7415
7858
|
});
|
|
7416
7859
|
}
|
|
7860
|
+
/**
|
|
7861
|
+
* Retorna o resourceID da tela em questão.
|
|
7862
|
+
*/
|
|
7417
7863
|
async getResourceID() {
|
|
7418
7864
|
return Promise.resolve(this.resourceID);
|
|
7419
7865
|
}
|
|
7866
|
+
/**
|
|
7867
|
+
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
7868
|
+
*/
|
|
7420
7869
|
async alert(title, message, icon, options) {
|
|
7421
7870
|
return ApplicationUtils.alert(title, message, icon, options);
|
|
7422
7871
|
}
|
|
7872
|
+
/**
|
|
7873
|
+
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
7874
|
+
*/
|
|
7423
7875
|
async error(title, message, icon, options) {
|
|
7424
7876
|
return ApplicationUtils.error(title, message, icon, options);
|
|
7425
7877
|
}
|
|
7426
|
-
|
|
7427
|
-
|
|
7878
|
+
/**
|
|
7879
|
+
* Mostra o diálogo de sucesso de acordo com os parâmetros passados.
|
|
7880
|
+
*/
|
|
7881
|
+
async success(title, message, icon, options) {
|
|
7882
|
+
return ApplicationUtils.success(title, message, icon, options);
|
|
7883
|
+
}
|
|
7884
|
+
/**
|
|
7885
|
+
* Exibe um diálogo de mensagem comum
|
|
7886
|
+
*/
|
|
7887
|
+
async message(title, message, icon, options) {
|
|
7888
|
+
return ApplicationUtils.message(title, message, icon, options);
|
|
7889
|
+
}
|
|
7890
|
+
/**
|
|
7891
|
+
* Exibe um diálogo de confirmação
|
|
7892
|
+
*/
|
|
7893
|
+
async confirm(title, message, icon, dialogType, options) {
|
|
7894
|
+
return ApplicationUtils.confirm(title, message, icon, dialogType, options);
|
|
7428
7895
|
}
|
|
7896
|
+
/**
|
|
7897
|
+
* Mostra uma informação efêmera (de segundo plano).
|
|
7898
|
+
*/
|
|
7429
7899
|
async info(message, options) {
|
|
7430
7900
|
return ApplicationUtils.info(message, options);
|
|
7431
7901
|
}
|
|
7902
|
+
/**
|
|
7903
|
+
* Busca a configuração de formulário.
|
|
7904
|
+
*/
|
|
7432
7905
|
async loadFormConfig(name) {
|
|
7433
7906
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7434
7907
|
}
|
|
7435
|
-
|
|
7436
|
-
|
|
7908
|
+
/**
|
|
7909
|
+
* Busca a configuração de grade.
|
|
7910
|
+
*/
|
|
7911
|
+
async loadGridConfig(name) {
|
|
7912
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7913
|
+
}
|
|
7914
|
+
/**
|
|
7915
|
+
* Busca os totalizadores da grade.
|
|
7916
|
+
*/
|
|
7917
|
+
async loadTotals(name, resourceID, filters) {
|
|
7918
|
+
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
|
7437
7919
|
}
|
|
7920
|
+
/**
|
|
7921
|
+
* Salva a configuração de grade.
|
|
7922
|
+
*/
|
|
7438
7923
|
async saveGridConfig(config) {
|
|
7439
7924
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7440
7925
|
}
|
|
7926
|
+
/**
|
|
7927
|
+
* Obtém as configurações da barra de filtros
|
|
7928
|
+
*/
|
|
7929
|
+
async getFilterBarConfig(name) {
|
|
7930
|
+
return new Promise((accept, reject) => {
|
|
7931
|
+
if (this.configName === name && this._filterBarConfig) {
|
|
7932
|
+
accept(this._filterBarConfig);
|
|
7933
|
+
}
|
|
7934
|
+
else if (this.configName === name && this._filterConfigPromise != undefined) {
|
|
7935
|
+
Promise.all([this._filterConfigPromise])
|
|
7936
|
+
.then(result => accept(result[0]))
|
|
7937
|
+
.catch(reason => reject(reason[0]));
|
|
7938
|
+
}
|
|
7939
|
+
else {
|
|
7940
|
+
this.filterBarConfigFetcher.getConfig(this.resourceID, name)
|
|
7941
|
+
.then(config => accept(config))
|
|
7942
|
+
.catch(reason => reject(reason));
|
|
7943
|
+
}
|
|
7944
|
+
});
|
|
7945
|
+
}
|
|
7946
|
+
/**
|
|
7947
|
+
* Salva as configurações da barra de filtros
|
|
7948
|
+
*/
|
|
7949
|
+
async saveFilterBarConfig(config, name) {
|
|
7950
|
+
return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
|
|
7951
|
+
}
|
|
7952
|
+
async getAuthList(_auth) {
|
|
7953
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7954
|
+
}
|
|
7441
7955
|
get urlParams() {
|
|
7442
7956
|
if (!this._urlParams) {
|
|
7443
7957
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -7462,6 +7976,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7462
7976
|
}
|
|
7463
7977
|
return this._gridConfigFetcher;
|
|
7464
7978
|
}
|
|
7979
|
+
get totalsFetcher() {
|
|
7980
|
+
if (!this._totalsFetcher) {
|
|
7981
|
+
this._totalsFetcher = new TotalsFetcher();
|
|
7982
|
+
}
|
|
7983
|
+
return this._totalsFetcher;
|
|
7984
|
+
}
|
|
7465
7985
|
get pesquisaFetcher() {
|
|
7466
7986
|
if (!this._pesquisaFetcher) {
|
|
7467
7987
|
this._pesquisaFetcher = new PesquisaFetcher();
|
|
@@ -7474,9 +7994,17 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7474
7994
|
}
|
|
7475
7995
|
return this._authFetcher;
|
|
7476
7996
|
}
|
|
7997
|
+
get filterBarConfigFetcher() {
|
|
7998
|
+
if (!this._filterBarConfigFetcher) {
|
|
7999
|
+
this._filterBarConfigFetcher = new FilterBarConfigFetcher();
|
|
8000
|
+
}
|
|
8001
|
+
return this._filterBarConfigFetcher;
|
|
8002
|
+
}
|
|
7477
8003
|
async executeSearch(searchArgument, fieldName, dataUnit) {
|
|
7478
8004
|
const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
|
|
7479
|
-
if (!descriptor)
|
|
8005
|
+
if (!descriptor) {
|
|
8006
|
+
//TODO: Implementar mensagem de erro
|
|
8007
|
+
}
|
|
7480
8008
|
else {
|
|
7481
8009
|
const { mode, argument } = searchArgument;
|
|
7482
8010
|
const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
|
|
@@ -7508,23 +8036,27 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7508
8036
|
}
|
|
7509
8037
|
}
|
|
7510
8038
|
});
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
8039
|
+
return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
|
|
8040
|
+
}
|
|
8041
|
+
}
|
|
8042
|
+
async executePreparedSearch(mode, argument, options) {
|
|
8043
|
+
const { entity, entityDescription, criteria, searchOptions } = options;
|
|
8044
|
+
if (mode === "ADVANCED") {
|
|
8045
|
+
return new Promise(accept => {
|
|
8046
|
+
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
8047
|
+
pesquisaContent.argument = argument;
|
|
8048
|
+
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
|
|
8049
|
+
pesquisaContent.selectItem = (option) => {
|
|
8050
|
+
accept(option);
|
|
8051
|
+
this.clearPopUpTitle();
|
|
8052
|
+
this.closePopUp();
|
|
8053
|
+
};
|
|
8054
|
+
this.setPopUpTitle(entityDescription);
|
|
8055
|
+
this.showPopUp(pesquisaContent);
|
|
8056
|
+
});
|
|
8057
|
+
}
|
|
8058
|
+
else {
|
|
8059
|
+
return this.pesquisaFetcher.loadSearchOptions(entity, argument, criteria, searchOptions);
|
|
7528
8060
|
}
|
|
7529
8061
|
}
|
|
7530
8062
|
async isDebugMode() {
|
|
@@ -7532,10 +8064,10 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7532
8064
|
accept(window['isDebugMode']);
|
|
7533
8065
|
});
|
|
7534
8066
|
}
|
|
7535
|
-
|
|
7536
|
-
if (
|
|
7537
|
-
Array.from(
|
|
7538
|
-
|
|
8067
|
+
clearContent(container) {
|
|
8068
|
+
if (container) {
|
|
8069
|
+
Array.from(container.children).forEach(child => {
|
|
8070
|
+
container.removeChild(child);
|
|
7539
8071
|
});
|
|
7540
8072
|
}
|
|
7541
8073
|
}
|
|
@@ -7547,14 +8079,26 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7547
8079
|
}
|
|
7548
8080
|
componentWillLoad() {
|
|
7549
8081
|
this._errorHandler = new SnkErrorHandler(this);
|
|
8082
|
+
this.messagesBuilder = new SnkMessageBuilder();
|
|
7550
8083
|
ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
|
|
7551
8084
|
ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
|
|
7552
8085
|
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
7553
8086
|
});
|
|
7554
8087
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
8088
|
+
if (this.configName) {
|
|
8089
|
+
this._filterConfigPromise = new Promise((accept, reject) => {
|
|
8090
|
+
this.filterBarConfigFetcher.getConfig(this.resourceID, this.configName)
|
|
8091
|
+
.then(config => {
|
|
8092
|
+
this._filterBarConfig = config;
|
|
8093
|
+
accept(config);
|
|
8094
|
+
})
|
|
8095
|
+
.catch(reason => reject(reason));
|
|
8096
|
+
});
|
|
8097
|
+
}
|
|
7555
8098
|
ErrorTracking.init();
|
|
7556
8099
|
}
|
|
7557
8100
|
connectedCallback() {
|
|
8101
|
+
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
7558
8102
|
DataFetcher.addRequestListener(this._requestListener);
|
|
7559
8103
|
}
|
|
7560
8104
|
disconnectedCallback() {
|
|
@@ -7567,10 +8111,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7567
8111
|
});
|
|
7568
8112
|
}
|
|
7569
8113
|
render() {
|
|
7570
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() })));
|
|
8114
|
+
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "col col--sd-3", closeOutsideClick: true })));
|
|
7571
8115
|
}
|
|
7572
8116
|
static get style() { return snkApplicationCss; }
|
|
7573
8117
|
}, [2, "snk-application", {
|
|
8118
|
+
"messagesBuilder": [1040],
|
|
8119
|
+
"configName": [1, "config-name"],
|
|
7574
8120
|
"isUserSup": [64],
|
|
7575
8121
|
"hasAccess": [64],
|
|
7576
8122
|
"getAllAccess": [64],
|
|
@@ -7580,6 +8126,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7580
8126
|
"getBooleanParam": [64],
|
|
7581
8127
|
"getDateParam": [64],
|
|
7582
8128
|
"showPopUp": [64],
|
|
8129
|
+
"showModal": [64],
|
|
8130
|
+
"closeModal": [64],
|
|
7583
8131
|
"closePopUp": [64],
|
|
7584
8132
|
"temOpcional": [64],
|
|
7585
8133
|
"getConfig": [64],
|
|
@@ -7587,31 +8135,45 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7587
8135
|
"getAttributeFromHTMLWrapper": [64],
|
|
7588
8136
|
"openApp": [64],
|
|
7589
8137
|
"createDataunit": [64],
|
|
8138
|
+
"getDataUnit": [64],
|
|
7590
8139
|
"getResourceID": [64],
|
|
7591
8140
|
"alert": [64],
|
|
7592
8141
|
"error": [64],
|
|
8142
|
+
"success": [64],
|
|
8143
|
+
"message": [64],
|
|
7593
8144
|
"confirm": [64],
|
|
7594
8145
|
"info": [64],
|
|
7595
8146
|
"loadFormConfig": [64],
|
|
7596
8147
|
"loadGridConfig": [64],
|
|
8148
|
+
"loadTotals": [64],
|
|
7597
8149
|
"saveGridConfig": [64],
|
|
8150
|
+
"getFilterBarConfig": [64],
|
|
8151
|
+
"saveFilterBarConfig": [64],
|
|
7598
8152
|
"executeSearch": [64],
|
|
8153
|
+
"executePreparedSearch": [64],
|
|
7599
8154
|
"isDebugMode": [64]
|
|
7600
8155
|
}]);
|
|
7601
8156
|
class RequestListenerLoadingBar {
|
|
7602
8157
|
constructor() {
|
|
7603
8158
|
this._debounceTime = 1000;
|
|
8159
|
+
this._ignoredNameTypes = ["totals"];
|
|
7604
8160
|
this._countRequest = 0;
|
|
7605
8161
|
}
|
|
7606
|
-
onRequestStart() {
|
|
7607
|
-
this.
|
|
8162
|
+
onRequestStart(param) {
|
|
8163
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8164
|
+
return;
|
|
8165
|
+
}
|
|
7608
8166
|
this._countRequest++;
|
|
8167
|
+
this.loadingBar.show();
|
|
7609
8168
|
if (this._timerLoading) {
|
|
7610
8169
|
clearTimeout(this._timerLoading);
|
|
7611
8170
|
}
|
|
7612
8171
|
}
|
|
7613
8172
|
;
|
|
7614
|
-
onRequestEnd() {
|
|
8173
|
+
onRequestEnd(param) {
|
|
8174
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8175
|
+
return;
|
|
8176
|
+
}
|
|
7615
8177
|
this._countRequest--;
|
|
7616
8178
|
this._timerLoading = setTimeout(() => {
|
|
7617
8179
|
if (this._countRequest <= 0) {
|
|
@@ -7620,6 +8182,25 @@ class RequestListenerLoadingBar {
|
|
|
7620
8182
|
}, this._debounceTime);
|
|
7621
8183
|
}
|
|
7622
8184
|
;
|
|
8185
|
+
isIgnoreLoadingOnRequest(param) {
|
|
8186
|
+
var _a;
|
|
8187
|
+
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
8188
|
+
const { name } = param.requestBody[0].variables;
|
|
8189
|
+
if (name) {
|
|
8190
|
+
const nameParts = name.split(":");
|
|
8191
|
+
const nameType = nameParts[0];
|
|
8192
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
8193
|
+
}
|
|
8194
|
+
}
|
|
8195
|
+
return false;
|
|
8196
|
+
}
|
|
8197
|
+
;
|
|
8198
|
+
}
|
|
8199
|
+
class PendingPromise {
|
|
8200
|
+
constructor(resolve, reject) {
|
|
8201
|
+
this.resolve = resolve;
|
|
8202
|
+
this.reject = reject;
|
|
8203
|
+
}
|
|
7623
8204
|
}
|
|
7624
8205
|
function defineCustomElement() {
|
|
7625
8206
|
if (typeof customElements === "undefined") {
|