@sankhyalabs/sankhyablocks 8.2.0-dev.1 → 8.2.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 (222) 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/{auth-fetcher-319a4cb2.js → auth-fetcher-d407c31c.js} +2 -2
  5. package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-15a7cc88.js} +1 -1
  6. package/dist/cjs/filter-bar-config-fetcher-24548cec.js +155 -0
  7. package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-ab3ce222.js} +3 -66
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-96c042aa.js} +1 -1
  10. package/dist/cjs/resource-fetcher-64102551.js +68 -0
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +11 -18
  13. package/dist/cjs/snk-application.cjs.entry.js +44 -49
  14. package/dist/cjs/snk-attach.cjs.entry.js +13 -7
  15. package/dist/cjs/snk-configurator.cjs.entry.js +1 -2
  16. package/dist/cjs/snk-crud.cjs.entry.js +10 -25
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  18. package/dist/cjs/{snk-data-unit-80a00ae4.js → snk-data-unit-e89e07bd.js} +3 -4
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +12 -14
  21. package/dist/cjs/snk-entity-list.cjs.entry.js +4 -0
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -14
  23. package/dist/cjs/snk-filter-detail.cjs.entry.js +15 -1
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +19 -5
  25. package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
  26. package/dist/cjs/snk-form-view.cjs.entry.js +1 -6
  27. package/dist/cjs/snk-form.cjs.entry.js +8 -12
  28. package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
  29. package/dist/cjs/snk-grid.cjs.entry.js +20 -17
  30. package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-8518c61b.js} +7 -17
  31. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  32. package/dist/cjs/snk-personalized-filter.cjs.entry.js +16 -13
  33. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  34. package/dist/cjs/snk-simple-crud.cjs.entry.js +72 -20
  35. package/dist/cjs/snk-taskbar.cjs.entry.js +1 -2
  36. package/dist/collection/components/snk-actions-button/actions/index.js +4 -3
  37. package/dist/collection/components/snk-actions-button/snk-actions-button.js +4 -8
  38. package/dist/collection/components/snk-application/snk-application.js +65 -60
  39. package/dist/collection/components/snk-configurator/snk-configurator.js +1 -19
  40. package/dist/collection/components/snk-crud/snk-crud.js +6 -40
  41. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -42
  42. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +1 -27
  43. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +28 -47
  44. package/dist/collection/components/snk-data-unit/snk-data-unit.js +4 -21
  45. package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -0
  46. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +12 -2
  47. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  48. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +16 -21
  49. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -28
  50. package/dist/collection/components/snk-form/SnkFormConfigManager.js +19 -17
  51. package/dist/collection/components/snk-form/snk-form.js +2 -46
  52. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +15 -5
  53. package/dist/collection/components/snk-grid/snk-grid.js +15 -51
  54. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +1 -19
  55. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +12 -28
  56. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +0 -22
  57. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -19
  58. package/dist/collection/lib/configs/ConfigStorage.js +44 -33
  59. package/dist/collection/lib/dataUnit/InMemoryLoader.js +59 -2
  60. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -38
  61. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +24 -0
  62. package/dist/collection/lib/index.js +0 -10
  63. package/dist/collection/lib/utils/urlutils.js +0 -29
  64. package/dist/components/ConfigStorage.js +48 -161
  65. package/dist/components/DataFetcher.js +29 -67
  66. package/dist/components/SnkFormConfigManager.js +19 -17
  67. package/dist/components/auth-fetcher.js +1 -1
  68. package/dist/components/filter-bar-config-fetcher.js +153 -0
  69. package/dist/components/form-config-fetcher.js +2 -64
  70. package/dist/components/resource-fetcher.js +66 -0
  71. package/dist/components/snk-actions-button2.js +9 -23
  72. package/dist/components/snk-application2.js +128 -134
  73. package/dist/components/snk-attach2.js +8 -1
  74. package/dist/components/snk-configurator2.js +1 -3
  75. package/dist/components/snk-crud.js +6 -23
  76. package/dist/components/snk-data-unit2.js +3 -5
  77. package/dist/components/snk-detail-view2.js +8 -20
  78. package/dist/components/snk-entity-list.js +4 -0
  79. package/dist/components/snk-filter-bar2.js +12 -12
  80. package/dist/components/snk-filter-detail2.js +12 -2
  81. package/dist/components/snk-filter-modal-item2.js +16 -5
  82. package/dist/components/snk-form-config2.js +15 -5
  83. package/dist/components/snk-form-view2.js +1 -6
  84. package/dist/components/snk-form.js +2 -9
  85. package/dist/components/snk-grid-config2.js +2 -4
  86. package/dist/components/snk-grid2.js +16 -17
  87. package/dist/components/snk-personalized-filter2.js +11 -11
  88. package/dist/components/snk-simple-crud2.js +60 -8
  89. package/dist/components/snk-taskbar2.js +1 -3
  90. package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-1090289a.js} +49 -162
  91. package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-a4ed43e7.js} +29 -67
  92. package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-de537eca.js} +21 -19
  93. package/dist/esm/{auth-fetcher-6d9664b7.js → auth-fetcher-c53e0d6c.js} +1 -1
  94. package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-8d0bfa4a.js} +1 -1
  95. package/dist/esm/filter-bar-config-fetcher-2417b8cf.js +153 -0
  96. package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-4065db9a.js} +3 -65
  97. package/dist/esm/loader.js +1 -1
  98. package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-7460b876.js} +1 -1
  99. package/dist/esm/resource-fetcher-45a70066.js +66 -0
  100. package/dist/esm/sankhyablocks.js +1 -1
  101. package/dist/esm/snk-actions-button.entry.js +11 -18
  102. package/dist/esm/snk-application.entry.js +44 -49
  103. package/dist/esm/snk-attach.entry.js +9 -3
  104. package/dist/esm/snk-configurator.entry.js +1 -2
  105. package/dist/esm/snk-crud.entry.js +10 -25
  106. package/dist/esm/snk-data-exporter.entry.js +2 -2
  107. package/dist/esm/{snk-data-unit-3ab57d1a.js → snk-data-unit-8c4d944d.js} +3 -4
  108. package/dist/esm/snk-data-unit.entry.js +1 -1
  109. package/dist/esm/snk-detail-view.entry.js +12 -14
  110. package/dist/esm/snk-entity-list.entry.js +4 -0
  111. package/dist/esm/snk-filter-bar.entry.js +17 -14
  112. package/dist/esm/snk-filter-detail.entry.js +16 -2
  113. package/dist/esm/snk-filter-modal-item.entry.js +20 -6
  114. package/dist/esm/snk-form-config.entry.js +18 -7
  115. package/dist/esm/snk-form-view.entry.js +1 -6
  116. package/dist/esm/snk-form.entry.js +8 -12
  117. package/dist/esm/snk-grid-config.entry.js +6 -5
  118. package/dist/esm/snk-grid.entry.js +20 -17
  119. package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-cdecff6e.js} +7 -17
  120. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  121. package/dist/esm/snk-personalized-filter.entry.js +16 -13
  122. package/dist/esm/snk-print-selector.entry.js +1 -1
  123. package/dist/esm/snk-simple-crud.entry.js +62 -10
  124. package/dist/esm/snk-taskbar.entry.js +1 -2
  125. package/dist/sankhyablocks/{p-d13c00b6.entry.js → p-0848ee4d.entry.js} +1 -1
  126. package/dist/sankhyablocks/p-0bd9c412.js +1 -0
  127. package/dist/sankhyablocks/p-0fb83448.js +1 -0
  128. package/dist/sankhyablocks/p-10b2aedc.entry.js +1 -0
  129. package/dist/sankhyablocks/p-1f63dcd4.entry.js +1 -0
  130. package/dist/sankhyablocks/p-216b2102.entry.js +1 -0
  131. package/dist/sankhyablocks/p-216f081a.entry.js +1 -0
  132. package/dist/sankhyablocks/{p-f8e6b97e.js → p-44e66c8d.js} +1 -1
  133. package/dist/sankhyablocks/p-4514fc6a.entry.js +1 -0
  134. package/dist/sankhyablocks/p-50c13cc8.entry.js +1 -0
  135. package/dist/sankhyablocks/p-52c6b2e7.js +1 -0
  136. package/dist/sankhyablocks/p-564efc43.js +1 -0
  137. package/dist/sankhyablocks/p-5994af77.js +56 -0
  138. package/dist/sankhyablocks/p-6bb904bb.entry.js +1 -0
  139. package/dist/sankhyablocks/p-6e06175e.entry.js +1 -0
  140. package/dist/sankhyablocks/p-6f0795c8.entry.js +1 -0
  141. package/dist/sankhyablocks/p-7588f006.entry.js +1 -0
  142. package/dist/sankhyablocks/p-847e6c20.js +17 -0
  143. package/dist/sankhyablocks/p-8f3652bf.entry.js +11 -0
  144. package/dist/sankhyablocks/p-9471cbc9.entry.js +1 -0
  145. package/dist/sankhyablocks/{p-14eac6fe.js → p-9d18017a.js} +1 -1
  146. package/dist/sankhyablocks/p-a42dd503.entry.js +1 -0
  147. package/dist/sankhyablocks/p-b04fb9d4.js +1 -0
  148. package/dist/sankhyablocks/{p-2d333d22.js → p-b978da60.js} +1 -1
  149. package/dist/sankhyablocks/p-befbc9ee.entry.js +1 -0
  150. package/dist/sankhyablocks/p-c32b9d7c.entry.js +1 -0
  151. package/dist/sankhyablocks/p-c6380ea2.entry.js +1 -0
  152. package/dist/sankhyablocks/{p-03bb1aea.entry.js → p-c6feb995.entry.js} +1 -1
  153. package/dist/sankhyablocks/p-d7c7a289.entry.js +1 -0
  154. package/dist/sankhyablocks/p-de69b4b0.entry.js +1 -0
  155. package/dist/sankhyablocks/p-f3b7b69e.js +10 -0
  156. package/dist/sankhyablocks/p-f7eded3a.entry.js +1 -0
  157. package/dist/sankhyablocks/p-ff7383b0.entry.js +1 -0
  158. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  159. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -2
  160. package/dist/types/components/snk-application/snk-application.d.ts +13 -8
  161. package/dist/types/components/snk-configurator/snk-configurator.d.ts +0 -4
  162. package/dist/types/components/snk-crud/snk-crud.d.ts +0 -5
  163. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -8
  164. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +0 -5
  165. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +2 -9
  166. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -4
  167. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +4 -0
  168. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +3 -0
  169. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  170. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +4 -5
  171. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
  172. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +4 -5
  173. package/dist/types/components/snk-form/snk-form.d.ts +1 -9
  174. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +2 -0
  175. package/dist/types/components/snk-grid/snk-grid.d.ts +1 -5
  176. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +0 -4
  177. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +1 -5
  178. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -4
  179. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
  180. package/dist/types/components.d.ts +21 -125
  181. package/dist/types/lib/configs/ConfigStorage.d.ts +13 -11
  182. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +7 -0
  183. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  184. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +1 -0
  185. package/dist/types/lib/index.d.ts +0 -11
  186. package/dist/types/lib/utils/urlutils.d.ts +0 -14
  187. package/package.json +2 -2
  188. package/dist/cjs/ISave-d68ce3cd.js +0 -8
  189. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +0 -12
  190. package/dist/collection/lib/resourceid/ResourceIDUtils.js +0 -7
  191. package/dist/components/ResourceIDUtils.js +0 -10
  192. package/dist/esm/ISave-4412b20c.js +0 -8
  193. package/dist/esm/ResourceIDUtils-a114189a.js +0 -10
  194. package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
  195. package/dist/sankhyablocks/p-05dbc70e.entry.js +0 -1
  196. package/dist/sankhyablocks/p-41e897f1.js +0 -56
  197. package/dist/sankhyablocks/p-48a40939.js +0 -1
  198. package/dist/sankhyablocks/p-611aa624.entry.js +0 -1
  199. package/dist/sankhyablocks/p-66bb8c20.entry.js +0 -1
  200. package/dist/sankhyablocks/p-688dcb4c.js +0 -1
  201. package/dist/sankhyablocks/p-6f154396.entry.js +0 -1
  202. package/dist/sankhyablocks/p-787071a8.js +0 -1
  203. package/dist/sankhyablocks/p-8481bb59.entry.js +0 -1
  204. package/dist/sankhyablocks/p-8818d8f6.entry.js +0 -1
  205. package/dist/sankhyablocks/p-93f6ca04.entry.js +0 -1
  206. package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
  207. package/dist/sankhyablocks/p-9e7d65a4.js +0 -1
  208. package/dist/sankhyablocks/p-a52a6c9d.js +0 -26
  209. package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
  210. package/dist/sankhyablocks/p-c555075c.entry.js +0 -1
  211. package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
  212. package/dist/sankhyablocks/p-d53a9169.entry.js +0 -1
  213. package/dist/sankhyablocks/p-d7638f45.entry.js +0 -11
  214. package/dist/sankhyablocks/p-e086cc2a.entry.js +0 -1
  215. package/dist/sankhyablocks/p-e64f3e17.entry.js +0 -1
  216. package/dist/sankhyablocks/p-ed41b38c.js +0 -1
  217. package/dist/sankhyablocks/p-ed705cbb.entry.js +0 -1
  218. package/dist/sankhyablocks/p-efc10705.entry.js +0 -1
  219. package/dist/sankhyablocks/p-f74fe358.js +0 -1
  220. package/dist/sankhyablocks/p-f91e0c5d.entry.js +0 -1
  221. package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
  222. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +0 -3
