@sankhyalabs/sankhyablocks 8.1.0 → 8.2.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/cjs/{ConfigStorage-73e7afff.js → ConfigStorage-12397f18.js} +163 -51
  2. package/dist/cjs/{DataFetcher-004811c6.js → DataFetcher-f2da1f79.js} +68 -30
  3. package/dist/cjs/ISave-d68ce3cd.js +8 -0
  4. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  5. package/dist/cjs/{SnkFormConfigManager-d1f1a222.js → SnkFormConfigManager-13f79e37.js} +19 -21
  6. package/dist/cjs/auth-fetcher-319a4cb2.js +34 -0
  7. package/dist/cjs/{dataunit-fetcher-029eafbd.js → dataunit-fetcher-e72068c1.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-181767c9.js → form-config-fetcher-5d62ab62.js} +66 -3
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-9a97994a.js → pesquisa-fetcher-8c363096.js} +1 -1
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +18 -11
  13. package/dist/cjs/snk-application.cjs.entry.js +51 -73
  14. package/dist/cjs/snk-attach.cjs.entry.js +7 -13
  15. package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
  16. package/dist/cjs/snk-crud.cjs.entry.js +28 -9
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  18. package/dist/cjs/{snk-data-unit-d5109a08.js → snk-data-unit-80a00ae4.js} +8 -6
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +18 -25
  21. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +14 -17
  23. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -19
  25. package/dist/cjs/snk-form-config.cjs.entry.js +6 -17
  26. package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
  27. package/dist/cjs/snk-form.cjs.entry.js +12 -8
  28. package/dist/cjs/snk-grid-config.cjs.entry.js +5 -6
  29. package/dist/cjs/snk-grid.cjs.entry.js +20 -20
  30. package/dist/cjs/{snk-guides-viewer-aa3e3bfa.js → snk-guides-viewer-a7cd6fda.js} +18 -9
  31. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  32. package/dist/cjs/snk-personalized-filter.cjs.entry.js +13 -16
  33. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  34. package/dist/cjs/snk-simple-crud.cjs.entry.js +43 -92
  35. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
  36. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  37. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  38. package/dist/collection/components/snk-application/snk-application.js +60 -65
  39. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  40. package/dist/collection/components/snk-crud/snk-crud.js +63 -8
  41. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +65 -15
  42. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
  43. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +66 -30
  44. package/dist/collection/components/snk-data-unit/snk-data-unit.js +42 -7
  45. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  46. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
  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 +21 -16
  49. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +28 -12
  50. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  51. package/dist/collection/components/snk-form/snk-form.js +46 -2
  52. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  53. package/dist/collection/components/snk-grid/snk-grid.js +110 -16
  54. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  55. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  56. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +43 -9
  57. package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
  58. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  59. package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -71
  60. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +39 -30
  61. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  62. package/dist/collection/lib/index.js +10 -0
  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 +68 -30
  67. package/dist/components/ResourceIDUtils.js +10 -0
  68. package/dist/components/SnkFormConfigManager.js +17 -19
  69. package/dist/components/auth-fetcher.js +32 -0
  70. package/dist/components/form-config-fetcher.js +64 -2
  71. package/dist/components/snk-actions-button2.js +23 -9
  72. package/dist/components/snk-application2.js +132 -154
  73. package/dist/components/snk-attach2.js +1 -8
  74. package/dist/components/snk-configurator2.js +3 -1
  75. package/dist/components/snk-crud.js +29 -7
  76. package/dist/components/snk-data-unit2.js +10 -6
  77. package/dist/components/snk-detail-view2.js +28 -23
  78. package/dist/components/snk-entity-list.js +0 -4
  79. package/dist/components/snk-filter-bar2.js +12 -12
  80. package/dist/components/snk-filter-detail2.js +2 -12
  81. package/dist/components/snk-filter-modal-item2.js +5 -16
  82. package/dist/components/snk-form-config2.js +5 -15
  83. package/dist/components/snk-form-view2.js +6 -1
  84. package/dist/components/snk-form.js +9 -2
  85. package/dist/components/snk-grid-config2.js +4 -2
  86. package/dist/components/snk-grid2.js +23 -16
  87. package/dist/components/snk-personalized-filter2.js +11 -11
  88. package/dist/components/snk-simple-crud2.js +33 -81
  89. package/dist/components/snk-taskbar2.js +3 -1
  90. package/dist/esm/{ConfigStorage-19a7260b.js → ConfigStorage-932ab366.js} +162 -49
  91. package/dist/esm/{DataFetcher-e0fc5549.js → DataFetcher-7e18aa30.js} +68 -30
  92. package/dist/esm/ISave-4412b20c.js +8 -0
  93. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  94. package/dist/esm/{SnkFormConfigManager-1a42eb02.js → SnkFormConfigManager-bb9afc3f.js} +19 -21
  95. package/dist/esm/auth-fetcher-6d9664b7.js +32 -0
  96. package/dist/esm/{dataunit-fetcher-6a695723.js → dataunit-fetcher-91a4eb82.js} +1 -1
  97. package/dist/esm/{form-config-fetcher-9e167008.js → form-config-fetcher-aaaa79a6.js} +65 -3
  98. package/dist/esm/loader.js +1 -1
  99. package/dist/esm/{pesquisa-fetcher-9118eb7a.js → pesquisa-fetcher-56b30fb4.js} +1 -1
  100. package/dist/esm/sankhyablocks.js +1 -1
  101. package/dist/esm/snk-actions-button.entry.js +18 -11
  102. package/dist/esm/snk-application.entry.js +49 -71
  103. package/dist/esm/snk-attach.entry.js +3 -9
  104. package/dist/esm/snk-configurator.entry.js +2 -1
  105. package/dist/esm/snk-crud.entry.js +28 -9
  106. package/dist/esm/snk-data-exporter.entry.js +2 -2
  107. package/dist/esm/{snk-data-unit-3a0bbfcb.js → snk-data-unit-3ab57d1a.js} +8 -6
  108. package/dist/esm/snk-data-unit.entry.js +1 -1
  109. package/dist/esm/snk-detail-view.entry.js +18 -25
  110. package/dist/esm/snk-entity-list.entry.js +0 -4
  111. package/dist/esm/snk-filter-bar.entry.js +14 -17
  112. package/dist/esm/snk-filter-detail.entry.js +2 -16
  113. package/dist/esm/snk-filter-modal-item.entry.js +6 -20
  114. package/dist/esm/snk-form-config.entry.js +7 -18
  115. package/dist/esm/snk-form-view.entry.js +6 -1
  116. package/dist/esm/snk-form.entry.js +12 -8
  117. package/dist/esm/snk-grid-config.entry.js +5 -6
  118. package/dist/esm/snk-grid.entry.js +20 -20
  119. package/dist/esm/{snk-guides-viewer-aa386f6e.js → snk-guides-viewer-cc709b5f.js} +18 -9
  120. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  121. package/dist/esm/snk-personalized-filter.entry.js +13 -16
  122. package/dist/esm/snk-print-selector.entry.js +1 -1
  123. package/dist/esm/snk-simple-crud.entry.js +34 -83
  124. package/dist/esm/snk-taskbar.entry.js +2 -1
  125. package/dist/sankhyablocks/p-01739b21.entry.js +1 -0
  126. package/dist/sankhyablocks/{p-e7e54737.entry.js → p-03bb1aea.entry.js} +1 -1
  127. package/dist/sankhyablocks/p-05dbc70e.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-0a4c753d.js → p-14eac6fe.js} +1 -1
  129. package/dist/sankhyablocks/{p-2ac9c585.js → p-2d333d22.js} +1 -1
  130. package/dist/sankhyablocks/p-41e897f1.js +56 -0
  131. package/dist/sankhyablocks/p-48a40939.js +1 -0
  132. package/dist/sankhyablocks/p-611aa624.entry.js +1 -0
  133. package/dist/sankhyablocks/p-66bb8c20.entry.js +1 -0
  134. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  135. package/dist/sankhyablocks/p-6f154396.entry.js +1 -0
  136. package/dist/sankhyablocks/p-787071a8.js +1 -0
  137. package/dist/sankhyablocks/p-8818d8f6.entry.js +1 -0
  138. package/dist/sankhyablocks/p-93f6ca04.entry.js +1 -0
  139. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  140. package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
  141. package/dist/sankhyablocks/p-a52a6c9d.js +26 -0
  142. package/dist/sankhyablocks/p-b6003974.entry.js +1 -0
  143. package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
  144. package/dist/sankhyablocks/p-cfb33a4a.entry.js +1 -0
  145. package/dist/sankhyablocks/{p-7c7764bf.entry.js → p-d13c00b6.entry.js} +1 -1
  146. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  147. package/dist/sankhyablocks/p-d53a9169.entry.js +1 -0
  148. package/dist/sankhyablocks/p-d7638f45.entry.js +11 -0
  149. package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
  150. package/dist/sankhyablocks/p-e64f3e17.entry.js +1 -0
  151. package/dist/sankhyablocks/p-ed41b38c.js +1 -0
  152. package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
  153. package/dist/sankhyablocks/p-efc10705.entry.js +1 -0
  154. package/dist/sankhyablocks/p-f74fe358.js +1 -0
  155. package/dist/sankhyablocks/{p-df8621b4.js → p-f8e6b97e.js} +1 -1
  156. package/dist/sankhyablocks/p-f91e0c5d.entry.js +1 -0
  157. package/dist/sankhyablocks/p-fa523d6b.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 +2 -1
  160. package/dist/types/components/snk-application/snk-application.d.ts +8 -13
  161. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  162. package/dist/types/components/snk-crud/snk-crud.d.ts +10 -0
  163. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +13 -0
  164. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
  165. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -2
  166. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +8 -0
  167. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  168. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  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 +5 -4
  171. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  172. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  173. package/dist/types/components/snk-form/snk-form.d.ts +9 -1
  174. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  175. package/dist/types/components/snk-grid/snk-grid.d.ts +18 -1
  176. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  177. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  178. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +8 -0
  179. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
  180. package/dist/types/components.d.ts +189 -21
  181. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  182. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -8
  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 +0 -1
  185. package/dist/types/lib/index.d.ts +11 -0
  186. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  187. package/dist/types/lib/utils/urlutils.d.ts +14 -0
  188. package/package.json +2 -2
  189. package/dist/cjs/filter-bar-config-fetcher-2b8ed9d0.js +0 -155
  190. package/dist/cjs/resource-fetcher-c0332609.js +0 -68
  191. package/dist/components/filter-bar-config-fetcher.js +0 -153
  192. package/dist/components/resource-fetcher.js +0 -66
  193. package/dist/esm/filter-bar-config-fetcher-06e02851.js +0 -153
  194. package/dist/esm/resource-fetcher-768d5556.js +0 -66
  195. package/dist/sankhyablocks/p-0a94fdbd.entry.js +0 -1
  196. package/dist/sankhyablocks/p-0ed0fc02.entry.js +0 -1
  197. package/dist/sankhyablocks/p-1e0189ff.entry.js +0 -1
  198. package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
  199. package/dist/sankhyablocks/p-50d72261.entry.js +0 -1
  200. package/dist/sankhyablocks/p-6759adae.entry.js +0 -1
  201. package/dist/sankhyablocks/p-7b8b8ae9.js +0 -10
  202. package/dist/sankhyablocks/p-815a42c0.entry.js +0 -1
  203. package/dist/sankhyablocks/p-8a41172a.entry.js +0 -1
  204. package/dist/sankhyablocks/p-8f8184ff.js +0 -56
  205. package/dist/sankhyablocks/p-8fdc3108.js +0 -1
  206. package/dist/sankhyablocks/p-976e56e9.js +0 -1
  207. package/dist/sankhyablocks/p-98f9d076.js +0 -17
  208. package/dist/sankhyablocks/p-9edad923.js +0 -1
  209. package/dist/sankhyablocks/p-abdcac04.entry.js +0 -1
  210. package/dist/sankhyablocks/p-b0847056.entry.js +0 -1
  211. package/dist/sankhyablocks/p-bc735728.entry.js +0 -1
  212. package/dist/sankhyablocks/p-be684b38.entry.js +0 -1
  213. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  214. package/dist/sankhyablocks/p-c0f656af.entry.js +0 -1
  215. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  216. package/dist/sankhyablocks/p-ccbfb1cf.entry.js +0 -1
  217. package/dist/sankhyablocks/p-d1b89765.js +0 -1
  218. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  219. package/dist/sankhyablocks/p-e28129aa.entry.js +0 -1
  220. package/dist/sankhyablocks/p-f31bfdee.entry.js +0 -1
  221. package/dist/sankhyablocks/p-f92fda53.entry.js +0 -11
