@empathyco/x-components 7.2.3 → 7.2.4

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 (572) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/core/index.js +3 -3
  3. package/js/components/animations/{animate-clip-path2.vue.js → animate-clip-path.vue2.js} +1 -1
  4. package/js/components/animations/animate-clip-path.vue2.js.map +1 -0
  5. package/js/components/animations/animate-clip-path.vue3.js +7 -0
  6. package/js/components/animations/animate-clip-path.vue3.js.map +1 -0
  7. package/js/components/animations/{animate-scale2.vue.js → animate-scale.vue2.js} +1 -1
  8. package/js/components/animations/animate-scale.vue2.js.map +1 -0
  9. package/js/components/animations/{animate-scale3.vue.js → animate-scale.vue3.js} +2 -2
  10. package/js/components/animations/animate-scale.vue3.js.map +1 -0
  11. package/js/components/animations/{animate-translate2.vue.js → animate-translate.vue2.js} +1 -1
  12. package/js/components/animations/animate-translate.vue2.js.map +1 -0
  13. package/js/components/animations/animate-translate.vue3.js +7 -0
  14. package/js/components/animations/animate-translate.vue3.js.map +1 -0
  15. package/js/components/animations/animate-width.vue.js +2 -2
  16. package/js/components/animations/{animate-width2.vue.js → animate-width.vue2.js} +1 -1
  17. package/js/components/animations/{animate-width2.vue.js.map → animate-width.vue2.js.map} +1 -1
  18. package/js/components/animations/{animate-width3.vue.js → animate-width.vue3.js} +1 -1
  19. package/js/components/animations/animate-width.vue3.js.map +1 -0
  20. package/js/components/animations/change-height.vue.js +2 -2
  21. package/js/components/animations/{change-height2.vue.js → change-height.vue2.js} +1 -1
  22. package/js/components/animations/{change-height2.vue.js.map → change-height.vue2.js.map} +1 -1
  23. package/js/components/animations/{change-height3.vue.js → change-height.vue3.js} +1 -1
  24. package/js/components/animations/change-height.vue3.js.map +1 -0
  25. package/js/components/animations/collapse-height.vue.js +2 -2
  26. package/js/components/animations/{collapse-height2.vue.js → collapse-height.vue2.js} +1 -1
  27. package/js/components/animations/{collapse-height2.vue.js.map → collapse-height.vue2.js.map} +1 -1
  28. package/js/components/animations/{collapse-height3.vue.js → collapse-height.vue3.js} +1 -1
  29. package/js/components/animations/collapse-height.vue3.js.map +1 -0
  30. package/js/components/animations/collapse-width.vue.js +2 -2
  31. package/js/components/animations/{collapse-width2.vue.js → collapse-width.vue2.js} +1 -1
  32. package/js/components/animations/{collapse-width2.vue.js.map → collapse-width.vue2.js.map} +1 -1
  33. package/js/components/animations/{collapse-width3.vue.js → collapse-width.vue3.js} +1 -1
  34. package/js/components/animations/collapse-width.vue3.js.map +1 -0
  35. package/js/components/animations/cross-fade.vue.js +2 -2
  36. package/js/components/animations/{cross-fade2.vue.js → cross-fade.vue2.js} +1 -1
  37. package/js/components/animations/{cross-fade2.vue.js.map → cross-fade.vue2.js.map} +1 -1
  38. package/js/components/animations/{cross-fade3.vue.js → cross-fade.vue3.js} +1 -1
  39. package/js/components/animations/cross-fade.vue3.js.map +1 -0
  40. package/js/components/animations/fade-and-slide.vue.js +2 -2
  41. package/js/components/animations/{fade-and-slide2.vue.js → fade-and-slide.vue2.js} +1 -1
  42. package/js/components/animations/{fade-and-slide2.vue.js.map → fade-and-slide.vue2.js.map} +1 -1
  43. package/js/components/animations/{fade-and-slide3.vue.js → fade-and-slide.vue3.js} +1 -1
  44. package/js/components/animations/fade-and-slide.vue3.js.map +1 -0
  45. package/js/components/animations/fade.vue.js +2 -2
  46. package/js/components/animations/{fade2.vue.js → fade.vue2.js} +1 -1
  47. package/js/components/animations/{fade2.vue.js.map → fade.vue2.js.map} +1 -1
  48. package/js/components/animations/{fade3.vue.js → fade.vue3.js} +1 -1
  49. package/js/components/animations/fade.vue3.js.map +1 -0
  50. package/js/components/animations/{no-animation2.vue.js → no-animation.vue2.js} +1 -1
  51. package/js/components/animations/no-animation.vue2.js.map +1 -0
  52. package/js/components/animations/staggered-fade-and-slide.vue.js +2 -2
  53. package/js/components/animations/{staggered-fade-and-slide2.vue.js → staggered-fade-and-slide.vue2.js} +1 -1
  54. package/js/components/animations/{staggered-fade-and-slide2.vue.js.map → staggered-fade-and-slide.vue2.js.map} +1 -1
  55. package/js/components/animations/{staggered-fade-and-slide3.vue.js → staggered-fade-and-slide.vue3.js} +1 -1
  56. package/js/components/animations/staggered-fade-and-slide.vue3.js.map +1 -0
  57. package/js/components/auto-progress-bar.vue.js +2 -2
  58. package/js/components/{auto-progress-bar2.vue.js → auto-progress-bar.vue2.js} +1 -1
  59. package/js/components/{auto-progress-bar2.vue.js.map → auto-progress-bar.vue2.js.map} +1 -1
  60. package/js/components/{auto-progress-bar3.vue.js → auto-progress-bar.vue3.js} +1 -1
  61. package/js/components/auto-progress-bar.vue3.js.map +1 -0
  62. package/js/components/base-dropdown.vue.js +2 -2
  63. package/js/components/{base-dropdown2.vue.js → base-dropdown.vue2.js} +20 -20
  64. package/js/components/{base-dropdown2.vue.js.map → base-dropdown.vue2.js.map} +1 -1
  65. package/js/components/{base-dropdown3.vue.js → base-dropdown.vue3.js} +1 -1
  66. package/js/components/base-dropdown.vue3.js.map +1 -0
  67. package/js/components/base-event-button.vue.js +1 -1
  68. package/js/components/{base-event-button2.vue.js → base-event-button.vue2.js} +1 -1
  69. package/js/components/{base-event-button2.vue.js.map → base-event-button.vue2.js.map} +1 -1
  70. package/js/components/base-grid.vue.js +2 -2
  71. package/js/components/{base-grid2.vue.js → base-grid.vue2.js} +1 -1
  72. package/js/components/{base-grid2.vue.js.map → base-grid.vue2.js.map} +1 -1
  73. package/js/components/{base-grid3.vue.js → base-grid.vue3.js} +1 -1
  74. package/js/components/base-grid.vue3.js.map +1 -0
  75. package/js/components/base-keyboard-navigation.vue.js +1 -1
  76. package/js/components/{base-keyboard-navigation2.vue.js → base-keyboard-navigation.vue2.js} +1 -1
  77. package/js/components/{base-keyboard-navigation2.vue.js.map → base-keyboard-navigation.vue2.js.map} +1 -1
  78. package/js/components/base-rating.vue.js +2 -2
  79. package/js/components/{base-rating2.vue.js → base-rating.vue2.js} +1 -1
  80. package/js/components/{base-rating2.vue.js.map → base-rating.vue2.js.map} +1 -1
  81. package/js/components/{base-rating3.vue.js → base-rating.vue3.js} +1 -1
  82. package/js/components/base-rating.vue3.js.map +1 -0
  83. package/js/components/base-slider.vue.js +2 -2
  84. package/js/components/{base-slider2.vue.js → base-slider.vue2.js} +1 -1
  85. package/js/components/{base-slider2.vue.js.map → base-slider.vue2.js.map} +1 -1
  86. package/js/components/{base-slider3.vue.js → base-slider.vue3.js} +1 -1
  87. package/js/components/base-slider.vue3.js.map +1 -0
  88. package/js/components/base-switch.vue.js +2 -2
  89. package/js/components/{base-switch2.vue.js → base-switch.vue2.js} +1 -1
  90. package/js/components/{base-switch2.vue.js.map → base-switch.vue2.js.map} +1 -1
  91. package/js/components/{base-switch3.vue.js → base-switch.vue3.js} +1 -1
  92. package/js/components/base-switch.vue3.js.map +1 -0
  93. package/js/components/base-teleport.vue.js +1 -1
  94. package/js/components/{base-teleport2.vue.js → base-teleport.vue2.js} +1 -1
  95. package/js/components/{base-teleport2.vue.js.map → base-teleport.vue2.js.map} +1 -1
  96. package/js/components/base-variable-column-grid.vue.js +1 -1
  97. package/js/components/{base-variable-column-grid2.vue.js → base-variable-column-grid.vue2.js} +1 -1
  98. package/js/components/{base-variable-column-grid2.vue.js.map → base-variable-column-grid.vue2.js.map} +1 -1
  99. package/js/components/column-picker/base-column-picker-dropdown.vue.js +1 -1
  100. package/js/components/column-picker/{base-column-picker-dropdown2.vue.js → base-column-picker-dropdown.vue2.js} +1 -1
  101. package/js/components/column-picker/{base-column-picker-dropdown2.vue.js.map → base-column-picker-dropdown.vue2.js.map} +1 -1
  102. package/js/components/column-picker/base-column-picker-list.vue.js +1 -1
  103. package/js/components/column-picker/{base-column-picker-list2.vue.js → base-column-picker-list.vue2.js} +1 -1
  104. package/js/components/column-picker/{base-column-picker-list2.vue.js.map → base-column-picker-list.vue2.js.map} +1 -1
  105. package/js/components/currency/base-currency.vue.js +1 -1
  106. package/js/components/currency/{base-currency2.vue.js → base-currency.vue2.js} +1 -1
  107. package/js/components/currency/{base-currency2.vue.js.map → base-currency.vue2.js.map} +1 -1
  108. package/js/components/{display-click-provider2.vue.js → display-click-provider.vue2.js} +1 -1
  109. package/js/components/display-click-provider.vue2.js.map +1 -0
  110. package/js/components/{display-emitter2.vue.js → display-emitter.vue2.js} +1 -1
  111. package/js/components/display-emitter.vue2.js.map +1 -0
  112. package/js/components/filters/labels/{base-price-filter-label2.vue.js → base-price-filter-label.vue2.js} +1 -1
  113. package/js/components/filters/labels/base-price-filter-label.vue2.js.map +1 -0
  114. package/js/components/filters/labels/base-rating-filter-label.vue.js +1 -1
  115. package/js/components/filters/labels/{base-rating-filter-label2.vue.js → base-rating-filter-label.vue2.js} +1 -1
  116. package/js/components/filters/labels/{base-rating-filter-label2.vue.js.map → base-rating-filter-label.vue2.js.map} +1 -1
  117. package/js/components/{global-x-bus2.vue.js → global-x-bus.vue2.js} +1 -1
  118. package/js/components/global-x-bus.vue2.js.map +1 -0
  119. package/js/components/highlight.vue.js +1 -1
  120. package/js/components/{highlight2.vue.js → highlight.vue2.js} +1 -1
  121. package/js/components/{highlight2.vue.js.map → highlight.vue2.js.map} +1 -1
  122. package/js/components/items-list.vue.js +1 -1
  123. package/js/components/{items-list2.vue.js → items-list.vue2.js} +1 -1
  124. package/js/components/{items-list2.vue.js.map → items-list.vue2.js.map} +1 -1
  125. package/js/components/{location-provider2.vue.js → location-provider.vue2.js} +1 -1
  126. package/js/components/location-provider.vue2.js.map +1 -0
  127. package/js/components/message.vue.js +17 -17
  128. package/js/components/{message2.vue.js → message.vue2.js} +1 -1
  129. package/js/components/message.vue2.js.map +1 -0
  130. package/js/components/modals/base-events-modal-close.vue.js +1 -1
  131. package/js/components/modals/{base-events-modal-close2.vue.js → base-events-modal-close.vue2.js} +1 -1
  132. package/js/components/modals/{base-events-modal-close2.vue.js.map → base-events-modal-close.vue2.js.map} +1 -1
  133. package/js/components/modals/base-events-modal-open.vue.js +1 -1
  134. package/js/components/modals/{base-events-modal-open2.vue.js → base-events-modal-open.vue2.js} +1 -1
  135. package/js/components/modals/{base-events-modal-open2.vue.js.map → base-events-modal-open.vue2.js.map} +1 -1
  136. package/js/components/modals/base-events-modal.vue.js +1 -1
  137. package/js/components/modals/{base-events-modal2.vue.js → base-events-modal.vue2.js} +1 -1
  138. package/js/components/modals/{base-events-modal2.vue.js.map → base-events-modal.vue2.js.map} +1 -1
  139. package/js/components/modals/base-id-modal-close.vue.js +1 -1
  140. package/js/components/modals/{base-id-modal-close2.vue.js → base-id-modal-close.vue2.js} +1 -1
  141. package/js/components/modals/{base-id-modal-close2.vue.js.map → base-id-modal-close.vue2.js.map} +1 -1
  142. package/js/components/modals/base-id-modal-open.vue.js +1 -1
  143. package/js/components/modals/{base-id-modal-open2.vue.js → base-id-modal-open.vue2.js} +1 -1
  144. package/js/components/modals/{base-id-modal-open2.vue.js.map → base-id-modal-open.vue2.js.map} +1 -1
  145. package/js/components/modals/base-id-modal.vue.js +1 -1
  146. package/js/components/modals/{base-id-modal2.vue.js → base-id-modal.vue2.js} +1 -1
  147. package/js/components/modals/{base-id-modal2.vue.js.map → base-id-modal.vue2.js.map} +1 -1
  148. package/js/components/modals/base-modal.vue.js +2 -2
  149. package/js/components/modals/{base-modal2.vue.js → base-modal.vue2.js} +18 -18
  150. package/js/components/modals/{base-modal2.vue.js.map → base-modal.vue2.js.map} +1 -1
  151. package/js/components/modals/{base-modal3.vue.js → base-modal.vue3.js} +1 -1
  152. package/js/components/modals/base-modal.vue3.js.map +1 -0
  153. package/js/components/modals/close-main-modal.vue.js +1 -1
  154. package/js/components/modals/{close-main-modal2.vue.js → close-main-modal.vue2.js} +1 -1
  155. package/js/components/modals/{close-main-modal2.vue.js.map → close-main-modal.vue2.js.map} +1 -1
  156. package/js/components/modals/main-modal.vue.js +1 -1
  157. package/js/components/modals/{main-modal2.vue.js → main-modal.vue2.js} +1 -1
  158. package/js/components/modals/{main-modal2.vue.js.map → main-modal.vue2.js.map} +1 -1
  159. package/js/components/modals/open-main-modal.vue.js +1 -1
  160. package/js/components/modals/{open-main-modal2.vue.js → open-main-modal.vue2.js} +1 -1
  161. package/js/components/modals/{open-main-modal2.vue.js.map → open-main-modal.vue2.js.map} +1 -1
  162. package/js/components/page-loader-button.vue.js +2 -2
  163. package/js/components/{page-loader-button2.vue.js → page-loader-button.vue2.js} +1 -1
  164. package/js/components/{page-loader-button2.vue.js.map → page-loader-button.vue2.js.map} +1 -1
  165. package/js/components/{page-loader-button3.vue.js → page-loader-button.vue3.js} +1 -1
  166. package/js/components/page-loader-button.vue3.js.map +1 -0
  167. package/js/components/page-selector.vue.js +2 -2
  168. package/js/components/{page-selector2.vue.js → page-selector.vue2.js} +1 -1
  169. package/js/components/{page-selector2.vue.js.map → page-selector.vue2.js.map} +1 -1
  170. package/js/components/{page-selector3.vue.js → page-selector.vue3.js} +1 -1
  171. package/js/components/page-selector.vue3.js.map +1 -0
  172. package/js/components/panels/base-header-toggle-panel.vue.js +2 -2
  173. package/js/components/panels/{base-header-toggle-panel2.vue.js → base-header-toggle-panel.vue2.js} +20 -20
  174. package/js/components/panels/{base-header-toggle-panel2.vue.js.map → base-header-toggle-panel.vue2.js.map} +1 -1
  175. package/js/components/panels/{base-header-toggle-panel3.vue.js → base-header-toggle-panel.vue3.js} +1 -1
  176. package/js/components/panels/base-header-toggle-panel.vue3.js.map +1 -0
  177. package/js/components/panels/base-id-toggle-panel-button.vue.js +1 -1
  178. package/js/components/panels/{base-id-toggle-panel-button2.vue.js → base-id-toggle-panel-button.vue2.js} +1 -1
  179. package/js/components/panels/{base-id-toggle-panel-button2.vue.js.map → base-id-toggle-panel-button.vue2.js.map} +1 -1
  180. package/js/components/panels/base-id-toggle-panel.vue.js +1 -1
  181. package/js/components/panels/{base-id-toggle-panel2.vue.js → base-id-toggle-panel.vue2.js} +20 -20
  182. package/js/components/panels/{base-id-toggle-panel2.vue.js.map → base-id-toggle-panel.vue2.js.map} +1 -1
  183. package/js/components/panels/base-tabs-panel.vue.js +2 -2
  184. package/js/components/panels/{base-tabs-panel2.vue.js → base-tabs-panel.vue2.js} +20 -20
  185. package/js/components/panels/{base-tabs-panel2.vue.js.map → base-tabs-panel.vue2.js.map} +1 -1
  186. package/js/components/panels/{base-tabs-panel3.vue.js → base-tabs-panel.vue3.js} +1 -1
  187. package/js/components/panels/base-tabs-panel.vue3.js.map +1 -0
  188. package/js/components/panels/base-toggle-panel.vue.js +1 -1
  189. package/js/components/panels/{base-toggle-panel2.vue.js → base-toggle-panel.vue2.js} +1 -1
  190. package/js/components/panels/{base-toggle-panel2.vue.js.map → base-toggle-panel.vue2.js.map} +1 -1
  191. package/js/components/result/base-result-add-to-cart.vue.js +1 -1
  192. package/js/components/result/{base-result-add-to-cart2.vue.js → base-result-add-to-cart.vue2.js} +1 -1
  193. package/js/components/result/{base-result-add-to-cart2.vue.js.map → base-result-add-to-cart.vue2.js.map} +1 -1
  194. package/js/components/result/base-result-current-price.vue.js +1 -1
  195. package/js/components/result/{base-result-current-price2.vue.js → base-result-current-price.vue2.js} +1 -1
  196. package/js/components/result/{base-result-current-price2.vue.js.map → base-result-current-price.vue2.js.map} +1 -1
  197. package/js/components/result/base-result-image.vue.js +2 -2
  198. package/js/components/result/{base-result-image2.vue.js → base-result-image.vue2.js} +20 -20
  199. package/js/components/result/{base-result-image2.vue.js.map → base-result-image.vue2.js.map} +1 -1
  200. package/js/components/result/{base-result-image3.vue.js → base-result-image.vue3.js} +1 -1
  201. package/js/components/result/base-result-image.vue3.js.map +1 -0
  202. package/js/components/result/base-result-link.vue.js +2 -2
  203. package/js/components/result/{base-result-link2.vue.js → base-result-link.vue2.js} +1 -1
  204. package/js/components/result/{base-result-link2.vue.js.map → base-result-link.vue2.js.map} +1 -1
  205. package/js/components/result/{base-result-link3.vue.js → base-result-link.vue3.js} +1 -1
  206. package/js/components/result/base-result-link.vue3.js.map +1 -0
  207. package/js/components/result/base-result-previous-price.vue.js +1 -1
  208. package/js/components/result/{base-result-previous-price2.vue.js → base-result-previous-price.vue2.js} +1 -1
  209. package/js/components/result/{base-result-previous-price2.vue.js.map → base-result-previous-price.vue2.js.map} +1 -1
  210. package/js/components/result/base-result-rating.vue.js +2 -2
  211. package/js/components/result/{base-result-rating2.vue.js → base-result-rating.vue2.js} +1 -1
  212. package/js/components/result/{base-result-rating2.vue.js.map → base-result-rating.vue2.js.map} +1 -1
  213. package/js/components/result/{base-result-rating3.vue.js → base-result-rating.vue3.js} +1 -1
  214. package/js/components/result/base-result-rating.vue3.js.map +1 -0
  215. package/js/components/result/result-variant-selector.vue.js +2 -2
  216. package/js/components/result/{result-variant-selector2.vue.js → result-variant-selector.vue2.js} +1 -1
  217. package/js/components/result/{result-variant-selector2.vue.js.map → result-variant-selector.vue2.js.map} +1 -1
  218. package/js/components/result/{result-variant-selector3.vue.js → result-variant-selector.vue3.js} +1 -1
  219. package/js/components/result/result-variant-selector.vue3.js.map +1 -0
  220. package/js/components/result/{result-variants-provider2.vue.js → result-variants-provider.vue2.js} +1 -1
  221. package/js/components/result/result-variants-provider.vue2.js.map +1 -0
  222. package/js/components/scroll/base-scroll.vue.js +1 -1
  223. package/js/components/scroll/{base-scroll2.vue.js → base-scroll.vue2.js} +1 -1
  224. package/js/components/scroll/{base-scroll2.vue.js.map → base-scroll.vue2.js.map} +1 -1
  225. package/js/components/sliding-panel.vue.js +2 -2
  226. package/js/components/{sliding-panel2.vue.js → sliding-panel.vue2.js} +1 -1
  227. package/js/components/{sliding-panel2.vue.js.map → sliding-panel.vue2.js.map} +1 -1
  228. package/js/components/{sliding-panel3.vue.js → sliding-panel.vue3.js} +1 -1
  229. package/js/components/sliding-panel.vue3.js.map +1 -0
  230. package/js/components/snippet-callbacks.vue.js +1 -1
  231. package/js/components/{snippet-callbacks2.vue.js → snippet-callbacks.vue2.js} +1 -1
  232. package/js/components/{snippet-callbacks2.vue.js.map → snippet-callbacks.vue2.js.map} +1 -1
  233. package/js/components/suggestions/base-suggestion.vue.js +1 -1
  234. package/js/components/suggestions/{base-suggestion2.vue.js → base-suggestion.vue2.js} +1 -1
  235. package/js/components/suggestions/{base-suggestion2.vue.js.map → base-suggestion.vue2.js.map} +1 -1
  236. package/js/components/suggestions/base-suggestions.vue.js +2 -2
  237. package/js/components/suggestions/{base-suggestions2.vue.js → base-suggestions.vue2.js} +1 -1
  238. package/js/components/suggestions/{base-suggestions2.vue.js.map → base-suggestions.vue2.js.map} +1 -1
  239. package/js/components/suggestions/{base-suggestions3.vue.js → base-suggestions.vue3.js} +1 -1
  240. package/js/components/suggestions/base-suggestions.vue3.js.map +1 -0
  241. package/js/index.js +3 -3
  242. package/js/x-modules/ai/components/ai-carousel.vue.js +2 -2
  243. package/js/x-modules/ai/components/{ai-carousel2.vue.js → ai-carousel.vue2.js} +75 -75
  244. package/js/x-modules/ai/components/{ai-carousel2.vue.js.map → ai-carousel.vue2.js.map} +1 -1
  245. package/js/x-modules/ai/components/{ai-carousel3.vue.js → ai-carousel.vue3.js} +1 -1
  246. package/js/x-modules/ai/components/ai-carousel.vue3.js.map +1 -0
  247. package/js/x-modules/ai/components/ai-grouped-carousel.vue.js +1 -1
  248. package/js/x-modules/ai/components/ai-grouped-carousel.vue2.js +123 -0
  249. package/js/x-modules/ai/components/{ai-grouped-carousel2.vue.js.map → ai-grouped-carousel.vue2.js.map} +1 -1
  250. package/js/x-modules/device/components/device-detector.vue.js +1 -1
  251. package/js/x-modules/device/components/{device-detector2.vue.js → device-detector.vue2.js} +1 -1
  252. package/js/x-modules/device/components/{device-detector2.vue.js.map → device-detector.vue2.js.map} +1 -1
  253. package/js/x-modules/empathize/components/empathize.vue.js +1 -1
  254. package/js/x-modules/empathize/components/{empathize2.vue.js → empathize.vue2.js} +82 -82
  255. package/js/x-modules/empathize/components/{empathize2.vue.js.map → empathize.vue2.js.map} +1 -1
  256. package/js/x-modules/experience-controls/components/{experience-controls2.vue.js → experience-controls.vue2.js} +1 -1
  257. package/js/x-modules/experience-controls/components/experience-controls.vue2.js.map +1 -0
  258. package/js/x-modules/extra-params/components/{extra-params2.vue.js → extra-params.vue2.js} +1 -1
  259. package/js/x-modules/extra-params/components/extra-params.vue2.js.map +1 -0
  260. package/js/x-modules/extra-params/components/{renderless-extra-param2.vue.js → renderless-extra-param.vue2.js} +1 -1
  261. package/js/x-modules/extra-params/components/renderless-extra-param.vue2.js.map +1 -0
  262. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js +1 -1
  263. package/js/x-modules/extra-params/components/{snippet-config-extra-params2.vue.js → snippet-config-extra-params.vue2.js} +1 -1
  264. package/js/x-modules/extra-params/components/{snippet-config-extra-params2.vue.js.map → snippet-config-extra-params.vue2.js.map} +1 -1
  265. package/js/x-modules/facets/components/clear-filters.vue.js +1 -1
  266. package/js/x-modules/facets/components/{clear-filters2.vue.js → clear-filters.vue2.js} +1 -1
  267. package/js/x-modules/facets/components/{clear-filters2.vue.js.map → clear-filters.vue2.js.map} +1 -1
  268. package/js/x-modules/facets/components/facets/facets-provider.vue.js +2 -2
  269. package/js/x-modules/facets/components/facets/{facets-provider2.vue.js → facets-provider.vue2.js} +1 -1
  270. package/js/x-modules/facets/components/facets/{facets-provider2.vue.js.map → facets-provider.vue2.js.map} +1 -1
  271. package/js/x-modules/facets/components/facets/{facets-provider3.vue.js → facets-provider.vue3.js} +1 -1
  272. package/js/x-modules/facets/components/facets/facets-provider.vue3.js.map +1 -0
  273. package/js/x-modules/facets/components/facets/facets.vue.js +2 -2
  274. package/js/x-modules/facets/components/facets/{facets2.vue.js → facets.vue2.js} +1 -1
  275. package/js/x-modules/facets/components/facets/{facets2.vue.js.map → facets.vue2.js.map} +1 -1
  276. package/js/x-modules/facets/components/facets/{facets3.vue.js → facets.vue3.js} +1 -1
  277. package/js/x-modules/{extra-params/components/extra-params2.vue.js.map → facets/components/facets/facets.vue3.js.map} +1 -1
  278. package/js/x-modules/facets/components/filters/all-filter.vue.js +1 -1
  279. package/js/x-modules/facets/components/filters/{all-filter2.vue.js → all-filter.vue2.js} +1 -1
  280. package/js/x-modules/facets/components/filters/{all-filter2.vue.js.map → all-filter.vue2.js.map} +1 -1
  281. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +2 -2
  282. package/js/x-modules/facets/components/filters/{editable-number-range-filter2.vue.js → editable-number-range-filter.vue2.js} +1 -1
  283. package/js/x-modules/facets/components/filters/{editable-number-range-filter2.vue.js.map → editable-number-range-filter.vue2.js.map} +1 -1
  284. package/js/x-modules/facets/components/filters/{editable-number-range-filter3.vue.js → editable-number-range-filter.vue3.js} +1 -1
  285. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue3.js.map +1 -0
  286. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js +1 -1
  287. package/js/x-modules/facets/components/filters/{hierarchical-filter2.vue.js → hierarchical-filter.vue2.js} +1 -1
  288. package/js/x-modules/facets/components/filters/{hierarchical-filter2.vue.js.map → hierarchical-filter.vue2.js.map} +1 -1
  289. package/js/x-modules/facets/components/filters/number-range-filter.vue.js +1 -1
  290. package/js/x-modules/facets/components/filters/{number-range-filter2.vue.js → number-range-filter.vue2.js} +1 -1
  291. package/js/x-modules/facets/components/filters/{number-range-filter2.vue.js.map → number-range-filter.vue2.js.map} +1 -1
  292. package/js/x-modules/facets/components/filters/{renderless-filter2.vue.js → renderless-filter.vue2.js} +1 -1
  293. package/js/x-modules/facets/components/filters/renderless-filter.vue2.js.map +1 -0
  294. package/js/x-modules/facets/components/filters/simple-filter.vue.js +1 -1
  295. package/js/x-modules/facets/components/filters/{simple-filter2.vue.js → simple-filter.vue2.js} +1 -1
  296. package/js/x-modules/facets/components/filters/{simple-filter2.vue.js.map → simple-filter.vue2.js.map} +1 -1
  297. package/js/x-modules/facets/components/lists/{exclude-filters-with-no-results2.vue.js → exclude-filters-with-no-results.vue2.js} +1 -1
  298. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue2.js.map +1 -0
  299. package/js/x-modules/facets/components/lists/filters-list.vue.js +2 -2
  300. package/js/x-modules/facets/components/lists/{filters-list2.vue.js → filters-list.vue2.js} +1 -1
  301. package/js/x-modules/facets/components/lists/{filters-list2.vue.js.map → filters-list.vue2.js.map} +1 -1
  302. package/js/x-modules/facets/components/lists/{filters-list3.vue.js → filters-list.vue3.js} +1 -1
  303. package/js/x-modules/facets/components/lists/filters-list.vue3.js.map +1 -0
  304. package/js/x-modules/facets/components/lists/filters-search.vue.js +2 -2
  305. package/js/x-modules/facets/components/lists/{filters-search2.vue.js → filters-search.vue2.js} +1 -1
  306. package/js/x-modules/facets/components/lists/{filters-search2.vue.js.map → filters-search.vue2.js.map} +1 -1
  307. package/js/x-modules/facets/components/lists/{filters-search3.vue.js → filters-search.vue3.js} +1 -1
  308. package/js/x-modules/facets/components/lists/filters-search.vue3.js.map +1 -0
  309. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js +1 -1
  310. package/js/x-modules/facets/components/lists/{selected-filters-list2.vue.js → selected-filters-list.vue2.js} +1 -1
  311. package/js/x-modules/facets/components/lists/{selected-filters-list2.vue.js.map → selected-filters-list.vue2.js.map} +1 -1
  312. package/js/x-modules/facets/components/lists/{selected-filters2.vue.js → selected-filters.vue2.js} +1 -1
  313. package/js/x-modules/facets/components/lists/selected-filters.vue2.js.map +1 -0
  314. package/js/x-modules/facets/components/lists/sliced-filters.vue.js +1 -1
  315. package/js/x-modules/facets/components/lists/{sliced-filters2.vue.js → sliced-filters.vue2.js} +1 -1
  316. package/js/x-modules/facets/components/lists/{sliced-filters2.vue.js.map → sliced-filters.vue2.js.map} +1 -1
  317. package/js/x-modules/facets/components/lists/{sorted-filters2.vue.js → sorted-filters.vue2.js} +1 -1
  318. package/js/x-modules/facets/components/lists/sorted-filters.vue2.js.map +1 -0
  319. package/js/x-modules/facets/components/{preselected-filters2.vue.js → preselected-filters.vue2.js} +1 -1
  320. package/js/x-modules/facets/components/preselected-filters.vue2.js.map +1 -0
  321. package/js/x-modules/history-queries/components/clear-history-queries.vue.js +1 -1
  322. package/js/x-modules/history-queries/components/{clear-history-queries2.vue.js → clear-history-queries.vue2.js} +1 -1
  323. package/js/x-modules/history-queries/components/{clear-history-queries2.vue.js.map → clear-history-queries.vue2.js.map} +1 -1
  324. package/js/x-modules/history-queries/components/history-queries-switch.vue.js +1 -1
  325. package/js/x-modules/history-queries/components/{history-queries-switch2.vue.js → history-queries-switch.vue2.js} +1 -1
  326. package/js/x-modules/history-queries/components/{history-queries-switch2.vue.js.map → history-queries-switch.vue2.js.map} +1 -1
  327. package/js/x-modules/history-queries/components/history-queries.vue.js +1 -1
  328. package/js/x-modules/history-queries/components/{history-queries2.vue.js → history-queries.vue2.js} +1 -1
  329. package/js/x-modules/history-queries/components/{history-queries2.vue.js.map → history-queries.vue2.js.map} +1 -1
  330. package/js/x-modules/history-queries/components/history-query.vue.js +1 -1
  331. package/js/x-modules/history-queries/components/{history-query2.vue.js → history-query.vue2.js} +1 -1
  332. package/js/x-modules/history-queries/components/{history-query2.vue.js.map → history-query.vue2.js.map} +1 -1
  333. package/js/x-modules/history-queries/components/my-history.vue.js +2 -2
  334. package/js/x-modules/history-queries/components/{my-history2.vue.js → my-history.vue2.js} +1 -1
  335. package/js/x-modules/history-queries/components/{my-history2.vue.js.map → my-history.vue2.js.map} +1 -1
  336. package/js/x-modules/history-queries/components/{my-history3.vue.js → my-history.vue3.js} +1 -1
  337. package/js/x-modules/history-queries/components/my-history.vue3.js.map +1 -0
  338. package/js/x-modules/history-queries/components/remove-history-query.vue.js +1 -1
  339. package/js/x-modules/history-queries/components/{remove-history-query2.vue.js → remove-history-query.vue2.js} +1 -1
  340. package/js/x-modules/history-queries/components/{remove-history-query2.vue.js.map → remove-history-query.vue2.js.map} +1 -1
  341. package/js/x-modules/identifier-results/components/identifier-result.vue.js +1 -1
  342. package/js/x-modules/identifier-results/components/{identifier-result2.vue.js → identifier-result.vue2.js} +1 -1
  343. package/js/x-modules/identifier-results/components/{identifier-result2.vue.js.map → identifier-result.vue2.js.map} +1 -1
  344. package/js/x-modules/identifier-results/components/identifier-results.vue.js +2 -2
  345. package/js/x-modules/identifier-results/components/{identifier-results2.vue.js → identifier-results.vue2.js} +1 -1
  346. package/js/x-modules/identifier-results/components/{identifier-results2.vue.js.map → identifier-results.vue2.js.map} +1 -1
  347. package/js/x-modules/identifier-results/components/{identifier-results3.vue.js → identifier-results.vue3.js} +1 -1
  348. package/js/x-modules/identifier-results/components/identifier-results.vue3.js.map +1 -0
  349. package/js/x-modules/next-queries/components/{next-queries-list2.vue.js → next-queries-list.vue2.js} +1 -1
  350. package/js/x-modules/next-queries/components/next-queries-list.vue2.js.map +1 -0
  351. package/js/x-modules/next-queries/components/next-queries.vue.js +1 -1
  352. package/js/x-modules/next-queries/components/{next-queries2.vue.js → next-queries.vue2.js} +1 -1
  353. package/js/x-modules/next-queries/components/{next-queries2.vue.js.map → next-queries.vue2.js.map} +1 -1
  354. package/js/x-modules/next-queries/components/next-query-preview.vue.js +1 -1
  355. package/js/x-modules/next-queries/components/{next-query-preview2.vue.js → next-query-preview.vue2.js} +1 -1
  356. package/js/x-modules/next-queries/components/{next-query-preview2.vue.js.map → next-query-preview.vue2.js.map} +1 -1
  357. package/js/x-modules/next-queries/components/next-query.vue.js +1 -1
  358. package/js/x-modules/next-queries/components/{next-query2.vue.js → next-query.vue2.js} +1 -1
  359. package/js/x-modules/next-queries/components/{next-query2.vue.js.map → next-query.vue2.js.map} +1 -1
  360. package/js/x-modules/popular-searches/components/popular-search.vue.js +1 -1
  361. package/js/x-modules/popular-searches/components/{popular-search2.vue.js → popular-search.vue2.js} +1 -1
  362. package/js/x-modules/popular-searches/components/{popular-search2.vue.js.map → popular-search.vue2.js.map} +1 -1
  363. package/js/x-modules/popular-searches/components/popular-searches.vue.js +1 -1
  364. package/js/x-modules/popular-searches/components/{popular-searches2.vue.js → popular-searches.vue2.js} +1 -1
  365. package/js/x-modules/popular-searches/components/{popular-searches2.vue.js.map → popular-searches.vue2.js.map} +1 -1
  366. package/js/x-modules/queries-preview/components/query-preview-button.vue.js +1 -1
  367. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +165 -0
  368. package/js/x-modules/queries-preview/components/{query-preview-button2.vue.js.map → query-preview-button.vue2.js.map} +1 -1
  369. package/js/x-modules/queries-preview/components/query-preview-list.vue.js +2 -2
  370. package/js/x-modules/queries-preview/components/{query-preview-list2.vue.js → query-preview-list.vue2.js} +1 -1
  371. package/js/x-modules/queries-preview/components/{query-preview-list2.vue.js.map → query-preview-list.vue2.js.map} +1 -1
  372. package/js/x-modules/queries-preview/components/{query-preview-list3.vue.js → query-preview-list.vue3.js} +1 -1
  373. package/js/x-modules/queries-preview/components/query-preview-list.vue3.js.map +1 -0
  374. package/js/x-modules/queries-preview/components/query-preview.vue.js +1 -1
  375. package/js/x-modules/queries-preview/components/{query-preview2.vue.js → query-preview.vue2.js} +82 -82
  376. package/js/x-modules/queries-preview/components/{query-preview2.vue.js.map → query-preview.vue2.js.map} +1 -1
  377. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js +1 -1
  378. package/js/x-modules/query-suggestions/components/{query-suggestion2.vue.js → query-suggestion.vue2.js} +1 -1
  379. package/js/x-modules/query-suggestions/components/{query-suggestion2.vue.js.map → query-suggestion.vue2.js.map} +1 -1
  380. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js +1 -1
  381. package/js/x-modules/query-suggestions/components/{query-suggestions2.vue.js → query-suggestions.vue2.js} +1 -1
  382. package/js/x-modules/query-suggestions/components/{query-suggestions2.vue.js.map → query-suggestions.vue2.js.map} +1 -1
  383. package/js/x-modules/recommendations/components/recommendations.vue.js +2 -2
  384. package/js/x-modules/recommendations/components/{recommendations2.vue.js → recommendations.vue2.js} +1 -1
  385. package/js/x-modules/recommendations/components/{recommendations2.vue.js.map → recommendations.vue2.js.map} +1 -1
  386. package/js/x-modules/recommendations/components/{recommendations3.vue.js → recommendations.vue3.js} +1 -1
  387. package/js/x-modules/recommendations/components/recommendations.vue3.js.map +1 -0
  388. package/js/x-modules/related-prompts/components/related-prompt.vue.js +2 -2
  389. package/js/x-modules/related-prompts/components/{related-prompt2.vue.js → related-prompt.vue2.js} +1 -1
  390. package/js/x-modules/related-prompts/components/{related-prompt2.vue.js.map → related-prompt.vue2.js.map} +1 -1
  391. package/js/x-modules/related-prompts/components/{related-prompt3.vue.js → related-prompt.vue3.js} +1 -1
  392. package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
  393. package/js/x-modules/related-prompts/components/{related-prompts-list2.vue.js → related-prompts-list.vue2.js} +1 -1
  394. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js.map +1 -0
  395. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +2 -2
  396. package/js/x-modules/related-prompts/components/{related-prompts-tag-list2.vue.js → related-prompts-tag-list.vue2.js} +1 -1
  397. package/js/x-modules/related-prompts/components/{related-prompts-tag-list2.vue.js.map → related-prompts-tag-list.vue2.js.map} +1 -1
  398. package/js/x-modules/related-prompts/components/{related-prompts-tag-list3.vue.js → related-prompts-tag-list.vue3.js} +1 -1
  399. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js.map +1 -0
  400. package/js/x-modules/related-tags/components/related-tag.vue.js +1 -1
  401. package/js/x-modules/related-tags/components/{related-tag2.vue.js → related-tag.vue2.js} +1 -1
  402. package/js/x-modules/related-tags/components/{related-tag2.vue.js.map → related-tag.vue2.js.map} +1 -1
  403. package/js/x-modules/related-tags/components/related-tags.vue.js +2 -2
  404. package/js/x-modules/related-tags/components/{related-tags2.vue.js → related-tags.vue2.js} +1 -1
  405. package/js/x-modules/related-tags/components/{related-tags2.vue.js.map → related-tags.vue2.js.map} +1 -1
  406. package/js/x-modules/related-tags/components/{related-tags3.vue.js → related-tags.vue3.js} +1 -1
  407. package/js/x-modules/related-tags/components/related-tags.vue3.js.map +1 -0
  408. package/js/x-modules/scroll/components/main-scroll-item.vue.js +1 -1
  409. package/js/x-modules/scroll/components/{main-scroll-item2.vue.js → main-scroll-item.vue2.js} +1 -1
  410. package/js/x-modules/scroll/components/{main-scroll-item2.vue.js.map → main-scroll-item.vue2.js.map} +1 -1
  411. package/js/x-modules/scroll/components/{main-scroll2.vue.js → main-scroll.vue2.js} +1 -1
  412. package/js/x-modules/scroll/components/main-scroll.vue2.js.map +1 -0
  413. package/js/x-modules/scroll/components/scroll-to-top.vue.js +1 -1
  414. package/js/x-modules/scroll/components/{scroll-to-top2.vue.js → scroll-to-top.vue2.js} +81 -81
  415. package/js/x-modules/scroll/components/{scroll-to-top2.vue.js.map → scroll-to-top.vue2.js.map} +1 -1
  416. package/js/x-modules/scroll/components/scroll.vue.js +1 -1
  417. package/js/x-modules/scroll/components/{scroll2.vue.js → scroll.vue2.js} +1 -1
  418. package/js/x-modules/scroll/components/{scroll2.vue.js.map → scroll.vue2.js.map} +1 -1
  419. package/js/x-modules/search/components/banner.vue.js +2 -2
  420. package/js/x-modules/search/components/{banner2.vue.js → banner.vue2.js} +1 -1
  421. package/js/x-modules/search/components/{banner2.vue.js.map → banner.vue2.js.map} +1 -1
  422. package/js/x-modules/search/components/{banner3.vue.js → banner.vue3.js} +1 -1
  423. package/js/x-modules/search/components/banner.vue3.js.map +1 -0
  424. package/js/x-modules/search/components/{banners-list2.vue.js → banners-list.vue2.js} +1 -1
  425. package/js/x-modules/search/components/banners-list.vue2.js.map +1 -0
  426. package/js/x-modules/search/components/fallback-disclaimer.vue.js +1 -1
  427. package/js/x-modules/search/components/{fallback-disclaimer2.vue.js → fallback-disclaimer.vue2.js} +1 -1
  428. package/js/x-modules/search/components/{fallback-disclaimer2.vue.js.map → fallback-disclaimer.vue2.js.map} +1 -1
  429. package/js/x-modules/search/components/partial-query-button.vue.js +1 -1
  430. package/js/x-modules/search/components/{partial-query-button2.vue.js → partial-query-button.vue2.js} +1 -1
  431. package/js/x-modules/search/components/{partial-query-button2.vue.js.map → partial-query-button.vue2.js.map} +1 -1
  432. package/js/x-modules/search/components/partial-results-list.vue.js +2 -2
  433. package/js/x-modules/search/components/{partial-results-list2.vue.js → partial-results-list.vue2.js} +1 -1
  434. package/js/x-modules/search/components/{partial-results-list2.vue.js.map → partial-results-list.vue2.js.map} +1 -1
  435. package/js/x-modules/search/components/{partial-results-list3.vue.js → partial-results-list.vue3.js} +1 -1
  436. package/js/x-modules/search/components/partial-results-list.vue3.js.map +1 -0
  437. package/js/x-modules/search/components/promoted.vue.js +2 -2
  438. package/js/x-modules/search/components/{promoted2.vue.js → promoted.vue2.js} +1 -1
  439. package/js/x-modules/search/components/{promoted2.vue.js.map → promoted.vue2.js.map} +1 -1
  440. package/js/x-modules/search/components/{promoted3.vue.js → promoted.vue3.js} +1 -1
  441. package/js/x-modules/search/components/promoted.vue3.js.map +1 -0
  442. package/js/x-modules/search/components/{promoteds-list2.vue.js → promoteds-list.vue2.js} +1 -1
  443. package/js/x-modules/search/components/promoteds-list.vue2.js.map +1 -0
  444. package/js/x-modules/search/components/redirection.vue.js +1 -1
  445. package/js/x-modules/search/components/{redirection2.vue.js → redirection.vue2.js} +1 -1
  446. package/js/x-modules/search/components/{redirection2.vue.js.map → redirection.vue2.js.map} +1 -1
  447. package/js/x-modules/search/components/{results-list2.vue.js → results-list.vue2.js} +1 -1
  448. package/js/x-modules/search/components/results-list.vue2.js.map +1 -0
  449. package/js/x-modules/search/components/sort-dropdown.vue.js +1 -1
  450. package/js/x-modules/search/components/{sort-dropdown2.vue.js → sort-dropdown.vue2.js} +1 -1
  451. package/js/x-modules/search/components/{sort-dropdown2.vue.js.map → sort-dropdown.vue2.js.map} +1 -1
  452. package/js/x-modules/search/components/sort-list.vue.js +2 -2
  453. package/js/x-modules/search/components/{sort-list2.vue.js → sort-list.vue2.js} +1 -1
  454. package/js/x-modules/search/components/{sort-list2.vue.js.map → sort-list.vue2.js.map} +1 -1
  455. package/js/x-modules/search/components/{sort-list3.vue.js → sort-list.vue3.js} +1 -1
  456. package/js/x-modules/search/components/sort-list.vue3.js.map +1 -0
  457. package/js/x-modules/search/components/sort-picker-list.vue.js +1 -1
  458. package/js/x-modules/search/components/{sort-picker-list2.vue.js → sort-picker-list.vue2.js} +1 -1
  459. package/js/x-modules/search/components/{sort-picker-list2.vue.js.map → sort-picker-list.vue2.js.map} +1 -1
  460. package/js/x-modules/search/components/spellcheck-button.vue.js +1 -1
  461. package/js/x-modules/search/components/{spellcheck-button2.vue.js → spellcheck-button.vue2.js} +1 -1
  462. package/js/x-modules/search/components/{spellcheck-button2.vue.js.map → spellcheck-button.vue2.js.map} +1 -1
  463. package/js/x-modules/search/components/spellcheck.vue.js +1 -1
  464. package/js/x-modules/search/components/{spellcheck2.vue.js → spellcheck.vue2.js} +1 -1
  465. package/js/x-modules/search/components/{spellcheck2.vue.js.map → spellcheck.vue2.js.map} +1 -1
  466. package/js/x-modules/search-box/components/clear-search-input.vue.js +1 -1
  467. package/js/x-modules/search-box/components/{clear-search-input2.vue.js → clear-search-input.vue2.js} +1 -1
  468. package/js/x-modules/search-box/components/{clear-search-input2.vue.js.map → clear-search-input.vue2.js.map} +1 -1
  469. package/js/x-modules/search-box/components/search-button.vue.js +1 -1
  470. package/js/x-modules/search-box/components/{search-button2.vue.js → search-button.vue2.js} +1 -1
  471. package/js/x-modules/search-box/components/{search-button2.vue.js.map → search-button.vue2.js.map} +1 -1
  472. package/js/x-modules/search-box/components/search-input-placeholder.vue.js +3 -3
  473. package/js/x-modules/search-box/components/{search-input-placeholder2.vue.js → search-input-placeholder.vue2.js} +2 -2
  474. package/js/x-modules/search-box/components/{search-input-placeholder2.vue.js.map → search-input-placeholder.vue2.js.map} +1 -1
  475. package/js/x-modules/search-box/components/{search-input-placeholder3.vue.js → search-input-placeholder.vue3.js} +1 -1
  476. package/js/x-modules/search-box/components/search-input-placeholder.vue3.js.map +1 -0
  477. package/js/x-modules/search-box/components/{search-input-placeholder4.vue.js → search-input-placeholder.vue4.js} +1 -1
  478. package/js/x-modules/search-box/components/search-input-placeholder.vue4.js.map +1 -0
  479. package/js/x-modules/search-box/components/search-input.vue.js +2 -2
  480. package/js/x-modules/search-box/components/{search-input2.vue.js → search-input.vue2.js} +1 -1
  481. package/js/x-modules/search-box/components/{search-input2.vue.js.map → search-input.vue2.js.map} +1 -1
  482. package/js/x-modules/search-box/components/{search-input3.vue.js → search-input.vue3.js} +1 -1
  483. package/js/x-modules/search-box/components/search-input.vue3.js.map +1 -0
  484. package/js/x-modules/semantic-queries/components/semantic-queries.vue.js +1 -1
  485. package/js/x-modules/semantic-queries/components/{semantic-queries2.vue.js → semantic-queries.vue2.js} +1 -1
  486. package/js/x-modules/semantic-queries/components/{semantic-queries2.vue.js.map → semantic-queries.vue2.js.map} +1 -1
  487. package/js/x-modules/semantic-queries/components/semantic-query.vue.js +1 -1
  488. package/js/x-modules/semantic-queries/components/{semantic-query2.vue.js → semantic-query.vue2.js} +1 -1
  489. package/js/x-modules/semantic-queries/components/{semantic-query2.vue.js.map → semantic-query.vue2.js.map} +1 -1
  490. package/js/x-modules/tagging/components/{tagging2.vue.js → tagging.vue2.js} +1 -1
  491. package/js/x-modules/tagging/components/tagging.vue2.js.map +1 -0
  492. package/js/x-modules/url/components/url-handler.vue.js +1 -1
  493. package/js/x-modules/url/components/{url-handler2.vue.js → url-handler.vue2.js} +1 -1
  494. package/js/x-modules/url/components/{url-handler2.vue.js.map → url-handler.vue2.js.map} +1 -1
  495. package/package.json +3 -3
  496. package/js/components/animations/animate-clip-path2.vue.js.map +0 -1
  497. package/js/components/animations/animate-clip-path3.vue.js +0 -7
  498. package/js/components/animations/animate-clip-path3.vue.js.map +0 -1
  499. package/js/components/animations/animate-scale2.vue.js.map +0 -1
  500. package/js/components/animations/animate-scale3.vue.js.map +0 -1
  501. package/js/components/animations/animate-translate2.vue.js.map +0 -1
  502. package/js/components/animations/animate-translate3.vue.js +0 -7
  503. package/js/components/animations/animate-translate3.vue.js.map +0 -1
  504. package/js/components/animations/animate-width3.vue.js.map +0 -1
  505. package/js/components/animations/change-height3.vue.js.map +0 -1
  506. package/js/components/animations/collapse-height3.vue.js.map +0 -1
  507. package/js/components/animations/collapse-width3.vue.js.map +0 -1
  508. package/js/components/animations/cross-fade3.vue.js.map +0 -1
  509. package/js/components/animations/fade-and-slide3.vue.js.map +0 -1
  510. package/js/components/animations/fade3.vue.js.map +0 -1
  511. package/js/components/animations/no-animation2.vue.js.map +0 -1
  512. package/js/components/animations/staggered-fade-and-slide3.vue.js.map +0 -1
  513. package/js/components/auto-progress-bar3.vue.js.map +0 -1
  514. package/js/components/base-dropdown3.vue.js.map +0 -1
  515. package/js/components/base-grid3.vue.js.map +0 -1
  516. package/js/components/base-rating3.vue.js.map +0 -1
  517. package/js/components/base-slider3.vue.js.map +0 -1
  518. package/js/components/base-switch3.vue.js.map +0 -1
  519. package/js/components/display-click-provider2.vue.js.map +0 -1
  520. package/js/components/display-emitter2.vue.js.map +0 -1
  521. package/js/components/filters/labels/base-price-filter-label2.vue.js.map +0 -1
  522. package/js/components/global-x-bus2.vue.js.map +0 -1
  523. package/js/components/location-provider2.vue.js.map +0 -1
  524. package/js/components/message2.vue.js.map +0 -1
  525. package/js/components/modals/base-modal3.vue.js.map +0 -1
  526. package/js/components/page-loader-button3.vue.js.map +0 -1
  527. package/js/components/page-selector3.vue.js.map +0 -1
  528. package/js/components/panels/base-header-toggle-panel3.vue.js.map +0 -1
  529. package/js/components/panels/base-tabs-panel3.vue.js.map +0 -1
  530. package/js/components/result/base-result-image3.vue.js.map +0 -1
  531. package/js/components/result/base-result-link3.vue.js.map +0 -1
  532. package/js/components/result/base-result-rating3.vue.js.map +0 -1
  533. package/js/components/result/result-variant-selector3.vue.js.map +0 -1
  534. package/js/components/result/result-variants-provider2.vue.js.map +0 -1
  535. package/js/components/sliding-panel3.vue.js.map +0 -1
  536. package/js/components/suggestions/base-suggestions3.vue.js.map +0 -1
  537. package/js/x-modules/ai/components/ai-carousel3.vue.js.map +0 -1
  538. package/js/x-modules/ai/components/ai-grouped-carousel2.vue.js +0 -123
  539. package/js/x-modules/experience-controls/components/experience-controls2.vue.js.map +0 -1
  540. package/js/x-modules/extra-params/components/renderless-extra-param2.vue.js.map +0 -1
  541. package/js/x-modules/facets/components/facets/facets-provider3.vue.js.map +0 -1
  542. package/js/x-modules/facets/components/facets/facets3.vue.js.map +0 -1
  543. package/js/x-modules/facets/components/filters/editable-number-range-filter3.vue.js.map +0 -1
  544. package/js/x-modules/facets/components/filters/renderless-filter2.vue.js.map +0 -1
  545. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results2.vue.js.map +0 -1
  546. package/js/x-modules/facets/components/lists/filters-list3.vue.js.map +0 -1
  547. package/js/x-modules/facets/components/lists/filters-search3.vue.js.map +0 -1
  548. package/js/x-modules/facets/components/lists/selected-filters2.vue.js.map +0 -1
  549. package/js/x-modules/facets/components/lists/sorted-filters2.vue.js.map +0 -1
  550. package/js/x-modules/facets/components/preselected-filters2.vue.js.map +0 -1
  551. package/js/x-modules/history-queries/components/my-history3.vue.js.map +0 -1
  552. package/js/x-modules/identifier-results/components/identifier-results3.vue.js.map +0 -1
  553. package/js/x-modules/next-queries/components/next-queries-list2.vue.js.map +0 -1
  554. package/js/x-modules/queries-preview/components/query-preview-button2.vue.js +0 -165
  555. package/js/x-modules/queries-preview/components/query-preview-list3.vue.js.map +0 -1
  556. package/js/x-modules/recommendations/components/recommendations3.vue.js.map +0 -1
  557. package/js/x-modules/related-prompts/components/related-prompt3.vue.js.map +0 -1
  558. package/js/x-modules/related-prompts/components/related-prompts-list2.vue.js.map +0 -1
  559. package/js/x-modules/related-prompts/components/related-prompts-tag-list3.vue.js.map +0 -1
  560. package/js/x-modules/related-tags/components/related-tags3.vue.js.map +0 -1
  561. package/js/x-modules/scroll/components/main-scroll2.vue.js.map +0 -1
  562. package/js/x-modules/search/components/banner3.vue.js.map +0 -1
  563. package/js/x-modules/search/components/banners-list2.vue.js.map +0 -1
  564. package/js/x-modules/search/components/partial-results-list3.vue.js.map +0 -1
  565. package/js/x-modules/search/components/promoted3.vue.js.map +0 -1
  566. package/js/x-modules/search/components/promoteds-list2.vue.js.map +0 -1
  567. package/js/x-modules/search/components/results-list2.vue.js.map +0 -1
  568. package/js/x-modules/search/components/sort-list3.vue.js.map +0 -1
  569. package/js/x-modules/search-box/components/search-input-placeholder3.vue.js.map +0 -1
  570. package/js/x-modules/search-box/components/search-input-placeholder4.vue.js.map +0 -1
  571. package/js/x-modules/search-box/components/search-input3.vue.js.map +0 -1
  572. package/js/x-modules/tagging/components/tagging2.vue.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"facets2.vue.js","sources":["../../../../../../src/x-modules/facets/components/facets/facets.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"hasFacets\" class=\"x-facets-list\" data-test=\"facets\" tag=\"ul\">\n <li\n v-for=\"({ facet, slotNameById, slotNameByModelName }, facetId) in mappedFacets\"\n :key=\"facetId\"\n class=\"x-facets-list__item\"\n data-test=\"facets-facet\"\n >\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's name will result in the\n facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-if=\"hasSlot(slotNameById)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || [],\n }\"\n :name=\"slotNameById\"\n />\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's modelName will result\n in the facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else-if=\"hasSlot(slotNameByModelName)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || [],\n }\"\n :name=\"slotNameByModelName\"\n />\n <!--\n @slot (required) Default Facet rendering. This slot will be used by default for rendering\n the facets without an specific slot implementation.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || [],\n }\"\n >\n This is the {{ facet.label }} facet. Pass something into its slot to display content.\n </slot>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Facet } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { RenderFacet } from './facets.types'\nimport { map, objectFilter } from '@empathyco/x-utils'\nimport { computed, defineComponent } from 'vue'\nimport { useGetter } from '../../../../composables/use-getter'\nimport { AnimationProp } from '../../../../types'\nimport { toKebabCase } from '../../../../utils/string'\nimport { useFacets } from '../../composables/use-facets'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * This component renders the list of facets stored in the Facets module. Facets can be rendered\n * differently based on their purpose and this can be achieved using the exposed slots:\n * - A default and required slot.\n * - A custom slot for each facet with the facetId as its name. This allows each facet to be\n * rendered differently based on its needs.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Facets',\n xModule: facetsXModule.name,\n props: {\n /** Array of facets ids used to get the selected filters for those facets. */\n facetsIds: Array as PropType<Array<Facet['id']>>,\n /** Flag to render the component even if there are no filters selected. */\n alwaysVisible: Boolean,\n /** Animation component that will be used to animate the facets. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n /**\n * Discriminates the facets rendered by this component. It expects a string containing facets\n * ids, comma separated. This property will include or exclude facets based on its value.\n * The default value is an empty string and the component will render all existing facets.\n *\n * @remarks\n * To behave as a `include`, simply set the facets ids, comma separated:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"brand, category\"`\n *\n * The component will render brand and category facets.\n *\n * On the other hand, to simulate an `exclude` behaviour and exclude a facet from being\n * rendered, append a '!' before its id:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"!brand,!price\"`\n *\n * The component will render category and color facets.\n */\n renderableFacets: String,\n },\n setup(props, { slots }) {\n const { selectedFiltersByFacet } = useFacets(props)\n const { facets } = useGetter('facets')\n\n /**\n * The facets to be rendered after filtering {@link Facets.facets} by\n * {@link Facets.renderableFacets} content.\n *\n * @returns The list of facets to be rendered.\n */\n const facetsToRender = computed<Dictionary<Facet>>(() => {\n if (!props.renderableFacets) {\n return facets.value\n } else {\n const excludedRegExp = /^!/\n const facetIds: string[] = props.renderableFacets.split(',').map(facetId => facetId.trim())\n const included: string[] = []\n const excluded: string[] = []\n facetIds.forEach(facetId => {\n if (excludedRegExp.test(facetId)) {\n excluded.push(facetId.replace(excludedRegExp, ''))\n } else {\n included.push(facetId)\n }\n })\n\n return filterFacetsToRender(included, excluded)\n }\n })\n\n /**\n * Transforms a dictionary of Facets including the slot name.\n *\n * @returns A dictionary of facets with the slot name.\n */\n const mappedFacets = computed<Dictionary<RenderFacet>>(() => {\n return map(facetsToRender.value, (facetId, facet) => ({\n slotNameById: toKebabCase(facetId),\n slotNameByModelName: toKebabCase(facet.modelName),\n facet,\n }))\n })\n\n /**\n * Indicates if there are facets available to show.\n *\n * @returns True if there are facets available and false otherwise.\n */\n const hasFacets = computed<boolean>(() => !!Object.keys(facetsToRender.value).length)\n\n /**\n * Filter facets dictionary retrieving those included and/or removing excluded.\n *\n * @param included - List of facets to render.\n * @param excluded - List of not renderable facets.\n *\n * @returns The filtered list of facets to render.\n */\n function filterFacetsToRender(included: string[], excluded: string[]): Dictionary<Facet> {\n const hasAnyFacetIncluded = included.length > 0\n return objectFilter(facets.value, facetKey => {\n const isIncluded = included.includes(String(facetKey))\n const isExcluded = excluded.includes(String(facetKey))\n\n return hasAnyFacetIncluded ? isIncluded && !isExcluded : !isExcluded\n })\n }\n\n /**\n * Whether the slot is present in the template or not.\n *\n * @param name - The slot name.\n *\n * @returns True is the slot is present in the template. False otherwise.\n */\n function hasSlot(name: string): boolean {\n return !!slots[name]\n }\n\n return {\n selectedFiltersByFacet,\n hasFacets,\n mappedFacets,\n hasSlot,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-facets-list {\n display: flex;\n flex-flow: column nowrap;\n list-style-type: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders the list of facets stored in the Facets module. Facets can be rendered\ndifferently based on their purpose and this can be achieved using the exposed slots:\n\n- A default and required slot.\n- A custom slot for each facet with the facetId as its name. This allows each facet to be rendered\n differently based on its needs.\n\nBelow, there are some examples showing how to use the component with its different configurations.\n\n### Default usage\n\nThe default slot of this component is mandatory. If no other slot is defined, every Facet will be\nrendered as specified in the default slot.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ facet.label }}</h1>\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} selected` }}</span>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Customized usage\n\nCustomized compositions for a specific Facet can be achieved by using a slot with the same id as the\nfacet to customize. For example, the Facet with the id \"color\" requires a composition that differs\nfrom the rest of the Facets. Doing it in a slot with the name \"color\" will apply this customization\njust to the \"color\" Facet. The other facets will fallback to the composition of the default slot.\n\nIt is also possible to customize the Facet content by the facet \"model name\". For example, to\nconfigure different content for \"Hierarchical Facets\" the \"hierarchical-facet\" slot will apply that\ncustomization. This can be combined with the facets by facet id. If some hierarchical facet needs\nsome different customization from the rest of the hierarchical, it can be achieve using the slot\nwith the facet id.\n\n```vue\n<template>\n <Facets>\n <template #color=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n\n <template #hierarchical-facet=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n <ul v-for=\"childFilter in filter.children\" :key=\"childFilter.id\">\n <li v-if=\"!childFilter.selected\">\n {{ childFilter.label }}\n </li>\n </ul>\n </li>\n </ul>\n </template>\n\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Render specific facets I\n\nBy default, this component will render all existing facets. However, it has the renderableFacets\nprop to filter which facets will be rendered. Its value is a string containing the different facets\nids. This value is treated as an include or exclude list (to exclude a facet from being rendered,\njust prefix its id with a `!`). The component will only render included facets and discard excluded\nones. In the following example, the component will only render color and category facets.\n\n```vue\n<template>\n <Facets renderableFacets=\"color, category\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Render specific facets II\n\nExclude facets so the component does not render them. In the following example, the component will\nrender every facet except color and price.\n\n```vue\n<template>\n <Facets renderableFacets=\"!color, !price\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Integrating with the filters components\n\nThere are many components that will help you build your own awesome filters list. `Facets` just\nrenders the list, but what to render for each facet is up to you. Below you can see an example of\nthe `Facets` component using the `FiltersSearch`, `MultiSelectFilters`, `SimpleFilter`, `Filters`,\n`HierarchicalFilter`, `NumberRangeFilter` and `BasePriceFilterLabel` components.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ facet.label }}</h1>\n <FiltersSearch :filters=\"facet.filters\">\n <MultiSelectFilters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\" />\n </MultiSelectFilters>\n </FiltersSearch>\n </template>\n\n <template #category=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <HierarchicalFilter :filter=\"filter\" />\n </Filters>\n </template>\n\n <template #price=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <NumberRangeFilter :filter=\"filter\">\n <BasePriceFilterLabel :filter=\"filter\" />\n </NumberRangeFilter>\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport {\n Facets,\n Filters,\n FiltersSearch,\n HierarchicalFilter,\n MultiSelectFilters,\n NumberRangeFilter,\n SimpleFilter,\n} from '@empathyco/x-components/facets'\n\nimport { BasePriceFilterLabel } from '@empathyco/x-components'\n</script>\n```\n</docs>\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"facets.vue2.js","sources":["../../../../../../src/x-modules/facets/components/facets/facets.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"hasFacets\" class=\"x-facets-list\" data-test=\"facets\" tag=\"ul\">\n <li\n v-for=\"({ facet, slotNameById, slotNameByModelName }, facetId) in mappedFacets\"\n :key=\"facetId\"\n class=\"x-facets-list__item\"\n data-test=\"facets-facet\"\n >\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's name will result in the\n facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-if=\"hasSlot(slotNameById)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || [],\n }\"\n :name=\"slotNameById\"\n />\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's modelName will result\n in the facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else-if=\"hasSlot(slotNameByModelName)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || [],\n }\"\n :name=\"slotNameByModelName\"\n />\n <!--\n @slot (required) Default Facet rendering. This slot will be used by default for rendering\n the facets without an specific slot implementation.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || [],\n }\"\n >\n This is the {{ facet.label }} facet. Pass something into its slot to display content.\n </slot>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Facet } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { RenderFacet } from './facets.types'\nimport { map, objectFilter } from '@empathyco/x-utils'\nimport { computed, defineComponent } from 'vue'\nimport { useGetter } from '../../../../composables/use-getter'\nimport { AnimationProp } from '../../../../types'\nimport { toKebabCase } from '../../../../utils/string'\nimport { useFacets } from '../../composables/use-facets'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * This component renders the list of facets stored in the Facets module. Facets can be rendered\n * differently based on their purpose and this can be achieved using the exposed slots:\n * - A default and required slot.\n * - A custom slot for each facet with the facetId as its name. This allows each facet to be\n * rendered differently based on its needs.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Facets',\n xModule: facetsXModule.name,\n props: {\n /** Array of facets ids used to get the selected filters for those facets. */\n facetsIds: Array as PropType<Array<Facet['id']>>,\n /** Flag to render the component even if there are no filters selected. */\n alwaysVisible: Boolean,\n /** Animation component that will be used to animate the facets. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n /**\n * Discriminates the facets rendered by this component. It expects a string containing facets\n * ids, comma separated. This property will include or exclude facets based on its value.\n * The default value is an empty string and the component will render all existing facets.\n *\n * @remarks\n * To behave as a `include`, simply set the facets ids, comma separated:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"brand, category\"`\n *\n * The component will render brand and category facets.\n *\n * On the other hand, to simulate an `exclude` behaviour and exclude a facet from being\n * rendered, append a '!' before its id:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"!brand,!price\"`\n *\n * The component will render category and color facets.\n */\n renderableFacets: String,\n },\n setup(props, { slots }) {\n const { selectedFiltersByFacet } = useFacets(props)\n const { facets } = useGetter('facets')\n\n /**\n * The facets to be rendered after filtering {@link Facets.facets} by\n * {@link Facets.renderableFacets} content.\n *\n * @returns The list of facets to be rendered.\n */\n const facetsToRender = computed<Dictionary<Facet>>(() => {\n if (!props.renderableFacets) {\n return facets.value\n } else {\n const excludedRegExp = /^!/\n const facetIds: string[] = props.renderableFacets.split(',').map(facetId => facetId.trim())\n const included: string[] = []\n const excluded: string[] = []\n facetIds.forEach(facetId => {\n if (excludedRegExp.test(facetId)) {\n excluded.push(facetId.replace(excludedRegExp, ''))\n } else {\n included.push(facetId)\n }\n })\n\n return filterFacetsToRender(included, excluded)\n }\n })\n\n /**\n * Transforms a dictionary of Facets including the slot name.\n *\n * @returns A dictionary of facets with the slot name.\n */\n const mappedFacets = computed<Dictionary<RenderFacet>>(() => {\n return map(facetsToRender.value, (facetId, facet) => ({\n slotNameById: toKebabCase(facetId),\n slotNameByModelName: toKebabCase(facet.modelName),\n facet,\n }))\n })\n\n /**\n * Indicates if there are facets available to show.\n *\n * @returns True if there are facets available and false otherwise.\n */\n const hasFacets = computed<boolean>(() => !!Object.keys(facetsToRender.value).length)\n\n /**\n * Filter facets dictionary retrieving those included and/or removing excluded.\n *\n * @param included - List of facets to render.\n * @param excluded - List of not renderable facets.\n *\n * @returns The filtered list of facets to render.\n */\n function filterFacetsToRender(included: string[], excluded: string[]): Dictionary<Facet> {\n const hasAnyFacetIncluded = included.length > 0\n return objectFilter(facets.value, facetKey => {\n const isIncluded = included.includes(String(facetKey))\n const isExcluded = excluded.includes(String(facetKey))\n\n return hasAnyFacetIncluded ? isIncluded && !isExcluded : !isExcluded\n })\n }\n\n /**\n * Whether the slot is present in the template or not.\n *\n * @param name - The slot name.\n *\n * @returns True is the slot is present in the template. False otherwise.\n */\n function hasSlot(name: string): boolean {\n return !!slots[name]\n }\n\n return {\n selectedFiltersByFacet,\n hasFacets,\n mappedFacets,\n hasSlot,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-facets-list {\n display: flex;\n flex-flow: column nowrap;\n list-style-type: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders the list of facets stored in the Facets module. Facets can be rendered\ndifferently based on their purpose and this can be achieved using the exposed slots:\n\n- A default and required slot.\n- A custom slot for each facet with the facetId as its name. This allows each facet to be rendered\n differently based on its needs.\n\nBelow, there are some examples showing how to use the component with its different configurations.\n\n### Default usage\n\nThe default slot of this component is mandatory. If no other slot is defined, every Facet will be\nrendered as specified in the default slot.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ facet.label }}</h1>\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} selected` }}</span>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Customized usage\n\nCustomized compositions for a specific Facet can be achieved by using a slot with the same id as the\nfacet to customize. For example, the Facet with the id \"color\" requires a composition that differs\nfrom the rest of the Facets. Doing it in a slot with the name \"color\" will apply this customization\njust to the \"color\" Facet. The other facets will fallback to the composition of the default slot.\n\nIt is also possible to customize the Facet content by the facet \"model name\". For example, to\nconfigure different content for \"Hierarchical Facets\" the \"hierarchical-facet\" slot will apply that\ncustomization. This can be combined with the facets by facet id. If some hierarchical facet needs\nsome different customization from the rest of the hierarchical, it can be achieve using the slot\nwith the facet id.\n\n```vue\n<template>\n <Facets>\n <template #color=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n\n <template #hierarchical-facet=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n <ul v-for=\"childFilter in filter.children\" :key=\"childFilter.id\">\n <li v-if=\"!childFilter.selected\">\n {{ childFilter.label }}\n </li>\n </ul>\n </li>\n </ul>\n </template>\n\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Render specific facets I\n\nBy default, this component will render all existing facets. However, it has the renderableFacets\nprop to filter which facets will be rendered. Its value is a string containing the different facets\nids. This value is treated as an include or exclude list (to exclude a facet from being rendered,\njust prefix its id with a `!`). The component will only render included facets and discard excluded\nones. In the following example, the component will only render color and category facets.\n\n```vue\n<template>\n <Facets renderableFacets=\"color, category\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Render specific facets II\n\nExclude facets so the component does not render them. In the following example, the component will\nrender every facet except color and price.\n\n```vue\n<template>\n <Facets renderableFacets=\"!color, !price\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Integrating with the filters components\n\nThere are many components that will help you build your own awesome filters list. `Facets` just\nrenders the list, but what to render for each facet is up to you. Below you can see an example of\nthe `Facets` component using the `FiltersSearch`, `MultiSelectFilters`, `SimpleFilter`, `Filters`,\n`HierarchicalFilter`, `NumberRangeFilter` and `BasePriceFilterLabel` components.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ facet.label }}</h1>\n <FiltersSearch :filters=\"facet.filters\">\n <MultiSelectFilters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\" />\n </MultiSelectFilters>\n </FiltersSearch>\n </template>\n\n <template #category=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <HierarchicalFilter :filter=\"filter\" />\n </Filters>\n </template>\n\n <template #price=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <NumberRangeFilter :filter=\"filter\">\n <BasePriceFilterLabel :filter=\"filter\" />\n </NumberRangeFilter>\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport {\n Facets,\n Filters,\n FiltersSearch,\n HierarchicalFilter,\n MultiSelectFilters,\n NumberRangeFilter,\n SimpleFilter,\n} from '@empathyco/x-components/facets'\n\nimport { BasePriceFilterLabel } from '@empathyco/x-components'\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;;AAoEA;;;;;;;;AAQE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE,KAAqC;;AAEhD,QAAA,aAAa,EAAE,OAAO;;AAEtB,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;;;;;;;;;;;;;;;;AAkBE;AACF,QAAA,gBAAgB,EAAE,MAAM;AACzB,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;QACpB,MAAM,EAAE,sBAAqB,KAAM,SAAS,CAAC,KAAK,CAAA;QAClD,MAAM,EAAE,MAAK,EAAE,GAAI,SAAS,CAAC,QAAQ,CAAA;AAErC;;;;;AAKE;AACF,QAAA,MAAM,cAAa,GAAI,QAAQ,CAAoB,MAAI;AACrD,YAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;gBAC3B,OAAO,MAAM,CAAC,KAAI;YACpB;iBAAO;gBACL,MAAM,cAAa,GAAI,IAAG;gBAC1B,MAAM,QAAQ,GAAa,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAM,IAAK,OAAO,CAAC,IAAI,EAAE,CAAA;gBAC1F,MAAM,QAAQ,GAAa,EAAC;gBAC5B,MAAM,QAAQ,GAAa,EAAC;AAC5B,gBAAA,QAAQ,CAAC,OAAO,CAAC,OAAM,IAAG;AACxB,oBAAA,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;AAChC,wBAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;oBACnD;yBAAO;AACL,wBAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;oBACvB;AACF,gBAAA,CAAC,CAAA;AAED,gBAAA,OAAO,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAA;YAChD;AACF,QAAA,CAAC,CAAA;AAED;;;;AAIE;AACF,QAAA,MAAM,YAAW,GAAI,QAAQ,CAA0B,MAAI;AACzD,YAAA,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,MAAM;AACpD,gBAAA,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC;AAClC,gBAAA,mBAAmB,EAAE,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;gBACjD,KAAK;AACN,aAAA,CAAC,CAAA;AACJ,QAAA,CAAC,CAAA;AAED;;;;AAIE;QACF,MAAM,SAAQ,GAAI,QAAQ,CAAU,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAA;AAEpF;;;;;;;AAOE;AACF,QAAA,SAAS,oBAAoB,CAAC,QAAkB,EAAE,QAAkB,EAAA;AAClE,YAAA,MAAM,mBAAkB,GAAI,QAAQ,CAAC,SAAS,CAAA;YAC9C,OAAO,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,QAAO,IAAG;gBAC1C,MAAM,UAAS,GAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;gBACrD,MAAM,UAAS,GAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAErD,gBAAA,OAAO,mBAAkB,GAAI,UAAS,IAAK,CAAC,UAAS,GAAI,CAAC,UAAS;AACrE,YAAA,CAAC,CAAA;QACH;AAEA;;;;;;AAME;QACF,SAAS,OAAO,CAAC,IAAY,EAAA;AAC3B,YAAA,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAA;QACrB;QAEA,OAAO;YACL,sBAAsB;YACtB,SAAS;YACT,YAAY;YACZ,OAAO;SACT;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -4,4 +4,4 @@ var css = ".x-facets-list[data-v-ec0aa26c]{display:flex;flex-flow:column nowrap;
4
4
  injectCss(css);
5
5
 
6
6
  export { css };
7
- //# sourceMappingURL=facets3.vue.js.map
7
+ //# sourceMappingURL=facets.vue3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extra-params2.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"facets.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,4 +1,4 @@
1
- import _sfc_main from './all-filter2.vue.js';
1
+ import _sfc_main from './all-filter.vue2.js';
2
2
  import { resolveComponent, openBlock, createBlock, normalizeClass, withCtx, renderSlot, createTextVNode } from 'vue';
3
3
  import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
@@ -69,4 +69,4 @@ var _sfc_main = defineComponent({
69
69
  });
70
70
 
71
71
  export { _sfc_main as default };
72
- //# sourceMappingURL=all-filter2.vue.js.map
72
+ //# sourceMappingURL=all-filter.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-filter2.vue.js","sources":["../../../../../../src/x-modules/facets/components/filters/all-filter.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-all-filter xds:filter-facet\"\n data-test=\"all-filter\"\n role=\"checkbox\"\n :aria-checked=\"isSelected.toString()\"\n :events=\"clickEvent\"\n :class=\"cssClasses\"\n >\n <!--\n @slot The content to render inside the button\n @binding {Facet} Facet - The facet data\n -->\n <slot :facet=\"facet\" :is-selected=\"isSelected\">all</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\nimport type { Facet } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { computed, defineComponent } from 'vue'\nimport BaseEventButton from '../../../../components/base-event-button.vue'\nimport { useGetter } from '../../../../composables/use-getter'\nimport { isArrayEmpty } from '../../../../utils/array'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * This component receives a required `facet` with\n * {@link @empathyco/x-types#BooleanFilter} as prop and renders a button, which\n * on clicked emits the {@link FacetsXEvents.UserClickedAllFilter} event. By default\n * the rendered button displays a message with the facet label but this content is customizable\n * through the default slot.\n *\n * @public\n */\nexport default defineComponent({\n name: 'AllFilter',\n components: {\n BaseEventButton,\n },\n xModule: facetsXModule.name,\n props: {\n /** The facet data. */\n facet: {\n type: Object as PropType<Facet>,\n required: true,\n },\n },\n setup(props) {\n /** The getter of the selectedFiltersByFacet. */\n const { selectedFiltersByFacet } = useGetter('facets')\n\n /**\n * The event that will be emitted when the all filter button is clicked.\n *\n * @returns The event to emit on click.\n * @internal\n */\n const clickEvent = computed((): Partial<XEventsTypes> => {\n return { UserClickedAllFilter: [props.facet.id] }\n })\n\n /**\n * Computed to retrieve the selected state of this component.\n *\n * @returns True if is selected false otherwise.\n */\n const isSelected = computed(() => {\n return isArrayEmpty(selectedFiltersByFacet.value?.[props.facet.id])\n })\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @remarks This is only valid considering that in the case of HierarchicalFilters, ancestors\n * of nested selected filters are also selected.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n const cssClasses = computed(() => {\n return {\n 'xds:selected x-all-filter--is-selected': isSelected.value,\n }\n })\n\n return {\n clickEvent,\n cssClasses,\n isSelected,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedAllFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the id of the facet\n that this `AllFilter` component corresponds to.\n\n## Examples\n\nThis component receives a required `facet` as prop and renders a button, which on clicked emits the\nUserClickedAllFilter event. By default the rendered button displays a message with the facet label\nbut this content is customizable through the default slot.\n\n### Basic usage\n\n```vue\n<template>\n <AllFilter :facet=\"facet\" />\n</template>\n\n<script setup>\nimport { AllFilter } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Customizing its content\n\n```vue\n<template>\n <AllFilter v-slot=\"{ facet }\" :facet=\"facet\"> Select all {{ facet.label }} </AllFilter>\n</template>\n\n<script setup>\nimport { AllFilter } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Basic example within facets\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet }\">\n <AllFilter :facet=\"facet\" />\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <SimpleFilter :filter=\"filter\" />\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets, Filters, AllFilter, SimpleFilter } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Custom example within facets\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet }\">\n <AllFilter v-slot=\"{ facet }\" :facet=\"facet\"> Select all {{ facet.label }} </AllFilter>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <SimpleFilter :filter=\"filter\" />\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets, Filters, AllFilter, SimpleFilter } from '@empathyco/x-components/facets'\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;AA2BA;;;;;;;;AAQE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,UAAU,EAAE;QACV,eAAe;AAChB,KAAA;IACD,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAAyB;AAC/B,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;;QAET,MAAM,EAAE,wBAAuB,GAAI,SAAS,CAAC,QAAQ,CAAA;AAErD;;;;;AAKE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAA2B;YACrD,OAAO,EAAE,oBAAoB,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAA,EAAE;AAClD,QAAA,CAAC,CAAA;AAED;;;;AAIE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAAI;AAC9B,YAAA,OAAO,YAAY,CAAC,sBAAsB,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;AACpE,QAAA,CAAC,CAAA;AAED;;;;;;;;AAQE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAAI;YAC9B,OAAO;gBACL,wCAAwC,EAAE,UAAU,CAAC,KAAK;aAC5D;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,UAAU;YACV,UAAU;YACV,UAAU;SACZ;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"all-filter.vue2.js","sources":["../../../../../../src/x-modules/facets/components/filters/all-filter.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-all-filter xds:filter-facet\"\n data-test=\"all-filter\"\n role=\"checkbox\"\n :aria-checked=\"isSelected.toString()\"\n :events=\"clickEvent\"\n :class=\"cssClasses\"\n >\n <!--\n @slot The content to render inside the button\n @binding {Facet} Facet - The facet data\n -->\n <slot :facet=\"facet\" :is-selected=\"isSelected\">all</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\nimport type { Facet } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { computed, defineComponent } from 'vue'\nimport BaseEventButton from '../../../../components/base-event-button.vue'\nimport { useGetter } from '../../../../composables/use-getter'\nimport { isArrayEmpty } from '../../../../utils/array'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * This component receives a required `facet` with\n * {@link @empathyco/x-types#BooleanFilter} as prop and renders a button, which\n * on clicked emits the {@link FacetsXEvents.UserClickedAllFilter} event. By default\n * the rendered button displays a message with the facet label but this content is customizable\n * through the default slot.\n *\n * @public\n */\nexport default defineComponent({\n name: 'AllFilter',\n components: {\n BaseEventButton,\n },\n xModule: facetsXModule.name,\n props: {\n /** The facet data. */\n facet: {\n type: Object as PropType<Facet>,\n required: true,\n },\n },\n setup(props) {\n /** The getter of the selectedFiltersByFacet. */\n const { selectedFiltersByFacet } = useGetter('facets')\n\n /**\n * The event that will be emitted when the all filter button is clicked.\n *\n * @returns The event to emit on click.\n * @internal\n */\n const clickEvent = computed((): Partial<XEventsTypes> => {\n return { UserClickedAllFilter: [props.facet.id] }\n })\n\n /**\n * Computed to retrieve the selected state of this component.\n *\n * @returns True if is selected false otherwise.\n */\n const isSelected = computed(() => {\n return isArrayEmpty(selectedFiltersByFacet.value?.[props.facet.id])\n })\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @remarks This is only valid considering that in the case of HierarchicalFilters, ancestors\n * of nested selected filters are also selected.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n const cssClasses = computed(() => {\n return {\n 'xds:selected x-all-filter--is-selected': isSelected.value,\n }\n })\n\n return {\n clickEvent,\n cssClasses,\n isSelected,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedAllFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the id of the facet\n that this `AllFilter` component corresponds to.\n\n## Examples\n\nThis component receives a required `facet` as prop and renders a button, which on clicked emits the\nUserClickedAllFilter event. By default the rendered button displays a message with the facet label\nbut this content is customizable through the default slot.\n\n### Basic usage\n\n```vue\n<template>\n <AllFilter :facet=\"facet\" />\n</template>\n\n<script setup>\nimport { AllFilter } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Customizing its content\n\n```vue\n<template>\n <AllFilter v-slot=\"{ facet }\" :facet=\"facet\"> Select all {{ facet.label }} </AllFilter>\n</template>\n\n<script setup>\nimport { AllFilter } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Basic example within facets\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet }\">\n <AllFilter :facet=\"facet\" />\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <SimpleFilter :filter=\"filter\" />\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets, Filters, AllFilter, SimpleFilter } from '@empathyco/x-components/facets'\n</script>\n```\n\n### Custom example within facets\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet }\">\n <AllFilter v-slot=\"{ facet }\" :facet=\"facet\"> Select all {{ facet.label }} </AllFilter>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <SimpleFilter :filter=\"filter\" />\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script setup>\nimport { Facets, Filters, AllFilter, SimpleFilter } from '@empathyco/x-components/facets'\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;AA2BA;;;;;;;;AAQE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,UAAU,EAAE;QACV,eAAe;AAChB,KAAA;IACD,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAAyB;AAC/B,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;;QAET,MAAM,EAAE,wBAAuB,GAAI,SAAS,CAAC,QAAQ,CAAA;AAErD;;;;;AAKE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAA2B;YACrD,OAAO,EAAE,oBAAoB,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAA,EAAE;AAClD,QAAA,CAAC,CAAA;AAED;;;;AAIE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAAI;AAC9B,YAAA,OAAO,YAAY,CAAC,sBAAsB,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;AACpE,QAAA,CAAC,CAAA;AAED;;;;;;;;AAQE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAAI;YAC9B,OAAO;gBACL,wCAAwC,EAAE,UAAU,CAAC,KAAK;aAC5D;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,UAAU;YACV,UAAU;YACV,UAAU;SACZ;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -1,6 +1,6 @@
1
- import _sfc_main from './editable-number-range-filter2.vue.js';
1
+ import _sfc_main from './editable-number-range-filter.vue2.js';
2
2
  import { openBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, createTextVNode, createCommentVNode } from 'vue';
3
- import './editable-number-range-filter3.vue.js';
3
+ import './editable-number-range-filter.vue3.js';
4
4
  import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
5
5
 
6
6
  const _hoisted_1 = ["value", "aria-label"];
@@ -231,4 +231,4 @@ var _sfc_main = defineComponent({
231
231
  });
232
232
 
233
233
  export { _sfc_main as default };
234
- //# sourceMappingURL=editable-number-range-filter2.vue.js.map
234
+ //# sourceMappingURL=editable-number-range-filter.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editable-number-range-filter2.vue.js","sources":["../../../../../../src/x-modules/facets/components/filters/editable-number-range-filter.vue"],"sourcesContent":["<template>\n <div\n class=\"x-editable-number-range-filter\"\n :class=\"cssClasses\"\n data-test=\"editable-number-range-filter\"\n >\n <!--\n @slot Empty slot used to customize the whole component.\n @binding {min} number - Component min value.\n @binding {max} number - Component max value.\n @binding {setMin} function - Component min setter.\n @binding {setMax} function - Component max setter.\n @binding {emitUserModifiedFilter} function - It emits the\n `UserModifiedEditableNumberRangeFilter` X event.\n @binding {clearValues} function - It sets component min and max values to null.\n @binding {hasError} boolean - Returns true when there is an error with component values.\n -->\n <slot\n v-bind=\"{\n min,\n max,\n setMin,\n setMax,\n emitUserModifiedFilter,\n clearValues,\n hasError,\n isAnyRange,\n }\"\n >\n <!-- eslint-disable max-len -->\n <input\n name=\"min\"\n type=\"number\"\n class=\"x-editable-number-range-filter__input x-editable-number-range-filter__input--min xds:input\"\n :class=\"inputsClass\"\n :value=\"!isAnyRange ? min : null\"\n data-test=\"range-min\"\n :aria-label=\"rangeFilterMin\"\n @change=\"setMin(($event?.target as HTMLInputElement)?.valueAsNumber)\"\n />\n\n <input\n name=\"max\"\n type=\"number\"\n class=\"x-editable-number-range-filter__input x-editable-number-range-filter__input--max xds:input\"\n :class=\"inputsClass\"\n :value=\"max\"\n data-test=\"range-max\"\n :aria-label=\"rangeFilterMax\"\n @change=\"setMax(($event?.target as HTMLInputElement)?.valueAsNumber)\"\n />\n <!-- eslint-enable max-len -->\n\n <button\n v-if=\"!isInstant\"\n class=\"x-editable-number-range-filter__apply xds:button\"\n :class=\"buttonsClass\"\n :disabled=\"hasError\"\n data-test=\"range-apply\"\n @click=\"emitUserModifiedFilter\"\n >\n <!--\n @slot Slot used to customize the apply button content.\n -->\n <slot name=\"apply-content\">✓</slot>\n </button>\n\n <button\n v-if=\"renderClearButton\"\n class=\"x-editable-number-range-filter__clear xds:button\"\n :class=\"buttonsClass\"\n data-test=\"range-clear\"\n @click=\"clearValues\"\n >\n <!--\n @slot Slot used to customize the clear button content.\n -->\n <slot name=\"clear-content\">𐄂</slot>\n </button>\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type {\n EditableNumberRangeFilter as EditableNumberRangeFilterModel,\n RangeValue,\n} from '@empathyco/x-types'\nimport type { PropType, Ref } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { use$x } from '../../../../composables'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * Renders an editable number range filter. It has two input fields to handle min and max values,\n * emitting the needed events when clicked.\n *\n * It provides a default slot, with some utils bind, to customize the whole component; and two\n * named slots `apply-content` and `clear-content` to override each button content.\n *\n * If `instant` prop is true, the needed events are emitted immediately; else, apply button is\n * rendered to confirm to do it. False by default.\n *\n * If `clear` prop is true, clear button, which sets to null component min and max values, is\n * rendered. True by default.\n *\n * @public\n */\nexport default defineComponent({\n name: 'EditableNumberRangeFilter',\n xModule: facetsXModule.name,\n props: {\n /**\n * The filter data to render and edit.\n *\n * @public\n */\n filter: {\n type: Object as PropType<EditableNumberRangeFilterModel>,\n required: true,\n },\n /**\n * If `instant` prop is true, the needed events are emitted immediately; else, apply button is\n * rendered to confirm to do it. False by default.\n *\n * @public\n */\n isInstant: Boolean,\n /**\n * If `clear` prop is true, clear button, which sets to null component min and max values, is\n * rendered. True by default.\n *\n * @public\n */\n hasClearButton: {\n type: Boolean,\n default: true,\n },\n /** Class inherited by content element. */\n inputsClass: String,\n /** Class inherited by content element. */\n buttonsClass: String,\n },\n setup(props) {\n const $x = use$x()\n\n const rangeFilterMin = 'minimum amount'\n const rangeFilterMax = 'maximum amount'\n /**\n * Component min value.\n *\n * @internal\n */\n const min: Ref<RangeValue['min']> = ref(null)\n /**\n * Component max value.\n *\n * @internal\n */\n const max: Ref<RangeValue['max']> = ref(null)\n\n /**\n * Returns {@link @empathyco/x-types#RangeValue} with component min and max\n * values.\n *\n * @returns Range value object with component values.\n *\n * @internal\n */\n const range = computed((): RangeValue => {\n return { min: min.value, max: max.value }\n })\n\n /**\n * It checks if component min and max values are valid.\n *\n * @returns True if there is any error in the component min and max values.\n *\n * @internal\n */\n const hasError = computed(\n () => min.value !== null && max.value !== null && min.value > max.value,\n )\n\n /**\n * It checks if component min and max values are different from the ones within the filter\n * provided as property.\n *\n * @returns True if they are different.\n *\n * @internal\n */\n const areValuesDifferent = computed(\n () => min.value !== props.filter.range.min || max.value !== props.filter.range.max,\n )\n\n /**\n * Dynamic CSS classes.\n *\n * @returns Object which contains dynamic CSS classes.\n *\n * @internal\n */\n const cssClasses = computed(() => {\n return { 'x-editable-number-range-filter--error': hasError.value }\n })\n\n /**\n * Checks if the range of the filter allows any value, which happens when the min is\n * null or 0 and the max is null.\n *\n * @returns True if the range of the filter allows any value.\n *\n * @internal\n */\n const isAnyRange = computed(() => !min.value && max.value === null)\n\n /**\n * It returns true if the property `hasClearButton` is true and there are values to clear.\n *\n * @returns True if the clear button has to be rendered.\n *\n * @internal\n */\n const renderClearButton = computed(() => props.hasClearButton && !isAnyRange.value)\n\n /**\n * It emits {@link FacetsXEvents.UserModifiedEditableNumberRangeFilter} event if there are no\n * errors and component `min` and `max` values are different than `filter.range` ones.\n *\n * @internal\n */\n const emitUserModifiedFilter = () => {\n if (!hasError.value && areValuesDifferent.value) {\n $x.emit('UserModifiedEditableNumberRangeFilter', {\n ...props.filter,\n range: range.value,\n })\n }\n }\n\n /**\n * It returns the number if possible or null otherwise.\n *\n * @param value - Value.\n * @returns The element value as a number if possible or null.\n *\n * @internal\n */\n const parseRangeValue = (value: number) => (Number.isNaN(value) ? null : value)\n\n /**\n * `min` setter.\n *\n * @param value - The component `min` value to be set.\n *\n * @internal\n */\n const setMin = (value: number) => {\n min.value = parseRangeValue(value)\n }\n\n /**\n * `max` setter.\n *\n * @param value - The component `max` value to be set.\n *\n * @internal\n */\n const setMax = (value: number) => {\n max.value = parseRangeValue(value)\n }\n\n /**\n * It sets component `min` and `max` values to null , and it emits the change if component is\n * working in instant mode.\n *\n * @internal\n */\n const clearValues = () => {\n min.value = null\n max.value = null\n }\n\n /**\n * It resets the min/max range values to null if the\n * {@link FacetsXEvents.UserClickedClearAllFilters} event is fired.\n *\n * @public\n */\n $x.on('UserClickedClearAllFilters', false).subscribe(clearValues)\n\n /**\n * It watches the filter range values passed as property and updates component range values if\n * they change.\n *\n * @param newRange - New range value.\n *\n * @internal\n */\n watch(\n () => props.filter.range,\n (newRange: RangeValue) => {\n min.value = newRange.min\n max.value = newRange.max\n },\n { immediate: true, deep: true },\n )\n\n /**\n * It watches range values in order to emit the event with the change if `isInstant`\n * property is true.\n *\n * @internal\n */\n watch(\n range,\n () => {\n if (props.isInstant) {\n emitUserModifiedFilter()\n }\n },\n { deep: true },\n )\n\n return {\n rangeFilterMin,\n rangeFilterMax,\n cssClasses,\n min,\n max,\n setMin,\n setMax,\n emitUserModifiedFilter,\n clearValues,\n hasError,\n isAnyRange,\n renderClearButton,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-editable-number-range-filter--error .x-editable-number-range-filter__input {\n border-color: red;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserModifiedEditableNumberRangeFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n this event is emitted instantly after typing the value or clicking the submit button. The event\n payload in both cases is an object containing the filter and the new value for the range.\n\n## Example\n\nRenders an editable number range filter. It has two input fields to handle min and max values,\nemitting the needed events when clicked.\n\nIt provides a default slot, with some utils bind, to customize the whole component; and two named\nslots `apply-content` and `clear-content` to override each button content.\n\nIf `instant` prop is true, the needed events are emitted immediately; else, apply button is rendered\nto confirm to do it. False by default.\n\nIf `clear` prop is true, clear button, which sets to null component min and max values, is rendered.\nTrue by default.\n\n### Basic usage\n\n```vue\n<template>\n <EditableNumberRangeFilter :filter=\"editableFilter\" />\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Properties\n\n```vue\n<template>\n <EditableNumberRangeFilter :filter=\"editableFilter\" :isInstant=\"true\" :hasClearButton=\"false\" />\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Customizing content slots\n\n```vue\n<template>\n <EditableNumberRangeFilter :filter=\"editableFilter\">\n <template #apply-content>Apply</template>\n <template #clear-content>Clear</template>\n </EditableNumberRangeFilter>\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Customizing default slot\n\n```vue\n<template>\n <EditableNumberRangeFilter\n :filter=\"editableFilter\"\n #default=\"{\n min,\n max,\n setMin,\n setMax,\n emitUserModifiedFilter,\n clearValues,\n hasError,\n isAnyRange,\n }\"\n >\n <button @click=\"emitUserModifiedFilter\">✅ Apply!</button>\n <button @click=\"clearValues\">🗑 Clear!</button>\n <input :value=\"!isAnyRange ? min : null\" @change=\"setMin($event.target.valueAsNumber)\" />\n <input :value=\"max\" @change=\"setMax($event.target.valueAsNumber)\" />\n <div class=\"has-error\" v-if=\"hasError\">⚠️ Invalid range values</div>\n </EditableNumberRangeFilter>\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Customizing the items with classes\n\nThe `buttonsClass` and `inputsClass` props can be used to add classes to the inputs and buttons of\nthe component.\n\n```\n<template>\n <EditableNumberRangeFilter\n :filter=\"editableFilter\"\n :inputsClass=\"'my-inputs-class'\"\n :buttonsClass=\"'my-buttons-class'\"\n />\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n</docs>\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"editable-number-range-filter.vue2.js","sources":["../../../../../../src/x-modules/facets/components/filters/editable-number-range-filter.vue"],"sourcesContent":["<template>\n <div\n class=\"x-editable-number-range-filter\"\n :class=\"cssClasses\"\n data-test=\"editable-number-range-filter\"\n >\n <!--\n @slot Empty slot used to customize the whole component.\n @binding {min} number - Component min value.\n @binding {max} number - Component max value.\n @binding {setMin} function - Component min setter.\n @binding {setMax} function - Component max setter.\n @binding {emitUserModifiedFilter} function - It emits the\n `UserModifiedEditableNumberRangeFilter` X event.\n @binding {clearValues} function - It sets component min and max values to null.\n @binding {hasError} boolean - Returns true when there is an error with component values.\n -->\n <slot\n v-bind=\"{\n min,\n max,\n setMin,\n setMax,\n emitUserModifiedFilter,\n clearValues,\n hasError,\n isAnyRange,\n }\"\n >\n <!-- eslint-disable max-len -->\n <input\n name=\"min\"\n type=\"number\"\n class=\"x-editable-number-range-filter__input x-editable-number-range-filter__input--min xds:input\"\n :class=\"inputsClass\"\n :value=\"!isAnyRange ? min : null\"\n data-test=\"range-min\"\n :aria-label=\"rangeFilterMin\"\n @change=\"setMin(($event?.target as HTMLInputElement)?.valueAsNumber)\"\n />\n\n <input\n name=\"max\"\n type=\"number\"\n class=\"x-editable-number-range-filter__input x-editable-number-range-filter__input--max xds:input\"\n :class=\"inputsClass\"\n :value=\"max\"\n data-test=\"range-max\"\n :aria-label=\"rangeFilterMax\"\n @change=\"setMax(($event?.target as HTMLInputElement)?.valueAsNumber)\"\n />\n <!-- eslint-enable max-len -->\n\n <button\n v-if=\"!isInstant\"\n class=\"x-editable-number-range-filter__apply xds:button\"\n :class=\"buttonsClass\"\n :disabled=\"hasError\"\n data-test=\"range-apply\"\n @click=\"emitUserModifiedFilter\"\n >\n <!--\n @slot Slot used to customize the apply button content.\n -->\n <slot name=\"apply-content\">✓</slot>\n </button>\n\n <button\n v-if=\"renderClearButton\"\n class=\"x-editable-number-range-filter__clear xds:button\"\n :class=\"buttonsClass\"\n data-test=\"range-clear\"\n @click=\"clearValues\"\n >\n <!--\n @slot Slot used to customize the clear button content.\n -->\n <slot name=\"clear-content\">𐄂</slot>\n </button>\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type {\n EditableNumberRangeFilter as EditableNumberRangeFilterModel,\n RangeValue,\n} from '@empathyco/x-types'\nimport type { PropType, Ref } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { use$x } from '../../../../composables'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * Renders an editable number range filter. It has two input fields to handle min and max values,\n * emitting the needed events when clicked.\n *\n * It provides a default slot, with some utils bind, to customize the whole component; and two\n * named slots `apply-content` and `clear-content` to override each button content.\n *\n * If `instant` prop is true, the needed events are emitted immediately; else, apply button is\n * rendered to confirm to do it. False by default.\n *\n * If `clear` prop is true, clear button, which sets to null component min and max values, is\n * rendered. True by default.\n *\n * @public\n */\nexport default defineComponent({\n name: 'EditableNumberRangeFilter',\n xModule: facetsXModule.name,\n props: {\n /**\n * The filter data to render and edit.\n *\n * @public\n */\n filter: {\n type: Object as PropType<EditableNumberRangeFilterModel>,\n required: true,\n },\n /**\n * If `instant` prop is true, the needed events are emitted immediately; else, apply button is\n * rendered to confirm to do it. False by default.\n *\n * @public\n */\n isInstant: Boolean,\n /**\n * If `clear` prop is true, clear button, which sets to null component min and max values, is\n * rendered. True by default.\n *\n * @public\n */\n hasClearButton: {\n type: Boolean,\n default: true,\n },\n /** Class inherited by content element. */\n inputsClass: String,\n /** Class inherited by content element. */\n buttonsClass: String,\n },\n setup(props) {\n const $x = use$x()\n\n const rangeFilterMin = 'minimum amount'\n const rangeFilterMax = 'maximum amount'\n /**\n * Component min value.\n *\n * @internal\n */\n const min: Ref<RangeValue['min']> = ref(null)\n /**\n * Component max value.\n *\n * @internal\n */\n const max: Ref<RangeValue['max']> = ref(null)\n\n /**\n * Returns {@link @empathyco/x-types#RangeValue} with component min and max\n * values.\n *\n * @returns Range value object with component values.\n *\n * @internal\n */\n const range = computed((): RangeValue => {\n return { min: min.value, max: max.value }\n })\n\n /**\n * It checks if component min and max values are valid.\n *\n * @returns True if there is any error in the component min and max values.\n *\n * @internal\n */\n const hasError = computed(\n () => min.value !== null && max.value !== null && min.value > max.value,\n )\n\n /**\n * It checks if component min and max values are different from the ones within the filter\n * provided as property.\n *\n * @returns True if they are different.\n *\n * @internal\n */\n const areValuesDifferent = computed(\n () => min.value !== props.filter.range.min || max.value !== props.filter.range.max,\n )\n\n /**\n * Dynamic CSS classes.\n *\n * @returns Object which contains dynamic CSS classes.\n *\n * @internal\n */\n const cssClasses = computed(() => {\n return { 'x-editable-number-range-filter--error': hasError.value }\n })\n\n /**\n * Checks if the range of the filter allows any value, which happens when the min is\n * null or 0 and the max is null.\n *\n * @returns True if the range of the filter allows any value.\n *\n * @internal\n */\n const isAnyRange = computed(() => !min.value && max.value === null)\n\n /**\n * It returns true if the property `hasClearButton` is true and there are values to clear.\n *\n * @returns True if the clear button has to be rendered.\n *\n * @internal\n */\n const renderClearButton = computed(() => props.hasClearButton && !isAnyRange.value)\n\n /**\n * It emits {@link FacetsXEvents.UserModifiedEditableNumberRangeFilter} event if there are no\n * errors and component `min` and `max` values are different than `filter.range` ones.\n *\n * @internal\n */\n const emitUserModifiedFilter = () => {\n if (!hasError.value && areValuesDifferent.value) {\n $x.emit('UserModifiedEditableNumberRangeFilter', {\n ...props.filter,\n range: range.value,\n })\n }\n }\n\n /**\n * It returns the number if possible or null otherwise.\n *\n * @param value - Value.\n * @returns The element value as a number if possible or null.\n *\n * @internal\n */\n const parseRangeValue = (value: number) => (Number.isNaN(value) ? null : value)\n\n /**\n * `min` setter.\n *\n * @param value - The component `min` value to be set.\n *\n * @internal\n */\n const setMin = (value: number) => {\n min.value = parseRangeValue(value)\n }\n\n /**\n * `max` setter.\n *\n * @param value - The component `max` value to be set.\n *\n * @internal\n */\n const setMax = (value: number) => {\n max.value = parseRangeValue(value)\n }\n\n /**\n * It sets component `min` and `max` values to null , and it emits the change if component is\n * working in instant mode.\n *\n * @internal\n */\n const clearValues = () => {\n min.value = null\n max.value = null\n }\n\n /**\n * It resets the min/max range values to null if the\n * {@link FacetsXEvents.UserClickedClearAllFilters} event is fired.\n *\n * @public\n */\n $x.on('UserClickedClearAllFilters', false).subscribe(clearValues)\n\n /**\n * It watches the filter range values passed as property and updates component range values if\n * they change.\n *\n * @param newRange - New range value.\n *\n * @internal\n */\n watch(\n () => props.filter.range,\n (newRange: RangeValue) => {\n min.value = newRange.min\n max.value = newRange.max\n },\n { immediate: true, deep: true },\n )\n\n /**\n * It watches range values in order to emit the event with the change if `isInstant`\n * property is true.\n *\n * @internal\n */\n watch(\n range,\n () => {\n if (props.isInstant) {\n emitUserModifiedFilter()\n }\n },\n { deep: true },\n )\n\n return {\n rangeFilterMin,\n rangeFilterMax,\n cssClasses,\n min,\n max,\n setMin,\n setMax,\n emitUserModifiedFilter,\n clearValues,\n hasError,\n isAnyRange,\n renderClearButton,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-editable-number-range-filter--error .x-editable-number-range-filter__input {\n border-color: red;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserModifiedEditableNumberRangeFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n this event is emitted instantly after typing the value or clicking the submit button. The event\n payload in both cases is an object containing the filter and the new value for the range.\n\n## Example\n\nRenders an editable number range filter. It has two input fields to handle min and max values,\nemitting the needed events when clicked.\n\nIt provides a default slot, with some utils bind, to customize the whole component; and two named\nslots `apply-content` and `clear-content` to override each button content.\n\nIf `instant` prop is true, the needed events are emitted immediately; else, apply button is rendered\nto confirm to do it. False by default.\n\nIf `clear` prop is true, clear button, which sets to null component min and max values, is rendered.\nTrue by default.\n\n### Basic usage\n\n```vue\n<template>\n <EditableNumberRangeFilter :filter=\"editableFilter\" />\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Properties\n\n```vue\n<template>\n <EditableNumberRangeFilter :filter=\"editableFilter\" :isInstant=\"true\" :hasClearButton=\"false\" />\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Customizing content slots\n\n```vue\n<template>\n <EditableNumberRangeFilter :filter=\"editableFilter\">\n <template #apply-content>Apply</template>\n <template #clear-content>Clear</template>\n </EditableNumberRangeFilter>\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Customizing default slot\n\n```vue\n<template>\n <EditableNumberRangeFilter\n :filter=\"editableFilter\"\n #default=\"{\n min,\n max,\n setMin,\n setMax,\n emitUserModifiedFilter,\n clearValues,\n hasError,\n isAnyRange,\n }\"\n >\n <button @click=\"emitUserModifiedFilter\">✅ Apply!</button>\n <button @click=\"clearValues\">🗑 Clear!</button>\n <input :value=\"!isAnyRange ? min : null\" @change=\"setMin($event.target.valueAsNumber)\" />\n <input :value=\"max\" @change=\"setMax($event.target.valueAsNumber)\" />\n <div class=\"has-error\" v-if=\"hasError\">⚠️ Invalid range values</div>\n </EditableNumberRangeFilter>\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n\n### Customizing the items with classes\n\nThe `buttonsClass` and `inputsClass` props can be used to add classes to the inputs and buttons of\nthe component.\n\n```\n<template>\n <EditableNumberRangeFilter\n :filter=\"editableFilter\"\n :inputsClass=\"'my-inputs-class'\"\n :buttonsClass=\"'my-buttons-class'\"\n />\n</template>\n\n<script setup>\nimport { EditableNumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst editableFilter = ref({\n facetId: 'age',\n id: 'age:primary',\n label: 'primary',\n modelName: 'EditableNumberRangeFilter',\n range: {\n min: null,\n max: null,\n },\n})\n</script>\n```\n</docs>\n"],"names":[],"mappings":"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"}
@@ -4,4 +4,4 @@ var css = ".x-editable-number-range-filter--error .x-editable-number-range-filte
4
4
  injectCss(css);
5
5
 
6
6
  export { css };
7
- //# sourceMappingURL=editable-number-range-filter3.vue.js.map
7
+ //# sourceMappingURL=editable-number-range-filter.vue3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editable-number-range-filter.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,4 +1,4 @@
1
- import _sfc_main from './hierarchical-filter2.vue.js';
1
+ import _sfc_main from './hierarchical-filter.vue2.js';
2
2
  import { resolveComponent, openBlock, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, normalizeClass, createTextVNode, toDisplayString } from 'vue';
3
3
  import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
@@ -116,4 +116,4 @@ var _sfc_main = defineComponent({
116
116
  });
117
117
 
118
118
  export { _sfc_main as default };
119
- //# sourceMappingURL=hierarchical-filter2.vue.js.map
119
+ //# sourceMappingURL=hierarchical-filter.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hierarchical-filter2.vue.js","sources":["../../../../../../src/x-modules/facets/components/filters/hierarchical-filter.vue"],"sourcesContent":["<template>\n <div class=\"x-hierarchical-filter-container\" data-test=\"hierarchical-filter-container\">\n <RenderlessFilter\n v-slot=\"{ filter: filterBinding, clickFilter, cssClasses: cssClassesBinding, isDisabled }\"\n :filter=\"filter\"\n :click-events=\"innerClickEvents\"\n :css-classes=\"innerCssClasses\"\n >\n <!--\n @slot The content to render inside the button.\n @binding {Filter} filter - The filter data.\n @binding {Function} clickFilter - The handler to invoke when clicking the filter.\n @binding {VueCssClasses} cssClasses - The CSS classes.\n @binding {boolean} isDisabled - Flag determining the disabled state.\n -->\n <slot\n v-bind=\"{ filter: filterBinding, clickFilter, cssClasses: cssClassesBinding, isDisabled }\"\n >\n <button\n :aria-checked=\"filterBinding.selected.toString()\"\n :class=\"[cssClassesBinding, filterItemClass]\"\n :disabled=\"isDisabled\"\n data-test=\"filter\"\n role=\"checkbox\"\n @click=\"clickFilter\"\n >\n <!--\n @slot The content to render inside the button.\n @binding {Filter} filter - The filter data.\n -->\n <slot name=\"label\" :filter=\"filterBinding\">{{ filterBinding.label }}</slot>\n </button>\n </slot>\n </RenderlessFilter>\n <FiltersList\n v-slot=\"{ filter: childFilter }\"\n :animation=\"childrenAnimation\"\n :filters=\"renderedChildrenFilters\"\n :parent-id=\"filter.id\"\n class=\"x-hierarchical-filter__children\"\n :class=\"childrenFiltersClass\"\n data-test=\"children-filters\"\n >\n <HierarchicalFilter\n :children-animation=\"childrenAnimation\"\n :filter=\"childFilter\"\n :click-events=\"getChildFilterClickEvents(childFilter)\"\n :children-filters-class=\"childrenFiltersClass\"\n :filter-item-class=\"filterItemClass\"\n >\n <template\n #default=\"{\n filter: filterBinding,\n clickFilter,\n cssClasses: cssClassesBinding,\n isDisabled,\n }\"\n >\n <slot\n v-bind=\"{\n filter: filterBinding,\n clickFilter,\n cssClasses: cssClassesBinding,\n isDisabled,\n }\"\n />\n </template>\n <template #label=\"{ filter: filterBinding }\">\n <slot name=\"label\" :filter=\"filterBinding\" />\n </template>\n </HierarchicalFilter>\n </FiltersList>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Filter, HierarchicalFilter as HierarchicalFilterModel } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { isHierarchicalFilter } from '@empathyco/x-types'\nimport { isObject } from '@empathyco/x-utils'\nimport { computed, defineComponent } from 'vue'\nimport { AnimationProp } from '../../../../types'\nimport { facetsXModule } from '../../x-module'\nimport FiltersList from '../lists/filters-list.vue'\nimport RenderlessFilter from './renderless-filter.vue'\n\n/**\n * Renders a hierarchical filter recursively, emitting the needed events when clicked.\n *\n * @public\n */\nexport default defineComponent({\n name: 'HierarchicalFilter',\n xModule: facetsXModule.name,\n components: { FiltersList, RenderlessFilter },\n props: {\n /** The filter data to render. */\n filter: {\n type: Object as PropType<HierarchicalFilterModel>,\n required: true,\n },\n /** The animation component to use for the children filters. */\n childrenAnimation: AnimationProp,\n /**\n * Additional events, with their payload, to emit when the filter is clicked.\n *\n * @public\n */\n clickEvents: Object as PropType<Partial<XEventsTypes>>,\n /** Inheritance CSS classes. */\n cssClasses: {\n type: Array as PropType<(string | Dictionary<boolean>)[]>,\n default: () => [],\n },\n /** Class inherited by content element. */\n childrenFiltersClass: String,\n /** Class inherited by content element. */\n filterItemClass: String,\n },\n setup(props) {\n /**\n * The {@link XEventsTypes} to emit.\n *\n * @returns The events to emit when clicked.\n * @internal\n */\n const innerClickEvents = computed(() => ({\n UserClickedAHierarchicalFilter: props.filter,\n ...props.clickEvents,\n }))\n\n const isFilterPartiallySelected = (filter: HierarchicalFilterModel) => {\n const selectedChildren = filter.children?.filter(filter => filter.selected)\n const filterChildrenLength = filter.children?.length ?? 0\n return (\n !!selectedChildren &&\n ((selectedChildren.length > 0 && selectedChildren.length < filterChildrenLength) ||\n selectedChildren.some(isFilterPartiallySelected))\n )\n }\n\n /**\n * Returns if the filter is partially selected, which means having more than one child filter\n * selected, but not every of them, or having at least one child filter partially selected.\n *\n * @returns True if the filter is partially selected. False otherwise.\n * @internal\n */\n const isPartiallySelected = computed(() => isFilterPartiallySelected(props.filter))\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n const innerCssClasses = computed(() => [\n 'x-hierarchical-filter',\n { 'x-hierarchical-filter--is-partially-selected': isPartiallySelected.value },\n { 'x-hierarchical-filter--is-selected': props.filter.selected },\n { 'x-facet-filter--is-partially-selected': isPartiallySelected.value },\n ...props.cssClasses,\n ])\n\n /**\n * Gets the child filter click events, converting the payload of the events that have a\n * {@link HierarchicalFilter} as payload to the corresponding child filter.\n *\n * @param childFilter - The child filter.\n * @returns The events to emit when clicking a child.\n * @internal\n */\n const getChildFilterClickEvents = (childFilter: HierarchicalFilterModel) => {\n return Object.entries(innerClickEvents.value).reduce((clickEvents, [event, payload]) => {\n return {\n ...clickEvents,\n [event]:\n isObject(payload) &&\n isHierarchicalFilter(payload as unknown as Filter) &&\n childFilter !== (payload as unknown as HierarchicalFilterModel)\n ? childFilter\n : payload,\n }\n }, {} as Partial<XEventsTypes>)\n }\n\n /**\n * List of filters to render, in case that the children's array\n * is empty it will return an empty array instead of inject the ones from the parent.\n *\n * @returns A list of filters.\n * @internal\n */\n const renderedChildrenFilters = computed(() => props.filter.children ?? [])\n\n return {\n innerClickEvents,\n innerCssClasses,\n renderedChildrenFilters,\n getChildFilterClickEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedAFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n- [`UserClickedAHierarchicalFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n filter.\n\n## See it in action\n\nThis component renders a button, which on clicked emits the `UserClickedAFilter` and\n`UserClickedAHierarchicalFilter` events. By default it renders the filter label as the button text.\nIf the provided filter has children filters, this component will render them recursively. Changing\nthe slot content will change it for all of the children.\n\nThe `filter` prop is required. The `clickEvents` prop is optional and allows configuring the events\nto emit on click.\n\n```vue\n<template>\n <HierarchicalFilter :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Playing with props\n\nConfiguring the events to emit when the filter is clicked.\n\n```vue\n<template>\n <HierarchicalFilter :clickEvents=\"{ UserClickedAHierarchicalFilter: filter }\" :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Customizing the default slot content\n\nIn this example, the child filters will also include the label and checkbox.\n\n```vue\n<template>\n <HierarchicalFilter :filter=\"filter\" v-slot=\"{ filter, clickFilter, cssClasses, isDisabled }\">\n <label :class=\"cssClasses\">\n <input @change=\"clickFilter\" :disabled=\"isDisabled\" />\n {{ filter.label }}\n </label>\n </HierarchicalFilter>\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Customizing the label slot content\n\n```vue\n<template>\n <HierarchicalFilter :filter=\"filter\">\n <template #label=\"{ filter }\">\n <span class=\"custom-class\">{{ filter.label }}</span>\n </template>\n </HierarchicalFilter>\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Customizing the content with classes\n\nThe `childrenFiltersClass` prop can be used to add classes to the inner filters lists. This is\nuseful to set the indent of the children filters.\n\nThe `filterItemClass` prop can be used to add classes to the filter element itself.\n\n```vue\n<template>\n <HierarchicalFilter\n :filter=\"filter\"\n childrenFiltersClass=\"x-custom-class\"\n filterItemClass=\"x-custom-filter\"\n />\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n</docs>\n"],"names":["RenderlessFilter"],"mappings":";;;;;;;;AAwFA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,UAAU,EAAE,EAAE,WAAW,oBAAEA,aAAkB;AAC7C,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA2C;AACjD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,iBAAiB,EAAE,aAAa;AAChC;;;;AAIE;AACF,QAAA,WAAW,EAAE,MAAyC;;AAEtD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,KAAmD;AACzD,YAAA,OAAO,EAAE,MAAM,EAAE;AAClB,SAAA;;AAED,QAAA,oBAAoB,EAAE,MAAM;;AAE5B,QAAA,eAAe,EAAE,MAAM;AACxB,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;AAKE;AACF,QAAA,MAAM,gBAAe,GAAI,QAAQ,CAAC,OAAO;YACvC,8BAA8B,EAAE,KAAK,CAAC,MAAM;YAC5C,GAAG,KAAK,CAAC,WAAW;AACrB,SAAA,CAAC,CAAA;AAEF,QAAA,MAAM,4BAA4B,CAAC,MAA+B,KAAG;AACnE,YAAA,MAAM,gBAAe,GAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAK,IAAK,MAAM,CAAC,QAAQ,CAAA;YAC1E,MAAM,oBAAmB,GAAI,MAAM,CAAC,QAAQ,EAAE,MAAK,IAAK,CAAA;YACxD,QACE,CAAC,CAAC;AACF,iBAAC,CAAC,gBAAgB,CAAC,SAAS,CAAA,IAAK,gBAAgB,CAAC,MAAK,GAAI,oBAAoB;AAC7E,oBAAA,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;AAEtD,QAAA,CAAA;AAEA;;;;;;AAME;AACF,QAAA,MAAM,mBAAkB,GAAI,QAAQ,CAAC,MAAM,yBAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AAElF;;;;;AAKE;AACF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAAC,MAAM;YACrC,uBAAuB;AACvB,YAAA,EAAE,8CAA8C,EAAE,mBAAmB,CAAC,OAAO;AAC7E,YAAA,EAAE,oCAAoC,EAAE,KAAK,CAAC,MAAM,CAAC,QAAO,EAAG;AAC/D,YAAA,EAAE,uCAAuC,EAAE,mBAAmB,CAAC,OAAO;YACtE,GAAG,KAAK,CAAC,UAAU;AACpB,SAAA,CAAA;AAED;;;;;;;AAOE;AACF,QAAA,MAAM,yBAAwB,GAAI,CAAC,WAAoC,KAAG;YACxE,OAAO,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,KAAG;gBACpF,OAAO;AACL,oBAAA,GAAG,WAAW;AACd,oBAAA,CAAC,KAAK,GACJ,QAAQ,CAAC,OAAO;wBAChB,oBAAoB,CAAC,OAA4B,CAAA;AACjD,wBAAA,WAAU,KAAO;AACf,0BAAE;AACF,0BAAE,OAAO;iBACf;YACF,CAAC,EAAE,EAA2B,CAAA;AAChC,QAAA,CAAA;AAEA;;;;;;AAME;AACF,QAAA,MAAM,uBAAsB,GAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,QAAO,IAAK,EAAE,CAAA;QAE1E,OAAO;YACL,gBAAgB;YAChB,eAAe;YACf,uBAAuB;YACvB,yBAAyB;SAC3B;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"hierarchical-filter.vue2.js","sources":["../../../../../../src/x-modules/facets/components/filters/hierarchical-filter.vue"],"sourcesContent":["<template>\n <div class=\"x-hierarchical-filter-container\" data-test=\"hierarchical-filter-container\">\n <RenderlessFilter\n v-slot=\"{ filter: filterBinding, clickFilter, cssClasses: cssClassesBinding, isDisabled }\"\n :filter=\"filter\"\n :click-events=\"innerClickEvents\"\n :css-classes=\"innerCssClasses\"\n >\n <!--\n @slot The content to render inside the button.\n @binding {Filter} filter - The filter data.\n @binding {Function} clickFilter - The handler to invoke when clicking the filter.\n @binding {VueCssClasses} cssClasses - The CSS classes.\n @binding {boolean} isDisabled - Flag determining the disabled state.\n -->\n <slot\n v-bind=\"{ filter: filterBinding, clickFilter, cssClasses: cssClassesBinding, isDisabled }\"\n >\n <button\n :aria-checked=\"filterBinding.selected.toString()\"\n :class=\"[cssClassesBinding, filterItemClass]\"\n :disabled=\"isDisabled\"\n data-test=\"filter\"\n role=\"checkbox\"\n @click=\"clickFilter\"\n >\n <!--\n @slot The content to render inside the button.\n @binding {Filter} filter - The filter data.\n -->\n <slot name=\"label\" :filter=\"filterBinding\">{{ filterBinding.label }}</slot>\n </button>\n </slot>\n </RenderlessFilter>\n <FiltersList\n v-slot=\"{ filter: childFilter }\"\n :animation=\"childrenAnimation\"\n :filters=\"renderedChildrenFilters\"\n :parent-id=\"filter.id\"\n class=\"x-hierarchical-filter__children\"\n :class=\"childrenFiltersClass\"\n data-test=\"children-filters\"\n >\n <HierarchicalFilter\n :children-animation=\"childrenAnimation\"\n :filter=\"childFilter\"\n :click-events=\"getChildFilterClickEvents(childFilter)\"\n :children-filters-class=\"childrenFiltersClass\"\n :filter-item-class=\"filterItemClass\"\n >\n <template\n #default=\"{\n filter: filterBinding,\n clickFilter,\n cssClasses: cssClassesBinding,\n isDisabled,\n }\"\n >\n <slot\n v-bind=\"{\n filter: filterBinding,\n clickFilter,\n cssClasses: cssClassesBinding,\n isDisabled,\n }\"\n />\n </template>\n <template #label=\"{ filter: filterBinding }\">\n <slot name=\"label\" :filter=\"filterBinding\" />\n </template>\n </HierarchicalFilter>\n </FiltersList>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Filter, HierarchicalFilter as HierarchicalFilterModel } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { isHierarchicalFilter } from '@empathyco/x-types'\nimport { isObject } from '@empathyco/x-utils'\nimport { computed, defineComponent } from 'vue'\nimport { AnimationProp } from '../../../../types'\nimport { facetsXModule } from '../../x-module'\nimport FiltersList from '../lists/filters-list.vue'\nimport RenderlessFilter from './renderless-filter.vue'\n\n/**\n * Renders a hierarchical filter recursively, emitting the needed events when clicked.\n *\n * @public\n */\nexport default defineComponent({\n name: 'HierarchicalFilter',\n xModule: facetsXModule.name,\n components: { FiltersList, RenderlessFilter },\n props: {\n /** The filter data to render. */\n filter: {\n type: Object as PropType<HierarchicalFilterModel>,\n required: true,\n },\n /** The animation component to use for the children filters. */\n childrenAnimation: AnimationProp,\n /**\n * Additional events, with their payload, to emit when the filter is clicked.\n *\n * @public\n */\n clickEvents: Object as PropType<Partial<XEventsTypes>>,\n /** Inheritance CSS classes. */\n cssClasses: {\n type: Array as PropType<(string | Dictionary<boolean>)[]>,\n default: () => [],\n },\n /** Class inherited by content element. */\n childrenFiltersClass: String,\n /** Class inherited by content element. */\n filterItemClass: String,\n },\n setup(props) {\n /**\n * The {@link XEventsTypes} to emit.\n *\n * @returns The events to emit when clicked.\n * @internal\n */\n const innerClickEvents = computed(() => ({\n UserClickedAHierarchicalFilter: props.filter,\n ...props.clickEvents,\n }))\n\n const isFilterPartiallySelected = (filter: HierarchicalFilterModel) => {\n const selectedChildren = filter.children?.filter(filter => filter.selected)\n const filterChildrenLength = filter.children?.length ?? 0\n return (\n !!selectedChildren &&\n ((selectedChildren.length > 0 && selectedChildren.length < filterChildrenLength) ||\n selectedChildren.some(isFilterPartiallySelected))\n )\n }\n\n /**\n * Returns if the filter is partially selected, which means having more than one child filter\n * selected, but not every of them, or having at least one child filter partially selected.\n *\n * @returns True if the filter is partially selected. False otherwise.\n * @internal\n */\n const isPartiallySelected = computed(() => isFilterPartiallySelected(props.filter))\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n const innerCssClasses = computed(() => [\n 'x-hierarchical-filter',\n { 'x-hierarchical-filter--is-partially-selected': isPartiallySelected.value },\n { 'x-hierarchical-filter--is-selected': props.filter.selected },\n { 'x-facet-filter--is-partially-selected': isPartiallySelected.value },\n ...props.cssClasses,\n ])\n\n /**\n * Gets the child filter click events, converting the payload of the events that have a\n * {@link HierarchicalFilter} as payload to the corresponding child filter.\n *\n * @param childFilter - The child filter.\n * @returns The events to emit when clicking a child.\n * @internal\n */\n const getChildFilterClickEvents = (childFilter: HierarchicalFilterModel) => {\n return Object.entries(innerClickEvents.value).reduce((clickEvents, [event, payload]) => {\n return {\n ...clickEvents,\n [event]:\n isObject(payload) &&\n isHierarchicalFilter(payload as unknown as Filter) &&\n childFilter !== (payload as unknown as HierarchicalFilterModel)\n ? childFilter\n : payload,\n }\n }, {} as Partial<XEventsTypes>)\n }\n\n /**\n * List of filters to render, in case that the children's array\n * is empty it will return an empty array instead of inject the ones from the parent.\n *\n * @returns A list of filters.\n * @internal\n */\n const renderedChildrenFilters = computed(() => props.filter.children ?? [])\n\n return {\n innerClickEvents,\n innerCssClasses,\n renderedChildrenFilters,\n getChildFilterClickEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedAFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n- [`UserClickedAHierarchicalFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n filter.\n\n## See it in action\n\nThis component renders a button, which on clicked emits the `UserClickedAFilter` and\n`UserClickedAHierarchicalFilter` events. By default it renders the filter label as the button text.\nIf the provided filter has children filters, this component will render them recursively. Changing\nthe slot content will change it for all of the children.\n\nThe `filter` prop is required. The `clickEvents` prop is optional and allows configuring the events\nto emit on click.\n\n```vue\n<template>\n <HierarchicalFilter :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Playing with props\n\nConfiguring the events to emit when the filter is clicked.\n\n```vue\n<template>\n <HierarchicalFilter :clickEvents=\"{ UserClickedAHierarchicalFilter: filter }\" :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Customizing the default slot content\n\nIn this example, the child filters will also include the label and checkbox.\n\n```vue\n<template>\n <HierarchicalFilter :filter=\"filter\" v-slot=\"{ filter, clickFilter, cssClasses, isDisabled }\">\n <label :class=\"cssClasses\">\n <input @change=\"clickFilter\" :disabled=\"isDisabled\" />\n {{ filter.label }}\n </label>\n </HierarchicalFilter>\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Customizing the label slot content\n\n```vue\n<template>\n <HierarchicalFilter :filter=\"filter\">\n <template #label=\"{ filter }\">\n <span class=\"custom-class\">{{ filter.label }}</span>\n </template>\n </HierarchicalFilter>\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n\n### Customizing the content with classes\n\nThe `childrenFiltersClass` prop can be used to add classes to the inner filters lists. This is\nuseful to set the indent of the children filters.\n\nThe `filterItemClass` prop can be used to add classes to the filter element itself.\n\n```vue\n<template>\n <HierarchicalFilter\n :filter=\"filter\"\n childrenFiltersClass=\"x-custom-class\"\n filterItemClass=\"x-custom-filter\"\n />\n</template>\n\n<script setup>\nimport { HierarchicalFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `categories:men`,\n modelName: 'HierarchicalFilter',\n label: `men`,\n facetId: 'categories',\n parentId: null,\n totalResults: 10,\n children: [],\n selected: false,\n})\n</script>\n```\n</docs>\n"],"names":["RenderlessFilter"],"mappings":";;;;;;;;AAwFA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,UAAU,EAAE,EAAE,WAAW,oBAAEA,aAAkB;AAC7C,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA2C;AACjD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,iBAAiB,EAAE,aAAa;AAChC;;;;AAIE;AACF,QAAA,WAAW,EAAE,MAAyC;;AAEtD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,KAAmD;AACzD,YAAA,OAAO,EAAE,MAAM,EAAE;AAClB,SAAA;;AAED,QAAA,oBAAoB,EAAE,MAAM;;AAE5B,QAAA,eAAe,EAAE,MAAM;AACxB,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;AAKE;AACF,QAAA,MAAM,gBAAe,GAAI,QAAQ,CAAC,OAAO;YACvC,8BAA8B,EAAE,KAAK,CAAC,MAAM;YAC5C,GAAG,KAAK,CAAC,WAAW;AACrB,SAAA,CAAC,CAAA;AAEF,QAAA,MAAM,4BAA4B,CAAC,MAA+B,KAAG;AACnE,YAAA,MAAM,gBAAe,GAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAK,IAAK,MAAM,CAAC,QAAQ,CAAA;YAC1E,MAAM,oBAAmB,GAAI,MAAM,CAAC,QAAQ,EAAE,MAAK,IAAK,CAAA;YACxD,QACE,CAAC,CAAC;AACF,iBAAC,CAAC,gBAAgB,CAAC,SAAS,CAAA,IAAK,gBAAgB,CAAC,MAAK,GAAI,oBAAoB;AAC7E,oBAAA,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;AAEtD,QAAA,CAAA;AAEA;;;;;;AAME;AACF,QAAA,MAAM,mBAAkB,GAAI,QAAQ,CAAC,MAAM,yBAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AAElF;;;;;AAKE;AACF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAAC,MAAM;YACrC,uBAAuB;AACvB,YAAA,EAAE,8CAA8C,EAAE,mBAAmB,CAAC,OAAO;AAC7E,YAAA,EAAE,oCAAoC,EAAE,KAAK,CAAC,MAAM,CAAC,QAAO,EAAG;AAC/D,YAAA,EAAE,uCAAuC,EAAE,mBAAmB,CAAC,OAAO;YACtE,GAAG,KAAK,CAAC,UAAU;AACpB,SAAA,CAAA;AAED;;;;;;;AAOE;AACF,QAAA,MAAM,yBAAwB,GAAI,CAAC,WAAoC,KAAG;YACxE,OAAO,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,KAAG;gBACpF,OAAO;AACL,oBAAA,GAAG,WAAW;AACd,oBAAA,CAAC,KAAK,GACJ,QAAQ,CAAC,OAAO;wBAChB,oBAAoB,CAAC,OAA4B,CAAA;AACjD,wBAAA,WAAU,KAAO;AACf,0BAAE;AACF,0BAAE,OAAO;iBACf;YACF,CAAC,EAAE,EAA2B,CAAA;AAChC,QAAA,CAAA;AAEA;;;;;;AAME;AACF,QAAA,MAAM,uBAAsB,GAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,QAAO,IAAK,EAAE,CAAA;QAE1E,OAAO;YACL,gBAAgB;YAChB,eAAe;YACf,uBAAuB;YACvB,yBAAyB;SAC3B;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import _sfc_main from './number-range-filter2.vue.js';
1
+ import _sfc_main from './number-range-filter.vue2.js';
2
2
  import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, mergeProps, createTextVNode, toDisplayString } from 'vue';
3
3
  import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
@@ -60,4 +60,4 @@ var _sfc_main = defineComponent({
60
60
  });
61
61
 
62
62
  export { _sfc_main as default };
63
- //# sourceMappingURL=number-range-filter2.vue.js.map
63
+ //# sourceMappingURL=number-range-filter.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"number-range-filter2.vue.js","sources":["../../../../../../src/x-modules/facets/components/filters/number-range-filter.vue"],"sourcesContent":["<template>\n <RenderlessFilter\n v-slot=\"{ filter: filterBinding, clickFilter, cssClasses: cssClassesBinding, isDisabled }\"\n :css-classes=\"innerCssClasses\"\n :click-events=\"innerClickEvents\"\n :filter=\"filter\"\n >\n <!--\n @slot The control element to render\n @binding {Filter} filter - The filter data\n @binding {() => void} clickFilter - Method that will invoke the needed actions after the user\n clicks the filter.\n @binding {Object} cssClasses - Object containing CSS classes to add to the button\n @binding {Boolean} isDisabled - True if the filter shouldn't be able to be selected by the\n user\n -->\n <slot\n v-bind=\"{\n filter: filterBinding,\n clickFilter,\n cssClasses: cssClassesBinding,\n isDisabled,\n }\"\n >\n <button\n :aria-checked=\"filterBinding.selected.toString()\"\n :class=\"cssClassesBinding\"\n :disabled=\"isDisabled\"\n data-test=\"filter\"\n role=\"checkbox\"\n v-bind=\"$attrs\"\n @click=\"clickFilter\"\n >\n <!--\n @slot The content to render inside the button\n @binding {Filter} filter - The filter data\n -->\n <slot :filter=\"filter\" name=\"label\">{{ filterBinding.label }}</slot>\n </button>\n </slot>\n </RenderlessFilter>\n</template>\n\n<script lang=\"ts\">\nimport type { NumberRangeFilter as NumberRangeFilterModel } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { computed, defineComponent } from 'vue'\nimport { facetsXModule } from '../../x-module'\nimport RenderlessFilter from './renderless-filter.vue'\n\n/**\n * Renders a number range filter, emitting the needed events when clicked.\n *\n * @public\n */\nexport default defineComponent({\n name: 'NumberRangeFilter',\n xModule: facetsXModule.name,\n components: { RenderlessFilter },\n inheritAttrs: false,\n props: {\n /** The filter data to render. */\n filter: {\n type: Object as PropType<NumberRangeFilterModel>,\n required: true,\n },\n /**\n * Additional events, with their payload, to emit when the filter is clicked.\n *\n * @public\n */\n clickEvents: Object as PropType<Partial<XEventsTypes>>,\n /** Inheritance CSS classes. */\n cssClasses: {\n type: Array as PropType<(string | Dictionary<boolean>)[]>,\n default: () => [],\n },\n },\n setup(props: any) {\n /**\n * The {@link XEventsTypes} to emit.\n *\n * @returns The events to emit when clicked.\n * @internal\n */\n const innerClickEvents = computed(() => ({\n UserClickedANumberRangeFilter: props.filter,\n ...props.clickEvents,\n }))\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n const innerCssClasses = computed(() => [\n 'x-number-range-filter',\n { 'x-number-range-filter--is-selected': props.filter.selected },\n ...props.cssClasses,\n ])\n\n return {\n innerClickEvents,\n innerCssClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserClickedAFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n- [`UserClickedANumberRangeFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n\n## See it in action\n\nThis component renders a button which, on clicked, emits the `UserClickedAFilter` and the\n`UserClickedANumberRangeFilter` events. By default, it renders the filter label as the button text.\n\nThe `filter` prop is required. The `clickEvents` prop is optional and allows configuring the events\nto emit on click.\n\n```vue\n<template>\n <NumberRangeFilter :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { NumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `price:1-10`,\n modelName: 'NumberRangeFilter',\n label: `From 1 to 10`,\n facetId: 'price',\n range: {\n min: 1,\n max: 10,\n },\n selected: false,\n})\n</script>\n```\n\n### Playing with props\n\nConfiguring the events to emit when the filter is clicked.\n\n```vue\n<template>\n <NumberRangeFilter :clickEvents=\"{ UserClickedANumberRangeFilter: filter }\" :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { NumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `price:1-10`,\n modelName: 'NumberRangeFilter',\n label: `From 1 to 10`,\n facetId: 'price',\n range: {\n min: 1,\n max: 10,\n },\n selected: false,\n})\n</script>\n```\n\n### Customizing its contents\n\n```vue\n<template>\n <NumberRangeFilter :filter=\"filter\" v-slot=\"{ filter }\">\n <img src=\"checkbox.png\" />\n <span>{{ filter.label }}</span>\n </NumberRangeFilter>\n</template>\n\n<script setup>\nimport { NumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `price:1-10`,\n modelName: 'NumberRangeFilter',\n label: `From 1 to 10`,\n facetId: 'price',\n range: {\n min: 1,\n max: 10,\n },\n selected: false,\n})\n</script>\n```\n</docs>\n"],"names":["RenderlessFilter"],"mappings":";;;;AAoDA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,oBAAEA,WAAe,EAAG;AAChC,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0C;AAChD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;AAIE;AACF,QAAA,WAAW,EAAE,MAAyC;;AAEtD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,KAAmD;AACzD,YAAA,OAAO,EAAE,MAAM,EAAE;AAClB,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAU,EAAA;AACd;;;;;AAKE;AACF,QAAA,MAAM,gBAAe,GAAI,QAAQ,CAAC,OAAO;YACvC,6BAA6B,EAAE,KAAK,CAAC,MAAM;YAC3C,GAAG,KAAK,CAAC,WAAW;AACrB,SAAA,CAAC,CAAA;AAEF;;;;;AAKE;AACF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAAC,MAAM;YACrC,uBAAuB;AACvB,YAAA,EAAE,oCAAoC,EAAE,KAAK,CAAC,MAAM,CAAC,QAAO,EAAG;YAC/D,GAAG,KAAK,CAAC,UAAU;AACpB,SAAA,CAAA;QAED,OAAO;YACL,gBAAgB;YAChB,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"number-range-filter.vue2.js","sources":["../../../../../../src/x-modules/facets/components/filters/number-range-filter.vue"],"sourcesContent":["<template>\n <RenderlessFilter\n v-slot=\"{ filter: filterBinding, clickFilter, cssClasses: cssClassesBinding, isDisabled }\"\n :css-classes=\"innerCssClasses\"\n :click-events=\"innerClickEvents\"\n :filter=\"filter\"\n >\n <!--\n @slot The control element to render\n @binding {Filter} filter - The filter data\n @binding {() => void} clickFilter - Method that will invoke the needed actions after the user\n clicks the filter.\n @binding {Object} cssClasses - Object containing CSS classes to add to the button\n @binding {Boolean} isDisabled - True if the filter shouldn't be able to be selected by the\n user\n -->\n <slot\n v-bind=\"{\n filter: filterBinding,\n clickFilter,\n cssClasses: cssClassesBinding,\n isDisabled,\n }\"\n >\n <button\n :aria-checked=\"filterBinding.selected.toString()\"\n :class=\"cssClassesBinding\"\n :disabled=\"isDisabled\"\n data-test=\"filter\"\n role=\"checkbox\"\n v-bind=\"$attrs\"\n @click=\"clickFilter\"\n >\n <!--\n @slot The content to render inside the button\n @binding {Filter} filter - The filter data\n -->\n <slot :filter=\"filter\" name=\"label\">{{ filterBinding.label }}</slot>\n </button>\n </slot>\n </RenderlessFilter>\n</template>\n\n<script lang=\"ts\">\nimport type { NumberRangeFilter as NumberRangeFilterModel } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { computed, defineComponent } from 'vue'\nimport { facetsXModule } from '../../x-module'\nimport RenderlessFilter from './renderless-filter.vue'\n\n/**\n * Renders a number range filter, emitting the needed events when clicked.\n *\n * @public\n */\nexport default defineComponent({\n name: 'NumberRangeFilter',\n xModule: facetsXModule.name,\n components: { RenderlessFilter },\n inheritAttrs: false,\n props: {\n /** The filter data to render. */\n filter: {\n type: Object as PropType<NumberRangeFilterModel>,\n required: true,\n },\n /**\n * Additional events, with their payload, to emit when the filter is clicked.\n *\n * @public\n */\n clickEvents: Object as PropType<Partial<XEventsTypes>>,\n /** Inheritance CSS classes. */\n cssClasses: {\n type: Array as PropType<(string | Dictionary<boolean>)[]>,\n default: () => [],\n },\n },\n setup(props: any) {\n /**\n * The {@link XEventsTypes} to emit.\n *\n * @returns The events to emit when clicked.\n * @internal\n */\n const innerClickEvents = computed(() => ({\n UserClickedANumberRangeFilter: props.filter,\n ...props.clickEvents,\n }))\n\n /**\n * Dynamic CSS classes to apply to the component.\n *\n * @returns The dynamic CSS classes to apply to the component.\n * @internal\n */\n const innerCssClasses = computed(() => [\n 'x-number-range-filter',\n { 'x-number-range-filter--is-selected': props.filter.selected },\n ...props.cssClasses,\n ])\n\n return {\n innerClickEvents,\n innerCssClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserClickedAFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n- [`UserClickedANumberRangeFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n\n## See it in action\n\nThis component renders a button which, on clicked, emits the `UserClickedAFilter` and the\n`UserClickedANumberRangeFilter` events. By default, it renders the filter label as the button text.\n\nThe `filter` prop is required. The `clickEvents` prop is optional and allows configuring the events\nto emit on click.\n\n```vue\n<template>\n <NumberRangeFilter :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { NumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `price:1-10`,\n modelName: 'NumberRangeFilter',\n label: `From 1 to 10`,\n facetId: 'price',\n range: {\n min: 1,\n max: 10,\n },\n selected: false,\n})\n</script>\n```\n\n### Playing with props\n\nConfiguring the events to emit when the filter is clicked.\n\n```vue\n<template>\n <NumberRangeFilter :clickEvents=\"{ UserClickedANumberRangeFilter: filter }\" :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { NumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `price:1-10`,\n modelName: 'NumberRangeFilter',\n label: `From 1 to 10`,\n facetId: 'price',\n range: {\n min: 1,\n max: 10,\n },\n selected: false,\n})\n</script>\n```\n\n### Customizing its contents\n\n```vue\n<template>\n <NumberRangeFilter :filter=\"filter\" v-slot=\"{ filter }\">\n <img src=\"checkbox.png\" />\n <span>{{ filter.label }}</span>\n </NumberRangeFilter>\n</template>\n\n<script setup>\nimport { NumberRangeFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n id: `price:1-10`,\n modelName: 'NumberRangeFilter',\n label: `From 1 to 10`,\n facetId: 'price',\n range: {\n min: 1,\n max: 10,\n },\n selected: false,\n})\n</script>\n```\n</docs>\n"],"names":["RenderlessFilter"],"mappings":";;;;AAoDA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,oBAAEA,WAAe,EAAG;AAChC,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0C;AAChD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD;;;;AAIE;AACF,QAAA,WAAW,EAAE,MAAyC;;AAEtD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,KAAmD;AACzD,YAAA,OAAO,EAAE,MAAM,EAAE;AAClB,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAU,EAAA;AACd;;;;;AAKE;AACF,QAAA,MAAM,gBAAe,GAAI,QAAQ,CAAC,OAAO;YACvC,6BAA6B,EAAE,KAAK,CAAC,MAAM;YAC3C,GAAG,KAAK,CAAC,WAAW;AACrB,SAAA,CAAC,CAAA;AAEF;;;;;AAKE;AACF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAAC,MAAM;YACrC,uBAAuB;AACvB,YAAA,EAAE,oCAAoC,EAAE,KAAK,CAAC,MAAM,CAAC,QAAO,EAAG;YAC/D,GAAG,KAAK,CAAC,UAAU;AACpB,SAAA,CAAA;QAED,OAAO;YACL,gBAAgB;YAChB,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -3,4 +3,4 @@ import _sfc_main from './renderless-filter.vue.js';
3
3
 
4
4
 
5
5
  export { _sfc_main as default };
6
- //# sourceMappingURL=renderless-filter2.vue.js.map
6
+ //# sourceMappingURL=renderless-filter.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderless-filter.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +1,4 @@
1
- import _sfc_main from './simple-filter2.vue.js';
1
+ import _sfc_main from './simple-filter.vue2.js';
2
2
  import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, mergeProps, createTextVNode, toDisplayString } from 'vue';
