@sankhyalabs/sankhyablocks 1.3.34 → 1.4.0-beta.10

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 (285) hide show
  1. package/dist/cjs/SnkMessageBuilder-6c2f7bcd.js +302 -0
  2. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  3. package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
  4. package/dist/cjs/constants-9056ca9e.js +84 -0
  5. package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
  6. package/dist/cjs/filter-item-type.enum-3daf58d3.js +16 -0
  7. package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
  8. package/dist/cjs/{index-1133bc2a.js → index-20e8b68a.js} +964 -209
  9. package/dist/cjs/loader.cjs.js +3 -3
  10. package/dist/cjs/sankhyablocks.cjs.js +3 -3
  11. package/dist/cjs/snk-application.cjs.entry.js +680 -6994
  12. package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
  13. package/dist/cjs/snk-config-options.cjs.entry.js +230 -0
  14. package/dist/cjs/snk-configurator_6.cjs.entry.js +1156 -0
  15. package/dist/cjs/snk-crud.cjs.entry.js +78 -0
  16. package/dist/cjs/snk-data-unit.cjs.entry.js +272 -0
  17. package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
  18. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +50 -0
  19. package/dist/cjs/snk-filter-detail.cjs.entry.js +106 -0
  20. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +26 -0
  21. package/dist/cjs/snk-filter-number.cjs.entry.js +27 -0
  22. package/dist/cjs/snk-filter-period.cjs.entry.js +40 -0
  23. package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
  24. package/dist/cjs/snk-filter-search.cjs.entry.js +38 -0
  25. package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
  26. package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
  27. package/dist/cjs/snk-form.cjs.entry.js +146 -0
  28. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  29. package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
  30. package/dist/cjs/taskbar-elements-9a4b1e19.js +97 -0
  31. package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
  32. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  33. package/dist/collection/collection-manifest.json +45 -2
  34. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +9 -2
  35. package/dist/collection/components/snk-application/snk-application.js +1346 -642
  36. package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
  37. package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
  38. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
  39. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
  40. package/dist/collection/components/snk-crud/snk-crud.css +6 -0
  41. package/dist/collection/components/snk-crud/snk-crud.js +232 -0
  42. package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
  43. package/dist/collection/components/snk-data-unit/snk-data-unit.js +517 -0
  44. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
  45. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +111 -0
  46. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +87 -0
  47. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +88 -0
  48. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +101 -0
  49. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +180 -0
  50. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +102 -0
  51. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
  52. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +12 -0
  53. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +178 -0
  54. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +289 -0
  55. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +299 -0
  56. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +222 -0
  57. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +149 -0
  58. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +462 -0
  59. package/dist/collection/components/snk-form/snk-form.css +38 -0
  60. package/dist/collection/components/snk-form/snk-form.js +336 -0
  61. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
  62. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +315 -0
  63. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
  64. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
  65. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
  66. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
  67. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
  68. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
  69. package/dist/collection/components/snk-grid/snk-grid.css +18 -0
  70. package/dist/collection/components/snk-grid/snk-grid.js +273 -0
  71. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -79
  72. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +90 -0
  73. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
  74. package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
  75. package/dist/collection/components/snk-taskbar/snk-taskbar.js +339 -0
  76. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
  77. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +39 -14
  78. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +87 -21
  79. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +62 -0
  80. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
  81. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
  82. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +15 -15
  83. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
  84. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
  85. package/dist/collection/lib/index.js +2 -0
  86. package/dist/collection/lib/message/SnkMessageBuilder.js +130 -0
  87. package/dist/collection/lib/message/resources/crud-utils.msg.js +4 -0
  88. package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
  89. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +23 -0
  90. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +30 -0
  91. package/dist/collection/lib/message/resources/snk-form.msg.js +67 -0
  92. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
  93. package/dist/collection/lib/utils/CrudUtils.js +73 -0
  94. package/dist/collection/lib/utils/constants.js +72 -0
  95. package/dist/components/SnkMessageBuilder.js +280 -0
  96. package/dist/components/_commonjsHelpers.js +17 -0
  97. package/dist/components/constants.js +74 -0
  98. package/dist/components/filter-item-type.enum.js +14 -0
  99. package/dist/components/form-config-fetcher.js +6889 -0
  100. package/dist/components/index.d.ts +26 -5
  101. package/dist/components/index.js +26 -0
  102. package/dist/components/snk-application2.js +681 -6980
  103. package/dist/components/snk-config-modal.d.ts +11 -0
  104. package/dist/components/snk-config-modal.js +6 -0
  105. package/dist/components/snk-config-modal2.js +91 -0
  106. package/dist/components/snk-config-options.d.ts +11 -0
  107. package/dist/components/snk-config-options.js +6 -0
  108. package/dist/components/snk-config-options2.js +245 -0
  109. package/dist/components/snk-configurator.d.ts +11 -0
  110. package/dist/components/snk-configurator.js +6 -0
  111. package/dist/components/snk-configurator2.js +212 -0
  112. package/dist/components/snk-crud.d.ts +11 -0
  113. package/dist/components/snk-crud.js +183 -0
  114. package/dist/components/snk-data-unit.d.ts +11 -0
  115. package/dist/components/snk-data-unit.js +294 -0
  116. package/dist/components/snk-field-config.d.ts +11 -0
  117. package/dist/components/snk-field-config.js +6 -0
  118. package/dist/components/snk-field-config2.js +70 -0
  119. package/dist/components/snk-filter-bar.d.ts +11 -0
  120. package/dist/components/snk-filter-bar.js +6 -0
  121. package/dist/components/snk-filter-bar2.js +516 -0
  122. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  123. package/dist/components/snk-filter-binary-select.js +67 -0
  124. package/dist/components/snk-filter-detail.d.ts +11 -0
  125. package/dist/components/snk-filter-detail.js +6 -0
  126. package/dist/components/snk-filter-detail2.js +120 -0
  127. package/dist/components/snk-filter-item.d.ts +11 -0
  128. package/dist/components/snk-filter-item.js +6 -0
  129. package/dist/components/snk-filter-item2.js +194 -0
  130. package/dist/components/snk-filter-list.d.ts +11 -0
  131. package/dist/components/snk-filter-list.js +6 -0
  132. package/dist/components/snk-filter-list2.js +149 -0
  133. package/dist/components/snk-filter-modal.d.ts +11 -0
  134. package/dist/components/snk-filter-modal.js +6 -0
  135. package/dist/components/snk-filter-modal2.js +84 -0
  136. package/dist/components/snk-filter-multi-select.d.ts +11 -0
  137. package/dist/components/snk-filter-multi-select.js +43 -0
  138. package/dist/components/snk-filter-number.d.ts +11 -0
  139. package/dist/components/snk-filter-number.js +44 -0
  140. package/dist/components/snk-filter-period.d.ts +11 -0
  141. package/dist/components/snk-filter-period.js +57 -0
  142. package/dist/components/snk-filter-personalized.d.ts +11 -0
  143. package/dist/components/snk-filter-personalized.js +108 -0
  144. package/dist/components/snk-filter-search.d.ts +11 -0
  145. package/dist/components/snk-filter-search.js +55 -0
  146. package/dist/components/snk-filter-text.d.ts +11 -0
  147. package/dist/components/snk-filter-text.js +38 -0
  148. package/dist/components/snk-form-config.d.ts +11 -0
  149. package/dist/components/snk-form-config.js +6 -0
  150. package/dist/components/snk-form-config2.js +996 -0
  151. package/dist/components/snk-form.d.ts +11 -0
  152. package/dist/components/snk-form.js +6 -0
  153. package/dist/components/snk-form2.js +209 -0
  154. package/dist/components/snk-grid.d.ts +11 -0
  155. package/dist/components/snk-grid.js +6 -0
  156. package/dist/components/snk-grid2.js +152 -0
  157. package/dist/components/snk-tab-config.d.ts +11 -0
  158. package/dist/components/snk-tab-config.js +6 -0
  159. package/dist/components/snk-tab-config2.js +7220 -0
  160. package/dist/components/snk-taskbar.d.ts +11 -0
  161. package/dist/components/snk-taskbar.js +6 -0
  162. package/dist/components/snk-taskbar2.js +282 -0
  163. package/dist/components/taskbar-processor.js +45 -0
  164. package/dist/esm/SnkMessageBuilder-5792c260.js +280 -0
  165. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  166. package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
  167. package/dist/esm/constants-c6039d3d.js +74 -0
  168. package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
  169. package/dist/esm/filter-item-type.enum-a79b2fa8.js +14 -0
  170. package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
  171. package/dist/esm/{index-ffda6382.js → index-e4121713.js} +963 -210
  172. package/dist/esm/loader.js +3 -3
  173. package/dist/esm/polyfills/css-shim.js +1 -1
  174. package/dist/esm/sankhyablocks.js +3 -3
  175. package/dist/esm/snk-application.entry.js +667 -6981
  176. package/dist/esm/snk-config-modal.entry.js +58 -0
  177. package/dist/esm/snk-config-options.entry.js +226 -0
  178. package/dist/esm/snk-configurator_6.entry.js +1147 -0
  179. package/dist/esm/snk-crud.entry.js +74 -0
  180. package/dist/esm/snk-data-unit.entry.js +268 -0
  181. package/dist/esm/snk-field-config_2.entry.js +130 -0
  182. package/dist/esm/snk-filter-binary-select.entry.js +46 -0
  183. package/dist/esm/snk-filter-detail.entry.js +102 -0
  184. package/dist/esm/snk-filter-multi-select.entry.js +22 -0
  185. package/dist/esm/snk-filter-number.entry.js +23 -0
  186. package/dist/esm/snk-filter-period.entry.js +36 -0
  187. package/dist/esm/snk-filter-personalized.entry.js +85 -0
  188. package/dist/esm/snk-filter-search.entry.js +34 -0
  189. package/dist/esm/snk-filter-text.entry.js +18 -0
  190. package/dist/esm/snk-form-config.entry.js +953 -0
  191. package/dist/esm/snk-form.entry.js +142 -0
  192. package/dist/esm/snk-pesquisa.entry.js +1 -1
  193. package/dist/esm/snk-tab-config.entry.js +317 -0
  194. package/dist/esm/taskbar-elements-e2ed0536.js +94 -0
  195. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  196. package/dist/esm/teste-pesquisa.entry.js +1 -1
  197. package/dist/sankhyablocks/p-029ae4e4.entry.js +1 -0
  198. package/dist/sankhyablocks/p-03f9c407.js +1 -0
  199. package/dist/sankhyablocks/p-112455b1.js +1 -0
  200. package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
  201. package/dist/sankhyablocks/p-1feabfc7.entry.js +1 -0
  202. package/dist/sankhyablocks/p-21c8929b.js +1 -0
  203. package/dist/sankhyablocks/p-2284c850.entry.js +1 -0
  204. package/dist/sankhyablocks/p-2b891c4a.entry.js +1 -0
  205. package/dist/sankhyablocks/p-2dc76d79.entry.js +1 -0
  206. package/dist/sankhyablocks/p-361299e8.js +26 -0
  207. package/dist/sankhyablocks/p-3a276f3d.entry.js +1 -0
  208. package/dist/sankhyablocks/p-400cc777.entry.js +1 -0
  209. package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-44ce5b90.entry.js} +1 -1
  210. package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
  211. package/dist/sankhyablocks/{p-9520d78a.entry.js → p-6988f4a6.entry.js} +1 -1
  212. package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
  213. package/dist/sankhyablocks/p-7b4a4a50.entry.js +1 -0
  214. package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
  215. package/dist/sankhyablocks/p-9dc4426d.entry.js +1 -0
  216. package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
  217. package/dist/sankhyablocks/p-a17a4fca.entry.js +1 -0
  218. package/dist/sankhyablocks/p-a5b26df2.js +1 -0
  219. package/dist/sankhyablocks/p-b6d6b172.js +1 -0
  220. package/dist/sankhyablocks/p-cc4bef9f.entry.js +1 -0
  221. package/dist/sankhyablocks/p-d50651a3.js +1 -0
  222. package/dist/sankhyablocks/p-d690b6b5.entry.js +75 -0
  223. package/dist/sankhyablocks/p-d9fbb26f.js +1 -0
  224. package/dist/sankhyablocks/p-deb1f523.entry.js +1 -0
  225. package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
  226. package/dist/sankhyablocks/p-e9beab79.entry.js +1 -0
  227. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  228. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  229. package/dist/types/components/snk-application/snk-application.d.ts +178 -26
  230. package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
  231. package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
  232. package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
  233. package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
  234. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
  235. package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
  236. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +13 -0
  237. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +9 -0
  238. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +9 -0
  239. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +15 -0
  240. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +24 -0
  241. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +11 -0
  242. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +8 -0
  243. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +11 -0
  244. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +20 -0
  245. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
  246. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +45 -0
  247. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +26 -0
  248. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +65 -0
  249. package/dist/types/components/snk-form/snk-form.d.ts +71 -0
  250. package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +51 -0
  251. package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
  252. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
  253. package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
  254. package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
  255. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +30 -0
  256. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
  257. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +92 -0
  258. package/dist/types/components.d.ts +1100 -12
  259. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
  260. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +3 -0
  261. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +6 -0
  262. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
  263. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
  264. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +7 -7
  265. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
  266. package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
  267. package/dist/types/lib/index.d.ts +2 -0
  268. package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
  269. package/dist/types/lib/message/resources/crud-utils.msg.d.ts +2 -0
  270. package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
  271. package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
  272. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  273. package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -0
  274. package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
  275. package/dist/types/lib/utils/CrudUtils.d.ts +6 -0
  276. package/dist/types/lib/utils/constants.d.ts +76 -0
  277. package/dist/types/lib/utils/pesquisa.d.ts +2 -1
  278. package/dist/types/stencil-public-runtime.d.ts +15 -4
  279. package/loader/package.json +1 -0
  280. package/package.json +6 -5
  281. package/react/components.d.ts +23 -0
  282. package/react/components.js +23 -0
  283. package/react/components.js.map +1 -1
  284. package/dist/sankhyablocks/p-98e8490d.entry.js +0 -69
  285. package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
