@sankhyalabs/sankhyablocks 8.1.0 → 8.2.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/cjs/{ConfigStorage-73e7afff.js → ConfigStorage-12397f18.js} +163 -51
  2. package/dist/cjs/{DataFetcher-004811c6.js → DataFetcher-f2da1f79.js} +68 -30
  3. package/dist/cjs/ISave-d68ce3cd.js +8 -0
  4. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  5. package/dist/cjs/{SnkFormConfigManager-d1f1a222.js → SnkFormConfigManager-13f79e37.js} +19 -21
  6. package/dist/cjs/auth-fetcher-319a4cb2.js +34 -0
  7. package/dist/cjs/{dataunit-fetcher-029eafbd.js → dataunit-fetcher-e72068c1.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-181767c9.js → form-config-fetcher-5d62ab62.js} +66 -3
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-9a97994a.js → pesquisa-fetcher-8c363096.js} +1 -1
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +18 -11
  13. package/dist/cjs/snk-application.cjs.entry.js +51 -73
  14. package/dist/cjs/snk-attach.cjs.entry.js +7 -13
  15. package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
  16. package/dist/cjs/snk-crud.cjs.entry.js +28 -9
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  18. package/dist/cjs/{snk-data-unit-d5109a08.js → snk-data-unit-80a00ae4.js} +8 -6
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +18 -25
  21. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +14 -17
  23. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -19
  25. package/dist/cjs/snk-form-config.cjs.entry.js +6 -17
  26. package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
  27. package/dist/cjs/snk-form.cjs.entry.js +12 -8
  28. package/dist/cjs/snk-grid-config.cjs.entry.js +5 -6
  29. package/dist/cjs/snk-grid.cjs.entry.js +20 -20
  30. package/dist/cjs/{snk-guides-viewer-aa3e3bfa.js → snk-guides-viewer-a7cd6fda.js} +18 -9
  31. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  32. package/dist/cjs/snk-personalized-filter.cjs.entry.js +13 -16
  33. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  34. package/dist/cjs/snk-simple-crud.cjs.entry.js +43 -92
  35. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
  36. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  37. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  38. package/dist/collection/components/snk-application/snk-application.js +60 -65
  39. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  40. package/dist/collection/components/snk-crud/snk-crud.js +63 -8
  41. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +65 -15
  42. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
  43. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +66 -30
  44. package/dist/collection/components/snk-data-unit/snk-data-unit.js +42 -7
  45. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  46. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
  47. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  48. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
  49. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +28 -12
  50. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  51. package/dist/collection/components/snk-form/snk-form.js +46 -2
  52. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  53. package/dist/collection/components/snk-grid/snk-grid.js +110 -16
  54. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  55. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  56. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +43 -9
  57. package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
  58. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  59. package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -71
  60. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +39 -30
  61. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  62. package/dist/collection/lib/index.js +10 -0
  63. package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
  64. package/dist/collection/lib/utils/urlutils.js +29 -0
  65. package/dist/components/ConfigStorage.js +161 -48
  66. package/dist/components/DataFetcher.js +68 -30
  67. package/dist/components/ResourceIDUtils.js +10 -0
  68. package/dist/components/SnkFormConfigManager.js +17 -19
  69. package/dist/components/auth-fetcher.js +32 -0
  70. package/dist/components/form-config-fetcher.js +64 -2
  71. package/dist/components/snk-actions-button2.js +23 -9
  72. package/dist/components/snk-application2.js +132 -154
  73. package/dist/components/snk-attach2.js +1 -8
  74. package/dist/components/snk-configurator2.js +3 -1
  75. package/dist/components/snk-crud.js +29 -7
  76. package/dist/components/snk-data-unit2.js +10 -6
  77. package/dist/components/snk-detail-view2.js +28 -23
  78. package/dist/components/snk-entity-list.js +0 -4
  79. package/dist/components/snk-filter-bar2.js +12 -12
  80. package/dist/components/snk-filter-detail2.js +2 -12
  81. package/dist/components/snk-filter-modal-item2.js +5 -16
  82. package/dist/components/snk-form-config2.js +5 -15
  83. package/dist/components/snk-form-view2.js +6 -1
  84. package/dist/components/snk-form.js +9 -2
  85. package/dist/components/snk-grid-config2.js +4 -2
  86. package/dist/components/snk-grid2.js +23 -16
  87. package/dist/components/snk-personalized-filter2.js +11 -11
  88. package/dist/components/snk-simple-crud2.js +33 -81
  89. package/dist/components/snk-taskbar2.js +3 -1
  90. package/dist/esm/{ConfigStorage-19a7260b.js → ConfigStorage-932ab366.js} +162 -49
  91. package/dist/esm/{DataFetcher-e0fc5549.js → DataFetcher-7e18aa30.js} +68 -30
  92. package/dist/esm/ISave-4412b20c.js +8 -0
  93. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  94. package/dist/esm/{SnkFormConfigManager-1a42eb02.js → SnkFormConfigManager-bb9afc3f.js} +19 -21
  95. package/dist/esm/auth-fetcher-6d9664b7.js +32 -0
  96. package/dist/esm/{dataunit-fetcher-6a695723.js → dataunit-fetcher-91a4eb82.js} +1 -1
  97. package/dist/esm/{form-config-fetcher-9e167008.js → form-config-fetcher-aaaa79a6.js} +65 -3
  98. package/dist/esm/loader.js +1 -1
  99. package/dist/esm/{pesquisa-fetcher-9118eb7a.js → pesquisa-fetcher-56b30fb4.js} +1 -1
  100. package/dist/esm/sankhyablocks.js +1 -1
  101. package/dist/esm/snk-actions-button.entry.js +18 -11
  102. package/dist/esm/snk-application.entry.js +49 -71
  103. package/dist/esm/snk-attach.entry.js +3 -9
  104. package/dist/esm/snk-configurator.entry.js +2 -1
  105. package/dist/esm/snk-crud.entry.js +28 -9
  106. package/dist/esm/snk-data-exporter.entry.js +2 -2
  107. package/dist/esm/{snk-data-unit-3a0bbfcb.js → snk-data-unit-3ab57d1a.js} +8 -6
  108. package/dist/esm/snk-data-unit.entry.js +1 -1
  109. package/dist/esm/snk-detail-view.entry.js +18 -25
  110. package/dist/esm/snk-entity-list.entry.js +0 -4
  111. package/dist/esm/snk-filter-bar.entry.js +14 -17
  112. package/dist/esm/snk-filter-detail.entry.js +2 -16
  113. package/dist/esm/snk-filter-modal-item.entry.js +6 -20
  114. package/dist/esm/snk-form-config.entry.js +7 -18
  115. package/dist/esm/snk-form-view.entry.js +6 -1
  116. package/dist/esm/snk-form.entry.js +12 -8
  117. package/dist/esm/snk-grid-config.entry.js +5 -6
  118. package/dist/esm/snk-grid.entry.js +20 -20
  119. package/dist/esm/{snk-guides-viewer-aa386f6e.js → snk-guides-viewer-cc709b5f.js} +18 -9
  120. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  121. package/dist/esm/snk-personalized-filter.entry.js +13 -16
  122. package/dist/esm/snk-print-selector.entry.js +1 -1
  123. package/dist/esm/snk-simple-crud.entry.js +34 -83
  124. package/dist/esm/snk-taskbar.entry.js +2 -1
  125. package/dist/sankhyablocks/p-01739b21.entry.js +1 -0
  126. package/dist/sankhyablocks/{p-e7e54737.entry.js → p-03bb1aea.entry.js} +1 -1
  127. package/dist/sankhyablocks/p-05dbc70e.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-0a4c753d.js → p-14eac6fe.js} +1 -1
  129. package/dist/sankhyablocks/{p-2ac9c585.js → p-2d333d22.js} +1 -1
  130. package/dist/sankhyablocks/p-41e897f1.js +56 -0
  131. package/dist/sankhyablocks/p-48a40939.js +1 -0
  132. package/dist/sankhyablocks/p-611aa624.entry.js +1 -0
  133. package/dist/sankhyablocks/p-66bb8c20.entry.js +1 -0
  134. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  135. package/dist/sankhyablocks/p-6f154396.entry.js +1 -0
  136. package/dist/sankhyablocks/p-787071a8.js +1 -0
  137. package/dist/sankhyablocks/p-8818d8f6.entry.js +1 -0
  138. package/dist/sankhyablocks/p-93f6ca04.entry.js +1 -0
  139. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  140. package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
  141. package/dist/sankhyablocks/p-a52a6c9d.js +26 -0
  142. package/dist/sankhyablocks/p-b6003974.entry.js +1 -0
  143. package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
  144. package/dist/sankhyablocks/p-cfb33a4a.entry.js +1 -0
  145. package/dist/sankhyablocks/{p-7c7764bf.entry.js → p-d13c00b6.entry.js} +1 -1
  146. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  147. package/dist/sankhyablocks/p-d53a9169.entry.js +1 -0
  148. package/dist/sankhyablocks/p-d7638f45.entry.js +11 -0
  149. package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
  150. package/dist/sankhyablocks/p-e64f3e17.entry.js +1 -0
  151. package/dist/sankhyablocks/p-ed41b38c.js +1 -0
  152. package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
  153. package/dist/sankhyablocks/p-efc10705.entry.js +1 -0
  154. package/dist/sankhyablocks/p-f74fe358.js +1 -0
  155. package/dist/sankhyablocks/{p-df8621b4.js → p-f8e6b97e.js} +1 -1
  156. package/dist/sankhyablocks/p-f91e0c5d.entry.js +1 -0
  157. package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
  158. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  159. package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
  160. package/dist/types/components/snk-application/snk-application.d.ts +8 -13
  161. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  162. package/dist/types/components/snk-crud/snk-crud.d.ts +10 -0
  163. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +13 -0
  164. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
  165. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -2
  166. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +8 -0
  167. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  168. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  169. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  170. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
  171. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  172. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  173. package/dist/types/components/snk-form/snk-form.d.ts +9 -1
  174. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  175. package/dist/types/components/snk-grid/snk-grid.d.ts +18 -1
  176. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  177. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  178. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +8 -0
  179. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
  180. package/dist/types/components.d.ts +189 -21
  181. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  182. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -8
  183. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  184. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
  185. package/dist/types/lib/index.d.ts +11 -0
  186. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  187. package/dist/types/lib/utils/urlutils.d.ts +14 -0
  188. package/package.json +2 -2
  189. package/dist/cjs/filter-bar-config-fetcher-2b8ed9d0.js +0 -155
  190. package/dist/cjs/resource-fetcher-c0332609.js +0 -68
  191. package/dist/components/filter-bar-config-fetcher.js +0 -153
  192. package/dist/components/resource-fetcher.js +0 -66
  193. package/dist/esm/filter-bar-config-fetcher-06e02851.js +0 -153
  194. package/dist/esm/resource-fetcher-768d5556.js +0 -66
  195. package/dist/sankhyablocks/p-0a94fdbd.entry.js +0 -1
  196. package/dist/sankhyablocks/p-0ed0fc02.entry.js +0 -1
  197. package/dist/sankhyablocks/p-1e0189ff.entry.js +0 -1
  198. package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
  199. package/dist/sankhyablocks/p-50d72261.entry.js +0 -1
  200. package/dist/sankhyablocks/p-6759adae.entry.js +0 -1
  201. package/dist/sankhyablocks/p-7b8b8ae9.js +0 -10
  202. package/dist/sankhyablocks/p-815a42c0.entry.js +0 -1
  203. package/dist/sankhyablocks/p-8a41172a.entry.js +0 -1
  204. package/dist/sankhyablocks/p-8f8184ff.js +0 -56
  205. package/dist/sankhyablocks/p-8fdc3108.js +0 -1
  206. package/dist/sankhyablocks/p-976e56e9.js +0 -1
  207. package/dist/sankhyablocks/p-98f9d076.js +0 -17
  208. package/dist/sankhyablocks/p-9edad923.js +0 -1
  209. package/dist/sankhyablocks/p-abdcac04.entry.js +0 -1
  210. package/dist/sankhyablocks/p-b0847056.entry.js +0 -1
  211. package/dist/sankhyablocks/p-bc735728.entry.js +0 -1
  212. package/dist/sankhyablocks/p-be684b38.entry.js +0 -1
  213. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  214. package/dist/sankhyablocks/p-c0f656af.entry.js +0 -1
  215. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  216. package/dist/sankhyablocks/p-ccbfb1cf.entry.js +0 -1
  217. package/dist/sankhyablocks/p-d1b89765.js +0 -1
  218. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  219. package/dist/sankhyablocks/p-e28129aa.entry.js +0 -1
  220. package/dist/sankhyablocks/p-f31bfdee.entry.js +0 -1
  221. package/dist/sankhyablocks/p-f92fda53.entry.js +0 -11
