@sankhyalabs/sankhyablocks 8.16.0-dev.4 → 8.16.0-dev.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-ecc0ed20.js} +3 -2
  2. package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-c7e35e3b.js} +39 -6
  3. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
  4. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  5. package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-f1c92f79.js} +74 -20
  6. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
  7. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-a36ae041.js} +48 -20
  9. package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
  10. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
  11. package/dist/cjs/index-f9e81701.js +8 -28
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-490a86c3.js} +7 -2
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
  16. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  17. package/dist/cjs/snk-attach.cjs.entry.js +38 -29
  18. package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +381 -7
  19. package/dist/cjs/snk-crud.cjs.entry.js +16 -7
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +19 -18
  21. package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-b460f1da.js} +42 -22
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +12 -13
  24. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +1411 -0
  26. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  27. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  29. package/dist/cjs/snk-grid.cjs.entry.js +58 -21
  30. package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-de0a5c57.js} +27 -14
  31. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  32. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  34. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +66 -27
  37. package/dist/cjs/snk-taskbar.cjs.entry.js +24 -1
  38. package/dist/collection/collection-manifest.json +11 -31
  39. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  40. package/dist/collection/components/snk-attach/snk-attach.js +25 -16
  41. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
  42. package/dist/collection/components/snk-crud/snk-crud.js +97 -2
  43. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -4
  44. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +6 -6
  45. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +70 -7
  46. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  47. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +4 -4
  48. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
  49. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  50. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  51. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
  52. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  53. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
  54. package/dist/collection/components/snk-data-unit/snk-data-unit.js +57 -20
  55. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
  56. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  57. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +1 -1
  58. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  59. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
  60. package/dist/collection/components/snk-form/snk-form.js +2 -2
  61. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +72 -18
  62. package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
  63. package/dist/collection/components/snk-form-config/snk-form-config.js +32 -3
  64. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  65. package/dist/collection/components/snk-grid/snk-grid.js +74 -8
  66. package/dist/collection/components/snk-print-selector/snk-print-selector.js +1 -1
  67. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  68. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
  69. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +91 -16
  70. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
  71. package/dist/collection/components/snk-taskbar/snk-taskbar.js +65 -0
  72. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
  73. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  74. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
  75. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
  76. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
  77. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  78. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
  79. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
  80. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
  81. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +6 -1
  82. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  83. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  84. package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
  85. package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
  86. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  87. package/dist/collection/sw.js +46 -0
  88. package/dist/components/ConfigStorage.js +1 -0
  89. package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +40 -5
  90. package/dist/components/DataFetcher.js +22 -16
  91. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  92. package/dist/components/SnkFormConfigManager.js +72 -18
  93. package/dist/components/SnkMessageBuilder.js +7 -3
  94. package/dist/components/dataunit-fetcher.js +47 -17
  95. package/dist/components/form-config-fetcher.js +4 -1
  96. package/dist/components/pesquisa-fetcher.js +6 -1
  97. package/dist/components/snk-actions-button2.js +12 -9
  98. package/dist/components/snk-attach2.js +34 -25
  99. package/dist/components/snk-crud.js +15 -2
  100. package/dist/components/snk-data-exporter2.js +12 -11
  101. package/dist/components/snk-data-unit2.js +44 -60
  102. package/dist/components/snk-detail-view2.js +28 -13
  103. package/dist/components/snk-exporter-email-sender2.js +1 -1
  104. package/dist/components/snk-filter-bar2.js +35 -22
  105. package/dist/components/snk-filter-binary-select.js +1 -1
  106. package/dist/components/snk-filter-checkbox-list.js +1 -1
  107. package/dist/components/snk-form-config2.js +17 -4
  108. package/dist/components/snk-form.js +2 -2
  109. package/dist/components/snk-grid2.js +51 -12
  110. package/dist/components/snk-personalized-filter-editor.js +1 -1
  111. package/dist/components/snk-print-selector.js +1 -1
  112. package/dist/components/snk-simple-bar2.js +1 -1
  113. package/dist/components/snk-simple-crud2.js +59 -16
  114. package/dist/components/snk-taskbar2.js +25 -2
  115. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
  116. package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-3e520a07.js} +40 -8
  117. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
  118. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  119. package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-f1a0fc92.js} +74 -20
  120. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
  121. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
  122. package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
  123. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-fd58c640.js} +48 -18
  124. package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
  125. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
  126. package/dist/esm/index-a7d3d3f1.js +8 -28
  127. package/dist/esm/loader.js +1 -1
  128. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-50fc7e6b.js} +7 -2
  129. package/dist/esm/sankhyablocks.js +1 -1
  130. package/dist/esm/snk-actions-button_4.entry.js +18 -15
  131. package/dist/esm/snk-application.entry.js +7 -7
  132. package/dist/esm/snk-attach.entry.js +39 -30
  133. package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +382 -10
  134. package/dist/esm/snk-configurator.entry.js +1 -1
  135. package/dist/esm/snk-crud.entry.js +17 -8
  136. package/dist/esm/snk-data-exporter.entry.js +20 -19
  137. package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-590225b5.js} +42 -22
  138. package/dist/esm/snk-data-unit.entry.js +5 -5
  139. package/dist/esm/snk-detail-view.entry.js +13 -14
  140. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  141. package/dist/esm/snk-field-config.entry.js +1 -1
  142. package/dist/esm/snk-filter-bar_4.entry.js +1404 -0
  143. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  144. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  145. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  146. package/dist/esm/snk-grid.entry.js +53 -16
  147. package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-2f4dcdc5.js} +28 -15
  148. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  149. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  150. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  151. package/dist/esm/snk-print-selector.entry.js +1 -1
  152. package/dist/esm/snk-simple-bar.entry.js +1 -1
  153. package/dist/esm/snk-simple-crud.entry.js +63 -24
  154. package/dist/esm/snk-tab-config.entry.js +1 -1
  155. package/dist/esm/snk-taskbar.entry.js +24 -1
  156. package/dist/sankhyablocks/p-052213ba.entry.js +1 -0
  157. package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
  158. package/dist/sankhyablocks/p-0b6cd238.entry.js +1 -0
  159. package/dist/sankhyablocks/p-0e320bd2.entry.js +1 -0
  160. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  161. package/dist/sankhyablocks/p-17425c72.js +1 -0
  162. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-212213d9.entry.js} +1 -1
  163. package/dist/sankhyablocks/p-23736d75.js +1 -0
  164. package/dist/sankhyablocks/p-275de842.entry.js +1 -0
  165. package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
  166. package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
  167. package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
  168. package/dist/sankhyablocks/{p-72fc257b.entry.js → p-434817f0.entry.js} +1 -1
  169. package/dist/sankhyablocks/p-47bce500.js +60 -0
  170. package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
  171. package/dist/sankhyablocks/p-583517ba.entry.js +1 -0
  172. package/dist/sankhyablocks/p-5b51491f.entry.js +1 -0
  173. package/dist/sankhyablocks/p-5e51e833.entry.js +1 -0
  174. package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
  175. package/dist/sankhyablocks/p-656f0e51.entry.js +1 -0
  176. package/dist/sankhyablocks/p-72c10005.entry.js +1 -0
  177. package/dist/sankhyablocks/p-7bd9683d.js +1 -0
  178. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  179. package/dist/sankhyablocks/{p-af8efd95.js → p-8a9638ae.js} +2 -2
  180. package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
  181. package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-8c235d4c.entry.js} +1 -1
  182. package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
  183. package/dist/sankhyablocks/p-9f9b99d9.js +1 -0
  184. package/dist/sankhyablocks/p-ab1645fb.entry.js +1 -0
  185. package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
  186. package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
  187. package/dist/sankhyablocks/p-cefb0ee1.entry.js +1 -0
  188. package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-dbe6174a.entry.js} +2 -2
  189. package/dist/sankhyablocks/p-f3434fc4.js +1 -0
  190. package/dist/sankhyablocks/p-fa6c5826.entry.js +1 -0
  191. package/dist/sankhyablocks/p-fadc8339.js +1 -0
  192. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
  193. package/dist/sankhyablocks/p-fd13b4d2.js +1 -0
  194. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  195. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  196. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  197. package/dist/types/components/snk-crud/snk-crud.d.ts +17 -0
  198. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +15 -0
  199. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
  200. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
  201. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
  202. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +9 -4
  203. package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -0
  204. package/dist/types/components/snk-grid/snk-grid.d.ts +11 -0
  205. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +13 -0
  206. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
  207. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  208. package/dist/types/components.d.ts +113 -0
  209. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
  210. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  211. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
  212. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
  213. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  214. package/package.json +4 -3
  215. package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
  216. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -714
  217. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
  218. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
  219. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
  220. package/dist/cjs/snk-form.cjs.entry.js +0 -143
  221. package/dist/esm/snk-config-options.entry.js +0 -235
  222. package/dist/esm/snk-filter-bar.entry.js +0 -710
  223. package/dist/esm/snk-filter-item.entry.js +0 -308
  224. package/dist/esm/snk-filter-list.entry.js +0 -148
  225. package/dist/esm/snk-filter-modal.entry.js +0 -245
  226. package/dist/esm/snk-form.entry.js +0 -139
  227. package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
  228. package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
  229. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  230. package/dist/sankhyablocks/p-3a212712.js +0 -1
  231. package/dist/sankhyablocks/p-3a216b81.entry.js +0 -1
  232. package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
  233. package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
  234. package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
  235. package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
  236. package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
  237. package/dist/sankhyablocks/p-7a337364.js +0 -1
  238. package/dist/sankhyablocks/p-829d4045.js +0 -1
  239. package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
  240. package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
  241. package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
  242. package/dist/sankhyablocks/p-9863d682.js +0 -1
  243. package/dist/sankhyablocks/p-b11aa1e0.entry.js +0 -1
  244. package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
  245. package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
  246. package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
  247. package/dist/sankhyablocks/p-c2495304.js +0 -1
  248. package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
  249. package/dist/sankhyablocks/p-cefba299.js +0 -1
  250. package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
  251. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  252. package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
  253. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  254. package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
  255. package/dist/sankhyablocks/p-fe79f83a.js +0 -60
  256. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -4,8 +4,8 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
