@sankhyalabs/sankhyablocks 5.19.1 → 6.0.1

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 (298) hide show
  1. package/dist/cjs/ConfigStorage-0a738cdc.js +304 -0
  2. package/dist/cjs/IExpressionItem-1090c3fd.js +7 -0
  3. package/dist/cjs/PersonalizedFilterUtils-7d959e91.js +229 -0
  4. package/dist/cjs/{SnkFormConfigManager-69df3f74.js → SnkFormConfigManager-a583f503.js} +1 -1
  5. package/dist/cjs/{SnkMessageBuilder-3b5b5614.js → SnkMessageBuilder-8a2d3f26.js} +65 -4
  6. package/dist/cjs/{filter-bar-config-fetcher-a14536bf.js → filter-bar-config-fetcher-75219599.js} +34 -11
  7. package/dist/cjs/{index-de79181a.js → index-59a3e2de.js} +1 -1
  8. package/dist/cjs/{index-f400b1d6.js → index-614af008.js} +2 -0
  9. package/dist/cjs/{index-21bd01e1.js → index-aaaa2af5.js} +6 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  14. package/dist/cjs/snk-application.cjs.entry.js +4 -4
  15. package/dist/cjs/snk-attach.cjs.entry.js +4 -4
  16. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-crud.cjs.entry.js +4 -4
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
  21. package/dist/cjs/{snk-data-unit-e9c20097.js → snk-data-unit-53fc9200.js} +2 -2
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
  24. package/dist/cjs/snk-entity-list.cjs.entry.js +6 -4
  25. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  26. package/dist/cjs/snk-expression-group.cjs.entry.js +246 -0
  27. package/dist/cjs/{snk-filter-field-search_2.cjs.entry.js → snk-expression-item_3.cjs.entry.js} +327 -66
  28. package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
  29. package/dist/cjs/snk-filter-bar.cjs.entry.js +162 -72
  30. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  31. package/dist/cjs/snk-filter-detail.cjs.entry.js +54 -69
  32. package/dist/cjs/snk-filter-item.cjs.entry.js +21 -7
  33. package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
  34. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +57 -29
  35. package/dist/cjs/snk-filter-modal.cjs.entry.js +67 -13
  36. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  37. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  38. package/dist/cjs/snk-filter-period.cjs.entry.js +5 -3
  39. package/dist/cjs/snk-filter-personalized.cjs.entry.js +135 -55
  40. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  41. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  42. package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
  43. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  44. package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
  45. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  46. package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
  47. package/dist/cjs/snk-grid.cjs.entry.js +7 -7
  48. package/dist/cjs/{snk-guides-viewer-c8843478.js → snk-guides-viewer-10ffca10.js} +5 -5
  49. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  50. package/dist/cjs/snk-personalized-filter.cjs.entry.js +166 -94
  51. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  52. package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
  53. package/dist/cjs/snk-simple-bar.cjs.entry.js +45 -0
  54. package/dist/cjs/{snk-simple-bar_2.cjs.entry.js → snk-simple-crud.cjs.entry.js} +5 -43
  55. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  56. package/dist/cjs/snk-taskbar.cjs.entry.js +4 -4
  57. package/dist/cjs/{taskbar-elements-3be287d6.js → taskbar-elements-068aa945.js} +3 -3
  58. package/dist/cjs/{taskbar-processor-02f0fc84.js → taskbar-processor-6442c585.js} +1 -1
  59. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  60. package/dist/collection/collection-manifest.json +2 -1
  61. package/dist/collection/components/snk-entity-list/snk-entity-list.js +6 -4
  62. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +34 -12
  63. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +4 -2
  64. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.css +66 -0
  65. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.js +370 -0
  66. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +52 -68
  67. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +20 -6
  68. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +15 -15
  69. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +111 -11
  70. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +98 -27
  71. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +21 -0
  72. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +100 -49
  73. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js +1 -0
  74. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +23 -3
  75. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +96 -0
  76. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css +1 -1
  77. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +27 -6
  78. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +39 -2
  79. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +276 -30
  80. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css +73 -0
  81. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +443 -0
  82. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +16 -24
  83. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +18 -4
  84. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +131 -21
  85. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.js +0 -0
  86. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.js +5 -1
  87. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.js +1 -0
  88. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.js +1 -0
  89. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +3 -0
  90. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +1 -1
  91. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +184 -15
  92. package/dist/collection/lib/@types/index.js +2 -0
  93. package/dist/collection/lib/configs/ConfigStorage.js +15 -0
  94. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +36 -13
  95. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +106 -4
  96. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +15 -2
  97. package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js +2 -0
  98. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +48 -2
  99. package/dist/components/ConfigStorage.js +180 -1
  100. package/dist/components/PersonalizedFilterUtils.js +227 -0
  101. package/dist/components/SnkMessageBuilder.js +65 -4
  102. package/dist/components/filter-bar-config-fetcher.js +34 -11
  103. package/dist/components/index.d.ts +2 -1
  104. package/dist/components/index.js +1 -0
  105. package/dist/components/index2.js +3 -1
  106. package/dist/components/snk-crud.js +65 -35
  107. package/dist/components/snk-data-exporter2.js +1 -1
  108. package/dist/components/snk-detail-view2.js +99 -44
  109. package/dist/components/snk-entity-list.js +6 -4
  110. package/dist/components/snk-expression-group.d.ts +11 -0
  111. package/dist/components/snk-expression-group.js +6 -0
  112. package/dist/components/snk-expression-group2.js +296 -0
  113. package/dist/components/snk-expression-item2.js +133 -46
  114. package/dist/components/snk-filter-bar2.js +196 -68
  115. package/dist/components/snk-filter-detail2.js +52 -68
  116. package/dist/components/snk-filter-field-search2.js +26 -5
  117. package/dist/components/snk-filter-item2.js +20 -6
  118. package/dist/components/snk-filter-modal-item2.js +54 -27
  119. package/dist/components/snk-filter-modal.js +69 -13
  120. package/dist/components/snk-filter-param-config2.js +3 -57
  121. package/dist/components/snk-filter-period.js +4 -2
  122. package/dist/components/snk-filter-personalized.js +139 -58
  123. package/dist/components/snk-grid2.js +52 -16
  124. package/dist/components/snk-personalized-filter.js +1 -153
  125. package/dist/components/snk-personalized-filter2.js +238 -0
  126. package/dist/esm/ConfigStorage-9f4d2e67.js +300 -0
  127. package/dist/esm/IExpressionItem-2e922b2c.js +7 -0
  128. package/dist/esm/PersonalizedFilterUtils-202cd721.js +227 -0
  129. package/dist/esm/{SnkFormConfigManager-e60367a0.js → SnkFormConfigManager-def999fe.js} +1 -1
  130. package/dist/esm/{SnkMessageBuilder-188a38bb.js → SnkMessageBuilder-cc4d1599.js} +65 -4
  131. package/dist/esm/{filter-bar-config-fetcher-edc48f4b.js → filter-bar-config-fetcher-bd2070a3.js} +34 -11
  132. package/dist/esm/{index-cfd4bb13.js → index-8c3d76a6.js} +6 -1
  133. package/dist/esm/{index-507e19ec.js → index-a255b326.js} +3 -1
  134. package/dist/esm/{index-8efbf198.js → index-d60ca0ac.js} +1 -1
  135. package/dist/esm/loader.js +3 -3
  136. package/dist/esm/sankhyablocks.js +3 -3
  137. package/dist/esm/snk-actions-button.entry.js +2 -2
  138. package/dist/esm/snk-actions-form.entry.js +1 -1
  139. package/dist/esm/snk-application.entry.js +4 -4
  140. package/dist/esm/snk-attach.entry.js +4 -4
  141. package/dist/esm/snk-client-confirm.entry.js +1 -1
  142. package/dist/esm/snk-config-options.entry.js +1 -1
  143. package/dist/esm/snk-configurator.entry.js +1 -1
  144. package/dist/esm/snk-crud.entry.js +4 -4
  145. package/dist/esm/snk-data-exporter.entry.js +4 -4
  146. package/dist/esm/{snk-data-unit-79b1583a.js → snk-data-unit-97824457.js} +2 -2
  147. package/dist/esm/snk-data-unit.entry.js +3 -3
  148. package/dist/esm/snk-detail-view.entry.js +10 -10
  149. package/dist/esm/snk-entity-list.entry.js +7 -5
  150. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  151. package/dist/esm/snk-expression-group.entry.js +242 -0
  152. package/dist/esm/{snk-filter-field-search_2.entry.js → snk-expression-item_3.entry.js} +326 -66
  153. package/dist/esm/snk-field-config.entry.js +1 -1
  154. package/dist/esm/snk-filter-bar.entry.js +157 -67
  155. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  156. package/dist/esm/snk-filter-detail.entry.js +55 -70
  157. package/dist/esm/snk-filter-item.entry.js +21 -7
  158. package/dist/esm/snk-filter-list.entry.js +1 -1
  159. package/dist/esm/snk-filter-modal-item.entry.js +57 -29
  160. package/dist/esm/snk-filter-modal.entry.js +67 -13
  161. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  162. package/dist/esm/snk-filter-number.entry.js +1 -1
  163. package/dist/esm/snk-filter-period.entry.js +5 -3
  164. package/dist/esm/snk-filter-personalized.entry.js +135 -55
  165. package/dist/esm/snk-filter-search.entry.js +1 -1
  166. package/dist/esm/snk-filter-text.entry.js +1 -1
  167. package/dist/esm/snk-form-config.entry.js +1 -1
  168. package/dist/esm/snk-form-summary.entry.js +1 -1
  169. package/dist/esm/snk-form-view.entry.js +1 -1
  170. package/dist/esm/snk-form.entry.js +4 -4
  171. package/dist/esm/snk-grid-config.entry.js +3 -3
  172. package/dist/esm/snk-grid.entry.js +7 -7
  173. package/dist/esm/{snk-guides-viewer-59d3a78c.js → snk-guides-viewer-0380f3df.js} +5 -5
  174. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  175. package/dist/esm/snk-personalized-filter.entry.js +166 -94
  176. package/dist/esm/snk-pesquisa.entry.js +1 -1
  177. package/dist/esm/snk-select-box.entry.js +1 -1
  178. package/dist/esm/snk-simple-bar.entry.js +41 -0
  179. package/dist/esm/{snk-simple-bar_2.entry.js → snk-simple-crud.entry.js} +7 -44
  180. package/dist/esm/snk-tab-config.entry.js +1 -1
  181. package/dist/esm/snk-taskbar.entry.js +4 -4
  182. package/dist/esm/{taskbar-elements-8ff33c26.js → taskbar-elements-26d0fba3.js} +3 -3
  183. package/dist/esm/{taskbar-processor-20de6616.js → taskbar-processor-dfef41a8.js} +1 -1
  184. package/dist/esm/teste-pesquisa.entry.js +1 -1
  185. package/dist/sankhyablocks/{p-f27dc5e9.entry.js → p-00d1cac4.entry.js} +1 -1
  186. package/dist/sankhyablocks/{p-b9667fbe.js → p-066ee142.js} +2 -2
  187. package/dist/sankhyablocks/p-09a058ba.entry.js +1 -0
  188. package/dist/sankhyablocks/{p-82bc4666.entry.js → p-0dec4d29.entry.js} +1 -1
  189. package/dist/sankhyablocks/{p-1e6a95f5.entry.js → p-12632b8e.entry.js} +1 -1
  190. package/dist/sankhyablocks/{p-384c4a6b.js → p-18b34bb4.js} +1 -1
  191. package/dist/sankhyablocks/{p-538c057a.entry.js → p-2ad89e28.entry.js} +1 -1
  192. package/dist/sankhyablocks/p-2d5108b3.js +1 -0
  193. package/dist/sankhyablocks/{p-ff398057.entry.js → p-34cd4b39.entry.js} +1 -1
  194. package/dist/sankhyablocks/p-36ecb6ab.js +1 -0
  195. package/dist/sankhyablocks/p-372e0185.entry.js +1 -0
  196. package/dist/sankhyablocks/p-3be34bd1.entry.js +1 -0
  197. package/dist/sankhyablocks/p-3d45107f.js +1 -0
  198. package/dist/sankhyablocks/{p-28c12f65.js → p-463e0936.js} +1 -1
  199. package/dist/sankhyablocks/{p-e701646c.entry.js → p-49d628d1.entry.js} +1 -1
  200. package/dist/sankhyablocks/{p-e642bf7a.entry.js → p-50db4bc4.entry.js} +1 -1
  201. package/dist/sankhyablocks/{p-093febff.entry.js → p-5427566a.entry.js} +1 -1
  202. package/dist/sankhyablocks/{p-6a02e236.js → p-590d8900.js} +1 -1
  203. package/dist/sankhyablocks/p-5a6c090e.entry.js +1 -0
  204. package/dist/sankhyablocks/{p-e2bb9c9a.entry.js → p-67a19b48.entry.js} +1 -1
  205. package/dist/sankhyablocks/{p-19692f92.js → p-69770075.js} +1 -1
  206. package/dist/sankhyablocks/p-6d4169fc.entry.js +1 -0
  207. package/dist/sankhyablocks/{p-0b40c655.js → p-708ee8ee.js} +1 -1
  208. package/dist/sankhyablocks/{p-9af04fc7.entry.js → p-718cc24b.entry.js} +1 -1
  209. package/dist/sankhyablocks/{p-2d0fc912.entry.js → p-7946512f.entry.js} +1 -1
  210. package/dist/sankhyablocks/{p-900b2889.entry.js → p-7a5e1be7.entry.js} +1 -1
  211. package/dist/sankhyablocks/p-801b8858.js +68 -0
  212. package/dist/sankhyablocks/{p-80e52e85.entry.js → p-847b9506.entry.js} +1 -1
  213. package/dist/sankhyablocks/{p-56d70073.entry.js → p-8d541539.entry.js} +1 -1
  214. package/dist/sankhyablocks/{p-584a315a.entry.js → p-8e98a893.entry.js} +1 -1
  215. package/dist/sankhyablocks/p-9731180c.entry.js +1 -0
  216. package/dist/sankhyablocks/{p-b680fa7a.entry.js → p-a655ea15.entry.js} +1 -1
  217. package/dist/sankhyablocks/{p-eae124e3.entry.js → p-a8b06801.entry.js} +1 -1
  218. package/dist/sankhyablocks/{p-b25450ab.js → p-a8e5ded0.js} +1 -1
  219. package/dist/sankhyablocks/{p-6ac29569.entry.js → p-b66b99d9.entry.js} +1 -1
  220. package/dist/sankhyablocks/p-b7efc49a.entry.js +1 -0
  221. package/dist/sankhyablocks/{p-9c7f7214.entry.js → p-b91ee370.entry.js} +1 -1
  222. package/dist/sankhyablocks/{p-e551b19a.entry.js → p-b940798f.entry.js} +1 -1
  223. package/dist/sankhyablocks/{p-72e78de0.entry.js → p-bbefb3b2.entry.js} +1 -1
  224. package/dist/sankhyablocks/p-bdd61fa8.entry.js +1 -0
  225. package/dist/sankhyablocks/{p-f8c66aa3.entry.js → p-c06973e7.entry.js} +1 -1
  226. package/dist/sankhyablocks/{p-257c71a7.entry.js → p-c17e19a2.entry.js} +1 -1
  227. package/dist/sankhyablocks/p-c6bf66e0.js +1 -0
  228. package/dist/sankhyablocks/p-cdfddb41.entry.js +1 -0
  229. package/dist/sankhyablocks/p-cf90a195.entry.js +1 -0
  230. package/dist/sankhyablocks/{p-44c2ed16.entry.js → p-d11c5026.entry.js} +1 -1
  231. package/dist/sankhyablocks/p-d5145c3f.entry.js +1 -0
  232. package/dist/sankhyablocks/p-de328b00.entry.js +1 -0
  233. package/dist/sankhyablocks/{p-971abcc2.entry.js → p-e500863b.entry.js} +1 -1
  234. package/dist/sankhyablocks/{p-22e44b9d.entry.js → p-e824aef2.entry.js} +1 -1
  235. package/dist/sankhyablocks/{p-4ce96831.entry.js → p-eb24c092.entry.js} +1 -1
  236. package/dist/sankhyablocks/{p-4c2015a9.js → p-eb90de43.js} +1 -1
  237. package/dist/sankhyablocks/p-ebb8de34.entry.js +1 -0
  238. package/dist/sankhyablocks/p-f55450d5.entry.js +1 -0
  239. package/dist/sankhyablocks/{p-8652d177.entry.js → p-fc512cbe.entry.js} +1 -1
  240. package/dist/sankhyablocks/{p-786ae316.entry.js → p-fced1d89.entry.js} +1 -1
  241. package/dist/sankhyablocks/{p-e0b4aec3.entry.js → p-fdb43927.entry.js} +1 -1
  242. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  243. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.d.ts +85 -0
  244. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +6 -6
  245. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  246. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +18 -1
  247. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +14 -6
  248. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +10 -3
  249. package/dist/types/components/snk-filter-bar/types/custom-element-filter.d.ts +6 -0
  250. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +10 -1
  251. package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +92 -15
  252. package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +5 -11
  253. package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +3 -0
  254. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +39 -6
  255. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +82 -0
  256. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
  257. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +13 -1
  258. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.d.ts +0 -0
  259. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +23 -3
  260. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +21 -0
  261. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.d.ts +11 -0
  262. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +3 -0
  263. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +14 -2
  264. package/dist/types/components.d.ts +169 -10
  265. package/dist/types/lib/@types/index.d.ts +3 -1
  266. package/dist/types/lib/configs/ConfigStorage.d.ts +5 -0
  267. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +4 -2
  268. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +5 -0
  269. package/dist/types/lib/store/index.d.ts +1 -2
  270. package/package.json +5 -5
  271. package/react/components.d.ts +1 -0
  272. package/react/components.js +1 -0
  273. package/react/components.js.map +1 -1
  274. package/dist/cjs/ConfigStorage-f68c3607.js +0 -124
  275. package/dist/cjs/index-8d94b7e0.js +0 -7
  276. package/dist/cjs/snk-expression-item.cjs.entry.js +0 -213
  277. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +0 -214
  278. package/dist/esm/ConfigStorage-e6c17998.js +0 -121
  279. package/dist/esm/index-620ac460.js +0 -7
  280. package/dist/esm/snk-expression-item.entry.js +0 -209
  281. package/dist/sankhyablocks/p-0b6ddb67.entry.js +0 -1
  282. package/dist/sankhyablocks/p-0c2afa63.entry.js +0 -1
  283. package/dist/sankhyablocks/p-343699ad.entry.js +0 -1
  284. package/dist/sankhyablocks/p-471568c7.entry.js +0 -1
  285. package/dist/sankhyablocks/p-6c2c71ca.js +0 -1
  286. package/dist/sankhyablocks/p-8ce9ea9f.entry.js +0 -1
  287. package/dist/sankhyablocks/p-8efb0f47.entry.js +0 -1
  288. package/dist/sankhyablocks/p-9a448ff9.entry.js +0 -1
  289. package/dist/sankhyablocks/p-9e50681c.entry.js +0 -1
  290. package/dist/sankhyablocks/p-9f66bc54.entry.js +0 -1
  291. package/dist/sankhyablocks/p-b1c02726.js +0 -1
  292. package/dist/sankhyablocks/p-b34d23fa.js +0 -1
  293. package/dist/sankhyablocks/p-c20dd153.entry.js +0 -1
  294. package/dist/sankhyablocks/p-cbb5c440.entry.js +0 -1
  295. package/dist/sankhyablocks/p-f3241ada.entry.js +0 -1
  296. package/dist/sankhyablocks/p-f4184ce7.js +0 -1
  297. package/dist/sankhyablocks/p-ff96b509.entry.js +0 -27
  298. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +0 -40