@@ -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,
@@ -3,7 +3,7 @@ import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
4
4
  import { PresentationMode } from '../../lib';
5
5
  import { VIEW_MODE } from '../../lib/utils/constants';
6
- // import { AutorizationType } from '../../lib/http/data-fetcher/fetchers/auth-fetcher';
6
+ import { AutorizationType } from '../../lib/http/data-fetcher/fetchers/auth-fetcher';
7
7
  /**
8
8
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
9
9
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -16,6 +16,8 @@ export class SnkCrud {
16
16
  this._dataState = undefined;
17
17
  this.attachmentRegisterKey = undefined;
18
18
  this._currentViewMode = VIEW_MODE.GRID;
19
+ this._canEdit = undefined;
20
+ this._resourceID = undefined;
19
21
  this.configName = undefined;
20
22
  this.selectionToastConfig = undefined;
21
23
  this.showActionButtons = false;
@@ -26,6 +28,7 @@ export class SnkCrud {
26
28
  this.multipleSelection = true;
27
29
  this.presentationMode = PresentationMode.PRIMARY;
28
30
  this.messagesBuilder = undefined;
31
+ this.useEnterLikeTab = false;
29
32
  }
30
33
  /**
31
34
  * Usado para alternar a visão entre GRID e FORM externamente.
@@ -109,7 +112,7 @@ export class SnkCrud {
109
112
  }
110
113
  componentWillLoad() {
111
114
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
112
- // application.hasAccess(AutorizationType.UPDATE).then(canEdit=>this._canEdit = canEdit)
115
+ application.hasAccess(AutorizationType.UPDATE, this._resourceID).then(canEdit => this._canEdit = canEdit);
113
116
  let parent = this._element.parentElement;
114
117
  while (parent) {
115
118
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -121,11 +124,11 @@ export class SnkCrud {
121
124
  if (!this._dataUnit) {
122
125
  this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
123
126
  this._dataUnit = evt.detail;
124
- this.initDataUnit();
127
+ this.initDataUnit(application);
125
128
  });
126
129
  }
127
130
  else {
128
- this.initDataUnit();
131
+ this.initDataUnit(application);
129
132
  }
130
133
  this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
131
134
  this._dataState = dataState;
@@ -141,11 +144,18 @@ export class SnkCrud {
141
144
  this.configName = application.configName;
142
145
  }
143
146
  }
144
- initDataUnit() {
147
+ async initDataUnit(application) {
145
148
  this.addDataElementID();
146
149
  if (!this.messagesBuilder) {
147
150
  this.messagesBuilder = this._snkDataUnit.messagesBuilder;
148
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
+ }
149
159
  }
150
160
  handleConfiguratorEvent(evt, type) {
151
161
  evt.stopImmediatePropagation();
@@ -156,8 +166,11 @@ export class SnkCrud {
156
166
  this.configuratorCancel.emit();
157
167
  }
158
168
  render() {
159
- // this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
160
- return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form" }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
169
+ if (this._resourceID == undefined) {
170
+ return;
171
+ }
172
+ this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
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" })))));
161
174
  }
162
175
  static get is() { return "snk-crud"; }
163
176
  static get encapsulation() { return "scoped"; }
@@ -375,6 +388,24 @@ export class SnkCrud {
375
388
  "tags": [],
376
389
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
377
390
  }
391
+ },
392
+ "useEnterLikeTab": {
393
+ "type": "boolean",
394
+ "mutable": false,
395
+ "complexType": {
396
+ "original": "boolean",
397
+ "resolved": "boolean",
398
+ "references": {}
399
+ },
400
+ "required": false,
401
+ "optional": false,
402
+ "docs": {
403
+ "tags": [],
404
+ "text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
405
+ },
406
+ "attribute": "use-enter-like-tab",
407
+ "reflect": false,
408
+ "defaultValue": "false"
378
409
  }
379
410
  };
380
411
  }
@@ -383,7 +414,9 @@ export class SnkCrud {
383
414
  "_dataUnit": {},
384
415
  "_dataState": {},
385
416
  "attachmentRegisterKey": {},
386
- "_currentViewMode": {}
417
+ "_currentViewMode": {},
418
+ "_canEdit": {},
419
+ "_resourceID": {}
387
420
  };
388
421
  }
389
422
  static get events() {
@@ -432,6 +465,28 @@ export class SnkCrud {
432
465
  "resolved": "any",
433
466
  "references": {}
434
467
  }
468
+ }, {
469
+ "method": "formItemsReady",
470
+ "name": "formItemsReady",
471
+ "bubbles": true,
472
+ "cancelable": true,
473
+ "composed": true,
474
+ "docs": {
475
+ "tags": [],
476
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
477
+ },
478
+ "complexType": {
479
+ "original": "Array<HTMLElement>",
480
+ "resolved": "HTMLElement[]",
481
+ "references": {
482
+ "Array": {
483
+ "location": "global"
484
+ },
485
+ "HTMLElement": {
486
+ "location": "global"
487
+ }
488
+ }
489
+ }
435
490
  }];
436
491
  }
437
492
  static get methods() {
@@ -10,9 +10,11 @@ import { GuideBuilder } from '../GuideBuilder';
10
10
  export class SnkDetailView {
11
11
  constructor() {
12
12
  this._disabledButtons = undefined;
13
+ this._currentView = undefined;
13
14
  this.attachmentRegisterKey = undefined;
14
15
  this.formConfigManager = undefined;
15
16
  this.dataUnitName = undefined;
17
+ this.resourceID = undefined;
16
18
  this.guideItemPath = undefined;
17
19
  this.entityName = undefined;
18
20
  this.label = undefined;
@@ -21,12 +23,8 @@ export class SnkDetailView {
21
23
  this.dataState = undefined;
22
24
  this.messagesBuilder = undefined;
23
25
  this.branchGuide = undefined;
26
+ this.canEdit = true;
24
27
  }
25
- // /**
26
- // * Define se a edição está habilitada na grid.
27
- // */
28
- // @Prop()
29
- // canEdit: boolean = true;
30
28
  observerDataState(newValue, oldValue) {
31
29
  const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
32
30
  const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
@@ -139,10 +137,8 @@ export class SnkDetailView {
139
137
  updateViewStack(viewStack) {
140
138
  var _a, _b;
141
139
  this._viewStack = viewStack;
142
- // TODO: remove to gridEditor
143
- (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.selectedForm ? 1 : 0);
144
- // this._currentView = this.selectedForm ? 1 : 0;
145
- // this._viewStack?.show?.(this._currentView);
140
+ this._currentView = this.selectedForm ? 1 : 0;
141
+ (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this._currentView);
146
142
  }
147
143
  getFormFields() {
148
144
  if (this.selectedForm && this._formMetadata) {
@@ -188,7 +184,7 @@ export class SnkDetailView {
188
184
  }
189
185
  componentWillLoad() {
190
186
  this._configName = `dynaform.${this.entityName}`;
191
- this.formConfigManager = new SnkFormConfigManager(this._configName, () => this.loadMetadata());
187
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
192
188
  this.formConfigManager.loadConfig();
193
189
  if (this.messagesBuilder == undefined) {
194
190
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -197,11 +193,7 @@ export class SnkDetailView {
197
193
  render() {
198
194
  this.updateLabel();
199
195
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
200
- return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this),
201
- // ignoreSaveMessage={this._currentView === VIEW_MODE.GRID}
202
- messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY,
203
- // canEdit={this.canEdit}
204
- isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
196
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
205
197
  }
206
198
  static get is() { return "snk-detail-view"; }
207
199
  static get encapsulation() { return "scoped"; }
@@ -254,6 +246,23 @@ export class SnkDetailView {
254
246
  "attribute": "data-unit-name",
255
247
  "reflect": false
256
248
  },
249
+ "resourceID": {
250
+ "type": "string",
251
+ "mutable": false,
252
+ "complexType": {
253
+ "original": "string",
254
+ "resolved": "string",
255
+ "references": {}
256
+ },
257
+ "required": false,
258
+ "optional": false,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
262
+ },
263
+ "attribute": "resource-i-d",
264
+ "reflect": false
265
+ },
257
266
  "guideItemPath": {
258
267
  "type": "unknown",
259
268
  "mutable": false,
@@ -407,12 +416,31 @@ export class SnkDetailView {
407
416
  "tags": [],
408
417
  "text": ""
409
418
  }
419
+ },
420
+ "canEdit": {
421
+ "type": "boolean",
422
+ "mutable": false,
423
+ "complexType": {
424
+ "original": "boolean",
425
+ "resolved": "boolean",
426
+ "references": {}
427
+ },
428
+ "required": false,
429
+ "optional": false,
430
+ "docs": {
431
+ "tags": [],
432
+ "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
433
+ },
434
+ "attribute": "can-edit",
435
+ "reflect": false,
436
+ "defaultValue": "true"
410
437
  }
411
438
  };
412
439
  }
413
440
  static get states() {
414
441
  return {
415
442
  "_disabledButtons": {},
443
+ "_currentView": {},
416
444
  "attachmentRegisterKey": {}
417
445
  };
418
446
  }
@@ -452,6 +480,28 @@ export class SnkDetailView {
452
480
  "resolved": "string",
453
481
  "references": {}
454
482
  }
483
+ }, {
484
+ "method": "formItemsReady",
485
+ "name": "formItemsReady",
486
+ "bubbles": true,
487
+ "cancelable": true,
488
+ "composed": true,
489
+ "docs": {
490
+ "tags": [],
491
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
492
+ },
493
+ "complexType": {
494
+ "original": "Array<HTMLElement>",
495
+ "resolved": "HTMLElement[]",
496
+ "references": {
497
+ "Array": {
498
+ "location": "global"
499
+ },
500
+ "HTMLElement": {
501
+ "location": "global"
502
+ }
503
+ }
504
+ }
455
505
  }];
456
506
  }
