zignal-stencil-library 1.1.129 → 1.1.131

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 (304) hide show
  1. package/dist/cjs/{autocomplete-address_43.cjs.entry.js → autocomplete-address_44.cjs.entry.js} +576 -108
  2. package/dist/cjs/{dayjs-Btww0IBx.js → dayjs-Dqe_coVK.js} +11 -3
  3. package/dist/cjs/{index-REEdj4HR.js → index-BcnTODbr.js} +7 -0
  4. package/dist/cjs/{index-DBliBGHU.js → index-E5Wxua8O.js} +78 -4
  5. package/dist/cjs/index.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/quick-message-app.cjs.entry.js +5 -5
  8. package/dist/cjs/zignal-stencil-library.cjs.js +2 -2
  9. package/dist/collection/api/index.js +51 -0
  10. package/dist/collection/assets/images/logo/zerva.png +0 -0
  11. package/dist/collection/assets/images/logo/zrmz.png +0 -0
  12. package/dist/collection/collection-manifest.json +1 -0
  13. package/dist/collection/components/autocomplete-address/autocomplete-address.css +1 -1
  14. package/dist/collection/components/autocomplete-multiple-select/autocomplete-multiple-select.css +1 -1
  15. package/dist/collection/components/autocomplete-multiple-select/autocomplete-multiple-select.js +1 -1
  16. package/dist/collection/components/autocomplete-select/autocomplete-select.css +1 -1
  17. package/dist/collection/components/autocomplete-select/autocomplete-select.js +23 -3
  18. package/dist/collection/components/channel-box/channel-box.css +1 -1
  19. package/dist/collection/components/chat-app/chat-app.css +1 -1
  20. package/dist/collection/components/chat-header/chat-header.css +1 -1
  21. package/dist/collection/components/chat-input/chat-input.css +1 -1
  22. package/dist/collection/components/checkbox-list/checkbox-list.css +1 -1
  23. package/dist/collection/components/dialog-bill-editor/dialog-bill-editor.css +1 -1
  24. package/dist/collection/components/dialog-custom-filter/dialog-custom-filter.css +1 -0
  25. package/dist/collection/components/dialog-custom-filter/dialog-custom-filter.js +101 -0
  26. package/dist/collection/components/dialog-editor/dialog-editor.css +1 -1
  27. package/dist/collection/components/dialog-editor/dialog-editor.js +1 -1
  28. package/dist/collection/components/dialog-preview-media/dialog-preview-media.css +1 -1
  29. package/dist/collection/components/dialog-preview-media/dialog-preview-media.js +1 -1
  30. package/dist/collection/components/dialog-search/dialog-search.css +1 -1
  31. package/dist/collection/components/dialog-search/dialog-search.js +209 -16
  32. package/dist/collection/components/internal-component/icon.js +3 -1
  33. package/dist/collection/components/internal-component/z-button.js +19 -4
  34. package/dist/collection/components/internal-component/z-input.js +1 -1
  35. package/dist/collection/components/menu-chat-channel/menu-chat-channel.css +1 -1
  36. package/dist/collection/components/menu-chat-channel/menu-chat-channel.js +2 -2
  37. package/dist/collection/components/menu-chat-type/menu-chat-type.css +1 -1
  38. package/dist/collection/components/menu-chat-type/menu-chat-type.js +29 -3
  39. package/dist/collection/components/menu-list/menu-list.css +1 -1
  40. package/dist/collection/components/menu-list/menu-list.js +2 -2
  41. package/dist/collection/components/message-box/message-box.css +1 -1
  42. package/dist/collection/components/message-box/message-box.js +1 -1
  43. package/dist/collection/components/message-content/message-content.css +1 -1
  44. package/dist/collection/components/message-content/message-content.js +1 -1
  45. package/dist/collection/components/message-item/message-item.css +1 -1
  46. package/dist/collection/components/message-item/message-item.js +1 -1
  47. package/dist/collection/components/message-media/message-media.css +1 -1
  48. package/dist/collection/components/message-media/message-media.js +2 -2
  49. package/dist/collection/components/profile-history/profile-history.css +1 -1
  50. package/dist/collection/components/profile-history/profile-history.js +1 -1
  51. package/dist/collection/components/profile-info/profile-info.css +1 -1
  52. package/dist/collection/components/profile-info/user-info-section.js +4 -4
  53. package/dist/collection/components/profile-media/profile-media.css +1 -1
  54. package/dist/collection/components/profile-media/profile-media.js +1 -1
  55. package/dist/collection/components/profile-tabs/profile-tabs.css +1 -1
  56. package/dist/collection/components/profile-tabs/profile-tabs.js +2 -2
  57. package/dist/collection/components/quick-message-add-template/quick-message-add-template.css +1 -1
  58. package/dist/collection/components/quick-message-add-template/quick-message-add-template.js +3 -3
  59. package/dist/collection/components/quick-message-add-template/quick-message-text-content.js +1 -1
  60. package/dist/collection/components/quick-message-app/quick-message-app.css +1 -1
  61. package/dist/collection/components/quick-message-app/quick-message-app.js +1 -1
  62. package/dist/collection/components/quick-message-file/quick-message-file.css +1 -1
  63. package/dist/collection/components/quick-message-file/quick-message-file.js +1 -1
  64. package/dist/collection/components/quick-message-image/quick-message-image.css +1 -1
  65. package/dist/collection/components/quick-message-image/quick-message-image.js +1 -1
  66. package/dist/collection/components/quick-message-modal/quick-message-modal.css +1 -1
  67. package/dist/collection/components/quick-message-modal/quick-message-modal.js +1 -1
  68. package/dist/collection/components/quick-message-template/quick-message-template.css +1 -1
  69. package/dist/collection/components/quick-message-template/quick-message-template.js +2 -2
  70. package/dist/collection/components/search-box/search-box.css +1 -1
  71. package/dist/collection/components/search-box/search-box.js +64 -9
  72. package/dist/collection/components/status-badge/status-badge.css +1 -1
  73. package/dist/collection/components/status-badge/status-badge.js +2 -2
  74. package/dist/collection/components/tag-list/tag-list.css +1 -1
  75. package/dist/collection/components/tag-list/tag-list.js +1 -1
  76. package/dist/collection/components/tag-or-status-item/tag-or-status-item.css +1 -1
  77. package/dist/collection/components/tag-or-status-item/tag-or-status-item.js +2 -2
  78. package/dist/collection/components/tag-popper/tag-popper.css +1 -1
  79. package/dist/collection/components/tag-popper/tag-popper.js +2 -2
  80. package/dist/collection/components/typography-clamp/typography-clamp.css +1 -1
  81. package/dist/collection/components/typography-clamp/typography-clamp.js +2 -2
  82. package/dist/collection/components/z-avatar/z-avatar.css +1 -1
  83. package/dist/collection/components/z-dialog/z-dialog.css +1 -1
  84. package/dist/collection/store/chat.js +102 -2
  85. package/dist/collection/store/store.js +8 -1
  86. package/dist/components/autocomplete-address.js +1 -1
  87. package/dist/components/autocomplete-multiple-select.js +1 -1
  88. package/dist/components/autocomplete-select.js +1 -1
  89. package/dist/components/channel-box.js +1 -1
  90. package/dist/components/chat-app.js +63 -58
  91. package/dist/components/chat-header.js +1 -1
  92. package/dist/components/chat-input.js +1 -1
  93. package/dist/components/checkbox-list.js +1 -1
  94. package/dist/components/dialog-bill-editor.js +1 -1
  95. package/dist/components/dialog-custom-filter.d.ts +11 -0
  96. package/dist/components/dialog-custom-filter.js +6 -0
  97. package/dist/components/dialog-editor.js +1 -1
  98. package/dist/components/dialog-preview-media.js +1 -1
  99. package/dist/components/dialog-search.js +1 -1
  100. package/dist/components/index.js +2270 -5
  101. package/dist/components/menu-chat-channel.js +1 -1
  102. package/dist/components/menu-chat-type.js +1 -1
  103. package/dist/components/menu-list.js +1 -1
  104. package/dist/components/message-box.js +1 -1
  105. package/dist/components/message-content.js +1 -1
  106. package/dist/components/message-item.js +1 -1
  107. package/dist/components/message-media.js +1 -1
  108. package/dist/components/p-0FvHc-B5.js +308 -0
  109. package/dist/components/p-6aA6IXgE.js +515 -0
  110. package/dist/components/p-8LUpPeMC.js +121 -0
  111. package/dist/components/p-B--0UJ8Q.js +701 -0
  112. package/dist/components/p-B21KTEyo.js +233 -0
  113. package/dist/components/{p-BkFRrRKV.js → p-B47YNDih.js} +2 -2
  114. package/dist/components/{p-Bu7d3mrb.js → p-B4Cfocp9.js} +3 -3
  115. package/dist/components/p-B9fXhpga.js +155 -0
  116. package/dist/components/p-BDJJTGOU.js +135 -0
  117. package/dist/components/p-BDxpdg-N.js +231 -0
  118. package/dist/components/p-BI-UoISS.js +166 -0
  119. package/dist/components/p-BN3dsmNi.js +76 -0
  120. package/dist/components/p-BNAd9VOs.js +35 -0
  121. package/dist/components/p-BRKzV_qr.js +119 -0
  122. package/dist/components/{p-CEHfgumC.js → p-BT_WpMsl.js} +3 -3
  123. package/dist/components/p-BWShYY6x.js +129 -0
  124. package/dist/components/p-BYRd-ETx.js +51 -0
  125. package/dist/components/p-BcwS8hPe.js +57 -0
  126. package/dist/components/p-Bdlu4rso.js +223 -0
  127. package/dist/components/{p-DoSaXyw1.js → p-BdvA9NEC.js} +1 -1
  128. package/dist/components/p-BhCoO4f3.js +308 -0
  129. package/dist/components/p-BopDIDXn.js +108 -0
  130. package/dist/components/p-BpASk0tX.js +184 -0
  131. package/dist/components/{p-DvuE0BKi.js → p-BqOIOKFi.js} +2 -2
  132. package/dist/components/{p-DAdBAzUE.js → p-BrOdZv7V.js} +1 -1
  133. package/dist/components/p-BydrhdC7.js +175 -0
  134. package/dist/components/p-C4u7E9_t.js +96 -0
  135. package/dist/components/p-C71aADT1.js +121 -0
  136. package/dist/components/p-C7s-XcB7.js +265 -0
  137. package/dist/components/p-CEPL38dm.js +107 -0
  138. package/dist/components/p-CGTVfhQb.js +215 -0
  139. package/dist/components/p-CGc7F4KM.js +107 -0
  140. package/dist/components/p-CHSs9Ttf.js +175 -0
  141. package/dist/components/p-CJYhrgVu.js +563 -0
  142. package/dist/components/p-CJhbvCEH.js +98 -0
  143. package/dist/components/p-CKAFX0Iv.js +701 -0
  144. package/dist/components/p-CLXYWZlj.js +138 -0
  145. package/dist/components/p-CLlWrXTq.js +65 -0
  146. package/dist/components/{p-D3nAizga.js → p-CMDuo7hT.js} +2 -2
  147. package/dist/components/{p-Bt6e__iP.js → p-CNHOm1zC.js} +2 -2
  148. package/dist/components/{p-X0kRbis3.js → p-CNe_ZsVx.js} +56 -5
  149. package/dist/components/p-COcJs6mc.js +599 -0
  150. package/dist/components/p-CP6kAa06.js +155 -0
  151. package/dist/components/{p-C64OG6Go.js → p-CSjwRjNB.js} +3 -3
  152. package/dist/components/p-CURg_IlF.js +74 -0
  153. package/dist/components/p-CW-xBGZT.js +76 -0
  154. package/dist/components/p-CWHertSv.js +98 -0
  155. package/dist/components/p-CWiOAAbL.js +133 -0
  156. package/dist/components/{p-D6E7AT0Y.js → p-CXxNtcxg.js} +9 -2
  157. package/dist/components/p-C_lNjlP9.js +171 -0
  158. package/dist/components/p-CiJdh58e.js +166 -0
  159. package/dist/components/{p-ZODz3l7q.js → p-Ciltq84L.js} +4 -4
  160. package/dist/components/p-Ciw0N6KJ.js +554 -0
  161. package/dist/components/p-CjRQ8tWw.js +51 -0
  162. package/dist/components/{p-BRjNz6ke.js → p-Ck7Zzb_A.js} +3 -3
  163. package/dist/components/p-CkPghfKe.js +65 -0
  164. package/dist/components/p-CmU1kQfH.js +102 -0
  165. package/dist/components/p-CqEWDRGc.js +57 -0
  166. package/dist/components/p-CspaPELO.js +138 -0
  167. package/dist/components/p-CvoFnZ8_.js +122 -0
  168. package/dist/components/p-D3tPu5Y4.js +119 -0
  169. package/dist/components/p-D4gDJ3W1.js +32 -0
  170. package/dist/components/p-D6YiY6pP.js +155 -0
  171. package/dist/components/{p-CvZQgYYK.js → p-D93wPIC3.js} +1 -2
  172. package/dist/components/p-D9YlkO4-.js +599 -0
  173. package/dist/components/p-DDnZegDc.js +554 -0
  174. package/dist/components/p-DM5Sdblu.js +102 -0
  175. package/dist/components/p-DNR8IdgA.js +133 -0
  176. package/dist/components/p-DRgwUET0.js +223 -0
  177. package/dist/components/{p-rnwpU-MO.js → p-DWTlCCDm.js} +4 -4
  178. package/dist/components/{p-CTJvvlwf.js → p-DWeecZPp.js} +4 -4
  179. package/dist/components/p-DYIZvGP5.js +108 -0
  180. package/dist/components/p-DZj-fLD_.js +515 -0
  181. package/dist/components/p-D_oR-hBJ.js +156 -0
  182. package/dist/components/p-DfHPvUwh.js +122 -0
  183. package/dist/components/p-DfK17cYt.js +129 -0
  184. package/dist/components/{p-UNG2V2EJ.js → p-DgdZ-NpM.js} +1 -1
  185. package/dist/components/p-DiW_RB--.js +214 -0
  186. package/dist/components/p-DitKjbtM.js +171 -0
  187. package/dist/components/p-Djhy9K1-.js +215 -0
  188. package/dist/components/p-DmtUV4zq.js +231 -0
  189. package/dist/components/p-DoJtbC3R.js +563 -0
  190. package/dist/components/p-DvdxHjTt.js +74 -0
  191. package/dist/components/p-DxU_vY7A.js +265 -0
  192. package/dist/components/{p-BCLD-S_A.js → p-DyFFnt-x.js} +39 -0
  193. package/dist/components/{p-Cq-rMEH9.js → p-DygBeHqo.js} +3 -3
  194. package/dist/components/p-H4OQSs-h.js +214 -0
  195. package/dist/components/p-IaSLquNY.js +155 -0
  196. package/dist/components/p-SZeGyCdE.js +32 -0
  197. package/dist/components/p-YnD9y_Qu.js +578 -0
  198. package/dist/components/p-Z8XFPTBu.js +158 -0
  199. package/dist/components/p-cVjpVM7h.js +156 -0
  200. package/dist/components/p-dAfkDBvh.js +578 -0
  201. package/dist/components/p-ePQjUJ_9.js +158 -0
  202. package/dist/components/{p-CwmztnlQ.js → p-inmrc0Ir.js} +3 -3
  203. package/dist/components/p-lsx83h0R.js +96 -0
  204. package/dist/components/p-mQ8xbETj.js +184 -0
  205. package/dist/components/p-uJtpA8Ed.js +135 -0
  206. package/dist/components/profile-history.js +1 -1
  207. package/dist/components/profile-info.js +1 -1
  208. package/dist/components/profile-media.js +1 -1
  209. package/dist/components/profile-tabs.js +1 -1
  210. package/dist/components/quick-message-add-template.js +1 -1
  211. package/dist/components/quick-message-app.js +15 -16
  212. package/dist/components/quick-message-button-content.js +1 -1
  213. package/dist/components/quick-message-file.js +1 -1
  214. package/dist/components/quick-message-image-content.js +1 -1
  215. package/dist/components/quick-message-image.js +1 -1
  216. package/dist/components/quick-message-menu-list-content.js +1 -1
  217. package/dist/components/quick-message-modal.js +1 -1
  218. package/dist/components/quick-message-template.js +1 -1
  219. package/dist/components/quick-message-text-content.js +1 -1
  220. package/dist/components/quick-message-video-content.js +1 -1
  221. package/dist/components/search-box.js +1 -1
  222. package/dist/components/status-badge.js +1 -1
  223. package/dist/components/summarize-message-section.js +1 -1
  224. package/dist/components/tag-list.js +1 -1
  225. package/dist/components/tag-or-status-item.js +1 -1
  226. package/dist/components/tag-popper.js +1 -1
  227. package/dist/components/typography-clamp.js +1 -1
  228. package/dist/components/user-info-section.js +1 -1
  229. package/dist/components/z-avatar.js +1 -1
  230. package/dist/components/z-dialog.js +1 -1
  231. package/dist/esm/{autocomplete-address_43.entry.js → autocomplete-address_44.entry.js} +576 -109
  232. package/dist/esm/{dayjs-i8XfvNUE.js → dayjs-DpB2jvyJ.js} +11 -4
  233. package/dist/esm/{index-BsYB8kV0.js → index-CQZOvlmT.js} +78 -4
  234. package/dist/esm/{index-DrJU7-bz.js → index-SIpuloy-.js} +7 -1
  235. package/dist/esm/index.js +1 -1
  236. package/dist/esm/loader.js +3 -3
  237. package/dist/esm/quick-message-app.entry.js +5 -5
  238. package/dist/esm/zignal-stencil-library.js +3 -3
  239. package/dist/types/api/index.d.ts +4 -0
  240. package/dist/types/api/type.d.ts +78 -0
  241. package/dist/types/components/autocomplete-select/autocomplete-select.d.ts +1 -0
  242. package/dist/types/components/dialog-custom-filter/dialog-custom-filter.d.ts +11 -0
  243. package/dist/types/components/dialog-search/dialog-search.d.ts +15 -2
  244. package/dist/types/components/internal-component/z-button.d.ts +2 -1
  245. package/dist/types/components/search-box/search-box.d.ts +11 -1
  246. package/dist/types/components.d.ts +47 -2
  247. package/dist/types/store/chat.d.ts +27 -1
  248. package/dist/types/store/store.d.ts +7 -1
  249. package/dist/zignal-stencil-library/assets/images/logo/zerva.png +0 -0
  250. package/dist/zignal-stencil-library/assets/images/logo/zrmz.png +0 -0
  251. package/dist/zignal-stencil-library/index.esm.js +1 -1
  252. package/dist/zignal-stencil-library/p-52e55e01.entry.js +1 -0
  253. package/dist/zignal-stencil-library/p-908d55d2.entry.js +2 -0
  254. package/dist/zignal-stencil-library/p-CQZOvlmT.js +1 -0
  255. package/dist/zignal-stencil-library/p-SIpuloy-.js +2 -0
  256. package/dist/zignal-stencil-library/p-e53feba0.entry.js +2 -0
  257. package/dist/zignal-stencil-library/p-yAsAdobv.js +1 -0
  258. package/dist/zignal-stencil-library/zignal-stencil-library.esm.js +1 -1
  259. package/package.json +1 -1
  260. package/dist/components/p--2uPh98m.js +0 -173
  261. package/dist/components/p-4VtRaJ3s.js +0 -107
  262. package/dist/components/p-5oC4CRoP.js +0 -231
  263. package/dist/components/p-7jJKln0k.js +0 -155
  264. package/dist/components/p-B16voarw.js +0 -133
  265. package/dist/components/p-BFIFTMrY.js +0 -158
  266. package/dist/components/p-BGVN7Drg.js +0 -107
  267. package/dist/components/p-BH7MWaEm.js +0 -223
  268. package/dist/components/p-BQQE__zQ.js +0 -129
  269. package/dist/components/p-BTD3J3v6.js +0 -138
  270. package/dist/components/p-BX8sKLQ-.js +0 -148
  271. package/dist/components/p-BcnssswI.js +0 -32
  272. package/dist/components/p-BlDBX6wD.js +0 -133
  273. package/dist/components/p-Busq9xrD.js +0 -98
  274. package/dist/components/p-C9qH4kP3.js +0 -156
  275. package/dist/components/p-CBXm2OUy.js +0 -171
  276. package/dist/components/p-CHNajXFB.js +0 -701
  277. package/dist/components/p-CPZ9nOuH.js +0 -122
  278. package/dist/components/p-CW7_-hzK.js +0 -119
  279. package/dist/components/p-CdCDpC3-.js +0 -515
  280. package/dist/components/p-Cqfc6ySc.js +0 -135
  281. package/dist/components/p-D0Tke46Z.js +0 -121
  282. package/dist/components/p-D8-aPJYM.js +0 -74
  283. package/dist/components/p-DAoGutlB.js +0 -76
  284. package/dist/components/p-DPDx5rQM.js +0 -155
  285. package/dist/components/p-DaHmsqbO.js +0 -563
  286. package/dist/components/p-DcCoy5TC.js +0 -20
  287. package/dist/components/p-DhApSoyQ.js +0 -96
  288. package/dist/components/p-DhdQ-c2r.js +0 -214
  289. package/dist/components/p-Ds96RINY.js +0 -57
  290. package/dist/components/p-DxfQE8Dx.js +0 -108
  291. package/dist/components/p-Ij2dsIQ1.js +0 -2191
  292. package/dist/components/p-NqAhrUkX.js +0 -51
  293. package/dist/components/p-PjOxwy5b.js +0 -140
  294. package/dist/components/p-Wi-CJLal.js +0 -578
  295. package/dist/components/p-XNRZVnJm.js +0 -184
  296. package/dist/components/p-ZKLMD3_O.js +0 -102
  297. package/dist/components/p-fQie6nmM.js +0 -308
  298. package/dist/components/p-wiDfZE6o.js +0 -554
  299. package/dist/components/p-zreJIOvq.js +0 -599
  300. package/dist/zignal-stencil-library/p-9b4f0480.entry.js +0 -2
  301. package/dist/zignal-stencil-library/p-BsYB8kV0.js +0 -1
  302. package/dist/zignal-stencil-library/p-DZsPtXDQ.js +0 -1
  303. package/dist/zignal-stencil-library/p-DrJU7-bz.js +0 -2
  304. package/dist/zignal-stencil-library/p-c0c25f33.entry.js +0 -1