@@ -1,13 +1,18 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
4
- import './DataFetcher-e0fc5549.js';
5
- import './pesquisa-fetcher-9118eb7a.js';
4
+ import './DataFetcher-7e18aa30.js';
5
+ import './pesquisa-fetcher-56b30fb4.js';
6
6
  import { P as PresentationMode } from './index-1564817d.js';
7
+ import './ISave-4412b20c.js';
8
+ import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
+ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
+ import './filter-item-type.enum-5028ed3f.js';
11
+ import './form-config-fetcher-aaaa79a6.js';
7
12
  import { c as VIEW_MODE } from './constants-3644f1b6.js';
13
+ import { A as AutorizationType } from './auth-fetcher-6d9664b7.js';
8
14
  import './index-bdf75557.js';
9
15
  import './_commonjsHelpers-9943807e.js';
10
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
16
 
12
17
  const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
13
18
 
@@ -17,11 +22,14 @@ const SnkCrud = class {
17
22
  this.actionClick = createEvent(this, "actionClick", 7);
18
23
  this.configuratorSave = createEvent(this, "configuratorSave", 7);
19
24
  this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
25
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
20
26
  this._viewHistory = [];
21
27
  this._dataUnit = undefined;
22
28
  this._dataState = undefined;
23
29
  this.attachmentRegisterKey = undefined;
24
30
  this._currentViewMode = VIEW_MODE.GRID;
31
+ this._canEdit = undefined;
32
+ this._resourceID = undefined;
25
33
  this.configName = undefined;
26
34
  this.selectionToastConfig = undefined;
27
35
  this.showActionButtons = false;
@@ -32,6 +40,7 @@ const SnkCrud = class {
32
40
  this.multipleSelection = true;
33
41
  this.presentationMode = PresentationMode.PRIMARY;
34
42
  this.messagesBuilder = undefined;
43
+ this.useEnterLikeTab = false;
35
44
  }
36
45
  /**
37
46
  * Usado para alternar a visão entre GRID e FORM externamente.
@@ -115,7 +124,7 @@ const SnkCrud = class {
115
124
  }
116
125
  componentWillLoad() {
117
126
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
118
- // application.hasAccess(AutorizationType.UPDATE).then(canEdit=>this._canEdit = canEdit)
127
+ application.hasAccess(AutorizationType.UPDATE, this._resourceID).then(canEdit => this._canEdit = canEdit);
119
128
  let parent = this._element.parentElement;
120
129
  while (parent) {
121
130
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -127,11 +136,11 @@ const SnkCrud = class {
127
136
  if (!this._dataUnit) {
128
137
  this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
129
138
  this._dataUnit = evt.detail;
130
- this.initDataUnit();
139
+ this.initDataUnit(application);
131
140
  });
132
141
  }
133
142
  else {
134
- this.initDataUnit();
143
+ this.initDataUnit(application);
135
144
  }
136
145
  this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
137
146
  this._dataState = dataState;
@@ -147,11 +156,18 @@ const SnkCrud = class {
147
156
  this.configName = application.configName;
148
157
  }
149
158
  }
150
- initDataUnit() {
159
+ async initDataUnit(application) {
151
160
  this.addDataElementID();
152
161
  if (!this.messagesBuilder) {
153
162
  this.messagesBuilder = this._snkDataUnit.messagesBuilder;
154
163
  }
164
+ if (this._resourceID == undefined) {
165
+ //Tenta pegar o resourceID do snkDataUnit;
166
+ this._resourceID = this._snkDataUnit.resourceID;
167
+ if (this._resourceID == undefined) {
168
+ this._resourceID = await application.getResourceID();
169
+ }
170
+ }
155
171
  }
156
172
  handleConfiguratorEvent(evt, type) {
157
173
  evt.stopImmediatePropagation();
@@ -162,8 +178,11 @@ const SnkCrud = class {
162
178
  this.configuratorCancel.emit();
163
179
  }
164
180
  render() {
165
- // this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
166
- return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form" }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
181
+ if (this._resourceID == undefined) {
182
+ return;
183
+ }
184
+ this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
185
+ return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
167
186
  }
168
187
  get _element() { return getElement(this); }
169
188
  static get watchers() { return {
@@ -3,8 +3,8 @@ import { ObjectUtils, ApplicationContext, DataType, ElementIDUtils } from '@sank
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-1564817d.js';
5
5
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-3644f1b6.js';
6
- import { D as DataFetcher } from './DataFetcher-e0fc5549.js';
7
- import { S as SnkDataUnit } from './snk-data-unit-3a0bbfcb.js';
6
+ import { D as DataFetcher } from './DataFetcher-7e18aa30.js';
7
+ import { S as SnkDataUnit } from './snk-data-unit-3ab57d1a.js';
8
8
  import './_commonjsHelpers-9943807e.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './SnkMessageBuilder-68c1c25a.js';
@@ -20,9 +20,9 @@ const SnkDataUnit = class {
20
20
  const duState = this.buildDataState();
21
21
  this.dataState = duState;
22
22
  if (action.type === Action.DATA_SAVED) {
23
- // if(this.ignoreSaveMessage){
24
- // return
25
- // }
23
+ if (this.ignoreSaveMessage) {
24
+ return;
25
+ }
26
26
  const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
27
27
  if (msg != undefined) {
28
28
  this.showSuccessMessage(msg);
@@ -68,7 +68,9 @@ const SnkDataUnit = class {
68
68
  this.beforeSave = undefined;
69
69
  this.afterSave = undefined;
70
70
  this.useCancelConfirm = true;
71
+ this.ignoreSaveMessage = undefined;
71
72
  this.configName = undefined;
73
+ this.resourceID = undefined;
72
74
  }
73
75
  observePageSize() {
74
76
  if (this.dataUnit) {
@@ -332,10 +334,10 @@ const SnkDataUnit = class {
332
334
  const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
333
335
  if (this._parentSnkDataUnit) {
334
336
  this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
335
- return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
337
+ return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
336
338
  }
337
339
  else {
338
- return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
340
+ return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
339
341
  }
340
342
  }
341
343
  async loadDataUnit() {
@@ -394,7 +396,7 @@ const SnkDataUnit = class {
394
396
  //---------------------------------------------
395
397
  componentWillLoad() {
396
398
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
397
- this._application.getAllAccess().then(access => this._permissions = access);
399
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
398
400
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
399
401
  if (this.messagesBuilder == undefined) {
400
402
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -1,4 +1,4 @@
1
- export { S as snk_data_unit } from './snk-data-unit-3a0bbfcb.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-3ab57d1a.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
@@ -1,21 +1,21 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-1a42eb02.js';
2
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-bb9afc3f.js';
3
3
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
- import './DataFetcher-e0fc5549.js';
5
- import './pesquisa-fetcher-9118eb7a.js';
4
+ import './DataFetcher-7e18aa30.js';
5
+ import './pesquisa-fetcher-56b30fb4.js';
6
6
  import '@sankhyalabs/core';
7
7
  import { P as PresentationMode } from './index-1564817d.js';
8
+ import './ISave-4412b20c.js';
9
+ import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
+ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
+ import './filter-item-type.enum-5028ed3f.js';
12
+ import './form-config-fetcher-aaaa79a6.js';
8
13
  import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
9
14
  import { c as VIEW_MODE } from './constants-3644f1b6.js';
10
- import { S as SnkGuidesViewer } from './snk-guides-viewer-aa386f6e.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-cc709b5f.js';
11
16
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
12
- import './ConfigStorage-19a7260b.js';
13
- import './form-config-fetcher-9e167008.js';
14
- import './resource-fetcher-768d5556.js';
15
- import './filter-bar-config-fetcher-06e02851.js';
16
- import './filter-item-type.enum-5028ed3f.js';
17
+ import './ConfigStorage-932ab366.js';
17
18
  import './_commonjsHelpers-9943807e.js';
18
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
19
19
  import './index-bdf75557.js';
20
20
  import './taskbar-processor-94402e6e.js';
21
21
  import '@sankhyalabs/core/dist/dataunit/DataUnit';
@@ -70,10 +70,13 @@ const SnkDetailView = class {
70
70
  registerInstance(this, hostRef);
71
71
  this.snkDetailGuidesChange = createEvent(this, "snkDetailGuidesChange", 7);
72
72
  this.snkSwitchGuide = createEvent(this, "snkSwitchGuide", 7);
73
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
73
74
  this._disabledButtons = undefined;
75
+ this._currentView = undefined;
74
76
  this.attachmentRegisterKey = undefined;
75
77
  this.formConfigManager = undefined;
76
78
  this.dataUnitName = undefined;
79
+ this.resourceID = undefined;
77
80
  this.guideItemPath = undefined;
78
81
  this.entityName = undefined;
79
82
  this.label = undefined;
@@ -82,12 +85,8 @@ const SnkDetailView = class {
82
85
  this.dataState = undefined;
83
86
  this.messagesBuilder = undefined;
84
87
  this.branchGuide = undefined;
88
+ this.canEdit = true;
85
89
  }
86
- // /**
87
- // * Define se a edição está habilitada na grid.
88
- // */
89
- // @Prop()
90
- // canEdit: boolean = true;
91
90
  observerDataState(newValue, oldValue) {
92
91
  const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
93
92
  const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
@@ -200,10 +199,8 @@ const SnkDetailView = class {
200
199
  updateViewStack(viewStack) {
201
200
  var _a, _b;
202
201
  this._viewStack = viewStack;
203
- // TODO: remove to gridEditor
204
- (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.selectedForm ? 1 : 0);
205
- // this._currentView = this.selectedForm ? 1 : 0;
206
- // this._viewStack?.show?.(this._currentView);
202
+ this._currentView = this.selectedForm ? 1 : 0;
203
+ (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this._currentView);
207
204
  }
208
205
  getFormFields() {
209
206
  if (this.selectedForm && this._formMetadata) {
@@ -249,7 +246,7 @@ const SnkDetailView = class {
249
246
  }
250
247
  componentWillLoad() {
251
248
  this._configName = `dynaform.${this.entityName}`;
252
- this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
249
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
253
250
  this.formConfigManager.loadConfig();
254
251
  if (this.messagesBuilder == undefined) {
255
252
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -258,11 +255,7 @@ const SnkDetailView = class {
258
255
  render() {
259
256
  this.updateLabel();
260
257
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
261
- 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),
262
- // ignoreSaveMessage={this._currentView === VIEW_MODE.GRID}
263
- 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,
264
- // canEdit={this.canEdit}
265
- 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) }))))));
258
+ 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) }))))));
266
259
  }
