@sankhyalabs/sankhyablocks 10.1.0-dev.52 → 10.1.0-dev.53

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 (263) hide show
  1. package/dist/cjs/{ConfigStorage-a1fab5ca.js → ConfigStorage-4201dd3d.js} +2 -2
  2. package/dist/cjs/{DataFetcher-384d2ce8.js → DataFetcher-b3a8075d.js} +2830 -2
  3. package/dist/cjs/FormConfigHelper-c5f5473a.js +342 -0
  4. package/dist/cjs/{ISave-ecbe9336.js → ISave-4674c283.js} +1 -1
  5. package/dist/cjs/{PersonalizedFilterUtils-eccb267a.js → PersonalizedFilterUtils-263e4d24.js} +52 -5
  6. package/dist/cjs/{SnkFormConfigManager-44386305.js → SnkFormConfigManager-c3a49038.js} +2 -2
  7. package/dist/cjs/{SnkMultiSelectionListDataSource-d341dd02.js → SnkMultiSelectionListDataSource-0bc94d36.js} +4 -4
  8. package/dist/cjs/{auth-fetcher-6b134ec4.js → auth-fetcher-0ecc53ff.js} +1 -1
  9. package/dist/cjs/{dataunit-fetcher-b9822794.js → dataunit-fetcher-bcbc38c0.js} +2 -3
  10. package/dist/cjs/{filter-type.enum-2bb46d2a.js → filter-type.enum-b3b388af.js} +7 -0
  11. package/dist/cjs/{form-config-fetcher-45d1964c.js → form-config-fetcher-f80dbc3b.js} +23 -5
  12. package/dist/cjs/index-1894343a.js +24 -36
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -5
  15. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  16. package/dist/cjs/snk-actions-button_9.cjs.entry.js +5 -6
  17. package/dist/cjs/snk-application.cjs.entry.js +7 -8
  18. package/dist/cjs/snk-attach_11.cjs.entry.js +2950 -0
  19. package/dist/cjs/snk-crud.cjs.entry.js +31 -243
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -6
  21. package/dist/cjs/{snk-data-unit-4b6dc396.js → snk-data-unit-3b94547d.js} +11 -11
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -4
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
  24. package/dist/cjs/snk-dynaform-config-header_5.cjs.entry.js +739 -0
  25. package/dist/cjs/snk-dynaform-detail-view_2.cjs.entry.js +938 -0
  26. package/dist/cjs/snk-dynaform-field-config_2.cjs.entry.js +327 -0
  27. package/dist/cjs/snk-dynaform-guides-view-e98f7f3a.js +747 -0
  28. package/dist/cjs/snk-dynaform-guides-view.cjs.entry.js +23 -0
  29. package/dist/cjs/snk-dynaform.cjs.entry.js +675 -0
  30. package/dist/cjs/{snk-expression-group_2.cjs.entry.js → snk-expression-group_4.cjs.entry.js} +421 -18
  31. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +41 -44
  32. package/dist/cjs/snk-form_2.cjs.entry.js +4 -5
  33. package/dist/cjs/snk-grid.cjs.entry.js +7 -8
  34. package/dist/cjs/{snk-guides-viewer-8e7a503b.js → snk-guides-viewer-3054d541.js} +1 -1
  35. package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -6
  36. package/dist/cjs/snk-layout-form-config.cjs.entry.js +4 -5
  37. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -5
  38. package/dist/cjs/taskbarUtils-38748460.js +231 -0
  39. package/dist/collection/collection-manifest.json +17 -0
  40. package/dist/collection/components/snk-dynaform/interfaces/PropsCustomEditor.js +1 -0
  41. package/dist/collection/components/snk-dynaform/interfaces/PropsCustomRender.js +1 -0
  42. package/dist/collection/components/snk-dynaform/snk-dynaform.css +64 -0
  43. package/dist/collection/components/snk-dynaform/snk-dynaform.js +1657 -0
  44. package/dist/collection/components/snk-dynaform/subcomponents/CardFormResizeObserver.js +26 -0
  45. package/dist/collection/components/snk-dynaform/subcomponents/GuideBuilder.js +51 -0
  46. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.css +112 -0
  47. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.js +992 -0
  48. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.css +64 -0
  49. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.js +588 -0
  50. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.css +98 -0
  51. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.js +1167 -0
  52. package/dist/collection/components/snk-dynaform-form-config/FormConfigHelper.js +325 -0
  53. package/dist/collection/components/snk-dynaform-form-config/SnkFormConfigManager.js +212 -0
  54. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.css +17 -0
  55. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.js +236 -0
  56. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.css +41 -0
  57. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.js +170 -0
  58. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.css +22 -0
  59. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.js +408 -0
  60. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.css +88 -0
  61. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.js +209 -0
  62. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.css +167 -0
  63. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.js +655 -0
  64. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.css +42 -0
  65. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.js +171 -0
  66. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.css +66 -0
  67. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.js +557 -0
  68. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.css +80 -0
  69. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.js +326 -0
  70. package/dist/collection/components/snk-grid/snk-grid.css +4 -2
  71. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +22 -4
  72. package/dist/components/form-config-fetcher.js +22 -4
  73. package/dist/components/index.d.ts +12 -0
  74. package/dist/components/index.js +12 -0
  75. package/dist/components/snk-crud.js +1 -212
  76. package/dist/components/snk-dynaform-config-header.d.ts +11 -0
  77. package/dist/components/snk-dynaform-config-header.js +6 -0
  78. package/dist/components/snk-dynaform-config-header2.js +103 -0
  79. package/dist/components/snk-dynaform-configs-button.d.ts +11 -0
  80. package/dist/components/snk-dynaform-configs-button.js +6 -0
  81. package/dist/components/snk-dynaform-configs-button2.js +76 -0
  82. package/dist/components/snk-dynaform-detail-view.d.ts +11 -0
  83. package/dist/components/snk-dynaform-detail-view.js +6 -0
  84. package/dist/components/snk-dynaform-detail-view2.js +1835 -0
  85. package/dist/components/snk-dynaform-field-config.d.ts +11 -0
  86. package/dist/components/snk-dynaform-field-config.js +6 -0
  87. package/dist/components/snk-dynaform-field-config2.js +605 -0
  88. package/dist/components/snk-dynaform-field-item.d.ts +11 -0
  89. package/dist/components/snk-dynaform-field-item.js +6 -0
  90. package/dist/components/snk-dynaform-field-item2.js +96 -0
  91. package/dist/components/snk-dynaform-fields-layout.d.ts +11 -0
  92. package/dist/components/snk-dynaform-fields-layout.js +6 -0
  93. package/dist/components/snk-dynaform-fields-layout2.js +428 -0
  94. package/dist/components/snk-dynaform-fields-selector.d.ts +11 -0
  95. package/dist/components/snk-dynaform-fields-selector.js +6 -0
  96. package/dist/components/snk-dynaform-fields-selector2.js +104 -0
  97. package/dist/components/snk-dynaform-form-config.d.ts +11 -0
  98. package/dist/components/snk-dynaform-form-config.js +6 -0
  99. package/dist/components/snk-dynaform-form-config2.js +430 -0
  100. package/dist/components/snk-dynaform-form-view.d.ts +11 -0
  101. package/dist/components/snk-dynaform-form-view.js +6 -0
  102. package/dist/components/snk-dynaform-form-view2.js +270 -0
  103. package/dist/components/snk-dynaform-guides-configurator.d.ts +11 -0
  104. package/dist/components/snk-dynaform-guides-configurator.js +6 -0
  105. package/dist/components/snk-dynaform-guides-configurator2.js +173 -0
  106. package/dist/components/snk-dynaform-guides-view.d.ts +11 -0
  107. package/dist/components/snk-dynaform-guides-view.js +6 -0
  108. package/dist/components/snk-dynaform.d.ts +11 -0
  109. package/dist/components/snk-dynaform.js +1003 -0
  110. package/dist/components/snk-grid2.js +1 -1
  111. package/dist/components/taskbarUtils.js +224 -0
  112. package/dist/esm/{ConfigStorage-76872695.js → ConfigStorage-e834d1ea.js} +2 -2
  113. package/dist/esm/{DataFetcher-e60f8d53.js → DataFetcher-5ed0a377.js} +2830 -3
  114. package/dist/esm/FormConfigHelper-efc29480.js +328 -0
  115. package/dist/esm/{ISave-4929c071.js → ISave-5b46d691.js} +1 -1
  116. package/dist/esm/{PersonalizedFilterUtils-d2439a9a.js → PersonalizedFilterUtils-45b5803c.js} +49 -2
  117. package/dist/esm/{SnkFormConfigManager-83f6b22f.js → SnkFormConfigManager-bfd575c2.js} +2 -2
  118. package/dist/esm/{SnkMultiSelectionListDataSource-18abafb1.js → SnkMultiSelectionListDataSource-9e9166ae.js} +4 -4
  119. package/dist/esm/{auth-fetcher-1a31c1e4.js → auth-fetcher-5283045d.js} +1 -1
  120. package/dist/esm/{dataunit-fetcher-c176e002.js → dataunit-fetcher-3b1ca96e.js} +1 -2
  121. package/dist/esm/{filter-type.enum-f6a8fe23.js → filter-type.enum-62b7fe88.js} +8 -1
  122. package/dist/esm/{form-config-fetcher-b44b2727.js → form-config-fetcher-db1bf140.js} +23 -5
  123. package/dist/esm/index-04f73a26.js +24 -36
  124. package/dist/esm/loader.js +1 -1
  125. package/dist/esm/pesquisa-grid_2.entry.js +4 -5
  126. package/dist/esm/sankhyablocks.js +1 -1
  127. package/dist/esm/snk-actions-button_9.entry.js +5 -6
  128. package/dist/esm/snk-application.entry.js +6 -7
  129. package/dist/esm/snk-attach_11.entry.js +2936 -0
  130. package/dist/esm/snk-crud.entry.js +6 -218
  131. package/dist/esm/snk-data-exporter.entry.js +5 -6
  132. package/dist/esm/{snk-data-unit-d8cfa950.js → snk-data-unit-dfde62cb.js} +2 -2
  133. package/dist/esm/snk-data-unit.entry.js +3 -4
  134. package/dist/esm/snk-detail-view.entry.js +7 -8
  135. package/dist/esm/snk-dynaform-config-header_5.entry.js +731 -0
  136. package/dist/esm/snk-dynaform-detail-view_2.entry.js +933 -0
  137. package/dist/esm/snk-dynaform-field-config_2.entry.js +322 -0
  138. package/dist/esm/snk-dynaform-guides-view-1f1455d6.js +744 -0
  139. package/dist/esm/snk-dynaform-guides-view.entry.js +15 -0
  140. package/dist/esm/snk-dynaform.entry.js +671 -0
  141. package/dist/esm/{snk-expression-group_2.entry.js → snk-expression-group_4.entry.js} +405 -4
  142. package/dist/esm/snk-filter-bar_4.entry.js +5 -8
  143. package/dist/esm/snk-form_2.entry.js +4 -5
  144. package/dist/esm/snk-grid.entry.js +7 -8
  145. package/dist/esm/{snk-guides-viewer-adf39ea2.js → snk-guides-viewer-95fefcaa.js} +1 -1
  146. package/dist/esm/snk-guides-viewer.entry.js +5 -6
  147. package/dist/esm/snk-layout-form-config.entry.js +4 -5
  148. package/dist/esm/snk-pesquisa.entry.js +4 -5
  149. package/dist/esm/taskbarUtils-8501d09e.js +225 -0
  150. package/dist/sankhyablocks/p-0dbd53d9.js +1 -0
  151. package/dist/sankhyablocks/{p-f5ad0720.js → p-19d1ca14.js} +1 -1
  152. package/dist/sankhyablocks/{p-ab5e12fa.js → p-1cc4cf61.js} +1 -1
  153. package/dist/sankhyablocks/p-1edd6be6.entry.js +1 -0
  154. package/dist/sankhyablocks/p-22ddc1a5.entry.js +1 -0
  155. package/dist/sankhyablocks/p-24b059ee.entry.js +1 -0
  156. package/dist/sankhyablocks/{p-5c250661.js → p-2c00b93d.js} +1 -1
  157. package/dist/sankhyablocks/p-3623fddf.entry.js +1 -0
  158. package/dist/sankhyablocks/p-43c94ba5.entry.js +1 -0
  159. package/dist/sankhyablocks/p-449dfe55.entry.js +1 -0
  160. package/dist/sankhyablocks/p-451b5bcc.entry.js +1 -0
  161. package/dist/sankhyablocks/p-46d7e2de.js +1 -0
  162. package/dist/sankhyablocks/{p-3c990841.js → p-51e853f2.js} +1 -1
  163. package/dist/sankhyablocks/p-58709cf9.js +1 -0
  164. package/dist/sankhyablocks/p-589016e2.entry.js +1 -0
  165. package/dist/sankhyablocks/p-5d02c032.js +1 -0
  166. package/dist/sankhyablocks/p-5d50f59a.entry.js +1 -0
  167. package/dist/sankhyablocks/p-61776b68.entry.js +1 -0
  168. package/dist/sankhyablocks/p-6b8a1ec3.js +1 -0
  169. package/dist/sankhyablocks/p-7038cf62.entry.js +1 -0
  170. package/dist/sankhyablocks/{p-b1bb4cf1.js → p-70c2ee5c.js} +1 -1
  171. package/dist/sankhyablocks/p-7628e04f.entry.js +1 -0
  172. package/dist/sankhyablocks/p-7798788b.entry.js +1 -0
  173. package/dist/sankhyablocks/p-77c26de0.js +1 -0
  174. package/dist/sankhyablocks/p-7c34a0f7.entry.js +1 -0
  175. package/dist/sankhyablocks/p-a4a0d9b7.entry.js +1 -0
  176. package/dist/sankhyablocks/{p-4f7adf97.js → p-b1bf9564.js} +1 -1
  177. package/dist/sankhyablocks/p-b4c2a99c.entry.js +1 -0
  178. package/dist/sankhyablocks/p-b75af274.entry.js +1 -0
  179. package/dist/sankhyablocks/p-c538bd6c.entry.js +1 -0
  180. package/dist/sankhyablocks/{p-3704bf1b.js → p-d5810110.js} +1 -1
  181. package/dist/sankhyablocks/p-d7fd447e.entry.js +1 -0
  182. package/dist/sankhyablocks/p-d88278f8.js +28 -0
  183. package/dist/sankhyablocks/p-f076d742.js +60 -0
  184. package/dist/sankhyablocks/{p-8fe740b7.entry.js → p-f1ef090f.entry.js} +2 -2
  185. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  186. package/dist/types/components/snk-dynaform/interfaces/PropsCustomEditor.d.ts +4 -0
  187. package/dist/types/components/snk-dynaform/interfaces/PropsCustomRender.d.ts +4 -0
  188. package/dist/types/components/snk-dynaform/subcomponents/CardFormResizeObserver.d.ts +1 -0
  189. package/dist/types/components/snk-dynaform/subcomponents/GuideBuilder.d.ts +14 -0
  190. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.d.ts +158 -0
  191. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.d.ts +107 -0
  192. package/dist/types/components/snk-dynaform-form-config/FormConfigHelper.d.ts +36 -0
  193. package/dist/types/components/snk-dynaform-form-config/SnkFormConfigManager.d.ts +35 -0
  194. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.d.ts +23 -0
  195. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.d.ts +19 -0
  196. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.d.ts +56 -0
  197. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.d.ts +74 -0
  198. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.d.ts +21 -0
  199. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-form-config.d.ts +95 -0
  200. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.d.ts +35 -0
  201. package/dist/types/components.d.ts +2403 -1322
  202. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +1 -0
  203. package/package.json +1 -1
  204. package/react/components.d.ts +12 -0
  205. package/react/components.js +12 -0
  206. package/react/components.js.map +1 -1
  207. package/dist/cjs/SnkMessageBuilder-a9300ebe.js +0 -2833
  208. package/dist/cjs/default-filters-a09bf82b.js +0 -8
  209. package/dist/cjs/index-62760a9c.js +0 -49
  210. package/dist/cjs/index-8d94b7e0.js +0 -7
  211. package/dist/cjs/snk-attach.cjs.entry.js +0 -948
  212. package/dist/cjs/snk-default-filter.cjs.entry.js +0 -77
  213. package/dist/cjs/snk-filter-advanced-mode_3.cjs.entry.js +0 -99
  214. package/dist/cjs/snk-filter-detail.cjs.entry.js +0 -198
  215. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +0 -408
  216. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +0 -109
  217. package/dist/cjs/snk-image-input.cjs.entry.js +0 -160
  218. package/dist/cjs/snk-personalized-filter.cjs.entry.js +0 -358
  219. package/dist/cjs/snk-simple-crud.cjs.entry.js +0 -865
  220. package/dist/esm/SnkMessageBuilder-1eb7a1af.js +0 -2831
  221. package/dist/esm/default-filters-50105e43.js +0 -8
  222. package/dist/esm/index-620ac460.js +0 -7
  223. package/dist/esm/index-8acbae97.js +0 -49
  224. package/dist/esm/snk-attach.entry.js +0 -944
  225. package/dist/esm/snk-default-filter.entry.js +0 -73
  226. package/dist/esm/snk-filter-advanced-mode_3.entry.js +0 -93
  227. package/dist/esm/snk-filter-detail.entry.js +0 -194
  228. package/dist/esm/snk-filter-field-search_2.entry.js +0 -403
  229. package/dist/esm/snk-filter-modal-item.entry.js +0 -105
  230. package/dist/esm/snk-image-input.entry.js +0 -156
  231. package/dist/esm/snk-personalized-filter.entry.js +0 -354
  232. package/dist/esm/snk-simple-crud.entry.js +0 -861
  233. package/dist/sankhyablocks/p-0a4cdcde.entry.js +0 -1
  234. package/dist/sankhyablocks/p-0afc64df.entry.js +0 -1
  235. package/dist/sankhyablocks/p-10f27dc6.entry.js +0 -1
  236. package/dist/sankhyablocks/p-20f03230.entry.js +0 -1
  237. package/dist/sankhyablocks/p-2af8aca3.js +0 -1
  238. package/dist/sankhyablocks/p-3870748a.js +0 -28
  239. package/dist/sankhyablocks/p-3d294185.entry.js +0 -1
  240. package/dist/sankhyablocks/p-438a225f.entry.js +0 -1
  241. package/dist/sankhyablocks/p-4d04bc75.entry.js +0 -1
  242. package/dist/sankhyablocks/p-554c0e54.js +0 -1
  243. package/dist/sankhyablocks/p-57c184a2.entry.js +0 -1
  244. package/dist/sankhyablocks/p-68c1a093.js +0 -1
  245. package/dist/sankhyablocks/p-6a4b21dd.js +0 -1
  246. package/dist/sankhyablocks/p-6ae7543b.entry.js +0 -1
  247. package/dist/sankhyablocks/p-6e278003.js +0 -60
  248. package/dist/sankhyablocks/p-82bcb4cf.entry.js +0 -1
  249. package/dist/sankhyablocks/p-84345e7a.js +0 -1
  250. package/dist/sankhyablocks/p-95af0bb1.entry.js +0 -1
  251. package/dist/sankhyablocks/p-a905712a.entry.js +0 -1
  252. package/dist/sankhyablocks/p-aff2d081.entry.js +0 -1
  253. package/dist/sankhyablocks/p-b0a357b4.entry.js +0 -1
  254. package/dist/sankhyablocks/p-b568c1d4.js +0 -1
  255. package/dist/sankhyablocks/p-bab4cde4.entry.js +0 -1
  256. package/dist/sankhyablocks/p-bd3c1aaa.entry.js +0 -1
  257. package/dist/sankhyablocks/p-cc64239c.entry.js +0 -1
  258. package/dist/sankhyablocks/p-cd00a3d1.entry.js +0 -1
  259. package/dist/sankhyablocks/p-d9ec8c4b.entry.js +0 -1
  260. package/dist/sankhyablocks/p-dbdbb77a.entry.js +0 -1
  261. package/dist/sankhyablocks/p-e8df1dea.entry.js +0 -1
  262. package/dist/sankhyablocks/p-ef9343c3.entry.js +0 -1
  263. package/dist/sankhyablocks/p-f4184ce7.js +0 -1
