@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
@@ -112,8 +112,8 @@ export class SnkFilterItem {
112
112
  }
113
113
  getLabel(isTooltipLabel = false) {
114
114
  var _a;
115
- const { type, value, label, props } = this.config;
116
- if (value) {
115
+ const { type, value, label, props, groupedItems = [] } = this.config;
116
+ if (value || groupedItems.length) {
117
117
  if (type === FilterItemType.BINARY_SELECT) {
118
118
  const [optOne, optTwo] = props.options;
119
119
  const tooltip = this.getMessage('snkFilterBar.binarySelectTooltip');
@@ -165,7 +165,14 @@ export class SnkFilterItem {
165
165
  return `${label}: ${value.value} - ${value.label}`;
166
166
  }
167
167
  if (type === FilterItemType.PERSONALIZED) {
168
- return label;
168
+ const activeCount = groupedItems.reduce((total, item) => {
169
+ if (!!item.visible)
170
+ return total + 1;
171
+ return total;
172
+ }, 0);
173
+ if (activeCount <= 0)
174
+ return label;
175
+ return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
169
176
  }
170
177
  if (type === FilterItemType.MULTI_LIST) {
171
178
  const selectedOptions = ((_a = value.elements) !== null && _a !== void 0 ? _a : value).filter(item => item === null || item === void 0 ? void 0 : item.check);
@@ -231,10 +238,17 @@ export class SnkFilterItem {
231
238
  }
232
239
  return undefined;
233
240
  }
234
- render() {
241
+ getEnabledChip() {
235
242
  var _a, _b, _c, _d;
243
+ if (this.config.type === FilterItemType.PERSONALIZED) {
244
+ const { groupedItems = [] } = this.config;
245
+ return groupedItems.some(item => item.visible);
246
+ }
247
+ return (FilterItemType.MULTI_LIST != this.config.type && this.config.value != undefined) || (((_d = (_c = ((_b = (_a = this.config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : this.config.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) > 0);
248
+ }
249
+ render() {
236
250
  const leftIcon = this.getLeftIconName();
237
- return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: (FilterItemType.MULTI_LIST != this.config.type && this.config.value != undefined) || (((_d = (_c = ((_b = (_a = this.config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : this.config.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) > 0) }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
251
+ return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
238
252
  }
239
253
  static get is() { return "snk-filter-item"; }
240
254
  static get properties() {
@@ -299,7 +313,7 @@ export class SnkFilterItem {
299
313
  }, {
300
314
  "method": "filterChange",
301
315
  "name": "filterChange",
302
- "bubbles": true,
316
+ "bubbles": false,
303
317
  "cancelable": true,
304
318
  "composed": true,
305
319
  "docs": {
@@ -1,35 +1,35 @@
1
-
2
1
  ez-modal {
3
2
  --ez-modal-content-padding: 24px 12px;
4
3
  }
5
4
 
6
- .snk-filter__modal-container{
5
+ .snk-filter-modal__container {
7
6
  width: 344px;
8
7
  max-width: 344px;
8
+ min-width: 344px;
9
9
  overflow: hidden;
10
10
  }
11
11
 
12
- .snk-filter__modal-content{
12
+ .snk-filter-modal__content {
13
13
  display: flex;
14
14
  flex-direction: column;
15
- gap: 12px;
15
+ gap: var(--space--medium, 12px);
16
+ padding-right: var(--space--3xs, 4px);
17
+ }
18
+
19
+ .snk-filter-modal__collapsible-box {
20
+ border: var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);
21
+ border-radius: var(--border--radius-medium);
22
+ padding: var(--space--medium, 12px) var(--space--small, 6px);
23
+ }
24
+
25
+ .snk-filter-modal__rendered-items {
16
26
  max-height: 760px;
17
27
  overflow-x: clip;
18
28
  overflow-y: auto;
19
- padding-right: 4px;
20
29
  }
21
30
 
22
- .snk-filter__modal-content::-webkit-scrollbar {
31
+ .snk-filter-modal__rendered-items::-webkit-scrollbar {
23
32
  width: var(--space--small);
24
33
  min-width: var(--space--small);
25
34
  max-width: var(--space--small);
26
35
  }
27
-
28
-
29
- .snk-filter__modal-collapsible-box{
30
- border: 1px solid #DCE0E8;
31
- border-radius: var(--border--radius-medium);
32
- padding: 12px 6px;
33
- }
34
-
35
-
@@ -1,22 +1,53 @@
1
1
  import { h } from '@stencil/core';
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 FilterType from '../types/filter-type.enum';
4
5
  import FilterItemType from '../filter-item/filter-item-type.enum';
6
+ import { ObjectUtils } from '@sankhyalabs/core';
7
+ import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
5
8
  export class SnkFilterModal {
6
9
  constructor() {
7
10
  this.getMessage = undefined;
11
+ this.configName = undefined;
8
12
  this.filters = undefined;
9
13
  this.applyFilters = undefined;
10
14
  this.clearAll = undefined;
11
15
  this.closeModal = undefined;
16
+ this.addPersonalizedFilter = undefined;
17
+ this.editPersonalizedFilter = undefined;
12
18
  }
13
19
  getCustomMessage(key, params) {
14
20
  var _a;
15
21
  return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
16
22
  }
23
+ //TODO: tratar clear all dos filtros personalizados
17
24
  handleClearAll() {
18
- const cleanedFilters = this.clearAll(this.filters);
19
- this.filters = cleanedFilters;
25
+ const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
26
+ const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
27
+ this.handleClearFilterList(quickFilters);
28
+ otherFilters.forEach(this.handleClearSigleFilter.bind(this));
29
+ if (this.clearAll) {
30
+ this.filters = this.clearAll(this.filters);
31
+ }
32
+ }
33
+ handleClose() {
34
+ const hasChangesToSave = JSON.stringify(this.filters) !== JSON.stringify(this._originalFilterConfig);
35
+ if (!hasChangesToSave) {
36
+ this.closeModal();
37
+ return;
38
+ }
39
+ return ApplicationUtils.confirm(this.getCustomMessage('validations.notSaved.title'), this.getCustomMessage('validations.notSaved.message')).then((cancelAction) => {
40
+ if (cancelAction)
41
+ this.closeModal();
42
+ });
43
+ }
44
+ validatePersonalizedFilter() {
45
+ const filterPersonalized = this.filters.find(filter => filter.filterType === FilterType.CUSTOM_FILTER);
46
+ const isValid = PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
47
+ if (!isValid) {
48
+ return ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
49
+ }
50
+ this.applyFilters(this.filters);
20
51
  }
21
52
  modalActionListener(evt) {
22
53
  const modalAction = evt.detail;
@@ -25,9 +56,11 @@ export class SnkFilterModal {
25
56
  this.handleClearAll();
26
57
  break;
27
58
  case ModalAction.OK:
28
- this.applyFilters(this.filters);
59
+ this.validatePersonalizedFilter();
60
+ break;
29
61
  case ModalAction.CLOSE:
30
- this.closeModal();
62
+ this.handleClose();
63
+ break;
31
64
  default:
32
65
  break;
33
66
  }
@@ -35,9 +68,22 @@ export class SnkFilterModal {
35
68
  handleFilterChange(filterConfig) {
36
69
  this.filters = this.filters.map(filter => filter.id === filterConfig.id ? filterConfig : filter);
37
70
  }
38
- handleClearFilters(filterList) {
71
+ handleClearFilterList(filterList) {
39
72
  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);
40
73
  }
74
+ handleClearSigleFilter(filterItem) {
75
+ if (FilterItemType.MULTI_LIST === filterItem.type) {
76
+ let filterItemCopy = ObjectUtils.copy(filterItem);
77
+ this.uncheckFilterValues(filterItemCopy.value);
78
+ const filterListCopy = ObjectUtils.copy(this.filters);
79
+ const index = filterListCopy.findIndex(item => item.id === filterItem.id);
80
+ filterListCopy.splice(index, 1, filterItemCopy);
81
+ this.filters = ObjectUtils.copy(filterListCopy);
82
+ }
83
+ else {
84
+ this.filters.find(filter => filter.id === filterItem.id).value = undefined;
85
+ }
86
+ }
41
87
  uncheckFilterValues(valueList) {
42
88
  valueList.forEach(value => {
43
89
  if (!!value) {
@@ -47,7 +93,7 @@ export class SnkFilterModal {
47
93
  return valueList;
48
94
  }
49
95
  renderFilterItem(filterItem, fullRow) {
50
- 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) }));
96
+ 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() }));
51
97
  }
52
98
  mountFiltersLines(filters) {
53
99
  const MAX_LINE_LENGTH = 2;
@@ -75,7 +121,7 @@ export class SnkFilterModal {
75
121
  }
76
122
  renderFilterLine(filters) {
77
123
  const fullLine = filters.length === 1;
78
- return (h("div", { class: "ez-row" }, filters.map((filter) => this.renderFilterItem(filter, fullLine))));
124
+ return filters.map((filter) => this.renderFilterItem(filter, fullLine));
79
125
  }
80
126
  getIformedFiltersCount(listItems) {
81
127
  let countInformedItens = 0;
@@ -85,30 +131,37 @@ export class SnkFilterModal {
85
131
  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;
86
132
  return;
87
133
  }
134
+ if (item.groupedItems != undefined) {
135
+ countInformedItens = item.groupedItems.filter(item => item.visible).length;
136
+ return;
137
+ }
88
138
  if (!!item.value) {
89
139
  countInformedItens++;
90
140
  }
91
141
  });
92
142
  return countInformedItens;
93
143
  }
94
- renderCollapsibleFilterBox(label, listItems) {
144
+ renderCollapsibleFilterBox(label, listItems, isSingleItem, shouldRenderFooter = true) {
95
145
  if (!listItems.length)
96
146
  return null;
97
147
  const appliedFilters = this.getIformedFiltersCount(listItems);
98
148
  const lines = this.mountFiltersLines(listItems);
99
- return (h("ez-collapsible-box", { class: "snk-filter__modal-collapsible-box", headerSize: "medium", value: true, label: label }, !!appliedFilters &&
100
- 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) }))));
149
+ 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) })))));
101
150
  }
102
151
  componentWillRender() {
103
152
  this._modalTitle = this.getCustomMessage('title');
104
153
  this._okButtonLabel = this.getCustomMessage('okButtonLabel');
105
154
  this._cancelButtonLabel = this.getCustomMessage('cancelButtonLabel');
106
155
  }
156
+ componentDidLoad() {
157
+ if (!this._originalFilterConfig)
158
+ this._originalFilterConfig = this.filters;
159
+ }
107
160
  render() {
108
161
  const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
109
162
  const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
110
163
  const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
111
- 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])))));
164
+ 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)))));
112
165
  }