@@ -1,10 +1,13 @@
1
- import { Host, h } from "@stencil/core";
1
+ import { Host, h, getAssetPath } from "@stencil/core";
2
2
  import { ZButton } from "../internal-component/z-button";
3
3
  import { ZInput } from "../internal-component/z-input";
4
4
  import { configStore, filterChatsStore, responsiveStore } from "../../store/store";
5
- import { handleGetUserStatuses, handleGetUserTags } from "../../store/chat";
5
+ import { handleCreateChatFilter, handleDeleteChatFilter, handleGetUserStatuses, handleGetUserTags, handleUpdateChatFilter, haveConnectionFromZwiz } from "../../store/chat";
6
6
  import { useTranslation } from "../../utils/utils";
7
7
  import { ZIconButton } from "../internal-component/z-icon-button";
8
+ import { openDialog } from "../../store/dialog";
9
+ import { Icon } from "../internal-component/icon";
10
+ import { t } from "i18next";
8
11
  export class DialogSearch {
9
12
  connectionList = configStore.get('connectionList').map(connection => ({
10
13
  iconName: connection.type,
@@ -23,26 +26,85 @@ export class DialogSearch {
23
26
  name: label,
24
27
  };
25
28
  });
29
+ verifySlipList = [
30
+ { label: t('chat_filter.verify_slip'), value: 'total_completed_verify_slip' },
31
+ { label: t('chat_filter.verify_slip_more_than'), value: 'total_completed_verify_slip_more_than' },
32
+ ];
33
+ zrmzShopList = [
34
+ { label: 'Shop1', value: 'shop1' },
35
+ { label: 'Shop2', value: 'shop2' },
36
+ ];
37
+ zervaShopList = [
38
+ { label: 'Shop1', value: 'shop1' },
39
+ { label: 'Shop2', value: 'shop2' },
40
+ ];
26
41
  defaultFilter = {
42
+ name: '',
27
43
  search: '',
28
44
  // spam: false,
29
- read: undefined,
45
+ read: null,
46
+ type: null,
30
47
  connectionIds: this.connectionList.map(connection => connection.value) || [],
31
48
  lastAnswerByIds: this.answerList.map(answer => answer.value) || [],
32
49
  statusIds: [],
33
50
  tagIds: [],
51
+ verifySlip: null,
52
+ verifySlipValue: null,
53
+ zrmz: {
54
+ isOnlyCustomers: false,
55
+ shopId: null,
56
+ name: null,
57
+ email: null,
58
+ phoneNumber: null,
59
+ totalPointType: null,
60
+ totalPointMax: null,
61
+ totalPointMin: null,
62
+ remainingPointType: null,
63
+ remainingPointMax: null,
64
+ remainingPointMin: null,
65
+ },
66
+ zerva: {
67
+ isOnlyCustomers: false,
68
+ shopId: null,
69
+ bookingNo: null,
70
+ name: null,
71
+ email: null,
72
+ phoneNumber: null,
73
+ bookingStartDate: null,
74
+ bookingEndDate: null,
75
+ paymentStatus: null,
76
+ bookingStatus: null,
77
+ },
34
78
  };
35
79
  oldFilter;
80
+ filterType = 'advanced';
81
+ selectedFilter;
36
82
  filter = this.defaultFilter;
83
+ isShowAdvancedZrmz = false;
84
+ isShowAdvancedZerva = false;
37
85
  cancel;
38
86
  search;
39
87
  componentWillLoad() {
40
- const _filter = {
41
- ...filterChatsStore.get('filterChat'),
42
- ...this.oldFilter,
43
- };
44
- if (Object.keys(_filter).length) {
45
- this.filter = _filter;
88
+ const _filterType = filterChatsStore.get('filterType');
89
+ if (_filterType === 'advanced' && this.filterType === 'advanced') {
90
+ this.filter = {
91
+ ...this.oldFilter
92
+ };
93
+ }
94
+ else if (this.filterType === 'custom' && this.selectedFilter) {
95
+ this.filter = {
96
+ name: this.selectedFilter.name,
97
+ search: this.selectedFilter.search,
98
+ read: this.selectedFilter.read ?? null,
99
+ type: this.selectedFilter.type ?? null,
100
+ connectionIds: this.selectedFilter.connection_ids,
101
+ lastAnswerByIds: this.selectedFilter.last_answer_by_ids,
102
+ statusIds: this.selectedFilter.status_ids,
103
+ tagIds: this.selectedFilter.tag_ids,
104
+ };
105
+ }
106
+ else {
107
+ this.filter = this.defaultFilter;
46
108
  }
47
109
  }
48
110
  handleCancel = () => {
@@ -53,19 +115,105 @@ export class DialogSearch {
53
115
  this.filter = { ...this.filter, [field]: value };
54
116
  };
55
117
  handleSubmit = () => {
118
+ filterChatsStore.set('filterType', 'advanced');
56
119
  this.search.emit(this.filter);
57
120
  };
58
121
  handleReset = () => {
59
- this.filter = this.defaultFilter;
122
+ this.filter = { ...this.defaultFilter, name: this.selectedFilter?.name || '' };
123
+ };
124
+ handleCreateCustomFilter = async () => {
125
+ const result = await handleCreateChatFilter({
126
+ ...this.filter,
127
+ name: this.filter.name,
128
+ type: this.filter.type ?? null,
129
+ read: this.filter.read ?? null,
130
+ connection_ids: this.filter.connectionIds,
131
+ last_answer_by_ids: this.filter.lastAnswerByIds,
132
+ status_ids: this.filter.statusIds,
133
+ tag_ids: this.filter.tagIds,
134
+ });
135
+ if (result) {
136
+ this.cancel.emit();
137
+ }
138
+ };
139
+ handleUpdateCustomFilter = async () => {
140
+ const result = await handleUpdateChatFilter({
141
+ ...this.filter,
142
+ id: this.selectedFilter?.id,
143
+ name: this.filter.name,
144
+ type: this.filter.type ?? null,
145
+ read: this.filter.read ?? null,
146
+ connection_ids: this.filter.connectionIds,
147
+ last_answer_by_ids: this.filter.lastAnswerByIds,
148
+ status_ids: this.filter.statusIds,
149
+ tag_ids: this.filter.tagIds,
150
+ });
151
+ if (result) {
152
+ this.cancel.emit();
153
+ }
154
+ };
155
+ handleDeleteCustomFilter = async () => {
156
+ const t = useTranslation();
157
+ const title = t('chat_filter.confirm_delete_filter') || 'Are you sure you want to delete this filter?';
158
+ openDialog({
159
+ open: true,
160
+ type: "WARNING" /* DIALOG_TYPE.WARNING */,
161
+ title,
162
+ buttonName: t('confirm'),
163
+ cancelButtonName: t('cancel'),
164
+ onSubmitDialog: () => {
165
+ handleDeleteChatFilter(this.selectedFilter?.id).then((result) => {
166
+ if (result) {
167
+ this.cancel.emit();
168
+ }
169
+ });
170
+ },
171
+ onCloseDialog: () => {
172
+ // Dialog closed without confirmation
173
+ },
174
+ });
60
175
  };
176
+ isEnableUpdateCustomFilter = () => {
177
+ const isNameChanged = this.filter.name !== this.selectedFilter?.name;
178
+ const isTypeChanged = this.filter.type !== this.selectedFilter?.type;
179
+ const isReadChanged = this.filter.read !== this.selectedFilter?.read;
180
+ const isSearchChanged = this.filter.search !== this.selectedFilter?.search;
181
+ // Helper function to check if arrays contain the same items regardless of order
182
+ const areArraysEqual = (arr1, arr2) => {
183
+ if (!arr1 && !arr2)
184
+ return true;
185
+ if (!arr1 || !arr2)
186
+ return false;
187
+ if (arr1.length !== arr2.length)
188
+ return false;
189
+ const set1 = new Set(arr1);
190
+ const set2 = new Set(arr2);
191
+ return arr1.every(item => set2.has(item)) && arr2.every(item => set1.has(item));
192
+ };
193
+ const isConnectionIdsChanged = !areArraysEqual(this.filter.connectionIds, this.selectedFilter?.connection_ids);
194
+ const isLastAnswerByIdsChanged = !areArraysEqual(this.filter.lastAnswerByIds, this.selectedFilter?.last_answer_by_ids);
195
+ const isStatusIdsChanged = !areArraysEqual(this.filter.statusIds, this.selectedFilter?.status_ids);
196
+ const isTagIdsChanged = !areArraysEqual(this.filter.tagIds, this.selectedFilter?.tag_ids);
197
+ return isNameChanged || isTypeChanged || isReadChanged || isSearchChanged || isConnectionIdsChanged || isLastAnswerByIdsChanged || isStatusIdsChanged || isTagIdsChanged;
198
+ };
199
+ renderZrmz() {
200
+ return h("div", null, h("img", { src: getAssetPath("assets/images/logo/zrmz.png"), alt: "zrmz", class: "h-[40px]" }), h("div", { class: "flex items-center gap-2" }, h("label", { class: "flex-1 inline-flex items-center gap-2 text-sm mt-1 text-surface" }, h("input", { type: "checkbox", checked: this.filter.zrmz?.isOnlyCustomers, onChange: () => this.handleChange('zrmz', { ...this.filter.zrmz, isOnlyCustomers: !this.filter.zrmz?.isOnlyCustomers }) }), h("span", null, t('chat_filter.only_customer_zrmz'))), h(ZButton, { label: t('chat_tab.advance_search'), variant: "text-underline", endIcon: h(Icon, { name: 'Triangle', addClass: `ml-1 size-1.5 fill-current ${this.isShowAdvancedZrmz ? 'rotate-0' : 'rotate-180'}` }), onClick: () => this.isShowAdvancedZrmz = !this.isShowAdvancedZrmz })), this.isShowAdvancedZrmz && h("div", { class: "flex flex-col" }, h("autocomplete-select", { value: this.zrmzShopList.find(item => item.value === this.filter.zrmz?.shopId)?.label, fetchItems: () => Promise.resolve(this.zrmzShopList.map(item => ({ name: item.label, value: item.value }))), onSelecting: item => this.handleChange('zrmz', { ...this.filter.zrmz, shopId: item.detail.value }), referenceSelector: "filter-zrmz-shop", showClearButton: true, placeholder: t('chat_filter.shop_name'), class: "mb-2" }), h(ZInput, { placeholder: t('chat_filter.name'), value: this.filter.zrmz?.name, onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, name: value }) }), h("div", { class: "flex w-full gap-2" }, h("div", { class: "flex-1" }, h(ZInput, { placeholder: t('quick_message.button_action_tel'), value: this.filter.zrmz?.phoneNumber, onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, phoneNumber: value }) })), h("div", { class: "flex-1" }, h(ZInput, { placeholder: t('email'), value: this.filter.zrmz?.email, onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, email: value }) }))), h("p", { class: "text-sm mb-1 ml-1 text-surface" }, t('chat_filter.total_point')), h("div", { class: "flex w-full gap-2" }, h("div", { class: "flex-1" }, h(ZInput, { placeholder: "Point Type", value: this.filter.zrmz?.totalPointType, onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, totalPointType: value }) })), h("div", { class: "flex-1" }, h(ZInput, { placeholder: "Min", value: this.filter.zrmz?.totalPointMin?.toString(), onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, totalPointMin: Number.parseInt(value) || 0 }) })), h("div", { class: "flex-1" }, h(ZInput, { placeholder: "Max", value: this.filter.zrmz?.totalPointMax?.toString(), onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, totalPointMax: Number.parseInt(value) || 0 }) }))), h("p", { class: "text-sm mb-1 ml-1 text-surface" }, t('chat_filter.remaining_point')), h("div", { class: "flex w-full gap-2" }, h("div", { class: "flex-1" }, h(ZInput, { placeholder: "Point Type", value: this.filter.zrmz?.remainingPointType, onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, remainingPointType: value }) })), h("div", { class: "flex-1" }, h(ZInput, { placeholder: "Min", value: this.filter.zrmz?.remainingPointMin?.toString(), onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, remainingPointMin: Number.parseInt(value) || 0 }) })), h("div", { class: "flex-1" }, h(ZInput, { placeholder: "Max", value: this.filter.zrmz?.remainingPointMax?.toString(), onChange: value => this.handleChange('zrmz', { ...this.filter.zrmz, remainingPointMax: Number.parseInt(value) || 0 }) })))));
201
+ }
202
+ renderZerva() {
203
+ return (h("div", { class: "mt-1" }, h("img", { src: getAssetPath("assets/images/logo/zerva.png"), alt: "zerva", class: "h-[40px]" }), h("div", { class: "flex items-center gap-2" }, h("label", { class: "flex-1 inline-flex items-center gap-2 text-sm mt-1 text-surface" }, h("input", { type: "checkbox", checked: this.filter.zerva?.isOnlyCustomers, onChange: () => this.handleChange('zerva', { ...this.filter.zerva, isOnlyCustomers: !this.filter.zerva?.isOnlyCustomers }) }), h("span", null, t('chat_filter.only_customer_zerva'))), h(ZButton, { label: t('chat_tab.advance_search'), variant: "text-underline", endIcon: h(Icon, { name: 'Triangle', addClass: `ml-1 size-1.5 fill-current ${this.isShowAdvancedZerva ? 'rotate-0' : 'rotate-180'}` }), onClick: () => this.isShowAdvancedZerva = !this.isShowAdvancedZerva })), this.isShowAdvancedZerva && h("div", { class: "flex flex-col" }, h("autocomplete-select", { value: this.zervaShopList.find(item => item.value === this.filter.zerva?.shopId)?.label, fetchItems: () => Promise.resolve(this.zervaShopList.map(item => ({ name: item.label, value: item.value }))), onSelecting: item => this.handleChange('zerva', { ...this.filter.zerva, shopId: item.detail.value }), referenceSelector: "filter-zerva-shop", showClearButton: true, placeholder: t('chat_filter.shop_name'), class: "mb-2" }), h(ZInput, { placeholder: t('chat_filter.booking_no'), value: this.filter.zerva?.bookingNo, onChange: value => this.handleChange('zerva', { ...this.filter.zerva, bookingNo: value }) }), h(ZInput, { placeholder: t('chat_filter.name'), value: this.filter.zerva?.name, onChange: value => this.handleChange('zerva', { ...this.filter.zerva, name: value }) }), h("div", { class: "flex w-full gap-2" }, h("div", { class: "flex-1" }, h(ZInput, { placeholder: t('quick_message.button_action_tel'), value: this.filter.zerva?.phoneNumber, onChange: value => this.handleChange('zerva', { ...this.filter.zerva, phoneNumber: value }) })), h("div", { class: "flex-1" }, h(ZInput, { placeholder: t('email'), value: this.filter.zerva?.email, onChange: value => this.handleChange('zerva', { ...this.filter.zerva, email: value }) }))), h("p", { class: "text-sm mb-1 ml-1 text-surface" }, t('chat_filter.service_date')), h("div", { class: "flex w-full gap-2" }, h("div", { class: "flex-1" }, h(ZInput, { type: "date", placeholder: t('chat_filter.start_date'), value: this.filter.zerva?.bookingStartDate || '', onChange: value => this.handleChange('zerva', { ...this.filter.zerva, bookingStartDate: value }) })), h("div", { class: "flex-1" }, h(ZInput, { type: "date", placeholder: t('chat_filter.end_date'), value: this.filter.zerva?.bookingEndDate || '', onChange: value => this.handleChange('zerva', { ...this.filter.zerva, bookingEndDate: value }) }))), h("p", { class: "text-sm mb-1 ml-1 text-surface" }, t('status')), h("div", { class: "flex w-full gap-2" }, h("div", { class: "flex-1" }, h("autocomplete-select", { value: this.filter.zerva?.bookingStatus, fetchItems: () => Promise.resolve(this.zervaShopList.map(item => ({ name: item.label, value: item.value }))), onSelecting: item => this.handleChange('zerva', { ...this.filter.zerva, bookingStatus: item.detail.value }), referenceSelector: "filter-zerva-booking-status", showClearButton: true, placeholder: t('chat_filter.booking_status'), class: "mb-2" })), h("div", { class: "flex-1" }, h("autocomplete-select", { value: this.filter.zerva?.paymentStatus, fetchItems: () => Promise.resolve(this.zervaShopList.map(item => ({ name: item.label, value: item.value }))), onSelecting: item => this.handleChange('zerva', { ...this.filter.zerva, paymentStatus: item.detail.value }), referenceSelector: "filter-zerva-payment-status", showClearButton: true, placeholder: t('chat_filter.payment_status'), class: "mb-2" }))))));
204
+ }
61
205
  render() {
62
206
  const t = useTranslation();
63
207
  const isMobile = responsiveStore.get('isMobile');
64
- const selectReadOptions = [{ label: t('chat_tab.all_chat') }, { label: t('chat_tab.already_read'), value: true }, { label: t('chat_tab.unread'), value: false }];
65
- return (h(Host, { key: 'd8540d10aade175d8d77a3eafd63e29ab88eccc4' }, h("div", { key: '5d671265d4f4037c321c2c4c80dda22393fc4f3e', class: `dialog-search scroll-container ${isMobile ? 'w-xs' : 'w-xl'}` }, h("div", { key: 'cb9164a4b7a7c14d0151456dcf9c6141996bb6d0', class: "dialog-search-toolbar-action" }, h("div", { key: '2ba1172d9506e57876409738533da6b177de3421', class: "dialog-search-toolbar-action-wrapper " }, h("span", { key: '10c989cd1c334ef3fd76a58c7845aa36887ac574', class: "dialog-search-toolbar-action-reset", onClick: this.handleReset }, t('reset')), h(ZIconButton, { key: '58c6e16dcbf37745bbfd767daa40c0ba1c697b0e', iconName: "X", variant: "none", onClick: this.handleCancel }))), h("h2", { key: '9f9f30fa7928be191086e9d3ae2654b11ad1cf98', class: "dialog-search-toolbar-title" }, t('chat_tab.search_chat')), h("div", { key: '58b5bc058f12e09df323100935ddecb0d646350e', class: "space-y-2" }, h("p", { key: 'e8a7cce635fdbd1163e1edee7609fa01ef8b0d87', class: "dialog-search-text" }, t('search'), "\u00A0", h("span", { key: 'fc212b60766035d68ab9e58622ae7d15aaf04fa4', class: "text-sm text-theme-gray" }, "(", t('chat_tab.filter_search_fields'), ")")), h(ZInput, { key: '4795630ae00746cdaaf8ac5a93b2ff582d7e12a3', placeholder: t('search'), value: this.filter.search, onChange: value => this.handleChange('search', value) }), h("p", { key: '9140e318be3b0dd69700a7224f01bc9c3d364a09', class: "dialog-search-text" }, t('chat_tab.read_status')), h("div", { key: '66aeedf7aaf93567be21588551eed91c0110d160', class: "dialog-search-read-option" }, selectReadOptions.map(({ label, value }) => {
208
+ const selectReadOptions = [{ label: t('chat_tab.all_chat'), value: null }, { label: t('chat_tab.already_read'), value: true }, { label: t('chat_tab.unread'), value: false }];
209
+ const selectChatTypeOptions = [{ label: t('chat_filter.all'), value: null }, { label: t('chat_filter.friend'), value: 'user' }, { label: t('chat_filter.group'), value: 'group' }];
210
+ return (h(Host, { key: '8644594cf5faf6d3a0f076c1b02fce9cc3c4b98b' }, h("div", { key: '23cac53ce2dadadedce3008653dcaa471c249bac', class: `dialog-search scroll-container ${isMobile ? 'w-xs' : 'w-xl'}` }, h("div", { key: '3365d371b9dcdfa8d11610d1ef3cd7b26c3fdf6e', class: "dialog-search-toolbar-action" }, h("div", { key: 'fd3b29cbb1dbe94d3763b531b13030e70fec1aee', class: "dialog-search-toolbar-action-wrapper " }, h("span", { key: '7cbe9070332e1621f431d7a908769605c29f90ec', class: "dialog-search-toolbar-action-reset", onClick: this.handleReset }, t('reset')), h(ZIconButton, { key: '3a9bf5ab45baea022ed76dac4845bbe7f011319c', iconName: "X", variant: "none", onClick: this.handleCancel }))), h("h2", { key: '304bbf73ae2ccfc38da9412b3301383c8346bc19', class: "dialog-search-toolbar-title" }, this.filterType === 'advanced' ? t('chat_tab.advanced_search') : this.selectedFilter ? t('chat_tab.edit_custom_filter') : t('chat_tab.add_custom_filter')), h("div", { key: 'fdebf9044ba42b4d0740082be568ff2a9f6785b0', class: "dialog-search-content" }, h("div", { key: '8d6547c2fb19ddd3c887ea4209d99bf696677067', class: "space-y-2" }, this.filterType === 'custom' && h("div", { key: '308e56f00399316090e3560f1dfab56c7cef057c' }, h("p", { key: '27083190a05134d95fdde02b51e92d032d483aa9', class: "dialog-search-text" }, t('chat_filter.filter_name'), "\u00A0"), h(ZInput, { key: 'c00e5e2ed4344ddd46859265819e8e85e6703f0e', placeholder: t('chat_filter.filter_name'), value: this.filter.name, onChange: value => this.handleChange('name', value) })), h("p", { key: '45d2b4232907d887f807bb62a32905228d737d7d', class: "dialog-search-text" }, t('search'), "\u00A0", h("span", { key: 'a08c8347639ea7b9c5433f3b0d9f04814981ea2f', class: "text-sm text-theme-gray" }, "(", t('chat_tab.filter_search_fields'), ")")), h(ZInput, { key: '22e49d48d88a1300d4b2104963659dac0ac0205a', placeholder: t('search'), value: this.filter.search, onChange: value => this.handleChange('search', value) }), h("p", { key: '74d6c21b3447d4219c6c0211dbd1f12ea2428a09', class: "dialog-search-text" }, t('chat_tab.read_status')), h("div", { key: '7dc1331a43908dd1f853fffe4942a1bc00e062af', class: "dialog-search-read-option" }, selectReadOptions.map(({ label, value }) => {
66
211
  const isSelected = value === this.filter.read;
67
212
  return h(ZButton, { variant: isSelected ? 'primary' : 'outlined', label: label, title: label, onClick: () => this.handleChange('read', value) });
68
- })), h("p", { key: 'f3b594feb2f6ab788c996039393db540a121e194', class: "dialog-search-text" }, t('channel')), h("div", { key: '507634a6e7485b918a05cbcdb6dd1aa737a84591', class: 'mb-2', id: "filter-channel" }, h("autocomplete-multiple-select", { key: '0a0c9cb783dedb42b8afcad561dfa2b384b14951', selectedIds: this.filter.connectionIds, fetchItems: async () => Promise.resolve(this.connectionList), onSelecting: event => this.handleChange('connectionIds', event.detail), referenceSelector: "filter-channel" })), h("p", { key: '351e8bce39fb8c82d2957bb4400fd5c1aa7feb60', class: "dialog-search-text" }, t('chat_tab.last_reply')), h("div", { key: '472062b873ee7deb1152204732238843aa6d361f', class: 'mb-2', id: "filter-last-answer" }, h("autocomplete-multiple-select", { key: '496260a2e0c5f008532800195d3ec10060a84b84', selectedIds: this.filter.lastAnswerByIds, fetchItems: async () => Promise.resolve(this.answerList), onSelecting: event => this.handleChange('lastAnswerByIds', event.detail), referenceSelector: "filter-last-answer" })), h("p", { key: 'c9913b0bf7c54d25778eb8c11447b09d36122b5d', class: "dialog-search-text" }, t('status')), h("div", { key: '42d6a0d6f8e4692bad90c28c7cac7f9f98dcc89b', class: 'mb-2', id: "filter-status" }, h("autocomplete-multiple-select", { key: '23cbcc796290caca1b723af2a529bc268c4bf2eb', selectedIds: this.filter.statusIds, fetchItems: handleGetUserStatuses, onSelecting: event => this.handleChange('statusIds', event.detail), referenceSelector: "filter-status" })), h("p", { key: '68ead277ef9f2f51ada8073a0abb0273c1bccc63', class: "dialog-search-text" }, t('tag')), h("div", { key: '6bb325bee1d2deb1764ba94c1b6253bf862f1aec', class: 'mb-2', id: "filter-tag" }, h("autocomplete-multiple-select", { key: 'f17aa5e2024dd0894be890d6f291139f4570d264', selectedIds: this.filter.tagIds, fetchItems: handleGetUserTags, onSelecting: event => this.handleChange('tagIds', event.detail), referenceSelector: "filter-tag" }))), h("div", { key: 'a0ec136c676521f7c10a68f82eb7b9330a4c3393', class: "dialog-search-action-wrapper" }, h(ZButton, { key: '607b87990949724ec20bd5e428bb9746f941e09f', label: t('search_data'), fullWidth: true, onClick: this.handleSubmit })))));
213
+ })), h("p", { key: 'e915f1dece80412a59ed2a00ea9fdd6c2aa45f82', class: "dialog-search-text" }, t('channel')), h("div", { key: '1817ca28feca0fb1038912ba07dabc38646070fa', class: 'mb-2', id: "filter-channel" }, h("autocomplete-multiple-select", { key: 'c43b6c45fbca77dcab93c733558db3121e45e0ab', selectedIds: this.filter.connectionIds, fetchItems: async () => Promise.resolve(this.connectionList), onSelecting: event => this.handleChange('connectionIds', event.detail), referenceSelector: "filter-channel" })), h("p", { key: '0ed787b83aac340abdfc66194f630056b2a540d1', class: "dialog-search-text" }, t('chat_tab.last_reply')), h("div", { key: 'ffa937b4aeb84c0f3f8b9cc142c4d93b2b519700', class: 'mb-2', id: "filter-last-answer" }, h("autocomplete-multiple-select", { key: '8ef7dfad6f32d21f048beeb33c6cb9e8cc70daff', selectedIds: this.filter.lastAnswerByIds, fetchItems: async () => Promise.resolve(this.answerList), onSelecting: event => this.handleChange('lastAnswerByIds', event.detail), referenceSelector: "filter-last-answer" })), h("p", { key: '58175b27737ed2883f3a932dfd445e6333e0d7a5', class: "dialog-search-text" }, t('chat_filter.type'), "\u00A0", h("span", { key: '938125c8c6715b39dbe60b05fca2e75347ed7c71', class: "text-sm text-theme-gray" }, "(", t('chat_filter.type_for_line_oa'), ")")), h("div", { key: '669d4180c706dcf3dcec91f03317d8e98cbb0fad', class: "dialog-search-read-option" }, selectChatTypeOptions.map(({ label, value }) => {
214
+ const isSelected = value === this.filter.type;
215
+ return h(ZButton, { variant: isSelected ? 'primary' : 'outlined', label: label, title: label, onClick: () => this.handleChange('type', value) });
216
+ })), h("p", { key: 'e162c67444ff6e60edb2911c10af4ad3ce681475', class: "dialog-search-text" }, t('status')), h("div", { key: '58e9021261df36546bd9c8a6bdbe0961fd5b4ee3', class: 'mb-2', id: "filter-status" }, h("autocomplete-multiple-select", { key: '50d42eb427e48849193625ff5b855ffe40e0e00f', selectedIds: this.filter.statusIds, fetchItems: handleGetUserStatuses, onSelecting: event => this.handleChange('statusIds', event.detail), referenceSelector: "filter-status" })), h("p", { key: '04c06903a2ab8cdcb5d3312790e171e4967b2ecf', class: "dialog-search-text" }, t('tag')), h("div", { key: '55bd2b3aa65dadf40aa421acd8d48d83f6261c63', class: 'mb-2', id: "filter-tag" }, h("autocomplete-multiple-select", { key: 'd07a260ae4198262f9e829f5456ecf1a3d95c553', selectedIds: this.filter.tagIds, fetchItems: handleGetUserTags, onSelecting: event => this.handleChange('tagIds', event.detail), referenceSelector: "filter-tag" })), haveConnectionFromZwiz() && (h(h.Fragment, null, h("p", { key: '2529a64f4a24670d762081dea80413d9239abeb7', class: "dialog-search-text" }, t('chat_filter.verify_slip')), h("div", { key: '583c6b50d61f0934199eedacec530c428a9bddb4', class: "flex mb-2 gap-2", id: "filter-verify-slip" }, h("autocomplete-select", { key: 'c1ebf7d7a6858924cbc29a26b89156db3ab607ba', class: "flex-1", value: this.verifySlipList.find(item => item.value === this.filter.verifySlip)?.label, fetchItems: () => Promise.resolve(this.verifySlipList.map(item => ({ name: item.label, value: item.value }))), onSelecting: item => this.handleChange('verifySlip', item.detail.value), referenceSelector: "filter-verify-slip", showClearButton: true }), h("div", { key: 'f321a97938474d058c969eef9769b81e12558d45', class: "w-1/4" }, h(ZInput, { key: '51fc25c43e234da4b552c0716422eb368c8fb12a', placeholder: t('chat_filter.quantity'), value: this.filter.verifySlipValue?.toString() || '', onChange: value => this.handleChange('verifySlipValue', Number.parseInt(value) || 0) })), h("p", { key: '5fd3d21883cdf200dca75fd353a7882d197184f7', class: "text-sm mt-2" }, t('chat_filter.times'))))), haveConnectionFromZwiz() && this.renderZrmz(), haveConnectionFromZwiz() && this.renderZerva())), this.filterType === 'advanced' && h("div", { key: 'f9cd50989761cb91f64094b8f2cc36ea1a187c5c', class: "dialog-search-action-wrapper" }, h(ZButton, { key: 'ae3ef5c554f6f1bbad56cc9e48fab5ae9c7555ba', label: t('search_data'), fullWidth: true, onClick: this.handleSubmit })), this.filterType === 'custom' && !this.selectedFilter && h("div", { key: '46665e28993d265701972ed98d421273cac14616', class: "dialog-search-action-wrapper" }, h(ZButton, { key: '2ba3ae3046e078116b001cba1827b12a49838e5a', label: t('chat_filter.add_custom_filter'), fullWidth: true, onClick: this.handleCreateCustomFilter, disabled: !this.filter.name })), this.filterType === 'custom' && this.selectedFilter && h("div", { key: 'de2b0a2ba48176239f9c8cfaa6930ebc2b3dd779', class: "dialog-search-action-wrapper" }, h(ZButton, { key: '92bbaedfe6ea480ba27a94ad8f35a5fc5ae1c8b0', label: t('save'), fullWidth: true, onClick: this.handleUpdateCustomFilter, disabled: !this.filter.name || !this.isEnableUpdateCustomFilter() }), h(ZButton, { key: 'dcd226e138c6ffb723bbe23976eed4730550492a', variant: 'text-underline', label: t('delete'), fullWidth: true, onClick: this.handleDeleteCustomFilter })))));
69
217
  }