3
3
  import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
@@ -46,4 +46,4 @@ var _sfc_main = defineComponent({
46
46
  });
47
47
 
48
48
  export { _sfc_main as default };
49
- //# sourceMappingURL=simple-filter2.vue.js.map
49
+ //# sourceMappingURL=simple-filter.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"simple-filter2.vue.js","sources":["../../../../../../src/x-modules/facets/components/filters/simple-filter.vue"],"sourcesContent":["<template>\n <RenderlessFilter\n v-slot=\"{ filter: filterBinding, clickFilter, isDisabled, cssClasses: cssClassesBinding }\"\n :filter=\"filter\"\n :click-events=\"innerClickEvents\"\n :css-classes=\"innerCssClasses\"\n >\n <!--\n @slot The control element to render\n @binding {Filter} filter - The filter data\n @binding {() => void} clickFilter - Method that will invoke the needed actions after the user\n clicks the filter.\n @binding {Boolean} isDisabled - True if the filter shouldn't be able to be selected by the\n user\n @binding {Object} cssClasses - Object containing CSS classes to add to the button\n -->\n <slot\n v-bind=\"{\n filter: filterBinding,\n clickFilter,\n isDisabled,\n cssClasses: cssClassesBinding,\n }\"\n >\n <button\n :aria-checked=\"filterBinding.selected.toString()\"\n :class=\"cssClassesBinding\"\n :disabled=\"isDisabled\"\n data-test=\"filter\"\n role=\"checkbox\"\n v-bind=\"$attrs\"\n @click=\"clickFilter\"\n >\n <!--\n @slot The content to render inside the button\n @binding {Filter} filter - The filter data\n -->\n <slot :filter=\"filter\" name=\"label\">{{ filterBinding.label }}</slot>\n </button>\n </slot>\n </RenderlessFilter>\n</template>\n\n<script lang=\"ts\">\nimport type { SimpleFilter as SimpleFilterModel } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { computed, defineComponent } from 'vue'\nimport { facetsXModule } from '../../x-module'\nimport RenderlessFilter from './renderless-filter.vue'\n\n/**\n * Renders a simple filter, emitting the needed events when clicked.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SimpleFilter',\n xModule: facetsXModule.name,\n components: { RenderlessFilter },\n inheritAttrs: false,\n props: {\n /** The filter data to render. */\n filter: {\n type: Object as PropType<SimpleFilterModel>,\n required: true,\n },\n /** Additional events, with their payload, to emit when the filter is clicked. */\n clickEvents: Object as PropType<Partial<XEventsTypes>>,\n /** Inheritance CSS classes. */\n cssClasses: {\n type: Array as PropType<(string | Dictionary<boolean>)[]>,\n default: () => [],\n },\n },\n setup(props) {\n /** The {@link XEventsTypes} to emit. */\n const innerClickEvents = computed(() => ({\n UserClickedASimpleFilter: props.filter,\n ...props.clickEvents,\n }))\n\n /** CSS classes to apply to the element. */\n const innerCssClasses = computed(() => [\n 'x-simple-filter',\n { 'x-simple-filter--is-selected': props.filter.selected },\n ...props.cssClasses,\n ])\n\n return {\n innerClickEvents,\n innerCssClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedAFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n- [`UserClickedASimpleFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n\n## See it in action\n\nThis component renders a button, which on clicked emits the `UserClickedAFilter` and the\n`UserClickedASimpleFilter` events. By default, it renders a `button` with the `filter.label`\nproperty as text.\n\nThe `filter` prop is required. The `clickEvents` prop is optional and allows configuring the events\nto emit on click.\n\n```vue\n<template>\n <SimpleFilter :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n totalResults: 10,\n})\n</script>\n```\n\n### Playing with props\n\nConfiguring the events to emit when the filter is clicked.\n\n```vue\n<template>\n <SimpleFilter :clickEvents=\"{ UserClickedASimpleFilter: filter }\" :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n totalResults: 10,\n})\n</script>\n```\n\n### Rendering an input\n\nYou can change the rendered control using the default slot. Note that because of the current Vue\nlimitations, you must only render one single root node in this slot. There you will receive all the\ndata and methods needed:\n\n```vue\n<template>\n <SimpleFilter v-slot=\"{ filter, clickFilter, isDisabled, cssClasses }\" :filter=\"filter\">\n <label :class=\"cssClasses\">\n <input :checked=\"filter.selected\" type=\"checkbox\" @change=\"clickFilter\" />\n {{ filter.label }}\n </label>\n </SimpleFilter>\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n label: 'Shirts',\n totalResults: 10,\n})\n</script>\n```\n\n### Changing default button content\n\nYou can change the content rendered by the default button using the `label` slot. There you will\nreceive the filter data.\n\n```vue\n<template>\n <SimpleFilter :filter=\"filter\">\n <template #label=\"{ filter }\">\n <img :src=\"`imgs/filters/${filter.id}.png`\" />\n <span>{{ filter.label }}</span>\n </template>\n </SimpleFilter>\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n label: 'Shirts',\n totalResults: 10,\n})\n</script>\n```\n</docs>\n"],"names":["RenderlessFilter"],"mappings":";;;;AAoDA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,oBAAEA,WAAe,EAAG;AAChC,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAqC;AAC3C,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,WAAW,EAAE,MAAyC;;AAEtD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,KAAmD;AACzD,YAAA,OAAO,EAAE,MAAM,EAAE;AAClB,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;;AAET,QAAA,MAAM,gBAAe,GAAI,QAAQ,CAAC,OAAO;YACvC,wBAAwB,EAAE,KAAK,CAAC,MAAM;YACtC,GAAG,KAAK,CAAC,WAAW;AACrB,SAAA,CAAC,CAAA;;AAGF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAAC,MAAM;YACrC,iBAAiB;AACjB,YAAA,EAAE,8BAA8B,EAAE,KAAK,CAAC,MAAM,CAAC,QAAO,EAAG;YACzD,GAAG,KAAK,CAAC,UAAU;AACpB,SAAA,CAAA;QAED,OAAO;YACL,gBAAgB;YAChB,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"simple-filter.vue2.js","sources":["../../../../../../src/x-modules/facets/components/filters/simple-filter.vue"],"sourcesContent":["<template>\n <RenderlessFilter\n v-slot=\"{ filter: filterBinding, clickFilter, isDisabled, cssClasses: cssClassesBinding }\"\n :filter=\"filter\"\n :click-events=\"innerClickEvents\"\n :css-classes=\"innerCssClasses\"\n >\n <!--\n @slot The control element to render\n @binding {Filter} filter - The filter data\n @binding {() => void} clickFilter - Method that will invoke the needed actions after the user\n clicks the filter.\n @binding {Boolean} isDisabled - True if the filter shouldn't be able to be selected by the\n user\n @binding {Object} cssClasses - Object containing CSS classes to add to the button\n -->\n <slot\n v-bind=\"{\n filter: filterBinding,\n clickFilter,\n isDisabled,\n cssClasses: cssClassesBinding,\n }\"\n >\n <button\n :aria-checked=\"filterBinding.selected.toString()\"\n :class=\"cssClassesBinding\"\n :disabled=\"isDisabled\"\n data-test=\"filter\"\n role=\"checkbox\"\n v-bind=\"$attrs\"\n @click=\"clickFilter\"\n >\n <!--\n @slot The content to render inside the button\n @binding {Filter} filter - The filter data\n -->\n <slot :filter=\"filter\" name=\"label\">{{ filterBinding.label }}</slot>\n </button>\n </slot>\n </RenderlessFilter>\n</template>\n\n<script lang=\"ts\">\nimport type { SimpleFilter as SimpleFilterModel } from '@empathyco/x-types'\nimport type { Dictionary } from '@empathyco/x-utils'\nimport type { PropType } from 'vue'\nimport type { XEventsTypes } from '../../../../wiring/events.types'\nimport { computed, defineComponent } from 'vue'\nimport { facetsXModule } from '../../x-module'\nimport RenderlessFilter from './renderless-filter.vue'\n\n/**\n * Renders a simple filter, emitting the needed events when clicked.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SimpleFilter',\n xModule: facetsXModule.name,\n components: { RenderlessFilter },\n inheritAttrs: false,\n props: {\n /** The filter data to render. */\n filter: {\n type: Object as PropType<SimpleFilterModel>,\n required: true,\n },\n /** Additional events, with their payload, to emit when the filter is clicked. */\n clickEvents: Object as PropType<Partial<XEventsTypes>>,\n /** Inheritance CSS classes. */\n cssClasses: {\n type: Array as PropType<(string | Dictionary<boolean>)[]>,\n default: () => [],\n },\n },\n setup(props) {\n /** The {@link XEventsTypes} to emit. */\n const innerClickEvents = computed(() => ({\n UserClickedASimpleFilter: props.filter,\n ...props.clickEvents,\n }))\n\n /** CSS classes to apply to the element. */\n const innerCssClasses = computed(() => [\n 'x-simple-filter',\n { 'x-simple-filter--is-selected': props.filter.selected },\n ...props.cssClasses,\n ])\n\n return {\n innerClickEvents,\n innerCssClasses,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedAFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n- [`UserClickedASimpleFilter`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button, using the `filter` prop as its payload.\n\n## See it in action\n\nThis component renders a button, which on clicked emits the `UserClickedAFilter` and the\n`UserClickedASimpleFilter` events. By default, it renders a `button` with the `filter.label`\nproperty as text.\n\nThe `filter` prop is required. The `clickEvents` prop is optional and allows configuring the events\nto emit on click.\n\n```vue\n<template>\n <SimpleFilter :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n totalResults: 10,\n})\n</script>\n```\n\n### Playing with props\n\nConfiguring the events to emit when the filter is clicked.\n\n```vue\n<template>\n <SimpleFilter :clickEvents=\"{ UserClickedASimpleFilter: filter }\" :filter=\"filter\" />\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n totalResults: 10,\n})\n</script>\n```\n\n### Rendering an input\n\nYou can change the rendered control using the default slot. Note that because of the current Vue\nlimitations, you must only render one single root node in this slot. There you will receive all the\ndata and methods needed:\n\n```vue\n<template>\n <SimpleFilter v-slot=\"{ filter, clickFilter, isDisabled, cssClasses }\" :filter=\"filter\">\n <label :class=\"cssClasses\">\n <input :checked=\"filter.selected\" type=\"checkbox\" @change=\"clickFilter\" />\n {{ filter.label }}\n </label>\n </SimpleFilter>\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n label: 'Shirts',\n totalResults: 10,\n})\n</script>\n```\n\n### Changing default button content\n\nYou can change the content rendered by the default button using the `label` slot. There you will\nreceive the filter data.\n\n```vue\n<template>\n <SimpleFilter :filter=\"filter\">\n <template #label=\"{ filter }\">\n <img :src=\"`imgs/filters/${filter.id}.png`\" />\n <span>{{ filter.label }}</span>\n </template>\n </SimpleFilter>\n</template>\n\n<script setup>\nimport { SimpleFilter } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filter = ref({\n modelName: 'SimpleFilter',\n selected: false,\n id: 'category:shirts',\n value: 'category:shirts',\n facetId: 'category',\n label: 'Shirts',\n totalResults: 10,\n})\n</script>\n```\n</docs>\n"],"names":["RenderlessFilter"],"mappings":";;;;AAoDA;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,oBAAEA,WAAe,EAAG;AAChC,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAqC;AAC3C,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,WAAW,EAAE,MAAyC;;AAEtD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,KAAmD;AACzD,YAAA,OAAO,EAAE,MAAM,EAAE;AAClB,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;;AAET,QAAA,MAAM,gBAAe,GAAI,QAAQ,CAAC,OAAO;YACvC,wBAAwB,EAAE,KAAK,CAAC,MAAM;YACtC,GAAG,KAAK,CAAC,WAAW;AACrB,SAAA,CAAC,CAAA;;AAGF,QAAA,MAAM,eAAc,GAAI,QAAQ,CAAC,MAAM;YACrC,iBAAiB;AACjB,YAAA,EAAE,8BAA8B,EAAE,KAAK,CAAC,MAAM,CAAC,QAAO,EAAG;YACzD,GAAG,KAAK,CAAC,UAAU;AACpB,SAAA,CAAA;QAED,OAAO;YACL,gBAAgB;YAChB,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -3,4 +3,4 @@ import _sfc_main from './exclude-filters-with-no-results.vue.js';
3
3
 
