@empathyco/x-components 3.0.0-alpha.39 → 3.0.0-alpha.43

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 (273) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/core/index.js +6 -2
  3. package/core/index.js.map +1 -1
  4. package/design-system/base.css +2 -1
  5. package/design-system/default-theme.css +98 -35
  6. package/design-system/full-theme.css +324 -45
  7. package/design-system/grid-default.css +6 -0
  8. package/design-system/input-group-default.css +16 -7
  9. package/design-system/list-default.css +0 -5
  10. package/design-system/option-list-bottom.css +76 -10
  11. package/design-system/option-list-default.css +39 -2
  12. package/design-system/result-default.css +1 -1
  13. package/design-system/sliding-panel-default.css +15 -17
  14. package/design-system/sliding-panel-default.token.css +0 -2
  15. package/design-system/typography-default.css +1 -0
  16. package/design-system/utilities-background-color.css +3 -0
  17. package/design-system/utilities-border-color.css +3 -0
  18. package/design-system/utilities-flex.css +32 -0
  19. package/design-system/utilities-font-color.css +3 -0
  20. package/design-system/utilities-font-size.css +79 -0
  21. package/design-system/utilities-line-height.css +17 -0
  22. package/design-system/utilities-text-decoration.css +15 -0
  23. package/design-system/utilities-text-transform.css +11 -0
  24. package/docs/API-reference/api/x-adapter.empathynextquery.md +1 -0
  25. package/docs/API-reference/api/x-adapter.empathynextquery.source.md +11 -0
  26. package/docs/API-reference/api/{x-components.resetpage.md → x-components.arrowdownicon.md} +3 -5
  27. package/docs/API-reference/api/{x-components.resetsort.md → x-components.arrowlefticon.md} +3 -5
  28. package/docs/API-reference/api/{x-components.resetfacets.md → x-components.arrowrighticon.md} +3 -5
  29. package/docs/API-reference/api/{x-components.arrowicon.md → x-components.arrowupicon.md} +2 -2
  30. package/docs/API-reference/api/x-components.cancelfetchandsavesearchresponsewire.md +1 -1
  31. package/docs/API-reference/api/x-components.fetchandsavesearchresponsewire.md +1 -1
  32. package/docs/API-reference/api/x-components.getnewandupdatedkeys.md +27 -0
  33. package/docs/API-reference/api/x-components.grid2rowsicon.md +11 -0
  34. package/docs/API-reference/api/x-components.increasepageappendingresults.md +1 -1
  35. package/docs/API-reference/api/x-components.md +12 -7
  36. package/docs/API-reference/api/x-components.nextqueries.highlightcurated.md +13 -0
  37. package/docs/API-reference/api/x-components.nextquery.highlightcurated.md +13 -0
  38. package/docs/API-reference/api/x-components.nextquery.md +1 -0
  39. package/docs/API-reference/api/x-components.resetappending.md +1 -1
  40. package/docs/API-reference/api/x-components.resetspellcheckquery.md +1 -1
  41. package/docs/API-reference/api/x-components.resetstatewire.md +13 -0
  42. package/docs/API-reference/api/x-components.saveoriginwire.md +1 -1
  43. package/docs/API-reference/api/x-components.scroll.md +1 -3
  44. package/docs/API-reference/api/x-components.scrollmixin.md +1 -0
  45. package/docs/API-reference/api/x-components.scrollmixin.reseton.md +13 -0
  46. package/docs/API-reference/api/x-components.searchactions.md +1 -0
  47. package/docs/API-reference/api/x-components.searchactions.resetstate.md +24 -0
  48. package/docs/API-reference/api/x-components.searchxevents.md +1 -0
  49. package/docs/API-reference/api/x-components.searchxevents.searchrequestupdated.md +13 -0
  50. package/docs/API-reference/api/x-components.setpagesize.md +1 -1
  51. package/docs/API-reference/api/x-components.setquerytagginginfo.md +13 -0
  52. package/docs/API-reference/api/x-components.setrelatedtags.md +1 -1
  53. package/docs/API-reference/api/x-components.setsearchextraparams.md +1 -1
  54. package/docs/API-reference/api/x-components.setsearchpage.md +1 -1
  55. package/docs/API-reference/api/x-components.setsearchquery.md +1 -1
  56. package/docs/API-reference/api/x-components.setselectedfilters.md +1 -1
  57. package/docs/API-reference/api/x-components.setsort.md +1 -1
  58. package/docs/API-reference/api/x-components.seturlparams.md +1 -1
  59. package/docs/API-reference/api/x-components.slidingpanel.md +2 -12
  60. package/docs/API-reference/api/x-components.slidingpanel.resetoncontentchange.md +13 -0
  61. package/docs/API-reference/api/x-components.slidingpanel.scrollfactor.md +1 -1
  62. package/docs/API-reference/api/x-components.slidingpanel.showbuttons.md +1 -1
  63. package/docs/API-reference/api/x-components.taggingmutations.md +1 -0
  64. package/docs/API-reference/api/x-components.taggingmutations.setquerytagginginfo.md +24 -0
  65. package/docs/API-reference/api/x-components.taggingstate.md +1 -0
  66. package/docs/API-reference/api/x-components.taggingstate.querytagginginfo.md +13 -0
  67. package/docs/API-reference/api/x-components.taggingxevents.md +1 -0
  68. package/docs/API-reference/api/x-components.taggingxevents.searchtaggingreceived.md +13 -0
  69. package/docs/API-reference/api/x-components.trackquerywire.md +1 -1
  70. package/docs/API-reference/api/x-components.watchedinternalsearchrequest.md +21 -0
  71. package/docs/API-reference/api/x-components.watchedinternalsearchrequest.newrequest.md +11 -0
  72. package/docs/API-reference/api/x-components.watchedinternalsearchrequest.oldrequest.md +11 -0
  73. package/docs/API-reference/api/x-components.wiremetadata.md +1 -0
  74. package/docs/API-reference/api/x-components.wiremetadata.oldvalue.md +13 -0
  75. package/docs/API-reference/api/x-types.nextquery.iscurated.md +13 -0
  76. package/docs/API-reference/api/x-types.nextquery.md +6 -0
  77. package/docs/API-reference/components/common/icons/x-components.arrow-down.md +7 -0
  78. package/docs/API-reference/components/common/icons/x-components.arrow-left.md +7 -0
  79. package/docs/API-reference/components/common/icons/x-components.arrow-right.md +7 -0
  80. package/docs/API-reference/components/common/icons/x-components.arrow-up.md +7 -0
  81. package/docs/API-reference/components/common/icons/x-components.grid-2-rows.md +7 -0
  82. package/docs/API-reference/components/common/scroll/x-components.base-scroll.md +52 -33
  83. package/docs/API-reference/components/common/x-components.sliding-panel.md +192 -33
  84. package/docs/API-reference/components/next-queries/x-components.next-queries.md +17 -11
  85. package/docs/API-reference/components/next-queries/x-components.next-query.md +16 -7
  86. package/docs/API-reference/components/scroll/x-components.scroll.md +5 -8
  87. package/js/components/icons/arrow-down.vue.js +61 -0
  88. package/js/components/icons/arrow-down.vue.js.map +1 -0
  89. package/js/components/icons/arrow-down.vue_rollup-plugin-vue=script.js +4 -0
  90. package/js/components/icons/arrow-down.vue_rollup-plugin-vue=script.js.map +1 -0
  91. package/js/components/icons/{arrow.vue.js → arrow-left.vue.js} +2 -2
  92. package/js/components/icons/arrow-left.vue.js.map +1 -0
  93. package/js/components/icons/arrow-left.vue_rollup-plugin-vue=script.js +4 -0
  94. package/js/components/icons/arrow-left.vue_rollup-plugin-vue=script.js.map +1 -0
  95. package/js/components/icons/arrow-right.vue.js +61 -0
  96. package/js/components/icons/arrow-right.vue.js.map +1 -0
  97. package/js/components/icons/arrow-right.vue_rollup-plugin-vue=script.js +4 -0
  98. package/js/components/icons/arrow-right.vue_rollup-plugin-vue=script.js.map +1 -0
  99. package/js/components/icons/arrow-up.vue.js +61 -0
  100. package/js/components/icons/arrow-up.vue.js.map +1 -0
  101. package/js/components/icons/arrow-up.vue_rollup-plugin-vue=script.js +4 -0
  102. package/js/components/icons/arrow-up.vue_rollup-plugin-vue=script.js.map +1 -0
  103. package/js/components/icons/grid-2-rows.vue.js +65 -0
  104. package/js/components/icons/grid-2-rows.vue.js.map +1 -0
  105. package/js/components/icons/grid-2-rows.vue_rollup-plugin-vue=script.js +4 -0
  106. package/js/components/icons/grid-2-rows.vue_rollup-plugin-vue=script.js.map +1 -0
  107. package/js/components/icons/tag.vue.js +1 -1
  108. package/js/components/icons/tag.vue.js.map +1 -1
  109. package/js/components/scroll/base-scroll.vue.js +2 -2
  110. package/js/components/scroll/base-scroll.vue.js.map +1 -1
  111. package/js/components/scroll/scroll.mixin.js +12 -6
  112. package/js/components/scroll/scroll.mixin.js.map +1 -1
  113. package/js/components/sliding-panel.vue.js +2 -2
  114. package/js/components/sliding-panel.vue.js.map +1 -1
  115. package/js/components/sliding-panel.vue_rollup-plugin-vue=script.js +56 -40
  116. package/js/components/sliding-panel.vue_rollup-plugin-vue=script.js.map +1 -1
  117. package/js/index.js +8 -4
  118. package/js/index.js.map +1 -1
  119. package/js/plugins/x-emitters.js +3 -3
  120. package/js/plugins/x-emitters.js.map +1 -1
  121. package/js/utils/object.js +17 -1
  122. package/js/utils/object.js.map +1 -1
  123. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js +5 -1
  124. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
  125. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js +5 -1
  126. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue=script.js.map +1 -1
  127. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js +5 -1
  128. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue_rollup-plugin-vue=script.js.map +1 -1
  129. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js +5 -1
  130. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  131. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js +5 -1
  132. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue=script.js.map +1 -1
  133. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js +5 -1
  134. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  135. package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js +5 -1
  136. package/js/x-modules/facets/components/filters/base-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  137. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js +5 -1
  138. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  139. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js +5 -1
  140. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  141. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js +5 -1
  142. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  143. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js +5 -1
  144. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue=script.js.map +1 -1
  145. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js +5 -1
  146. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue=script.js.map +1 -1
  147. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js +5 -1
  148. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue=script.js.map +1 -1
  149. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js +5 -1
  150. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue=script.js.map +1 -1
  151. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js +5 -1
  152. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  153. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js +5 -1
  154. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  155. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue=script.js +5 -1
  156. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue=script.js.map +1 -1
  157. package/js/x-modules/facets/wiring.js +3 -0
  158. package/js/x-modules/facets/wiring.js.map +1 -1
  159. package/js/x-modules/next-queries/components/next-queries.vue.js +15 -4
  160. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  161. package/js/x-modules/next-queries/components/next-queries.vue_rollup-plugin-vue=script.js +3 -0
  162. package/js/x-modules/next-queries/components/next-queries.vue_rollup-plugin-vue=script.js.map +1 -1
  163. package/js/x-modules/next-queries/components/next-query.vue.js +6 -1
  164. package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
  165. package/js/x-modules/next-queries/components/next-query.vue_rollup-plugin-vue=script.js +18 -0
  166. package/js/x-modules/next-queries/components/next-query.vue_rollup-plugin-vue=script.js.map +1 -1
  167. package/js/x-modules/related-tags/wiring.js +3 -0
  168. package/js/x-modules/related-tags/wiring.js.map +1 -1
  169. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js +5 -1
  170. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue=script.js.map +1 -1
  171. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js +5 -1
  172. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue=script.js.map +1 -1
  173. package/js/x-modules/scroll/components/scroll.vue.js +14 -13
  174. package/js/x-modules/scroll/components/scroll.vue.js.map +1 -1
  175. package/js/x-modules/scroll/components/scroll.vue_rollup-plugin-vue=script.js +2 -9
  176. package/js/x-modules/scroll/components/scroll.vue_rollup-plugin-vue=script.js.map +1 -1
  177. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js +5 -1
  178. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue=script.js.map +1 -1
  179. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js +5 -1
  180. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue=script.js.map +1 -1
  181. package/js/x-modules/search/components/sort.mixin.js +5 -1
  182. package/js/x-modules/search/components/sort.mixin.js.map +1 -1
  183. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js +5 -1
  184. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue=script.js.map +1 -1
  185. package/js/x-modules/search/store/actions/increase-page-apending-results.action.js +1 -1
  186. package/js/x-modules/search/store/actions/increase-page-apending-results.action.js.map +1 -1
  187. package/js/x-modules/search/store/actions/reset-state.action.js +32 -0
  188. package/js/x-modules/search/store/actions/reset-state.action.js.map +1 -0
  189. package/js/x-modules/search/store/emitters.js +6 -0
  190. package/js/x-modules/search/store/emitters.js.map +1 -1
  191. package/js/x-modules/search/store/module.js +2 -0
  192. package/js/x-modules/search/store/module.js.map +1 -1
  193. package/js/x-modules/search/wiring.js +15 -32
  194. package/js/x-modules/search/wiring.js.map +1 -1
  195. package/js/x-modules/tagging/store/emitters.js +2 -4
  196. package/js/x-modules/tagging/store/emitters.js.map +1 -1
  197. package/js/x-modules/tagging/store/module.js +5 -1
  198. package/js/x-modules/tagging/store/module.js.map +1 -1
  199. package/js/x-modules/tagging/wiring.js +15 -6
  200. package/js/x-modules/tagging/wiring.js.map +1 -1
  201. package/package.json +4 -4
  202. package/report/x-adapter.api.json +26 -0
  203. package/report/x-components.api.json +589 -292
  204. package/report/x-components.api.md +68 -35
  205. package/report/x-types.api.json +28 -1
  206. package/search/index.js +1 -1
  207. package/tagging/index.js +1 -1
  208. package/types/components/icons/arrow-down.vue.d.ts +3 -0
  209. package/types/components/icons/arrow-down.vue.d.ts.map +1 -0
  210. package/types/components/icons/arrow-left.vue.d.ts +3 -0
  211. package/types/components/icons/arrow-left.vue.d.ts.map +1 -0
  212. package/types/components/icons/arrow-right.vue.d.ts +3 -0
  213. package/types/components/icons/arrow-right.vue.d.ts.map +1 -0
  214. package/types/components/icons/arrow-up.vue.d.ts +3 -0
  215. package/types/components/icons/arrow-up.vue.d.ts.map +1 -0
  216. package/types/components/icons/grid-2-rows.vue.d.ts +3 -0
  217. package/types/components/icons/grid-2-rows.vue.d.ts.map +1 -0
  218. package/types/components/icons/index.d.ts +5 -1
  219. package/types/components/icons/index.d.ts.map +1 -1
  220. package/types/components/scroll/scroll.mixin.d.ts +7 -0
  221. package/types/components/scroll/scroll.mixin.d.ts.map +1 -1
  222. package/types/components/sliding-panel.vue.d.ts +35 -18
  223. package/types/components/sliding-panel.vue.d.ts.map +1 -1
  224. package/types/utils/object.d.ts +11 -0
  225. package/types/utils/object.d.ts.map +1 -1
  226. package/types/wiring/wiring.types.d.ts +2 -0
  227. package/types/wiring/wiring.types.d.ts.map +1 -1
  228. package/types/x-modules/facets/wiring.d.ts +3 -0
  229. package/types/x-modules/facets/wiring.d.ts.map +1 -1
  230. package/types/x-modules/next-queries/components/next-queries.vue.d.ts +6 -0
  231. package/types/x-modules/next-queries/components/next-queries.vue.d.ts.map +1 -1
  232. package/types/x-modules/next-queries/components/next-query.vue.d.ts +14 -0
  233. package/types/x-modules/next-queries/components/next-query.vue.d.ts.map +1 -1
  234. package/types/x-modules/related-tags/wiring.d.ts +3 -0
  235. package/types/x-modules/related-tags/wiring.d.ts.map +1 -1
  236. package/types/x-modules/scroll/components/scroll.vue.d.ts +2 -17
  237. package/types/x-modules/scroll/components/scroll.vue.d.ts.map +1 -1
  238. package/types/x-modules/search/events.types.d.ts +5 -0
  239. package/types/x-modules/search/events.types.d.ts.map +1 -1
  240. package/types/x-modules/search/store/actions/reset-state.action.d.ts +11 -0
  241. package/types/x-modules/search/store/actions/reset-state.action.d.ts.map +1 -0
  242. package/types/x-modules/search/store/emitters.d.ts +4 -0
  243. package/types/x-modules/search/store/emitters.d.ts.map +1 -1
  244. package/types/x-modules/search/store/module.d.ts.map +1 -1
  245. package/types/x-modules/search/store/types.d.ts +7 -1
  246. package/types/x-modules/search/store/types.d.ts.map +1 -1
  247. package/types/x-modules/search/types.d.ts +10 -0
  248. package/types/x-modules/search/types.d.ts.map +1 -1
  249. package/types/x-modules/search/wiring.d.ts +37 -59
  250. package/types/x-modules/search/wiring.d.ts.map +1 -1
  251. package/types/x-modules/tagging/events.types.d.ts +6 -0
  252. package/types/x-modules/tagging/events.types.d.ts.map +1 -1
  253. package/types/x-modules/tagging/store/emitters.d.ts +1 -0
  254. package/types/x-modules/tagging/store/emitters.d.ts.map +1 -1
  255. package/types/x-modules/tagging/store/module.d.ts.map +1 -1
  256. package/types/x-modules/tagging/store/types.d.ts +10 -0
  257. package/types/x-modules/tagging/store/types.d.ts.map +1 -1
  258. package/types/x-modules/tagging/wiring.d.ts +14 -5
  259. package/types/x-modules/tagging/wiring.d.ts.map +1 -1
  260. package/docs/API-reference/api/x-components.scroll.distancetobottom.md +0 -13
  261. package/docs/API-reference/api/x-components.scroll.throttlems.md +0 -13
  262. package/docs/API-reference/api/x-components.slidingpanel._refs.md +0 -15
  263. package/docs/API-reference/api/x-components.slidingpanel.beforedestroy.md +0 -15
  264. package/docs/API-reference/api/x-components.slidingpanel.isscrollatend.md +0 -13
  265. package/docs/API-reference/api/x-components.slidingpanel.isscrollatstart.md +0 -13
  266. package/docs/API-reference/api/x-components.slidingpanel.mounted.md +0 -15
  267. package/docs/API-reference/api/x-components.slidingpanel.scrollobserver.md +0 -13
  268. package/docs/API-reference/components/common/icons/x-components.arrow.md +0 -7
  269. package/js/components/icons/arrow.vue.js.map +0 -1
  270. package/js/components/icons/arrow.vue_rollup-plugin-vue=script.js +0 -4
  271. package/js/components/icons/arrow.vue_rollup-plugin-vue=script.js.map +0 -1
  272. package/types/components/icons/arrow.vue.d.ts +0 -3
  273. package/types/components/icons/arrow.vue.d.ts.map +0 -1
