@empathyco/x-components 3.0.0-alpha.32 → 3.0.0-alpha.36

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 (568) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/core/index.js +24 -22
  3. package/core/index.js.map +1 -1
  4. package/docs/API-reference/api/x-adapter.empathyrelatedtag.md +1 -0
  5. package/docs/API-reference/api/x-adapter.empathyrelatedtag.source.md +11 -0
  6. package/docs/API-reference/api/x-components.baseidtogglepanel.md +0 -1
  7. package/docs/API-reference/api/x-components.baseresultlink.md +1 -1
  8. package/docs/API-reference/api/x-components.featurelocation.md +1 -1
  9. package/docs/API-reference/api/x-components.fixedheaderandasideslayout.isbackdropvisible.md +11 -0
  10. package/docs/API-reference/api/x-components.fixedheaderandasideslayout.leftasideanimation.md +11 -0
  11. package/docs/API-reference/api/x-components.fixedheaderandasideslayout.md +30 -0
  12. package/docs/API-reference/api/x-components.fixedheaderandasideslayout.rightasideanimation.md +11 -0
  13. package/docs/API-reference/api/x-components.fixedheaderandasideslayout.scrollposition.md +11 -0
  14. package/docs/API-reference/api/x-components.fixedheaderandasideslayout.setposition.md +22 -0
  15. package/docs/API-reference/api/x-components.getrootxcomponent.md +2 -2
  16. package/docs/API-reference/api/x-components.isxcomponent.md +2 -2
  17. package/docs/API-reference/api/x-components.maybearray.md +13 -0
  18. package/docs/API-reference/api/x-components.md +12 -7
  19. package/docs/API-reference/api/x-components.namespaceddebounce.md +2 -2
  20. package/docs/API-reference/api/x-components.namespacedthrottle.md +2 -2
  21. package/docs/API-reference/api/{x-components.namespacedtimeretrieving.md → x-components.namespacedtimeselector.md} +3 -3
  22. package/docs/API-reference/api/x-components.namespacedtimewireoperator.md +3 -3
  23. package/docs/API-reference/api/x-components.relatedtag.highlightcurated.md +13 -0
  24. package/docs/API-reference/api/x-components.relatedtag.md +1 -0
  25. package/docs/API-reference/api/x-components.relatedtags.highlightcurated.md +13 -0
  26. package/docs/API-reference/api/x-components.searchxevents.md +2 -0
  27. package/docs/API-reference/api/x-components.searchxevents.userclickedabanner.md +13 -0
  28. package/docs/API-reference/api/x-components.searchxevents.userclickedapromoted.md +13 -0
  29. package/docs/API-reference/api/x-components.setconsent.md +1 -1
  30. package/docs/API-reference/api/x-components.setquerytaggingdebounce.md +1 -1
  31. package/docs/API-reference/api/x-components.setsessionduration.md +1 -1
  32. package/docs/API-reference/api/x-components.snippetconfig.isspa.md +13 -0
  33. package/docs/API-reference/api/x-components.snippetconfig.md +1 -0
  34. package/docs/API-reference/api/x-components.tagicon.md +11 -0
  35. package/docs/API-reference/api/x-components.throttle.md +3 -3
  36. package/docs/API-reference/api/x-components.timedwireoperatoroptions.cancelon.md +13 -0
  37. package/docs/API-reference/api/x-components.timedwireoperatoroptions.forceon.md +13 -0
  38. package/docs/API-reference/api/x-components.timedwireoperatoroptions.md +21 -0
  39. package/docs/API-reference/api/{x-components.timeretrieving.md → x-components.timeselector.md} +3 -3
  40. package/docs/API-reference/api/x-components.trackaddtocartwire.md +13 -0
  41. package/docs/API-reference/api/{x-components.trackwire.md → x-components.trackquerywire.md} +3 -3
  42. package/docs/API-reference/api/x-components.trackresultclickedwire.md +13 -0
  43. package/docs/API-reference/api/x-components.xeventstypes.md +0 -1
  44. package/docs/API-reference/api/x-components.xinstaller.md +1 -1
  45. package/docs/API-reference/api/x-types.relatedtag.iscurated.md +13 -0
  46. package/docs/API-reference/api/x-types.relatedtag.md +1 -0
  47. package/docs/API-reference/components/common/animations/x-components.animate-width.md +6 -7
  48. package/docs/API-reference/components/common/animations/x-components.collapse-from-top.md +7 -8
  49. package/docs/API-reference/components/common/animations/x-components.collapse-height.md +8 -9
  50. package/docs/API-reference/components/common/animations/x-components.collapse-width.md +8 -9
  51. package/docs/API-reference/components/common/animations/x-components.cross-fade.md +7 -8
  52. package/docs/API-reference/components/common/animations/x-components.fade-and-slide.md +7 -8
  53. package/docs/API-reference/components/common/animations/x-components.staggered-fade-and-slide.md +7 -8
  54. package/docs/API-reference/components/common/{x-components.staggering-transition-group.md → animations/x-components.staggering-transition-group.md} +8 -9
  55. package/docs/API-reference/components/common/animations/x-components.translate-from-left.md +7 -8
  56. package/docs/API-reference/components/common/animations/x-components.translate-from-right.md +7 -8
  57. package/docs/API-reference/components/common/column-picker/x-components.base-column-picker-dropdown.md +12 -13
  58. package/docs/API-reference/components/common/column-picker/x-components.base-column-picker-list.md +11 -12
  59. package/docs/API-reference/components/common/currency/x-components.base-currency.md +9 -12
  60. package/docs/API-reference/components/common/filters/labels/x-components.base-price-filter-label.md +9 -10
  61. package/docs/API-reference/components/common/filters/labels/x-components.base-rating-filter-label.md +11 -12
  62. package/docs/API-reference/components/common/icons/x-components.arrow.md +3 -4
  63. package/docs/API-reference/components/common/icons/x-components.bag.md +3 -4
  64. package/docs/API-reference/components/common/icons/x-components.bar-code.md +4 -5
  65. package/docs/API-reference/components/common/icons/x-components.barcode-tiny.md +4 -5
  66. package/docs/API-reference/components/common/icons/x-components.cart.md +3 -4
  67. package/docs/API-reference/components/common/icons/x-components.check-tiny.md +4 -5
  68. package/docs/API-reference/components/common/icons/x-components.check.md +3 -4
  69. package/docs/API-reference/components/common/icons/x-components.checkbox-card-selected.md +4 -5
  70. package/docs/API-reference/components/common/icons/x-components.checkbox-card-unselected.md +4 -5
  71. package/docs/API-reference/components/common/icons/x-components.checkbox-selected.md +4 -5
  72. package/docs/API-reference/components/common/icons/x-components.checkbox-unselected.md +4 -5
  73. package/docs/API-reference/components/common/icons/x-components.chevron-down.md +4 -5
  74. package/docs/API-reference/components/common/icons/x-components.chevron-left.md +4 -5
  75. package/docs/API-reference/components/common/icons/x-components.chevron-right.md +4 -5
  76. package/docs/API-reference/components/common/icons/x-components.chevron-tiny-down.md +4 -5
  77. package/docs/API-reference/components/common/icons/x-components.chevron-tiny-left.md +4 -5
  78. package/docs/API-reference/components/common/icons/x-components.chevron-tiny-right.md +4 -5
  79. package/docs/API-reference/components/common/icons/x-components.chevron-tiny-up.md +4 -5
  80. package/docs/API-reference/components/common/icons/x-components.chevron-up.md +4 -5
  81. package/docs/API-reference/components/common/icons/x-components.cross-tiny.md +4 -5
  82. package/docs/API-reference/components/common/icons/x-components.cross.md +3 -4
  83. package/docs/API-reference/components/common/icons/x-components.filters.md +3 -4
  84. package/docs/API-reference/components/common/icons/x-components.grid-1-col.md +4 -5
  85. package/docs/API-reference/components/common/icons/x-components.grid-2-col.md +4 -5
  86. package/docs/API-reference/components/common/icons/x-components.hide.md +3 -4
  87. package/docs/API-reference/components/common/icons/x-components.history-tiny.md +4 -5
  88. package/docs/API-reference/components/common/icons/x-components.history.md +3 -4
  89. package/docs/API-reference/components/common/icons/x-components.menu.md +3 -4
  90. package/docs/API-reference/components/common/icons/x-components.minus-tiny.md +4 -5
  91. package/docs/API-reference/components/common/icons/x-components.minus.md +3 -4
  92. package/docs/API-reference/components/common/icons/x-components.nq-1.md +4 -5
  93. package/docs/API-reference/components/common/icons/x-components.nq-2.md +4 -5
  94. package/docs/API-reference/components/common/icons/x-components.nq-3.md +4 -5
  95. package/docs/API-reference/components/common/icons/x-components.nq-4.md +4 -5
  96. package/docs/API-reference/components/common/icons/x-components.plus.md +3 -4
  97. package/docs/API-reference/components/common/icons/x-components.search-tiny.md +4 -5
  98. package/docs/API-reference/components/common/icons/x-components.search.md +3 -4
  99. package/docs/API-reference/components/common/icons/x-components.show.md +3 -4
  100. package/docs/API-reference/components/common/icons/x-components.star.md +3 -4
  101. package/docs/API-reference/components/common/icons/x-components.tag.md +7 -0
  102. package/docs/API-reference/components/common/icons/x-components.trash-open.md +4 -5
  103. package/docs/API-reference/components/common/icons/x-components.trash.md +3 -4
  104. package/docs/API-reference/components/common/icons/x-components.trending-tiny.md +4 -5
  105. package/docs/API-reference/components/common/icons/x-components.trending.md +3 -4
  106. package/docs/API-reference/components/common/icons/x-components.user.md +3 -4
  107. package/docs/API-reference/components/common/layouts/x-components.fixed-header-and-asides-layout.md +8 -9
  108. package/docs/API-reference/components/common/layouts/x-components.multi-column-max-width-layout.md +8 -9
  109. package/docs/API-reference/components/common/layouts/x-components.single-column-layout.md +6 -5
  110. package/docs/API-reference/components/common/modals/x-components.base-events-modal-close.md +10 -11
  111. package/docs/API-reference/components/common/modals/x-components.base-events-modal-open.md +10 -11
  112. package/docs/API-reference/components/common/modals/x-components.base-events-modal.md +15 -16
  113. package/docs/API-reference/components/common/modals/x-components.base-id-modal-close.md +9 -10
  114. package/docs/API-reference/components/common/modals/x-components.base-id-modal-open.md +9 -10
  115. package/docs/API-reference/components/common/modals/x-components.base-id-modal.md +11 -12
  116. package/docs/API-reference/components/common/modals/x-components.base-modal.md +7 -8
  117. package/docs/API-reference/components/common/panels/x-components.base-header-toggle-panel.md +11 -12
  118. package/docs/API-reference/components/common/panels/x-components.base-id-toggle-panel-button.md +10 -11
  119. package/docs/API-reference/components/common/panels/x-components.base-id-toggle-panel.md +10 -11
  120. package/docs/API-reference/components/common/panels/x-components.base-toggle-panel.md +8 -9
  121. package/docs/API-reference/components/common/result/x-components.base-result-add-to-cart.md +9 -10
  122. package/docs/API-reference/components/common/result/x-components.base-result-current-price.md +10 -11
  123. package/docs/API-reference/components/common/result/x-components.base-result-fallback-image.md +4 -5
  124. package/docs/API-reference/components/common/result/x-components.base-result-image.md +9 -10
  125. package/docs/API-reference/components/common/result/x-components.base-result-link.md +15 -24
  126. package/docs/API-reference/components/common/result/x-components.base-result-placeholder-image.md +4 -5
  127. package/docs/API-reference/components/common/result/x-components.base-result-previous-price.md +9 -10
  128. package/docs/API-reference/components/common/scroll/x-components.base-scroll.md +8 -9
  129. package/docs/API-reference/components/common/suggestions/x-components.base-suggestion.md +10 -11
  130. package/docs/API-reference/components/common/suggestions/x-components.base-suggestions.md +7 -8
  131. package/docs/API-reference/components/common/x-components.auto-progress-bar.md +5 -6
  132. package/docs/API-reference/components/common/x-components.base-dropdown.md +8 -9
  133. package/docs/API-reference/components/common/x-components.base-event-button.md +11 -12
  134. package/docs/API-reference/components/common/x-components.base-grid.md +15 -16
  135. package/docs/API-reference/components/common/x-components.base-keyboard-navigation.md +10 -11
  136. package/docs/API-reference/components/common/x-components.base-rating.md +10 -11
  137. package/docs/API-reference/components/common/x-components.base-variable-column-grid.md +10 -11
  138. package/docs/API-reference/components/common/x-components.global-x-bus.md +6 -7
  139. package/docs/API-reference/components/common/x-components.items-list.md +6 -5
  140. package/docs/API-reference/components/common/x-components.location-provider.md +6 -7
  141. package/docs/API-reference/components/common/x-components.sliding-panel.md +10 -11
  142. package/docs/API-reference/components/common/x-components.snippet-callbacks.md +6 -7
  143. package/docs/API-reference/components/device/x-components.device-detector.md +8 -9
  144. package/docs/API-reference/components/empathize/x-components.empathize.md +8 -9
  145. package/docs/API-reference/components/extra-params/x-components.extra-params.md +7 -8
  146. package/docs/API-reference/components/extra-params/x-components.renderless-extra-param.md +9 -10
  147. package/docs/API-reference/components/extra-params/x-components.snippet-config-extra-params.md +6 -7
  148. package/docs/API-reference/components/facets/x-components.clear-filters.md +9 -10
  149. package/docs/API-reference/components/facets/x-components.facets/facets-provider.md +10 -11
  150. package/docs/API-reference/components/facets/x-components.facets/facets.md +12 -13
  151. package/docs/API-reference/components/facets/x-components.filters/all-filter.md +15 -16
  152. package/docs/API-reference/components/facets/x-components.filters/base-filter.md +12 -13
  153. package/docs/API-reference/components/facets/x-components.filters/editable-number-range-filter.md +12 -13
  154. package/docs/API-reference/components/facets/x-components.filters/hierarchical-filter.md +9 -10
  155. package/docs/API-reference/components/facets/x-components.filters/number-range-filter.md +9 -10
  156. package/docs/API-reference/components/facets/x-components.filters/renderless-filter.md +12 -13
  157. package/docs/API-reference/components/facets/x-components.filters/simple-filter.md +10 -11
  158. package/docs/API-reference/components/facets/x-components.lists/exclude-filters-with-no-results.md +11 -12
  159. package/docs/API-reference/components/facets/x-components.lists/filters-list.md +11 -12
  160. package/docs/API-reference/components/facets/x-components.lists/filters-search.md +9 -10
  161. package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +12 -13
  162. package/docs/API-reference/components/facets/x-components.lists/selected-filters.md +11 -12
  163. package/docs/API-reference/components/facets/x-components.lists/sliced-filters.md +11 -12
  164. package/docs/API-reference/components/facets/x-components.lists/sorted-filters.md +11 -12
  165. package/docs/API-reference/components/history-queries/x-components.clear-history-queries.md +10 -11
  166. package/docs/API-reference/components/history-queries/x-components.history-queries.md +10 -11
  167. package/docs/API-reference/components/history-queries/x-components.history-query.md +11 -12
  168. package/docs/API-reference/components/history-queries/x-components.remove-history-query.md +10 -11
  169. package/docs/API-reference/components/identifier-results/x-components.identifier-result.md +9 -10
  170. package/docs/API-reference/components/identifier-results/x-components.identifier-results.md +10 -11
  171. package/docs/API-reference/components/next-queries/x-components.next-queries-list.md +7 -8
  172. package/docs/API-reference/components/next-queries/x-components.next-queries.md +14 -15
  173. package/docs/API-reference/components/next-queries/x-components.next-query.md +11 -12
  174. package/docs/API-reference/components/popular-searches/x-components.popular-search.md +11 -12
  175. package/docs/API-reference/components/popular-searches/x-components.popular-searches.md +13 -14
  176. package/docs/API-reference/components/query-suggestions/x-components.query-suggestion.md +8 -9
  177. package/docs/API-reference/components/query-suggestions/x-components.query-suggestions.md +8 -9
  178. package/docs/API-reference/components/recommendations/x-components.recommendations.md +14 -15
  179. package/docs/API-reference/components/related-tags/x-components.related-tag.md +19 -17
  180. package/docs/API-reference/components/related-tags/x-components.related-tags.md +19 -19
  181. package/docs/API-reference/components/scroll/x-components.main-scroll-item.md +7 -8
  182. package/docs/API-reference/components/scroll/x-components.main-scroll.md +7 -8
  183. package/docs/API-reference/components/scroll/x-components.scroll-to-top.md +9 -10
  184. package/docs/API-reference/components/scroll/x-components.scroll.md +25 -30
  185. package/docs/API-reference/components/scroll/x-components.window-scroll.md +13 -16
  186. package/docs/API-reference/components/search/x-components.banner.md +8 -9
  187. package/docs/API-reference/components/search/x-components.banners-list.md +7 -8
  188. package/docs/API-reference/components/search/x-components.partial-query-button.md +11 -12
  189. package/docs/API-reference/components/search/x-components.partial-results-list.md +11 -12
  190. package/docs/API-reference/components/search/x-components.promoted.md +7 -8
  191. package/docs/API-reference/components/search/x-components.promoteds-list.md +7 -8
  192. package/docs/API-reference/components/search/x-components.redirection.md +8 -9
  193. package/docs/API-reference/components/search/x-components.results-list.md +7 -8
  194. package/docs/API-reference/components/search/x-components.sort-dropdown.md +8 -9
  195. package/docs/API-reference/components/search/x-components.sort-list.md +8 -9
  196. package/docs/API-reference/components/search/x-components.spellcheck-button.md +11 -12
  197. package/docs/API-reference/components/search/x-components.spellcheck.md +11 -12
  198. package/docs/API-reference/components/search-box/x-components.clear-search-input.md +6 -7
  199. package/docs/API-reference/components/search-box/x-components.search-button.md +6 -7
  200. package/docs/API-reference/components/search-box/x-components.search-input.md +7 -8
  201. package/docs/API-reference/components/tagging/x-components.tagging.md +7 -8
  202. package/docs/API-reference/components/url/x-components.url-handler.md +7 -8
  203. package/docs/build-search-ui/README.md +0 -5
  204. package/docs/build-search-ui/web-archetype-development-guide.md +178 -0
  205. package/docs/build-search-ui/web-archetype-integration-guide.md +146 -143
  206. package/docs/build-search-ui/web-use-x-components-guide.md +0 -5
  207. package/docs/build-search-ui/web-x-components-integration-guide.md +3 -8
  208. package/docs/build-search-ui/x-architecture/README.md +0 -5
  209. package/js/components/animations/animate-width.vue.js +2 -2
  210. package/js/components/animations/animate-width.vue.js.map +1 -1
  211. package/js/components/animations/collapse-from-top.vue.js +2 -2
  212. package/js/components/animations/collapse-from-top.vue.js.map +1 -1
  213. package/js/components/animations/collapse-height.vue.js +2 -2
  214. package/js/components/animations/collapse-height.vue.js.map +1 -1
  215. package/js/components/animations/collapse-width.vue.js +2 -2
  216. package/js/components/animations/collapse-width.vue.js.map +1 -1
  217. package/js/components/animations/cross-fade.vue.js +2 -2
  218. package/js/components/animations/cross-fade.vue.js.map +1 -1
  219. package/js/components/animations/fade-and-slide.vue.js +2 -2
  220. package/js/components/animations/fade-and-slide.vue.js.map +1 -1
  221. package/js/components/animations/staggered-fade-and-slide.vue.js +2 -2
  222. package/js/components/animations/staggered-fade-and-slide.vue.js.map +1 -1
  223. package/js/components/animations/staggered-fade-and-slide.vue_rollup-plugin-vue=script.js +1 -1
  224. package/js/components/animations/staggered-fade-and-slide.vue_rollup-plugin-vue=script.js.map +1 -1
  225. package/js/components/{staggering-transition-group.vue.js → animations/staggering-transition-group.vue.js} +2 -2
  226. package/js/components/animations/staggering-transition-group.vue.js.map +1 -0
  227. package/js/components/{staggering-transition-group.vue_rollup-plugin-vue=script.js → animations/staggering-transition-group.vue_rollup-plugin-vue=script.js} +17 -17
  228. package/js/components/animations/staggering-transition-group.vue_rollup-plugin-vue=script.js.map +1 -0
  229. package/js/components/animations/translate-from-left.vue.js +2 -2
  230. package/js/components/animations/translate-from-left.vue.js.map +1 -1
  231. package/js/components/animations/translate-from-right.vue.js +2 -2
  232. package/js/components/animations/translate-from-right.vue.js.map +1 -1
  233. package/js/components/base-dropdown.vue.js +2 -2
  234. package/js/components/base-dropdown.vue.js.map +1 -1
  235. package/js/components/base-event-button.vue.js.map +1 -1
  236. package/js/components/base-grid.vue.js +2 -2
  237. package/js/components/base-grid.vue.js.map +1 -1
  238. package/js/components/base-keyboard-navigation.vue.js.map +1 -1
  239. package/js/components/base-rating.vue.js +2 -2
  240. package/js/components/base-rating.vue.js.map +1 -1
  241. package/js/components/base-variable-column-grid.vue.js.map +1 -1
  242. package/js/components/column-picker/base-column-picker-dropdown.vue.js.map +1 -1
  243. package/js/components/column-picker/base-column-picker-list.vue.js +2 -2
  244. package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
  245. package/js/components/currency/base-currency.vue.js.map +1 -1
  246. package/js/components/filters/labels/base-price-filter-label.vue.js.map +1 -1
  247. package/js/components/filters/labels/base-rating-filter-label.vue.js.map +1 -1
  248. package/js/components/global-x-bus.vue.js.map +1 -1
  249. package/js/components/global-x-bus.vue_rollup-plugin-vue=script.js +2 -1
  250. package/js/components/global-x-bus.vue_rollup-plugin-vue=script.js.map +1 -1
  251. package/js/components/icons/tag.vue.js +59 -0
  252. package/js/components/icons/tag.vue.js.map +1 -0
  253. package/js/components/icons/tag.vue_rollup-plugin-vue=script.js +4 -0
  254. package/js/components/icons/tag.vue_rollup-plugin-vue=script.js.map +1 -0
  255. package/js/components/layouts/fixed-header-and-asides-layout.vue.js +212 -0
  256. package/js/components/layouts/fixed-header-and-asides-layout.vue.js.map +1 -0
  257. package/js/components/layouts/fixed-header-and-asides-layout.vue_rollup-plugin-vue=script.js +57 -0
  258. package/js/components/layouts/fixed-header-and-asides-layout.vue_rollup-plugin-vue=script.js.map +1 -0
  259. package/js/components/layouts/multi-column-max-width-layout.vue.js +3 -3
  260. package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
  261. package/js/components/layouts/multi-column-max-width-layout.vue_rollup-plugin-vue=script.js +1 -1
  262. package/js/components/layouts/single-column-layout.vue.js +1 -1
  263. package/js/components/layouts/single-column-layout.vue_rollup-plugin-vue=script.js +1 -1
  264. package/js/components/modals/base-events-modal-close.vue.js.map +1 -1
  265. package/js/components/modals/base-events-modal-open.vue.js.map +1 -1
  266. package/js/components/modals/base-events-modal.vue.js.map +1 -1
  267. package/js/components/modals/base-id-modal-close.vue.js.map +1 -1
  268. package/js/components/modals/base-id-modal-open.vue.js.map +1 -1
  269. package/js/components/modals/base-id-modal.vue.js.map +1 -1
  270. package/js/components/modals/base-modal.vue.js +2 -2
  271. package/js/components/modals/base-modal.vue.js.map +1 -1
  272. package/js/components/panels/base-header-toggle-panel.vue.js +2 -2
  273. package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
  274. package/js/components/panels/base-id-toggle-panel-button.vue.js.map +1 -1
  275. package/js/components/panels/base-id-toggle-panel.vue.js.map +1 -1
  276. package/js/components/panels/base-id-toggle-panel.vue_rollup-plugin-vue=script.js +4 -9
  277. package/js/components/panels/base-id-toggle-panel.vue_rollup-plugin-vue=script.js.map +1 -1
  278. package/js/components/panels/base-toggle-panel.vue.js.map +1 -1
  279. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  280. package/js/components/result/base-result-current-price.vue.js.map +1 -1
  281. package/js/components/result/base-result-image.vue.js +2 -2
  282. package/js/components/result/base-result-image.vue.js.map +1 -1
  283. package/js/components/result/base-result-link.vue.js +5 -5
  284. package/js/components/result/base-result-link.vue.js.map +1 -1
  285. package/js/components/result/base-result-link.vue_rollup-plugin-vue=script.js +3 -12
  286. package/js/components/result/base-result-link.vue_rollup-plugin-vue=script.js.map +1 -1
  287. package/js/components/result/base-result-previous-price.vue.js.map +1 -1
  288. package/js/components/scroll/base-scroll.vue.js +2 -2
  289. package/js/components/scroll/base-scroll.vue.js.map +1 -1
  290. package/js/components/sliding-panel.vue.js +2 -2
  291. package/js/components/sliding-panel.vue.js.map +1 -1
  292. package/js/components/suggestions/base-suggestion.vue.js.map +1 -1
  293. package/js/components/suggestions/base-suggestions.vue.js +2 -2
  294. package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
  295. package/js/components/x-component.mixin.js +1 -4
  296. package/js/components/x-component.mixin.js.map +1 -1
  297. package/js/components/x-component.utils.js +4 -20
  298. package/js/components/x-component.utils.js.map +1 -1
  299. package/js/index.js +32 -30
  300. package/js/index.js.map +1 -1
  301. package/js/plugins/x-plugin.alias.js +21 -20
  302. package/js/plugins/x-plugin.alias.js.map +1 -1
  303. package/js/plugins/x-plugin.mixin.js +2 -2
  304. package/js/plugins/x-plugin.mixin.js.map +1 -1
  305. package/js/utils/origin.js +5 -3
  306. package/js/utils/origin.js.map +1 -1
  307. package/js/wiring/namespaced-wires.operators.js +3 -4
  308. package/js/wiring/namespaced-wires.operators.js.map +1 -1
  309. package/js/wiring/wires-operators.utils.js +55 -0
  310. package/js/wiring/wires-operators.utils.js.map +1 -0
  311. package/js/wiring/wires.operators.js +17 -12
  312. package/js/wiring/wires.operators.js.map +1 -1
  313. package/js/x-installer/x-installer/x-installer.js +1 -1
  314. package/js/x-installer/x-installer/x-installer.js.map +1 -1
  315. package/js/x-modules/empathize/components/empathize.vue.js.map +1 -1
  316. package/js/x-modules/empathize/components/empathize.vue_rollup-plugin-vue=script.js +1 -1
  317. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js +14 -12
  318. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
  319. package/js/x-modules/extra-params/components/renderless-extra-param.vue.js.map +1 -1
  320. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js +14 -12
  321. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js.map +1 -1
  322. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js.map +1 -1
  323. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js +23 -12
  324. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
  325. package/js/x-modules/facets/components/clear-filters.vue.js.map +1 -1
  326. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js +14 -12
  327. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  328. package/js/x-modules/facets/components/facets/facets-provider.vue.js +2 -2
  329. package/js/x-modules/facets/components/facets/facets-provider.vue.js.map +1 -1
  330. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js +18 -23
  331. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js.map +1 -1
  332. package/js/x-modules/facets/components/facets/facets.vue.js +2 -2
  333. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  334. package/js/x-modules/facets/components/filters/all-filter.vue.js.map +1 -1
  335. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js +14 -12
  336. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  337. package/js/x-modules/facets/components/filters/base-filter.vue.js.map +1 -1
  338. package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js +14 -12
  339. package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  340. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +1 -1
  341. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
  342. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js.map +1 -1
  343. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js +14 -12
  344. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  345. package/js/x-modules/facets/components/filters/number-range-filter.vue.js.map +1 -1
  346. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js +14 -12
  347. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  348. package/js/x-modules/facets/components/filters/renderless-filter.vue.js.map +1 -1
  349. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js +14 -12
  350. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  351. package/js/x-modules/facets/components/filters/simple-filter.vue.js.map +1 -1
  352. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js +14 -12
  353. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  354. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue.js.map +1 -1
  355. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js +14 -12
  356. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js.map +1 -1
  357. package/js/x-modules/facets/components/lists/filters-list.vue.js +2 -2
  358. package/js/x-modules/facets/components/lists/filters-list.vue.js.map +1 -1
  359. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js +14 -12
  360. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js.map +1 -1
  361. package/js/x-modules/facets/components/lists/filters-search.vue.js +2 -2
  362. package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
  363. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js +14 -12
  364. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js.map +1 -1
  365. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
  366. package/js/x-modules/facets/components/lists/selected-filters.vue.js.map +1 -1
  367. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js +14 -12
  368. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  369. package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
  370. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js +14 -12
  371. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  372. package/js/x-modules/facets/components/lists/sorted-filters.vue.js.map +1 -1
  373. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue=script.js +14 -12
  374. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  375. package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
  376. package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
  377. package/js/x-modules/history-queries/components/history-queries.vue_rollup-plugin-vue=script.js +1 -1
  378. package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
  379. package/js/x-modules/history-queries/components/history-query.vue_rollup-plugin-vue=script.js +1 -1
  380. package/js/x-modules/history-queries/components/remove-history-query.vue.js.map +1 -1
  381. package/js/x-modules/history-queries/wiring.js +1 -1
  382. package/js/x-modules/history-queries/wiring.js.map +1 -1
  383. package/js/x-modules/identifier-results/components/identifier-result.vue.js.map +1 -1
  384. package/js/x-modules/identifier-results/components/identifier-results.vue.js.map +1 -1
  385. package/js/x-modules/identifier-results/store/actions/fetch-and-save-identifier-results.action.js +4 -2
  386. package/js/x-modules/identifier-results/store/actions/fetch-and-save-identifier-results.action.js.map +1 -1
  387. package/js/x-modules/identifier-results/store/getters/identifier-results-request.getter.js +2 -3
  388. package/js/x-modules/identifier-results/store/getters/identifier-results-request.getter.js.map +1 -1
  389. package/js/x-modules/identifier-results/wiring.js +3 -2
  390. package/js/x-modules/identifier-results/wiring.js.map +1 -1
  391. package/js/x-modules/next-queries/components/next-queries-list.vue_rollup-plugin-vue=script.js +1 -1
  392. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  393. package/js/x-modules/next-queries/components/next-queries.vue_rollup-plugin-vue=script.js +1 -1
  394. package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
  395. package/js/x-modules/next-queries/components/next-query.vue_rollup-plugin-vue=script.js +1 -1
  396. package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
  397. package/js/x-modules/popular-searches/components/popular-search.vue_rollup-plugin-vue=script.js +1 -1
  398. package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
  399. package/js/x-modules/popular-searches/components/popular-searches.vue_rollup-plugin-vue=script.js +1 -1
  400. package/js/x-modules/query-suggestions/components/query-suggestion.vue_rollup-plugin-vue=script.js +1 -1
  401. package/js/x-modules/query-suggestions/components/query-suggestions.vue_rollup-plugin-vue=script.js +1 -1
  402. package/js/x-modules/query-suggestions/wiring.js +1 -1
  403. package/js/x-modules/query-suggestions/wiring.js.map +1 -1
  404. package/js/x-modules/recommendations/components/recommendations.vue.js +2 -2
  405. package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
  406. package/js/x-modules/related-tags/components/related-tag.vue.js +7 -3
  407. package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
  408. package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue=script.js +20 -0
  409. package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue=script.js.map +1 -1
  410. package/js/x-modules/related-tags/components/related-tags.vue.js +15 -4
  411. package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
  412. package/js/x-modules/related-tags/components/related-tags.vue_rollup-plugin-vue=script.js +3 -0
  413. package/js/x-modules/related-tags/components/related-tags.vue_rollup-plugin-vue=script.js.map +1 -1
  414. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js +16 -14
  415. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js.map +1 -1
  416. package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -1
  417. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js +16 -14
  418. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js.map +1 -1
  419. package/js/x-modules/scroll/components/scroll.vue.js.map +1 -1
  420. package/js/x-modules/scroll/components/scroll.vue_rollup-plugin-vue=script.js +1 -1
  421. package/js/x-modules/scroll/components/window-scroll.vue.js.map +1 -1
  422. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js +16 -14
  423. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js.map +1 -1
  424. package/js/x-modules/search/components/banner.vue.js +2 -1
  425. package/js/x-modules/search/components/banner.vue.js.map +1 -1
  426. package/js/x-modules/search/components/banner.vue_rollup-plugin-vue=script.js +8 -0
  427. package/js/x-modules/search/components/banner.vue_rollup-plugin-vue=script.js.map +1 -1
  428. package/js/x-modules/search/components/banners-list.vue_rollup-plugin-vue=script.js +1 -1
  429. package/js/x-modules/search/components/partial-query-button.vue.js.map +1 -1
  430. package/js/x-modules/search/components/partial-results-list.vue.js +2 -2
  431. package/js/x-modules/search/components/partial-results-list.vue.js.map +1 -1
  432. package/js/x-modules/search/components/promoted.vue.js +2 -1
  433. package/js/x-modules/search/components/promoted.vue.js.map +1 -1
  434. package/js/x-modules/search/components/promoted.vue_rollup-plugin-vue=script.js +8 -0
  435. package/js/x-modules/search/components/promoted.vue_rollup-plugin-vue=script.js.map +1 -1
  436. package/js/x-modules/search/components/promoteds-list.vue_rollup-plugin-vue=script.js +1 -1
  437. package/js/x-modules/search/components/redirection.vue.js.map +1 -1
  438. package/js/x-modules/search/components/redirection.vue_rollup-plugin-vue=script.js.map +1 -1
  439. package/js/x-modules/search/components/results-list.vue_rollup-plugin-vue=script.js +2 -2
  440. package/js/x-modules/search/components/sort-dropdown.vue.js.map +1 -1
  441. package/js/x-modules/search/components/sort-list.vue.js +2 -2
  442. package/js/x-modules/search/components/sort-list.vue.js.map +1 -1
  443. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js +14 -12
  444. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js.map +1 -1
  445. package/js/x-modules/search/components/sort.mixin.js +14 -12
  446. package/js/x-modules/search/components/sort.mixin.js.map +1 -1
  447. package/js/x-modules/search/components/spellcheck-button.vue.js.map +1 -1
  448. package/js/x-modules/search/components/spellcheck.vue.js.map +1 -1
  449. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js +14 -12
  450. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js.map +1 -1
  451. package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js +4 -1
  452. package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js.map +1 -1
  453. package/js/x-modules/search/store/getters/request.getter.js +2 -3
  454. package/js/x-modules/search/store/getters/request.getter.js.map +1 -1
  455. package/js/x-modules/search/wiring.js +4 -3
  456. package/js/x-modules/search/wiring.js.map +1 -1
  457. package/js/x-modules/search-box/components/search-input.vue.js +2 -2
  458. package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
  459. package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue=script.js +7 -5
  460. package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue=script.js.map +1 -1
  461. package/js/x-modules/tagging/store/actions/track.action.js +2 -2
  462. package/js/x-modules/tagging/store/actions/track.action.js.map +1 -1
  463. package/js/x-modules/tagging/wiring.js +48 -4
  464. package/js/x-modules/tagging/wiring.js.map +1 -1
  465. package/js/x-modules/url/components/url-handler.vue.js +1 -1
  466. package/js/x-modules/url/components/url-handler.vue.js.map +1 -1
  467. package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue=script.js +101 -5
  468. package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue=script.js.map +1 -1
  469. package/package.json +9 -10
  470. package/report/tsdoc-metadata.json +1 -1
  471. package/report/x-adapter.api.json +27 -1
  472. package/report/x-components.api.json +674 -223
  473. package/report/x-components.api.md +86 -35
  474. package/report/x-types.api.json +27 -1
  475. package/tagging/index.js +1 -1
  476. package/types/adapter/mocked-adapter.d.ts.map +1 -1
  477. package/types/components/animations/index.d.ts +1 -0
  478. package/types/components/animations/index.d.ts.map +1 -1
  479. package/types/components/{staggering-transition-group.vue.d.ts → animations/staggering-transition-group.vue.d.ts} +0 -0
  480. package/types/components/animations/staggering-transition-group.vue.d.ts.map +1 -0
  481. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  482. package/types/components/icons/index.d.ts +1 -0
  483. package/types/components/icons/index.d.ts.map +1 -1
  484. package/types/components/icons/tag.vue.d.ts +3 -0
  485. package/types/components/icons/tag.vue.d.ts.map +1 -0
  486. package/types/components/index.d.ts +1 -4
  487. package/types/components/index.d.ts.map +1 -1
  488. package/types/components/layouts/fixed-header-and-asides-layout.vue.d.ts +17 -0
  489. package/types/components/layouts/fixed-header-and-asides-layout.vue.d.ts.map +1 -0
  490. package/types/components/layouts/index.d.ts +4 -0
  491. package/types/components/layouts/index.d.ts.map +1 -0
  492. package/types/components/panels/base-id-toggle-panel.vue.d.ts +0 -5
  493. package/types/components/panels/base-id-toggle-panel.vue.d.ts.map +1 -1
  494. package/types/components/result/base-result-link.vue.d.ts +3 -10
  495. package/types/components/result/base-result-link.vue.d.ts.map +1 -1
  496. package/types/components/x-component.mixin.d.ts.map +1 -1
  497. package/types/components/x-component.utils.d.ts +1 -16
  498. package/types/components/x-component.utils.d.ts.map +1 -1
  499. package/types/plugins/x-plugin.alias.d.ts +4 -6
  500. package/types/plugins/x-plugin.alias.d.ts.map +1 -1
  501. package/types/plugins/x-plugin.mixin.d.ts +13 -3
  502. package/types/plugins/x-plugin.mixin.d.ts.map +1 -1
  503. package/types/types/origin.d.ts +1 -1
  504. package/types/types/origin.d.ts.map +1 -1
  505. package/types/utils/origin.d.ts +3 -1
  506. package/types/utils/origin.d.ts.map +1 -1
  507. package/types/utils/types.d.ts +6 -0
  508. package/types/utils/types.d.ts.map +1 -1
  509. package/types/wiring/events.types.d.ts +0 -5
  510. package/types/wiring/events.types.d.ts.map +1 -1
  511. package/types/wiring/namespaced-wires.operators.d.ts +2 -3
  512. package/types/wiring/namespaced-wires.operators.d.ts.map +1 -1
  513. package/types/wiring/namespaced-wiring.types.d.ts +9 -10
  514. package/types/wiring/namespaced-wiring.types.d.ts.map +1 -1
  515. package/types/wiring/wires-operators.utils.d.ts +36 -0
  516. package/types/wiring/wires-operators.utils.d.ts.map +1 -0
  517. package/types/wiring/wires.operators.d.ts +5 -8
  518. package/types/wiring/wires.operators.d.ts.map +1 -1
  519. package/types/wiring/wiring.types.d.ts +17 -4
  520. package/types/wiring/wiring.types.d.ts.map +1 -1
  521. package/types/x-installer/api/api.types.d.ts +2 -0
  522. package/types/x-installer/api/api.types.d.ts.map +1 -1
  523. package/types/x-installer/x-installer/x-installer.d.ts +1 -1
  524. package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts +6 -0
  525. package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts.map +1 -1
  526. package/types/x-modules/facets/components/facets/facets-provider.vue.d.ts +0 -8
  527. package/types/x-modules/facets/components/facets/facets-provider.vue.d.ts.map +1 -1
  528. package/types/x-modules/history-queries/wiring.d.ts +1 -1
  529. package/types/x-modules/identifier-results/store/actions/fetch-and-save-identifier-results.action.d.ts.map +1 -1
  530. package/types/x-modules/identifier-results/store/getters/identifier-results-request.getter.d.ts.map +1 -1
  531. package/types/x-modules/identifier-results/wiring.d.ts +2 -1
  532. package/types/x-modules/identifier-results/wiring.d.ts.map +1 -1
  533. package/types/x-modules/query-suggestions/wiring.d.ts +1 -1
  534. package/types/x-modules/related-tags/components/related-tag.vue.d.ts +14 -0
  535. package/types/x-modules/related-tags/components/related-tag.vue.d.ts.map +1 -1
  536. package/types/x-modules/related-tags/components/related-tags.vue.d.ts +6 -0
  537. package/types/x-modules/related-tags/components/related-tags.vue.d.ts.map +1 -1
  538. package/types/x-modules/search/components/banner.vue.d.ts +6 -0
  539. package/types/x-modules/search/components/banner.vue.d.ts.map +1 -1
  540. package/types/x-modules/search/components/promoted.vue.d.ts +6 -0
  541. package/types/x-modules/search/components/promoted.vue.d.ts.map +1 -1
  542. package/types/x-modules/search/components/redirection.vue.d.ts +1 -1
  543. package/types/x-modules/search/components/redirection.vue.d.ts.map +1 -1
  544. package/types/x-modules/search/events.types.d.ts +11 -1
  545. package/types/x-modules/search/events.types.d.ts.map +1 -1
  546. package/types/x-modules/search/store/actions/fetch-and-save-search-response.action.d.ts.map +1 -1
  547. package/types/x-modules/search/store/getters/request.getter.d.ts.map +1 -1
  548. package/types/x-modules/search/wiring.d.ts +2 -1
  549. package/types/x-modules/search/wiring.d.ts.map +1 -1
  550. package/types/x-modules/search-box/components/search-input.vue.d.ts +5 -2
  551. package/types/x-modules/search-box/components/search-input.vue.d.ts.map +1 -1
  552. package/types/x-modules/tagging/wiring.d.ts +29 -9
  553. package/types/x-modules/tagging/wiring.d.ts.map +1 -1
  554. package/types/x-modules/url/components/url-handler.vue.d.ts +70 -7
  555. package/types/x-modules/url/components/url-handler.vue.d.ts.map +1 -1
  556. package/docs/API-reference/api/x-components.baseidtogglepanel.created.md +0 -17
  557. package/docs/API-reference/api/x-components.xcomponent.md +0 -15
  558. package/docs/API-reference/api/x-components.xeventstypes.userrightclickedaresult.md +0 -13
  559. package/docs/sidebar.json +0 -1
  560. package/js/components/staggering-transition-group.vue.js.map +0 -1
  561. package/js/components/staggering-transition-group.vue_rollup-plugin-vue=script.js.map +0 -1
  562. package/js/wiring/utils/wire-racing-handling.js +0 -108
  563. package/js/wiring/utils/wire-racing-handling.js.map +0 -1
  564. package/types/components/staggering-transition-group.vue.d.ts.map +0 -1
  565. package/types/components/x-component.types.d.ts +0 -19
  566. package/types/components/x-component.types.d.ts.map +0 -1
  567. package/types/wiring/utils/wire-racing-handling.d.ts +0 -27
  568. package/types/wiring/utils/wire-racing-handling.d.ts.map +0 -1
