@sankhyalabs/sankhyablocks 8.2.0-dev.1 → 8.2.0

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 (221) hide show
  1. package/dist/cjs/{ConfigStorage-12397f18.js → ConfigStorage-e9d7fa82.js} +51 -163
  2. package/dist/cjs/{DataFetcher-f2da1f79.js → DataFetcher-39b63a1e.js} +29 -67
  3. package/dist/cjs/{SnkFormConfigManager-13f79e37.js → SnkFormConfigManager-2f8eccd9.js} +21 -19
  4. package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-15a7cc88.js} +1 -1
  5. package/dist/cjs/filter-bar-config-fetcher-24548cec.js +155 -0
  6. package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-ab3ce222.js} +3 -66
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-96c042aa.js} +1 -1
  9. package/dist/cjs/resource-fetcher-64102551.js +68 -0
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/snk-actions-button.cjs.entry.js +11 -18
  12. package/dist/cjs/snk-application.cjs.entry.js +73 -51
  13. package/dist/cjs/snk-attach.cjs.entry.js +13 -7
  14. package/dist/cjs/snk-configurator.cjs.entry.js +1 -2
  15. package/dist/cjs/snk-crud.cjs.entry.js +9 -28
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  17. package/dist/cjs/{snk-data-unit-80a00ae4.js → snk-data-unit-d5109a08.js} +6 -8
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +25 -18
  20. package/dist/cjs/snk-entity-list.cjs.entry.js +4 -0
  21. package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -14
  22. package/dist/cjs/snk-filter-detail.cjs.entry.js +15 -1
  23. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +19 -5
  24. package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
  25. package/dist/cjs/snk-form-view.cjs.entry.js +1 -6
  26. package/dist/cjs/snk-form.cjs.entry.js +8 -12
  27. package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
  28. package/dist/cjs/snk-grid.cjs.entry.js +20 -20
  29. package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-8c9693aa.js} +9 -18
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +16 -13
  32. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +80 -22
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +1 -2
  35. package/dist/collection/components/snk-actions-button/actions/index.js +4 -3
  36. package/dist/collection/components/snk-actions-button/snk-actions-button.js +4 -8
  37. package/dist/collection/components/snk-application/snk-application.js +65 -60
  38. package/dist/collection/components/snk-configurator/snk-configurator.js +1 -19
  39. package/dist/collection/components/snk-crud/snk-crud.js +8 -63
  40. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +15 -65
  41. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +1 -27
  42. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +30 -66
  43. package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -42
  44. package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -0
  45. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +12 -2
  46. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  47. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +16 -21
  48. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -28
  49. package/dist/collection/components/snk-form/SnkFormConfigManager.js +19 -17
  50. package/dist/collection/components/snk-form/snk-form.js +2 -46
  51. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +15 -5
  52. package/dist/collection/components/snk-grid/snk-grid.js +16 -110
  53. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +1 -19
  54. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +12 -28
  55. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +9 -43
  56. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -19
  57. package/dist/collection/lib/configs/ConfigStorage.js +44 -33
  58. package/dist/collection/lib/dataUnit/InMemoryLoader.js +59 -2
  59. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -38
  60. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +24 -0
  61. package/dist/collection/lib/index.js +0 -10
  62. package/dist/collection/lib/utils/urlutils.js +0 -29
  63. package/dist/components/ConfigStorage.js +48 -161
  64. package/dist/components/DataFetcher.js +29 -67
  65. package/dist/components/SnkFormConfigManager.js +19 -17
  66. package/dist/components/filter-bar-config-fetcher.js +153 -0
  67. package/dist/components/form-config-fetcher.js +2 -64
  68. package/dist/components/resource-fetcher.js +66 -0
  69. package/dist/components/snk-actions-button2.js +9 -23
  70. package/dist/components/snk-application2.js +154 -132
  71. package/dist/components/snk-attach2.js +8 -1
  72. package/dist/components/snk-configurator2.js +1 -3
  73. package/dist/components/snk-crud.js +7 -29
  74. package/dist/components/snk-data-unit2.js +6 -10
  75. package/dist/components/snk-detail-view2.js +23 -28
  76. package/dist/components/snk-entity-list.js +4 -0
  77. package/dist/components/snk-filter-bar2.js +12 -12
  78. package/dist/components/snk-filter-detail2.js +12 -2
  79. package/dist/components/snk-filter-modal-item2.js +16 -5
  80. package/dist/components/snk-form-config2.js +15 -5
  81. package/dist/components/snk-form-view2.js +1 -6
  82. package/dist/components/snk-form.js +2 -9
  83. package/dist/components/snk-grid-config2.js +2 -4
  84. package/dist/components/snk-grid2.js +16 -23
  85. package/dist/components/snk-personalized-filter2.js +11 -11
  86. package/dist/components/snk-simple-crud2.js +69 -12
  87. package/dist/components/snk-taskbar2.js +1 -3
  88. package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-1090289a.js} +49 -162
  89. package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-a4ed43e7.js} +29 -67
  90. package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-de537eca.js} +21 -19
  91. package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-8d0bfa4a.js} +1 -1
  92. package/dist/esm/filter-bar-config-fetcher-2417b8cf.js +153 -0
  93. package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-4065db9a.js} +3 -65
  94. package/dist/esm/loader.js +1 -1
  95. package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-7460b876.js} +1 -1
  96. package/dist/esm/resource-fetcher-45a70066.js +66 -0
  97. package/dist/esm/sankhyablocks.js +1 -1
  98. package/dist/esm/snk-actions-button.entry.js +11 -18
  99. package/dist/esm/snk-application.entry.js +71 -49
  100. package/dist/esm/snk-attach.entry.js +9 -3
  101. package/dist/esm/snk-configurator.entry.js +1 -2
  102. package/dist/esm/snk-crud.entry.js +9 -28
  103. package/dist/esm/snk-data-exporter.entry.js +2 -2
  104. package/dist/esm/{snk-data-unit-3ab57d1a.js → snk-data-unit-3a0bbfcb.js} +6 -8
  105. package/dist/esm/snk-data-unit.entry.js +1 -1
  106. package/dist/esm/snk-detail-view.entry.js +25 -18
  107. package/dist/esm/snk-entity-list.entry.js +4 -0
  108. package/dist/esm/snk-filter-bar.entry.js +17 -14
  109. package/dist/esm/snk-filter-detail.entry.js +16 -2
  110. package/dist/esm/snk-filter-modal-item.entry.js +20 -6
  111. package/dist/esm/snk-form-config.entry.js +18 -7
  112. package/dist/esm/snk-form-view.entry.js +1 -6
  113. package/dist/esm/snk-form.entry.js +8 -12
  114. package/dist/esm/snk-grid-config.entry.js +6 -5
  115. package/dist/esm/snk-grid.entry.js +20 -20
  116. package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-a6d39c18.js} +9 -18
  117. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  118. package/dist/esm/snk-personalized-filter.entry.js +16 -13
  119. package/dist/esm/snk-print-selector.entry.js +1 -1
  120. package/dist/esm/snk-simple-crud.entry.js +71 -13
  121. package/dist/esm/snk-taskbar.entry.js +1 -2
  122. package/dist/sankhyablocks/p-0fb83448.js +1 -0
  123. package/dist/sankhyablocks/p-15aba6fb.entry.js +11 -0
  124. package/dist/sankhyablocks/p-216f081a.entry.js +1 -0
  125. package/dist/sankhyablocks/p-21e7c08e.entry.js +1 -0
  126. package/dist/sankhyablocks/p-2861d44f.entry.js +1 -0
  127. package/dist/sankhyablocks/p-2d883fe9.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-d13c00b6.entry.js → p-3d6f91c2.entry.js} +1 -1
  129. package/dist/sankhyablocks/{p-f8e6b97e.js → p-44e66c8d.js} +1 -1
  130. package/dist/sankhyablocks/p-4514fc6a.entry.js +1 -0
  131. package/dist/sankhyablocks/p-4f4cd005.entry.js +1 -0
  132. package/dist/sankhyablocks/p-50c13cc8.entry.js +1 -0
  133. package/dist/sankhyablocks/p-52c6b2e7.js +1 -0
  134. package/dist/sankhyablocks/p-5994af77.js +56 -0
  135. package/dist/sankhyablocks/p-5df17074.js +1 -0
  136. package/dist/sankhyablocks/p-6bb904bb.entry.js +1 -0
  137. package/dist/sankhyablocks/p-6f0795c8.entry.js +1 -0
  138. package/dist/sankhyablocks/p-7588f006.entry.js +1 -0
  139. package/dist/sankhyablocks/p-847e6c20.js +17 -0
  140. package/dist/sankhyablocks/p-9471cbc9.entry.js +1 -0
  141. package/dist/sankhyablocks/{p-14eac6fe.js → p-9d18017a.js} +1 -1
  142. package/dist/sankhyablocks/p-9edad923.js +1 -0
  143. package/dist/sankhyablocks/p-a42dd503.entry.js +1 -0
  144. package/dist/sankhyablocks/{p-2d333d22.js → p-b978da60.js} +1 -1
  145. package/dist/sankhyablocks/p-befbc9ee.entry.js +1 -0
  146. package/dist/sankhyablocks/p-c6380ea2.entry.js +1 -0
  147. package/dist/sankhyablocks/{p-03bb1aea.entry.js → p-c6feb995.entry.js} +1 -1
  148. package/dist/sankhyablocks/p-c945318c.entry.js +1 -0
  149. package/dist/sankhyablocks/p-ccbfb1cf.entry.js +1 -0
  150. package/dist/sankhyablocks/p-d7c7a289.entry.js +1 -0
  151. package/dist/sankhyablocks/p-de69b4b0.entry.js +1 -0
  152. package/dist/sankhyablocks/p-f3b7b69e.js +10 -0
  153. package/dist/sankhyablocks/p-f7eded3a.entry.js +1 -0
  154. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  155. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -2
  156. package/dist/types/components/snk-application/snk-application.d.ts +13 -8
  157. package/dist/types/components/snk-configurator/snk-configurator.d.ts +0 -4
  158. package/dist/types/components/snk-crud/snk-crud.d.ts +0 -10
  159. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -13
  160. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +0 -5
  161. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +2 -13
  162. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -8
  163. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +4 -0
  164. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +3 -0
  165. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  166. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +4 -5
  167. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
  168. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +4 -5
  169. package/dist/types/components/snk-form/snk-form.d.ts +1 -9
  170. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +2 -0
  171. package/dist/types/components/snk-grid/snk-grid.d.ts +1 -18
  172. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +0 -4
  173. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +1 -5
  174. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -8
  175. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
  176. package/dist/types/components.d.ts +21 -189
  177. package/dist/types/lib/configs/ConfigStorage.d.ts +13 -11
  178. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +7 -0
  179. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  180. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +1 -0
  181. package/dist/types/lib/index.d.ts +0 -11
  182. package/dist/types/lib/utils/urlutils.d.ts +0 -14
  183. package/package.json +2 -2
  184. package/dist/cjs/ISave-d68ce3cd.js +0 -8
  185. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +0 -12
  186. package/dist/cjs/auth-fetcher-319a4cb2.js +0 -34
  187. package/dist/collection/lib/resourceid/ResourceIDUtils.js +0 -7
  188. package/dist/components/ResourceIDUtils.js +0 -10
  189. package/dist/components/auth-fetcher.js +0 -32
  190. package/dist/esm/ISave-4412b20c.js +0 -8
  191. package/dist/esm/ResourceIDUtils-a114189a.js +0 -10
  192. package/dist/esm/auth-fetcher-6d9664b7.js +0 -32
  193. package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
  194. package/dist/sankhyablocks/p-05dbc70e.entry.js +0 -1
  195. package/dist/sankhyablocks/p-41e897f1.js +0 -56
  196. package/dist/sankhyablocks/p-48a40939.js +0 -1
  197. package/dist/sankhyablocks/p-611aa624.entry.js +0 -1
  198. package/dist/sankhyablocks/p-66bb8c20.entry.js +0 -1
  199. package/dist/sankhyablocks/p-688dcb4c.js +0 -1
  200. package/dist/sankhyablocks/p-6f154396.entry.js +0 -1
  201. package/dist/sankhyablocks/p-787071a8.js +0 -1
  202. package/dist/sankhyablocks/p-8481bb59.entry.js +0 -1
  203. package/dist/sankhyablocks/p-8818d8f6.entry.js +0 -1
  204. package/dist/sankhyablocks/p-93f6ca04.entry.js +0 -1
  205. package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
  206. package/dist/sankhyablocks/p-9e7d65a4.js +0 -1
  207. package/dist/sankhyablocks/p-a52a6c9d.js +0 -26
  208. package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
  209. package/dist/sankhyablocks/p-c555075c.entry.js +0 -1
  210. package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
  211. package/dist/sankhyablocks/p-d53a9169.entry.js +0 -1
  212. package/dist/sankhyablocks/p-d7638f45.entry.js +0 -11
  213. package/dist/sankhyablocks/p-e086cc2a.entry.js +0 -1
  214. package/dist/sankhyablocks/p-e64f3e17.entry.js +0 -1
  215. package/dist/sankhyablocks/p-ed41b38c.js +0 -1
  216. package/dist/sankhyablocks/p-ed705cbb.entry.js +0 -1
  217. package/dist/sankhyablocks/p-efc10705.entry.js +0 -1
  218. package/dist/sankhyablocks/p-f74fe358.js +0 -1
  219. package/dist/sankhyablocks/p-f91e0c5d.entry.js +0 -1
  220. package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
  221. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +0 -3
