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

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 (265) 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-3a13fd34.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-c7e66f0d.js} +13 -4
  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-35f10e01.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-383c596e.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/data-unit/cache/PreloadManager.js +11 -1
  72. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +22 -4
  73. package/dist/components/dataunit-fetcher.js +11 -1
  74. package/dist/components/form-config-fetcher.js +22 -4
  75. package/dist/components/index.d.ts +12 -0
  76. package/dist/components/index.js +12 -0
  77. package/dist/components/snk-crud.js +1 -212
  78. package/dist/components/snk-dynaform-config-header.d.ts +11 -0
  79. package/dist/components/snk-dynaform-config-header.js +6 -0
  80. package/dist/components/snk-dynaform-config-header2.js +103 -0
  81. package/dist/components/snk-dynaform-configs-button.d.ts +11 -0
  82. package/dist/components/snk-dynaform-configs-button.js +6 -0
  83. package/dist/components/snk-dynaform-configs-button2.js +76 -0
  84. package/dist/components/snk-dynaform-detail-view.d.ts +11 -0
  85. package/dist/components/snk-dynaform-detail-view.js +6 -0
  86. package/dist/components/snk-dynaform-detail-view2.js +1835 -0
  87. package/dist/components/snk-dynaform-field-config.d.ts +11 -0
  88. package/dist/components/snk-dynaform-field-config.js +6 -0
  89. package/dist/components/snk-dynaform-field-config2.js +605 -0
  90. package/dist/components/snk-dynaform-field-item.d.ts +11 -0
  91. package/dist/components/snk-dynaform-field-item.js +6 -0
  92. package/dist/components/snk-dynaform-field-item2.js +96 -0
  93. package/dist/components/snk-dynaform-fields-layout.d.ts +11 -0
  94. package/dist/components/snk-dynaform-fields-layout.js +6 -0
  95. package/dist/components/snk-dynaform-fields-layout2.js +428 -0
  96. package/dist/components/snk-dynaform-fields-selector.d.ts +11 -0
  97. package/dist/components/snk-dynaform-fields-selector.js +6 -0
  98. package/dist/components/snk-dynaform-fields-selector2.js +104 -0
  99. package/dist/components/snk-dynaform-form-config.d.ts +11 -0
  100. package/dist/components/snk-dynaform-form-config.js +6 -0
  101. package/dist/components/snk-dynaform-form-config2.js +430 -0
  102. package/dist/components/snk-dynaform-form-view.d.ts +11 -0
  103. package/dist/components/snk-dynaform-form-view.js +6 -0
  104. package/dist/components/snk-dynaform-form-view2.js +270 -0
  105. package/dist/components/snk-dynaform-guides-configurator.d.ts +11 -0
  106. package/dist/components/snk-dynaform-guides-configurator.js +6 -0
  107. package/dist/components/snk-dynaform-guides-configurator2.js +173 -0
  108. package/dist/components/snk-dynaform-guides-view.d.ts +11 -0
  109. package/dist/components/snk-dynaform-guides-view.js +6 -0
  110. package/dist/components/snk-dynaform.d.ts +11 -0
  111. package/dist/components/snk-dynaform.js +1003 -0
  112. package/dist/components/snk-grid2.js +1 -1
  113. package/dist/components/taskbarUtils.js +224 -0
  114. package/dist/esm/{ConfigStorage-76872695.js → ConfigStorage-e834d1ea.js} +2 -2
  115. package/dist/esm/{DataFetcher-e60f8d53.js → DataFetcher-5ed0a377.js} +2830 -3
  116. package/dist/esm/FormConfigHelper-efc29480.js +328 -0
  117. package/dist/esm/{ISave-4929c071.js → ISave-5b46d691.js} +1 -1
  118. package/dist/esm/{PersonalizedFilterUtils-d2439a9a.js → PersonalizedFilterUtils-45b5803c.js} +49 -2
  119. package/dist/esm/{SnkFormConfigManager-83f6b22f.js → SnkFormConfigManager-bfd575c2.js} +2 -2
  120. package/dist/esm/{SnkMultiSelectionListDataSource-18abafb1.js → SnkMultiSelectionListDataSource-22b50dd6.js} +4 -4
  121. package/dist/esm/{auth-fetcher-1a31c1e4.js → auth-fetcher-5283045d.js} +1 -1
  122. package/dist/esm/{dataunit-fetcher-c176e002.js → dataunit-fetcher-2200fdd6.js} +12 -3
  123. package/dist/esm/{filter-type.enum-f6a8fe23.js → filter-type.enum-62b7fe88.js} +8 -1
  124. package/dist/esm/{form-config-fetcher-b44b2727.js → form-config-fetcher-db1bf140.js} +23 -5
  125. package/dist/esm/index-04f73a26.js +24 -36
  126. package/dist/esm/loader.js +1 -1
  127. package/dist/esm/pesquisa-grid_2.entry.js +4 -5
  128. package/dist/esm/sankhyablocks.js +1 -1
  129. package/dist/esm/snk-actions-button_9.entry.js +5 -6
  130. package/dist/esm/snk-application.entry.js +6 -7
  131. package/dist/esm/snk-attach_11.entry.js +2936 -0
  132. package/dist/esm/snk-crud.entry.js +6 -218
  133. package/dist/esm/snk-data-exporter.entry.js +5 -6
  134. package/dist/esm/{snk-data-unit-d8cfa950.js → snk-data-unit-e8bd4143.js} +2 -2
  135. package/dist/esm/snk-data-unit.entry.js +3 -4
  136. package/dist/esm/snk-detail-view.entry.js +7 -8
  137. package/dist/esm/snk-dynaform-config-header_5.entry.js +731 -0
  138. package/dist/esm/snk-dynaform-detail-view_2.entry.js +933 -0
  139. package/dist/esm/snk-dynaform-field-config_2.entry.js +322 -0
  140. package/dist/esm/snk-dynaform-guides-view-1f1455d6.js +744 -0
  141. package/dist/esm/snk-dynaform-guides-view.entry.js +15 -0
  142. package/dist/esm/snk-dynaform.entry.js +671 -0
  143. package/dist/esm/{snk-expression-group_2.entry.js → snk-expression-group_4.entry.js} +405 -4
  144. package/dist/esm/snk-filter-bar_4.entry.js +5 -8
  145. package/dist/esm/snk-form_2.entry.js +4 -5
  146. package/dist/esm/snk-grid.entry.js +7 -8
  147. package/dist/esm/{snk-guides-viewer-adf39ea2.js → snk-guides-viewer-95fefcaa.js} +1 -1
  148. package/dist/esm/snk-guides-viewer.entry.js +5 -6
  149. package/dist/esm/snk-layout-form-config.entry.js +4 -5
  150. package/dist/esm/snk-pesquisa.entry.js +4 -5
  151. package/dist/esm/taskbarUtils-682ca78c.js +225 -0
  152. package/dist/sankhyablocks/p-06b6c284.entry.js +1 -0
  153. package/dist/sankhyablocks/p-09e2255b.entry.js +1 -0
  154. package/dist/sankhyablocks/p-0dbd53d9.js +1 -0
  155. package/dist/sankhyablocks/{p-5c250661.js → p-1a04f537.js} +1 -1
  156. package/dist/sankhyablocks/{p-ab5e12fa.js → p-1cc4cf61.js} +1 -1
  157. package/dist/sankhyablocks/{p-f5ad0720.js → p-2040953e.js} +1 -1
  158. package/dist/sankhyablocks/p-22ddc1a5.entry.js +1 -0
  159. package/dist/sankhyablocks/p-24b059ee.entry.js +1 -0
  160. package/dist/sankhyablocks/p-2b581179.entry.js +1 -0
  161. package/dist/sankhyablocks/p-449dfe55.entry.js +1 -0
  162. package/dist/sankhyablocks/p-451b5bcc.entry.js +1 -0
  163. package/dist/sankhyablocks/p-46d7e2de.js +1 -0
  164. package/dist/sankhyablocks/{p-3c990841.js → p-51e853f2.js} +1 -1
  165. package/dist/sankhyablocks/p-51f1485c.entry.js +1 -0
  166. package/dist/sankhyablocks/p-58709cf9.js +1 -0
  167. package/dist/sankhyablocks/p-589016e2.entry.js +1 -0
  168. package/dist/sankhyablocks/p-5c6eede7.js +60 -0
  169. package/dist/sankhyablocks/p-5d02c032.js +1 -0
  170. package/dist/sankhyablocks/p-5d50f59a.entry.js +1 -0
  171. package/dist/sankhyablocks/p-670c43e3.entry.js +1 -0
  172. package/dist/sankhyablocks/{p-b1bb4cf1.js → p-70c2ee5c.js} +1 -1
  173. package/dist/sankhyablocks/p-77c26de0.js +1 -0
  174. package/dist/sankhyablocks/p-92c71225.entry.js +1 -0
  175. package/dist/sankhyablocks/p-9c89a76a.entry.js +1 -0
  176. package/dist/sankhyablocks/{p-4f7adf97.js → p-b1bf9564.js} +1 -1
  177. package/dist/sankhyablocks/p-c538bd6c.entry.js +1 -0
  178. package/dist/sankhyablocks/p-ccd61eb8.entry.js +1 -0
  179. package/dist/sankhyablocks/{p-3704bf1b.js → p-d5810110.js} +1 -1
  180. package/dist/sankhyablocks/p-d88278f8.js +28 -0
  181. package/dist/sankhyablocks/p-dc45e9e5.entry.js +1 -0
  182. package/dist/sankhyablocks/{p-8fe740b7.entry.js → p-dc83c70f.entry.js} +2 -2
  183. package/dist/sankhyablocks/p-e5362a5c.js +1 -0
  184. package/dist/sankhyablocks/p-edd44079.entry.js +1 -0
  185. package/dist/sankhyablocks/p-eff38390.entry.js +1 -0
  186. package/dist/sankhyablocks/p-ff28e5e4.entry.js +1 -0
  187. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  188. package/dist/types/components/snk-dynaform/interfaces/PropsCustomEditor.d.ts +4 -0
  189. package/dist/types/components/snk-dynaform/interfaces/PropsCustomRender.d.ts +4 -0
  190. package/dist/types/components/snk-dynaform/subcomponents/CardFormResizeObserver.d.ts +1 -0
  191. package/dist/types/components/snk-dynaform/subcomponents/GuideBuilder.d.ts +14 -0
  192. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.d.ts +158 -0
  193. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.d.ts +107 -0
  194. package/dist/types/components/snk-dynaform-form-config/FormConfigHelper.d.ts +36 -0
  195. package/dist/types/components/snk-dynaform-form-config/SnkFormConfigManager.d.ts +35 -0
  196. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.d.ts +23 -0
  197. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.d.ts +19 -0
  198. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.d.ts +56 -0
  199. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.d.ts +74 -0
  200. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.d.ts +21 -0
  201. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-form-config.d.ts +95 -0
  202. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.d.ts +35 -0
  203. package/dist/types/components.d.ts +2403 -1322
  204. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +1 -0
  205. package/package.json +5 -1
  206. package/react/components.d.ts +12 -0
  207. package/react/components.js +12 -0
  208. package/react/components.js.map +1 -1
  209. package/dist/cjs/SnkMessageBuilder-a9300ebe.js +0 -2833
  210. package/dist/cjs/default-filters-a09bf82b.js +0 -8
  211. package/dist/cjs/index-62760a9c.js +0 -49
  212. package/dist/cjs/index-8d94b7e0.js +0 -7
  213. package/dist/cjs/snk-attach.cjs.entry.js +0 -948
  214. package/dist/cjs/snk-default-filter.cjs.entry.js +0 -77
  215. package/dist/cjs/snk-filter-advanced-mode_3.cjs.entry.js +0 -99
  216. package/dist/cjs/snk-filter-detail.cjs.entry.js +0 -198
  217. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +0 -408
  218. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +0 -109
  219. package/dist/cjs/snk-image-input.cjs.entry.js +0 -160
  220. package/dist/cjs/snk-personalized-filter.cjs.entry.js +0 -358
  221. package/dist/cjs/snk-simple-crud.cjs.entry.js +0 -865
  222. package/dist/esm/SnkMessageBuilder-1eb7a1af.js +0 -2831
  223. package/dist/esm/default-filters-50105e43.js +0 -8
  224. package/dist/esm/index-620ac460.js +0 -7
  225. package/dist/esm/index-8acbae97.js +0 -49
  226. package/dist/esm/snk-attach.entry.js +0 -944
  227. package/dist/esm/snk-default-filter.entry.js +0 -73
  228. package/dist/esm/snk-filter-advanced-mode_3.entry.js +0 -93
  229. package/dist/esm/snk-filter-detail.entry.js +0 -194
  230. package/dist/esm/snk-filter-field-search_2.entry.js +0 -403
  231. package/dist/esm/snk-filter-modal-item.entry.js +0 -105
  232. package/dist/esm/snk-image-input.entry.js +0 -156
  233. package/dist/esm/snk-personalized-filter.entry.js +0 -354
  234. package/dist/esm/snk-simple-crud.entry.js +0 -861
  235. package/dist/sankhyablocks/p-0a4cdcde.entry.js +0 -1
  236. package/dist/sankhyablocks/p-0afc64df.entry.js +0 -1
  237. package/dist/sankhyablocks/p-10f27dc6.entry.js +0 -1
  238. package/dist/sankhyablocks/p-20f03230.entry.js +0 -1
  239. package/dist/sankhyablocks/p-2af8aca3.js +0 -1
  240. package/dist/sankhyablocks/p-3870748a.js +0 -28
  241. package/dist/sankhyablocks/p-3d294185.entry.js +0 -1
  242. package/dist/sankhyablocks/p-438a225f.entry.js +0 -1
  243. package/dist/sankhyablocks/p-4d04bc75.entry.js +0 -1
  244. package/dist/sankhyablocks/p-554c0e54.js +0 -1
  245. package/dist/sankhyablocks/p-57c184a2.entry.js +0 -1
  246. package/dist/sankhyablocks/p-68c1a093.js +0 -1
  247. package/dist/sankhyablocks/p-6a4b21dd.js +0 -1
  248. package/dist/sankhyablocks/p-6ae7543b.entry.js +0 -1
  249. package/dist/sankhyablocks/p-6e278003.js +0 -60
  250. package/dist/sankhyablocks/p-82bcb4cf.entry.js +0 -1
  251. package/dist/sankhyablocks/p-84345e7a.js +0 -1
  252. package/dist/sankhyablocks/p-95af0bb1.entry.js +0 -1
  253. package/dist/sankhyablocks/p-a905712a.entry.js +0 -1
  254. package/dist/sankhyablocks/p-aff2d081.entry.js +0 -1
  255. package/dist/sankhyablocks/p-b0a357b4.entry.js +0 -1
  256. package/dist/sankhyablocks/p-b568c1d4.js +0 -1
  257. package/dist/sankhyablocks/p-bab4cde4.entry.js +0 -1
  258. package/dist/sankhyablocks/p-bd3c1aaa.entry.js +0 -1
  259. package/dist/sankhyablocks/p-cc64239c.entry.js +0 -1
  260. package/dist/sankhyablocks/p-cd00a3d1.entry.js +0 -1
  261. package/dist/sankhyablocks/p-d9ec8c4b.entry.js +0 -1
  262. package/dist/sankhyablocks/p-dbdbb77a.entry.js +0 -1
  263. package/dist/sankhyablocks/p-e8df1dea.entry.js +0 -1
  264. package/dist/sankhyablocks/p-ef9343c3.entry.js +0 -1
  265. package/dist/sankhyablocks/p-f4184ce7.js +0 -1