113
166
  static get is() { return "snk-filter-modal"; }
114
167
  static get originalStyleUrls() {
@@ -138,6 +191,23 @@ export class SnkFilterModal {
138
191
  "text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
139
192
  }
140
193
  },
194
+ "configName": {
195
+ "type": "string",
196
+ "mutable": true,
197
+ "complexType": {
198
+ "original": "string",
199
+ "resolved": "string",
200
+ "references": {}
201
+ },
202
+ "required": false,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": "Nome da config para buscar no resourceId"
207
+ },
208
+ "attribute": "config-name",
209
+ "reflect": false
210
+ },
141
211
  "filters": {
142
212
  "type": "unknown",
143
213
  "mutable": true,
@@ -221,6 +291,36 @@ export class SnkFilterModal {
221
291
  "tags": [],
222
292
  "text": "A\u00E7\u00E3o disparada ao fechar o modal"
223
293
  }
294
+ },
295
+ "addPersonalizedFilter": {
296
+ "type": "unknown",
297
+ "mutable": false,
298
+ "complexType": {
299
+ "original": "() => void",
300
+ "resolved": "() => void",
301
+ "references": {}
302
+ },
303
+ "required": false,
304
+ "optional": false,
305
+ "docs": {
306
+ "tags": [],
307
+ "text": "A\u00E7\u00E3o executada ao adicionar um filtro personalizado"
308
+ }
309
+ },
310
+ "editPersonalizedFilter": {
311
+ "type": "unknown",
312
+ "mutable": false,
313
+ "complexType": {
314
+ "original": "(id:string) => void",
315
+ "resolved": "(id: string) => void",
316
+ "references": {}
317
+ },
318
+ "required": false,
319
+ "optional": false,
320
+ "docs": {
321
+ "tags": [],
322
+ "text": "A\u00E7\u00E3o executada ao editart um filtro personalizado"
323
+ }
224
324
  }