@@ -5,15 +5,11 @@ import './DataFetcher.js';
5
5
  import './pesquisa-fetcher.js';
6
6
  import { ElementIDUtils } from '@sankhyalabs/core';
7
7
  import { P as PresentationMode } from './index2.js';
8
- import { d as defineCustomElement$t } from './snk-actions-button2.js';
9
- import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './filter-item-type.enum.js';
12
- import './form-config-fetcher.js';
13
8
  import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
14
9
  import { V as VIEW_MODE } from './constants.js';
15
10
  import { T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
16
11
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
12
+ import { d as defineCustomElement$t } from './snk-actions-button2.js';
17
13
  import { d as defineCustomElement$s } from './snk-attach2.js';
18
14
  import { d as defineCustomElement$r } from './snk-config-options2.js';
19
15
  import { d as defineCustomElement$q } from './snk-configurator2.js';
@@ -51,7 +47,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
51
47
  this.__registerHost();
52
48
  this.exit = createEvent(this, "exit", 7);
53
49
  this.actionClick = createEvent(this, "actionClick", 7);
54
- this.formItemsReady = createEvent(this, "formItemsReady", 7);
55
50
  this._guideBuilders = new Map();
56
51
  this.dataUnit = undefined;
57
52
  this.dataState = undefined;
@@ -65,7 +60,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
65
60
  this.messagesBuilder = undefined;
66
61
  this.canEdit = true;
67
62
  this.presentationMode = undefined;
68
- this.resourceID = undefined;
69
63
  this._breadcrumbItems = [];
70
64
  this._guides = undefined;
71
65
  this._formEditorConfigManager = undefined;
@@ -267,7 +261,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
267
261
  else {
268
262
  detailBranch = this.selectedGuide;
269
263
  }
270
- 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 }));
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) }));
271
265
  }