@@ -0,0 +1,747 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-1894343a.js');
4
+ const core = require('@sankhyalabs/core');
5
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
6
+ const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
+ const constants = require('./constants-6d82e405.js');
8
+ const ConfigStorage = require('./ConfigStorage-4201dd3d.js');
9
+ const formConfigFetcher = require('./form-config-fetcher-f80dbc3b.js');
10
+ const taskbarElements = require('./taskbar-elements-80eddec8.js');
11
+
12
+ class SnkFormConfigManager {
13
+ constructor(configName, resourceID, onConfigChange, dataUnit) {
14
+ this._resourceID = resourceID;
15
+ this._configName = configName;
16
+ this._onConfigChange = onConfigChange;
17
+ this._dataUnit = dataUnit;
18
+ }
19
+ addFormLegacyConfig(legacyConfigName) {
20
+ if (this._configName) {
21
+ ConfigStorage.ConfigStorage.addFormLegacyConfig(this._configName, legacyConfigName);
22
+ }
23
+ }
24
+ async loadConfig() {
25
+ return new Promise(resolve => {
26
+ ConfigStorage.ConfigStorage.loadFormConfig(this._configName, this._resourceID)
27
+ .then((config) => {
28
+ config = this.buildFormMetadataUITabs(config);
29
+ this.setConfig(config);
30
+ resolve(config);
31
+ })
32
+ .catch((error) => {
33
+ console.warn(error);
34
+ });
35
+ });
36
+ }
37
+ getEmptyConfig() {
38
+ return this.buildFormMetadataUITabs({ fields: [], emptyConfig: true }, true);
39
+ }
40
+ saveConfig(config) {
41
+ const configToSave = core.ObjectUtils.copy(config);
42
+ return new Promise(accept => {
43
+ ConfigStorage.ConfigStorage.saveFormConfig(config, this._configName, this._resourceID)
44
+ .then((response) => {
45
+ this.setConfig(Object.assign(Object.assign({}, configToSave), response));
46
+ accept(Object.assign(Object.assign({}, configToSave), response));
47
+ });
48
+ });
49
+ }
50
+ saveCardState(cardId, cardConfig, propertyChanged) {
51
+ return new Promise(resolve => {
52
+ var _a;
53
+ const cardsState = ((_a = this._config) === null || _a === void 0 ? void 0 : _a.cardsState) || new Map;
54
+ const currentConfig = cardsState.get(cardId);
55
+ cardsState.set(cardId, propertyChanged === "fixed" ?
56
+ this.updateFixSequence(Object.assign(Object.assign({}, currentConfig), { fixed: cardConfig.fixed }), cardsState)
57
+ : Object.assign(Object.assign({}, currentConfig), { [propertyChanged]: cardConfig[propertyChanged] }));
58
+ ConfigStorage.ConfigStorage.saveCardState(cardsState, this._configName, this._resourceID)
59
+ .then(savedCardConfig => {
60
+ this._config = Object.assign(Object.assign({}, this._config), { cardsState });
61
+ resolve(savedCardConfig);
62
+ });
63
+ });
64
+ }
65
+ updateFixSequence(updatingCardConfig, cardsState) {
66
+ let maxSequence = -1;
67
+ Array.from(cardsState.values()).forEach(cardConfig => {
68
+ if (!cardConfig.fixed) {
69
+ delete updatingCardConfig.fixSequence;
70
+ }
71
+ if (cardConfig.fixSequence != undefined) {
72
+ maxSequence = Math.max(maxSequence, cardConfig.fixSequence);
73
+ }
74
+ });
75
+ if (updatingCardConfig.fixed) {
76
+ updatingCardConfig.fixSequence = maxSequence + 1;
77
+ }
78
+ else {
79
+ delete updatingCardConfig.fixSequence;
80
+ }
81
+ return updatingCardConfig;
82
+ }
83
+ hasConfig(config) {
84
+ var _a;
85
+ const currentConfig = config !== null && config !== void 0 ? config : this._config;
86
+ if (currentConfig && ((_a = currentConfig.fields) === null || _a === void 0 ? void 0 : _a.length)) {
87
+ return true;
88
+ }
89
+ return false;
90
+ }
91
+ getFieldsList(descriptionFilter, forceEmptyConfig = false) {
92
+ var _a, _b;
93
+ const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
94
+ const hasConfig = this.hasConfig();
95
+ if (hasConfig && !forceEmptyConfig) {
96
+ return fields.map(({ label, name, readOnly, visible, required, tab, group }) => {
97
+ var _a;
98
+ if (label == undefined) {
99
+ const currentField = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
100
+ if (!currentField)
101
+ return;
102
+ 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, group: group });
103
+ }
104
+ return { name, label, readOnly, visible, required, tab, group };
105
+ })
106
+ .filter(field => this.isFieldVisible(field, descriptionFilter));
107
+ }
108
+ if (!this._dataUnit || !((_b = this._dataUnit.metadata) === null || _b === void 0 ? void 0 : _b.fields)) {
109
+ return [];
110
+ }
111
+ const filteredFields = this._dataUnit.metadata.fields
112
+ .filter(field => this.isFieldVisible(field, descriptionFilter))
113
+ .map(({ label, name, readOnly, visible, required, properties }) => ({ label, name, readOnly, visible, required, tab: properties === null || properties === void 0 ? void 0 : properties.UITabName }));
114
+ return filteredFields;
115
+ }
116
+ isFieldVisible(field, descriptionFilter) {
117
+ if (field === undefined || field.visible === false) {
118
+ return false;
119
+ }
120
+ if (descriptionFilter == undefined) {
121
+ return true;
122
+ }
123
+ const normalizedText = core.StringUtils.replaceAccentuatedCharsLower((field.label || field.name).toLocaleLowerCase());
124
+ const normalizedFilter = core.StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
125
+ return normalizedText.includes(normalizedFilter);
126
+ }
127
+ getFormConfig(dataUnit, ignoreReadOnlyFormFields, forceEmptyConfig = false) {
128
+ let fields = this.getFieldsList(undefined, forceEmptyConfig);
129
+ if (ignoreReadOnlyFormFields) {
130
+ fields = fields.filter(field => {
131
+ if (dataUnit) {
132
+ const def = dataUnit.getField(field.name);
133
+ if (def && def.readOnly) {
134
+ return false;
135
+ }
136
+ }
137
+ return !field.readOnly;
138
+ });
139
+ }
140
+ return Object.assign(Object.assign({}, this._config), { fields });
141
+ }
142
+ setConfig(config) {
143
+ this.isLoaded = true;
144
+ const { cardsState, summary, defaultVars } = this._config || {};
145
+ this._config = Object.assign({}, config);
146
+ if (cardsState) {
147
+ this._config.cardsState = cardsState;
148
+ }
149
+ if (summary) {
150
+ this._config.summary = summary;
151
+ }
152
+ if (defaultVars) {
153
+ this._config.defaultVars = defaultVars;
154
+ }
155
+ if (this._onConfigChange) {
156
+ this._onConfigChange(Object.assign({}, this._config));
157
+ }
158
+ }
159
+ getConfig(dataUnit, ignoreReadOnlyFormFields) {
160
+ return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields);
161
+ }
162
+ getFormConfigFetcher() {
163
+ if (this._formConfigFetcher == undefined) {
164
+ this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
165
+ }
166
+ return this._formConfigFetcher;
167
+ }
168
+ async fetchUserAvailableConfigs() {
169
+ if (this._configName != undefined) {
170
+ //FIXME: Precisamos preparar o backend para retornar as configurações disponíveis para details;
171
+ return Promise.resolve(undefined);
172
+ }
173
+ return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, this._resourceID);
174
+ }
175
+ async fetchLegacyConfig() {
176
+ return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, this._resourceID);
177
+ }
178
+ async fetchDefaultConfig() {
179
+ return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
180
+ }
181
+ parseObjectList(object) {
182
+ if (!object) {
183
+ return [];
184
+ }
185
+ return Array.isArray(object) ? object : [object];
186
+ }
187
+ buildFormMetadataUITabs(config, forceEmptyConfig = false) {
188
+ var _a, _b, _c;
189
+ const hasConfig = this.hasConfig(config);
190
+ if (!forceEmptyConfig && (!this._dataUnit || hasConfig)) {
191
+ return config;
192
+ }
193
+ config = this.getFormConfig(this._dataUnit, false, true);
194
+ config.tabs = this.parseObjectList(config.tabs);
195
+ config.emptyConfig = false;
196
+ config.defaultConfiguration = true;
197
+ const fields = (_b = (_a = this._dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
198
+ for (const currentField of fields) {
199
+ const field = config.fields.find(field => field.name === currentField.name);
200
+ const uiTabName = (_c = currentField.properties) === null || _c === void 0 ? void 0 : _c.UITabName;
201
+ if (!uiTabName || uiTabName === constants.TAB_NAMES.main) {
202
+ continue;
203
+ }
204
+ const haveTab = config.tabs.some((tab) => tab.label === uiTabName);
205
+ if (!haveTab) {
206
+ config.tabs.push({
207
+ label: uiTabName,
208
+ name: uiTabName,
209
+ order: 0,
210
+ visible: true,
211
+ });
212
+ }
213
+ if (field) {
214
+ field.tab = uiTabName;
215
+ }
216
+ }
217
+ return config;
218
+ }
219
+ }
220
+
221
+ const snkDynaformGuidesViewCss = ".sc-snk-dynaform-guides-view-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);display:block;height:100%;min-width:0;overflow-x:hidden}snk-dynaform-form-view.sc-snk-dynaform-guides-view{width:100%}.snk-guides-viewer.sc-snk-dynaform-guides-view{position:relative;display:flex;flex-direction:column;height:100%;overflow:hidden;padding:0px}.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view{display:flex;row-gap:24px;flex-direction:column;flex:1;max-height:none;min-height:0;overflow:hidden;margin-bottom:var(--space--12, 12px)}.snk-guides-viewer__container.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view{max-height:300px;min-height:0;overflow-y:auto}.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view,.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view>snk-dynaform-detail-view.sc-snk-dynaform-guides-view{flex:1;min-height:0;overflow-y:auto}.snk-guides-viewer__header.sc-snk-dynaform-guides-view{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);padding:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-dynaform-guides-view{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-dynaform-guides-view{width:75%}.snk-guides-viewer__container.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden}.snk-guides-viewer__tabselector.sc-snk-dynaform-guides-view{width:100%;min-width:0;box-sizing:border-box;padding:0 var(--space--12, 12px);flex-shrink:0}";
222
+
223
+ const SnkDynaformGuidesViewer = class {
224
+ constructor(hostRef) {
225
+ index.registerInstance(this, hostRef);
226
+ this.snkMasterFormConfigChange = index.createEvent(this, "snkMasterFormConfigChange", 7);
227
+ this.formConfigVisibilityChanged = index.createEvent(this, "formConfigVisibilityChanged", 7);
228
+ this.exit = index.createEvent(this, "exit", 7);
229
+ this.actionClick = index.createEvent(this, "actionClick", 7);
230
+ this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
231
+ this.dataUnit = undefined;
232
+ this.dataState = undefined;
233
+ this.configName = undefined;
234
+ this.entityPath = undefined;
235
+ this.actionsList = undefined;
236
+ this.recordsValidator = undefined;
237
+ this.masterFormConfig = undefined;
238
+ this.selectedGuide = undefined;
239
+ this.taskbarManager = undefined;
240
+ this.messagesBuilder = undefined;
241
+ this.canEdit = true;
242
+ this.presentationMode = undefined;
243
+ this.resourceID = undefined;
244
+ this.detailTaskbarCustomContainerId = undefined;
245
+ this.formLegacyConfigName = undefined;
246
+ this.enableGridInsert = false;
247
+ this.ignoreReadOnlyFormFields = undefined;
248
+ this.getCustomTitle = undefined;
249
+ this.customGuidesConfig = [];
250
+ this._guides = [];
251
+ this._formEditorConfigManager = undefined;
252
+ this._formEditorDataUnit = undefined;
253
+ this._fieldToGetFocus = undefined;
254
+ this._customEditors = {};
255
+ this._customRenders = {};
256
+ this._fieldsProps = {};
257
+ this._mainForm = undefined;
258
+ this._mainFormName = undefined;
259
+ this._errorTabs = new Set();
260
+ this._hasToCreateFieldSearch = true;
261
+ }
262
+ observeDataUnit() {
263
+ this.loadGuides(true);
264
+ }
265
+ async observeFormConfigManager(value) {
266
+ var _a, _b;
267
+ const showFormConfig = !!value;
268
+ await ((_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show(showFormConfig ?
269
+ GUIDES_VIEWER_VIEW_MODE.CONFIG :
270
+ GUIDES_VIEWER_VIEW_MODE.GUIDES));
271
+ (_b = this.formConfigVisibilityChanged) === null || _b === void 0 ? void 0 : _b.emit(showFormConfig);
272
+ }
273
+ observeDataState(newValue, oldValue) {
274
+ var _a, _b, _c, _d, _e, _f;
275
+ const newRecordsIds = (_b = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.selectionInfo) === null || _a === void 0 ? void 0 : _a.recordIds) !== null && _b !== void 0 ? _b : (_c = newValue === null || newValue === void 0 ? void 0 : newValue.selectedRecord) === null || _c === void 0 ? void 0 : _c['__record__id__'];
276
+ const oldRecordsIds = (_e = (_d = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectionInfo) === null || _d === void 0 ? void 0 : _d.recordIds) !== null && _e !== void 0 ? _e : (_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectedRecord) === null || _f === void 0 ? void 0 : _f['__record__id__'];
277
+ if (!core.ObjectUtils.equals(newRecordsIds, oldRecordsIds)) {
278
+ this.loadGuides((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) != (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode));
279
+ }
280
+ }
281
+ observeMasterFormConfig() {
282
+ var _a;
283
+ this.loadGuides(this.noGuideSelected());
284
+ (_a = this.snkMasterFormConfigChange) === null || _a === void 0 ? void 0 : _a.emit(this.masterFormConfig);
285
+ }
286
+ /**
287
+ * Abre o configurador do formulário
288
+ * @param detail - Define se a configuração que está sendo carregada é
289
+ * referente a um form detail.
290
+ */
291
+ async showFormConfig(detail = false) {
292
+ var _a, _b;
293
+ const masterConfig = !detail || this._currentDetail == undefined;
294
+ this._formEditorConfigManager = masterConfig ? this._configManager : (_a = this._currentDetail) === null || _a === void 0 ? void 0 : _a.formConfigManager;
295
+ this._formEditorDataUnit = masterConfig ? this.dataUnit : (_b = this._currentDetail) === null || _b === void 0 ? void 0 : _b.dataUnit;
296
+ }
297
+ /**
298
+ * Registra um editor customizado para campos da grade e formulário
299
+ */
300
+ async addCustomEditor(fieldName, customEditor) {
301
+ this._customEditors = Object.assign(Object.assign({}, this._customEditors), { [fieldName]: customEditor });
302
+ }
303
+ /**
304
+ * Registra um render customizado para colunas da grid.
305
+ */
306
+ async addGridCustomRender(fieldName, customRender) {
307
+ this._customRenders = Object.assign(Object.assign({}, this._customRenders), { [fieldName]: customRender });
308
+ }
309
+ ;
310
+ /**
311
+ * Altera/adiciona uma propriedade nos metadados do campo.
312
+ */
313
+ async setFieldProp(fieldName, propName, value) {
314
+ const newFieldsProps = {
315
+ [fieldName]: Object.assign(Object.assign({}, this._fieldsProps[fieldName]), { [propName]: value })
316
+ };
317
+ this._fieldsProps = Object.assign(Object.assign({}, this._fieldsProps), newFieldsProps);
318
+ }
319
+ /**
320
+ * Atribui o foco para o componente.
321
+ */
322
+ async setFocus() {
323
+ var _a;
324
+ (_a = this._container) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
325
+ }
326
+ /**
327
+ * Recarrega os guias baseada nos metadados atuais.
328
+ */
329
+ async reloadGuides() {
330
+ this.loadGuides(false);
331
+ }
332
+ exitViewer() {
333
+ var _a, _b;
334
+ if (!this.enableGridInsert && ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isDirty())) {
335
+ this.dataUnit.cancelEdition({ after: () => { var _a; return (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit(); } });
336
+ }
337
+ else {
338
+ (_b = this.exit) === null || _b === void 0 ? void 0 : _b.emit();
339
+ }
340
+ }
341
+ onActionClick(evt) {
342
+ var _a;
343
+ if (evt.detail === taskbarElements.TaskbarElement.CONFIGURATOR) {
344
+ if (evt.target.dataset.taskbarOwner != "master") {
345
+ (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
346
+ evt.stopImmediatePropagation();
347
+ evt.stopPropagation();
348
+ }
349
+ }
350
+ }
351
+ onContentCardChanged(evt) {
352
+ if (!this._configManager || !this.dataUnit) {
353
+ return;
354
+ }
355
+ SnkDynaformGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
356
+ .then(() => { var _a; return this.masterFormConfig = (_a = this._configManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit); });
357
+ }
358
+ /**
359
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
360
+ * através de um pequeno modulo na estrutura da aplicação:
361
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
362
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-crud.msg.ts"
363
+ */
364
+ getMessage(key) {
365
+ var _a, _b, _c, _d, _e, _f;
366
+ if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition) {
367
+ const selectedRecords = (_c = (_b = this.dataUnit.getSelectionInfo()) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : [];
368
+ return (_d = this.messagesBuilder) === null || _d === void 0 ? void 0 : _d.getMessage("snkCrud.multipleEdition.editing", { COUNT: selectedRecords.length });
369
+ }
370
+ return (_e = this.messagesBuilder) === null || _e === void 0 ? void 0 : _e.getMessage(key, (_f = this.dataUnit) === null || _f === void 0 ? void 0 : _f.getSelectedRecord());
371
+ }
372
+ loadGuides(changeSelection) {
373
+ var _a;
374
+ if (!this.dataUnit || !this._configManager) {
375
+ return;
376
+ }
377
+ if (!this._configManager.isLoaded) {
378
+ return;
379
+ }
380
+ this._masterFormMetadata = form.buildFormMetadata(this.masterFormConfig, this.dataUnit, true, this.customGuidesConfig);
381
+ const allSheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
382
+ if (!allSheets) {
383
+ return;
384
+ }
385
+ const currentRecord = this.dataUnit.getSelectedRecord();
386
+ const disableDetails = this.hasToDisableDetails(currentRecord);
387
+ const guides = [];
388
+ let mainFormName;
389
+ const listSheetsValues = Array.from(allSheets.values());
390
+ listSheetsValues.forEach((sheet) => {
391
+ if ((sheet === null || sheet === void 0 ? void 0 : sheet.name) === constants.TAB_NAMES.main) {
392
+ mainFormName = sheet === null || sheet === void 0 ? void 0 : sheet.name;
393
+ return;
394
+ }
395
+ const item = { id: sheet === null || sheet === void 0 ? void 0 : sheet.name, label: sheet === null || sheet === void 0 ? void 0 : sheet.label };
396
+ if (this.isDetail(sheet === null || sheet === void 0 ? void 0 : sheet.name) && disableDetails) {
397
+ item.tooltip = this.getMessage("snkCrud.detail.tooltip.needSingleSelection");
398
+ item.disabled = true;
399
+ }
400
+ if (sheet.isCustom && sheet.ctxProps) {
401
+ Object.entries(sheet.ctxProps).forEach(([key, value]) => {
402
+ if (value !== undefined) {
403
+ item[key] = value;
404
+ }
405
+ });
406
+ }
407
+ if (!item.props) {
408
+ item.props = {};
409
+ }
410
+ item.props.isAdditional = sheet.name.includes("AD_");
411
+ item.props.isCustom = !!sheet.isCustom;
412
+ guides.push(item);
413
+ });
414
+ this._mainFormName = mainFormName;
415
+ this._guides = guides;
416
+ const currentStillExists = this.selectedGuide
417
+ && this._guides.some(g => g.id === this.selectedGuide.id);
418
+ if (changeSelection || !currentStillExists) {
419
+ this.selectedGuide = this._guides && this._guides.length > 0 ? this._guides[0] : undefined;
420
+ }
421
+ }
422
+ hasToDisableDetails(currentRecord) {
423
+ return !currentRecord
424
+ || !this.dataUnit
425
+ || this.dataUnit.isNewRecord(currentRecord.__record__id__)
426
+ || this.dataUnit.isMultipleEdition;
427
+ }
428
+ isDetail(formId) {
429
+ return form.FormMetadata.getDetailName(formId) != undefined;
430
+ }
431
+ buildTabItems() {
432
+ return this._guides.map((guide, index) => ({
433
+ tabKey: guide.id,
434
+ label: guide.label,
435
+ index,
436
+ disabled: guide.disabled,
437
+ rightIcon: this._errorTabs.has(guide.id) ? 'alert-circle-inverted' : undefined,
438
+ leftIcon: this.getTabLeftIcon(guide),
439
+ }));
440
+ }
441
+ getTabLeftIcon(guide) {
442
+ var _a, _b;
443
+ if (guide.icon) {
444
+ return guide.icon;
445
+ }
446
+ if ((_a = guide.props) === null || _a === void 0 ? void 0 : _a.isCustom) {
447
+ return 'puzzle-piece';
448
+ }
449
+ if ((_b = guide.props) === null || _b === void 0 ? void 0 : _b.isAdditional) {
450
+ return 'puzzle-piece';
451
+ }
452
+ return undefined;
453
+ }
454
+ isCustomGuide(guideId) {
455
+ var _a;
456
+ if (!guideId) {
457
+ return false;
458
+ }
459
+ return !!((_a = this.customGuidesConfig) === null || _a === void 0 ? void 0 : _a.some(g => g.id === guideId));
460
+ }
461
+ onTabChange(tab) {
462
+ const targetGuide = this._guides.find(g => g.id === tab.tabKey);
463
+ if (!targetGuide || targetGuide.disabled) {
464
+ return;
465
+ }
466
+ this.selectedGuide = targetGuide;
467
+ }
468
+ static updateContentCard(formName, cardConfig, propertyChanged, configManager) {
469
+ return configManager.saveCardState(formName, cardConfig, propertyChanged);
470
+ }
471
+ static buildMainForm(params) {
472
+ if (params.formMetadata == undefined || params.mainFormName == undefined) {
473
+ return undefined;
474
+ }
475
+ const mainSheet = params.formMetadata.getSheet(params.mainFormName);
476
+ if (mainSheet == undefined) {
477
+ return undefined;
478
+ }
479
+ return (index.h("snk-dynaform-form-view", { ref: (ref) => { var _a; return (_a = params.onMainFormRef) === null || _a === void 0 ? void 0 : _a.call(params, ref); }, label: mainSheet.label, name: params.mainFormName, fields: mainSheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, fieldToFocus: params.fieldToFocus, key: params.mainFormName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps, entityPath: params.entityPath, fieldSearch: params.fieldSearch }));
480
+ }
481
+ static buildFixedForms(params) {
482
+ var _a;
483
+ const cardsState = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.cardsState;
484
+ if (cardsState == undefined || params.formMetadata == undefined) {
485
+ return undefined;
486
+ }
487
+ const fixedEntries = Array.from(cardsState.entries())
488
+ .filter(([formName, cardConfig]) => (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed) && formName != params.selectedForm && formName != params.mainFormName)
489
+ .sort(([, cardConfigA], [, cardConfigB]) => {
490
+ const indexA = (cardConfigA === null || cardConfigA === void 0 ? void 0 : cardConfigA.fixSequence) || 0;
491
+ const indexB = (cardConfigB === null || cardConfigB === void 0 ? void 0 : cardConfigB.fixSequence) || 0;
492
+ return indexA - indexB;
493
+ });
494
+ if (fixedEntries.length === 0) {
495
+ return undefined;
496
+ }
497
+ return (index.h(index.Fragment, null, fixedEntries.map(([formName]) => {
498
+ const sheet = params.formMetadata.getSheet(formName);
499
+ if (sheet == undefined) {
500
+ return undefined;
501
+ }
502
+ return index.h("snk-dynaform-form-view", { label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps, entityPath: params.entityPath });
503
+ })));
504
+ }
505
+ getContent() {
506
+ var _a;
507
+ if (!this.selectedGuide) {
508
+ return undefined;
509
+ }
510
+ const guideId = this.selectedGuide.id;
511
+ if (this.isCustomGuide(guideId)) {
512
+ return index.h("slot", { name: guideId });
513
+ }
514
+ const childEntityName = form.FormMetadata.getDetailName(guideId);
515
+ if (childEntityName) {
516
+ return (index.h("snk-dynaform-detail-view", { ref: (ref) => {
517
+ if (ref)
518
+ this._currentDetail = ref;
519
+ }, dataUnitName: `${this.entityPath}/${childEntityName}`, entityName: childEntityName, label: this.selectedGuide.label, key: `detail_${guideId}`, canEdit: this.canEdit, resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders, presentationMode: this.presentationMode, messagesBuilder: this.messagesBuilder }));
520
+ }
521
+ if (guideId === this._mainFormName) {
522
+ return undefined;
523
+ }
524
+ const sheet = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getSheet(guideId);
525
+ if (!sheet) {
526
+ return undefined;
527
+ }
528
+ return (index.h("snk-dynaform-form-view", { name: guideId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch, entityPath: this.entityPath }));
529
+ }
530
+ clearFieldToFocusHandler() {
531
+ this._fieldToGetFocus = undefined;
532
+ }
533
+ getConfigViewMode() {
534
+ return constants.VIEW_MODE.GRID;
535
+ }
536
+ changeConfigViewMode(mode) {
537
+ var _a, _b;
538
+ if (this._currentDetail) {
539
+ (_b = (_a = this._currentDetail).changeViewMode) === null || _b === void 0 ? void 0 : _b.call(_a, mode);
540
+ }
541
+ }
542
+ openConfig(mode) {
543
+ var _a, _b, _c, _d;
544
+ (_b = (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close) === null || _b === void 0 ? void 0 : _b.call(_a);
545
+ if (this._currentDetail) {
546
+ if (mode === constants.VIEW_MODE.FORM) {
547
+ this.showFormConfig(true);
548
+ }
549
+ else {
550
+ (_d = (_c = this._currentDetail).configGrid) === null || _d === void 0 ? void 0 : _d.call(_c);
551
+ }
552
+ }
553
+ }
554
+ noGuideSelected() {
555
+ var _a;
556
+ return this.selectedGuide === undefined || constants.TAB_NAMES.main === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
557
+ }
558
+ addFormLegacyConfigName() {
559
+ var _a;
560
+ if (this.formLegacyConfigName) {
561
+ (_a = this._configManager) === null || _a === void 0 ? void 0 : _a.addFormLegacyConfig(this.formLegacyConfigName);
562
+ }
563
+ }
564
+ setMasterFormConfig(config) {
565
+ this.masterFormConfig = config;
566
+ }
567
+ componentWillLoad() {
568
+ var _a;
569
+ if (this.resourceID == undefined) {
570
+ throw new Error((_a = this.getMessage("snkCrud.errors.resourceIDNotProvided")) !== null && _a !== void 0 ? _a : "");
571
+ }
572
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
573
+ this.addFormLegacyConfigName();
574
+ this._configManager.loadConfig();
575
+ }
576
+ async dataUnitActionHandler(action) {
577
+ var _a, _b;
578
+ switch (action.type) {
579
+ case core.Action.EDITION_CANCELED:
580
+ case core.Action.DATA_SAVED:
581
+ if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition) {
582
+ this.exitViewer();
583
+ if (this.dataUnit) {
584
+ this.dataUnit.isMultipleEdition = false;
585
+ }
586
+ }
587
+ break;
588
+ case core.Action.FIELD_INVALIDATED:
589
+ const guideName = this.getGuideName((_b = action.payload) === null || _b === void 0 ? void 0 : _b.fieldName);
590
+ if (guideName) {
591
+ this._errorTabs = new Set([...this._errorTabs, guideName]);
592
+ }
593
+ break;
594
+ case core.Action.METADATA_LOADED:
595
+ case core.Action.MULTIPLE_EDITION_CHANGED:
596
+ this.loadGuides(this.noGuideSelected());
597
+ break;
598
+ }
599
+ }
600
+ getGuideName(fieldName) {
601
+ var _a, _b;
602
+ const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
603
+ if (!sheets) {
604
+ return "";
605
+ }
606
+ for (const sheet of sheets) {
607
+ const formFields = (_b = sheet[1]) === null || _b === void 0 ? void 0 : _b.fields;
608
+ if (!formFields)
609
+ continue;
610
+ for (const field of formFields) {
611
+ if (field.name === fieldName) {
612
+ return sheet[0];
613
+ }
614
+ }
615
+ }
616
+ return "";
617
+ }
618
+ getTitle() {
619
+ var _a, _b, _c;
620
+ return (_c = (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title")) !== null && _c !== void 0 ? _c : "";
621
+ }
622
+ getTitleTooltip() {
623
+ var _a;
624
+ if (!((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition))
625
+ return undefined;
626
+ return this.buildRecordIdsArray();
627
+ }
628
+ buildRecordIdsArray() {
629
+ var _a, _b, _c;
630
+ const selectedRecords = (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo()) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : [];
631
+ if (selectedRecords.length === 0) {
632
+ return "[]";
633
+ }
634
+ const labels = selectedRecords.map(record => { var _a; return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkCrud.title", record); });
635
+ return `[${labels.join(", ")}]`;
636
+ }
637
+ getFieldsSearch() {
638
+ var _a;
639
+ if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
640
+ this._hasToCreateFieldSearch = false;
641
+ const item = {
642
+ label: (_a = this.getMessage("snkSimpleCrud.findFields")) !== null && _a !== void 0 ? _a : "Busca de campos",
643
+ value: "findFields",
644
+ };
645
+ this._fieldSearch = utils.buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
646
+ }
647
+ return this._fieldSearch;
648
+ }
649
+ fieldsOptionLoader(argument) {
650
+ var _a, _b;
651
+ return Promise.resolve((_b = (_a = this._configManager) === null || _a === void 0 ? void 0 : _a.getFieldsList(argument).map(field => ({ value: field.name, label: field.label }))) !== null && _b !== void 0 ? _b : []);
652
+ }
653
+ onSelectField(option) {
654
+ var _a, _b, _c;
655
+ if (option == undefined) {
656
+ return;
657
+ }
658
+ this._fieldToGetFocus = option.value;
659
+ const fieldGuideName = this.getGuideName(option.value);
660
+ if (!fieldGuideName) {
661
+ return;
662
+ }
663
+ if (fieldGuideName === this._mainFormName) {
664
+ (_b = (_a = this._mainForm) === null || _a === void 0 ? void 0 : _a.showUp) === null || _b === void 0 ? void 0 : _b.call(_a);
665
+ return;
666
+ }
667
+ if (fieldGuideName !== ((_c = this.selectedGuide) === null || _c === void 0 ? void 0 : _c.id)) {
668
+ const targetGuide = this._guides.find(g => g.id === fieldGuideName);
669
+ if (targetGuide && !targetGuide.disabled) {
670
+ this.selectedGuide = targetGuide;
671
+ }
672
+ }
673
+ }
674
+ componentDidLoad() {
675
+ var _a;
676
+ (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.subscribe(this.dataUnitActionHandler.bind(this));
677
+ this.initKeyboardManager();
678
+ this.getFieldsSearch();
679
+ }
680
+ disconnectedCallback() {
681
+ var _a;
682
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
683
+ }
684
+ async initKeyboardManager() {
685
+ this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
686
+ if (this._keyboardManager) {
687
+ this._keyboardManager.bind(utils.SHORTCUT_SEARCH_FIELD, async () => {
688
+ var _a, _b;
689
+ if (!this._mainForm)
690
+ return;
691
+ await ((_b = (_a = this._mainForm).showSearchField) === null || _b === void 0 ? void 0 : _b.call(_a));
692
+ }, { description: this.getMessage("snkSimpleCrud.findFields"), element: this._element });
693
+ }
694
+ }
695
+ render() {
696
+ var _a, _b, _c;
697
+ if (this._formEditorConfigManager != undefined) {
698
+ return (index.h("snk-dynaform-form-config", { ref: (ref) => {
699
+ if (ref)
700
+ this._container = ref;
701
+ }, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = undefined }));
702
+ }
703
+ if (!this.dataUnit || !((_a = this._configManager) === null || _a === void 0 ? void 0 : _a.isLoaded)) {
704
+ return undefined;
705
+ }
706
+ const showTabs = this._guides && this._guides.length > 0;
707
+ const fixedFormsParams = {
708
+ formConfig: this.masterFormConfig,
709
+ formMetadata: this._masterFormMetadata,
710
+ selectedForm: (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id,
711
+ mainFormName: this._mainFormName,
712
+ dataUnit: this.dataUnit,
713
+ recordsValidator: this.recordsValidator,
714
+ fieldToFocus: this._fieldToGetFocus,
715
+ onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
716
+ propsCustomEditor: this._customEditors,
717
+ fieldsProps: this._fieldsProps,
718
+ entityPath: this.entityPath,
719
+ fieldSearch: this._fieldSearch,
720
+ onMainFormRef: (ref) => { this._mainForm = ref; }
721
+ };
722
+ return (index.h("section", { class: "snk-guides-viewer", ref: (ref) => {
723
+ if (ref)
724
+ this._container = ref;
725
+ }, tabindex: -1 }, this.getTitle() && (index.h("div", { class: "ez-row snk-guides-viewer__header" }, index.h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center", key: "header" }, index.h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge", title: this.getTitleTooltip() }, this.getTitle()))))), index.h("div", { class: "snk-guides-viewer__container" }, SnkDynaformGuidesViewer.buildMainForm(fixedFormsParams), showTabs &&
726
+ index.h("ez-tabselector", Object.assign({ class: "snk-guides-viewer__tabselector", tabs: this.buildTabItems(), selectedTab: (_c = this.selectedGuide) === null || _c === void 0 ? void 0 : _c.id, onEzChange: (evt) => this.onTabChange(evt.detail) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("tabselector")}` })), index.h("div", { class: "snk-guides-viewer__detail-container" }, SnkDynaformGuidesViewer.buildFixedForms(fixedFormsParams), this.getContent())), index.h("snk-configurator", { ref: (ref) => {
727
+ if (ref)
728
+ this._snkConfigurator = ref;
729
+ }, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
730
+ }
731
+ get _element() { return index.getElement(this); }
732
+ static get watchers() { return {
733
+ "dataUnit": ["observeDataUnit"],
734
+ "_formEditorConfigManager": ["observeFormConfigManager"],
735
+ "dataState": ["observeDataState"],
736
+ "masterFormConfig": ["observeMasterFormConfig"]
737
+ }; }
738
+ };
739
+ var GUIDES_VIEWER_VIEW_MODE;
740
+ (function (GUIDES_VIEWER_VIEW_MODE) {
741
+ GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["GUIDES"] = 0] = "GUIDES";
742
+ GUIDES_VIEWER_VIEW_MODE[GUIDES_VIEWER_VIEW_MODE["CONFIG"] = 1] = "CONFIG";
743
+ })(GUIDES_VIEWER_VIEW_MODE || (GUIDES_VIEWER_VIEW_MODE = {}));
744
+ SnkDynaformGuidesViewer.style = snkDynaformGuidesViewCss;
745
+
746
+ exports.SnkDynaformGuidesViewer = SnkDynaformGuidesViewer;
747
+ exports.SnkFormConfigManager = SnkFormConfigManager;