225
325
  };
226
326
  }
@@ -1,48 +1,66 @@
1
1
  import { h, Host } from '@stencil/core';
2
- import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { ApplicationContext, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import FilterItemType from "../../filter-item/filter-item-type.enum";
4
- import FilterType from '../../types/filter-type.enum';
5
4
  import { EPresentationMode } from '../../filter-item/editors/enum/presentationMode';
6
- import FilterBarConfigFetcher from '../../../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher';
5
+ import { ConfigStorage } from '../../../../lib/configs/ConfigStorage';
6
+ import FilterType from '../../types/filter-type.enum';
7
7
  export class SnkFilterModalItem {
8
8
  constructor() {
9
9
  this.filterItem = undefined;
10
+ this.configName = undefined;
10
11
  }
11
12
  observeFilterItem(newValue) {
12
13
  var _a, _b;
14
+ this._editor && (this._editor["config"] = newValue);
13
15
  (_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
14
16
  this.filterChange.emit(newValue);
15
- this.saveConfig();
17
+ //isso faz o filtro salvar o estado precocemente. Caso: Botão limpar filtro dispara dezenas de vezes
18
+ //this.saveConfig();
16
19
  }
17
20
  getContentEditorConfig() {
18
- const variations = { presentationMode: EPresentationMode.MODAL };
21
+ const props = { presentationMode: EPresentationMode.MODAL };
19
22
  switch (this.filterItem.type) {
20
23
  case FilterItemType.BINARY_SELECT:
21
- return { tag: "snk-filter-binary-select", variations };
24
+ return { tag: "snk-filter-binary-select", props };
22
25
  case FilterItemType.MULTI_SELECT:
23
26
  return { tag: "snk-filter-multi-select" };
24
27
  case FilterItemType.PERIOD:
25
- return { tag: "snk-filter-period", variations };
28
+ return { tag: "snk-filter-period", props };
26
29
  case FilterItemType.SEARCH:
27
30
  return { tag: "snk-filter-search" };
28
31
  case FilterItemType.NUMBER:
29
32
  return { tag: "snk-filter-number" };
30
33
  case FilterItemType.PERSONALIZED:
31
- return { tag: "snk-filter-personalized" };
34
+ const snkFilterPersonalizedProps = {
35
+ tag: "snk-filter-personalized", props: {
36
+ onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
37
+ onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
38
+ onAddFilter: () => this.addPersonalizedFilter.emit(),
39
+ }
40
+ };
41
+ return snkFilterPersonalizedProps;
32
42
  case FilterItemType.MULTI_LIST:
33
- return { tag: "snk-entity-list", variations: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
43
+ return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
34
44
  }
35
45
  return { tag: "snk-filter-text" };
36
46
  }
37
- updateFilterValue(newValue) {
38
- const isVisble = !this.filterItem.visible ? newValue !== undefined : true;
39
- this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: isVisble });
40
- if (FilterItemType.MULTI_LIST === this.filterItem.type) {
41
- this.saveConfig();
47
+ isVisible(newValue) {
48
+ return !this.filterItem.visible ? newValue !== undefined : true;
49
+ }
50
+ updateFilterValue(data) {
51
+ const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
52
+ if (this.filterItem.groupedItems != undefined) {
53
+ this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
42
54
  }
55
+ else {
56
+ this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: newValue, visible: this.isVisible(newValue) });
57
+ }
58
+ this.saveConfig();
43
59
  }
44
- canShowDetailModal() {
45
- return this.filterItem.filterType !== FilterType.OTHER_FILTERS && this.filterItem.type !== FilterItemType.BINARY_SELECT;
60
+ handleDeleteFilter(filter, filterItemType) {
61
+ if (filterItemType === FilterItemType.PERSONALIZED) {
62
+ ConfigStorage.removePersonalizedFilter(filter, this.configName);
63
+ }
46
64
  }
47
65
  componentDidLoad() {
48
66
  if (this._element) {
@@ -53,25 +71,31 @@ export class SnkFilterModalItem {
53
71
  }
54
72
  }
55
73
  buildRightSlot(item) {
56
- return h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) });
74
+ return (h("ez-icon", { iconName: "delete", onClick: () => this.removeValueFromConfig(item) }));
57
75
  }
58
76
  removeValueFromConfig(item) {
59
- var _a, _b, _c, _d, _e, _f;
60
- 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);
61
- (_d = (_c = this.filterItem) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.splice(index, 1);
62
- (_f = (_e = this._editor) === null || _e === void 0 ? void 0 : _e["reloadList"]) === null || _f === void 0 ? void 0 : _f.call(_e);
63
- this.saveConfig();
77
+ var _a, _b, _c;
78
+ 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);
79
+ const filterItemCopy = ObjectUtils.copy(this.filterItem);
80
+ (_c = filterItemCopy === null || filterItemCopy === void 0 ? void 0 : filterItemCopy.value) === null || _c === void 0 ? void 0 : _c.splice(index, 1);
81
+ this.updateFilterValue(filterItemCopy.value);
82
+ }
83
+ canShowDetailModal() {
84
+ const { CUSTOM_FILTER, OTHER_FILTERS } = FilterType;
85
+ return ![CUSTOM_FILTER, OTHER_FILTERS].includes(this.filterItem.filterType) && this.filterItem.type !== FilterItemType.BINARY_SELECT;
64
86
  }