4
4
 
5
5
  export { _sfc_main as default };
6
- //# sourceMappingURL=exclude-filters-with-no-results2.vue.js.map
6
+ //# sourceMappingURL=exclude-filters-with-no-results.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exclude-filters-with-no-results.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,6 +1,6 @@
1
- import _sfc_main from './filters-list2.vue.js';
1
+ import _sfc_main from './filters-list.vue2.js';
2
2
  import { openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, createElementBlock, Fragment, renderList, renderSlot, createCommentVNode } from 'vue';
3
- import './filters-list3.vue.js';
3
+ import './filters-list.vue3.js';
4
4
  import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
5
5
 
6
6
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -81,4 +81,4 @@ var _sfc_main = defineComponent({
81
81
  });
82
82
 
83
83
  export { _sfc_main as default };
84
- //# sourceMappingURL=filters-list2.vue.js.map
84
+ //# sourceMappingURL=filters-list.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filters-list2.vue.js","sources":["../../../../../../src/x-modules/facets/components/lists/filters-list.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n v-if=\"hasFiltersToRender\"\n tag=\"ul\"\n class=\"x-filters\"\n :class=\"cssClasses\"\n data-test=\"base-filters\"\n >\n <li\n v-for=\"filter in renderedFilters\"\n :key=\"filter.id\"\n class=\"x-filters__item\"\n data-test=\"base-filters-item\"\n >\n <!--\n @slot (Required) Filter content\n @binding {Filter} filter - Search-types filter data.\n -->\n <slot :filter=\"filter\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Filter } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../../../utils/types'\nimport { computed, defineComponent } from 'vue'\nimport { AnimationProp } from '../../../../types/animation-prop'\nimport { useFiltersInjection } from '../../composables/use-filters-injection'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * Renders a list with a list item per each\n * {@link @empathyco/x-types#BooleanFilter} in the filters prop array.\n * Each list item has a scoped slot, passing the filter as slot prop.\n *\n * @public\n */\nexport default defineComponent({\n name: 'FiltersList',\n xModule: facetsXModule.name,\n props: {\n /**\n * The list of filters to be rendered as slots.\n *\n * @public\n */\n filters: Array as PropType<Filter[]>,\n\n /**\n * This prop is used in the `HierarchicalFilter` component and only in that case. It is necessary\n * to make the `renderedFilters` to return only the filters of each level of the hierarchy.\n *\n * @public\n */\n parentId: {\n type: String as PropType<Filter['id']>,\n required: false,\n },\n\n /**\n * Animation component that will be used to animate the base filters.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n },\n setup(props) {\n const renderedFilters = useFiltersInjection(props)\n\n /**\n * It handles if the filters should be rendered.\n *\n * @returns True if there are filters.\n *\n * @public\n */\n const hasFiltersToRender = computed(() => {\n return renderedFilters?.value.length > 0\n })\n\n /**\n * Checks if at least one filter is selected.\n *\n * @returns True if at least one filter is selected. False otherwise.\n * @internal\n */\n const hasSelectedFilters = computed(() => {\n return !!renderedFilters?.value.some(filter => filter.selected)\n })\n\n /**\n * Dynamic CSS classes for the root element of this component.\n *\n * @returns An object containing the dynamic CSS classes and a boolean indicating if they should\n * be added or not.\n */\n const cssClasses = computed((): VueCSSClasses => {\n return {\n 'x-filters--has-selected-filters': hasSelectedFilters.value,\n }\n })\n\n return {\n hasFiltersToRender,\n cssClasses,\n renderedFilters,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-filters {\n list-style-type: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nRenders a list with a list item per each filter in the filters prop array. Each list item has a\nscoped slot, passing the filter as slot prop.\n\n### Important\n\nThe component has two ways of receive the filters list, it can be injected by another component or\nbe send it as a prop. If the component doesnt have a parent component that receive and exposed a\nfilters list to their children, it is mandatory to send it as prop.\n\n### Basic usage\n\nUsing default slot:\n\n```vue\n<template>\n <FiltersList :filters=\"filters\">\n <template #default=\"{ filter }\">\n <p>{{ filter.label }}</p>\n </template>\n </FiltersList>\n</template>\n\n<script setup>\nimport { FiltersList } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filters = ref([\n { id: '1', label: 'Filter 1', modelName: 'SimpleFilter', selected: false },\n { id: '2', label: 'Filter 2', modelName: 'SimpleFilter', selected: false },\n])\n</script>\n```\n\nUsing default slot abbreviated syntax:\n\n```vue\n<template>\n <FiltersList :filters=\"filters\" v-slot=\"{ filter }\">\n <p>{{ filter.label }}</p>\n </FiltersList>\n</template>\n\n<script setup>\nimport { FiltersList } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filters = ref([\n { id: '1', label: 'Filter 1', modelName: 'SimpleFilter', selected: false },\n { id: '2', label: 'Filter 2', modelName: 'SimpleFilter', selected: false },\n])\n</script>\n```\n\n> **Using injection**: It can receive the filters list by injection. It only works if it has a\n> parent component that receives and exposes the filters list. Using the injection, It is not\n> necessary to send the prop to the child components, it has to be send it in the parent component ,\n> the rest of components will inject this list.\n\n```vue\n<template>\n <SlicedFilters :filters=\"filters\">\n <FiltersList v-slot=\"{ filter }\">\n <p>{{ filter.label }}</p>\n </FiltersList>\n </SlicedFilters>\n</template>\n\n<script setup>\nimport { SlicedFilters, FiltersList } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filters = ref([\n { id: '1', label: 'Filter 1', modelName: 'SimpleFilter', selected: false },\n { id: '2', label: 'Filter 2', modelName: 'SimpleFilter', selected: false },\n])\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAiCA;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,OAAO,EAAE,KAA2B;AAEpC;;;;;AAKE;AACF,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAAgC;AACtC,YAAA,QAAQ,EAAE,KAAK;AAChB,SAAA;AAED;;;;AAIE;AACF,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,eAAc,GAAI,mBAAmB,CAAC,KAAK,CAAA;AAEjD;;;;;;AAME;AACF,QAAA,MAAM,kBAAiB,GAAI,QAAQ,CAAC,MAAI;AACtC,YAAA,OAAO,eAAe,EAAE,KAAK,CAAC,SAAS,CAAA;AACzC,QAAA,CAAC,CAAA;AAED;;;;;AAKE;AACF,QAAA,MAAM,kBAAiB,GAAI,QAAQ,CAAC,MAAI;AACtC,YAAA,OAAO,CAAC,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,MAAK,IAAK,MAAM,CAAC,QAAQ,CAAA;AAChE,QAAA,CAAC,CAAA;AAED;;;;;AAKE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAAmB;YAC7C,OAAO;gBACL,iCAAiC,EAAE,kBAAkB,CAAC,KAAK;aAC7D;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,kBAAkB;YAClB,UAAU;YACV,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"filters-list.vue2.js","sources":["../../../../../../src/x-modules/facets/components/lists/filters-list.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n v-if=\"hasFiltersToRender\"\n tag=\"ul\"\n class=\"x-filters\"\n :class=\"cssClasses\"\n data-test=\"base-filters\"\n >\n <li\n v-for=\"filter in renderedFilters\"\n :key=\"filter.id\"\n class=\"x-filters__item\"\n data-test=\"base-filters-item\"\n >\n <!--\n @slot (Required) Filter content\n @binding {Filter} filter - Search-types filter data.\n -->\n <slot :filter=\"filter\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Filter } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../../../utils/types'\nimport { computed, defineComponent } from 'vue'\nimport { AnimationProp } from '../../../../types/animation-prop'\nimport { useFiltersInjection } from '../../composables/use-filters-injection'\nimport { facetsXModule } from '../../x-module'\n\n/**\n * Renders a list with a list item per each\n * {@link @empathyco/x-types#BooleanFilter} in the filters prop array.\n * Each list item has a scoped slot, passing the filter as slot prop.\n *\n * @public\n */\nexport default defineComponent({\n name: 'FiltersList',\n xModule: facetsXModule.name,\n props: {\n /**\n * The list of filters to be rendered as slots.\n *\n * @public\n */\n filters: Array as PropType<Filter[]>,\n\n /**\n * This prop is used in the `HierarchicalFilter` component and only in that case. It is necessary\n * to make the `renderedFilters` to return only the filters of each level of the hierarchy.\n *\n * @public\n */\n parentId: {\n type: String as PropType<Filter['id']>,\n required: false,\n },\n\n /**\n * Animation component that will be used to animate the base filters.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n },\n setup(props) {\n const renderedFilters = useFiltersInjection(props)\n\n /**\n * It handles if the filters should be rendered.\n *\n * @returns True if there are filters.\n *\n * @public\n */\n const hasFiltersToRender = computed(() => {\n return renderedFilters?.value.length > 0\n })\n\n /**\n * Checks if at least one filter is selected.\n *\n * @returns True if at least one filter is selected. False otherwise.\n * @internal\n */\n const hasSelectedFilters = computed(() => {\n return !!renderedFilters?.value.some(filter => filter.selected)\n })\n\n /**\n * Dynamic CSS classes for the root element of this component.\n *\n * @returns An object containing the dynamic CSS classes and a boolean indicating if they should\n * be added or not.\n */\n const cssClasses = computed((): VueCSSClasses => {\n return {\n 'x-filters--has-selected-filters': hasSelectedFilters.value,\n }\n })\n\n return {\n hasFiltersToRender,\n cssClasses,\n renderedFilters,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-filters {\n list-style-type: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nRenders a list with a list item per each filter in the filters prop array. Each list item has a\nscoped slot, passing the filter as slot prop.\n\n### Important\n\nThe component has two ways of receive the filters list, it can be injected by another component or\nbe send it as a prop. If the component doesnt have a parent component that receive and exposed a\nfilters list to their children, it is mandatory to send it as prop.\n\n### Basic usage\n\nUsing default slot:\n\n```vue\n<template>\n <FiltersList :filters=\"filters\">\n <template #default=\"{ filter }\">\n <p>{{ filter.label }}</p>\n </template>\n </FiltersList>\n</template>\n\n<script setup>\nimport { FiltersList } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filters = ref([\n { id: '1', label: 'Filter 1', modelName: 'SimpleFilter', selected: false },\n { id: '2', label: 'Filter 2', modelName: 'SimpleFilter', selected: false },\n])\n</script>\n```\n\nUsing default slot abbreviated syntax:\n\n```vue\n<template>\n <FiltersList :filters=\"filters\" v-slot=\"{ filter }\">\n <p>{{ filter.label }}</p>\n </FiltersList>\n</template>\n\n<script setup>\nimport { FiltersList } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filters = ref([\n { id: '1', label: 'Filter 1', modelName: 'SimpleFilter', selected: false },\n { id: '2', label: 'Filter 2', modelName: 'SimpleFilter', selected: false },\n])\n</script>\n```\n\n> **Using injection**: It can receive the filters list by injection. It only works if it has a\n> parent component that receives and exposes the filters list. Using the injection, It is not\n> necessary to send the prop to the child components, it has to be send it in the parent component ,\n> the rest of components will inject this list.\n\n```vue\n<template>\n <SlicedFilters :filters=\"filters\">\n <FiltersList v-slot=\"{ filter }\">\n <p>{{ filter.label }}</p>\n </FiltersList>\n </SlicedFilters>\n</template>\n\n<script setup>\nimport { SlicedFilters, FiltersList } from '@empathyco/x-components/facets'\nimport { ref } from 'vue'\n\nconst filters = ref([\n { id: '1', label: 'Filter 1', modelName: 'SimpleFilter', selected: false },\n { id: '2', label: 'Filter 2', modelName: 'SimpleFilter', selected: false },\n])\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAiCA;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,OAAO,EAAE,KAA2B;AAEpC;;;;;AAKE;AACF,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAAgC;AACtC,YAAA,QAAQ,EAAE,KAAK;AAChB,SAAA;AAED;;;;AAIE;AACF,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,eAAc,GAAI,mBAAmB,CAAC,KAAK,CAAA;AAEjD;;;;;;AAME;AACF,QAAA,MAAM,kBAAiB,GAAI,QAAQ,CAAC,MAAI;AACtC,YAAA,OAAO,eAAe,EAAE,KAAK,CAAC,SAAS,CAAA;AACzC,QAAA,CAAC,CAAA;AAED;;;;;AAKE;AACF,QAAA,MAAM,kBAAiB,GAAI,QAAQ,CAAC,MAAI;AACtC,YAAA,OAAO,CAAC,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,MAAK,IAAK,MAAM,CAAC,QAAQ,CAAA;AAChE,QAAA,CAAC,CAAA;AAED;;;;;AAKE;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAC,MAAmB;YAC7C,OAAO;gBACL,iCAAiC,EAAE,kBAAkB,CAAC,KAAK;aAC7D;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,kBAAkB;YAClB,UAAU;YACV,eAAe;SACjB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -4,4 +4,4 @@ var css = ".x-filters[data-v-98350b91]{list-style-type:none}";
4
4
  injectCss(css);
5
5
 
6
6
  export { css };
7
- //# sourceMappingURL=filters-list3.vue.js.map
7
+ //# sourceMappingURL=filters-list.vue3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-list.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,6 +1,6 @@
1
- import _sfc_main from './filters-search2.vue.js';
1
+ import _sfc_main from './filters-search.vue2.js';
2
2
  import { openBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, createElementVNode } from 'vue';
3
- import './filters-search3.vue.js';
3
+ import './filters-search.vue3.js';
4
4
  import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.js';
5
5
 
6
6
  const _hoisted_1 = ["value"];
@@ -100,4 +100,4 @@ var _sfc_main = defineComponent({
100
100
  });
101
101
 
102
102
  export { _sfc_main as default };
103
- //# sourceMappingURL=filters-search2.vue.js.map
103
+ //# sourceMappingURL=filters-search.vue2.js.map