@sankhyalabs/sankhyablocks 8.1.0-dev.10 → 8.1.0-dev.12

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 (209) hide show
  1. package/dist/cjs/{ConfigStorage-e32e1391.js → ConfigStorage-42601579.js} +163 -51
  2. package/dist/cjs/{DataFetcher-d2c6ae38.js → DataFetcher-370cc8f2.js} +38 -29
  3. package/dist/cjs/ISave-d68ce3cd.js +8 -0
  4. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  5. package/dist/cjs/{SnkFormConfigManager-5e61b0a9.js → SnkFormConfigManager-e5a28b2e.js} +19 -21
  6. package/dist/cjs/{auth-fetcher-da975ac5.js → auth-fetcher-c42326e9.js} +2 -2
  7. package/dist/cjs/{dataunit-fetcher-58ad78a7.js → dataunit-fetcher-eab8050e.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-761994b9.js → form-config-fetcher-6704319c.js} +66 -3
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-bb0bb679.js → pesquisa-fetcher-84d392c7.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 +49 -44
  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 +24 -10
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  18. package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-80a00ae4.js} +4 -3
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +13 -12
  21. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +13 -16
  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.cjs.entry.js +11 -8
  27. package/dist/cjs/snk-grid-config.cjs.entry.js +5 -6
  28. package/dist/cjs/snk-grid.cjs.entry.js +13 -17
  29. package/dist/cjs/{snk-guides-viewer-eb0a79a4.js → snk-guides-viewer-fd785f55.js} +16 -7
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +13 -16
  32. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -3
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
  35. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  36. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  37. package/dist/collection/components/snk-application/snk-application.js +60 -65
  38. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  39. package/dist/collection/components/snk-crud/snk-crud.js +18 -6
  40. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +20 -2
  41. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +25 -28
  42. package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -4
  43. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  44. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
  45. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  46. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
  47. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +27 -11
  48. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  49. package/dist/collection/components/snk-form/snk-form.js +24 -2
  50. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  51. package/dist/collection/components/snk-grid/snk-grid.js +27 -12
  52. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  53. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  54. package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
  55. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  56. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +38 -29
  57. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  58. package/dist/collection/lib/index.js +10 -0
  59. package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
  60. package/dist/components/ConfigStorage.js +161 -48
  61. package/dist/components/DataFetcher.js +38 -29
  62. package/dist/components/ResourceIDUtils.js +10 -0
  63. package/dist/components/SnkFormConfigManager.js +17 -19
  64. package/dist/components/auth-fetcher.js +1 -1
  65. package/dist/components/form-config-fetcher.js +64 -2
  66. package/dist/components/snk-actions-button2.js +23 -9
  67. package/dist/components/snk-application2.js +134 -128
  68. package/dist/components/snk-attach2.js +1 -8
  69. package/dist/components/snk-configurator2.js +3 -1
  70. package/dist/components/snk-crud.js +22 -6
  71. package/dist/components/snk-data-unit2.js +5 -3
  72. package/dist/components/snk-detail-view2.js +18 -8
  73. package/dist/components/snk-entity-list.js +0 -4
  74. package/dist/components/snk-filter-bar2.js +11 -11
  75. package/dist/components/snk-filter-detail2.js +2 -12
  76. package/dist/components/snk-filter-modal-item2.js +5 -16
  77. package/dist/components/snk-form-config2.js +5 -15
  78. package/dist/components/snk-form.js +8 -2
  79. package/dist/components/snk-grid-config2.js +4 -2
  80. package/dist/components/snk-grid2.js +11 -12
  81. package/dist/components/snk-personalized-filter2.js +11 -11
  82. package/dist/components/snk-simple-crud2.js +5 -1
  83. package/dist/components/snk-taskbar2.js +3 -1
  84. package/dist/esm/{ConfigStorage-b6aefe42.js → ConfigStorage-2915a841.js} +162 -49
  85. package/dist/esm/{DataFetcher-aaaff866.js → DataFetcher-0b121ffb.js} +38 -29
  86. package/dist/esm/ISave-4412b20c.js +8 -0
  87. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  88. package/dist/esm/{SnkFormConfigManager-80901f2d.js → SnkFormConfigManager-8005340f.js} +19 -21
  89. package/dist/esm/{auth-fetcher-7860d777.js → auth-fetcher-643f240e.js} +1 -1
  90. package/dist/esm/{dataunit-fetcher-9dfcdb1d.js → dataunit-fetcher-6423d6eb.js} +1 -1
  91. package/dist/esm/{form-config-fetcher-4a34b86a.js → form-config-fetcher-77cdb26c.js} +65 -3
  92. package/dist/esm/loader.js +1 -1
  93. package/dist/esm/{pesquisa-fetcher-01d058e6.js → pesquisa-fetcher-c5a3c564.js} +1 -1
  94. package/dist/esm/sankhyablocks.js +1 -1
  95. package/dist/esm/snk-actions-button.entry.js +18 -11
  96. package/dist/esm/snk-application.entry.js +49 -44
  97. package/dist/esm/snk-attach.entry.js +3 -9
  98. package/dist/esm/snk-configurator.entry.js +2 -1
  99. package/dist/esm/snk-crud.entry.js +24 -10
  100. package/dist/esm/snk-data-exporter.entry.js +2 -2
  101. package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-3ab57d1a.js} +4 -3
  102. package/dist/esm/snk-data-unit.entry.js +1 -1
  103. package/dist/esm/snk-detail-view.entry.js +13 -12
  104. package/dist/esm/snk-entity-list.entry.js +0 -4
  105. package/dist/esm/snk-filter-bar.entry.js +13 -16
  106. package/dist/esm/snk-filter-detail.entry.js +2 -16
  107. package/dist/esm/snk-filter-modal-item.entry.js +6 -20
  108. package/dist/esm/snk-form-config.entry.js +7 -18
  109. package/dist/esm/snk-form.entry.js +11 -8
  110. package/dist/esm/snk-grid-config.entry.js +5 -6
  111. package/dist/esm/snk-grid.entry.js +13 -17
  112. package/dist/esm/{snk-guides-viewer-ee42eb53.js → snk-guides-viewer-43b550a2.js} +16 -7
  113. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  114. package/dist/esm/snk-personalized-filter.entry.js +13 -16
  115. package/dist/esm/snk-print-selector.entry.js +1 -1
  116. package/dist/esm/snk-simple-crud.entry.js +7 -3
  117. package/dist/esm/snk-taskbar.entry.js +2 -1
  118. package/dist/sankhyablocks/p-1108ed0e.entry.js +1 -0
  119. package/dist/sankhyablocks/p-18ead46b.entry.js +1 -0
  120. package/dist/sankhyablocks/p-1986cfa4.js +26 -0
  121. package/dist/sankhyablocks/p-1c7b4bad.entry.js +1 -0
  122. package/dist/sankhyablocks/p-48a40939.js +1 -0
  123. package/dist/sankhyablocks/p-508822c3.entry.js +1 -0
  124. package/dist/sankhyablocks/{p-85affa29.js → p-53a7ab6c.js} +1 -1
  125. package/dist/sankhyablocks/{p-77ecc583.entry.js → p-58b84e45.entry.js} +1 -1
  126. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  127. package/dist/sankhyablocks/{p-05bcad8a.entry.js → p-774afde8.entry.js} +1 -1
  128. package/dist/sankhyablocks/p-84b9208d.entry.js +1 -0
  129. package/dist/sankhyablocks/p-85dfb90b.entry.js +1 -0
  130. package/dist/sankhyablocks/p-86dda34d.js +1 -0
  131. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  132. package/dist/sankhyablocks/{p-bee6b5d7.js → p-9bfc7124.js} +1 -1
  133. package/dist/sankhyablocks/p-9d81ad53.entry.js +1 -0
  134. package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
  135. package/dist/sankhyablocks/p-a107474c.js +56 -0
  136. package/dist/sankhyablocks/p-a28470ae.entry.js +1 -0
  137. package/dist/sankhyablocks/p-b9376677.entry.js +1 -0
  138. package/dist/sankhyablocks/p-c7c035eb.js +1 -0
  139. package/dist/sankhyablocks/p-caaef934.js +1 -0
  140. package/dist/sankhyablocks/p-cf65dbb2.entry.js +1 -0
  141. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  142. package/dist/sankhyablocks/p-da2422ef.entry.js +11 -0
  143. package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
  144. package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
  145. package/dist/sankhyablocks/p-f1f5232d.entry.js +1 -0
  146. package/dist/sankhyablocks/{p-60791bb6.js → p-f88bdc84.js} +1 -1
  147. package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
  148. package/dist/sankhyablocks/p-fcdd5761.entry.js +1 -0
  149. package/dist/sankhyablocks/p-fdf6b377.entry.js +1 -0
  150. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  151. package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
  152. package/dist/types/components/snk-application/snk-application.d.ts +8 -13
  153. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  154. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
  155. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +4 -0
  156. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -2
  157. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
  158. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  159. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  160. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  161. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
  162. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  163. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  164. package/dist/types/components/snk-form/snk-form.d.ts +5 -1
  165. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  166. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  167. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  168. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  169. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
  170. package/dist/types/components.d.ts +99 -21
  171. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  172. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  173. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
  174. package/dist/types/lib/index.d.ts +11 -0
  175. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  176. package/package.json +1 -1
  177. package/dist/cjs/filter-bar-config-fetcher-80b033ce.js +0 -155
  178. package/dist/cjs/resource-fetcher-95d24dff.js +0 -68
  179. package/dist/components/filter-bar-config-fetcher.js +0 -153
  180. package/dist/components/resource-fetcher.js +0 -66
  181. package/dist/esm/filter-bar-config-fetcher-317cb6bf.js +0 -153
  182. package/dist/esm/resource-fetcher-b36ac145.js +0 -66
  183. package/dist/sankhyablocks/p-0b64f036.entry.js +0 -1
  184. package/dist/sankhyablocks/p-0e97ec46.entry.js +0 -1
  185. package/dist/sankhyablocks/p-1b81c379.entry.js +0 -1
  186. package/dist/sankhyablocks/p-2dd0f891.js +0 -17
  187. package/dist/sankhyablocks/p-330f584a.entry.js +0 -1
  188. package/dist/sankhyablocks/p-35ecafcb.entry.js +0 -1
  189. package/dist/sankhyablocks/p-42843f0e.js +0 -1
  190. package/dist/sankhyablocks/p-459d4267.entry.js +0 -1
  191. package/dist/sankhyablocks/p-557affc8.entry.js +0 -1
  192. package/dist/sankhyablocks/p-564efc43.js +0 -1
  193. package/dist/sankhyablocks/p-6295424d.entry.js +0 -1
  194. package/dist/sankhyablocks/p-64c2cec3.js +0 -1
  195. package/dist/sankhyablocks/p-803b79d6.js +0 -1
  196. package/dist/sankhyablocks/p-80729c9b.entry.js +0 -11
  197. package/dist/sankhyablocks/p-95fa8af6.entry.js +0 -1
  198. package/dist/sankhyablocks/p-96c1ae78.entry.js +0 -1
  199. package/dist/sankhyablocks/p-b556fadc.entry.js +0 -1
  200. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  201. package/dist/sankhyablocks/p-bf3bd954.entry.js +0 -1
  202. package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
  203. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  204. package/dist/sankhyablocks/p-dd1fa35d.js +0 -56
  205. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  206. package/dist/sankhyablocks/p-e42f1f2a.js +0 -1
  207. package/dist/sankhyablocks/p-f24c4bc7.entry.js +0 -1
  208. package/dist/sankhyablocks/p-f737f7e1.js +0 -10
  209. package/dist/sankhyablocks/p-fd69eab9.entry.js +0 -1
