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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/dist/cjs/{ConfigStorage-a1fab5ca.js → ConfigStorage-4201dd3d.js} +2 -2
  2. package/dist/cjs/{DataFetcher-384d2ce8.js → DataFetcher-b3a8075d.js} +2830 -2
  3. package/dist/cjs/FormConfigHelper-c5f5473a.js +342 -0
  4. package/dist/cjs/{ISave-ecbe9336.js → ISave-4674c283.js} +1 -1
  5. package/dist/cjs/{PersonalizedFilterUtils-eccb267a.js → PersonalizedFilterUtils-263e4d24.js} +52 -5
  6. package/dist/cjs/{SnkFormConfigManager-44386305.js → SnkFormConfigManager-c3a49038.js} +2 -2
  7. package/dist/cjs/{SnkMultiSelectionListDataSource-d341dd02.js → SnkMultiSelectionListDataSource-0bc94d36.js} +4 -4
  8. package/dist/cjs/{auth-fetcher-6b134ec4.js → auth-fetcher-0ecc53ff.js} +1 -1
  9. package/dist/cjs/{dataunit-fetcher-b9822794.js → dataunit-fetcher-bcbc38c0.js} +2 -3
  10. package/dist/cjs/{filter-type.enum-2bb46d2a.js → filter-type.enum-b3b388af.js} +7 -0
  11. package/dist/cjs/{form-config-fetcher-45d1964c.js → form-config-fetcher-f80dbc3b.js} +23 -5
  12. package/dist/cjs/index-1894343a.js +24 -36
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -5
  15. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  16. package/dist/cjs/snk-actions-button_9.cjs.entry.js +5 -6
  17. package/dist/cjs/snk-application.cjs.entry.js +7 -8
  18. package/dist/cjs/snk-attach_11.cjs.entry.js +2950 -0
  19. package/dist/cjs/snk-crud.cjs.entry.js +31 -243
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -6
  21. package/dist/cjs/{snk-data-unit-4b6dc396.js → snk-data-unit-3b94547d.js} +11 -11
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -4
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
  24. package/dist/cjs/snk-dynaform-config-header_5.cjs.entry.js +739 -0
  25. package/dist/cjs/snk-dynaform-detail-view_2.cjs.entry.js +938 -0
  26. package/dist/cjs/snk-dynaform-field-config_2.cjs.entry.js +327 -0
  27. package/dist/cjs/snk-dynaform-guides-view-e98f7f3a.js +747 -0
  28. package/dist/cjs/snk-dynaform-guides-view.cjs.entry.js +23 -0
  29. package/dist/cjs/snk-dynaform.cjs.entry.js +675 -0
  30. package/dist/cjs/{snk-expression-group_2.cjs.entry.js → snk-expression-group_4.cjs.entry.js} +421 -18
  31. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +41 -44
  32. package/dist/cjs/snk-form_2.cjs.entry.js +4 -5
  33. package/dist/cjs/snk-grid.cjs.entry.js +7 -8
  34. package/dist/cjs/{snk-guides-viewer-8e7a503b.js → snk-guides-viewer-3054d541.js} +1 -1
  35. package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -6
  36. package/dist/cjs/snk-layout-form-config.cjs.entry.js +4 -5
  37. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -5
  38. package/dist/cjs/taskbarUtils-38748460.js +231 -0
  39. package/dist/collection/collection-manifest.json +17 -0
  40. package/dist/collection/components/snk-dynaform/interfaces/PropsCustomEditor.js +1 -0
  41. package/dist/collection/components/snk-dynaform/interfaces/PropsCustomRender.js +1 -0
  42. package/dist/collection/components/snk-dynaform/snk-dynaform.css +64 -0
  43. package/dist/collection/components/snk-dynaform/snk-dynaform.js +1657 -0
  44. package/dist/collection/components/snk-dynaform/subcomponents/CardFormResizeObserver.js +26 -0
  45. package/dist/collection/components/snk-dynaform/subcomponents/GuideBuilder.js +51 -0
  46. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.css +112 -0
  47. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.js +992 -0
  48. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.css +64 -0
  49. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.js +588 -0
  50. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.css +98 -0
  51. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.js +1167 -0
  52. package/dist/collection/components/snk-dynaform-form-config/FormConfigHelper.js +325 -0
  53. package/dist/collection/components/snk-dynaform-form-config/SnkFormConfigManager.js +212 -0
  54. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.css +17 -0
  55. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.js +236 -0
  56. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.css +41 -0
  57. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.js +170 -0
  58. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.css +22 -0
  59. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.js +408 -0
  60. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.css +88 -0
  61. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.js +209 -0
  62. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.css +167 -0
  63. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.js +655 -0
  64. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.css +42 -0
  65. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.js +171 -0
  66. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.css +66 -0
  67. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.js +557 -0
  68. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.css +80 -0
  69. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.js +326 -0
  70. package/dist/collection/components/snk-grid/snk-grid.css +4 -2
  71. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +22 -4
  72. package/dist/components/form-config-fetcher.js +22 -4
  73. package/dist/components/index.d.ts +12 -0
  74. package/dist/components/index.js +12 -0
  75. package/dist/components/snk-crud.js +1 -212
  76. package/dist/components/snk-dynaform-config-header.d.ts +11 -0
  77. package/dist/components/snk-dynaform-config-header.js +6 -0
  78. package/dist/components/snk-dynaform-config-header2.js +103 -0
  79. package/dist/components/snk-dynaform-configs-button.d.ts +11 -0
  80. package/dist/components/snk-dynaform-configs-button.js +6 -0
  81. package/dist/components/snk-dynaform-configs-button2.js +76 -0
  82. package/dist/components/snk-dynaform-detail-view.d.ts +11 -0
  83. package/dist/components/snk-dynaform-detail-view.js +6 -0
  84. package/dist/components/snk-dynaform-detail-view2.js +1835 -0
  85. package/dist/components/snk-dynaform-field-config.d.ts +11 -0
  86. package/dist/components/snk-dynaform-field-config.js +6 -0
  87. package/dist/components/snk-dynaform-field-config2.js +605 -0
  88. package/dist/components/snk-dynaform-field-item.d.ts +11 -0
  89. package/dist/components/snk-dynaform-field-item.js +6 -0
  90. package/dist/components/snk-dynaform-field-item2.js +96 -0
  91. package/dist/components/snk-dynaform-fields-layout.d.ts +11 -0
  92. package/dist/components/snk-dynaform-fields-layout.js +6 -0
  93. package/dist/components/snk-dynaform-fields-layout2.js +428 -0
  94. package/dist/components/snk-dynaform-fields-selector.d.ts +11 -0
  95. package/dist/components/snk-dynaform-fields-selector.js +6 -0
  96. package/dist/components/snk-dynaform-fields-selector2.js +104 -0
  97. package/dist/components/snk-dynaform-form-config.d.ts +11 -0
  98. package/dist/components/snk-dynaform-form-config.js +6 -0
  99. package/dist/components/snk-dynaform-form-config2.js +430 -0
  100. package/dist/components/snk-dynaform-form-view.d.ts +11 -0
  101. package/dist/components/snk-dynaform-form-view.js +6 -0
  102. package/dist/components/snk-dynaform-form-view2.js +270 -0
  103. package/dist/components/snk-dynaform-guides-configurator.d.ts +11 -0
  104. package/dist/components/snk-dynaform-guides-configurator.js +6 -0
  105. package/dist/components/snk-dynaform-guides-configurator2.js +173 -0
  106. package/dist/components/snk-dynaform-guides-view.d.ts +11 -0
  107. package/dist/components/snk-dynaform-guides-view.js +6 -0
  108. package/dist/components/snk-dynaform.d.ts +11 -0
  109. package/dist/components/snk-dynaform.js +1003 -0
  110. package/dist/components/snk-grid2.js +1 -1
  111. package/dist/components/taskbarUtils.js +224 -0
  112. package/dist/esm/{ConfigStorage-76872695.js → ConfigStorage-e834d1ea.js} +2 -2
  113. package/dist/esm/{DataFetcher-e60f8d53.js → DataFetcher-5ed0a377.js} +2830 -3
  114. package/dist/esm/FormConfigHelper-efc29480.js +328 -0
  115. package/dist/esm/{ISave-4929c071.js → ISave-5b46d691.js} +1 -1
  116. package/dist/esm/{PersonalizedFilterUtils-d2439a9a.js → PersonalizedFilterUtils-45b5803c.js} +49 -2
  117. package/dist/esm/{SnkFormConfigManager-83f6b22f.js → SnkFormConfigManager-bfd575c2.js} +2 -2
  118. package/dist/esm/{SnkMultiSelectionListDataSource-18abafb1.js → SnkMultiSelectionListDataSource-9e9166ae.js} +4 -4
  119. package/dist/esm/{auth-fetcher-1a31c1e4.js → auth-fetcher-5283045d.js} +1 -1
  120. package/dist/esm/{dataunit-fetcher-c176e002.js → dataunit-fetcher-3b1ca96e.js} +1 -2
  121. package/dist/esm/{filter-type.enum-f6a8fe23.js → filter-type.enum-62b7fe88.js} +8 -1
  122. package/dist/esm/{form-config-fetcher-b44b2727.js → form-config-fetcher-db1bf140.js} +23 -5
  123. package/dist/esm/index-04f73a26.js +24 -36
  124. package/dist/esm/loader.js +1 -1
  125. package/dist/esm/pesquisa-grid_2.entry.js +4 -5
  126. package/dist/esm/sankhyablocks.js +1 -1
  127. package/dist/esm/snk-actions-button_9.entry.js +5 -6
  128. package/dist/esm/snk-application.entry.js +6 -7
  129. package/dist/esm/snk-attach_11.entry.js +2936 -0
  130. package/dist/esm/snk-crud.entry.js +6 -218
  131. package/dist/esm/snk-data-exporter.entry.js +5 -6
  132. package/dist/esm/{snk-data-unit-d8cfa950.js → snk-data-unit-dfde62cb.js} +2 -2
  133. package/dist/esm/snk-data-unit.entry.js +3 -4
  134. package/dist/esm/snk-detail-view.entry.js +7 -8
  135. package/dist/esm/snk-dynaform-config-header_5.entry.js +731 -0
  136. package/dist/esm/snk-dynaform-detail-view_2.entry.js +933 -0
  137. package/dist/esm/snk-dynaform-field-config_2.entry.js +322 -0
  138. package/dist/esm/snk-dynaform-guides-view-1f1455d6.js +744 -0
  139. package/dist/esm/snk-dynaform-guides-view.entry.js +15 -0
  140. package/dist/esm/snk-dynaform.entry.js +671 -0
  141. package/dist/esm/{snk-expression-group_2.entry.js → snk-expression-group_4.entry.js} +405 -4
  142. package/dist/esm/snk-filter-bar_4.entry.js +5 -8
  143. package/dist/esm/snk-form_2.entry.js +4 -5
  144. package/dist/esm/snk-grid.entry.js +7 -8
  145. package/dist/esm/{snk-guides-viewer-adf39ea2.js → snk-guides-viewer-95fefcaa.js} +1 -1
  146. package/dist/esm/snk-guides-viewer.entry.js +5 -6
  147. package/dist/esm/snk-layout-form-config.entry.js +4 -5
  148. package/dist/esm/snk-pesquisa.entry.js +4 -5
  149. package/dist/esm/taskbarUtils-8501d09e.js +225 -0
  150. package/dist/sankhyablocks/p-0dbd53d9.js +1 -0
  151. package/dist/sankhyablocks/{p-f5ad0720.js → p-19d1ca14.js} +1 -1
  152. package/dist/sankhyablocks/{p-ab5e12fa.js → p-1cc4cf61.js} +1 -1
  153. package/dist/sankhyablocks/p-1edd6be6.entry.js +1 -0
  154. package/dist/sankhyablocks/p-22ddc1a5.entry.js +1 -0
  155. package/dist/sankhyablocks/p-24b059ee.entry.js +1 -0
  156. package/dist/sankhyablocks/{p-5c250661.js → p-2c00b93d.js} +1 -1
  157. package/dist/sankhyablocks/p-3623fddf.entry.js +1 -0
  158. package/dist/sankhyablocks/p-43c94ba5.entry.js +1 -0
  159. package/dist/sankhyablocks/p-449dfe55.entry.js +1 -0
  160. package/dist/sankhyablocks/p-451b5bcc.entry.js +1 -0
  161. package/dist/sankhyablocks/p-46d7e2de.js +1 -0
  162. package/dist/sankhyablocks/{p-3c990841.js → p-51e853f2.js} +1 -1
  163. package/dist/sankhyablocks/p-58709cf9.js +1 -0
  164. package/dist/sankhyablocks/p-589016e2.entry.js +1 -0
  165. package/dist/sankhyablocks/p-5d02c032.js +1 -0
  166. package/dist/sankhyablocks/p-5d50f59a.entry.js +1 -0
  167. package/dist/sankhyablocks/p-61776b68.entry.js +1 -0
  168. package/dist/sankhyablocks/p-6b8a1ec3.js +1 -0
  169. package/dist/sankhyablocks/p-7038cf62.entry.js +1 -0
  170. package/dist/sankhyablocks/{p-b1bb4cf1.js → p-70c2ee5c.js} +1 -1
  171. package/dist/sankhyablocks/p-7628e04f.entry.js +1 -0
  172. package/dist/sankhyablocks/p-7798788b.entry.js +1 -0
  173. package/dist/sankhyablocks/p-77c26de0.js +1 -0
  174. package/dist/sankhyablocks/p-7c34a0f7.entry.js +1 -0
  175. package/dist/sankhyablocks/p-a4a0d9b7.entry.js +1 -0
  176. package/dist/sankhyablocks/{p-4f7adf97.js → p-b1bf9564.js} +1 -1
  177. package/dist/sankhyablocks/p-b4c2a99c.entry.js +1 -0
  178. package/dist/sankhyablocks/p-b75af274.entry.js +1 -0
  179. package/dist/sankhyablocks/p-c538bd6c.entry.js +1 -0
  180. package/dist/sankhyablocks/{p-3704bf1b.js → p-d5810110.js} +1 -1
  181. package/dist/sankhyablocks/p-d7fd447e.entry.js +1 -0
  182. package/dist/sankhyablocks/p-d88278f8.js +28 -0
  183. package/dist/sankhyablocks/p-f076d742.js +60 -0
  184. package/dist/sankhyablocks/{p-8fe740b7.entry.js → p-f1ef090f.entry.js} +2 -2
  185. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  186. package/dist/types/components/snk-dynaform/interfaces/PropsCustomEditor.d.ts +4 -0
  187. package/dist/types/components/snk-dynaform/interfaces/PropsCustomRender.d.ts +4 -0
  188. package/dist/types/components/snk-dynaform/subcomponents/CardFormResizeObserver.d.ts +1 -0
  189. package/dist/types/components/snk-dynaform/subcomponents/GuideBuilder.d.ts +14 -0
  190. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.d.ts +158 -0
  191. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.d.ts +107 -0
  192. package/dist/types/components/snk-dynaform-form-config/FormConfigHelper.d.ts +36 -0
  193. package/dist/types/components/snk-dynaform-form-config/SnkFormConfigManager.d.ts +35 -0
  194. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.d.ts +23 -0
  195. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.d.ts +19 -0
  196. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.d.ts +56 -0
  197. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.d.ts +74 -0
  198. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.d.ts +21 -0
  199. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-form-config.d.ts +95 -0
  200. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.d.ts +35 -0
  201. package/dist/types/components.d.ts +2403 -1322
  202. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +1 -0
  203. package/package.json +1 -1
  204. package/react/components.d.ts +12 -0
  205. package/react/components.js +12 -0
  206. package/react/components.js.map +1 -1
  207. package/dist/cjs/SnkMessageBuilder-a9300ebe.js +0 -2833
  208. package/dist/cjs/default-filters-a09bf82b.js +0 -8
  209. package/dist/cjs/index-62760a9c.js +0 -49
  210. package/dist/cjs/index-8d94b7e0.js +0 -7
  211. package/dist/cjs/snk-attach.cjs.entry.js +0 -948
  212. package/dist/cjs/snk-default-filter.cjs.entry.js +0 -77
  213. package/dist/cjs/snk-filter-advanced-mode_3.cjs.entry.js +0 -99
  214. package/dist/cjs/snk-filter-detail.cjs.entry.js +0 -198
  215. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +0 -408
  216. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +0 -109
  217. package/dist/cjs/snk-image-input.cjs.entry.js +0 -160
  218. package/dist/cjs/snk-personalized-filter.cjs.entry.js +0 -358
  219. package/dist/cjs/snk-simple-crud.cjs.entry.js +0 -865
  220. package/dist/esm/SnkMessageBuilder-1eb7a1af.js +0 -2831
  221. package/dist/esm/default-filters-50105e43.js +0 -8
  222. package/dist/esm/index-620ac460.js +0 -7
  223. package/dist/esm/index-8acbae97.js +0 -49
  224. package/dist/esm/snk-attach.entry.js +0 -944
  225. package/dist/esm/snk-default-filter.entry.js +0 -73
  226. package/dist/esm/snk-filter-advanced-mode_3.entry.js +0 -93
  227. package/dist/esm/snk-filter-detail.entry.js +0 -194
  228. package/dist/esm/snk-filter-field-search_2.entry.js +0 -403
  229. package/dist/esm/snk-filter-modal-item.entry.js +0 -105
  230. package/dist/esm/snk-image-input.entry.js +0 -156
  231. package/dist/esm/snk-personalized-filter.entry.js +0 -354
  232. package/dist/esm/snk-simple-crud.entry.js +0 -861
  233. package/dist/sankhyablocks/p-0a4cdcde.entry.js +0 -1
  234. package/dist/sankhyablocks/p-0afc64df.entry.js +0 -1
  235. package/dist/sankhyablocks/p-10f27dc6.entry.js +0 -1
  236. package/dist/sankhyablocks/p-20f03230.entry.js +0 -1
  237. package/dist/sankhyablocks/p-2af8aca3.js +0 -1
  238. package/dist/sankhyablocks/p-3870748a.js +0 -28
  239. package/dist/sankhyablocks/p-3d294185.entry.js +0 -1
  240. package/dist/sankhyablocks/p-438a225f.entry.js +0 -1
  241. package/dist/sankhyablocks/p-4d04bc75.entry.js +0 -1
  242. package/dist/sankhyablocks/p-554c0e54.js +0 -1
  243. package/dist/sankhyablocks/p-57c184a2.entry.js +0 -1
  244. package/dist/sankhyablocks/p-68c1a093.js +0 -1
  245. package/dist/sankhyablocks/p-6a4b21dd.js +0 -1
  246. package/dist/sankhyablocks/p-6ae7543b.entry.js +0 -1
  247. package/dist/sankhyablocks/p-6e278003.js +0 -60
  248. package/dist/sankhyablocks/p-82bcb4cf.entry.js +0 -1
  249. package/dist/sankhyablocks/p-84345e7a.js +0 -1
  250. package/dist/sankhyablocks/p-95af0bb1.entry.js +0 -1
  251. package/dist/sankhyablocks/p-a905712a.entry.js +0 -1
  252. package/dist/sankhyablocks/p-aff2d081.entry.js +0 -1
  253. package/dist/sankhyablocks/p-b0a357b4.entry.js +0 -1
  254. package/dist/sankhyablocks/p-b568c1d4.js +0 -1
  255. package/dist/sankhyablocks/p-bab4cde4.entry.js +0 -1
  256. package/dist/sankhyablocks/p-bd3c1aaa.entry.js +0 -1
  257. package/dist/sankhyablocks/p-cc64239c.entry.js +0 -1
  258. package/dist/sankhyablocks/p-cd00a3d1.entry.js +0 -1
  259. package/dist/sankhyablocks/p-d9ec8c4b.entry.js +0 -1
  260. package/dist/sankhyablocks/p-dbdbb77a.entry.js +0 -1
  261. package/dist/sankhyablocks/p-e8df1dea.entry.js +0 -1
  262. package/dist/sankhyablocks/p-ef9343c3.entry.js +0 -1
  263. package/dist/sankhyablocks/p-f4184ce7.js +0 -1