@@ -34,11 +34,11 @@ __vue_render__._withStripped = true;
34
34
  /* style */
35
35
  var __vue_inject_styles__ = function (inject) {
36
36
  if (!inject) { return }
37
- inject("data-v-11f289f2_0", { source: ".x-staggered-fade-and-slide[data-v-11f289f2] .x-staggered-fade-and-slide--enter-active, .x-staggered-fade-and-slide[data-v-11f289f2] .x-staggered-fade-and-slide--leave-active {\n transition: 0.25s ease-out;\n transition-property: opacity, transform;\n}\n.x-staggered-fade-and-slide[data-v-11f289f2] .x-staggered-fade-and-slide--move {\n transition: transform 0.25s ease-out;\n z-index: 1;\n}\n.x-staggered-fade-and-slide[data-v-11f289f2] .x-staggered-fade-and-slide--enter, .x-staggered-fade-and-slide[data-v-11f289f2] .x-staggered-fade-and-slide--leave-to {\n transform: translate3d(0, 50%, 0);\n opacity: 0;\n}", map: undefined, media: undefined });
37
+ inject("data-v-2d47bdea_0", { source: ".x-staggered-fade-and-slide[data-v-2d47bdea] .x-staggered-fade-and-slide--enter-active, .x-staggered-fade-and-slide[data-v-2d47bdea] .x-staggered-fade-and-slide--leave-active {\n transition: 0.25s ease-out;\n transition-property: opacity, transform;\n}\n.x-staggered-fade-and-slide[data-v-2d47bdea] .x-staggered-fade-and-slide--move {\n transition: transform 0.25s ease-out;\n z-index: 1;\n}\n.x-staggered-fade-and-slide[data-v-2d47bdea] .x-staggered-fade-and-slide--enter, .x-staggered-fade-and-slide[data-v-2d47bdea] .x-staggered-fade-and-slide--leave-to {\n transform: translate3d(0, 50%, 0);\n opacity: 0;\n}", map: undefined, media: undefined });
38
38
 
39
39
  };
