@sankhyalabs/sankhyablocks 8.3.1 → 8.4.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/cjs/{ConfigStorage-c9ca6658.js → ConfigStorage-f0f89379.js} +163 -51
  2. package/dist/cjs/{DataFetcher-7694daf2.js → DataFetcher-4798bac3.js} +78 -234
  3. package/dist/cjs/ISave-d68ce3cd.js +8 -0
  4. package/dist/cjs/PrintUtils-bcaeb82f.js +215 -0
  5. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  6. package/dist/cjs/{SnkFormConfigManager-fb684c0e.js → SnkFormConfigManager-d5fd8800.js} +19 -21
  7. package/dist/cjs/{auth-fetcher-80818a0f.js → auth-fetcher-f2967437.js} +2 -2
  8. package/dist/cjs/{dataunit-fetcher-1acab20d.js → dataunit-fetcher-959c9a00.js} +1 -1
  9. package/dist/cjs/{form-config-fetcher-f10017bf.js → form-config-fetcher-5e3d3b87.js} +66 -3
  10. package/dist/cjs/index-f9e81701.js +4 -0
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{pesquisa-fetcher-c9d99342.js → pesquisa-fetcher-7973c081.js} +1 -1
  13. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  14. package/dist/cjs/snk-actions-button.cjs.entry.js +19 -11
  15. package/dist/cjs/snk-application.cjs.entry.js +60 -44
  16. package/dist/cjs/snk-attach.cjs.entry.js +9 -14
  17. package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
  18. package/dist/cjs/snk-crud.cjs.entry.js +28 -11
  19. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
  20. package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-7cc1846d.js} +5 -5
  21. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-detail-view.cjs.entry.js +17 -13
  23. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  24. package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -17
  25. package/dist/cjs/snk-filter-detail.cjs.entry.js +7 -16
  26. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -19
  27. package/dist/cjs/snk-form-config.cjs.entry.js +7 -17
  28. package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
  29. package/dist/cjs/snk-form.cjs.entry.js +13 -8
  30. package/dist/cjs/snk-grid-config.cjs.entry.js +6 -6
  31. package/dist/cjs/snk-grid.cjs.entry.js +23 -22
  32. package/dist/cjs/{snk-guides-viewer-5da253af.js → snk-guides-viewer-b7b680d2.js} +19 -8
  33. package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -9
  34. package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -16
  35. package/dist/cjs/snk-print-selector.cjs.entry.js +2 -4
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +43 -85
  37. package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +20 -0
  38. package/dist/cjs/snk-taskbar.cjs.entry.js +71 -5
  39. package/dist/cjs/{taskbar-elements-b98dd6e9.js → taskbar-elements-39949c7a.js} +4 -4
  40. package/dist/collection/collection-manifest.json +1 -0
  41. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  42. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  43. package/dist/collection/components/snk-application/snk-application.js +120 -65
  44. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  45. package/dist/collection/components/snk-crud/snk-crud.js +44 -8
  46. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +60 -2
  47. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
  48. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +65 -28
  49. package/dist/collection/components/snk-data-unit/snk-data-unit.js +22 -6
  50. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  51. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +8 -13
  52. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  53. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
  54. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +28 -12
  55. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  56. package/dist/collection/components/snk-form/snk-form.js +46 -2
  57. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  58. package/dist/collection/components/snk-grid/snk-grid.js +108 -16
  59. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  60. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  61. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +23 -1
  62. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +4 -4
  63. package/dist/collection/components/snk-taskbar/snk-taskbar-custom-elements.js +43 -0
  64. package/dist/collection/components/snk-taskbar/snk-taskbar.css +4 -0
  65. package/dist/collection/components/snk-taskbar/snk-taskbar.js +126 -5
  66. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  67. package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -71
  68. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +47 -32
  69. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  70. package/dist/collection/lib/index.js +10 -0
  71. package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
  72. package/dist/collection/lib/utils/PrintUtils.js +18 -9
  73. package/dist/collection/lib/utils/urlutils.js +29 -0
  74. package/dist/components/ConfigStorage.js +161 -48
  75. package/dist/components/DataFetcher.js +79 -234
  76. package/dist/components/PrintUtils.js +213 -0
  77. package/dist/components/ResourceIDUtils.js +10 -0
  78. package/dist/components/SnkFormConfigManager.js +17 -19
  79. package/dist/components/auth-fetcher.js +1 -1
  80. package/dist/components/form-config-fetcher.js +64 -2
  81. package/dist/components/index.d.ts +1 -0
  82. package/dist/components/index.js +1 -0
  83. package/dist/components/snk-actions-button2.js +23 -9
  84. package/dist/components/snk-application2.js +145 -129
  85. package/dist/components/snk-attach2.js +1 -8
  86. package/dist/components/snk-configurator2.js +3 -1
  87. package/dist/components/snk-crud.js +27 -8
  88. package/dist/components/snk-data-unit2.js +6 -5
  89. package/dist/components/snk-detail-view2.js +26 -10
  90. package/dist/components/snk-entity-list.js +0 -4
  91. package/dist/components/snk-filter-bar2.js +12 -12
  92. package/dist/components/snk-filter-detail2.js +8 -13
  93. package/dist/components/snk-filter-modal-item2.js +5 -16
  94. package/dist/components/snk-form-config2.js +5 -15
  95. package/dist/components/snk-form-view2.js +6 -1
  96. package/dist/components/snk-form.js +9 -2
  97. package/dist/components/snk-grid-config2.js +4 -2
  98. package/dist/components/snk-grid2.js +24 -17
  99. package/dist/components/snk-personalized-filter2.js +11 -11
  100. package/dist/components/snk-print-selector.js +1 -1
  101. package/dist/components/snk-simple-crud2.js +30 -73
  102. package/dist/components/snk-taskbar-custom-elements.d.ts +11 -0
  103. package/dist/components/snk-taskbar-custom-elements.js +35 -0
  104. package/dist/components/snk-taskbar2.js +81 -9
  105. package/dist/esm/{ConfigStorage-6887ede4.js → ConfigStorage-4441aa3d.js} +162 -49
  106. package/dist/esm/{DataFetcher-731430d9.js → DataFetcher-1618bffe.js} +79 -234
  107. package/dist/esm/ISave-4412b20c.js +8 -0
  108. package/dist/esm/PrintUtils-3e4ff0f5.js +213 -0
  109. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  110. package/dist/esm/{SnkFormConfigManager-6acecf9f.js → SnkFormConfigManager-5a5f85a3.js} +19 -21
  111. package/dist/esm/{auth-fetcher-82d89fe6.js → auth-fetcher-7861187e.js} +1 -1
  112. package/dist/esm/{dataunit-fetcher-ad7a1a3e.js → dataunit-fetcher-53c007be.js} +1 -1
  113. package/dist/esm/{form-config-fetcher-9560730a.js → form-config-fetcher-2fe67341.js} +65 -3
  114. package/dist/esm/index-a7d3d3f1.js +4 -0
  115. package/dist/esm/loader.js +1 -1
  116. package/dist/esm/{pesquisa-fetcher-27dc20ed.js → pesquisa-fetcher-19e81fc8.js} +1 -1
  117. package/dist/esm/sankhyablocks.js +1 -1
  118. package/dist/esm/snk-actions-button.entry.js +19 -11
  119. package/dist/esm/snk-application.entry.js +60 -44
  120. package/dist/esm/snk-attach.entry.js +5 -10
  121. package/dist/esm/snk-configurator.entry.js +2 -1
  122. package/dist/esm/snk-crud.entry.js +30 -13
  123. package/dist/esm/snk-data-exporter.entry.js +3 -2
  124. package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-1715d2f1.js} +5 -5
  125. package/dist/esm/snk-data-unit.entry.js +1 -1
  126. package/dist/esm/snk-detail-view.entry.js +17 -13
  127. package/dist/esm/snk-entity-list.entry.js +0 -4
  128. package/dist/esm/snk-filter-bar.entry.js +15 -17
  129. package/dist/esm/snk-filter-detail.entry.js +8 -17
  130. package/dist/esm/snk-filter-modal-item.entry.js +7 -20
  131. package/dist/esm/snk-form-config.entry.js +8 -18
  132. package/dist/esm/snk-form-view.entry.js +6 -1
  133. package/dist/esm/snk-form.entry.js +13 -8
  134. package/dist/esm/snk-grid-config.entry.js +6 -6
  135. package/dist/esm/snk-grid.entry.js +23 -22
  136. package/dist/esm/{snk-guides-viewer-d3623a1f.js → snk-guides-viewer-e4fe884d.js} +19 -8
  137. package/dist/esm/snk-guides-viewer.entry.js +10 -9
  138. package/dist/esm/snk-personalized-filter.entry.js +14 -16
  139. package/dist/esm/snk-print-selector.entry.js +1 -3
  140. package/dist/esm/snk-simple-crud.entry.js +34 -76
  141. package/dist/esm/snk-taskbar-custom-elements.entry.js +16 -0
  142. package/dist/esm/snk-taskbar.entry.js +71 -5
  143. package/dist/esm/{taskbar-elements-2c761819.js → taskbar-elements-0a6b8b95.js} +4 -4
  144. package/dist/sankhyablocks/p-0b99a775.entry.js +1 -0
  145. package/dist/sankhyablocks/p-1e30c376.entry.js +1 -0
  146. package/dist/sankhyablocks/p-1fa3acbe.entry.js +1 -0
  147. package/dist/sankhyablocks/p-27dbbb3a.entry.js +1 -0
  148. package/dist/sankhyablocks/p-29b1d77b.entry.js +11 -0
  149. package/dist/sankhyablocks/p-324ce41e.entry.js +1 -0
  150. package/dist/sankhyablocks/p-34604220.entry.js +1 -0
  151. package/dist/sankhyablocks/p-41820e28.entry.js +1 -0
  152. package/dist/sankhyablocks/p-4352324d.entry.js +1 -0
  153. package/dist/sankhyablocks/{p-f6b98398.js → p-449d25e0.js} +2 -2
  154. package/dist/sankhyablocks/p-5051a23a.entry.js +1 -0
  155. package/dist/sankhyablocks/p-5526ab67.js +1 -0
  156. package/dist/sankhyablocks/p-5b2ee1d3.js +1 -0
  157. package/dist/sankhyablocks/p-5da848bb.js +26 -0
  158. package/dist/sankhyablocks/p-6098d844.entry.js +1 -0
  159. package/dist/sankhyablocks/p-648a7c72.entry.js +1 -0
  160. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  161. package/dist/sankhyablocks/p-72fc257b.entry.js +1 -0
  162. package/dist/sankhyablocks/p-7d6eca73.entry.js +1 -0
  163. package/dist/sankhyablocks/p-81a7f74c.js +1 -0
  164. package/dist/sankhyablocks/p-8d884fab.js +1 -0
  165. package/dist/sankhyablocks/p-90b5d1af.entry.js +1 -0
  166. package/dist/sankhyablocks/p-989937ee.entry.js +1 -0
  167. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  168. package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
  169. package/dist/sankhyablocks/{p-1bed2c42.js → p-a75e892a.js} +1 -1
  170. package/dist/sankhyablocks/p-a81996df.js +1 -0
  171. package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
  172. package/dist/sankhyablocks/{p-a2493d11.js → p-c9841939.js} +1 -1
  173. package/dist/sankhyablocks/p-ca1522bc.entry.js +1 -0
  174. package/dist/sankhyablocks/p-cbed6235.entry.js +1 -0
  175. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  176. package/dist/sankhyablocks/p-daa687aa.js +56 -0
  177. package/dist/sankhyablocks/p-e1cb1f0b.js +1 -0
  178. package/dist/sankhyablocks/p-eb1a650a.entry.js +1 -0
  179. package/dist/sankhyablocks/p-f784010c.entry.js +1 -0
  180. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  181. package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
  182. package/dist/types/components/snk-application/snk-application.d.ts +9 -22
  183. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  184. package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
  185. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +12 -0
  186. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
  187. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -2
  188. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
  189. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  190. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  191. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  192. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
  193. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  194. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  195. package/dist/types/components/snk-form/snk-form.d.ts +9 -1
  196. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  197. package/dist/types/components/snk-grid/snk-grid.d.ts +17 -1
  198. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  199. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  200. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
  201. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +2 -2
  202. package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +7 -0
  203. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +27 -0
  204. package/dist/types/components.d.ts +203 -22
  205. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  206. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -8
  207. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  208. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
  209. package/dist/types/lib/index.d.ts +11 -0
  210. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  211. package/dist/types/lib/utils/PrintUtils.d.ts +1 -0
  212. package/dist/types/lib/utils/urlutils.d.ts +14 -0
  213. package/package.json +2 -2
  214. package/react/components.d.ts +1 -0
  215. package/react/components.js +1 -0
  216. package/react/components.js.map +1 -1
  217. package/dist/cjs/filter-bar-config-fetcher-f13a1aff.js +0 -155
  218. package/dist/cjs/resource-fetcher-a6e6c5fd.js +0 -68
  219. package/dist/components/filter-bar-config-fetcher.js +0 -153
  220. package/dist/components/resource-fetcher.js +0 -66
  221. package/dist/esm/filter-bar-config-fetcher-553c5463.js +0 -153
  222. package/dist/esm/resource-fetcher-0586b1fc.js +0 -66
  223. package/dist/sankhyablocks/p-000d073b.entry.js +0 -1
  224. package/dist/sankhyablocks/p-162f5d21.entry.js +0 -1
  225. package/dist/sankhyablocks/p-1dc76c50.js +0 -1
  226. package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
  227. package/dist/sankhyablocks/p-24b18442.entry.js +0 -1
  228. package/dist/sankhyablocks/p-301d4e34.js +0 -1
  229. package/dist/sankhyablocks/p-4374bc89.entry.js +0 -1
  230. package/dist/sankhyablocks/p-564efc43.js +0 -1
  231. package/dist/sankhyablocks/p-5fe223c9.entry.js +0 -1
  232. package/dist/sankhyablocks/p-61651a40.entry.js +0 -1
  233. package/dist/sankhyablocks/p-70d4a90a.entry.js +0 -1
  234. package/dist/sankhyablocks/p-7bd353de.entry.js +0 -1
  235. package/dist/sankhyablocks/p-837831c2.js +0 -56
  236. package/dist/sankhyablocks/p-85ec10c9.entry.js +0 -1
  237. package/dist/sankhyablocks/p-89d46727.entry.js +0 -1
  238. package/dist/sankhyablocks/p-8e8b5fc7.js +0 -1
  239. package/dist/sankhyablocks/p-8e96581f.js +0 -17
  240. package/dist/sankhyablocks/p-9b2af526.entry.js +0 -1
  241. package/dist/sankhyablocks/p-9db7e50a.js +0 -10
  242. package/dist/sankhyablocks/p-a2f32d4e.entry.js +0 -1
  243. package/dist/sankhyablocks/p-a7eaea51.entry.js +0 -1
  244. package/dist/sankhyablocks/p-a84b1ca2.entry.js +0 -1
  245. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  246. package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
  247. package/dist/sankhyablocks/p-c3943e7e.entry.js +0 -11
  248. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  249. package/dist/sankhyablocks/p-c7d1e26a.js +0 -1
  250. package/dist/sankhyablocks/p-cd40ab53.entry.js +0 -1
  251. package/dist/sankhyablocks/p-d41198ff.js +0 -1
  252. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  253. package/dist/sankhyablocks/p-f9f385eb.entry.js +0 -1