@@ -6434,35 +6434,6 @@ class UrlUtils {
6434
6434
  return window['mock_url'];
6435
6435
  return `${location.protocol}//${location.hostname}${location.port ? ":" + location.port : ""}`;
6436
6436
  }
6437
- /**
6438
- * Extrai da URL o parâmetro que contém o resourceId da tela desejada.
6439
- *
6440
- */
6441
- static getResourceIdFromUrlToken(url) {
6442
- try {
6443
- const parts = url.split('/');
6444
- const encodedValue = parts[1];
6445
- return atob(encodedValue);
6446
- }
6447
- catch (error) {
6448
- throw new Error('Erro ao obter resourceId:' + error);
6449
- }
6450
- }
6451
- /**
6452
- * Extrai da URL o parâmetro que contém o o objeto com a PK do registro específico.
6453
- *
6454
- */
6455
- static getPkObjectFromUrlToken(url) {
6456
- try {
6457
- const parts = url.split('/');
6458
- const encodedObjectPart = parts[parts.length - 2];
6459
- const decodedObjectPart = atob(encodedObjectPart);
6460
- return JSON.parse(decodedObjectPart);
6461
- }
6462
- catch (error) {
6463
- throw new Error('Erro ao obter a PK do objeto:' + error);
6464
- }
6465
- }
6466
6437
  }
6467
6438
 