4
4
  import { OperationMap, SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
5
5
  import { DatasetStrategy } from '../../lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy';
6
6
  import { getRecordValue } from '../../lib/dataUnit/ValueFormatter';
7
- import { getSelectedIDs } from '../snk-data-exporter/utils/RecordIDUtils';
8
7
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
8
+ import { getSelectedRecordsIDsInfo } from '../../lib/utils/GetSelectedRecordsIDsInfo';
9
9
  export class SnkDataUnit {
10
10
  constructor() {
11
11
  this._onDataUnitResolve = [];
@@ -54,6 +54,7 @@ export class SnkDataUnit {
54
54
  this.ignoreSaveMessage = undefined;
55
55
  this.configName = undefined;
56
56
  this.resourceID = undefined;
57
+ this.domainMessagesBuilder = undefined;
57
58
  }
58
59
  observePageSize() {
59
60
  if (this.dataUnit) {
@@ -109,7 +110,7 @@ export class SnkDataUnit {
109
110
  * @returns Retorna a lista de IDs dos registros selecionados.
110
111
  */
111
112
  async getSelectedRecordsIDsInfo() {
112
- return Promise.resolve(getSelectedIDs(this.dataUnit));
113
+ return getSelectedRecordsIDsInfo(this.dataUnit);
113
114
  }
114
115
  /**
115
116
  * Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
@@ -470,21 +471,15 @@ export class SnkDataUnit {
470
471
  if (this.ignoreSaveMessage) {
471
472
  return;
472
473
  }
473
- const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
474
+ const saveOperation = action.payload.changes[0]._operation.toLowerCase();
475
+ const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
474
476
  if (msg != undefined) {
475
477
  this.showSuccessMessage(msg);
476
478
  }
477
479
  }
478
480
  handleRecordsRemoved(action) {
479
481
  var _a, _b;
480
- const cachedRecords = action.payload.cachedRecords;
481
- let removeFinishMsg;
482
- if ((cachedRecords === null || cachedRecords === void 0 ? void 0 : cachedRecords.length) > 1) {
483
- removeFinishMsg = this.getMessage("snkDataUnit.removeAllInfo", { size: cachedRecords.length });
484
- }
485
- else {
486
- removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
487
- }
482
+ let removeFinishMsg = this.buildRemoveFinishMessage(action);
488
483
  if (removeFinishMsg != undefined) {
489
484
  this.showSuccessMessage(removeFinishMsg);
490
485
  }
@@ -495,16 +490,27 @@ export class SnkDataUnit {
495
490
  this.dataUnit.gotoPage(page);
496
491
  }
497
492
  }
493
+ buildRemoveFinishMessage(action) {
494
+ const records = action.payload.records;
495
+ if (!records || !records.length)
496
+ return undefined;
497
+ if ((records === null || records === void 0 ? void 0 : records.length) > 1)
498
+ return this.getMessage('snkDataUnit.removeAllInfo', { size: records.length });
499
+ return this.getMessage('snkDataUnit.removeInfo', records);
500
+ }
498
501
  /**
499
502
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
500
503
  * através de um pequeno modulo na estrutura da aplicação:
501
504
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
502
505
  * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
503
506
  */
504
- getMessage(key, params = undefined) {
507
+ getMessage(key, params = undefined, customOperation) {
505
508
  if (!params) {
506
509
  params = this.getMessageParams();
507
510
  }
511
+ if (customOperation) {
512
+ this.messagesBuilder.currentOperation = customOperation;
513
+ }
508
514
  return this.messagesBuilder.getMessage(key, params);
509
515
  }
510
516
  getMessageParams() {
@@ -535,19 +541,28 @@ export class SnkDataUnit {
535
541
  return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
536
542
  }
537
543
  }
544
+ updateMetadataWithRMP() {
545
+ this.fillFieldsWithRmp(this.dataUnit.metadata);
546
+ this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
547
+ const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
548
+ this.dataUnit.metadata = dataUnitUpdatedMetadata;
549
+ }
538
550
  async loadDataUnit() {
539
- var _a;
551
+ var _a, _b;
540
552
  if (this.dataUnit == null && this._application && this.entityName) {
541
553
  this.dataUnit = await this.getDataUnitParentOrChild();
542
554
  }
543
555
  if (this.dataUnit) {
544
556
  this.dataUnit.pageSize = this.pageSize;
545
557
  this.dataUnit.unsubscribe(this._dataUnitObserver);
546
- this.dataUnit.addInterceptor(this);
547
558
  this.dataUnit.subscribe(this._dataUnitObserver);
548
- await this.dataUnit.loadMetadata();
549
- if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
550
- this.getMetadataByRow(this.dataUnit);
559
+ if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
560
+ this.updateMetadataWithRMP();
561
+ }
562
+ this.dataUnit.addInterceptor(this);
563
+ if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
564
+ const { records } = this.getMetadataByRow(this.dataUnit);
565
+ this.dataUnit.records = records;
551
566
  }
552
567
  this.dataState = this.buildDataState();
553
568
  let resolver;
@@ -611,6 +626,13 @@ export class SnkDataUnit {
611
626
  parent = parent.parentElement;
612
627
  }
613
628
  }
629
+ instanceMessagesBuilder() {
630
+ var _a;
631
+ if (this.messagesBuilder) {
632
+ return;
633
+ }
634
+ this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
635
+ }
614
636
  //---------------------------------------------
615
637
  // Lifecycle web component
616
638
  //---------------------------------------------
@@ -618,9 +640,7 @@ export class SnkDataUnit {
618
640
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
619
641
  this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
620
642
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
621
- if (this.messagesBuilder == undefined) {
622
- this.messagesBuilder = new SnkMessageBuilder(this.entityName);
623
- }
643
+ this.instanceMessagesBuilder();
624
644
  }
625
645
  disconnectedCallback() {
626
646
  if (this.dataUnit) {
@@ -860,6 +880,23 @@ export class SnkDataUnit {
860
880
  },
861
881
  "attribute": "resource-i-d",
862
882
  "reflect": false
883
+ },
884
+ "domainMessagesBuilder": {
885
+ "type": "string",
886
+ "mutable": false,
887
+ "complexType": {
888
+ "original": "string",
889
+ "resolved": "string",
890
+ "references": {}
891
+ },
892
+ "required": false,
893
+ "optional": false,
894
+ "docs": {
895
+ "tags": [],
896
+ "text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
897
+ },
898
+ "attribute": "domain-messages-builder",
899
+ "reflect": false
863
900
  }
864
901
  };
865
902
  }
@@ -74,7 +74,7 @@ export class SnkFilterBinarySelect {
74
74
  }
75
75
  const [optOne, optTwo] = this.config.props.options;
76
76
  if (this.presentationMode === EPresentationMode.MODAL) {
77
- return (h(Host, null, h("div", { class: "ez-row ez-size-height--full" }, h("label", { class: "ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4" }, this.config.detailModal), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkOne = ref, id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: this.isSelected(optOne.name), compact: true })), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkTwo = ref, id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: this.isSelected(optTwo.name), compact: true })))));
77
+ return (h(Host, null, h("div", { class: "ez-row ez-size-height--full" }, h("label", { class: "ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4" }, this.config.detailModal), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkOne = ref, id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: this.isSelected(optOne.name) })), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkTwo = ref, id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: this.isSelected(optTwo.name) })))));
78
78
  }
