@sankhyalabs/sankhyablocks 8.1.0-dev.1 → 8.1.0-dev.11

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 (212) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{ConfigStorage-73e7afff.js → ConfigStorage-d688c739.js} +163 -50
  3. package/dist/cjs/{DataFetcher-004811c6.js → DataFetcher-d2c6ae38.js} +29 -0
  4. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  5. package/dist/cjs/{SnkFormConfigManager-d1f1a222.js → SnkFormConfigManager-29b73c81.js} +19 -21
  6. package/dist/cjs/{auth-fetcher-58237931.js → auth-fetcher-da975ac5.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-029eafbd.js → dataunit-fetcher-58ad78a7.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-181767c9.js → form-config-fetcher-761994b9.js} +2 -2
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-9a97994a.js → pesquisa-fetcher-bb0bb679.js} +1 -1
  11. package/dist/cjs/{resource-fetcher-c0332609.js → resource-fetcher-95d24dff.js} +1 -1
  12. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  13. package/dist/cjs/snk-actions-button.cjs.entry.js +13 -10
  14. package/dist/cjs/snk-application.cjs.entry.js +48 -44
  15. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  16. package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
  17. package/dist/cjs/snk-crud.cjs.entry.js +21 -9
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  19. package/dist/cjs/{snk-data-unit-cc7a7ed0.js → snk-data-unit-80a00ae4.js} +4 -4
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +11 -10
  22. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  23. package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -17
  24. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
  25. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -19
  26. package/dist/cjs/snk-form-config.cjs.entry.js +7 -17
  27. package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
  28. package/dist/cjs/snk-form.cjs.entry.js +13 -8
  29. package/dist/cjs/snk-grid-config.cjs.entry.js +6 -6
  30. package/dist/cjs/snk-grid.cjs.entry.js +18 -20
  31. package/dist/cjs/{snk-guides-viewer-27f87d90.js → snk-guides-viewer-f67f9cea.js} +12 -7
  32. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
  33. package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -16
  34. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-simple-crud.cjs.entry.js +15 -71
  36. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
  37. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  38. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  39. package/dist/collection/components/snk-application/snk-application.js +58 -65
  40. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  41. package/dist/collection/components/snk-crud/snk-crud.js +40 -6
  42. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +42 -2
  43. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
  44. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +47 -28
  45. package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -8
  46. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  47. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
  48. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  49. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
  50. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +28 -12
  51. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  52. package/dist/collection/components/snk-form/snk-form.js +46 -2
  53. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  54. package/dist/collection/components/snk-grid/snk-grid.js +51 -15
  55. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  56. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  57. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +22 -0
  58. package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
  59. package/dist/collection/components/teste-pesquisa/teste-pesquisa.css +1 -1
  60. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  61. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -59
  62. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  63. package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
  64. package/dist/collection/lib/utils/urlutils.js +29 -0
  65. package/dist/components/ConfigStorage.js +161 -48
  66. package/dist/components/DataFetcher.js +29 -0
  67. package/dist/components/ResourceIDUtils.js +10 -0
  68. package/dist/components/SnkFormConfigManager.js +17 -19
  69. package/dist/components/auth-fetcher.js +1 -1
  70. package/dist/components/form-config-fetcher.js +64 -2
  71. package/dist/components/snk-actions-button2.js +11 -8
  72. package/dist/components/snk-application2.js +42 -38
  73. package/dist/components/snk-configurator2.js +3 -1
  74. package/dist/components/snk-crud.js +18 -5
  75. package/dist/components/snk-data-unit2.js +5 -4
  76. package/dist/components/snk-detail-view2.js +15 -7
  77. package/dist/components/snk-entity-list.js +0 -4
  78. package/dist/components/snk-filter-bar2.js +12 -12
  79. package/dist/components/snk-filter-detail2.js +2 -12
  80. package/dist/components/snk-filter-modal-item2.js +5 -16
  81. package/dist/components/snk-form-config2.js +5 -15
  82. package/dist/components/snk-form-view2.js +6 -1
  83. package/dist/components/snk-form.js +9 -2
  84. package/dist/components/snk-grid-config2.js +4 -2
  85. package/dist/components/snk-grid2.js +17 -16
  86. package/dist/components/snk-personalized-filter2.js +11 -11
  87. package/dist/components/snk-simple-crud2.js +3 -59
  88. package/dist/components/snk-taskbar2.js +3 -1
  89. package/dist/esm/{ConfigStorage-19a7260b.js → ConfigStorage-cfe03e99.js} +163 -49
  90. package/dist/esm/{DataFetcher-e0fc5549.js → DataFetcher-aaaff866.js} +29 -0
  91. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  92. package/dist/esm/{SnkFormConfigManager-1a42eb02.js → SnkFormConfigManager-bfd8eabd.js} +19 -21
  93. package/dist/esm/{auth-fetcher-83a946f8.js → auth-fetcher-7860d777.js} +1 -1
  94. package/dist/esm/{dataunit-fetcher-6a695723.js → dataunit-fetcher-9dfcdb1d.js} +1 -1
  95. package/dist/esm/{form-config-fetcher-9e167008.js → form-config-fetcher-4a34b86a.js} +2 -2
  96. package/dist/esm/loader.js +1 -1
  97. package/dist/esm/{pesquisa-fetcher-9118eb7a.js → pesquisa-fetcher-01d058e6.js} +1 -1
  98. package/dist/{components/resource-fetcher.js → esm/resource-fetcher-b36ac145.js} +1 -1
  99. package/dist/esm/sankhyablocks.js +1 -1
  100. package/dist/esm/snk-actions-button.entry.js +13 -10
  101. package/dist/esm/snk-application.entry.js +48 -44
  102. package/dist/esm/snk-attach.entry.js +2 -2
  103. package/dist/esm/snk-configurator.entry.js +2 -1
  104. package/dist/esm/snk-crud.entry.js +21 -9
  105. package/dist/esm/snk-data-exporter.entry.js +2 -2
  106. package/dist/esm/{snk-data-unit-77508763.js → snk-data-unit-3ab57d1a.js} +4 -4
  107. package/dist/esm/snk-data-unit.entry.js +1 -1
  108. package/dist/esm/snk-detail-view.entry.js +11 -10
  109. package/dist/esm/snk-entity-list.entry.js +0 -4
  110. package/dist/esm/snk-filter-bar.entry.js +15 -17
  111. package/dist/esm/snk-filter-detail.entry.js +2 -16
  112. package/dist/esm/snk-filter-modal-item.entry.js +7 -20
  113. package/dist/esm/snk-form-config.entry.js +8 -18
  114. package/dist/esm/snk-form-view.entry.js +6 -1
  115. package/dist/esm/snk-form.entry.js +13 -8
  116. package/dist/esm/snk-grid-config.entry.js +6 -6
  117. package/dist/esm/snk-grid.entry.js +18 -20
  118. package/dist/esm/{snk-guides-viewer-c47cd45e.js → snk-guides-viewer-3ea14ab4.js} +12 -7
  119. package/dist/esm/snk-guides-viewer.entry.js +7 -8
  120. package/dist/esm/snk-personalized-filter.entry.js +14 -16
  121. package/dist/esm/snk-print-selector.entry.js +1 -1
  122. package/dist/esm/snk-simple-crud.entry.js +5 -61
  123. package/dist/esm/snk-taskbar.entry.js +2 -1
  124. package/dist/sankhyablocks/{p-e7e54737.entry.js → p-05bcad8a.entry.js} +1 -1
  125. package/dist/sankhyablocks/p-0ae5b923.entry.js +1 -0
  126. package/dist/sankhyablocks/p-15230263.js +1 -0
  127. package/dist/sankhyablocks/p-18fa618e.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-0ed0fc02.entry.js → p-1b81c379.entry.js} +1 -1
  129. package/dist/sankhyablocks/{p-98f9d076.js → p-2dd0f891.js} +2 -2
  130. package/dist/sankhyablocks/p-330f584a.entry.js +1 -0
  131. package/dist/sankhyablocks/{p-968741cc.js → p-48a40939.js} +1 -1
  132. package/dist/sankhyablocks/p-4c33a77c.entry.js +1 -0
  133. package/dist/sankhyablocks/p-53884b5f.entry.js +1 -0
  134. package/dist/sankhyablocks/{p-df8621b4.js → p-60791bb6.js} +1 -1
  135. package/dist/sankhyablocks/{p-f88c45bf.js → p-64c2cec3.js} +1 -1
  136. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  137. package/dist/sankhyablocks/p-70e785db.entry.js +1 -0
  138. package/dist/sankhyablocks/{p-0a4c753d.js → p-85affa29.js} +1 -1
  139. package/dist/sankhyablocks/p-861a3495.entry.js +1 -0
  140. package/dist/sankhyablocks/p-878b0dd3.entry.js +1 -0
  141. package/dist/sankhyablocks/p-97d2fbd9.entry.js +1 -0
  142. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  143. package/dist/sankhyablocks/p-9d591463.js +1 -0
  144. package/dist/sankhyablocks/p-9d93da18.js +56 -0
  145. package/dist/sankhyablocks/{p-34085ced.entry.js → p-9f387187.entry.js} +1 -1
  146. package/dist/sankhyablocks/p-aa4c112f.entry.js +11 -0
  147. package/dist/sankhyablocks/p-bae87498.entry.js +1 -0
  148. package/dist/sankhyablocks/{p-2ac9c585.js → p-bee6b5d7.js} +1 -1
  149. package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
  150. package/dist/sankhyablocks/p-cc67bd06.entry.js +1 -0
  151. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  152. package/dist/sankhyablocks/p-e070d7a3.entry.js +1 -0
  153. package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
  154. package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
  155. package/dist/sankhyablocks/{p-7b8b8ae9.js → p-f737f7e1.js} +1 -1
  156. package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
  157. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  158. package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
  159. package/dist/types/components/snk-application/snk-application.d.ts +8 -13
  160. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  161. package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
  162. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +8 -0
  163. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
  164. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +9 -2
  165. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +2 -2
  166. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  167. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  168. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  169. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
  170. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  171. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  172. package/dist/types/components/snk-form/snk-form.d.ts +9 -1
  173. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  174. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -1
  175. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  176. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  177. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
  178. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
  179. package/dist/types/components.d.ts +125 -21
  180. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  181. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -7
  182. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
  183. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  184. package/dist/types/lib/utils/urlutils.d.ts +14 -0
  185. package/package.json +3 -3
  186. package/dist/cjs/filter-bar-config-fetcher-2b8ed9d0.js +0 -155
  187. package/dist/components/filter-bar-config-fetcher.js +0 -153
  188. package/dist/esm/filter-bar-config-fetcher-06e02851.js +0 -153
  189. package/dist/esm/resource-fetcher-768d5556.js +0 -66
  190. package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
  191. package/dist/sankhyablocks/p-22c6fe1a.entry.js +0 -1
  192. package/dist/sankhyablocks/p-34a1357a.entry.js +0 -1
  193. package/dist/sankhyablocks/p-4721c3db.js +0 -1
  194. package/dist/sankhyablocks/p-6759adae.entry.js +0 -1
  195. package/dist/sankhyablocks/p-7e285d6c.entry.js +0 -11
  196. package/dist/sankhyablocks/p-815a42c0.entry.js +0 -1
  197. package/dist/sankhyablocks/p-8a41172a.entry.js +0 -1
  198. package/dist/sankhyablocks/p-8f8184ff.js +0 -56
  199. package/dist/sankhyablocks/p-976e56e9.js +0 -1
  200. package/dist/sankhyablocks/p-bc735728.entry.js +0 -1
  201. package/dist/sankhyablocks/p-be684b38.entry.js +0 -1
  202. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  203. package/dist/sankhyablocks/p-c0f656af.entry.js +0 -1
  204. package/dist/sankhyablocks/p-c44f6aaf.entry.js +0 -1
  205. package/dist/sankhyablocks/p-c57bd935.entry.js +0 -1
  206. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  207. package/dist/sankhyablocks/p-cfd7da4a.entry.js +0 -1
  208. package/dist/sankhyablocks/p-d1b89765.js +0 -1
  209. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  210. package/dist/sankhyablocks/p-e28129aa.entry.js +0 -1
  211. package/dist/sankhyablocks/p-f31bfdee.entry.js +0 -1
  212. package/dist/sankhyablocks/p-fe010e54.entry.js +0 -1