267
260
  static get watchers() { return {
268
261
  "dataState": ["observerDataState"]
@@ -7,7 +7,6 @@ const SnkEntityList = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
9
  this.valueChanged = createEvent(this, "valueChanged", 7);
10
- this.saveConfig = createEvent(this, "saveConfig", 7);
11
10
  this._searchValue = undefined;
12
11
  this._ezListSource = [];
13
12
  this.config = undefined;
@@ -16,7 +15,6 @@ const SnkEntityList = class {
16
15
  }
17
16
  async reloadList() {
18
17
  this.loadListSource();
19
- this.saveConfig.emit(this.config);
20
18
  }
21
19
  observeConfig() {
22
20
  var _a, _b;
@@ -32,7 +30,6 @@ const SnkEntityList = class {
32
30
  }
33
31
  });
34
32
  this.config = ObjectUtils.copy(configCopy);
35
- this.saveConfig.emit(this.config);
36
33
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
37
34
  }
38
35
  loadListSource() {
@@ -89,7 +86,6 @@ const SnkEntityList = class {
89
86
  }
90
87
  ] });
91
88
  this.loadListSource();
92
- this.saveConfig.emit(this.config);
93
89
  this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
94
90
  }
95
91
  }
@@ -1,18 +1,16 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DataType, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-19a7260b.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-932ab366.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
7
7
  import { F as FilterOperand } from './index-ae591a44.js';