@@ -1,12 +1,14 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-cfd4bb13.js';
2
- import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
2
+ import { ElementIDUtils, ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
- import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
5
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
6
- import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-edc48f4b.js';
7
- import './resource-fetcher-02642924.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-9f4d2e67.js';
6
+ import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
+ import './form-config-fetcher-cac8cd96.js';
8
8
  import './DataFetcher-b3d8b2d5.js';
9
9
  import './_commonjsHelpers-9943807e.js';
10
+ import './resource-fetcher-02642924.js';
11
+ import './filter-bar-config-fetcher-bd2070a3.js';
10
12
 
11
13
  const snkFilterModalItemCss = ".grow{flex-grow:1}.gap{gap:4px}";
12
14
 
@@ -14,43 +16,63 @@ const SnkFilterModalItem = class {
14
16
  constructor(hostRef) {
15
17
  registerInstance(this, hostRef);
16
18
  this.filterChange = createEvent(this, "filterChange", 7);
19
+ this.editPersonalizedFilter = createEvent(this, "editPersonalizedFilter", 7);
20
+ this.addPersonalizedFilter = createEvent(this, "addPersonalizedFilter", 7);
17
21
  this.filterItem = undefined;
22
+ this.configName = undefined;
18
23
  }
19
24
  observeFilterItem(newValue) {
20
25
  var _a, _b;
26
+ this._editor && (this._editor["config"] = newValue);
21
27
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
22
28
  this.filterChange.emit(newValue);
23
- this.saveConfig();
29
+ //isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
30
+ //this.saveConfig();
24
31
  }
25
32
  getContentEditorConfig() {
26
- const variations = { presentationMode: EPresentationMode.MODAL };
33
+ const props = { presentationMode: EPresentationMode.MODAL };
27
34
  switch (this.filterItem.type) {
28
35
  case FilterItemType.BINARY_SELECT:
29
- return { tag: "snk-filter-binary-select", variations };
36
+ return { tag: "snk-filter-binary-select", props };
30
37
  case FilterItemType.MULTI_SELECT:
31
38
  return { tag: "snk-filter-multi-select" };
32
39
  case FilterItemType.PERIOD:
33
- return { tag: "snk-filter-period", variations };
40
+ return { tag: "snk-filter-period", props };
34
41
  case FilterItemType.SEARCH:
35
42
  return { tag: "snk-filter-search" };
36
43
  case FilterItemType.NUMBER:
37
44
  return { tag: "snk-filter-number" };
38
45
  case FilterItemType.PERSONALIZED:
39
- return { tag: "snk-filter-personalized" };
46
+ const snkFilterPersonalizedProps = {
47
+ tag: "snk-filter-personalized", props: {
48
+ onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
49
+ onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
50
+ onAddFilter: () => this.addPersonalizedFilter.emit(),
51
+ }
52
+ };
53
+ return snkFilterPersonalizedProps;
40
54
  case FilterItemType.MULTI_LIST:
41
- return { tag: "snk-entity-list", variations: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
55
+ return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
42
56
  }
43
57
  return { tag: "snk-filter-text" };
44
58
  }
45
- updateFilterValue(newValue) {
46
- const isVisble = !this.filterItem.visible ? newValue !== undefined : true;
47
- this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: isVisble });
48
- if (FilterItemType.MULTI_LIST === this.filterItem.type) {
49
- this.saveConfig();
59
+ isVisible(newValue) {
60
+ return !this.filterItem.visible ? newValue !== undefined : true;
61
+ }
62
+ updateFilterValue(data) {
63
+ const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
64
+ if (this.filterItem.groupedItems != undefined) {
65
+ this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
66
+ }
67
+ else {
68
+ this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: this.isVisible(newValue) });
50
69
  }
70
+ this.saveConfig();
51
71
  }
52
- canShowDetailModal() {
53
- return this.filterItem.filterType !== FilterType.OTHER_FILTERS && this.filterItem.type !== FilterItemType.BINARY_SELECT;
72
+ handleDeleteFilter(filter, filterItemType) {
73
+ if (filterItemType === FilterItemType.PERSONALIZED) {
74
+ ConfigStorage.removePersonalizedFilter(filter, this.configName);
75
+ }
54
76
  }
55
77
  componentDidLoad() {
56
78
  if (this._element) {
@@ -61,25 +83,31 @@ const SnkFilterModalItem = class {
61
83
  }
62
84
  }
63
85
  buildRightSlot(item) {
64
- return h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) });
86
+ return (h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) }));
65
87
  }