@@ -47,6 +47,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
47
47
  this.__registerHost();
48
48
  this.exit = createEvent(this, "exit", 7);
49
49
  this.actionClick = createEvent(this, "actionClick", 7);
50
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
50
51
  this._guideBuilders = new Map();
51
52
  this.dataUnit = undefined;
52
53
  this.dataState = undefined;
@@ -60,6 +61,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
60
61
  this.messagesBuilder = undefined;
61
62
  this.canEdit = true;
62
63
  this.presentationMode = undefined;
64
+ this.resourceID = undefined;
63
65
  this._breadcrumbItems = [];
64
66
  this._guides = undefined;
65
67
  this._formEditorConfigManager = undefined;
@@ -261,7 +263,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
261
263
  else {
262
264
  detailBranch = this.selectedGuide;
263
265
  }
264
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
266
+ content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID }));
265
267
  }
266
268
  else {
267
269
  const cardId = this.selectedGuide.id;
@@ -310,7 +312,10 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
310
312
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
311
313
  }
312
314
  componentWillLoad() {
313
- this._configManager = new SnkFormConfigManager(this.configName, config => this.masterFormConfig = config);
315
+ if (this.resourceID == undefined) {
316
+ throw new Error("Erro interno: resourceID não informado");
317
+ }
318
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
314
319
  this._configManager.loadConfig();
315
320
  }