272
266
  else {
273
267
  const cardId = this.selectedGuide.id;
@@ -316,10 +310,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
316
310
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
317
311
  }
318
312
  componentWillLoad() {
319
- if (this.resourceID == undefined) {
320
- throw new Error("Erro interno: resourceID não informado");
321
- }
322
- this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
313
+ this._configManager = new SnkFormConfigManager(this.configName, config => this.masterFormConfig = config);
323
314
  this._configManager.loadConfig();
324
315
  }
325
316
  componentDidRender() {
@@ -338,7 +329,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
338
329
  }
339
330
  buildTaskBar() {
340
331
  var _a;
341
- 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 }));
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 }));
342
333
  }
343
334
  render() {
344
335
  var _a, _b;
@@ -357,7 +348,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
357
348
  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 ?
358
349
  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) })
359
350
  :
360
- 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 })));
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) })));
361
352
  }
362
353
  static get watchers() { return {
363
354
  "dataUnit": ["observeDataUnit"],
@@ -366,6 +357,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
366
357
  }; }
367
358
  static get style() { return snkGuidesViewerCss; }
368
359
  }, [2, "snk-guides-viewer", {
360
+ "_guideBuilders": [16],
369
361
  "dataUnit": [16],
370
362
  "dataState": [16],
371
363
  "configName": [1, "config-name"],
@@ -378,7 +370,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
378
370
  "messagesBuilder": [1040],
379
371
  "canEdit": [4, "can-edit"],
380
372
  "presentationMode": [1, "presentation-mode"],
381
- "resourceID": [1, "resource-i-d"],
382
373
  "_breadcrumbItems": [32],
383
374
  "_guides": [32],
384
375
  "_formEditorConfigManager": [32],
@@ -595,13 +586,11 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
595
586
  this.__registerHost();
596
587
  this.snkDetailGuidesChange = createEvent(this, "snkDetailGuidesChange", 7);
597
588
  this.snkSwitchGuide = createEvent(this, "snkSwitchGuide", 7);
598
- this.formItemsReady = createEvent(this, "formItemsReady", 7);
599
589
  this._disabledButtons = undefined;
600
590
  this._currentView = undefined;
601
591
  this.attachmentRegisterKey = undefined;
602
592
  this.formConfigManager = undefined;
603
593
  this.dataUnitName = undefined;
604
- this.resourceID = undefined;
605
594
  this.guideItemPath = undefined;
606
595
  this.entityName = undefined;
607
596
  this.label = undefined;
@@ -771,7 +760,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
771
760
  }
772
761
  componentWillLoad() {
773
762
  this._configName = `dynaform.${this.entityName}`;
774
- this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
763
+ this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
775
764
  this.formConfigManager.loadConfig();
776
765
  if (this.messagesBuilder == undefined) {
777
766
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -780,7 +769,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
780
769
  render() {
781
770
  this.updateLabel();
782
771
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
783
- 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) }))))));
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) }))))));
784
773
  }