65
87
  saveConfig() {
66
- var _a;
67
- (_a = this._application) === null || _a === void 0 ? void 0 : _a.getResourceID().then(resourceId => {
88
+ //Precisa ser rediscutido... não podemos salvar configuração por conta própria. Não temos autonomia pra isso.
89
+ /*if(FilterItemType.MULTI_LIST !== this.filterItem.type) return;
90
+
91
+ this._application?.getResourceID().then(resourceId => {
68
92
  const fetcher = new FilterBarConfigFetcher();
69
93
  fetcher.saveEntityListConfig(this.filterItem, resourceId, this._application.configName);
70
- });
94
+ });*/
71
95
  }
72
96
  render() {
73
- const { tag: ContentEditor, variations } = this.getContentEditorConfig();
74
- 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)))));
97
+ const { tag: ContentEditor, props } = this.getContentEditorConfig();
98
+ 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)))));
75
99
  }
76
100
  static get is() { return "snk-filter-modal-item"; }
77
101
  static get originalStyleUrls() {
@@ -105,6 +129,23 @@ export class SnkFilterModalItem {
105
129
  "tags": [],
106
130
  "text": ""
107
131
  }
132
+ },
133
+ "configName": {
134
+ "type": "string",
135
+ "mutable": true,
136
+ "complexType": {
137
+ "original": "string",
138
+ "resolved": "string",
139
+ "references": {}
140
+ },
141
+ "required": false,
142
+ "optional": false,
143
+ "docs": {
144
+ "tags": [],
145
+ "text": "Nome da config para buscar no resourceId"
146
+ },
147
+ "attribute": "config-name",
148
+ "reflect": false
108
149
  }