66
88
  removeValueFromConfig(item) {
67
- var _a, _b, _c, _d, _e, _f;
68
- const index = (_b = (_a = this.filterItem) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.findIndex(i => (i === null || i === void 0 ? void 0 : i.id) === item.id);
69
- (_d = (_c = this.filterItem) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.splice(index, 1);
70
- (_f = (_e = this._editor) === null || _e === void 0 ? void 0 : _e["reloadList"]) === null || _f === void 0 ? void 0 : _f.call(_e);
71
- this.saveConfig();
89
+ var _a, _b, _c;
90
+ 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);
91
+ const filterItemCopy = ObjectUtils.copy(this.filterItem);
92
+ (_c = filterItemCopy === null || filterItemCopy === void 0 ? void 0 : filterItemCopy.value) === null || _c === void 0 ? void 0 : _c.splice(index, 1);
93
+ this.updateFilterValue(filterItemCopy.value);
94
+ }
95
+ canShowDetailModal() {
96
+ const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
97
+ return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
72
98
  }
73
99
  saveConfig() {
74
- var _a;
75
- (_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
100
+ //Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
101
+ /*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
102
+
103
+ this._application?.getResourceID().then(resourceId => {
76
104
  const fetcher = new FilterBarConfigFetcher();
77
105
  fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
78
- });
106
+ });*/
79
107
  }
80
108
  render() {
81
- const { tag: ContentEditor, variations } = this.getContentEditorConfig();
82
- return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, variations)))));
109
+ const { tag: ContentEditor, props } = this.getContentEditorConfig();
110
+ return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-title ez-title--small ez-title--primary grow" }, this.filterItem.detailModal))), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
83
111
  }
