@sankhyalabs/sankhyablocks 8.1.0 → 8.2.0-dev.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 (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 +22 -80
  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 +2 -59
  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 +12 -69
  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 +13 -71
  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-8481bb59.entry.js +1 -0
  138. package/dist/sankhyablocks/p-8818d8f6.entry.js +1 -0
  139. package/dist/sankhyablocks/p-93f6ca04.entry.js +1 -0
  140. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  141. package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
  142. package/dist/sankhyablocks/p-a52a6c9d.js +26 -0
  143. package/dist/sankhyablocks/p-b6003974.entry.js +1 -0
  144. package/dist/sankhyablocks/p-c555075c.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 +0 -7
  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
@@ -10,9 +10,11 @@ import { GuideBuilder } from '../GuideBuilder';
10
10
  export class SnkDetailView {
11
11
  constructor() {
12
12
  this._disabledButtons = undefined;
13
+ this._currentView = undefined;
13
14
  this.attachmentRegisterKey = undefined;
14
15
  this.formConfigManager = undefined;
15
16
  this.dataUnitName = undefined;
17
+ this.resourceID = undefined;
16
18
  this.guideItemPath = undefined;
17
19
  this.entityName = undefined;
18
20
  this.label = undefined;
@@ -21,12 +23,8 @@ export class SnkDetailView {
21
23
  this.dataState = undefined;
22
24
  this.messagesBuilder = undefined;
23
25
  this.branchGuide = undefined;
26
+ this.canEdit = true;
24
27
  }
25
- // /**
26
- // * Define se a edição está habilitada na grid.
27
- // */
28
- // @Prop()
29
- // canEdit: boolean = true;
30
28
  observerDataState(newValue, oldValue) {
31
29
  const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
32
30
  const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
@@ -139,10 +137,8 @@ export class SnkDetailView {
139
137
  updateViewStack(viewStack) {
140
138
  var _a, _b;
141
139
  this._viewStack = viewStack;
142
- // TODO: remove to gridEditor
143
- (_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);
144
- // this._currentView = this.selectedForm ? 1 : 0;
145
- // this._viewStack?.show?.(this._currentView);
140
+ this._currentView = this.selectedForm ? 1 : 0;
141
+ (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this._currentView);
146
142
  }
147
143
  getFormFields() {
148
144
  if (this.selectedForm && this._formMetadata) {
@@ -188,7 +184,7 @@ export class SnkDetailView {
188
184
  }
189
185
  componentWillLoad() {
190
186
  this._configName = `dynaform.${this.entityName}`;
191
- this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
187
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
192
188
  this.formConfigManager.loadConfig();
193
189
  if (this.messagesBuilder == undefined) {
194
190
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -197,11 +193,7 @@ export class SnkDetailView {
197
193
  render() {
198
194
  this.updateLabel();
199
195
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
200
- 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),
201
- // ignoreSaveMessage={this._currentView === VIEW_MODE.GRID}
202
- 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,
203
- // canEdit={this.canEdit}
204
- 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) }))))));
196
+ 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) }))))));
205
197
  }
206
198
  static get is() { return "snk-detail-view"; }
207
199
  static get encapsulation() { return "scoped"; }
@@ -254,6 +246,23 @@ export class SnkDetailView {
254
246
  "attribute": "data-unit-name",
255
247
  "reflect": false
256
248
  },
249
+ "resourceID": {
250
+ "type": "string",
251
+ "mutable": false,
252
+ "complexType": {
253
+ "original": "string",
254
+ "resolved": "string",
255
+ "references": {}
256
+ },
257
+ "required": false,
258
+ "optional": false,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
262
+ },
263
+ "attribute": "resource-i-d",
264
+ "reflect": false
265
+ },
257
266
  "guideItemPath": {
258
267
  "type": "unknown",
259
268
  "mutable": false,
@@ -407,12 +416,31 @@ export class SnkDetailView {
407
416
  "tags": [],
408
417
  "text": ""
409
418
  }
419
+ },
420
+ "canEdit": {
421
+ "type": "boolean",
422
+ "mutable": false,
423
+ "complexType": {
424
+ "original": "boolean",
425
+ "resolved": "boolean",
426
+ "references": {}
427
+ },
428
+ "required": false,
429
+ "optional": false,
430
+ "docs": {
431
+ "tags": [],
432
+ "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
433
+ },
434
+ "attribute": "can-edit",
435
+ "reflect": false,
436
+ "defaultValue": "true"
410
437
  }