8
8
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
9
9
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
10
- import './form-config-fetcher-9e167008.js';
11
- import './DataFetcher-e0fc5549.js';
10
+ import './form-config-fetcher-aaaa79a6.js';
11
+ import './DataFetcher-7e18aa30.js';
12
12
  import './_commonjsHelpers-9943807e.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
- import './resource-fetcher-768d5556.js';
15
- import './filter-bar-config-fetcher-06e02851.js';
16
14
 
17
15
  const buildFilter = (item) => {
18
16
  switch (item.type) {
@@ -204,6 +202,7 @@ const SnkFilterBar = class {
204
202
  };
205
203
  this.dataUnit = undefined;
206
204
  this.configName = undefined;
205
+ this.resourceID = undefined;
207
206
  this.filterConfig = undefined;
208
207
  this.messagesBuilder = undefined;
209
208
  this.allowDefault = undefined;
@@ -279,11 +278,11 @@ const SnkFilterBar = class {
279
278
  return;
280
279
  }
281
280
  this._loadingPending = false;
282
- this.dataUnit.loadData();
281
+ this.dataUnit.loadData(undefined, undefined, true);
283
282
  }
284
283
  if (this._configUpdated) {
285
284
  this._configUpdated = false;
286
- ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName);
285
+ ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
287
286
  }
