@sankhyalabs/sankhyablocks 1.3.31-beta.2 → 1.3.31-beta.20

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.
Files changed (218) hide show
  1. package/dist/cjs/SnkMessageBuilder-7717f1e4.js +326 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/css-shim-b8158822.js +6 -0
  4. package/dist/cjs/dom-36862b77.js +75 -0
  5. package/dist/cjs/filter-item-type.enum-e2e1bc5b.js +14 -0
  6. package/dist/cjs/index-02201bc9.js +2397 -0
  7. package/dist/cjs/index-b0b676c5.js +3298 -0
  8. package/dist/cjs/loader.cjs.js +19 -3
  9. package/dist/cjs/sankhyablocks.cjs.js +117 -5
  10. package/dist/cjs/shadow-css-346c0795.js +389 -0
  11. package/dist/cjs/snk-application.cjs.entry.js +1041 -177
  12. package/dist/cjs/snk-crud.cjs.entry.js +65 -0
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +276 -0
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +265 -0
  15. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
  16. package/dist/cjs/snk-filter-detail.cjs.entry.js +49 -0
  17. package/dist/cjs/snk-filter-item.cjs.entry.js +143 -0
  18. package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
  19. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
  20. package/dist/cjs/snk-filter-number.cjs.entry.js +24 -0
  21. package/dist/cjs/snk-filter-period.cjs.entry.js +26 -0
  22. package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
  23. package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
  24. package/dist/cjs/snk-form.cjs.entry.js +133 -0
  25. package/dist/cjs/snk-grid.cjs.entry.js +79 -0
  26. package/dist/cjs/snk-pesquisa.cjs.entry.js +10 -7
  27. package/dist/cjs/snk-taskbar.cjs.entry.js +160 -0
  28. package/dist/cjs/taskbar-elements-283c737e.js +93 -0
  29. package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
  30. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  31. package/dist/collection/collection-manifest.json +17 -2
  32. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +9 -2
  33. package/dist/collection/components/snk-application/snk-application.js +1061 -629
  34. package/dist/collection/components/snk-crud/snk-crud.css +6 -0
  35. package/dist/collection/components/snk-crud/snk-crud.js +176 -0
  36. package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
  37. package/dist/collection/components/snk-data-unit/snk-data-unit.js +540 -0
  38. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
  39. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
  40. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +65 -0
  41. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +69 -0
  42. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
  43. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
  44. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +10 -0
  45. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +118 -0
  46. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +244 -0
  47. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +233 -0
  48. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +114 -0
  49. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +323 -0
  50. package/dist/collection/components/snk-form/snk-form.css +34 -0
  51. package/dist/collection/components/snk-form/snk-form.js +258 -0
  52. package/dist/collection/components/snk-grid/snk-grid.css +18 -0
  53. package/dist/collection/components/snk-grid/snk-grid.js +183 -0
  54. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +56 -13
  55. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +81 -76
  56. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +86 -0
  57. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
  58. package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
  59. package/dist/collection/components/snk-taskbar/snk-taskbar.js +307 -0
  60. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
  61. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +38 -13
  62. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
  63. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +388 -0
  64. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
  65. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +2 -0
  66. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
  67. package/dist/collection/lib/index.js +1 -0
  68. package/dist/collection/lib/message/SnkMessageBuilder.js +121 -0
  69. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +23 -0
  70. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +18 -0
  71. package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
  72. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
  73. package/dist/components/SnkMessageBuilder.js +303 -0
  74. package/dist/components/filter-item-type.enum.js +12 -0
  75. package/dist/components/index.d.ts +18 -5
  76. package/dist/components/index.js +22 -0
  77. package/dist/components/index2.js +2384 -0
  78. package/dist/components/snk-application2.js +1019 -148
  79. package/dist/components/snk-crud.d.ts +11 -0
  80. package/dist/components/snk-crud.js +127 -0
  81. package/dist/components/snk-data-unit.d.ts +11 -0
  82. package/dist/components/snk-data-unit.js +299 -0
  83. package/dist/components/snk-filter-bar.d.ts +11 -0
  84. package/dist/components/snk-filter-bar.js +6 -0
  85. package/dist/components/snk-filter-bar2.js +296 -0
  86. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  87. package/dist/components/snk-filter-binary-select.js +63 -0
  88. package/dist/components/snk-filter-detail.d.ts +11 -0
  89. package/dist/components/snk-filter-detail.js +6 -0
  90. package/dist/components/snk-filter-detail2.js +63 -0
  91. package/dist/components/snk-filter-item.d.ts +11 -0
  92. package/dist/components/snk-filter-item.js +6 -0
  93. package/dist/components/snk-filter-item2.js +164 -0
  94. package/dist/components/snk-filter-list.d.ts +11 -0
  95. package/dist/components/snk-filter-list.js +6 -0
  96. package/dist/components/snk-filter-list2.js +111 -0
  97. package/dist/components/snk-filter-multi-select.d.ts +11 -0
  98. package/dist/components/snk-filter-multi-select.js +39 -0
  99. package/dist/components/snk-filter-number.d.ts +11 -0
  100. package/dist/components/snk-filter-number.js +40 -0
  101. package/dist/components/snk-filter-period.d.ts +11 -0
  102. package/dist/components/snk-filter-period.js +42 -0
  103. package/dist/components/snk-filter-search.d.ts +11 -0
  104. package/dist/components/snk-filter-search.js +62 -0
  105. package/dist/components/snk-filter-text.d.ts +11 -0
  106. package/dist/components/snk-filter-text.js +38 -0
  107. package/dist/components/snk-form.d.ts +11 -0
  108. package/dist/components/snk-form.js +6 -0
  109. package/dist/components/snk-form2.js +159 -0
  110. package/dist/components/snk-grid.d.ts +11 -0
  111. package/dist/components/snk-grid.js +6 -0
  112. package/dist/components/snk-grid2.js +126 -0
  113. package/dist/components/snk-pesquisa2.js +6 -3
  114. package/dist/components/snk-taskbar.d.ts +11 -0
  115. package/dist/components/snk-taskbar.js +6 -0
  116. package/dist/components/snk-taskbar2.js +264 -0
  117. package/dist/components/taskbar-processor.js +45 -0
  118. package/dist/components/teste-pesquisa.js +1 -1
  119. package/dist/esm/SnkMessageBuilder-a7da466b.js +303 -0
  120. package/dist/esm/app-globals-0f993ce5.js +3 -0
  121. package/dist/esm/css-shim-b3f2ee8d.js +4 -0
  122. package/dist/esm/dom-665d6011.js +73 -0
  123. package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
  124. package/dist/esm/index-2b4d2d14.js +3262 -0
  125. package/dist/esm/index-e5b61043.js +2384 -0
  126. package/dist/esm/loader.js +19 -3
  127. package/dist/esm/polyfills/css-shim.js +1 -1
  128. package/dist/esm/sankhyablocks.js +117 -5
  129. package/dist/esm/shadow-css-b18e99d7.js +387 -0
  130. package/dist/esm/snk-application.entry.js +1013 -149
  131. package/dist/esm/snk-crud.entry.js +61 -0
  132. package/dist/esm/snk-data-unit.entry.js +272 -0
  133. package/dist/esm/snk-filter-bar.entry.js +261 -0
  134. package/dist/esm/snk-filter-binary-select.entry.js +43 -0
  135. package/dist/esm/snk-filter-detail.entry.js +45 -0
  136. package/dist/esm/snk-filter-item.entry.js +139 -0
  137. package/dist/esm/snk-filter-list.entry.js +87 -0
  138. package/dist/esm/snk-filter-multi-select.entry.js +19 -0
  139. package/dist/esm/snk-filter-number.entry.js +20 -0
  140. package/dist/esm/snk-filter-period.entry.js +22 -0
  141. package/dist/esm/snk-filter-search.entry.js +40 -0
  142. package/dist/esm/snk-filter-text.entry.js +18 -0
  143. package/dist/esm/snk-form.entry.js +129 -0
  144. package/dist/esm/snk-grid.entry.js +75 -0
  145. package/dist/esm/snk-pesquisa.entry.js +7 -4
  146. package/dist/esm/snk-taskbar.entry.js +156 -0
  147. package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
  148. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  149. package/dist/esm/teste-pesquisa.entry.js +2 -2
  150. package/dist/sankhyablocks/SnkMessageBuilder-a7da466b.js +303 -0
  151. package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
  152. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
  153. package/dist/sankhyablocks/dom-665d6011.js +73 -0
  154. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
  155. package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
  156. package/dist/sankhyablocks/index-e5b61043.js +2384 -0
  157. package/dist/sankhyablocks/index.esm.js +1 -0
  158. package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
  159. package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
  160. package/dist/sankhyablocks/snk-application.entry.js +8452 -0
  161. package/dist/sankhyablocks/snk-crud.entry.js +61 -0
  162. package/dist/sankhyablocks/snk-data-unit.entry.js +272 -0
  163. package/dist/sankhyablocks/snk-filter-bar.entry.js +261 -0
  164. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
  165. package/dist/sankhyablocks/snk-filter-detail.entry.js +45 -0
  166. package/dist/sankhyablocks/snk-filter-item.entry.js +139 -0
  167. package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
  168. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
  169. package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
  170. package/dist/sankhyablocks/snk-filter-period.entry.js +22 -0
  171. package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
  172. package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
  173. package/dist/sankhyablocks/snk-form.entry.js +129 -0
  174. package/dist/sankhyablocks/snk-grid.entry.js +75 -0
  175. package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
  176. package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
  177. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
  178. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
  179. package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
  180. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  181. package/dist/types/components/snk-application/snk-application.d.ts +141 -20
  182. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  183. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
  184. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
  185. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +13 -0
  186. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
  187. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
  188. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
  189. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +14 -0
  190. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
  191. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +46 -0
  192. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -0
  193. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
  194. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +84 -0
  195. package/dist/types/components.d.ts +662 -9
  196. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
  197. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
  198. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +5 -0
  199. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -3
  200. package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
  201. package/dist/types/lib/index.d.ts +1 -0
  202. package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
  203. package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
  204. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  205. package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
  206. package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
  207. package/dist/types/stencil-public-runtime.d.ts +15 -4
  208. package/loader/package.json +1 -0
  209. package/package.json +5 -5
  210. package/react/components.d.ts +0 -2
  211. package/react/components.js +0 -2
  212. package/react/components.js.map +1 -1
  213. package/dist/cjs/index-1133bc2a.js +0 -1235
  214. package/dist/esm/index-ffda6382.js +0 -1208
  215. package/dist/sankhyablocks/p-2a7b4cb3.entry.js +0 -1
  216. package/dist/sankhyablocks/p-d62412bb.entry.js +0 -1
  217. package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
  218. 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, WarningException, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