@@ -13,7 +13,6 @@ import Workspace from "../../lib/workspace/workspace";
13
13
  import AppletCaller from "../../lib/applet-caller/applet-caller";
14
14
  import ParametersFetcher from "../../lib/http/data-fetcher/fetchers/parameters-fecher";
15
15
  import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
16
- import GridConfigFetcher from "../../lib/http/data-fetcher/fetchers/grid-config-fetcher";
17
16
  import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
18
17
  import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
19
18
  /**
@@ -36,16 +35,21 @@ export class SnkApplication {
36
35
  }
37
36
  return this._parameters;
38
37
  }
39
- get resourceID() {
40
- if (!this._resourceID) {
41
- this._resourceID = this.urlParams.get("workspaceResourceID") ||
42
- this.urlParams.get("resourceID") ||
43
- Workspace.resourceID ||
44
- "unknown.resource.id";
38
+ async getAuth(resourceID) {
39
+ if (resourceID == undefined) {
40
+ return this.getApplicationAuth();
41
+ }
42
+ else {
43
+ return new Promise((resolve, reject) => {
44
+ this.authFetcher.getData(resourceID).then((authList) => {
45
+ resolve(authList);
46
+ }).catch(error => {
47
+ reject(error);
48
+ });
49
+ });
45
50
  }
46
- return this._resourceID;
47
51
  }
48
- get auth() {
52
+ async getApplicationAuth() {
49
53
  if (this._auth) {
50
54
  return Promise.resolve(this._auth);
51
55
  }
@@ -54,7 +58,7 @@ export class SnkApplication {
54
58
  const waitingAuth = this._authPromises.length > 0;
55
59
  this._authPromises.push(new PendingPromise(resolve, reject));
56
60
  if (!waitingAuth) {
57
- this.authFetcher.getData(this.resourceID).then((authList) => {
61
+ this.authFetcher.getData(this.applicationResourceID).then((authList) => {
58
62
  this._auth = authList;
59
63
  while (this._authPromises.length > 0) {
60
64
  this._authPromises.pop().resolve(this._auth);
@@ -73,7 +77,7 @@ export class SnkApplication {
73
77
  */