288
287
  }
289
288
  /**
@@ -399,15 +398,13 @@ const SnkFilterBar = class {
399
398
  }
400
399
  loadConfigFromStorage() {
401
400
  return new Promise(accept => {
402
- ConfigStorage.get().then(instance => {
403
- instance.loadFilterBarConfig(this.configName, { contextURI: this.dataUnit.name })
404
- .then((filters) => {
405
- accept();
406
- this.filterConfig = filters.map(item => this.normalizeItem(item));
407
- })
408
- .catch(reason => {
409
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
410
- });
401
+ ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
402
+ .then((filters) => {
403
+ accept();
404
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
405
+ })
406
+ .catch(reason => {
407
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
411
408
  });
412
409
  });
413
410
  }
@@ -492,7 +489,7 @@ const SnkFilterBar = class {
492
489
  return undefined;
493
490
  }
494
491
  if (this.showPersonalizedFilter) {
495
- 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 });
492
+ 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 });
496
493
  }
497
494
  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" }))));
498
495
  }
@@ -1,14 +1,9 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
- import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
5
- import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-06e02851.js';
4
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
6
5
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
7
6
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
8
- import './resource-fetcher-768d5556.js';
9
- import './DataFetcher-e0fc5549.js';
10
- import './_commonjsHelpers-9943807e.js';
11
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
7
  import './index-ae591a44.js';
13
8
 
14
9
  const SnkFilterDetail = class {
@@ -32,7 +27,6 @@ const SnkFilterDetail = class {
32
27
  }
33
28
  componentDidLoad() {
34
29
  if (this._element) {
35
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
36
30
  ElementIDUtils.addIDInfo(this._element);
37
31
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
38
32
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
@@ -150,20 +144,12 @@ const SnkFilterDetail = class {
150
144
  this.config = ObjectUtils.copy(configCopy);
151
145
  }
152
146
  }
153
- saveConfig(newConfig) {
154
- var _a;
155
- (_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
156
- const fetcher = new FilterBarConfigFetcher();
157
- fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
158
- this.config = newConfig;
159
- });
160
- }
161
147
  componentWillLoad() {
162
148
  this.originalConfig = ObjectUtils.copy(this.config);
163
149
  }
164
150
  render() {
165
151
  const { tag: CustomElement, props } = this.getContentEditor();
166
- 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" }))));
167
153
  }
168
154
  get _element() { return getElement(this); }
169
155
  static get watchers() { return {
@@ -1,15 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
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-5028ed3f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { C as ConfigStorage } from './ConfigStorage-19a7260b.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-932ab366.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
- import './form-config-fetcher-9e167008.js';
8
- import './DataFetcher-e0fc5549.js';
7
+ import './form-config-fetcher-aaaa79a6.js';
8
+ import './DataFetcher-7e18aa30.js';
9
9
  import './_commonjsHelpers-9943807e.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './resource-fetcher-768d5556.js';
12
- import './filter-bar-config-fetcher-06e02851.js';
13
11
 
14
12
  const snkFilterModalItemCss = ".grow{flex-grow:1}.gap{gap:4px}";
15
13
 
@@ -21,14 +19,13 @@ const SnkFilterModalItem = class {
21
19
  this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
22
20
  this.filterItem = undefined;
23
21
  this.configName = undefined;
22
+ this.resourceID = undefined;
24
23
  }
25
24
  observeFilterItem(newValue) {
26
25
  var _a, _b;
27
26
  this._editor && (this._editor["config"] = newValue);
28
27
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
29
28
  this.filterChange.emit(newValue);
30
- //isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
31
- //this.saveConfig();
32
29
  }
33
30
  getContentEditorConfig() {
34
31
  const props = { presentationMode: EPresentationMode.MODAL };
@@ -70,11 +67,10 @@ const SnkFilterModalItem = class {
70
67
  else {
71
68
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
72
69
  }
73
- this.saveConfig();
74
70
  }
75
71
  handleDeleteFilter(filter, filterItemType) {
76
72
  if (filterItemType === FilterItemType.PERSONALIZED) {
77
- ConfigStorage.removePersonalizedFilter(filter, this.configName);
73
+ ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
78
74
  }
79
75
  }
80
76
  componentDidLoad() {
@@ -82,7 +78,6 @@ const SnkFilterModalItem = class {
82
78
  ElementIDUtils.addIDInfo(this._element);
83
79
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
84
80
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
85
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
86
81
  }
87
82
  }
88
83
  buildRightSlot(item) {
@@ -99,15 +94,6 @@ const SnkFilterModalItem = class {
99
94
  const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
100
95
  return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
101
96
  }
102
- saveConfig() {
103
- //Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
104
- /*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
105
-
106
- this._application?.getResourceID().then(resourceId => {
107
- const fetcher = new FilterBarConfigFetcher();
108
- fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
109
- });*/
110
- }
111
97
  render() {
112
98
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
113
99
  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)))));