70
218
  static get is() { return "dialog-search"; }
71
219
  static get originalStyleUrls() {
@@ -85,7 +233,7 @@ export class DialogSearch {
85
233
  "mutable": false,
86
234
  "complexType": {
87
235
  "original": "SearchChatsParams",
88
- "resolved": "{ search?: string; spam?: boolean; read?: boolean; connectionIds?: string[]; lastAnswerByIds?: string[]; statusIds?: string[]; tagIds?: string[]; }",
236
+ "resolved": "{ name?: string; search?: string; spam?: boolean; type?: \"user\" | \"group\"; read?: boolean; context?: string; connectionIds?: string[]; lastAnswerByIds?: string[]; statusIds?: string[]; tagIds?: string[]; verifySlip?: string; verifySlipValue?: number; zrmz?: { isOnlyCustomers?: boolean; shopId?: string; name?: string; phoneNumber?: string; email?: string; totalPointType?: string; totalPointMin?: number; totalPointMax?: number; remainingPointType?: string; remainingPointMin?: number; remainingPointMax?: number; }; zerva?: { isOnlyCustomers?: boolean; shopId?: string; bookingNo?: string; name?: string; phoneNumber?: string; email?: string; bookingStartDate?: string; bookingEndDate?: string; paymentStatus?: string; bookingStatus?: string; }; }",
89
237
  "references": {
90
238
  "SearchChatsParams": {
91
239
  "location": "import",
@@ -102,12 +250,57 @@ export class DialogSearch {
102
250
  },
103
251
  "getter": false,
104
252
  "setter": false
253
+ },
254
+ "filterType": {
255
+ "type": "string",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "'quick' | 'advanced' | 'custom'",
259
+ "resolved": "\"advanced\" | \"custom\" | \"quick\"",
260
+ "references": {}
261
+ },
262
+ "required": false,
263
+ "optional": false,
264
+ "docs": {
265
+ "tags": [],
266
+ "text": ""
267
+ },
268
+ "getter": false,
269
+ "setter": false,
270
+ "reflect": false,
271
+ "attribute": "filter-type",
272
+ "defaultValue": "'advanced'"
273
+ },
274
+ "selectedFilter": {
275
+ "type": "unknown",
276
+ "mutable": false,
277
+ "complexType": {
278
+ "original": "ChatFilter",
279
+ "resolved": "{ id: string; name: string; search?: string; read?: boolean; type?: \"user\" | \"group\"; connection_ids?: string[]; last_answer_by_ids?: string[]; status_ids?: string[]; tag_ids?: string[]; created_at?: string; updated_at?: string; }",
280
+ "references": {
281
+ "ChatFilter": {
282
+ "location": "import",
283
+ "path": "../../api/type",
284
+ "id": "src/api/type.ts::ChatFilter"
285
+ }
286
+ }
287
+ },
288
+ "required": false,
289
+ "optional": true,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": ""
293
+ },
294
+ "getter": false,
295
+ "setter": false
105
296
  }
106
297
  };
107
298
  }