785
774
  static get watchers() { return {
786
775
  "dataState": ["observerDataState"]
@@ -789,7 +778,6 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
789
778
  }, [2, "snk-detail-view", {
790
779
  "formConfigManager": [1040],
791
780
  "dataUnitName": [1, "data-unit-name"],
792
- "resourceID": [1, "resource-i-d"],
793
781
  "guideItemPath": [16],
794
782
  "entityName": [1, "entity-name"],
795
783
  "label": [1],
@@ -8,6 +8,7 @@ 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);
11
12
  this._searchValue = undefined;
12
13
  this._ezListSource = [];
13
14
  this.config = undefined;
@@ -16,6 +17,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
16
17
  }
17
18
  async reloadList() {
18
19
  this.loadListSource();
20
+ this.saveConfig.emit(this.config);
19
21
  }
20
22
  observeConfig() {
21
23
  var _a, _b;
@@ -31,6 +33,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
31
33
  }
32
34
  });
33
35
  this.config = ObjectUtils.copy(configCopy);
36
+ this.saveConfig.emit(this.config);
34
37
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
35
38
  }
36
39
  loadListSource() {
@@ -87,6 +90,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
87
90
  }
88
91
  ] });
89
92
  this.loadListSource();
93
+ this.saveConfig.emit(this.config);
90
94
  this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