84
112
  get _element() { return getElement(this); }
85
113
  static get watchers() { return {
@@ -1,26 +1,58 @@
1
- import { r as registerInstance, h } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, h } from './index-8c3d76a6.js';
2
2
  import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
3
+ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
4
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
4
5
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
6
+ import { ObjectUtils } from '@sankhyalabs/core';
7
+ import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-202cd721.js';
8
+ import './index-a255b326.js';
5
9
 
6
- const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter__modal-container{width:344px;max-width:344px;overflow:hidden}.snk-filter__modal-content{display:flex;flex-direction:column;gap:12px;max-height:760px;overflow-x:clip;overflow-y:auto;padding-right:4px}.snk-filter__modal-content::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.snk-filter__modal-collapsible-box{border:1px solid #DCE0E8;border-radius:var(--border--radius-medium);padding:12px 6px}";
10
+ const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{width:344px;max-width:344px;min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px;overflow-x:clip;overflow-y:auto}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
7
11
 
8
12
  const SnkFilterModal = class {
9
13
  constructor(hostRef) {
10
14
  registerInstance(this, hostRef);
11
15
  this.getMessage = undefined;
16
+ this.configName = undefined;
12
17
  this.filters = undefined;
13
18
  this.applyFilters = undefined;
14
19
  this.clearAll = undefined;
15
20
  this.closeModal = undefined;
21
+ this.addPersonalizedFilter = undefined;
22
+ this.editPersonalizedFilter = undefined;
16
23
  }
17
24
  getCustomMessage(key, params) {
18
25
  var _a;
19
26
  return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
20
27
  }
28
+ //TODO: tratar clear all dos filtros personalizados
21
29
  handleClearAll() {
22
- const cleanedFilters = this.clearAll(this.filters);
23
- this.filters = cleanedFilters;
30
+ const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
31
+ const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
32
+ this.handleClearFilterList(quickFilters);
33
+ otherFilters.forEach(this.handleClearSigleFilter.bind(this));
34
+ if (this.clearAll) {
35
+ this.filters = this.clearAll(this.filters);
36
+ }
37
+ }
38
+ handleClose() {
39
+ const hasChangesToSave = JSON.stringify(this.filters) !== JSON.stringify(this._originalFilterConfig);
40
+ if (!hasChangesToSave) {
41
+ this.closeModal();
42
+ return;
43
+ }
44
+ return ApplicationUtils.confirm(this.getCustomMessage('validations.notSaved.title'), this.getCustomMessage('validations.notSaved.message')).then((cancelAction) => {
45
+ if (cancelAction)
46
+ this.closeModal();
47
+ });
48
+ }
49
+ validatePersonalizedFilter() {
50
+ const filterPersonalized = this.filters.find(filter => filter.filterType === FilterType.CUSTOM_FILTER);
51
+ const isValid = PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
52
+ if (!isValid) {
53
+ return ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
54
+ }
55
+ this.applyFilters(this.filters);
24
56
  }
25
57
  modalActionListener(evt) {
26
58
  const modalAction = evt.detail;
@@ -29,17 +61,32 @@ const SnkFilterModal = class {
29
61
  this.handleClearAll();
30
62
  break;
31
63
  case ModalAction.OK:
32
- this.applyFilters(this.filters);
64
+ this.validatePersonalizedFilter();
65
+ break;
33
66
  case ModalAction.CLOSE:
34
- this.closeModal();
67
+ this.handleClose();
68
+ break;
35
69
  }
36
70
  }
37
71
  handleFilterChange(filterConfig) {
38
72
  this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
39
73
  }
40
- handleClearFilters(filterList) {
74
+ handleClearFilterList(filterList) {
41
75
  this.filters = this.filters.map(filter => filterList.includes(filter) ? (Object.assign(Object.assign({}, filter), { value: FilterItemType.MULTI_LIST === filter.type ? this.uncheckFilterValues(filter.value) : undefined })) : filter);
42
76
  }
77
+ handleClearSigleFilter(filterItem) {
78
+ if (FilterItemType.MULTI_LIST === filterItem.type) {
79
+ let filterItemCopy = ObjectUtils.copy(filterItem);
80
+ this.uncheckFilterValues(filterItemCopy.value);
81
+ const filterListCopy = ObjectUtils.copy(this.filters);
82
+ const index = filterListCopy.findIndex(item => item.id === filterItem.id);
83
+ filterListCopy.splice(index, 1, filterItemCopy);
84
+ this.filters = ObjectUtils.copy(filterListCopy);
85
+ }
86
+ else {
87
+ this.filters.find(filter => filter.id === filterItem.id).value = undefined;
88
+ }
89
+ }
43
90
  uncheckFilterValues(valueList) {
44
91
  valueList.forEach(value => {
45
92
  if (!!value) {
@@ -49,7 +96,7 @@ const SnkFilterModal = class {
49
96
  return valueList;
50
97
  }
51
98
  renderFilterItem(filterItem, fullRow) {
52
- return (h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, onFilterChange: (event) => this.handleFilterChange(event.detail) }));
99
+ return (h("snk-filter-modal-item", { class: fullRow ? 'ez-col ez-col--sd-12' : 'ez-col ez-col--sd-6 ez-padding--small', filterItem: filterItem, configName: this.configName, onFilterChange: (event) => this.handleFilterChange(event.detail), onEditPersonalizedFilter: evt => this.editPersonalizedFilter(evt.detail), onAddPersonalizedFilter: () => this.addPersonalizedFilter() }));
53
100
  }
54
101
  mountFiltersLines(filters) {
55
102
  const MAX_LINE_LENGTH = 2;
@@ -77,7 +124,7 @@ const SnkFilterModal = class {
77
124
  }
78
125
  renderFilterLine(filters) {
79
126
  const fullLine = filters.length === 1;
80
- return (h("div", { class: "ez-row" }, filters.map((filter) => this.renderFilterItem(filter, fullLine))));
127
+ return filters.map((filter) => this.renderFilterItem(filter, fullLine));
81
128
  }
82
129
  getIformedFiltersCount(listItems) {
83
130
  let countInformedItens = 0;
@@ -87,30 +134,37 @@ const SnkFilterModal = class {
87
134
  countInformedItens += (_e = (_d = (_c = ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : item.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
88
135
  return;
89
136
  }
137
+ if (item.groupedItems != undefined) {
138
+ countInformedItens = item.groupedItems.filter(item => item.visible).length;
139
+ return;
140
+ }
90
141
  if (!!item.value) {
91
142
  countInformedItens++;
92
143
  }
93
144
  });
94
145
  return countInformedItens;
95
146
  }
96
- renderCollapsibleFilterBox(label, listItems) {
147
+ renderCollapsibleFilterBox(label, listItems, isSingleItem, shouldRenderFooter = true) {
97
148
  if (!listItems.length)
98
149
  return null;
99
150
  const appliedFilters = this.getIformedFiltersCount(listItems);
100
151
  const lines = this.mountFiltersLines(listItems);
101
- return (h("ez-collapsible-box", { class: "snk-filter__modal-collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters &&
102
- h("ez-badge", { class: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() }), lines.map(this.renderFilterLine.bind(this)), h("div", { class: "ez-flex ez-flex--justify-end grow" }, h("ez-button", { class: "ez-button--tertiary", size: "medium", label: "Limpar", onClick: () => this.handleClearFilters(listItems) }))));
152
+ return (h("ez-collapsible-box", { class: "snk-filter-modal__collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters && (h("ez-badge", { class: "ez-badge--primary-subtle", slot: "rightSlot", label: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toString() })), h("div", { class: "ez-row snk-filter-modal__rendered-items" }, lines.map(this.renderFilterLine.bind(this))), shouldRenderFooter && (h("div", { class: "ez-flex ez-flex--justify-end grow" }, h("ez-button", { class: "ez-button--tertiary", size: "medium", label: "Limpar", onClick: () => isSingleItem ? this.handleClearSigleFilter(listItems[0]) : this.handleClearFilterList(listItems) })))));
103
153
  }
104
154
  componentWillRender() {
105
155
  this._modalTitle = this.getCustomMessage('title');
106
156
  this._okButtonLabel = this.getCustomMessage('okButtonLabel');
107
157
  this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
108
158
  }
159
+ componentDidLoad() {
160
+ if (!this._originalFilterConfig)
161
+ this._originalFilterConfig = this.filters;
162
+ }
109
163
  render() {
110
164
  const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
111
165
  const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
112
166
  const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
113
- return (h("ez-modal-container", { class: "snk-filter__modal-container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter__modal-content" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter])))));
167
+ return (h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
114
168
  }
115
169
  };
116
170
  SnkFilterModal.style = snkFilterModalCss;
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
@@ -52,8 +52,10 @@ const SnkFilterPeriod = class {
52
52
  }
53
53
  }
54
54
  componentWillLoad() {
55
- this._startDateLabel = this.getMessage('snkFilterBar.labelStartDatePeriod');
56
- this._endDateLabel = this.getMessage('snkFilterBar.labelEndDatePeriod');
55
+ if (this.getMessage) {
56
+ this._startDateLabel = this.getMessage('snkFilterBar.labelStartDatePeriod');
57
+ this._endDateLabel = this.getMessage('snkFilterBar.labelEndDatePeriod');
58
+ }
57
59
  }
58
60
  render() {
59
61
  if (!this.config || this.config.type !== FilterItemType.PERIOD) {
@@ -1,50 +1,65 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils, UserInterface, ApplicationContext } from '@sankhyalabs/core';
3
- import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
4
- import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
5
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
+ import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
+ import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
6
+ import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
7
+
8
+ const snkFilterPersonalizedCss = ".sc-snk-filter-personalized-h{--snk-filter-personalized__max-height:21;--snk-filter-personalized__max-width:21.5}.SnkFilterPersonalized_list-container.sc-snk-filter-personalized{margin:0;padding:0;list-style:none;display:flex;flex-direction:column}.SnkFilterPersonalized_list-container-chip.sc-snk-filter-personalized{width:400px}.SnkFilterPersonalized_list-scroller.sc-snk-filter-personalized{display:block;max-height:calc(var(--space--2xl) * var(--snk-filter-personalized__max-height));cursor:auto;--ez-scroller__max-height:300px}.SnkFilterPersonalized_checkbox.sc-snk-filter-personalized{display:grid;grid-template-columns:auto auto;justify-content:start}.SnkFilterPersonalized_list-container.sc-snk-filter-personalized:has(.SnkFilterPersonalized_list-item--chip){gap:var(--space--small, 6px);max-width:calc(var(--space--md) * var(--snk-filter-personalized__max-width))}.SnkFilterPersonalized_list-item--modal.sc-snk-filter-personalized{display:flex;border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--modal.sc-snk-filter-personalized:hover{background-color:var(--background--medium, #f0f3f7)}.SnkFilterPersonalized_list-actions.sc-snk-filter-personalized{display:none;align-items:center}.SnkFilterPersonalized_list-item--modal.sc-snk-filter-personalized:hover .SnkFilterPersonalized_list-actions.sc-snk-filter-personalized{display:flex}.SnkFilterPersonalized_list-item--chip.sc-snk-filter-personalized{display:flex;flex-direction:column;border:var(--border--small, 1px solid) var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--chip.sc-snk-filter-personalized .sc-snk-filter-personalized:first-of-type{gap:var(--space--3xs)}";
6
9
 
7
10
  const SnkFilterPersonalized = class {
8
11
  constructor(hostRef) {
9
12
  registerInstance(this, hostRef);
13
+ this.deleteFilter = createEvent(this, "deleteFilter", 7);
14
+ this.editFilter = createEvent(this, "editFilter", 7);
15
+ this.addFilter = createEvent(this, "addFilter", 7);
10
16
  this.valueChanged = createEvent(this, "valueChanged", 7);
17
+ this.originalItems = [];
18
+ this.messagesBuilder = undefined;
19
+ this.presentationMode = EPresentationMode.MODAL;
11
20
  this.config = undefined;
12
21
  this.value = undefined;
13
- this.fix = undefined;
14
- this.unfix = undefined;
22
+ this.items = [];
15
23
  }
16
- componentDidLoad() {
17
- if (this._element) {
18
- ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
19
- }
24
+ /**
25
+ * Apresenta o componente
26
+ */
27
+ async show() {
28
+ const elem = document.querySelector("#param_0");
29
+ if (elem)
30
+ elem["setFocus"]();
20
31
  }
21
- getValue(param, index) {
22
- if (this.value && index >= 0 && index < this.value.length) {
23
- const rawValue = this.value[index];
24
- if (param.type === UserInterface.SEARCH) {
25
- return rawValue;
26
- }
27
- return convertType(param.dataType, rawValue);
28
- }
29
- return undefined;
32
+ configWatcher(newConfig) {
33
+ this.items = this.originalItems = newConfig.groupedItems || [];
30
34
  }
31
- setValue(index, value) {
32
- if (this.value == undefined) {
33
- this.value = Array(index).fill(null);
34
- }
35
- else {
36
- this.value = [...this.value];
37
- }
38
- this.value[index] = value;
39
- if (this.value.filter(item => item != undefined).length == 0) {
40
- this.value = null;
41
- }
42
- this.valueChanged.emit(this.value || []);
35
+ /**
36
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
37
+ * através de um pequeno modulo na estrutura da aplicação:
38
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
39
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-personalized-filter.msg.ts"
40
+ */
41
+ getMessage(key, params) {
42
+ var _a;
43
+ if (this.messagesBuilder)
44
+ return this.messagesBuilder.getMessage(key, params);
45
+ if ((_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder)
46
+ return this._application.messagesBuilder.getMessage(key, params);
47
+ }
48
+ getItemContent(item) {
49
+ var _a, _b;
50
+ const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, compact: true, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
51
+ const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
52
+ return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, h(CheckboxElement, null), this.isModalMode() ?
53
+ h("div", { class: "SnkFilterPersonalized_list-actions" }, h("ez-button", { size: "small", mode: "icon", iconName: "edit", title: this.getMessage('snkPersonalizedFilter.listActions.edit'), onClick: () => this.editFilter.emit(item.id) }), h("ez-button", { size: "small", mode: "icon", iconName: "delete", title: this.getMessage('snkPersonalizedFilter.listActions.delete'), onClick: this.handleDeleteFilter.bind(this, item) }))
54
+ :
55
+ isVariable && (h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))))), (item.visible && isVariable) && (h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
56
+ }
57
+ isModalMode() {
58
+ return this.presentationMode === EPresentationMode.MODAL;
43
59
  }
44
60
  doSearch(mode, argument, param) {
45
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
46
61
  return new Promise((resolve, reject) => {
47
- application.executePreparedSearch(mode, argument, param.searchContext)
62
+ this._application.executePreparedSearch(mode, argument, param.searchContext)
48
63
  .then(result => {
49
64
  resolve(result);
50
65
  }).catch(reason => {
@@ -52,49 +67,114 @@ const SnkFilterPersonalized = class {
52
67
  });
53
68
  });
54
69
  }
55
- getParamsInterface() {
56
- var _a, _b, _c;
57
- const params = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.personalizedFilter) === null || _c === void 0 ? void 0 : _c.parameters;
70
+ getFormField(parentItem) {
71
+ var _a, _b;
72
+ const params = (_b = (_a = parentItem === null || parentItem === void 0 ? void 0 : parentItem.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters;
58
73
  return params.map((param, index) => {
59
- var _a;
74
+ var _a, _b;
75
+ const formProp = Object.assign(Object.assign({}, param), { id: parentItem.id });
76
+ const value = (_a = parentItem.value) === null || _a === void 0 ? void 0 : _a[index];
60
77
  const elemId = 'param_' + index;
61
- switch (param.type) {
78
+ switch (param.userInterface) {
62
79
  case UserInterface.SEARCH:
63
- return h("ez-search", { id: elemId, suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
80
+ return h("ez-search", { id: elemId, suppressEmptyOption: true, value: value, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
64
81
  case UserInterface.SWITCH:
65
82
  case UserInterface.CHECKBOX:
66
- const mode = UserInterface.SWITCH === param.type ? CheckMode.SWITCH : CheckMode.REGULAR;
67
- return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
83
+ const mode = UserInterface.SWITCH === param.userInterface ? CheckMode.SWITCH : CheckMode.REGULAR;
84
+ return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: value, label: param.label, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
68
85
  case UserInterface.DECIMALNUMBER:
69
86
  case UserInterface.INTEGERNUMBER:
70
- return h("ez-number-input", { id: elemId, label: param.label, value: this.getValue(param, index), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index, evt.detail) });
87
+ return h("ez-number-input", { id: elemId, label: param.label, value: value, precision: (_b = param.props) === null || _b === void 0 ? void 0 : _b.precision, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
71
88
  case UserInterface.OPTIONSELECTOR:
72
- return h("ez-combo-box", { id: elemId, label: param.label, value: this.getValue(param, index), options: param.options, onEzChange: evt => { var _a; return this.setValue(index, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
89
+ return h("ez-combo-box", { id: elemId, label: param.label, value: value, options: param.options, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
73
90
  case UserInterface.DATE:
74
- return h("ez-date-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
91
+ return h("ez-date-input", { id: elemId, label: param.label, value: this.parseDate(value), onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
75
92
  case UserInterface.DATETIME:
76
- return h("ez-date-time-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
93
+ return h("ez-date-time-input", { id: elemId, label: param.label, value: this.parseDate(value), onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
77
94
  default:
78
- return h("ez-text-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
95
+ return h("ez-text-input", { id: elemId, label: param.label, value: value, onEzChange: evt => this.handleFilterItemChange(evt.detail, formProp) });
79
96
  }
80
97
  });
81
98
  }
82
- /**
83
- * Exibe o componente snk-filter-personalized
84
- */
85
- async show() {
86
- const elem = document.querySelector("#param_0");
87
- if (elem) {
88
- elem["setFocus"]();
99
+ parseDate(objValue) {
100
+ if (typeof objValue === "string") {
101
+ let date = new Date(objValue);
102
+ date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
103
+ return date;
104
+ }
105
+ return objValue;
106
+ }
107
+ getVisibleCount(items) {
108
+ return items.reduce((total, item) => {
109
+ if (!!item.visible)
110
+ return total + 1;
111
+ return total;
112
+ }, 0);
113
+ }
114
+ handleItemChange(visible, itemId) {
115
+ this.items = this.originalItems = this.originalItems.map(item => {
116
+ const isVisible = item.id === itemId ? visible : item.visible;
117
+ return Object.assign(Object.assign({}, item), { visible: isVisible, active: isVisible });
118
+ });
119
+ this.emitChange();
120
+ }
121
+ handleFilterChange({ detail: query = "" }) {
122
+ this.items = query ? this.originalItems.filter(item => item.label.toLowerCase().includes(query.toLowerCase())) : this.originalItems;
123
+ }
124
+ handleFilterItemChange(value, formProp) {
125
+ var _a;
126
+ const changedItem = this.items.find(({ id }) => id === formProp.id);
127
+ const { parameters = [] } = ((_a = changedItem.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) || {};
128
+ const indexToChangedParameter = parameters.findIndex(param => param.name === formProp.name);
129
+ parameters[indexToChangedParameter] = formProp;
130
+ changedItem.props.personalizedFilter.parameters = parameters;
131
+ if (!changedItem.value) {
132
+ changedItem.value = [];
89
133
  }
134
+ changedItem.value[indexToChangedParameter] = value;
135
+ const updatedItems = [
136
+ ...this.items,
137
+ changedItem
138
+ ];
139
+ this.items = Array.from(new Set(updatedItems));
140
+ this.emitChange();
141
+ }
142
+ handleClearFilters() {
143
+ this.emitChange(true);
144
+ }
145
+ emitChange(clear = false) {
146
+ const items = this.items.map(item => (Object.assign(Object.assign({}, item), { visible: !clear && item.visible })));
147
+ const value = this.getVisibleCount(items);
148
+ this.valueChanged.emit({ value, items });
149
+ }
150
+ handleDeleteFilter(item) {
151
+ this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.deleteConfirm.message', { filterName: item.label })).then((actionConfirmed) => {
152
+ if (actionConfirmed) {
153
+ this.deleteFilter.emit(item);
154
+ this.items = this.originalItems = this.originalItems.filter(originalItem => originalItem.id !== item.id);
155
+ this.emitChange();
156
+ }
157
+ });
158
+ }
159
+ componentDidLoad() {
160
+ if (this._element)
161
+ ElementIDUtils.addIDInfoIfNotExists(this._element, 'filterContentEditor');
162
+ }
163
+ componentWillLoad() {
164
+ var _a;
165
+ this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
166
+ this.items = this.originalItems = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.groupedItems) || [];
90
167
  }
91
168
  render() {
92
- if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
169
+ if (!this.config || this.config.type !== FilterItemType.PERSONALIZED)
93
170
  return undefined;
94
- }
95
- return (h(Host, null, this.getParamsInterface()));
171
+ return (h(Host, null, h("div", { class: "ez-margin-bottom--medium" }, this.presentationMode === EPresentationMode.MODAL && (h(Fragment, null, h("ez-filter-input", Object.assign({ label: this.config.label, onEzChange: this.handleFilterChange.bind(this) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("filterSearch")}` })), h("span", { class: "ez-text ez-title--small ez-title--primary" }, " ", this.config.detailTitle, " ")))), this.items.length ? (h("ez-scroller", { class: "SnkFilterPersonalized_list-scroller", direction: EzScrollDirection.VERTICAL }, h("ul", { class: `SnkFilterPersonalized_list-container ${!this.isModalMode() ? "SnkFilterPersonalized_list-container-chip" : ""}` }, this.items.map((itemConfig) => this.getItemContent(itemConfig))))) : (h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--small" }, this.getMessage('snkPersonalizedFilter.info.noDataFound')))), this.presentationMode === EPresentationMode.MODAL && (h("div", { class: "ez-flex ez-flex--justify-end grow ez-margin-top--medium" }, h("ez-button", { class: "ez-button--tertiary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.clear'), onClick: this.handleClearFilters.bind(this) }), h("ez-button", { class: "ez-button--secondary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.create'), onClick: () => this.addFilter.emit() })))));
96
172
  }
97
173
  get _element() { return getElement(this); }
174
+ static get watchers() { return {
175
+ "config": ["configWatcher"]
176
+ }; }
98
177
  };
178
+ SnkFilterPersonalized.style = snkFilterPersonalizedCss;
99
179
 
100
180
  export { SnkFilterPersonalized as snk_filter_personalized };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const SnkFilterText = class {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c3d76a6.js';
2
2
  import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
3
3
  import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const BOUNDARY_FALSE_POSITIVE_VALUE = 14;
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-cfd4bb13.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-8c3d76a6.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { DataBinder } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
4