@@ -3,29 +3,27 @@ import { ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FormConfigFetcher } from './form-config-fetcher.js';
4
4
 
5
5
  class SnkFormConfigManager {
6
- constructor(configName, onConfigChange) {
6
+ constructor(configName, resourceID, onConfigChange) {
7
+ this._resourceID = resourceID;
7
8
  this._configName = configName;
8
9
  this._onConfigChange = onConfigChange;
9
10
  }
10
11
  async loadConfig() {
11
12
  return new Promise(resolve => {
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
- });
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);
22
20
  });
23
21
  });
24
22
  }
25
23
  saveConfig(config) {
26
24
  const configToSave = ObjectUtils.copy(config);
27
25
  return new Promise(accept => {
28
- ConfigStorage.saveFormConfig(config, this._configName)
26
+ ConfigStorage.saveFormConfig(config, this._configName, this._resourceID)
29
27
  .then((response) => {
30
28
  this.setConfig(Object.assign(Object.assign({}, configToSave), response));
31
29
  accept(Object.assign(Object.assign({}, configToSave), response));
@@ -40,7 +38,7 @@ class SnkFormConfigManager {
40
38
  cardsState.set(cardId, propertyChanged === "fixed" ?
41
39
  this.updateFixSequence(Object.assign(Object.assign({}, currentConfig), { fixed: cardConfig.fixed }), cardsState)
42
40
  : Object.assign(Object.assign({}, currentConfig), { [propertyChanged]: cardConfig[propertyChanged] }));
43
- ConfigStorage.saveCardState(cardsState, this._configName)
41
+ ConfigStorage.saveCardState(cardsState, this._configName, this._resourceID)
44
42
  .then(savedCardConfig => {
45
43
  this._config = Object.assign(Object.assign({}, this._config), { cardsState });
46
44
  resolve(savedCardConfig);
@@ -116,18 +114,18 @@ class SnkFormConfigManager {
116
114
  }
117
115
  return this._formConfigFetcher;
118
116
  }
119
- async fetchUserAvailableConfigs(resourceID) {
117
+ async fetchUserAvailableConfigs() {
120
118
  if (this._configName != undefined) {
121
119
  //FIXME: Precisamos preparar o backend para retornar as configurações disponíveis para details;
122
120
  return Promise.resolve(undefined);
123
121
  }
124
- return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, resourceID);
122
+ return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, this._resourceID);
125
123
  }
126
- async fetchLegacyConfig(resourceID) {
127
- return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, resourceID);
124
+ async fetchLegacyConfig() {
125
+ return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, this._resourceID);
128
126
  }
129
- async fetchDefaultConfig(resourceID) {
130
- return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, resourceID);
127
+ async fetchDefaultConfig() {
128
+ return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
131
129
  }
132
130
  }
133
131
 
@@ -1,5 +1,5 @@
1
1
  import { ObjectUtils } from '@sankhyalabs/core';
2
- import { R as ResourceFetcher } from './resource-fetcher.js';
2
+ import { R as ResourceFetcher } from './form-config-fetcher.js';
3
3
 
4
4
  class AuthFetcher extends ResourceFetcher {
5
5
  getData(resourceID) {
@@ -1,6 +1,68 @@
1
1
  import { d as dist, D as DataFetcher } from './DataFetcher.js';
2
2
  import { ObjectUtils } from '@sankhyalabs/core';
3
- import { R as ResourceFetcher } from './resource-fetcher.js';
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();
4
66
 
5
67
  class FormConfigFetcher extends ResourceFetcher {
6
68
  constructor() {
@@ -176,4 +238,4 @@ var UserConfigType;
176
238
  UserConfigType["SHARED"] = "SHARED";
177
239
  })(UserConfigType || (UserConfigType = {}));
178
240
 
179
- export { FormConfigFetcher as F, UserConfigType as U };
241
+ export { FormConfigFetcher as F, ResourceFetcher as R, UserConfigType as U };
@@ -47,6 +47,7 @@ export { SnkSimpleBar as SnkSimpleBar } from '../types/components/snk-simple-bar
47
47
  export { SnkSimpleCrud as SnkSimpleCrud } from '../types/components/snk-simple-crud/snk-simple-crud';
48
48
  export { SnkTabConfig as SnkTabConfig } from '../types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config';
49
49
  export { SnkTaskbar as SnkTaskbar } from '../types/components/snk-taskbar/snk-taskbar';
50
+ export { SnkTaskbarCustomElements as SnkTaskbarCustomElements } from '../types/components/snk-taskbar/snk-taskbar-custom-elements';
50
51
  export { TestePesquisa as TestePesquisa } from '../types/components/teste-pesquisa/teste-pesquisa';
51
52
 
52
53
  /**
@@ -47,4 +47,5 @@ export { SnkSimpleBar, defineCustomElement as defineCustomElementSnkSimpleBar }
47
47
  export { SnkSimpleCrud, defineCustomElement as defineCustomElementSnkSimpleCrud } from './snk-simple-crud.js';
48
48
  export { SnkTabConfig, defineCustomElement as defineCustomElementSnkTabConfig } from './snk-tab-config.js';
49
49
  export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
50
+ export { SnkTaskbarCustomElements, defineCustomElement as defineCustomElementSnkTaskbarCustomElements } from './snk-taskbar-custom-elements.js';
50
51
  export { TestePesquisa, defineCustomElement as defineCustomElementTestePesquisa } from './teste-pesquisa.js';
@@ -4,6 +4,11 @@ import { D as DataFetcher } from './DataFetcher.js';
4
4
  import { P as ParamType } from './ParamType.js';
5
5
  import './pesquisa-fetcher.js';
6
6
  import './index2.js';
7
+ import '@sankhyalabs/ezui/dist/collection/utils/constants';
8
+ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
+ import './filter-item-type.enum.js';
10
+ import './form-config-fetcher.js';
11
+ import { R as ResourceIDUtils } from './ResourceIDUtils.js';
7
12
 
8
13
  const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
9
14
  class JavaExecutor {
@@ -153,18 +158,26 @@ var RefreshType;
153
158
  RefreshType["ALL"] = "ALL";
154
159
  })(RefreshType || (RefreshType = {}));
155
160
 
161
+ var SaveErrorsEnum;
162
+ (function (SaveErrorsEnum) {
163
+ SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
164
+ SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
165
+ SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
166
+ })(SaveErrorsEnum || (SaveErrorsEnum = {}));
167
+
156
168
  const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
157
169
  const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
158
170
  const NUFIN_COLUMN = 'NUFIN';
159
171
  const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
160
172
  class Actions {
161
- constructor(actionsExecuteInterface, dataUnit) {
173
+ constructor(actionsExecuteInterface, dataUnit, appResourceId) {
162
174
  var _a;
163
175
  this._lastValuesCache = {};
164
176
  this._actionsExecuteInterface = actionsExecuteInterface;
165
177
  this._dataUnit = dataUnit;
166
178
  this._selectedRows = ((_a = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo()) === null || _a === void 0 ? void 0 : _a.isAllRecords()) ? [] : dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo().records;
167
179
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
180
+ this._appResourceId = appResourceId;
168
181
  }
169
182
  apply(action, hasParamsToSave) {
170
183
  this._application.closePopUp();
@@ -427,9 +440,7 @@ class Actions {
427
440
  }
428
441
  }
429
442
  async buildResourceId(actionId) {
430
- let appResId = '';
431
- appResId = await this._application.getResourceID();
432
- return appResId + '.actionconfig.' + actionId;
443
+ return this._appResourceId + '.actionconfig.' + actionId;
433
444
  }
434
445
  prepareAndExecute(execSource, executeAction) {
435
446
  this.addRows(execSource);
@@ -588,7 +599,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
588
599
  this.handleClick = (evt) => {
589
600
  const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
590
601
  const executor = new ExecutorFactory(selectedAction.type).executor;
591
- const action = new Actions(executor, this._dataUnit);
602
+ const action = new Actions(executor, this._dataUnit, this._resourceID);
592
603
  action.execute(Object.assign({}, selectedAction));
593
604
  this._showDropdown = false;
594
605
  };
@@ -646,12 +657,15 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
646
657
  document.addEventListener("scroll", this.positionDropdown.bind(this));
647
658
  }
648
659
  async componentWillLoad() {
649
- var _a;
650
660
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
651
- this._resourceID = await this._application.getResourceID();
652
661
  this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
653
- this._dataUnit = (_a = this._element.parentElement) === null || _a === void 0 ? void 0 : _a.dataUnit;
662
+ const snkDataUnit = this._element.parentElement;
663
+ this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
664
+ this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
654
665
  this._entityName = this._dataUnit.name.split('/')[2];
666
+ if (this._resourceID == undefined) {
667
+ this._resourceID = await ResourceIDUtils.getResourceID();
668
+ }
655
669
  this.setEvents();
656
670
  this.getActions().then(() => {
657
671
  this.loadItems();
@@ -715,4 +729,4 @@ function defineCustomElement() {
715
729
  } });
716
730
  }
717
731
 
718
- export { SnkActionsButton as S, defineCustomElement as d };
732
+ export { SnkActionsButton as S, SaveErrorsEnum as a, defineCustomElement as d };