3
- import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { DependencyType } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
2
+ import { E as ErrorException, W as WarningException, S as StringUtils, D as DataUnit, b as DataType, C as ChangeOperation, c as DateUtils, O as ObjectUtils, d as WaitingChangeException, e as DependencyType, a as ApplicationContext, f as ErrorTracking } from './index2.js';
3
+ import { A as ApplicationUtils, S as SnkMessageBuilder } from './SnkMessageBuilder.js';
4
+ import { F as FilterItemType } from './filter-item-type.enum.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
- ((function (exports) {
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
- let OperationTypeNode;
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
- let DirectiveLocation;
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
- let Kind;
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
- let TokenKind;
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
- function instanceOf(value, constructor) {
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._lexer.advance();
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._lexer.advance();
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._lexer.advance();
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
- var _this$_options2;
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._lexer.advance();
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._lexer.advance();
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._lexer.advance();
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._lexer.advance();
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();
@@ -6459,7 +6618,7 @@ class UrlUtils {
6459
6618
 
6460
6619
  class DataFetcher {
6461
6620
  constructor() {
6462
- this.GRAPHQL_PATH = window['applicationenv'] === "sankhyaom" ? "/mge/graphql" : "";
6621
+ this.GRAPHQL_PATH = "/mge/graphql";
6463
6622
  this.watingRequestsById = new Map();
6464
6623
  }
6465
6624
  static get() {
@@ -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
- reject(new ErrorException("Falha detectada", res.errors[0][0].message));
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()}/mge/service.sbr`,
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 ctx = this.getContext();
6531
- const url = `${ctx.baseUrl}?serviceName=${serviceName}&counter=21&application=${ctx.appName}&outputType=json&preventTransform=false&mgeSession=${ctx.mgeSession}&resourceID=${ctx.resourceID}&globalID=${ctx.globalID}&allowConcurrentCalls=true`;
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 $filter: [InputFilter!] $sort: [InputSort!]) {
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: $filter sort: $sort){
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, page, sort, filters) => this.loadData(dataUnit, page, sort, filters);
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, page, sort, filter) {
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
- var _a, _b, _c;
6794
- const variables = { dataunit: dataUnit.name, sort, filter };
6795
- if (page) {
6796
- variables.limit = page.limit;
6797
- variables.offset = page.offset;
6798
- }
6799
- if (!StringUtils.isEmpty((_a = page === null || page === void 0 ? void 0 : page.quickFilter) === null || _a === void 0 ? void 0 : _a.term)) {
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: page.quickFilter.term }]
7005
+ params: [{ name: "term", dataType: DataType.TEXT, value: quickFilter.term }]
6807
7006
  };
6808
- if (((_c = (_b = page.quickFilter) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.length) > 0) {
6809
- quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value: page.quickFilter.fields });
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 pageResult = resp.data;
6820
- const records = [];
6821
- pageResult.records.forEach((responseRecord) => {
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
- records.push(duRecord);
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
- let config = JSON.parse(loadedResource);
7061
- resolve(config);
7276
+ config = JSON.parse(loadedResource);
7062
7277
  }
7278
+ resolve(config);
7063
7279
  }).catch((error) => {
7064
7280
  reject(error);
7065
7281
  });
@@ -7094,6 +7310,8 @@ class PesquisaFetcher {
7094
7310
  }`);
7095
7311
  }
7096
7312
  loadSearchOptions(entityName, argument, criteria, options) {
7313
+ const cleanText = (argument === null || argument === void 0 ? void 0 : argument.trim()) || undefined;
7314
+ argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
7097
7315
  return new Promise((resolve, reject) => {
7098
7316
  DataFetcher.get()
7099
7317
  .callGraphQL({
@@ -7216,7 +7434,14 @@ class SnkErrorHandler {
7216
7434
  errorHandler(evt) {
7217
7435
  this.processException(evt.error);
7218
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
+ }
7219
7441
  processException(exception) {
7442
+ if (exception.errorCode != "") {
7443
+ exception.message += this.buildErrorCodeHTML(exception);
7444
+ }
7220
7445
  if (exception instanceof WaitingChangeException) {
7221
7446
  this._app.alert(exception.title, exception.message);
7222
7447
  }
@@ -7234,7 +7459,7 @@ class SnkErrorHandler {
7234
7459
  }
7235
7460
  else {
7236
7461
  const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
7237
- 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)}"`;
7238
7463
  this._app.error(title, message);
7239
7464
  }
7240
7465
  }
@@ -7245,6 +7470,439 @@ class SnkErrorHandler {
7245
7470
 
7246
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);
7247
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
+ class FilterBarConfigFetcher extends ResourceFetcher {
7520
+ getConfig(resourceID) {
7521
+ return new Promise((resolve) => {
7522
+ if (resourceID === "br.com.sankhya.fin.cad.movimentacaoFinanceira") {
7523
+ resolve(getFiltrosMovFin());
7524
+ }
7525
+ else if (resourceID === "br.com.sankhya.fin.cad.movimentacaoBancaria") {
7526
+ resolve(getFiltrosMovBan());
7527
+ }
7528
+ else {
7529
+ resolve(undefined);
7530
+ }
7531
+ });
7532
+ }
7533
+ }
7534
+ function getFiltrosMovBan() {
7535
+ return [{
7536
+ "id": "DTLANC",
7537
+ "visible": true,
7538
+ "type": FilterItemType.PERIOD,
7539
+ "label": "Dt Lançamento",
7540
+ "detailTitle": "Informe a data ou período",
7541
+ "props": {
7542
+ "expression": {
7543
+ "fullfill": "onlydate(this.DTLANC) >= :DTLANC.START AND onlydate(this.DTLANC) <= :DTLANC.END",
7544
+ "onlystart": "onlydate(this.DTLANC) >= :DTLANC",
7545
+ "onlyend": "onlydate(this.DTLANC) <= :DTLANC"
7546
+ }
7547
+ }
7548
+ },
7549
+ {
7550
+ "id": "CODCTABCOINT",
7551
+ "visible": true,
7552
+ "type": FilterItemType.SEARCH,
7553
+ "label": "Conta origem",
7554
+ "detailTitle": "Informe a conta de origem",
7555
+ "props": {
7556
+ "expression": "this.CODCTABCOINT = :CODCTABCOINT",
7557
+ "searchContext": {
7558
+ "entity": "ImplantacaoSaldoConta",
7559
+ "entityDescription": "Conta origem",
7560
+ "searchOptions": {
7561
+ "rootEntity": "MovimentoBancario",
7562
+ "descriptionFieldName": "DESCRICAO",
7563
+ "codeFieldName": "CODCTABCOINT",
7564
+ "showInactives": false
7565
+ }
7566
+ }
7567
+ }
7568
+ },
7569
+ {
7570
+ "id": "CODTIPOPER",
7571
+ "visible": false,
7572
+ "type": FilterItemType.SEARCH,
7573
+ "label": "Tipo de operação",
7574
+ "detailTitle": "Informe o tipo de operação",
7575
+ "props": {
7576
+ "expression": "this.CODTIPOPER = :CODTIPOPER",
7577
+ "searchContext": {
7578
+ "entity": "TipoOperacao",
7579
+ "entityDescription": "Tipo de operação",
7580
+ "searchOptions": {
7581
+ "rootEntity": "MovimentoBancario",
7582
+ "descriptionFieldName": "DESCROPER",
7583
+ "codeFieldName": "CODTIPOPER",
7584
+ "showInactives": false
7585
+ }
7586
+ }
7587
+ }
7588
+ },
7589
+ {
7590
+ "id": "ORIGMOV",
7591
+ "visible": false,
7592
+ "type": FilterItemType.MULTI_SELECT,
7593
+ "label": "Tipo de movimento",
7594
+ "detailTitle": "Escolha um tipo de movimento",
7595
+ "props": {
7596
+ "expression": "this.ORIGMOV = :ORIGMOV",
7597
+ "options": [
7598
+ { "value": "A", "label": "Aplicação" },
7599
+ { "value": "R", "label": "Resgate" },
7600
+ { "value": "S", "label": "Saque" },
7601
+ { "value": "D", "label": "Depósito" },
7602
+ { "value": "T", "label": "Transferência" }
7603
+ ]
7604
+ }
7605
+ },
7606
+ {
7607
+ "id": "NUBCO",
7608
+ "type": FilterItemType.NUMBER,
7609
+ "visible": false,
7610
+ "label": "Nr. único",
7611
+ "detailTitle": "Informe o número único",
7612
+ "props": {
7613
+ "expression": "this.NUBCO = :NUBCO"
7614
+ }
7615
+ },
7616
+ {
7617
+ "id": "VLRLANC",
7618
+ "type": FilterItemType.NUMBER,
7619
+ "visible": false,
7620
+ "label": "Vlr. Lançamento",
7621
+ "detailTitle": "Informe o valor do lançamento",
7622
+ "props": {
7623
+ "expression": "this.VLRLANC = :VLRLANC",
7624
+ "precision": 2
7625
+ }
7626
+ },
7627
+ {
7628
+ "id": "CODLANC",
7629
+ "visible": false,
7630
+ "type": FilterItemType.SEARCH,
7631
+ "label": "Lançamento origem",
7632
+ "detailTitle": "Informe o lançamento de origem",
7633
+ "props": {
7634
+ "expression": "this.CODLANC = :CODLANC",
7635
+ "searchContext": {
7636
+ "entity": "HistoricoBancario",
7637
+ "entityDescription": "Lançamento origem",
7638
+ "searchOptions": {
7639
+ "rootEntity": "MovimentoBancario",
7640
+ "descriptionFieldName": "DESCRLANCBCO",
7641
+ "codeFieldName": "CODLANC",
7642
+ "showInactives": false
7643
+ }
7644
+ }
7645
+ }
7646
+ }];
7647
+ }
7648
+ function getFiltrosMovFin() {
7649
+ return [{
7650
+ id: "RECDESP",
7651
+ visible: true,
7652
+ label: "Receitas + Despesas",
7653
+ detailTitle: "Selecione o que deseja ver",
7654
+ type: FilterItemType.BINARY_SELECT,
7655
+ hardFixed: true,
7656
+ props: {
7657
+ options: [
7658
+ { name: "RECEITA", expression: "this.RECDESP = 1", label: "Receitas" },
7659
+ { name: "DESPESA", expression: "this.RECDESP = -1", label: "Despesas" }
7660
+ ]
7661
+ }
7662
+ },
7663
+ {
7664
+ id: "PROVISAO",
7665
+ visible: true,
7666
+ label: "Real + Provisão",
7667
+ detailTitle: "Selecione o que deseja ver",
7668
+ type: FilterItemType.BINARY_SELECT,
7669
+ hardFixed: true,
7670
+ props: {
7671
+ options: [
7672
+ { name: "REAL", expression: "nullvalue(this.PROVISAO, 'N') = 'N'", label: "Real" },
7673
+ { name: "PROVISAO", expression: "nullvalue(this.PROVISAO, 'N') = 'S'", label: "Provisão" }
7674
+ ]
7675
+ }
7676
+ },
7677
+ {
7678
+ id: "BAIXADO",
7679
+ visible: true,
7680
+ label: "Pendentes + Baixados",
7681
+ detailTitle: "Selecione o que deseja ver",
7682
+ type: FilterItemType.BINARY_SELECT,
7683
+ hardFixed: true,
7684
+ props: {
7685
+ options: [
7686
+ { name: "PENDENTE", expression: "this.DHBAIXA IS NULL", label: "Pendentes" },
7687
+ { name: "BAIXADO", expression: "this.DHBAIXA IS NOT NULL", label: "Baixados" }
7688
+ ]
7689
+ }
7690
+ },
7691
+ {
7692
+ id: "DTVENC",
7693
+ visible: true,
7694
+ type: FilterItemType.PERIOD,
7695
+ label: "Dt. Vencimento",
7696
+ detailTitle: "Informe a data ou período",
7697
+ props: {
7698
+ expression: {
7699
+ fullfill: "onlydate(this.DTVENC) >= :DTVENC.START AND onlydate(this.DTVENC) <= :DTVENC.END",
7700
+ onlystart: "onlydate(this.DTVENC) >= :DTVENC",
7701
+ onlyend: "onlydate(this.DTVENC) <= :DTVENC"
7702
+ }
7703
+ }
7704
+ },
7705
+ {
7706
+ id: "CODPARC",
7707
+ visible: true,
7708
+ type: FilterItemType.SEARCH,
7709
+ label: "Parceiro",
7710
+ detailTitle: "Informe o parceiro",
7711
+ props: {
7712
+ expression: "this.CODPARC = :CODPARC",
7713
+ searchContext: {
7714
+ entity: "Parceiro",
7715
+ entityDescription: "Parceiro",
7716
+ searchOptions: {
7717
+ rootEntity: "Financeiro",
7718
+ descriptionFieldName: "NOMEPARC",
7719
+ codeFieldName: "CODPARC",
7720
+ showInactives: false
7721
+ }
7722
+ }
7723
+ }
7724
+ },
7725
+ {
7726
+ id: "NUFIN",
7727
+ type: FilterItemType.NUMBER,
7728
+ visible: true,
7729
+ label: "Nr. único",
7730
+ detailTitle: "Informe o número único",
7731
+ props: {
7732
+ expression: "this.NUFIN = :NUFIN"
7733
+ }
7734
+ },
7735
+ {
7736
+ id: "NUMNOTA",
7737
+ visible: true,
7738
+ type: FilterItemType.NUMBER,
7739
+ label: "Nr. Nota",
7740
+ detailTitle: "Informe o número da nota",
7741
+ props: {
7742
+ expression: "this.NUMNOTA = :NUMNOTA"
7743
+ }
7744
+ },
7745
+ {
7746
+ id: "DHBAIXA",
7747
+ visible: true,
7748
+ type: FilterItemType.PERIOD,
7749
+ label: "Data da Baixa",
7750
+ detailTitle: "Informe a data ou período",
7751
+ props: {
7752
+ expression: {
7753
+ fullfill: "onlydate(this.DHBAIXA) >= :DHBAIXA.START AND onlydate(this.DHBAIXA) <= :DHBAIXA.END",
7754
+ onlystart: "onlydate(this.DHBAIXA) >= :DHBAIXA",
7755
+ onlyend: "onlydate(this.DHBAIXA) <= :DHBAIXA"
7756
+ }
7757
+ }
7758
+ },
7759
+ {
7760
+ id: "CODEMP",
7761
+ visible: false,
7762
+ type: FilterItemType.SEARCH,
7763
+ label: "Empresa",
7764
+ detailTitle: "Informe a empresa",
7765
+ props: {
7766
+ expression: "this.CODEMP = :CODEMP",
7767
+ searchContext: {
7768
+ entity: "Empresa",
7769
+ entityDescription: "Empresa",
7770
+ searchOptions: {
7771
+ rootEntity: "Financeiro",
7772
+ descriptionFieldName: "NOMEFANTASIA",
7773
+ codeFieldName: "CODEMP",
7774
+ showInactives: false
7775
+ }
7776
+ }
7777
+ }
7778
+ },
7779
+ {
7780
+ id: "CODNAT",
7781
+ visible: false,
7782
+ type: FilterItemType.SEARCH,
7783
+ label: "Natureza",
7784
+ detailTitle: "Informe a natureza",
7785
+ props: {
7786
+ expression: "this.CODNAT = :CODNAT",
7787
+ searchContext: {
7788
+ entity: "Natureza",
7789
+ entityDescription: "Natureza",
7790
+ searchOptions: {
7791
+ rootEntity: "Financeiro",
7792
+ descriptionFieldName: "DESCRNAT",
7793
+ codeFieldName: "CODNAT",
7794
+ showInactives: false
7795
+ }
7796
+ }
7797
+ }
7798
+ },
7799
+ {
7800
+ id: "DTNEG",
7801
+ visible: false,
7802
+ type: FilterItemType.PERIOD,
7803
+ label: "Dt. Negociação",
7804
+ detailTitle: "Informe a data ou período",
7805
+ props: {
7806
+ expression: {
7807
+ fullfill: "onlydate(this.DTNEG) >= :DTNEG.START AND onlydate(this.DTNEG) <= :DTNEG.END",
7808
+ onlystart: "onlydate(this.DTNEG) >= :DTNEG",
7809
+ onlyend: "onlydate(this.DTNEG) <= :DTNEG"
7810
+ }
7811
+ }
7812
+ },
7813
+ {
7814
+ id: "NUNOTA",
7815
+ visible: false,
7816
+ type: FilterItemType.NUMBER,
7817
+ label: "Nro Único do Pedido",
7818
+ detailTitle: "Informe o número único do pedido",
7819
+ props: {
7820
+ expression: "this.NUNOTA = :NUNOTA"
7821
+ }
7822
+ },
7823
+ {
7824
+ id: "CODCENCUS",
7825
+ visible: false,
7826
+ type: FilterItemType.SEARCH,
7827
+ label: "Centro de resultado",
7828
+ detailTitle: "Informe o centro de resultado",
7829
+ props: {
7830
+ expression: "this.CODCENCUS = :CODCENCUS",
7831
+ searchContext: {
7832
+ entity: "CentroResultado",
7833
+ entityDescription: "Centro de resultado",
7834
+ searchOptions: {
7835
+ rootEntity: "Financeiro",
7836
+ descriptionFieldName: "DESCRCENCUS",
7837
+ codeFieldName: "CODCENCUS",
7838
+ showInactives: false
7839
+ }
7840
+ }
7841
+ }
7842
+ },
7843
+ {
7844
+ id: "CODCTABCOINT",
7845
+ visible: false,
7846
+ type: FilterItemType.SEARCH,
7847
+ label: "Conta bancária",
7848
+ detailTitle: "Informe a conta bancária",
7849
+ props: {
7850
+ expression: "this.CODCTABCOINT = :CODCTABCOINT",
7851
+ searchContext: {
7852
+ entity: "ContaBancaria",
7853
+ entityDescription: "Conta bancária",
7854
+ searchOptions: {
7855
+ rootEntity: "Financeiro",
7856
+ descriptionFieldName: "DESCRICAO",
7857
+ codeFieldName: "CODCTABCOINT",
7858
+ showInactives: false
7859
+ }
7860
+ }
7861
+ }
7862
+ },
7863
+ {
7864
+ id: "CODBCO",
7865
+ visible: false,
7866
+ type: FilterItemType.SEARCH,
7867
+ label: "Banco",
7868
+ detailTitle: "Informe o banco",
7869
+ props: {
7870
+ expression: "this.CODBCO = :CODBCO",
7871
+ searchContext: {
7872
+ entity: "Banco",
7873
+ entityDescription: "Banco",
7874
+ searchOptions: {
7875
+ rootEntity: "Financeiro",
7876
+ descriptionFieldName: "NOMEBCO",
7877
+ codeFieldName: "CODBCO",
7878
+ showInactives: false
7879
+ }
7880
+ }
7881
+ }
7882
+ },
7883
+ {
7884
+ id: "CODPROJ",
7885
+ visible: false,
7886
+ type: FilterItemType.SEARCH,
7887
+ label: "Projeto",
7888
+ detailTitle: "Informe o projeto",
7889
+ props: {
7890
+ expression: "this.CODPROJ = :CODPROJ",
7891
+ searchContext: {
7892
+ entity: "Projeto",
7893
+ entityDescription: "Projeto",
7894
+ searchOptions: {
7895
+ rootEntity: "Financeiro",
7896
+ descriptionFieldName: "IDENTIFICACAO",
7897
+ codeFieldName: "CODPROJ",
7898
+ showInactives: false
7899
+ }
7900
+ }
7901
+ }
7902
+ }
7903
+ ];
7904
+ }
7905
+
7248
7906
  const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
7249
7907
 
7250
7908
  const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -7253,6 +7911,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7253
7911
  this.__registerHost();
7254
7912
  this.applicationLoaded = createEvent(this, "applicationLoaded", 7);
7255
7913
  this.applicationLoading = createEvent(this, "applicationLoading", 7);
7914
+ this._authPromises = [];
7915
+ this._duCache = new Map();
7916
+ this._duPromises = new Map();
7256
7917
  this._requestListener = new RequestListenerLoadingBar();
7257
7918
  }
7258
7919
  get parameters() {
@@ -7271,18 +7932,31 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7271
7932
  return this._resourceID;
7272
7933
  }
7273
7934
  get auth() {
7274
- return new Promise((resolve, reject) => {
7275
- if (this._auth) {
7276
- resolve(this._auth);
7277
- }
7278
- else {
7279
- this.authFetcher.getData(this._resourceID).then((authList) => {
7280
- this._auth = authList;
7281
- resolve(authList);
7282
- }).catch(error => reject(error));
7283
- }
7284
- });
7935
+ if (this._auth) {
7936
+ return Promise.resolve(this._auth);
7937
+ }
7938
+ else {
7939
+ return new Promise((resolve, reject) => {
7940
+ const waitingAuth = this._authPromises.length > 0;
7941
+ this._authPromises.push(new PendingPromise(resolve, reject));
7942
+ if (!waitingAuth) {
7943
+ this.authFetcher.getData(this.resourceID).then((authList) => {
7944
+ this._auth = authList;
7945
+ while (this._authPromises.length > 0) {
7946
+ this._authPromises.pop().resolve(this._auth);
7947
+ }
7948
+ }).catch(error => {
7949
+ while (this._authPromises.length > 0) {
7950
+ this._authPromises.pop().reject(error);
7951
+ }
7952
+ });
7953
+ }
7954
+ });
7955
+ }
7285
7956
  }
7957
+ /**
7958
+ * Caso o usuário logado seja o SUP.
7959
+ */
7286
7960
  async isUserSup() {
7287
7961
  return new Promise((resolve, reject) => {
7288
7962
  this.auth.then((authorization) => {
@@ -7292,6 +7966,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7292
7966
  });
7293
7967
  });
7294
7968
  }
7969
+ /**
7970
+ * Se o usuário logado tem permissão pra determinada ação.
7971
+ */
7295
7972
  async hasAccess(access) {
7296
7973
  return new Promise((resolve, reject) => {
7297
7974
  this.auth.then((authorization) => {
@@ -7301,6 +7978,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7301
7978
  });
7302
7979
  });
7303
7980
  }
7981
+ /**
7982
+ * Retorna todos os acessos do usuário logado.
7983
+ */
7304
7984
  async getAllAccess() {
7305
7985
  return new Promise((resolve, reject) => {
7306
7986
  this.auth.then((authorization) => {
@@ -7315,34 +7995,54 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7315
7995
  });
7316
7996
  });
7317
7997
  }
7318
- async getAuthList(_auth) {
7319
- return await (new MGEAuthorization()).parseFromJSON(_auth);
7320
- }
7998
+ /**
7999
+ * Retorna o valor de um parâmetro do tipo string.
8000
+ */
7321
8001
  async getStringParam(name) {
7322
8002
  return this.parameters.asString(name, this.resourceID);
7323
8003
  }
8004
+ /**
8005
+ * Retorna o valor de um parâmetro do tipo Inteiro.
8006
+ */
7324
8007
  async getIntParam(name) {
7325
8008
  return this.parameters.asInteger(name, this.resourceID);
7326
8009
  }
8010
+ /**
8011
+ * Retorna o valor de um parâmetro do tipo Decimal.
8012
+ */
7327
8013
  async getFloatParam(name) {
7328
8014
  return this.parameters.asFloat(name, this.resourceID);
7329
8015
  }
8016
+ /**
8017
+ * Retorna o valor de um parâmetro do tipo booleano.
8018
+ */
7330
8019
  async getBooleanParam(name) {
7331
8020
  return this.parameters.asBoolean(name, this.resourceID);
7332
8021
  }
8022
+ /**
8023
+ * Retorna o valor de um parâmetro do tipo data.
8024
+ */
7333
8025
  async getDateParam(name) {
7334
8026
  return this.parameters.asDate(name, this.resourceID);
7335
8027
  }
8028
+ /**
8029
+ * Mostra o conteúdo passado em um Popup
8030
+ */
7336
8031
  async showPopUp(content) {
8032
+ this.clearPopUpContent();
7337
8033
  this._popUp.appendChild(content);
7338
- this._popUp["opened"] = true;
8034
+ this._popUp.opened = true;
7339
8035
  }
8036
+ /**
8037
+ * Fecha o popup, liberando o conteúdo.
8038
+ */
7340
8039
  async closePopUp() {
7341
- Array.from(this._popUp.children).forEach(c => {
7342
- this._popUp.removeChild(c);
7343
- });
7344
- this._popUp["opened"] = false;
8040
+ this.clearPopUpContent();
8041
+ this._popUp.opened = false;
7345
8042
  }
8043
+ /**
8044
+ * Verifica se a licença do cliente tem determinado opcional (produto)
8045
+ */
7346
8046
  async temOpcional(opcional) {
7347
8047
  const opts = opcional.split(",");
7348
8048
  return new Promise((resolve, reject) => {
@@ -7366,6 +8066,10 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7366
8066
  });
7367
8067
  });
7368
8068
  }
8069
+ /**
8070
+ * Retorna a configuração de um recurso por service broker
8071
+ * Veja também o método "loadConfig"
8072
+ */
7369
8073
  async getConfig(key) {
7370
8074
  let payload = {
7371
8075
  "serviceName": "SystemUtilsSP.getConf",
@@ -7383,6 +8087,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7383
8087
  .catch(error => reject(error));
7384
8088
  });
7385
8089
  }
8090
+ /**
8091
+ * Salva a configuração de determinado recurso.
8092
+ */
7386
8093
  async saveConfig(key, data) {
7387
8094
  let payload = {
7388
8095
  "serviceName": "SystemUtilsSP.saveConf",
@@ -7401,42 +8108,146 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7401
8108
  .catch(error => reject(error));
7402
8109
  });
7403
8110
  }
8111
+ /**
8112
+ * Acessa informações de contexto "empurrados" na abertura da tela
8113
+ */
7404
8114
  async getAttributeFromHTMLWrapper(attribName) {
7405
8115
  return Promise.resolve(window[attribName]);
7406
8116
  }
8117
+ /**
8118
+ * Abre determinada tela, repassando pkObject
8119
+ */
7407
8120
  async openApp(resourceId, pkObject) {
7408
8121
  Workspace.openAppActivity(resourceId, pkObject);
7409
8122
  }
7410
- async createDataunit(entityName) {
7411
- return new Promise(resolve => {
7412
- const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
7413
- dataUnit.loadMetadata().then(() => resolve(dataUnit));
8123
+ getDuPromissesStack(dataUnitName) {
8124
+ let stack;
8125
+ if (dataUnitName) {
8126
+ stack = this._duPromises.get(dataUnitName);
8127
+ if (!stack) {
8128
+ stack = [];
8129
+ this._duPromises.set(dataUnitName, stack);
8130
+ }
8131
+ }
8132
+ return stack || [];
8133
+ }
8134
+ /**
8135
+ * Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
8136
+ * passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado
8137
+ */
8138
+ async createDataunit(entityName, dataUnitName) {
8139
+ return new Promise((resolve, reject) => {
8140
+ const duPromisses = this.getDuPromissesStack(dataUnitName);
8141
+ const waitingDu = duPromisses.length > 0;
8142
+ duPromisses.push(new PendingPromise(resolve, reject));
8143
+ if (!waitingDu) {
8144
+ const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
8145
+ dataUnit.loadMetadata().then(() => {
8146
+ if (dataUnitName) {
8147
+ this._duCache.set(dataUnitName, dataUnit);
8148
+ }
8149
+ while (duPromisses.length > 0) {
8150
+ duPromisses.pop().resolve(dataUnit);
8151
+ }
8152
+ }).catch(reason => {
8153
+ while (duPromisses.length > 0) {
8154
+ duPromisses.pop().reject(reason);
8155
+ }
8156
+ });
8157
+ }
8158
+ });
8159
+ }
8160
+ /**
8161
+ * Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
8162
+ */
8163
+ async getDataUnit(entityName, dataUnitName) {
8164
+ return new Promise((resolve, reject) => {
8165
+ const dataUnit = this._duCache.get(dataUnitName);
8166
+ if (dataUnit) {
8167
+ resolve(dataUnit);
8168
+ }
8169
+ else {
8170
+ this.createDataunit(entityName, dataUnitName).then(dataUnit => {
8171
+ resolve(dataUnit);
8172
+ }).catch(reason => reject(reason));
8173
+ }
7414
8174
  });
7415
8175
  }
8176
+ /**
8177
+ * Retorna o resourceID da tela em questão.
8178
+ */
7416
8179
  async getResourceID() {
7417
8180
  return Promise.resolve(this.resourceID);
7418
8181
  }
8182
+ /**
8183
+ * Mostra o diálogo de alerta de acordo com os parâmetros passados.
8184
+ */
7419
8185
  async alert(title, message, icon, options) {
7420
8186
  return ApplicationUtils.alert(title, message, icon, options);
7421
8187
  }
8188
+ /**
8189
+ * Mostra o diálogo de erro de acordo com os parâmetros passados.
8190
+ */
7422
8191
  async error(title, message, icon, options) {
7423
8192
  return ApplicationUtils.error(title, message, icon, options);
7424
8193
  }
7425
- async confirm(title, message, icon, critical, options) {
7426
- return ApplicationUtils.confirm(title, message, icon, critical, options);
8194
+ /**
8195
+ * Mostra o diálogo de sucesso de acordo com os parâmetros passados.
8196
+ */
8197
+ async success(title, message, icon, options) {
8198
+ return ApplicationUtils.success(title, message, icon, options);
8199
+ }
8200
+ /**
8201
+ * Exibe um diálogo de mensagem comum
8202
+ */
8203
+ async message(title, message, icon, options) {
8204
+ return ApplicationUtils.message(title, message, icon, options);
7427
8205
  }
8206
+ /**
8207
+ * Exibe um diálogo de confirmação
8208
+ */
8209
+ async confirm(title, message, icon, dialogType, options) {
8210
+ return ApplicationUtils.confirm(title, message, icon, dialogType, options);
8211
+ }
8212
+ /**
8213
+ * Mostra uma informação efêmera (de segundo plano).
8214
+ */
7428
8215
  async info(message, options) {
7429
8216
  return ApplicationUtils.info(message, options);
7430
8217
  }
8218
+ /**
8219
+ * Busca a configuração de formulário.
8220
+ */
7431
8221
  async loadFormConfig(name) {
7432
8222
  return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
7433
8223
  }
7434
- async loadGridConfig() {
7435
- return this.gridConfigFetcher.getConfig(this.resourceID);
8224
+ /**
8225
+ * Busca a configuração de grade.
8226
+ */
8227
+ async loadGridConfig(name) {
8228
+ return this.gridConfigFetcher.getConfig(name, this.resourceID);
8229
+ }
8230
+ /**
8231
+ * Busca os totalizadores da grade.
8232
+ */
8233
+ async loadTotals(name, resourceID, filters) {
8234
+ return this.totalsFetcher.fetchTotals(name, resourceID, filters);
7436
8235
  }
8236
+ /**
8237
+ * Salva a configuração de grade.
8238
+ */
7437
8239
  async saveGridConfig(config) {
7438
8240
  return this.gridConfigFetcher.saveConfig(config, this.resourceID);
7439
8241
  }
8242
+ /**
8243
+ * Obtém as configurações da barra de filtros
8244
+ */
8245
+ async getFilterBarConfig() {
8246
+ return this.filterBarConfigFetcher.getConfig(this.resourceID);
8247
+ }
8248
+ async getAuthList(_auth) {
8249
+ return await (new MGEAuthorization()).parseFromJSON(_auth);
8250
+ }
7440
8251
  get urlParams() {
7441
8252
  if (!this._urlParams) {
7442
8253
  this._urlParams = UrlUtils.getQueryParams(location.search);
@@ -7461,6 +8272,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7461
8272
  }
7462
8273
  return this._gridConfigFetcher;
7463
8274
  }
8275
+ get totalsFetcher() {
8276
+ if (!this._totalsFetcher) {
8277
+ this._totalsFetcher = new TotalsFetcher();
8278
+ }
8279
+ return this._totalsFetcher;
8280
+ }
7464
8281
  get pesquisaFetcher() {
7465
8282
  if (!this._pesquisaFetcher) {
7466
8283
  this._pesquisaFetcher = new PesquisaFetcher();
@@ -7473,9 +8290,17 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7473
8290
  }
7474
8291
  return this._authFetcher;
7475
8292
  }
8293
+ get filterBarConfigFetcher() {
8294
+ if (!this._filterBarConfigFetcher) {
8295
+ this._filterBarConfigFetcher = new FilterBarConfigFetcher();
8296
+ }
8297
+ return this._filterBarConfigFetcher;
8298
+ }
7476
8299
  async executeSearch(searchArgument, fieldName, dataUnit) {
7477
8300
  const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
7478
- if (!descriptor) ;
8301
+ if (!descriptor) {
8302
+ //TODO: Implementar mensagem de erro
8303
+ }
7479
8304
  else {
7480
8305
  const { mode, argument } = searchArgument;
7481
8306
  const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
@@ -7507,23 +8332,27 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7507
8332
  }
7508
8333
  }
7509
8334
  });
7510
- if (mode === "ADVANCED") {
7511
- return new Promise(accept => {
7512
- const pesquisaContent = document.createElement("snk-pesquisa");
7513
- pesquisaContent.argument = argument;
7514
- pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
7515
- pesquisaContent.selectItem = (option) => {
7516
- accept(option);
7517
- this.cleanPopUpTitle();
7518
- this.closePopUp();
7519
- };
7520
- this.setPopUpTitle(DESCRIPTIONENTITY);
7521
- this.showPopUp(pesquisaContent);
7522
- });
7523
- }
7524
- else {
7525
- return this.pesquisaFetcher.loadSearchOptions(ENTITYNAME, argument, criteria, searchOptions);
7526
- }
8335
+ return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
8336
+ }
8337
+ }
8338
+ async executePreparedSearch(mode, argument, options) {
8339
+ const { entity, entityDescription, criteria, searchOptions } = options;
8340
+ if (mode === "ADVANCED") {
8341
+ return new Promise(accept => {
8342
+ const pesquisaContent = document.createElement("snk-pesquisa");
8343
+ pesquisaContent.argument = argument;
8344
+ pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
8345
+ pesquisaContent.selectItem = (option) => {
8346
+ accept(option);
8347
+ this.clearPopUpTitle();
8348
+ this.closePopUp();
8349
+ };
8350
+ this.setPopUpTitle(entityDescription);
8351
+ this.showPopUp(pesquisaContent);
8352
+ });
8353
+ }
8354
+ else {
8355
+ return this.pesquisaFetcher.loadSearchOptions(entity, argument, criteria, searchOptions);
7527
8356
  }
7528
8357
  }
7529
8358
  async isDebugMode() {
@@ -7531,14 +8360,22 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7531
8360
  accept(window['isDebugMode']);
7532
8361
  });
7533
8362
  }
7534
- cleanPopUpTitle() {
7535
- this._popUp['ezTitle'] = "";
8363
+ clearPopUpContent() {
8364
+ if (this._popUp) {
8365
+ Array.from(this._popUp.children).forEach(c => {
8366
+ this._popUp.removeChild(c);
8367
+ });
8368
+ }
8369
+ }
8370
+ clearPopUpTitle() {
8371
+ this._popUp.ezTitle = "";
7536
8372
  }
7537
8373
  setPopUpTitle(title) {
7538
- this._popUp['ezTitle'] = title;
8374
+ this._popUp.ezTitle = title;
7539
8375
  }
7540
8376
  componentWillLoad() {
7541
8377
  this._errorHandler = new SnkErrorHandler(this);
8378
+ this.messagesBuilder = new SnkMessageBuilder();
7542
8379
  ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
7543
8380
  ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
7544
8381
  return this.executeSearch(searchArgument, fieldName, dataUnit);
@@ -7547,6 +8384,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7547
8384
  ErrorTracking.init();
7548
8385
  }
7549
8386
  connectedCallback() {
8387
+ ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
7550
8388
  DataFetcher.addRequestListener(this._requestListener);
7551
8389
  }
7552
8390
  disconnectedCallback() {
@@ -7563,6 +8401,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7563
8401
  }
7564
8402
  static get style() { return snkApplicationCss; }
7565
8403
  }, [2, "snk-application", {
8404
+ "messagesBuilder": [1040],
7566
8405
  "isUserSup": [64],
7567
8406
  "hasAccess": [64],
7568
8407
  "getAllAccess": [64],
@@ -7579,31 +8418,44 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7579
8418
  "getAttributeFromHTMLWrapper": [64],
7580
8419
  "openApp": [64],
7581
8420
  "createDataunit": [64],
8421
+ "getDataUnit": [64],
7582
8422
  "getResourceID": [64],
7583
8423
  "alert": [64],
7584
8424
  "error": [64],
8425
+ "success": [64],
8426
+ "message": [64],
7585
8427
  "confirm": [64],
7586
8428
  "info": [64],
7587
8429
  "loadFormConfig": [64],
7588
8430
  "loadGridConfig": [64],
8431
+ "loadTotals": [64],
7589
8432
  "saveGridConfig": [64],
8433
+ "getFilterBarConfig": [64],
7590
8434
  "executeSearch": [64],
8435
+ "executePreparedSearch": [64],
7591
8436
  "isDebugMode": [64]
7592
8437
  }]);
7593
8438
  class RequestListenerLoadingBar {
7594
8439
  constructor() {
7595
8440
  this._debounceTime = 1000;
8441
+ this._ignoredNameTypes = ["totals"];
7596
8442
  this._countRequest = 0;
7597
8443
  }
7598
- onRequestStart() {
7599
- this.loadingBar.show();
8444
+ onRequestStart(param) {
8445
+ if (this.isIgnoreLoadingOnRequest(param)) {
8446
+ return;
8447
+ }
7600
8448
  this._countRequest++;
8449
+ this.loadingBar.show();
7601
8450
  if (this._timerLoading) {
7602
8451
  clearTimeout(this._timerLoading);
7603
8452
  }
7604
8453
  }
7605
8454
  ;
7606
- onRequestEnd() {
8455
+ onRequestEnd(param) {
8456
+ if (this.isIgnoreLoadingOnRequest(param)) {
8457
+ return;
8458
+ }
7607
8459
  this._countRequest--;
7608
8460
  this._timerLoading = setTimeout(() => {
7609
8461
  if (this._countRequest <= 0) {
@@ -7612,6 +8464,25 @@ class RequestListenerLoadingBar {
7612
8464
  }, this._debounceTime);
7613
8465
  }
7614
8466
  ;
8467
+ isIgnoreLoadingOnRequest(param) {
8468
+ var _a;
8469
+ if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
8470
+ const { name } = param.requestBody[0].variables;
8471
+ if (name) {
8472
+ const nameParts = name.split(":");
8473
+ const nameType = nameParts[0];
8474
+ return this._ignoredNameTypes.indexOf(nameType) >= 0;
8475
+ }
8476
+ }
8477
+ return false;
8478
+ }
8479
+ ;
8480
+ }
8481
+ class PendingPromise {
8482
+ constructor(resolve, reject) {
8483
+ this.resolve = resolve;
8484
+ this.reject = reject;
8485
+ }
7615
8486
  }
7616
8487
  function defineCustomElement() {
7617
8488
  if (typeof customElements === "undefined") {