411
438
  };
412
439
  }
413
440
  static get states() {
414
441
  return {
415
442
  "_disabledButtons": {},
443
+ "_currentView": {},
416
444
  "attachmentRegisterKey": {}
417
445
  };
418
446
  }
@@ -452,6 +480,28 @@ export class SnkDetailView {
452
480
  "resolved": "string",
453
481
  "references": {}
454
482
  }
483
+ }, {
484
+ "method": "formItemsReady",
485
+ "name": "formItemsReady",
486
+ "bubbles": true,
487
+ "cancelable": true,
488
+ "composed": true,
489
+ "docs": {
490
+ "tags": [],
491
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
492
+ },
493
+ "complexType": {
494
+ "original": "Array<HTMLElement>",
495
+ "resolved": "HTMLElement[]",
496
+ "references": {
497
+ "Array": {
498
+ "location": "global"
499
+ },
500
+ "HTMLElement": {
501
+ "location": "global"
502
+ }
503
+ }
504
+ }
455
505
  }];
456
506
  }
457
507
  static get methods() {
@@ -70,6 +70,10 @@ export class SnkFormView {
70
70
  this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
71
71
  }
72
72
  }
73
+ handleFormItemsReady(event) {
74
+ event.stopPropagation();
75
+ this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
76
+ }
73
77
  disconnectedCallback() {
74
78
  if (this._dataBinder != undefined) {
75
79
  this._dataBinder.onDisconnectedCallback();
@@ -82,7 +86,7 @@ export class SnkFormView {
82
86
  ?
83
87
  h("snk-form-summary", { summary: this.getCardSummary() })
84
88
  :
85
- h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
89
+ h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
86
90
  }
87
91
  static get is() { return "snk-form-view"; }
88
92
  static get encapsulation() { return "scoped"; }
@@ -351,6 +355,28 @@ export class SnkFormView {
351
355
  }
352
356
  }
353
357
  }
358
+ }, {
359
+ "method": "formItemsReady",
360
+ "name": "formItemsReady",
361
+ "bubbles": true,
362
+ "cancelable": true,
363
+ "composed": true,
364
+ "docs": {
365
+ "tags": [],
366
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
367
+ },
368
+ "complexType": {
369
+ "original": "Array<HTMLElement>",
370
+ "resolved": "HTMLElement[]",
371
+ "references": {
372
+ "Array": {
373
+ "location": "global"
374
+ },
375
+ "HTMLElement": {
376
+ "location": "global"
377
+ }
378
+ }
379
+ }
354
380
  }];
355
381
  }
