@sankhyalabs/sankhyablocks 5.19.0 → 6.0.0

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 (300) 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 +2 -2
  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 +161 -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 +66 -12
  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-actions-button/subcomponents/snk-client-confirm.js +1 -1
  62. package/dist/collection/components/snk-entity-list/snk-entity-list.js +6 -4
  63. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +34 -12
  64. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +4 -2
  65. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.css +66 -0
  66. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.js +370 -0
  67. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +52 -68
  68. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +20 -6
  69. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +1 -0
  70. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +110 -10
  71. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +98 -27
  72. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +21 -0
  73. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +100 -49
  74. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js +1 -0
  75. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +22 -3
  76. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +96 -0
  77. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css +1 -1
  78. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +27 -6
  79. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +39 -2
  80. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +276 -30
  81. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css +73 -0
  82. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +443 -0
  83. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +16 -24
  84. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +18 -4
  85. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +131 -21
  86. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.js +0 -0
  87. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.js +5 -1
  88. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.js +1 -0
  89. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.js +1 -0
  90. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +3 -0
  91. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +1 -1
  92. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +184 -15
  93. package/dist/collection/lib/@types/index.js +2 -0
  94. package/dist/collection/lib/configs/ConfigStorage.js +15 -0
  95. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +36 -13
  96. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +106 -4
  97. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +15 -2
  98. package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js +2 -0
  99. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +48 -2
  100. package/dist/components/ConfigStorage.js +180 -1
  101. package/dist/components/PersonalizedFilterUtils.js +227 -0
  102. package/dist/components/SnkMessageBuilder.js +65 -4
  103. package/dist/components/filter-bar-config-fetcher.js +34 -11
  104. package/dist/components/index.d.ts +2 -1
  105. package/dist/components/index.js +1 -0
  106. package/dist/components/index2.js +3 -1
  107. package/dist/components/snk-client-confirm.js +1 -1
  108. package/dist/components/snk-crud.js +65 -35
  109. package/dist/components/snk-data-exporter2.js +1 -1
  110. package/dist/components/snk-detail-view2.js +99 -44
  111. package/dist/components/snk-entity-list.js +6 -4
  112. package/dist/components/snk-expression-group.d.ts +11 -0
  113. package/dist/components/snk-expression-group.js +6 -0
  114. package/dist/components/snk-expression-group2.js +296 -0
  115. package/dist/components/snk-expression-item2.js +133 -46
  116. package/dist/components/snk-filter-bar2.js +195 -68
  117. package/dist/components/snk-filter-detail2.js +52 -68
  118. package/dist/components/snk-filter-field-search2.js +26 -5
  119. package/dist/components/snk-filter-item2.js +20 -6
  120. package/dist/components/snk-filter-modal-item2.js +54 -27
  121. package/dist/components/snk-filter-modal.js +68 -12
  122. package/dist/components/snk-filter-param-config2.js +3 -57
  123. package/dist/components/snk-filter-period.js +4 -2
  124. package/dist/components/snk-filter-personalized.js +139 -58
  125. package/dist/components/snk-grid2.js +52 -16
  126. package/dist/components/snk-personalized-filter.js +1 -153
  127. package/dist/components/snk-personalized-filter2.js +238 -0
  128. package/dist/esm/ConfigStorage-9f4d2e67.js +300 -0
  129. package/dist/esm/IExpressionItem-2e922b2c.js +7 -0
  130. package/dist/esm/PersonalizedFilterUtils-202cd721.js +227 -0
  131. package/dist/esm/{SnkFormConfigManager-e60367a0.js → SnkFormConfigManager-def999fe.js} +1 -1
  132. package/dist/esm/{SnkMessageBuilder-188a38bb.js → SnkMessageBuilder-cc4d1599.js} +65 -4
  133. package/dist/esm/{filter-bar-config-fetcher-edc48f4b.js → filter-bar-config-fetcher-bd2070a3.js} +34 -11
  134. package/dist/esm/{index-cfd4bb13.js → index-8c3d76a6.js} +6 -1
  135. package/dist/esm/{index-507e19ec.js → index-a255b326.js} +3 -1
  136. package/dist/esm/{index-8efbf198.js → index-d60ca0ac.js} +1 -1
  137. package/dist/esm/loader.js +3 -3
  138. package/dist/esm/sankhyablocks.js +3 -3
  139. package/dist/esm/snk-actions-button.entry.js +2 -2
  140. package/dist/esm/snk-actions-form.entry.js +1 -1
  141. package/dist/esm/snk-application.entry.js +4 -4
  142. package/dist/esm/snk-attach.entry.js +4 -4
  143. package/dist/esm/snk-client-confirm.entry.js +2 -2
  144. package/dist/esm/snk-config-options.entry.js +1 -1
  145. package/dist/esm/snk-configurator.entry.js +1 -1
  146. package/dist/esm/snk-crud.entry.js +4 -4
  147. package/dist/esm/snk-data-exporter.entry.js +4 -4
  148. package/dist/esm/{snk-data-unit-79b1583a.js → snk-data-unit-97824457.js} +2 -2
  149. package/dist/esm/snk-data-unit.entry.js +3 -3
  150. package/dist/esm/snk-detail-view.entry.js +10 -10
  151. package/dist/esm/snk-entity-list.entry.js +7 -5
  152. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  153. package/dist/esm/snk-expression-group.entry.js +242 -0
  154. package/dist/esm/{snk-filter-field-search_2.entry.js → snk-expression-item_3.entry.js} +326 -66
  155. package/dist/esm/snk-field-config.entry.js +1 -1
  156. package/dist/esm/snk-filter-bar.entry.js +156 -67
  157. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  158. package/dist/esm/snk-filter-detail.entry.js +55 -70
  159. package/dist/esm/snk-filter-item.entry.js +21 -7
  160. package/dist/esm/snk-filter-list.entry.js +1 -1
  161. package/dist/esm/snk-filter-modal-item.entry.js +57 -29
  162. package/dist/esm/snk-filter-modal.entry.js +66 -12
  163. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  164. package/dist/esm/snk-filter-number.entry.js +1 -1
  165. package/dist/esm/snk-filter-period.entry.js +5 -3
  166. package/dist/esm/snk-filter-personalized.entry.js +135 -55
  167. package/dist/esm/snk-filter-search.entry.js +1 -1
  168. package/dist/esm/snk-filter-text.entry.js +1 -1
  169. package/dist/esm/snk-form-config.entry.js +1 -1
  170. package/dist/esm/snk-form-summary.entry.js +1 -1
  171. package/dist/esm/snk-form-view.entry.js +1 -1
  172. package/dist/esm/snk-form.entry.js +4 -4
  173. package/dist/esm/snk-grid-config.entry.js +3 -3
  174. package/dist/esm/snk-grid.entry.js +7 -7
  175. package/dist/esm/{snk-guides-viewer-59d3a78c.js → snk-guides-viewer-0380f3df.js} +5 -5
  176. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  177. package/dist/esm/snk-personalized-filter.entry.js +166 -94
  178. package/dist/esm/snk-pesquisa.entry.js +1 -1
  179. package/dist/esm/snk-select-box.entry.js +1 -1
  180. package/dist/esm/snk-simple-bar.entry.js +41 -0
  181. package/dist/esm/{snk-simple-bar_2.entry.js → snk-simple-crud.entry.js} +7 -44
  182. package/dist/esm/snk-tab-config.entry.js +1 -1
  183. package/dist/esm/snk-taskbar.entry.js +4 -4
  184. package/dist/esm/{taskbar-elements-8ff33c26.js → taskbar-elements-26d0fba3.js} +3 -3
  185. package/dist/esm/{taskbar-processor-20de6616.js → taskbar-processor-dfef41a8.js} +1 -1
  186. package/dist/esm/teste-pesquisa.entry.js +1 -1
  187. package/dist/sankhyablocks/{p-f27dc5e9.entry.js → p-00d1cac4.entry.js} +1 -1
  188. package/dist/sankhyablocks/{p-b9667fbe.js → p-066ee142.js} +2 -2
  189. package/dist/sankhyablocks/p-09a058ba.entry.js +1 -0
  190. package/dist/sankhyablocks/{p-82bc4666.entry.js → p-0dec4d29.entry.js} +1 -1
  191. package/dist/sankhyablocks/{p-1e6a95f5.entry.js → p-12632b8e.entry.js} +1 -1
  192. package/dist/sankhyablocks/{p-384c4a6b.js → p-18b34bb4.js} +1 -1
  193. package/dist/sankhyablocks/{p-538c057a.entry.js → p-2ad89e28.entry.js} +1 -1
  194. package/dist/sankhyablocks/p-2d5108b3.js +1 -0
  195. package/dist/sankhyablocks/{p-ff398057.entry.js → p-34cd4b39.entry.js} +1 -1
  196. package/dist/sankhyablocks/p-36ecb6ab.js +1 -0
  197. package/dist/sankhyablocks/p-372e0185.entry.js +1 -0
  198. package/dist/sankhyablocks/p-3be34bd1.entry.js +1 -0
  199. package/dist/sankhyablocks/p-3d45107f.js +1 -0
  200. package/dist/sankhyablocks/{p-28c12f65.js → p-463e0936.js} +1 -1
  201. package/dist/sankhyablocks/{p-e701646c.entry.js → p-49d628d1.entry.js} +1 -1
  202. package/dist/sankhyablocks/{p-e642bf7a.entry.js → p-50db4bc4.entry.js} +1 -1
  203. package/dist/sankhyablocks/{p-093febff.entry.js → p-5427566a.entry.js} +1 -1
  204. package/dist/sankhyablocks/{p-6a02e236.js → p-590d8900.js} +1 -1
  205. package/dist/sankhyablocks/p-5a6c090e.entry.js +1 -0
  206. package/dist/sankhyablocks/p-639be4aa.entry.js +1 -0
  207. package/dist/sankhyablocks/{p-e2bb9c9a.entry.js → p-67a19b48.entry.js} +1 -1
  208. package/dist/sankhyablocks/{p-19692f92.js → p-69770075.js} +1 -1
  209. package/dist/sankhyablocks/p-6d4169fc.entry.js +1 -0
  210. package/dist/sankhyablocks/{p-0b40c655.js → p-708ee8ee.js} +1 -1
  211. package/dist/sankhyablocks/{p-9af04fc7.entry.js → p-718cc24b.entry.js} +1 -1
  212. package/dist/sankhyablocks/{p-2d0fc912.entry.js → p-7946512f.entry.js} +1 -1
  213. package/dist/sankhyablocks/{p-900b2889.entry.js → p-7a5e1be7.entry.js} +1 -1
  214. package/dist/sankhyablocks/p-801b8858.js +68 -0
  215. package/dist/sankhyablocks/{p-80e52e85.entry.js → p-847b9506.entry.js} +1 -1
  216. package/dist/sankhyablocks/{p-56d70073.entry.js → p-8d541539.entry.js} +1 -1
  217. package/dist/sankhyablocks/{p-584a315a.entry.js → p-8e98a893.entry.js} +1 -1
  218. package/dist/sankhyablocks/p-9731180c.entry.js +1 -0
  219. package/dist/sankhyablocks/p-a6055eb9.entry.js +1 -0
  220. package/dist/sankhyablocks/{p-b680fa7a.entry.js → p-a655ea15.entry.js} +1 -1
  221. package/dist/sankhyablocks/{p-b75ce8b8.entry.js → p-a8b06801.entry.js} +1 -1
  222. package/dist/sankhyablocks/{p-b25450ab.js → p-a8e5ded0.js} +1 -1
  223. package/dist/sankhyablocks/{p-6ac29569.entry.js → p-b66b99d9.entry.js} +1 -1
  224. package/dist/sankhyablocks/p-b7efc49a.entry.js +1 -0
  225. package/dist/sankhyablocks/{p-9c7f7214.entry.js → p-b91ee370.entry.js} +1 -1
  226. package/dist/sankhyablocks/{p-e551b19a.entry.js → p-b940798f.entry.js} +1 -1
  227. package/dist/sankhyablocks/{p-72e78de0.entry.js → p-bbefb3b2.entry.js} +1 -1
  228. package/dist/sankhyablocks/p-bdd61fa8.entry.js +1 -0
  229. package/dist/sankhyablocks/{p-f8c66aa3.entry.js → p-c06973e7.entry.js} +1 -1
  230. package/dist/sankhyablocks/{p-257c71a7.entry.js → p-c17e19a2.entry.js} +1 -1
  231. package/dist/sankhyablocks/p-c6bf66e0.js +1 -0
  232. package/dist/sankhyablocks/p-cf90a195.entry.js +1 -0
  233. package/dist/sankhyablocks/{p-44c2ed16.entry.js → p-d11c5026.entry.js} +1 -1
  234. package/dist/sankhyablocks/p-d5145c3f.entry.js +1 -0
  235. package/dist/sankhyablocks/p-de328b00.entry.js +1 -0
  236. package/dist/sankhyablocks/{p-971abcc2.entry.js → p-e500863b.entry.js} +1 -1
  237. package/dist/sankhyablocks/{p-22e44b9d.entry.js → p-e824aef2.entry.js} +1 -1
  238. package/dist/sankhyablocks/{p-4ce96831.entry.js → p-eb24c092.entry.js} +1 -1
  239. package/dist/sankhyablocks/{p-4c2015a9.js → p-eb90de43.js} +1 -1
  240. package/dist/sankhyablocks/p-ebb8de34.entry.js +1 -0
  241. package/dist/sankhyablocks/{p-8652d177.entry.js → p-fc512cbe.entry.js} +1 -1
  242. package/dist/sankhyablocks/{p-786ae316.entry.js → p-fced1d89.entry.js} +1 -1
  243. package/dist/sankhyablocks/{p-e0b4aec3.entry.js → p-fdb43927.entry.js} +1 -1
  244. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  245. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.d.ts +85 -0
  246. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +6 -6
  247. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  248. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +18 -1
  249. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +14 -6
  250. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +10 -3
  251. package/dist/types/components/snk-filter-bar/types/custom-element-filter.d.ts +6 -0
  252. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +10 -1
  253. package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +92 -15
  254. package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +5 -11
  255. package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +3 -0
  256. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +39 -6
  257. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +82 -0
  258. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
  259. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +13 -1
  260. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.d.ts +0 -0
  261. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +23 -3
  262. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +21 -0
  263. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.d.ts +11 -0
  264. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +3 -0
  265. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +14 -2
  266. package/dist/types/components.d.ts +169 -10
  267. package/dist/types/lib/@types/index.d.ts +3 -1
  268. package/dist/types/lib/configs/ConfigStorage.d.ts +5 -0
  269. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +4 -2
  270. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +5 -0
  271. package/dist/types/lib/store/index.d.ts +1 -2
  272. package/package.json +5 -5
  273. package/react/components.d.ts +1 -0
  274. package/react/components.js +1 -0
  275. package/react/components.js.map +1 -1
  276. package/dist/cjs/ConfigStorage-f68c3607.js +0 -124
  277. package/dist/cjs/index-8d94b7e0.js +0 -7
  278. package/dist/cjs/snk-expression-item.cjs.entry.js +0 -213
  279. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +0 -214
  280. package/dist/esm/ConfigStorage-e6c17998.js +0 -121
  281. package/dist/esm/index-620ac460.js +0 -7
  282. package/dist/esm/snk-expression-item.entry.js +0 -209
  283. package/dist/sankhyablocks/p-0b6ddb67.entry.js +0 -1
  284. package/dist/sankhyablocks/p-0c2afa63.entry.js +0 -1
  285. package/dist/sankhyablocks/p-343699ad.entry.js +0 -1
  286. package/dist/sankhyablocks/p-471568c7.entry.js +0 -1
  287. package/dist/sankhyablocks/p-6c2c71ca.js +0 -1
  288. package/dist/sankhyablocks/p-8ce9ea9f.entry.js +0 -1
  289. package/dist/sankhyablocks/p-8efb0f47.entry.js +0 -1
  290. package/dist/sankhyablocks/p-9a448ff9.entry.js +0 -1
  291. package/dist/sankhyablocks/p-9e50681c.entry.js +0 -1
  292. package/dist/sankhyablocks/p-9f66bc54.entry.js +0 -1
  293. package/dist/sankhyablocks/p-b1c02726.js +0 -1
  294. package/dist/sankhyablocks/p-b34d23fa.js +0 -1
  295. package/dist/sankhyablocks/p-c20dd153.entry.js +0 -1
  296. package/dist/sankhyablocks/p-cbb5c440.entry.js +0 -1
  297. package/dist/sankhyablocks/p-f3241ada.entry.js +0 -1
  298. package/dist/sankhyablocks/p-f4184ce7.js +0 -1
  299. package/dist/sankhyablocks/p-ff96b509.entry.js +0 -27
  300. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +0 -40