@@ -0,0 +1,61 @@
1
+ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
+ import script from './arrow-right.vue_rollup-plugin-vue=script.js';
3
+
4
+ /* script */
5
+ var __vue_script__ = script;
6
+
7
+ /* template */
8
+ var __vue_render__ = function (_h, _vm) {
9
+ var _c = _vm._c;
10
+ return _c(
11
+ "svg",
12
+ {
13
+ class: ["x-icon"].concat(_vm.data.staticClass, _vm.data.class),
14
+ attrs: {
15
+ viewBox: "0 0 16 16",
16
+ version: "1.1",
17
+ xmlns: "http://www.w3.org/2000/svg",
18
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
19
+ },
20
+ },
21
+ [
22
+ _c("g", { attrs: { fill: "none", "fill-rule": "evenodd" } }, [
23
+ _c("line", { attrs: { x1: "13", y1: "8", x2: "3", y2: "8" } }),
24
+ _vm._v(" "),
25
+ _c("polyline", { attrs: { points: "8 13 13 8 8 3" } }) ]) ]
26
+ )
27
+ };
28
+ var __vue_staticRenderFns__ = [];
29
+ __vue_render__._withStripped = true;
30
+
31
+ /* style */
32
+ var __vue_inject_styles__ = undefined;
33
+ /* scoped */
34
+ var __vue_scope_id__ = undefined;
35
+ /* module identifier */
36
+ var __vue_module_identifier__ = undefined;
37
+ /* functional template */
38
+ var __vue_is_functional_template__ = true;
39
+ /* style inject */
40
+
41
+ /* style inject SSR */
42
+
43
+ /* style inject shadow dom */
44
+
45
+
46
+
47
+ var __vue_component__ = /*#__PURE__*/__vue_normalize__(
48
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
49
+ __vue_inject_styles__,
50
+ __vue_script__,
51
+ __vue_scope_id__,
52
+ __vue_is_functional_template__,
53
+ __vue_module_identifier__,
54
+ false,
55
+ undefined,
56
+ undefined,
57
+ undefined
58
+ );
59
+
60
+ export default __vue_component__;
61
+ //# sourceMappingURL=arrow-right.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-right.vue.js","sources":["../../../../src/components/icons/arrow-right.vue"],"sourcesContent":["<template functional>\n <svg\n :class=\"['x-icon'].concat(data.staticClass, data.class)\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <line x1=\"13\" y1=\"8\" x2=\"3\" y2=\"8\" />\n <polyline points=\"8 13 13 8 8 3\" />\n </g>\n </svg>\n</template>\n\n<script lang=\"ts\">\n export default {};\n</script>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ var script = {};
2
+
3
+ export default script;
4
+ //# sourceMappingURL=arrow-right.vue_rollup-plugin-vue=script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-right.vue_rollup-plugin-vue=script.js","sources":["../../../../src/components/icons/arrow-right.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nexport default {};\n"],"names":[],"mappings":"AAgBA,aAAe,EAAE;;;;"}
@@ -0,0 +1,61 @@
1
+ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
+ import script from './arrow-up.vue_rollup-plugin-vue=script.js';
3
+
4
+ /* script */
5
+ var __vue_script__ = script;
6
+
7
+ /* template */
8
+ var __vue_render__ = function (_h, _vm) {
9
+ var _c = _vm._c;
10
+ return _c(
11
+ "svg",
12
+ {
13
+ class: ["x-icon"].concat(_vm.data.staticClass, _vm.data.class),
14
+ attrs: {
15
+ viewBox: "0 0 16 16",
16
+ version: "1.1",
17
+ xmlns: "http://www.w3.org/2000/svg",
18
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
19
+ },
20
+ },
21
+ [
22
+ _c("g", { attrs: { fill: "none", "fill-rule": "evenodd" } }, [
23
+ _c("line", { attrs: { x1: "8", y1: "13", x2: "8", y2: "3" } }),
24
+ _vm._v(" "),
25
+ _c("polyline", { attrs: { points: "3 8 8 3 13 8" } }) ]) ]
26
+ )
27
+ };
28
+ var __vue_staticRenderFns__ = [];
29
+ __vue_render__._withStripped = true;
30
+
31
+ /* style */
32
+ var __vue_inject_styles__ = undefined;
33
+ /* scoped */
34
+ var __vue_scope_id__ = undefined;
35
+ /* module identifier */
36
+ var __vue_module_identifier__ = undefined;
37
+ /* functional template */
38
+ var __vue_is_functional_template__ = true;
39
+ /* style inject */
40
+
41
+ /* style inject SSR */
42
+
43
+ /* style inject shadow dom */
44
+
45
+
46
+
47
+ var __vue_component__ = /*#__PURE__*/__vue_normalize__(
48
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
49
+ __vue_inject_styles__,
50
+ __vue_script__,
51
+ __vue_scope_id__,
52
+ __vue_is_functional_template__,
53
+ __vue_module_identifier__,
54
+ false,
55
+ undefined,
56
+ undefined,
57
+ undefined
58
+ );
59
+
60
+ export default __vue_component__;
61
+ //# sourceMappingURL=arrow-up.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-up.vue.js","sources":["../../../../src/components/icons/arrow-up.vue"],"sourcesContent":["<template functional>\n <svg\n :class=\"['x-icon'].concat(data.staticClass, data.class)\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <line x1=\"8\" y1=\"13\" x2=\"8\" y2=\"3\" />\n <polyline points=\"3 8 8 3 13 8\" />\n </g>\n </svg>\n</template>\n\n<script lang=\"ts\">\n export default {};\n</script>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ var script = {};
2
+
3
+ export default script;
4
+ //# sourceMappingURL=arrow-up.vue_rollup-plugin-vue=script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-up.vue_rollup-plugin-vue=script.js","sources":["../../../../src/components/icons/arrow-up.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nexport default {};\n"],"names":[],"mappings":"AAgBA,aAAe,EAAE;;;;"}
@@ -0,0 +1,65 @@
1
+ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
+ import script from './grid-2-rows.vue_rollup-plugin-vue=script.js';
3
+
4
+ /* script */
5
+ var __vue_script__ = script;
6
+
7
+ /* template */
8
+ var __vue_render__ = function (_h, _vm) {
9
+ var _c = _vm._c;
10
+ return _c(
11
+ "svg",
12
+ {
13
+ class: ["x-icon"].concat(_vm.data.staticClass, _vm.data.class),
14
+ attrs: {
15
+ viewBox: "0 0 16 16",
16
+ version: "1.1",
17
+ xmlns: "http://www.w3.org/2000/svg",
18
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
19
+ },
20
+ },
21
+ [
22
+ _c("g", { attrs: { fill: "none", "fill-rule": "evenodd" } }, [
23
+ _c("rect", {
24
+ attrs: { x: "2.5", y: "2.5", width: "11", height: "4.4" },
25
+ }),
26
+ _vm._v(" "),
27
+ _c("rect", {
28
+ attrs: { x: "2.5", y: "9.1", width: "11", height: "4.4" },
29
+ }) ]) ]
30
+ )
31
+ };
32
+ var __vue_staticRenderFns__ = [];
33
+ __vue_render__._withStripped = true;
34
+
35
+ /* style */
36
+ var __vue_inject_styles__ = undefined;
37
+ /* scoped */
38
+ var __vue_scope_id__ = undefined;
39
+ /* module identifier */
40
+ var __vue_module_identifier__ = undefined;
41
+ /* functional template */
42
+ var __vue_is_functional_template__ = true;
43
+ /* style inject */
44
+
45
+ /* style inject SSR */
46
+
47
+ /* style inject shadow dom */
48
+
49
+
50
+
51
+ var __vue_component__ = /*#__PURE__*/__vue_normalize__(
52
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
53
+ __vue_inject_styles__,
54
+ __vue_script__,
55
+ __vue_scope_id__,
56
+ __vue_is_functional_template__,
57
+ __vue_module_identifier__,
58
+ false,
59
+ undefined,
60
+ undefined,
61
+ undefined
62
+ );
63
+
64
+ export default __vue_component__;
65
+ //# sourceMappingURL=grid-2-rows.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-2-rows.vue.js","sources":["../../../../src/components/icons/grid-2-rows.vue"],"sourcesContent":["<template functional>\n <svg\n :class=\"['x-icon'].concat(data.staticClass, data.class)\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <rect x=\"2.5\" y=\"2.5\" width=\"11\" height=\"4.4\" />\n <rect x=\"2.5\" y=\"9.1\" width=\"11\" height=\"4.4\" />\n </g>\n </svg>\n</template>\n\n<script lang=\"ts\">\n export default {};\n</script>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ var script = {};
2
+
3
+ export default script;
4
+ //# sourceMappingURL=grid-2-rows.vue_rollup-plugin-vue=script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-2-rows.vue_rollup-plugin-vue=script.js","sources":["../../../../src/components/icons/grid-2-rows.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nexport default {};\n"],"names":[],"mappings":"AAgBA,aAAe,EAAE;;;;"}
@@ -16,7 +16,7 @@ var __vue_render__ = function (_h, _vm) {
16
16
  [
17
17
  _c("path", {
18
18
  attrs: {
19
- d: "m6.336 13.594 4.143 4.144a1.155 1.155 0 0 0 1.635 0l4.963-4.959V7h-5.778l-4.963 4.964a1.156 1.156 0 0 0 0 1.63zM14.188 9.89h-.006",
19
+ d: "m6.3 13.6 4.1 4.1a1.2 1.2 0 0 0 1.6 0l5-5V7h-5.8l-5 5a1.1 1.1 0 0 0 0 1.6zM14.1 9.9h-0",
20
20
  "stroke-linecap": "round",
21
21
  "stroke-linejoin": "round",
22
22
  },
@@ -1 +1 @@
1
- {"version":3,"file":"tag.vue.js","sources":["../../../../src/components/icons/tag.vue"],"sourcesContent":["<template functional>\n <svg :class=\"['x-icon'].concat(data.staticClass, data.class)\" viewBox=\"0 0 24 24\">\n <!-- eslint-disable max-len -->\n <path\n d=\"m6.336 13.594 4.143 4.144a1.155 1.155 0 0 0 1.635 0l4.963-4.959V7h-5.778l-4.963 4.964a1.156 1.156 0 0 0 0 1.63zM14.188 9.89h-.006\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</template>\n\n<script lang=\"ts\">\n export default {};\n</script>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"tag.vue.js","sources":["../../../../src/components/icons/tag.vue"],"sourcesContent":["<template functional>\n <svg :class=\"['x-icon'].concat(data.staticClass, data.class)\" viewBox=\"0 0 24 24\">\n <!-- eslint-disable max-len -->\n <path\n d=\"m6.3 13.6 4.1 4.1a1.2 1.2 0 0 0 1.6 0l5-5V7h-5.8l-5 5a1.1 1.1 0 0 0 0 1.6zM14.1 9.9h-0\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</template>\n\n<script lang=\"ts\">\n export default {};\n</script>\n"],"names":["const"],"mappings":";;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -27,11 +27,11 @@ __vue_render__._withStripped = true;
27
27
  /* style */
28
28
  var __vue_inject_styles__ = function (inject) {
29
29
  if (!inject) { return }
30
- inject("data-v-3b6a5d44_0", { source: ".x-base-scroll[data-v-3b6a5d44] {\n overflow-y: var(--x-string-overflow-scroll, auto);\n}", map: undefined, media: undefined });
30
+ inject("data-v-437d066c_0", { source: ".x-base-scroll[data-v-437d066c] {\n overflow-y: var(--x-string-overflow-scroll, auto);\n}", map: undefined, media: undefined });
31
31
 
32
32
  };
33
33
  /* scoped */
34
- var __vue_scope_id__ = "data-v-3b6a5d44";
34
+ var __vue_scope_id__ = "data-v-437d066c";
35
35
  /* module identifier */
36
36
  var __vue_module_identifier__ = undefined;
37
37
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"base-scroll.vue.js","sources":["../../../../src/components/scroll/base-scroll.vue"],"sourcesContent":["<template>\n <div @scroll=\"throttledStoreScrollData\" class=\"x-scroll x-base-scroll\" data-test=\"base-scroll\">\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { mixins } from 'vue-class-component';\n import { Component } from 'vue-property-decorator';\n import ScrollMixin from './scroll.mixin';\n\n /**\n * Base scroll component that depending on the user interactivity emits different events for\n * knowing when the user scrolls, the direction of scroll and if user reaches the start or end.\n *\n * @public\n */\n @Component\n export default class BaseScroll extends mixins(ScrollMixin) {}\n</script>\n\n<style lang=\"scss\" scoped>\n .x-base-scroll {\n overflow-y: var(--x-string-overflow-scroll, auto);\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThe BaseScroll is a component that manage the states of scroll of a specified element. The component\ndoes the necessary calculations for knowing the direction of scroll, if the scroll has reached to\nstart or to end, and is about to reaching to end. The components emits the next events depending of\nmovement that realize the user:\n\n```vue\n<template>\n <BaseScroll\n @scroll=\"scroll\"\n @scroll:direction-change=\"scrollDirectionChange\"\n @scroll:at-start=\"scrollAtStart\"\n @scroll:almost-at-end=\"scrollAlmostAtEnd\"\n @scroll:at-end=\"scrollAtEnd\"\n throttleMs=\"1000\"\n distanceToBottom=\"200\"\n >\n <template>\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </template>\n </BaseScroll>\n</template>\n\n<script>\n import { BaseScroll } from '@empathyco/x-components';\n\n export default {\n name: 'ScrollTest',\n components: {\n BaseScroll\n },\n methods: {\n scroll(position) {\n console.log('scroll', position);\n },\n scrollDirectionChange(direction) {\n console.log('scroll:direction-change', direction);\n },\n scrollAtStart() {\n console.log('scroll:at-start');\n },\n scrollAlmostAtEnd(distance) {\n console.log('scroll:almost-at-end', distance);\n },\n scrollAtEnd() {\n console.log('scroll:at-end');\n }\n }\n };\n</script>\n```\n\n### Avoid reset scroll on query change\n\nSet to false the reset scroll on query change feature which is true by default.\n\n```vue\n<template>\n <BaseScroll\n @scroll=\"scroll\"\n @scroll:direction-change=\"scrollDirectionChange\"\n @scroll:at-start=\"scrollAtStart\"\n @scroll:almost-at-end=\"scrollAlmostAtEnd\"\n @scroll:at-end=\"scrollAtEnd\"\n throttleMs=\"1000\"\n distanceToBottom=\"200\"\n >\n <template>\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </template>\n </BaseScroll>\n</template>\n\n<script>\n import { BaseScroll } from '@empathyco/x-components';\n\n export default {\n name: 'ScrollTest',\n components: {\n BaseScroll\n },\n methods: {\n scroll(position) {\n console.log('scroll', position);\n },\n scrollDirectionChange(direction) {\n console.log('scroll:direction-change', direction);\n },\n scrollAtStart() {\n console.log('scroll:at-start');\n },\n scrollAlmostAtEnd(distance) {\n console.log('scroll:almost-at-end', distance);\n },\n scrollAtEnd() {\n console.log('scroll:at-end');\n }\n }\n };\n</script>\n```\n\n## Vue Events:\n\n- `scroll`: the event is emitted after the user scrolls in this container. The payload is the scroll\n top distance in pixels.\n- `scroll:direction-change`: the event is emitted when the user changes the scroll direction. The\n payload is the new scrolling direction.\n- `scroll:at-start`: the event is emitted when the user scrolls up to the initial position of the\n scroll.\n- `scroll:almost-at-end`: the event is emitted when the user is about to reach the bottom part of\n the scroll.\n- `scroll:at-end`: the event is emitted when the user has reached the bottom part of the scroll.\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-scroll.vue.js","sources":["../../../../src/components/scroll/base-scroll.vue"],"sourcesContent":["<template>\n <div @scroll=\"throttledStoreScrollData\" class=\"x-scroll x-base-scroll\" data-test=\"base-scroll\">\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { mixins } from 'vue-class-component';\n import { Component } from 'vue-property-decorator';\n import ScrollMixin from './scroll.mixin';\n\n /**\n * Base scroll component that depending on the user interactivity emits different events for\n * knowing when the user scrolls, the direction of scroll and if user reaches the start or end.\n *\n * @public\n */\n @Component\n export default class BaseScroll extends mixins(ScrollMixin) {}\n</script>\n\n<style lang=\"scss\" scoped>\n .x-base-scroll {\n overflow-y: var(--x-string-overflow-scroll, auto);\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThe `BaseScroll` is a component that manages the state of scroll of a specified element. The\ncomponent does the necessary calculations for knowing the direction of scroll, if the scroll has\nreached to start or to end, and is about to reaching to end. The components emits the next events\ndepending of movement that realize the user:\n\n```vue\n<template>\n <BaseScroll\n @scroll=\"scroll\"\n @scroll:direction-change=\"scrollDirectionChange\"\n @scroll:at-start=\"scrollAtStart\"\n @scroll:almost-at-end=\"scrollAlmostAtEnd\"\n @scroll:at-end=\"scrollAtEnd\"\n :throttleMs=\"1000\"\n :distanceToBottom=\"200\"\n >\n <template>\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </template>\n </BaseScroll>\n</template>\n\n<script>\n import { BaseScroll } from '@empathyco/x-components';\n\n export default {\n name: 'ScrollTest',\n components: {\n BaseScroll\n },\n methods: {\n scroll(position) {\n console.log('scroll', position);\n },\n scrollDirectionChange(direction) {\n console.log('scroll:direction-change', direction);\n },\n scrollAtStart() {\n console.log('scroll:at-start');\n },\n scrollAlmostAtEnd(distance) {\n console.log('scroll:almost-at-end', distance);\n },\n scrollAtEnd() {\n console.log('scroll:at-end');\n }\n }\n };\n</script>\n```\n\n### Avoid reset scroll on query change\n\nSet to false the reset scroll on query change feature which is true by default.\n\n```vue\n<template>\n <BaseScroll @scroll=\"scroll\" :resetOnChange=\"false\">\n <template>\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </template>\n </BaseScroll>\n</template>\n\n<script>\n import { BaseScroll } from '@empathyco/x-components';\n\n export default {\n name: 'ScrollTest',\n components: {\n BaseScroll\n },\n methods: {\n scroll(position) {\n console.log('scroll', position);\n }\n }\n };\n</script>\n```\n\n### Reset scroll\n\nYou can configure which events reset the scroll position using the `resetOn` prop.\n\n```vue\n<template>\n <BaseScroll @scroll=\"scroll\" :resetOn=\"resetScrollEvents\">\n <template>\n <div class=\"content-scroll\">\n <span>content1</span>\n <span>content1</span>\n </div>\n </template>\n </BaseScroll>\n</template>\n\n<script>\n import { BaseScroll } from '@empathyco/x-components';\n\n export default {\n name: 'ScrollTest',\n components: {\n BaseScroll\n },\n data() {\n return {\n resetScrollEvents: ['UserAcceptedAQuery']\n };\n },\n methods: {\n scroll(position) {\n console.log('scroll', position);\n }\n }\n };\n</script>\n```\n\n## Vue Events:\n\n- `scroll`: the event is emitted after the user scrolls in this container. The payload is the scroll\n top distance in pixels.\n- `scroll:direction-change`: the event is emitted when the user changes the scroll direction. The\n payload is the new scrolling direction.\n- `scroll:at-start`: the event is emitted when the user scrolls up to the initial position of the\n scroll.\n- `scroll:almost-at-end`: the event is emitted when the user is about to reach the bottom part of\n the scroll.\n- `scroll:at-end`: the event is emitted when the user has reached the bottom part of the scroll.\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -237,12 +237,18 @@ var ScrollMixin = /** @class */ (function (_super) {
237
237
  Prop({ type: Boolean, default: true })
238
238
  ], ScrollMixin.prototype, "resetOnChange", void 0);
239
239
  __decorate([
240
- XOn([
241
- 'SearchBoxQueryChanged',
242
- 'SortChanged',
243
- 'SelectedFiltersChanged',
244
- 'SelectedRelatedTagsChanged'
245
- ])
240
+ Prop({
241
+ default: function () { return [
242
+ 'SearchBoxQueryChanged',
243
+ 'SortChanged',
244
+ 'SelectedFiltersChanged',
245
+ 'SelectedRelatedTagsChanged',
246
+ 'UserChangedExtraParams'
247
+ ]; }
248
+ })
249
+ ], ScrollMixin.prototype, "resetOn", void 0);
250
+ __decorate([
251
+ XOn(function (instance) { return instance.resetOn; })
246
252
  ], ScrollMixin.prototype, "resetScroll", null);
247
253
  __decorate([
248
254
  Watch('currentPosition')
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.mixin.js","sources":["../../../../src/components/scroll/scroll.mixin.ts"],"sourcesContent":["import Vue from 'vue';\nimport { Component, Prop, Watch } from 'vue-property-decorator';\nimport { throttle } from '../../utils/throttle';\nimport { XOn } from '../decorators/bus.decorators';\nimport { ScrollDirection } from './scroll.types';\n\n/**\n * Mixin to share Scroll logic.\n *\n * @public\n */\n@Component\n/* eslint-disable @typescript-eslint/unbound-method */\nexport default class ScrollMixin extends Vue {\n /**\n * The scrolling container reference.\n *\n * @public\n */\n public $el!: HTMLElement;\n /**\n * Distance to the end of the scroll that when reached will emit the\n * `scroll:about-to-end` event.\n *\n * @public\n */\n @Prop({ default: 100 })\n public distanceToBottom!: number;\n /**\n * Positive vertical distance to still consider that the an element is the first one visible.\n * For example, if set to 100, after scrolling 100 pixels, the first rendered element\n * will still be considered the first one.\n */\n @Prop({ default: 100 })\n public firstElementThresholdPx!: number;\n /**\n * Time duration to ignore the subsequent scroll events after an emission.\n * Higher values will decrease events precision but can prevent performance issues.\n *\n * @public\n */\n @Prop({ default: 100 })\n public throttleMs!: number;\n\n /**\n * If true (default), sets the scroll position to the top when certain events are emitted.\n *\n * @public\n */\n @Prop({ type: Boolean, default: true })\n protected resetOnChange!: boolean;\n /**\n * Property for getting the client height of scroll.\n *\n * @internal\n */\n protected clientHeight = 0;\n /**\n * Property for getting the current position of scroll.\n *\n * @internal\n */\n protected currentPosition = 0;\n /**\n * Property for getting the direction of scroll.\n *\n * @internal\n */\n protected direction!: ScrollDirection;\n /**\n * Property for getting the previous position of scroll.\n *\n * @internal\n */\n protected previousPosition = 0;\n /**\n * Property for getting the scroll height.\n *\n * @internal\n */\n protected scrollHeight = 0;\n\n /**\n * Throttled version of the function that stores the DOM scroll related properties.\n * The duration of the throttle is configured through the\n * {@link ScrollMixin.throttleMs}.\n *\n * @returns A throttled version of the function to store the scroll data.\n * @internal\n */\n protected get throttledStoreScrollData(): () => void {\n return throttle(this.storeScrollData, this.throttleMs);\n }\n\n /**\n * Returns distance missing to end position position.\n *\n * @returns A number for knowing the distance missing to end position position.\n * @internal\n */\n protected get distanceToEnd(): number {\n return this.scrollEndPosition - this.currentPosition;\n }\n\n /**\n * Returns `true` when the amount of pixels scrolled is greater than\n * the {@link ScrollMixin.distanceToBottom}.\n *\n * @returns A boolean for knowing if the user is about to reaching to the end.\n * @internal\n */\n protected get hasScrollAlmostReachedEnd(): boolean {\n return !this.hasScrollReachedStart && this.distanceToBottom > this.distanceToEnd;\n }\n\n /**\n * Returns `true` when there is no more content to scroll.\n *\n * @returns A boolean for knowing if the user scrolls to the end.\n * @internal\n */\n protected get hasScrollReachedEnd(): boolean {\n return this.currentPosition === this.scrollEndPosition;\n }\n\n /**\n * Returns `true` when the scroll is at the initial position.\n *\n * @returns A boolean for knowing if the user scrolls to the start.\n * @internal\n */\n protected get hasScrollReachedStart(): boolean {\n return this.currentPosition === 0;\n }\n\n /**\n * Returns direction of scroll based in {@link ScrollDirection}.\n *\n * @returns The scroll direction.\n * @internal\n */\n protected get scrollDirection(): ScrollDirection {\n return this.currentPosition > this.previousPosition ? 'DOWN' : 'UP';\n }\n\n /**\n * Returns end position of scroll.\n *\n * @returns A number for knowing end position of scroll.\n * @internal\n */\n protected get scrollEndPosition(): number {\n return this.scrollHeight - this.clientHeight;\n }\n\n /**\n * Initialises DOM dependant scroll properties.\n *\n * @internal\n */\n mounted(): void {\n this.$nextTick().then(() => {\n if (!this.$el) {\n // TODO Replace with Empathy's logger\n // eslint-disable-next-line no-console\n console.warn(\n '[ScrollMixin]',\n 'Components using this mixin must set `this.$el` to the HTML node that is scrolling.'\n );\n } else {\n this.storeScrollData();\n }\n });\n }\n\n /**\n * Resets the scroll position.\n *\n * @internal\n */\n @XOn([\n 'SearchBoxQueryChanged',\n 'SortChanged',\n 'SelectedFiltersChanged',\n 'SelectedRelatedTagsChanged'\n ])\n resetScroll(): void {\n this.$nextTick().then(() => {\n if (this.resetOnChange) {\n this.$el.scrollTo({ top: 0 });\n }\n });\n }\n\n /**\n * Emits the `scroll` event.\n *\n * @param _newScrollPosition - The new position of scroll.\n * @param oldScrollPosition - The old position of scroll.\n * @internal\n */\n @Watch('currentPosition')\n protected emitScroll(_newScrollPosition: number, oldScrollPosition: number): void {\n this.$emit('scroll', this.currentPosition);\n this.previousPosition = oldScrollPosition;\n }\n\n /**\n * Emits the 'scroll:at-start' event when the user reaches the start.\n *\n * @param isScrollAtStart - For knowing if the user reaches at start.\n * @internal\n */\n @Watch('hasScrollReachedStart')\n protected emitScrollReachedAtStart(isScrollAtStart: boolean): void {\n this.$emit('scroll:at-start', isScrollAtStart);\n }\n\n /**\n * Emits the 'scroll:almost-at-end' event when the user is about to reach to end.\n *\n * @param isScrollAlmostAtEnd - For knowing if the user is about to reach to end.\n * @internal\n */\n @Watch('hasScrollAlmostReachedEnd')\n protected emitScrollAlmostAtEnd(isScrollAlmostAtEnd: boolean): void {\n this.$emit('scroll:almost-at-end', isScrollAlmostAtEnd);\n }\n\n /**\n * Emits the 'scroll:at-end' event when the user reaches the end.\n *\n * @param isScrollAtEnd - For knowing if the user reaches at end.\n * @internal\n */\n @Watch('hasScrollReachedEnd')\n protected emitScrollAtEnd(isScrollAtEnd: boolean): void {\n this.$emit('scroll:at-end', isScrollAtEnd);\n }\n\n /**\n * Emits the `scroll:direction-change` event when the scrolling direction has changed.\n *\n * @param direction - The new direction of scroll.\n * @internal\n */\n @Watch('scrollDirection')\n protected emitScrollDirection(direction: ScrollDirection): void {\n this.$emit('scroll:direction-change', direction);\n }\n\n /**\n * Updates scroll related properties.\n *\n * @internal\n */\n protected storeScrollData(): void {\n if (this.$el) {\n this.currentPosition = this.$el.scrollTop;\n this.scrollHeight = this.$el.scrollHeight;\n this.clientHeight = this.$el.clientHeight;\n }\n }\n}\n/* eslint-enable @typescript-eslint/unbound-method */\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"scroll.mixin.js","sources":["../../../../src/components/scroll/scroll.mixin.ts"],"sourcesContent":["import Vue from 'vue';\nimport { Component, Prop, Watch } from 'vue-property-decorator';\nimport { throttle } from '../../utils/throttle';\nimport { XEvent } from '../../wiring/events.types';\nimport { XOn } from '../decorators/bus.decorators';\nimport { ScrollDirection } from './scroll.types';\n\n/**\n * Mixin to share Scroll logic.\n *\n * @public\n */\n@Component\n/* eslint-disable @typescript-eslint/unbound-method */\nexport default class ScrollMixin extends Vue {\n /**\n * The scrolling container reference.\n *\n * @public\n */\n public $el!: HTMLElement;\n /**\n * Distance to the end of the scroll that when reached will emit the\n * `scroll:about-to-end` event.\n *\n * @public\n */\n @Prop({ default: 100 })\n public distanceToBottom!: number;\n /**\n * Positive vertical distance to still consider that the an element is the first one visible.\n * For example, if set to 100, after scrolling 100 pixels, the first rendered element\n * will still be considered the first one.\n */\n @Prop({ default: 100 })\n public firstElementThresholdPx!: number;\n /**\n * Time duration to ignore the subsequent scroll events after an emission.\n * Higher values will decrease events precision but can prevent performance issues.\n *\n * @public\n */\n @Prop({ default: 100 })\n public throttleMs!: number;\n\n /**\n * If true (default), sets the scroll position to the top when certain events are emitted.\n *\n * @public\n */\n @Prop({ type: Boolean, default: true })\n protected resetOnChange!: boolean;\n\n /**\n * List of events that should reset the scroll when emitted.\n *\n * @public\n */\n @Prop({\n default: () => [\n 'SearchBoxQueryChanged',\n 'SortChanged',\n 'SelectedFiltersChanged',\n 'SelectedRelatedTagsChanged',\n 'UserChangedExtraParams'\n ]\n })\n public resetOn!: XEvent;\n\n /**\n * Property for getting the client height of scroll.\n *\n * @internal\n */\n protected clientHeight = 0;\n /**\n * Property for getting the current position of scroll.\n *\n * @internal\n */\n protected currentPosition = 0;\n /**\n * Property for getting the direction of scroll.\n *\n * @internal\n */\n protected direction!: ScrollDirection;\n /**\n * Property for getting the previous position of scroll.\n *\n * @internal\n */\n protected previousPosition = 0;\n /**\n * Property for getting the scroll height.\n *\n * @internal\n */\n protected scrollHeight = 0;\n\n /**\n * Throttled version of the function that stores the DOM scroll related properties.\n * The duration of the throttle is configured through the\n * {@link ScrollMixin.throttleMs}.\n *\n * @returns A throttled version of the function to store the scroll data.\n * @internal\n */\n protected get throttledStoreScrollData(): () => void {\n return throttle(this.storeScrollData, this.throttleMs);\n }\n\n /**\n * Returns distance missing to end position position.\n *\n * @returns A number for knowing the distance missing to end position position.\n * @internal\n */\n protected get distanceToEnd(): number {\n return this.scrollEndPosition - this.currentPosition;\n }\n\n /**\n * Returns `true` when the amount of pixels scrolled is greater than\n * the {@link ScrollMixin.distanceToBottom}.\n *\n * @returns A boolean for knowing if the user is about to reaching to the end.\n * @internal\n */\n protected get hasScrollAlmostReachedEnd(): boolean {\n return !this.hasScrollReachedStart && this.distanceToBottom > this.distanceToEnd;\n }\n\n /**\n * Returns `true` when there is no more content to scroll.\n *\n * @returns A boolean for knowing if the user scrolls to the end.\n * @internal\n */\n protected get hasScrollReachedEnd(): boolean {\n return this.currentPosition === this.scrollEndPosition;\n }\n\n /**\n * Returns `true` when the scroll is at the initial position.\n *\n * @returns A boolean for knowing if the user scrolls to the start.\n * @internal\n */\n protected get hasScrollReachedStart(): boolean {\n return this.currentPosition === 0;\n }\n\n /**\n * Returns direction of scroll based in {@link ScrollDirection}.\n *\n * @returns The scroll direction.\n * @internal\n */\n protected get scrollDirection(): ScrollDirection {\n return this.currentPosition > this.previousPosition ? 'DOWN' : 'UP';\n }\n\n /**\n * Returns end position of scroll.\n *\n * @returns A number for knowing end position of scroll.\n * @internal\n */\n protected get scrollEndPosition(): number {\n return this.scrollHeight - this.clientHeight;\n }\n\n /**\n * Initialises DOM dependant scroll properties.\n *\n * @internal\n */\n mounted(): void {\n this.$nextTick().then(() => {\n if (!this.$el) {\n // TODO Replace with Empathy's logger\n // eslint-disable-next-line no-console\n console.warn(\n '[ScrollMixin]',\n 'Components using this mixin must set `this.$el` to the HTML node that is scrolling.'\n );\n } else {\n this.storeScrollData();\n }\n });\n }\n\n /**\n * Resets the scroll position.\n *\n * @internal\n */\n @XOn(instance => (instance as ScrollMixin).resetOn)\n resetScroll(): void {\n this.$nextTick().then(() => {\n if (this.resetOnChange) {\n this.$el.scrollTo({ top: 0 });\n }\n });\n }\n\n /**\n * Emits the `scroll` event.\n *\n * @param _newScrollPosition - The new position of scroll.\n * @param oldScrollPosition - The old position of scroll.\n * @internal\n */\n @Watch('currentPosition')\n protected emitScroll(_newScrollPosition: number, oldScrollPosition: number): void {\n this.$emit('scroll', this.currentPosition);\n this.previousPosition = oldScrollPosition;\n }\n\n /**\n * Emits the 'scroll:at-start' event when the user reaches the start.\n *\n * @param isScrollAtStart - For knowing if the user reaches at start.\n * @internal\n */\n @Watch('hasScrollReachedStart')\n protected emitScrollReachedAtStart(isScrollAtStart: boolean): void {\n this.$emit('scroll:at-start', isScrollAtStart);\n }\n\n /**\n * Emits the 'scroll:almost-at-end' event when the user is about to reach to end.\n *\n * @param isScrollAlmostAtEnd - For knowing if the user is about to reach to end.\n * @internal\n */\n @Watch('hasScrollAlmostReachedEnd')\n protected emitScrollAlmostAtEnd(isScrollAlmostAtEnd: boolean): void {\n this.$emit('scroll:almost-at-end', isScrollAlmostAtEnd);\n }\n\n /**\n * Emits the 'scroll:at-end' event when the user reaches the end.\n *\n * @param isScrollAtEnd - For knowing if the user reaches at end.\n * @internal\n */\n @Watch('hasScrollReachedEnd')\n protected emitScrollAtEnd(isScrollAtEnd: boolean): void {\n this.$emit('scroll:at-end', isScrollAtEnd);\n }\n\n /**\n * Emits the `scroll:direction-change` event when the scrolling direction has changed.\n *\n * @param direction - The new direction of scroll.\n * @internal\n */\n @Watch('scrollDirection')\n protected emitScrollDirection(direction: ScrollDirection): void {\n this.$emit('scroll:direction-change', direction);\n }\n\n /**\n * Updates scroll related properties.\n *\n * @internal\n */\n protected storeScrollData(): void {\n if (this.$el) {\n this.currentPosition = this.$el.scrollTop;\n this.scrollHeight = this.$el.scrollHeight;\n this.clientHeight = this.$el.clientHeight;\n }\n }\n}\n/* eslint-enable @typescript-eslint/unbound-method */\n"],"names":[],"mappings":"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"}
@@ -77,11 +77,11 @@ __vue_render__._withStripped = true;
77
77
  /* style */
78
78
  var __vue_inject_styles__ = function (inject) {
79
79
  if (!inject) { return }
80
- inject("data-v-6800b566_0", { source: ".x-sliding-panel[data-v-6800b566] {\n align-items: center;\n display: flex;\n flex-flow: row nowrap;\n height: 100%;\n position: relative;\n}\n.x-sliding-panel__button[data-v-6800b566] {\n opacity: 0;\n pointer-events: none;\n position: absolute;\n transition: all ease-out 0.2s;\n z-index: 2;\n /* To overlay the design system gradient with z-index:1 */\n}\n.x-sliding-panel__button-left[data-v-6800b566] {\n left: 0;\n}\n.x-sliding-panel__button-right[data-v-6800b566] {\n right: 0;\n}\n.x-sliding-panel__scroll[data-v-6800b566] {\n display: flex;\n flex: 100%;\n flex-flow: row nowrap;\n overflow: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n.x-sliding-panel__scroll[data-v-6800b566]::-webkit-scrollbar {\n display: none;\n}\n.x-sliding-panel:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-start) .x-sliding-panel__button-left[data-v-6800b566] {\n opacity: 1;\n pointer-events: all;\n}\n.x-sliding-panel:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-end) .x-sliding-panel__button-right[data-v-6800b566] {\n opacity: 1;\n pointer-events: all;\n}", map: undefined, media: undefined });
80
+ inject("data-v-561f2662_0", { source: ".x-sliding-panel[data-v-561f2662] {\n align-items: center;\n display: flex;\n flex-flow: row nowrap;\n height: 100%;\n position: relative;\n}\n.x-sliding-panel__button[data-v-561f2662] {\n opacity: 0;\n pointer-events: none;\n position: absolute;\n transition: all ease-out 0.2s;\n z-index: 2;\n /* To overlay the design system gradient with z-index:1 */\n}\n.x-sliding-panel__button-left[data-v-561f2662] {\n left: 0;\n}\n.x-sliding-panel__button-right[data-v-561f2662] {\n right: 0;\n}\n.x-sliding-panel__scroll[data-v-561f2662] {\n display: flex;\n flex: 100%;\n flex-flow: row nowrap;\n overflow: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n.x-sliding-panel__scroll[data-v-561f2662]::-webkit-scrollbar {\n display: none;\n}\n.x-sliding-panel:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-start) .x-sliding-panel__button-left[data-v-561f2662] {\n opacity: 1;\n pointer-events: all;\n}\n.x-sliding-panel:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-end) .x-sliding-panel__button-right[data-v-561f2662] {\n opacity: 1;\n pointer-events: all;\n}", map: undefined, media: undefined });
81
81
 
82
82
  };
83
83
  /* scoped */
84
- var __vue_scope_id__ = "data-v-6800b566";
84
+ var __vue_scope_id__ = "data-v-561f2662";
85
85
  /* module identifier */
86
86
  var __vue_module_identifier__ = undefined;
87
87
  /* functional template */
@@ -1 +1 @@
1
- {"version":3,"file":"sliding-panel.vue.js","sources":["../../../src/components/sliding-panel.vue"],"sourcesContent":["<template>\n <div v-if=\"$slots.default\" class=\"x-sliding-panel\" :class=\"cssClasses\" data-test=\"sliding-panel\">\n <button\n v-if=\"showButtons\"\n @click=\"scrollLeft\"\n class=\"x-sliding-panel__button x-sliding-panel__button-left x-button x-button--round\"\n data-test=\"sliding-panel-left-button\"\n >\n <!-- @slot Left button content -->\n <slot name=\"sliding-panel-left-button\">ᐸ</slot>\n </button>\n <div\n ref=\"scrollContainer\"\n @scroll=\"debouncedUpdateScrollPosition\"\n @transitionend=\"debouncedUpdateScrollPosition\"\n @animationend=\"debouncedUpdateScrollPosition\"\n class=\"x-list x-list--horizontal x-sliding-panel__scroll\"\n data-test=\"sliding-panel-scroll\"\n >\n <!-- @slot (Required) Sliding panel content -->\n <slot />\n </div>\n <button\n v-if=\"showButtons\"\n @click=\"scrollRight\"\n class=\"x-sliding-panel__button x-sliding-panel__button-right x-button x-button--round\"\n data-test=\"sliding-panel-right-button\"\n >\n <!-- @slot Right button content -->\n <slot name=\"sliding-panel-right-button\">ᐳ</slot>\n </button>\n </div>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { VueCSSClasses } from '../utils/types';\n import { Debounce } from './decorators/debounce.decorators';\n\n /**\n * Horizontal slide panel component. The content that is provided to this component would be\n * navigable horizontally using two navigational buttons.\n *\n * @public\n */\n @Component\n export default class SlidingPanel extends Vue {\n /**\n * Scroll factor that will dictate how much the scroll moves when pressing a navigation button.\n */\n @Prop({ default: 0.7 })\n protected scrollFactor!: number;\n\n /**\n * Would make the navigation buttons visible when they're needed or always hide them.\n */\n @Prop({ default: true })\n protected showButtons!: boolean;\n\n /**\n * MutationObserver that watches for changes inside the wrapping div to update\n * the scroll position.\n */\n protected scrollObserver = new MutationObserver(\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.restoreAndUpdateScroll\n );\n\n /**\n * Indicates if the scroll is at the start of the sliding panel.\n */\n protected isScrollAtStart = true;\n\n /**\n * Indicates if the scroll is at the end of the sliding panel.\n */\n protected isScrollAtEnd = true;\n\n /**\n * HTMLElement referencing the scroll of the component.\n */\n public $refs!: {\n scrollContainer: HTMLElement;\n };\n\n mounted(): void {\n this.scrollObserver.observe(this.$refs.scrollContainer, {\n attributes: false,\n childList: true,\n subtree: true,\n characterData: false\n });\n // eslint-disable-next-line @typescript-eslint/unbound-method\n window?.addEventListener('resize', this.debouncedUpdateScrollPosition);\n\n this.updateScrollPosition();\n }\n\n beforeDestroy(): void {\n this.scrollObserver.disconnect();\n // eslint-disable-next-line @typescript-eslint/unbound-method\n window?.removeEventListener('resize', this.debouncedUpdateScrollPosition);\n }\n\n /**\n * Resets the scroll and updates the values of the scroll for the buttons to react.\n *\n * @internal\n */\n @Debounce(100, { leading: true })\n restoreAndUpdateScroll(): void {\n this.$refs.scrollContainer.scroll({ left: 0, behavior: 'smooth' });\n this.updateScrollPosition();\n }\n\n /**\n * Updates the values of the scroll positions to show or hide the buttons depending on it.\n *\n * @internal\n */\n protected updateScrollPosition(): void {\n const { scrollLeft, clientWidth, scrollWidth } = this.$refs.scrollContainer;\n this.isScrollAtStart = !scrollLeft;\n /* The 2 px extra is to fix some cases in some resolutions where the scroll + client size is\n * less than the scroll width even when the scroll is at the end */\n this.isScrollAtEnd = scrollLeft + clientWidth + 2 >= scrollWidth;\n }\n\n /**\n * Debounced version of the {@link SlidingPanel.updateScrollPosition | updateScrollPosition}\n * method.\n *\n * @internal\n */\n @Debounce(100, { leading: true })\n debouncedUpdateScrollPosition(): void {\n this.updateScrollPosition();\n }\n\n /**\n * Scrolls the wrapper element to the left.\n *\n * @internal\n */\n protected scrollLeft(): void {\n this.scrollTo(-this.$refs.scrollContainer.clientWidth);\n }\n\n /**\n * Scrolls the wrapper element to the right.\n *\n * @internal\n */\n protected scrollRight(): void {\n this.scrollTo(this.$refs.scrollContainer.clientWidth);\n }\n\n /**\n * Scrolls the wrapper element towards the provided scroll value.\n *\n * @param scrollValue - The value the scroll will go towards.\n *\n * @remarks this function uses the scrollBy from Element and it's not available in all browsers.\n *\n * @internal\n */\n protected scrollTo(scrollValue: number): void {\n this.$refs.scrollContainer.scrollBy({\n left: scrollValue * this.scrollFactor,\n behavior: 'smooth'\n });\n }\n\n /**\n * CSS classes to apply based on the scroll position.\n *\n * @returns The CSS classes to apply.\n *\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-sliding-panel--at-start': this.isScrollAtStart,\n 'x-sliding-panel--at-end': this.isScrollAtEnd\n };\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-sliding-panel {\n align-items: center;\n display: flex;\n flex-flow: row nowrap;\n height: 100%;\n position: relative;\n\n &__button {\n opacity: 0;\n pointer-events: none;\n position: absolute;\n transition: all ease-out 0.2s;\n z-index: 2; /* To overlay the design system gradient with z-index:1 */\n\n &-left {\n left: 0;\n }\n\n &-right {\n right: 0;\n }\n }\n\n &__scroll {\n display: flex;\n flex: 100%;\n flex-flow: row nowrap;\n overflow: auto;\n scrollbar-width: none; // Firefox\n -ms-overflow-style: none; // IE\n\n // Chrome, Edge & Safari\n &::-webkit-scrollbar {\n display: none;\n }\n }\n\n &:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-start) {\n .x-sliding-panel__button-left {\n opacity: 1;\n pointer-events: all;\n }\n }\n &:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-end) {\n .x-sliding-panel__button-right {\n opacity: 1;\n pointer-events: all;\n }\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component allows for any other component or element inside it to be horizontally navigable. It\nalso implements customizable buttons as well as other minor customizations to its general behavior.\nThe component uses the method `scrollBy` from `Element` to function, and it doesn't work properly in\nall browsers. A polyfill for the `scrollBy` would be needed for the component to behave as expected\nin those browsers.\n\n### Default usage\n\nSimplest implementation of the component, just a list-based component inside its slot.\n\n```vue\n<SlidingPanel>\n <RelatedTags />\n</SlidingPanel>\n```\n\n### Behavior customization\n\nEdit how much the scroll travels when navigating with the buttons by changing the `scrollFactor`.\n\n```vue\n<SlidingPanel :scrollFactor=\"1.2\">\n <RelatedTags />\n</SlidingPanel>\n```\n\nHide the navigational buttons completely by setting the `showButtons` prop to `false`. This is\nintended to be used when other scrolling options are available, like in mobile, where you can scroll\njust by swiping.\n\n```vue\n<SlidingPanel :showButtons=\"isMobile\">\n <RelatedTags />\n</SlidingPanel>\n```\n\n### Overriding Button content\n\nBy default the buttons show an arrow depicting the direction the scroll would go to when clicked,\nbut this content can be customized with anything, from characters to SVG and images.\n\n```vue\n<SlidingPanel>\n <template #sliding-panel-left-button>\n Left\n </template>\n <RelatedTags />\n <template #sliding-panel-right-button>\n Right\n </template>\n</SlidingPanel>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"sliding-panel.vue.js","sources":["../../../src/components/sliding-panel.vue"],"sourcesContent":["<template>\n <div v-if=\"$slots.default\" class=\"x-sliding-panel\" :class=\"cssClasses\" data-test=\"sliding-panel\">\n <button\n v-if=\"showButtons\"\n @click=\"scrollLeft\"\n class=\"x-sliding-panel__button x-sliding-panel__button-left x-button x-button--round\"\n data-test=\"sliding-panel-left-button\"\n >\n <!-- @slot Left button content -->\n <slot name=\"sliding-panel-left-button\">ᐸ</slot>\n </button>\n <div\n ref=\"scrollContainer\"\n @scroll=\"debouncedUpdateScrollPosition\"\n @transitionend=\"debouncedUpdateScrollPosition\"\n @animationend=\"debouncedUpdateScrollPosition\"\n class=\"x-list x-list--horizontal x-sliding-panel__scroll\"\n data-test=\"sliding-panel-scroll\"\n >\n <!-- @slot (Required) Sliding panel content -->\n <slot />\n </div>\n <button\n v-if=\"showButtons\"\n @click=\"scrollRight\"\n class=\"x-sliding-panel__button x-sliding-panel__button-right x-button x-button--round\"\n data-test=\"sliding-panel-right-button\"\n >\n <!-- @slot Right button content -->\n <slot name=\"sliding-panel-right-button\">ᐳ</slot>\n </button>\n </div>\n</template>\n\n<script lang=\"ts\">\n import Vue from 'vue';\n import { Component, Prop } from 'vue-property-decorator';\n import { VueCSSClasses } from '../utils/types';\n import { Debounce } from './decorators/debounce.decorators';\n\n /**\n * This component allows for any other component or element inside it to be horizontally\n * navigable. It also implements customizable buttons as well as other minor customizations to its\n * general behavior.\n *\n * @public\n */\n @Component\n export default class SlidingPanel extends Vue {\n /**\n * Scroll factor that will dictate how much the scroll moves when pressing a navigation button.\n *\n * @public\n */\n @Prop({ default: 0.7 })\n public scrollFactor!: number;\n\n /**\n * Would make the navigation buttons visible when they're needed or always hide them.\n *\n * @public\n */\n @Prop({ default: true })\n public showButtons!: boolean;\n\n /**\n * When true, whenever the DOM content in the sliding panel slot changes, it will reset\n * the scroll position to 0.\n *\n * @public\n */\n @Prop({ default: true })\n public resetOnContentChange!: boolean;\n\n /**\n * Indicates if the scroll is at the start of the sliding panel.\n *\n * @internal\n */\n protected isScrollAtStart = true;\n\n /**\n * Indicates if the scroll is at the end of the sliding panel.\n *\n * @internal\n */\n protected isScrollAtEnd = true;\n\n /**\n * HTMLElement referencing the scroll of the component.\n *\n * @internal\n */\n public $refs!: {\n scrollContainer: HTMLElement;\n };\n\n /**\n * CSS classes to apply based on the scroll position.\n *\n * @returns The CSS classes to apply.\n *\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-sliding-panel--at-start': this.isScrollAtStart,\n 'x-sliding-panel--at-end': this.isScrollAtEnd\n };\n }\n\n /**\n * Initialises browser platform code:\n * - Creates a mutation observer to detect content changes and reset scroll position.\n * - Stores initial size and scroll position values.\n *\n * @internal\n */\n mounted(): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const resizeObserver = new ResizeObserver(this.debouncedUpdateScrollPosition);\n resizeObserver.observe(this.$el);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const contentChangedObserver = new MutationObserver(this.restoreAndUpdateScroll);\n this.$watch(\n () => this.resetOnContentChange,\n shouldReset => {\n if (shouldReset) {\n contentChangedObserver.observe(this.$refs.scrollContainer, {\n attributes: false,\n childList: true,\n subtree: true,\n characterData: false\n });\n } else {\n contentChangedObserver.disconnect();\n }\n },\n { immediate: true }\n );\n this.$on('hook:beforeDestroy', () => {\n contentChangedObserver.disconnect();\n resizeObserver.disconnect();\n });\n\n this.updateScrollPosition();\n }\n\n /**\n * Resets the scroll and updates the values of the scroll for the buttons to react.\n *\n * @internal\n */\n @Debounce(100, { leading: true })\n restoreAndUpdateScroll(): void {\n this.$refs.scrollContainer.scroll({ left: 0, behavior: 'smooth' });\n this.updateScrollPosition();\n }\n\n /**\n * Updates the values of the scroll positions to show or hide the buttons depending on it.\n *\n * @internal\n */\n protected updateScrollPosition(): void {\n const { scrollLeft, clientWidth, scrollWidth } = this.$refs.scrollContainer;\n this.isScrollAtStart = !scrollLeft;\n /* The 2 px extra is to fix some cases in some resolutions where the scroll + client size is\n * less than the scroll width even when the scroll is at the end */\n this.isScrollAtEnd = scrollLeft + clientWidth + 2 >= scrollWidth;\n }\n\n /**\n * Debounced version of the {@link SlidingPanel.updateScrollPosition | updateScrollPosition}\n * method.\n *\n * @internal\n */\n @Debounce(100, { leading: true })\n debouncedUpdateScrollPosition(): void {\n this.updateScrollPosition();\n }\n\n /**\n * Scrolls the wrapper element to the left.\n *\n * @internal\n */\n protected scrollLeft(): void {\n this.scrollTo(-this.$refs.scrollContainer.clientWidth);\n }\n\n /**\n * Scrolls the wrapper element to the right.\n *\n * @internal\n */\n protected scrollRight(): void {\n this.scrollTo(this.$refs.scrollContainer.clientWidth);\n }\n\n /**\n * Scrolls the wrapper element towards the provided scroll value.\n *\n * @param scrollValue - The value the scroll will go towards.\n *\n * @internal\n */\n protected scrollTo(scrollValue: number): void {\n this.$refs.scrollContainer.scrollBy({\n left: scrollValue * this.scrollFactor,\n behavior: 'smooth'\n });\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-sliding-panel {\n align-items: center;\n display: flex;\n flex-flow: row nowrap;\n height: 100%;\n position: relative;\n\n &__button {\n opacity: 0;\n pointer-events: none;\n position: absolute;\n transition: all ease-out 0.2s;\n z-index: 2; /* To overlay the design system gradient with z-index:1 */\n\n &-left {\n left: 0;\n }\n\n &-right {\n right: 0;\n }\n }\n\n &__scroll {\n display: flex;\n flex: 100%;\n flex-flow: row nowrap;\n overflow: auto;\n scrollbar-width: none; // Firefox\n -ms-overflow-style: none; // IE\n\n // Chrome, Edge & Safari\n &::-webkit-scrollbar {\n display: none;\n }\n }\n\n &:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-start) {\n .x-sliding-panel__button-left {\n opacity: 1;\n pointer-events: all;\n }\n }\n\n &:not(.x-sliding-panel--show-buttons-on-hover):not(.x-sliding-panel--at-end) {\n .x-sliding-panel__button-right {\n opacity: 1;\n pointer-events: all;\n }\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits no events.\n\n## See it in action\n\nSimplest implementation of the component, just a list-based component inside its slot.\n\n```vue\n<template>\n <SlidingPanel>\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel\n }\n };\n</script>\n\n<style>\n .x-sliding-panel {\n width: 200px;\n }\n\n .item {\n display: inline-block;\n width: 100px;\n }\n</style>\n```\n\n### Play with props\n\n#### Modifying scroll buttons travel distance\n\nEdit how much the scroll travels when navigating with the buttons by changing the `scrollFactor`\nprop.\n\n```vue\n<template>\n <SlidingPanel :scrollFactor=\"1.5\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel\n }\n };\n</script>\n\n<style>\n .x-sliding-panel {\n width: 200px;\n }\n\n .item {\n display: inline-block;\n width: 100px;\n }\n</style>\n```\n\n#### Hiding scroll buttons\n\nHide the navigational buttons completely by setting the `showButtons` prop to `false`. This is\nintended to be used when other scrolling options are available, like in mobile, where you can scroll\njust by swiping.\n\n```vue\n<template>\n <SlidingPanel :showButtons=\"false\">\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </SlidingPanel>\n</template>\n\n<script>\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel\n }\n };\n</script>\n\n<style>\n .x-sliding-panel {\n width: 200px;\n }\n\n .item {\n display: inline-block;\n width: 100px;\n }\n</style>\n```\n\n#### Disabling reset the scroll when content changes\n\nBy default, whenever the content of the sliding panel changes, it auto resets its scroll position.\nYou can disable this behavior setting the `resetOnContentChange` prop to `false`.\n\n```vue\n<template>\n <div>\n <button @click=\"items++\">Add item</button>\n <label>\n <input type=\"checkbox\" v-model=\"resetOnContentChange\" />\n Reset content onchange\n </label>\n <SlidingPanel :resetOnContentChange=\"resetOnContentChange\">\n <div class=\"item\" v-for=\"item in items\" :key=\"item\">Item {{ item }}</div>\n </SlidingPanel>\n </div>\n</template>\n\n<script>\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel\n },\n data() {\n return {\n items: 4,\n resetOnContentChange: false\n };\n }\n };\n</script>\n\n<style>\n .x-sliding-panel {\n width: 200px;\n }\n\n .item {\n display: inline-block;\n width: 100px;\n }\n</style>\n```\n\n## Extending the component\n\n### Overriding Button content\n\nBy default the buttons show an arrow depicting the direction the scroll would go to when clicked,\nbut this content can be customized with anything, from characters to SVG and images.\n\n```vue\n<template>\n <SlidingPanel>\n <template #sliding-panel-left-button>Left</template>\n <template #default>\n <div class=\"item\">Item 1</div>\n <div class=\"item\">Item 2</div>\n <div class=\"item\">Item 3</div>\n <div class=\"item\">Item 4</div>\n </template>\n <template #sliding-panel-right-button>Right</template>\n </SlidingPanel>\n</template>\n\n<script>\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SlidingPanelDemo',\n components: {\n SlidingPanel\n }\n };\n</script>\n\n<style>\n .x-sliding-panel {\n width: 200px;\n }\n\n .item {\n display: inline-block;\n width: 100px;\n }\n</style>\n```\n</docs>\n"],"names":["const"],"mappings":";;;;;AAEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,8 +4,9 @@ import { Prop, Component } from 'vue-property-decorator';
4
4
  import { Debounce } from './decorators/debounce.decorators.js';
5
5
 
6
6
  /**
7
- * Horizontal slide panel component. The content that is provided to this component would be
8
- * navigable horizontally using two navigational buttons.
7
+ * This component allows for any other component or element inside it to be horizontally
8
+ * navigable. It also implements customizable buttons as well as other minor customizations to its
9
+ * general behavior.
9
10
  *
10
11
  * @public
11
12
  */
@@ -13,38 +14,69 @@ var SlidingPanel = /** @class */ (function (_super) {
13
14
  __extends(SlidingPanel, _super);
14
15
  function SlidingPanel() {
15
16
  var _this = _super !== null && _super.apply(this, arguments) || this;
16
- /**
17
- * MutationObserver that watches for changes inside the wrapping div to update
18
- * the scroll position.
19
- */
20
- _this.scrollObserver = new MutationObserver(
21
- // eslint-disable-next-line @typescript-eslint/unbound-method
22
- _this.restoreAndUpdateScroll);
23
17
  /**
24
18
  * Indicates if the scroll is at the start of the sliding panel.
19
+ *
20
+ * @internal
25
21
  */
26
22
  _this.isScrollAtStart = true;
27
23
  /**
28
24
  * Indicates if the scroll is at the end of the sliding panel.
25
+ *
26
+ * @internal
29
27
  */
30
28
  _this.isScrollAtEnd = true;
31
29
  return _this;
32
30
  }
31
+ Object.defineProperty(SlidingPanel.prototype, "cssClasses", {
32
+ /**
33
+ * CSS classes to apply based on the scroll position.
34
+ *
35
+ * @returns The CSS classes to apply.
36
+ *
37
+ * @internal
38
+ */
39
+ get: function () {
40
+ return {
41
+ 'x-sliding-panel--at-start': this.isScrollAtStart,
42
+ 'x-sliding-panel--at-end': this.isScrollAtEnd
43
+ };
44
+ },
45
+ enumerable: false,
46
+ configurable: true
47
+ });
48
+ /**
49
+ * Initialises browser platform code:
50
+ * - Creates a mutation observer to detect content changes and reset scroll position.
51
+ * - Stores initial size and scroll position values.
52
+ *
53
+ * @internal
54
+ */
33
55
  SlidingPanel.prototype.mounted = function () {
34
- this.scrollObserver.observe(this.$refs.scrollContainer, {
35
- attributes: false,
36
- childList: true,
37
- subtree: true,
38
- characterData: false
39
- });
56
+ var _this = this;
40
57
  // eslint-disable-next-line @typescript-eslint/unbound-method
41
- window === null || window === void 0 ? void 0 : window.addEventListener('resize', this.debouncedUpdateScrollPosition);
42
- this.updateScrollPosition();
43
- };
44
- SlidingPanel.prototype.beforeDestroy = function () {
45
- this.scrollObserver.disconnect();
58
+ var resizeObserver = new ResizeObserver(this.debouncedUpdateScrollPosition);
59
+ resizeObserver.observe(this.$el);
46
60
  // eslint-disable-next-line @typescript-eslint/unbound-method
47
- window === null || window === void 0 ? void 0 : window.removeEventListener('resize', this.debouncedUpdateScrollPosition);
61
+ var contentChangedObserver = new MutationObserver(this.restoreAndUpdateScroll);
62
+ this.$watch(function () { return _this.resetOnContentChange; }, function (shouldReset) {
63
+ if (shouldReset) {
64
+ contentChangedObserver.observe(_this.$refs.scrollContainer, {
65
+ attributes: false,
66
+ childList: true,
67
+ subtree: true,
68
+ characterData: false
69
+ });
70
+ }
71
+ else {
72
+ contentChangedObserver.disconnect();
73
+ }
74
+ }, { immediate: true });
75
+ this.$on('hook:beforeDestroy', function () {
76
+ contentChangedObserver.disconnect();
77
+ resizeObserver.disconnect();
78
+ });
79
+ this.updateScrollPosition();
48
80
  };
49
81
  /**
50
82
  * Resets the scroll and updates the values of the scroll for the buttons to react.
@@ -97,8 +129,6 @@ var SlidingPanel = /** @class */ (function (_super) {
97
129
  *
98
130
  * @param scrollValue - The value the scroll will go towards.
99
131
  *
100
- * @remarks this function uses the scrollBy from Element and it's not available in all browsers.
101
- *
102
132
  * @internal
103
133
  */
104
134
  SlidingPanel.prototype.scrollTo = function (scrollValue) {
@@ -107,29 +137,15 @@ var SlidingPanel = /** @class */ (function (_super) {
107
137
  behavior: 'smooth'
108
138
  });
109
139
  };
110
- Object.defineProperty(SlidingPanel.prototype, "cssClasses", {
111
- /**
112
- * CSS classes to apply based on the scroll position.
113
- *
114
- * @returns The CSS classes to apply.
115
- *
116
- * @internal
117
- */
118
- get: function () {
119
- return {
120
- 'x-sliding-panel--at-start': this.isScrollAtStart,
121
- 'x-sliding-panel--at-end': this.isScrollAtEnd
122
- };
123
- },
124
- enumerable: false,
125
- configurable: true
126
- });
127
140
  __decorate([
128
141
  Prop({ default: 0.7 })
129
142
  ], SlidingPanel.prototype, "scrollFactor", void 0);
130
143
  __decorate([
131
144
  Prop({ default: true })
132
145
  ], SlidingPanel.prototype, "showButtons", void 0);
146
+ __decorate([
147
+ Prop({ default: true })
148
+ ], SlidingPanel.prototype, "resetOnContentChange", void 0);
133
149
  __decorate([
134
150
  Debounce(100, { leading: true })
135
151
  ], SlidingPanel.prototype, "restoreAndUpdateScroll", null);