457
507
  static get methods() {
@@ -70,6 +70,10 @@ export class SnkFormView {
70
70
  this._dataBinder.bind(fields, this.dataUnit.dataUnitId, this.formMetadata, this.recordsValidator);
71
71
  }
72
72
  }
73
+ handleFormItemsReady(event) {
74
+ event.stopPropagation();
75
+ this.formItemsReady.emit(Object.assign(Object.assign({}, event.detail), { formId: this.name }));
76
+ }
73
77
  disconnectedCallback() {
74
78
  if (this._dataBinder != undefined) {
75
79
  this._dataBinder.onDisconnectedCallback();
@@ -82,7 +86,7 @@ export class SnkFormView {
82
86
  ?
83
87
  h("snk-form-summary", { summary: this.getCardSummary() })
84
88
  :
85
- h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail) })));
89
+ h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
86
90
  }
87
91
  static get is() { return "snk-form-view"; }
88
92
  static get encapsulation() { return "scoped"; }
@@ -351,6 +355,28 @@ export class SnkFormView {
351
355
  }
352
356
  }
353
357
  }
358
+ }, {
359
+ "method": "formItemsReady",
360
+ "name": "formItemsReady",
361
+ "bubbles": true,
362
+ "cancelable": true,
363
+ "composed": true,
364
+ "docs": {
365
+ "tags": [],
366
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
367
+ },
368
+ "complexType": {
369
+ "original": "Array<HTMLElement>",
370
+ "resolved": "HTMLElement[]",
371
+ "references": {
372
+ "Array": {
373
+ "location": "global"
374
+ },
375
+ "HTMLElement": {
376
+ "location": "global"
377
+ }
378
+ }
379
+ }
354
380
  }];