@@ -0,0 +1,299 @@
1
+ import { ArrayUtils, FloatingManager } from '@sankhyalabs/core';
2
+ import { h, Host } from '@stencil/core';
3
+ const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
4
+ const MAX_FILTERS = 5;
5
+ export class SnkFilterList {
6
+ constructor() {
7
+ this._preselection = -1;
8
+ this.innerClickCheck = (_floatingContainer, node) => {
9
+ if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
10
+ return true;
11
+ }
12
+ this._detailIsVisible = false;
13
+ return false;
14
+ };
15
+ }
16
+ showDetail() {
17
+ this._preselection = -1;
18
+ this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, {
19
+ autoClose: true,
20
+ innerClickTest: this.innerClickCheck,
21
+ backClickListener: () => this.onListCloseCallback(),
22
+ useOverlay: true
23
+ });
24
+ this._detailIsVisible = true;
25
+ this._showAll = false;
26
+ this._filterArgument = "";
27
+ this._filterInput.setFocus();
28
+ }
29
+ async hideDetail() {
30
+ if (this._floatingID != undefined) {
31
+ FloatingManager.close(this._floatingID);
32
+ }
33
+ }
34
+ onListCloseCallback() {
35
+ this._floatingID = undefined;
36
+ this._detailIsVisible = false;
37
+ }
38
+ buttonClick() {
39
+ if (this._detailIsVisible) {
40
+ this.hideDetail();
41
+ }
42
+ else {
43
+ this.showDetail();
44
+ }
45
+ }
46
+ componentDidRender() {
47
+ if (this._floatingID == undefined) {
48
+ if (this._popover) {
49
+ this._popover.remove();
50
+ }
51
+ }
52
+ }
53
+ buildItemElement(item) {
54
+ const itemId = ++this._selectableItemsCount;
55
+ return (h("button", { id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name) }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
56
+ }
57
+ itemSelected(itemName) {
58
+ if (itemName === SHOW_MORE_ITEM_NAME) {
59
+ this._showAll = true;
60
+ }
61
+ else {
62
+ this.hideDetail();
63
+ this.snkItemSelected.emit(itemName);
64
+ }
65
+ }
66
+ getFilterItems() {
67
+ const items = this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
68
+ if (items.length === 0) {
69
+ return h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.emptyText);
70
+ }
71
+ const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
72
+ if (hideItems) {
73
+ items.splice(MAX_FILTERS);
74
+ items.push({ kind: "INTERNAL", label: "Mostrar mais", iconName: "dots-horizontal", name: SHOW_MORE_ITEM_NAME, iconClass: "snk-filter-bar__filter-list-item__icon--secondary", labelClass: "snk-filter-bar__filter-list-item__label--secondary" });
75
+ }
76
+ this._selectableItemsCount = 0;
77
+ return h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
78
+ }
79
+ getFooterItems() {
80
+ return this.items.filter(item => item.kind === "FOOTER");
81
+ }
82
+ keyDownHandler(event) {
83
+ switch (event.key) {
84
+ case "ArrowDown":
85
+ this.changePreselection(this._preselection + 1);
86
+ //Paramos a propagação do evento para evitar scroll indesejado
87
+ event.stopImmediatePropagation();
88
+ event.stopPropagation();
89
+ event.preventDefault();
90
+ break;
91
+ case "ArrowUp":
92
+ this.changePreselection(this._preselection - 1);
93
+ //Paramos a propagação do evento para evitar scroll indesejado
94
+ event.stopImmediatePropagation();
95
+ event.stopPropagation();
96
+ event.preventDefault();
97
+ break;
98
+ }
99
+ }
100
+ changePreselection(newSelection) {
101
+ if (newSelection < 0) {
102
+ newSelection = this._selectableItemsCount;
103
+ }
104
+ this._preselection = newSelection > this._selectableItemsCount ? 0 : newSelection;
105
+ if (this._preselection === 0) {
106
+ this._filterInput.setFocus();
107
+ }
108
+ else {
109
+ const item = this._element.querySelector(`#filter-item${this._preselection}`);
110
+ if (item) {
111
+ item.focus();
112
+ }
113
+ }
114
+ }
115
+ render() {
116
+ return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail, onFocus: () => this._preselection = 0 }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
117
+ }
118
+ static get is() { return "snk-filter-list"; }
119
+ static get properties() {
120
+ return {
121
+ "label": {
122
+ "type": "string",
123
+ "mutable": false,
124
+ "complexType": {
125
+ "original": "string",
126
+ "resolved": "string",
127
+ "references": {}
128
+ },
129
+ "required": false,
130
+ "optional": false,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": ""
134
+ },
135
+ "attribute": "label",
136
+ "reflect": false
137
+ },
138
+ "iconName": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "string",
143
+ "resolved": "string",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": ""
151
+ },
152
+ "attribute": "icon-name",
153
+ "reflect": false
154
+ },
155
+ "items": {
156
+ "type": "unknown",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "Array<ListItem>",
160
+ "resolved": "ListItem[]",
161
+ "references": {
162
+ "Array": {
163
+ "location": "global"
164
+ },
165
+ "ListItem": {
166
+ "location": "local"
167
+ }
168
+ }
169
+ },
170
+ "required": false,
171
+ "optional": false,
172
+ "docs": {
173
+ "tags": [],
174
+ "text": ""
175
+ }
176
+ },
177
+ "getMessage": {
178
+ "type": "unknown",
179
+ "mutable": false,
180
+ "complexType": {
181
+ "original": "(key: string, props?: any) => string",
182
+ "resolved": "(key: string, props?: any) => string",
183
+ "references": {}
184
+ },
185
+ "required": false,
186
+ "optional": false,
187
+ "docs": {
188
+ "tags": [],
189
+ "text": ""
190
+ }
191
+ },
192
+ "emptyText": {
193
+ "type": "string",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "string",
197
+ "resolved": "string",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": ""
205
+ },
206
+ "attribute": "empty-text",
207
+ "reflect": false
208
+ },
209
+ "findFilterText": {
210
+ "type": "string",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "string",
214
+ "resolved": "string",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": ""
222
+ },
223
+ "attribute": "find-filter-text",
224
+ "reflect": false
225
+ },
226
+ "buttonClass": {
227
+ "type": "string",
228
+ "mutable": false,
229
+ "complexType": {
230
+ "original": "string",
231
+ "resolved": "string",
232
+ "references": {}
233
+ },
234
+ "required": false,
235
+ "optional": false,
236
+ "docs": {
237
+ "tags": [],
238
+ "text": ""
239
+ },
240
+ "attribute": "button-class",
241
+ "reflect": false
242
+ }
243
+ };
244
+ }
245
+ static get states() {
246
+ return {
247
+ "_filterArgument": {},
248
+ "_showAll": {}
249
+ };
250
+ }
251
+ static get events() {
252
+ return [{
253
+ "method": "snkItemSelected",
254
+ "name": "snkItemSelected",
255
+ "bubbles": true,
256
+ "cancelable": true,
257
+ "composed": true,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": ""
261
+ },
262
+ "complexType": {
263
+ "original": "string",
264
+ "resolved": "string",
265
+ "references": {}
266
+ }
267
+ }];
268
+ }
269
+ static get methods() {
270
+ return {
271
+ "hideDetail": {
272
+ "complexType": {
273
+ "signature": "() => Promise<void>",
274
+ "parameters": [],
275
+ "references": {
276
+ "Promise": {
277
+ "location": "global"
278
+ }
279
+ },
280
+ "return": "Promise<void>"
281
+ },
282
+ "docs": {
283
+ "text": "",
284
+ "tags": []
285
+ }
286
+ }
287
+ };
288
+ }
289
+ static get elementRef() { return "_element"; }
290
+ static get listeners() {
291
+ return [{
292
+ "name": "keydown",
293
+ "method": "keyDownHandler",
294
+ "target": undefined,
295
+ "capture": true,
296
+ "passive": false
297
+ }];
298
+ }
299
+ }
@@ -0,0 +1,222 @@
1
+ import { h } from '@stencil/core';
2
+ import { ModalAction, ModalButtonStatus } from "@sankhyalabs/ezui/dist/collection/components/ez-modal-container";
3
+ import { ArrayUtils } from '@sankhyalabs/core';
4
+ import { CheckMode } from "@sankhyalabs/ezui/dist/collection/utils";
5
+ export class SnkFilterModal {
6
+ updateValue(id, value = undefined) {
7
+ this.items = this.items.map(item => {
8
+ if (item.id === id && item.enabled) {
9
+ if (value == undefined) {
10
+ value = !item.active;
11
+ }
12
+ return Object.assign(Object.assign({}, item), { active: value });
13
+ }
14
+ return item;
15
+ });
16
+ }
17
+ getActiveFiltersMsg() {
18
+ const activeFilters = this.items.filter(item => item.active).length;
19
+ if (activeFilters === 0) {
20
+ return this.getMessage("snkFilterBar.noActiveFilters");
21
+ }
22
+ return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
23
+ }
24
+ buildItems(list) {
25
+ return list.map(item => {
26
+ return (h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { id: `checkbox_${item.id}`, tabIndex: "-1", class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: CheckMode.SWITCH }), h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
27
+ });
28
+ }
29
+ itemKeyBoardSelect(event, item) {
30
+ if (event.key === "Enter" || event.key === " ") {
31
+ this.updateValue(item.id);
32
+ }
33
+ }
34
+ modalActionListener(evt) {
35
+ const modalAction = evt.detail;
36
+ if (modalAction === ModalAction.LOAD) {
37
+ if (this._filterInput) {
38
+ this._filterInput.setFocus();
39
+ }
40
+ }
41
+ else {
42
+ this.processModalAction(modalAction);
43
+ }
44
+ }
45
+ render() {
46
+ const allowCancel = this.items.filter(item => item.active).length > 0;
47
+ const items = (this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items) : []);
48
+ return (h("ez-modal-container", { modalTitle: this.modalTitle, modalSubTitle: this.modalSubTitle, cancelButtonLabel: this.cancelButtonLabel, okButtonLabel: this.okButtonLabel, onEzModalAction: evt => this.modalActionListener(evt), cancelButtonStatus: allowCancel ? ModalButtonStatus.ENABLED : ModalButtonStatus.DISABLED }, h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-modal-content" }, h("div", null, this.useSearch ?
49
+ h("ez-filter-input", { ref: ref => this._filterInput = ref, label: this.getMessage("snkFilterBar.modalFindFilter"), onEzChange: (evt) => this._filterArgument = evt.detail })
50
+ :
51
+ undefined), items.length > 0 ? h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding-bottom--small" }, this.getActiveFiltersMsg()) : undefined, h("div", null, this.buildItems(items)), h("div", { class: "ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large" }, this.infoText))));
52
+ }
53
+ static get is() { return "snk-filter-modal"; }
54
+ static get properties() {
55
+ return {
56
+ "getMessage": {
57
+ "type": "unknown",
58
+ "mutable": false,
59
+ "complexType": {
60
+ "original": "(key: string, props?: any) => string",
61
+ "resolved": "(key: string, props?: any) => string",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ }
70
+ },
71
+ "items": {
72
+ "type": "unknown",
73
+ "mutable": true,
74
+ "complexType": {
75
+ "original": "Array<ModalItem>",
76
+ "resolved": "ModalItem[]",
77
+ "references": {
78
+ "Array": {
79
+ "location": "global"
80
+ },
81
+ "ModalItem": {
82
+ "location": "local"
83
+ }
84
+ }
85
+ },
86
+ "required": false,
87
+ "optional": false,
88
+ "docs": {
89
+ "tags": [],
90
+ "text": ""
91
+ }
92
+ },
93
+ "modalTitle": {
94
+ "type": "string",
95
+ "mutable": false,
96
+ "complexType": {
97
+ "original": "string",
98
+ "resolved": "string",
99
+ "references": {}
100
+ },
101
+ "required": false,
102
+ "optional": false,
103
+ "docs": {
104
+ "tags": [],
105
+ "text": ""
106
+ },
107
+ "attribute": "modal-title",
108
+ "reflect": false
109
+ },
110
+ "modalSubTitle": {
111
+ "type": "string",
112
+ "mutable": false,
113
+ "complexType": {
114
+ "original": "string",
115
+ "resolved": "string",
116
+ "references": {}
117
+ },
118
+ "required": false,
119
+ "optional": false,
120
+ "docs": {
121
+ "tags": [],
122
+ "text": ""
123
+ },
124
+ "attribute": "modal-sub-title",
125
+ "reflect": false
126
+ },
127
+ "cancelButtonLabel": {
128
+ "type": "string",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "string",
132
+ "resolved": "string",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": ""
140
+ },
141
+ "attribute": "cancel-button-label",
142
+ "reflect": false
143
+ },
144
+ "okButtonLabel": {
145
+ "type": "string",
146
+ "mutable": false,
147
+ "complexType": {
148
+ "original": "string",
149
+ "resolved": "string",
150
+ "references": {}
151
+ },
152
+ "required": false,
153
+ "optional": false,
154
+ "docs": {
155
+ "tags": [],
156
+ "text": ""
157
+ },
158
+ "attribute": "ok-button-label",
159
+ "reflect": false
160
+ },
161
+ "infoText": {
162
+ "type": "string",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "string",
166
+ "resolved": "string",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": ""
174
+ },
175
+ "attribute": "info-text",
176
+ "reflect": false
177
+ },
178
+ "useSearch": {
179
+ "type": "boolean",
180
+ "mutable": false,
181
+ "complexType": {
182
+ "original": "boolean",
183
+ "resolved": "boolean",
184
+ "references": {}
185
+ },
186
+ "required": false,
187
+ "optional": false,
188
+ "docs": {
189
+ "tags": [],
190
+ "text": ""
191
+ },
192
+ "attribute": "use-search",
193
+ "reflect": false
194
+ },
195
+ "processModalAction": {
196
+ "type": "unknown",
197
+ "mutable": false,
198
+ "complexType": {
199
+ "original": "(action: ModalAction) => void",
200
+ "resolved": "(action: ModalAction) => void",
201
+ "references": {
202
+ "ModalAction": {
203
+ "location": "import",
204
+ "path": "@sankhyalabs/ezui/dist/collection/components/ez-modal-container"
205
+ }
206
+ }
207
+ },
208
+ "required": false,
209
+ "optional": false,
210
+ "docs": {
211
+ "tags": [],
212
+ "text": ""
213
+ }
214
+ }
215
+ };
216
+ }
217
+ static get states() {
218
+ return {
219
+ "_filterArgument": {}
220
+ };
221
+ }
222
+ }
@@ -0,0 +1,149 @@
1
+ :host {
2
+ display: grid;
3
+ grid-template-columns: minmax(100px, 100%) 1fr 1fr;
4
+ }
5
+
6
+ .snk-filter__popover-container{
7
+ /*private*/
8
+ display: flex;
9
+ cursor: auto;
10
+ }
11
+
12
+ .snk-filter__popover{
13
+ /*private*/
14
+ display: flex;
15
+ flex-direction: column;
16
+ position: absolute;
17
+ width: fit-content;
18
+ height: fit-content;
19
+ min-width: 265px;
20
+
21
+ /*public*/
22
+ z-index: var(--more-visible, 2);
23
+ background-color: var(--background--xlight, #fff);
24
+ border-radius: var(--border--radius-medium, 12px);
25
+ box-shadow: var(--shadow, 0px 0px 16px 0px #000);
26
+
27
+ }
28
+
29
+ .snk-filter-item__editor-header{
30
+ flex-grow: 1;
31
+ font-weight: var(--text-weight--medium, 400);
32
+ color: var(--color--title-primary, #2B3A54);
33
+ }
34
+
35
+ .snk-filter__popover-rule{
36
+ border-style: solid;
37
+ border-color: var(--color--disable-secondary, #F2F5F8);
38
+ border-radius: 1px;
39
+ border-width: 1px;
40
+ width: 100%;
41
+ }
42
+
43
+ .editor__ez-check{
44
+ --ez-check__label--padding-left: 0;
45
+ }
46
+
47
+ .snk-filter-item__editor-header-button{
48
+ cursor: pointer;
49
+ background-color: transparent;
50
+ border: none;
51
+ padding: 3px;
52
+ outline-color: var(--color--primary);
53
+ }
54
+
55
+ .snk-filter-bar__divider{
56
+ margin-bottom: var(--space--small);
57
+ }
58
+
59
+ .snk-filter-bar__filter-list-items-container{
60
+ overflow-y: auto;
61
+ max-height: 360px;
62
+ margin-top: var(--space--small, 6px);
63
+ }
64
+
65
+ .snk-filter-bar__filter-list-item{
66
+ cursor: pointer;
67
+ border-radius: var(--border--radius-small, 6px);
68
+ border: none;
69
+ background-color: transparent;
70
+ }
71
+
72
+ .snk-filter-bar__filter-list-item__label{
73
+ color: var(--title--primary);
74
+ }
75
+
76
+ .snk-filter-bar__filter-list-item__label--secondary{
77
+ color: var(--text--primary);
78
+ }
79
+
80
+ .snk-filter-bar__filter-list-item__icon{
81
+ --ez-icon--color: var(--title--primary);
82
+ }
83
+
84
+ .snk-filter-bar__filter-list-item__icon--secondary{
85
+ --ez-icon--color: var(--text--secondary);
86
+ }
87
+
88
+ .snk-filter-bar__filter-list-item:focus-visible {
89
+ outline: none;
90
+ background-color: var(--background--medium);
91
+ }
92
+
93
+ .snk-filter-bar__filter-list-item:hover{
94
+ background-color: var(--background--medium);
95
+ }
96
+
97
+ .snk-filter-bar__filter-list-items-container--empty{
98
+ width: 100%;
99
+ height: 100px;
100
+ display: flex;
101
+ justify-content: center;
102
+ align-self: center;
103
+ align-items: center;
104
+ }
105
+
106
+ .snk-filter-bar__filter-list-items-button--active{
107
+ position: relative;
108
+ }
109
+ .snk-filter-bar__filter-list-items-button--active::after{
110
+ display: flex;
111
+ position: absolute;
112
+ content: "";
113
+ width: 8px;
114
+ height: 8px;
115
+ top: 7px;
116
+ left: 17px;
117
+ background-color: var(--icon--alert--color, #008561);
118
+ border-radius: 50%;
119
+ }
120
+
121
+ .snk-filter-bar__filter-modal-item{
122
+ --modal-item-border-width: 2px;
123
+ display: flex;
124
+ flex-direction: row;
125
+ margin-left: var(--modal-item-border-width);
126
+ border-radius: var(--border--radius-medium, 12px);
127
+ background-color: var(--background--medium, #f0f3f7);
128
+ border: none;
129
+ width: 100%;
130
+
131
+ }
132
+
133
+ .snk-filter-bar__filter-modal-item:focus-visible{
134
+ outline: var(--color--primary) solid var(--modal-item-border-width);
135
+ }
136
+
137
+ .snk-filter-bar__filter-modal-item__check{
138
+ width: auto;
139
+ }
140
+ .snk-filter-bar__filter-modal-item__label{
141
+ font-weight: var(--text-weight--medium);
142
+ }
143
+
144
+ .snk-filter-bar__filter-modal-content{
145
+ display: grid;
146
+ grid-template-rows: auto auto 1fr auto;
147
+ width: 100%;
148
+ height: 100%;
149
+ }