@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
@@ -11,11 +11,6 @@ export class SnkSimpleCrud {
11
11
  this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
12
12
  this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
13
13
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
14
- // /**
15
- // * Quando verdadeiro, o ENTER fará a navegação como se fosse a tecla TAB na grade.
16
- // */
17
- // @Prop()
18
- // useEnterLikeTab: boolean = false;
19
14
  this._taskbarProcessor = new TaskbarProcessor({
20
15
  "snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.GRID_MODE),
21
16
  "snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.FORM_MODE),
@@ -34,6 +29,7 @@ export class SnkSimpleCrud {
34
29
  this.useCancelConfirm = true;
35
30
  this.taskbarManager = undefined;
36
31
  this.messagesBuilder = undefined;
32
+ this.useEnterLikeTab = false;
37
33
  }
38
34
  resolveInMemoryBtns(taskbarButtons) {
39
35
  const newTaskBarConfig = [...taskbarButtons];
@@ -178,11 +174,9 @@ export class SnkSimpleCrud {
178
174
  }
179
175
  render() {
180
176
  var _a;
181
- return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail),
182
- // ignoreSaveMessage={this._currentViewMode === VIEW_MODE.GRID}
183
- onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
177
+ return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
184
178
  ? undefined
185
- : this._multiSelectionListDataSource }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
179
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
186
180
  }
187
181
  static get is() { return "snk-simple-crud"; }
188
182
  static get encapsulation() { return "scoped"; }
@@ -375,6 +369,24 @@ export class SnkSimpleCrud {
375
369
  "tags": [],
376
370
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
377
371
  }
372
+ },
373
+ "useEnterLikeTab": {
374
+ "type": "boolean",
375
+ "mutable": false,
376
+ "complexType": {
377
+ "original": "boolean",
378
+ "resolved": "boolean",
379
+ "references": {}
380
+ },
381
+ "required": false,
382
+ "optional": false,
383
+ "docs": {
384
+ "tags": [],
385
+ "text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
386
+ },
387
+ "attribute": "use-enter-like-tab",
388
+ "reflect": false,
389
+ "defaultValue": "false"
378
390
  }
379
391
  };
380
392
  }
@@ -440,6 +452,28 @@ export class SnkSimpleCrud {
440
452
  "resolved": "string",
441
453
  "references": {}
442
454
  }
455
+ }, {
456
+ "method": "formItemsReady",
457
+ "name": "formItemsReady",
458
+ "bubbles": true,
459
+ "cancelable": true,
460
+ "composed": true,
461
+ "docs": {
462
+ "tags": [],
463
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
464
+ },
465
+ "complexType": {
466
+ "original": "Array<HTMLElement>",
467
+ "resolved": "HTMLElement[]",
468
+ "references": {
469
+ "Array": {
470
+ "location": "global"
471
+ },
472
+ "HTMLElement": {
473
+ "location": "global"
474
+ }
475
+ }
476
+ }
443
477
  }];
444
478
  }