@@ -0,0 +1,992 @@
1
+ import { Action as DUAction, KeyboardManager, StringUtils } from '@sankhyalabs/core';
2
+ import { Host, forceUpdate, h } from '@stencil/core';
3
+ import { SnkFormConfigManager } from '../../../snk-dynaform-form-config/SnkFormConfigManager';
4
+ import { FormMetadata, buildFormMetadata } from "@sankhyalabs/ezui/dist/collection/utils/form";
5
+ import { PresentationMode } from '../../../../lib';
6
+ import { TaskbarElement } from '../../../snk-taskbar/elements/taskbar-elements';
7
+ import { VIEW_MODE } from '../../../../lib/utils/constants';
8
+ import { SnkDynaformGuidesViewer } from '../snk-dynaform-guides-view/snk-dynaform-guides-view';
9
+ import { SnkMessageBuilder } from '../../../../lib/message/SnkMessageBuilder';
10
+ import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
11
+ import SimpleTaskbarProcessor from '../../../snk-taskbar/processor/simple-taskbar-processor';
12
+ import { DEFAULT_TASKBAR_BUTTONS, getTopTaskBarId } from '../../../snk-crud/utils/taskbarUtils';
13
+ export class SnkDynaformDetailView {
14
+ constructor() {
15
+ this._taskbarProcessor = new SimpleTaskbarProcessor(DEFAULT_TASKBAR_BUTTONS);
16
+ this._currentView = 0;
17
+ this.attachmentRegisterKey = undefined;
18
+ this._fieldToGetFocus = undefined;
19
+ this._hasToCreateFieldSearch = true;
20
+ this._selectedSheet = undefined;
21
+ this._internalErrorTabs = new Set();
22
+ this._selectedRecordPKDisplay = undefined;
23
+ this.formConfigManager = undefined;
24
+ this.dataUnitName = undefined;
25
+ this.resourceID = undefined;
26
+ this.entityName = undefined;
27
+ this.label = undefined;
28
+ this.dataUnit = undefined;
29
+ this.selectedForm = undefined;
30
+ this.dataState = undefined;
31
+ this.messagesBuilder = undefined;
32
+ this.canEdit = true;
33
+ this.taskbarCustomContainerId = undefined;
34
+ this.customEditors = undefined;
35
+ this.customRenders = undefined;
36
+ this.presentationMode = PresentationMode.SECONDARY;
37
+ }
38
+ observeDataUnit(newDataUnit, oldDataUnit) {
39
+ newDataUnit === null || newDataUnit === void 0 ? void 0 : newDataUnit.subscribe(this.dataUnitActionHandler.bind(this));
40
+ oldDataUnit === null || oldDataUnit === void 0 ? void 0 : oldDataUnit.unsubscribe(this.dataUnitActionHandler);
41
+ }
42
+ observerDataState(newValue, oldValue) {
43
+ const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
44
+ const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
45
+ if (openInsertion || closeInsertion) {
46
+ this.loadMetadata();
47
+ }
48
+ if (this._formMetadata == undefined) {
49
+ return;
50
+ }
51
+ if (!this.selectedSheetIsDetail()) {
52
+ if (openInsertion) {
53
+ setTimeout(() => {
54
+ this.changeViewMode(VIEW_MODE.FORM);
55
+ }, 0);
56
+ }
57
+ if (closeInsertion) {
58
+ this.changeViewMode(VIEW_MODE.GRID);
59
+ }
60
+ }
61
+ }
62
+ /**
63
+ * Muda o modo de visualização do componente entre VIEW_MODE.GRID e VIEW_MODE.FORM
64
+ * @param mode - Novo modo que o componente deve ser apresentado.
65
+ */
66
+ async changeViewMode(mode) {
67
+ if (!this._viewStack) {
68
+ return;
69
+ }
70
+ this._viewStack.show(mode);
71
+ this._currentView = mode;
72
+ }
73
+ /**
74
+ * Abre o configurador de grid.
75
+ */
76
+ async configGrid() {
77
+ if (this._snkGrid) {
78
+ this._snkGrid.showConfig();
79
+ }
80
+ }
81
+ async showUp() {
82
+ if (this._snkFormView) {
83
+ this._snkFormView.showUp();
84
+ }
85
+ if (this._snkGrid) {
86
+ this._snkGrid.scrollIntoView({ behavior: "smooth", block: "start" });
87
+ }
88
+ }
89
+ /**
90
+ * Registra um editor customizado para campos da grade e formulário.
91
+ */
92
+ async addCustomEditor(fieldName, customEditor) {
93
+ var _a, _b;
94
+ const detailContext = this.normalizeDataUnitName();
95
+ (_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.addCustomEditor(fieldName, customEditor, detailContext);
96
+ (_b = this._snkFormView) === null || _b === void 0 ? void 0 : _b.addCustomEditor(fieldName, customEditor, detailContext);
97
+ }
98
+ async observerPropsCustomEditor(newValue) {
99
+ for (const fieldName in newValue) {
100
+ await this.addCustomEditor(fieldName, newValue[fieldName]);
101
+ }
102
+ }
103
+ /**
104
+ * Registra um render customizado para colunas da grid.
105
+ */
106
+ async addGridCustomRender(fieldName, customRender) {
107
+ var _a;
108
+ const detailContext = this.normalizeDataUnitName();
109
+ await ((_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.addGridCustomRender(fieldName, customRender, detailContext));
110
+ }
111
+ onContentCardChanged(evt) {
112
+ SnkDynaformGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this.formConfigManager).then(() => forceUpdate(this));
113
+ evt.stopPropagation();
114
+ }
115
+ async observeCustomRenders(newValue) {
116
+ for (const field in newValue) {
117
+ const customRender = newValue[field];
118
+ await this.addGridCustomRender(field, customRender);
119
+ }
120
+ }
121
+ loadMetadata() {
122
+ if (!this.dataUnit || !this.formConfigManager) {
123
+ return;
124
+ }
125
+ if (!this.formConfigManager.isLoaded) {
126
+ return;
127
+ }
128
+ const formConfig = this.formConfigManager.getConfig(this.dataUnit);
129
+ this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
130
+ this.initSelectedSheet();
131
+ }
132
+ initSelectedSheet() {
133
+ if (!this._formMetadata) {
134
+ this._selectedSheet = undefined;
135
+ return;
136
+ }
137
+ const sheets = this._formMetadata.getAllSheets();
138
+ if (!sheets || sheets.size === 0) {
139
+ this._selectedSheet = undefined;
140
+ return;
141
+ }
142
+ // Mantém a aba atual caso ela ainda exista e não seja a área principal.
143
+ if (this._selectedSheet && this._selectedSheet.name !== SnkDynaformDetailView.MAIN_TAB) {
144
+ const current = sheets.get(this._selectedSheet.name);
145
+ if (current) {
146
+ this._selectedSheet = current;
147
+ return;
148
+ }
149
+ }
150
+ // Caso contrário, seleciona o primeiro sheet que não seja a área principal (primeira aba).
151
+ this._selectedSheet = this.getFirstNonMainSheet(sheets);
152
+ }
153
+ getFirstNonMainSheet(sheets) {
154
+ for (const [name, sheet] of sheets) {
155
+ if (name !== SnkDynaformDetailView.MAIN_TAB) {
156
+ return sheet;
157
+ }
158
+ }
159
+ return undefined;
160
+ }
161
+ dataUnitReadyHandler(evt) {
162
+ this.dataUnit = evt.detail;
163
+ this.loadMetadata();
164
+ }
165
+ getFormFields() {
166
+ var _a, _b, _c;
167
+ const mainSheet = (_b = (_a = this._formMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets()) === null || _b === void 0 ? void 0 : _b.get(SnkDynaformDetailView.MAIN_TAB);
168
+ return (_c = mainSheet === null || mainSheet === void 0 ? void 0 : mainSheet.fields) !== null && _c !== void 0 ? _c : [];
169
+ }
170
+ hasNonMainSheets() {
171
+ if (!this._formMetadata) {
172
+ return false;
173
+ }
174
+ for (const name of this._formMetadata.getAllSheets().keys()) {
175
+ if (name !== SnkDynaformDetailView.MAIN_TAB) {
176
+ return true;
177
+ }
178
+ }
179
+ return false;
180
+ }
181
+ selectedSheetIsDetail() {
182
+ return !!this._selectedSheet && FormMetadata.getDetailName(this._selectedSheet.name) != undefined;
183
+ }
184
+ isSheetDisabled(sheet) {
185
+ var _a;
186
+ if (FormMetadata.getDetailName(sheet.name) == undefined) {
187
+ return false;
188
+ }
189
+ const currentRecord = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord();
190
+ if (!currentRecord || !this.dataUnit) {
191
+ return true;
192
+ }
193
+ return this.dataUnit.isNewRecord(currentRecord.__record__id__) || this.dataUnit.isMultipleEdition;
194
+ }
195
+ buildInternalTabItems() {
196
+ if (!this._formMetadata) {
197
+ return [];
198
+ }
199
+ const sheets = Array.from(this._formMetadata.getAllSheets().values());
200
+ const nonMainSheets = sheets.filter((sheet) => sheet.name !== SnkDynaformDetailView.MAIN_TAB);
201
+ return nonMainSheets.map((sheet, index) => ({
202
+ tabKey: sheet.name,
203
+ label: sheet.label,
204
+ index,
205
+ disabled: this.isSheetDisabled(sheet),
206
+ rightIcon: this._internalErrorTabs.has(sheet.name) ? 'alert-circle-inverted' : undefined,
207
+ }));
208
+ }
209
+ onInternalTabChange(tab) {
210
+ var _a, _b;
211
+ // A área principal (__main) é sempre visível e não é uma aba selecionável.
212
+ if (tab.tabKey === SnkDynaformDetailView.MAIN_TAB) {
213
+ return;
214
+ }
215
+ const matchedSheet = (_b = (_a = this._formMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets()) === null || _b === void 0 ? void 0 : _b.get(tab.tabKey);
216
+ if (!matchedSheet || this.isSheetDisabled(matchedSheet)) {
217
+ return;
218
+ }
219
+ this._selectedSheet = matchedSheet;
220
+ }
221
+ executeActionHandler(evt) {
222
+ var _a;
223
+ if (evt.detail === TaskbarElement.GRID_MODE) {
224
+ this.changeViewMode(VIEW_MODE.GRID);
225
+ evt.stopPropagation();
226
+ }
227
+ if (evt.detail === TaskbarElement.UPDATE_MULTIPLE && this.dataUnit) {
228
+ this.dataUnit.isMultipleEdition = true;
229
+ this.changeViewMode(VIEW_MODE.FORM);
230
+ evt.stopPropagation();
231
+ }
232
+ if (evt.detail === TaskbarElement.FORM_MODE || evt.detail === TaskbarElement.UPDATE || evt.detail === TaskbarElement.INSERT) {
233
+ this.changeViewMode(VIEW_MODE.FORM);
234
+ evt.stopPropagation();
235
+ }
236
+ if (evt.detail === TaskbarElement.ATTACH) {
237
+ (_a = this._snkAttach) === null || _a === void 0 ? void 0 : _a.open();
238
+ evt.stopPropagation();
239
+ }
240
+ }
241
+ async getAttachmentRegisterKey() {
242
+ if (!this._snkDataUnit) {
243
+ return;
244
+ }
245
+ const recordCriteria = await this._snkDataUnit.getSelectedRecordsIDsInfo();
246
+ const joinedPrimaryKeys = recordCriteria.map(({ value }) => value).join('_');
247
+ return joinedPrimaryKeys;
248
+ }
249
+ async handleDataStateChange({ detail: dataState }) {
250
+ var _a;
251
+ this.dataState = dataState;
252
+ if (dataState.selectedRecord !== undefined && this._snkDataUnit) {
253
+ this.attachmentRegisterKey = (_a = await this.getAttachmentRegisterKey()) !== null && _a !== void 0 ? _a : undefined;
254
+ }
255
+ this._selectedRecordPKDisplay = this.buildSelectedRecordPKDisplay();
256
+ }
257
+ buildSelectedRecordPKDisplay() {
258
+ var _a, _b, _c, _d, _e, _f, _g;
259
+ if (!this.dataUnit) {
260
+ return undefined;
261
+ }
262
+ if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) {
263
+ const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkCrud.newRecord");
264
+ return message ? { message } : undefined;
265
+ }
266
+ const selectedRecord = this.dataUnit.getSelectedRecord();
267
+ if (!selectedRecord) {
268
+ return undefined;
269
+ }
270
+ const items = [];
271
+ const fields = (_d = (_c = this.dataUnit.metadata) === null || _c === void 0 ? void 0 : _c.fields) !== null && _d !== void 0 ? _d : [];
272
+ for (const field of fields) {
273
+ if (((_e = field.properties) === null || _e === void 0 ? void 0 : _e.isPrimaryKey) !== "true") {
274
+ continue;
275
+ }
276
+ const rawValue = selectedRecord[field.name];
277
+ const value = (_f = rawValue === null || rawValue === void 0 ? void 0 : rawValue.value) !== null && _f !== void 0 ? _f : rawValue;
278
+ if (value === undefined || value === null || value === "") {
279
+ continue;
280
+ }
281
+ items.push({ label: (_g = field.label) !== null && _g !== void 0 ? _g : field.name, value: String(value) });
282
+ }
283
+ return items.length ? { items } : undefined;
284
+ }
285
+ renderSelectedRecordHeader() {
286
+ var _a;
287
+ if (!this.label && !this._selectedRecordPKDisplay) {
288
+ return undefined;
289
+ }
290
+ const display = this._selectedRecordPKDisplay;
291
+ if (!display) {
292
+ return undefined;
293
+ }
294
+ if (display.message) {
295
+ return (h("div", { class: "selected-record-header selected-record-header--message" }, h("span", { class: "selected-record-header__message" }, display.message)));
296
+ }
297
+ if (!((_a = display.items) === null || _a === void 0 ? void 0 : _a.length)) {
298
+ return undefined;
299
+ }
300
+ return (h("div", { class: "selected-record-header", role: "group" }, display.items.map((item, index) => [
301
+ index > 0 && h("span", { class: "selected-record-header__separator", "aria-hidden": "true" }),
302
+ h("div", { class: "selected-record-header__chip" }, h("span", { class: "selected-record-header__label" }, item.label, ":"), h("span", { class: "selected-record-header__value" }, item.value))
303
+ ])));
304
+ }
305
+ componentWillLoad() {
306
+ var _a;
307
+ this._configName = `dynaform.${this.entityName}`;
308
+ this.formConfigManager = new SnkFormConfigManager(this._configName, (_a = this.resourceID) !== null && _a !== void 0 ? _a : '', () => this.loadMetadata(), this.dataUnit);
309
+ this.formConfigManager.loadConfig();
310
+ if (this.messagesBuilder == undefined) {
311
+ this.messagesBuilder = new SnkMessageBuilder(this.entityName);
312
+ }
313
+ }
314
+ componentWillRender() {
315
+ this.initializeTaskbarProcessor();
316
+ }
317
+ initializeTaskbarProcessor() {
318
+ if (!this.dataState) {
319
+ return;
320
+ }
321
+ const detailTaskbarManager = this.buildDetailTaskbarManager();
322
+ const topTaskbarId = getTopTaskBarId(this.dataState, this.presentationMode);
323
+ this._taskbarProcessor.process(topTaskbarId, detailTaskbarManager, this.dataState, [], []);
324
+ }
325
+ buildDetailTaskbarManager() {
326
+ const EDITION_MODE_BUTTONS = [
327
+ TaskbarElement.CANCEL,
328
+ TaskbarElement.SAVE,
329
+ ];
330
+ const currentView = this._currentView;
331
+ return {
332
+ getButtons: (taskbarID, dataState, defaultButtons) => {
333
+ var _a, _b, _c;
334
+ if (!taskbarID) {
335
+ return [];
336
+ }
337
+ const isInEditionMode = (dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty);
338
+ if (isInEditionMode) {
339
+ return EDITION_MODE_BUTTONS;
340
+ }
341
+ let buttons = [...defaultButtons];
342
+ if (currentView === VIEW_MODE.FORM) {
343
+ const indexFormMode = buttons.indexOf(TaskbarElement.FORM_MODE);
344
+ if (indexFormMode > -1) {
345
+ buttons = [
346
+ ...buttons.slice(0, indexFormMode),
347
+ TaskbarElement.GRID_MODE,
348
+ ...buttons.slice(indexFormMode + 1),
349
+ ];
350
+ }
351
+ }
352
+ if (((_c = (_b = (_a = dataState === null || dataState === void 0 ? void 0 : dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 1) {
353
+ const indexUpdate = buttons.indexOf(TaskbarElement.UPDATE);
354
+ if (indexUpdate > -1) {
355
+ buttons = [
356
+ ...buttons.slice(0, indexUpdate),
357
+ TaskbarElement.UPDATE_MULTIPLE,
358
+ ...buttons.slice(indexUpdate + 1),
359
+ ];
360
+ }
361
+ }
362
+ return buttons;
363
+ },
364
+ isEnabled: (_, dataState, buttonName, originalValue) => {
365
+ if (!dataState) {
366
+ return originalValue;
367
+ }
368
+ const hasSelectedRecord = dataState.selectedRecord !== undefined;
369
+ const buttonsRequiringSelection = [
370
+ TaskbarElement.UPDATE,
371
+ TaskbarElement.REMOVE,
372
+ TaskbarElement.ATTACH,
373
+ TaskbarElement.CLONE,
374
+ ];
375
+ if (!hasSelectedRecord && buttonsRequiringSelection.includes(buttonName)) {
376
+ return false;
377
+ }
378
+ if (buttonName === TaskbarElement.PREVIOUS && !dataState.hasPrevious) {
379
+ return false;
380
+ }
381
+ if (buttonName === TaskbarElement.NEXT && !dataState.hasNext) {
382
+ return false;
383
+ }
384
+ if (buttonName === TaskbarElement.INSERT && dataState.insertionMode) {
385
+ return false;
386
+ }
387
+ return originalValue;
388
+ },
389
+ };
390
+ }
391
+ async componentDidLoad() {
392
+ if (this.customEditors) {
393
+ await this.observerPropsCustomEditor(this.customEditors);
394
+ }
395
+ if (this.customRenders) {
396
+ await this.observeCustomRenders(this.customRenders);
397
+ }
398
+ this.initKeyboardManager();
399
+ }
400
+ disconnectedCallback() {
401
+ var _a;
402
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
403
+ }
404
+ async dataUnitActionHandler(action) {
405
+ var _a;
406
+ if (action.type === DUAction.FIELD_INVALIDATED) {
407
+ const sheetName = this.findSheetOfField((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fieldName);
408
+ if (sheetName) {
409
+ this._internalErrorTabs = new Set([...this._internalErrorTabs, sheetName]);
410
+ }
411
+ }
412
+ }
413
+ findSheetOfField(fieldName) {
414
+ var _a;
415
+ if (!fieldName || !this._formMetadata) {
416
+ return undefined;
417
+ }
418
+ const sheets = this._formMetadata.getAllSheets();
419
+ for (const [sheetName, sheet] of sheets) {
420
+ if ((_a = sheet.fields) === null || _a === void 0 ? void 0 : _a.some((f) => f.name === fieldName)) {
421
+ return sheetName;
422
+ }
423
+ }
424
+ return undefined;
425
+ }
426
+ normalizeDataUnitName() {
427
+ var _a, _b;
428
+ return (_b = (_a = this.dataUnitName) === null || _a === void 0 ? void 0 : _a.replace(/\//g, '>')) !== null && _b !== void 0 ? _b : '';
429
+ }
430
+ getSettingsListForm() {
431
+ var _a, _b;
432
+ const hardList = [{
433
+ value: StringUtils.generateUUID(),
434
+ label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "",
435
+ disableCloseOnSelect: true,
436
+ eagerInitialize: true,
437
+ itemBuilder: (_, item) => this.getFieldsSearch(item)
438
+ }];
439
+ return hardList;
440
+ }
441
+ getFieldsSearch(item) {
442
+ var _a;
443
+ if (this._fieldSearch === undefined || this._hasToCreateFieldSearch) {
444
+ this._hasToCreateFieldSearch = false;
445
+ this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
446
+ }
447
+ return (_a = this._fieldSearch) !== null && _a !== void 0 ? _a : document.createElement('div');
448
+ }
449
+ fieldsOptionLoader(argument) {
450
+ const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
451
+ const allFields = this.getFormFields().map(field => { var _a; return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field.name); });
452
+ const filteredFields = allFields.filter(field => {
453
+ var _a, _b;
454
+ if (!field) {
455
+ return;
456
+ }
457
+ return ((_a = field.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm)) ||
458
+ ((_b = field.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTerm));
459
+ });
460
+ const options = filteredFields.map((field) => {
461
+ if (!field) {
462
+ return;
463
+ }
464
+ return ({ value: field.name, label: field.label });
465
+ });
466
+ return Promise.resolve(options);
467
+ }
468
+ onSelectField(option) {
469
+ if (option == undefined) {
470
+ return;
471
+ }
472
+ this._fieldToGetFocus = option.value;
473
+ }
474
+ clearFieldToFocusHandler() {
475
+ this._fieldToGetFocus = undefined;
476
+ }
477
+ getColumnSearch(item) {
478
+ var _a;
479
+ if (this._columnSearch !== undefined) {
480
+ return this._columnSearch;
481
+ }
482
+ this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
483
+ var _a;
484
+ (_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.filterColumns(argument).then((columns) => {
485
+ accept(columns
486
+ .filter(column => !column.hidden)
487
+ .map(column => ({ label: column.label, value: column.name })));
488
+ });
489
+ }), (option) => {
490
+ var _a;
491
+ if (option != undefined) {
492
+ (_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.locateColumn(option.value);
493
+ }
494
+ });
495
+ return (_a = this._columnSearch) !== null && _a !== void 0 ? _a : document.createElement('div');
496
+ }
497
+ buildTaskbarCustomActionsList() {
498
+ return [this.buildSearchColumnTaskbarAction()];
499
+ }
500
+ buildSearchColumnTaskbarAction() {
501
+ var _a, _b;
502
+ return {
503
+ value: StringUtils.generateUUID(),
504
+ label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage('snkGrid.findColumn', {})) !== null && _b !== void 0 ? _b : "",
505
+ disableCloseOnSelect: true,
506
+ eagerInitialize: true,
507
+ itemBuilder: (_, item) => { var _a; return (_a = this.getColumnSearch(item)) !== null && _a !== void 0 ? _a : document.createElement('div'); },
508
+ };
509
+ }
510
+ async initKeyboardManager() {
511
+ var _a;
512
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
513
+ this._keyboardManager.bind(SHORTCUT_SEARCH_FIELD, async () => {
514
+ var _a;
515
+ await ((_a = this._snkFormView) === null || _a === void 0 ? void 0 : _a.showSearchField());
516
+ }, { description: (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findFields"), element: this._element });
517
+ }
518
+ renderTabSelector() {
519
+ if (!this.hasNonMainSheets()) {
520
+ return undefined;
521
+ }
522
+ const selectedKey = this._selectedSheet && this._selectedSheet.name !== SnkDynaformDetailView.MAIN_TAB
523
+ ? this._selectedSheet.name
524
+ : undefined;
525
+ return (h("ez-tabselector", { class: "ez-tabselector-internal", tabs: this.buildInternalTabItems(), selectedTab: selectedKey, onEzChange: (evt) => this.onInternalTabChange(evt.detail) }));
526
+ }
527
+ /**
528
+ * Renderiza o conteúdo da aba selecionada, seguindo as mesmas regras do
529
+ * formulário master (snk-dynaform-guides-view.getContent):
530
+ * - Sheet de detalhe (child[...]) → snk-dynaform-detail-view aninhado.
531
+ * - Sheet de formulário (ex.: "Geral") → snk-dynaform-form-view com os campos do sheet.
532
+ */
533
+ renderSelectedSheetContent() {
534
+ if (!this._selectedSheet || this._selectedSheet.name === SnkDynaformDetailView.MAIN_TAB) {
535
+ return undefined;
536
+ }
537
+ const childEntityName = FormMetadata.getDetailName(this._selectedSheet.name);
538
+ if (childEntityName) {
539
+ return (h("snk-dynaform-detail-view", { key: `sub_${this.dataUnitName}_${this._selectedSheet.name}`, dataUnitName: `${this.dataUnitName}/${childEntityName}`, entityName: childEntityName, label: this._selectedSheet.label, resourceID: this.resourceID, canEdit: this.canEdit, messagesBuilder: this.messagesBuilder, customEditors: this.customEditors, customRenders: this.customRenders, presentationMode: this.presentationMode, taskbarCustomContainerId: this.taskbarCustomContainerId }));
540
+ }
541
+ return (h("snk-dynaform-form-view", { key: `sheet_${this._selectedSheet.name}`, name: this._selectedSheet.name, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this._selectedSheet.fields, fieldToFocus: this._fieldToGetFocus, label: this._selectedSheet.label, onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch }));
542
+ }
543
+ renderViewStack() {
544
+ var _a, _b;
545
+ return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", { class: "ez-size-width--full ez-size-height--full" }, h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => {
546
+ if (ref)
547
+ this._snkGrid = ref;
548
+ }, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.changeViewMode(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: true, enableGridInsert: true, autoLoad: true, multipleEditionEnabled: true, multipleSelection: true, hideHeader: true, hideGridTaskbar: true })), h("stack-item", { class: "ez-size-width--full ez-size-height--full grid-container" }, h("div", { class: "form-and-detail-container" }, h("snk-dynaform-form-view", { ref: (ref) => {
549
+ if (ref)
550
+ this._snkFormView = ref;
551
+ }, name: SnkDynaformDetailView.MAIN_TAB, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch }, this.renderSelectedRecordHeader()), this.renderTabSelector(), this.renderSelectedSheetContent())), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: (_a = this.attachmentRegisterKey) !== null && _a !== void 0 ? _a : '', messagesBuilder: this.messagesBuilder, entityName: (_b = this.entityName) !== null && _b !== void 0 ? _b : '' })));
552
+ }
553
+ render() {
554
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => {
555
+ if (el)
556
+ this._snkDataUnit = el;
557
+ }, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("snk-taskbar", { key: "detailViewTaskbar", class: "form-taskbar", "data-element-id": "detail_top", configName: this._configName, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, sizeButtons: 'small', presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm(), customActionsList: this.buildTaskbarCustomActionsList() }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })), this.renderViewStack())));
558
+ }
559
+ static get is() { return "snk-dynaform-detail-view"; }
560
+ static get encapsulation() { return "scoped"; }
561
+ static get originalStyleUrls() {
562
+ return {
563
+ "$": ["snk-dynaform-detail-view.css"]
564
+ };
565
+ }
566
+ static get styleUrls() {
567
+ return {
568
+ "$": ["snk-dynaform-detail-view.css"]
569
+ };
570
+ }
571
+ static get properties() {
572
+ return {
573
+ "formConfigManager": {
574
+ "type": "unknown",
575
+ "mutable": true,
576
+ "complexType": {
577
+ "original": "SnkFormConfigManager",
578
+ "resolved": "SnkFormConfigManager",
579
+ "references": {
580
+ "SnkFormConfigManager": {
581
+ "location": "import",
582
+ "path": "../../../snk-dynaform-form-config/SnkFormConfigManager"
583
+ }
584
+ }
585
+ },
586
+ "required": false,
587
+ "optional": true,
588
+ "docs": {
589
+ "tags": [],
590
+ "text": "Gerenciador de configura\u00E7\u00E3o do formul\u00E1rio."
591
+ }
592
+ },
593
+ "dataUnitName": {
594
+ "type": "string",
595
+ "mutable": false,
596
+ "complexType": {
597
+ "original": "string",
598
+ "resolved": "string",
599
+ "references": {}
600
+ },
601
+ "required": false,
602
+ "optional": true,
603
+ "docs": {
604
+ "tags": [],
605
+ "text": "Determina todo o caminho desde o pai at\u00E9 chegar neste n\u00EDvel"
606
+ },
607
+ "attribute": "data-unit-name",
608
+ "reflect": false
609
+ },
610
+ "resourceID": {
611
+ "type": "string",
612
+ "mutable": false,
613
+ "complexType": {
614
+ "original": "string",
615
+ "resolved": "string",
616
+ "references": {}
617
+ },
618
+ "required": false,
619
+ "optional": true,
620
+ "docs": {
621
+ "tags": [],
622
+ "text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
623
+ },
624
+ "attribute": "resource-i-d",
625
+ "reflect": false
626
+ },
627
+ "entityName": {
628
+ "type": "string",
629
+ "mutable": false,
630
+ "complexType": {
631
+ "original": "string",
632
+ "resolved": "string",
633
+ "references": {}
634
+ },
635
+ "required": false,
636
+ "optional": true,
637
+ "docs": {
638
+ "tags": [],
639
+ "text": "Nome da entidade detail."
640
+ },
641
+ "attribute": "entity-name",
642
+ "reflect": false
643
+ },
644
+ "label": {
645
+ "type": "string",
646
+ "mutable": false,
647
+ "complexType": {
648
+ "original": "string",
649
+ "resolved": "string",
650
+ "references": {}
651
+ },
652
+ "required": false,
653
+ "optional": true,
654
+ "docs": {
655
+ "tags": [],
656
+ "text": "Descri\u00E7\u00E3o amig\u00E1vel do cadastro detalhe."
657
+ },
658
+ "attribute": "label",
659
+ "reflect": false
660
+ },
661
+ "dataUnit": {
662
+ "type": "unknown",
663
+ "mutable": true,
664
+ "complexType": {
665
+ "original": "DataUnit",
666
+ "resolved": "DataUnit",
667
+ "references": {
668
+ "DataUnit": {
669
+ "location": "import",
670
+ "path": "@sankhyalabs/core"
671
+ }
672
+ }
673
+ },
674
+ "required": false,
675
+ "optional": true,
676
+ "docs": {
677
+ "tags": [],
678
+ "text": "Inst\u00E2ncia do DataUnit detail."
679
+ }
680
+ },
681
+ "selectedForm": {
682
+ "type": "string",
683
+ "mutable": true,
684
+ "complexType": {
685
+ "original": "string",
686
+ "resolved": "string",
687
+ "references": {}
688
+ },
689
+ "required": false,
690
+ "optional": true,
691
+ "docs": {
692
+ "tags": [],
693
+ "text": "Representa o formul\u00E1rio selecionado na inicializa\u00E7\u00E3o.\nAp\u00F3s o primeiro render, o estado interno _selectedSheet assume o controle."
694
+ },
695
+ "attribute": "selected-form",
696
+ "reflect": false
697
+ },
698
+ "dataState": {
699
+ "type": "unknown",
700
+ "mutable": true,
701
+ "complexType": {
702
+ "original": "DataState",
703
+ "resolved": "DataState",
704
+ "references": {
705
+ "DataState": {
706
+ "location": "import",
707
+ "path": "../../../snk-data-unit/snk-data-unit"
708
+ }
709
+ }
710
+ },
711
+ "required": false,
712
+ "optional": true,
713
+ "docs": {
714
+ "tags": [],
715
+ "text": "Representa o estado do dataUnit detail."
716
+ }
717
+ },
718
+ "messagesBuilder": {
719
+ "type": "unknown",
720
+ "mutable": true,
721
+ "complexType": {
722
+ "original": "SnkMessageBuilder",
723
+ "resolved": "SnkMessageBuilder",
724
+ "references": {
725
+ "SnkMessageBuilder": {
726
+ "location": "import",
727
+ "path": "../../../../lib/message/SnkMessageBuilder"
728
+ }
729
+ }
730
+ },
731
+ "required": false,
732
+ "optional": true,
733
+ "docs": {
734
+ "tags": [],
735
+ "text": ""
736
+ }
737
+ },
738
+ "canEdit": {
739
+ "type": "boolean",
740
+ "mutable": false,
741
+ "complexType": {
742
+ "original": "boolean",
743
+ "resolved": "boolean",
744
+ "references": {}
745
+ },
746
+ "required": false,
747
+ "optional": false,
748
+ "docs": {
749
+ "tags": [],
750
+ "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
751
+ },
752
+ "attribute": "can-edit",
753
+ "reflect": false,
754
+ "defaultValue": "true"
755
+ },
756
+ "taskbarCustomContainerId": {
757
+ "type": "string",
758
+ "mutable": false,
759
+ "complexType": {
760
+ "original": "string",
761
+ "resolved": "string",
762
+ "references": {}
763
+ },
764
+ "required": false,
765
+ "optional": true,
766
+ "docs": {
767
+ "tags": [],
768
+ "text": "Define o identificador do container de elementos customizados da Taskbar."
769
+ },
770
+ "attribute": "taskbar-custom-container-id",
771
+ "reflect": false
772
+ },
773
+ "customEditors": {
774
+ "type": "unknown",
775
+ "mutable": false,
776
+ "complexType": {
777
+ "original": "PropsCustomEditor",
778
+ "resolved": "PropsCustomEditor",
779
+ "references": {
780
+ "PropsCustomEditor": {
781
+ "location": "import",
782
+ "path": "../../interfaces/PropsCustomEditor"
783
+ }
784
+ }
785
+ },
786
+ "required": false,
787
+ "optional": true,
788
+ "docs": {
789
+ "tags": [],
790
+ "text": "Registra um editor customizado para campos da grade e formul\u00E1rio."
791
+ }
792
+ },
793
+ "customRenders": {
794
+ "type": "unknown",
795
+ "mutable": false,
796
+ "complexType": {
797
+ "original": "PropsCustomRender",
798
+ "resolved": "PropsCustomRender",
799
+ "references": {
800
+ "PropsCustomRender": {
801
+ "location": "import",
802
+ "path": "../../interfaces/PropsCustomRender"
803
+ }
804
+ }
805
+ },
806
+ "required": false,
807
+ "optional": true,
808
+ "docs": {
809
+ "tags": [],
810
+ "text": "Render customizados da grade."
811
+ }
812
+ },
813
+ "presentationMode": {
814
+ "type": "string",
815
+ "mutable": false,
816
+ "complexType": {
817
+ "original": "PresentationMode",
818
+ "resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY | PresentationMode.SINGLE_TASKBAR",
819
+ "references": {
820
+ "PresentationMode": {
821
+ "location": "import",
822
+ "path": "../../../../lib"
823
+ }
824
+ }
825
+ },
826
+ "required": false,
827
+ "optional": false,
828
+ "docs": {
829
+ "tags": [],
830
+ "text": "Altera o modo de apresenta\u00E7\u00E3o dos bot\u00F5es do snk-taskbar."
831
+ },
832
+ "attribute": "presentation-mode",
833
+ "reflect": false,
834
+ "defaultValue": "PresentationMode.SECONDARY"
835
+ }
836
+ };
837
+ }
838
+ static get states() {
839
+ return {
840
+ "_currentView": {},
841
+ "attachmentRegisterKey": {},
842
+ "_fieldToGetFocus": {},
843
+ "_hasToCreateFieldSearch": {},
844
+ "_selectedSheet": {},
845
+ "_internalErrorTabs": {},
846
+ "_selectedRecordPKDisplay": {}
847
+ };
848
+ }
849
+ static get methods() {
850
+ return {
851
+ "changeViewMode": {
852
+ "complexType": {
853
+ "signature": "(mode: VIEW_MODE) => Promise<void>",
854
+ "parameters": [{
855
+ "tags": [{
856
+ "name": "param",
857
+ "text": "mode - Novo modo que o componente deve ser apresentado."
858
+ }],
859
+ "text": "- Novo modo que o componente deve ser apresentado."
860
+ }],
861
+ "references": {
862
+ "Promise": {
863
+ "location": "global"
864
+ },
865
+ "VIEW_MODE": {
866
+ "location": "import",
867
+ "path": "../../../../lib/utils/constants"
868
+ }
869
+ },
870
+ "return": "Promise<void>"
871
+ },
872
+ "docs": {
873
+ "text": "Muda o modo de visualiza\u00E7\u00E3o do componente entre VIEW_MODE.GRID e VIEW_MODE.FORM",
874
+ "tags": [{
875
+ "name": "param",
876
+ "text": "mode - Novo modo que o componente deve ser apresentado."
877
+ }]
878
+ }
879
+ },
880
+ "configGrid": {
881
+ "complexType": {
882
+ "signature": "() => Promise<void>",
883
+ "parameters": [],
884
+ "references": {
885
+ "Promise": {
886
+ "location": "global"
887
+ }
888
+ },
889
+ "return": "Promise<void>"
890
+ },
891
+ "docs": {
892
+ "text": "Abre o configurador de grid.",
893
+ "tags": []
894
+ }
895
+ },
896
+ "showUp": {
897
+ "complexType": {
898
+ "signature": "() => Promise<void>",
899
+ "parameters": [],
900
+ "references": {
901
+ "Promise": {
902
+ "location": "global"
903
+ }
904
+ },
905
+ "return": "Promise<void>"
906
+ },
907
+ "docs": {
908
+ "text": "",
909
+ "tags": []
910
+ }
911
+ },
912
+ "addCustomEditor": {
913
+ "complexType": {
914
+ "signature": "(fieldName: string, customEditor: ICustomEditor) => Promise<void>",
915
+ "parameters": [{
916
+ "tags": [],
917
+ "text": ""
918
+ }, {
919
+ "tags": [],
920
+ "text": ""
921
+ }],
922
+ "references": {
923
+ "Promise": {
924
+ "location": "global"
925
+ },
926
+ "ICustomEditor": {
927
+ "location": "import",
928
+ "path": "@sankhyalabs/ezui/dist/types/utils"
929
+ }
930
+ },
931
+ "return": "Promise<void>"
932
+ },
933
+ "docs": {
934
+ "text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
935
+ "tags": []
936
+ }
937
+ },
938
+ "addGridCustomRender": {
939
+ "complexType": {
940
+ "signature": "(fieldName: string, customRender: ICustomRender) => Promise<void>",
941
+ "parameters": [{
942
+ "tags": [],
943
+ "text": ""
944
+ }, {
945
+ "tags": [],
946
+ "text": ""
947
+ }],
948
+ "references": {
949
+ "Promise": {
950
+ "location": "global"
951
+ },
952
+ "ICustomRender": {
953
+ "location": "import",
954
+ "path": "@sankhyalabs/ezui/dist/types/utils"
955
+ }
956
+ },
957
+ "return": "Promise<void>"
958
+ },
959
+ "docs": {
960
+ "text": "Registra um render customizado para colunas da grid.",
961
+ "tags": []
962
+ }
963
+ }
964
+ };
965
+ }
966
+ static get elementRef() { return "_element"; }
967
+ static get watchers() {
968
+ return [{
969
+ "propName": "dataUnit",
970
+ "methodName": "observeDataUnit"
971
+ }, {
972
+ "propName": "dataState",
973
+ "methodName": "observerDataState"
974
+ }, {
975
+ "propName": "customEditors",
976
+ "methodName": "observerPropsCustomEditor"
977
+ }, {
978
+ "propName": "customRenders",
979
+ "methodName": "observeCustomRenders"
980
+ }];
981
+ }
982
+ static get listeners() {
983
+ return [{
984
+ "name": "snkContentCardChanged",
985
+ "method": "onContentCardChanged",
986
+ "target": undefined,
987
+ "capture": false,
988
+ "passive": false
989
+ }];
990
+ }
991
+ }
992
+ SnkDynaformDetailView.MAIN_TAB = "__main";