316
321
  componentDidRender() {
@@ -329,7 +334,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
329
334
  }
330
335
  buildTaskBar() {
331
336
  var _a;
332
- return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit }));
337
+ return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID }));
333
338
  }
334
339
  render() {
335
340
  var _a, _b;
@@ -348,7 +353,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
348
353
  h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
349
354
  h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
350
355
  :
351
- h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail) })));
356
+ h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
352
357
  }
353
358
  static get watchers() { return {
354
359
  "dataUnit": ["observeDataUnit"],
@@ -357,7 +362,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
357
362
  }; }
358
363
  static get style() { return snkGuidesViewerCss; }
359
364
  }, [2, "snk-guides-viewer", {
360
- "_guideBuilders": [16],
361
365
  "dataUnit": [16],
362
366
  "dataState": [16],
363
367
  "configName": [1, "config-name"],
@@ -370,6 +374,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
370
374
  "messagesBuilder": [1040],
371
375
  "canEdit": [4, "can-edit"],
372
376
  "presentationMode": [1, "presentation-mode"],
377
+ "resourceID": [1, "resource-i-d"],
373
378
  "_breadcrumbItems": [32],
374
379
  "_guides": [32],
375
380
  "_formEditorConfigManager": [32],
@@ -586,11 +591,13 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
586
591
  this.__registerHost();
587
592
  this.snkDetailGuidesChange = createEvent(this, "snkDetailGuidesChange", 7);
588
593
  this.snkSwitchGuide = createEvent(this, "snkSwitchGuide", 7);
594
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
589
595
  this._disabledButtons = undefined;
590
596
  this._currentView = undefined;
591
597
  this.attachmentRegisterKey = undefined;
592
598
  this.formConfigManager = undefined;
593
599
  this.dataUnitName = undefined;
600
+ this.resourceID = undefined;
594
601
  this.guideItemPath = undefined;
595
602
  this.entityName = undefined;
596
603
  this.label = undefined;
@@ -760,7 +767,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
760
767
  }
761
768
  componentWillLoad() {
762
769
  this._configName = `dynaform.${this.entityName}`;
763
- this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
770
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
764
771
  this.formConfigManager.loadConfig();
765
772
  if (this.messagesBuilder == undefined) {
766
773
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -769,7 +776,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
769
776
  render() {
770
777
  this.updateLabel();
771
778
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
772
- return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
779
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
773
780
  }
774
781
  static get watchers() { return {
775
782
  "dataState": ["observerDataState"]
@@ -778,6 +785,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
778
785
  }, [2, "snk-detail-view", {
779
786
  "formConfigManager": [1040],
780
787
  "dataUnitName": [1, "data-unit-name"],
788
+ "resourceID": [1, "resource-i-d"],
781
789
  "guideItemPath": [16],
782
790
  "entityName": [1, "entity-name"],
783
791
  "label": [1],
@@ -8,7 +8,6 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
8
8
  super();
9
9
  this.__registerHost();
10
10
  this.valueChanged = createEvent(this, "valueChanged", 7);
11
- this.saveConfig = createEvent(this, "saveConfig", 7);
12
11
  this._searchValue = undefined;
13
12
  this._ezListSource = [];
14
13
  this.config = undefined;
@@ -17,7 +16,6 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
17
16
  }
18
17
  async reloadList() {
19
18
  this.loadListSource();
20
- this.saveConfig.emit(this.config);
21
19
  }
22
20
  observeConfig() {
23
21
  var _a, _b;
@@ -33,7 +31,6 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
33
31
  }
34
32
  });
35
33
  this.config = ObjectUtils.copy(configCopy);
36
- this.saveConfig.emit(this.config);
37
34
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
38
35
  }
39
36
  loadListSource() {
@@ -90,7 +87,6 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
90
87
  }
91
88
  ] });
