@empathyco/x-components 6.0.0-alpha.184 → 6.0.0-alpha.185

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 (631) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/docs/API-reference/api/x-components.aioverview.md +22 -8
  3. package/docs/API-reference/api/x-components.allfilter.md +6 -4
  4. package/docs/API-reference/api/x-components.animatewidth.md +1 -1
  5. package/docs/API-reference/api/x-components.autoprogressbar.md +5 -5
  6. package/docs/API-reference/api/x-components.banner.md +5 -5
  7. package/docs/API-reference/api/x-components.bannerslist.md +5 -5
  8. package/docs/API-reference/api/x-components.baseaddtocart.md +6 -4
  9. package/docs/API-reference/api/x-components.basecolumnpickerdropdown.md +8 -6
  10. package/docs/API-reference/api/x-components.basecolumnpickerlist.md +7 -5
  11. package/docs/API-reference/api/x-components.basecurrency.md +4 -4
  12. package/docs/API-reference/api/x-components.basedropdown.md +12 -12
  13. package/docs/API-reference/api/x-components.baseeventbutton.md +5 -5
  14. package/docs/API-reference/api/x-components.baseeventsmodal.md +10 -8
  15. package/docs/API-reference/api/x-components.baseeventsmodalclose.md +7 -5
  16. package/docs/API-reference/api/x-components.baseeventsmodalopen.md +7 -5
  17. package/docs/API-reference/api/x-components.basegrid.md +9 -7
  18. package/docs/API-reference/api/x-components.baseheadertogglepanel.md +9 -7
  19. package/docs/API-reference/api/x-components.baseidmodal.md +8 -6
  20. package/docs/API-reference/api/x-components.baseidmodalclose.md +4 -4
  21. package/docs/API-reference/api/x-components.baseidmodalopen.md +4 -4
  22. package/docs/API-reference/api/x-components.baseidtogglepanel.md +8 -6
  23. package/docs/API-reference/api/x-components.baseidtogglepanelbutton.md +7 -5
  24. package/docs/API-reference/api/x-components.basekeyboardnavigation.md +6 -6
  25. package/docs/API-reference/api/x-components.basemodal.md +9 -9
  26. package/docs/API-reference/api/x-components.basepricefilterlabel.md +6 -4
  27. package/docs/API-reference/api/x-components.baserating.md +7 -5
  28. package/docs/API-reference/api/x-components.baseratingfilterlabel.md +7 -5
  29. package/docs/API-reference/api/x-components.baseresultcurrentprice.md +6 -4
  30. package/docs/API-reference/api/x-components.baseresultimage.md +9 -9
  31. package/docs/API-reference/api/x-components.baseresultlink.md +5 -5
  32. package/docs/API-reference/api/x-components.baseresultpreviousprice.md +5 -3
  33. package/docs/API-reference/api/x-components.baseresultrating.md +7 -5
  34. package/docs/API-reference/api/x-components.basescroll.md +7 -7
  35. package/docs/API-reference/api/x-components.baseslider.md +7 -7
  36. package/docs/API-reference/api/x-components.basesuggestion.md +8 -6
  37. package/docs/API-reference/api/x-components.basesuggestions.md +5 -5
  38. package/docs/API-reference/api/x-components.baseswitch.md +6 -6
  39. package/docs/API-reference/api/x-components.basetabspanel.md +6 -6
  40. package/docs/API-reference/api/x-components.baseteleport.md +6 -6
  41. package/docs/API-reference/api/x-components.basetogglepanel.md +4 -4
  42. package/docs/API-reference/api/x-components.basevariablecolumngrid.md +7 -5
  43. package/docs/API-reference/api/x-components.changeheight.md +2 -2
  44. package/docs/API-reference/api/x-components.clearfilters.md +7 -5
  45. package/docs/API-reference/api/x-components.clearhistoryqueries.md +3 -1
  46. package/docs/API-reference/api/x-components.clearsearchinput.md +7 -1
  47. package/docs/API-reference/api/x-components.closemainmodal.md +3 -1
  48. package/docs/API-reference/api/x-components.collapseheight.md +5 -5
  49. package/docs/API-reference/api/x-components.collapsewidth.md +5 -5
  50. package/docs/API-reference/api/x-components.crossfade.md +4 -4
  51. package/docs/API-reference/api/x-components.devicedetector.md +9 -5
  52. package/docs/API-reference/api/x-components.displayclickprovider.md +5 -5
  53. package/docs/API-reference/api/x-components.displayemitter.md +4 -4
  54. package/docs/API-reference/api/x-components.editablenumberrangefilter.md +7 -7
  55. package/docs/API-reference/api/x-components.empathize.md +6 -6
  56. package/docs/API-reference/api/x-components.excludefilterswithnoresults.md +4 -4
  57. package/docs/API-reference/api/x-components.experiencecontrols.md +1 -1
  58. package/docs/API-reference/api/x-components.extraparams.md +3 -3
  59. package/docs/API-reference/api/x-components.facets.md +5 -5
  60. package/docs/API-reference/api/x-components.facetsprovider.md +4 -4
  61. package/docs/API-reference/api/x-components.fade.md +4 -4
  62. package/docs/API-reference/api/x-components.fadeandslide.md +5 -5
  63. package/docs/API-reference/api/x-components.fallbackdisclaimer.md +1 -1
  64. package/docs/API-reference/api/x-components.filterslist.md +5 -5
  65. package/docs/API-reference/api/x-components.filterssearch.md +6 -6
  66. package/docs/API-reference/api/x-components.fixedheaderandasideslayout.md +9 -5
  67. package/docs/API-reference/api/x-components.globalxbus.md +3 -3
  68. package/docs/API-reference/api/x-components.hierarchicalfilter.md +8 -5
  69. package/docs/API-reference/api/x-components.highlight_2.md +5 -5
  70. package/docs/API-reference/api/x-components.historyqueries.md +4 -1
  71. package/docs/API-reference/api/x-components.historyqueriesswitch.md +3 -1
  72. package/docs/API-reference/api/x-components.historyquery.md +8 -5
  73. package/docs/API-reference/api/x-components.identifierresult.md +4 -4
  74. package/docs/API-reference/api/x-components.identifierresults.md +5 -5
  75. package/docs/API-reference/api/x-components.itemslist.md +5 -5
  76. package/docs/API-reference/api/x-components.locationprovider.md +4 -4
  77. package/docs/API-reference/api/x-components.mainmodal.md +6 -4
  78. package/docs/API-reference/api/x-components.mainscroll.md +5 -5
  79. package/docs/API-reference/api/x-components.mainscrollitem.md +6 -6
  80. package/docs/API-reference/api/x-components.md +1 -0
  81. package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +9 -5
  82. package/docs/API-reference/api/x-components.myhistory.md +8 -5
  83. package/docs/API-reference/api/x-components.nextqueries.md +8 -5
  84. package/docs/API-reference/api/x-components.nextquerieslist.md +5 -5
  85. package/docs/API-reference/api/x-components.nextquery.md +7 -5
  86. package/docs/API-reference/api/x-components.nextquerypreview.md +4 -4
  87. package/docs/API-reference/api/x-components.noanimation.md +2 -2
  88. package/docs/API-reference/api/x-components.numberrangefilter.md +7 -5
  89. package/docs/API-reference/api/x-components.openmainmodal.md +3 -1
  90. package/docs/API-reference/api/x-components.pageloaderbutton.md +7 -5
  91. package/docs/API-reference/api/x-components.pageselector.md +5 -5
  92. package/docs/API-reference/api/x-components.partialquerybutton.md +5 -5
  93. package/docs/API-reference/api/x-components.partialresultslist.md +5 -5
  94. package/docs/API-reference/api/x-components.popularsearch.md +6 -4
  95. package/docs/API-reference/api/x-components.popularsearches.md +4 -1
  96. package/docs/API-reference/api/x-components.preselectedfilters.md +5 -5
  97. package/docs/API-reference/api/x-components.promoted.md +4 -4
  98. package/docs/API-reference/api/x-components.promotedslist.md +5 -5
  99. package/docs/API-reference/api/x-components.querypreview.md +6 -6
  100. package/docs/API-reference/api/x-components.querypreviewbutton.md +6 -4
  101. package/docs/API-reference/api/x-components.querypreviewlist.md +8 -6
  102. package/docs/API-reference/api/x-components.querysuggestion.md +6 -4
  103. package/docs/API-reference/api/x-components.querysuggestions.md +4 -1
  104. package/docs/API-reference/api/x-components.recommendations.md +5 -5
  105. package/docs/API-reference/api/x-components.redirection.md +6 -6
  106. package/docs/API-reference/api/x-components.relatedprompt.md +9 -4
  107. package/docs/API-reference/api/x-components.relatedpromptslist.md +5 -5
  108. package/docs/API-reference/api/x-components.relatedpromptstaglist.md +11 -7
  109. package/docs/API-reference/api/x-components.relatedtag.md +6 -6
  110. package/docs/API-reference/api/x-components.relatedtags.md +7 -5
  111. package/docs/API-reference/api/x-components.removehistoryquery.md +6 -4
  112. package/docs/API-reference/api/x-components.renderlessextraparams.md +4 -4
  113. package/docs/API-reference/api/x-components.renderlessfilter.md +5 -5
  114. package/docs/API-reference/api/x-components.resultslist.md +6 -6
  115. package/docs/API-reference/api/x-components.resultvariantselector.md +6 -6
  116. package/docs/API-reference/api/x-components.resultvariantsprovider.md +5 -5
  117. package/docs/API-reference/api/x-components.scroll.md +8 -6
  118. package/docs/API-reference/api/x-components.scrolltotop.md +7 -5
  119. package/docs/API-reference/api/x-components.searchbutton.md +2 -2
  120. package/docs/API-reference/api/x-components.searchinput.md +6 -6
  121. package/docs/API-reference/api/x-components.searchinputplaceholder.md +6 -6
  122. package/docs/API-reference/api/x-components.selectedfilters.md +5 -5
  123. package/docs/API-reference/api/x-components.selectedfilterslist.md +7 -5
  124. package/docs/API-reference/api/x-components.semanticqueries.md +4 -1
  125. package/docs/API-reference/api/x-components.semanticquery.md +6 -4
  126. package/docs/API-reference/api/x-components.simplefilter.md +7 -5
  127. package/docs/API-reference/api/x-components.singlecolumnlayout.md +10 -5
  128. package/docs/API-reference/api/x-components.slicedfilters.md +6 -6
  129. package/docs/API-reference/api/x-components.slidingpanel.md +8 -8
  130. package/docs/API-reference/api/x-components.snippetcallbacks.md +3 -1
  131. package/docs/API-reference/api/x-components.snippetconfigextraparams.md +8 -6
  132. package/docs/API-reference/api/x-components.sortdropdown.md +8 -6
  133. package/docs/API-reference/api/x-components.sortedfilters.md +4 -4
  134. package/docs/API-reference/api/x-components.sortlist.md +7 -5
  135. package/docs/API-reference/api/x-components.sortpickerlist.md +7 -5
  136. package/docs/API-reference/api/x-components.spellcheck.md +1 -1
  137. package/docs/API-reference/api/x-components.spellcheckbutton.md +2 -2
  138. package/docs/API-reference/api/x-components.staggeredfadeandslide.md +5 -5
  139. package/docs/API-reference/api/x-components.tagging.md +4 -4
  140. package/docs/API-reference/api/x-components.typinghtmlelement.__timeoutid.md +11 -0
  141. package/docs/API-reference/api/x-components.typinghtmlelement.md +19 -0
  142. package/docs/API-reference/api/x-components.urlhandler.md +5 -1
  143. package/js/components/animations/animate-width.vue.js.map +1 -1
  144. package/js/components/animations/collapse-height.vue.js.map +1 -1
  145. package/js/components/animations/collapse-width.vue.js.map +1 -1
  146. package/js/components/animations/cross-fade.vue.js.map +1 -1
  147. package/js/components/animations/fade-and-slide.vue.js.map +1 -1
  148. package/js/components/animations/fade.vue.js.map +1 -1
  149. package/js/components/animations/staggered-fade-and-slide.vue.js.map +1 -1
  150. package/js/components/auto-progress-bar.vue.js.map +1 -1
  151. package/js/components/base-dropdown.vue.js.map +1 -1
  152. package/js/components/base-grid.vue.js.map +1 -1
  153. package/js/components/base-keyboard-navigation.vue.js.map +1 -1
  154. package/js/components/base-rating.vue.js.map +1 -1
  155. package/js/components/base-slider.vue.js +16 -18
  156. package/js/components/base-slider.vue.js.map +1 -1
  157. package/js/components/base-switch.vue.js +10 -13
  158. package/js/components/base-switch.vue.js.map +1 -1
  159. package/js/components/base-teleport.vue.js.map +1 -1
  160. package/js/components/base-variable-column-grid.vue.js.map +1 -1
  161. package/js/components/column-picker/base-column-picker-dropdown.vue.js.map +1 -1
  162. package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
  163. package/js/components/currency/base-currency.vue.js.map +1 -1
  164. package/js/components/filters/labels/base-rating-filter-label.vue.js.map +1 -1
  165. package/js/components/highlight.vue.js.map +1 -1
  166. package/js/components/icons/ai-star.vue.js +19 -22
  167. package/js/components/icons/ai-star.vue.js.map +1 -1
  168. package/js/components/icons/arrow-down.vue.js +16 -19
  169. package/js/components/icons/arrow-down.vue.js.map +1 -1
  170. package/js/components/icons/arrow-left.vue.js +16 -19
  171. package/js/components/icons/arrow-left.vue.js.map +1 -1
  172. package/js/components/icons/arrow-right.vue.js +16 -19
  173. package/js/components/icons/arrow-right.vue.js.map +1 -1
  174. package/js/components/icons/arrow-up.vue.js +16 -19
  175. package/js/components/icons/arrow-up.vue.js.map +1 -1
  176. package/js/components/icons/bag.vue.js +16 -19
  177. package/js/components/icons/bag.vue.js.map +1 -1
  178. package/js/components/icons/bar-code.vue.js +8 -10
  179. package/js/components/icons/bar-code.vue.js.map +1 -1
  180. package/js/components/icons/barcode-tiny.vue.js +8 -10
  181. package/js/components/icons/barcode-tiny.vue.js.map +1 -1
  182. package/js/components/icons/cart-filled.vue.js +21 -25
  183. package/js/components/icons/cart-filled.vue.js.map +1 -1
  184. package/js/components/icons/cart.vue.js +16 -19
  185. package/js/components/icons/cart.vue.js.map +1 -1
  186. package/js/components/icons/check-tiny.vue.js +9 -11
  187. package/js/components/icons/check-tiny.vue.js.map +1 -1
  188. package/js/components/icons/check.vue.js +9 -11
  189. package/js/components/icons/check.vue.js.map +1 -1
  190. package/js/components/icons/checkbox-selected-filled.vue.js +20 -23
  191. package/js/components/icons/checkbox-selected-filled.vue.js.map +1 -1
  192. package/js/components/icons/checkbox-selected.vue.js +19 -22
  193. package/js/components/icons/checkbox-selected.vue.js.map +1 -1
  194. package/js/components/icons/checkbox-unselected-filled.vue.js +13 -15
  195. package/js/components/icons/checkbox-unselected-filled.vue.js.map +1 -1
  196. package/js/components/icons/checkbox-unselected.vue.js +12 -14
  197. package/js/components/icons/checkbox-unselected.vue.js.map +1 -1
  198. package/js/components/icons/chevron-down.vue.js +9 -11
  199. package/js/components/icons/chevron-down.vue.js.map +1 -1
  200. package/js/components/icons/chevron-left.vue.js +9 -11
  201. package/js/components/icons/chevron-left.vue.js.map +1 -1
  202. package/js/components/icons/chevron-right.vue.js +9 -11
  203. package/js/components/icons/chevron-right.vue.js.map +1 -1
  204. package/js/components/icons/chevron-tiny-down.vue.js +9 -11
  205. package/js/components/icons/chevron-tiny-down.vue.js.map +1 -1
  206. package/js/components/icons/chevron-tiny-left.vue.js +9 -11
  207. package/js/components/icons/chevron-tiny-left.vue.js.map +1 -1
  208. package/js/components/icons/chevron-tiny-right.vue.js +9 -11
  209. package/js/components/icons/chevron-tiny-right.vue.js.map +1 -1
  210. package/js/components/icons/chevron-tiny-up.vue.js +9 -11
  211. package/js/components/icons/chevron-tiny-up.vue.js.map +1 -1
  212. package/js/components/icons/chevron-up.vue.js +9 -11
  213. package/js/components/icons/chevron-up.vue.js.map +1 -1
  214. package/js/components/icons/corner-arrow-left.vue.js +9 -11
  215. package/js/components/icons/corner-arrow-left.vue.js.map +1 -1
  216. package/js/components/icons/corner-arrow-right.vue.js +9 -11
  217. package/js/components/icons/corner-arrow-right.vue.js.map +1 -1
  218. package/js/components/icons/cross-tiny.vue.js +9 -11
  219. package/js/components/icons/cross-tiny.vue.js.map +1 -1
  220. package/js/components/icons/cross.vue.js +9 -11
  221. package/js/components/icons/cross.vue.js.map +1 -1
  222. package/js/components/icons/curated-check-filled.vue.js +19 -22
  223. package/js/components/icons/curated-check-filled.vue.js.map +1 -1
  224. package/js/components/icons/curated-check-tiny-filled.vue.js +19 -22
  225. package/js/components/icons/curated-check-tiny-filled.vue.js.map +1 -1
  226. package/js/components/icons/curated-check-tiny.vue.js +18 -21
  227. package/js/components/icons/curated-check-tiny.vue.js.map +1 -1
  228. package/js/components/icons/curated-check.vue.js +18 -21
  229. package/js/components/icons/curated-check.vue.js.map +1 -1
  230. package/js/components/icons/diagonal-arrow-left-down.vue.js +9 -11
  231. package/js/components/icons/diagonal-arrow-left-down.vue.js.map +1 -1
  232. package/js/components/icons/diagonal-arrow-left-top.vue.js +9 -11
  233. package/js/components/icons/diagonal-arrow-left-top.vue.js.map +1 -1
  234. package/js/components/icons/diagonal-arrow-right-down.vue.js +9 -11
  235. package/js/components/icons/diagonal-arrow-right-down.vue.js.map +1 -1
  236. package/js/components/icons/diagonal-arrow-right-top.vue.js +9 -11
  237. package/js/components/icons/diagonal-arrow-right-top.vue.js.map +1 -1
  238. package/js/components/icons/filters.vue.js +8 -10
  239. package/js/components/icons/filters.vue.js.map +1 -1
  240. package/js/components/icons/grid-1-col.vue.js +8 -10
  241. package/js/components/icons/grid-1-col.vue.js.map +1 -1
  242. package/js/components/icons/grid-2-col.vue.js +8 -10
  243. package/js/components/icons/grid-2-col.vue.js.map +1 -1
  244. package/js/components/icons/grid-2-rows.vue.js +19 -22
  245. package/js/components/icons/grid-2-rows.vue.js.map +1 -1
  246. package/js/components/icons/grid-4-col.vue.js +8 -10
  247. package/js/components/icons/grid-4-col.vue.js.map +1 -1
  248. package/js/components/icons/heart-filled.vue.js +10 -12
  249. package/js/components/icons/heart-filled.vue.js.map +1 -1
  250. package/js/components/icons/heart.vue.js +9 -11
  251. package/js/components/icons/heart.vue.js.map +1 -1
  252. package/js/components/icons/hide.vue.js +9 -11
  253. package/js/components/icons/hide.vue.js.map +1 -1
  254. package/js/components/icons/history-tiny.vue.js +16 -19
  255. package/js/components/icons/history-tiny.vue.js.map +1 -1
  256. package/js/components/icons/history.vue.js +16 -19
  257. package/js/components/icons/history.vue.js.map +1 -1
  258. package/js/components/icons/light-bulb-off.vue.js +14 -17
  259. package/js/components/icons/light-bulb-off.vue.js.map +1 -1
  260. package/js/components/icons/light-bulb-on.vue.js +20 -24
  261. package/js/components/icons/light-bulb-on.vue.js.map +1 -1
  262. package/js/components/icons/menu.vue.js +9 -11
  263. package/js/components/icons/menu.vue.js.map +1 -1
  264. package/js/components/icons/minus-tiny.vue.js +9 -11
  265. package/js/components/icons/minus-tiny.vue.js.map +1 -1
  266. package/js/components/icons/minus.vue.js +9 -11
  267. package/js/components/icons/minus.vue.js.map +1 -1
  268. package/js/components/icons/plus-tiny.vue.js +9 -11
  269. package/js/components/icons/plus-tiny.vue.js.map +1 -1
  270. package/js/components/icons/plus.vue.js +9 -11
  271. package/js/components/icons/plus.vue.js.map +1 -1
  272. package/js/components/icons/radiobutton-selected.vue.js +3 -5
  273. package/js/components/icons/radiobutton-selected.vue.js.map +1 -1
  274. package/js/components/icons/radiobutton-unselected.vue.js +20 -23
  275. package/js/components/icons/radiobutton-unselected.vue.js.map +1 -1
  276. package/js/components/icons/search-tiny.vue.js +9 -11
  277. package/js/components/icons/search-tiny.vue.js.map +1 -1
  278. package/js/components/icons/search.vue.js +9 -11
  279. package/js/components/icons/search.vue.js.map +1 -1
  280. package/js/components/icons/settings.vue.js +3 -5
  281. package/js/components/icons/settings.vue.js.map +1 -1
  282. package/js/components/icons/show.vue.js +18 -21
  283. package/js/components/icons/show.vue.js.map +1 -1
  284. package/js/components/icons/sort-az.vue.js +31 -36
  285. package/js/components/icons/sort-az.vue.js.map +1 -1
  286. package/js/components/icons/sort-price-down.vue.js +3 -5
  287. package/js/components/icons/sort-price-down.vue.js.map +1 -1
  288. package/js/components/icons/sort-price-up.vue.js +3 -5
  289. package/js/components/icons/sort-price-up.vue.js.map +1 -1
  290. package/js/components/icons/sort-relevancy.vue.js +23 -27
  291. package/js/components/icons/sort-relevancy.vue.js.map +1 -1
  292. package/js/components/icons/sort-za.vue.js +31 -36
  293. package/js/components/icons/sort-za.vue.js.map +1 -1
  294. package/js/components/icons/spinner.vue.js +3 -5
  295. package/js/components/icons/spinner.vue.js.map +1 -1
  296. package/js/components/icons/star-filled.vue.js +23 -26
  297. package/js/components/icons/star-filled.vue.js.map +1 -1
  298. package/js/components/icons/star.vue.js +11 -13
  299. package/js/components/icons/star.vue.js.map +1 -1
  300. package/js/components/icons/tag-filled.vue.js +17 -20
  301. package/js/components/icons/tag-filled.vue.js.map +1 -1
  302. package/js/components/icons/tag.vue.js +16 -19
  303. package/js/components/icons/tag.vue.js.map +1 -1
  304. package/js/components/icons/trash-open.vue.js +3 -5
  305. package/js/components/icons/trash-open.vue.js.map +1 -1
  306. package/js/components/icons/trash.vue.js +3 -5
  307. package/js/components/icons/trash.vue.js.map +1 -1
  308. package/js/components/icons/trending-tiny.vue.js +16 -19
  309. package/js/components/icons/trending-tiny.vue.js.map +1 -1
  310. package/js/components/icons/trending.vue.js +16 -19
  311. package/js/components/icons/trending.vue.js.map +1 -1
  312. package/js/components/icons/user-filled.vue.js +13 -16
  313. package/js/components/icons/user-filled.vue.js.map +1 -1
  314. package/js/components/icons/user.vue.js +9 -11
  315. package/js/components/icons/user.vue.js.map +1 -1
  316. package/js/components/items-list.vue.js.map +1 -1
  317. package/js/components/layouts/fixed-header-and-asides-layout.vue.js.map +1 -1
  318. package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
  319. package/js/components/layouts/single-column-layout.vue.js.map +1 -1
  320. package/js/components/modals/base-events-modal-close.vue.js.map +1 -1
  321. package/js/components/modals/base-events-modal-open.vue.js.map +1 -1
  322. package/js/components/modals/base-events-modal.vue.js.map +1 -1
  323. package/js/components/modals/base-id-modal.vue.js.map +1 -1
  324. package/js/components/modals/base-modal.vue.js.map +1 -1
  325. package/js/components/modals/close-main-modal.vue.js.map +1 -1
  326. package/js/components/modals/main-modal.vue.js.map +1 -1
  327. package/js/components/modals/open-main-modal.vue.js.map +1 -1
  328. package/js/components/page-loader-button.vue.js +5 -1
  329. package/js/components/page-loader-button.vue.js.map +1 -1
  330. package/js/components/page-selector.vue.js +10 -2
  331. package/js/components/page-selector.vue.js.map +1 -1
  332. package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
  333. package/js/components/panels/base-id-toggle-panel-button.vue.js.map +1 -1
  334. package/js/components/panels/base-id-toggle-panel.vue.js.map +1 -1
  335. package/js/components/panels/base-tabs-panel.vue.js.map +1 -1
  336. package/js/components/panels/base-toggle-panel.vue.js.map +1 -1
  337. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  338. package/js/components/result/base-result-current-price.vue.js.map +1 -1
  339. package/js/components/result/base-result-fallback-image.vue.js +15 -18
  340. package/js/components/result/base-result-fallback-image.vue.js.map +1 -1
  341. package/js/components/result/base-result-image.vue.js.map +1 -1
  342. package/js/components/result/base-result-link.vue.js.map +1 -1
  343. package/js/components/result/base-result-placeholder-image.vue.js +14 -17
  344. package/js/components/result/base-result-placeholder-image.vue.js.map +1 -1
  345. package/js/components/result/base-result-previous-price.vue.js.map +1 -1
  346. package/js/components/result/base-result-rating.vue.js.map +1 -1
  347. package/js/components/result/result-variant-selector.vue.js.map +1 -1
  348. package/js/components/sliding-panel.vue.js +10 -2
  349. package/js/components/sliding-panel.vue.js.map +1 -1
  350. package/js/components/suggestions/base-suggestion.vue.js.map +1 -1
  351. package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
  352. package/js/composables/use-on-display.js +1 -1
  353. package/js/composables/use-on-display.js.map +1 -1
  354. package/js/directives/infinite-scroll.js +1 -1
  355. package/js/directives/infinite-scroll.js.map +1 -1
  356. package/js/directives/typing.js.map +1 -1
  357. package/js/x-modules/ai/components/ai-overview.vue.js +25 -26
  358. package/js/x-modules/ai/components/ai-overview.vue.js.map +1 -1
  359. package/js/x-modules/device/components/device-detector.vue.js.map +1 -1
  360. package/js/x-modules/empathize/components/empathize.vue.js.map +1 -1
  361. package/js/x-modules/facets/components/clear-filters.vue.js.map +1 -1
  362. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  363. package/js/x-modules/facets/components/filters/all-filter.vue.js +5 -1
  364. package/js/x-modules/facets/components/filters/all-filter.vue.js.map +1 -1
  365. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +10 -2
  366. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
  367. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js +3 -3
  368. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js.map +1 -1
  369. package/js/x-modules/facets/components/filters/number-range-filter.vue.js.map +1 -1
  370. package/js/x-modules/facets/components/filters/simple-filter.vue.js.map +1 -1
  371. package/js/x-modules/facets/components/lists/filters-list.vue.js.map +1 -1
  372. package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
  373. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
  374. package/js/x-modules/facets/components/lists/sliced-filters.vue.js +20 -4
  375. package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
  376. package/js/x-modules/history-queries/components/clear-history-queries.vue.js +5 -1
  377. package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
  378. package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
  379. package/js/x-modules/history-queries/components/history-query.vue.js +5 -1
  380. package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
  381. package/js/x-modules/history-queries/components/my-history.vue.js +3 -3
  382. package/js/x-modules/history-queries/components/my-history.vue.js.map +1 -1
  383. package/js/x-modules/history-queries/components/remove-history-query.vue.js.map +1 -1
  384. package/js/x-modules/identifier-results/components/identifier-result.vue.js.map +1 -1
  385. package/js/x-modules/identifier-results/components/identifier-results.vue.js.map +1 -1
  386. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  387. package/js/x-modules/next-queries/components/next-query-preview.vue.js.map +1 -1
  388. package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
  389. package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
  390. package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
  391. package/js/x-modules/queries-preview/components/query-preview-button.vue.js.map +1 -1
  392. package/js/x-modules/queries-preview/components/query-preview-list.vue.js.map +1 -1
  393. package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
  394. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
  395. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
  396. package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
  397. package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -1
  398. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -1
  399. package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
  400. package/js/x-modules/related-tags/components/related-tags.vue.js +3 -3
  401. package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
  402. package/js/x-modules/scroll/components/main-scroll-item.vue.js.map +1 -1
  403. package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -1
  404. package/js/x-modules/scroll/components/scroll.vue.js.map +1 -1
  405. package/js/x-modules/search/components/banner.vue.js.map +1 -1
  406. package/js/x-modules/search/components/fallback-disclaimer.vue.js.map +1 -1
  407. package/js/x-modules/search/components/partial-query-button.vue.js.map +1 -1
  408. package/js/x-modules/search/components/partial-results-list.vue.js.map +1 -1
  409. package/js/x-modules/search/components/promoted.vue.js.map +1 -1
  410. package/js/x-modules/search/components/redirection.vue.js.map +1 -1
  411. package/js/x-modules/search/components/sort-dropdown.vue.js.map +1 -1
  412. package/js/x-modules/search/components/sort-list.vue.js.map +1 -1
  413. package/js/x-modules/search/components/sort-picker-list.vue.js.map +1 -1
  414. package/js/x-modules/search/components/spellcheck-button.vue.js.map +1 -1
  415. package/js/x-modules/search/components/spellcheck.vue.js.map +1 -1
  416. package/js/x-modules/search-box/components/clear-search-input.vue.js +5 -1
  417. package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
  418. package/js/x-modules/search-box/components/search-button.vue.js +7 -8
  419. package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
  420. package/js/x-modules/search-box/components/search-input-placeholder.vue.js.map +1 -1
  421. package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
  422. package/js/x-modules/semantic-queries/components/semantic-queries.vue.js +3 -3
  423. package/js/x-modules/semantic-queries/components/semantic-queries.vue.js.map +1 -1
  424. package/js/x-modules/semantic-queries/components/semantic-query.vue.js.map +1 -1
  425. package/package.json +6 -6
  426. package/report/x-components.api.json +6216 -1603
  427. package/report/x-components.api.md +819 -647
  428. package/types/components/animations/animate-width.vue.d.ts +1 -1
  429. package/types/components/animations/change-height.vue.d.ts +2 -2
  430. package/types/components/animations/collapse-height.vue.d.ts +5 -5
  431. package/types/components/animations/collapse-width.vue.d.ts +5 -5
  432. package/types/components/animations/cross-fade.vue.d.ts +4 -4
  433. package/types/components/animations/fade-and-slide.vue.d.ts +5 -5
  434. package/types/components/animations/fade.vue.d.ts +4 -4
  435. package/types/components/animations/no-animation.vue.d.ts +2 -2
  436. package/types/components/animations/staggered-fade-and-slide.vue.d.ts +5 -5
  437. package/types/components/animations/staggered-fade-and-slide.vue.d.ts.map +1 -1
  438. package/types/components/auto-progress-bar.vue.d.ts +5 -5
  439. package/types/components/base-dropdown.vue.d.ts +12 -12
  440. package/types/components/base-event-button.vue.d.ts +5 -5
  441. package/types/components/base-grid.vue.d.ts +9 -7
  442. package/types/components/base-grid.vue.d.ts.map +1 -1
  443. package/types/components/base-keyboard-navigation.vue.d.ts +6 -6
  444. package/types/components/base-rating.vue.d.ts +7 -5
  445. package/types/components/base-rating.vue.d.ts.map +1 -1
  446. package/types/components/base-slider.vue.d.ts +7 -7
  447. package/types/components/base-switch.vue.d.ts +6 -6
  448. package/types/components/base-teleport.vue.d.ts +6 -6
  449. package/types/components/base-variable-column-grid.vue.d.ts +7 -5
  450. package/types/components/base-variable-column-grid.vue.d.ts.map +1 -1
  451. package/types/components/column-picker/base-column-picker-dropdown.vue.d.ts +8 -6
  452. package/types/components/column-picker/base-column-picker-dropdown.vue.d.ts.map +1 -1
  453. package/types/components/column-picker/base-column-picker-list.vue.d.ts +7 -5
  454. package/types/components/column-picker/base-column-picker-list.vue.d.ts.map +1 -1
  455. package/types/components/currency/base-currency.vue.d.ts +4 -4
  456. package/types/components/display-click-provider.vue.d.ts +5 -5
  457. package/types/components/display-emitter.vue.d.ts +4 -4
  458. package/types/components/filters/labels/base-price-filter-label.vue.d.ts +6 -4
  459. package/types/components/filters/labels/base-price-filter-label.vue.d.ts.map +1 -1
  460. package/types/components/filters/labels/base-rating-filter-label.vue.d.ts +7 -5
  461. package/types/components/filters/labels/base-rating-filter-label.vue.d.ts.map +1 -1
  462. package/types/components/global-x-bus.vue.d.ts +3 -3
  463. package/types/components/highlight.vue.d.ts +5 -5
  464. package/types/components/items-list.vue.d.ts +5 -5
  465. package/types/components/layouts/fixed-header-and-asides-layout.vue.d.ts +9 -5
  466. package/types/components/layouts/fixed-header-and-asides-layout.vue.d.ts.map +1 -1
  467. package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +9 -5
  468. package/types/components/layouts/multi-column-max-width-layout.vue.d.ts.map +1 -1
  469. package/types/components/layouts/single-column-layout.vue.d.ts +10 -5
  470. package/types/components/layouts/single-column-layout.vue.d.ts.map +1 -1
  471. package/types/components/location-provider.vue.d.ts +4 -4
  472. package/types/components/modals/base-events-modal-close.vue.d.ts +7 -5
  473. package/types/components/modals/base-events-modal-close.vue.d.ts.map +1 -1
  474. package/types/components/modals/base-events-modal-open.vue.d.ts +7 -5
  475. package/types/components/modals/base-events-modal-open.vue.d.ts.map +1 -1
  476. package/types/components/modals/base-events-modal.vue.d.ts +10 -8
  477. package/types/components/modals/base-events-modal.vue.d.ts.map +1 -1
  478. package/types/components/modals/base-id-modal-close.vue.d.ts +4 -4
  479. package/types/components/modals/base-id-modal-open.vue.d.ts +4 -4
  480. package/types/components/modals/base-id-modal.vue.d.ts +8 -6
  481. package/types/components/modals/base-id-modal.vue.d.ts.map +1 -1
  482. package/types/components/modals/base-modal.vue.d.ts +9 -9
  483. package/types/components/modals/close-main-modal.vue.d.ts +3 -1
  484. package/types/components/modals/close-main-modal.vue.d.ts.map +1 -1
  485. package/types/components/modals/main-modal.vue.d.ts +6 -4
  486. package/types/components/modals/main-modal.vue.d.ts.map +1 -1
  487. package/types/components/modals/open-main-modal.vue.d.ts +3 -1
  488. package/types/components/modals/open-main-modal.vue.d.ts.map +1 -1
  489. package/types/components/page-loader-button.vue.d.ts +7 -5
  490. package/types/components/page-loader-button.vue.d.ts.map +1 -1
  491. package/types/components/page-selector.vue.d.ts +5 -5
  492. package/types/components/panels/base-header-toggle-panel.vue.d.ts +9 -7
  493. package/types/components/panels/base-header-toggle-panel.vue.d.ts.map +1 -1
  494. package/types/components/panels/base-id-toggle-panel-button.vue.d.ts +7 -5
  495. package/types/components/panels/base-id-toggle-panel-button.vue.d.ts.map +1 -1
  496. package/types/components/panels/base-id-toggle-panel.vue.d.ts +8 -6
  497. package/types/components/panels/base-id-toggle-panel.vue.d.ts.map +1 -1
  498. package/types/components/panels/base-tabs-panel.vue.d.ts +6 -6
  499. package/types/components/panels/base-toggle-panel.vue.d.ts +4 -4
  500. package/types/components/result/base-result-add-to-cart.vue.d.ts +6 -4
  501. package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
  502. package/types/components/result/base-result-current-price.vue.d.ts +6 -4
  503. package/types/components/result/base-result-current-price.vue.d.ts.map +1 -1
  504. package/types/components/result/base-result-image.vue.d.ts +9 -9
  505. package/types/components/result/base-result-link.vue.d.ts +5 -5
  506. package/types/components/result/base-result-previous-price.vue.d.ts +5 -3
  507. package/types/components/result/base-result-previous-price.vue.d.ts.map +1 -1
  508. package/types/components/result/base-result-rating.vue.d.ts +7 -5
  509. package/types/components/result/base-result-rating.vue.d.ts.map +1 -1
  510. package/types/components/result/result-variant-selector.vue.d.ts +6 -6
  511. package/types/components/result/result-variants-provider.vue.d.ts +5 -5
  512. package/types/components/scroll/base-scroll.vue.d.ts +7 -7
  513. package/types/components/sliding-panel.vue.d.ts +8 -8
  514. package/types/components/snippet-callbacks.vue.d.ts +3 -1
  515. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  516. package/types/components/suggestions/base-suggestion.vue.d.ts +8 -6
  517. package/types/components/suggestions/base-suggestion.vue.d.ts.map +1 -1
  518. package/types/components/suggestions/base-suggestions.vue.d.ts +5 -5
  519. package/types/directives/infinite-scroll.d.ts.map +1 -1
  520. package/types/directives/typing.d.ts +1 -2
  521. package/types/directives/typing.d.ts.map +1 -1
  522. package/types/x-modules/ai/components/ai-overview.vue.d.ts +22 -8
  523. package/types/x-modules/ai/components/ai-overview.vue.d.ts.map +1 -1
  524. package/types/x-modules/device/components/device-detector.vue.d.ts +9 -5
  525. package/types/x-modules/device/components/device-detector.vue.d.ts.map +1 -1
  526. package/types/x-modules/empathize/components/empathize.vue.d.ts +6 -6
  527. package/types/x-modules/experience-controls/components/experience-controls.vue.d.ts +1 -1
  528. package/types/x-modules/extra-params/components/extra-params.vue.d.ts +3 -3
  529. package/types/x-modules/extra-params/components/renderless-extra-param.vue.d.ts +4 -4
  530. package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts +8 -6
  531. package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts.map +1 -1
  532. package/types/x-modules/facets/components/clear-filters.vue.d.ts +7 -5
  533. package/types/x-modules/facets/components/clear-filters.vue.d.ts.map +1 -1
  534. package/types/x-modules/facets/components/facets/facets-provider.vue.d.ts +4 -4
  535. package/types/x-modules/facets/components/facets/facets.vue.d.ts +5 -5
  536. package/types/x-modules/facets/components/filters/all-filter.vue.d.ts +6 -4
  537. package/types/x-modules/facets/components/filters/all-filter.vue.d.ts.map +1 -1
  538. package/types/x-modules/facets/components/filters/editable-number-range-filter.vue.d.ts +7 -7
  539. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +8 -5
  540. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  541. package/types/x-modules/facets/components/filters/number-range-filter.vue.d.ts +7 -5
  542. package/types/x-modules/facets/components/filters/number-range-filter.vue.d.ts.map +1 -1
  543. package/types/x-modules/facets/components/filters/renderless-filter.vue.d.ts +5 -5
  544. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +7 -5
  545. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  546. package/types/x-modules/facets/components/lists/exclude-filters-with-no-results.vue.d.ts +4 -4
  547. package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +5 -5
  548. package/types/x-modules/facets/components/lists/filters-search.vue.d.ts +6 -6
  549. package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +7 -5
  550. package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts.map +1 -1
  551. package/types/x-modules/facets/components/lists/selected-filters.vue.d.ts +5 -5
  552. package/types/x-modules/facets/components/lists/sliced-filters.vue.d.ts +6 -6
  553. package/types/x-modules/facets/components/lists/sorted-filters.vue.d.ts +4 -4
  554. package/types/x-modules/facets/components/preselected-filters.vue.d.ts +5 -5
  555. package/types/x-modules/history-queries/components/clear-history-queries.vue.d.ts +3 -1
  556. package/types/x-modules/history-queries/components/clear-history-queries.vue.d.ts.map +1 -1
  557. package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts +3 -1
  558. package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts.map +1 -1
  559. package/types/x-modules/history-queries/components/history-queries.vue.d.ts +4 -1
  560. package/types/x-modules/history-queries/components/history-queries.vue.d.ts.map +1 -1
  561. package/types/x-modules/history-queries/components/history-query.vue.d.ts +8 -5
  562. package/types/x-modules/history-queries/components/history-query.vue.d.ts.map +1 -1
  563. package/types/x-modules/history-queries/components/my-history.vue.d.ts +8 -5
  564. package/types/x-modules/history-queries/components/my-history.vue.d.ts.map +1 -1
  565. package/types/x-modules/history-queries/components/remove-history-query.vue.d.ts +6 -4
  566. package/types/x-modules/history-queries/components/remove-history-query.vue.d.ts.map +1 -1
  567. package/types/x-modules/identifier-results/components/identifier-result.vue.d.ts +4 -4
  568. package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +5 -5
  569. package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +5 -5
  570. package/types/x-modules/next-queries/components/next-queries.vue.d.ts +8 -5
  571. package/types/x-modules/next-queries/components/next-queries.vue.d.ts.map +1 -1
  572. package/types/x-modules/next-queries/components/next-query-preview.vue.d.ts +4 -4
  573. package/types/x-modules/next-queries/components/next-query.vue.d.ts +7 -5
  574. package/types/x-modules/next-queries/components/next-query.vue.d.ts.map +1 -1
  575. package/types/x-modules/popular-searches/components/popular-search.vue.d.ts +6 -4
  576. package/types/x-modules/popular-searches/components/popular-search.vue.d.ts.map +1 -1
  577. package/types/x-modules/popular-searches/components/popular-searches.vue.d.ts +4 -1
  578. package/types/x-modules/popular-searches/components/popular-searches.vue.d.ts.map +1 -1
  579. package/types/x-modules/queries-preview/components/query-preview-button.vue.d.ts +6 -4
  580. package/types/x-modules/queries-preview/components/query-preview-button.vue.d.ts.map +1 -1
  581. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +8 -6
  582. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts.map +1 -1
  583. package/types/x-modules/queries-preview/components/query-preview.vue.d.ts +6 -6
  584. package/types/x-modules/query-suggestions/components/query-suggestion.vue.d.ts +6 -4
  585. package/types/x-modules/query-suggestions/components/query-suggestion.vue.d.ts.map +1 -1
  586. package/types/x-modules/query-suggestions/components/query-suggestions.vue.d.ts +4 -1
  587. package/types/x-modules/query-suggestions/components/query-suggestions.vue.d.ts.map +1 -1
  588. package/types/x-modules/recommendations/components/recommendations.vue.d.ts +5 -5
  589. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +9 -4
  590. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -1
  591. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +5 -5
  592. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +11 -7
  593. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -1
  594. package/types/x-modules/related-tags/components/related-tag.vue.d.ts +6 -6
  595. package/types/x-modules/related-tags/components/related-tags.vue.d.ts +7 -5
  596. package/types/x-modules/related-tags/components/related-tags.vue.d.ts.map +1 -1
  597. package/types/x-modules/scroll/components/main-scroll-item.vue.d.ts +6 -6
  598. package/types/x-modules/scroll/components/main-scroll.vue.d.ts +5 -5
  599. package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +7 -5
  600. package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts.map +1 -1
  601. package/types/x-modules/scroll/components/scroll.vue.d.ts +8 -6
  602. package/types/x-modules/scroll/components/scroll.vue.d.ts.map +1 -1
  603. package/types/x-modules/search/components/banner.vue.d.ts +5 -5
  604. package/types/x-modules/search/components/banners-list.vue.d.ts +5 -5
  605. package/types/x-modules/search/components/fallback-disclaimer.vue.d.ts +1 -1
  606. package/types/x-modules/search/components/partial-query-button.vue.d.ts +5 -5
  607. package/types/x-modules/search/components/partial-results-list.vue.d.ts +5 -5
  608. package/types/x-modules/search/components/promoted.vue.d.ts +4 -4
  609. package/types/x-modules/search/components/promoteds-list.vue.d.ts +5 -5
  610. package/types/x-modules/search/components/redirection.vue.d.ts +6 -6
  611. package/types/x-modules/search/components/results-list.vue.d.ts +6 -6
  612. package/types/x-modules/search/components/sort-dropdown.vue.d.ts +8 -6
  613. package/types/x-modules/search/components/sort-dropdown.vue.d.ts.map +1 -1
  614. package/types/x-modules/search/components/sort-list.vue.d.ts +7 -5
  615. package/types/x-modules/search/components/sort-list.vue.d.ts.map +1 -1
  616. package/types/x-modules/search/components/sort-picker-list.vue.d.ts +7 -5
  617. package/types/x-modules/search/components/sort-picker-list.vue.d.ts.map +1 -1
  618. package/types/x-modules/search/components/spellcheck-button.vue.d.ts +2 -2
  619. package/types/x-modules/search/components/spellcheck.vue.d.ts +1 -1
  620. package/types/x-modules/search-box/components/clear-search-input.vue.d.ts +7 -1
  621. package/types/x-modules/search-box/components/clear-search-input.vue.d.ts.map +1 -1
  622. package/types/x-modules/search-box/components/search-button.vue.d.ts +2 -2
  623. package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +6 -6
  624. package/types/x-modules/search-box/components/search-input.vue.d.ts +6 -6
  625. package/types/x-modules/semantic-queries/components/semantic-queries.vue.d.ts +4 -1
  626. package/types/x-modules/semantic-queries/components/semantic-queries.vue.d.ts.map +1 -1
  627. package/types/x-modules/semantic-queries/components/semantic-query.vue.d.ts +6 -4
  628. package/types/x-modules/semantic-queries/components/semantic-query.vue.d.ts.map +1 -1
  629. package/types/x-modules/tagging/components/tagging.vue.d.ts +4 -4
  630. package/types/x-modules/url/components/url-handler.vue.d.ts +5 -1
  631. package/types/x-modules/url/components/url-handler.vue.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"main-scroll-item.vue.js","sources":["../../../../../src/x-modules/scroll/components/main-scroll-item.vue"],"sourcesContent":["<template>\n <component :is=\"tag\" ref=\"rootRef\" :data-scroll=\"item.id\">\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Identifiable } from '@empathyco/x-types'\nimport type { Component, PropType, Ref, WatchCallback } from 'vue'\nimport type { ScrollVisibilityObserver } from './scroll.types'\nimport { defineComponent, inject, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { useXBus } from '../../../composables/use-x-bus'\nimport { scrollXModule } from '../x-module'\nimport { ScrollObserverKey } from './scroll.const'\n\n/**\n * Wrapper for elements contained in the {@link MainScroll} that should store/restore its\n * position.\n *\n * @public\n */\nexport default defineComponent({\n name: 'MainScrollItem',\n xModule: scrollXModule.name,\n props: {\n /** The item data. Used to set the scroll identifier. */\n item: {\n type: Object as PropType<Identifiable>,\n required: true,\n },\n /** The tag to render. */\n tag: {\n type: [String, Object] as PropType<string | Component>,\n default: 'div',\n },\n },\n setup(props) {\n const xBus = useXBus()\n\n /** Rendered HTML node. */\n const rootRef = ref<HTMLElement>()\n\n /**\n * Pending identifier scroll position to restore. If it matches the {@link MainScrollItem} item\n * `id` property, this component should be scrolled into view.\n */\n const { pendingScrollTo } = useState('scroll')\n\n /** Observer to detect the first visible element. */\n const firstVisibleItemObserver = inject<Ref<ScrollVisibilityObserver> | null>(\n ScrollObserverKey as string,\n null,\n )\n\n /**\n * Initialises the element visibility observation, stopping the previous one if it has.\n *\n * @param newObserver - The new observer for the HTML element.\n * @param oldObserver - The old observer for the HTML element.\n */\n const observeItem: WatchCallback<ScrollVisibilityObserver> = (\n newObserver: ScrollVisibilityObserver | null,\n oldObserver: ScrollVisibilityObserver | null,\n ): void => {\n if (rootRef.value) {\n oldObserver?.unobserve(rootRef.value)\n newObserver?.observe(rootRef.value)\n if (pendingScrollTo.value === props.item.id) {\n nextTick(() => {\n rootRef.value!.scrollIntoView({\n block: 'center',\n })\n })\n xBus.emit('ScrollRestoreSucceeded')\n }\n }\n }\n\n /** Detaches the observer from the rendered element to prevent memory leaks. */\n onBeforeUnmount(() => {\n if (rootRef.value) {\n firstVisibleItemObserver?.value.unobserve(rootRef.value)\n }\n })\n\n /**\n * Initialise scroll behavior.\n * - Observes the rendered element to detect if it is the first visible item.\n * - If the rendered element matches the {@link MainScrollItem.pendingScrollTo}, scrolls the\n * element into the first position of the view.\n */\n onMounted(() => {\n nextTick(() => {\n // Mounted does not guarantee that child components are mounted too\n if (firstVisibleItemObserver) {\n watch(firstVisibleItemObserver, observeItem, { immediate: true })\n }\n })\n })\n\n return { rootRef }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis components emits the following events:\n\n- [`ScrollRestoreSucceeded`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nThis component has no predefined template. It renders whatever you decide using the `tag` prop. It's\nmain purpose is to help storing and restoring the scroll position so URLs can be shared, and also to\nallow users to smoothly navigate back and forth.\n\nTo do so, it must be wrapped with the `MainScroll` component. In the following example we make use\nof all of these components. The URL is modified as the user scrolls.\n\n```vue\n<template>\n <div>\n <UrlHandler />\n <SearchInput />\n\n <MainScroll>\n <Scroll>\n <ResultsList #result=\"{ item }\">\n <MainScrollItem :item=\"item\" tag=\"article\">\n <BaseResultLink :item=\"item\">\n <img :src=\"item.images[0]\" />\n <p>{{ item.title }}</p>\n </BaseResultLink>\n </MainScrollItem>\n </ResultsList>\n </Scroll>\n </MainScroll>\n </div>\n</template>\n\n<script>\nimport { MainScroll, Scroll, MainScrollItem } from '@empathyco/x-components/scroll'\nimport { ResultsList } from '@empathyco/x-components/search'\nimport { SearchInput } from '@empathyco/x-components/search-box'\nimport { UrlHandler } from '@empathyco/x-components/url'\n\nexport default {\n name: 'ScrollItemDemo',\n components: {\n Scroll,\n ResultsList,\n MainScroll,\n MainScrollItem,\n SearchInput,\n UrlHandler,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot"],"mappings":";;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAEYC,wBAFI,IAAG,CAAA,GAAA,CAAA,EAAA;AAAA,IAAE,GAAI,EAAA,SAAA;AAAA,IAAW,eAAa,IAAK,CAAA,IAAA,CAAA,EAAA;AAAA,GAAA,EAAA;AADxD,IAAA,OAAA,EAAAC,OAAA,CAEI,MAAQ;AAAA,MAARC,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;AAFZ,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"main-scroll-item.vue.js","sources":["../../../../../src/x-modules/scroll/components/main-scroll-item.vue"],"sourcesContent":["<template>\n <component :is=\"tag\" ref=\"rootRef\" :data-scroll=\"item.id\">\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Identifiable } from '@empathyco/x-types'\nimport type { Component, PropType, Ref, WatchCallback } from 'vue'\nimport type { ScrollVisibilityObserver } from './scroll.types'\nimport { defineComponent, inject, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { useXBus } from '../../../composables/use-x-bus'\nimport { scrollXModule } from '../x-module'\nimport { ScrollObserverKey } from './scroll.const'\n\n/**\n * Wrapper for elements contained in the {@link MainScroll} that should store/restore its\n * position.\n *\n * @public\n */\nexport default defineComponent({\n name: 'MainScrollItem',\n xModule: scrollXModule.name,\n props: {\n /** The item data. Used to set the scroll identifier. */\n item: {\n type: Object as PropType<Identifiable>,\n required: true,\n },\n /** The tag to render. */\n tag: {\n type: [String, Object] as PropType<string | Component>,\n default: 'div',\n },\n },\n setup(props) {\n const xBus = useXBus()\n\n /** Rendered HTML node. */\n const rootRef = ref<HTMLElement>()\n\n /**\n * Pending identifier scroll position to restore. If it matches the {@link MainScrollItem} item\n * `id` property, this component should be scrolled into view.\n */\n const { pendingScrollTo } = useState('scroll')\n\n /** Observer to detect the first visible element. */\n const firstVisibleItemObserver = inject<Ref<ScrollVisibilityObserver> | null>(\n ScrollObserverKey as string,\n null,\n )\n\n /**\n * Initialises the element visibility observation, stopping the previous one if it has.\n *\n * @param newObserver - The new observer for the HTML element.\n * @param oldObserver - The old observer for the HTML element.\n */\n const observeItem: WatchCallback<ScrollVisibilityObserver> = (\n newObserver: ScrollVisibilityObserver | null,\n oldObserver: ScrollVisibilityObserver | null,\n ): void => {\n if (rootRef.value) {\n oldObserver?.unobserve(rootRef.value)\n newObserver?.observe(rootRef.value)\n if (pendingScrollTo.value === props.item.id) {\n nextTick(() => {\n rootRef.value!.scrollIntoView({\n block: 'center',\n })\n })\n xBus.emit('ScrollRestoreSucceeded')\n }\n }\n }\n\n /** Detaches the observer from the rendered element to prevent memory leaks. */\n onBeforeUnmount(() => {\n if (rootRef.value) {\n firstVisibleItemObserver?.value.unobserve(rootRef.value)\n }\n })\n\n /**\n * Initialise scroll behavior.\n * - Observes the rendered element to detect if it is the first visible item.\n * - If the rendered element matches the {@link MainScrollItem.pendingScrollTo}, scrolls the\n * element into the first position of the view.\n */\n onMounted(() => {\n nextTick(() => {\n // Mounted does not guarantee that child components are mounted too\n if (firstVisibleItemObserver) {\n watch(firstVisibleItemObserver, observeItem, { immediate: true })\n }\n })\n })\n\n return { rootRef }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis components emits the following events:\n\n- [`ScrollRestoreSucceeded`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nThis component has no predefined template. It renders whatever you decide using the `tag` prop. It's\nmain purpose is to help storing and restoring the scroll position so URLs can be shared, and also to\nallow users to smoothly navigate back and forth.\n\nTo do so, it must be wrapped with the `MainScroll` component. In the following example we make use\nof all of these components. The URL is modified as the user scrolls.\n\n```vue\n<template>\n <div>\n <UrlHandler />\n <SearchInput />\n\n <MainScroll>\n <Scroll>\n <ResultsList #result=\"{ item }\">\n <MainScrollItem :item=\"item\" tag=\"article\">\n <BaseResultLink :item=\"item\">\n <img :src=\"item.images[0]\" />\n <p>{{ item.title }}</p>\n </BaseResultLink>\n </MainScrollItem>\n </ResultsList>\n </Scroll>\n </MainScroll>\n </div>\n</template>\n\n<script>\nimport { MainScroll, Scroll, MainScrollItem } from '@empathyco/x-components/scroll'\nimport { ResultsList } from '@empathyco/x-components/search'\nimport { SearchInput } from '@empathyco/x-components/search-box'\nimport { UrlHandler } from '@empathyco/x-components/url'\n\nexport default {\n name: 'ScrollItemDemo',\n components: {\n Scroll,\n ResultsList,\n MainScroll,\n MainScrollItem,\n SearchInput,\n UrlHandler,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_renderSlot"],"mappings":";;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAEYC,wBAFI,IAAG,CAAA,GAAA,CAAA,EAAA;AAAA,IAAE,GAAI,EAAA,SAAA;AAAA,IAAW,eAAa,IAAK,CAAA,IAAA,CAAA,EAAA;AAAA,GAAA,EAAA;qBACpD,MAAQ;AAAA,MAARC,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-to-top.vue.js","sources":["../../../../../src/x-modules/scroll/components/scroll-to-top.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <BaseEventButton\n v-if=\"isVisible\"\n class=\"x-scroll-to-top x-button\"\n data-test=\"scroll-to-top\"\n aria-label=\"Scroll to top\"\n :events=\"events\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { XEventsTypes } from '../../../wiring'\nimport { computed, defineComponent } from 'vue'\nimport { BaseEventButton, NoAnimation } from '../../../components'\nimport { useState } from '../../../composables'\nimport { AnimationProp } from '../../../types'\nimport { scrollXModule } from '../x-module'\nimport { MainScrollId } from './scroll.const'\n\n/**\n * The `ScrollToTop` component is a button that the user can click to make a container scroll\n * up to its initial position.\n *\n * @public\n */\nexport default defineComponent({\n name: 'ScrollToTop',\n xModule: scrollXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * Animation to use for showing/hiding the button.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /**\n * Threshold in pixels from the top to show the button.\n *\n * @public\n */\n thresholdPx: Number,\n /**\n * Id of the target scroll component.\n *\n * @public\n */\n scrollId: {\n type: String,\n default: MainScrollId,\n },\n },\n setup(props) {\n /**\n * State of all the scroll components in this module.\n *\n * @internal\n */\n // TODO: Directly retrieve the needed data in this computed property\n const { data } = useState('scroll')\n\n /**\n * The scroll data retrieved for this component.\n *\n * @returns The scroll data for this component if a valid {@link ScrollToTop.scrollId} has been\n * passed. Otherwise it returns `null`.\n * @internal\n */\n const scrollData = computed(() => {\n return props.scrollId && data.value[props.scrollId]\n ? data.value[props.scrollId]\n : {\n position: 0,\n direction: 'UP',\n hasReachedStart: false,\n hasAlmostReachedEnd: false,\n hasReachedEnd: false,\n }\n })\n\n /**\n * Event that will be emitted when the scroll to top is clicked.\n *\n * @returns The event to be emitted when the scroll to top is clicked. The id as a payload.\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserClickedScrollToTop: props.scrollId }),\n )\n\n /**\n * Checks if the thresholdPx prop has been provided and if it is a number.\n *\n * @returns If the thresholdPx is a number or not.\n * @internal\n */\n const useThresholdStrategy = computed(() => typeof props.thresholdPx === 'number')\n\n /**\n * Checks if the threshold has been reached in case the threshold strategy is in use.\n *\n * @returns If the scrollTop is bigger than the thresholdPx.\n * @internal\n */\n const isThresholdReached = computed(\n () => useThresholdStrategy.value && scrollData.value.position > props.thresholdPx!,\n )\n\n /**\n * Returns if the scroll has almost reached its end or not.\n *\n * @returns True if the scroll has almost reached the end and the user is still scrolling down.\n * @internal\n */\n const hasAlmostReachedScrollEnd = computed(\n () => scrollData.value.hasAlmostReachedEnd && scrollData.value.direction === 'DOWN',\n )\n\n /**\n * Whether if the button is visible or not depending on the strategy being used.\n *\n * @returns If the button should be visible or not.\n * @internal\n */\n const isVisible = computed(() =>\n useThresholdStrategy.value ? isThresholdReached.value : hasAlmostReachedScrollEnd.value,\n )\n\n return {\n events,\n isVisible,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedScrollToTop`](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 scroll\n that it going to be scrolled.\n\n## Examples\n\n### Basic example\n\nThe component renders whatever is passed to it in the default slot and scrolls to top the scroll\nwith an id `scrollId`.\n\nIt also receives an optional threshold in pixels. When the threshold is reached from the top, the\ncomponent will be shown once the user scrolls `UP`.\n\nIf this parameter is not provided the button will be visible when the user almost reaches the end of\nthe scroll.\n\n```vue\n<template>\n <div>\n <ScrollToTop scroll-id=\"scrollId\" :threshold-px=\"1000\">\n <span>Scroll to top</span>\n </ScrollToTop>\n </div>\n</template>\n\n<script>\nimport { ScrollToTop } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollToTopTest',\n components: {\n ScrollToTop,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot","_createCommentVNode"],"mappings":";;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAWYC,wBAXI,IAAS,CAAA,SAAA,CAAA,EAAA,IAAA,EAAA;AAAA,IAD3B,iBAEI,MASkB;AAAA,MARV,+BADRD,WASkB,CAAA,0BAAA,EAAA;AAAA,QAXtB,GAAA,EAAA,CAAA;AAAA,QAIM,KAAM,EAAA,0BAAA;AAAA,QACN,WAAU,EAAA,eAAA;AAAA,QACV,YAAW,EAAA,eAAA;AAAA,QACV,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,OAAA,EAAA;AAPf,QAAA,OAAA,EAAAE,OAAA,CAUM,MAAQ;AAAA,UAARC,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,SAAA,CAAA;AAVd,QAAA,CAAA,EAAA,CAAA;AAAA;AAAA,OAAA,EAAA,CAAA,EAAA,CAAA,QAAA,CAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"scroll-to-top.vue.js","sources":["../../../../../src/x-modules/scroll/components/scroll-to-top.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <BaseEventButton\n v-if=\"isVisible\"\n class=\"x-scroll-to-top x-button\"\n data-test=\"scroll-to-top\"\n aria-label=\"Scroll to top\"\n :events=\"events\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { XEventsTypes } from '../../../wiring'\nimport { computed, defineComponent } from 'vue'\nimport { BaseEventButton, NoAnimation } from '../../../components'\nimport { useState } from '../../../composables'\nimport { AnimationProp } from '../../../types'\nimport { scrollXModule } from '../x-module'\nimport { MainScrollId } from './scroll.const'\n\n/**\n * The `ScrollToTop` component is a button that the user can click to make a container scroll\n * up to its initial position.\n *\n * @public\n */\nexport default defineComponent({\n name: 'ScrollToTop',\n xModule: scrollXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * Animation to use for showing/hiding the button.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation,\n },\n /**\n * Threshold in pixels from the top to show the button.\n *\n * @public\n */\n thresholdPx: Number,\n /**\n * Id of the target scroll component.\n *\n * @public\n */\n scrollId: {\n type: String,\n default: MainScrollId,\n },\n },\n setup(props) {\n /**\n * State of all the scroll components in this module.\n *\n * @internal\n */\n // TODO: Directly retrieve the needed data in this computed property\n const { data } = useState('scroll')\n\n /**\n * The scroll data retrieved for this component.\n *\n * @returns The scroll data for this component if a valid {@link ScrollToTop.scrollId} has been\n * passed. Otherwise it returns `null`.\n * @internal\n */\n const scrollData = computed(() => {\n return props.scrollId && data.value[props.scrollId]\n ? data.value[props.scrollId]\n : {\n position: 0,\n direction: 'UP',\n hasReachedStart: false,\n hasAlmostReachedEnd: false,\n hasReachedEnd: false,\n }\n })\n\n /**\n * Event that will be emitted when the scroll to top is clicked.\n *\n * @returns The event to be emitted when the scroll to top is clicked. The id as a payload.\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserClickedScrollToTop: props.scrollId }),\n )\n\n /**\n * Checks if the thresholdPx prop has been provided and if it is a number.\n *\n * @returns If the thresholdPx is a number or not.\n * @internal\n */\n const useThresholdStrategy = computed(() => typeof props.thresholdPx === 'number')\n\n /**\n * Checks if the threshold has been reached in case the threshold strategy is in use.\n *\n * @returns If the scrollTop is bigger than the thresholdPx.\n * @internal\n */\n const isThresholdReached = computed(\n () => useThresholdStrategy.value && scrollData.value.position > props.thresholdPx!,\n )\n\n /**\n * Returns if the scroll has almost reached its end or not.\n *\n * @returns True if the scroll has almost reached the end and the user is still scrolling down.\n * @internal\n */\n const hasAlmostReachedScrollEnd = computed(\n () => scrollData.value.hasAlmostReachedEnd && scrollData.value.direction === 'DOWN',\n )\n\n /**\n * Whether if the button is visible or not depending on the strategy being used.\n *\n * @returns If the button should be visible or not.\n * @internal\n */\n const isVisible = computed(() =>\n useThresholdStrategy.value ? isThresholdReached.value : hasAlmostReachedScrollEnd.value,\n )\n\n return {\n events,\n isVisible,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedScrollToTop`](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 scroll\n that it going to be scrolled.\n\n## Examples\n\n### Basic example\n\nThe component renders whatever is passed to it in the default slot and scrolls to top the scroll\nwith an id `scrollId`.\n\nIt also receives an optional threshold in pixels. When the threshold is reached from the top, the\ncomponent will be shown once the user scrolls `UP`.\n\nIf this parameter is not provided the button will be visible when the user almost reaches the end of\nthe scroll.\n\n```vue\n<template>\n <div>\n <ScrollToTop scroll-id=\"scrollId\" :threshold-px=\"1000\">\n <span>Scroll to top</span>\n </ScrollToTop>\n </div>\n</template>\n\n<script>\nimport { ScrollToTop } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollToTopTest',\n components: {\n ScrollToTop,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot"],"mappings":";;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAWYC,wBAXI,IAAS,CAAA,SAAA,CAAA,EAAA,IAAA,EAAA;AAAA,IAAA,OAAA,EAAAC,OAAA,CACvB,MASkB;AAAA,MARV,+BADRF,WASkB,CAAA,0BAAA,EAAA;AAAA,QAAA,GAAA,EAAA,CAAA;QAPhB,KAAM,EAAA,0BAAA;AAAA,QACN,WAAU,EAAA,eAAA;AAAA,QACV,YAAW,EAAA,eAAA;AAAA,QACV,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,OAAA,EAAA;yBAGT,MAAQ;AAAA,UAARG,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,SAAA,CAAA;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.vue.js","sources":["../../../../../src/x-modules/scroll/components/scroll.vue"],"sourcesContent":["<template>\n <BaseScroll\n :id=\"id\"\n ref=\"scrollRef\"\n @scroll=\"emitScroll\"\n @scroll:direction-change=\"emitScrollDirectionChange\"\n @scroll:at-start=\"emitScrollAtStart\"\n @scroll:almost-at-end=\"emitScrollAlmostAtEnd\"\n @scroll:at-end=\"emitScrollAtEnd\"\n >\n <slot />\n </BaseScroll>\n</template>\n\n<script lang=\"ts\">\nimport type { ComponentPublicInstance } from 'vue'\nimport type { ScrollDirection } from '../../../components/scroll/scroll.types'\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { defineComponent, ref } from 'vue'\nimport BaseScroll from '../../../components/scroll/base-scroll.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { scrollXModule } from '../x-module'\nimport { MainScrollId } from './scroll.const'\n\n/**\n * Scrollable container that emits scroll related X Events. It exposes all the listeners\n * and props from the {@link BaseScroll} component.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Scroll',\n xModule: scrollXModule.name,\n components: { BaseScroll },\n props: {\n /**\n * Id to identify the component.\n *\n * @public\n */\n id: {\n type: String,\n default: MainScrollId,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const scrollRef = ref<ComponentPublicInstance>()\n\n /**\n * Creates a {@link WireMetadata} metadata object for all the emitted events.\n *\n * @internal\n * @returns A new {@link WireMetadata} object.\n */\n const createEventMetadata = (): Partial<WireMetadata> => {\n return {\n target: scrollRef.value?.$el as HTMLElement,\n id: props.id,\n }\n }\n\n /**\n * Emits the `UserScrolled` event.\n *\n * @param position - The new position of scroll.\n * @internal\n */\n const emitScroll = (position: number) => {\n $x.emit('UserScrolled', position, createEventMetadata())\n }\n\n /**\n * Emits the `UserChangedScrollDirection` event when the scrolling direction has changed.\n *\n * @param direction - The new direction of scroll.\n * @internal\n */\n const emitScrollDirectionChange = (direction: ScrollDirection) => {\n $x.emit('UserChangedScrollDirection', direction, createEventMetadata())\n }\n\n /**\n * Emits the 'UserReachedScrollStart' event when the user reaches the start.\n *\n * @param isAtStart - A boolean indicating if the scroll is at the ending position.\n * @internal\n */\n const emitScrollAtStart = (isAtStart: boolean) => {\n $x.emit('UserReachedScrollStart', isAtStart, createEventMetadata())\n }\n\n /**\n * Emits the 'UserAlmostReachedScrollEnd' event when the user is about to reach to end.\n *\n * @param isAlmostAtEnd - A boolean indicating if the scroll is almost at its ending position.\n * @internal\n */\n const emitScrollAlmostAtEnd = (isAlmostAtEnd: boolean) => {\n $x.emit('UserAlmostReachedScrollEnd', isAlmostAtEnd, createEventMetadata())\n }\n\n /**\n * Emits the 'UserReachedScrollEnd' event when the user is about to reach to end.\n *\n * @param isAtEnd - A boolean indicating if the scroll is at the ending position.\n * @internal\n */\n const emitScrollAtEnd = (isAtEnd: boolean) => {\n $x.emit('UserReachedScrollEnd', isAtEnd, createEventMetadata())\n }\n\n /**\n * Scrolls to initial position when the user has clicked the scroll to top button.\n *\n * @param scrollId - {@link XEventsTypes.UserClickedScrollToTop}.\n * @internal\n */\n $x.on('UserClickedScrollToTop', false).subscribe((scrollId: string) => {\n if (scrollId === props.id && scrollRef.value) {\n ;(scrollRef.value.$el as HTMLElement).scrollTo({ top: 0, behavior: 'smooth' })\n }\n })\n\n return {\n scrollRef,\n emitScrollAtEnd,\n emitScrollAlmostAtEnd,\n emitScrollAtStart,\n emitScrollDirectionChange,\n emitScroll,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserScrolled`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted after the user scrolls in this container. The payload is the scroll top distance in\n pixels.\n- [`UserChangedScrollDirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user changes the scroll direction. The payload is the new scrolling direction.\n- [`UserReachedScrollStart`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user scrolls up to the initial position of the scroll.\n- [`UserAlmostReachedScrollEnd`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user is about to reach the bottom part of the scroll.\n- [`UserReachedScrollEnd`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user has reached the bottom part of the scroll.\n\n## Example\n\nThe Scroll is a component that wraps the BaseScroll and provides it for a unique id.\n\n### Customized usage\n\n#### Overriding the properties\n\nIt renders an element with scroll, with the content passed in the `default slot`.\n\n```vue\n<template>\n <Scroll id=\"exampleScrollId\" throttleMs=\"50\" distanceToBottom=\"300\">\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </Scroll>\n</template>\n\n<script>\nimport { Scroll } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollIdTest',\n components: {\n Scroll,\n },\n}\n</script>\n```\n\n#### Using scroll events.\n\n```vue\n<template>\n <Scroll\n @scroll=\"scroll\"\n @scroll:direction-change=\"scrollDirectionChange\"\n @scroll:at-start=\"scrollAtStart\"\n @scroll:almost-at-end=\"scrollAlmostAtEnd\"\n @scroll:at-end=\"scrollAtEnd\"\n id=\"exampleScrollId\"\n throttleMs=\"50\"\n distanceToBottom=\"300\"\n >\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </Scroll>\n</template>\n\n<script>\nimport { Scroll } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollIdTest',\n components: {\n Scroll,\n },\n methods: {\n scroll(position) {\n console.log('scroll', position)\n },\n scrollDirectionChange(direction) {\n console.log('scroll:direction-change', direction)\n },\n scrollAtStart(isAtStart) {\n console.log('scroll:at-start', isAtStart)\n },\n scrollAlmostAtEnd(isAlmostAtEnd) {\n console.log('scroll:almost-at-end', isAlmostAtEnd)\n },\n scrollAtEnd(isAtEnd) {\n console.log('scroll:at-end', isAtEnd)\n },\n },\n}\n</script>\n```\n\n#### Using XEvents.\n\nYou can use the XEvents subscribing to them.\n\n```vue\n<template>\n <Scroll throttleMs=\"50\" distanceToBottom=\"300\">\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </Scroll>\n</template>\n\n<script>\nimport { Scroll } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollIdTest',\n components: {\n Scroll,\n },\n mounted() {\n this.$x.on('UserScrolled').subscribe(distance => {\n console.log(distance)\n })\n this.$x.on('UserChangedScrollDirection').subscribe(direction => {\n console.log(direction)\n })\n this.$x.on('UserReachedScrollStart').subscribe(isAtStart => {\n console.log(isAtStart)\n })\n this.$x.on('UserAlmostReachedScrollEnd').subscribe(isAlmostAtEnd => {\n console.log(isAlmostAtEnd)\n })\n this.$x.on('UserReachedScrollEnd').subscribe(isAtEnd => {\n console.log(isAtEnd)\n })\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_withCtx","_renderSlot"],"mappings":";;;;;;sBACEA,WAUa,CAAA,qBAAA,EAAA;AAAA,IATV,EAAI,EAAA,IAAA,CAAA,EAAA;AAAA,IACL,GAAI,EAAA,WAAA;AAAA,IACH,QAAQ,EAAA,IAAA,CAAA,UAAA;AAAA,IACR,0BAAyB,EAAA,IAAA,CAAA,yBAAA;AAAA,IACzB,kBAAiB,EAAA,IAAA,CAAA,iBAAA;AAAA,IACjB,sBAAsB,EAAA,IAAA,CAAA,qBAAA;AAAA,IACtB,gBAAe,EAAA,IAAA,CAAA,eAAA;AAAA,GAAA,EAAA;AARpB,IAAA,OAAA,EAAAC,OAAA,CAUI,MAAQ;AAAA,MAARC,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;AAVZ,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,CAAA,EAAA,CAAA,IAAA,EAAA,UAAA,EAAA,0BAAA,EAAA,kBAAA,EAAA,sBAAA,EAAA,gBAAA,CAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"scroll.vue.js","sources":["../../../../../src/x-modules/scroll/components/scroll.vue"],"sourcesContent":["<template>\n <BaseScroll\n :id=\"id\"\n ref=\"scrollRef\"\n @scroll=\"emitScroll\"\n @scroll:direction-change=\"emitScrollDirectionChange\"\n @scroll:at-start=\"emitScrollAtStart\"\n @scroll:almost-at-end=\"emitScrollAlmostAtEnd\"\n @scroll:at-end=\"emitScrollAtEnd\"\n >\n <slot />\n </BaseScroll>\n</template>\n\n<script lang=\"ts\">\nimport type { ComponentPublicInstance } from 'vue'\nimport type { ScrollDirection } from '../../../components/scroll/scroll.types'\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { defineComponent, ref } from 'vue'\nimport BaseScroll from '../../../components/scroll/base-scroll.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { scrollXModule } from '../x-module'\nimport { MainScrollId } from './scroll.const'\n\n/**\n * Scrollable container that emits scroll related X Events. It exposes all the listeners\n * and props from the {@link BaseScroll} component.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Scroll',\n xModule: scrollXModule.name,\n components: { BaseScroll },\n props: {\n /**\n * Id to identify the component.\n *\n * @public\n */\n id: {\n type: String,\n default: MainScrollId,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const scrollRef = ref<ComponentPublicInstance>()\n\n /**\n * Creates a {@link WireMetadata} metadata object for all the emitted events.\n *\n * @internal\n * @returns A new {@link WireMetadata} object.\n */\n const createEventMetadata = (): Partial<WireMetadata> => {\n return {\n target: scrollRef.value?.$el as HTMLElement,\n id: props.id,\n }\n }\n\n /**\n * Emits the `UserScrolled` event.\n *\n * @param position - The new position of scroll.\n * @internal\n */\n const emitScroll = (position: number) => {\n $x.emit('UserScrolled', position, createEventMetadata())\n }\n\n /**\n * Emits the `UserChangedScrollDirection` event when the scrolling direction has changed.\n *\n * @param direction - The new direction of scroll.\n * @internal\n */\n const emitScrollDirectionChange = (direction: ScrollDirection) => {\n $x.emit('UserChangedScrollDirection', direction, createEventMetadata())\n }\n\n /**\n * Emits the 'UserReachedScrollStart' event when the user reaches the start.\n *\n * @param isAtStart - A boolean indicating if the scroll is at the ending position.\n * @internal\n */\n const emitScrollAtStart = (isAtStart: boolean) => {\n $x.emit('UserReachedScrollStart', isAtStart, createEventMetadata())\n }\n\n /**\n * Emits the 'UserAlmostReachedScrollEnd' event when the user is about to reach to end.\n *\n * @param isAlmostAtEnd - A boolean indicating if the scroll is almost at its ending position.\n * @internal\n */\n const emitScrollAlmostAtEnd = (isAlmostAtEnd: boolean) => {\n $x.emit('UserAlmostReachedScrollEnd', isAlmostAtEnd, createEventMetadata())\n }\n\n /**\n * Emits the 'UserReachedScrollEnd' event when the user is about to reach to end.\n *\n * @param isAtEnd - A boolean indicating if the scroll is at the ending position.\n * @internal\n */\n const emitScrollAtEnd = (isAtEnd: boolean) => {\n $x.emit('UserReachedScrollEnd', isAtEnd, createEventMetadata())\n }\n\n /**\n * Scrolls to initial position when the user has clicked the scroll to top button.\n *\n * @param scrollId - {@link XEventsTypes.UserClickedScrollToTop}.\n * @internal\n */\n $x.on('UserClickedScrollToTop', false).subscribe((scrollId: string) => {\n if (scrollId === props.id && scrollRef.value) {\n ;(scrollRef.value.$el as HTMLElement).scrollTo({ top: 0, behavior: 'smooth' })\n }\n })\n\n return {\n scrollRef,\n emitScrollAtEnd,\n emitScrollAlmostAtEnd,\n emitScrollAtStart,\n emitScrollDirectionChange,\n emitScroll,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserScrolled`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted after the user scrolls in this container. The payload is the scroll top distance in\n pixels.\n- [`UserChangedScrollDirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user changes the scroll direction. The payload is the new scrolling direction.\n- [`UserReachedScrollStart`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user scrolls up to the initial position of the scroll.\n- [`UserAlmostReachedScrollEnd`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user is about to reach the bottom part of the scroll.\n- [`UserReachedScrollEnd`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n emitted when the user has reached the bottom part of the scroll.\n\n## Example\n\nThe Scroll is a component that wraps the BaseScroll and provides it for a unique id.\n\n### Customized usage\n\n#### Overriding the properties\n\nIt renders an element with scroll, with the content passed in the `default slot`.\n\n```vue\n<template>\n <Scroll id=\"exampleScrollId\" throttleMs=\"50\" distanceToBottom=\"300\">\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </Scroll>\n</template>\n\n<script>\nimport { Scroll } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollIdTest',\n components: {\n Scroll,\n },\n}\n</script>\n```\n\n#### Using scroll events.\n\n```vue\n<template>\n <Scroll\n @scroll=\"scroll\"\n @scroll:direction-change=\"scrollDirectionChange\"\n @scroll:at-start=\"scrollAtStart\"\n @scroll:almost-at-end=\"scrollAlmostAtEnd\"\n @scroll:at-end=\"scrollAtEnd\"\n id=\"exampleScrollId\"\n throttleMs=\"50\"\n distanceToBottom=\"300\"\n >\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </Scroll>\n</template>\n\n<script>\nimport { Scroll } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollIdTest',\n components: {\n Scroll,\n },\n methods: {\n scroll(position) {\n console.log('scroll', position)\n },\n scrollDirectionChange(direction) {\n console.log('scroll:direction-change', direction)\n },\n scrollAtStart(isAtStart) {\n console.log('scroll:at-start', isAtStart)\n },\n scrollAlmostAtEnd(isAlmostAtEnd) {\n console.log('scroll:almost-at-end', isAlmostAtEnd)\n },\n scrollAtEnd(isAtEnd) {\n console.log('scroll:at-end', isAtEnd)\n },\n },\n}\n</script>\n```\n\n#### Using XEvents.\n\nYou can use the XEvents subscribing to them.\n\n```vue\n<template>\n <Scroll throttleMs=\"50\" distanceToBottom=\"300\">\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </Scroll>\n</template>\n\n<script>\nimport { Scroll } from '@empathyco/x-components/scroll'\n\nexport default {\n name: 'ScrollIdTest',\n components: {\n Scroll,\n },\n mounted() {\n this.$x.on('UserScrolled').subscribe(distance => {\n console.log(distance)\n })\n this.$x.on('UserChangedScrollDirection').subscribe(direction => {\n console.log(direction)\n })\n this.$x.on('UserReachedScrollStart').subscribe(isAtStart => {\n console.log(isAtStart)\n })\n this.$x.on('UserAlmostReachedScrollEnd').subscribe(isAlmostAtEnd => {\n console.log(isAlmostAtEnd)\n })\n this.$x.on('UserReachedScrollEnd').subscribe(isAtEnd => {\n console.log(isAtEnd)\n })\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_renderSlot"],"mappings":";;;;;;sBACEA,WAUa,CAAA,qBAAA,EAAA;AAAA,IATV,EAAI,EAAA,IAAA,CAAA,EAAA;AAAA,IACL,GAAI,EAAA,WAAA;AAAA,IACH,QAAQ,EAAA,IAAA,CAAA,UAAA;AAAA,IACR,0BAAyB,EAAA,IAAA,CAAA,yBAAA;AAAA,IACzB,kBAAiB,EAAA,IAAA,CAAA,iBAAA;AAAA,IACjB,sBAAsB,EAAA,IAAA,CAAA,qBAAA;AAAA,IACtB,gBAAe,EAAA,IAAA,CAAA,eAAA;AAAA,GAAA,EAAA;qBAEhB,MAAQ;AAAA,MAARC,UAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"banner.vue.js","sources":["../../../../../src/x-modules/search/components/banner.vue"],"sourcesContent":["<template>\n <component\n :is=\"banner.url ? 'a' : 'figure'\"\n v-if=\"!imageFailed\"\n :href=\"banner.url\"\n class=\"x-banner\"\n data-test=\"banner\"\n v-on=\"banner.url ? anchorEvents() : {}\"\n >\n <img\n :src=\"banner.image\"\n :alt=\"banner.title ? banner.title : 'Banner'\"\n class=\"x-banner__image\"\n data-test=\"banner-image\"\n @error=\"imageFailed = true\"\n />\n <h2 v-if=\"banner.title\" class=\"x-banner__title\" :class=\"titleClass\" data-test=\"banner-title\">\n {{ banner.title }}\n </h2>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Banner as BannerModel } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent, ref } from 'vue'\nimport { useXBus } from '../../../composables/use-x-bus'\nimport { searchXModule } from '../x-module'\n\n/**.\n * A banner result is just an item that has been inserted into the search results to advertise\n * something. Usually it is the first item in the grid or it can be placed in the middle of them\n * and fill the whole row where appears.\n * The banner may be clickable or non-clickable depending on whether it has an associated URL\n * or not. It contains an image and, optionally, a title. In case the image does not\n * load due to an error the banner will not be rendered.\n *\n * Additionally, this component exposes the following props to modify the classes of the\n * elements: `titleClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Banner',\n xModule: searchXModule.name,\n props: {\n /**\n * The banner data.\n *\n * @public\n */\n banner: {\n type: Object as PropType<BannerModel>,\n required: true,\n },\n titleClass: String,\n },\n setup(props) {\n const xBus = useXBus()\n\n /**\n * Flag to handle banner image errors.\n *\n * @public\n */\n const imageFailed = ref(false)\n\n /**\n * Emits the banner click event.\n *\n * @internal\n */\n const emitClickEvent = (): void => {\n xBus.emit('UserClickedABanner', props.banner)\n }\n\n /**\n * Returns the events supported by the anchor.\n *\n * @returns Events supported by the anchor.\n *\n * @internal\n */\n const anchorEvents = (): Partial<{\n [key in keyof GlobalEventHandlersEventMap]: () => void\n }> => ({\n click: () => emitClickEvent(),\n auxclick: () => emitClickEvent(),\n contextmenu: () => emitClickEvent(),\n })\n\n return {\n imageFailed,\n anchorEvents,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-banner {\n display: flex;\n flex-flow: column nowrap;\n text-decoration: none;\n}\n\n.x-banner__image {\n width: 100%;\n object-fit: contain;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nIn this example banned data is passed as a prop.\n\n_Here you can see how the `Banner` component is rendered._\n\n```vue\n<template>\n <Banner :banner=\"banner\" />\n</template>\n\n<script>\nimport { Banner } from '@empathyco/x-components/search'\nexport default {\n name: 'BannerDemo',\n components: {\n Banner,\n },\n data() {\n return {\n banner: {\n modelName: 'Banner',\n id: 'banner-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n\n### Customizing the items with classes\n\nThe `titleClass` prop can be used to add classes to the banner title.\n\n```vue\n<template>\n <Banner :banner=\"banner\" titleClass=\"x-bg-neutral-50\" />\n</template>\n\n<script>\nimport { Banner } from '@empathyco/x-components/search'\nexport default {\n name: 'BannerDemo',\n components: {\n Banner,\n },\n data() {\n return {\n banner: {\n modelName: 'Banner',\n id: 'banner-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_toHandlers","_createElementVNode","_createElementBlock","_normalizeClass","_toDisplayString","_createCommentVNode"],"mappings":";;;;;AAAA,MAAA,UAAA,GAAA,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA;;AAGW,EAAA,OAAA,CAAA,IAAA,CAAA,WAAA,IAAAA,SAAA,EAAA,EAFTC,WAkBY,CAAAC,uBAAA,CAjBL,IAAO,CAAA,MAAA,CAAA,GAAA,GAAG,iBADjBC,UAkBY,CAAA;AAAA,IAnBd,GAAA,EAAA,CAAA;AAAA,IAIK,MAAM,IAAO,CAAA,MAAA,CAAA,GAAA;AAAA,IACd,KAAM,EAAA,UAAA;AAAA,IACN,WAAU,EAAA,QAAA;AAAA,GAAA,EACVC,UAAuC,CAAA,IAAA,CAAjC,MAAO,CAAA,GAAA,GAAM,IAAY,CAAA,YAAA,EAAA,GAAA,EAAA,CAAA,CAAA,EAAA;AAAA,IAPnC,iBASI,MAME;AAAA,MANFC,kBAME,CAAA,KAAA,EAAA;AAAA,QALC,KAAK,IAAO,CAAA,MAAA,CAAA,KAAA;AAAA,QACZ,GAAK,EAAA,IAAA,CAAA,MAAA,CAAO,KAAQ,GAAA,IAAA,CAAA,MAAA,CAAO,KAAK,GAAA,QAAA;AAAA,QACjC,KAAM,EAAA,iBAAA;AAAA,QACN,WAAU,EAAA,cAAA;AAAA,QACT,OAAA,EAAK,sCAAE,IAAW,CAAA,WAAA,GAAA,IAAA,CAAA;AAAA,OAdzB,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,CAAA;AAAA,MAgBc,YAAO,KAAjB,IAAAL,SAAA,EAAA,EAAAM,kBAAA;AAAA,QAEK,IAAA;AAAA,QAAA;AAAA,UAlBT,GAAA,EAAA,CAAA;AAAA,UAgB4B,KAAA,EAhB5BC,cAgBkC,CAAA,CAAA,iBAAA,EAA0B,IAAU,CAAA,UAAA,CAAA,CAAA;AAAA,UAAE,WAAU,EAAA,cAAA;AAAA,SAAA;AACzE,QAAAC,eAAA,CAAA,IAAA,CAAA,MAAA,CAAO,KAAK,CAAA;AAAA,QAAA,CAAA;AAAA;AAAA,OAjBrB,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,EAAA,EAAA,CAAA,MAAA,CAAA,CAAA,IAAAA,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"banner.vue.js","sources":["../../../../../src/x-modules/search/components/banner.vue"],"sourcesContent":["<template>\n <component\n :is=\"banner.url ? 'a' : 'figure'\"\n v-if=\"!imageFailed\"\n :href=\"banner.url\"\n class=\"x-banner\"\n data-test=\"banner\"\n v-on=\"banner.url ? anchorEvents() : {}\"\n >\n <img\n :src=\"banner.image\"\n :alt=\"banner.title ? banner.title : 'Banner'\"\n class=\"x-banner__image\"\n data-test=\"banner-image\"\n @error=\"imageFailed = true\"\n />\n <h2 v-if=\"banner.title\" class=\"x-banner__title\" :class=\"titleClass\" data-test=\"banner-title\">\n {{ banner.title }}\n </h2>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Banner as BannerModel } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent, ref } from 'vue'\nimport { useXBus } from '../../../composables/use-x-bus'\nimport { searchXModule } from '../x-module'\n\n/**.\n * A banner result is just an item that has been inserted into the search results to advertise\n * something. Usually it is the first item in the grid or it can be placed in the middle of them\n * and fill the whole row where appears.\n * The banner may be clickable or non-clickable depending on whether it has an associated URL\n * or not. It contains an image and, optionally, a title. In case the image does not\n * load due to an error the banner will not be rendered.\n *\n * Additionally, this component exposes the following props to modify the classes of the\n * elements: `titleClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Banner',\n xModule: searchXModule.name,\n props: {\n /**\n * The banner data.\n *\n * @public\n */\n banner: {\n type: Object as PropType<BannerModel>,\n required: true,\n },\n titleClass: String,\n },\n setup(props) {\n const xBus = useXBus()\n\n /**\n * Flag to handle banner image errors.\n *\n * @public\n */\n const imageFailed = ref(false)\n\n /**\n * Emits the banner click event.\n *\n * @internal\n */\n const emitClickEvent = (): void => {\n xBus.emit('UserClickedABanner', props.banner)\n }\n\n /**\n * Returns the events supported by the anchor.\n *\n * @returns Events supported by the anchor.\n *\n * @internal\n */\n const anchorEvents = (): Partial<{\n [key in keyof GlobalEventHandlersEventMap]: () => void\n }> => ({\n click: () => emitClickEvent(),\n auxclick: () => emitClickEvent(),\n contextmenu: () => emitClickEvent(),\n })\n\n return {\n imageFailed,\n anchorEvents,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-banner {\n display: flex;\n flex-flow: column nowrap;\n text-decoration: none;\n}\n\n.x-banner__image {\n width: 100%;\n object-fit: contain;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nIn this example banned data is passed as a prop.\n\n_Here you can see how the `Banner` component is rendered._\n\n```vue\n<template>\n <Banner :banner=\"banner\" />\n</template>\n\n<script>\nimport { Banner } from '@empathyco/x-components/search'\nexport default {\n name: 'BannerDemo',\n components: {\n Banner,\n },\n data() {\n return {\n banner: {\n modelName: 'Banner',\n id: 'banner-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n\n### Customizing the items with classes\n\nThe `titleClass` prop can be used to add classes to the banner title.\n\n```vue\n<template>\n <Banner :banner=\"banner\" titleClass=\"x-bg-neutral-50\" />\n</template>\n\n<script>\nimport { Banner } from '@empathyco/x-components/search'\nexport default {\n name: 'BannerDemo',\n components: {\n Banner,\n },\n data() {\n return {\n banner: {\n modelName: 'Banner',\n id: 'banner-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_toHandlers","_withCtx","_createElementVNode","_createElementBlock","_normalizeClass","_toDisplayString","_createCommentVNode"],"mappings":";;;;;;;AAGW,EAAA,OAAA,CAAA,IAAA,CAAA,WAAA,IAAAA,SAAA,EAAA,EAFTC,WAkBY,CAAAC,uBAAA,CAjBL,IAAO,CAAA,MAAA,CAAA,GAAA,GAAG,iBADjBC,UAkBY,CAAA;AAAA,IAAA,GAAA,EAAA,CAAA;AAfT,IAAA,IAAA,EAAM,IAAO,CAAA,MAAA,CAAA,GAAA;AAAA,IACd,KAAM,EAAA,UAAA;AAAA,IACN,WAAU,EAAA,QAAA;AAAA,GAAA,EACVC,UAAuC,CAAA,IAAA,CAAjC,MAAO,CAAA,GAAA,GAAM,IAAY,CAAA,YAAA,EAAA,GAAA,EAAA,CAAA,CAAA,EAAA;AAAA,IAAA,OAAA,EAAAC,OAAA,CAE/B,MAME;AAAA,MANFC,kBAME,CAAA,KAAA,EAAA;AAAA,QALC,KAAK,IAAO,CAAA,MAAA,CAAA,KAAA;AAAA,QACZ,GAAK,EAAA,IAAA,CAAA,MAAA,CAAO,KAAQ,GAAA,IAAA,CAAA,MAAA,CAAO,KAAK,GAAA,QAAA;AAAA,QACjC,KAAM,EAAA,iBAAA;AAAA,QACN,WAAU,EAAA,cAAA;AAAA,QACT,OAAA,EAAK,sCAAE,IAAW,CAAA,WAAA,GAAA,IAAA,CAAA;AAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,CAAA;AAEX,MAAA,IAAA,CAAA,MAAA,CAAO,KAAjB,IAAAN,SAAA,EAAA,EAAAO,kBAAA;AAAA,QAEK,IAAA;AAAA,QAAA;AAAA,UAAA,GAAA,EAAA,CAAA;UAFmB,KAAK,EAAAC,cAAA,CAAA,CAAC,mBAA0B,IAAU,CAAA,UAAA,CAAA,CAAA;AAAA,UAAE,WAAU,EAAA,cAAA;AAAA,SAAA;AACzE,QAAAC,eAAA,CAAA,IAAA,CAAA,MAAA,CAAO,KAAK,CAAA;AAAA,QAAA,CAAA;AAAA;AAAA,OAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"fallback-disclaimer.vue.js","sources":["../../../../../src/x-modules/search/components/fallback-disclaimer.vue"],"sourcesContent":["<template>\n <div\n v-if=\"fromNoResultsWithFilters\"\n class=\"x-fallback-disclaimer\"\n data-test=\"fallback-disclaimer\"\n >\n <slot v-bind=\"{ query }\">\n No results found for {{ query }} with the selected filters. The filters have been unselected.\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * The `FallbackDisclaimer` component shows a message if the filters have been removed\n * from the current search because there were no results.\n *\n * @public\n */\nexport default defineComponent({\n name: 'FallbackDisclaimer',\n xModule: searchXModule.name,\n setup() {\n const { query, fromNoResultsWithFilters } = useState('search')\n\n return { query, fromNoResultsWithFilters }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis default fallback disclaimer component reads the query from the search state and passes it to\nits default slot. This component will be rendered if there is a no results with filters situation.\n\n### Basic usage\n\n```vue\n<FallbackDisclaimer />\n```\n\n### Customizing its contents\n\n```vue\n<FallbackDisclaimer>\n <template #default=\"{ query }\">\n No results found for '{{ query }}' with the selected filters. The filters have been unselected.\n </template>\n</FallbackDisclaimer>\n\n<script>\nimport { FallbackDisclaimer } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n FallbackDisclaimer,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EAGI,KAAM,EAAA,uBAAA;AAAA,EACN,WAAU,EAAA,qBAAA;;;SAFJ,IADR,CAAA,wBAAA,IAAAA,SAAA,EAAA,EAAAC,kBAAA,CAQM,OARN,UAQM,EAAA;AAAA,IAHJC,UAEO,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EARXC,cAMoB,CAAAC,kBAAA,CAAA,EAAA,KAAA,EAAA,IAAA,CAAA,KAAA,MAAhB,MAEO;AAAA,MARXC,eAAA;AAAA,QAM6B,wBAAA,GACFC,eAAG,CAAA,IAAA,CAAA,KAAK,CAAG,GAAA,gEAAA;AAAA,QAClC,CAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AARJ,GAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"fallback-disclaimer.vue.js","sources":["../../../../../src/x-modules/search/components/fallback-disclaimer.vue"],"sourcesContent":["<template>\n <div\n v-if=\"fromNoResultsWithFilters\"\n class=\"x-fallback-disclaimer\"\n data-test=\"fallback-disclaimer\"\n >\n <slot v-bind=\"{ query }\">\n No results found for {{ query }} with the selected filters. The filters have been unselected.\n </slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * The `FallbackDisclaimer` component shows a message if the filters have been removed\n * from the current search because there were no results.\n *\n * @public\n */\nexport default defineComponent({\n name: 'FallbackDisclaimer',\n xModule: searchXModule.name,\n setup() {\n const { query, fromNoResultsWithFilters } = useState('search')\n\n return { query, fromNoResultsWithFilters }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis default fallback disclaimer component reads the query from the search state and passes it to\nits default slot. This component will be rendered if there is a no results with filters situation.\n\n### Basic usage\n\n```vue\n<FallbackDisclaimer />\n```\n\n### Customizing its contents\n\n```vue\n<FallbackDisclaimer>\n <template #default=\"{ query }\">\n No results found for '{{ query }}' with the selected filters. The filters have been unselected.\n </template>\n</FallbackDisclaimer>\n\n<script>\nimport { FallbackDisclaimer } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n FallbackDisclaimer,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;;EAGI,KAAM,EAAA,uBAAA;AAAA,EACN,WAAU,EAAA,qBAAA;;;SAFJ,IADR,CAAA,wBAAA,IAAAA,SAAA,EAAA,EAAAC,kBAAA,CAQM,OARN,UAQM,EAAA;AAAA,IAHJC,UAEO,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,KAAA,EAFS,IAAK,CAAA,KAAA,EAAA,CAAA,CAAA,EAArB,MAEO;AAAA,MAAAC,eAAA;QAFkB,wBACF,GAAAC,eAAA,CAAG,UAAK,CAAG,GAAA,gEAAA;AAAA,QAClC,CAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"partial-query-button.vue.js","sources":["../../../../../src/x-modules/search/components/partial-query-button.vue"],"sourcesContent":["<template>\n <button\n ref=\"partialButtonEl\"\n class=\"x-partial-query-button x-button\"\n data-test=\"partial-query-button\"\n @click=\"emitEvents\"\n >\n <slot v-bind=\"{ query }\">{{ query }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { defineComponent, ref } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { searchXModule } from '../x-module'\n\n/**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link SearchXEvents.UserClickedPartialQuery} events, expressing the user\n * intention to set the partial query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'PartialQueryButton',\n xModule: searchXModule.name,\n props: {\n /**\n * The query property.\n *\n * @public\n */\n query: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const partialButtonEl = ref<HTMLElement>()\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n const createEventMetadata = (): Omit<WireMetadata, 'moduleName'> => ({\n target: partialButtonEl.value,\n feature: 'partial_result',\n })\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n const emitEvents = () => {\n $x.emit('UserAcceptedAQuery', props.query, createEventMetadata())\n $x.emit('UserClickedPartialQuery', props.query, createEventMetadata())\n }\n\n return {\n partialButtonEl,\n emitEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits 2 different events:\n\n- [`UserAcceptedAQuery`](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 partial query. The event payload is the partial\n query data.\n- [`UserClickedPartialQuery`](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 partial query. The event payload is the partial\n query data.\n\n## Examples\n\n### Basic example\n\nA button that when pressed emits the `XEventsTypes.UserAcceptedAQuery` and\n`SearchXEvents.UserClickedPartialQuery` events, expressing the user intention to set the partial\nquery.\n\nThe component sets the current query as the new query and emits the `UserAcceptedAQuery` and\n`UserClickedPartialQuery` events when is clicked.\n\n```vue\n<template>\n <PartialQueryButton :query=\"query\" />\n</template>\n```\n\n### Customizing its contents\n\n```vue\n<template>\n <PartialQueryButton>\n <template #default=\"{ query }\">\n <span class=\"x-partial-query-button__text\">\n Set the Partial query as the new query: {{ query }}!\n </span>\n </template>\n </PartialQueryButton>\n</template>\n\n<script>\nimport { PartialQueryButton } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n PartialQueryButton,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IAOS,QAAA;AAAA,IAAA;AAAA,MANP,GAAI,EAAA,iBAAA;AAAA,MACJ,KAAM,EAAA,iCAAA;AAAA,MACN,WAAU,EAAA,sBAAA;AAAA,MACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,KAAA;;AAER,MAAAC,UAAA,CAA2C,IAP/C,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,KAAA,EAOoB,IAAK,CAAA,KAAA,EAAA,CAAA,CAAA,EAArB,MAA2C;AAAA,QAP/CC,eAAA;AAAA,UAAAC,eAAA,CAOgC,IAAK,CAAA,KAAA,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"partial-query-button.vue.js","sources":["../../../../../src/x-modules/search/components/partial-query-button.vue"],"sourcesContent":["<template>\n <button\n ref=\"partialButtonEl\"\n class=\"x-partial-query-button x-button\"\n data-test=\"partial-query-button\"\n @click=\"emitEvents\"\n >\n <slot v-bind=\"{ query }\">{{ query }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { defineComponent, ref } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { searchXModule } from '../x-module'\n\n/**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link SearchXEvents.UserClickedPartialQuery} events, expressing the user\n * intention to set the partial query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'PartialQueryButton',\n xModule: searchXModule.name,\n props: {\n /**\n * The query property.\n *\n * @public\n */\n query: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const $x = use$x()\n\n const partialButtonEl = ref<HTMLElement>()\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n const createEventMetadata = (): Omit<WireMetadata, 'moduleName'> => ({\n target: partialButtonEl.value,\n feature: 'partial_result',\n })\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n const emitEvents = () => {\n $x.emit('UserAcceptedAQuery', props.query, createEventMetadata())\n $x.emit('UserClickedPartialQuery', props.query, createEventMetadata())\n }\n\n return {\n partialButtonEl,\n emitEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits 2 different events:\n\n- [`UserAcceptedAQuery`](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 partial query. The event payload is the partial\n query data.\n- [`UserClickedPartialQuery`](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 partial query. The event payload is the partial\n query data.\n\n## Examples\n\n### Basic example\n\nA button that when pressed emits the `XEventsTypes.UserAcceptedAQuery` and\n`SearchXEvents.UserClickedPartialQuery` events, expressing the user intention to set the partial\nquery.\n\nThe component sets the current query as the new query and emits the `UserAcceptedAQuery` and\n`UserClickedPartialQuery` events when is clicked.\n\n```vue\n<template>\n <PartialQueryButton :query=\"query\" />\n</template>\n```\n\n### Customizing its contents\n\n```vue\n<template>\n <PartialQueryButton>\n <template #default=\"{ query }\">\n <span class=\"x-partial-query-button__text\">\n Set the Partial query as the new query: {{ query }}!\n </span>\n </template>\n </PartialQueryButton>\n</template>\n\n<script>\nimport { PartialQueryButton } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n PartialQueryButton,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode"],"mappings":";;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IAOS,QAAA;AAAA,IAAA;AAAA,MANP,GAAI,EAAA,iBAAA;AAAA,MACJ,KAAM,EAAA,iCAAA;AAAA,MACN,WAAU,EAAA,sBAAA;AAAA,MACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,KAAA;;MAERC,UAA2C,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,KAAA,EAA3B,IAAK,CAAA,KAAA,EAAA,CAAA,CAAA,EAArB,MAA2C;AAAA,QAAAC,eAAA;0BAAf,IAAK,CAAA,KAAA,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"partial-results-list.vue.js","sources":["../../../../../src/x-modules/search/components/partial-results-list.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n v-if=\"partialResults.length\"\n class=\"x-partial-results-list\"\n data-test=\"partial-results\"\n tag=\"ul\"\n >\n <li\n v-for=\"(partialResult, index) in partialResults\"\n :key=\"`${partialResult.query}-${index}`\"\n class=\"x-partial-result\"\n data-test=\"partial-result\"\n >\n <!--\n @slot (Required) Partial results item content\n @binding {Partial} partialResult - Partial Result data\n -->\n <slot :partial-result=\"partialResult\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { searchXModule } from '../x-module'\n\n/**\n * It renders a list of partial results from {@link SearchState.partialResults} by default.\n * It also provides the partial result slot to customize the item with the partial result bound.\n *\n * @public\n */\nexport default defineComponent({\n name: 'PartialResultsList',\n xModule: searchXModule.name,\n props: {\n /**\n * Animation component that will be used to animate the partial results.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n\n /**\n * Maximum number of partial results to show.\n *\n * @public\n */\n maxItemsToRender: {\n type: Number,\n default: 5,\n },\n },\n setup(props) {\n /**\n * The partials results from the search state.\n *\n * @public\n */\n const items = useState('search').partialResults\n\n /**\n * A limited number of partial results.\n *\n * @returns The partial results sliced by the maxItemsToRender.\n *\n * @internal\n */\n const partialResults = computed(() => items.value.slice(0, props.maxItemsToRender))\n\n return {\n partialResults,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-partial-results-list {\n display: flex;\n flex-flow: column nowrap;\n list-style-type: none;\n padding: 0;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component loops through an array of partials an exposed a slot to use customize each partial.\n\n### Basic example\n\nIt renders a list of partial results using the default slot:\n\n```vue\n<template>\n <PartialResultsList>\n <template #default=\"{ partialResult }\">\n <ResultsList :results=\"partialResult.results\" />\n </template>\n </PartialResultsList>\n</template>\n```\n\n### Configuring the number of partials\n\nIt sets the maximum partials to show to 3.\n\n```vue\n<template>\n <PartialResultsList :maxItemsToRender=\"3\">\n <template #default=\"{ partialResult }\">\n <ResultsList :results=\"partialResult.results\" />\n </template>\n </PartialResultsList>\n</template>\n```\n\n### Rendering usage\n\nIt renders a list of partial results using the default slot. It will show the query, the partial\nresults and a button to update the query with the partial one.\n\n```vue\n<template>\n <PartialResultsList>\n <template #default=\"{ partialResult }\">\n <span>{{ partialResult.query }}</span>\n <BaseGrid :columns=\"4\" :items=\"partialResult.results\">\n <template #result=\"{ item }\">\n <BaseResultLink :result=\"item\">\n <template #default=\"{ item }\">\n <BaseResultImage :result=\"item\" />\n <span class=\"x-result__title\">{{ item.name }}</span>\n </template>\n </BaseResultLink>\n </template>\n </BaseGrid>\n <PartialQueryButton :query=\"partialResult.query\">\n <template #default=\"{ query }\">Ver todos {{ query }}</template>\n </PartialQueryButton>\n </template>\n </PartialResultsList>\n</template>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_createElementBlock","_Fragment","_renderList","_renderSlot","_createCommentVNode"],"mappings":";;;;;;SAGU,IAAe,CAAA,cAAA,CAAA,MAAA,IAAAA,SAAA,EAAA,EAFvBC,WAmBY,CAAAC,uBAAA,CAlBL,IAAS,CAAA,SAAA,CAAA,EAAA;AAAA,IAFlB,GAAA,EAAA,CAAA;AAAA,IAII,KAAM,EAAA,wBAAA;AAAA,IACN,WAAU,EAAA,iBAAA;AAAA,IACV,GAAI,EAAA,IAAA;AAAA,GAAA,EAAA;AANR,IAAA,OAAA,EAAAC,OAAA,CASM,MAAgD;AAAA,OADlDH,SAAA,CAAA,IAAA,CAAA,EAAAI,kBAAA;AAAA,QAWKC,QAAA;AAAA,QAAA,IAAA;AAAA,QAnBTC,UASuC,CAAA,IAAA,CAAA,cAAA,EATvC,CASc,aAAA,EAAe,KAAK,KAAA;8BAD9BF,kBAWK,CAAA,IAAA,EAAA;AAAA,YATF,GAAG,EAAA,CAAA,EAAK,aAAc,CAAA,KAAK,IAAI,KAAK,CAAA,CAAA;AAAA,YACrC,KAAM,EAAA,kBAAA;AAAA,YACN,WAAU,EAAA,gBAAA;AAAA,WAAA,EAAA;AAMV,YAAAG,UAAA,CAAwC,0BAAjC,aAA6B,EAAA,EAAA,KAAA,CAAA,EAAA,IAAA,CAAA;AAAA,WAAA,CAAA,CAAA;;;;;;AAlB1C,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"partial-results-list.vue.js","sources":["../../../../../src/x-modules/search/components/partial-results-list.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n v-if=\"partialResults.length\"\n class=\"x-partial-results-list\"\n data-test=\"partial-results\"\n tag=\"ul\"\n >\n <li\n v-for=\"(partialResult, index) in partialResults\"\n :key=\"`${partialResult.query}-${index}`\"\n class=\"x-partial-result\"\n data-test=\"partial-result\"\n >\n <!--\n @slot (Required) Partial results item content\n @binding {Partial} partialResult - Partial Result data\n -->\n <slot :partial-result=\"partialResult\" />\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { searchXModule } from '../x-module'\n\n/**\n * It renders a list of partial results from {@link SearchState.partialResults} by default.\n * It also provides the partial result slot to customize the item with the partial result bound.\n *\n * @public\n */\nexport default defineComponent({\n name: 'PartialResultsList',\n xModule: searchXModule.name,\n props: {\n /**\n * Animation component that will be used to animate the partial results.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n\n /**\n * Maximum number of partial results to show.\n *\n * @public\n */\n maxItemsToRender: {\n type: Number,\n default: 5,\n },\n },\n setup(props) {\n /**\n * The partials results from the search state.\n *\n * @public\n */\n const items = useState('search').partialResults\n\n /**\n * A limited number of partial results.\n *\n * @returns The partial results sliced by the maxItemsToRender.\n *\n * @internal\n */\n const partialResults = computed(() => items.value.slice(0, props.maxItemsToRender))\n\n return {\n partialResults,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-partial-results-list {\n display: flex;\n flex-flow: column nowrap;\n list-style-type: none;\n padding: 0;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component loops through an array of partials an exposed a slot to use customize each partial.\n\n### Basic example\n\nIt renders a list of partial results using the default slot:\n\n```vue\n<template>\n <PartialResultsList>\n <template #default=\"{ partialResult }\">\n <ResultsList :results=\"partialResult.results\" />\n </template>\n </PartialResultsList>\n</template>\n```\n\n### Configuring the number of partials\n\nIt sets the maximum partials to show to 3.\n\n```vue\n<template>\n <PartialResultsList :maxItemsToRender=\"3\">\n <template #default=\"{ partialResult }\">\n <ResultsList :results=\"partialResult.results\" />\n </template>\n </PartialResultsList>\n</template>\n```\n\n### Rendering usage\n\nIt renders a list of partial results using the default slot. It will show the query, the partial\nresults and a button to update the query with the partial one.\n\n```vue\n<template>\n <PartialResultsList>\n <template #default=\"{ partialResult }\">\n <span>{{ partialResult.query }}</span>\n <BaseGrid :columns=\"4\" :items=\"partialResult.results\">\n <template #result=\"{ item }\">\n <BaseResultLink :result=\"item\">\n <template #default=\"{ item }\">\n <BaseResultImage :result=\"item\" />\n <span class=\"x-result__title\">{{ item.name }}</span>\n </template>\n </BaseResultLink>\n </template>\n </BaseGrid>\n <PartialQueryButton :query=\"partialResult.query\">\n <template #default=\"{ query }\">Ver todos {{ query }}</template>\n </PartialQueryButton>\n </template>\n </PartialResultsList>\n</template>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","_renderSlot"],"mappings":";;;;;;SAGU,IAAe,CAAA,cAAA,CAAA,MAAA,IAAAA,SAAA,EAAA,EAFvBC,WAmBY,CAAAC,uBAAA,CAlBL,IAAS,CAAA,SAAA,CAAA,EAAA;AAAA,IAAA,GAAA,EAAA,CAAA;IAEd,KAAM,EAAA,wBAAA;AAAA,IACN,WAAU,EAAA,iBAAA;AAAA,IACV,GAAI,EAAA,IAAA;AAAA,GAAA,EAAA;qBAGF,MAAgD;AAAA,OADlDF,SAAA,CAAA,IAAA,CAAA,EAAAG,kBAAA;AAAA,QAWKC,QAAA;AAAA,QAAA,IAAA;AAAA,QAV8BC,UAAA,CAAA,IAAA,CAAA,cAAA,EAAc,CAAvC,aAAA,EAAe,KAAK,KAAA;8BAD9BF,kBAWK,CAAA,IAAA,EAAA;AAAA,YATF,GAAG,EAAA,CAAA,EAAK,aAAc,CAAA,KAAK,IAAI,KAAK,CAAA,CAAA;AAAA,YACrC,KAAM,EAAA,kBAAA;AAAA,YACN,WAAU,EAAA,gBAAA;AAAA,WAAA,EAAA;AAMV,YAAAG,UAAA,CAAwC,0BAAjC,aAA6B,EAAA,EAAA,KAAA,CAAA,EAAA,IAAA,CAAA;AAAA,WAAA,CAAA,CAAA;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"promoted.vue.js","sources":["../../../../../src/x-modules/search/components/promoted.vue"],"sourcesContent":["<template>\n <a\n :href=\"promoted.url\"\n class=\"x-promoted\"\n data-test=\"promoted\"\n @click=\"emitUserClickedAPromoted\"\n @click.right=\"emitUserClickedAPromoted\"\n @click.middle=\"emitUserClickedAPromoted\"\n >\n <img :src=\"promoted.image\" class=\"x-promoted__image\" :alt=\"promoted.title\" />\n <h2 class=\"x-promoted__title\" :class=\"titleClass\" data-test=\"promoted-title\">\n {{ promoted.title }}\n </h2>\n </a>\n</template>\n\n<script lang=\"ts\">\nimport type { Promoted as PromotedModel } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent } from 'vue'\nimport { useXBus } from '../../../composables/use-x-bus'\nimport { searchXModule } from '../x-module'\n\n/**\n * A promoted result is just an item that has been inserted into the search results to advertise\n * something. Usually it is one of the first items in the grid, and has the same shape as a\n * result. It just contains a link to the promoted content, an image, and a title.\n *\n * Additionally, this component exposes the following props to modify the classes of the\n * elements: `titleClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Promoted',\n xModule: searchXModule.name,\n props: {\n /**\n * The promoted data.\n *\n * @public\n */\n promoted: {\n type: Object as PropType<PromotedModel>,\n required: true,\n },\n titleClass: String,\n },\n setup(props) {\n const xBus = useXBus()\n\n /**\n * Emits the promoted click event.\n *\n * @internal\n */\n const emitUserClickedAPromoted = () => {\n xBus.emit('UserClickedAPromoted', props.promoted)\n }\n\n return {\n emitUserClickedAPromoted,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-promoted {\n display: flex;\n flex-flow: column nowrap;\n text-decoration: none;\n}\n\n.x-promoted__image {\n width: 100%;\n object-fit: contain;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nIn this example promoted data is passed as a prop.\n\n_Here you can see how the `Promoted` component is rendered._\n\n```vue\n<template>\n <Promoted :promoted=\"promoted\" />\n</template>\n\n<script>\nimport { Promoted } from '@empathyco/x-components/search'\n\nexport default {\n name: 'PromotedDemo',\n components: {\n Promoted,\n },\n data() {\n return {\n promoted: {\n modelName: 'Promoted',\n id: 'promoted-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n\n### Customizing the items with classes\n\nThe `titleClass` prop can be used to add classes to the promoted title.\n\n```vue\n<template>\n <Promoted :promoted=\"promoted\" titleClass=\"x-bg-neutral-50\" />\n</template>\n\n<script>\nimport { Promoted } from '@empathyco/x-components/search'\n\nexport default {\n name: 'PromotedDemo',\n components: {\n Promoted,\n },\n data() {\n return {\n promoted: {\n modelName: 'Promoted',\n id: 'promoted-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createElementBlock","_createElementVNode","_normalizeClass","_toDisplayString"],"mappings":";;;;;AAAA,MAAA,UAAA,GAAA,CAAA,MAAA,CAAA,CAAA;AAAA,MAAA,UAAA,GAAA,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA;;sBACEA,kBAYI,CAAA,GAAA,EAAA;AAAA,IAXD,MAAM,IAAS,CAAA,QAAA,CAAA,GAAA;AAAA,IAChB,KAAM,EAAA,YAAA;AAAA,IACN,WAAU,EAAA,UAAA;AAAA,IACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,wBAAA,IAAA,IAAA,CAAA,wBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,IALZ,oEAMkB,IAAwB,CAAA,wBAAA,IAAA,IAAA,CAAA,wBAAA,CAAA,GAAA,IAAA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA;AAAA,IAN1C,gEAOmB,IAAwB,CAAA,wBAAA,IAAA,IAAA,CAAA,wBAAA,CAAA,GAAA,IAAA,CAAA,EAAA,CAAA,QAAA,CAAA,CAAA,CAAA;AAAA,GAAA,EAAA;IAEvCC,kBAA6E,CAAA,KAAA,EAAA;AAAA,MAAvE,KAAK,IAAS,CAAA,QAAA,CAAA,KAAA;AAAA,MAAO,KAAM,EAAA,mBAAA;AAAA,MAAqB,KAAK,IAAS,CAAA,QAAA,CAAA,KAAA;AAAA,KATxE,EAAA,IAAA,EAAA,CAAA,EAAA,UAAA,CAAA;AAAA,IAUIA,kBAAA;AAAA,MAEK,IAAA;AAAA,MAAA;AAAA,QAFD,KAAA,EAVRC,cAUc,CAAA,CAAA,mBAAA,EAA4B,IAAU,CAAA,UAAA,CAAA,CAAA;AAAA,QAAE,WAAU,EAAA,gBAAA;AAAA,OAAA;AACvD,MAAAC,eAAA,CAAA,IAAA,CAAA,QAAA,CAAS,KAAK,CAAA;AAAA,MAAA,CAAA;AAAA;AAAA,KAAA;AAAA,GAXvB,EAAA,EAAA,EAAA,UAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"promoted.vue.js","sources":["../../../../../src/x-modules/search/components/promoted.vue"],"sourcesContent":["<template>\n <a\n :href=\"promoted.url\"\n class=\"x-promoted\"\n data-test=\"promoted\"\n @click=\"emitUserClickedAPromoted\"\n @click.right=\"emitUserClickedAPromoted\"\n @click.middle=\"emitUserClickedAPromoted\"\n >\n <img :src=\"promoted.image\" class=\"x-promoted__image\" :alt=\"promoted.title\" />\n <h2 class=\"x-promoted__title\" :class=\"titleClass\" data-test=\"promoted-title\">\n {{ promoted.title }}\n </h2>\n </a>\n</template>\n\n<script lang=\"ts\">\nimport type { Promoted as PromotedModel } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { defineComponent } from 'vue'\nimport { useXBus } from '../../../composables/use-x-bus'\nimport { searchXModule } from '../x-module'\n\n/**\n * A promoted result is just an item that has been inserted into the search results to advertise\n * something. Usually it is one of the first items in the grid, and has the same shape as a\n * result. It just contains a link to the promoted content, an image, and a title.\n *\n * Additionally, this component exposes the following props to modify the classes of the\n * elements: `titleClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Promoted',\n xModule: searchXModule.name,\n props: {\n /**\n * The promoted data.\n *\n * @public\n */\n promoted: {\n type: Object as PropType<PromotedModel>,\n required: true,\n },\n titleClass: String,\n },\n setup(props) {\n const xBus = useXBus()\n\n /**\n * Emits the promoted click event.\n *\n * @internal\n */\n const emitUserClickedAPromoted = () => {\n xBus.emit('UserClickedAPromoted', props.promoted)\n }\n\n return {\n emitUserClickedAPromoted,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-promoted {\n display: flex;\n flex-flow: column nowrap;\n text-decoration: none;\n}\n\n.x-promoted__image {\n width: 100%;\n object-fit: contain;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nIn this example promoted data is passed as a prop.\n\n_Here you can see how the `Promoted` component is rendered._\n\n```vue\n<template>\n <Promoted :promoted=\"promoted\" />\n</template>\n\n<script>\nimport { Promoted } from '@empathyco/x-components/search'\n\nexport default {\n name: 'PromotedDemo',\n components: {\n Promoted,\n },\n data() {\n return {\n promoted: {\n modelName: 'Promoted',\n id: 'promoted-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n\n### Customizing the items with classes\n\nThe `titleClass` prop can be used to add classes to the promoted title.\n\n```vue\n<template>\n <Promoted :promoted=\"promoted\" titleClass=\"x-bg-neutral-50\" />\n</template>\n\n<script>\nimport { Promoted } from '@empathyco/x-components/search'\n\nexport default {\n name: 'PromotedDemo',\n components: {\n Promoted,\n },\n data() {\n return {\n promoted: {\n modelName: 'Promoted',\n id: 'promoted-example',\n url: 'https://my-website.com/summer-shirts',\n image: 'https://my-website.com/images/summer-shirts.jpg',\n title: 'Trendy summer shirts',\n position: 1,\n },\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createElementBlock","_withModifiers","_createElementVNode","_normalizeClass","_toDisplayString"],"mappings":";;;;;;;;sBACEA,kBAYI,CAAA,GAAA,EAAA;AAAA,IAXD,MAAM,IAAS,CAAA,QAAA,CAAA,GAAA;AAAA,IAChB,KAAM,EAAA,YAAA;AAAA,IACN,WAAU,EAAA,UAAA;AAAA,IACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,wBAAA,IAAA,IAAA,CAAA,wBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,IAAA,aAAA,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAAC,aAAA,CAAA,CAAA,GAAA,IAAA,KACM,IAAwB,CAAA,wBAAA,IAAA,IAAA,CAAA,wBAAA,CAAA,GAAA,IAAA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA;AAAA,IAAA,SAAA,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAAA,aAAA,CAAA,CAAA,GAAA,IAAA,KACvB,IAAwB,CAAA,wBAAA,IAAA,IAAA,CAAA,wBAAA,CAAA,GAAA,IAAA,CAAA,EAAA,CAAA,QAAA,CAAA,CAAA,CAAA;AAAA,GAAA,EAAA;IAEvCC,kBAA6E,CAAA,KAAA,EAAA;AAAA,MAAvE,KAAK,IAAS,CAAA,QAAA,CAAA,KAAA;AAAA,MAAO,KAAM,EAAA,mBAAA;AAAA,MAAqB,KAAK,IAAS,CAAA,QAAA,CAAA,KAAA;AAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,UAAA,CAAA;AACpE,IAAAA,kBAAA;AAAA,MAEK,IAAA;AAAA,MAAA;AAAA,QAFD,KAAA,EAAKC,cAAC,CAAA,CAAA,mBAAA,EAA4B,IAAU,CAAA,UAAA,CAAA,CAAA;AAAA,QAAE,WAAU,EAAA,gBAAA;AAAA,OAAA;AACvD,MAAAC,eAAA,CAAA,IAAA,CAAA,QAAA,CAAS,KAAK,CAAA;AAAA,MAAA,CAAA;AAAA;AAAA,KAAA;AAAA,GAAA,EAAA,EAAA,EAAA,UAAA,CAAA,CAAA;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"redirection.vue.js","sources":["../../../../../src/x-modules/search/components/redirection.vue"],"sourcesContent":["<template>\n <div v-if=\"redirection && slots.default\" class=\"x-redirection\" data-test=\"redirection\">\n <slot v-bind=\"{ redirection, redirect, abortRedirect, isRedirecting, delayInSeconds }\" />\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Redirection as RedirectionModel } from '@empathyco/x-types'\nimport type { PropType, Ref } from 'vue'\nimport type { XEvent } from '../../../wiring/events.types'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * A redirection is a component that sends the user to a link in the website. It is helpful when\n * there are queries like `help`, `shipping costs`, `my account`, where a link to a section in the\n * website will be more helpful than the set of results returned.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Redirection',\n xModule: searchXModule.name,\n props: {\n /**\n * The redirection mode. Auto for auto redirection and manual for an user interaction.\n *\n * @public\n */\n mode: {\n type: String as PropType<'auto' | 'manual'>,\n default: 'auto',\n },\n /**\n * The waiting time in seconds until the redirection is made.\n *\n * @remarks this delay only works in auto mode.\n *\n * @public\n */\n delayInSeconds: {\n type: Number,\n default: 0,\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n const { redirections } = useState('search')\n\n /**\n * List of events to stop the animation.\n */\n const eventsToStopAnimation: XEvent[] = [\n 'UserAcceptedAQuery',\n 'UserClearedQuery',\n 'UserSelectedARelatedTag',\n ]\n\n /**\n * The timeout id, used to cancel the redirection.\n *\n * @internal\n */\n const timeoutId: Ref<number> = ref(0)\n\n /**\n * Boolean flag which indicates if the redirection is running.\n *\n * @public\n */\n const isRedirecting = ref(true)\n\n /**\n * Computed property which returns the first recommendation of the state, if any returns null.\n *\n * @returns The first redirection of the state.\n *\n * @internal\n */\n const redirection = computed((): RedirectionModel | null => redirections?.value[0] ?? null)\n\n /**\n * Stops the animation if the user search another query.\n *\n * @internal\n */\n const cancelRedirect = () => {\n clearTimeout(timeoutId.value)\n isRedirecting.value = false\n }\n\n eventsToStopAnimation.forEach(event => $x.on(event, false).subscribe(cancelRedirect))\n\n /**\n * Dispatches the redirection, updating the url.\n *\n * @public\n */\n const redirect = () => {\n clearTimeout(timeoutId.value)\n $x.emit('UserClickedARedirection', redirection.value!)\n window.location.replace(redirection.value!.url)\n }\n\n /**\n * Stops the redirection, emitting `UserClickedAbortARedirection` event.\n *\n * @public\n */\n const abortRedirect = () => {\n cancelRedirect()\n $x.emit('UserClickedAbortARedirection')\n }\n\n /**\n * Watcher function which adds a setTimeout to the redirect method is the component\n * is in auto mode and there are redirections.\n *\n * @internal\n */\n watch(\n redirections,\n () => {\n isRedirecting.value = true\n if (props.mode === 'auto' && redirection.value) {\n timeoutId.value = window.setTimeout(redirect, props.delayInSeconds * 1000)\n }\n },\n { immediate: true },\n )\n\n return {\n redirection,\n redirect,\n abortRedirect,\n isRedirecting,\n slots,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserClickedARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the redirection button.\n- [`UserClickedAbortARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the abort redirection button.\n\n## Play with the component\n\nIn this example, a query has been searched in the search input resulting in a case where the\nresponse has a redirection.\n\nA text box appears bellow the search box indicating that you're going to be redirected to another\nweb page.\n\nThis component has two modes:\n\n- Auto mode means that the redirection will occur after a certain number of seconds passed as a\n property.\n- If the value is 0 the redirection will be instantly.\n- Manual mode means that the user have to click the redirect button or nothing will happen.\n\n_Type any term in the input field to try it out!_\n\n```vue\n<template>\n <Redirection #default=\"{ redirection, redirect, abortRedirect }\">\n <span>In a few seconds you're going to be redirected!</span>\n <span>{{ redirection.url }}</span>\n <button @click=\"redirection\">Redirect now!</button>\n <button @click=\"abortRedirect\">Abort redirection!</button>\n </Redirection>\n</template>\n\n<script>\nimport { Redirection } from '@empathyco/x-components/search'\nexport default {\n name: 'RedirectionDemo',\n components: {\n Redirection,\n },\n}\n</script>\n```\n\n## Extending the component\n\nComponents behaviour can be changed, in this example the mode of the component will be manual\nforcing the user to accept the redirection\n\n```vue\n<template>\n <Redirection #default=\"{ redirection, redirect }\">\n <span>{{ redirection.url }}</span>\n <button @click=\"redirect\">Redirect now!</button>\n </Redirection>\n</template>\n\n<script>\nimport { Redirection } from '@empathyco/x-components/search'\nexport default {\n name: 'RedirectionDemo',\n components: {\n Redirection,\n },\n data() {\n return {\n mode: 'manual',\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createCommentVNode"],"mappings":";;;;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EAC2C,KAAM,EAAA,eAAA;AAAA,EAAgB,WAAU,EAAA,aAAA;;;AAA9D,EAAA,OAAA,IAAA,CAAA,WAAA,IAAe,IAAM,CAAA,KAAA,CAAA,OAAA,IAAAA,SAAA,EAAA,EAAhCC,kBAEM,CAAA,KAAA,EAFN,UAEM,EAAA;AAAA,IADJC,UAAA,CAAyF,IAF7F,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,WAAA,EAEoB,IAAW,CAAA,WAAA,EAAA,QAAA,EAAE,IAAQ,CAAA,QAAA,EAAA,aAAA,EAAE,IAAa,CAAA,aAAA,EAAA,aAAA,EAAE,IAAa,CAAA,aAAA,EAAA,cAAA,EAAE,IAAc,CAAA,cAAA,EAAA,CAAA,CAAA,CAAA;AAAA,GAFvF,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"redirection.vue.js","sources":["../../../../../src/x-modules/search/components/redirection.vue"],"sourcesContent":["<template>\n <div v-if=\"redirection && slots.default\" class=\"x-redirection\" data-test=\"redirection\">\n <slot v-bind=\"{ redirection, redirect, abortRedirect, isRedirecting, delayInSeconds }\" />\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { Redirection as RedirectionModel } from '@empathyco/x-types'\nimport type { PropType, Ref } from 'vue'\nimport type { XEvent } from '../../../wiring/events.types'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * A redirection is a component that sends the user to a link in the website. It is helpful when\n * there are queries like `help`, `shipping costs`, `my account`, where a link to a section in the\n * website will be more helpful than the set of results returned.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Redirection',\n xModule: searchXModule.name,\n props: {\n /**\n * The redirection mode. Auto for auto redirection and manual for an user interaction.\n *\n * @public\n */\n mode: {\n type: String as PropType<'auto' | 'manual'>,\n default: 'auto',\n },\n /**\n * The waiting time in seconds until the redirection is made.\n *\n * @remarks this delay only works in auto mode.\n *\n * @public\n */\n delayInSeconds: {\n type: Number,\n default: 0,\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n const { redirections } = useState('search')\n\n /**\n * List of events to stop the animation.\n */\n const eventsToStopAnimation: XEvent[] = [\n 'UserAcceptedAQuery',\n 'UserClearedQuery',\n 'UserSelectedARelatedTag',\n ]\n\n /**\n * The timeout id, used to cancel the redirection.\n *\n * @internal\n */\n const timeoutId: Ref<number> = ref(0)\n\n /**\n * Boolean flag which indicates if the redirection is running.\n *\n * @public\n */\n const isRedirecting = ref(true)\n\n /**\n * Computed property which returns the first recommendation of the state, if any returns null.\n *\n * @returns The first redirection of the state.\n *\n * @internal\n */\n const redirection = computed((): RedirectionModel | null => redirections?.value[0] ?? null)\n\n /**\n * Stops the animation if the user search another query.\n *\n * @internal\n */\n const cancelRedirect = () => {\n clearTimeout(timeoutId.value)\n isRedirecting.value = false\n }\n\n eventsToStopAnimation.forEach(event => $x.on(event, false).subscribe(cancelRedirect))\n\n /**\n * Dispatches the redirection, updating the url.\n *\n * @public\n */\n const redirect = () => {\n clearTimeout(timeoutId.value)\n $x.emit('UserClickedARedirection', redirection.value!)\n window.location.replace(redirection.value!.url)\n }\n\n /**\n * Stops the redirection, emitting `UserClickedAbortARedirection` event.\n *\n * @public\n */\n const abortRedirect = () => {\n cancelRedirect()\n $x.emit('UserClickedAbortARedirection')\n }\n\n /**\n * Watcher function which adds a setTimeout to the redirect method is the component\n * is in auto mode and there are redirections.\n *\n * @internal\n */\n watch(\n redirections,\n () => {\n isRedirecting.value = true\n if (props.mode === 'auto' && redirection.value) {\n timeoutId.value = window.setTimeout(redirect, props.delayInSeconds * 1000)\n }\n },\n { immediate: true },\n )\n\n return {\n redirection,\n redirect,\n abortRedirect,\n isRedirecting,\n slots,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserClickedARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the redirection button.\n- [`UserClickedAbortARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the abort redirection button.\n\n## Play with the component\n\nIn this example, a query has been searched in the search input resulting in a case where the\nresponse has a redirection.\n\nA text box appears bellow the search box indicating that you're going to be redirected to another\nweb page.\n\nThis component has two modes:\n\n- Auto mode means that the redirection will occur after a certain number of seconds passed as a\n property.\n- If the value is 0 the redirection will be instantly.\n- Manual mode means that the user have to click the redirect button or nothing will happen.\n\n_Type any term in the input field to try it out!_\n\n```vue\n<template>\n <Redirection #default=\"{ redirection, redirect, abortRedirect }\">\n <span>In a few seconds you're going to be redirected!</span>\n <span>{{ redirection.url }}</span>\n <button @click=\"redirection\">Redirect now!</button>\n <button @click=\"abortRedirect\">Abort redirection!</button>\n </Redirection>\n</template>\n\n<script>\nimport { Redirection } from '@empathyco/x-components/search'\nexport default {\n name: 'RedirectionDemo',\n components: {\n Redirection,\n },\n}\n</script>\n```\n\n## Extending the component\n\nComponents behaviour can be changed, in this example the mode of the component will be manual\nforcing the user to accept the redirection\n\n```vue\n<template>\n <Redirection #default=\"{ redirection, redirect }\">\n <span>{{ redirection.url }}</span>\n <button @click=\"redirect\">Redirect now!</button>\n </Redirection>\n</template>\n\n<script>\nimport { Redirection } from '@empathyco/x-components/search'\nexport default {\n name: 'RedirectionDemo',\n components: {\n Redirection,\n },\n data() {\n return {\n mode: 'manual',\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createCommentVNode"],"mappings":";;;;;;EAC2C,KAAM,EAAA,eAAA;AAAA,EAAgB,WAAU,EAAA,aAAA;;;AAA9D,EAAA,OAAA,IAAA,CAAA,WAAA,IAAe,IAAM,CAAA,KAAA,CAAA,OAAA,IAAAA,SAAA,EAAA,EAAhCC,kBAEM,CAAA,KAAA,EAFN,UAEM,EAAA;AAAA,IADJC,UAAA,CAAyF,IAAzE,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,WAAA,EAAA,IAAA,CAAA,WAAA,EAAW,QAAE,EAAA,IAAA,CAAA,QAAA,EAAQ,eAAE,IAAa,CAAA,aAAA,EAAA,aAAA,EAAE,IAAa,CAAA,aAAA,EAAA,cAAA,EAAE,IAAc,CAAA,cAAA,EAAA,CAAA,CAAA,CAAA;AAAA,GAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"sort-dropdown.vue.js","sources":["../../../../../src/x-modules/search/components/sort-dropdown.vue"],"sourcesContent":["<template>\n <BaseDropdown\n ref=\"rootRef\"\n :items=\"items\"\n :model-value=\"selectedSort\"\n :animation=\"animation\"\n class=\"x-sort-dropdown\"\n data-test=\"sort-dropdown\"\n aria-label=\"Select sorting\"\n @update:model-value=\"emitUserClickedASort\"\n >\n <template #toggle=\"{ isOpen, item }\">\n <!--\n @slot Used to render the contents of the dropdown toggle button. If not provided, it uses\n the item slot as fallback.\n @binding {Sort} item - The sort data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-bind=\"{ isOpen, item }\" name=\"toggle\">{{ item }}</slot>\n </template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <!--\n @slot (required) Used to render each one of the items content, and as fallback\n for the toggle button content slot if it is not provided.\n @binding {Sort} item - Sort to render\n @binding {boolean} isHighlighted - True when the item has the focus.\n @binding {boolean} isSelected - True when the item is selected.\n -->\n <slot v-bind=\"{ item, isHighlighted, isSelected }\" name=\"item\">{{ item }}</slot>\n </template>\n </BaseDropdown>\n</template>\n\n<script lang=\"ts\">\nimport type { Sort } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type Vue from 'vue'\nimport { defineComponent, ref, watch } from 'vue'\n\nimport BaseDropdown from '../../../components/base-dropdown.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * The `SortDropdown` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\nexport default defineComponent({\n name: 'SortDropdown',\n xModule: searchXModule.name,\n components: { BaseDropdown },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true,\n },\n /** The transition to use for opening and closing the dropdown. */\n animation: [String, Object] as PropType<string | typeof Vue>,\n },\n emits: ['change'],\n setup(_, { emit }) {\n const $x = use$x()\n\n const { sort: selectedSort } = useState('search')\n const rootRef = ref<typeof BaseDropdown>()\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true,\n })\n\n /**\n * Emits the events related to the selection of a sort value.\n *\n * @remarks `(rootRef.value as any)?.$el` because rollup-plugin-vue understands\n * `ref<typeof BaseDropdown>` as VueConstructor which doesn't contain $el.\n *\n * @param sort - The selected sort.\n */\n function emitUserClickedASort(sort: Sort) {\n $x.emit('UserClickedASort', sort, { target: (rootRef.value as any)?.$el })\n emit('change', sort)\n }\n\n return {\n emitUserClickedASort,\n rootRef,\n selectedSort,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Sort Dropdown\n\nThe `SortDropdown` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can be received then in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing both the toggle button and each one of the possible sort\nvalues. This can be done with the`toggle` and `item` slots.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortDropdown :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\nimport { SortDropdown } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortDropdown,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortDropdown v-model=\"selectedSort\" :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\nimport { SortDropdown } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortDropdown,\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc'],\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;;sBACEA,WA6Be,CAAA,uBAAA,EAAA;AAAA,IA5Bb,GAAI,EAAA,SAAA;AAAA,IACH,KAAO,EAAA,IAAA,CAAA,KAAA;AAAA,IACP,aAAa,EAAA,IAAA,CAAA,YAAA;AAAA,IACb,SAAW,EAAA,IAAA,CAAA,SAAA;AAAA,IACZ,KAAM,EAAA,iBAAA;AAAA,IACN,WAAU,EAAA,eAAA;AAAA,IACV,YAAW,EAAA,gBAAA;AAAA,IACV,qBAAoB,EAAA,IAAA,CAAA,oBAAA;AAAA,GAAA,EAAA;AAEV,IAAA,MAAA,EAAMC,OAOf,CAAA,CAA+D,EAP5C,MAAA,EAAQ,IAAI,EAAA,KAAA;AAAA,MAO/BC,WAA+D,IAlBrE,CAAA,MAAA,EAAA,QAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAkBsB,MAAQ,EAAA,IAAA,MAAxB,MAA+D;AAAA,QAlBrEC,eAAA;AAAA,UAAAC,eAAA,CAkBuD,IAAI,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;AAE5C,IAAA,IAAA,EAAIL,OAQb,CAAA,CAAgF,EAR/D,IAAA,EAAM,eAAe,UAAU,EAAA,KAAA;AAAA,MAQhDC,WAAgF,IA5BtF,CAAA,MAAA,EAAA,MAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EA4BsB,MAAM,aAAe,EAAA,UAAA,MAArC,MAAgF;AAAA,QA5BtFC,eAAA;AAAA,UAAAC,eAAA,CA4BwE,IAAI,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;AA5B5E,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,CAAA,EAAA,CAAA,OAAA,EAAA,aAAA,EAAA,WAAA,EAAA,qBAAA,CAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"sort-dropdown.vue.js","sources":["../../../../../src/x-modules/search/components/sort-dropdown.vue"],"sourcesContent":["<template>\n <BaseDropdown\n ref=\"rootRef\"\n :items=\"items\"\n :model-value=\"selectedSort\"\n :animation=\"animation\"\n class=\"x-sort-dropdown\"\n data-test=\"sort-dropdown\"\n aria-label=\"Select sorting\"\n @update:model-value=\"emitUserClickedASort\"\n >\n <template #toggle=\"{ isOpen, item }\">\n <!--\n @slot Used to render the contents of the dropdown toggle button. If not provided, it uses\n the item slot as fallback.\n @binding {Sort} item - The sort data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-bind=\"{ isOpen, item }\" name=\"toggle\">{{ item }}</slot>\n </template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <!--\n @slot (required) Used to render each one of the items content, and as fallback\n for the toggle button content slot if it is not provided.\n @binding {Sort} item - Sort to render\n @binding {boolean} isHighlighted - True when the item has the focus.\n @binding {boolean} isSelected - True when the item is selected.\n -->\n <slot v-bind=\"{ item, isHighlighted, isSelected }\" name=\"item\">{{ item }}</slot>\n </template>\n </BaseDropdown>\n</template>\n\n<script lang=\"ts\">\nimport type { Sort } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type Vue from 'vue'\nimport { defineComponent, ref, watch } from 'vue'\n\nimport BaseDropdown from '../../../components/base-dropdown.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * The `SortDropdown` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\nexport default defineComponent({\n name: 'SortDropdown',\n xModule: searchXModule.name,\n components: { BaseDropdown },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true,\n },\n /** The transition to use for opening and closing the dropdown. */\n animation: [String, Object] as PropType<string | typeof Vue>,\n },\n emits: ['change'],\n setup(_, { emit }) {\n const $x = use$x()\n\n const { sort: selectedSort } = useState('search')\n const rootRef = ref<typeof BaseDropdown>()\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true,\n })\n\n /**\n * Emits the events related to the selection of a sort value.\n *\n * @remarks `(rootRef.value as any)?.$el` because rollup-plugin-vue understands\n * `ref<typeof BaseDropdown>` as VueConstructor which doesn't contain $el.\n *\n * @param sort - The selected sort.\n */\n function emitUserClickedASort(sort: Sort) {\n $x.emit('UserClickedASort', sort, { target: (rootRef.value as any)?.$el })\n emit('change', sort)\n }\n\n return {\n emitUserClickedASort,\n rootRef,\n selectedSort,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Sort Dropdown\n\nThe `SortDropdown` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can be received then in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing both the toggle button and each one of the possible sort\nvalues. This can be done with the`toggle` and `item` slots.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortDropdown :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\nimport { SortDropdown } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortDropdown,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortDropdown v-model=\"selectedSort\" :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\nimport { SortDropdown } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortDropdown,\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc'],\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode"],"mappings":";;;;;;sBACEA,WA6Be,CAAA,uBAAA,EAAA;AAAA,IA5Bb,GAAI,EAAA,SAAA;AAAA,IACH,KAAO,EAAA,IAAA,CAAA,KAAA;AAAA,IACP,aAAa,EAAA,IAAA,CAAA,YAAA;AAAA,IACb,SAAW,EAAA,IAAA,CAAA,SAAA;AAAA,IACZ,KAAM,EAAA,iBAAA;AAAA,IACN,WAAU,EAAA,eAAA;AAAA,IACV,YAAW,EAAA,gBAAA;AAAA,IACV,qBAAoB,EAAA,IAAA,CAAA,oBAAA;AAAA,GAAA,EAAA;AAEV,IAAA,MAAA,EAAMC,OAOf,CAAA,CAA+D,EAP5C,MAAA,EAAQ,IAAI,EAAA,KAAA;AAAA,MAO/BC,UAA+D,CAAA,IAAA,CAAA,MAAA,EAAA,QAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAA/C,MAAQ,EAAA,IAAA,MAAxB,MAA+D;AAAA,QAAAC,eAAA;0BAAd,IAAI,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;AAE5C,IAAA,IAAA,EAAIJ,OAQb,CAAA,CAAgF,EAR/D,IAAA,EAAM,eAAe,UAAU,EAAA,KAAA;AAAA,MAQhDC,WAAgF,IAAhE,CAAA,MAAA,EAAA,MAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,IAAA,EAAM,aAAe,EAAA,UAAA,MAArC,MAAgF;AAAA,QAAAC,eAAA;0BAAd,IAAI,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"sort-list.vue.js","sources":["../../../../../src/x-modules/search/components/sort-list.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" tag=\"ul\" class=\"x-option-list x-sort-list\" data-test=\"sort-list\">\n <li\n v-for=\"{ item, cssClasses, event } in listItems\"\n :key=\"item\"\n :class=\"cssClasses\"\n class=\"x-option-list__item x-sort-list__item\"\n >\n <BaseEventButton\n class=\"x-sort-list__button x-button\"\n data-test=\"x-sort-button\"\n :events=\"event\"\n >\n <slot v-bind=\"{ item, isSelected: item === selectedSort }\">\n {{ item }}\n </slot>\n </BaseEventButton>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Sort } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type Vue from 'vue'\nimport type { VueCSSClasses } from '../../../utils/types'\nimport type { XEventsTypes } from '../../../wiring/events.types'\nimport { computed, defineComponent, watch } from 'vue'\nimport BaseEventButton from '../../../components/base-event-button.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * Sort list item options.\n */\ninterface SortListItem {\n item: Sort\n cssClasses: VueCSSClasses\n event: Partial<XEventsTypes>\n}\n\n/**\n * The `SortList` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\nexport default defineComponent({\n name: 'SortList',\n xModule: searchXModule.name,\n components: { BaseEventButton },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true,\n },\n /** The transition to use for rendering the list. */\n animation: {\n type: [String, Object] as PropType<string | typeof Vue>,\n default: () => 'ul',\n },\n },\n setup(props) {\n const $x = use$x()\n\n const { sort: selectedSort } = useState('search')\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true,\n })\n\n /**\n * Sort list items.\n *\n * @returns A list of items with their css class and the event associate to it.\n */\n const listItems = computed<SortListItem[]>(() =>\n props.items.map(item => ({\n item,\n cssClasses: {\n 'x-sort-list__item--is-selected': item === selectedSort.value,\n 'x-option-list__item--is-selected': item === selectedSort.value,\n },\n event: { UserClickedASort: item },\n })),\n )\n\n return {\n listItems,\n selectedSort,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-sort-list {\n list-style-type: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Sort List\n\nThe `SortList` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can then be received in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing each one of the possible sort values. This can be done with\nthe `default` slot.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortList :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">Item: {{ item }}</template>\n </SortList>\n</template>\n\n<script>\nimport { SortList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortList,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortList v-model=\"selectedSort\" :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n {{ item }}\n </template>\n </SortList>\n</template>\n\n<script>\nimport { SortList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortList,\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc'],\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createVNode","_renderSlot","_mergeProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAiBYC,wBAjBI,IAAS,CAAA,SAAA,CAAA,EAAA;AAAA,IAAE,GAAI,EAAA,IAAA;AAAA,IAAK,KAAM,EAAA,2BAAA;AAAA,IAA4B,WAAU,EAAA,WAAA;AAAA,GAAA,EAAA;AADlF,IAAA,OAAA,EAAAC,OAAA,CAGM,MAAgD;AAAA,OADlDH,SAAA,CAAA,IAAA,CAAA,EAAAI,kBAAA;AAAA,QAeKC,QAAA;AAAA,QAAA,IAAA;AAAA,QAjBTC,UAG4C,CAAA,IAAA,CAAA,SAAA,EAH5C,CAGe,EAAA,IAAA,EAAM,YAAY,KAAK,EAAA,KAAA;AADlC,UAAA,OAAAN,SAAA,EAAA,EAAAI,kBAAA;AAAA,YAeK,IAAA;AAAA,YAAA;AAAA,cAbF,GAAK,EAAA,IAAA;AAAA,cACL,KAAA,EALPG,cAKc,CAAA,CAAA,UAAA,EACF,uCAAuC,CAAA,CAAA;AAAA,aAAA;;cAE7CC,WAQkB,CAAA,0BAAA,EAAA;AAAA,gBAPhB,KAAM,EAAA,8BAAA;AAAA,gBACN,WAAU,EAAA,eAAA;AAAA,gBACT,MAAQ,EAAA,KAAA;AAAA,eAAA,EAAA;AAXjB,gBAAA,OAAA,EAAAL,OAAA,CAaQ,MAEO;AAAA,kBAFPM,UAAA,CAEO,IAFP,CAAA,MAAA,EAAA,SAAA,EAAAC,UAAA,CAEO,EAff,OAAA,EAAA,IAAA,EAAA,EAAA,EAawB,MAAI,UAAc,EAAA,IAAA,KAAS,IAAY,CAAA,YAAA,EAAA,CAAA,EAAvD,MAEO;AAAA,oBAffC,eAAA;AAAA,sBAAAC,eAAA,CAca,IAAI,CAAA;AAAA,sBAAA,CAAA;AAAA;AAAA,qBAAA;AAAA,mBAAA,EAAA,IAAA,CAAA;;AAdjB,gBAAA,CAAA,EAAA,CAAA;AAAA;AAAA,eAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,CAAA;;;;;;;;;;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"sort-list.vue.js","sources":["../../../../../src/x-modules/search/components/sort-list.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" tag=\"ul\" class=\"x-option-list x-sort-list\" data-test=\"sort-list\">\n <li\n v-for=\"{ item, cssClasses, event } in listItems\"\n :key=\"item\"\n :class=\"cssClasses\"\n class=\"x-option-list__item x-sort-list__item\"\n >\n <BaseEventButton\n class=\"x-sort-list__button x-button\"\n data-test=\"x-sort-button\"\n :events=\"event\"\n >\n <slot v-bind=\"{ item, isSelected: item === selectedSort }\">\n {{ item }}\n </slot>\n </BaseEventButton>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Sort } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type Vue from 'vue'\nimport type { VueCSSClasses } from '../../../utils/types'\nimport type { XEventsTypes } from '../../../wiring/events.types'\nimport { computed, defineComponent, watch } from 'vue'\nimport BaseEventButton from '../../../components/base-event-button.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * Sort list item options.\n */\ninterface SortListItem {\n item: Sort\n cssClasses: VueCSSClasses\n event: Partial<XEventsTypes>\n}\n\n/**\n * The `SortList` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\nexport default defineComponent({\n name: 'SortList',\n xModule: searchXModule.name,\n components: { BaseEventButton },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true,\n },\n /** The transition to use for rendering the list. */\n animation: {\n type: [String, Object] as PropType<string | typeof Vue>,\n default: () => 'ul',\n },\n },\n setup(props) {\n const $x = use$x()\n\n const { sort: selectedSort } = useState('search')\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true,\n })\n\n /**\n * Sort list items.\n *\n * @returns A list of items with their css class and the event associate to it.\n */\n const listItems = computed<SortListItem[]>(() =>\n props.items.map(item => ({\n item,\n cssClasses: {\n 'x-sort-list__item--is-selected': item === selectedSort.value,\n 'x-option-list__item--is-selected': item === selectedSort.value,\n },\n event: { UserClickedASort: item },\n })),\n )\n\n return {\n listItems,\n selectedSort,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-sort-list {\n list-style-type: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Sort List\n\nThe `SortList` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can then be received in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing each one of the possible sort values. This can be done with\nthe `default` slot.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortList :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">Item: {{ item }}</template>\n </SortList>\n</template>\n\n<script>\nimport { SortList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortList,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortList v-model=\"selectedSort\" :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n {{ item }}\n </template>\n </SortList>\n</template>\n\n<script>\nimport { SortList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortList,\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc'],\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createVNode","_renderSlot","_mergeProps","_createTextVNode"],"mappings":";;;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAiBYC,wBAjBI,IAAS,CAAA,SAAA,CAAA,EAAA;AAAA,IAAE,GAAI,EAAA,IAAA;AAAA,IAAK,KAAM,EAAA,2BAAA;AAAA,IAA4B,WAAU,EAAA,WAAA;AAAA,GAAA,EAAA;qBAE5E,MAAgD;AAAA,OADlDF,SAAA,CAAA,IAAA,CAAA,EAAAG,kBAAA;AAAA,QAeKC,QAAA;AAAA,QAAA,IAAA;AAAA,QAAAC,UAAA,CAdmC,IAAS,CAAA,SAAA,EAAA,CAAA,EAAtC,IAAM,EAAA,UAAA,EAAY,KAAK,EAAA,KAAA;AADlC,UAAA,OAAAL,SAAA,EAAA,EAAAG,kBAAA;AAAA,YAeK,IAAA;AAAA,YAAA;AAAA,cAbF,GAAK,EAAA,IAAA;AAAA,cACL,KAAA,EAAKG,cAAE,CAAA,CAAA,UAAA,EACF,uCAAuC,CAAA,CAAA;AAAA,aAAA;;cAE7CC,WAQkB,CAAA,0BAAA,EAAA;AAAA,gBAPhB,KAAM,EAAA,8BAAA;AAAA,gBACN,WAAU,EAAA,eAAA;AAAA,gBACT,MAAQ,EAAA,KAAA;AAAA,eAAA,EAAA;iCAET,MAEO;AAAA,kBAFPC,UAAA,CAEO,wBAFPC,UAEO,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAFS,MAAI,UAAc,EAAA,IAAA,KAAS,IAAY,CAAA,YAAA,EAAA,CAAA,EAAvD,MAEO;AAAA,oBAAAC,eAAA;sCADF,IAAI,CAAA;AAAA,sBAAA,CAAA;AAAA;AAAA,qBAAA;AAAA,mBAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"sort-picker-list.vue.js","sources":["../../../../../src/x-modules/search/components/sort-picker-list.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n tag=\"div\"\n class=\"x-sort-picker-list\"\n data-test=\"sort-picker\"\n role=\"list\"\n >\n <BaseEventButton\n v-for=\"{ item, cssClasses, event } in listItems\"\n :key=\"item\"\n :class=\"[cssClasses, buttonClass]\"\n data-test=\"sort-picker-button\"\n :events=\"event\"\n :aria-pressed=\"item === selectedSort || null\"\n role=\"listitem\"\n >\n <slot v-bind=\"{ item, isSelected: item === selectedSort }\">\n {{ item }}\n </slot>\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Sort } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type Vue from 'vue'\nimport type { VueCSSClasses } from '../../../utils/types'\nimport type { XEventsTypes } from '../../../wiring/events.types'\nimport { computed, defineComponent, watch } from 'vue'\nimport BaseEventButton from '../../../components/base-event-button.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * Sort Picker item options.\n */\ninterface SortPickerItem {\n item: Sort\n cssClasses: VueCSSClasses\n event: Partial<XEventsTypes>\n}\n\n/**\n * The `SortPickerList` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\nexport default defineComponent({\n name: 'SortPickerList',\n xModule: searchXModule.name,\n components: { BaseEventButton },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true,\n },\n /** The transition to use for rendering the list. */\n animation: {\n type: [String, Object] as PropType<string | typeof Vue>,\n default: () => 'div',\n },\n /** Class inherited by each sort button. */\n buttonClass: String,\n },\n setup(props) {\n const $x = use$x()\n\n const { sort: selectedSort } = useState('search')\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true,\n })\n\n /**\n * Sort list items.\n *\n * @returns A list of items with their css class and the event associate to it.\n */\n const listItems = computed<SortPickerItem[]>(() =>\n props.items.map(item => ({\n item,\n cssClasses: {\n 'x-selected': item === selectedSort.value,\n },\n event: { UserClickedASort: item },\n })),\n )\n\n return {\n listItems,\n selectedSort,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Sort Picker List\n\nThe `SortPickerList` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can then be received in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing each one of the possible sort values. This can be done with\nthe `default` slot.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortPickerList :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">Item: {{ item }}</template>\n </SortPickerList>\n</template>\n\n<script>\nimport { SortPickerList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortPickerList,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortPickerList v-model=\"selectedSort\" :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n {{ item }}\n </template>\n </SortPickerList>\n</template>\n\n<script>\nimport { SortPickerList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortPickerList,\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc'],\n }\n },\n}\n</script>\n```\n\n### Customizing the items with classes\n\nThe `buttonClass` prop can be used to add classes to the sort items.\n\n```vue\n<template>\n <SortPickerList :items=\"sortValues\" buttonClass=\"x-button-outlined\" />\n</template>\n\n<script>\nimport { SortPickerList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortPickerList,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_createElementBlock","_Fragment","_renderList","_normalizeClass","_renderSlot","_mergeProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAoBYC,wBAnBL,IAAS,CAAA,SAAA,CAAA,EAAA;AAAA,IACd,GAAI,EAAA,KAAA;AAAA,IACJ,KAAM,EAAA,oBAAA;AAAA,IACN,WAAU,EAAA,aAAA;AAAA,IACV,IAAK,EAAA,MAAA;AAAA,GAAA,EAAA;AANT,IAAA,OAAA,EAAAC,OAAA,CASM,MAAgD;AAAA,OADlDH,SAAA,CAAA,IAAA,CAAA,EAAAI,kBAAA;AAAA,QAYkBC,QAAA;AAAA,QAAA,IAAA;AAAA,QApBtBC,UAS4C,CAAA,IAAA,CAAA,SAAA,EAT5C,CASe,EAAA,IAAA,EAAM,YAAY,KAAK,EAAA,KAAA;8BADlCL,WAYkB,CAAA,0BAAA,EAAA;AAAA,YAVf,GAAK,EAAA,IAAA;AAAA,YACL,KAAA,EAXPM,cAWe,CAAA,CAAA,UAAA,EAAY,IAAW,CAAA,WAAA,CAAA,CAAA;AAAA,YAChC,WAAU,EAAA,oBAAA;AAAA,YACT,MAAQ,EAAA,KAAA;AAAA,YACR,cAAA,EAAc,SAAS,IAAY,CAAA,YAAA,IAAA,IAAA;AAAA,YACpC,IAAK,EAAA,UAAA;AAAA,WAAA,EAAA;AAfX,YAAA,OAAA,EAAAJ,OAAA,CAiBM,MAEO;AAAA,cAFPK,UAAA,CAEO,IAFP,CAAA,MAAA,EAAA,SAAA,EAAAC,UAAA,CAEO,EAnBb,OAAA,EAAA,IAAA,EAAA,EAAA,EAiBsB,MAAI,UAAc,EAAA,IAAA,KAAS,IAAY,CAAA,YAAA,EAAA,CAAA,EAAvD,MAEO;AAAA,gBAnBbC,eAAA;AAAA,kBAAAC,eAAA,CAkBW,IAAI,CAAA;AAAA,kBAAA,CAAA;AAAA;AAAA,iBAAA;AAAA,eAAA,CAAA;;AAlBf,YAAA,CAAA,EAAA,CAAA;AAAA;AAAA,WAAA,EAAA,IAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,cAAA,CAAA,CAAA,CAAA;;;;;;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"sort-picker-list.vue.js","sources":["../../../../../src/x-modules/search/components/sort-picker-list.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n tag=\"div\"\n class=\"x-sort-picker-list\"\n data-test=\"sort-picker\"\n role=\"list\"\n >\n <BaseEventButton\n v-for=\"{ item, cssClasses, event } in listItems\"\n :key=\"item\"\n :class=\"[cssClasses, buttonClass]\"\n data-test=\"sort-picker-button\"\n :events=\"event\"\n :aria-pressed=\"item === selectedSort || null\"\n role=\"listitem\"\n >\n <slot v-bind=\"{ item, isSelected: item === selectedSort }\">\n {{ item }}\n </slot>\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\nimport type { Sort } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport type Vue from 'vue'\nimport type { VueCSSClasses } from '../../../utils/types'\nimport type { XEventsTypes } from '../../../wiring/events.types'\nimport { computed, defineComponent, watch } from 'vue'\nimport BaseEventButton from '../../../components/base-event-button.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * Sort Picker item options.\n */\ninterface SortPickerItem {\n item: Sort\n cssClasses: VueCSSClasses\n event: Partial<XEventsTypes>\n}\n\n/**\n * The `SortPickerList` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\nexport default defineComponent({\n name: 'SortPickerList',\n xModule: searchXModule.name,\n components: { BaseEventButton },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true,\n },\n /** The transition to use for rendering the list. */\n animation: {\n type: [String, Object] as PropType<string | typeof Vue>,\n default: () => 'div',\n },\n /** Class inherited by each sort button. */\n buttonClass: String,\n },\n setup(props) {\n const $x = use$x()\n\n const { sort: selectedSort } = useState('search')\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true,\n })\n\n /**\n * Sort list items.\n *\n * @returns A list of items with their css class and the event associate to it.\n */\n const listItems = computed<SortPickerItem[]>(() =>\n props.items.map(item => ({\n item,\n cssClasses: {\n 'x-selected': item === selectedSort.value,\n },\n event: { UserClickedASort: item },\n })),\n )\n\n return {\n listItems,\n selectedSort,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Sort Picker List\n\nThe `SortPickerList` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can then be received in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing each one of the possible sort values. This can be done with\nthe `default` slot.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortPickerList :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">Item: {{ item }}</template>\n </SortPickerList>\n</template>\n\n<script>\nimport { SortPickerList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortPickerList,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortPickerList v-model=\"selectedSort\" :items=\"sortValues\">\n <template #item=\"{ item, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n {{ item }}\n </template>\n </SortPickerList>\n</template>\n\n<script>\nimport { SortPickerList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortPickerList,\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc'],\n }\n },\n}\n</script>\n```\n\n### Customizing the items with classes\n\nThe `buttonClass` prop can be used to add classes to the sort items.\n\n```vue\n<template>\n <SortPickerList :items=\"sortValues\" buttonClass=\"x-button-outlined\" />\n</template>\n\n<script>\nimport { SortPickerList } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n SortPickerList,\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","_normalizeClass","_renderSlot","_mergeProps","_createTextVNode"],"mappings":";;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAoBYC,wBAnBL,IAAS,CAAA,SAAA,CAAA,EAAA;AAAA,IACd,GAAI,EAAA,KAAA;AAAA,IACJ,KAAM,EAAA,oBAAA;AAAA,IACN,WAAU,EAAA,aAAA;AAAA,IACV,IAAK,EAAA,MAAA;AAAA,GAAA,EAAA;qBAGH,MAAgD;AAAA,OADlDF,SAAA,CAAA,IAAA,CAAA,EAAAG,kBAAA;AAAA,QAYkBC,QAAA;AAAA,QAAA,IAAA;AAAA,QAAAC,UAAA,CAXsB,IAAS,CAAA,SAAA,EAAA,CAAA,EAAtC,IAAM,EAAA,UAAA,EAAY,KAAK,EAAA,KAAA;8BADlCJ,WAYkB,CAAA,0BAAA,EAAA;AAAA,YAVf,GAAK,EAAA,IAAA;AAAA,YACL,KAAA,EAAKK,cAAG,CAAA,CAAA,UAAA,EAAY,IAAW,CAAA,WAAA,CAAA,CAAA;AAAA,YAChC,WAAU,EAAA,oBAAA;AAAA,YACT,MAAQ,EAAA,KAAA;AAAA,YACR,cAAA,EAAc,SAAS,IAAY,CAAA,YAAA,IAAA,IAAA;AAAA,YACpC,IAAK,EAAA,UAAA;AAAA,WAAA,EAAA;6BAEL,MAEO;AAAA,cAFPC,UAAA,CAEO,wBAFPC,UAEO,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAFS,MAAI,UAAc,EAAA,IAAA,KAAS,IAAY,CAAA,YAAA,EAAA,CAAA,EAAvD,MAEO;AAAA,gBAAAC,eAAA;kCADF,IAAI,CAAA;AAAA,kBAAA,CAAA;AAAA;AAAA,iBAAA;AAAA,eAAA,CAAA;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"spellcheck-button.vue.js","sources":["../../../../../src/x-modules/search/components/spellcheck-button.vue"],"sourcesContent":["<template>\n <button\n v-if=\"spellcheckedQuery\"\n ref=\"el\"\n class=\"x-spellcheck-button\"\n data-test=\"set-spellcheck\"\n @click=\"emitEvents\"\n >\n <slot v-bind=\"{ spellcheckedQuery }\">{{ spellcheckedQuery }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { defineComponent, ref } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link XEventsTypes.UserAcceptedSpellcheckQuery} events, expressing the user\n * intention to set the spellchecked query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SpellcheckButton',\n xModule: searchXModule.name,\n setup() {\n const $x = use$x()\n\n const el = ref<HTMLElement>()\n\n /**\n * The spellcheckedQuery from the search state.\n *\n * @public\n */\n const { spellcheckedQuery } = useState('search')\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n const createEventMetadata = (): Omit<WireMetadata, 'moduleName'> => ({\n target: el.value as HTMLElement,\n feature: 'spellcheck',\n })\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n const emitEvents = () => {\n $x.emit('UserAcceptedAQuery', spellcheckedQuery.value as string, createEventMetadata())\n $x.emit(\n 'UserAcceptedSpellcheckQuery',\n spellcheckedQuery.value as string,\n createEventMetadata(),\n )\n }\n\n return {\n el,\n spellcheckedQuery,\n emitEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits 2 different events:\n\n- [`UserAcceptedAQuery`](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 spellchecked query\n data.\n- [`UserAcceptedSpellcheckQuery`](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 spellchecked query\n data.\n\n## Examples\n\n### Basic example\n\nThe component sets the current spellcheckedQuery as the new query and emits the `UserAcceptedAQuery`\nand `UserAcceptedSpellcheckQuery` events.\n\n```vue\n<SpellcheckButton />\n```\n\n### Customizing its contents\n\n```vue\n<SpellcheckButton>\n <template #default=\"{ spellcheckedQuery }\">\n <span class=\"x-spellcheck__text\">\n Set the Spellcheck as the new query: {{ spellcheckedQuery}}!\n </span>\n </template>\n</SpellcheckButton>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;SAEU,IADR,CAAA,iBAAA,IAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IAQS,QAAA;AAAA,IAAA;AAAA,MATX,GAAA,EAAA,CAAA;AAAA,MAGI,GAAI,EAAA,IAAA;AAAA,MACJ,KAAM,EAAA,qBAAA;AAAA,MACN,WAAU,EAAA,gBAAA;AAAA,MACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,KAAA;;AAER,MAAAC,UAAA,CAAmE,IARvE,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,iBAAA,EAQoB,IAAiB,CAAA,iBAAA,EAAA,CAAA,CAAA,EAAjC,MAAmE;AAAA,QARvEC,eAAA;AAAA,UAAAC,eAAA,CAQ4C,IAAiB,CAAA,iBAAA,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;;;AAR7D,GAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"spellcheck-button.vue.js","sources":["../../../../../src/x-modules/search/components/spellcheck-button.vue"],"sourcesContent":["<template>\n <button\n v-if=\"spellcheckedQuery\"\n ref=\"el\"\n class=\"x-spellcheck-button\"\n data-test=\"set-spellcheck\"\n @click=\"emitEvents\"\n >\n <slot v-bind=\"{ spellcheckedQuery }\">{{ spellcheckedQuery }}</slot>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { defineComponent, ref } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * A button that when pressed emits the {@link XEventsTypes.UserAcceptedAQuery}\n * and {@link XEventsTypes.UserAcceptedSpellcheckQuery} events, expressing the user\n * intention to set the spellchecked query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SpellcheckButton',\n xModule: searchXModule.name,\n setup() {\n const $x = use$x()\n\n const el = ref<HTMLElement>()\n\n /**\n * The spellcheckedQuery from the search state.\n *\n * @public\n */\n const { spellcheckedQuery } = useState('search')\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n const createEventMetadata = (): Omit<WireMetadata, 'moduleName'> => ({\n target: el.value as HTMLElement,\n feature: 'spellcheck',\n })\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n const emitEvents = () => {\n $x.emit('UserAcceptedAQuery', spellcheckedQuery.value as string, createEventMetadata())\n $x.emit(\n 'UserAcceptedSpellcheckQuery',\n spellcheckedQuery.value as string,\n createEventMetadata(),\n )\n }\n\n return {\n el,\n spellcheckedQuery,\n emitEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits 2 different events:\n\n- [`UserAcceptedAQuery`](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 spellchecked query\n data.\n- [`UserAcceptedSpellcheckQuery`](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 spellchecked query\n data.\n\n## Examples\n\n### Basic example\n\nThe component sets the current spellcheckedQuery as the new query and emits the `UserAcceptedAQuery`\nand `UserAcceptedSpellcheckQuery` events.\n\n```vue\n<SpellcheckButton />\n```\n\n### Customizing its contents\n\n```vue\n<SpellcheckButton>\n <template #default=\"{ spellcheckedQuery }\">\n <span class=\"x-spellcheck__text\">\n Set the Spellcheck as the new query: {{ spellcheckedQuery}}!\n </span>\n </template>\n</SpellcheckButton>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode"],"mappings":";;;;;SAEU,IADR,CAAA,iBAAA,IAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IAQS,QAAA;AAAA,IAAA;AAAA,MAAA,GAAA,EAAA,CAAA;MANP,GAAI,EAAA,IAAA;AAAA,MACJ,KAAM,EAAA,qBAAA;AAAA,MACN,WAAU,EAAA,gBAAA;AAAA,MACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,KAAA;;MAERC,UAAmE,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,iBAAA,EAAnD,IAAiB,CAAA,iBAAA,EAAA,CAAA,CAAA,EAAjC,MAAmE;AAAA,QAAAC,eAAA;0BAA3B,IAAiB,CAAA,iBAAA,CAAA;AAAA,UAAA,CAAA;AAAA;AAAA,SAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"spellcheck.vue.js","sources":["../../../../../src/x-modules/search/components/spellcheck.vue"],"sourcesContent":["<template>\n <div v-if=\"spellcheckedQuery\" class=\"x-spellcheck\" data-test=\"spellcheck\">\n <slot v-bind=\"{ query, spellcheckedQuery }\">{{ query }} - {{ spellcheckedQuery }}</slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * The `Spellcheck` component allows to inform the user with a friendly message that he\n * might have misspelled the search query. This message can be set using the default slot\n * of the component, which gives access to the searched query using the `query` scope property,\n * and the spellchecked query proposal, using the `spellcheckedQuery` scope property.\n *\n * The component will only render itself if the `spellcheckedQuery` property has value.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Spellcheck',\n xModule: searchXModule.name,\n setup() {\n /**\n * The query and the spellcheckedQuery from the search state.\n *\n * @public\n */\n const { query, spellcheckedQuery } = useState('search')\n\n return {\n query,\n spellcheckedQuery,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis default spellcheck component expects a query and a spellcheckedQuery to render and pass to its\ndefault slot.\n\nThis two props should be show like a message comparing them.\n\n### Basic usage\n\n```vue\n<Spellcheck />\n```\n\n### Customizing its contents\n\n```vue\n<Spellcheck>\n <template #default=\"{ query, spellcheckedQuery }\">\n No results found for '{{ query }}'. We show you results for '{{ spellcheckedQuery }}'\n </template>\n</Spellcheck>\n\n<script>\nimport { Spellcheck } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n Spellcheck,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EACgC,KAAM,EAAA,cAAA;AAAA,EAAe,WAAU,EAAA,YAAA;;;SAAlD,IAAX,CAAA,iBAAA,IAAAA,SAAA,EAAA,EAAAC,kBAAA,CAEM,OAFN,UAEM,EAAA;AAAA,IADJC,WAAwF,IAF5F,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,KAAA,EAEoB,YAAK,iBAAE,EAAA,IAAA,CAAA,iBAAA,MAAvB,MAAwF;AAAA,MAF5FC,eAAA;AAAA,QAAAC,eAAA,CAEmD,IAAK,CAAA,KAAA,CAAA,GAAG,KAAG,GAAAA,eAAA,CAAG,IAAiB,CAAA,iBAAA,CAAA;AAAA,QAAA,CAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAFlF,GAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"spellcheck.vue.js","sources":["../../../../../src/x-modules/search/components/spellcheck.vue"],"sourcesContent":["<template>\n <div v-if=\"spellcheckedQuery\" class=\"x-spellcheck\" data-test=\"spellcheck\">\n <slot v-bind=\"{ query, spellcheckedQuery }\">{{ query }} - {{ spellcheckedQuery }}</slot>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport { useState } from '../../../composables/use-state'\nimport { searchXModule } from '../x-module'\n\n/**\n * The `Spellcheck` component allows to inform the user with a friendly message that he\n * might have misspelled the search query. This message can be set using the default slot\n * of the component, which gives access to the searched query using the `query` scope property,\n * and the spellchecked query proposal, using the `spellcheckedQuery` scope property.\n *\n * The component will only render itself if the `spellcheckedQuery` property has value.\n *\n * @public\n */\nexport default defineComponent({\n name: 'Spellcheck',\n xModule: searchXModule.name,\n setup() {\n /**\n * The query and the spellcheckedQuery from the search state.\n *\n * @public\n */\n const { query, spellcheckedQuery } = useState('search')\n\n return {\n query,\n spellcheckedQuery,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis default spellcheck component expects a query and a spellcheckedQuery to render and pass to its\ndefault slot.\n\nThis two props should be show like a message comparing them.\n\n### Basic usage\n\n```vue\n<Spellcheck />\n```\n\n### Customizing its contents\n\n```vue\n<Spellcheck>\n <template #default=\"{ query, spellcheckedQuery }\">\n No results found for '{{ query }}'. We show you results for '{{ spellcheckedQuery }}'\n </template>\n</Spellcheck>\n\n<script>\nimport { Spellcheck } from '@empathyco/x-components/search'\n\nexport default {\n components: {\n Spellcheck,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_toDisplayString"],"mappings":";;;;;;EACgC,KAAM,EAAA,cAAA;AAAA,EAAe,WAAU,EAAA,YAAA;;;SAAlD,IAAX,CAAA,iBAAA,IAAAA,SAAA,EAAA,EAAAC,kBAAA,CAEM,OAFN,UAEM,EAAA;AAAA,IADJC,WAAwF,IAAxE,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,KAAA,EAAA,IAAA,CAAA,KAAA,EAAK,iBAAE,EAAA,IAAA,CAAA,iBAAA,MAAvB,MAAwF;AAAA,MAAAC,eAAA;wBAAzC,IAAK,CAAA,KAAA,CAAA,GAAG,KAAG,GAAAC,eAAA,CAAG,IAAiB,CAAA,iBAAA,CAAA;AAAA,QAAA,CAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;;;;;;;"}