@@ -1,403 +0,0 @@
1
- import { h, r as registerInstance, e as createEvent, g as getElement } from './index-04f73a26.js';
2
- import { S as SelectedItemType } from './index-620ac460.js';
3
- import { UserInterface, JSUtils, ElementIDUtils, ApplicationContext, StringUtils, DataType } from '@sankhyalabs/core';
4
- import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
5
- import { b as FilterConfigType, c as FilterEntities, d as FilterUserConfigTypes } from './index-8acbae97.js';
6
- import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-d2439a9a.js';
7
- import './filter-item-type.enum-d45e026f.js';
8
-
9
- const ICON_MODES = {
10
- [UserInterface.SHORTTEXT]: 'text',
11
- [UserInterface.LONGTEXT]: 'text',
12
- [UserInterface.INTEGERNUMBER]: 'number',
13
- [UserInterface.DECIMALNUMBER]: 'number',
14
- [UserInterface.DATE]: 'calendar',
15
- [UserInterface.DATETIME]: 'calendar',
16
- [UserInterface.SWITCH]: 'boolean',
17
- [UserInterface.CHECKBOX]: 'check-circle-inverted',
18
- [UserInterface.OPTIONSELECTOR]: 'list',
19
- [UserInterface.SEARCH]: 'search',
20
- [UserInterface.HTML]: 'tag_code',
21
- [UserInterface.IMAGE]: 'png',
22
- [UserInterface.FILE]: 'edit-file',
23
- [UserInterface.TIME]: 'timer-outline',
24
- [UserInterface.ELAPSEDTIME]: 'timer',
25
- [UserInterface.MASKEDTEXT]: 'text',
26
- [UserInterface.PASSWORD]: 'email',
27
- };
28
- const ListItem = ({ userInterface, description }) => {
29
- return (h("ez-icon", { iconName: ICON_MODES[userInterface], class: "ez-padding-left--small", title: description }));
30
- };
31
-
32
- const snkFilterFieldSearchCss = ".sc-snk-filter-field-search-h{--snk-filter-field-search--container-width:468px;--snk-filter-field-search--container-height:322px}.snk-filter-field-search__container.sc-snk-filter-field-search{display:flex;flex-direction:column;padding:var(--space--medium);width:var(--snk-filter-field-search--container-width);height:var(--snk-filter-field-search--container-height)}.snk-filter-field-search__section.sc-snk-filter-field-search{display:grid;grid-template-columns:1fr 1fr;place-items:flex-start;overflow:hidden;gap:var(--space--small)}.snk-filter-field-search__input.sc-snk-filter-field-search{margin-bottom:var(--space--medium)}.snk-filter-field-search__list_container.sc-snk-filter-field-search{display:flex;flex-direction:column}.snk-filter-field-search__list.sc-snk-filter-field-search{overflow-y:auto}";
33
-
34
- const SNK_CONTEXT_KEY = "__SNK__APPLICATION__";
35
- const ENTITY_NAME_PATTERN = /\w+:\/\/(\w+)/;
36
- const SnkFilterFieldSearch = class {
37
- constructor(hostRef) {
38
- registerInstance(this, hostRef);
39
- this.ezSelectFilterItem = createEvent(this, "ezSelectFilterItem", 7);
40
- this._currentMetadata = null;
41
- this._filterText = "";
42
- this._isLoading = false;
43
- this.searchable = true;
44
- this.fieldsDataSource = undefined;
45
- this.breadcrumbItems = [];
46
- this.linkItems = [];
47
- this.fieldItems = [];
48
- this.searchEmpty = false;
49
- this.groupEmpty = false;
50
- }
51
- /**
52
- * /**
53
- * Realiza a abertura do componente abaixo do elemento HTML informado
54
- * e faz a primeira carga de dados.
55
- *
56
- * @param {HTMLElement} element - Elemento HTML onde o snk-filter-field-search irá se posicionar abaixo.
57
- * @param {IEzPopoverAnchorOptions} options - opções para regular o posicionamento do componente.
58
- */
59
- async show(element, options) {
60
- var _a;
61
- if (element) {
62
- (_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.showUnder(element, options);
63
- }
64
- else {
65
- this._ezPopover.show();
66
- }
67
- return this.loadData();
68
- }
69
- /**
70
- * Filtra a fonte de dados do componente.
71
- * @param {string} filterText - Texto para filtrar a fonte de dados.
72
- * @throws {Error} - Quando o componente estiver com a propriedade searchable como true.
73
- */
74
- async applyFilter(filterText) {
75
- if (this.searchable)
76
- throw new Error('This method is not available when searchable is true');
77
- this.handleFilterChange(filterText);
78
- }
79
- async loadData() {
80
- var _a, _b;
81
- this._isLoading = true;
82
- let metadata = await this.fieldsDataSource.fetchData(this._currentLink);
83
- this._currentLink = metadata.currentLink;
84
- const { fields, links } = metadata || {};
85
- if (!Array.isArray(fields) || !Array.isArray(links))
86
- throw new Error('Invalid metadata');
87
- this._currentMetadata = metadata;
88
- this.mapDataSourceToLinkItems();
89
- this.mapDataSourceToFieldItems();
90
- this._isLoading = false;
91
- (_a = this._ezFieldList) === null || _a === void 0 ? void 0 : _a.scrollToTop();
92
- (_b = this._ezLinkList) === null || _b === void 0 ? void 0 : _b.scrollToTop();
93
- }
94
- mapDataSourceToLinkItems() {
95
- var _a;
96
- const { links } = this._currentMetadata;
97
- const filterLinkLabelMessage = this.getMessage('snkFilterFieldSearch.linkLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
98
- const items = links.map(link => (Object.assign({ label: link.description }, link)));
99
- this.groupEmpty = Boolean(items.length === 0);
100
- this.linkItems = [{
101
- group: filterLinkLabelMessage,
102
- items,
103
- }];
104
- if (this.breadcrumbItems.length === 0) {
105
- this.breadcrumbItems = [Object.assign({ id: JSUtils.generateUUID(), label: this._currentLink.description }, this._currentLink)];
106
- }
107
- }
108
- mapDataSourceToFieldItems() {
109
- var _a;
110
- const fields = this._currentMetadata.fields;
111
- const filterFieldLabelMessage = this.getMessage('snkFilterFieldSearch.fieldLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
112
- const filteredFields = fields.filter(field => {
113
- if (!this._currentLink)
114
- return true;
115
- const searchableByDescription = field.description.toLowerCase().includes(this._filterText.toLowerCase());
116
- const searchableByName = field.name.toLowerCase().includes(this._filterText.toLowerCase());
117
- return searchableByDescription || searchableByName;
118
- });
119
- const items = filteredFields.map(field => (Object.assign({ label: field.description }, field)));
120
- this.searchEmpty = Boolean(this._filterText && items.length === 0);
121
- this.fieldItems = [{
122
- group: filterFieldLabelMessage,
123
- items
124
- }];
125
- }
126
- handleFilterChange(filterText) {
127
- if (this._isLoading)
128
- return;
129
- this._filterText = filterText;
130
- this.mapDataSourceToFieldItems();
131
- }
132
- handleSelectLink({ detail: item }) {
133
- if (this._isLoading)
134
- return;
135
- const breadcrumbByIndex = this.breadcrumbItems.findIndex(breadcrumbItem => breadcrumbItem.id === item.id);
136
- if (breadcrumbByIndex > -1) {
137
- this.breadcrumbItems = this.breadcrumbItems.slice(0, (breadcrumbByIndex + 1));
138
- }
139
- else {
140
- this.breadcrumbItems = [...this.breadcrumbItems, Object.assign({ id: JSUtils.generateUUID(), label: item.description }, item)];
141
- }
142
- const selectedItem = Object.assign(Object.assign({}, item), { type: SelectedItemType.LINK });
143
- this._currentLink = selectedItem;
144
- this.ezSelectFilterItem.emit(selectedItem);
145
- this.loadData();
146
- }
147
- getEntityFromBreadCrumbItem(item) {
148
- const result = ENTITY_NAME_PATTERN.exec(item.uri);
149
- if (!result) {
150
- return undefined;
151
- }
152
- return result[1];
153
- }
154
- handleSelectField({ detail: item }) {
155
- var _a;
156
- const breadcrumbPath = this.breadcrumbItems.map(breadcrumbItem => breadcrumbItem.label).join('>>');
157
- const selectedField = Object.assign(Object.assign({}, item), { type: SelectedItemType.FIELD, entityPath: this.breadcrumbItems.map(item => this.getEntityFromBreadCrumbItem(item)).filter(item => item != undefined), path: `${breadcrumbPath} >> ${item.description}` });
158
- this.ezSelectFilterItem.emit(selectedField);
159
- (_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
160
- }
161
- getElementID(sufix) {
162
- return {
163
- [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
164
- };
165
- }
166
- /**
167
- * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
168
- * através de um pequeno modulo na estrutura da aplicação:
169
- * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
170
- * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-field-search.msg.ts"
171
- */
172
- getMessage(key, params) {
173
- var _a, _b, _c;
174
- if (!this._application)
175
- this._application = ApplicationContext.getContextValue(SNK_CONTEXT_KEY);
176
- return (_c = (_b = (_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage) === null || _c === void 0 ? void 0 : _c.call(_b, key, params);
177
- }
178
- ;
179
- componentWillLoad() {
180
- this._application = ApplicationContext.getContextValue(SNK_CONTEXT_KEY);
181
- }
182
- componentDidLoad() {
183
- ElementIDUtils.addIDInfoIfNotExists(this._ezPopover, 'popover');
184
- }
185
- disconnectedCallback() {
186
- var _a;
187
- (_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
188
- }
189
- render() {
190
- var _a;
191
- const searchLabelMessage = this.getMessage('snkFilterFieldSearch.searchLabel');
192
- return (h("ez-popover", Object.assign({ ref: (el) => this._ezPopover = el, role: "dialog", overlayType: "none", "aria-hidden": !((_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.opened) }, this.getElementID('EzPopover')), h("div", { class: "snk-filter-field-search__container" }, h("header", { class: "snk-filter-field-search__header" }, this.searchable && !!searchLabelMessage && (h("ez-filter-input", Object.assign({ class: "snk-filter-field-search__input", label: searchLabelMessage, asyncSearch: true, canShowError: false, onEzSearching: (event) => this.handleFilterChange.bind(this)(event.detail), "aria-label": searchLabelMessage, "aria-required": "false", "aria-invalid": "false" }, this.getElementID('EzFilterInput')))), this.breadcrumbItems.length > 0 && (h("ez-breadcrumb", Object.assign({ items: this.breadcrumbItems, onSelectedItem: this.handleSelectLink.bind(this), role: "navigation", "aria-current": "step" }, this.getElementID('EzBreadcrumb')))), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })), h("section", { class: `snk-filter-field-search__section ${(this.groupEmpty && this.searchEmpty) && " ez-margin--auto"}` }, this.groupEmpty ?
193
- h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--medium" }, this.getMessage('snkFilterFieldSearch.groupEmpty')))
194
- :
195
- h("ez-list", Object.assign({ ref: (el) => this._ezLinkList = el, class: "snk-filter-field-search__list", id: "filterLinkList", useGroups: true, dataSource: this.linkItems, onEzSelectItem: this.handleSelectLink.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: listItem => h("ez-badge", { label: listItem.fieldCount }), "aria-describedby": "filterLinkLabel" }, this.getElementID('EzListLinks'))), this.searchEmpty ?
196
- h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--medium" }, this.getMessage('snkFilterFieldSearch.searchEmpty')))
197
- :
198
- h("ez-list", Object.assign({ ref: (el) => this._ezFieldList = el, class: "snk-filter-field-search__list", id: "filterFieldList", useGroups: true, dataSource: this.fieldItems, onEzSelectItem: this.handleSelectField.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: ListItem, "aria-describedby": "filterFieldLabel" }, this.getElementID('EzListFields')))))));
199
- }
200
- };
201
- SnkFilterFieldSearch.style = snkFilterFieldSearchCss;
202
-
203
- const snkFilterParamConfigCss = ":host{--snk-filter-param-config__expression--color:var(--title--primary, #2b3a54);display:flex;position:relative}.snk-filter-param-config__expression{--text-area__input--disabled--color:var(--snk-filter-param-config__expression--color)}";
204
-
205
- const SnkFilterParamConfig = class {
206
- constructor(hostRef) {
207
- registerInstance(this, hostRef);
208
- this._opened = false;
209
- this._configType = FilterConfigType.SYSTEM_CONFIG;
210
- this._expressionItem = undefined;
211
- this._informedInstance = false;
212
- this._canSave = false;
213
- this.messagesBuilder = undefined;
214
- }
215
- /**
216
- * Abre o modal de configuração de valor variável
217
- */
218
- open(expressionItem) {
219
- this._opened = true;
220
- this._expressionItem = expressionItem;
221
- this.loadValues();
222
- return new Promise(accept => {
223
- this._promiseResolver = accept;
224
- });
225
- }
226
- /**
227
- * Fecha o modal de configuração de valor variável
228
- */
229
- close() {
230
- this._opened = false;
231
- return new Promise(accept => {
232
- this._promiseResolver = accept;
233
- });
234
- }
235
- /**
236
- * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
237
- * através de um pequeno modulo na estrutura da aplicação:
238
- * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
239
- * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-param-config.msg.ts"
240
- */
241
- getMessage(key, params) {
242
- var _a;
243
- return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
244
- }
245
- getConfigValue(configName, inputName, inputAlias = "") {
246
- var _a, _b, _c;
247
- return ((_b = (_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a[configName]) === null || _b === void 0 ? void 0 : _b[inputName])
248
- || ((_c = this._expressionItem) === null || _c === void 0 ? void 0 : _c[inputAlias || inputName]);
249
- }
250
- loadValues() {
251
- var _a;
252
- const entityName = this.getConfigValue("systemConfig", "entity", "entityName");
253
- const fieldName = this.getConfigValue("systemConfig", "fieldName");
254
- const description = this.getConfigValue("userConfig", "description");
255
- const type = this.getConfigValue("userConfig", "type");
256
- if (((_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a.userConfig) != undefined) {
257
- this._configType = FilterConfigType.USER_CONFIG;
258
- }
259
- else {
260
- this._configType = FilterConfigType.SYSTEM_CONFIG;
261
- }
262
- if (!StringUtils.isEmpty(entityName) && !StringUtils.isEmpty(fieldName)) {
263
- this._instanceElement.value = { value: entityName, label: "" };
264
- this._fieldElement.value = { value: fieldName, label: "" };
265
- }
266
- if (!StringUtils.isEmpty(description) && !StringUtils.isEmpty(type)) {
267
- this._descriptionElement.value = description;
268
- this._typeElement.value = type;
269
- }
270
- this.buildFilterExpression();
271
- }
272
- changeDefinitionUsed(option) {
273
- this._configType = option !== null && option !== void 0 ? option : FilterConfigType.SYSTEM_CONFIG;
274
- if (this._configType === FilterConfigType.SYSTEM_CONFIG) {
275
- const entityName = this.getConfigValue("systemConfig", "entity", "entityName");
276
- const fieldName = this.getConfigValue("systemConfig", "fieldName");
277
- this._instanceElement.value = this._instanceElement.value || { value: entityName, label: "" };
278
- this._fieldElement.value = this._fieldElement.value || { value: fieldName, label: "" };
279
- }
280
- else if (this._configType === FilterConfigType.USER_CONFIG) {
281
- const description = this.getConfigValue("userConfig", "description");
282
- const type = this.getConfigValue("userConfig", "type");
283
- this._descriptionElement.value = this._descriptionElement.value || description;
284
- this._typeElement.value = this._typeElement.value || type;
285
- }
286
- this.buildFilterExpression();
287
- }
288
- getTypeValue() {
289
- var _a;
290
- const value = (_a = this._typeElement) === null || _a === void 0 ? void 0 : _a.value;
291
- return ((value === null || value === void 0 ? void 0 : value.value) || value);
292
- }
293
- getExpressionValues() {
294
- var _a, _b, _c, _d, _e;
295
- let systemConfig;
296
- let userConfig;
297
- if (this._configType === FilterConfigType.SYSTEM_CONFIG) {
298
- const entity = (_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value;
299
- const fieldName = (_d = (_c = this._fieldElement) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.value;
300
- systemConfig = { entity, fieldName };
301
- }
302
- else if (this._configType === FilterConfigType.USER_CONFIG) {
303
- const description = (_e = this._descriptionElement) === null || _e === void 0 ? void 0 : _e.value;
304
- const type = this.getTypeValue();
305
- userConfig = { description, type };
306
- }
307
- return Object.assign(Object.assign(Object.assign({}, this._expressionItem), { systemConfig }), { userConfig });
308
- }
309
- isEnabled(value) {
310
- return this._configType === value;
311
- }
312
- isInformedInstance() {
313
- var _a, _b;
314
- return !StringUtils.isEmpty((_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value);
315
- }
316
- save() {
317
- var _a;
318
- this._expressionItem = Object.assign(Object.assign({}, this.getExpressionValues()), { expression: (_a = this._expressionElement) === null || _a === void 0 ? void 0 : _a.value });
319
- this._promiseResolver(this._expressionItem);
320
- this._opened = false;
321
- }
322
- buildFilterExpression() {
323
- var _a;
324
- this._informedInstance = this.isInformedInstance();
325
- const expression = PersonalizedFilterUtils.buildFilterExpression(this.getExpressionValues());
326
- this._expressionElement.value = expression || ((_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a.expression);
327
- this._canSave = this.getCanSave();
328
- }
329
- handleChangeInstance() {
330
- this._informedInstance = this.isInformedInstance();
331
- if (this._fieldElement != undefined && !StringUtils.isEmpty(this._fieldElement.value)) {
332
- this._fieldElement.value = null;
333
- }
334
- this.buildFilterExpression();
335
- }
336
- getInstanceCriteria() {
337
- var _a, _b;
338
- const value = (_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value;
339
- return {
340
- expression: "this.NOMETAB = (SELECT NOMETAB FROM TDDINS WHERE NOMEINSTANCIA = ?)",
341
- params: [
342
- {
343
- name: "NOMEINSTANCIA",
344
- dataType: DataType.TEXT,
345
- value
346
- }
347
- ]
348
- };
349
- }
350
- onSearch({ mode, argument }, entity) {
351
- if (this._application == undefined || !this._opened) {
352
- return;
353
- }
354
- const isField = entity === FilterEntities.FIELD;
355
- const criteria = isField ? this.getInstanceCriteria() : undefined;
356
- const messageKey = `snkFilterParamConfig.label${isField ? "Field" : "Instance"}`;
357
- const entityDescription = this.getMessage(messageKey);
358
- const searchOptions = {
359
- descriptionFieldName: isField ? "DESCRCAMPO" : "DESCRINSTANCIA",
360
- codeFieldName: isField ? "NOMECAMPO" : "NOMEINSTANCIA",
361
- showInactives: false
362
- };
363
- const options = {
364
- entity,
365
- entityDescription,
366
- criteria,
367
- searchOptions
368
- };
369
- return new Promise((resolve) => {
370
- this._application.executePreparedSearch(mode, argument, options).then(res => resolve(res));
371
- });
372
- }
373
- getElementID(sufix) {
374
- return {
375
- [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
376
- };
377
- }
378
- getCanSave() {
379
- var _a;
380
- if (this._configType === FilterConfigType.USER_CONFIG) {
381
- const description = (_a = this._descriptionElement) === null || _a === void 0 ? void 0 : _a.value;
382
- const type = this.getTypeValue();
383
- return !StringUtils.isEmpty(description) && !StringUtils.isEmpty(type);
384
- }
385
- return true;
386
- }
387
- componentWillLoad() {
388
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
389
- }
390
- render() {
391
- ElementIDUtils.addIDInfoIfNotExists(this._element, 'snkFilterParamConfig');
392
- return (h("ez-popup", Object.assign({ useHeader: false, size: "small", heightMode: "auto", opened: this._opened }, this.getElementID("popup")), h("ez-modal-container", Object.assign({ onEzModalAction: (evt) => {
393
- if (evt.detail === ModalAction.CLOSE)
394
- this.close();
395
- }, modalTitle: this.getMessage("snkFilterParamConfig.modalTitle") }, this.getElementID("modalContainer")), h("div", { class: "ez-flex" }, h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("systemConfigOption")), h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelSystemConfig"), value: FilterConfigType.SYSTEM_CONFIG })), h("ez-search", Object.assign({ ref: (ref) => this._instanceElement = ref, label: this.getMessage("snkFilterParamConfig.labelInstance"), enabled: this.isEnabled(FilterConfigType.SYSTEM_CONFIG), suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.handleChangeInstance(), optionLoader: (searchArgument) => this.onSearch(searchArgument, FilterEntities.INSTANCE) }, this.getElementID("configFindEntity"))), h("ez-search", Object.assign({ ref: (ref) => this._fieldElement = ref, label: this.getMessage("snkFilterParamConfig.labelField"), enabled: this.isEnabled(FilterConfigType.SYSTEM_CONFIG) && this._informedInstance, suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.buildFilterExpression(), optionLoader: (searchArgument) => this.onSearch(searchArgument, FilterEntities.FIELD) }, this.getElementID("configFindField")))), h("div", { class: "ez-flex ez-padding--medium" }, h("hr", { class: "ez-divider-vertical" })), h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("userConfigOption")), h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelUserConfig"), value: FilterConfigType.USER_CONFIG })), h("ez-text-input", Object.assign({ ref: (ref) => this._descriptionElement = ref, label: this.getMessage("snkFilterParamConfig.labelDescription"), enabled: this.isEnabled(FilterConfigType.USER_CONFIG), onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamLabel"))), h("ez-combo-box", Object.assign({ ref: (ref) => this._typeElement = ref, label: this.getMessage("snkFilterParamConfig.labelType"), enabled: this.isEnabled(FilterConfigType.USER_CONFIG), suppressEmptyOption: true, onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamType")), Object.keys(FilterUserConfigTypes).map((configType) => {
396
- return (h("option", { value: FilterUserConfigTypes[configType] }, this.getMessage(`snkFilterParamConfig.labelTypeValues.${configType.toLowerCase()}`)));
397
- })))), h("ez-text-area", Object.assign({ ref: (ref) => this._expressionElement = ref, class: "snk-filter-param-config__expression", label: this.getMessage("snkFilterParamConfig.labelExpression"), enabled: false }, this.getElementID("presentationExpression"))), h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, h("ez-button", Object.assign({ class: "ez-padding-right--medium", label: this.getMessage("snkFilterParamConfig.labelCancel"), onClick: () => this.close() }, this.getElementID("cancelEditParam"))), h("ez-button", Object.assign({ class: "ez-button--primary", label: this.getMessage("snkFilterParamConfig.labelSave"), onClick: () => this.save(), enabled: this._canSave }, this.getElementID("saveEditParam")))))));
398
- }
399
- get _element() { return getElement(this); }
400
- };
401
- SnkFilterParamConfig.style = snkFilterParamConfigCss;
402
-
403
- export { SnkFilterFieldSearch as snk_filter_field_search, SnkFilterParamConfig as snk_filter_param_config };
@@ -1,105 +0,0 @@
1
- import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-04f73a26.js';
2
- import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
- import { C as ConfigStorage } from './ConfigStorage-76872695.js';
4
- import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
6
- import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
7
- import './form-config-fetcher-b44b2727.js';
8
- import './DataFetcher-e60f8d53.js';
9
- import './PrintUtils-3e4ff0f5.js';
10
- import './SnkMessageBuilder-1eb7a1af.js';
11
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
-
13
- const snkFilterModalItemCss = ".grow{flex-grow:1}.gap{gap:4px}";
14
-
15
- const SnkFilterModalItem = class {
16
- constructor(hostRef) {
17
- registerInstance(this, hostRef);
18
- this.filterChange = createEvent(this, "filterChange", 7);
19
- this.editPersonalizedFilter = createEvent(this, "editPersonalizedFilter", 7);
20
- this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
21
- this.filterItem = undefined;
22
- this.configName = undefined;
23
- this.resourceID = undefined;
24
- }
25
- getContentEditorConfig() {
26
- const props = { presentationMode: EPresentationMode.MODAL };
27
- switch (this.filterItem.type) {
28
- case FilterItemType.BINARY_SELECT:
29
- return { tag: "snk-filter-binary-select", props };
30
- case FilterItemType.MULTI_SELECT:
31
- return { tag: "snk-filter-multi-select" };
32
- case FilterItemType.PERIOD:
33
- return { tag: "snk-filter-period", props };
34
- case FilterItemType.SEARCH:
35
- return { tag: "snk-filter-search" };
36
- case FilterItemType.NUMBER:
37
- return { tag: "snk-filter-number", props };
38
- case FilterItemType.PERSONALIZED:
39
- return this.buildSnkFilterPersonalizedProps();
40
- case FilterItemType.CHECK_BOX_LIST:
41
- return { tag: "snk-filter-checkbox-list", props };
42
- case FilterItemType.MULTI_LIST:
43
- return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
44
- }
45
- return { tag: "snk-filter-text" };
46
- }
47
- buildSnkFilterPersonalizedProps() {
48
- return {
49
- tag: "snk-personalized-filter-editor", props: {
50
- onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
51
- onAddFilter: () => this.addPersonalizedFilter.emit(),
52
- }
53
- };
54
- }
55
- isVisible(newValue) {
56
- return !this.filterItem.visible ? newValue !== undefined : true;
57
- }
58
- updateFilterValue(data) {
59
- var _a, _b;
60
- const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
61
- if (this.filterItem.groupedItems != undefined) {
62
- this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
63
- }
64
- else {
65
- this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === (FilterItemType.SEARCH || FilterItemType.CHECK_BOX_LIST) ? data : newValue, visible: this.isVisible(newValue) });
66
- }
67
- this._editor && (this._editor["config"] = this.filterItem);
68
- (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
69
- this.filterChange.emit(this.filterItem);
70
- }
71
- handleDeleteFilter(filter, filterItemType) {
72
- if (filterItemType === FilterItemType.PERSONALIZED) {
73
- ConfigStorage.removePersonalizedFilter(filter, this.resourceID, this.configName);
74
- }
75
- }
76
- componentDidLoad() {
77
- if (this._element) {
78
- ElementIDUtils.addIDInfo(this._element);
79
- const dataElementIdDoFilterItem = this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
80
- this._idContentEditor = `${dataElementIdDoFilterItem}_${this.filterItem.id}`;
81
- }
82
- }
83
- buildRightSlot(item) {
84
- return (h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) }));
85
- }
86
- removeValueFromConfig(item) {
87
- var _a, _b, _c;
88
- const index = (_b = (_a = this.filterItem) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.findIndex(({ id }) => id === item.id);
89
- const filterItemCopy = ObjectUtils.copy(this.filterItem);
90
- (_c = filterItemCopy === null || filterItemCopy === void 0 ? void 0 : filterItemCopy.value) === null || _c === void 0 ? void 0 : _c.splice(index, 1);
91
- this.updateFilterValue(filterItemCopy.value);
92
- }
93
- canShowDetailModal() {
94
- const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
95
- return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
96
- }
97
- render() {
98
- const { tag: ContentEditor, props } = this.getContentEditorConfig();
99
- return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin-bottom--extra-small", htmlFor: `filter-item-${this.filterItem.id}` }, this.filterItem.detailModal)), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, id: `filter-item-${this.filterItem.id}`, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
100
- }
101
- get _element() { return getElement(this); }
102
- };
103
- SnkFilterModalItem.style = snkFilterModalItemCss;
104
-
105
- export { SnkFilterModalItem as snk_filter_modal_item };
@@ -1,156 +0,0 @@
1
- import { r as registerInstance, e as createEvent, h, f as Host } from './index-04f73a26.js';
2
- import { Action, ApplicationContext } from '@sankhyalabs/core';
3
- import { S as SnkMessageBuilder } from './SnkMessageBuilder-1eb7a1af.js';
4
- import { b as base64ToBlob, s as sessionFileUpload, a as buildFileKey, g as getPKs, d as downloadImage } from './ImageUtils-efbea0e4.js';
5
-
6
- const snkImageInputCss = ":host{display:block}";
7
-
8
- const SnkImageInput = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.imageError = createEvent(this, "imageError", 7);
12
- this.dataUnitObserver = async (action) => {
13
- var _a;
14
- const actionsMoveSelection = [Action.NEXT_SELECTED, Action.PREVIOUS_SELECTED];
15
- if (actionsMoveSelection.includes(action.type)) {
16
- await this.loadImage();
17
- return;
18
- }
19
- const selection = ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.selection) || [];
20
- if (action.type === Action.SELECTION_CHANGED && selection.length > 0) {
21
- await this.loadImage();
22
- return;
23
- }
24
- if (action.type === Action.RECORDS_ADDED) {
25
- await this.clearImage();
26
- return;
27
- }
28
- if (action.type === Action.EDITION_CANCELED) {
29
- await this.loadImage();
30
- return;
31
- }
32
- };
33
- this.dataUnit = undefined;
34
- this.fieldName = undefined;
35
- this.entityName = undefined;
36
- this.enabled = true;
37
- this.acceptType = undefined;
38
- this.maxSize = undefined;
39
- this.label = undefined;
40
- this.imageValue = undefined;
41
- this.loading = true;
42
- }
43
- /**
44
- * Força o reload da imagem
45
- */
46
- async reloadImage(pks) {
47
- await this.loadImage(pks);
48
- }
49
- getMessage(key, params) {
50
- if (!this.messagesBuilder) {
51
- this.messagesBuilder = new SnkMessageBuilder();
52
- }
53
- return this.messagesBuilder.getMessage(key, params);
54
- }
55
- async clearImage() {
56
- var _a;
57
- (_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
58
- this.imageValue = undefined;
59
- }
60
- async handleImageChange(event) {
61
- const base64 = event.detail;
62
- if (!base64) {
63
- await this.clearImage();
64
- await this.updatedataUnitField(true);
65
- return;
66
- }
67
- const blob = await base64ToBlob(base64);
68
- if (this.maxSize && blob.size > this.maxSize * 1024) {
69
- const errorMsg = this.getMessage('snkImageInput.errorImageSize') + this.maxSize + '(KB)';
70
- this.imageError.emit(errorMsg);
71
- if (this.application) {
72
- await this.application.error(this.getMessage('snkImageInput.errorTitle'), errorMsg);
73
- }
74
- return;
75
- }
76
- this.imageValue = base64;
77
- await sessionFileUpload(blob, this.entityName, this.fieldName);
78
- await this.updatedataUnitField();
79
- }
80
- async updatedataUnitField(deleted = false) {
81
- if (!this.dataUnit || !this.dataUnit.getSelectedRecord()) {
82
- return;
83
- }
84
- if (deleted) {
85
- await this.dataUnit.setFieldValue(this.fieldName, 'deletado');
86
- }
87
- else {
88
- await this.dataUnit.setFieldValue(this.fieldName, `$file.session.key{${buildFileKey(this.entityName, this.fieldName)}}`);
89
- }
90
- }
91
- async handleImageError(event) {
92
- this.imageError.emit(event.detail);
93
- if (this.application) {
94
- await this.application.error(this.getMessage('snkImageInput.errorTitle'), event.detail);
95
- }
96
- }
97
- getPksFromDataUnit() {
98
- if (!this.dataUnit) {
99
- return undefined;
100
- }
101
- const selectedRecord = this.dataUnit.getSelectedRecord();
102
- if (!selectedRecord) {
103
- return undefined;
104
- }
105
- const fieldValue = selectedRecord[this.fieldName];
106
- if (!fieldValue) {
107
- return undefined;
108
- }
109
- try {
110
- const pk = JSON.parse(fieldValue);
111
- return pk;
112
- }
113
- catch (error) {
114
- console.error('Error parsing PK from data unit field:', error);
115
- return undefined;
116
- }
117
- }
118
- async loadImage(pks) {
119
- var _a, _b;
120
- (_a = this._loadAbortController) === null || _a === void 0 ? void 0 : _a.abort();
121
- const controller = new AbortController();
122
- this._loadAbortController = controller;
123
- this.loading = true;
124
- if (this.dataUnit && this.entityName) {
125
- pks = (_b = pks !== null && pks !== void 0 ? pks : this.getPksFromDataUnit()) !== null && _b !== void 0 ? _b : getPKs(this.dataUnit);
126
- const image = await downloadImage(pks, this.fieldName, this.entityName, controller.signal);
127
- if (controller.signal.aborted)
128
- return;
129
- this.imageValue = image;
130
- }
131
- this.loading = false;
132
- }
133
- async componentWillLoad() {
134
- this.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
135
- if (!this.messagesBuilder) {
136
- this.messagesBuilder = new SnkMessageBuilder();
137
- }
138
- if (this.dataUnit) {
139
- this.dataUnit.subscribe(this.dataUnitObserver);
140
- }
141
- }
142
- disconnectedCallback() {
143
- if (this.dataUnit) {
144
- this.dataUnit.unsubscribe(this.dataUnitObserver);
145
- }
146
- }
147
- async componentDidLoad() {
148
- await this.loadImage();
149
- }
150
- render() {
151
- return (h(Host, null, h("ez-image-input", { enabled: this.enabled, label: this.label, name: this.fieldName, value: this.imageValue, maxFileSize: this.maxSize ? this.maxSize * 1024 : undefined, accept: this.acceptType || 'image/png,image/jpeg,image/gif', onEzChange: (e) => this.handleImageChange(e), onEzError: (e) => this.handleImageError(e), loading: this.loading })));
152
- }
153
- };
154
- SnkImageInput.style = snkImageInputCss;
155
-
156
- export { SnkImageInput as snk_image_input };