91
95
  }
92
96
  }
@@ -208,7 +208,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
208
208
  };
209
209
  this.dataUnit = undefined;
210
210
  this.configName = undefined;
211
- this.resourceID = undefined;
212
211
  this.filterConfig = undefined;
213
212
  this.messagesBuilder = undefined;
214
213
  this.allowDefault = undefined;
@@ -284,11 +283,11 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
284
283
  return;
285
284
  }
286
285
  this._loadingPending = false;
287
- this.dataUnit.loadData(undefined, undefined, true);
286
+ this.dataUnit.loadData();
288
287
  }
289
288
  if (this._configUpdated) {
290
289
  this._configUpdated = false;
291
- ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
290
+ ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
292
291
  }
293
292
  }
294
293
  /**
@@ -404,13 +403,15 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
404
403
  }
405
404
  loadConfigFromStorage() {
406
405
  return new Promise(accept => {
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);
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
+ });
414
415
  });
415
416
  });
416
417
  }
@@ -495,7 +496,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
495
496
  return undefined;
496
497
  }
497
498
  if (this.showPersonalizedFilter) {
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 });
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 });
499
500
  }
500
501
  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" }))));
501
502
  }
@@ -507,7 +508,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
507
508
  }, [2, "snk-filter-bar", {
508
509
  "dataUnit": [1040],
509
510
  "configName": [1, "config-name"],
510
- "resourceID": [1, "resource-i-d"],
511
511
  "filterConfig": [1040],
512
512
  "messagesBuilder": [1040],
513
513
  "allowDefault": [32],
@@ -1,7 +1,8 @@
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 { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
4
+ import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
5
+ import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher.js';
5
6
  import { E as EPresentationMode } from './presentationMode.js';
6
7
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
7
8
 
@@ -27,6 +28,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
27
28
  }
28
29
  componentDidLoad() {
29
30
  if (this._element) {
31
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
30
32
  ElementIDUtils.addIDInfo(this._element);
31
33
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
32
34
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
@@ -144,12 +146,20 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
144
146
  this.config = ObjectUtils.copy(configCopy);
145
147
  }
146
148
  }
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
+ }
147
157
  componentWillLoad() {
148
158
  this.originalConfig = ObjectUtils.copy(this.config);
149
159
  }
150
160
  render() {
151
161
  const { tag: CustomElement, props } = this.getContentEditor();
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" }))));
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" }))));
153
163
  }
154
164
  get _element() { return this; }
155
165
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
2
+ import { ElementIDUtils, ApplicationContext, 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,13 +23,14 @@ 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;
27
26
  }
28
27
  observeFilterItem(newValue) {
29
28
  var _a, _b;
30
29
  this._editor && (this._editor["config"] = newValue);
31
30
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
32
31
  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();
33
34
  }
34
35
  getContentEditorConfig() {
35
36
  const props = { presentationMode: EPresentationMode.MODAL };
@@ -71,10 +72,11 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
71
72
  else {
72
73
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
73
74
  }
75
+ this.saveConfig();
74
76
  }
75
77
  handleDeleteFilter(filter, filterItemType) {
76
78
  if (filterItemType === FilterItemType.PERSONALIZED) {
77
- ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
79
+ ConfigStorage.removePersonalizedFilter(filter, this.configName);
78
80
  }
79
81
  }
80
82
  componentDidLoad() {
@@ -82,6 +84,7 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
82
84
  ElementIDUtils.addIDInfo(this._element);
83
85
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
84
86
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
87
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
85
88
  }
86
89
  }
87
90
  buildRightSlot(item) {
@@ -98,6 +101,15 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
98
101
  const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType$1;
99
102
  return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
100
103
  }
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
+ }
101
113
  render() {
102
114
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
103
115
  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)))));
@@ -109,8 +121,7 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
109
121
  static get style() { return snkFilterModalItemCss; }
110
122
  }, [0, "snk-filter-modal-item", {
111
123
  "filterItem": [1040],
112
- "configName": [1025, "config-name"],
113
- "resourceID": [1, "resource-i-d"]
124
+ "configName": [1025, "config-name"]
114
125
  }]);
115
126
  function defineCustomElement() {
116
127
  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 } from '@sankhyalabs/core';
3
+ import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } 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,10 +452,13 @@ 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
+ }
455
458
  if (this.configManager == undefined) {
456
459
  return;
457
460
  }
458
- this.configManager.fetchUserAvailableConfigs()
461
+ this.configManager.fetchUserAvailableConfigs(this._applicationResourceID)
459
462
  .then((userConfig) => {
460
463
  this._formConfigOptions = userConfig;
461
464
  if (this._formConfigOptions == undefined) {
@@ -509,6 +512,9 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
509
512
  }
510
513
  }
511
514
  async loadConfigByUser() {
515
+ if (this._applicationResourceID == undefined) {
516
+ return;
517
+ }
512
518
  if (this.configManager == undefined) {
513
519
  return;
514
520
  }
@@ -518,10 +524,10 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
518
524
  let config;
519
525
  switch (this._optionFormConfigSelected.origin) {
520
526
  case UserConfigType.DEFAULT:
521
- config = await this.configManager.fetchDefaultConfig();
527
+ config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
522
528
  break;
523
529
  case UserConfigType.DEFAULT:
524
- config = await this.configManager.fetchDefaultConfig();
530
+ config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
525
531
  break;
526
532
  }
527
533
  if (config != undefined) {
@@ -937,7 +943,11 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
937
943
  this.controlSortableGroup();
938
944
  }
939
945
  componentWillLoad() {
940
- this.loadConfig();
946
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
947
+ this._application.getResourceID().then(resourceID => {
948
+ this._applicationResourceID = resourceID;
949
+ this.loadConfig();
950
+ });
941
951
  }
942
952
  componentDidLoad() {
943
953
  const dataInfo = { dataUnit: this.dataUnit };
@@ -10,7 +10,6 @@ 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);
14
13
  this.levelPath = undefined;
15
14
  this.label = undefined;
16
15
  this.name = undefined;
@@ -78,10 +77,6 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
78
77
  this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
79
78
  }
80
79
  }
81
- handleFormItemsReady(event) {
82
- event.stopPropagation();
83
- this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
84
- }
85
80
  disconnectedCallback() {
86
81
  if (this._dataBinder != undefined) {
87
82
  this._dataBinder.onDisconnectedCallback();
@@ -94,7 +89,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
94
89
  ?
95
90
  h("snk-form-summary", { summary: this.getCardSummary() })
96
91
  :
97
- h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
92
+ h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
98
93
  }
99
94
  static get style() { return snkFormViewCss; }
100
95
  }, [6, "snk-form-view", {
@@ -1,7 +1,6 @@
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';
5
4
  import { d as defineCustomElement$5 } from './snk-config-options2.js';
6
5
  import { d as defineCustomElement$4 } from './snk-field-config2.js';
7
6
  import { d as defineCustomElement$3 } from './snk-form-config2.js';
@@ -15,7 +14,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
15
14
  this.__registerHost();
16
15
  this.exit = createEvent(this, "exit", 7);
17
16
  this.actionClick = createEvent(this, "actionClick", 7);
18
- this.formItemsReady = createEvent(this, "formItemsReady", 7);
19
17
  this._dataUnit = undefined;
20
18
  this._dataState = undefined;
21
19
  this._showFormConfig = false;
@@ -23,7 +21,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
23
21
  this.configName = undefined;
24
22
  this.recordsValidator = undefined;
25
23
  this.messagesBuilder = undefined;
26
- this.resourceID = undefined;
27
24
  }
28
25
  /**
29
26
  * Exibe a janela de configurações do formulário.
@@ -44,7 +41,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
44
41
  const dataInfo = { dataUnit: this._dataUnit };
45
42
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
46
43
  }
47
- async componentWillLoad() {
44
+ componentWillLoad() {
48
45
  let parent = this._element.parentElement;
49
46
  while (parent) {
50
47
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -66,10 +63,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
66
63
  }
67
64
  parent = parent.parentElement;
68
65
  }
69
- if (this.resourceID == undefined) {
70
- this.resourceID = await ResourceIDUtils.getResourceID();
71
- }
72
- this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
66
+ this._configManager = new SnkFormConfigManager(this.configName);
73
67
  this._configManager.loadConfig();
74
68
  }
75
69
  render() {
@@ -85,7 +79,6 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
85
79
  "configName": [1, "config-name"],
86
80
  "recordsValidator": [16],
87
81
  "messagesBuilder": [1040],
88
- "resourceID": [1, "resource-i-d"],
89
82
  "_dataUnit": [32],
90
83
  "_dataState": [32],
91
84
  "_showFormConfig": [32],
@@ -25,7 +25,6 @@ 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;
29
28
  }
30
29
  /* Creation Methods */