356
382
  static get methods() {
@@ -21,7 +21,9 @@ export class SnkGuidesViewer {
21
21
  this.selectedGuide = undefined;
22
22
  this.taskbarManager = undefined;
23
23
  this.messagesBuilder = undefined;
24
+ this.canEdit = true;
24
25
  this.presentationMode = undefined;
26
+ this.resourceID = undefined;
25
27
  this._breadcrumbItems = [];
26
28
  this._guides = undefined;
27
29
  this._formEditorConfigManager = undefined;
@@ -223,9 +225,7 @@ export class SnkGuidesViewer {
223
225
  else {
224
226
  detailBranch = this.selectedGuide;
225
227
  }
226
- 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}`,
227
- // canEdit={this.canEdit}
228
- onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
228
+ 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 }));
229
229
  }
230
230
  else {
231
231
  const cardId = this.selectedGuide.id;
@@ -274,7 +274,10 @@ export class SnkGuidesViewer {
274
274
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
275
275
  }
276
276
  componentWillLoad() {
277
- this._configManager = new SnkFormConfigManager(this.configName, config => this.masterFormConfig = config);
277
+ if (this.resourceID == undefined) {
278
+ throw new Error("Erro interno: resourceID não informado");
279
+ }
280
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
278
281
  this._configManager.loadConfig();
279
282
  }
280
283
  componentDidRender() {
@@ -293,7 +296,7 @@ export class SnkGuidesViewer {
293
296
  }
294
297
  buildTaskBar() {
295
298
  var _a;
296
- 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 }));
299
+ 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 }));
297
300
  }
298
301
  render() {
299
302
  var _a, _b;
@@ -312,7 +315,7 @@ export class SnkGuidesViewer {
312
315
  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 ?
313
316
  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) })
314
317
  :
315
- 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) })));
318
+ 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 })));
316
319
  }
317
320
  static get is() { return "snk-guides-viewer"; }
318
321
  static get encapsulation() { return "scoped"; }
@@ -328,30 +331,6 @@ export class SnkGuidesViewer {
328
331
  }
329
332
  static get properties() {
330
333
  return {
331
- "_guideBuilders": {
332
- "type": "unknown",
333
- "mutable": false,
334
- "complexType": {
335
- "original": "Map<string, GuideBuilder>",
336
- "resolved": "Map<string, GuideBuilder>",
337
- "references": {
338
- "Map": {
339
- "location": "global"
340
- },
341
- "GuideBuilder": {
342
- "location": "import",
343
- "path": "./GuideBuilder"
344
- }
345
- }
346
- },
347
- "required": false,
348
- "optional": false,
349
- "docs": {
350
- "tags": [],
351
- "text": ""
352
- },
353
- "defaultValue": "new Map()"
354
- },
355
334
  "dataUnit": {
356
335
  "type": "unknown",
357
336
  "mutable": false,
@@ -549,6 +528,24 @@ export class SnkGuidesViewer {
549
528
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
550
529
  }
551
530
  },
531
+ "canEdit": {
532
+ "type": "boolean",
533
+ "mutable": false,
534
+ "complexType": {
535
+ "original": "boolean",
536
+ "resolved": "boolean",
537
+ "references": {}
538
+ },
539
+ "required": false,
540
+ "optional": false,
541
+ "docs": {
542
+ "tags": [],
543
+ "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
544
+ },
545
+ "attribute": "can-edit",
546
+ "reflect": false,
547
+ "defaultValue": "true"
548
+ },
552
549
  "presentationMode": {
553
550
  "type": "string",
554
551
  "mutable": false,
@@ -570,6 +567,23 @@ export class SnkGuidesViewer {
570
567
  },
571
568
  "attribute": "presentation-mode",
572
569
  "reflect": false
570
+ },
571
+ "resourceID": {
572
+ "type": "string",
573
+ "mutable": false,
574
+ "complexType": {
575
+ "original": "string",
576
+ "resolved": "string",
577
+ "references": {}
578
+ },
579
+ "required": false,
580
+ "optional": false,
581
+ "docs": {
582
+ "tags": [],
583
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
584
+ },
585
+ "attribute": "resource-i-d",
586
+ "reflect": false
573
587
  }
574
588
  };
575
589
  }
@@ -612,6 +626,28 @@ export class SnkGuidesViewer {
612
626
  "resolved": "string",
613
627
  "references": {}
614
628
  }
629
+ }, {
630
+ "method": "formItemsReady",
631
+ "name": "formItemsReady",
632
+ "bubbles": true,
633
+ "cancelable": true,
634
+ "composed": true,
635
+ "docs": {
636
+ "tags": [],
637
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
638
+ },
639
+ "complexType": {
640
+ "original": "Array<HTMLElement>",
641
+ "resolved": "HTMLElement[]",
642
+ "references": {
643
+ "Array": {
644
+ "location": "global"
645
+ },
646
+ "HTMLElement": {
647
+ "location": "global"
648
+ }
649
+ }
650
+ }
615
651
  }];
616
652
  }
617
653
  static get methods() {
@@ -11,9 +11,9 @@ export class SnkDataUnit {
11
11
  const duState = this.buildDataState();
12
12
  this.dataState = duState;
13
13
  if (action.type === Action.DATA_SAVED) {
14
- // if(this.ignoreSaveMessage){
15
- // return
16
- // }
14
+ if (this.ignoreSaveMessage) {
15
+ return;
16
+ }
17
17
  const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
18
18
  if (msg != undefined) {
19
19
  this.showSuccessMessage(msg);
@@ -59,7 +59,9 @@ export class SnkDataUnit {
59
59
  this.beforeSave = undefined;
60
60
  this.afterSave = undefined;
61
61
  this.useCancelConfirm = true;
62
+ this.ignoreSaveMessage = undefined;
62
63
  this.configName = undefined;
64
+ this.resourceID = undefined;
63
65
  }
64
66
  observePageSize() {
65
67
  if (this.dataUnit) {
@@ -179,7 +181,6 @@ export class SnkDataUnit {
179
181
  return resolve(action);
180
182
  if (this._openedAlert)
181
183
  return this.dataUnit.cancelEdition();
182
- ;
183
184
  this._openedAlert = true;
184
185
  this.dataUnit.cancelEdition();
185
186
  ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate")).then(() => {
@@ -324,10 +325,10 @@ export class SnkDataUnit {
324
325
  const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
325
326
  if (this._parentSnkDataUnit) {
326
327
  this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
327
- return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
328
+ return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
328
329
  }
329
330
  else {
330
- return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
331
+ return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
331
332
  }
332
333
  }
333
334
  async loadDataUnit() {
@@ -386,7 +387,7 @@ export class SnkDataUnit {
386
387
  //---------------------------------------------
387
388
  componentWillLoad() {
388
389
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
389
- this._application.getAllAccess().then(access => this._permissions = access);
390
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
390
391
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
391
392
  if (this.messagesBuilder == undefined) {
392
393
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -590,6 +591,23 @@ export class SnkDataUnit {
590
591
  "reflect": false,
591
592
  "defaultValue": "true"
592
593
  },
594
+ "ignoreSaveMessage": {
595
+ "type": "boolean",
596
+ "mutable": false,
597
+ "complexType": {
598
+ "original": "boolean",
599
+ "resolved": "boolean",
600
+ "references": {}
601
+ },
602
+ "required": false,
603
+ "optional": false,
604
+ "docs": {
605
+ "tags": [],
606
+ "text": "Respons\u00E1vel por evitar a mensagem de sucesso ao salvar."
607
+ },
608
+ "attribute": "ignore-save-message",
609
+ "reflect": false
610
+ },
593
611
  "configName": {
594
612
  "type": "string",
595
613
  "mutable": false,
@@ -606,6 +624,23 @@ export class SnkDataUnit {
606
624
  },
607
625
  "attribute": "config-name",
608
626
  "reflect": false
627
+ },
628
+ "resourceID": {
629
+ "type": "string",
630
+ "mutable": false,
631
+ "complexType": {
632
+ "original": "string",
633
+ "resolved": "string",
634
+ "references": {}
635
+ },
636
+ "required": false,
637
+ "optional": false,
638
+ "docs": {
639
+ "tags": [],
640
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
641
+ },
642
+ "attribute": "resource-i-d",
643
+ "reflect": false
609
644
  }
610
645
  };
611
646
  }
@@ -10,7 +10,6 @@ export class SnkEntityList {
10
10
  }
11
11
  async reloadList() {
12
12
  this.loadListSource();
13
- this.saveConfig.emit(this.config);
14
13
  }
15
14
  observeConfig() {
16
15
  var _a, _b;
@@ -26,7 +25,6 @@ export class SnkEntityList {
26
25
  }
27
26
  });
28
27
  this.config = ObjectUtils.copy(configCopy);
29
- this.saveConfig.emit(this.config);
30
28
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
31
29
  }
32
30
  loadListSource() {
@@ -83,7 +81,6 @@ export class SnkEntityList {
83
81
  }
84
82
  ] });
85
83
  this.loadListSource();
86
- this.saveConfig.emit(this.config);
87
84
  this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
88
85
  }
89
86
  }
@@ -206,26 +203,6 @@ export class SnkEntityList {
206
203
  }
207
204
  }
208
205
  }
209
- }, {
210
- "method": "saveConfig",
211
- "name": "saveConfig",
212
- "bubbles": true,
213
- "cancelable": true,
214
- "composed": true,
215
- "docs": {
216
- "tags": [],
217
- "text": "Evento emitido ao realizar alguma a\u00E7\u00E3o que altera os dados do config.value permitindo salvar estas informa\u00E7\u00F5es"
218
- },
219
- "complexType": {
220
- "original": "SnkFilterItemConfig",
221
- "resolved": "SnkFilterItemConfig",
222
- "references": {
223
- "SnkFilterItemConfig": {
224
- "location": "import",
225
- "path": "../snk-filter-bar/filter-item/snk-filter-item"
226
- }
227
- }
228
- }
229
206
  }];
230
207
  }
231
208
  static get methods() {
@@ -1,8 +1,7 @@
1
1
  import { h, Host, Fragment } from '@stencil/core';
2
2
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
3
  import FilterItemType from './filter-item-type.enum';
4
- import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
5
- import FilterBarConfigFetcher from '../../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher';
4
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
6
5
  import { EPresentationMode } from './editors/enum/presentationMode';
7
6
  import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
8
7
  export class SnkFilterDetail {
@@ -24,7 +23,6 @@ export class SnkFilterDetail {
24
23
  }
25
24
  componentDidLoad() {
26
25
  if (this._element) {
27
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
28
26
  ElementIDUtils.addIDInfo(this._element);
29
27
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
30
28
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.config.id}`;
@@ -142,20 +140,12 @@ export class SnkFilterDetail {
142
140
  this.config = ObjectUtils.copy(configCopy);
143
141
  }
144
142
  }
145
- saveConfig(newConfig) {
146
- var _a;
147
- (_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
148
- const fetcher = new FilterBarConfigFetcher();
149
- fetcher.saveEntityListConfig(newConfig, resourceId, this._application.configName);
150
- this.config = newConfig;
151
- });
152
- }
153
143
  componentWillLoad() {
154
144
  this.originalConfig = ObjectUtils.copy(this.config);
155
145
  }