40
40
  /* scoped */
41
- var __vue_scope_id__ = "data-v-11f289f2";
41
+ var __vue_scope_id__ = "data-v-2d47bdea";
42
42
  /* module identifier */
43
43
  var __vue_module_identifier__ = undefined;
44
44
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"staggered-fade-and-slide.vue.js","sources":["../../../../src/components/animations/staggered-fade-and-slide.vue"],"sourcesContent":["<template>\n <staggering-transition-group\n v-on=\"$listeners\"\n v-bind=\"$attrs\"\n appear\n class=\"x-staggered-fade-and-slide\"\n name=\"x-staggered-fade-and-slide-\"\n >\n <!-- @slot (Required) Transition-group content -->\n <slot />\n </staggering-transition-group>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n import StaggeringTransitionGroup from '../staggering-transition-group.vue';\n\n /**\n * Renders a transition group wrapping the elements passed in the default slot and animating\n * them with an staggered fade and slide animation.\n *\n * @public\n */\n @Component({\n components: { StaggeringTransitionGroup }\n })\n export default class StaggeredFadeAndSlide extends Vue {}\n</script>\n\n<style lang=\"scss\" scoped>\n $transition-duration: 0.25s;\n\n .x-staggered-fade-and-slide::v-deep .x-staggered-fade-and-slide {\n &--enter-active,\n &--leave-active {\n transition: $transition-duration ease-out;\n transition-property: opacity, transform;\n }\n\n &--move {\n transition: transform $transition-duration ease-out;\n z-index: 1;\n }\n\n &--enter,\n &--leave-to {\n transform: translate3d(0, 50%, 0);\n opacity: 0;\n }\n }\n</style>\n\n<docs lang=\"mdx\">\nThe Staggered fade and slide components works as the normal fade and slide components, but it also\nadds a configurable delay to each transition.\n\n## Example\n\n### Used with animatable components\n\n```vue\n<AnimatableComponent :animation=\"StaggeredFadeAndSlide\" />\n```\n\n### Used as a regular component:\n\nThis components exposes all the props and events of the Staggering transition group, like the `tag`\nor the `stagger` props:\n\n```vue\n<StaggeredFadeAndSlide tag=\"ul\" :stagger=\"50\">\n <li>Element to animate</li>\n <li>Element to animate</li>\n <li>Element to animate</li>\n</StaggeredFadeAndSlide>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"staggered-fade-and-slide.vue.js","sources":["../../../../src/components/animations/staggered-fade-and-slide.vue"],"sourcesContent":["<template>\n <staggering-transition-group\n v-on=\"$listeners\"\n v-bind=\"$attrs\"\n appear\n class=\"x-staggered-fade-and-slide\"\n name=\"x-staggered-fade-and-slide-\"\n >\n <!-- @slot (Required) Transition-group content -->\n <slot />\n </staggering-transition-group>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n import StaggeringTransitionGroup from '../animations/staggering-transition-group.vue';\n\n /**\n * Renders a transition group wrapping the elements passed in the default slot and animating\n * them with an staggered fade and slide animation.\n *\n * @public\n */\n @Component({\n components: { StaggeringTransitionGroup }\n })\n export default class StaggeredFadeAndSlide extends Vue {}\n</script>\n\n<style lang=\"scss\" scoped>\n $transition-duration: 0.25s;\n\n .x-staggered-fade-and-slide::v-deep .x-staggered-fade-and-slide {\n &--enter-active,\n &--leave-active {\n transition: $transition-duration ease-out;\n transition-property: opacity, transform;\n }\n\n &--move {\n transition: transform $transition-duration ease-out;\n z-index: 1;\n }\n\n &--enter,\n &--leave-to {\n transform: translate3d(0, 50%, 0);\n opacity: 0;\n }\n }\n</style>\n\n<docs lang=\"mdx\">\nThe Staggered fade and slide components works as the normal fade and slide components, but it also\nadds a configurable delay to each transition.\n\n## Example\n\n### Used with animatable components\n\n```vue\n<AnimatableComponent :animation=\"StaggeredFadeAndSlide\" />\n```\n\n### Used as a regular component:\n\nThis components exposes all the props and events of the Staggering transition group, like the `tag`\nor the `stagger` props:\n\n```vue\n<StaggeredFadeAndSlide tag=\"ul\" :stagger=\"50\">\n <li>Element to animate</li>\n <li>Element to animate</li>\n <li>Element to animate</li>\n</StaggeredFadeAndSlide>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { __extends, __decorate } from 'tslib';
2
2
  import Vue from 'vue';
3
3
  import { Component } from 'vue-property-decorator';
4
- import StaggeringTransitionGroup from '../staggering-transition-group.vue.js';
4
+ import StaggeringTransitionGroup from './staggering-transition-group.vue.js';
5
5
 
6
6
  /**
7
7
  * Renders a transition group wrapping the elements passed in the default slot and animating
@@ -1 +1 @@
1
- {"version":3,"file":"staggered-fade-and-slide.vue_rollup-plugin-vue=script.js","sources":["../../../../src/components/animations/staggered-fade-and-slide.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component } from 'vue-property-decorator';\nimport StaggeringTransitionGroup from '../staggering-transition-group.vue';\n\n/**\n * Renders a transition group wrapping the elements passed in the default slot and animating\n * them with an staggered fade and slide animation.\n *\n * @public\n */\n@Component({\n components: { StaggeringTransitionGroup }\n})\nexport default class StaggeredFadeAndSlide extends Vue {}\n"],"names":[],"mappings":";;;;;AAkBA;;;;;;AASA;IAAmD,yCAAG;IAAtD;;KAAyD;IAApC,qBAAqB;QAHzC,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,yBAAyB,2BAAA,EAAE;SAC1C,CAAC;OACmB,qBAAqB,CAAe;IAAD,4BAAC;CAAA,CAAN,GAAG;;;;"}
1
+ {"version":3,"file":"staggered-fade-and-slide.vue_rollup-plugin-vue=script.js","sources":["../../../../src/components/animations/staggered-fade-and-slide.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport { Component } from 'vue-property-decorator';\nimport StaggeringTransitionGroup from '../animations/staggering-transition-group.vue';\n\n/**\n * Renders a transition group wrapping the elements passed in the default slot and animating\n * them with an staggered fade and slide animation.\n *\n * @public\n */\n@Component({\n components: { StaggeringTransitionGroup }\n})\nexport default class StaggeredFadeAndSlide extends Vue {}\n"],"names":[],"mappings":";;;;;AAkBA;;;;;;AASA;IAAmD,yCAAG;IAAtD;;KAAyD;IAApC,qBAAqB;QAHzC,SAAS,CAAC;YACT,UAAU,EAAE,EAAE,yBAAyB,2BAAA,EAAE;SAC1C,CAAC;OACmB,qBAAqB,CAAe;IAAD,4BAAC;CAAA,CAAN,GAAG;;;;"}
@@ -10,11 +10,11 @@ var __vue_script__ = script;
10
10
  /* style */
11
11
  var __vue_inject_styles__ = function (inject) {
12
12
  if (!inject) { return }
13
- inject("data-v-82fbf2ac_0", { source: ".x-staggering-transition-group[data-v-82fbf2ac] {\n position: relative;\n}", map: undefined, media: undefined });
13
+ inject("data-v-43f70f6e_0", { source: ".x-staggering-transition-group[data-v-43f70f6e] {\n position: relative;\n}", map: undefined, media: undefined });
14
14
 
15
15
  };
16
16
  /* scoped */
17
- var __vue_scope_id__ = "data-v-82fbf2ac";
17
+ var __vue_scope_id__ = "data-v-43f70f6e";
18
18
  /* module identifier */
19
19
  var __vue_module_identifier__ = undefined;
20
20
  /* functional template */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staggering-transition-group.vue.js","sources":["../../../../src/components/animations/staggering-transition-group.vue"],"sourcesContent":["<script lang=\"ts\">\n import Vue, { CreateElement, VNode } from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { noOp } from '../../utils';\n\n /* eslint-disable @typescript-eslint/unbound-method */\n /**\n * A replacement component for Vue's transition-group, that also adds the option to stagger\n * the animations.\n *\n * @public\n */\n @Component\n export default class StaggeringTransitionGroup extends Vue {\n /**\n * The name of the transition. Used to generate the CSS classes.\n *\n * @internal\n */\n @Prop({ default: 'v' })\n public name!: string;\n\n /** The CSS move class name.\n *\n * @internal\n */\n @Prop()\n public moveClass!: string;\n\n /**\n * The tag of the node to render to the DOM.\n *\n * @internal\n */\n @Prop({ default: 'div' })\n public tag!: string;\n\n /**\n * The time in ms to stagger each item.\n *\n * @internal\n */\n @Prop({ default: 25 })\n public staggering!: number;\n\n /**\n * The CSS class for the moving transitions.\n *\n * @returns The move transition name.\n * @internal\n */\n protected get moveClassName(): string {\n return this.moveClass ?? `${this.name}-move`;\n }\n\n /**\n * The transition data contains the needed events and props to perform a transition using Vue\n * virtual node's API.\n *\n * The `beforeLeave` hook is extended to also restore the previous position of the element using\n * the position absolute.\n * The `afterEnter` and `afterLeave` hooks are extended to also clean the transition delay\n * applied by the stagger.\n *\n * @returns The transition data for Vue virtual nodes.\n * @internal\n */\n protected get transitionData(): TransitionData {\n const transitionData: TransitionData = { ...this.$props, ...this.$attrs, ...this.$listeners };\n\n transitionData.beforeLeave = this.addRestorePositionHook(transitionData.beforeLeave);\n transitionData.afterEnter = this.addClearStaggeringCall(transitionData.afterEnter);\n transitionData.afterLeave = this.addClearStaggeringCall(transitionData.afterLeave);\n\n return transitionData;\n }\n\n /** The list of old virtual nodes, generated by the previous called render method.\n *\n * @internal */\n protected oldChildren!: TransitionVNode[];\n /** The list of new virtual nodes, generated by the last called render method.\n *\n * @internal */\n protected newChildren!: TransitionVNode[];\n /** A map containing the previous positions relative to the container, for each item\n * rendered inside the slot of this component component.\n * This is used together with the `newPositions` to calculate the move transition.\n *\n * @internal */\n protected oldPositions!: WeakMap<Element, Bounds>;\n /** A map containing the new positions relative to the container, for each item\n * rendered inside the slot of this component component.\n * This is used together with the `newPositions` to calculate the move transition.\n *\n * @internal */\n protected newPositions!: WeakMap<Element, Bounds>;\n /** A map containing the move cleanup functions pending to have been called. When invoked\n * this functions remove all the styles and classes associated to the move transition.\n *\n * @internal */\n protected pendingCleanupMoveCallbacks!: WeakMap<Element, () => void>;\n /** The counter for the stagger, used to calculate the delay for the transition of each child\n * element. It is reset every time the render method is triggered.\n *\n * @internal */\n protected staggerCounter!: number;\n /** The bounds of the container rendered using the `tag` prop. This is used to calculate the\n * relative positions of each leaving child, which are then applied with the position absolute.\n *\n * @internal */\n protected wrapperBounds!: DOMRect;\n\n beforeCreate(): void {\n /* Initialize properties here to avoid making them reactive,\n which would cause infinite loops */\n this.oldChildren = [];\n this.newChildren = [];\n this.oldPositions = new WeakMap();\n this.newPositions = new WeakMap();\n this.pendingCleanupMoveCallbacks = new WeakMap<Element, () => void>();\n this.staggerCounter = 0;\n }\n\n render(createElement: CreateElement): VNode {\n this.staggerCounter = 0;\n // New children are now the old ones\n this.oldChildren = this.newChildren;\n // Only vnodes with a tag (i.e. no HTML comments) and with a `key` property are valid.\n this.newChildren = (this.$slots.default ?? []).filter(this.isTransitionValidVNode);\n\n // Apply transition data to both new and old nodes & store the position of the old nodes.\n this.newChildren.forEach(this.addTransitionData);\n this.oldChildren.forEach(this.syncOldNodes);\n\n return createElement(\n this.tag,\n { staticClass: 'x-staggering-transition-group' },\n this.newChildren\n );\n }\n\n mounted(): void {\n this.newChildren.forEach(this.applyStagger);\n }\n\n beforeUpdate(): void {\n this.wrapperBounds = this.$el.getBoundingClientRect();\n }\n\n updated(): void {\n this.wrapperBounds = this.$el.getBoundingClientRect();\n this.newChildren.forEach(this.recordNewPosition);\n const { leavingNodes, stayingNodes, enteringNodes } = this.getNodesByTransitionType();\n\n leavingNodes.forEach(vNode => {\n this.applyStagger(vNode);\n this.disableClickingEvents(vNode);\n });\n const movedChildren = stayingNodes.filter(this.applyTranslation);\n const movedStagger = movedChildren.map(this.getNextTransitionDelay);\n enteringNodes.forEach(this.applyStagger);\n\n // force reflow to put everything in position\n document.body.getBoundingClientRect();\n\n movedChildren.forEach(this.startMoveAnimation(movedStagger));\n }\n\n /**\n * Extends the provided leave transition hook restoring the position of the element with an\n * absolute position.\n * Additionally, it removes the element position from the maps of positions.\n *\n * @param transitionHook - The leave transition hook to extend.\n * @returns The new leave transition hook extended.\n * @internal\n */\n protected addRestorePositionHook(transitionHook: TransitionHook = noOp): TransitionHook {\n return element => {\n const { top, left, width, height } = this.oldPositions.get(element)!;\n const { marginTop, marginLeft } = window.getComputedStyle(element);\n const style = element.style;\n style.position = 'absolute';\n style.top = `${top - parseFloat(marginTop)}px`;\n style.left = `${left - parseFloat(marginLeft)}px`;\n style.width = `${width}px`;\n style.height = `${height}px`;\n this.newPositions.delete(element);\n this.oldPositions.delete(element);\n const pendingCallback = this.pendingCleanupMoveCallbacks.get(element);\n pendingCallback?.();\n transitionHook(element);\n };\n }\n\n /**\n * Extends the provided transition hook clearing the transition delay.\n *\n * @param transitionHook - The transition hook to extend.\n * @returns The new transition hook, that also clears the transitionDelay from the element.\n * @internal\n */\n protected addClearStaggeringCall(transitionHook: TransitionHook = noOp): TransitionHook {\n return element => {\n element.style.transitionDelay = '';\n transitionHook(element);\n };\n }\n\n /**\n * Returns if the vNode contains a non empty key, and a non empty tag.\n *\n * @param vNode - The VNode to check if it is a valid transition node, containing a `tag` and a\n * `key` property.\n * @returns True when the vNode contains a non empty key and a non empty tag. False otherwise.\n * @internal\n */\n protected isTransitionValidVNode(vNode: VNode): vNode is TransitionVNode {\n // TODO Add warning with logger: <staggering-transition-group> children must be keyed.\n return !!vNode.key && !!vNode.tag;\n }\n\n /**\n * Adds the generated transition data to the vNode, creating the `data` property if necessary.\n *\n * @param vNode - The VNode to add the transition data to.\n * @internal\n */\n protected addTransitionData(vNode: TransitionVNode): void {\n if (!vNode.data) {\n vNode.data = {};\n }\n vNode.data.transition = this.transitionData;\n }\n\n /**\n * Re-applies the transition data to an old node, just in case it changed from the previous\n * render call. It also records the position of the node, to then calculate the move\n * transitions.\n *\n * @param vNode - The vNode to add the transition data to, and record his current position as\n * old.\n * @internal\n */\n protected syncOldNodes(vNode: TransitionVNode): void {\n // Synchronize transition data, in case it changed in the last frame.\n // We can trust data to be defined because each new node has the transition applied\n vNode.data!.transition = this.transitionData;\n this.recordOldPosition(vNode);\n }\n\n /**\n * Saves the position of the vNode in the map of old positions.\n *\n * @param vNode - The node to store its position.\n * @internal\n */\n protected recordOldPosition(vNode: TransitionVNode): void {\n this.oldPositions.set(vNode.elm, this.createRelativeBounds(vNode));\n }\n\n /**\n * Saves the position of the vNode in the map of new positions.\n *\n * @param vNode - The node to store its position.\n * @internal\n */\n protected recordNewPosition(vNode: TransitionVNode): void {\n this.newPositions.set(vNode.elm, this.createRelativeBounds(vNode));\n }\n\n /**\n * Creates an object containing the position of the vNode relative to its container.\n *\n * @param vNode - The virtual node to store its relative position.\n * @returns The relative bounds of the provided virtual node.\n * @internal\n */\n protected createRelativeBounds(vNode: TransitionVNode): Bounds {\n const { left, top, width, height } = vNode.elm.getBoundingClientRect();\n const { left: wrapperLeft, top: wrapperTop } = this.wrapperBounds;\n return {\n left: left - wrapperLeft,\n top: top - wrapperTop,\n width,\n height\n };\n }\n\n /**\n * Splits the children of the component into three groups:\n * - Nodes that are leaving.\n * - Nodes that are entering.\n * - Nodes that stay.\n *\n * This is then used to apply the stagger in the correct order: leave -\\> move -\\> enter.\n *\n * @returns The children nodes, divided in different groups depending on if they are leaving,\n * staying or entering.\n * @internal\n */\n protected getNodesByTransitionType(): TransitionTypeNodes {\n const leave = this.oldChildren.filter(child => !this.newPositions.has(child.elm));\n const enter = this.newChildren.filter(child => !this.oldPositions.has(child.elm));\n const stay = this.oldChildren.filter(child => this.newPositions.has(child.elm));\n return {\n leavingNodes: leave,\n enteringNodes: enter,\n stayingNodes: stay\n };\n }\n\n /**\n * Applies an incremental delay to the virtual node element.\n *\n * @param vNode - The virtual node to apply the stagger to.\n * @internal\n */\n protected applyStagger(vNode: TransitionVNode): void {\n vNode.elm.style.transitionDelay = this.getNextTransitionDelay();\n }\n\n /**\n * Disables listening to click events in a virtual node element.\n *\n * @remarks This is done to avoid letting the user click elements that are performing the moving\n * animation to leave the DOM but are still rendered.\n *\n * @param vNode - The virtual node to disable listening to click events.\n * @internal\n */\n protected disableClickingEvents(vNode: TransitionVNode): void {\n vNode.elm.style.pointerEvents = 'none';\n }\n\n /**\n * Calculates the next transition delay property, incrementing the `staggerCounter` property\n * each time it is called.\n *\n * @returns The value for the next element `style.transitionDelay` property.\n * @internal\n */\n protected getNextTransitionDelay(): string {\n return `${this.staggerCounter++ * this.staggering}ms`;\n }\n\n /**\n * Calculates if the virtual node should have a move transition. If its has it, then it\n * applies it immediately using the `style.transform`.\n *\n * @param vNode - The virtual node to calculate if it should have a move transition.\n * @returns True when a move transition was applied to the virtual node.\n * @internal\n */\n protected applyTranslation(vNode: TransitionVNode): boolean {\n const oldPosition = this.oldPositions.get(vNode.elm as Element)!;\n const newPosition = this.newPositions.get(vNode.elm as Element)!;\n const dx = oldPosition.left - newPosition.left;\n const dy = oldPosition.top - newPosition.top;\n if (dx !== 0 || dy !== 0) {\n const style = vNode.elm.style;\n style.transform = `translate3d(${dx}px,${dy}px,0)`;\n style.transitionDuration = '0s';\n return true;\n }\n return false;\n }\n\n /**\n * Generates a function to start the moving animations to each node that it needs them with the\n * provided stagger.\n *\n * @param moveStagger - A list containing the delay to add to each node.\n * @returns A function that starts the moving animation with the provided stagger to a single\n * virtual node.\n * @internal\n */\n protected startMoveAnimation(\n moveStagger: string[]\n ): (vNode: TransitionVNode, index: number) => void {\n return (vNode, index) => {\n const element = vNode.elm;\n const style = element.style;\n element.classList.add(this.moveClassName);\n style.transform = style.transitionDuration = '';\n style.transitionDelay = moveStagger[index];\n const cleanMoveTransition = (event?: TransitionEvent): void => {\n if (!event || (event.target === element && /transform$/.test(event.propertyName))) {\n element.removeEventListener('transitionend', cleanMoveTransition);\n element.style.transitionDelay = '';\n element.classList.remove(this.moveClassName);\n this.pendingCleanupMoveCallbacks.delete(element);\n }\n };\n this.pendingCleanupMoveCallbacks.set(element, cleanMoveTransition);\n element.addEventListener('transitionend', cleanMoveTransition);\n };\n }\n }\n\n /**\n * Contains arrays of nodes, splitted by the action they should have.\n */\n interface TransitionTypeNodes {\n leavingNodes: TransitionVNode[];\n stayingNodes: TransitionVNode[];\n enteringNodes: TransitionVNode[];\n }\n\n /**\n * Safe transition version of the VNode type, with the required non optional properties.\n */\n interface TransitionVNode extends VNode {\n elm: HTMLElement;\n tag: string;\n key: string;\n }\n\n /**\n * Vue's VNode {@link https://vuejs.org/v2/api/#transition | transition} data props and events.\n */\n interface TransitionData {\n name?: string;\n appear?: boolean;\n css?: boolean;\n type?: 'transition' | 'animation'; // Unused\n mode?: 'out-in' | 'in-out'; // Unused\n duration?: number;\n enterClass?: string;\n leaveClass?: string;\n appearClass?: string;\n enterToClass?: string;\n leaveToClass?: string;\n appearToClass?: string;\n enterActiveClass?: string;\n leaveActiveClass?: string;\n appearActiveClass?: string;\n beforeEnter?: TransitionHook;\n enter?: TransitionHook;\n afterEnter?: TransitionHook;\n beforeLeave?: TransitionHook;\n leave?: TransitionHook;\n afterLeave?: TransitionHook;\n }\n\n /**\n * A function that receives an HTMLElement. Used to perform actions when the different phases\n * of Vue transitions happens.\n */\n type TransitionHook = (element: HTMLElement) => void;\n\n /**\n * Represents the dimensions and positions of an element.\n */\n interface Bounds {\n top: number;\n left: number;\n width: number;\n height: number;\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-staggering-transition-group {\n position: relative;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nApart from all the props and events that the classic transition group has, the staggering transition\ngroup also exposes a new `stagger` property, which allows to configure the delay for each one of the\nnodes when animating.\n\n```vue\n<staggering-transition-group appear :stagger=\"50\" name=\"staggered-fade-slide-\">\n <!-- @slot (Required) Transition-group content -->\n <slot />\n</staggering-transition-group>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,23 +1,23 @@
1
1
  import { __extends, __assign, __decorate } from 'tslib';
2
2
  import Vue from 'vue';
3
3
  import { Prop, Component } from 'vue-property-decorator';
4
- import '../utils/array.js';
5
- import { noOp } from '../utils/function.js';
6
- import '../utils/cancellable-promise.js';
7
- import '../utils/clone.js';
8
- import '../utils/currency-formatter.js';
9
- import '../utils/debounce.js';
10
- import '../utils/filters.js';
11
- import '../utils/get-url-parameters.js';
12
- import '../utils/html.js';
13
- import '../utils/normalize.js';
14
- import '../utils/number.js';
15
- import '../utils/object.js';
16
- import '../utils/origin.js';
17
- import '../utils/sanitize.js';
18
- import '../utils/storage.js';
19
- import '../utils/string.js';
20
- import '../utils/throttle.js';
4
+ import '../../utils/array.js';
5
+ import { noOp } from '../../utils/function.js';
6
+ import '../../utils/cancellable-promise.js';
7
+ import '../../utils/clone.js';
8
+ import '../../utils/currency-formatter.js';
9
+ import '../../utils/debounce.js';
10
+ import '../../utils/filters.js';
11
+ import '../../utils/get-url-parameters.js';
12
+ import '../../utils/html.js';
13
+ import '../../utils/normalize.js';
14
+ import '../../utils/number.js';
15
+ import '../../utils/object.js';
16
+ import '../../utils/origin.js';
17
+ import '../../utils/sanitize.js';
18
+ import '../../utils/storage.js';
19
+ import '../../utils/string.js';
20
+ import '../../utils/throttle.js';
21
21
 
22
22
  /* eslint-disable @typescript-eslint/unbound-method */
23
23
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staggering-transition-group.vue_rollup-plugin-vue=script.js","sources":["../../../../src/components/animations/staggering-transition-group.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\nimport Vue, { CreateElement, VNode } from 'vue';\nimport { Component, Prop } from 'vue-property-decorator';\nimport { noOp } from '../../utils';\n\n/* eslint-disable @typescript-eslint/unbound-method */\n/**\n * A replacement component for Vue's transition-group, that also adds the option to stagger\n * the animations.\n *\n * @public\n */\n@Component\nexport default class StaggeringTransitionGroup extends Vue {\n /**\n * The name of the transition. Used to generate the CSS classes.\n *\n * @internal\n */\n @Prop({ default: 'v' })\n public name!: string;\n\n /** The CSS move class name.\n *\n * @internal\n */\n @Prop()\n public moveClass!: string;\n\n /**\n * The tag of the node to render to the DOM.\n *\n * @internal\n */\n @Prop({ default: 'div' })\n public tag!: string;\n\n /**\n * The time in ms to stagger each item.\n *\n * @internal\n */\n @Prop({ default: 25 })\n public staggering!: number;\n\n /**\n * The CSS class for the moving transitions.\n *\n * @returns The move transition name.\n * @internal\n */\n protected get moveClassName(): string {\n return this.moveClass ?? `${this.name}-move`;\n }\n\n /**\n * The transition data contains the needed events and props to perform a transition using Vue\n * virtual node's API.\n *\n * The `beforeLeave` hook is extended to also restore the previous position of the element using\n * the position absolute.\n * The `afterEnter` and `afterLeave` hooks are extended to also clean the transition delay\n * applied by the stagger.\n *\n * @returns The transition data for Vue virtual nodes.\n * @internal\n */\n protected get transitionData(): TransitionData {\n const transitionData: TransitionData = { ...this.$props, ...this.$attrs, ...this.$listeners };\n\n transitionData.beforeLeave = this.addRestorePositionHook(transitionData.beforeLeave);\n transitionData.afterEnter = this.addClearStaggeringCall(transitionData.afterEnter);\n transitionData.afterLeave = this.addClearStaggeringCall(transitionData.afterLeave);\n\n return transitionData;\n }\n\n /** The list of old virtual nodes, generated by the previous called render method.\n *\n * @internal */\n protected oldChildren!: TransitionVNode[];\n /** The list of new virtual nodes, generated by the last called render method.\n *\n * @internal */\n protected newChildren!: TransitionVNode[];\n /** A map containing the previous positions relative to the container, for each item\n * rendered inside the slot of this component component.\n * This is used together with the `newPositions` to calculate the move transition.\n *\n * @internal */\n protected oldPositions!: WeakMap<Element, Bounds>;\n /** A map containing the new positions relative to the container, for each item\n * rendered inside the slot of this component component.\n * This is used together with the `newPositions` to calculate the move transition.\n *\n * @internal */\n protected newPositions!: WeakMap<Element, Bounds>;\n /** A map containing the move cleanup functions pending to have been called. When invoked\n * this functions remove all the styles and classes associated to the move transition.\n *\n * @internal */\n protected pendingCleanupMoveCallbacks!: WeakMap<Element, () => void>;\n /** The counter for the stagger, used to calculate the delay for the transition of each child\n * element. It is reset every time the render method is triggered.\n *\n * @internal */\n protected staggerCounter!: number;\n /** The bounds of the container rendered using the `tag` prop. This is used to calculate the\n * relative positions of each leaving child, which are then applied with the position absolute.\n *\n * @internal */\n protected wrapperBounds!: DOMRect;\n\n beforeCreate(): void {\n /* Initialize properties here to avoid making them reactive,\n which would cause infinite loops */\n this.oldChildren = [];\n this.newChildren = [];\n this.oldPositions = new WeakMap();\n this.newPositions = new WeakMap();\n this.pendingCleanupMoveCallbacks = new WeakMap<Element, () => void>();\n this.staggerCounter = 0;\n }\n\n render(createElement: CreateElement): VNode {\n this.staggerCounter = 0;\n // New children are now the old ones\n this.oldChildren = this.newChildren;\n // Only vnodes with a tag (i.e. no HTML comments) and with a `key` property are valid.\n this.newChildren = (this.$slots.default ?? []).filter(this.isTransitionValidVNode);\n\n // Apply transition data to both new and old nodes & store the position of the old nodes.\n this.newChildren.forEach(this.addTransitionData);\n this.oldChildren.forEach(this.syncOldNodes);\n\n return createElement(\n this.tag,\n { staticClass: 'x-staggering-transition-group' },\n this.newChildren\n );\n }\n\n mounted(): void {\n this.newChildren.forEach(this.applyStagger);\n }\n\n beforeUpdate(): void {\n this.wrapperBounds = this.$el.getBoundingClientRect();\n }\n\n updated(): void {\n this.wrapperBounds = this.$el.getBoundingClientRect();\n this.newChildren.forEach(this.recordNewPosition);\n const { leavingNodes, stayingNodes, enteringNodes } = this.getNodesByTransitionType();\n\n leavingNodes.forEach(vNode => {\n this.applyStagger(vNode);\n this.disableClickingEvents(vNode);\n });\n const movedChildren = stayingNodes.filter(this.applyTranslation);\n const movedStagger = movedChildren.map(this.getNextTransitionDelay);\n enteringNodes.forEach(this.applyStagger);\n\n // force reflow to put everything in position\n document.body.getBoundingClientRect();\n\n movedChildren.forEach(this.startMoveAnimation(movedStagger));\n }\n\n /**\n * Extends the provided leave transition hook restoring the position of the element with an\n * absolute position.\n * Additionally, it removes the element position from the maps of positions.\n *\n * @param transitionHook - The leave transition hook to extend.\n * @returns The new leave transition hook extended.\n * @internal\n */\n protected addRestorePositionHook(transitionHook: TransitionHook = noOp): TransitionHook {\n return element => {\n const { top, left, width, height } = this.oldPositions.get(element)!;\n const { marginTop, marginLeft } = window.getComputedStyle(element);\n const style = element.style;\n style.position = 'absolute';\n style.top = `${top - parseFloat(marginTop)}px`;\n style.left = `${left - parseFloat(marginLeft)}px`;\n style.width = `${width}px`;\n style.height = `${height}px`;\n this.newPositions.delete(element);\n this.oldPositions.delete(element);\n const pendingCallback = this.pendingCleanupMoveCallbacks.get(element);\n pendingCallback?.();\n transitionHook(element);\n };\n }\n\n /**\n * Extends the provided transition hook clearing the transition delay.\n *\n * @param transitionHook - The transition hook to extend.\n * @returns The new transition hook, that also clears the transitionDelay from the element.\n * @internal\n */\n protected addClearStaggeringCall(transitionHook: TransitionHook = noOp): TransitionHook {\n return element => {\n element.style.transitionDelay = '';\n transitionHook(element);\n };\n }\n\n /**\n * Returns if the vNode contains a non empty key, and a non empty tag.\n *\n * @param vNode - The VNode to check if it is a valid transition node, containing a `tag` and a\n * `key` property.\n * @returns True when the vNode contains a non empty key and a non empty tag. False otherwise.\n * @internal\n */\n protected isTransitionValidVNode(vNode: VNode): vNode is TransitionVNode {\n // TODO Add warning with logger: <staggering-transition-group> children must be keyed.\n return !!vNode.key && !!vNode.tag;\n }\n\n /**\n * Adds the generated transition data to the vNode, creating the `data` property if necessary.\n *\n * @param vNode - The VNode to add the transition data to.\n * @internal\n */\n protected addTransitionData(vNode: TransitionVNode): void {\n if (!vNode.data) {\n vNode.data = {};\n }\n vNode.data.transition = this.transitionData;\n }\n\n /**\n * Re-applies the transition data to an old node, just in case it changed from the previous\n * render call. It also records the position of the node, to then calculate the move\n * transitions.\n *\n * @param vNode - The vNode to add the transition data to, and record his current position as\n * old.\n * @internal\n */\n protected syncOldNodes(vNode: TransitionVNode): void {\n // Synchronize transition data, in case it changed in the last frame.\n // We can trust data to be defined because each new node has the transition applied\n vNode.data!.transition = this.transitionData;\n this.recordOldPosition(vNode);\n }\n\n /**\n * Saves the position of the vNode in the map of old positions.\n *\n * @param vNode - The node to store its position.\n * @internal\n */\n protected recordOldPosition(vNode: TransitionVNode): void {\n this.oldPositions.set(vNode.elm, this.createRelativeBounds(vNode));\n }\n\n /**\n * Saves the position of the vNode in the map of new positions.\n *\n * @param vNode - The node to store its position.\n * @internal\n */\n protected recordNewPosition(vNode: TransitionVNode): void {\n this.newPositions.set(vNode.elm, this.createRelativeBounds(vNode));\n }\n\n /**\n * Creates an object containing the position of the vNode relative to its container.\n *\n * @param vNode - The virtual node to store its relative position.\n * @returns The relative bounds of the provided virtual node.\n * @internal\n */\n protected createRelativeBounds(vNode: TransitionVNode): Bounds {\n const { left, top, width, height } = vNode.elm.getBoundingClientRect();\n const { left: wrapperLeft, top: wrapperTop } = this.wrapperBounds;\n return {\n left: left - wrapperLeft,\n top: top - wrapperTop,\n width,\n height\n };\n }\n\n /**\n * Splits the children of the component into three groups:\n * - Nodes that are leaving.\n * - Nodes that are entering.\n * - Nodes that stay.\n *\n * This is then used to apply the stagger in the correct order: leave -\\> move -\\> enter.\n *\n * @returns The children nodes, divided in different groups depending on if they are leaving,\n * staying or entering.\n * @internal\n */\n protected getNodesByTransitionType(): TransitionTypeNodes {\n const leave = this.oldChildren.filter(child => !this.newPositions.has(child.elm));\n const enter = this.newChildren.filter(child => !this.oldPositions.has(child.elm));\n const stay = this.oldChildren.filter(child => this.newPositions.has(child.elm));\n return {\n leavingNodes: leave,\n enteringNodes: enter,\n stayingNodes: stay\n };\n }\n\n /**\n * Applies an incremental delay to the virtual node element.\n *\n * @param vNode - The virtual node to apply the stagger to.\n * @internal\n */\n protected applyStagger(vNode: TransitionVNode): void {\n vNode.elm.style.transitionDelay = this.getNextTransitionDelay();\n }\n\n /**\n * Disables listening to click events in a virtual node element.\n *\n * @remarks This is done to avoid letting the user click elements that are performing the moving\n * animation to leave the DOM but are still rendered.\n *\n * @param vNode - The virtual node to disable listening to click events.\n * @internal\n */\n protected disableClickingEvents(vNode: TransitionVNode): void {\n vNode.elm.style.pointerEvents = 'none';\n }\n\n /**\n * Calculates the next transition delay property, incrementing the `staggerCounter` property\n * each time it is called.\n *\n * @returns The value for the next element `style.transitionDelay` property.\n * @internal\n */\n protected getNextTransitionDelay(): string {\n return `${this.staggerCounter++ * this.staggering}ms`;\n }\n\n /**\n * Calculates if the virtual node should have a move transition. If its has it, then it\n * applies it immediately using the `style.transform`.\n *\n * @param vNode - The virtual node to calculate if it should have a move transition.\n * @returns True when a move transition was applied to the virtual node.\n * @internal\n */\n protected applyTranslation(vNode: TransitionVNode): boolean {\n const oldPosition = this.oldPositions.get(vNode.elm as Element)!;\n const newPosition = this.newPositions.get(vNode.elm as Element)!;\n const dx = oldPosition.left - newPosition.left;\n const dy = oldPosition.top - newPosition.top;\n if (dx !== 0 || dy !== 0) {\n const style = vNode.elm.style;\n style.transform = `translate3d(${dx}px,${dy}px,0)`;\n style.transitionDuration = '0s';\n return true;\n }\n return false;\n }\n\n /**\n * Generates a function to start the moving animations to each node that it needs them with the\n * provided stagger.\n *\n * @param moveStagger - A list containing the delay to add to each node.\n * @returns A function that starts the moving animation with the provided stagger to a single\n * virtual node.\n * @internal\n */\n protected startMoveAnimation(\n moveStagger: string[]\n ): (vNode: TransitionVNode, index: number) => void {\n return (vNode, index) => {\n const element = vNode.elm;\n const style = element.style;\n element.classList.add(this.moveClassName);\n style.transform = style.transitionDuration = '';\n style.transitionDelay = moveStagger[index];\n const cleanMoveTransition = (event?: TransitionEvent): void => {\n if (!event || (event.target === element && /transform$/.test(event.propertyName))) {\n element.removeEventListener('transitionend', cleanMoveTransition);\n element.style.transitionDelay = '';\n element.classList.remove(this.moveClassName);\n this.pendingCleanupMoveCallbacks.delete(element);\n }\n };\n this.pendingCleanupMoveCallbacks.set(element, cleanMoveTransition);\n element.addEventListener('transitionend', cleanMoveTransition);\n };\n }\n}\n\n/**\n * Contains arrays of nodes, splitted by the action they should have.\n */\ninterface TransitionTypeNodes {\n leavingNodes: TransitionVNode[];\n stayingNodes: TransitionVNode[];\n enteringNodes: TransitionVNode[];\n}\n\n/**\n * Safe transition version of the VNode type, with the required non optional properties.\n */\ninterface TransitionVNode extends VNode {\n elm: HTMLElement;\n tag: string;\n key: string;\n}\n\n/**\n * Vue's VNode {@link https://vuejs.org/v2/api/#transition | transition} data props and events.\n */\ninterface TransitionData {\n name?: string;\n appear?: boolean;\n css?: boolean;\n type?: 'transition' | 'animation'; // Unused\n mode?: 'out-in' | 'in-out'; // Unused\n duration?: number;\n enterClass?: string;\n leaveClass?: string;\n appearClass?: string;\n enterToClass?: string;\n leaveToClass?: string;\n appearToClass?: string;\n enterActiveClass?: string;\n leaveActiveClass?: string;\n appearActiveClass?: string;\n beforeEnter?: TransitionHook;\n enter?: TransitionHook;\n afterEnter?: TransitionHook;\n beforeLeave?: TransitionHook;\n leave?: TransitionHook;\n afterLeave?: TransitionHook;\n}\n\n/**\n * A function that receives an HTMLElement. Used to perform actions when the different phases\n * of Vue transitions happens.\n */\ntype TransitionHook = (element: HTMLElement) => void;\n\n/**\n * Represents the dimensions and positions of an element.\n */\ninterface Bounds {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;AACA;;;;;;AAOA;IAAuD,6CAAG;IAA1D;;KAkYC;IA5VC,sBAAc,oDAAa;;;;;;;aAA3B;;YACE,OAAO,MAAA,IAAI,CAAC,SAAS,mCAAO,IAAI,CAAC,IAAI,UAAO,CAAC;SAC9C;;;OAAA;IAcD,sBAAc,qDAAc;;;;;;;;;;;;;aAA5B;YACE,IAAM,cAAc,kCAAwB,IAAI,CAAC,MAAM,GAAK,IAAI,CAAC,MAAM,GAAK,IAAI,CAAC,UAAU,CAAE,CAAC;YAE9F,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACrF,cAAc,CAAC,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YACnF,cAAc,CAAC,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YAEnF,OAAO,cAAc,CAAC;SACvB;;;OAAA;IAsCD,gDAAY,GAAZ;;;QAGE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,OAAO,EAAE,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,IAAI,OAAO,EAAE,CAAC;QAClC,IAAI,CAAC,2BAA2B,GAAG,IAAI,OAAO,EAAuB,CAAC;QACtE,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;KACzB;IAED,0CAAM,GAAN,UAAO,aAA4B;;QACjC,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;;QAExB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;;QAEpC,IAAI,CAAC,WAAW,GAAG,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,mCAAI,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;;QAGnF,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACjD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE5C,OAAO,aAAa,CAClB,IAAI,CAAC,GAAG,EACR,EAAE,WAAW,EAAE,+BAA+B,EAAE,EAChD,IAAI,CAAC,WAAW,CACjB,CAAC;KACH;IAED,2CAAO,GAAP;QACE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC7C;IAED,gDAAY,GAAZ;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;KACvD;IAED,2CAAO,GAAP;QAAA,iBAiBC;QAhBC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QACtD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC3C,IAAA,KAAgD,IAAI,CAAC,wBAAwB,EAAE,EAA7E,YAAY,kBAAA,EAAE,YAAY,kBAAA,EAAE,aAAa,mBAAoC,CAAC;QAEtF,YAAY,CAAC,OAAO,CAAC,UAAA,KAAK;YACxB,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACzB,KAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;SACnC,CAAC,CAAC;QACH,IAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACjE,IAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACpE,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;;QAGzC,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAEtC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;KAC9D;;;;;;;;;;IAWS,0DAAsB,GAAhC,UAAiC,cAAqC;QAAtE,iBAgBC;QAhBgC,+BAAA,EAAA,qBAAqC;QACpE,OAAO,UAAA,OAAO;YACN,IAAA,KAA+B,KAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAE,EAA5D,GAAG,SAAA,EAAE,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAoC,CAAC;YAC/D,IAAA,KAA4B,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAA1D,SAAS,eAAA,EAAE,UAAU,gBAAqC,CAAC;YACnE,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC5B,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;YAC5B,KAAK,CAAC,GAAG,GAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,OAAI,CAAC;YAC/C,KAAK,CAAC,IAAI,GAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,OAAI,CAAC;YAClD,KAAK,CAAC,KAAK,GAAM,KAAK,OAAI,CAAC;YAC3B,KAAK,CAAC,MAAM,GAAM,MAAM,OAAI,CAAC;YAC7B,KAAI,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAClC,KAAI,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAClC,IAAM,eAAe,GAAG,KAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACtE,eAAe,aAAf,eAAe,uBAAf,eAAe,EAAI,CAAC;YACpB,cAAc,CAAC,OAAO,CAAC,CAAC;SACzB,CAAC;KACH;;;;;;;;IASS,0DAAsB,GAAhC,UAAiC,cAAqC;QAArC,+BAAA,EAAA,qBAAqC;QACpE,OAAO,UAAA,OAAO;YACZ,OAAO,CAAC,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;YACnC,cAAc,CAAC,OAAO,CAAC,CAAC;SACzB,CAAC;KACH;;;;;;;;;IAUS,0DAAsB,GAAhC,UAAiC,KAAY;;QAE3C,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;KACnC;;;;;;;IAQS,qDAAiB,GAA3B,UAA4B,KAAsB;QAChD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACf,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;SACjB;QACD,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC;KAC7C;;;;;;;;;;IAWS,gDAAY,GAAtB,UAAuB,KAAsB;;;QAG3C,KAAK,CAAC,IAAK,CAAC,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC/B;;;;;;;IAQS,qDAAiB,GAA3B,UAA4B,KAAsB;QAChD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;KACpE;;;;;;;IAQS,qDAAiB,GAA3B,UAA4B,KAAsB;QAChD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;KACpE;;;;;;;;IASS,wDAAoB,GAA9B,UAA+B,KAAsB;QAC7C,IAAA,KAA+B,KAAK,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAA9D,IAAI,UAAA,EAAE,GAAG,SAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAsC,CAAC;QACjE,IAAA,KAAyC,IAAI,CAAC,aAAa,EAAnD,WAAW,UAAA,EAAO,UAAU,SAAuB,CAAC;QAClE,OAAO;YACL,IAAI,EAAE,IAAI,GAAG,WAAW;YACxB,GAAG,EAAE,GAAG,GAAG,UAAU;YACrB,KAAK,OAAA;YACL,MAAM,QAAA;SACP,CAAC;KACH;;;;;;;;;;;;;IAcS,4DAAwB,GAAlC;QAAA,iBASC;QARC,IAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,CAAC,KAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAA,CAAC,CAAC;QAClF,IAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,CAAC,KAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAA,CAAC,CAAC;QAClF,IAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAA,CAAC,CAAC;QAChF,OAAO;YACL,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,IAAI;SACnB,CAAC;KACH;;;;;;;IAQS,gDAAY,GAAtB,UAAuB,KAAsB;QAC3C,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;KACjE;;;;;;;;;;IAWS,yDAAqB,GAA/B,UAAgC,KAAsB;QACpD,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;KACxC;;;;;;;;IASS,0DAAsB,GAAhC;QACE,OAAU,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,UAAU,OAAI,CAAC;KACvD;;;;;;;;;IAUS,oDAAgB,GAA1B,UAA2B,KAAsB;QAC/C,IAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAc,CAAE,CAAC;QACjE,IAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAc,CAAE,CAAC;QACjE,IAAM,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QAC/C,IAAM,EAAE,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC;QAC7C,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;YACxB,IAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;YAC9B,KAAK,CAAC,SAAS,GAAG,iBAAe,EAAE,WAAM,EAAE,UAAO,CAAC;YACnD,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;YAChC,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;KACd;;;;;;;;;;IAWS,sDAAkB,GAA5B,UACE,WAAqB;QADvB,iBAoBC;QAjBC,OAAO,UAAC,KAAK,EAAE,KAAK;YAClB,IAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC;YAC1B,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC5B,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;YAC1C,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,kBAAkB,GAAG,EAAE,CAAC;YAChD,KAAK,CAAC,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;YAC3C,IAAM,mBAAmB,GAAG,UAAC,KAAuB;gBAClD,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,KAAK,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE;oBACjF,OAAO,CAAC,mBAAmB,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;oBAClE,OAAO,CAAC,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;oBACnC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;oBAC7C,KAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;iBAClD;aACF,CAAC;YACF,KAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;YACnE,OAAO,CAAC,gBAAgB,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;SAChE,CAAC;KACH;IA1XD;QADC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;2DACF;IAOrB;QADC,IAAI,EAAE;gEACmB;IAQ1B;QADC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;0DACL;IAQpB;QADC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;iEACK;IA9BR,yBAAyB;QAD7C,SAAS;OACW,yBAAyB,CAkY7C;IAAD,gCAAC;CAAA,CAlYsD,GAAG;;;;"}
@@ -26,11 +26,11 @@ __vue_render__._withStripped = true;
26
26
  /* style */
27
27
  var __vue_inject_styles__ = function (inject) {
28
28
  if (!inject) { return }
29
- inject("data-v-4c4c4550_0", { source: ".x-translate-from-left--enter-active[data-v-4c4c4550], .x-translate-from-left--leave-active[data-v-4c4c4550] {\n transition: transform 0.3s ease-out;\n}\n.x-translate-from-left--leave-to[data-v-4c4c4550], .x-translate-from-left--enter[data-v-4c4c4550] {\n transform: translateX(-100%);\n}", map: undefined, media: undefined });
29
+ inject("data-v-cf07d6f6_0", { source: ".x-translate-from-left--enter-active[data-v-cf07d6f6], .x-translate-from-left--leave-active[data-v-cf07d6f6] {\n transition: transform 0.3s ease-out;\n}\n.x-translate-from-left--leave-to[data-v-cf07d6f6], .x-translate-from-left--enter[data-v-cf07d6f6] {\n transform: translateX(-100%);\n}", map: undefined, media: undefined });
30
30
 
31
31
  };
32
32
  /* scoped */
33
- var __vue_scope_id__ = "data-v-4c4c4550";
33
+ var __vue_scope_id__ = "data-v-cf07d6f6";
34
34
  /* module identifier */
35
35
  var __vue_module_identifier__ = undefined;
36
36
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"translate-from-left.vue.js","sources":["../../../../src/components/animations/translate-from-left.vue"],"sourcesContent":["<template>\n <transition v-on=\"$listeners\" appear name=\"x-translate-from-left-\">\n <!-- @slot (Required) to add content to the transition -->\n <slot />\n </transition>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n\n /**\n * Renders a transition wrapping the element passed in the default slot and moving it to its\n * desired position.\n *\n * @public\n */\n @Component\n export default class TranslateFromLeft extends Vue {}\n</script>\n\n<style lang=\"scss\" scoped>\n .x-translate-from-left {\n &--enter-active,\n &--leave-active {\n transition: transform 0.3s ease-out;\n }\n\n &--leave-to,\n &--enter {\n transform: translateX(-100%);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n# Example\n\nThe `TranslateFromRight` component is intended to be used as animation to wrap an element with v-if\nor v-show and animate it. The animation translates the item from/to left 100%.\n\nWrapping a component:\n\n```vue\n<TranslateFromLeft>\n <ComponentOrElement v-if=\"open\"/>\n</TranslateFromLeft>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"translate-from-left.vue.js","sources":["../../../../src/components/animations/translate-from-left.vue"],"sourcesContent":["<template>\n <transition v-on=\"$listeners\" appear name=\"x-translate-from-left-\">\n <!-- @slot (Required) to add content to the transition -->\n <slot />\n </transition>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n\n /**\n * Renders a transition wrapping the element passed in the default slot and moving it to its\n * desired position.\n *\n * @public\n */\n @Component\n export default class TranslateFromLeft extends Vue {}\n</script>\n\n<style lang=\"scss\" scoped>\n .x-translate-from-left {\n &--enter-active,\n &--leave-active {\n transition: transform 0.3s ease-out;\n }\n\n &--leave-to,\n &--enter {\n transform: translateX(-100%);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThe `TranslateFromRight` component is intended to be used as animation to wrap an element with v-if\nor v-show and animate it. The animation translates the item from/to left 100%.\n\nWrapping a component:\n\n```vue\n<TranslateFromLeft>\n <ComponentOrElement v-if=\"open\"/>\n</TranslateFromLeft>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -26,11 +26,11 @@ __vue_render__._withStripped = true;
26
26
  /* style */
27
27
  var __vue_inject_styles__ = function (inject) {
28
28
  if (!inject) { return }
29
- inject("data-v-38a51aa9_0", { source: ".x-translate-from-right--enter-active[data-v-38a51aa9], .x-translate-from-right--leave-active[data-v-38a51aa9] {\n transition: transform 0.3s ease-out;\n}\n.x-translate-from-right--leave-to[data-v-38a51aa9], .x-translate-from-right--enter[data-v-38a51aa9] {\n transform: translateX(100%);\n}", map: undefined, media: undefined });
29
+ inject("data-v-d9420f60_0", { source: ".x-translate-from-right--enter-active[data-v-d9420f60], .x-translate-from-right--leave-active[data-v-d9420f60] {\n transition: transform 0.3s ease-out;\n}\n.x-translate-from-right--leave-to[data-v-d9420f60], .x-translate-from-right--enter[data-v-d9420f60] {\n transform: translateX(100%);\n}", map: undefined, media: undefined });
30
30
 
31
31
  };
32
32
  /* scoped */
33
- var __vue_scope_id__ = "data-v-38a51aa9";
33
+ var __vue_scope_id__ = "data-v-d9420f60";
34
34
  /* module identifier */
35
35
  var __vue_module_identifier__ = undefined;
36
36
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"translate-from-right.vue.js","sources":["../../../../src/components/animations/translate-from-right.vue"],"sourcesContent":["<template>\n <transition v-on=\"$listeners\" appear name=\"x-translate-from-right-\">\n <!-- @slot (Required) to add content to the transition -->\n <slot />\n </transition>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n\n /**\n * Renders a transition wrapping the element passed in the default slot and moving it to its\n * desired position.\n *\n * @public\n */\n @Component\n export default class TranslateFromRight extends Vue {}\n</script>\n\n<style lang=\"scss\" scoped>\n .x-translate-from-right {\n &--enter-active,\n &--leave-active {\n transition: transform 0.3s ease-out;\n }\n\n &--leave-to,\n &--enter {\n transform: translateX(100%);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n# Example\n\nThe `TranslateFromRight` component is intended to be used as animation to wrap an element with v-if\nor v-show and animate it. The animation translates the item from/to right 100%.\n\nUsed wrapping a component:\n\n```vue\n<TranslateFromRight>\n <ComponentOrElement v-if=\"open\"/>\n</TranslateFromRight>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"translate-from-right.vue.js","sources":["../../../../src/components/animations/translate-from-right.vue"],"sourcesContent":["<template>\n <transition v-on=\"$listeners\" appear name=\"x-translate-from-right-\">\n <!-- @slot (Required) to add content to the transition -->\n <slot />\n </transition>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component } from 'vue-property-decorator';\n\n /**\n * Renders a transition wrapping the element passed in the default slot and moving it to its\n * desired position.\n *\n * @public\n */\n @Component\n export default class TranslateFromRight extends Vue {}\n</script>\n\n<style lang=\"scss\" scoped>\n .x-translate-from-right {\n &--enter-active,\n &--leave-active {\n transition: transform 0.3s ease-out;\n }\n\n &--leave-to,\n &--enter {\n transform: translateX(100%);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThe `TranslateFromRight` component is intended to be used as animation to wrap an element with v-if\nor v-show and animate it. The animation translates the item from/to right 100%.\n\nUsed wrapping a component:\n\n```vue\n<TranslateFromRight>\n <ComponentOrElement v-if=\"open\"/>\n</TranslateFromRight>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -203,11 +203,11 @@ __vue_render__._withStripped = true;
203
203
  /* style */
204
204
  var __vue_inject_styles__ = function (inject) {
205
205
  if (!inject) { return }
206
- inject("data-v-7a98ac51_0", { source: ".x-dropdown[data-v-7a98ac51] {\n position: relative;\n}\n.x-dropdown__items-list[data-v-7a98ac51] {\n z-index: 1;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0;\n top: calc(100% + var(--x-size-gap-dropdown-default, 0));\n}", map: undefined, media: undefined });
206
+ inject("data-v-12a3cc4e_0", { source: ".x-dropdown[data-v-12a3cc4e] {\n position: relative;\n}\n.x-dropdown__items-list[data-v-12a3cc4e] {\n z-index: 1;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0;\n top: calc(100% + var(--x-size-gap-dropdown-default, 0));\n}", map: undefined, media: undefined });
207
207
 
208
208
  };
209
209
  /* scoped */
210
- var __vue_scope_id__ = "data-v-7a98ac51";
210
+ var __vue_scope_id__ = "data-v-12a3cc4e";
211
211
  /* module identifier */
212
212
  var __vue_module_identifier__ = undefined;
213
213
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"base-dropdown.vue.js","sources":["../../../src/components/base-dropdown.vue"],"sourcesContent":["<template>\n <div\n @keydown=\"updateSearchBuffer\"\n @keydown.down.prevent=\"highlightNextItem\"\n @keydown.up.prevent=\"highlightPreviousItem\"\n :class=\"dropdownCSSClasses\"\n class=\"x-dropdown\"\n >\n <button\n @click=\"toggle\"\n @keydown.up.down.prevent.stop=\"open\"\n aria-haspopup=\"listbox\"\n class=\"x-dropdown__toggle\"\n data-test=\"dropdown-toggle\"\n >\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 {string|number|Identifiable} item - The item data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-if=\"$scopedSlots.toggle\" :isOpen=\"isOpen\" :item=\"value\" name=\"toggle\">\n {{ value }}\n </slot>\n <slot v-else :item=\"value\" name=\"item\">{{ value }}</slot>\n </button>\n\n <component :is=\"animation\">\n <ul\n v-if=\"isOpen\"\n @keydown.end=\"highlightLastItem\"\n @keydown.esc=\"close\"\n @keydown.home=\"highlightFirstItem\"\n :aria-expanded=\"isOpen.toString()\"\n class=\"x-dropdown__items-list\"\n role=\"listbox\"\n >\n <li v-for=\"(item, index) in items\" :key=\"item.id || item\" class=\"x-dropdown__list-item\">\n <button\n ref=\"itemButtons\"\n @click=\"emitSelectedItemChanged(item)\"\n :aria-selected=\"(index === highlightedItemIndex).toString()\"\n :aria-current=\"(item === value).toString()\"\n :class=\"itemsCSSClasses[index]\"\n class=\"x-dropdown__item\"\n data-test=\"dropdown-item\"\n role=\"option\"\n tabindex=\"-1\"\n >\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 {string|number|Identifiable} item - Item 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\n :isHighlighted=\"index === highlightedItemIndex\"\n :isSelected=\"item === value\"\n :item=\"item\"\n name=\"item\"\n >\n {{ item }}\n </slot>\n </button>\n </li>\n </ul>\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Identifiable } from '@empathyco/x-types';\n import { Component, Prop, Watch } from 'vue-property-decorator';\n import Vue from 'vue';\n import { normalizeString } from '../utils/normalize';\n import { isInRange } from '../utils/number';\n import { debounce } from '../utils/debounce';\n import { VueCSSClasses } from '../utils/types';\n import { NoElement } from './no-element';\n\n type DropdownItem = string | number | Identifiable;\n\n /**\n * Dropdown component that mimics a Select element behavior, but with the option\n * to customize the toggle button and each item contents.\n *\n * @public\n */\n @Component({\n components: {\n NoElement\n },\n model: {\n event: 'change'\n }\n })\n export default class BaseDropdown extends Vue {\n /**\n * List of items to display.\n *\n * @public\n */\n @Prop({ required: true })\n public items!: DropdownItem[];\n\n /**\n * The selected item.\n *\n * @public\n */\n @Prop({ required: true })\n public value!: DropdownItem | null;\n\n /**\n * Animation component to use for expanding the dropdown. This is a single element animation,\n * so only `<transition>` components are allowed.\n *\n * @public\n */\n @Prop({ default: 'NoElement' })\n public animation!: typeof Vue | string;\n\n /**\n * Time to wait without receiving any keystroke before resetting the items search query.\n *\n * @public\n */\n @Prop({ default: 1000 })\n public searchTimeoutMs!: number;\n\n public $refs!: {\n /** Array containing the dropdown list buttons HTMLElements. */\n itemButtons: HTMLButtonElement[];\n };\n\n /**\n * Property to track whether the dropdown is expanded and displaying the full\n * list of items, or closed.\n *\n * @internal\n */\n protected isOpen = false;\n\n /**\n * Index of the element that has the focus in the list. -1 means no element has focus.\n *\n * @internal\n */\n protected highlightedItemIndex = -1;\n\n /**\n * String to search for the first element that starts with it.\n *\n * @internal\n */\n protected searchBuffer = '';\n\n /**\n * Resets the search buffer after a certain time has passed.\n *\n * @internal\n */\n protected restartResetSearchTimeout!: () => void;\n\n /**\n * Dynamic CSS classes to add to the dropdown root element.\n *\n * @returns An object containing the CSS classes to add to the dropdown root element.\n * @internal\n */\n protected get dropdownCSSClasses(): VueCSSClasses {\n return {\n 'x-dropdown--is-open': this.isOpen\n };\n }\n\n /**\n * Dynamic CSS classes to add to each one of the items.\n *\n * @returns An object containing the CSS classes to add to each item.\n * @internal\n */\n protected get itemsCSSClasses(): VueCSSClasses[] {\n return this.items.map((item, index) => {\n return {\n 'x-dropdown__item--is-selected': this.value === item,\n 'x-dropdown__item--is-highlighted': this.highlightedItemIndex === index\n };\n });\n }\n\n /**\n * If the dropdown is destroyed before removing the document listeners, it ensures that they\n * are removed too.\n *\n * @internal\n */\n protected beforeDestroy(): void {\n this.removeDocumentCloseListeners();\n }\n\n /**\n * Opens the dropdown.\n *\n * @internal\n */\n protected open(): void {\n this.isOpen = true;\n }\n\n /**\n * Closes the dropdown.\n *\n * @internal\n */\n protected close(): void {\n this.isOpen = false;\n }\n\n /**\n * If the dropdown is opened it closes it. If it is closed it opens it.\n *\n * @internal\n */\n protected toggle(): void {\n this.isOpen = !this.isOpen;\n }\n\n /**\n * Emits the event that the selected item has changed.\n *\n * @param item - The new selected item.\n * @internal\n */\n protected emitSelectedItemChanged(item: DropdownItem): void {\n this.$emit('change', item);\n this.close();\n }\n\n /**\n * Highlights the item after the one that is currently highlighted.\n *\n * @internal\n */\n protected highlightNextItem(): void {\n this.open();\n this.highlightedItemIndex = (this.highlightedItemIndex + 1) % this.items.length;\n }\n\n /**\n * Highlights the item before the one that is currently highlighted.\n *\n * @internal\n */\n protected highlightPreviousItem(): void {\n this.open();\n this.highlightedItemIndex =\n this.highlightedItemIndex > 0 ? this.highlightedItemIndex - 1 : this.items.length - 1;\n }\n\n /**\n * Highlights the first of the provided items.\n *\n * @internal\n */\n protected highlightFirstItem(): void {\n this.highlightedItemIndex = 0;\n }\n\n /**\n * Highlights the last of the provided items.\n *\n * @internal\n */\n protected highlightLastItem(): void {\n this.highlightedItemIndex = this.items.length - 1;\n }\n\n /**\n * Updates the variable that is used to search in the filters.\n *\n * @param event - The event coming from the user typing.\n * @internal\n */\n protected updateSearchBuffer(event: KeyboardEvent): void {\n if (/^\\w$/.test(event.key)) {\n const key = event.key;\n this.searchBuffer += key;\n this.restartResetSearchTimeout();\n }\n }\n\n /**\n * Highlights the item that matches the search buffer. To do so it checks the list buttons\n * text content. It highlights items folowing this priority:\n * - If an element is already highlighted, it starts searching from that element.\n * - If no element is found starting from the previously highlighted, it returns the first one.\n * - If no element is found matching the search query it highlights the first element.\n *\n * @param search - The search string to find in the HTML.\n * @internal\n */\n @Watch('searchBuffer')\n protected highlightMatchingItem(search: string): void {\n if (search) {\n const normalizedSearch = normalizeString(search);\n const matchingIndices = this.$refs.itemButtons.reduce<number[]>(\n (matchingIndices, button, index) => {\n const safeButtonWordCharacters = button.textContent!.replace(/[^\\w]/g, '');\n const normalizedButtonText = normalizeString(safeButtonWordCharacters);\n if (normalizedButtonText.startsWith(normalizedSearch)) {\n matchingIndices.push(index);\n }\n return matchingIndices;\n },\n []\n );\n this.highlightedItemIndex =\n // First matching item starting to search from the current highlighted element\n matchingIndices.find(index => index >= this.highlightedItemIndex) ??\n // First matching item\n matchingIndices[0] ??\n // First item\n 0;\n }\n }\n\n /**\n * Resets the search buffer.\n *\n * @internal\n */\n protected resetSearch(): void {\n this.searchBuffer = '';\n }\n\n /** Updates the debounced function to reset the search.\n *\n * @param searchTimeoutMs - The new milliseconds that have to pass without typing before\n * resetting the search.\n * @internal\n */\n @Watch('searchTimeoutMs', { immediate: true })\n protected updateSearchTimeout(searchTimeoutMs: number): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.restartResetSearchTimeout = debounce(this.resetSearch, searchTimeoutMs);\n }\n\n /**\n * Focuses the DOM element which matches the `highlightedItemIndex`.\n *\n * @param highlightedItemIndex - The index of the HTML element to focus.\n * @internal\n */\n @Watch('highlightedItemIndex', { immediate: true })\n protected focusHighlightedItem(highlightedItemIndex: number): void {\n this.$nextTick(() => {\n if (this.$refs.itemButtons && isInRange(highlightedItemIndex, [0, this.items.length - 1])) {\n const newItem = this.$refs.itemButtons[this.highlightedItemIndex];\n newItem.focus();\n }\n });\n }\n\n /**\n * When the dropdown is open it sets the focused element to the one that is selected.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n * @internal\n */\n @Watch('isOpen')\n protected updateHighlightedItem(isOpen: boolean): void {\n if (isOpen) {\n this.highlightedItemIndex = this.value === null ? 0 : this.items.indexOf(this.value);\n } else {\n this.highlightedItemIndex = -1;\n }\n }\n\n /**\n * Adds and removes listeners to close the dropdown when it loses the focus.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n * @internal\n */\n @Watch('isOpen')\n protected syncCloseListeners(isOpen: boolean): void {\n /*\n * Because there is an issue with Firefox in macOS and Safari that doesn't focus the target\n * element of the `mousedown` events, the `focusout` event `relatedTarget` property can't be\n * used to detect whether or not the user has blurred the dropdown. The hack here is to use\n * document listeners that have the side effect of losing the focus.\n */\n if (isOpen) {\n this.addDocumentCloseListeners();\n } else {\n this.removeDocumentCloseListeners();\n }\n }\n\n /**\n * Adds listeners to the document element to detect if the focus has moved out from the\n * dropdown.\n *\n * @internal\n */\n protected addDocumentCloseListeners(): void {\n /* eslint-disable @typescript-eslint/unbound-method */\n document.addEventListener('mousedown', this.closeIfEventIsOutOfDropdown);\n document.addEventListener('touchstart', this.closeIfEventIsOutOfDropdown);\n document.addEventListener('focusin', this.closeIfEventIsOutOfDropdown);\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n\n /**\n * Removes the listeners of the document element to detect if the focus has moved out from the\n * dropdown.\n *\n * @internal\n */\n protected removeDocumentCloseListeners(): void {\n /* eslint-disable @typescript-eslint/unbound-method */\n document.removeEventListener('mousedown', this.closeIfEventIsOutOfDropdown);\n document.removeEventListener('touchstart', this.closeIfEventIsOutOfDropdown);\n document.removeEventListener('focusin', this.closeIfEventIsOutOfDropdown);\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n\n /**\n * Closes the dropdown if the passed event has happened on an element out of the dropdown.\n *\n * @param event - The event to check if it has happen out of the dropdown component.\n */\n protected closeIfEventIsOutOfDropdown(event: MouseEvent | TouchEvent | FocusEvent): void {\n if (!this.$el.contains(event.target as HTMLElement)) {\n this.close();\n }\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-dropdown {\n position: relative;\n\n &__items-list {\n z-index: 1;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0;\n top: calc(100% + var(--x-size-gap-dropdown-default, 0));\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n# Example\n\nThe `Dropdown` component is a simple yet customizable select component. The component needs to work\nthe list of items available to select, which are passed using the `items` prop, and the selected\nitem, which is passed in using the `value` prop.\n\nThe supported items must be an array that can contain unique strings, unique numbers, or objects\nwith a unique `id` property.\n\nThe content of each item can be customized using the `item` slot, which apart from the data of the\nitem, it also receives via prop if the element is selected or highlighted.\n\nThere `toggle` slot can be used to customize the button that opens the dropdown. If this is not\nprovided, the `item` slot will be used for that.\n\n```vue\n<template>\n <BaseDropdown :items=\"items\" v-model=\"value\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseDropdown>\n</template>\n\n<script>\n import { BaseDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'DropdownTest',\n components: {\n BaseDropdown\n },\n data() {\n return {\n items: ['a', 2, { id: '3' }],\n value: ['a']\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-dropdown.vue.js","sources":["../../../src/components/base-dropdown.vue"],"sourcesContent":["<template>\n <div\n @keydown=\"updateSearchBuffer\"\n @keydown.down.prevent=\"highlightNextItem\"\n @keydown.up.prevent=\"highlightPreviousItem\"\n :class=\"dropdownCSSClasses\"\n class=\"x-dropdown\"\n >\n <button\n @click=\"toggle\"\n @keydown.up.down.prevent.stop=\"open\"\n aria-haspopup=\"listbox\"\n class=\"x-dropdown__toggle\"\n data-test=\"dropdown-toggle\"\n >\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 {string|number|Identifiable} item - The item data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-if=\"$scopedSlots.toggle\" :isOpen=\"isOpen\" :item=\"value\" name=\"toggle\">\n {{ value }}\n </slot>\n <slot v-else :item=\"value\" name=\"item\">{{ value }}</slot>\n </button>\n\n <component :is=\"animation\">\n <ul\n v-if=\"isOpen\"\n @keydown.end=\"highlightLastItem\"\n @keydown.esc=\"close\"\n @keydown.home=\"highlightFirstItem\"\n :aria-expanded=\"isOpen.toString()\"\n class=\"x-dropdown__items-list\"\n role=\"listbox\"\n >\n <li v-for=\"(item, index) in items\" :key=\"item.id || item\" class=\"x-dropdown__list-item\">\n <button\n ref=\"itemButtons\"\n @click=\"emitSelectedItemChanged(item)\"\n :aria-selected=\"(index === highlightedItemIndex).toString()\"\n :aria-current=\"(item === value).toString()\"\n :class=\"itemsCSSClasses[index]\"\n class=\"x-dropdown__item\"\n data-test=\"dropdown-item\"\n role=\"option\"\n tabindex=\"-1\"\n >\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 {string|number|Identifiable} item - Item 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\n :isHighlighted=\"index === highlightedItemIndex\"\n :isSelected=\"item === value\"\n :item=\"item\"\n name=\"item\"\n >\n {{ item }}\n </slot>\n </button>\n </li>\n </ul>\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Identifiable } from '@empathyco/x-types';\n import { Component, Prop, Watch } from 'vue-property-decorator';\n import Vue from 'vue';\n import { normalizeString } from '../utils/normalize';\n import { isInRange } from '../utils/number';\n import { debounce } from '../utils/debounce';\n import { VueCSSClasses } from '../utils/types';\n import { NoElement } from './no-element';\n\n type DropdownItem = string | number | Identifiable;\n\n /**\n * Dropdown component that mimics a Select element behavior, but with the option\n * to customize the toggle button and each item contents.\n *\n * @public\n */\n @Component({\n components: {\n NoElement\n },\n model: {\n event: 'change'\n }\n })\n export default class BaseDropdown extends Vue {\n /**\n * List of items to display.\n *\n * @public\n */\n @Prop({ required: true })\n public items!: DropdownItem[];\n\n /**\n * The selected item.\n *\n * @public\n */\n @Prop({ required: true })\n public value!: DropdownItem | null;\n\n /**\n * Animation component to use for expanding the dropdown. This is a single element animation,\n * so only `<transition>` components are allowed.\n *\n * @public\n */\n @Prop({ default: 'NoElement' })\n public animation!: typeof Vue | string;\n\n /**\n * Time to wait without receiving any keystroke before resetting the items search query.\n *\n * @public\n */\n @Prop({ default: 1000 })\n public searchTimeoutMs!: number;\n\n public $refs!: {\n /** Array containing the dropdown list buttons HTMLElements. */\n itemButtons: HTMLButtonElement[];\n };\n\n /**\n * Property to track whether the dropdown is expanded and displaying the full\n * list of items, or closed.\n *\n * @internal\n */\n protected isOpen = false;\n\n /**\n * Index of the element that has the focus in the list. -1 means no element has focus.\n *\n * @internal\n */\n protected highlightedItemIndex = -1;\n\n /**\n * String to search for the first element that starts with it.\n *\n * @internal\n */\n protected searchBuffer = '';\n\n /**\n * Resets the search buffer after a certain time has passed.\n *\n * @internal\n */\n protected restartResetSearchTimeout!: () => void;\n\n /**\n * Dynamic CSS classes to add to the dropdown root element.\n *\n * @returns An object containing the CSS classes to add to the dropdown root element.\n * @internal\n */\n protected get dropdownCSSClasses(): VueCSSClasses {\n return {\n 'x-dropdown--is-open': this.isOpen\n };\n }\n\n /**\n * Dynamic CSS classes to add to each one of the items.\n *\n * @returns An object containing the CSS classes to add to each item.\n * @internal\n */\n protected get itemsCSSClasses(): VueCSSClasses[] {\n return this.items.map((item, index) => {\n return {\n 'x-dropdown__item--is-selected': this.value === item,\n 'x-dropdown__item--is-highlighted': this.highlightedItemIndex === index\n };\n });\n }\n\n /**\n * If the dropdown is destroyed before removing the document listeners, it ensures that they\n * are removed too.\n *\n * @internal\n */\n protected beforeDestroy(): void {\n this.removeDocumentCloseListeners();\n }\n\n /**\n * Opens the dropdown.\n *\n * @internal\n */\n protected open(): void {\n this.isOpen = true;\n }\n\n /**\n * Closes the dropdown.\n *\n * @internal\n */\n protected close(): void {\n this.isOpen = false;\n }\n\n /**\n * If the dropdown is opened it closes it. If it is closed it opens it.\n *\n * @internal\n */\n protected toggle(): void {\n this.isOpen = !this.isOpen;\n }\n\n /**\n * Emits the event that the selected item has changed.\n *\n * @param item - The new selected item.\n * @internal\n */\n protected emitSelectedItemChanged(item: DropdownItem): void {\n this.$emit('change', item);\n this.close();\n }\n\n /**\n * Highlights the item after the one that is currently highlighted.\n *\n * @internal\n */\n protected highlightNextItem(): void {\n this.open();\n this.highlightedItemIndex = (this.highlightedItemIndex + 1) % this.items.length;\n }\n\n /**\n * Highlights the item before the one that is currently highlighted.\n *\n * @internal\n */\n protected highlightPreviousItem(): void {\n this.open();\n this.highlightedItemIndex =\n this.highlightedItemIndex > 0 ? this.highlightedItemIndex - 1 : this.items.length - 1;\n }\n\n /**\n * Highlights the first of the provided items.\n *\n * @internal\n */\n protected highlightFirstItem(): void {\n this.highlightedItemIndex = 0;\n }\n\n /**\n * Highlights the last of the provided items.\n *\n * @internal\n */\n protected highlightLastItem(): void {\n this.highlightedItemIndex = this.items.length - 1;\n }\n\n /**\n * Updates the variable that is used to search in the filters.\n *\n * @param event - The event coming from the user typing.\n * @internal\n */\n protected updateSearchBuffer(event: KeyboardEvent): void {\n if (/^\\w$/.test(event.key)) {\n const key = event.key;\n this.searchBuffer += key;\n this.restartResetSearchTimeout();\n }\n }\n\n /**\n * Highlights the item that matches the search buffer. To do so it checks the list buttons\n * text content. It highlights items folowing this priority:\n * - If an element is already highlighted, it starts searching from that element.\n * - If no element is found starting from the previously highlighted, it returns the first one.\n * - If no element is found matching the search query it highlights the first element.\n *\n * @param search - The search string to find in the HTML.\n * @internal\n */\n @Watch('searchBuffer')\n protected highlightMatchingItem(search: string): void {\n if (search) {\n const normalizedSearch = normalizeString(search);\n const matchingIndices = this.$refs.itemButtons.reduce<number[]>(\n (matchingIndices, button, index) => {\n const safeButtonWordCharacters = button.textContent!.replace(/[^\\w]/g, '');\n const normalizedButtonText = normalizeString(safeButtonWordCharacters);\n if (normalizedButtonText.startsWith(normalizedSearch)) {\n matchingIndices.push(index);\n }\n return matchingIndices;\n },\n []\n );\n this.highlightedItemIndex =\n // First matching item starting to search from the current highlighted element\n matchingIndices.find(index => index >= this.highlightedItemIndex) ??\n // First matching item\n matchingIndices[0] ??\n // First item\n 0;\n }\n }\n\n /**\n * Resets the search buffer.\n *\n * @internal\n */\n protected resetSearch(): void {\n this.searchBuffer = '';\n }\n\n /** Updates the debounced function to reset the search.\n *\n * @param searchTimeoutMs - The new milliseconds that have to pass without typing before\n * resetting the search.\n * @internal\n */\n @Watch('searchTimeoutMs', { immediate: true })\n protected updateSearchTimeout(searchTimeoutMs: number): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.restartResetSearchTimeout = debounce(this.resetSearch, searchTimeoutMs);\n }\n\n /**\n * Focuses the DOM element which matches the `highlightedItemIndex`.\n *\n * @param highlightedItemIndex - The index of the HTML element to focus.\n * @internal\n */\n @Watch('highlightedItemIndex', { immediate: true })\n protected focusHighlightedItem(highlightedItemIndex: number): void {\n this.$nextTick(() => {\n if (this.$refs.itemButtons && isInRange(highlightedItemIndex, [0, this.items.length - 1])) {\n const newItem = this.$refs.itemButtons[this.highlightedItemIndex];\n newItem.focus();\n }\n });\n }\n\n /**\n * When the dropdown is open it sets the focused element to the one that is selected.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n * @internal\n */\n @Watch('isOpen')\n protected updateHighlightedItem(isOpen: boolean): void {\n if (isOpen) {\n this.highlightedItemIndex = this.value === null ? 0 : this.items.indexOf(this.value);\n } else {\n this.highlightedItemIndex = -1;\n }\n }\n\n /**\n * Adds and removes listeners to close the dropdown when it loses the focus.\n *\n * @param isOpen - True if the dropdown is open, false otherwise.\n * @internal\n */\n @Watch('isOpen')\n protected syncCloseListeners(isOpen: boolean): void {\n /*\n * Because there is an issue with Firefox in macOS and Safari that doesn't focus the target\n * element of the `mousedown` events, the `focusout` event `relatedTarget` property can't be\n * used to detect whether or not the user has blurred the dropdown. The hack here is to use\n * document listeners that have the side effect of losing the focus.\n */\n if (isOpen) {\n this.addDocumentCloseListeners();\n } else {\n this.removeDocumentCloseListeners();\n }\n }\n\n /**\n * Adds listeners to the document element to detect if the focus has moved out from the\n * dropdown.\n *\n * @internal\n */\n protected addDocumentCloseListeners(): void {\n /* eslint-disable @typescript-eslint/unbound-method */\n document.addEventListener('mousedown', this.closeIfEventIsOutOfDropdown);\n document.addEventListener('touchstart', this.closeIfEventIsOutOfDropdown);\n document.addEventListener('focusin', this.closeIfEventIsOutOfDropdown);\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n\n /**\n * Removes the listeners of the document element to detect if the focus has moved out from the\n * dropdown.\n *\n * @internal\n */\n protected removeDocumentCloseListeners(): void {\n /* eslint-disable @typescript-eslint/unbound-method */\n document.removeEventListener('mousedown', this.closeIfEventIsOutOfDropdown);\n document.removeEventListener('touchstart', this.closeIfEventIsOutOfDropdown);\n document.removeEventListener('focusin', this.closeIfEventIsOutOfDropdown);\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n\n /**\n * Closes the dropdown if the passed event has happened on an element out of the dropdown.\n *\n * @param event - The event to check if it has happen out of the dropdown component.\n */\n protected closeIfEventIsOutOfDropdown(event: MouseEvent | TouchEvent | FocusEvent): void {\n if (!this.$el.contains(event.target as HTMLElement)) {\n this.close();\n }\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-dropdown {\n position: relative;\n\n &__items-list {\n z-index: 1;\n list-style: none;\n position: absolute;\n padding: 0;\n margin: 0;\n top: calc(100% + var(--x-size-gap-dropdown-default, 0));\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThe `Dropdown` component is a simple yet customizable select component. The component needs to work\nthe list of items available to select, which are passed using the `items` prop, and the selected\nitem, which is passed in using the `value` prop.\n\nThe supported items must be an array that can contain unique strings, unique numbers, or objects\nwith a unique `id` property.\n\nThe content of each item can be customized using the `item` slot, which apart from the data of the\nitem, it also receives via prop if the element is selected or highlighted.\n\nThere `toggle` slot can be used to customize the button that opens the dropdown. If this is not\nprovided, the `item` slot will be used for that.\n\n```vue\n<template>\n <BaseDropdown :items=\"items\" v-model=\"value\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseDropdown>\n</template>\n\n<script>\n import { BaseDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'DropdownTest',\n components: {\n BaseDropdown\n },\n data() {\n return {\n items: ['a', 2, { id: '3' }],\n value: ['a']\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-event-button.vue.js","sources":["../../../src/components/base-event-button.vue"],"sourcesContent":["<template>\n <button v-on=\"$listeners\" @click=\"emitEvents\" data-test=\"event-button\">\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { XEvent, XEventsTypes } from '../wiring';\n\n /**\n * Component to be reused that renders a `<button>` with the logic of emitting events to the bus\n * on click. The events are passed as an object to prop {@link XEventsTypes | events}.\n * The keys are the event name and the values are the payload of each event. All events are\n * emitted with its respective payload. If any event doesn't need payload a `undefined` must be\n * passed as value.\n *\n * @public\n */\n @Component\n export default class BaseEventButton extends Vue {\n /**\n * (Required) A object where the keys are the {@link XEvent} and the values\n * are the payload of each event.\n *\n * @public\n */\n @Prop({ required: true })\n protected events!: Partial<XEventsTypes>;\n\n protected emitEvents(): void {\n Object.entries(this.events).forEach(([event, payload]) => {\n this.$x.emit(event as XEvent, payload, { target: this.$el as HTMLElement });\n });\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\n## Basic example\n\nThe event prop is required. It will render a <button></button> that emits the event passed as prop\nwith the value as payload on click:\n\n```vue\n<BaseEventButton :events=\"{ myEvent: payload }\" />\n```\n\nIf the event doesn't need payload then `undefined` must be passed:\n\n```vue\n<BaseEventButton :events=\"{ myEvent: undefined }\" />\n```\n\nIt can emit multiple events at the same time:\n\n```vue\n<BaseEventButton :events=\"{ myFirstEvent: payload1, mySecondEvent: payload2 }\" />\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-event-button.vue.js","sources":["../../../src/components/base-event-button.vue"],"sourcesContent":["<template>\n <button v-on=\"$listeners\" @click=\"emitEvents\" data-test=\"event-button\">\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </button>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { XEvent, XEventsTypes } from '../wiring';\n\n /**\n * Component to be reused that renders a `<button>` with the logic of emitting events to the bus\n * on click. The events are passed as an object to prop {@link XEventsTypes | events}.\n * The keys are the event name and the values are the payload of each event. All events are\n * emitted with its respective payload. If any event doesn't need payload a `undefined` must be\n * passed as value.\n *\n * @public\n */\n @Component\n export default class BaseEventButton extends Vue {\n /**\n * (Required) A object where the keys are the {@link XEvent} and the values\n * are the payload of each event.\n *\n * @public\n */\n @Prop({ required: true })\n protected events!: Partial<XEventsTypes>;\n\n protected emitEvents(): void {\n Object.entries(this.events).forEach(([event, payload]) => {\n this.$x.emit(event as XEvent, payload, { target: this.$el as HTMLElement });\n });\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThe event prop is required. It will render a <button></button> that emits the event passed as prop\nwith the value as payload on click:\n\n```vue\n<BaseEventButton :events=\"{ myEvent: payload }\" />\n```\n\nIf the event doesn't need payload then `undefined` must be passed:\n\n```vue\n<BaseEventButton :events=\"{ myEvent: undefined }\" />\n```\n\nIt can emit multiple events at the same time:\n\n```vue\n<BaseEventButton :events=\"{ myFirstEvent: payload1, mySecondEvent: payload2 }\" />\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -55,11 +55,11 @@ __vue_render__._withStripped = true;
55
55
  /* style */
56
56
  var __vue_inject_styles__ = function (inject) {
57
57
  if (!inject) { return }
58
- inject("data-v-3b64b85a_0", { source: ".x-base-grid[data-v-3b64b85a] {\n padding: var(--x-size-padding-grid, 0);\n margin: 0;\n display: grid;\n grid-auto-flow: dense;\n list-style: none;\n}\n.x-base-grid__banner[data-v-3b64b85a] {\n grid-column-start: 1;\n grid-column-end: -1;\n}", map: undefined, media: undefined });
58
+ inject("data-v-c0275f42_0", { source: ".x-base-grid[data-v-c0275f42] {\n padding: var(--x-size-padding-grid, 0);\n margin: 0;\n display: grid;\n grid-auto-flow: dense;\n list-style: none;\n}\n.x-base-grid__banner[data-v-c0275f42] {\n grid-column-start: 1;\n grid-column-end: -1;\n}", map: undefined, media: undefined });
59
59
 
60
60
  };
61
61
  /* scoped */
62
- var __vue_scope_id__ = "data-v-3b64b85a";
62
+ var __vue_scope_id__ = "data-v-c0275f42";
63
63
  /* module identifier */
64
64
  var __vue_module_identifier__ = undefined;
65
65
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"base-grid.vue.js","sources":["../../../src/components/base-grid.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n :style=\"style\"\n class=\"x-grid x-base-grid\"\n :class=\"cssClasses\"\n tag=\"ul\"\n data-test=\"grid\"\n >\n <li\n v-for=\"{ slotName, item, cssClass } in gridItems\"\n :key=\"item.id\"\n :class=\"cssClass\"\n class=\"x-grid__item x-base-grid__item\"\n >\n <!--\n @slot Customized item rendering. Specifying a slot with the item's modelName will result in\n the item using that slot composition to render.\n @binding {item} item - Item to render\n -->\n <slot v-if=\"$scopedSlots[slotName]\" :name=\"slotName\" :item=\"item\" />\n <!--\n @slot (required) Default item rendering. This slot will be used by default for rendering\n the item without an specific slot implementation.\n @binding {item} item - Item to render\n -->\n <slot v-else :item=\"item\">{{ item.name || item.modelName || item.id || item }}</slot>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { toKebabCase } from '../utils/string';\n import { ListItem, VueCSSClasses } from '../utils/types';\n import { XInject } from './decorators/injection.decorators';\n import { LIST_ITEMS_KEY } from './decorators/injection.consts';\n\n /**\n * The type returned by the gridItems function. Basically it's a list of items with its CSS\n * classes and a slotName.\n *\n * @internal\n */\n interface GridItem {\n slotName: string;\n item: ListItem;\n cssClass: VueCSSClasses;\n }\n\n /**\n * Grid component that is able to render different items based on their modelName value. In order\n * to achieve this, it exposes a scopedSlot for each different modelName. In case the items used\n * do not have modelName property, the default slot is used instead. It has a required property:\n * the `items` to render; and an optional one: the number `columns` the grid is divided in. If the\n * number of columns is not specified, the grid automatically fills the rows with as many columns\n * as it can fit.\n *\n * @public\n */\n @Component({})\n export default class BaseGrid extends Vue {\n /**\n * Animation component that will be used to animate the base grid.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue | string;\n\n /**\n * Number of columns the grid is divided into. By default, its value is 0, setting the grid\n * columns mode to auto-fill.\n *\n * @public\n */\n @Prop({ default: 0 })\n protected columns!: number;\n\n /**\n * The list of items to be rendered.\n *\n * @remarks The items must have an id property.\n *\n * @public\n */\n @Prop()\n protected items!: ListItem[];\n\n /**\n * It injects {@link ListItem} provided by an ancestor.\n *\n * @internal\n */\n @XInject(LIST_ITEMS_KEY)\n public injectedListItems!: ListItem[];\n\n /**\n * It returns the items passed as props or the injected ones.\n *\n * @returns List of grid items.\n *\n * @public\n */\n protected get computedItems(): ListItem[] {\n return (\n this.items ??\n this.injectedListItems ??\n //TODO: add here logger\n //eslint-disable-next-line no-console\n console.warn('It is necessary to pass a prop or inject the list of filters')\n );\n }\n\n /**\n * CSS class based on the column property value so items inside the grid can fill different\n * amount of columns or rows based on how many columns the grid is divided into.\n *\n * @returns CSS class with the column property value.\n *\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return this.columns ? `x-grid--cols-${this.columns}` : 'x-grid--cols-auto';\n }\n\n /**\n * CSSStyleDeclaration object specifying the number of columns the grid is divided into based on\n * the column property value.\n *\n * @returns A CSSStyleDeclaration to use as the style attribute.\n *\n * @internal\n */\n protected get style(): Partial<CSSStyleDeclaration> {\n return {\n gridTemplateColumns: this.columns\n ? `repeat(${this.columns}, minmax(0, 1fr))`\n : 'repeat(auto-fill, minmax(var(--x-size-min-width-grid-item, 150px), auto))'\n };\n }\n\n /**\n * Maps the item to an object containing: the `item`, its `CSS class` and its slot name.\n *\n * @returns An array of objects containing the item and its CSS class.\n *\n * @internal\n */\n protected get gridItems(): GridItem[] {\n return this.computedItems.map(item => {\n const slotName = toKebabCase(item.modelName);\n return {\n slotName,\n item,\n cssClass: `x-base-grid__${slotName}`\n };\n });\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-base-grid {\n padding: var(--x-size-padding-grid, 0);\n margin: 0;\n display: grid;\n grid-auto-flow: dense;\n list-style: none;\n\n &__banner {\n grid-column-start: 1;\n grid-column-end: -1;\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n# Examples\n\nThis component renders a list of elements in different slots depending on their modelName. In order\nto achieve this, it exposes a scopedSlot for each different modelName. In case the items used do not\nhave modelName property, the default slot is used instead. It has a required property, the `items`\nto render, and an optional one, the number of `columns` the grid is divided in. If the number of\ncolumns is not specified, the grid automatically fills the rows with as many columns as it can fit.\n\n## Basic example\n\nIt renders a list of items using the default slot:\n\n```vue\n<template>\n <BaseGrid :items=\"items\">\n <template #default=\"{ item }\">\n {{ `Default slot content: ${item.id}` }}\n </template>\n </BaseGrid>\n</template>\n```\n\n## Configuring the number of columns\n\nIt renders a grid with 12 columns instead of 6, which is the default value:\n\n```vue\n<template>\n <BaseGrid :items=\"items\" :columns=\"12\">\n <template #default=\"{ item }\">\n {{ `Default slot content: ${item.id}` }}\n </template>\n </BaseGrid>\n</template>\n```\n\n## Rendering usage\n\nConfiguring the number of columns.\n\nIt renders a list of items using the different scopedSlots created by the item's modelName. For\nexample, if you want to use this component as the search grid, you pass the search results (results,\nbanners, promoted, next queries...etc) as items. Each of these results have a different modelName\nand are rendered in different slots.\n\n```vue\n<template>\n <BaseGrid :animation=\"animation\" :items=\"items\">\n <template #banner=\"{ item }\">\n <span class=\"banner\">\n {{ `${item.title} banner` }}\n </span>\n </template>\n <template #next-queries=\"{ item }\">\n <span>\n {{ `${item.totalResults} next queries` }}\n </span>\n </template>\n <template #promoted=\"{ item }\">\n <span class=\"promoted\">\n {{ `${item.title} promoted` }}\n </span>\n </template>\n <template #result=\"{ item }\">\n <BaseResultLink :result=\"item\">\n {{ item.name }}\n </BaseResultLink>\n </template>\n </BaseGrid>\n</template>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-grid.vue.js","sources":["../../../src/components/base-grid.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n :style=\"style\"\n class=\"x-grid x-base-grid\"\n :class=\"cssClasses\"\n tag=\"ul\"\n data-test=\"grid\"\n >\n <li\n v-for=\"{ slotName, item, cssClass } in gridItems\"\n :key=\"item.id\"\n :class=\"cssClass\"\n class=\"x-grid__item x-base-grid__item\"\n >\n <!--\n @slot Customized item rendering. Specifying a slot with the item's modelName will result in\n the item using that slot composition to render.\n @binding {item} item - Item to render\n -->\n <slot v-if=\"$scopedSlots[slotName]\" :name=\"slotName\" :item=\"item\" />\n <!--\n @slot (required) Default item rendering. This slot will be used by default for rendering\n the item without an specific slot implementation.\n @binding {item} item - Item to render\n -->\n <slot v-else :item=\"item\">{{ item.name || item.modelName || item.id || item }}</slot>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { toKebabCase } from '../utils/string';\n import { ListItem, VueCSSClasses } from '../utils/types';\n import { XInject } from './decorators/injection.decorators';\n import { LIST_ITEMS_KEY } from './decorators/injection.consts';\n\n /**\n * The type returned by the gridItems function. Basically it's a list of items with its CSS\n * classes and a slotName.\n *\n * @internal\n */\n interface GridItem {\n slotName: string;\n item: ListItem;\n cssClass: VueCSSClasses;\n }\n\n /**\n * Grid component that is able to render different items based on their modelName value. In order\n * to achieve this, it exposes a scopedSlot for each different modelName. In case the items used\n * do not have modelName property, the default slot is used instead. It has a required property:\n * the `items` to render; and an optional one: the number `columns` the grid is divided in. If the\n * number of columns is not specified, the grid automatically fills the rows with as many columns\n * as it can fit.\n *\n * @public\n */\n @Component({})\n export default class BaseGrid extends Vue {\n /**\n * Animation component that will be used to animate the base grid.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue | string;\n\n /**\n * Number of columns the grid is divided into. By default, its value is 0, setting the grid\n * columns mode to auto-fill.\n *\n * @public\n */\n @Prop({ default: 0 })\n protected columns!: number;\n\n /**\n * The list of items to be rendered.\n *\n * @remarks The items must have an id property.\n *\n * @public\n */\n @Prop()\n protected items!: ListItem[];\n\n /**\n * It injects {@link ListItem} provided by an ancestor.\n *\n * @internal\n */\n @XInject(LIST_ITEMS_KEY)\n public injectedListItems!: ListItem[];\n\n /**\n * It returns the items passed as props or the injected ones.\n *\n * @returns List of grid items.\n *\n * @public\n */\n protected get computedItems(): ListItem[] {\n return (\n this.items ??\n this.injectedListItems ??\n //TODO: add here logger\n //eslint-disable-next-line no-console\n console.warn('It is necessary to pass a prop or inject the list of filters')\n );\n }\n\n /**\n * CSS class based on the column property value so items inside the grid can fill different\n * amount of columns or rows based on how many columns the grid is divided into.\n *\n * @returns CSS class with the column property value.\n *\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return this.columns ? `x-grid--cols-${this.columns}` : 'x-grid--cols-auto';\n }\n\n /**\n * CSSStyleDeclaration object specifying the number of columns the grid is divided into based on\n * the column property value.\n *\n * @returns A CSSStyleDeclaration to use as the style attribute.\n *\n * @internal\n */\n protected get style(): Partial<CSSStyleDeclaration> {\n return {\n gridTemplateColumns: this.columns\n ? `repeat(${this.columns}, minmax(0, 1fr))`\n : 'repeat(auto-fill, minmax(var(--x-size-min-width-grid-item, 150px), auto))'\n };\n }\n\n /**\n * Maps the item to an object containing: the `item`, its `CSS class` and its slot name.\n *\n * @returns An array of objects containing the item and its CSS class.\n *\n * @internal\n */\n protected get gridItems(): GridItem[] {\n return this.computedItems.map(item => {\n const slotName = toKebabCase(item.modelName);\n return {\n slotName,\n item,\n cssClass: `x-base-grid__${slotName}`\n };\n });\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-base-grid {\n padding: var(--x-size-padding-grid, 0);\n margin: 0;\n display: grid;\n grid-auto-flow: dense;\n list-style: none;\n\n &__banner {\n grid-column-start: 1;\n grid-column-end: -1;\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders a list of elements in different slots depending on their modelName. In order\nto achieve this, it exposes a scopedSlot for each different modelName. In case the items used do not\nhave modelName property, the default slot is used instead. It has a required property, the `items`\nto render, and an optional one, the number of `columns` the grid is divided in. If the number of\ncolumns is not specified, the grid automatically fills the rows with as many columns as it can fit.\n\n### Basic example\n\nIt renders a list of items using the default slot:\n\n```vue\n<template>\n <BaseGrid :items=\"items\">\n <template #default=\"{ item }\">\n {{ `Default slot content: ${item.id}` }}\n </template>\n </BaseGrid>\n</template>\n```\n\n### Configuring the number of columns\n\nIt renders a grid with 12 columns instead of 6, which is the default value:\n\n```vue\n<template>\n <BaseGrid :items=\"items\" :columns=\"12\">\n <template #default=\"{ item }\">\n {{ `Default slot content: ${item.id}` }}\n </template>\n </BaseGrid>\n</template>\n```\n\n### Rendering usage\n\nConfiguring the number of columns.\n\nIt renders a list of items using the different scopedSlots created by the item's modelName. For\nexample, if you want to use this component as the search grid, you pass the search results (results,\nbanners, promoted, next queries...etc) as items. Each of these results have a different modelName\nand are rendered in different slots.\n\n```vue\n<template>\n <BaseGrid :animation=\"animation\" :items=\"items\">\n <template #banner=\"{ item }\">\n <span class=\"banner\">\n {{ `${item.title} banner` }}\n </span>\n </template>\n <template #next-queries=\"{ item }\">\n <span>\n {{ `${item.totalResults} next queries` }}\n </span>\n </template>\n <template #promoted=\"{ item }\">\n <span class=\"promoted\">\n {{ `${item.title} promoted` }}\n </span>\n </template>\n <template #result=\"{ item }\">\n <BaseResultLink :result=\"item\">\n {{ item.name }}\n </BaseResultLink>\n </template>\n </BaseGrid>\n</template>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-keyboard-navigation.vue.js","sources":["../../../src/components/base-keyboard-navigation.vue"],"sourcesContent":["<template>\n <div\n @keydown.up.down.right.left.prevent=\"focusNextNavigableElement\"\n class=\"x-keyboard-navigation\"\n data-test=\"keyboard-navigation\"\n >\n <!-- @slot (Required) Container content -->\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n // eslint-disable-next-line max-len\n import { DirectionalFocusNavigationService } from '../services/directional-focus-navigation.service';\n import { SpatialNavigation } from '../services/services.types';\n import { ArrowKey, EventsForDirectionLimit, TakeNavigationControl } from '../utils/types';\n import { XEventsOf } from '../wiring/events.types';\n import { WireMetadata } from '../wiring/wiring.types';\n import { XOn } from './decorators/bus.decorators';\n\n /**\n * Base component to handle keyboard navigation for elements inside it. It has a required slot to\n * include the navigable elements.\n *\n * @remarks\n * The component can be customized through props: an array of navigationHijacker objects, which\n * contains: the xEvent to listen to, the moduleName in charge of emitting the event and to which\n * direction it should react to; to take control of the navigation and eventsForDirectionLimit, to\n * emit an xEvent when reaching the navigation limit in any direction.\n *\n * @public\n */\n @Component\n export default class BaseKeyboardNavigation extends Vue {\n /**\n * An array of {@link TakeNavigationControl | navigation hijacker} objects defining when to\n * take control of the keyboard navigation.\n */\n @Prop({\n default: () => [\n { xEvent: 'UserPressedArrowKey', moduleName: 'searchBox', direction: 'ArrowDown' }\n ]\n })\n protected navigationHijacker!: TakeNavigationControl[];\n\n /**\n * An {@link EventsForDirectionLimit} to emit when the user is already at the furthest element\n * in a direction and tries to keep going on the same direction.\n */\n @Prop({ default: () => ({ ArrowUp: 'UserReachedEmpathizeTop' }) })\n protected eventsForDirectionLimit!: Partial<EventsForDirectionLimit>;\n\n /**\n * The {@link SpatialNavigation | navigation service} to use.\n */\n protected navigationService!: SpatialNavigation;\n\n /**\n * The element to focus.\n */\n protected elementToFocus: HTMLElement | undefined;\n\n mounted(): void {\n // TODO Replace this with injection\n this.navigationService = new DirectionalFocusNavigationService(this.$el as HTMLElement);\n }\n\n /**\n * Get the navigation hijacker events.\n *\n * @remarks\n * If the same {@link XEvent} is defined multiple times it is only inserted once.\n *\n * @returns The events to hijack the navigation.\n */\n protected get navigationHijackerEvents(): XEventsOf<ArrowKey>[] {\n const eventsSet = this.navigationHijacker.map(({ xEvent }) => xEvent);\n return Array.from(new Set(eventsSet));\n }\n\n /**\n * Trigger navigation if this component is in control of it.\n *\n * @param eventPayload - The {@link WirePayload.eventPayload}.\n * @param metadata - The {@link WirePayload.metadata}.\n * @public\n */\n @XOn(component => (component as BaseKeyboardNavigation).navigationHijackerEvents)\n triggerNavigation(eventPayload: ArrowKey, metadata: WireMetadata): void {\n if (this.hasToTakeNavigationControl(eventPayload, metadata)) {\n this.focusNextNavigableElement(eventPayload);\n }\n }\n\n /**\n * Checks if the component has to take control of the keyboard navigation.\n *\n * @param eventPayload - The {@link ArrowKey}.\n * @param metadata - The {@link WireMetadata}.\n *\n * @returns Whether the component needs to take control of the keyboard navigation or not.\n * @internal\n */\n private hasToTakeNavigationControl(eventPayload: ArrowKey, metadata: WireMetadata): boolean {\n return this.navigationHijacker.some(\n ({ moduleName, direction }) =>\n moduleName === metadata.moduleName && direction === eventPayload\n );\n }\n\n /**\n * Focus the next navigable element returned by the navigation service.\n *\n * @param direction - The navigation direction.\n * @internal\n */\n protected focusNextNavigableElement(direction: ArrowKey | KeyboardEvent): void {\n const dir = typeof direction === 'object' ? (direction.key as ArrowKey) : direction;\n const nextElementToFocus = this.navigationService?.navigateTo(dir);\n\n if (this.elementToFocus !== nextElementToFocus) {\n this.elementToFocus = nextElementToFocus;\n this.elementToFocus.focus();\n } else {\n this.emitDirectionalLimitReached(dir);\n this.elementToFocus = undefined;\n }\n }\n\n /**\n * Emit the {@link XEvent} associated to the navigation's direction when reaching its limit.\n *\n * @param direction - The navigation direction.\n * @internal\n */\n private emitDirectionalLimitReached(direction: ArrowKey): void {\n const xEvent = this.eventsForDirectionLimit?.[direction];\n if (xEvent) {\n this.$x.emit(xEvent, undefined, { target: this.elementToFocus });\n }\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Examples\n\nThis component has a slot to inject other components inside it. The component expects a required\nprop, navigationHijacker, which is an array of objects containing: the xEvent to listen to, the\nmoduleName in charge of emitting the event and to which direction it should react to; to take\ncontrol of the navigation. It has another prop, optional in this case, to emit an xEvent when\nreaching the navigation limit in any direction.\n\n## Basic Usage\n\n```vue\n<KeyboardNavigation>\n <QuerySuggestions/>\n</KeyboardNavigation>\n```\n\n## Defining multiple conditions to take navigation's control\n\n```vue\n<KeyboardNavigation\n :navigationHijacker=\"[\n {\n xEvent: 'UserPressedArrowKey',\n moduleName: 'searchBox',\n direction: 'ArrowDown'\n },\n {\n xEvent: 'UserPressedArrowKey',\n moduleName: 'facets',\n direction: 'ArrowRight'\n }\n ]\"\n>\n <QuerySuggestions/>\n</KeyboardNavigation>\n```\n\n## Defining events to emit when reaching a navigation limit\n\n```vue\n<KeyboardNavigation\n :navigationHijacker=\"[\n {\n xEvent: 'UserPressedArrowKey',\n moduleName: 'searchBox',\n direction: 'ArrowDown'\n }\n ]\"\n :eventsForDirectionLimit=\"{\n ArrowUp: 'UserReachedEmpathizeTop'\n }\"\n>\n <QuerySuggestions/>\n</KeyboardNavigation>\n```\n\n## Events\n\nAn event that the component will emit:\n\n- `UserReachedEmpathizeTop`: the event emitted by default when the container reaches its top\n navigation, but more events can be emitted for each direction using the `eventsForDirectionLimit`\n prop.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-keyboard-navigation.vue.js","sources":["../../../src/components/base-keyboard-navigation.vue"],"sourcesContent":["<template>\n <div\n @keydown.up.down.right.left.prevent=\"focusNextNavigableElement\"\n class=\"x-keyboard-navigation\"\n data-test=\"keyboard-navigation\"\n >\n <!-- @slot (Required) Container content -->\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n // eslint-disable-next-line max-len\n import { DirectionalFocusNavigationService } from '../services/directional-focus-navigation.service';\n import { SpatialNavigation } from '../services/services.types';\n import { ArrowKey, EventsForDirectionLimit, TakeNavigationControl } from '../utils/types';\n import { XEventsOf } from '../wiring/events.types';\n import { WireMetadata } from '../wiring/wiring.types';\n import { XOn } from './decorators/bus.decorators';\n\n /**\n * Base component to handle keyboard navigation for elements inside it. It has a required slot to\n * include the navigable elements.\n *\n * @remarks\n * The component can be customized through props: an array of navigationHijacker objects, which\n * contains: the xEvent to listen to, the moduleName in charge of emitting the event and to which\n * direction it should react to; to take control of the navigation and eventsForDirectionLimit, to\n * emit an xEvent when reaching the navigation limit in any direction.\n *\n * @public\n */\n @Component\n export default class BaseKeyboardNavigation extends Vue {\n /**\n * An array of {@link TakeNavigationControl | navigation hijacker} objects defining when to\n * take control of the keyboard navigation.\n */\n @Prop({\n default: () => [\n { xEvent: 'UserPressedArrowKey', moduleName: 'searchBox', direction: 'ArrowDown' }\n ]\n })\n protected navigationHijacker!: TakeNavigationControl[];\n\n /**\n * An {@link EventsForDirectionLimit} to emit when the user is already at the furthest element\n * in a direction and tries to keep going on the same direction.\n */\n @Prop({ default: () => ({ ArrowUp: 'UserReachedEmpathizeTop' }) })\n protected eventsForDirectionLimit!: Partial<EventsForDirectionLimit>;\n\n /**\n * The {@link SpatialNavigation | navigation service} to use.\n */\n protected navigationService!: SpatialNavigation;\n\n /**\n * The element to focus.\n */\n protected elementToFocus: HTMLElement | undefined;\n\n mounted(): void {\n // TODO Replace this with injection\n this.navigationService = new DirectionalFocusNavigationService(this.$el as HTMLElement);\n }\n\n /**\n * Get the navigation hijacker events.\n *\n * @remarks\n * If the same {@link XEvent} is defined multiple times it is only inserted once.\n *\n * @returns The events to hijack the navigation.\n */\n protected get navigationHijackerEvents(): XEventsOf<ArrowKey>[] {\n const eventsSet = this.navigationHijacker.map(({ xEvent }) => xEvent);\n return Array.from(new Set(eventsSet));\n }\n\n /**\n * Trigger navigation if this component is in control of it.\n *\n * @param eventPayload - The {@link WirePayload.eventPayload}.\n * @param metadata - The {@link WirePayload.metadata}.\n * @public\n */\n @XOn(component => (component as BaseKeyboardNavigation).navigationHijackerEvents)\n triggerNavigation(eventPayload: ArrowKey, metadata: WireMetadata): void {\n if (this.hasToTakeNavigationControl(eventPayload, metadata)) {\n this.focusNextNavigableElement(eventPayload);\n }\n }\n\n /**\n * Checks if the component has to take control of the keyboard navigation.\n *\n * @param eventPayload - The {@link ArrowKey}.\n * @param metadata - The {@link WireMetadata}.\n *\n * @returns Whether the component needs to take control of the keyboard navigation or not.\n * @internal\n */\n private hasToTakeNavigationControl(eventPayload: ArrowKey, metadata: WireMetadata): boolean {\n return this.navigationHijacker.some(\n ({ moduleName, direction }) =>\n moduleName === metadata.moduleName && direction === eventPayload\n );\n }\n\n /**\n * Focus the next navigable element returned by the navigation service.\n *\n * @param direction - The navigation direction.\n * @internal\n */\n protected focusNextNavigableElement(direction: ArrowKey | KeyboardEvent): void {\n const dir = typeof direction === 'object' ? (direction.key as ArrowKey) : direction;\n const nextElementToFocus = this.navigationService?.navigateTo(dir);\n\n if (this.elementToFocus !== nextElementToFocus) {\n this.elementToFocus = nextElementToFocus;\n this.elementToFocus.focus();\n } else {\n this.emitDirectionalLimitReached(dir);\n this.elementToFocus = undefined;\n }\n }\n\n /**\n * Emit the {@link XEvent} associated to the navigation's direction when reaching its limit.\n *\n * @param direction - The navigation direction.\n * @internal\n */\n private emitDirectionalLimitReached(direction: ArrowKey): void {\n const xEvent = this.eventsForDirectionLimit?.[direction];\n if (xEvent) {\n this.$x.emit(xEvent, undefined, { target: this.elementToFocus });\n }\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component has a slot to inject other components inside it. The component expects a required\nprop, navigationHijacker, which is an array of objects containing: the xEvent to listen to, the\nmoduleName in charge of emitting the event and to which direction it should react to; to take\ncontrol of the navigation. It has another prop, optional in this case, to emit an xEvent when\nreaching the navigation limit in any direction.\n\n### Basic Usage\n\n```vue\n<KeyboardNavigation>\n <QuerySuggestions/>\n</KeyboardNavigation>\n```\n\n### Defining multiple conditions to take navigation's control\n\n```vue\n<KeyboardNavigation\n :navigationHijacker=\"[\n {\n xEvent: 'UserPressedArrowKey',\n moduleName: 'searchBox',\n direction: 'ArrowDown'\n },\n {\n xEvent: 'UserPressedArrowKey',\n moduleName: 'facets',\n direction: 'ArrowRight'\n }\n ]\"\n>\n <QuerySuggestions/>\n</KeyboardNavigation>\n```\n\n### Defining events to emit when reaching a navigation limit\n\n```vue\n<KeyboardNavigation\n :navigationHijacker=\"[\n {\n xEvent: 'UserPressedArrowKey',\n moduleName: 'searchBox',\n direction: 'ArrowDown'\n }\n ]\"\n :eventsForDirectionLimit=\"{\n ArrowUp: 'UserReachedEmpathizeTop'\n }\"\n>\n <QuerySuggestions/>\n</KeyboardNavigation>\n```\n\n## Events\n\nAn event that the component will emit:\n\n- `UserReachedEmpathizeTop`: the event emitted by default when the container reaches its top\n navigation, but more events can be emitted for each direction using the `eventsForDirectionLimit`\n prop.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -69,11 +69,11 @@ __vue_render__._withStripped = true;
69
69
  /* style */
70
70
  var __vue_inject_styles__ = function (inject) {
71
71
  if (!inject) { return }
72
- inject("data-v-3aab804a_0", { source: ".x-rating[data-v-3aab804a] {\n position: relative;\n display: inline-block;\n}\n.x-rating--empty[data-v-3aab804a] {\n overflow-x: hidden;\n display: flex;\n}\n.x-rating--filled[data-v-3aab804a] {\n display: flex;\n position: absolute;\n overflow-x: hidden;\n top: 0;\n left: 0;\n}\n.x-rating__default-icon[data-v-3aab804a] {\n fill: currentColor;\n stroke: currentColor;\n}\n.x-rating__default-icon--empty[data-v-3aab804a] {\n fill: none;\n}", map: undefined, media: undefined });
72
+ inject("data-v-572d183e_0", { source: ".x-rating[data-v-572d183e] {\n position: relative;\n display: inline-block;\n}\n.x-rating--empty[data-v-572d183e] {\n overflow: hidden;\n display: flex;\n}\n.x-rating--filled[data-v-572d183e] {\n display: flex;\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n}\n.x-rating__default-icon[data-v-572d183e] {\n fill: currentColor;\n stroke: currentColor;\n}\n.x-rating__default-icon--empty[data-v-572d183e] {\n fill: none;\n}", map: undefined, media: undefined });
73
73
 
74
74
  };
75
75
  /* scoped */
76
- var __vue_scope_id__ = "data-v-3aab804a";
76
+ var __vue_scope_id__ = "data-v-572d183e";
77
77
  /* module identifier */
78
78
  var __vue_module_identifier__ = undefined;
79
79
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"base-rating.vue.js","sources":["../../../src/components/base-rating.vue"],"sourcesContent":["<template>\n <span class=\"x-rating\" role=\"img\" :aria-label=\"ariaLabel\" data-test=\"rating\">\n <div class=\"x-rating--empty\" data-test=\"rating-empty\">\n <!--\n @slot The content to render as empty icon\n -->\n <slot v-for=\"i in max\" name=\"emptyIcon\">\n <DefaultIcon :key=\"i\" class=\"x-rating__default-icon x-rating__default-icon--empty\" />\n </slot>\n </div>\n <div\n class=\"x-rating--filled\"\n :style=\"{ width: calculateFilledWrapperWidth }\"\n data-test=\"rating-filled\"\n >\n <!--\n @slot The content to render as filled icon\n -->\n <slot v-for=\"i in max\" name=\"filledIcon\">\n <DefaultIcon :key=\"i\" class=\"x-rating__default-icon x-rating__default-icon--filled\" />\n </slot>\n </div>\n </span>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import StarIcon from './icons/star.vue';\n\n /**\n * Rating component. This component renders a set of elements filled based on the value passed as\n * prop.\n *\n * @public\n */\n @Component({\n components: {\n DefaultIcon: StarIcon\n }\n })\n export default class BaseRating extends Vue {\n /**\n * Numeric value used to calculates the width of the filled elements.\n *\n * @public\n */\n @Prop({ required: true })\n protected value!: number;\n /**\n * Maximum number of elements to paint.\n *\n * @public\n */\n @Prop({ default: 5 })\n protected max!: number;\n\n /**\n * Calculates the width of the filled elements wrapper.\n *\n * @returns The % of the wrapper width.\n *\n * @internal\n */\n protected get calculateFilledWrapperWidth(): string {\n return this.value < 0 ? '0%' : `${(this.value * 100) / this.max}%`;\n }\n\n /**\n * Creates the aria label for accessibility purpose.\n *\n * @returns The aria label.\n *\n * @internal\n */\n protected get ariaLabel(): string {\n return `${this.value}/${this.max}`;\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-rating {\n position: relative;\n display: inline-block;\n\n &--empty {\n overflow-x: hidden;\n display: flex;\n }\n\n &--filled {\n display: flex;\n position: absolute;\n overflow-x: hidden;\n top: 0;\n left: 0;\n }\n\n &__default-icon {\n fill: currentColor;\n stroke: currentColor;\n\n &--empty {\n fill: none;\n }\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n# Examples\n\nThis component receives a `value` as prop and renders a set of elements, which will be filled based\non this value.\n\n## Basic usage\n\n```vue\n<BaseRating :value=\"5.23\" />\n```\n\n## Customizing its contents\n\n```vue\n<BaseRating :value=\"7.15\" :max=\"10\">\n <template #filledIcon>\n <TestIcon/>\n </template>\n <template #emptyIcon>\n <TestIcon/>\n </template>\n</BaseRating>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-rating.vue.js","sources":["../../../src/components/base-rating.vue"],"sourcesContent":["<template>\n <span class=\"x-rating\" role=\"img\" :aria-label=\"ariaLabel\" data-test=\"rating\">\n <div class=\"x-rating--empty\" data-test=\"rating-empty\">\n <!--\n @slot The content to render as empty icon\n -->\n <slot v-for=\"i in max\" name=\"emptyIcon\">\n <DefaultIcon :key=\"i\" class=\"x-rating__default-icon x-rating__default-icon--empty\" />\n </slot>\n </div>\n <div\n class=\"x-rating--filled\"\n :style=\"{ width: calculateFilledWrapperWidth }\"\n data-test=\"rating-filled\"\n >\n <!--\n @slot The content to render as filled icon\n -->\n <slot v-for=\"i in max\" name=\"filledIcon\">\n <DefaultIcon :key=\"i\" class=\"x-rating__default-icon x-rating__default-icon--filled\" />\n </slot>\n </div>\n </span>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import StarIcon from './icons/star.vue';\n\n /**\n * Rating component. This component renders a set of elements filled based on the value passed as\n * prop.\n *\n * @public\n */\n @Component({\n components: {\n DefaultIcon: StarIcon\n }\n })\n export default class BaseRating extends Vue {\n /**\n * Numeric value used to calculates the width of the filled elements.\n *\n * @public\n */\n @Prop({ required: true })\n protected value!: number;\n /**\n * Maximum number of elements to paint.\n *\n * @public\n */\n @Prop({ default: 5 })\n protected max!: number;\n\n /**\n * Calculates the width of the filled elements wrapper.\n *\n * @returns The % of the wrapper width.\n *\n * @internal\n */\n protected get calculateFilledWrapperWidth(): string {\n return this.value < 0 ? '0%' : `${(this.value * 100) / this.max}%`;\n }\n\n /**\n * Creates the aria label for accessibility purpose.\n *\n * @returns The aria label.\n *\n * @internal\n */\n protected get ariaLabel(): string {\n return `${this.value}/${this.max}`;\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-rating {\n position: relative;\n display: inline-block;\n\n &--empty {\n overflow: hidden;\n display: flex;\n }\n\n &--filled {\n display: flex;\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n }\n\n &__default-icon {\n fill: currentColor;\n stroke: currentColor;\n\n &--empty {\n fill: none;\n }\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component receives a `value` as prop and renders a set of elements, which will be filled based\non this value.\n\n### Basic usage\n\n```vue\n<BaseRating :value=\"5.23\" />\n```\n\n### Customizing its contents\n\n```vue\n<BaseRating :value=\"7.15\" :max=\"10\">\n <template #filledIcon>\n <TestIcon/>\n </template>\n <template #emptyIcon>\n <TestIcon/>\n </template>\n</BaseRating>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-variable-column-grid.vue.js","sources":["../../../src/components/base-variable-column-grid.vue"],"sourcesContent":["<template>\n <BaseGrid :animation=\"animation\" :columns=\"columns\" :items=\"items\">\n <template v-for=\"(_, name) in $scopedSlots\" v-slot:[name]=\"{ item }\">\n <!--\n @slot Customized item rendering. The slot name can either be default or the item's model\n name.\n @binding {GridItem} item - Item to render.\n -->\n <slot :name=\"name\" v-bind=\"{ item }\" />\n </template>\n </BaseGrid>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { ListItem } from '../utils/types';\n import BaseGrid from './base-grid.vue';\n import { XOn } from './decorators/bus.decorators';\n\n /**\n * The `BaseVariableColumnGrid` component is a wrapper of the `BaseGrid` component that listens to\n * the `UserClickedColumnPicker` and the `ColumnsNumberProvided` events and passes the\n * selected number of columns to the grid. It also allows to customize the grid items using the\n * available `scopedSlots`.\n *\n * @public\n */\n @Component({\n components: {\n BaseGrid\n }\n })\n export default class BaseVariableColumnGrid extends Vue {\n /**\n * Animation component that will be used to animate the grid.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue | string;\n\n /**\n * The list of items to be rendered.\n *\n * @remarks The items must have an id property.\n *\n * @public\n */\n @Prop()\n protected items?: ListItem[];\n\n /**\n * The columns to render in the grid.\n *\n * @internal\n */\n protected columns = 0;\n\n /**\n * Handler to update the number of columns when the user selects a new value.\n *\n * @param newColumns - The new columns value.\n *\n * @internal\n */\n @XOn(['ColumnsNumberProvided'])\n setColumns(newColumns: number): void {\n this.columns = newColumns;\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Example\n\nThe `BaseVariableColumnGrid` component is a wrapper of the `BaseGrid` component that listens to the\n`ColumnsNumberProvided` events and passes the selected amount of columns to the grid. It also allows\nyou to customize the grid items using the available `scopedSlots`.\n\n```vue\n<template>\n <section class=\"results\">\n <button @click=\"setColumns(4)\" class=\"column-picker-selector\">\n <span class=\"column-picker-selector__text\">4 columns</span>\n </button>\n <BaseVariableColumnGrid :animation=\"animation\" :items=\"items\">\n <template #default=\"{ item }\">\n <span data-test=\"default-slot\">{{ item.id }}</span>\n </template>\n <template #result=\"{ item }\">\n <span data-test=\"result-slot\">{{ 'Result ' + item.id }}</span>\n </template>\n </BaseVariableColumnGrid>\n </section>\n</template>\n\n<script>\n import { BaseVariableColumnGrid, StaggeredFadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'ResultsSection',\n components: {\n BaseVariableColumnGrid\n },\n data() {\n return {\n animation: StaggeredFadeAndSlide,\n items: [\n {\n id: 'res-1',\n modelName: 'Result',\n name: 'Product 1'\n },\n {\n id: 'res-2',\n modelName: 'Result',\n name: 'Product 2'\n }\n ]\n };\n },\n methods: {\n setColumns(columns) {\n this.$x.emit('UserClickedColumnPicker', columns);\n }\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-variable-column-grid.vue.js","sources":["../../../src/components/base-variable-column-grid.vue"],"sourcesContent":["<template>\n <BaseGrid :animation=\"animation\" :columns=\"columns\" :items=\"items\">\n <template v-for=\"(_, name) in $scopedSlots\" v-slot:[name]=\"{ item }\">\n <!--\n @slot Customized item rendering. The slot name can either be default or the item's model\n name.\n @binding {GridItem} item - Item to render.\n -->\n <slot :name=\"name\" v-bind=\"{ item }\" />\n </template>\n </BaseGrid>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { ListItem } from '../utils/types';\n import BaseGrid from './base-grid.vue';\n import { XOn } from './decorators/bus.decorators';\n\n /**\n * The `BaseVariableColumnGrid` component is a wrapper of the `BaseGrid` component that listens to\n * the `UserClickedColumnPicker` and the `ColumnsNumberProvided` events and passes the\n * selected number of columns to the grid. It also allows to customize the grid items using the\n * available `scopedSlots`.\n *\n * @public\n */\n @Component({\n components: {\n BaseGrid\n }\n })\n export default class BaseVariableColumnGrid extends Vue {\n /**\n * Animation component that will be used to animate the grid.\n *\n * @public\n */\n @Prop({ default: 'ul' })\n protected animation!: Vue | string;\n\n /**\n * The list of items to be rendered.\n *\n * @remarks The items must have an id property.\n *\n * @public\n */\n @Prop()\n protected items?: ListItem[];\n\n /**\n * The columns to render in the grid.\n *\n * @internal\n */\n protected columns = 0;\n\n /**\n * Handler to update the number of columns when the user selects a new value.\n *\n * @param newColumns - The new columns value.\n *\n * @internal\n */\n @XOn(['ColumnsNumberProvided'])\n setColumns(newColumns: number): void {\n this.columns = newColumns;\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nThe `BaseVariableColumnGrid` component is a wrapper of the `BaseGrid` component that listens to the\n`ColumnsNumberProvided` events and passes the selected amount of columns to the grid. It also allows\nyou to customize the grid items using the available `scopedSlots`.\n\n```vue\n<template>\n <section class=\"results\">\n <button @click=\"setColumns(4)\" class=\"column-picker-selector\">\n <span class=\"column-picker-selector__text\">4 columns</span>\n </button>\n <BaseVariableColumnGrid :animation=\"animation\" :items=\"items\">\n <template #default=\"{ item }\">\n <span data-test=\"default-slot\">{{ item.id }}</span>\n </template>\n <template #result=\"{ item }\">\n <span data-test=\"result-slot\">{{ 'Result ' + item.id }}</span>\n </template>\n </BaseVariableColumnGrid>\n </section>\n</template>\n\n<script>\n import { BaseVariableColumnGrid, StaggeredFadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'ResultsSection',\n components: {\n BaseVariableColumnGrid\n },\n data() {\n return {\n animation: StaggeredFadeAndSlide,\n items: [\n {\n id: 'res-1',\n modelName: 'Result',\n name: 'Product 1'\n },\n {\n id: 'res-2',\n modelName: 'Result',\n name: 'Product 2'\n }\n ]\n };\n },\n methods: {\n setColumns(columns) {\n this.$x.emit('UserClickedColumnPicker', columns);\n }\n }\n };\n</script>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-column-picker-dropdown.vue.js","sources":["../../../../src/components/column-picker/base-column-picker-dropdown.vue"],"sourcesContent":["<template>\n <BaseDropdown\n @change=\"emitEvent\"\n :value=\"selectedColumns\"\n :items=\"columns\"\n :animation=\"animation\"\n >\n <template v-if=\"$scopedSlots.toggle\" #toggle=\"{ item, isOpen }\">\n <!--\n @slot From `BaseDropdown` component: Used to render the contents of the dropdown toggle\n button. If not provided, it uses the `item` slot as fallback.\n @binding {string|number|Identifiable} item - The item data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is\n closed.\n -->\n <slot name=\"toggle\" v-bind=\"{ item, isOpen }\" />\n </template>\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <!--\n @slot (required) From `BaseDropdown` component: Used to render each one of the items\n content, and as fallback for the toggle button content slot if it is not provided.\n @binding {string|number|Identifiable} item - Item 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 name=\"item\" v-bind=\"{ item, isSelected, isHighlighted }\" />\n </template>\n </BaseDropdown>\n</template>\n\n<script lang=\"ts\">\n import { Component, Prop } from 'vue-property-decorator';\n import { mixins } from 'vue-class-component';\n import Vue from 'vue';\n import BaseEventButton from '../base-event-button.vue';\n import BaseDropdown from '../base-dropdown.vue';\n import ColumnPickerMixin from './column-picker.mixin';\n\n /**\n * Column picker dropdown component renders {@link BaseDropdown | dropdown} component which\n * options are the different columns you can set for a grid.\n *\n * It emits {@link XEventsTypes.UserClickedColumnPicker | UserClickedColumnPicker} on dropdown\n * input.\n *\n * @remarks It extends {@link ColumnPickerMixin}.\n *\n * @public\n */\n @Component({\n components: { BaseDropdown, BaseEventButton }\n })\n export default class BaseColumnPickerDropdown extends mixins(ColumnPickerMixin) {\n /**\n * The transition to use for opening and closing the dropdown.\n *\n * @public\n */\n @Prop()\n public animation?: string | typeof Vue;\n\n /**\n * Emits a {@link XEventsTypes.UserClickedColumnPicker | UserClickedColumnPicker} and\n * {@link XEventsTypes.ColumnsNumberProvided | ColumnsNumberProvided} events.\n *\n * @param column - Column number payload.\n */\n emitEvent(column: number): void {\n this.$x.emit('UserClickedColumnPicker', column);\n this.$x.emit('ColumnsNumberProvided', column);\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n# Example\n\nColumn picker dropdown component renders a dropdown component which options are the different\ncolumns you can set for a grid.\n\n## Usage\n\nNotice that the slots provided match with the `BaseDropdown` component. The `item` slot is required\nunlike the `toggle`, which renders the same `item` slot defined by default.\n\n### Default usage\n\n```vue\n<template>\n <BaseColumnPickerDropdown v-model=\"selectedColumns\" :columns=\"[2, 4, 6]\">\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseColumnPickerDropdown>\n</template>\n\n<script>\n import { BaseColumnPickerDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'BaseColumnPickerDropdownTest',\n components: {\n BaseColumnPickerDropdown\n },\n data() {\n return {\n selectedColumns: 2\n };\n }\n };\n</script>\n```\n\n### Customizing toggle button\n\n```vue\n<template>\n <BaseColumnPickerDropdown v-model=\"selectedColumns\" :columns=\"[2, 4, 6]\">\n <template #toggle=\"{ item, isOpen }\">Selected: {{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseColumnPickerDropdown>\n</template>\n\n<script>\n import { BaseColumnPickerDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'BaseColumnPickerDropdownTest',\n components: {\n BaseColumnPickerDropdown\n },\n data() {\n return {\n selectedColumns: 2\n };\n }\n };\n</script>\n```\n\n### Using it without v-model / value\n\nThe component emits an X Event, `UserClickedColumnPicker`, on column change and it also listens to\nthat event from outside, so you don't need to store the current column value to keep it synchronized\nwith other column pickers.\n\n```vue\n<template>\n <BaseColumnPickerDropdown :columns=\"[2, 4, 6]\">\n <template #toggle=\"{ item, isOpen }\">Selected: {{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseColumnPickerDropdown>\n</template>\n\n<script>\n import { BaseColumnPickerDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'BaseColumnPickerDropdownTest',\n components: {\n BaseColumnPickerDropdown\n }\n };\n</script>\n```\n\n## Events\n\nAn event that the component will emit:\n\n- `UserClickedColumnPicker`: the event is emitted after the user clicks an item in the dropdown. The\n event payload is the number of columns that the clicked item represents.\n- `ColumnsNumberProvided`: the event is emitted on component mount, and whenever the value changes.\n The event payload is the current `selectedColumns` value.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-column-picker-dropdown.vue.js","sources":["../../../../src/components/column-picker/base-column-picker-dropdown.vue"],"sourcesContent":["<template>\n <BaseDropdown\n @change=\"emitEvent\"\n :value=\"selectedColumns\"\n :items=\"columns\"\n :animation=\"animation\"\n >\n <template v-if=\"$scopedSlots.toggle\" #toggle=\"{ item, isOpen }\">\n <!--\n @slot From `BaseDropdown` component: Used to render the contents of the dropdown toggle\n button. If not provided, it uses the `item` slot as fallback.\n @binding {string|number|Identifiable} item - The item data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is\n closed.\n -->\n <slot name=\"toggle\" v-bind=\"{ item, isOpen }\" />\n </template>\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <!--\n @slot (required) From `BaseDropdown` component: Used to render each one of the items\n content, and as fallback for the toggle button content slot if it is not provided.\n @binding {string|number|Identifiable} item - Item 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 name=\"item\" v-bind=\"{ item, isSelected, isHighlighted }\" />\n </template>\n </BaseDropdown>\n</template>\n\n<script lang=\"ts\">\n import { Component, Prop } from 'vue-property-decorator';\n import { mixins } from 'vue-class-component';\n import Vue from 'vue';\n import BaseEventButton from '../base-event-button.vue';\n import BaseDropdown from '../base-dropdown.vue';\n import ColumnPickerMixin from './column-picker.mixin';\n\n /**\n * Column picker dropdown component renders {@link BaseDropdown | dropdown} component which\n * options are the different columns you can set for a grid.\n *\n * It emits {@link XEventsTypes.UserClickedColumnPicker | UserClickedColumnPicker} on dropdown\n * input.\n *\n * @remarks It extends {@link ColumnPickerMixin}.\n *\n * @public\n */\n @Component({\n components: { BaseDropdown, BaseEventButton }\n })\n export default class BaseColumnPickerDropdown extends mixins(ColumnPickerMixin) {\n /**\n * The transition to use for opening and closing the dropdown.\n *\n * @public\n */\n @Prop()\n public animation?: string | typeof Vue;\n\n /**\n * Emits a {@link XEventsTypes.UserClickedColumnPicker | UserClickedColumnPicker} and\n * {@link XEventsTypes.ColumnsNumberProvided | ColumnsNumberProvided} events.\n *\n * @param column - Column number payload.\n */\n emitEvent(column: number): void {\n this.$x.emit('UserClickedColumnPicker', column);\n this.$x.emit('ColumnsNumberProvided', column);\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Example\n\nColumn picker dropdown component renders a dropdown component which options are the different\ncolumns you can set for a grid.\n\n### Usage\n\nNotice that the slots provided match with the `BaseDropdown` component. The `item` slot is required\nunlike the `toggle`, which renders the same `item` slot defined by default.\n\n#### Default usage\n\n```vue\n<template>\n <BaseColumnPickerDropdown v-model=\"selectedColumns\" :columns=\"[2, 4, 6]\">\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseColumnPickerDropdown>\n</template>\n\n<script>\n import { BaseColumnPickerDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'BaseColumnPickerDropdownTest',\n components: {\n BaseColumnPickerDropdown\n },\n data() {\n return {\n selectedColumns: 2\n };\n }\n };\n</script>\n```\n\n#### Customizing toggle button\n\n```vue\n<template>\n <BaseColumnPickerDropdown v-model=\"selectedColumns\" :columns=\"[2, 4, 6]\">\n <template #toggle=\"{ item, isOpen }\">Selected: {{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseColumnPickerDropdown>\n</template>\n\n<script>\n import { BaseColumnPickerDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'BaseColumnPickerDropdownTest',\n components: {\n BaseColumnPickerDropdown\n },\n data() {\n return {\n selectedColumns: 2\n };\n }\n };\n</script>\n```\n\n#### Using it without v-model / value\n\nThe component emits an X Event, `UserClickedColumnPicker`, on column change and it also listens to\nthat event from outside, so you don't need to store the current column value to keep it synchronized\nwith other column pickers.\n\n```vue\n<template>\n <BaseColumnPickerDropdown :columns=\"[2, 4, 6]\">\n <template #toggle=\"{ item, isOpen }\">Selected: {{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>\n <template #item=\"{ item, isSelected, isHighlighted }\">\n <span v-if=\"isHighlighted\">🟢</span>\n <span v-if=\"isSelected\">✅</span>\n <span>{{ item }}</span>\n </template>\n </BaseColumnPickerDropdown>\n</template>\n\n<script>\n import { BaseColumnPickerDropdown } from '@empathyco/x-components';\n\n export default {\n name: 'BaseColumnPickerDropdownTest',\n components: {\n BaseColumnPickerDropdown\n }\n };\n</script>\n```\n\n## Events\n\nAn event that the component will emit:\n\n- `UserClickedColumnPicker`: the event is emitted after the user clicks an item in the dropdown. The\n event payload is the number of columns that the clicked item represents.\n- `ColumnsNumberProvided`: the event is emitted on component mount, and whenever the value changes.\n The event payload is the current `selectedColumns` value.\n</docs>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}