6468
6439
  class ServiceBrokerRecaller {
@@ -6709,7 +6680,6 @@ class AppletImpressao {
6709
6680
  class DataFetcher {
6710
6681
  constructor() {
6711
6682
  this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
6712
- this.ready = true;
6713
6683
  this.watingRequestsById = new Map();
6714
6684
  }
6715
6685
  static get() {
@@ -6720,9 +6690,6 @@ class DataFetcher {
6720
6690
  DataFetcher.instance.resume();
6721
6691
  }
6722
6692
  else {
6723
- if (ApplicationContext.getContextValue("__SNK__APPLICATION__LOADING__") === true) {
6724
- DataFetcher.instance.pause();
6725
- }
6726
6693
  application.addEventListener('applicationLoading', () => DataFetcher.instance.pause());
6727
6694
  application.addEventListener('applicationLoaded', () => DataFetcher.instance.resume());
6728
6695
  }
@@ -6781,10 +6748,6 @@ class DataFetcher {
6781
6748
  }
6782
6749
  async callGraphQL(req) {
6783
6750
  var _a;
6784
- if (this.ready) {
6785
- this.pause();
6786
- window.requestAnimationFrame(() => this.resume());
6787
- }
6788
6751
  const reqKey = this.getReqKey(req);
6789
6752
  req.queryID = reqKey;
6790
6753
  req.values.queryID = reqKey;
@@ -6814,7 +6777,7 @@ class DataFetcher {
6814
6777
  if (!this.watingRequestsById.has(reqKey)) {
6815
6778
  this.watingRequestsById.set(reqKey, new WaitingRequest(req));
6816
6779
  }
6817
- return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
6780
+ return (_a = this.getWatingRequest(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
6818
6781
  }
6819
6782
  }
6820
6783
  resolveURL() {
@@ -6962,43 +6925,42 @@ class DataFetcher {
6962
6925
  getQueryTemplate(re) {
6963
6926
  return (re.query || "").replaceAll("$queryAlias$", re.queryID);
6964
6927
  }
6928
+ getWatingRequest(reqID) {
6929
+ return this.watingRequestsById.get(reqID);
6930
+ }
6965
6931
  pause() {
6966
6932
  this.ready = false;
6967
6933
  }
6968
6934
  async resume() {
6969
6935
  this.ready = true;
6970
6936
  if (this.watingRequestsById.size > 0) {
6971
- const waitinRequests = this.watingRequestsById;
6972
- this.watingRequestsById = new Map();
6973
- this.executePendingRequest(waitinRequests);
6974
- }
6975
- }
6976
- async executePendingRequest(watingRequestsById) {
6977
- const requestsBatch = [];
6978
- watingRequestsById.forEach(async (waitingReq) => {
6979
- let query = this.getQueryTemplate(waitingReq.request);
6980
- requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
6981
- });
6982
- let res = undefined;
6983
- let dataResponse = [];
6984
- let errorsResponse = [];
6985
- res = await this.fecthGrapql(requestsBatch);
6986
- dataResponse = res.data;
6987
- errorsResponse = res.errors;
6988
- //Reject promises with errors from query
6989
- errorsResponse.forEach((errorResponse) => {
6990
- Object.entries(errorResponse).forEach(([_key, val]) => {
6991
- var _a;
6992
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6937
+ const requestsBatch = [];
6938
+ this.watingRequestsById.forEach(async (waitingReq) => {
6939
+ let query = this.getQueryTemplate(waitingReq.request);
6940
+ requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
6993
6941
  });
6994
- });
6995
- //Resolve promises with data from query
6996
- dataResponse.forEach((data) => {
6997
- Object.entries(data).forEach(([key, val]) => {
6998
- var _a;
6999
- (((_a = watingRequestsById.get(key)) === null || _a === void 0 ? void 0 : _a.resolve) || Promise.resolve)(val);
6942
+ let res = undefined;
6943
+ let dataResponse = [];
6944
+ let errorsResponse = [];
6945
+ res = await this.fecthGrapql(requestsBatch);
6946
+ dataResponse = res.data;
6947
+ errorsResponse = res.errors;
6948
+ //Reject promises with errors from query
6949
+ errorsResponse.forEach((errorResponse) => {
6950
+ Object.entries(errorResponse).forEach(([_key, val]) => {
6951
+ var _a;
6952
+ (((_a = this.getWatingRequest(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6953
+ });
7000
6954
  });
7001
- });
6955
+ //Resolve promises with data from query
6956
+ dataResponse.forEach((data) => {
6957
+ Object.entries(data).forEach(([key, val]) => {
6958
+ var _a;
6959
+ (((_a = this.getWatingRequest(key)) === null || _a === void 0 ? void 0 : _a.resolve) || Promise.resolve)(val);
6960
+ });
6961
+ });
6962
+ this.watingRequestsById.clear();
6963
+ }
7002
6964
  }
7003
6965
  async fecthGrapql(request) {
7004
6966
  let res = undefined;
@@ -1,29 +1,31 @@
1
- import { C as ConfigStorage } from './ConfigStorage-932ab366.js';
1
+ import { C as ConfigStorage } from './ConfigStorage-1090289a.js';
2
2
  import { ObjectUtils } from '@sankhyalabs/core';
3
- import { F as FormConfigFetcher } from './form-config-fetcher-aaaa79a6.js';
3
+ import { F as FormConfigFetcher } from './form-config-fetcher-4065db9a.js';
4
4
 
5
5
  class SnkFormConfigManager {
6
- constructor(configName, resourceID, onConfigChange) {
7
- this._resourceID = resourceID;
6
+ constructor(configName, onConfigChange) {
8
7
  this._configName = configName;
9
8
  this._onConfigChange = onConfigChange;
10
9
  }
11
10
  async loadConfig() {
12
11
  return new Promise(resolve => {
13
- ConfigStorage.loadFormConfig(this._configName, this._resourceID)
14
- .then((config) => {
15
- this.setConfig(config);
16
- resolve(config);
17
- })
18
- .catch((error) => {
19
- console.warn(error);
12
+ ConfigStorage.get()
13
+ .then((configStorage) => {
14
+ configStorage.loadFormConfig(this._configName)
15
+ .then((config) => {
16
+ this.setConfig(config);
17
+ resolve(config);
18
+ })
19
+ .catch((error) => {
20
+ console.warn(error);
21
+ });
20
22
  });
21
23
  });
22
24
  }
23
25
  saveConfig(config) {
24
26
  const configToSave = ObjectUtils.copy(config);
25
27
  return new Promise(accept => {
26
- ConfigStorage.saveFormConfig(config, this._configName, this._resourceID)
28
+ ConfigStorage.saveFormConfig(config, this._configName)
27
29
  .then((response) => {
28
30
  this.setConfig(Object.assign(Object.assign({}, configToSave), response));
29
31
  accept(Object.assign(Object.assign({}, configToSave), response));
@@ -38,7 +40,7 @@ class SnkFormConfigManager {
38
40
  cardsState.set(cardId, propertyChanged === "fixed" ?
39
41
  this.updateFixSequence(Object.assign(Object.assign({}, currentConfig), { fixed: cardConfig.fixed }), cardsState)
40
42
  : Object.assign(Object.assign({}, currentConfig), { [propertyChanged]: cardConfig[propertyChanged] }));
41
- ConfigStorage.saveCardState(cardsState, this._configName, this._resourceID)
43
+ ConfigStorage.saveCardState(cardsState, this._configName)
42
44
  .then(savedCardConfig => {
43
45
  this._config = Object.assign(Object.assign({}, this._config), { cardsState });
44
46
  resolve(savedCardConfig);
@@ -114,18 +116,18 @@ class SnkFormConfigManager {
114
116
  }
115
117
  return this._formConfigFetcher;
116
118
  }
117
- async fetchUserAvailableConfigs() {
119
+ async fetchUserAvailableConfigs(resourceID) {
118
120
  if (this._configName != undefined) {
119
121
  //FIXME: Precisamos preparar o backend para retornar as configurações disponíveis para details;
120
122
  return Promise.resolve(undefined);
121
123
  }
122
- return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, this._resourceID);
124
+ return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, resourceID);
123
125
  }
124
- async fetchLegacyConfig() {
125
- return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, this._resourceID);
126
+ async fetchLegacyConfig(resourceID) {
127
+ return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, resourceID);
126
128
  }
127
- async fetchDefaultConfig() {
128
- return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
129
+ async fetchDefaultConfig(resourceID) {
130
+ return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, resourceID);
129
131
  }
130
132
  }
131
133
 
@@ -1,5 +1,5 @@
1
1
  import { DataUnit, StringUtils, DataType, DataUnitStorage, ChangeOperation } from '@sankhyalabs/core';
2
- import { d as dist, D as DataFetcher } from './DataFetcher-7e18aa30.js';
2
+ import { d as dist, D as DataFetcher } from './DataFetcher-a4ed43e7.js';
3
3
  import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
4
4
  import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
5
5
 
@@ -0,0 +1,153 @@
1
+ import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
2
+ import { R as ResourceFetcher } from './resource-fetcher-45a70066.js';
3
+
4
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
5
+ var t = {};
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7
+ t[p] = s[p];
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
9
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
10
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
11
+ t[p[i]] = s[p[i]];
12
+ }
13
+ return t;
14
+ };
15
+ function normalizeValue(value, type) {
16
+ if (value == undefined) {
17
+ return value;
18
+ }
19
+ if (value instanceof Date) {
20
+ return value.toISOString();
21
+ }
22
+ if (typeof value === "object") {
23
+ if (value instanceof Array) {
24
+ return value.map(item => {
25
+ if (FilterItemType.MULTI_LIST === type) {
26
+ const values = __rest(item, ["label"]);
27
+ return normalizeValue(values);
28
+ }
29
+ return normalizeValue(item);
30
+ });
31
+ }
32
+ else {
33
+ const normalized = Object.assign({}, value);
34
+ Object.keys(value).forEach(prop => {
35
+ if (value[prop] !== undefined) {
36
+ normalized[prop] = normalizeValue(value[prop], type);
37
+ }
38
+ else {
39
+ delete normalized[prop];
40
+ }
41
+ });
42
+ return normalized;
43
+ }
44
+ }
45
+ return value;
46
+ }
47
+ class FilterBarConfigFetcher extends ResourceFetcher {
48
+ normalize(items) {
49
+ return items.map(item => {
50
+ const { id, value, fixed, visible, type, groupedItems } = item;
51
+ const stateItem = { id };
52
+ if (value) {
53
+ stateItem["value"] = normalizeValue(value, type);
54
+ }
55
+ if (fixed) {
56
+ stateItem["fixed"] = fixed;
57
+ }
58
+ if (groupedItems) {
59
+ if (groupedItems.length === 0) {
60
+ return;
61
+ }
62
+ if (groupedItems.filter(item => item.visible).length > 0) {
63
+ stateItem["visible"] = true;
64
+ }
65
+ stateItem["groupedItems"] = this.normalize(groupedItems);
66
+ }
67
+ else {
68
+ if (visible) {
69
+ stateItem["visible"] = true;
70
+ }
71
+ }
72
+ return stateItem;
73
+ }).filter(item => item != undefined);
74
+ }
75
+ saveConfig(items, resourceID, configName) {
76
+ return this.saveResource(this.normalize(items), this.getPath(resourceID, configName));
77
+ }
78
+ getConfig(resourceID, configName, urlParams) {
79
+ return new Promise((accept, reject) => {
80
+ this.loadResource(this.getPath(resourceID, configName, urlParams))
81
+ .then((configAsString) => {
82
+ let fieldsList;
83
+ if (configAsString) {
84
+ const filterBarConfig = JSON.parse(configAsString);
85
+ fieldsList = this.buildFieldList(filterBarConfig.items);
86
+ }
87
+ accept(fieldsList || []);
88
+ })
89
+ .catch((error) => {
90
+ reject(error);
91
+ });
92
+ });
93
+ }
94
+ saveEntityListConfig(item, resourceID, configName) {
95
+ return new Promise((accept, reject) => {
96
+ this.getConfig(resourceID, configName).then(config => {
97
+ const state = config.map(({ id, value, fixed, visible, type, groupedItems }) => {
98
+ return Object.assign(Object.assign(Object.assign(Object.assign({ id }, (value && { value: normalizeValue(value, type) })), (fixed && { fixed })), (visible && { visible: true })), { groupedItems });
99
+ });
100
+ const index = state.findIndex(({ id }) => id === item.id);
101
+ const newItem = { id: item.id, value: normalizeValue(item.value, item.type), fixed: item.fixed, visible: true };
102
+ if (index > -1) {
103
+ state[index] = newItem;
104
+ }
105
+ else {
106
+ state.push(newItem);
107
+ }
108
+ this.saveResource(state, this.getPath(resourceID, configName)).then(resp => {
109
+ accept(resp);
110
+ }).catch(exception => {
111
+ reject(exception);
112
+ });
113
+ }).catch(exception => {
114
+ reject(exception);
115
+ });
116
+ });
117
+ }
118
+ buildFieldList(items) {
119
+ return items.map(item => {
120
+ var _a, _b;
121
+ if (item.type === FilterItemType.MULTI_LIST) {
122
+ const multiListValue = item.value;
123
+ item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
124
+ }
125
+ return item;
126
+ });
127
+ }
128
+ getPath(resourceID, name, urlParams) {
129
+ let path = `cfg://filter/FilterBarState:${resourceID}`;
130
+ if (name) {
131
+ path += `.${name}`;
132
+ }
133
+ if (urlParams) {
134
+ path += this.buildQueryString(urlParams);
135
+ }
136
+ return path;
137
+ }
138
+ buildQueryString(urlParams) {
139
+ let queryString = '?';
140
+ for (let key in urlParams) {
141
+ if (!urlParams.hasOwnProperty(key)) {
142
+ continue;
143
+ }
144
+ if (queryString.length > 1) {
145
+ queryString += '&';
146
+ }
147
+ queryString += key + '=' + urlParams[key];
148
+ }
149
+ return queryString;
150
+ }
151
+ }
152
+
153
+ export { FilterBarConfigFetcher as F };
@@ -1,68 +1,6 @@
1
- import { d as dist, D as DataFetcher } from './DataFetcher-7e18aa30.js';
1
+ import { d as dist, D as DataFetcher } from './DataFetcher-a4ed43e7.js';
2
2
  import { ObjectUtils } from '@sankhyalabs/core';
3
-
4
- class ResourceFetcher {
5
- constructor() {
6
- this.templateByQuery = new Map();
7
- this.buldTemplates();
8
- }
9
- buldTemplates() {
10
- this.templateByQuery.set("fetchResource", dist.gql `query($name: String!) {
11
- $queryAlias$: fetchResource(name: $name){
12
- resource
13
- }
14
- }`);
15
- this.templateByQuery.set("saveResource", dist.gql `mutation($resource: InputResource!) {
16
- $queryAlias$: saveResource(resource: $resource){
17
- name
18
- resource
19
- }
20
- }`);
21
- }
22
- loadResource(name) {
23
- if (ResourceFetcher._loadingResource.has(name)) {
24
- return ResourceFetcher._loadingResource.get(name);
25
- }
26
- const promiseLoadResource = new Promise((resolve, reject) => {
27
- DataFetcher.get()
28
- .callGraphQL({
29
- values: { name },
30
- query: this.templateByQuery.get("fetchResource"),
31
- })
32
- .then((result) => {
33
- resolve(result === null || result === void 0 ? void 0 : result.resource);
34
- ResourceFetcher._loadingResource.delete(name);
35
- })
36
- .catch((error) => {
37
- reject(error);
38
- ResourceFetcher._loadingResource.delete(name);
39
- });
40
- });
41
- ResourceFetcher._loadingResource.set(name, promiseLoadResource);
42
- return promiseLoadResource;
43
- }
44
- saveResource(resource, name) {
45
- return new Promise((resolve, reject) => {
46
- DataFetcher.get()
47
- .callGraphQL({
48
- values: {
49
- resource: {
50
- name: name,
51
- resource: JSON.stringify(resource)
52
- }
53
- },
54
- query: this.templateByQuery.get("saveResource")
55
- })
56
- .then((resp) => {
57
- resolve(resp);
58
- })
59
- .catch((error) => {
60
- reject(error);
61
- });
62
- });
63
- }
64
- }
65
- ResourceFetcher._loadingResource = new Map();
3
+ import { R as ResourceFetcher } from './resource-fetcher-45a70066.js';
66
4
 
67
5
  class FormConfigFetcher extends ResourceFetcher {
68
6
  constructor() {
@@ -238,4 +176,4 @@ var UserConfigType;
238
176
  UserConfigType["SHARED"] = "SHARED";
239
177
  })(UserConfigType || (UserConfigType = {}));
240
178
 
241
- export { FormConfigFetcher as F, ResourceFetcher as R, UserConfigType as U };
179
+ export { FormConfigFetcher as F, UserConfigType as U };
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy(JSON.parse("[[\"teste-pesquisa\",[[1,\"teste-pesquisa\"]]],[\"snk-filter-modal\",[[0,\"snk-filter-modal\",{\"getMessage\":[16],\"configName\":[1025,\"config-name\"],\"filters\":[1040],\"applyFilters\":[16],\"closeModal\":[16],\"addPersonalizedFilter\":[16],\"editPersonalizedFilter\":[16]}]]],[\"snk-actions-form\",[[2,\"snk-actions-form\",{\"action\":[16],\"applyParameters\":[16],\"dataUnit\":[32],\"openPopup\":[64]}]]],[\"snk-client-confirm\",[[2,\"snk-client-confirm\",{\"titleMessage\":[1,\"title-message\"],\"message\":[1],\"accept\":[16],\"cancel\":[16],\"openPopup\":[64]}]]],[\"snk-entity-list\",[[2,\"snk-entity-list\",{\"config\":[1040],\"rightListSlotBuilder\":[1040],\"maxHeightList\":[1,\"max-height-list\"],\"_searchValue\":[32],\"_ezListSource\":[32],\"reloadList\":[64]}]]],[\"snk-filter-binary-select\",[[0,\"snk-filter-binary-select\",{\"value\":[1544],\"config\":[16],\"presentationMode\":[2,\"presentation-mode\"],\"resetValues\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-list\",[[4,\"snk-filter-list\",{\"label\":[1],\"iconName\":[1,\"icon-name\"],\"items\":[16],\"getMessage\":[16],\"emptyText\":[1,\"empty-text\"],\"findFilterText\":[1,\"find-filter-text\"],\"buttonClass\":[1,\"button-class\"],\"_filterArgument\":[32],\"_showAll\":[32],\"hideDetail\":[64]},[[2,\"keydown\",\"keyDownHandler\"]]]]],[\"snk-filter-multi-select\",[[0,\"snk-filter-multi-select\",{\"value\":[1544],\"config\":[16],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-number\",[[0,\"snk-filter-number\",{\"config\":[16],\"value\":[2],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-period\",[[0,\"snk-filter-period\",{\"config\":[16],\"getMessage\":[16],\"value\":[8],\"presentationMode\":[2,\"presentation-mode\"],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-search\",[[0,\"snk-filter-search\",{\"config\":[16],\"value\":[16],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-text\",[[0,\"snk-filter-text\",{\"config\":[16],\"value\":[1]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-personalized-filter-editor\",[[2,\"snk-personalized-filter-editor\",{\"messagesBuilder\":[1040],\"presentationMode\":[2,\"presentation-mode\"],\"config\":[16],\"value\":[1040],\"items\":[32],\"show\":[64]}]]],[\"snk-print-selector\",[[2,\"snk-print-selector\",{\"_printServerActive\":[32],\"_selectedPrinter\":[32],\"_remotePrintersDataSource\":[32],\"_localPrintersDataSource\":[32],\"_printJobData\":[32],\"openPrintSelector\":[64]}]]],[\"snk-filter-modal-item\",[[0,\"snk-filter-modal-item\",{\"filterItem\":[1040],\"configName\":[1025,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"]}]]],[\"snk-detail-view\",[[2,\"snk-detail-view\",{\"formConfigManager\":[1040],\"dataUnitName\":[1,\"data-unit-name\"],\"resourceID\":[1,\"resource-i-d\"],\"guideItemPath\":[16],\"entityName\":[1,\"entity-name\"],\"label\":[1],\"dataUnit\":[1040],\"selectedForm\":[1025,\"selected-form\"],\"dataState\":[1040],\"messagesBuilder\":[1040],\"branchGuide\":[16],\"canEdit\":[4,\"can-edit\"],\"_disabledButtons\":[32],\"_currentView\":[32],\"attachmentRegisterKey\":[32],\"changeViewMode\":[64],\"configGrid\":[64],\"showUp\":[64]},[[0,\"snkContentCardChanged\",\"onContentCardChanged\"]]]]],[\"snk-configurator\",[[6,\"snk-configurator\",{\"showActionButtons\":[4,\"show-action-buttons\"],\"configName\":[1,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"],\"viewMode\":[2,\"view-mode\"],\"messagesBuilder\":[1040],\"_opened\":[32],\"_permissions\":[32],\"open\":[64],\"close\":[64]}]]],[\"snk-pesquisa\",[[2,\"snk-pesquisa\",{\"searchLoader\":[16],\"selectItem\":[16],\"argument\":[1025],\"_itemList\":[32],\"_startLoading\":[32]}]]],[\"snk-filter-bar\",[[2,\"snk-filter-bar\",{\"dataUnit\":[1040],\"configName\":[1,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"],\"filterConfig\":[1040],\"messagesBuilder\":[1040],\"allowDefault\":[32],\"scrollerLocked\":[32],\"showPersonalizedFilter\":[32],\"personalizedFilterId\":[32],\"reload\":[64]},[[0,\"filterChange\",\"filterChangeListener\"]]]]],[\"snk-select-box\",[[1,\"snk-select-box\",{\"selectedOption\":[1,\"selected-option\"]}]]],[\"snk-grid-config\",[[2,\"snk-grid-config\",{\"selectedIndex\":[1026,\"selected-index\"],\"application\":[16],\"columns\":[1040],\"config\":[1040],\"configName\":[1,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"]}]]],[\"snk-config-options\",[[2,\"snk-config-options\",{\"fieldConfig\":[16],\"idConfig\":[513,\"id-config\"],\"dataUnit\":[16],\"messagesBuilder\":[1040],\"_defaultType\":[32]}]]],[\"snk-field-config\",[[2,\"snk-field-config\",{\"isConfigActive\":[16],\"fieldConfig\":[16],\"modeInsertion\":[516,\"mode-insertion\"],\"dataUnit\":[16],\"messagesBuilder\":[1040]}]]],[\"snk-tab-config\",[[6,\"snk-tab-config\",{\"selectedIndex\":[1538,\"selected-index\"],\"selectedTab\":[1537,\"selected-tab\"],\"tabs\":[1],\"tabItems\":[16],\"messagesBuilder\":[1040],\"_processedTabs\":[32],\"_activeEditText\":[32],\"_activeEditTextIndex\":[32],\"_actionsHide\":[32],\"_actionsShow\":[32]}]]],[\"snk-form-config\",[[2,\"snk-form-config\",{\"dataUnit\":[16],\"configManager\":[16],\"messagesBuilder\":[1040],\"_formConfigOptions\":[32],\"_fieldConfigSelected\":[32],\"_layoutFormConfig\":[32],\"_fieldsAvailable\":[32],\"_formConfig\":[32],\"_formConfigChanged\":[32],\"_optionFormConfigSelected\":[32],\"_optionFormConfigChanged\":[32],\"_tempGroups\":[32]}]]],[\"snk-personalized-filter\",[[2,\"snk-personalized-filter\",{\"messagesBuilder\":[1040],\"entityUri\":[1025,\"entity-uri\"],\"filterId\":[1025,\"filter-id\"],\"configName\":[1025,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"],\"_filterAssistentMode\":[32],\"_filterAssistent\":[32],\"createPersonalizedFilter\":[64]}]]],[\"snk-filter-detail\",[[0,\"snk-filter-detail\",{\"config\":[1040],\"getMessage\":[16],\"show\":[64]}]]],[\"snk-filter-item\",[[0,\"snk-filter-item\",{\"config\":[1040],\"getMessage\":[16],\"detailIsVisible\":[32],\"showUp\":[64],\"hideDetail\":[64]},[[2,\"click\",\"clickListener\"],[2,\"mousedown\",\"mouseDownListener\"],[0,\"filterChange\",\"filterChangeListener\"]]]]],[\"snk-data-unit\",[[2,\"snk-data-unit\",{\"dataState\":[1040],\"messagesBuilder\":[1040],\"dataUnitName\":[1,\"data-unit-name\"],\"entityName\":[1,\"entity-name\"],\"pageSize\":[2,\"page-size\"],\"dataUnit\":[1040],\"beforeSave\":[16],\"afterSave\":[16],\"useCancelConfirm\":[4,\"use-cancel-confirm\"],\"ignoreSaveMessage\":[4,\"ignore-save-message\"],\"configName\":[1,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"],\"getDataUnit\":[64],\"getSelectedRecordsIDsInfo\":[64]}]]],[\"snk-exporter-email-sender\",[[0,\"snk-exporter-email-sender\",{\"getMessage\":[16],\"_config\":[32],\"_opened\":[32],\"_currentStep\":[32],\"open\":[64],\"close\":[64]}]]],[\"snk-data-exporter\",[[2,\"snk-data-exporter\",{\"provider\":[16],\"messagesBuilder\":[1040],\"_items\":[32],\"_showDropdown\":[32],\"_releasedToExport\":[32]}]]],[\"snk-actions-button\",[[2,\"snk-actions-button\",{\"_items\":[32],\"_showDropdown\":[32],\"_actions\":[32],\"_isOrderActions\":[32]}]]],[\"snk-taskbar\",[[6,\"snk-taskbar\",{\"configName\":[1,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"],\"buttons\":[1],\"customButtons\":[16],\"actionsList\":[16],\"primaryButton\":[1,\"primary-button\"],\"disabledButtons\":[16],\"dataUnit\":[16],\"presentationMode\":[1537,\"presentation-mode\"],\"messagesBuilder\":[1040],\"_permissions\":[32]}]]],[\"snk-filter-field-search_2\",[[2,\"snk-filter-field-search\",{\"searchable\":[4],\"fieldsDataSource\":[16],\"breadcrumbItems\":[32],\"linkItems\":[32],\"fieldItems\":[32],\"searchEmpty\":[32],\"groupEmpty\":[32],\"show\":[64],\"applyFilter\":[64]}],[0,\"snk-filter-param-config\",{\"messagesBuilder\":[1040],\"_opened\":[32],\"_configType\":[32],\"_expressionItem\":[32],\"_informedInstance\":[32],\"_canSave\":[32],\"open\":[64],\"close\":[64]}]]],[\"snk-expression-group_2\",[[2,\"snk-expression-group\",{\"parentTop\":[1026,\"parent-top\"],\"group\":[1040],\"messagesBuilder\":[1040],\"filterId\":[1025,\"filter-id\"],\"entityURI\":[1025,\"entity-u-r-i\"],\"_conditionOperator\":[32],\"_group\":[32],\"_selfTop\":[32],\"canAddExpression\":[32],\"_showDashes\":[32],\"getExpressionGroup\":[64]},[[8,\"ezExpressionLayoutChanged\",\"todoCompletedHandler\"]]],[2,\"snk-expression-item\",{\"expression\":[16],\"canRemove\":[516,\"can-remove\"],\"messagesBuilder\":[1040],\"entityURI\":[1025,\"entity-u-r-i\"],\"_showValueVariable\":[32],\"_fieldSelected\":[32],\"_optionNotNull\":[32]}]]],[\"snk-grid\",[[6,\"snk-grid\",{\"columnFilterDataSource\":[1040],\"configName\":[1,\"config-name\"],\"resourceID\":[1,\"resource-i-d\"],\"selectionToastConfig\":[16],\"actionsList\":[16],\"isDetail\":[4,\"is-detail\"],\"taskbarManager\":[16],\"statusResolver\":[16],\"multipleSelection\":[4,\"multiple-selection\"],\"presentationMode\":[1,\"presentation-mode\"],\"messagesBuilder\":[1040],\"useEnterLikeTab\":[4,\"use-enter-like-tab\"],\"recordsValidator\":[16],\"canEdit\":[4,\"can-edit\"],\"_dataUnit\":[32],\"_dataState\":[32],\"_gridConfig\":[32],\"_popUpGridConfig\":[32],\"showConfig\":[64],\"hideConfig\":[64],\"setConfig\":[64],\"reloadFilterBar\":[64]}]]],[\"snk-guides-viewer\",[[2,\"snk-guides-viewer\",{\"dataUnit\":[16],\"dataState\":[16],\"configName\":[1,\"config-name\"],\"entityPath\":[1,\"entity-path\"],\"actionsList\":[16],\"recordsValidator\":[16],\"masterFormConfig\":[1040],\"selectedGuide\":[16],\"taskbarManager\":[16],\"messagesBuilder\":[1040],\"canEdit\":[4,\"can-edit\"],\"presentationMode\":[1,\"presentation-mode\"],\"resourceID\":[1,\"resource-i-d\"],\"_breadcrumbItems\":[32],\"_guides\":[32],\"_formEditorConfigManager\":[32],\"_formEditorDataUnit\":[32],\"showFormConfig\":[64]},[[2,\"actionClick\",\"onActionClick\"],[0,\"snkContentCardChanged\",\"onContentCardChanged\"]]]]],[\"snk-crud\",[[6,\"snk-crud\",{\"configName\":[1025,\"config-name\"],\"selectionToastConfig\":[16],\"showActionButtons\":[4,\"show-action-buttons\"],\"actionsList\":[16],\"taskbarManager\":[16],\"recordsValidator\":[16],\"statusResolver\":[16],\"multipleSelection\":[4,\"multiple-selection\"],\"presentationMode\":[1,\"presentation-mode\"],\"messagesBuilder\":[1040],\"useEnterLikeTab\":[4,\"use-enter-like-tab\"],\"_dataUnit\":[32],\"_dataState\":[32],\"attachmentRegisterKey\":[32],\"_currentViewMode\":[32],\"_canEdit\":[32],\"_resourceID\":[32],\"goToView\":[64],\"openConfigurator\":[64],\"closeConfigurator\":[64],\"reloadFilterBar\":[64]}]]],[\"snk-form\",[[2,\"snk-form\",{\"configName\":[1,\"config-name\"],\"recordsValidator\":[16],\"messagesBuilder\":[1040],\"resourceID\":[1,\"resource-i-d\"],\"_dataUnit\":[32],\"_dataState\":[32],\"_showFormConfig\":[32],\"_configManager\":[32],\"showConfig\":[64],\"hideConfig\":[64]}]]],[\"snk-application\",[[2,\"snk-application\",{\"messagesBuilder\":[1040],\"configName\":[1,\"config-name\"],\"isUserSup\":[64],\"initOnboarding\":[64],\"hasAccess\":[64],\"getAllAccess\":[64],\"getStringParam\":[64],\"getIntParam\":[64],\"getFloatParam\":[64],\"getBooleanParam\":[64],\"getDateParam\":[64],\"showPopUp\":[64],\"showModal\":[64],\"closeModal\":[64],\"closePopUp\":[64],\"temOpcional\":[64],\"getConfig\":[64],\"saveConfig\":[64],\"getAttributeFromHTMLWrapper\":[64],\"openApp\":[64],\"webConnection\":[64],\"createDataunit\":[64],\"updateDataunitCache\":[64],\"getDataUnit\":[64],\"addClientEvent\":[64],\"removeClientEvent\":[64],\"hasClientEvent\":[64],\"callServiceBroker\":[64],\"getResourceID\":[64],\"getUserID\":[64],\"alert\":[64],\"error\":[64],\"success\":[64],\"message\":[64],\"confirm\":[64],\"info\":[64],\"loadTotals\":[64],\"executeSearch\":[64],\"executePreparedSearch\":[64],\"isDebugMode\":[64],\"getAppLabel\":[64],\"addSearchListener\":[64],\"importScript\":[64],\"getApplicationPath\":[64],\"executeSelectDistinct\":[64],\"getDataFetcher\":[64]}]]],[\"snk-simple-crud\",[[6,\"snk-simple-crud\",{\"dataState\":[16],\"dataUnit\":[16],\"mode\":[2],\"gridConfig\":[16],\"formConfig\":[16],\"multipleSelection\":[4,\"multiple-selection\"],\"useCancelConfirm\":[4,\"use-cancel-confirm\"],\"taskbarManager\":[16],\"messagesBuilder\":[1040],\"useEnterLikeTab\":[4,\"use-enter-like-tab\"],\"_currentViewMode\":[32],\"_config\":[32],\"goToView\":[64],\"setMetadata\":[64],\"setRecords\":[64],\"getRecords\":[64]},[[0,\"actionClick\",\"actionClickListener\"]]]]],[\"snk-attach\",[[2,\"snk-attach\",{\"registerKey\":[1,\"register-key\"],\"entityName\":[1,\"entity-name\"],\"messagesBuilder\":[1040],\"dataUnit\":[32],\"crudConfig\":[32]}]]],[\"snk-form-summary\",[[2,\"snk-form-summary\",{\"fixed\":[1540],\"contracted\":[1540],\"summary\":[16]}]]],[\"snk-form-view\",[[6,\"snk-form-view\",{\"levelPath\":[1,\"level-path\"],\"label\":[1],\"name\":[1],\"fields\":[16],\"formMetadata\":[8,\"form-metadata\"],\"dataUnit\":[16],\"contracted\":[4],\"fixed\":[1540],\"summaryFields\":[16],\"canExpand\":[4,\"can-expand\"],\"canFix\":[4,\"can-fix\"],\"recordsValidator\":[16],\"showUp\":[64]}]]],[\"snk-simple-bar\",[[6,\"snk-simple-bar\",{\"label\":[1],\"breadcrumbItens\":[16],\"messagesBuilder\":[1040]}]]],[\"snk-filter-advanced-mode_2\",[[2,\"snk-filter-assistent-mode\",{\"filterAssistent\":[1040],\"messagesBuilder\":[1040],\"filterId\":[1025,\"filter-id\"],\"entityUri\":[1025,\"entity-uri\"],\"application\":[1040]}],[2,\"snk-filter-advanced-mode\",{\"filterAssistent\":[1040],\"application\":[1040]}]]]]"), options);
14
+ return bootstrapLazy(JSON.parse("[[\"teste-pesquisa\",[[1,\"teste-pesquisa\"]]],[\"snk-filter-modal\",[[0,\"snk-filter-modal\",{\"getMessage\":[16],\"configName\":[1025,\"config-name\"],\"filters\":[1040],\"applyFilters\":[16],\"closeModal\":[16],\"addPersonalizedFilter\":[16],\"editPersonalizedFilter\":[16]}]]],[\"snk-actions-form\",[[2,\"snk-actions-form\",{\"action\":[16],\"applyParameters\":[16],\"dataUnit\":[32],\"openPopup\":[64]}]]],[\"snk-client-confirm\",[[2,\"snk-client-confirm\",{\"titleMessage\":[1,\"title-message\"],\"message\":[1],\"accept\":[16],\"cancel\":[16],\"openPopup\":[64]}]]],[\"snk-entity-list\",[[2,\"snk-entity-list\",{\"config\":[1040],\"rightListSlotBuilder\":[1040],\"maxHeightList\":[1,\"max-height-list\"],\"_searchValue\":[32],\"_ezListSource\":[32],\"reloadList\":[64]}]]],[\"snk-filter-binary-select\",[[0,\"snk-filter-binary-select\",{\"value\":[1544],\"config\":[16],\"presentationMode\":[2,\"presentation-mode\"],\"resetValues\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-list\",[[4,\"snk-filter-list\",{\"label\":[1],\"iconName\":[1,\"icon-name\"],\"items\":[16],\"getMessage\":[16],\"emptyText\":[1,\"empty-text\"],\"findFilterText\":[1,\"find-filter-text\"],\"buttonClass\":[1,\"button-class\"],\"_filterArgument\":[32],\"_showAll\":[32],\"hideDetail\":[64]},[[2,\"keydown\",\"keyDownHandler\"]]]]],[\"snk-filter-multi-select\",[[0,\"snk-filter-multi-select\",{\"value\":[1544],\"config\":[16],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-number\",[[0,\"snk-filter-number\",{\"config\":[16],\"value\":[2],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-period\",[[0,\"snk-filter-period\",{\"config\":[16],\"getMessage\":[16],\"value\":[8],\"presentationMode\":[2,\"presentation-mode\"],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-search\",[[0,\"snk-filter-search\",{\"config\":[16],\"value\":[16],\"show\":[64]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-filter-text\",[[0,\"snk-filter-text\",{\"config\":[16],\"value\":[1]},[[0,\"ezChange\",\"ezChangeListener\"]]]]],[\"snk-personalized-filter-editor\",[[2,\"snk-personalized-filter-editor\",{\"messagesBuilder\":[1040],\"presentationMode\":[2,\"presentation-mode\"],\"config\":[16],\"value\":[1040],\"items\":[32],\"show\":[64]}]]],[\"snk-print-selector\",[[2,\"snk-print-selector\",{\"_printServerActive\":[32],\"_selectedPrinter\":[32],\"_remotePrintersDataSource\":[32],\"_localPrintersDataSource\":[32],\"_printJobData\":[32],\"openPrintSelector\":[64]}]]],[\"snk-filter-modal-item\",[[0,\"snk-filter-modal-item\",{\"filterItem\":[1040],\"configName\":[1025,\"config-name\"]}]]],[\"snk-detail-view\",[[2,\"snk-detail-view\",{\"formConfigManager\":[1040],\"dataUnitName\":[1,\"data-unit-name\"],\"guideItemPath\":[16],\"entityName\":[1,\"entity-name\"],\"label\":[1],\"dataUnit\":[1040],\"selectedForm\":[1025,\"selected-form\"],\"dataState\":[1040],\"messagesBuilder\":[1040],\"branchGuide\":[16],\"_disabledButtons\":[32],\"attachmentRegisterKey\":[32],\"changeViewMode\":[64],\"configGrid\":[64],\"showUp\":[64]},[[0,\"snkContentCardChanged\",\"onContentCardChanged\"]]]]],[\"snk-configurator\",[[6,\"snk-configurator\",{\"showActionButtons\":[4,\"show-action-buttons\"],\"configName\":[1,\"config-name\"],\"viewMode\":[2,\"view-mode\"],\"messagesBuilder\":[1040],\"_opened\":[32],\"_permissions\":[32],\"open\":[64],\"close\":[64]}]]],[\"snk-pesquisa\",[[2,\"snk-pesquisa\",{\"searchLoader\":[16],\"selectItem\":[16],\"argument\":[1025],\"_itemList\":[32],\"_startLoading\":[32]}]]],[\"snk-filter-bar\",[[2,\"snk-filter-bar\",{\"dataUnit\":[1040],\"configName\":[1,\"config-name\"],\"filterConfig\":[1040],\"messagesBuilder\":[1040],\"allowDefault\":[32],\"scrollerLocked\":[32],\"showPersonalizedFilter\":[32],\"personalizedFilterId\":[32],\"reload\":[64]},[[0,\"filterChange\",\"filterChangeListener\"]]]]],[\"snk-select-box\",[[1,\"snk-select-box\",{\"selectedOption\":[1,\"selected-option\"]}]]],[\"snk-grid-config\",[[2,\"snk-grid-config\",{\"selectedIndex\":[1026,\"selected-index\"],\"application\":[16],\"columns\":[1040],\"config\":[1040],\"configName\":[1,\"config-name\"]}]]],[\"snk-config-options\",[[2,\"snk-config-options\",{\"fieldConfig\":[16],\"idConfig\":[513,\"id-config\"],\"dataUnit\":[16],\"messagesBuilder\":[1040],\"_defaultType\":[32]}]]],[\"snk-field-config\",[[2,\"snk-field-config\",{\"isConfigActive\":[16],\"fieldConfig\":[16],\"modeInsertion\":[516,\"mode-insertion\"],\"dataUnit\":[16],\"messagesBuilder\":[1040]}]]],[\"snk-tab-config\",[[6,\"snk-tab-config\",{\"selectedIndex\":[1538,\"selected-index\"],\"selectedTab\":[1537,\"selected-tab\"],\"tabs\":[1],\"tabItems\":[16],\"messagesBuilder\":[1040],\"_processedTabs\":[32],\"_activeEditText\":[32],\"_activeEditTextIndex\":[32],\"_actionsHide\":[32],\"_actionsShow\":[32]}]]],[\"snk-form-config\",[[2,\"snk-form-config\",{\"dataUnit\":[16],\"configManager\":[16],\"messagesBuilder\":[1040],\"_formConfigOptions\":[32],\"_fieldConfigSelected\":[32],\"_layoutFormConfig\":[32],\"_fieldsAvailable\":[32],\"_formConfig\":[32],\"_formConfigChanged\":[32],\"_optionFormConfigSelected\":[32],\"_optionFormConfigChanged\":[32],\"_tempGroups\":[32]}]]],[\"snk-personalized-filter\",[[2,\"snk-personalized-filter\",{\"messagesBuilder\":[1040],\"entityUri\":[1025,\"entity-uri\"],\"filterId\":[1025,\"filter-id\"],\"configName\":[1025,\"config-name\"],\"_filterAssistentMode\":[32],\"_filterAssistent\":[32],\"createPersonalizedFilter\":[64]}]]],[\"snk-filter-detail\",[[0,\"snk-filter-detail\",{\"config\":[1040],\"getMessage\":[16],\"show\":[64]}]]],[\"snk-filter-item\",[[0,\"snk-filter-item\",{\"config\":[1040],\"getMessage\":[16],\"detailIsVisible\":[32],\"showUp\":[64],\"hideDetail\":[64]},[[2,\"click\",\"clickListener\"],[2,\"mousedown\",\"mouseDownListener\"],[0,\"filterChange\",\"filterChangeListener\"]]]]],[\"snk-data-unit\",[[2,\"snk-data-unit\",{\"dataState\":[1040],\"messagesBuilder\":[1040],\"dataUnitName\":[1,\"data-unit-name\"],\"entityName\":[1,\"entity-name\"],\"pageSize\":[2,\"page-size\"],\"dataUnit\":[1040],\"beforeSave\":[16],\"afterSave\":[16],\"useCancelConfirm\":[4,\"use-cancel-confirm\"],\"configName\":[1,\"config-name\"],\"getDataUnit\":[64],\"getSelectedRecordsIDsInfo\":[64]}]]],[\"snk-exporter-email-sender\",[[0,\"snk-exporter-email-sender\",{\"getMessage\":[16],\"_config\":[32],\"_opened\":[32],\"_currentStep\":[32],\"open\":[64],\"close\":[64]}]]],[\"snk-data-exporter\",[[2,\"snk-data-exporter\",{\"provider\":[16],\"messagesBuilder\":[1040],\"_items\":[32],\"_showDropdown\":[32],\"_releasedToExport\":[32]}]]],[\"snk-actions-button\",[[2,\"snk-actions-button\",{\"_items\":[32],\"_showDropdown\":[32],\"_actions\":[32],\"_isOrderActions\":[32]}]]],[\"snk-taskbar\",[[6,\"snk-taskbar\",{\"configName\":[1,\"config-name\"],\"buttons\":[1],\"customButtons\":[16],\"actionsList\":[16],\"primaryButton\":[1,\"primary-button\"],\"disabledButtons\":[16],\"dataUnit\":[16],\"presentationMode\":[1537,\"presentation-mode\"],\"messagesBuilder\":[1040],\"_permissions\":[32]}]]],[\"snk-filter-field-search_2\",[[2,\"snk-filter-field-search\",{\"searchable\":[4],\"fieldsDataSource\":[16],\"breadcrumbItems\":[32],\"linkItems\":[32],\"fieldItems\":[32],\"searchEmpty\":[32],\"groupEmpty\":[32],\"show\":[64],\"applyFilter\":[64]}],[0,\"snk-filter-param-config\",{\"messagesBuilder\":[1040],\"_opened\":[32],\"_configType\":[32],\"_expressionItem\":[32],\"_informedInstance\":[32],\"_canSave\":[32],\"open\":[64],\"close\":[64]}]]],[\"snk-expression-group_2\",[[2,\"snk-expression-group\",{\"parentTop\":[1026,\"parent-top\"],\"group\":[1040],\"messagesBuilder\":[1040],\"filterId\":[1025,\"filter-id\"],\"entityURI\":[1025,\"entity-u-r-i\"],\"_conditionOperator\":[32],\"_group\":[32],\"_selfTop\":[32],\"canAddExpression\":[32],\"_showDashes\":[32],\"getExpressionGroup\":[64]},[[8,\"ezExpressionLayoutChanged\",\"todoCompletedHandler\"]]],[2,\"snk-expression-item\",{\"expression\":[16],\"canRemove\":[516,\"can-remove\"],\"messagesBuilder\":[1040],\"entityURI\":[1025,\"entity-u-r-i\"],\"_showValueVariable\":[32],\"_fieldSelected\":[32],\"_optionNotNull\":[32]}]]],[\"snk-grid\",[[6,\"snk-grid\",{\"configName\":[1,\"config-name\"],\"selectionToastConfig\":[16],\"actionsList\":[16],\"isDetail\":[4,\"is-detail\"],\"taskbarManager\":[16],\"statusResolver\":[16],\"multipleSelection\":[4,\"multiple-selection\"],\"presentationMode\":[1,\"presentation-mode\"],\"messagesBuilder\":[1040],\"_dataUnit\":[32],\"_dataState\":[32],\"_gridConfig\":[32],\"_popUpGridConfig\":[32],\"showConfig\":[64],\"hideConfig\":[64],\"setConfig\":[64],\"reloadFilterBar\":[64]}]]],[\"snk-guides-viewer\",[[2,\"snk-guides-viewer\",{\"_guideBuilders\":[16],\"dataUnit\":[16],\"dataState\":[16],\"configName\":[1,\"config-name\"],\"entityPath\":[1,\"entity-path\"],\"actionsList\":[16],\"recordsValidator\":[16],\"masterFormConfig\":[1040],\"selectedGuide\":[16],\"taskbarManager\":[16],\"messagesBuilder\":[1040],\"presentationMode\":[1,\"presentation-mode\"],\"_breadcrumbItems\":[32],\"_guides\":[32],\"_formEditorConfigManager\":[32],\"_formEditorDataUnit\":[32],\"showFormConfig\":[64]},[[2,\"actionClick\",\"onActionClick\"],[0,\"snkContentCardChanged\",\"onContentCardChanged\"]]]]],[\"snk-crud\",[[6,\"snk-crud\",{\"configName\":[1025,\"config-name\"],\"selectionToastConfig\":[16],\"showActionButtons\":[4,\"show-action-buttons\"],\"actionsList\":[16],\"taskbarManager\":[16],\"recordsValidator\":[16],\"statusResolver\":[16],\"multipleSelection\":[4,\"multiple-selection\"],\"presentationMode\":[1,\"presentation-mode\"],\"messagesBuilder\":[1040],\"_dataUnit\":[32],\"_dataState\":[32],\"attachmentRegisterKey\":[32],\"_currentViewMode\":[32],\"goToView\":[64],\"openConfigurator\":[64],\"closeConfigurator\":[64],\"reloadFilterBar\":[64]}]]],[\"snk-form\",[[2,\"snk-form\",{\"configName\":[1,\"config-name\"],\"recordsValidator\":[16],\"messagesBuilder\":[1040],\"_dataUnit\":[32],\"_dataState\":[32],\"_showFormConfig\":[32],\"_configManager\":[32],\"showConfig\":[64],\"hideConfig\":[64]}]]],[\"snk-application\",[[2,\"snk-application\",{\"messagesBuilder\":[1040],\"configName\":[1,\"config-name\"],\"isUserSup\":[64],\"initOnboarding\":[64],\"hasAccess\":[64],\"getAllAccess\":[64],\"getStringParam\":[64],\"getIntParam\":[64],\"getFloatParam\":[64],\"getBooleanParam\":[64],\"getDateParam\":[64],\"showPopUp\":[64],\"showModal\":[64],\"closeModal\":[64],\"closePopUp\":[64],\"temOpcional\":[64],\"getConfig\":[64],\"saveConfig\":[64],\"getAttributeFromHTMLWrapper\":[64],\"openApp\":[64],\"webConnection\":[64],\"createDataunit\":[64],\"updateDataunitCache\":[64],\"getDataUnit\":[64],\"addClientEvent\":[64],\"removeClientEvent\":[64],\"hasClientEvent\":[64],\"callServiceBroker\":[64],\"getResourceID\":[64],\"getUserID\":[64],\"alert\":[64],\"error\":[64],\"success\":[64],\"message\":[64],\"confirm\":[64],\"info\":[64],\"loadGridConfig\":[64],\"loadTotals\":[64],\"executeSearch\":[64],\"executePreparedSearch\":[64],\"isDebugMode\":[64],\"getAppLabel\":[64],\"addSearchListener\":[64],\"importScript\":[64],\"getApplicationPath\":[64],\"executeSelectDistinct\":[64],\"getDataFetcher\":[64]}]]],[\"snk-simple-crud\",[[6,\"snk-simple-crud\",{\"dataState\":[16],\"dataUnit\":[16],\"mode\":[2],\"gridConfig\":[16],\"formConfig\":[16],\"multipleSelection\":[4,\"multiple-selection\"],\"useCancelConfirm\":[4,\"use-cancel-confirm\"],\"taskbarManager\":[16],\"messagesBuilder\":[1040],\"_currentViewMode\":[32],\"_config\":[32],\"goToView\":[64],\"setMetadata\":[64],\"setRecords\":[64],\"getRecords\":[64]},[[0,\"actionClick\",\"actionClickListener\"]]]]],[\"snk-attach\",[[2,\"snk-attach\",{\"registerKey\":[1,\"register-key\"],\"entityName\":[1,\"entity-name\"],\"messagesBuilder\":[1040],\"dataUnit\":[32],\"crudConfig\":[32]}]]],[\"snk-form-summary\",[[2,\"snk-form-summary\",{\"fixed\":[1540],\"contracted\":[1540],\"summary\":[16]}]]],[\"snk-form-view\",[[6,\"snk-form-view\",{\"levelPath\":[1,\"level-path\"],\"label\":[1],\"name\":[1],\"fields\":[16],\"formMetadata\":[8,\"form-metadata\"],\"dataUnit\":[16],\"contracted\":[4],\"fixed\":[1540],\"summaryFields\":[16],\"canExpand\":[4,\"can-expand\"],\"canFix\":[4,\"can-fix\"],\"recordsValidator\":[16],\"showUp\":[64]}]]],[\"snk-simple-bar\",[[6,\"snk-simple-bar\",{\"label\":[1],\"breadcrumbItens\":[16],\"messagesBuilder\":[1040]}]]],[\"snk-filter-advanced-mode_2\",[[2,\"snk-filter-assistent-mode\",{\"filterAssistent\":[1040],\"messagesBuilder\":[1040],\"filterId\":[1025,\"filter-id\"],\"entityUri\":[1025,\"entity-uri\"],\"application\":[1040]}],[2,\"snk-filter-advanced-mode\",{\"filterAssistent\":[1040],\"application\":[1040]}]]]]"), options);
15
15
  });
16
16
  };
17
17
 
@@ -1,5 +1,5 @@
1
1
  import { DataType } from '@sankhyalabs/core';
2
- import { d as dist, D as DataFetcher } from './DataFetcher-7e18aa30.js';
2
+ import { d as dist, D as DataFetcher } from './DataFetcher-a4ed43e7.js';
3
3
 
4
4
  class PesquisaFetcher {
5
5
  constructor() {
@@ -0,0 +1,66 @@
1
+ import { d as dist, D as DataFetcher } from './DataFetcher-a4ed43e7.js';
2
+
3
+ class ResourceFetcher {
4
+ constructor() {
5
+ this.templateByQuery = new Map();
6
+ this.buldTemplates();
7
+ }
8
+ buldTemplates() {
9
+ this.templateByQuery.set("fetchResource", dist.gql `query($name: String!) {
10
+ $queryAlias$: fetchResource(name: $name){
11
+ resource
12
+ }
13
+ }`);
14
+ this.templateByQuery.set("saveResource", dist.gql `mutation($resource: InputResource!) {
15
+ $queryAlias$: saveResource(resource: $resource){
16
+ name
17
+ resource
18
+ }
19
+ }`);
20
+ }
21
+ loadResource(name) {
22
+ if (ResourceFetcher._loadingResource.has(name)) {
23
+ return ResourceFetcher._loadingResource.get(name);
24
+ }
25
+ const promiseLoadResource = new Promise((resolve, reject) => {
26
+ DataFetcher.get()
27
+ .callGraphQL({
28
+ values: { name },
29
+ query: this.templateByQuery.get("fetchResource"),
30
+ })
31
+ .then((result) => {
32
+ resolve(result === null || result === void 0 ? void 0 : result.resource);
33
+ ResourceFetcher._loadingResource.delete(name);
34
+ })
35
+ .catch((error) => {
36
+ reject(error);
37
+ ResourceFetcher._loadingResource.delete(name);
38
+ });
39
+ });
40
+ ResourceFetcher._loadingResource.set(name, promiseLoadResource);
41
+ return promiseLoadResource;
42
+ }
43
+ saveResource(resource, name) {
44
+ return new Promise((resolve, reject) => {
45
+ DataFetcher.get()
46
+ .callGraphQL({
47
+ values: {
48
+ resource: {
49
+ name: name,
50
+ resource: JSON.stringify(resource)
51
+ }
52
+ },
53
+ query: this.templateByQuery.get("saveResource")
54
+ })
55
+ .then((resp) => {
56
+ resolve(resp);
57
+ })
58
+ .catch((error) => {
59
+ reject(error);
60
+ });
61
+ });
62
+ }
63
+ }
64
+ ResourceFetcher._loadingResource = new Map();
65
+
66
+ export { ResourceFetcher as R };