31
30
  /**
@@ -249,7 +248,7 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
249
248
  }
250
249
  }
251
250
  _newConfig.columns = _newColumnConfigList;
252
- ConfigStorage.saveGridConfig(_newConfig, this.configName, this.resourceID)
251
+ ConfigStorage.saveGridConfig(_newConfig, this.configName)
253
252
  .then((savedConfig) => {
254
253
  this.configChange.emit(savedConfig);
255
254
  this._orderList.clearHistory();
@@ -476,8 +475,7 @@ const SnkGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
476
475
  "application": [16],
477
476
  "columns": [1040],
478
477
  "config": [1040],
479
- "configName": [1, "config-name"],
480
- "resourceID": [1, "resource-i-d"]
478
+ "configName": [1, "config-name"]
481
479
  }]);
482
480
  function defineCustomElement() {
483
481
  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 { T as TaskbarProcessor, S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource.js';
7
+ import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor } 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,6 +32,7 @@ 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();
35
36
  this._topTaskbarProcessor = new TaskbarProcessor({
36
37
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
37
38
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
@@ -48,9 +49,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
48
49
  this._dataState = undefined;
49
50
  this._gridConfig = undefined;
50
51
  this._popUpGridConfig = false;
51
- this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
52
52
  this.configName = undefined;
53
- this.resourceID = undefined;
54
53
  this.selectionToastConfig = undefined;
55
54
  this.actionsList = undefined;
56
55
  this.isDetail = undefined;
@@ -109,17 +108,20 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
109
108
  this._gridConfig = config;
110
109
  }
111
110
  loadConfig() {
112
- ConfigStorage.loadGridConfig(this.configName, this.resourceID)
113
- .then((config) => {
114
- this.setGridConfig(config);
115
- })
116
- .catch((error) => {
117
- console.warn(error);
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
+ });
118
120
  });
119
121
  }
120
122
  gridConfigChangeHandler(evt) {
121
123
  const config = evt.detail;
122
- ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
124
+ ConfigStorage.saveGridConfig(config, this.configName);
123
125
  evt.stopPropagation();
124
126
  }
125
127
  modalConfigChangeHandler(evt) {
@@ -232,11 +234,10 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
232
234
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
233
235
  }
234
236
  finshLoading() {
235
- var _a, _b;
236
237
  this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
237
238
  this.addElementID();
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);
239
+ this._multiSelectionListDataSource.setApplication(this._application);
240
+ this._multiSelectionListDataSource.setDataUnit(this._dataUnit);
240
241
  }
241
242
  componentWillLoad() {
242
243
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
@@ -327,15 +328,13 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
327
328
  if (!this._dataUnit) {
328
329
  return undefined;
329
330
  }
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 }))));
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() }))));
332
333
  }
333
334
  get _element() { return this; }
334
335
  static get style() { return snkGridCss; }
335
336
  }, [6, "snk-grid", {
336
- "columnFilterDataSource": [1040],
337
337
  "configName": [1, "config-name"],
338
- "resourceID": [1, "resource-i-d"],
339
338
  "selectionToastConfig": [16],
340
339
  "actionsList": [16],
341
340
  "isDetail": [4, "is-detail"],