@@ -5,12 +5,14 @@ import { ConfigStorage } from '../../lib/configs/ConfigStorage';
5
5
  import buildFilter from './filter-item/dataunitfilter/data-unit-filter-builder';
6
6
  import FilterItemType from './filter-item/filter-item-type.enum';
7
7
  import SnkFilterModalFactory from './utils/SnkFilterModalFactory';
8
+ import { PersonalizedFilterUtils } from '../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
8
9
  export class SnkFilterBar {
9
10
  constructor() {
10
11
  this._updateSequence = [];
11
12
  this._loadingPending = false;
12
13
  this._configUpdated = false;
13
- this._pendingFilters = [];
14
+ this._pendingVariables = false;
15
+ this._customfiltersToBeUpdated = [];
14
16
  this._calculateSortIndex = (item) => {
15
17
  let index = item.hardFixed ? 1000000 : 0;
16
18
  //campos Hard Fixed não variam a ordem
@@ -30,6 +32,8 @@ export class SnkFilterBar {
30
32
  this.messagesBuilder = undefined;
31
33
  this.allowDefault = undefined;
32
34
  this.scrollerLocked = false;
35
+ this.showPersonalizedFilter = false;
36
+ this.personalizedFilterId = undefined;
33
37
  }
34
38
  observeFilterConfig(newValue, oldValue) {
35
39
  if (oldValue != undefined && newValue == undefined) {
@@ -38,17 +42,28 @@ export class SnkFilterBar {
38
42
  }
39
43
  else {
40
44
  const oldItems = new Map(oldValue ? oldValue.map(item => [item.id, item]) : undefined);
41
- newValue.forEach(newItem => {
42
- const oldItem = oldItems.get(newItem.id);
43
- if (oldItem != undefined) {
44
- this._configUpdated = this._configUpdated || ObjectUtils.objectToString(oldItem) != ObjectUtils.objectToString(newItem);
45
- this._loadingPending = this._loadingPending || ObjectUtils.objectToString(oldItem.value) !== ObjectUtils.objectToString(newItem.value);
46
- }
47
- else {
48
- this._configUpdated = true;
49
- this._loadingPending = this._loadingPending || newItem.value != undefined;
50
- }
51
- });
45
+ if (oldItems.size === 0 && newValue.length > 0) {
46
+ this._loadingPending = true;
47
+ this._configUpdated = false;
48
+ }
49
+ else {
50
+ newValue.forEach(newItem => {
51
+ const oldItem = oldItems.get(newItem.id);
52
+ if (oldItem != undefined) {
53
+ this._configUpdated = this._configUpdated || ObjectUtils.objectToString(oldItem) != ObjectUtils.objectToString(newItem);
54
+ this._loadingPending = this._loadingPending || ObjectUtils.objectToString(oldItem.value) !== ObjectUtils.objectToString(newItem.value);
55
+ if (!this._loadingPending) {
56
+ const groupedChanged = ObjectUtils.objectToString(oldItem.groupedItems) != ObjectUtils.objectToString(newItem.groupedItems);
57
+ this._configUpdated = this._configUpdated || groupedChanged;
58
+ this._loadingPending = this._loadingPending || groupedChanged;
59
+ }
60
+ }
61
+ else {
62
+ this._configUpdated = true;
63
+ this._loadingPending = this._loadingPending || newItem.value != undefined;
64
+ }
65
+ });
66
+ }
52
67
  }
53
68
  this.processAfterUpdateConfig();
54
69
  }
@@ -65,30 +80,31 @@ export class SnkFilterBar {
65
80
  }
66
81
  }
67
82
  processPendingFilter() {
68
- if (this._pendingFilters.length > 0 && this._currentPendingFilter == undefined) {
69
- this._currentPendingFilter = this._element.querySelector("#filter-" + this._pendingFilters.pop());
70
- if (this._currentPendingFilter) {
71
- this._currentPendingFilter.showUp(true).then(() => {
72
- this._currentPendingFilter = undefined;
73
- this.processPendingFilter();
83
+ if (this._pendingVariables) {
84
+ const popUp = this._element.querySelector("#filter-PERSONALIZED_FILTER_GROUP");
85
+ if (popUp) {
86
+ popUp.showUp(true).then(() => {
87
+ this.processAfterUpdateConfig();
74
88
  });
75
89
  }
76
90
  }
77
- if (this._currentPendingFilter == undefined) {
91
+ else {
78
92
  this.processAfterUpdateConfig();
79
93
  }
80
94
  }
81
- processAfterUpdateConfig() {
82
- if (this._pendingFilters.length > 0) {
83
- return;
84
- }
95
+ async processAfterUpdateConfig() {
85
96
  if (this._loadingPending) {
86
- this._loadingPending = false;
87
- this._inProgressLoadFromConfig = new Promise((resolve) => {
88
- this.dataUnit.loadData().then(() => {
89
- resolve();
90
- });
97
+ const personalizedFilter = this.filterConfig.find(item => {
98
+ if (item.type === FilterItemType.PERSONALIZED) {
99
+ return true;
100
+ }
91
101
  });
102
+ this._pendingVariables = !PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
103
+ if (this._pendingVariables) {
104
+ return;
105
+ }
106
+ this._loadingPending = false;
107
+ this.dataUnit.loadData();
92
108
  }
93
109
  if (this._configUpdated) {
94
110
  this._configUpdated = false;
@@ -117,7 +133,14 @@ export class SnkFilterBar {
117
133
  return filters;
118
134
  }
119
135
  isActiveFilter(item) {
120
- return (item.visible && item.value != undefined) || item.type === FilterItemType.DEFAULT_FILTER;
136
+ /*
137
+ - O filtro padrão também deve sempre ser condiderado ativo, pois, sempre deve
138
+ ser aplicado.
139
+ */
140
+ if (item.type === FilterItemType.DEFAULT_FILTER) {
141
+ return true;
142
+ }
143
+ return item.visible && (item.groupedItems || item.value != undefined);
121
144
  }
122
145
  registryFilterProvider() {
123
146
  this.dataUnit.addFilterProvider(this);
@@ -137,12 +160,16 @@ export class SnkFilterBar {
137
160
  }
138
161
  });
139
162
  }
163
+ filterActiveFilter(item) {
164
+ return item.visible || item.removalBlocked;
165
+ }
140
166
  getFilterItems() {
141
167
  const pinnedItems = [];
142
168
  const unpinnedItems = [];
143
169
  this.filterConfig
144
- .filter(item => item.visible)
170
+ .filter(this.filterActiveFilter)
145
171
  .forEach((item, index) => {
172
+ item = ObjectUtils.copy(item);
146
173
  const itemId = `filter-${item.id}`;
147
174
  const filterItem = (h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
148
175
  if (item.fixed || item.hardFixed) {
@@ -196,19 +223,16 @@ export class SnkFilterBar {
196
223
  this._application.isUserSup().then(value => this.allowDefault = value);
197
224
  }
198
225
  loadConfigFromStorage() {
199
- ConfigStorage.get().then(instance => {
200
- instance.loadFilterBarConfig(this.configName)
201
- .then((filters) => {
202
- var _a;
203
- this.filterConfig = filters.map(item => this.normalizeItem(item));
204
- if (this._inProgressLoadFromConfig) {
205
- return;
206
- }
207
- (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true);
208
- this._inProgressLoadFromConfig = undefined;
209
- })
210
- .catch(reason => {
211
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
226
+ return new Promise(accept => {
227
+ ConfigStorage.get().then(instance => {
228
+ instance.loadFilterBarConfig(this.configName)
229
+ .then((filters) => {
230
+ accept();
231
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
232
+ })
233
+ .catch(reason => {
234
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
235
+ });
212
236
  });
213
237
  });
214
238
  }
@@ -248,12 +272,34 @@ export class SnkFilterBar {
248
272
  this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
249
273
  };
250
274
  const factoryParams = {
251
- filterConfig: this.filterConfig,
275
+ filterConfig: ObjectUtils.copy(this.filterConfig),
276
+ configName: this.configName,
252
277
  onComplete: callbackOnApplyFilter,
253
- getMessage: (key, props) => this.getMessage(key, props)
278
+ getMessage: (key, props) => this.getMessage(key, props),
279
+ onAddPersonalizedFilter: () => this.addPersonalizedFilter(),
280
+ onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id)
254
281
  };
255
- const factory = new SnkFilterModalFactory(factoryParams);
256
- await factory.showModal();
282
+ this._filterModalFactory = new SnkFilterModalFactory(factoryParams);
283
+ await this._filterModalFactory.showModal();
284
+ }
285
+ addPersonalizedFilter() {
286
+ this._filterModalFactory.closeModal();
287
+ this.personalizedFilterId = undefined;
288
+ this.showPersonalizedFilter = true;
289
+ window.requestAnimationFrame(() => {
290
+ this._elPersonalizedFilter.createPersonalizedFilter();
291
+ });
292
+ }
293
+ editPersonalizedFilter(id) {
294
+ this._filterModalFactory.closeModal();
295
+ this.showPersonalizedFilter = true;
296
+ this.personalizedFilterId = id;
297
+ }
298
+ hidePersonalizedFilter() {
299
+ this.loadConfigFromStorage().then(() => {
300
+ this.personalizedFilterId = undefined;
301
+ this.showPersonalizedFilter = false;
302
+ });
257
303
  }
258
304
  componentWillLoad() {
259
305
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
@@ -270,7 +316,10 @@ export class SnkFilterBar {
270
316
  if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
271
317
  return undefined;
272
318
  }
273
- return (h(Host, null, h("ez-scroller", { direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
319
+ if (this.showPersonalizedFilter) {
320
+ return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
321
+ }
322
+ return h(Host, null, h("ez-scroller", { direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" })));
274
323
  }
275
324
  static get is() { return "snk-filter-bar"; }
276
325
  static get encapsulation() { return "scoped"; }
@@ -371,7 +420,9 @@ export class SnkFilterBar {
371
420
  static get states() {
372
421
  return {
373
422
  "allowDefault": {},
374
- "scrollerLocked": {}
423
+ "scrollerLocked": {},
424
+ "showPersonalizedFilter": {},
425
+ "personalizedFilterId": {}
375
426
  };
376
427
  }
377
428
  static get methods() {
@@ -1,24 +1,40 @@
1
1
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
2
+ import FilterItemType from "../filter-item/filter-item-type.enum";
2
3
  class SnkFilterModalFactory {
3
- constructor({ filterConfig, onComplete, getMessage }) {
4
+ constructor({ filterConfig, configName, onComplete, getMessage, onAddPersonalizedFilter, onEditPersonalizedFilter }) {
4
5
  this._filterConfig = filterConfig;
6
+ this._configName = configName;
5
7
  this._onComplete = onComplete;
6
8
  this._getMessage = getMessage;
9
+ this._addPersonalizedFilterFn = onAddPersonalizedFilter;
10
+ this._editPersonalizedFilterFn = onEditPersonalizedFilter;
7
11
  }
8
12
  applyFilters(newFilterConfig) {
9
13
  this._onComplete(newFilterConfig);
10
14
  this._closeModal();
11
15
  }
12
16
  clearAll(filterConfigSnapshot) {
13
- return filterConfigSnapshot.map(filterItem => (Object.assign(Object.assign({}, filterItem), { value: undefined })));
17
+ return filterConfigSnapshot.map(filterItem => {
18
+ const copy = Object.assign({}, filterItem);
19
+ delete copy.value;
20
+ if (filterItem.type === FilterItemType.PERSONALIZED) {
21
+ copy.visible = false;
22
+ }
23
+ if (copy.groupedItems) {
24
+ copy.groupedItems = this.clearAll(copy.groupedItems);
25
+ }
26
+ return copy;
27
+ });
14
28
  }
15
29
  buildFilterModal() {
16
30
  const filterModal = document.createElement("snk-filter-modal");
17
31
  filterModal.filters = this._filterConfig;
32
+ filterModal.configName = this._configName;
18
33
  filterModal.getMessage = this._getMessage.bind(this);
19
34
  filterModal.applyFilters = this.applyFilters.bind(this);
20
- filterModal.clearAll = this.clearAll.bind(this);
21
35
  filterModal.closeModal = () => this._closeModal();
36
+ filterModal.addPersonalizedFilter = () => this._addPersonalizedFilterFn();
37
+ filterModal.editPersonalizedFilter = (id) => this._editPersonalizedFilterFn(id);
22
38
  return filterModal;
23
39
  }
24
40
  async showModal() {
@@ -32,5 +48,8 @@ class SnkFilterModalFactory {
32
48
  };
33
49
  this._closeModal = await ApplicationUtils.showModal(modalProps);
34
50
  }
51
+ async closeModal() {
52
+ this._closeModal();
53
+ }
35
54
  }
36
55
  export default SnkFilterModalFactory;
@@ -1,4 +1,100 @@
1
1
  export const filtersMock = [
2
+ {
3
+ "id": "PERSONALIZED_FILTER_GROUP",
4
+ "label": "Filtros Personalizados",
5
+ "detailTitle": "Filtros criados",
6
+ "detailModal": "Filtros criados",
7
+ "visible": true,
8
+ "type": "PERSONALIZED",
9
+ "filterType": "CUSTOM_FILTER",
10
+ "groupedItems": [
11
+ {
12
+ "id": "0",
13
+ "label": "teste",
14
+ "detailTitle": "teste",
15
+ "type": "PERSONALIZED",
16
+ "active": true,
17
+ "props": {
18
+ "expression": "Financeiro.CODCFO = :FILTER_0_PARAM_1:{entidade=Financeiro;campo=CODCFO} AND Financeiro.CODBCO = :FILTER_0_PARAM_2:{entidade=Financeiro;campo=CODBCO}",
19
+ "personalizedFilter": {
20
+ "parameters": [
21
+ {
22
+ "name": "FILTER_0_PARAM_1",
23
+ "label": "CFOP",
24
+ "type": "SEARCH",
25
+ "dataType": "TEXT",
26
+ "searchContext": {
27
+ "entity": "ClassificacaoFiscalOperacao",
28
+ "entityDescription": "Financeiro",
29
+ "searchOptions": {
30
+ "rootEntity": "Financeiro",
31
+ "descriptionFieldName": "DESCRCFO",
32
+ "codeFieldName": "CODCFO",
33
+ "showInactives": false
34
+ }
35
+ }
36
+ },
37
+ {
38
+ "name": "FILTER_0_PARAM_2",
39
+ "label": "Banco",
40
+ "type": "SEARCH",
41
+ "dataType": "TEXT",
42
+ "searchContext": {
43
+ "entity": "Banco",
44
+ "entityDescription": "Financeiro",
45
+ "searchOptions": {
46
+ "rootEntity": "Financeiro",
47
+ "descriptionFieldName": "NOMEBCO",
48
+ "codeFieldName": "CODBCO",
49
+ "showInactives": false
50
+ }
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ "value": [
57
+ {
58
+ "value": "6352",
59
+ "label": "A estab.industrial"
60
+ },
61
+ {
62
+ "value": "0",
63
+ "label": "<SEM BANCO>"
64
+ }
65
+ ],
66
+ "visible": true,
67
+ "filterType": "CUSTOM_FILTER"
68
+ },
69
+ {
70
+ "id": "1",
71
+ "label": "filtro 2",
72
+ "detailTitle": "filtro 2",
73
+ "type": "PERSONALIZED",
74
+ "props": {
75
+ "expression": "Financeiro.ALIQICMS = :FILTER_1_PARAM_1:{entidade=Financeiro;campo=ALIQICMS}",
76
+ "personalizedFilter": {
77
+ "parameters": [
78
+ {
79
+ "name": "FILTER_1_PARAM_1",
80
+ "label": "% ICMS",
81
+ "type": "DECIMALNUMBER",
82
+ "dataType": "NUMBER",
83
+ "props": {
84
+ "precision": "2"
85
+ }
86
+ }
87
+ ]
88
+ }
89
+ },
90
+ "value": [
91
+ 15.0
92
+ ],
93
+ "visible": true,
94
+ "filterType": "CUSTOM_FILTER"
95
+ },
96
+ ]
97
+ },
2
98
  {
3
99
  "id": "RECDESP",
4
100
  "label": "Receitas + Despesas",
@@ -38,4 +38,4 @@
38
38
 
39
39
  .snk-filter-field-search__list {
40
40
  overflow-y: auto;
41
- }
41
+ }
@@ -3,6 +3,7 @@ import { SelectedItemType } from "./interfaces";
3
3
  import { ApplicationContext, ElementIDUtils, JSUtils } from "@sankhyalabs/core";
4
4
  import { ListItem } from "./subcomponents";
5
5
  const SNK_CONTEXT_KEY = "__SNK__APPLICATION__";
6
+ const ENTITY_NAME_PATTERN = /\w+:\/\/(\w+)/;
6
7
  export class SnkFilterFieldSearch {
7
8
  constructor() {
8
9
  this._filterMetadataStorage = new Map();
@@ -14,6 +15,8 @@ export class SnkFilterFieldSearch {
14
15
  this.breadcrumbItems = [];
15
16
  this.linkItems = [];
16
17
  this.fieldItems = [];
18
+ this.searchEmpty = false;
19
+ this.groupEmpty = false;
17
20
  }
18
21
  /**
19
22
  * Realiza a abertura do componente e faz a primeira carga
@@ -35,6 +38,7 @@ export class SnkFilterFieldSearch {
35
38
  this.handleFilterChange(filterText);
36
39
  }
37
40
  async loadData() {
41
+ var _a, _b;
38
42
  this._isLoading = true;
39
43
  let metadata;
40
44
  if (this._currentLink != undefined) {
@@ -52,14 +56,15 @@ export class SnkFilterFieldSearch {
52
56
  this.mapDataSourceToLinkItems();
53
57
  this.mapDataSourceToFieldItems();
54
58
  this._isLoading = false;
55
- this._ezFieldList.scrollToTop();
56
- this._ezLinkList.scrollToTop();
59
+ (_a = this._ezFieldList) === null || _a === void 0 ? void 0 : _a.scrollToTop();
60
+ (_b = this._ezLinkList) === null || _b === void 0 ? void 0 : _b.scrollToTop();
57
61
  }
58
62
  mapDataSourceToLinkItems() {
59
63
  var _a;
60
64
  const { links } = this._currentMetadata;
61
65
  const filterLinkLabelMessage = this.getMessage('snkFilterFieldSearch.linkLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
62
66
  const items = links.map(link => (Object.assign({ label: link.description }, link)));
67
+ this.groupEmpty = Boolean(items.length === 0);
63
68
  this.linkItems = [{
64
69
  group: filterLinkLabelMessage,
65
70
  items,
@@ -70,7 +75,7 @@ export class SnkFilterFieldSearch {
70
75
  }
71
76
  mapDataSourceToFieldItems() {
72
77
  var _a;
73
- const { fields } = this._currentMetadata;
78
+ const fields = this._currentMetadata.fields;
74
79
  const filterFieldLabelMessage = this.getMessage('snkFilterFieldSearch.fieldLabel', { link: (_a = this._currentLink) === null || _a === void 0 ? void 0 : _a.description });
75
80
  const filteredFields = fields.filter(field => {
76
81
  if (!this._currentLink)
@@ -80,6 +85,7 @@ export class SnkFilterFieldSearch {
80
85
  return searchableByDescription || searchableByName;
81
86
  });
82
87
  const items = filteredFields.map(field => (Object.assign({ label: field.description }, field)));
88
+ this.searchEmpty = Boolean(this._filterText && items.length === 0);
83
89
  this.fieldItems = [{
84
90
  group: filterFieldLabelMessage,
85
91
  items
@@ -107,10 +113,17 @@ export class SnkFilterFieldSearch {
107
113
  this.ezSelectFilterItem.emit(selectedItem);
108
114
  this.loadData();
109
115
  }
116
+ getEntityFromBreadCrumbItem(item) {
117
+ const result = ENTITY_NAME_PATTERN.exec(item.uri);
118
+ if (!result) {
119
+ return undefined;
120
+ }
121
+ return result[1];
122
+ }
110
123
  handleSelectField({ detail: item }) {
111
124
  var _a;
112
125
  const breadcrumbPath = this.breadcrumbItems.map(breadcrumbItem => breadcrumbItem.label).join('>>');
113
- const selectedField = Object.assign(Object.assign({}, item), { type: SelectedItemType.FIELD, path: `${breadcrumbPath} >> ${item.description}` });
126
+ const selectedField = Object.assign(Object.assign({}, item), { type: SelectedItemType.FIELD, entityPath: this.breadcrumbItems.map(item => this.getEntityFromBreadCrumbItem(item)).filter(item => item != undefined), path: `${breadcrumbPath} >> ${item.description}` });
114
127
  this.ezSelectFilterItem.emit(selectedField);
115
128
  (_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
116
129
  }
@@ -146,7 +159,13 @@ export class SnkFilterFieldSearch {
146
159
  render() {
147
160
  var _a;
148
161
  const searchLabelMessage = this.getMessage('snkFilterFieldSearch.searchLabel');
149
- return (h("ez-popover", Object.assign({ ref: (el) => this._ezPopover = el, role: "dialog", overlayType: "none", "aria-hidden": !((_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.opened) }, this.getElementID('EzPopover')), h("div", { class: "snk-filter-field-search__container" }, h("header", { class: "snk-filter-field-search__header" }, this.searchable && !!searchLabelMessage && (h("ez-filter-input", Object.assign({ class: "snk-filter-field-search__input", label: searchLabelMessage, asyncSearch: true, canShowError: false, onEzSearching: (event) => this.handleFilterChange.bind(this)(event.detail), "aria-label": searchLabelMessage, "aria-required": "false", "aria-invalid": "false" }, this.getElementID('EzFilterInput')))), this.breadcrumbItems.length > 0 && (h("ez-breadcrumb", Object.assign({ items: this.breadcrumbItems, onSelectedItem: this.handleSelectLink.bind(this), role: "navigation", "aria-current": "step" }, this.getElementID('EzBreadcrumb')))), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })), h("section", { class: "snk-filter-field-search__section" }, h("ez-list", Object.assign({ ref: (el) => this._ezLinkList = el, class: "snk-filter-field-search__list", id: "filterLinkList", useGroups: true, dataSource: this.linkItems, onEzSelectItem: this.handleSelectLink.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: listItem => h("ez-badge", { label: listItem.fieldCount }), "aria-describedby": "filterLinkLabel" }, this.getElementID('EzListLinks'))), h("ez-list", Object.assign({ ref: (el) => this._ezFieldList = el, class: "snk-filter-field-search__list", id: "filterFieldList", useGroups: true, dataSource: this.fieldItems, onEzSelectItem: this.handleSelectField.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: ListItem, "aria-describedby": "filterFieldLabel" }, this.getElementID('EzListFields')))))));
162
+ return (h("ez-popover", Object.assign({ ref: (el) => this._ezPopover = el, role: "dialog", overlayType: "none", "aria-hidden": !((_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.opened) }, this.getElementID('EzPopover')), h("div", { class: "snk-filter-field-search__container" }, h("header", { class: "snk-filter-field-search__header" }, this.searchable && !!searchLabelMessage && (h("ez-filter-input", Object.assign({ class: "snk-filter-field-search__input", label: searchLabelMessage, asyncSearch: true, canShowError: false, onEzSearching: (event) => this.handleFilterChange.bind(this)(event.detail), "aria-label": searchLabelMessage, "aria-required": "false", "aria-invalid": "false" }, this.getElementID('EzFilterInput')))), this.breadcrumbItems.length > 0 && (h("ez-breadcrumb", Object.assign({ items: this.breadcrumbItems, onSelectedItem: this.handleSelectLink.bind(this), role: "navigation", "aria-current": "step" }, this.getElementID('EzBreadcrumb')))), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })), h("section", { class: `snk-filter-field-search__section ${(this.groupEmpty && this.searchEmpty) && " ez-margin--auto"}` }, this.groupEmpty ?
163
+ h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--medium" }, this.getMessage('snkFilterFieldSearch.groupEmpty')))
164
+ :
165
+ h("ez-list", Object.assign({ ref: (el) => this._ezLinkList = el, class: "snk-filter-field-search__list", id: "filterLinkList", useGroups: true, dataSource: this.linkItems, onEzSelectItem: this.handleSelectLink.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: listItem => h("ez-badge", { label: listItem.fieldCount }), "aria-describedby": "filterLinkLabel" }, this.getElementID('EzListLinks'))), this.searchEmpty ?
166
+ h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--medium" }, this.getMessage('snkFilterFieldSearch.searchEmpty')))
167
+ :
168
+ h("ez-list", Object.assign({ ref: (el) => this._ezFieldList = el, class: "snk-filter-field-search__list", id: "filterFieldList", useGroups: true, dataSource: this.fieldItems, onEzSelectItem: this.handleSelectField.bind(this), hoverFeedback: true, ezSelectable: true, itemSlotBuilder: ListItem, "aria-describedby": "filterFieldLabel" }, this.getElementID('EzListFields')))))));
150
169
  }
151
170
  static get is() { return "snk-filter-field-search"; }
152
171
  static get encapsulation() { return "scoped"; }
@@ -206,7 +225,9 @@ export class SnkFilterFieldSearch {
206
225
  return {
207
226
  "breadcrumbItems": {},
208
227
  "linkItems": {},
209
- "fieldItems": {}
228
+ "fieldItems": {},
229
+ "searchEmpty": {},
230
+ "groupEmpty": {}
210
231
  };
211
232
  }
212
233
  static get events() {
@@ -1,4 +1,41 @@
1
1
  :host {
2
- display: flex;
2
+ /*private*/
3
+ display: flex;
4
+ height: 100%;
5
+ padding: var(--space--large, 24px);
6
+
7
+ /*@doc Define a largura do container.*/
8
+ --snk-personalized-filter--width: 100%;
9
+ /*@doc Define a altura do container.*/
10
+ --snk-personalized-filter--height: 100%;
11
+ /*@doc Define a cor da linha de separação.*/
12
+ --snk-personalized-filter--background-color-line: var(--color--disable-secondary);
13
+ /*@doc Define a margem da linha de separação.*/
14
+ --snk-personalized-filter--margin-line: var(--border--radius-medium, 12px);
3
15
  }
4
-
16
+
17
+ .snk-personalized-filter{
18
+ height: var(--snk-personalized-filter--width);
19
+ width: var(--snk-personalized-filter--height);
20
+ }
21
+
22
+ .snk-personalized-filter__header-actions {
23
+ display: flex;
24
+ gap: var(--space--medium);
25
+ }
26
+
27
+ .snk-personalized-filter__group{
28
+ flex: 1;
29
+ }
30
+
31
+ .snk-personalized-filter__expression-input--line {
32
+ width: 100%;
33
+ height: 2px;
34
+ background-color: var(--snk-personalized-filter--background-color-line);
35
+ margin-top: var(--snk-personalized-filter--margin-line);
36
+ margin-bottom: var(--snk-personalized-filter--margin-line);
37
+ }
38
+
39
+ .ez-box__main {
40
+ height: 90%;
41
+ }