109
150
  };
110
151
  }
@@ -129,6 +170,36 @@ export class SnkFilterModalItem {
129
170
  }
130
171
  }
131
172
  }
173
+ }, {
174
+ "method": "editPersonalizedFilter",
175
+ "name": "editPersonalizedFilter",
176
+ "bubbles": true,
177
+ "cancelable": true,
178
+ "composed": true,
179
+ "docs": {
180
+ "tags": [],
181
+ "text": ""
182
+ },
183
+ "complexType": {
184
+ "original": "string",
185
+ "resolved": "string",
186
+ "references": {}
187
+ }
188
+ }, {
189
+ "method": "addPersonalizedFilter",
190
+ "name": "addPersonalizedFilter",
191
+ "bubbles": true,
192
+ "cancelable": true,
193
+ "composed": true,
194
+ "docs": {
195
+ "tags": [],
196
+ "text": ""
197
+ },
198
+ "complexType": {
199
+ "original": "void",
200
+ "resolved": "void",
201
+ "references": {}
202
+ }
132
203
  }];
133
204
  }
134
205
  static get elementRef() { return "_element"; }
@@ -1,6 +1,11 @@
1
1
  :host {
2
2
  display: grid;
3
3
  grid-template-columns: minmax(100px, 100%) 1fr 1fr;
4
+
5
+ /*@doc Define o z-index do componente.*/
6
+ --snk-personalized-filter--z-index: var(--more-visible, 2);
7
+ /*@doc Define a cor de fundo do componente.*/
8
+ --snk-personalized-filter--background-color: var(--background--xlight, #fff);
4
9
  }
5
10
 
6
11
  .snk-filter__popover-container{
@@ -9,6 +14,22 @@
9
14
  cursor: auto;
10
15
  }
11
16
 
17
+ .filter-bar__personalized-filter{
18
+ /*private*/
19
+ display: flex;
20
+ flex-direction: column;
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ width: 100%;
25
+ height: 100%;
26
+ overflow: auto;
27
+
28
+ /*public*/
29
+ z-index: var(--snk-personalized-filter--z-index);
30
+ background-color: var(--snk-personalized-filter--background-color);
31
+ }
32
+
12
33
  .snk-filter__popover{
13
34
  /*private*/
14
35
  display: flex;