@@ -1,14 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { d as draggable_bundle } from './draggable.bundle-41d56f06.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, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-3644f1b6.js';
6
- import { U as UserConfigType } from './form-config-fetcher-9e167008.js';
6
+ import { U as UserConfigType } from './form-config-fetcher-aaaa79a6.js';
7
7
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
8
8
  import './_commonjsHelpers-9943807e.js';
9
- import './DataFetcher-e0fc5549.js';
9
+ import './DataFetcher-7e18aa30.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './resource-fetcher-768d5556.js';
12
11
 
13
12
  const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config--z-index:var(--more-visible, 2);--snk-form-config--background-color:var(--background--xlight, #fff);--snk-form-config__icon--color:var(--text--disable, #AFB6C0);--snk-form-config__label-counter--font-weight:var(--text-weight--extra-small, 200);--snk-form-config__add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__add-group-container--background-color:var(--background--medium, #d2dce9);--snk-form-config__add-group-container--padding:var(--space--small, 6px);--snk-form-config__add-group-content--border:2px dashed var(--color-strokes, #DCE0E8);--snk-form-config__add-group-content--border-radius:var(--border--radius-small, 6px);--snk-form-config__add-group-label--padding:var(--space--large, 24px);--snk-form-config__btn-add-group--padding:var(--space--large, 24px) var(--space--medium, 12px) 0;--snk-form-config__btn-add-group-container--padding:var(--space--medium, 12px);--snk-form-config__btn-add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__btn-add-group-container--border:2px solid var(--color-strokes, #DCE0E8);--snk-form-config__btn-add-group-container--background-color:var(--background--body, #fafcff);display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--snk-form-config--z-index);background-color:var(--snk-form-config--background-color)}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--snk-form-config__icon--color)}.ez-box__label-counter.sc-snk-form-config{margin-top:-7px;font-weight:var(--snk-form-config__label-counter--font-weight)}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:var(--snk-form-config--background-color)}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--snk-form-config--z-index)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--snk-form-config__add-group-container--border-radius);background-color:var(--snk-form-config__add-group-container--background-color);padding:var(--snk-form-config__add-group-container--padding)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:var(--snk-form-config__add-group-content--border);border-radius:var(--snk-form-config__add-group-content--border-radius)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--snk-form-config__add-group-label--padding)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--snk-form-config__btn-add-group--padding)}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--snk-form-config__btn-add-group-container--padding);border-radius:var(--snk-form-config__btn-add-group-container--border-radius);border:var(--snk-form-config__btn-add-group-container--border);background-color:var(--snk-form-config__btn-add-group-container--background-color)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:var(--snk-form-config--background-color)}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -1)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -2)}}";
14
13
 
@@ -453,13 +452,10 @@ const SnkFormConfig = class {
453
452
  this._sortableGroup.on(CONFIG_EVENTS.dragStop, (evt) => this.controlStopDraggingGroup(evt));
454
453
  }
455
454
  loadUserConfig() {
456
- if (this._applicationResourceID == undefined) {
457
- return;
458
- }
459
455
  if (this.configManager == undefined) {
460
456
  return;
461
457
  }
462
- this.configManager.fetchUserAvailableConfigs(this._applicationResourceID)
458
+ this.configManager.fetchUserAvailableConfigs()
463
459
  .then((userConfig) => {
464
460
  this._formConfigOptions = userConfig;
465
461
  if (this._formConfigOptions == undefined) {
@@ -513,9 +509,6 @@ const SnkFormConfig = class {
513
509
  }
514
510
  }
515
511
  async loadConfigByUser() {
516
- if (this._applicationResourceID == undefined) {
517
- return;
518
- }
519
512
  if (this.configManager == undefined) {
520
513
  return;
521
514
  }
@@ -525,10 +518,10 @@ const SnkFormConfig = class {
525
518
  let config;
526
519
  switch (this._optionFormConfigSelected.origin) {
527
520
  case UserConfigType.DEFAULT:
528
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
521
+ config = await this.configManager.fetchDefaultConfig();
529
522
  break;
530
523
  case UserConfigType.DEFAULT:
531
- config = await this.configManager.fetchDefaultConfig(this._applicationResourceID);
524
+ config = await this.configManager.fetchDefaultConfig();
532
525
  break;
533
526
  }
534
527
  if (config != undefined) {
@@ -944,11 +937,7 @@ const SnkFormConfig = class {
944
937
  this.controlSortableGroup();
945
938
  }
946
939
  componentWillLoad() {
947
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
948
- this._application.getResourceID().then(resourceID => {
949
- this._applicationResourceID = resourceID;
950
- this.loadConfig();
951
- });
940
+ this.loadConfig();
952
941
  }
953
942
  componentDidLoad() {
954
943
  const dataInfo = { dataUnit: this.dataUnit };
@@ -8,6 +8,7 @@ const SnkFormView = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
10
  this.snkContentCardChanged = createEvent(this, "snkContentCardChanged", 7);
11
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
11
12
  this.levelPath = undefined;
12
13
  this.label = undefined;
13
14
  this.name = undefined;
@@ -75,6 +76,10 @@ const SnkFormView = class {
75
76
  this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
76
77
  }
77
78
  }
79
+ handleFormItemsReady(event) {
80
+ event.stopPropagation();
81
+ this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
82
+ }
78
83
  disconnectedCallback() {
79
84
  if (this._dataBinder != undefined) {
80
85
  this._dataBinder.onDisconnectedCallback();
@@ -87,7 +92,7 @@ const SnkFormView = class {
87
92
  ?
88
93
  h("snk-form-summary", { summary: this.getCardSummary() })
89
94
  :
90
- h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
95
+ h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
91
96
  }
92
97
  };
93
98
  SnkFormView.style = snkFormViewCss;