355
381
  }
356
382
  static get methods() {
@@ -21,7 +21,9 @@ export class SnkGuidesViewer {
21
21
  this.selectedGuide = undefined;
22
22
  this.taskbarManager = undefined;
23
23
  this.messagesBuilder = undefined;
24
+ this.canEdit = true;
24
25
  this.presentationMode = undefined;
26
+ this.resourceID = undefined;
25
27
  this._breadcrumbItems = [];
26
28
  this._guides = undefined;
27
29
  this._formEditorConfigManager = undefined;
@@ -223,9 +225,7 @@ export class SnkGuidesViewer {
223
225
  else {
224
226
  detailBranch = this.selectedGuide;
225
227
  }
226
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`,
227
- // canEdit={this.canEdit}
228
- onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
228
+ content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID }));
229
229
  }
230
230
  else {
231
231
  const cardId = this.selectedGuide.id;
@@ -274,7 +274,10 @@ export class SnkGuidesViewer {
274
274
  return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
275
275
  }
276
276
  componentWillLoad() {
277
- this._configManager = new SnkFormConfigManager(this.configName, config => this.masterFormConfig = config);
277
+ if (this.resourceID == undefined) {
278
+ throw new Error("Erro interno: resourceID não informado");
279
+ }
280
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
278
281
  this._configManager.loadConfig();
279
282
  }
280
283
  componentDidRender() {
@@ -293,7 +296,7 @@ export class SnkGuidesViewer {
293
296
  }
294
297
  buildTaskBar() {
295
298
  var _a;
296
- return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit }));
299
+ return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID }));
297
300
  }
298
301
  render() {
299
302
  var _a, _b;
@@ -312,7 +315,7 @@ export class SnkGuidesViewer {
312
315
  h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
313
316
  h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
314
317
  :
315
- h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail) })));
318
+ h("div", null), h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
316
319
  }
317
320
  static get is() { return "snk-guides-viewer"; }
318
321
  static get encapsulation() { return "scoped"; }
@@ -328,30 +331,6 @@ export class SnkGuidesViewer {
328
331
  }
329
332
  static get properties() {
330
333
  return {
331
- "_guideBuilders": {
332
- "type": "unknown",
333
- "mutable": false,
334
- "complexType": {
335
- "original": "Map<string, GuideBuilder>",
336
- "resolved": "Map<string, GuideBuilder>",
337
- "references": {
338
- "Map": {
339
- "location": "global"
340
- },
341
- "GuideBuilder": {
342
- "location": "import",
343
- "path": "./GuideBuilder"
344
- }
345
- }
346
- },
347
- "required": false,
348
- "optional": false,
349
- "docs": {
350
- "tags": [],
351
- "text": ""
352
- },
353
- "defaultValue": "new Map()"
354
- },
355
334
  "dataUnit": {
356
335
  "type": "unknown",
357
336
  "mutable": false,
@@ -549,6 +528,24 @@ export class SnkGuidesViewer {
549
528
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
550
529
  }
551
530
  },
531
+ "canEdit": {
532
+ "type": "boolean",
533
+ "mutable": false,
534
+ "complexType": {
535
+ "original": "boolean",
536
+ "resolved": "boolean",
537
+ "references": {}
538
+ },
539
+ "required": false,
540
+ "optional": false,
541
+ "docs": {
542
+ "tags": [],
543
+ "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
544
+ },
545
+ "attribute": "can-edit",
546
+ "reflect": false,
547
+ "defaultValue": "true"
548
+ },
552
549
  "presentationMode": {
553
550
  "type": "string",
554
551
  "mutable": false,
@@ -570,6 +567,23 @@ export class SnkGuidesViewer {
570
567
  },
571
568
  "attribute": "presentation-mode",
572
569
  "reflect": false
570
+ },
571
+ "resourceID": {
572
+ "type": "string",
573
+ "mutable": false,
574
+ "complexType": {
575
+ "original": "string",
576
+ "resolved": "string",
577
+ "references": {}
578
+ },
579
+ "required": false,
580
+ "optional": false,
581
+ "docs": {
582
+ "tags": [],
583
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
584
+ },
585
+ "attribute": "resource-i-d",
586
+ "reflect": false
573
587
  }
574
588
  };
575
589
  }
@@ -612,6 +626,28 @@ export class SnkGuidesViewer {
612
626
  "resolved": "string",
613
627
  "references": {}
614
628
  }
629
+ }, {
630
+ "method": "formItemsReady",
631
+ "name": "formItemsReady",
632
+ "bubbles": true,
633
+ "cancelable": true,
634
+ "composed": true,
635
+ "docs": {
636
+ "tags": [],
637
+ "text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
638
+ },
639
+ "complexType": {
640
+ "original": "Array<HTMLElement>",
641
+ "resolved": "HTMLElement[]",
642
+ "references": {
643
+ "Array": {
644
+ "location": "global"
645
+ },
646
+ "HTMLElement": {
647
+ "location": "global"
648
+ }
649
+ }
650
+ }
615
651
  }];
616
652
  }
617
653
  static get methods() {
@@ -11,9 +11,9 @@ export class SnkDataUnit {
11
11
  const duState = this.buildDataState();
12
12
  this.dataState = duState;
13
13
  if (action.type === Action.DATA_SAVED) {
14
- // if(this.ignoreSaveMessage){
15
- // return
16
- // }
14
+ if (this.ignoreSaveMessage) {
15
+ return;
16
+ }
17
17
  const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
18
18
  if (msg != undefined) {
19
19
  this.showSuccessMessage(msg);
@@ -59,7 +59,9 @@ export class SnkDataUnit {
59
59
  this.beforeSave = undefined;
60
60
  this.afterSave = undefined;
61
61
  this.useCancelConfirm = true;
62
+ this.ignoreSaveMessage = undefined;
62
63
  this.configName = undefined;
64
+ this.resourceID = undefined;
63
65
  }
64
66
  observePageSize() {
65
67
  if (this.dataUnit) {
@@ -179,7 +181,6 @@ export class SnkDataUnit {
179
181
  return resolve(action);
180
182
  if (this._openedAlert)
181
183
  return this.dataUnit.cancelEdition();
182
- ;
183
184
  this._openedAlert = true;
184
185
  this.dataUnit.cancelEdition();
185
186
  ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate")).then(() => {
@@ -324,10 +325,10 @@ export class SnkDataUnit {
324
325
  const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
325
326
  if (this._parentSnkDataUnit) {
326
327
  this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
327
- return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
328
+ return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName, this.resourceID);
328
329
  }
329
330
  else {
330
- return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
331
+ return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
331
332
  }
332
333
  }
333
334
  async loadDataUnit() {
@@ -386,7 +387,7 @@ export class SnkDataUnit {
386
387
  //---------------------------------------------
387
388
  componentWillLoad() {
388
389
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
389
- this._application.getAllAccess().then(access => this._permissions = access);
390
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
390
391
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
391
392
  if (this.messagesBuilder == undefined) {
392
393
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -590,6 +591,23 @@ export class SnkDataUnit {
590
591
  "reflect": false,
591
592
  "defaultValue": "true"
592
593
  },
594
+ "ignoreSaveMessage": {
595
+ "type": "boolean",
596
+ "mutable": false,
597
+ "complexType": {
598
+ "original": "boolean",
599
+ "resolved": "boolean",
600
+ "references": {}
601
+ },
602
+ "required": false,
603
+ "optional": false,
604
+ "docs": {
605
+ "tags": [],
606
+ "text": "Respons\u00E1vel por evitar a mensagem de sucesso ao salvar."
607
+ },
608
+ "attribute": "ignore-save-message",
609
+ "reflect": false
610
+ },
593
611
  "configName": {
594
612
  "type": "string",
595
613
  "mutable": false,
@@ -606,6 +624,23 @@ export class SnkDataUnit {
606
624
  },
607
625
  "attribute": "config-name",
608
626
  "reflect": false
627
+ },
628
+ "resourceID": {
629
+ "type": "string",
630
+ "mutable": false,
631
+ "complexType": {
632
+ "original": "string",
633
+ "resolved": "string",
634
+ "references": {}
635
+ },
636
+ "required": false,
637
+ "optional": false,
638
+ "docs": {
639
+ "tags": [],
640
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
641
+ },
642
+ "attribute": "resource-i-d",
643
+ "reflect": false
609
644
  }
610
645
  };
611
646
  }