79
79
  return (h(Host, null, h("ez-radio-button", { value: this._radioButtonValue }, h("ez-radio-button-option", { id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: optOne.name }), h("ez-radio-button-option", { id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: optTwo.name }), h("ez-radio-button-option", { id: `${this.config.id}_option3`, class: "sc-snk-filter-bar editor__ez-check", label: `${optOne.label} + ${optTwo.label}`, value: this._noOptionValue }))));
80
80
  }
@@ -19,7 +19,7 @@ export class SnkFilterCheckboxList {
19
19
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
20
20
  }
21
21
  renderOptions() {
22
- return this.optionsList.map(option => (h("ez-check", { label: option.label, compact: true, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
22
+ return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
23
23
  }
24
24
  isChecked(itemName) {
25
25
  var _a;
@@ -39,7 +39,7 @@ export class SnkFilterPersonalized {
39
39
  }
40
40
  getItemContent(item) {
41
41
  var _a, _b;
42
- const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, compact: true, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
42
+ const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
43
43
  const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
44
44
  return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, h(CheckboxElement, null), this.buildModalListActions(item, isVariable))), (item.visible && isVariable) && (h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
45
45
  }
@@ -105,7 +105,7 @@
105
105
 
106
106
  .snk-filter-bar__filter-item-container {
107
107
  display: flex;
108
- align-self: center;
108
+ align-items: start;
109
109
  }
110
110
 
111
111
  .snk-filter-bar__scroller :first-child {
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, ElementIDUtils, ErrorException, ObjectUtils } from '@sankhyalabs/core';
1
+ import { ApplicationContext, ElementIDUtils, ObjectUtils, ErrorException } from '@sankhyalabs/core';
2
2
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
3
3
  import { h, Host } from '@stencil/core';
4
4
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
@@ -15,18 +15,19 @@ export class SnkFilterBar {
15
15
  this._pendingVariables = false;
16
16
  this._customfiltersToBeUpdated = [];
17
17
  this._calculateSortIndex = (item) => {
18
- let index = item.hardFixed ? 1000000 : 0;
19
- //campos Hard Fixed não variam a ordem
20
- if (!item.hardFixed) {
21
- index += item.fixed ? 100000 : 0;
22
- index += item.value == undefined ? 0 : 10000;
23
- index += this._updateSequence.lastIndexOf(item.id) + 1;
24
- }
18
+ if (!item.visible)
19
+ return 0;
20
+ if (item.hardFixed)
21
+ return 1000000; //campos Hard Fixed não variam a ordem
22
+ let index = item.fixed ? 100000 : 0;
23
+ index += this.hasValidValue(item) ? 10000 : 0;
24
+ index += this._updateSequence.lastIndexOf(item.id) + 1;
25
25
  return index;
26
26
  };
27
27
  this._filtersComparator = (a, b) => {
28
28
  return this._calculateSortIndex(b) - this._calculateSortIndex(a);
29
29
  };
30
+ this.customFilterBarConfig = undefined;
30
31
  this.dataUnit = undefined;
31
32
  this.title = undefined;
32
33
  this.configName = undefined;
@@ -42,6 +43,13 @@ export class SnkFilterBar {
42
43
  this.showPersonalizedFilter = false;
43
44
  this.personalizedFilterId = undefined;
44
45
  }
46
+ hasValidValue(item) {
47
+ if (item.value === undefined || item.value === null)
48
+ return false;
49
+ if (!Array.isArray(item.value))
50
+ return true;
51
+ return item.value.some(filterItem => filterItem.check === true);
52
+ }
45
53
  observeFilterConfig(newValue, oldValue) {
46
54
  if (ObjectUtils.equals(newValue, oldValue))
47
55
  return;
@@ -268,7 +276,7 @@ export class SnkFilterBar {
268
276
  getFilterItems() {
269
277
  const pinnedItems = [];
270
278
  const unpinnedItems = [];
271
- this.filterConfig
279
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
272
280
  .filter(this.filterActiveFilter)
273
281
  .forEach((item, index) => {
274
282
  item = ObjectUtils.copy(item);
@@ -330,19 +338,23 @@ export class SnkFilterBar {
330
338
  }
331
339
  }
332
340
  async loadConfigFromStorage(clearCache) {
333
- if (clearCache) {
334
- await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
341
+ try {
342
+ if (clearCache) {
343
+ await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
344
+ }
345
+ let config;
346
+ if (this.customFilterBarConfig) {
347
+ config = await this.customFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
348
+ }
349
+ else {
350
+ config = await ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
351
+ }
352
+ this.filterConfig = config.map(item => this.normalizeItem(item));
353
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
354
+ }
355
+ catch (e) {
356
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), e);
335
357
  }
336
- return new Promise(accept => {
337
- ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
338
- .then((filters) => {
339
- accept();
340
- this.filterConfig = filters.map(item => this.normalizeItem(item));
341
- })
342
- .catch(reason => {
343
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
344
- });
345
- });
346
358
  }
347
359
  attachDataUnit() {
348
360
  if (this.dataUnit == undefined) {
@@ -469,6 +481,32 @@ export class SnkFilterBar {
469
481
  }
470
482
  static get properties() {
471
483
  return {
484
+ "customFilterBarConfig": {
485
+ "type": "unknown",
486
+ "mutable": false,
487
+ "complexType": {
488
+ "original": "(configName: string, resourceId: string, options: any) => Promise<Array<SnkFilterItemConfig>>",
489
+ "resolved": "(configName: string, resourceId: string, options: any) => Promise<SnkFilterItemConfig[]>",
490
+ "references": {
491
+ "Promise": {
492
+ "location": "global"
493
+ },
494
+ "Array": {
495
+ "location": "global"
496
+ },
497
+ "SnkFilterItemConfig": {
498
+ "location": "import",
499
+ "path": "./filter-item/snk-filter-item"
500
+ }
501
+ }
502
+ },
503
+ "required": false,
504
+ "optional": true,
505
+ "docs": {
506
+ "tags": [],
507
+ "text": "Loader customizado para carregar as configura\u00E7\u00F5es"
508
+ }
509
+ },
472
510
  "dataUnit": {
473
511
  "type": "unknown",
474
512
  "mutable": true,
@@ -87,7 +87,7 @@ export class SnkForm {
87
87
  if (this.resourceID == undefined) {
88
88
  this.resourceID = await ResourceIDUtils.getResourceID();
89
89
  }
90
- this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
90
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
91
91
  this.addFormLegacyConfig();
92
92
  await this._configManager.loadConfig();
93
93
  }
@@ -117,7 +117,7 @@ export class SnkForm {
117
117
  if (!this._dataUnit || !this._dataState) {
118
118
  return undefined;
119
119
  }
120
- return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
120
+ return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
121
121
  h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
122
122
  }
123
123
  static get is() { return "snk-form"; }
@@ -1,11 +1,13 @@
1
1
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
2
2
  import { ObjectUtils, StringUtils } from "@sankhyalabs/core";
3
3
  import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
4
+ import { TAB_NAMES } from "../../lib/utils/constants";
4
5
  export class SnkFormConfigManager {
5
- constructor(configName, resourceID, onConfigChange) {
6
+ constructor(configName, resourceID, onConfigChange, dataUnit) {
6
7
  this._resourceID = resourceID;
7
8
  this._configName = configName;
8
9
  this._onConfigChange = onConfigChange;
10
+ this._dataUnit = dataUnit;
9
11
  }
10
12
  addFormLegacyConfig(legacyConfigName) {
11
13
  if (this._configName) {
@@ -16,6 +18,7 @@ export class SnkFormConfigManager {
16
18
  return new Promise(resolve => {
17
19
  ConfigStorage.loadFormConfig(this._configName, this._resourceID)
18
20
  .then((config) => {
21
+ config = this.buildFormMetadataUITabs(config);
19
22
  this.setConfig(config);
20
23
  resolve(config);
21
24
  })
@@ -24,6 +27,10 @@ export class SnkFormConfigManager {
24
27
  });
25
28
  });
26
29
  }
30
+ getEmptyConfig() {
31
+ const config = this.buildFormMetadataUITabs({ fields: [], emptyConfig: true }, true);
32
+ return config;
33
+ }
27
34
  saveConfig(config) {
28
35
  const configToSave = ObjectUtils.copy(config);
29
36
  return new Promise(accept => {
@@ -67,27 +74,36 @@ export class SnkFormConfigManager {
67
74
  }
68
75
  return updatingCardConfig;
69
76
  }
70
- getFieldsList(dataUnit, descriptionFilter) {
77
+ hasConfig(config) {
78
+ var _a;
79
+ const currentConfig = config !== null && config !== void 0 ? config : this._config;
80
+ if (currentConfig && ((_a = currentConfig.fields) === null || _a === void 0 ? void 0 : _a.length)) {
81
+ return true;
82
+ }
83
+ return false;
84
+ }
85
+ getFieldsList(descriptionFilter, forceEmptyConfig = false) {
71
86
  var _a;
72
87
  const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
73
- if (fields != undefined && fields.length > 0) {
74
- return fields.map(({ label, name, readOnly, visible, required }) => {
88
+ const hasConfig = this.hasConfig();
89
+ if (hasConfig && !forceEmptyConfig) {
90
+ return fields.map(({ label, name, readOnly, visible, required, tab }) => {
91
+ var _a;
75
92
  if (label == undefined) {
76
- return Object.assign(Object.assign({}, dataUnit.getField(name)), { name,
77
- readOnly,
78
- visible,
79
- required });
93
+ const currentField = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
94
+ return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required, tab: tab });
80
95
  }
81
- return { name, label, readOnly, visible, required };
96
+ return { name, label, readOnly, visible, required, tab };
82
97
  })
83
98
  .filter(field => this.isFieldVisible(field, descriptionFilter));
84
99
  }
85
- if (dataUnit != undefined) {
86
- return dataUnit.metadata.fields
87
- .filter(field => this.isFieldVisible(field, descriptionFilter))
88
- .map(({ label, name, readOnly }) => { return { label, name, readOnly }; });
100
+ if (!this._dataUnit) {
101
+ return [];
89
102
  }
90
- return [];
103
+ const filteredFields = this._dataUnit.metadata.fields
104
+ .filter(field => this.isFieldVisible(field, descriptionFilter))
105
+ .map(({ label, name, readOnly, visible, required, properties }) => ({ label, name, readOnly, visible, required, tab: properties === null || properties === void 0 ? void 0 : properties.UITabName }));
106
+ return filteredFields;
91
107
  }
92
108
  isFieldVisible(field, descriptionFilter) {
93
109
  if (field.visible === false) {
@@ -100,8 +116,8 @@ export class SnkFormConfigManager {
100
116
  const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
101
117
  return normalizedText.includes(normalizedFilter);
102
118
  }
103
- getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
104
- let fields = this.getFieldsList(dataUnit);
119
+ getFormConfig(dataUnit, ignoreReadOnlyFormFields, forceEmptyConfig = false) {
120
+ let fields = this.getFieldsList(undefined, forceEmptyConfig);
105
121
  if (ignoreReadOnlyFormFields) {
106
122
  fields = fields.filter(field => {
107
123
  if (dataUnit) {
@@ -132,8 +148,8 @@ export class SnkFormConfigManager {
132
148
  this._onConfigChange(Object.assign({}, this._config));
133
149
  }
134
150
  }
135
- getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
136
- return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
151
+ getConfig(dataUnit, ignoreReadOnlyFormFields) {
152
+ return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
137
153
  }
138
154
  getFormConfigFetcher() {
139
155
  if (this._formConfigFetcher == undefined) {
@@ -154,4 +170,42 @@ export class SnkFormConfigManager {
154
170
  async fetchDefaultConfig() {
155
171
  return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
156
172
  }
173
+ parseObjectList(object) {
174
+ if (!object) {
175
+ return [];
176
+ }
177
+ return Array.isArray(object) ? object : [object];
178
+ }
179
+ buildFormMetadataUITabs(config, forceEmptyConfig = false) {
180
+ var _a;
181
+ const hasConfig = this.hasConfig(config);
182
+ if (!forceEmptyConfig && (!this._dataUnit || hasConfig)) {
183
+ return config;
184
+ }
185
+ config = this.getFormConfig(this._dataUnit, false, true);
186
+ config.tabs = this.parseObjectList(config.tabs);
187
+ config.emptyConfig = false;
188
+ config.defaultConfiguration = true;
189
+ const fields = this._dataUnit.metadata.fields;
190
+ for (const currentField of fields) {
191
+ const field = config.fields.find(field => field.name === currentField.name);
192
+ const uiTabName = (_a = currentField.properties) === null || _a === void 0 ? void 0 : _a.UITabName;
193
+ if (!uiTabName || uiTabName === TAB_NAMES.main) {
194
+ continue;
195
+ }
196
+ const haveTab = config.tabs.some((tab) => tab.label === uiTabName);
197
+ if (!haveTab) {
198
+ config.tabs.push({
199
+ label: uiTabName,
200
+ name: uiTabName,
201
+ order: 0,
202
+ visible: true,
203
+ });
204
+ }
205
+ if (field) {
206
+ field.tab = uiTabName;
207
+ }
208
+ }
209
+ return config;
210
+ }
157
211
  }
@@ -44,6 +44,11 @@
44
44
  background-color: var(--snk-form-config--background-color);
45
45
  }
46
46
 
47
+ div:focus-visible,
48
+ div:focus {
49
+ outline: none;
50
+ }
51
+
47
52
  .form-config__header-container {
48
53
  /*private*/
49
54
  display: flex;
@@ -58,7 +63,7 @@
58
63
  .form-config__hide-content {
59
64
  /*private*/
60
65
  display: none;
61
- }
66
+ }
62
67
 
63
68
  ez-icon .left-icon {
64
69
  /*public*/
@@ -229,9 +234,9 @@ ez-collapsible-box{
229
234
  /*private*/
230
235
  left: calc(100% / 1 * -1);
231
236
  }
232
-
237
+
233
238
  .form-config__field-config--selected:nth-child(3n+3) .ez-flex.form-config__config-options {
234
239
  /*private*/
235
240
  left: calc(100% / 1 * -2);
236
241
  }
237
- }
242
+ }
@@ -38,6 +38,7 @@ export class SnkFormConfig {
38
38
  this.dataUnit = undefined;
39
39
  this.configManager = undefined;
40
40
  this.messagesBuilder = undefined;
41
+ this.ignoreReadOnlyFormFields = undefined;
41
42
  }
42
43
  observeConfigManager() {
43
44
  this.loadConfig(this._sortableTimer);
@@ -67,7 +68,7 @@ export class SnkFormConfig {
67
68
  }
68
69
  }
69
70
  getConfig() {
70
- let config = this.configManager.getConfig(false, this.dataUnit);
71
+ let config = this.configManager.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
71
72
  if (config.fields && config.fields.length === 0) {
72
73
  config = undefined;
73
74
  }
@@ -192,7 +193,12 @@ export class SnkFormConfig {
192
193
  this._optionFormConfigChanged = false;
193
194
  this.configManager.saveConfig(this.buildConfigToSave())
194
195
  .then(savedConfig => {
196
+ var _a;
195
197
  ApplicationUtils.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"), { iconName: "check" });
198
+ const userOption = (_a = this._formConfigOptions) === null || _a === void 0 ? void 0 : _a.find((config) => {
199
+ return config.origin === UserConfigType.USER;
200
+ });
201
+ this.setFormConfig(userOption);
196
202
  this.configChange.emit(savedConfig);
197
203
  });
198
204
  }
@@ -529,9 +535,12 @@ export class SnkFormConfig {
529
535
  switch (this._optionFormConfigSelected.origin) {
530
536
  case UserConfigType.DEFAULT:
531
537
  config = await this.configManager.fetchDefaultConfig();
538
+ if (!config) {
539
+ config = this.configManager.getEmptyConfig();
540
+ }
532
541
  break;
533
- case UserConfigType.DEFAULT:
534
- config = await this.configManager.fetchDefaultConfig();
542
+ default:
543
+ config = this.getConfig();
535
544
  break;
536
545
  }
537
546
  if (config != undefined) {
@@ -734,6 +743,9 @@ export class SnkFormConfig {
734
743
  if (layoutFormConfig == undefined) {
735
744
  layoutFormConfig = [];
736
745
  }
746
+ if (this._formConfig.defaultConfiguration) {
747
+ return layoutFormConfig;
748
+ }
737
749
  return this._formConfig.tabs.map((tab) => {
738
750
  return layoutFormConfig.find(config => { var _a, _b; return ((_a = tab.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = config.tab) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })
739
751
  || { tab: tab.label, groups: [], visible: tab.visible };
@@ -1055,6 +1067,23 @@ export class SnkFormConfig {
1055
1067
  "tags": [],
1056
1068
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
1057
1069
  }
1070
+ },
1071
+ "ignoreReadOnlyFormFields": {
1072
+ "type": "boolean",
1073
+ "mutable": false,
1074
+ "complexType": {
1075
+ "original": "boolean",
1076
+ "resolved": "boolean",
1077
+ "references": {}
1078
+ },
1079
+ "required": false,
1080
+ "optional": true,
1081
+ "docs": {
1082
+ "tags": [],
1083
+ "text": "Ignora os campos \"somente leitura\" no modo de inser\u00E7\u00E3o."
1084
+ },
1085
+ "attribute": "ignore-read-only-form-fields",
1086
+ "reflect": false
1058
1087
  }
1059
1088
  };
1060
1089
  }
@@ -1,11 +1,13 @@
1
1
  :host {
2
2
  --snk-grid-min-height: 300px;
3
+ --snk-grid-padding: var(--space--small);
3
4
  }
4
5
 
5
6
  .snk-grid__container {
6
7
  display: flex;
7
8
  height: 100%;
8
9
  width: 100%;
10
+ padding: var(--snk-grid-padding);
9
11
  }
10
12
 
11
13
  .snk-grid__header {