92
89
  this.loadListSource();
93
- this.saveConfig.emit(this.config);
94
90
  this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
95
91
  }
96
92
  }
@@ -208,6 +208,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
208
208
  };
209
209
  this.dataUnit = undefined;
210
210
  this.configName = undefined;
211
+ this.resourceID = undefined;
211
212
  this.filterConfig = undefined;
212
213
  this.messagesBuilder = undefined;
213
214
  this.allowDefault = undefined;
@@ -283,11 +284,11 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
283
284
  return;
284
285
  }
285
286
  this._loadingPending = false;
286
- this.dataUnit.loadData();
287
+ this.dataUnit.loadData(undefined, undefined, true);
287
288
  }
288
289
  if (this._configUpdated) {
289
290
  this._configUpdated = false;
290
- ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
291
+ ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
291
292
  }
292
293
  }
293
294
  /**
@@ -403,15 +404,13 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
403
404
  }
404
405
  loadConfigFromStorage() {
405
406
  return new Promise(accept => {
406
- ConfigStorage.get().then(instance => {
407
- instance.loadFilterBarConfig(this.configName, { contextURI: this.dataUnit.name })
408
- .then((filters) => {
409
- accept();
410
- this.filterConfig = filters.map(item => this.normalizeItem(item));
411
- })
412
- .catch(reason => {
413
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
414
- });
407
+ ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
408
+ .then((filters) => {
409
+ accept();
410
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
411
+ })
412
+ .catch(reason => {
413
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
415
414
  });
416
415
  });
417
416
  }
@@ -496,7 +495,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
496
495
  return undefined;
497
496
  }
498
497
  if (this.showPersonalizedFilter) {
499
- return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
498
+ return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
500
499
  }
501
500
  return (h(Host, null, h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
502
501
  }
@@ -508,6 +507,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
508
507
  }, [2, "snk-filter-bar", {
509
508
  "dataUnit": [1040],
510
509
  "configName": [1, "config-name"],
510
+ "resourceID": [1, "resource-i-d"],
511
511
  "filterConfig": [1040],
512
512
  "messagesBuilder": [1040],
513
513
  "allowDefault": [32],
@@ -1,8 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
2
2
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
3
  import { F as FilterItemType } from './filter-item-type.enum.js';
4
- import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
5
- import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher.js';
4
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
6
5
  import { E as EPresentationMode } from './presentationMode.js';
7
6
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
8
7
 
@@ -28,7 +27,6 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
28
27
  }
29
28
  componentDidLoad() {
30
29
  if (this._element) {
31
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
32
30
  ElementIDUtils.addIDInfo(this._element);
33
31
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
34
32
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
@@ -146,20 +144,12 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
146
144
  this.config = ObjectUtils.copy(configCopy);
147
145
  }
148
146
  }
149
- saveConfig(newConfig) {
150
- var _a;
151
- (_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
152
- const fetcher = new FilterBarConfigFetcher();
153
- fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
154
- this.config = newConfig;
155
- });
156
- }
157
147
  componentWillLoad() {
158
148
  this.originalConfig = ObjectUtils.copy(this.config);
159
149
  }
160
150
  render() {
161
151
  const { tag: CustomElement, props } = this.getContentEditor();
162
- return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, onSaveConfig: evt => this.saveConfig(evt.detail), rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
152
+ return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
163
153
  }
164
154
  get _element() { return this; }
165
155
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
2
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum.js';
4
4
  import { E as EPresentationMode } from './presentationMode.js';
5
5
  import { C as ConfigStorage } from './ConfigStorage.js';
@@ -23,14 +23,13 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
23
23
  this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
24
24
  this.filterItem = undefined;
25
25
  this.configName = undefined;
26
+ this.resourceID = undefined;
26
27
  }
27
28
  observeFilterItem(newValue) {
28
29
  var _a, _b;
29
30
  this._editor && (this._editor["config"] = newValue);
30
31
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
31
32
  this.filterChange.emit(newValue);
32
- //isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
33
- //this.saveConfig();
34
33
  }
35
34
  getContentEditorConfig() {
36
35
  const props = { presentationMode: EPresentationMode.MODAL };
@@ -72,11 +71,10 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
72
71
  else {
73
72
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
74
73
  }
75
- this.saveConfig();
76
74
  }
77
75
  handleDeleteFilter(filter, filterItemType) {
78
76
  if (filterItemType === FilterItemType.PERSONALIZED) {
79
- ConfigStorage.removePersonalizedFilter(filter, this.configName);
77
+ ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
80
78
  }
81
79
  }
82
80
  componentDidLoad() {
@@ -84,7 +82,6 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
84
82
  ElementIDUtils.addIDInfo(this._element);
85
83
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
86
84
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
87
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
88
85
  }
89
86
  }
90
87
  buildRightSlot(item) {
@@ -101,15 +98,6 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
101
98
  const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType$1;
102
99
  return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
103
100
  }
104
- saveConfig() {
105
- //Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
106
- /*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
107
-
108
- this._application?.getResourceID().then(resourceId => {
109
- const fetcher = new FilterBarConfigFetcher();
110
- fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
111
- });*/
112
- }
113
101
  render() {
114
102
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
115
103
  return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
@@ -121,7 +109,8 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
121
109
  static get style() { return snkFilterModalItemCss; }
122
110
  }, [0, "snk-filter-modal-item", {
123
111
  "filterItem": [1040],
124
- "configName": [1025, "config-name"]
112
+ "configName": [1025, "config-name"],
113
+ "resourceID": [1, "resource-i-d"]
125
114
  }]);