108
299
  static get states() {
109
300
  return {
110
- "filter": {}
301
+ "filter": {},
302
+ "isShowAdvancedZrmz": {},
303
+ "isShowAdvancedZerva": {}
111
304
  };
112
305
  }
113
306
  static get events() {
@@ -138,7 +331,7 @@ export class DialogSearch {
138
331
  },
139
332
  "complexType": {
140
333
  "original": "SearchChatsParams",
141
- "resolved": "{ search?: string; spam?: boolean; read?: boolean; connectionIds?: string[]; lastAnswerByIds?: string[]; statusIds?: string[]; tagIds?: string[]; }",
334
+ "resolved": "{ name?: string; search?: string; spam?: boolean; type?: \"user\" | \"group\"; read?: boolean; context?: string; connectionIds?: string[]; lastAnswerByIds?: string[]; statusIds?: string[]; tagIds?: string[]; verifySlip?: string; verifySlipValue?: number; zrmz?: { isOnlyCustomers?: boolean; shopId?: string; name?: string; phoneNumber?: string; email?: string; totalPointType?: string; totalPointMin?: number; totalPointMax?: number; remainingPointType?: string; remainingPointMin?: number; remainingPointMax?: number; }; zerva?: { isOnlyCustomers?: boolean; shopId?: string; bookingNo?: string; name?: string; phoneNumber?: string; email?: string; bookingStartDate?: string; bookingEndDate?: string; paymentStatus?: string; bookingStatus?: string; }; }",
142
335
  "references": {
143
336
  "SearchChatsParams": {
144
337
  "location": "import",
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  // Import only icons actually used in the project (49 icons instead of 1000+)
3
- import { ArrowDown, ArrowRight, Ban, Bot, Camera, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleCheck, CircleMinus, CircleOff, CircleX, Edit, Ellipsis, EllipsisVertical, File, Folder, Globe, Image, ImageOff, Inbox, Info, Languages, Loader2, LoaderCircle, Mail, MailCheck, MailWarning, MessageSquareText, MoreVertical, Paperclip, Pencil, Pin, Play, Plus, Reply, RotateCw, Save, Search, Send, SlidersHorizontal, SquareMenu, Touchpad, Trash2, Triangle, TriangleAlert, Unlink, UserRound, UserSearch, UsersRound, X, } from "lucide";
3
+ import { ArrowDown, ArrowRight, Ban, Bot, Camera, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleCheck, CircleMinus, CircleOff, CircleX, Edit, Ellipsis, EllipsisVertical, File, Folder, Globe, Image, ImageOff, Inbox, Info, Languages, Loader2, LoaderCircle, Mail, MailCheck, MailWarning, MessageSquareText, MoreVertical, Paperclip, Pencil, Pin, Play, Plus, Reply, RotateCw, Save, Search, Send, SlidersHorizontal, SquareMenu, Touchpad, Trash2, Triangle, TriangleAlert, Unlink, UserRound, UserSearch, UsersRound, X, BotMessageSquare, Filter, } from "lucide";
4
4
  // Icon map for tree-shaking - only includes icons actually used
5
5
  const iconMap = {
6
6
  ArrowDown,
@@ -56,6 +56,8 @@ const iconMap = {
56
56
  UserSearch,
57
57
  UsersRound,
58
58
  X,
59
+ BotMessageSquare,
60
+ Filter,
59
61
  };
60
62
  export const Icon = ({ name, addClass }) => {
61
63
  const icon = iconMap[name];
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- export const ZButton = ({ id, variant = 'primary', textVariant = 'primary', disabled = false, onClick, fullWidth, maxWidth, label, startIcon, endIcon, size = 'medium', ref, title, }) => {
2
+ export const ZButton = ({ id, variant = 'primary', textVariant = 'primary', disabled = false, onClick, fullWidth, maxWidth, label, startIcon, endIcon, size = 'medium', ref, title, padding, }) => {
3
3
  let styleSize = 'z-button-medium';
4
4
  if (size === 'small') {
5
5
  styleSize = 'z-button-small';
@@ -7,11 +7,26 @@ export const ZButton = ({ id, variant = 'primary', textVariant = 'primary', disa
7
7
  if (size === 'large') {
8
8
  styleSize = 'z-button-large';
9
9
  }
10
- const base = `z-button ${styleSize} ${fullWidth ? 'w-full' : maxWidth ? maxWidth : ''}`;
10
+ const base = `z-button ${padding} ${styleSize} ${fullWidth ? 'w-full' : maxWidth ? maxWidth : ''}`;
11
11
  const primary = 'z-button-primary';
12
12
  const outlined = 'z-button-outlined';
13
13
  const text = `${textVariant === 'primary' ? 'text-primary' : 'text-surface'} hover:brightness-110`;
14
+ const textUnderline = `${textVariant === 'primary' ? 'text-primary' : 'text-surface'} hover:brightness-110 underline`;
14
15
  const disabledStyle = 'z-button-disabled';
15
- const classList = [base, variant === 'primary' ? primary : variant === 'outlined' ? outlined : text, disabled ? disabledStyle : ''].join(' ');
16
- return (h("button", { id: id, title: title, ref: ref, class: classList, disabled: disabled, onClick: e => !disabled && onClick?.(e) }, startIcon, h("span", { class: "z-button-text", id: id }, label), endIcon));
16
+ let variantClass;
17
+ if (variant === 'primary') {
18
+ variantClass = primary;
19
+ }
20
+ else if (variant === 'outlined') {
21
+ variantClass = outlined;
22
+ }
23
+ else if (variant === 'text-underline') {
24
+ variantClass = textUnderline;
25
+ }
26
+ else {
27
+ variantClass = text;
28
+ }
29
+ const disabledClass = disabled ? disabledStyle : '';
30
+ const classList = [base, variantClass, disabledClass].filter(Boolean).join(' ');
31
+ return (h("button", { id: id, title: title, ref: ref, class: classList, disabled: disabled, onClick: e => !disabled && onClick?.(e) }, startIcon, label && h("span", { class: "z-button-text", id: id }, label), endIcon));
17
32
  };
@@ -2,5 +2,5 @@ import { h } from "@stencil/core";
2
2
  import { configStore } from "../../store/store";
3
3
  export const ZInput = ({ id, label, placeholder = '', value = '', onChange, onKeyDown, autoFocus, type = 'text', error }) => {
4
4
  const theme = configStore.get('theme');
5
- return (h("div", { class: "mb-4", "data-theme": theme }, label && h("label", { class: "z-input-label" }, label), h("input", { id: id, type: type, placeholder: placeholder, class: "z-input", value: value, onInput: (e) => onChange?.(e.target.value), onKeyDown: onKeyDown, autoFocus: autoFocus }), error && h("p", { class: "z-input-error" }, error)));
5
+ return (h("div", { class: "mb-2", "data-theme": theme }, label && h("label", { class: "z-input-label" }, label), h("input", { id: id, type: type, placeholder: placeholder, class: "z-input", value: value, onInput: (e) => onChange?.(e.target.value), onKeyDown: onKeyDown, autoFocus: autoFocus }), error && h("p", { class: "z-input-error" }, error)));
6
6
  };