74
78
  async isUserSup() {
75
79
  return new Promise((resolve, reject) => {
76
- this.auth.then((authorization) => {
80
+ this.getAuth().then((authorization) => {
77
81
  this.getAuthList(authorization).then((auths) => {
78
82
  resolve(auths.isSup);
79
83
  }).catch(error => reject(error));
@@ -87,9 +91,9 @@ export class SnkApplication {
87
91
  /**
88
92
  * Obtém `true` caso o usuário logado tem permissão pra determinada ação.
89
93
  */
90
- async hasAccess(access) {
94
+ async hasAccess(access, resourceID) {
91
95
  return new Promise((resolve, reject) => {
92
- this.auth.then((authorization) => {
96
+ this.getAuth(resourceID).then((authorization) => {
93
97
  this.getAuthList(authorization).then((auths) => {
94
98
  resolve(auths.isSup || auths.actions[access]);
95
99
  }).catch(error => reject(error));
@@ -99,9 +103,9 @@ export class SnkApplication {
99
103
  /**
100
104
  * Obtém todos os acessos do usuário logado.
101
105
  */
102
- async getAllAccess() {
106
+ async getAllAccess(resourceID) {
103
107
  return new Promise((resolve, reject) => {
104
- this.auth.then((authorization) => {
108
+ this.getAuth(resourceID).then((authorization) => {
105
109
  this.getAuthList(authorization).then((auths) => {
106
110
  const allAccess = {};
107
111
  allAccess['isSup'] = auths.isSup;
@@ -285,13 +289,16 @@ export class SnkApplication {
285
289
  * Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
286
290
  * passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
287
291
  */
288
- async createDataunit(entityName, dataUnitName, parentDataUnit, configName) {
292
+ async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
293
+ if (resourceID == undefined) {
294
+ resourceID = this.applicationResourceID;
295
+ }
289
296
  return new Promise((resolve, reject) => {
290
297
  const duPromisses = this.getDuPromissesStack(dataUnitName);
291
298
  const waitingDu = duPromisses.length > 0;
292
299
  duPromisses.push(new PendingPromise(resolve, reject));
293
300
  if (!waitingDu) {
294
- const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID, parentDataUnit, configName);
301
+ const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
295
302
  dataUnit.loadMetadata().then(() => {
296
303
  if (dataUnitName) {
297
304
  this.updateDataunitCache(undefined, dataUnitName, dataUnit);
@@ -322,14 +329,14 @@ export class SnkApplication {
322
329
  /**
323
330
  * Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
324
331
  */
325
- async getDataUnit(entityName, dataUnitName, parentDataUnit, configName) {
332
+ async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
326
333
  return new Promise((resolve, reject) => {
327
334
  const dataUnit = this._duCache.get(dataUnitName);
328
335
  if (dataUnit) {
329
336
  resolve(dataUnit);
330
337
  }
331
338
  else {
332
- this.createDataunit(entityName, dataUnitName, parentDataUnit, configName).then(dataUnit => {
339
+ this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID).then(dataUnit => {
333
340
  resolve(dataUnit);
334
341
  }).catch(reason => reject(reason));
335
342
  }
@@ -378,11 +385,20 @@ export class SnkApplication {
378
385
  async callServiceBroker(serviceName, payload, options) {
379
386
  return DataFetcher.get().callServiceBroker(serviceName, payload, options);
380
387
  }
388
+ get applicationResourceID() {
389
+ if (!this._applicationResourceID) {
390
+ this._applicationResourceID = this.urlParams.get("workspaceResourceID") ||
391
+ this.urlParams.get("resourceID") ||
392
+ Workspace.resourceID ||
393
+ "unknown.resource.id";
394
+ }
395
+ return this._applicationResourceID;
396
+ }
381
397
  /**
382
398
  * Obtém o resourceID da tela em questão.
383
399
  */
384
400
  async getResourceID() {
385
- return Promise.resolve(this.resourceID);
401
+ return Promise.resolve(this.applicationResourceID);
386
402
  }
387
403
  /**
388
404
  * Obtém o UserId da tela em questão.
@@ -426,20 +442,14 @@ export class SnkApplication {
426
442
  async info(message, options) {
427
443
  return ApplicationUtils.info(message, options);
428
444
  }
429
- /**
430
- * Obtém a configuração de grade.
431
- */
432
- async loadGridConfig(name) {
433
- return this.gridConfigFetcher.getConfig(name, this.resourceID);
434
- }
435
445
  /**
436
446
  * Obtém os totalizadores da grade.
437
447
  */
438
448
  async loadTotals(name, resourceID, filters) {
439
449
  return this.totalsFetcher.fetchTotals(name, resourceID, filters);
440
450
  }
441
- async getAuthList(_auth) {
442
- return await (new MGEAuthorization()).parseFromJSON(_auth);
451
+ async getAuthList(auth) {
452
+ return await (new MGEAuthorization()).parseFromJSON(auth);
443
453
  }
444
454
  get urlParams() {
445
455
  if (!this._urlParams) {
@@ -453,12 +463,6 @@ export class SnkApplication {
453
463
  }
454
464
  return this._dataUnitFetcher;
455
465
  }
456
- get gridConfigFetcher() {
457
- if (!this._gridConfigFetcher) {
458
- this._gridConfigFetcher = new GridConfigFetcher();
459
- }
460
- return this._gridConfigFetcher;
461
- }
462
466
  get totalsFetcher() {
463
467
  if (!this._totalsFetcher) {
464
468
  this._totalsFetcher = new TotalsFetcher();
@@ -558,7 +562,7 @@ export class SnkApplication {
558
562
  * Obtém o nome das telas da aplicação
559
563
  */
560
564
  async getAppLabel() {
561
- return Workspace.getAppLabel(this._resourceID);
565
+ return Workspace.getAppLabel(this.applicationResourceID);
562
566
  }
563
567
  /**
564
568
  * Adiciona um listener no fetcher de Pesquisa
@@ -630,6 +634,7 @@ export class SnkApplication {
630
634
  this._popUp.ezTitle = title;
631
635
  }
632
636
  componentWillLoad() {
637
+ ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
633
638
  this._errorHandler = new SnkErrorHandler(this);
634
639
  this.messagesBuilder = new SnkMessageBuilder();
635
640
  ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
@@ -638,7 +643,7 @@ export class SnkApplication {
638
643
  });
639
644
  ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
640
645
  ErrorTracking.init();
641
- ConfigStorage.get();
646
+ ConfigStorage.preload(this.applicationResourceID, this.configName);
642
647
  }
643
648
  connectedCallback() {
644
649
  ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
@@ -650,9 +655,10 @@ export class SnkApplication {
650
655
  componentDidLoad() {
651
656
  this.applicationLoading.emit(true);
652
657
  window.requestAnimationFrame(() => {
658
+ ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", false);
653
659
  this.applicationLoaded.emit(true);
654
660
  });
655
- ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
661
+ ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
656
662
  }
657
663
  render() {
658
664
  return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
@@ -782,10 +788,13 @@ export class SnkApplication {
782
788
  },
783
789
  "hasAccess": {
784
790
  "complexType": {
785
- "signature": "(access: AutorizationType) => Promise<boolean>",
791
+ "signature": "(access: AutorizationType, resourceID?: string) => Promise<boolean>",
786
792
  "parameters": [{
787
793
  "tags": [],
788
794
  "text": ""
795
+ }, {
796
+ "tags": [],
797
+ "text": ""
789
798
  }],
790
799
  "references": {
791
800
  "Promise": {
@@ -805,8 +814,11 @@ export class SnkApplication {
805
814
  },
806
815
  "getAllAccess": {
807
816
  "complexType": {
808
- "signature": "() => Promise<any>",
809
- "parameters": [],
817
+ "signature": "(resourceID?: string) => Promise<any>",
818
+ "parameters": [{
819
+ "tags": [],
820
+ "text": ""
821
+ }],
810
822
  "references": {
811
823
  "Promise": {
812
824
  "location": "global"
@@ -1155,7 +1167,7 @@ export class SnkApplication {
1155
1167
  },
1156
1168
  "createDataunit": {
1157
1169
  "complexType": {
1158
- "signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>",
1170
+ "signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>",
1159
1171
  "parameters": [{
1160
1172
  "tags": [],
1161
1173
  "text": ""
@@ -1168,6 +1180,9 @@ export class SnkApplication {
1168
1180
  }, {
1169
1181
  "tags": [],
1170
1182
  "text": ""
1183
+ }, {
1184
+ "tags": [],
1185
+ "text": ""
1171
1186
  }],
1172
1187
  "references": {
1173
1188
  "Promise": {
@@ -1234,7 +1249,7 @@ export class SnkApplication {
1234
1249
  },
1235
1250
  "getDataUnit": {
1236
1251
  "complexType": {
1237
- "signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>",
1252
+ "signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>",
1238
1253
  "parameters": [{
1239
1254
  "tags": [],
1240
1255
  "text": ""
@@ -1247,6 +1262,9 @@ export class SnkApplication {
1247
1262
  }, {
1248
1263
  "tags": [],
1249
1264
  "text": ""
1265
+ }, {
1266
+ "tags": [],
1267
+ "text": ""
1250
1268
  }],
1251
1269
  "references": {
1252
1270
  "Promise": {
@@ -1640,29 +1658,6 @@ export class SnkApplication {
1640
1658
  "tags": []
1641
1659
  }
1642
1660
  },
1643
- "loadGridConfig": {
1644
- "complexType": {
1645
- "signature": "(name: string) => Promise<IGridConfig>",
1646
- "parameters": [{
1647
- "tags": [],
1648
- "text": ""
1649
- }],
1650
- "references": {
1651
- "Promise": {
1652
- "location": "global"
1653
- },
1654
- "IGridConfig": {
1655
- "location": "import",
1656
- "path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
1657
- }
1658
- },
1659
- "return": "Promise<IGridConfig>"
1660
- },
1661
- "docs": {
1662
- "text": "Obt\u00E9m a configura\u00E7\u00E3o de grade.",
1663
- "tags": []
1664
- }
1665
- },
1666
1661
  "loadTotals": {
1667
1662
  "complexType": {
1668
1663
  "signature": "(name: string, resourceID: string, filters: Array<Filter>) => Promise<Map<string, number>>",
@@ -8,6 +8,7 @@ export class SnkConfigurator {
8
8
  this._permissions = undefined;
9
9
  this.showActionButtons = false;
10
10
  this.configName = undefined;
11
+ this.resourceID = undefined;
11
12
  this.viewMode = VIEW_MODE.GRID;
12
13
  this.messagesBuilder = undefined;
13
14
  }
@@ -72,7 +73,7 @@ export class SnkConfigurator {
72
73
  componentWillLoad() {
73
74
  this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
74
75
  if (this._application) {
75
- this._application.getAllAccess().then(access => (this._permissions = access));
76
+ this._application.getAllAccess(this.resourceID).then(access => (this._permissions = access));
76
77
  }
77
78
  else {
78
79
  this._permissions = {};
@@ -130,6 +131,23 @@ export class SnkConfigurator {
130
131
  "attribute": "config-name",
131
132
  "reflect": false
132
133
  },
134
+ "resourceID": {
135
+ "type": "string",
136
+ "mutable": false,
137
+ "complexType": {
138
+ "original": "string",
139
+ "resolved": "string",
140
+ "references": {}
141
+ },
142
+ "required": false,
143
+ "optional": false,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
147
+ },
148
+ "attribute": "resource-i-d",
149
+ "reflect": false
150
+ },
133
151
  "viewMode": {
134
152
  "type": "number",
135
153
  "mutable": false,
@@ -17,6 +17,7 @@ export class SnkCrud {
17
17
  this.attachmentRegisterKey = undefined;
18
18
  this._currentViewMode = VIEW_MODE.GRID;
19
19
  this._canEdit = undefined;
20
+ this._resourceID = undefined;
20
21
  this.configName = undefined;
21
22
  this.selectionToastConfig = undefined;
22
23
  this.showActionButtons = false;
@@ -111,7 +112,7 @@ export class SnkCrud {
111
112
  }
112
113
  componentWillLoad() {
113
114
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
114
- application.hasAccess(AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
115
+ application.hasAccess(AutorizationType.UPDATE, this._resourceID).then(canEdit => this._canEdit = canEdit);
115
116
  let parent = this._element.parentElement;
116
117
  while (parent) {
117
118
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -123,11 +124,11 @@ export class SnkCrud {
123
124
  if (!this._dataUnit) {
124
125
  this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
125
126
  this._dataUnit = evt.detail;
126
- this.initDataUnit();
127
+ this.initDataUnit(application);
127
128
  });
128
129
  }
129
130
  else {
130
- this.initDataUnit();
131
+ this.initDataUnit(application);
131
132
  }
132
133
  this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
133
134
  this._dataState = dataState;
@@ -143,11 +144,18 @@ export class SnkCrud {
143
144
  this.configName = application.configName;
144
145
  }
145
146
  }
146
- initDataUnit() {
147
+ async initDataUnit(application) {
147
148
  this.addDataElementID();
148
149
  if (!this.messagesBuilder) {
149
150
  this.messagesBuilder = this._snkDataUnit.messagesBuilder;
150
151
  }
152
+ if (this._resourceID == undefined) {
153
+ //Tenta pegar o resourceID do snkDataUnit;
154
+ this._resourceID = this._snkDataUnit.resourceID;
155
+ if (this._resourceID == undefined) {
156
+ this._resourceID = await application.getResourceID();
157
+ }
158
+ }
151
159
  }
152
160
  handleConfiguratorEvent(evt, type) {
153
161
  evt.stopImmediatePropagation();
@@ -158,8 +166,11 @@ export class SnkCrud {
158
166
  this.configuratorCancel.emit();
159
167
  }
160
168
  render() {
169
+ if (this._resourceID == undefined) {
170
+ return;
171
+ }
161
172
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
162
- 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 }, 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 }, 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" })))));
173
+ 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" })))));
163
174
  }
164
175
  static get is() { return "snk-crud"; }
165
176
  static get encapsulation() { return "scoped"; }
@@ -404,7 +415,8 @@ export class SnkCrud {
404
415
  "_dataState": {},
405
416
  "attachmentRegisterKey": {},
406
417
  "_currentViewMode": {},
407
- "_canEdit": {}
418
+ "_canEdit": {},
419
+ "_resourceID": {}
408
420
  };
409
421
  }
410
422
  static get events() {
@@ -14,6 +14,7 @@ export class SnkDetailView {
14
14
  this.attachmentRegisterKey = undefined;
15
15
  this.formConfigManager = undefined;
16
16
  this.dataUnitName = undefined;
17
+ this.resourceID = undefined;
17
18
  this.guideItemPath = undefined;
18
19
  this.entityName = undefined;
19
20
  this.label = undefined;
@@ -183,7 +184,7 @@ export class SnkDetailView {
183
184
  }
184
185
  componentWillLoad() {
185
186
  this._configName = `dynaform.${this.entityName}`;
186
- this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
187
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
187
188
  this.formConfigManager.loadConfig();
188
189
  if (this.messagesBuilder == undefined) {
189
190
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -192,7 +193,7 @@ export class SnkDetailView {
192
193
  render() {
193
194
  this.updateLabel();
194
195
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
195
- 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 }))), 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) }))))));
196
197
  }
197
198
  static get is() { return "snk-detail-view"; }
198
199
  static get encapsulation() { return "scoped"; }
@@ -245,6 +246,23 @@ export class SnkDetailView {
245
246
  "attribute": "data-unit-name",
246
247
  "reflect": false
247
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
+ },
248
266
  "guideItemPath": {
249
267
  "type": "unknown",
250
268
  "mutable": false,
@@ -23,6 +23,7 @@ export class SnkGuidesViewer {
23
23
  this.messagesBuilder = undefined;
24
24
  this.canEdit = true;
25
25
  this.presentationMode = undefined;
26
+ this.resourceID = undefined;
26
27
  this._breadcrumbItems = [];
27
28
  this._guides = undefined;
28
29
  this._formEditorConfigManager = undefined;
@@ -224,7 +225,7 @@ export class SnkGuidesViewer {
224
225
  else {
225
226
  detailBranch = this.selectedGuide;
226
227
  }
227
- 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) }));
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 }));
228
229
  }
229
230
  else {
230
231
  const cardId = this.selectedGuide.id;
@@ -273,7 +274,10 @@ export class SnkGuidesViewer {
273
274
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
274
275
  }
275
276
  componentWillLoad() {
276
- 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);
277
281
  this._configManager.loadConfig();
278
282
  }
279
283
  componentDidRender() {
@@ -292,7 +296,7 @@ export class SnkGuidesViewer {
292
296
  }
293
297
  buildTaskBar() {
294
298
  var _a;
295
- 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 }));
296
300
  }
297
301
  render() {
298
302
  var _a, _b;
@@ -311,7 +315,7 @@ export class SnkGuidesViewer {
311
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 ?
312
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) })
313
317
  :
314
- 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 })));
315
319
  }
316
320
  static get is() { return "snk-guides-viewer"; }
317
321
  static get encapsulation() { return "scoped"; }
@@ -327,30 +331,6 @@ export class SnkGuidesViewer {
327
331
  }
328
332
  static get properties() {
329
333
  return {
330
- "_guideBuilders": {
331
- "type": "unknown",
332
- "mutable": false,
333
- "complexType": {
334
- "original": "Map<string, GuideBuilder>",
335
- "resolved": "Map<string, GuideBuilder>",
336
- "references": {
337
- "Map": {
338
- "location": "global"
339
- },
340
- "GuideBuilder": {
341
- "location": "import",
342
- "path": "./GuideBuilder"
343
- }
344
- }
345
- },
346
- "required": false,
347
- "optional": false,
348
- "docs": {
349
- "tags": [],
350
- "text": ""
351
- },
352
- "defaultValue": "new Map()"
353
- },
354
334
  "dataUnit": {
355
335
  "type": "unknown",
356
336
  "mutable": false,
@@ -587,6 +567,23 @@ export class SnkGuidesViewer {
587
567
  },
588
568
  "attribute": "presentation-mode",
589
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
590
587
  }
591
588
  };
592
589
  }
@@ -61,6 +61,7 @@ export class SnkDataUnit {
61
61
  this.useCancelConfirm = true;
62
62
  this.ignoreSaveMessage = undefined;
63
63
  this.configName = undefined;
64
+ this.resourceID = undefined;
64
65
  }
65
66
  observePageSize() {
66
67
  if (this.dataUnit) {
@@ -180,7 +181,6 @@ export class SnkDataUnit {
180
181
  return resolve(action);
181
182
  if (this._openedAlert)
182
183
  return this.dataUnit.cancelEdition();
183
- ;
184
184
  this._openedAlert = true;
185
185
  this.dataUnit.cancelEdition();
186
186
  ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate")).then(() => {
@@ -325,10 +325,10 @@ export class SnkDataUnit {
325
325
  const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
326
326
  if (this._parentSnkDataUnit) {
327
327
  this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
328
- 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);
329
329
  }
330
330
  else {
331
- 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);
332
332
  }
333
333
  }
334
334
  async loadDataUnit() {
@@ -387,7 +387,7 @@ export class SnkDataUnit {
387
387
  //---------------------------------------------
388
388
  componentWillLoad() {
389
389
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
390
- this._application.getAllAccess().then(access => this._permissions = access);
390
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
391
391
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
392
392
  if (this.messagesBuilder == undefined) {
393
393
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -624,6 +624,23 @@ export class SnkDataUnit {
624
624
  },
625
625
  "attribute": "config-name",
626
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
627
644
  }
628
645
  };
629
646
  }