126
115
  function defineCustomElement() {
127
116
  if (typeof customElements === "undefined") {
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { a as draggable_bundle, d as defineCustomElement$1 } from './snk-tab-config2.js';
3
- import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
3
+ import { ObjectUtils, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { C as CONFIG_EVENTS, b as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants.js';
6
6
  import { U as UserConfigType } from './form-config-fetcher.js';
@@ -452,13 +452,10 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
452
452
  this._sortableGroup.on(CONFIG_EVENTS.dragStop, (evt) => this.controlStopDraggingGroup(evt));
453
453
  }
454
454
  loadUserConfig() {
455
- if (this._applicationResourceID == undefined) {
456
- return;
457
- }
458
455
  if (this.configManager == undefined) {
459
456
  return;
460
457
  }
461
- this.configManager.fetchUserAvailableConfigs(this._applicationResourceID)
458
+ this.configManager.fetchUserAvailableConfigs()
462
459
  .then((userConfig) => {
463
460
  this._formConfigOptions = userConfig;
464
461
  if (this._formConfigOptions == undefined) {
@@ -512,9 +509,6 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
512
509
  }
513
510
  }
514
511
  async loadConfigByUser() {
515
- if (this._applicationResourceID == undefined) {
516
- return;
517
- }
518
512
  if (this.configManager == undefined) {
519
513
  return;
520
514
  }
@@ -524,10 +518,10 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
524
518
  let config;
525
519
  switch (this._optionFormConfigSelected.origin) {
526
520
  case UserConfigType.DEFAULT:
527
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
521
+ config = await this.configManager.fetchDefaultConfig();
528
522
  break;
529
523
  case UserConfigType.DEFAULT:
530
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
524
+ config = await this.configManager.fetchDefaultConfig();
531
525
  break;
532
526
  }
533
527
  if (config != undefined) {
@@ -943,11 +937,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
943
937
  this.controlSortableGroup();
944
938
  }
945
939
  componentWillLoad() {
946
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
947
- this._application.getResourceID().then(resourceID => {
948
- this._applicationResourceID = resourceID;
949
- this.loadConfig();
950
- });
940
+ this.loadConfig();
951
941
  }
952
942
  componentDidLoad() {
953
943
  const dataInfo = { dataUnit: this.dataUnit };
@@ -10,6 +10,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
10
  super();
11
11
  this.__registerHost();
12
12
  this.snkContentCardChanged = createEvent(this, "snkContentCardChanged", 7);
13
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
13
14
  this.levelPath = undefined;
14
15
  this.label = undefined;
15
16
  this.name = undefined;
@@ -77,6 +78,10 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
77
78
  this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
78
79
  }
79
80
  }
81
+ handleFormItemsReady(event) {
82
+ event.stopPropagation();
83
+ this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
84
+ }
80
85
  disconnectedCallback() {
81
86
  if (this._dataBinder != undefined) {
82
87
  this._dataBinder.onDisconnectedCallback();
@@ -89,7 +94,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
89
94
  ?
90
95
  h("snk-form-summary", { summary: this.getCardSummary() })
91
96
  :
92
- h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
97
+ h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
93
98
  }
94
99
  static get style() { return snkFormViewCss; }
95
100
  }, [6, "snk-form-view", {
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager.js';
4
+ import { R as ResourceIDUtils } from './ResourceIDUtils.js';
4
5
  import { d as defineCustomElement$5 } from './snk-config-options2.js';
5
6
  import { d as defineCustomElement$4 } from './snk-field-config2.js';
6
7
  import { d as defineCustomElement$3 } from './snk-form-config2.js';
@@ -14,6 +15,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
14
15
  this.__registerHost();
15
16
  this.exit = createEvent(this, "exit", 7);
16
17
  this.actionClick = createEvent(this, "actionClick", 7);
18
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
17
19
  this._dataUnit = undefined;
18
20
  this._dataState = undefined;
19
21
  this._showFormConfig = false;
@@ -21,6 +23,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
23
  this.configName = undefined;
22
24
  this.recordsValidator = undefined;
23
25
  this.messagesBuilder = undefined;
26
+ this.resourceID = undefined;
24
27
  }
25
28
  /**
26
29
  * Exibe a janela de configurações do formulário.
@@ -41,7 +44,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
41
44
  const dataInfo = { dataUnit: this._dataUnit };
42
45
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
43
46
  }
44
- componentWillLoad() {
47
+ async componentWillLoad() {
45
48
  let parent = this._element.parentElement;
46
49
  while (parent) {
47
50
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -63,7 +66,10 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
63
66
  }
64
67
  parent = parent.parentElement;
65
68
  }
66
- this._configManager = new SnkFormConfigManager(this.configName);
69
+ if (this.resourceID == undefined) {
70
+ this.resourceID = await ResourceIDUtils.getResourceID();
71
+ }
72
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
67
73
  this._configManager.loadConfig();
68
74
  }
69
75
  render() {
@@ -79,6 +85,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
79
85
  "configName": [1, "config-name"],
80
86
  "recordsValidator": [16],
81
87
  "messagesBuilder": [1040],
88
+ "resourceID": [1, "resource-i-d"],
82
89
  "_dataUnit": [32],
83
90
  "_dataState": [32],
84
91
  "_showFormConfig": [32],
@@ -25,6 +25,7 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
25
25
  this.columns = undefined;
26
26
  this.config = undefined;
27
27
  this.configName = undefined;
28
+ this.resourceID = undefined;
28
29
  }
29
30
  /* Creation Methods */
30
31
  /**
@@ -248,7 +249,7 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
248
249
  }
249
250
  }
250
251
  _newConfig.columns = _newColumnConfigList;
251
- ConfigStorage.saveGridConfig(_newConfig, this.configName)
252
+ ConfigStorage.saveGridConfig(_newConfig, this.configName, this.resourceID)
252
253
  .then((savedConfig) => {
253
254
  this.configChange.emit(savedConfig);
254
255
  this._orderList.clearHistory();
@@ -475,7 +476,8 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
475
476
  "application": [16],
476
477
  "columns": [1040],
477
478
  "config": [1040],
478
- "configName": [1, "config-name"]
479
+ "configName": [1, "config-name"],
480
+ "resourceID": [1, "resource-i-d"]
479
481
  }]);
480
482
  function defineCustomElement() {
481
483
  if (typeof customElements === "undefined") {
@@ -4,7 +4,7 @@ import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMeta
4
4
  import { d as defineCustomElement$1, T as TaskbarElement } from './snk-taskbar2.js';
5
5
  import { C as ConfigStorage } from './ConfigStorage.js';
6
6
  import { P as PresentationMode } from './index2.js';
7
- import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
7
+ import { T as TaskbarProcessor, S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource.js';
8
8
  import { s as store } from './index3.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
10
  import { d as defineCustomElement$h } from './snk-actions-button2.js';
@@ -32,7 +32,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
32
32
  this.__registerHost();
33
33
  this.actionClick = createEvent(this, "actionClick", 7);
34
34
  this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
35
- this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
36
35
  this._topTaskbarProcessor = new TaskbarProcessor({
37
36
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
38
37
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
@@ -49,7 +48,9 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
49
48
  this._dataState = undefined;
50
49
  this._gridConfig = undefined;
51
50
  this._popUpGridConfig = false;
51
+ this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
52
52
  this.configName = undefined;
53
+ this.resourceID = undefined;
53
54
  this.selectionToastConfig = undefined;
54
55
  this.actionsList = undefined;
55
56
  this.isDetail = undefined;
@@ -108,20 +109,17 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
108
109
  this._gridConfig = config;
109
110
  }
110
111
  loadConfig() {
111
- ConfigStorage.get()
112
- .then((instance) => {
113
- instance.loadGridConfig(this.configName)
114
- .then((config) => {
115
- this.setGridConfig(config);
116
- })
117
- .catch((error) => {
118
- console.warn(error);
119
- });
112
+ ConfigStorage.loadGridConfig(this.configName, this.resourceID)
113
+ .then((config) => {
114
+ this.setGridConfig(config);
115
+ })
116
+ .catch((error) => {
117
+ console.warn(error);
120
118
  });
121
119
  }
122
120
  gridConfigChangeHandler(evt) {
123
121
  const config = evt.detail;
124
- ConfigStorage.saveGridConfig(config, this.configName);
122
+ ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
125
123
  evt.stopPropagation();
126
124
  }
127
125
  modalConfigChangeHandler(evt) {
@@ -234,10 +232,11 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
234
232
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
235
233
  }
236
234
  finshLoading() {
235
+ var _a, _b;
237
236
  this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
238
237
  this.addElementID();
239
- this._multiSelectionListDataSource.setApplication(this._application);
240
- this._multiSelectionListDataSource.setDataUnit(this._dataUnit);
238
+ (_a = this.columnFilterDataSource) === null || _a === void 0 ? void 0 : _a.setApplication(this._application);
239
+ (_b = this.columnFilterDataSource) === null || _b === void 0 ? void 0 : _b.setDataUnit(this._dataUnit);
241
240
  }
242
241
  componentWillLoad() {
243
242
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
@@ -328,13 +327,15 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
328
327
  if (!this._dataUnit) {
329
328
  return undefined;
330
329
  }
331
- return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
332
- h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
330
+ return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
331
+ h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList, resourceID: this.resourceID })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
333
332
  }
334
333
  get _element() { return this; }
335
334
  static get style() { return snkGridCss; }
336
335
  }, [6, "snk-grid", {
336
+ "columnFilterDataSource": [1040],
337
337
  "configName": [1, "config-name"],
338
+ "resourceID": [1, "resource-i-d"],
338
339
  "selectionToastConfig": [16],
339
340
  "actionsList": [16],
340
341
  "isDetail": [4, "is-detail"],