@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,516 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { DataType, ObjectUtils, StringUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
+ import { F as FilterItemType } from './filter-item-type.enum.js';
4
+ import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
5
+ import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
+ import { d as defineCustomElement$4 } from './snk-filter-detail2.js';
7
+ import { d as defineCustomElement$3 } from './snk-filter-item2.js';
8
+ import { d as defineCustomElement$2 } from './snk-filter-list2.js';
9
+ import { d as defineCustomElement$1 } from './snk-filter-modal2.js';
10
+
11
+ const buildFilter = (item) => {
12
+ switch (item.type) {
13
+ case FilterItemType.DEFAULT_FILTER:
14
+ return buildDefault(item);
15
+ case FilterItemType.BINARY_SELECT:
16
+ return buildBinary(item);
17
+ case FilterItemType.MULTI_SELECT:
18
+ return buildMultSelect(item);
19
+ case FilterItemType.PERIOD:
20
+ return buildPeriod(item);
21
+ case FilterItemType.SEARCH:
22
+ return buildSearch(item);
23
+ case FilterItemType.TEXT:
24
+ return buildText(item);
25
+ case FilterItemType.NUMBER:
26
+ return buildNumber(item);
27
+ case FilterItemType.PERSONALIZED:
28
+ return buildPersonalized(item);
29
+ default:
30
+ return undefined;
31
+ }
32
+ };
33
+ function buildDefault(item) {
34
+ return { name: item.id, expression: item.props.expression, params: [] };
35
+ }
36
+ function buildBinary(item) {
37
+ const { id, value, props } = item;
38
+ const options = props.options;
39
+ const selectedOption = options.find(opt => opt.name === value);
40
+ return { name: id, expression: selectedOption.expression, params: [] };
41
+ }
42
+ function buildMultSelect(item) {
43
+ const { id, value, props } = item;
44
+ return { name: id, expression: props.expression, params: [{ name: id, dataType: DataType.TEXT, value }] };
45
+ }
46
+ function buildPeriod(item) {
47
+ const { id, value, props } = item;
48
+ let { end, start } = value;
49
+ if (typeof end === "string") {
50
+ end = new Date(end);
51
+ }
52
+ if (typeof start === "string") {
53
+ start = new Date(start);
54
+ }
55
+ const params = [];
56
+ let expression;
57
+ if (end && start) {
58
+ expression = props.expression.fullfill;
59
+ params.push({ name: `${id}.START`, dataType: DataType.DATE, value: toString(DataType.DATE, start) }, { name: `${id}.END`, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
60
+ }
61
+ else {
62
+ if (start) {
63
+ expression = props.expression.onlystart;
64
+ params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, start) });
65
+ }
66
+ else {
67
+ expression = props.expression.onlyend;
68
+ params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
69
+ }
70
+ }
71
+ return { name: id, expression, params };
72
+ }
73
+ function buildSearch(item) {
74
+ const { id, value, props } = item;
75
+ const expression = props.expression;
76
+ return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value.value) }] };
77
+ }
78
+ function buildText(item) {
79
+ const { id, value, props } = item;
80
+ const expression = props.expression;
81
+ return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value) }] };
82
+ }
83
+ function buildNumber(item) {
84
+ const { id, value, props } = item;
85
+ const expression = props.expression;
86
+ return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
87
+ }
88
+ function buildPersonalized(item) {
89
+ var _a;
90
+ const { id, value, props } = item;
91
+ const expression = props.expression;
92
+ return {
93
+ name: id, expression, params: (((_a = props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || []).map((param, index) => {
94
+ const valuesArray = Array.from(value);
95
+ const dataType = param.dataType;
96
+ let paramValue = (index >= 0 && index < valuesArray.length ? valuesArray[index] : null);
97
+ if (paramValue != undefined && typeof paramValue === "object" && "value" in paramValue) {
98
+ paramValue = paramValue["value"];
99
+ }
100
+ if (paramValue == undefined && dataType === DataType.BOOLEAN) {
101
+ paramValue = false;
102
+ }
103
+ return { name: param.name, dataType, value: typeof paramValue === "string" ? paramValue : toString(dataType, paramValue) };
104
+ })
105
+ };
106
+ }
107
+
108
+ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 2);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:100%;height:100%}";
109
+
110
+ const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
111
+ const DEFAULT_FILTER = "DEFAULT_FILTER";
112
+ const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
113
+ const ADD_FILTER = "ADD_FILTER";
114
+ const APPLIED_FILTERS = "APPLIED_FILTERS";
115
+ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
116
+ constructor() {
117
+ super();
118
+ this.__registerHost();
119
+ this._updateSequence = [];
120
+ this._loadingPending = false;
121
+ this._configUpdated = false;
122
+ this._pendingFilters = [];
123
+ this._calculateSortIndex = (item) => {
124
+ let index = item.hardFixed ? 1000000 : 0;
125
+ //campos Hard Fixed não variam a ordem
126
+ if (!item.hardFixed) {
127
+ index += item.fixed ? 100000 : 0;
128
+ index += item.value == undefined ? 0 : 10000;
129
+ index += this._updateSequence.lastIndexOf(item.id) + 1;
130
+ }
131
+ return index;
132
+ };
133
+ this._filtersComparator = (a, b) => {
134
+ return this._calculateSortIndex(b) - this._calculateSortIndex(a);
135
+ };
136
+ }
137
+ observeFilterConfig(newValue, oldValue) {
138
+ if (oldValue != undefined && newValue == undefined) {
139
+ this._loadingPending = true;
140
+ this._configUpdated = true;
141
+ }
142
+ else {
143
+ const oldItems = new Map(oldValue ? oldValue.map(item => [item.id, item]) : undefined);
144
+ newValue.forEach(newItem => {
145
+ const oldItem = oldItems.get(newItem.id);
146
+ if (oldItem != undefined) {
147
+ this._configUpdated = this._configUpdated || ObjectUtils.objectToString(oldItem) != ObjectUtils.objectToString(newItem);
148
+ this._loadingPending = this._loadingPending || ObjectUtils.objectToString(oldItem.value) !== ObjectUtils.objectToString(newItem.value);
149
+ }
150
+ else {
151
+ this._configUpdated = true;
152
+ this._loadingPending = this._loadingPending || newItem.value != undefined;
153
+ }
154
+ });
155
+ }
156
+ this.processAfterUpdateConfig();
157
+ }
158
+ processPendingFilter() {
159
+ if (this._pendingFilters.length > 0 && this._currentPendingFilter == undefined) {
160
+ this._currentPendingFilter = this._element.querySelector("#filter-" + this._pendingFilters.pop());
161
+ if (this._currentPendingFilter) {
162
+ this._currentPendingFilter.showUp(true).then(() => {
163
+ this._currentPendingFilter = undefined;
164
+ this.processPendingFilter();
165
+ });
166
+ }
167
+ }
168
+ if (this._currentPendingFilter == undefined) {
169
+ this.processAfterUpdateConfig();
170
+ }
171
+ }
172
+ processAfterUpdateConfig() {
173
+ if (this._pendingFilters.length > 0) {
174
+ return;
175
+ }
176
+ if (this._loadingPending) {
177
+ this._loadingPending = false;
178
+ this.dataUnit.loadData();
179
+ }
180
+ if (this._configUpdated) {
181
+ this._configUpdated = false;
182
+ this._application.saveFilterBarConfig(this.filterConfig, this.configName);
183
+ }
184
+ }
185
+ /**
186
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
187
+ * através de um pequeno modulo na estrutura da aplicação:
188
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
189
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-bar.msg.ts"
190
+ */
191
+ getMessage(key, params) {
192
+ return this._application.messagesBuilder.getMessage(key, params);
193
+ }
194
+ getFilter(_dataUnit) {
195
+ var _a;
196
+ const filters = [];
197
+ (_a = this.filterConfig) === null || _a === void 0 ? void 0 : _a.filter(item => this.isActiveFilter(item)).forEach(item => {
198
+ const filter = buildFilter(item);
199
+ if (filter) {
200
+ filters.push(filter);
201
+ }
202
+ });
203
+ return filters;
204
+ }
205
+ isActiveFilter(item) {
206
+ return (item.visible && item.value != undefined) || item.type === FilterItemType.DEFAULT_FILTER;
207
+ }
208
+ registryFilterProvider() {
209
+ this.dataUnit.addFilterProvider(this);
210
+ if (this.filterConfig) {
211
+ this.dataUnit.loadData();
212
+ }
213
+ }
214
+ itemFocused(selectedItem) {
215
+ this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach(item => {
216
+ if (item.id === selectedItem) {
217
+ if (item.tagName.toLowerCase() === "snk-filter-item" && item.getClientRects()[0].x < 0) {
218
+ item.scrollIntoView({ behavior: "auto", inline: 'nearest' });
219
+ }
220
+ }
221
+ else {
222
+ item["hideDetail"]();
223
+ }
224
+ });
225
+ }
226
+ getFilterItems() {
227
+ const pinnedItems = [];
228
+ const unpinnedItems = [];
229
+ this.filterConfig
230
+ .filter(item => item.visible)
231
+ .forEach((item, index) => {
232
+ const itemId = `filter-${item.id}`;
233
+ const filterItem = (h("snk-filter-item", { 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 }));
234
+ if (item.fixed || item.hardFixed) {
235
+ pinnedItems.push(filterItem);
236
+ }
237
+ else {
238
+ unpinnedItems.push(filterItem);
239
+ }
240
+ return filterItem;
241
+ });
242
+ const elements = [];
243
+ elements.push(...pinnedItems);
244
+ if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
245
+ elements.push(h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
246
+ }
247
+ elements.push(...unpinnedItems);
248
+ return elements;
249
+ }
250
+ calculateUpdateSequence(item) {
251
+ if (item) {
252
+ this._updateSequence = this._updateSequence.filter(itemId => item.id !== itemId);
253
+ this._updateSequence.push(item.id);
254
+ }
255
+ }
256
+ normalizeItem(item) {
257
+ const normalized = Object.assign({}, item);
258
+ const optionals = ["props", "value", "hardFixed", "fixed"];
259
+ optionals.forEach(prop => {
260
+ if (normalized[prop] == undefined) {
261
+ delete normalized[prop];
262
+ }
263
+ });
264
+ if (item.value === "") {
265
+ delete item.value;
266
+ }
267
+ return normalized;
268
+ }
269
+ updateFilter(newItem) {
270
+ this.filterConfig = this.filterConfig.map(item => {
271
+ newItem = this.normalizeItem(newItem);
272
+ if (item.id === newItem.id) {
273
+ if (ObjectUtils.objectToString(item) != ObjectUtils.objectToString(newItem)) {
274
+ this.calculateUpdateSequence(newItem);
275
+ }
276
+ return newItem;
277
+ }
278
+ return item;
279
+ }).sort((a, b) => this._filtersComparator(a, b));
280
+ }
281
+ getAddListItems() {
282
+ const hiddenItems = this.filterConfig
283
+ .filter(item => !item.visible && this.isListable(item));
284
+ const footerItems = [{ name: PERSONALIZED_FILTER, label: this.getMessage("snkFilterBar.customFilter"), iconName: "tune", kind: "FOOTER" }];
285
+ if (this.allowDefault) {
286
+ footerItems.push({ name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" });
287
+ }
288
+ return hiddenItems.map(filter => { return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null }; })
289
+ .concat(footerItems);
290
+ }
291
+ getActiveClass() {
292
+ const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
293
+ return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
294
+ }
295
+ isListable(item, allowPersonalized = false) {
296
+ return item.type !== FilterItemType.DEFAULT_FILTER && (allowPersonalized || item.type !== FilterItemType.PERSONALIZED);
297
+ }
298
+ getAppliedListItems() {
299
+ const appliedItems = this.filterConfig
300
+ .filter(item => this.isActiveFilter(item) && this.isListable(item, true));
301
+ return appliedItems.map(filter => {
302
+ return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
303
+ }).concat([
304
+ { name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
305
+ ]);
306
+ }
307
+ addPersonalizedFilters(personalizedItems) {
308
+ const activeFilters = {};
309
+ personalizedItems.forEach(item => {
310
+ if (item.active) {
311
+ activeFilters[item.id] = true;
312
+ }
313
+ });
314
+ this.filterConfig = this.filterConfig.map(item => {
315
+ var _a, _b;
316
+ if (item.type === FilterItemType.PERSONALIZED) {
317
+ const visible = activeFilters[item.id];
318
+ if (!item.visible && visible) {
319
+ this.calculateUpdateSequence(item);
320
+ if (((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters) != undefined) {
321
+ this._pendingFilters.push(item.id);
322
+ }
323
+ }
324
+ return this.normalizeItem(visible ? Object.assign(Object.assign({}, item), { visible }) : Object.assign(Object.assign({}, item), { visible, value: undefined, fixed: undefined }));
325
+ }
326
+ return item;
327
+ }).sort((a, b) => this._filtersComparator(a, b));
328
+ }
329
+ openDefaultFilterModal() {
330
+ const filterModal = document.createElement("snk-filter-modal");
331
+ const defaultFilter = this.filterConfig.filter(item => item.type === FilterItemType.DEFAULT_FILTER);
332
+ filterModal.getMessage = (key, props) => this.getMessage(key, props);
333
+ filterModal.modalTitle = this.getMessage("snkFilterBar.modalDefaultFilterTitle");
334
+ filterModal.infoText = this.getMessage(defaultFilter.length == 0 ? "snkFilterBar.modalInfoTextCreateDefault" : "snkFilterBar.modalInfoTextEditDefault");
335
+ filterModal.items = defaultFilter.map(item => {
336
+ return { id: item.id, active: true, enabled: false, label: item.label };
337
+ });
338
+ filterModal.processModalAction = (_action) => {
339
+ this._application.closeModal();
340
+ };
341
+ this._application.showModal(filterModal);
342
+ }
343
+ openPersonalizedModal() {
344
+ const filterModal = document.createElement("snk-filter-modal");
345
+ const personalizedFilter = this.filterConfig
346
+ .filter(item => item.type === FilterItemType.PERSONALIZED)
347
+ .sort((itemA, itemB) => StringUtils.compare(itemA.label, itemB.label));
348
+ filterModal.getMessage = (key, props) => this.getMessage(key, props);
349
+ filterModal.modalTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterTitle");
350
+ filterModal.modalSubTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle");
351
+ filterModal.okButtonLabel = this.getMessage("snkFilterBar.modalOkButtonLabel");
352
+ filterModal.cancelButtonLabel = this.getMessage("snkFilterBar.modalCancelButtonLabel");
353
+ filterModal.infoText = this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized");
354
+ filterModal.useSearch = true;
355
+ filterModal.items = personalizedFilter.map(item => {
356
+ return { id: item.id, active: item.visible, enabled: true, label: item.label };
357
+ });
358
+ filterModal.processModalAction = (action) => {
359
+ if (action === ModalAction.CANCEL) {
360
+ // O Botão de cancelar, tem efeito específico:
361
+ // - Desmarcar todos os filtros personalizados.
362
+ filterModal.items = filterModal.items.map(item => {
363
+ return Object.assign(Object.assign({}, item), { active: false });
364
+ });
365
+ }
366
+ else {
367
+ if (action === ModalAction.OK) {
368
+ this.addPersonalizedFilters(filterModal.items);
369
+ }
370
+ this._application.closeModal();
371
+ }
372
+ };
373
+ this._application.showModal(filterModal);
374
+ }
375
+ clearFilters() {
376
+ let changed = false;
377
+ this.filterConfig = this.filterConfig.map(item => {
378
+ if (item.value != undefined) {
379
+ changed = true;
380
+ }
381
+ return Object.assign(Object.assign({}, item), { value: undefined });
382
+ }).sort((a, b) => this._filtersComparator(a, b));
383
+ return changed;
384
+ }
385
+ loadPermitions() {
386
+ this._application.isUserSup().then(value => this.allowDefault = value);
387
+ }
388
+ loadConfigFromApplication() {
389
+ this._application.getFilterBarConfig(this.configName)
390
+ .then((filters) => {
391
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
392
+ if (this.dataUnit) {
393
+ this.dataUnit.loadData();
394
+ }
395
+ })
396
+ .catch(reason => {
397
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
398
+ });
399
+ }
400
+ attachDataUnit() {
401
+ if (this.dataUnit == undefined) {
402
+ let parent = this._element.parentElement;
403
+ while (parent) {
404
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
405
+ const snkDataUnit = parent;
406
+ this.dataUnit = snkDataUnit.dataUnit;
407
+ if (this.dataUnit) {
408
+ this.registryFilterProvider();
409
+ }
410
+ else {
411
+ snkDataUnit.addEventListener("dataUnitReady", (evt) => {
412
+ this.dataUnit = evt.detail;
413
+ this.registryFilterProvider();
414
+ });
415
+ }
416
+ break;
417
+ }
418
+ }
419
+ parent = parent.parentElement;
420
+ }
421
+ else {
422
+ this.registryFilterProvider();
423
+ }
424
+ }
425
+ filterChangeListener(evt) {
426
+ this.updateFilter(evt.detail);
427
+ }
428
+ addFilterHandler(itemName) {
429
+ const filterItem = this.filterConfig.find(currentFilter => currentFilter.id === itemName);
430
+ if (itemName === PERSONALIZED_FILTER) {
431
+ this.openPersonalizedModal();
432
+ }
433
+ else if (itemName === DEFAULT_FILTER) {
434
+ this.openDefaultFilterModal();
435
+ }
436
+ else if (filterItem) {
437
+ this._pendingFilters.push(itemName);
438
+ this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
439
+ }
440
+ }
441
+ appliedFilterHandler(itemName) {
442
+ if (itemName === CLEAR_ALL_FILTERS) {
443
+ if (this.clearFilters()) {
444
+ this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
445
+ }
446
+ }
447
+ else {
448
+ const filterItemElement = this._element.querySelector("#filter-" + itemName);
449
+ if (filterItemElement) {
450
+ filterItemElement.showUp(true);
451
+ }
452
+ }
453
+ }
454
+ componentWillLoad() {
455
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
456
+ if (this._application) {
457
+ this.loadPermitions();
458
+ this.loadConfigFromApplication();
459
+ }
460
+ this.attachDataUnit();
461
+ }
462
+ componentDidRender() {
463
+ this.processPendingFilter();
464
+ }
465
+ render() {
466
+ if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
467
+ return undefined;
468
+ }
469
+ return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail) }), h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
470
+ }
471
+ get _element() { return this; }
472
+ static get watchers() { return {
473
+ "filterConfig": ["observeFilterConfig"]
474
+ }; }
475
+ static get style() { return snkFilterBarCss; }
476
+ }, [2, "snk-filter-bar", {
477
+ "dataUnit": [1040],
478
+ "configName": [1, "config-name"],
479
+ "filterConfig": [1040],
480
+ "allowDefault": [32]
481
+ }, [[0, "filterChange", "filterChangeListener"]]]);
482
+ function defineCustomElement() {
483
+ if (typeof customElements === "undefined") {
484
+ return;
485
+ }
486
+ const components = ["snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-filter-modal"];
487
+ components.forEach(tagName => { switch (tagName) {
488
+ case "snk-filter-bar":
489
+ if (!customElements.get(tagName)) {
490
+ customElements.define(tagName, SnkFilterBar);
491
+ }
492
+ break;
493
+ case "snk-filter-detail":
494
+ if (!customElements.get(tagName)) {
495
+ defineCustomElement$4();
496
+ }
497
+ break;
498
+ case "snk-filter-item":
499
+ if (!customElements.get(tagName)) {
500
+ defineCustomElement$3();
501
+ }
502
+ break;
503
+ case "snk-filter-list":
504
+ if (!customElements.get(tagName)) {
505
+ defineCustomElement$2();
506
+ }
507
+ break;
508
+ case "snk-filter-modal":
509
+ if (!customElements.get(tagName)) {
510
+ defineCustomElement$1();
511
+ }
512
+ break;
513
+ } });
514
+ }
515
+
516
+ export { SnkFilterBar as S, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterBinarySelect extends Components.SnkFilterBinarySelect, HTMLElement {}
4
+ export const SnkFilterBinarySelect: {
5
+ prototype: SnkFilterBinarySelect;
6
+ new (): SnkFilterBinarySelect;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,67 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { F as FilterItemType } from './filter-item-type.enum.js';
3
+
4
+ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.__registerHost();
8
+ }
9
+ isSelected(option) {
10
+ return this.value == undefined || this.value === option;
11
+ }
12
+ ezChangeListener(evt) {
13
+ if (!evt.detail) {
14
+ this.assertCheckedOption(evt.target);
15
+ }
16
+ this.updateValue();
17
+ }
18
+ assertCheckedOption(updatingCheck) {
19
+ if (updatingCheck === this._checkOne) {
20
+ this._checkTwo.value = true;
21
+ }
22
+ else {
23
+ this._checkOne.value = true;
24
+ }
25
+ }
26
+ updateValue() {
27
+ if (!this._checkOne.value || !this._checkTwo.value) {
28
+ const [optOne, optTwo] = this.config.props.options;
29
+ this.value = this._checkOne.value ? optOne.name : optTwo.name;
30
+ }
31
+ else {
32
+ this.value = undefined;
33
+ }
34
+ }
35
+ async show() {
36
+ this._checkOne.setFocus();
37
+ }
38
+ render() {
39
+ if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
40
+ return undefined;
41
+ }
42
+ const [optOne, optTwo] = this.config.props.options;
43
+ return (h(Host, null, h("ez-check", { label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), h("ez-check", { label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) })));
44
+ }
45
+ }, [0, "snk-filter-binary-select", {
46
+ "value": [1544],
47
+ "config": [16],
48
+ "show": [64]
49
+ }, [[0, "ezChange", "ezChangeListener"]]]);
50
+ function defineCustomElement$1() {
51
+ if (typeof customElements === "undefined") {
52
+ return;
53
+ }
54
+ const components = ["snk-filter-binary-select"];
55
+ components.forEach(tagName => { switch (tagName) {
56
+ case "snk-filter-binary-select":
57
+ if (!customElements.get(tagName)) {
58
+ customElements.define(tagName, SnkFilterBinarySelect$1);
59
+ }
60
+ break;
61
+ } });
62
+ }
63
+
64
+ const SnkFilterBinarySelect = SnkFilterBinarySelect$1;
65
+ const defineCustomElement = defineCustomElement$1;
66
+
67
+ export { SnkFilterBinarySelect, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterDetail extends Components.SnkFilterDetail, HTMLElement {}
4
+ export const SnkFilterDetail: {
5
+ prototype: SnkFilterDetail;
6
+ new (): SnkFilterDetail;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { S as SnkFilterDetail$1, d as defineCustomElement$1 } from './snk-filter-detail2.js';
2
+
3
+ const SnkFilterDetail = SnkFilterDetail$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkFilterDetail, defineCustomElement };