156
146
  render() {
157
147
  const { tag: CustomElement, props } = this.getContentEditor();
158
- 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" }))));
148
+ 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" }))));
159
149
  }
160
150
  static get is() { return "snk-filter-detail"; }
161
151
  static get properties() {
@@ -244,7 +244,7 @@ export class SnkFilterModal {
244
244
  "optional": false,
245
245
  "docs": {
246
246
  "tags": [],
247
- "text": "Nome da config para buscar no resourceId"
247
+ "text": "Nome da configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
248
248
  },
249
249
  "attribute": "config-name",
250
250
  "reflect": false
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from '@stencil/core';
2
- import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
2
+ import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import FilterItemType from '../../filter-item/filter-item-type.enum';
4
4
  import { EPresentationMode } from '../../filter-item/editors/enum/presentationMode';
5
5
  import { ConfigStorage } from '../../../../lib/configs/ConfigStorage';
@@ -8,14 +8,13 @@ export class SnkFilterModalItem {
8
8
  constructor() {
9
9
  this.filterItem = undefined;
10
10
  this.configName = undefined;
11
+ this.resourceID = undefined;
11
12
  }
12
13
  observeFilterItem(newValue) {
13
14
  var _a, _b;
14
15
  this._editor && (this._editor["config"] = newValue);
15
16
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
16
17
  this.filterChange.emit(newValue);
17
- //isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
18
- //this.saveConfig();
19
18
  }
20
19
  getContentEditorConfig() {
21
20
  const props = { presentationMode: EPresentationMode.MODAL };
@@ -57,11 +56,10 @@ export class SnkFilterModalItem {
57
56
  else {
58
57
  this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === FilterItemType.SEARCH ? data : newValue, visible: this.isVisible(newValue) });
59
58
  }
60
- this.saveConfig();
61
59
  }
62
60
  handleDeleteFilter(filter, filterItemType) {
63
61
  if (filterItemType === FilterItemType.PERSONALIZED) {
64
- ConfigStorage.removePersonalizedFilter(filter, this.configName);
62
+ ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
65
63
  }
66
64
  }
67
65
  componentDidLoad() {
@@ -69,7 +67,6 @@ export class SnkFilterModalItem {
69
67
  ElementIDUtils.addIDInfo(this._element);
70
68
  const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
71
69
  this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
72
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
73
70
  }
74
71
  }
75
72
  buildRightSlot(item) {
@@ -86,15 +83,6 @@ export class SnkFilterModalItem {
86
83
  const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
87
84
  return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
88
85
  }
89
- saveConfig() {
90
- //Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
91
- /*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
92
-
93
- this._application?.getResourceID().then(resourceId => {
94
- const fetcher = new FilterBarConfigFetcher();
95
- fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
96
- });*/
97
- }
98
86
  render() {
99
87
  const { tag: ContentEditor, props } = this.getContentEditorConfig();
100
88
  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)))));
@@ -144,10 +132,27 @@ export class SnkFilterModalItem {
144
132
  "optional": false,
145
133
  "docs": {
146
134
  "tags": [],
147
- "text": "Nome da config para buscar no resourceId"
135
+ "text": "Nome da configura\u00E7\u00E3o. Serve para distinguir v\u00E1rias inst\u00E2ncias do componente."
148
136
  },
149
137
  "attribute": "config-name",
150
138
  "reflect": false
139
+ },
140
+ "resourceID": {
141
+ "type": "string",
142
+ "mutable": false,
143
+ "complexType": {
144
+ "original": "string",
145
+ "resolved": "string",
146
+ "references": {}
147
+ },
148
+ "required": false,
149
+ "optional": false,
150
+ "docs": {
151
+ "tags": [],
152
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
153
+ },
154
+ "attribute": "resource-i-d",
155
+ "reflect": false
151
156
  }
152
157
  };
153
158
  }