@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
@@ -1,865 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-1894343a.js');
6
- const core = require('@sankhyalabs/core');
7
- const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const constants = require('./constants-6d82e405.js');
9
- const taskbarElements = require('./taskbar-elements-80eddec8.js');
10
- require('./DataFetcher-384d2ce8.js');
11
- require('./ISave-ecbe9336.js');
12
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-d341dd02.js');
13
- const index$1 = require('./index-e3e39724.js');
14
- require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
- require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
- const dataunitFetcher = require('./dataunit-fetcher-b9822794.js');
17
- require('./filter-item-type.enum-a7ffdaa6.js');
18
- const formConfigFetcher = require('./form-config-fetcher-45d1964c.js');
19
- const ConfigStorage = require('./ConfigStorage-a1fab5ca.js');
20
- const SnkFormConfigManager = require('./SnkFormConfigManager-44386305.js');
21
- const index$2 = require('./index-f0fe7e6e.js');
22
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-1ae0c6ac.js');
23
- require('./PrintUtils-bcaeb82f.js');
24
- require('./SnkMessageBuilder-a9300ebe.js');
25
- require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
26
- require('./IFetchDataExporterParams-e78ec415.js');
27
- require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
28
- require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
29
- require('@sankhyalabs/core/dist/utils/SortingUtils');
30
- require('./ResourceIDUtils-5ff86aa7.js');
31
-
32
- const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
33
- const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
34
-
35
- const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
36
-
37
- const SnkSimpleCrud = class {
38
- constructor(hostRef) {
39
- index.registerInstance(this, hostRef);
40
- this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
41
- this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
42
- this.actionClick = index.createEvent(this, "actionClick", 7);
43
- this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
44
- this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
45
- this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
46
- this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
47
- this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
48
- this._customEditors = new Map();
49
- this._customRenders = new Map();
50
- this._container = undefined;
51
- this._showPopUpGridConfig = false;
52
- this._currentViewMode = constants.VIEW_MODE.GRID;
53
- this._config = undefined;
54
- this._fieldToGetFocus = undefined;
55
- this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
56
- this.enableLockManagerLoadingComp = false;
57
- this.enableLockManagerTaskbarClick = false;
58
- this.dataState = undefined;
59
- this.dataUnit = undefined;
60
- this.entityName = undefined;
61
- this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
62
- this.gridConfig = undefined;
63
- this.formConfig = undefined;
64
- this._formFields = [];
65
- this._fieldsProps = new Map();
66
- this.enableContinuousInsert = false;
67
- this.multipleSelection = undefined;
68
- this.useCancelConfirm = true;
69
- this.pageSize = 150;
70
- this.resourceID = undefined;
71
- this.enableGridInsert = false;
72
- this.paginationCounterMode = 'auto';
73
- this.taskbarManager = undefined;
74
- this.messagesBuilder = undefined;
75
- this.useEnterLikeTab = false;
76
- this.actionsList = undefined;
77
- this.configName = undefined;
78
- this.showConfiguratorButtons = false;
79
- this.gridLegacyConfigName = undefined;
80
- this.formLegacyConfigName = undefined;
81
- this.ignoreReadOnlyFormFields = false;
82
- this.autoFocus = true;
83
- this.domainMessagesBuilder = undefined;
84
- this.multipleEditionEnabled = true;
85
- this.layoutFormConfig = true;
86
- this.disableGridEdition = false;
87
- this.autoLoad = undefined;
88
- this.outlineMode = false;
89
- }
90
- /**
91
- * @description Registra um editor customizado para campos da grade e do formulário.
92
- * @param {string} fieldName - O nome do campo.
93
- * @param {ICustomEditor} customEditor - A instância do editor customizado.
94
- * @returns {Promise<void>}
95
- */
96
- async addCustomEditor(fieldName, customEditor) {
97
- if (this._grid && this._form) {
98
- this._grid.addCustomEditor(fieldName, customEditor);
99
- this._form.addCustomEditor(fieldName, customEditor);
100
- return;
101
- }
102
- const newCustomEditors = new Map(this._customEditors);
103
- newCustomEditors.set(fieldName, customEditor);
104
- this._customEditors = newCustomEditors;
105
- }
106
- /**
107
- * @description Registra um renderizador customizado para colunas da grade.
108
- * @param {string} fieldName - O nome do campo.
109
- * @param {ICustomRender} customRender - A instância do renderizador customizado.
110
- * @returns {Promise<void>}
111
- */
112
- async addGridCustomRender(fieldName, customRender) {
113
- if (this._grid) {
114
- this._grid.addGridCustomRender(fieldName, customRender);
115
- return;
116
- }
117
- const newCustomRenders = new Map(this._customRenders);
118
- newCustomRenders.set(fieldName, customRender);
119
- this._customRenders = newCustomRenders;
120
- }
121
- async handleResourceIDChanged(newValue, oldValue) {
122
- if (core.StringUtils.isEmpty(newValue)) {
123
- return;
124
- }
125
- if (newValue === oldValue) {
126
- return;
127
- }
128
- await this.loadFormConfig(true);
129
- await this.loadGridConfig(true);
130
- }
131
- /**
132
- * @description Registra um formatador de valores para uma coluna da grade.
133
- * @param {string} columnName - O nome da coluna.
134
- * @param {ICustomFormatter} customFormatter - A instância do formatador customizado.
135
- * @returns {Promise<void>}
136
- */
137
- async addCustomValueFormatter(columnName, customFormatter) {
138
- this._grid.addCustomValueFormatter(columnName, customFormatter);
139
- }
140
- /**
141
- * @description Remove o formatador de valores de uma coluna da grade.
142
- * @param {string} columnName - O nome da coluna.
143
- * @returns {Promise<void>}
144
- */
145
- async removeCustomValueFormatter(columnName) {
146
- this._grid.removeCustomValueFormatter(columnName);
147
- }
148
- /**
149
- * @description Altera/adiciona uma propriedade nos metadados do campo.
150
- * @param {string} fieldName - O nome do campo.
151
- * @param {string} propName - O nome da propriedade.
152
- * @param {any} value - O valor da propriedade.
153
- * @returns {Promise<void>}
154
- */
155
- async setFieldProp(fieldName, propName, value) {
156
- const newCustomFieldProps = new Map(this._fieldsProps);
157
- const currentProps = this._fieldsProps.get(fieldName);
158
- newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
159
- this._fieldsProps = newCustomFieldProps;
160
- }
161
- loadTaskbarProcessor() {
162
- const taskbarIDs = {};
163
- taskbarIDs[TASKBAR_ID.FORM_REGULAR] = this.getButtons(false, [taskbarElements.TaskbarElement.GRID_MODE], true);
164
- taskbarIDs[TASKBAR_ID.GRID_REGULAR] = this.getButtons(false, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]);
165
- taskbarIDs[TASKBAR_ID.FORM_SELECTED] = this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE], true);
166
- taskbarIDs[TASKBAR_ID.GRID_SELECTED] = this.getGridSelectedButtonsCallBack.bind(this);
167
- taskbarIDs[TASKBAR_ID.FINISH_EDITION] = this.getFinishEditionButtonsCallback.bind(this);
168
- taskbarIDs[TASKBAR_ID.MULTIPLE_EDITION] = [taskbarElements.TaskbarElement.CANCEL];
169
- this._taskbarProcessor = new SnkMultiSelectionListDataSource.TaskbarProcessor(taskbarIDs);
170
- }
171
- getGridSelectedButtonsCallBack() {
172
- var _a, _b, _c;
173
- if (!this.multipleEditionEnabled || ((_c = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length) === 1) {
174
- return this.getButtons(true, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]);
175
- }
176
- return this.getButtons(true, [taskbarElements.TaskbarElement.UPDATE_MULTIPLE, taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]);
177
- }
178
- getFinishEditionButtonsCallback() {
179
- const btns = [taskbarElements.TaskbarElement.CANCEL, taskbarElements.TaskbarElement.SAVE];
180
- if (this.enableGridInsert && this._currentViewMode !== constants.VIEW_MODE.ATTACHMENT) {
181
- btns.push(this._currentViewMode === constants.VIEW_MODE.GRID ? taskbarElements.TaskbarElement.FORM_MODE : taskbarElements.TaskbarElement.GRID_MODE);
182
- }
183
- return btns;
184
- }
185
- getButtons(selected, extraButtons, removeRefresh) {
186
- let btnList = selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS;
187
- if (removeRefresh || this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
188
- btnList = btnList.filter(item => item !== taskbarElements.TaskbarElement.REFRESH);
189
- }
190
- return this.addConfigButton(btnList.concat(extraButtons));
191
- }
192
- addConfigButton(buttons) {
193
- if (this.configName === undefined || (this.configName && this.gridLegacyConfigName)) {
194
- return buttons;
195
- }
196
- return buttons.concat(taskbarElements.TaskbarElement.CONFIGURATOR);
197
- }
198
- get application() {
199
- return core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
200
- }
201
- /**
202
- * @description Usado para alternar a visão entre GRID e FORM externamente.
203
- * @param {VIEW_MODE} view - A visão para a qual navegar.
204
- * @returns {Promise<void>}
205
- */
206
- async goToView(view) {
207
- this._currentViewMode = view;
208
- if (this._viewStack) {
209
- if (view === constants.VIEW_MODE.GRID)
210
- this.dataUnit.isMultipleEdition = false;
211
- this._viewStack.show(view);
212
- }
213
- if (view === constants.VIEW_MODE.GRID) {
214
- requestAnimationFrame(() => this.focusToGrid());
215
- }
216
- if (view === constants.VIEW_MODE.FORM) {
217
- requestAnimationFrame(() => this.focusToForm());
218
- }
219
- }
220
- actionClickListener(evt) {
221
- this.handleTaskbarAction(evt.detail);
222
- evt.stopPropagation();
223
- }
224
- handleTaskbarAction(action) {
225
- switch (action) {
226
- case taskbarElements.TaskbarElement.CONFIGURATOR:
227
- this._snkConfigurator.open();
228
- break;
229
- case taskbarElements.TaskbarElement.GRID_MODE:
230
- this.goToView(constants.VIEW_MODE.GRID);
231
- break;
232
- case taskbarElements.TaskbarElement.FORM_MODE:
233
- this.goToView(constants.VIEW_MODE.FORM);
234
- break;
235
- case taskbarElements.TaskbarElement.UPDATE_MULTIPLE:
236
- this.dataUnit.isMultipleEdition = true;
237
- this.goToView(constants.VIEW_MODE.FORM);
238
- break;
239
- }
240
- }
241
- async onChangeEntityName(newValue) {
242
- if (this.dataUnit)
243
- return;
244
- const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
245
- this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
246
- }
247
- onModeChange() {
248
- if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
249
- this.initInMemoryDataUnit();
250
- }
251
- }
252
- observeDataState(newValue, oldValue) {
253
- this.handleDataStateChange(newValue, oldValue);
254
- }
255
- async observeFormLegacy(newValue, oldValue) {
256
- await this.handleUpdateFormLegacyConfig(newValue, oldValue);
257
- }
258
- async observeGridLegacy(newValue, oldValue) {
259
- await this.handleUpdateGridLegacyConfig(newValue, oldValue);
260
- }
261
- async handleDataStateChange(newValue, oldValue) {
262
- if (core.ObjectUtils.objectToString(oldValue) != core.ObjectUtils.objectToString(newValue)) {
263
- this.dataStateChange.emit(newValue);
264
- }
265
- await this.processRmPrecision();
266
- }
267
- async processRmPrecision() {
268
- var _a, _b;
269
- const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
270
- for (const field of fieldsWithRmPrecision || []) {
271
- if (!field) {
272
- continue;
273
- }
274
- const rmPrecision = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata) === null || _b === void 0 ? void 0 : _b.getProp('rm_precision', field);
275
- if (!rmPrecision && rmPrecision !== 0) {
276
- continue;
277
- }
278
- await this.setFieldProp(field, 'precision', rmPrecision);
279
- await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
280
- }
281
- this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
282
- }
283
- async handleUpdateGridLegacyConfig(newValue, oldValue) {
284
- if (newValue == undefined || newValue == oldValue) {
285
- return;
286
- }
287
- if (!this._gridConfigAlreadyLoaded) {
288
- return;
289
- }
290
- await this.loadGridConfig(true);
291
- }
292
- async handleUpdateFormLegacyConfig(newValue, oldValue) {
293
- if (newValue == undefined || newValue == oldValue) {
294
- return;
295
- }
296
- if (!this._formConfigAlreadyLoaded) {
297
- return;
298
- }
299
- await this.loadFormConfig(true);
300
- }
301
- async openConfig(viewMode) {
302
- await this._snkConfigurator.close();
303
- if (viewMode === constants.VIEW_MODE.GRID) {
304
- await this.openGridConfig();
305
- }
306
- else if (viewMode === constants.VIEW_MODE.FORM) {
307
- await this.openFormConfig();
308
- }
309
- }
310
- async openGridConfig() {
311
- var _a, _b, _c, _d;
312
- const originalColumns = (_b = await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumns())) !== null && _b !== void 0 ? _b : [];
313
- const gridColumns = (_d = await ((_c = this._grid) === null || _c === void 0 ? void 0 : _c.getColumnsState())) !== null && _d !== void 0 ? _d : [];
314
- this._snkGridConfig.columns = gridColumns.filter(c => c.name);
315
- this._snkGridConfig.originalColumns = originalColumns.filter(c => c.name);
316
- this._snkGridConfig.selectedIndex = 0;
317
- this._showPopUpGridConfig = true;
318
- }
319
- async openFormConfig() {
320
- if (this.formLegacyConfigName || this.configName) {
321
- await this._snkSimpleFormConfig.show();
322
- }
323
- }
324
- addGridLegacyConfigName() {
325
- if (this.gridLegacyConfigName && this.configName) {
326
- ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
327
- }
328
- }
329
- loadGridConfig(forceUpdate) {
330
- if (this.configName === undefined) {
331
- return;
332
- }
333
- if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
334
- return;
335
- }
336
- this.addGridLegacyConfigName();
337
- this._gridConfigAlreadyLoaded = true;
338
- return new Promise((accept, reject) => {
339
- ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
340
- .then(config => {
341
- this.setGridConfig(config);
342
- accept();
343
- })
344
- .catch(reason => {
345
- reject(reason);
346
- });
347
- });
348
- }
349
- formConfigIsLoaded() {
350
- return this.formConfig != undefined || this._formConfigAlreadyLoaded;
351
- }
352
- async loadFormConfig(forceLoad = false, forceSetNewConfig = false) {
353
- if (this.configName === undefined) {
354
- return;
355
- }
356
- if (this._formConfigManager == undefined) {
357
- this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
358
- this._formConfigManager.setConfig(this.formConfig);
359
- }
360
- if (this.formConfigIsLoaded() && !forceLoad) {
361
- return;
362
- }
363
- this._formConfigAlreadyLoaded = true;
364
- let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
365
- if (loadedLegacyConfig != undefined) {
366
- this._formConfigManager.setConfig(loadedLegacyConfig);
367
- this.setFormConfig(loadedLegacyConfig, forceSetNewConfig);
368
- return;
369
- }
370
- this.setFormConfig(await this._formConfigManager.loadConfig());
371
- }
372
- async componentWillRender() {
373
- this.loadTaskbarProcessor();
374
- this._resourceID = await this.application.getResourceID();
375
- this.dataExporterProviderStore();
376
- this.dataExporterProviderStore();
377
- this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
378
- if (this.configName === undefined) {
379
- return;
380
- }
381
- if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
382
- return;
383
- }
384
- await this.addGridLegacyConfigName();
385
- await this.loadGridConfig();
386
- await this.loadFormConfig();
387
- }
388
- componentDidRender() {
389
- this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
390
- this.addGridCustomValueFormattters();
391
- this.setFieldsProps();
392
- this.setCustomRenders();
393
- this.setCustomEditors();
394
- }
395
- componentWillLoad() {
396
- this.processMetadata();
397
- this.onModeChange();
398
- this.configDatasource();
399
- this._rmPrecisionCustomValueFormatter = new SnkMultiSelectionListDataSource.RmPrecisionCustomValueFormatter();
400
- this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
401
- if (this.enableGridInsert) {
402
- this._continuousInsertUtils.getConfig().then(value => this.enableContinuousInsert = value);
403
- }
404
- }
405
- componentDidLoad() {
406
- utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
407
- this.initKeyboardManager();
408
- this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
409
- }
410
- async dataUnitActionHandler(action) {
411
- if (action.type === core.Action.EDITION_CANCELED || action.type === core.Action.DATA_SAVED) {
412
- if (this.dataUnit.isMultipleEdition) {
413
- this.goToView(constants.VIEW_MODE.GRID);
414
- }
415
- }
416
- }
417
- getMessage(key, params) {
418
- var _a;
419
- return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
420
- }
421
- disconnectedCallback() {
422
- var _a;
423
- (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
424
- }
425
- setCustomRenders() {
426
- if (!this._grid) {
427
- return;
428
- }
429
- for (const [fieldName, customRender] of this._customRenders) {
430
- this._grid.addGridCustomRender(fieldName, customRender);
431
- this._customRenders.delete(fieldName);
432
- }
433
- }
434
- setCustomEditors() {
435
- if (!this._grid || !this._form) {
436
- return;
437
- }
438
- for (const [fieldName, customEditor] of this._customEditors) {
439
- this._grid.addCustomEditor(fieldName, customEditor);
440
- this._form.addCustomEditor(fieldName, customEditor);
441
- this._customEditors.delete(fieldName);
442
- }
443
- }
444
- configDatasource() {
445
- this._multiSelectionListDataSource.setApplication(this.application);
446
- this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
447
- }
448
- setFieldsProps() {
449
- if (!this._form) {
450
- return;
451
- }
452
- for (const [fieldName, props] of this._fieldsProps) {
453
- for (const prop in props) {
454
- this._form.setFieldProp(fieldName, prop, props[prop]);
455
- }
456
- this._fieldsProps.delete(fieldName);
457
- }
458
- }
459
- getTaskBarId() {
460
- var _a, _b;
461
- if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
462
- return TASKBAR_ID.FINISH_EDITION;
463
- }
464
- if (this.dataUnit.isMultipleEdition) {
465
- return TASKBAR_ID.MULTIPLE_EDITION;
466
- }
467
- if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
468
- !this.dataState.selectionInfo.isAllRecords() &&
469
- this.dataState.selectionInfo.length > 0) {
470
- return this._currentViewMode === constants.VIEW_MODE.GRID ? TASKBAR_ID.GRID_SELECTED : TASKBAR_ID.FORM_SELECTED;
471
- }
472
- return this._currentViewMode === constants.VIEW_MODE.GRID ? TASKBAR_ID.GRID_REGULAR : TASKBAR_ID.FORM_REGULAR;
473
- }
474
- initInMemoryDataUnit() {
475
- this._inMemoryLoader = new dataunitFetcher.InMemoryLoader(this._metadata, undefined, { autoLoad: this.autoLoad });
476
- this.dataUnit = this._inMemoryLoader.dataUnit;
477
- this.dataUnitReady.emit(this.dataUnit);
478
- }
479
- /**
480
- * @description Define os metadados do DataUnit.
481
- * @param {UnitMetadata} metadata - Os metadados a serem definidos.
482
- * @returns {Promise<void>}
483
- */
484
- setMetadata(metadata) {
485
- if (this._inMemoryLoader) {
486
- this._inMemoryLoader.metadata = metadata;
487
- }
488
- else if (this.dataUnit) {
489
- this.dataUnit.metadata = metadata;
490
- }
491
- return Promise.resolve();
492
- }
493
- /**
494
- * @description Define os registros do DataUnit.
495
- * @param {Array<Record>} records - Os registros a serem definidos.
496
- * @returns {Promise<void>}
497
- */
498
- setRecords(records) {
499
- if (this._inMemoryLoader) {
500
- this._inMemoryLoader.records = records;
501
- }
502
- else if (this.dataUnit) {
503
- this.dataUnit.records = records;
504
- }
505
- return Promise.resolve();
506
- }
507
- /**
508
- * @description Obtém os registros do DataUnit.
509
- * @returns {Promise<Array<Record>>} Uma promessa que resolve com a lista de registros.
510
- */
511
- getRecords() {
512
- return Promise.resolve(this.dataUnit.records);
513
- }
514
- /**
515
- * @description Usado para abrir o configurador do CRUD.
516
- * @returns {Promise<void>}
517
- */
518
- async openConfigurator() {
519
- var _a;
520
- (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
521
- }
522
- /**
523
- * @description Usado para fechar o configurador do CRUD.
524
- * @returns {Promise<void>}
525
- */
526
- async closeConfigurator() {
527
- var _a;
528
- (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
529
- }
530
- /**
531
- * @description Atualiza a configuração do formulário.
532
- * @returns {Promise<void>}
533
- */
534
- async updateConfig() {
535
- if (this._formConfigManager == undefined) {
536
- this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
537
- }
538
- this._formConfigManager.setConfig(this.formConfig);
539
- }
540
- processMetadata() {
541
- const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
542
- const fieldMetadata = [];
543
- const formConfig = { fields: [], emptyConfig: false };
544
- fieldsMetadataElem.forEach(fieldElem => {
545
- const field = {
546
- name: fieldElem.getAttribute("name") || fieldElem.getAttribute("label"),
547
- label: fieldElem.getAttribute("label"),
548
- dataType: core.DataType[fieldElem.getAttribute("dataType")] || core.DataType.TEXT,
549
- userInterface: core.UserInterface[fieldElem.getAttribute("userInterface")] || core.UserInterface.SHORTTEXT,
550
- readOnly: fieldElem.getAttribute("readOnly") == "true",
551
- required: fieldElem.getAttribute("required") == "true",
552
- tab: fieldElem.getAttribute("tab") || undefined,
553
- visible: fieldElem.getAttribute("visible") != "false"
554
- };
555
- const fieldConfig = { name: field.name, tab: field.tab, visible: field.visible };
556
- formConfig.fields.push(fieldConfig);
557
- fieldMetadata.push(field);
558
- });
559
- if (fieldMetadata.length > 0) {
560
- if (!this.formConfig) {
561
- this.formConfig = formConfig;
562
- }
563
- this._metadata = {
564
- name: "SimpleCrud",
565
- label: "SimpleCrud",
566
- fields: fieldMetadata
567
- };
568
- }
569
- }
570
- addGridCustomValueFormattters() {
571
- var _a, _b, _c;
572
- const metadataFields = ((_a = this._metadata) === null || _a === void 0 ? void 0 : _a.fields) || ((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.fields);
573
- if (!metadataFields) {
574
- return;
575
- }
576
- const fieldsWithRmPrecision = [];
577
- metadataFields.forEach((field) => {
578
- var _a;
579
- if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
580
- fieldsWithRmPrecision.push(field.name);
581
- }
582
- });
583
- fieldsWithRmPrecision.forEach(field => {
584
- this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
585
- });
586
- }
587
- onDataStateChange(evt) {
588
- this.dataState = Object.assign({}, evt.detail);
589
- }
590
- getTaskBarDisabledButtons() {
591
- var _a, _b, _c, _d, _e, _f;
592
- const disabledButtons = [];
593
- if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
594
- disabledButtons.push(taskbarElements.TaskbarElement.NEXT);
595
- }
596
- if (!((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.hasPrevious)) {
597
- disabledButtons.push(taskbarElements.TaskbarElement.PREVIOUS);
598
- }
599
- if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
600
- disabledButtons.push(taskbarElements.TaskbarElement.FORM_MODE);
601
- }
602
- if (((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.length) > 1) {
603
- disabledButtons.push(taskbarElements.TaskbarElement.CLONE);
604
- }
605
- return disabledButtons;
606
- }
607
- handleCancelEdit() {
608
- var _a;
609
- if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
610
- this.goToView(constants.VIEW_MODE.GRID);
611
- this.dataUnit.clearSelection();
612
- }
613
- }
614
- handleConfiguratorEvent(evt, type) {
615
- evt.stopImmediatePropagation();
616
- if (type === 'SAVE') {
617
- this.configuratorSave.emit();
618
- return;
619
- }
620
- this.configuratorCancel.emit();
621
- }
622
- onSelectField(option) {
623
- if (option == undefined) {
624
- return;
625
- }
626
- this._fieldToGetFocus = option.value;
627
- }
628
- getFieldSearch(splitButton, item) {
629
- if (this._fieldSearch != undefined) {
630
- return this._fieldSearch;
631
- }
632
- this._splitButtonForm = splitButton;
633
- this._fieldSearch = utils.buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
634
- return this._fieldSearch;
635
- }
636
- getFormFields() {
637
- var _a, _b;
638
- return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
639
- }
640
- handleFormSetFields(fields) {
641
- if (!core.ObjectUtils.equals(this._formFields, fields)) {
642
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
643
- }
644
- }
645
- fieldsOptionLoader(argument) {
646
- const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
647
- const allFields = this.getFormFields().map(field => { var _a; return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field.name); });
648
- const filteredFields = allFields.filter(field => {
649
- var _a, _b;
650
- return ((_a = field.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm)) ||
651
- ((_b = field.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTerm));
652
- });
653
- const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
654
- return Promise.resolve(options);
655
- }
656
- isGridInsertActive() {
657
- return this.enableGridInsert && this.dataUnit.hasNewRecord();
658
- }
659
- getColumnSearch(splitButton, item) {
660
- if (this._columnSearch != undefined) {
661
- return this._columnSearch;
662
- }
663
- this._splitButton = splitButton;
664
- this._columnSearch = utils.buildFieldSearch(item, ({ argument }) => new Promise(accept => {
665
- this._grid.filterColumns(argument).then((columns) => {
666
- accept(columns
667
- .filter(column => !column.hidden)
668
- .map(column => ({ label: column.label, value: column.name })));
669
- });
670
- }), (option) => {
671
- if (option != undefined) {
672
- this._grid.locateColumn(option.value);
673
- }
674
- });
675
- return this._columnSearch;
676
- }
677
- getActionsList() {
678
- const hardList = [];
679
- if (this.enableGridInsert) {
680
- hardList.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert, () => {
681
- this.enableContinuousInsert = !this.enableContinuousInsert;
682
- this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert);
683
- }));
684
- }
685
- if (this.isGridInsertActive())
686
- return hardList;
687
- if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
688
- const taskbarID = this.getTopTaskBarId();
689
- return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
690
- }
691
- return hardList.concat(this.actionsList);
692
- }
693
- getSettingsListGrid() {
694
- const hardList = [{
695
- value: core.StringUtils.generateUUID(),
696
- label: this.getMessage("snkSimpleCrud.findColumn"),
697
- disableCloseOnSelect: true,
698
- eagerInitialize: true,
699
- itemBuilder: (splitButton, item) => this.getColumnSearch(splitButton, item)
700
- }];
701
- return hardList;
702
- }
703
- getSettingsListForm() {
704
- const hardList = [{
705
- value: core.StringUtils.generateUUID(),
706
- label: this.getMessage("snkSimpleCrud.findFields"),
707
- disableCloseOnSelect: true,
708
- eagerInitialize: true,
709
- itemBuilder: (splitButton, item) => this.getFieldSearch(splitButton, item)
710
- }];
711
- return hardList;
712
- }
713
- getTopTaskBarId() {
714
- var _a;
715
- return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index$1.PresentationMode.PRIMARY}` :
716
- `snkGridTopTaskbar.regular${index$1.PresentationMode.PRIMARY}`;
717
- }
718
- clearFieldToFocusHandler() {
719
- this._fieldToGetFocus = undefined;
720
- }
721
- gridConfigChangeHandler(evt) {
722
- evt.stopPropagation();
723
- if (!this.configName)
724
- return;
725
- const config = evt.detail;
726
- ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
727
- }
728
- modalConfigChangeHandler(evt) {
729
- const config = evt.detail;
730
- this._grid.setColumnsState(config.columns)
731
- .then(() => {
732
- this.setGridConfig(config);
733
- this.closeGridConfig();
734
- this.dataExporterProviderStore();
735
- });
736
- evt.stopPropagation();
737
- }
738
- async dataExporterProviderStore() {
739
- if (this.dataUnit == undefined) {
740
- return;
741
- }
742
- if (this._grid == undefined) {
743
- return;
744
- }
745
- const dataExporterProvider = new SnkMultiSelectionListDataSource.ClientSideExporterProvider(this.dataUnit, this._grid);
746
- index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
747
- }
748
- getDataExporterStoreKey() {
749
- return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
750
- }
751
- setGridConfig(config) {
752
- this.gridConfig = config;
753
- SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
754
- }
755
- setFormConfig(config, forceUpdate) {
756
- if (this.formConfig && !forceUpdate)
757
- return;
758
- this.formConfig = config;
759
- }
760
- closeGridConfig() {
761
- this._showPopUpGridConfig = false;
762
- }
763
- getPageSize() {
764
- if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
765
- return 0;
766
- }
767
- if (this.pageSize == undefined) {
768
- return 150;
769
- }
770
- return this.pageSize;
771
- }
772
- resolveResourceID() {
773
- return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
774
- }
775
- getFormConfig() {
776
- var _a;
777
- const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
778
- if (!this.configName && !configFromManager) {
779
- return this.formConfig;
780
- }
781
- return configFromManager;
782
- }
783
- updateFormConfig() {
784
- let newConfig = this.formConfig;
785
- if (this.formLegacyConfigName == undefined) {
786
- newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
787
- }
788
- this.setFormConfig(newConfig, true);
789
- if (this._formConfigManager == undefined) {
790
- this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
791
- }
792
- this._formConfigManager.setConfig(this.formConfig);
793
- }
794
- handleDataUnitOnInsertionMode() {
795
- if (this.enableGridInsert)
796
- return;
797
- this.goToView(constants.VIEW_MODE.FORM);
798
- }
799
- async initKeyboardManager() {
800
- var _a;
801
- this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
802
- const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
803
- if (dataUnit == undefined) {
804
- return;
805
- }
806
- this._keyboardManager
807
- .bind("F7", () => dataUnit.saveData(), { description: this.getMessage("snkSimpleCrud.keyboardShortcuts.saveData"), element: this._element })
808
- .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: this.getMessage("snkSimpleCrud.keyboardShortcuts.addRecord"), element: this._element })
809
- .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: this.getMessage("snkSimpleCrud.keyboardShortcuts.removeRecord"), element: this._element })
810
- .bind("Escape", () => {
811
- if (dataUnit.isDirty()) {
812
- dataUnit.cancelEdition();
813
- }
814
- }, {
815
- debounceTime: 1000,
816
- description: this.getMessage("snkSimpleCrud.keyboardShortcuts.cancelAction"), element: this._element
817
- });
818
- }
819
- async handleFormConfigSaved() {
820
- await this.loadFormConfig(true, true);
821
- }
822
- focusToGrid() {
823
- const gridElement = this._grid;
824
- gridElement.focus();
825
- }
826
- focusToForm() {
827
- const formElement = this._form;
828
- formElement.focus();
829
- }
830
- renderTaskbarContent(layout) {
831
- var _a;
832
- return (index.h("snk-taskbar", { class: `ez-box--no-outline ez-box ${this._currentViewMode === constants.VIEW_MODE.FORM ? (this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow-xsmall') + ' ez-padding--small' : ''}`, dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), actionsSettingsList: layout === constants.VIEW_MODE.GRID ? this.getSettingsListGrid() : this.getSettingsListForm(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY, tabindex: "0" }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
833
- }
834
- /* istanbul ignore next */
835
- render() {
836
- var _a;
837
- if (this.dataUnit == undefined) {
838
- return;
839
- }
840
- return (index.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: `ez-box ez-box--no-outline ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section`, ref: (ref) => this._container = ref, tabindex: "0" }, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large ez-box--no-outline", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
841
- ? undefined
842
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, tabindex: "0", paginationCounterMode: this.paginationCounterMode, canEdit: !this.disableGridEdition }, this.renderTaskbarContent(constants.VIEW_MODE.GRID), index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, this.renderTaskbarContent(constants.VIEW_MODE.FORM), index.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ez-box--no-outline`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), elementFocusSearchField: this._container, tabindex: "0" }), index.h("slot", { name: "snkSimpleCrudFormFooter" }), index.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName, messagesBuilder: this.messagesBuilder })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId, layoutFormConfig: this.layoutFormConfig })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._showPopUpGridConfig, onEzClosePopup: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
843
- }
844
- get _element() { return index.getElement(this); }
845
- static get watchers() { return {
846
- "resourceID": ["handleResourceIDChanged"],
847
- "entityName": ["onChangeEntityName"],
848
- "mode": ["onModeChange"],
849
- "dataState": ["observeDataState"],
850
- "formLegacyConfigName": ["observeFormLegacy"],
851
- "gridLegacyConfigName": ["observeGridLegacy"]
852
- }; }
853
- };
854
- var TASKBAR_ID;
855
- (function (TASKBAR_ID) {
856
- TASKBAR_ID["FORM_REGULAR"] = "snkSimpleCrudTaskbar.form_regular";
857
- TASKBAR_ID["GRID_REGULAR"] = "snkSimpleCrudTaskbar.grid_regular";
858
- TASKBAR_ID["FORM_SELECTED"] = "snkSimpleCrudTaskbar.form_selected";
859
- TASKBAR_ID["GRID_SELECTED"] = "snkSimpleCrudTaskbar.grid_selected";
860
- TASKBAR_ID["FINISH_EDITION"] = "snkSimpleCrudTaskbar.finish_edition";
861
- TASKBAR_ID["MULTIPLE_EDITION"] = "snkSimpleCrudTaskbar.multiple_edition";
862
- })(TASKBAR_ID || (TASKBAR_ID = {}));
863
- SnkSimpleCrud.style = snkSimpleCrudCss;
864
-
865
- exports.snk_simple_crud = SnkSimpleCrud;