445
479
  static get methods() {
@@ -23,6 +23,7 @@ export class SnkTaskbar {
23
23
  };
24
24
  this._permissions = undefined;
25
25
  this.configName = undefined;
26
+ this.resourceID = undefined;
26
27
  this.buttons = undefined;
27
28
  this.customButtons = undefined;
28
29
  this.actionsList = undefined;
@@ -164,7 +165,7 @@ export class SnkTaskbar {
164
165
  componentWillLoad() {
165
166
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
166
167
  if (this._application) {
167
- this._application.getAllAccess().then(access => this._permissions = access);
168
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
168
169
  }
169
170
  else {
170
171
  this._permissions = {};
@@ -232,6 +233,23 @@ export class SnkTaskbar {
232
233
  "attribute": "config-name",
233
234
  "reflect": false
234
235
  },
236
+ "resourceID": {
237
+ "type": "string",
238
+ "mutable": false,
239
+ "complexType": {
240
+ "original": "string",
241
+ "resolved": "string",
242
+ "references": {}
243
+ },
244
+ "required": false,
245
+ "optional": false,
246
+ "docs": {
247
+ "tags": [],
248
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
249
+ },
250
+ "attribute": "resource-i-d",
251
+ "reflect": false
252
+ },
235
253
  "buttons": {
236
254
  "type": "string",
237
255
  "mutable": false,
@@ -1,4 +1,3 @@
1
- import { ApplicationContext } from "@sankhyalabs/core";
2
1
  import { FormConfigFetcher } from "../http/data-fetcher/fetchers/form-config-fetcher";
3
2
  import GridConfigFetcher from "../http/data-fetcher/fetchers/grid-config-fetcher";
4
3
  import FilterBarConfigFetcher from "../http/data-fetcher/fetchers/filter-bar-config-fetcher";
@@ -9,83 +8,73 @@ const CONFIG_SOURCE = {
9
8
  filterBar: "filterBar"
10
9
  };
11
10
  export class ConfigStorage {
12
- static async get() {
13
- if (!ConfigStorage.instance) {
14
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
15
- if (application != undefined) {
16
- const configName = application.configName;
17
- const resourceID = await application.getResourceID();
18
- ConfigStorage.instance = new ConfigStorage();
19
- ConfigStorage.resourceID = resourceID;
20
- ConfigStorage.instance.loadFormConfig(configName);
21
- ConfigStorage.instance.loadGridConfig(configName);
22
- }
23
- }
24
- return this.instance;
11
+ static preload(resourceID, configName) {
12
+ ConfigStorage.loadFormConfig(configName, resourceID);
13
+ ConfigStorage.loadGridConfig(configName, resourceID);
25
14
  }
26
- async loadFilterBarConfig(name, urlParams) {
27
- const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar);
15
+ static async loadFilterBarConfig(name, resourceID, urlParams) {
16
+ const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
28
17
  if (!ConfigStorage.configById.has(cacheID)) {
29
- ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(ConfigStorage.resourceID, name, urlParams));
18
+ ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(resourceID, name, urlParams));
30
19
  }
31
20
  return ConfigStorage.configById.get(cacheID);
32
21
  }
33
- async loadFormConfig(name) {
34
- const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
22
+ static async loadFormConfig(name, resourceID) {
23
+ const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
35
24
  if (!ConfigStorage.configById.has(cacheID)) {
36
- ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
25
+ ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, resourceID));
37
26
  }
38
27
  return ConfigStorage.configById.get(cacheID);
39
28
  }
40
- async loadGridConfig(name) {
41
- const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
29
+ static async loadGridConfig(name, resourceID) {
30
+ const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
42
31
  if (!ConfigStorage.configById.has(cacheID)) {
43
- ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
32
+ ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, resourceID));
44
33
  }
45
34
  return ConfigStorage.configById.get(cacheID);
46
35
  }
47
- static async saveFilterBarConfig(config, name) {
48
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar);
36
+ static async saveFilterBarConfig(config, name, resourceID) {
37
+ const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
49
38
  this.configById.delete(cacheID);
50
- return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
39
+ return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
51
40
  }
52
- static async saveFormConfig(config, name) {
53
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
41
+ static async saveFormConfig(config, name, resourceID) {
42
+ const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
54
43
  this.configById.delete(cacheID);
55
- return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
44
+ return this.formConfigFetcher.saveConfig(config, name, resourceID);
56
45
  }
57
- static async saveCardState(config, name) {
58
- return this.formConfigFetcher.saveCardState(config, name, this.resourceID);
46
+ static async saveCardState(config, name, resourceID) {
47
+ return this.formConfigFetcher.saveCardState(config, name, resourceID);
59
48
  }
60
- static async saveGridConfig(config, name) {
49
+ static async saveGridConfig(config, name, resourceID) {
61
50
  if (config == undefined) {
62
51
  return;
63
52
  }
64
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
53
+ const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
65
54
  this.configById.delete(cacheID);
66
- return this.gridConfigFetcher.saveConfig(config, name, this.resourceID);
55
+ return this.gridConfigFetcher.saveConfig(config, name, resourceID);
67
56
  }
68
- static async loadPersonalizedFilter(filterId, configName) {
69
- return this.personalizedFilterFetcher.loadPersonalizedFilter(this.resourceID, filterId, configName);
57
+ static async loadPersonalizedFilter(filterId, resourceID, configName) {
58
+ return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
70
59
  }
71
- static async savePersonalizedFilter(personalizedFilter, configName) {
60
+ static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
72
61
  //Ao criar ou alterar um filtro personalizado,
73
62
  //precisamos remover o cache do status da filterbar.
74
- const cacheID = this.buildCacheID(configName, CONFIG_SOURCE.filterBar);
63
+ const cacheID = this.buildCacheID(configName, CONFIG_SOURCE.filterBar, resourceID);
75
64
  this.configById.delete(cacheID);
76
- return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, this.resourceID, configName);
65
+ return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
77
66
  }
78
- static async removePersonalizedFilter(personalizedFilter, configName) {
79
- return this.personalizedFilterFetcher.removePersonalizedFilter(personalizedFilter, this.resourceID, configName);
67
+ static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
68
+ return this.personalizedFilterFetcher.removePersonalizedFilter(personalizedFilter, resourceID, configName);
80
69
  }
81
70
  static async validatePersonalizedFilter(dataUnitName, expression) {
82
71
  return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
83
72
  }
84
- static buildCacheID(name, source) {
73
+ static buildCacheID(name, source, resourceID) {
85
74
  if (name == undefined) {
86
- return `req_${source}_${this.resourceID}`;
75
+ return `req_${source}_${resourceID}`;
87
76
  }
88
- return `req_${source}_${name}_${this.resourceID}`;
77
+ return `req_${source}_${name}_${resourceID}`;
89
78
  }
90
79
  }
91
80
  ConfigStorage.configById = new Map();
@@ -1,12 +1,11 @@
1
- import { ChangeOperation, DataType, DataUnit, SortMode, StringUtils, } from '@sankhyalabs/core';
2
- import { DISTINCT_FILTER_NAME_PREFIX } from "@sankhyalabs/ezui/dist/collection/utils/constants";
1
+ import { ChangeOperation, DataUnit, defaultDataLoader, StringUtils, } from '@sankhyalabs/core';
3
2
  export default class InMemoryLoader {
4
3
  constructor(metadata, records) {
5
4
  this.records = records || [];
6
5
  this.metadata = metadata;
7
6
  this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
8
7
  this._dataUnit.metadataLoader = () => this.metadaLoader();
9
- this._dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
8
+ this._dataUnit.dataLoader = (dataUnit, request) => defaultDataLoader(dataUnit, request, this._records);
10
9
  this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
11
10
  this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
12
11
  this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
@@ -43,62 +42,6 @@ export default class InMemoryLoader {
43
42
  metadaLoader() {
44
43
  return Promise.resolve(this._metadata);
45
44
  }
46
- dataLoader(dataUnit, request) {
47
- const filters = this.getColumnFilters(dataUnit);
48
- let records = this.applyFilters(filters);
49
- if (request.sort) {
50
- request.sort.forEach(sort => {
51
- records = records.sort((recordA, recordB) => {
52
- const fieldA = recordA[sort.field];
53
- const fieldB = recordB[sort.field];
54
- const sortFn = this.getSortFn(sort.dataType);
55
- return sortFn(fieldA, fieldB) * (sort.mode == SortMode.ASC ? 1 : -1);
56
- });
57
- });
58
- }
59
- return Promise.resolve({ records: records });
60
- }
61
- applyFilters(filters) {
62
- let records = [...this._records];
63
- filters.forEach(filter => {
64
- records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
65
- });
66
- return records;
67
- }
68
- getColumnFilters(dataUnit) {
69
- var _a, _b;
70
- const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
71
- const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
72
- return columnFilters.map(filter => {
73
- var _a, _b;
74
- return {
75
- column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
76
- values: filter.params.map(param => param.value),
77
- };
78
- });
79
- }
80
- getSortFn(type) {
81
- switch (type) {
82
- case DataType.NUMBER:
83
- return this.sortNumber;
84
- case DataType.DATE:
85
- return this.sortDate;
86
- case DataType.OBJECT:
87
- return this.sortObject;
88
- default:
89
- return StringUtils.compare;
90
- }
91
- }
92
- sortObject(a, b) {
93
- return StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
94
- }
95
- sortNumber(a, b) {
96
- return a - b;
97
- }
98
- sortDate(a, b) {
99
- let timeA = a.getTime(), timeB = b.getTime();
100
- return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
101
- }
102
45
  saveLoader(_dataUnit, changes) {
103
46
  return new Promise((resolve) => {
104
47
  let dataUnitRecords = [];
@@ -7,7 +7,8 @@ import { GraphQLRecaller } from './recaller/GraphQLRecaller';
7
7
  import { PrintUtils } from '../../utils/PrintUtils';
8
8
  export class DataFetcher {
9
9
  constructor() {
10
- this.GRAPHQL_PATH = "/mgefin-bff/graphql";
10
+ this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
11
+ this.ready = true;
11
12
  this.watingRequestsById = new Map();
12
13
  }
13
14
  static get() {
@@ -18,6 +19,9 @@ export class DataFetcher {
18
19
  DataFetcher.instance.resume();
19
20
  }
20
21
  else {
22
+ if (ApplicationContext.getContextValue("__SNK__APPLICATION__LOADING__") === true) {
23
+ DataFetcher.instance.pause();
24
+ }
21
25
  application.addEventListener('applicationLoading', () => DataFetcher.instance.pause());
22
26
  application.addEventListener('applicationLoaded', () => DataFetcher.instance.resume());
23
27
  }
@@ -76,6 +80,10 @@ export class DataFetcher {
76
80
  }
77
81
  async callGraphQL(req) {
78
82
  var _a;
83
+ if (this.ready) {
84
+ this.pause();
85
+ window.requestAnimationFrame(() => this.resume());
86
+ }
79
87
  const reqKey = this.getReqKey(req);
80
88
  req.queryID = reqKey;
81
89
  req.values.queryID = reqKey;
@@ -105,7 +113,7 @@ export class DataFetcher {
105
113
  if (!this.watingRequestsById.has(reqKey)) {
106
114
  this.watingRequestsById.set(reqKey, new WaitingRequest(req));
107
115
  }
108
- return (_a = this.getWatingRequest(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
116
+ return (_a = this.watingRequestsById.get(reqKey)) === null || _a === void 0 ? void 0 : _a.promise;
109
117
  }
110
118
  }
111
119
  resolveURL() {
@@ -253,42 +261,43 @@ export class DataFetcher {
253
261
  getQueryTemplate(re) {
254
262
  return (re.query || "").replaceAll("$queryAlias$", re.queryID);
255
263
  }
256
- getWatingRequest(reqID) {
257
- return this.watingRequestsById.get(reqID);
258
- }
259
264
  pause() {
260
265
  this.ready = false;
261
266
  }
262
267
  async resume() {
263
268
  this.ready = true;
264
269
  if (this.watingRequestsById.size > 0) {
265
- const requestsBatch = [];
266
- this.watingRequestsById.forEach(async (waitingReq) => {
267
- let query = this.getQueryTemplate(waitingReq.request);
268
- requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
269
- });
270
- let res = undefined;
271
- let dataResponse = [];
272
- let errorsResponse = [];
273
- res = await this.fecthGrapql(requestsBatch);
274
- dataResponse = res.data;
275
- errorsResponse = res.errors;
276
- //Reject promises with errors from query
277
- errorsResponse.forEach((errorResponse) => {
278
- Object.entries(errorResponse).forEach(([_key, val]) => {
279
- var _a;
280
- (((_a = this.getWatingRequest(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
281
- });
270
+ const waitinRequests = this.watingRequestsById;
271
+ this.watingRequestsById = new Map();
272
+ this.executePendingRequest(waitinRequests);
273
+ }
274
+ }
275
+ async executePendingRequest(watingRequestsById) {
276
+ const requestsBatch = [];
277
+ watingRequestsById.forEach(async (waitingReq) => {
278
+ let query = this.getQueryTemplate(waitingReq.request);
279
+ requestsBatch.push({ document: query, variables: Object.assign({}, waitingReq.request.values) });
280
+ });
281
+ let res = undefined;
282
+ let dataResponse = [];
283
+ let errorsResponse = [];
284
+ res = await this.fecthGrapql(requestsBatch);
285
+ dataResponse = res.data;
286
+ errorsResponse = res.errors;
287
+ //Reject promises with errors from query
288
+ errorsResponse.forEach((errorResponse) => {
289
+ Object.entries(errorResponse).forEach(([_key, val]) => {
290
+ var _a;
291
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
282
292
  });
283
- //Resolve promises with data from query
284
- dataResponse.forEach((data) => {
285
- Object.entries(data).forEach(([key, val]) => {
286
- var _a;
287
- (((_a = this.getWatingRequest(key)) === null || _a === void 0 ? void 0 : _a.resolve) || Promise.resolve)(val);
288
- });
293
+ });
294
+ //Resolve promises with data from query
295
+ dataResponse.forEach((data) => {
296
+ Object.entries(data).forEach(([key, val]) => {
297
+ var _a;
298
+ (((_a = watingRequestsById.get(key)) === null || _a === void 0 ? void 0 : _a.resolve) || Promise.resolve)(val);
289
299
  });
290
- this.watingRequestsById.clear();
291
- }
300
+ });
292
301
  }
293
302
  async fecthGrapql(request) {
294
303
  let res = undefined;
@@ -91,30 +91,6 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
91
91
  });
92
92
  });
93
93
  }
94
- saveEntityListConfig(item, resourceID, configName) {
95
- return new Promise((accept, reject) => {
96
- this.getConfig(resourceID, configName).then(config => {
97
- const state = config.map(({ id, value, fixed, visible, type, groupedItems }) => {
98
- return Object.assign(Object.assign(Object.assign(Object.assign({ id }, (value && { value: normalizeValue(value, type) })), (fixed && { fixed })), (visible && { visible: true })), { groupedItems });
99
- });
100
- const index = state.findIndex(({ id }) => id === item.id);
101
- const newItem = { id: item.id, value: normalizeValue(item.value, item.type), fixed: item.fixed, visible: true };
102
- if (index > -1) {
103
- state[index] = newItem;
104
- }
105
- else {
106
- state.push(newItem);
107
- }
108
- this.saveResource(state, this.getPath(resourceID, configName)).then(resp => {
109
- accept(resp);
110
- }).catch(exception => {
111
- reject(exception);
112
- });
113
- }).catch(exception => {
114
- reject(exception);
115
- });
116
- });
117
- }
118
94
  buildFieldList(items) {
119
95
  return items.map(item => {
120
96
  var _a, _b;
@@ -2,3 +2,13 @@ export { DataFetcher } from './http/data-fetcher/DataFetcher';
2
2
  export { PesquisaFetcher } from './http/data-fetcher/fetchers/pesquisa-fetcher';
3
3
  export { CrudUtils } from './utils/CrudUtils';
4
4
  export { PresentationMode } from "./@types";
5
+ export { TotalsFetcher } from './http/data-fetcher/fetchers/totals-fetcher';
6
+ export { default as ApplicationConfigFetcher } from './http/data-fetcher/fetchers/application-config-fetcher';
7
+ export { AttachFetcher } from './http/data-fetcher/fetchers/attach-fetcher';
8
+ export { default as DataUnitFetcher } from './http/data-fetcher/fetchers/dataunit-fetcher';
9
+ export { default as FilterBarConfigFetcher } from './http/data-fetcher/fetchers/filter-bar-config-fetcher';
10
+ export { FormConfigFetcher } from './http/data-fetcher/fetchers/form-config-fetcher';
11
+ export { default as GridConfigFetcher } from './http/data-fetcher/fetchers/grid-config-fetcher';
12
+ export { default as ParametersFetcher } from './http/data-fetcher/fetchers/parameters-fecher';
13
+ export { default as PersonalizedFilterFetcher } from './http/data-fetcher/fetchers/personalized-filter-fetcher';
14
+ export { ResourceFetcher } from './http/data-fetcher/fetchers/resource-fetcher';
@@ -0,0 +1,7 @@
1
+ import { ApplicationContext } from "@sankhyalabs/core";
2
+ export default class ResourceIDUtils {
3
+ static async getResourceID() {
4
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
5
+ return application.getResourceID();
6
+ }
7
+ }
@@ -22,4 +22,33 @@ export default class UrlUtils {
22
22
  return window['mock_url'];
23
23
  return `${location.protocol}//${location.hostname}${location.port ? ":" + location.port : ""}`;
24
24
  }
25
+ /**
26
+ * Extrai da URL o parâmetro que contém o resourceId da tela desejada.
27
+ *
28
+ */
29
+ static getResourceIdFromUrlToken(url) {
30
+ try {
31
+ const parts = url.split('/');
32
+ const encodedValue = parts[1];
33
+ return atob(encodedValue);
34
+ }
35
+ catch (error) {
36
+ throw new Error('Erro ao obter resourceId:' + error);
37
+ }
38
+ }
39
+ /**
40
+ * Extrai da URL o parâmetro que contém o o objeto com a PK do registro específico.
41
+ *
42
+ */
43
+ static getPkObjectFromUrlToken(url) {
44
+ try {
45
+ const parts = url.split('/');
46
+ const encodedObjectPart = parts[parts.length - 2];
47
+ const decodedObjectPart = atob(encodedObjectPart);
48
+ return JSON.parse(decodedObjectPart);
49
+ }
50
+ catch (error) {
51
+ throw new Error('Erro ao obter a PK do objeto:' + error);
52
+ }
53
+ }
25
54
  }