@@ -11,7 +11,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11
11
  }, {
12
12
  default: withCtx(() => [
13
13
  renderSlot(_ctx.$slots, "default", {}, () => [
14
- createTextVNode("✕")
14
+ _cache[0] || (_cache[0] = createTextVNode(
15
+ "✕",
16
+ -1
17
+ /* CACHED */
18
+ ))
15
19
  ])
16
20
  ]),
17
21
  _: 3
@@ -1 +1 @@
1
- {"version":3,"file":"clear-search-input.vue.js","sources":["../../../../../src/x-modules/search-box/components/clear-search-input.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-search-input x-button\"\n :class=\"dynamicClasses\"\n :events=\"clearSearchInputEvents\"\n data-test=\"clear-search-input\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../../../utils/types'\nimport { computed, defineComponent, ref } from 'vue'\nimport BaseEventButton from '../../../components/base-event-button.vue'\nimport { useState } from '../../../composables/use-state'\nimport { searchBoxXModule } from '../x-module'\n\n/**\n * This component renders a button to delete the current query.\n *\n * @remarks\n * A button that when pressed emits the {@link SearchBoxXEvents.UserPressedClearSearchBoxButton}\n * and {@link SearchBoxXEvents.UserClearedQuery} events, expressing the user intention to clear\n * the current query.\n * It also adds `x-clear-search-input--has-empty-query` as class when there is no query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'ClearSearchInput',\n components: { BaseEventButton },\n xModule: searchBoxXModule.name,\n setup() {\n const { query } = useState('searchBox')\n\n /**\n * The events dictionary that are going to be emitted when the button is pressed.\n *\n * @internal\n */\n const clearSearchInputEvents = ref({\n UserPressedClearSearchBoxButton: undefined,\n })\n\n const isQueryEmpty = computed(() => query.value.length === 0)\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-clear-search-input--has-empty-query': isQueryEmpty.value,\n }))\n\n return {\n dynamicClasses,\n clearSearchInputEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserPressedClearSearchBoxButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserClearedQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nHere a basic example of how the clear button is rendered.\n\n_Type any term in the input field and then click the Clear button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\nimport { ClearSearchInput, SearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n SearchInput,\n },\n}\n</script>\n```\n\n### Play with default slot\n\nIn this example, a custom text is passed in the default slot instead of the default text to\ncustomize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <ClearSearchInput>Clear</ClearSearchInput>\n</template>\n\n<script>\nimport { ClearSearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n },\n}\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedClearSearchBoxButton` event is implemented, triggering the message\n“clear” when the clear search input button is clicked.\n\n_Click the Clear button to try it out!_\n\n```vue live\n<template>\n <div>\n <ClearSearchInput @UserPressedClearSearchBoxButton=\"message = 'clear'\">Clear</ClearSearchInput>\n {{ message }}\n </div>\n</template>\n\n<script>\nimport { ClearSearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n },\n data() {\n return {\n message: '',\n }\n },\n}\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `ClearSearchInput`\ncomponent communicates with the [`SearchInput`](./search-input.md), deleting the search term\nentered.\n\n_Type any term in the input field and then click the icon button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\nimport { SearchInput, ClearSearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n SearchInput,\n ClearSearchInput,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_normalizeClass","_withCtx","_renderSlot","_createTextVNode"],"mappings":";;;;;;sBACEA,WAQkB,CAAA,0BAAA,EAAA;AAAA,IAPhB,KAAA,EAFJC,cAEU,CAAA,CAAA,+BAAA,EACE,IAAc,CAAA,cAAA,CAAA,CAAA;AAAA,IACrB,MAAQ,EAAA,IAAA,CAAA,sBAAA;AAAA,IACT,WAAU,EAAA,oBAAA;AAAA,GAAA,EAAA;AALd,IAAA,OAAA,EAAAC,OAAA,CAQI,MAAc;AAAA,MAAdC,UAAA,CAAc,4BAAd,MAAc;AAAA,QARlBC,gBAQU,GAAC,CAAA;AAAA,OAAA,CAAA;;AARX,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,CAAA,EAAA,CAAA,OAAA,EAAA,QAAA,CAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"clear-search-input.vue.js","sources":["../../../../../src/x-modules/search-box/components/clear-search-input.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-search-input x-button\"\n :class=\"dynamicClasses\"\n :events=\"clearSearchInputEvents\"\n data-test=\"clear-search-input\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../../../utils/types'\nimport { computed, defineComponent, ref } from 'vue'\nimport BaseEventButton from '../../../components/base-event-button.vue'\nimport { useState } from '../../../composables/use-state'\nimport { searchBoxXModule } from '../x-module'\n\n/**\n * This component renders a button to delete the current query.\n *\n * @remarks\n * A button that when pressed emits the {@link SearchBoxXEvents.UserPressedClearSearchBoxButton}\n * and {@link SearchBoxXEvents.UserClearedQuery} events, expressing the user intention to clear\n * the current query.\n * It also adds `x-clear-search-input--has-empty-query` as class when there is no query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'ClearSearchInput',\n components: { BaseEventButton },\n xModule: searchBoxXModule.name,\n setup() {\n const { query } = useState('searchBox')\n\n /**\n * The events dictionary that are going to be emitted when the button is pressed.\n *\n * @internal\n */\n const clearSearchInputEvents = ref({\n UserPressedClearSearchBoxButton: undefined,\n })\n\n const isQueryEmpty = computed(() => query.value.length === 0)\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-clear-search-input--has-empty-query': isQueryEmpty.value,\n }))\n\n return {\n dynamicClasses,\n clearSearchInputEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserPressedClearSearchBoxButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserClearedQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nHere a basic example of how the clear button is rendered.\n\n_Type any term in the input field and then click the Clear button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\nimport { ClearSearchInput, SearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n SearchInput,\n },\n}\n</script>\n```\n\n### Play with default slot\n\nIn this example, a custom text is passed in the default slot instead of the default text to\ncustomize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <ClearSearchInput>Clear</ClearSearchInput>\n</template>\n\n<script>\nimport { ClearSearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n },\n}\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedClearSearchBoxButton` event is implemented, triggering the message\n“clear” when the clear search input button is clicked.\n\n_Click the Clear button to try it out!_\n\n```vue live\n<template>\n <div>\n <ClearSearchInput @UserPressedClearSearchBoxButton=\"message = 'clear'\">Clear</ClearSearchInput>\n {{ message }}\n </div>\n</template>\n\n<script>\nimport { ClearSearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n },\n data() {\n return {\n message: '',\n }\n },\n}\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `ClearSearchInput`\ncomponent communicates with the [`SearchInput`](./search-input.md), deleting the search term\nentered.\n\n_Type any term in the input field and then click the icon button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\nimport { SearchInput, ClearSearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'ClearSearchInputDemo',\n components: {\n SearchInput,\n ClearSearchInput,\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createBlock","_normalizeClass","_renderSlot","_createTextVNode"],"mappings":";;;;;;sBACEA,WAQkB,CAAA,0BAAA,EAAA;AAAA,IAPhB,KAAA,EAAKC,cAAC,CAAA,CAAA,+BAAA,EACE,IAAc,CAAA,cAAA,CAAA,CAAA;AAAA,IACrB,MAAQ,EAAA,IAAA,CAAA,sBAAA;AAAA,IACT,WAAU,EAAA,oBAAA;AAAA,GAAA,EAAA;qBAGV,MAAc;AAAA,MAAdC,UAAA,CAAc,4BAAd,MAAc;AAAA,QAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAAC,eAAA;AAAR,UAAA,GAAA;AAAA,UAAC,CAAA,CAAA;AAAA;AAAA,SAAA,CAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
@@ -2,13 +2,6 @@ import _sfc_main from './search-button.vue2.js';
2
2
  import { openBlock, createElementBlock, normalizeClass, renderSlot, createElementVNode } from 'vue';
3
3
  import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
5
- const _hoisted_1 = /* @__PURE__ */ createElementVNode(
6
- "span",
7
- { class: "x-icon" },
8
- "⌕",
9
- -1
10
- /* HOISTED */
11
- );
12
5
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
13
6
  return openBlock(), createElementBlock(
14
7
  "button",
@@ -20,7 +13,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
20
13
  },
21
14
  [
22
15
  renderSlot(_ctx.$slots, "default", {}, () => [
23
- _hoisted_1
16
+ _cache[1] || (_cache[1] = createElementVNode(
17
+ "span",
18
+ { class: "x-icon" },
19
+ "⌕",
20
+ -1
21
+ /* CACHED */
22
+ ))
24
23
  ])
25
24
  ],
26
25
  2
@@ -1 +1 @@
1
- {"version":3,"file":"search-button.vue.js","sources":["../../../../../src/x-modules/search-box/components/search-button.vue"],"sourcesContent":["<template>\n <button\n ref=\"buttonRef\"\n class=\"x-search-button x-button\"\n :class=\"dynamicClasses\"\n data-test=\"search-button\"\n @click=\"emitEvents\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot><span class=\"x-icon\">⌕</span></slot>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../../../utils/types'\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { computed, defineComponent, ref } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchBoxXModule } from '../x-module'\n\n/**\n * This component renders a button to submit the query.\n *\n * @remarks\n * If query is not empty, it emits {@link XEventsTypes.UserAcceptedAQuery} and\n * {@link SearchBoxXEvents.UserPressedSearchButton} events with the query as payload.\n * It also adds `x-search-button--has-empty-query` as class when there is no query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SearchButton',\n xModule: searchBoxXModule.name,\n setup() {\n const $x = use$x()\n\n const buttonRef = ref<HTMLElement | null>(null)\n\n const { query } = useState('searchBox')\n\n const isQueryEmpty = computed(() => query.value.length === 0)\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-search-button--has-empty-query': isQueryEmpty.value,\n }))\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n function createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: buttonRef.value,\n feature: 'search_box',\n }\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n function emitEvents() {\n if (!isQueryEmpty.value) {\n $x.emit('UserAcceptedAQuery', query.value, createEventMetadata())\n $x.emit('UserPressedSearchButton', query.value, createEventMetadata())\n }\n }\n\n return {\n dynamicClasses,\n buttonRef,\n emitEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserAcceptedAQuery`]https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserPressedSearchButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n<!-- prettier-ignore-start -->\n:::warning\nNote that no events are emitted if the query is empty.\n:::\n<!-- prettier-ignore-end -->\n\n## Dynamic classes\n\n`SearchButton` uses the `x-search-button--has-empty-query` dynamic CSS class to modify the HTML\nbutton style when the query is empty.\n\n## See it in action\n\nIn this example, a clickable button is rendered.\n\n_Click the Search button to try it out!_\n\n```vue live\n<template>\n <SearchButton />\n</template>\n\n<script>\nimport { SearchButton } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n },\n}\n</script>\n```\n\n### Play with default slot\n\nHere text is passed in the default slot instead of an icon to customize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <SearchButton>Search</SearchButton>\n</template>\n\n<script>\nimport { SearchButton } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n },\n}\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedSearchButton` event has been implemented so that when you enter a\nsearch term and click the Search button, the search term is displayed as a message.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton\n @UserPressedSearchButton=\"\n query => {\n message = query\n }\n \"\n />\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\nimport { SearchInput, SearchButton } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchInput,\n SearchButton,\n },\n data() {\n return {\n message: '',\n }\n },\n}\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `SearchButton` component\ncommunicates with the [`SearchInput`](./search-input.md) to submit the query. In this example, when\nyou enter a search term and click the Search button, the “Looking for results” message is displayed.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton @UserAcceptedAQuery=\"message = 'looking for results'\">Search</SearchButton>\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\nimport { SearchButton, SearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n SearchInput,\n },\n data() {\n return {\n message: '',\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_createElementVNode","_openBlock","_createElementBlock","_normalizeClass","_renderSlot"],"mappings":";;;;AASU,MAAA,UAAA,mBAAAA,kBAAA;AAAA,EAA6B,MAAA;AAAA,EAAA,EAAvB,OAAM,QAAQ,EAAA;AAAA,EAAC,GAAA;AAAA,EAAC,CAAA,CAAA;AAAA;AAAA,CAAA,CAAA;;AAR9B,EAAA,OAAAC,SAAA,EAAA,EAAAC,kBAAA;AAAA,IASS,QAAA;AAAA,IAAA;AAAA,MARP,GAAI,EAAA,WAAA;AAAA,MACJ,KAAA,EAHJC,cAGU,CAAA,CAAA,0BAAA,EACE,IAAc,CAAA,cAAA,CAAA,CAAA;AAAA,MACtB,WAAU,EAAA,eAAA;AAAA,MACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,KAAA;;AAGR,MAAAC,UAAA,CAA0C,4BAA1C,MAA0C;AAAA,QAApC,UAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"search-button.vue.js","sources":["../../../../../src/x-modules/search-box/components/search-button.vue"],"sourcesContent":["<template>\n <button\n ref=\"buttonRef\"\n class=\"x-search-button x-button\"\n :class=\"dynamicClasses\"\n data-test=\"search-button\"\n @click=\"emitEvents\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot><span class=\"x-icon\">⌕</span></slot>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../../../utils/types'\nimport type { WireMetadata } from '../../../wiring/wiring.types'\nimport { computed, defineComponent, ref } from 'vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { searchBoxXModule } from '../x-module'\n\n/**\n * This component renders a button to submit the query.\n *\n * @remarks\n * If query is not empty, it emits {@link XEventsTypes.UserAcceptedAQuery} and\n * {@link SearchBoxXEvents.UserPressedSearchButton} events with the query as payload.\n * It also adds `x-search-button--has-empty-query` as class when there is no query.\n *\n * @public\n */\nexport default defineComponent({\n name: 'SearchButton',\n xModule: searchBoxXModule.name,\n setup() {\n const $x = use$x()\n\n const buttonRef = ref<HTMLElement | null>(null)\n\n const { query } = useState('searchBox')\n\n const isQueryEmpty = computed(() => query.value.length === 0)\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-search-button--has-empty-query': isQueryEmpty.value,\n }))\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n function createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: buttonRef.value,\n feature: 'search_box',\n }\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n function emitEvents() {\n if (!isQueryEmpty.value) {\n $x.emit('UserAcceptedAQuery', query.value, createEventMetadata())\n $x.emit('UserPressedSearchButton', query.value, createEventMetadata())\n }\n }\n\n return {\n dynamicClasses,\n buttonRef,\n emitEvents,\n }\n },\n})\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserAcceptedAQuery`]https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserPressedSearchButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n<!-- prettier-ignore-start -->\n:::warning\nNote that no events are emitted if the query is empty.\n:::\n<!-- prettier-ignore-end -->\n\n## Dynamic classes\n\n`SearchButton` uses the `x-search-button--has-empty-query` dynamic CSS class to modify the HTML\nbutton style when the query is empty.\n\n## See it in action\n\nIn this example, a clickable button is rendered.\n\n_Click the Search button to try it out!_\n\n```vue live\n<template>\n <SearchButton />\n</template>\n\n<script>\nimport { SearchButton } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n },\n}\n</script>\n```\n\n### Play with default slot\n\nHere text is passed in the default slot instead of an icon to customize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <SearchButton>Search</SearchButton>\n</template>\n\n<script>\nimport { SearchButton } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n },\n}\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedSearchButton` event has been implemented so that when you enter a\nsearch term and click the Search button, the search term is displayed as a message.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton\n @UserPressedSearchButton=\"\n query => {\n message = query\n }\n \"\n />\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\nimport { SearchInput, SearchButton } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchInput,\n SearchButton,\n },\n data() {\n return {\n message: '',\n }\n },\n}\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `SearchButton` component\ncommunicates with the [`SearchInput`](./search-input.md) to submit the query. In this example, when\nyou enter a search term and click the Search button, the “Looking for results” message is displayed.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton @UserAcceptedAQuery=\"message = 'looking for results'\">Search</SearchButton>\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\nimport { SearchButton, SearchInput } from '@empathyco/x-components/search-box'\n\nexport default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n SearchInput,\n },\n data() {\n return {\n message: '',\n }\n },\n}\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode"],"mappings":";;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IASS,QAAA;AAAA,IAAA;AAAA,MARP,GAAI,EAAA,WAAA;AAAA,MACJ,KAAA,EAAKC,cAAC,CAAA,CAAA,0BAAA,EACE,IAAc,CAAA,cAAA,CAAA,CAAA;AAAA,MACtB,WAAU,EAAA,eAAA;AAAA,MACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,KAAA;;AAGR,MAAAC,UAAA,CAA0C,4BAA1C,MAA0C;AAAA,QAApC,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAAC,kBAAA;AAAA,UAA6B,MAAA;AAAA,UAAA,EAAvB,OAAM,QAAQ,EAAA;AAAA,UAAC,GAAA;AAAA,UAAC,CAAA,CAAA;AAAA;AAAA,SAAA,CAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}