@empathyco/x-components 3.0.0-alpha.154 → 3.0.0-alpha.157

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 (255) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/core/index.js.map +1 -1
  3. package/design-system/button-default.css +1 -1
  4. package/design-system/default-theme.css +12 -16
  5. package/design-system/dropdown-default.css +2 -2
  6. package/design-system/facet-default.css +1 -1
  7. package/design-system/filter-default.css +1 -1
  8. package/design-system/full-theme.css +45 -155
  9. package/design-system/input-default.css +1 -1
  10. package/design-system/input-group-default.css +1 -1
  11. package/design-system/list-default.css +1 -5
  12. package/design-system/list-gap.css +20 -100
  13. package/design-system/list-padding.css +13 -39
  14. package/design-system/message-default.css +1 -1
  15. package/design-system/suggestion-default.css +1 -1
  16. package/design-system/suggestion-group-default.css +1 -1
  17. package/design-system/tag-default.css +1 -1
  18. package/docs/API-reference/api/x-components.md +9 -0
  19. package/docs/API-reference/api/x-components.queriespreviewactioncontext.md +15 -0
  20. package/docs/API-reference/api/x-components.queriespreviewactions.md +13 -0
  21. package/docs/API-reference/api/x-components.queriespreviewgetters.md +13 -0
  22. package/docs/API-reference/api/x-components.queriespreviewmutations.md +13 -0
  23. package/docs/API-reference/api/x-components.queriespreviewstate.md +13 -0
  24. package/docs/API-reference/api/x-components.queriespreviewxevents.md +13 -0
  25. package/docs/API-reference/api/x-components.queriespreviewxmodule.md +13 -0
  26. package/docs/API-reference/api/x-components.queriespreviewxstoremodule.md +15 -0
  27. package/docs/API-reference/api/x-components.xeventstypes.md +3 -3
  28. package/docs/API-reference/api/x-components.xmodulestree.md +1 -0
  29. package/docs/API-reference/api/x-components.xmodulestree.queriespreview.md +11 -0
  30. package/js/components/animations/animate-width.vue.js +5 -8
  31. package/js/components/animations/animate-width.vue.js.map +1 -1
  32. package/js/components/animations/animate-width.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  33. package/js/components/animations/animate-width.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  34. package/js/components/animations/collapse-height.vue.js +5 -8
  35. package/js/components/animations/collapse-height.vue.js.map +1 -1
  36. package/js/components/animations/collapse-height.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  37. package/js/components/animations/collapse-height.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  38. package/js/components/animations/collapse-width.vue.js +5 -8
  39. package/js/components/animations/collapse-width.vue.js.map +1 -1
  40. package/js/components/animations/collapse-width.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  41. package/js/components/animations/collapse-width.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  42. package/js/components/animations/cross-fade.vue.js +5 -8
  43. package/js/components/animations/cross-fade.vue.js.map +1 -1
  44. package/js/components/animations/cross-fade.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  45. package/js/components/animations/cross-fade.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  46. package/js/components/animations/fade-and-slide.vue.js +5 -8
  47. package/js/components/animations/fade-and-slide.vue.js.map +1 -1
  48. package/js/components/animations/fade-and-slide.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  49. package/js/components/animations/fade-and-slide.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  50. package/js/components/animations/fade.vue.js +5 -8
  51. package/js/components/animations/fade.vue.js.map +1 -1
  52. package/js/components/animations/fade.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  53. package/js/components/animations/fade.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  54. package/js/components/animations/staggered-fade-and-slide.vue.js +5 -8
  55. package/js/components/animations/staggered-fade-and-slide.vue.js.map +1 -1
  56. package/js/components/animations/staggered-fade-and-slide.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  57. package/js/components/animations/staggered-fade-and-slide.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  58. package/js/components/animations/staggering-transition-group.vue.js +5 -8
  59. package/js/components/animations/staggering-transition-group.vue.js.map +1 -1
  60. package/js/components/animations/staggering-transition-group.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  61. package/js/components/animations/staggering-transition-group.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  62. package/js/components/auto-progress-bar.vue.js +5 -8
  63. package/js/components/auto-progress-bar.vue.js.map +1 -1
  64. package/js/components/auto-progress-bar.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  65. package/js/components/auto-progress-bar.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  66. package/js/components/base-dropdown.vue.js +5 -8
  67. package/js/components/base-dropdown.vue.js.map +1 -1
  68. package/js/components/base-dropdown.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  69. package/js/components/base-dropdown.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  70. package/js/components/base-grid.vue.js +5 -8
  71. package/js/components/base-grid.vue.js.map +1 -1
  72. package/js/components/base-grid.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  73. package/js/components/base-grid.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  74. package/js/components/base-rating.vue.js +5 -8
  75. package/js/components/base-rating.vue.js.map +1 -1
  76. package/js/components/base-rating.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  77. package/js/components/base-rating.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  78. package/js/components/base-switch.vue.js +5 -8
  79. package/js/components/base-switch.vue.js.map +1 -1
  80. package/js/components/base-switch.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  81. package/js/components/base-switch.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  82. package/js/components/column-picker/base-column-picker-list.vue.js +5 -8
  83. package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
  84. package/js/components/column-picker/base-column-picker-list.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  85. package/js/components/column-picker/base-column-picker-list.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  86. package/js/components/layouts/fixed-header-and-asides-layout.vue.js +5 -8
  87. package/js/components/layouts/fixed-header-and-asides-layout.vue.js.map +1 -1
  88. package/js/components/layouts/fixed-header-and-asides-layout.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  89. package/js/components/layouts/fixed-header-and-asides-layout.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  90. package/js/components/layouts/multi-column-max-width-layout.vue.js +6 -9
  91. package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
  92. package/js/components/layouts/multi-column-max-width-layout.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  93. package/js/components/layouts/multi-column-max-width-layout.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  94. package/js/components/layouts/multi-column-max-width-layout.vue_rollup-plugin-vue_styles.1.vue.js +7 -0
  95. package/js/components/layouts/multi-column-max-width-layout.vue_rollup-plugin-vue_styles.1.vue.js.map +1 -0
  96. package/js/components/layouts/single-column-layout.vue.js +5 -8
  97. package/js/components/layouts/single-column-layout.vue.js.map +1 -1
  98. package/js/components/layouts/single-column-layout.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  99. package/js/components/layouts/single-column-layout.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  100. package/js/components/modals/base-modal.vue.js +5 -8
  101. package/js/components/modals/base-modal.vue.js.map +1 -1
  102. package/js/components/modals/base-modal.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  103. package/js/components/modals/base-modal.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  104. package/js/components/panels/base-header-toggle-panel.vue.js +5 -8
  105. package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
  106. package/js/components/panels/base-header-toggle-panel.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  107. package/js/components/panels/base-header-toggle-panel.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  108. package/js/components/result/base-result-image.vue.js +5 -8
  109. package/js/components/result/base-result-image.vue.js.map +1 -1
  110. package/js/components/result/base-result-image.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  111. package/js/components/result/base-result-image.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  112. package/js/components/result/base-result-link.vue.js +5 -8
  113. package/js/components/result/base-result-link.vue.js.map +1 -1
  114. package/js/components/result/base-result-link.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  115. package/js/components/result/base-result-link.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  116. package/js/components/result/base-result-rating.vue.js +5 -8
  117. package/js/components/result/base-result-rating.vue.js.map +1 -1
  118. package/js/components/result/base-result-rating.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  119. package/js/components/result/base-result-rating.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  120. package/js/components/scroll/base-scroll.vue.js +5 -8
  121. package/js/components/scroll/base-scroll.vue.js.map +1 -1
  122. package/js/components/scroll/base-scroll.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  123. package/js/components/scroll/base-scroll.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  124. package/js/components/sliding-panel.vue.js +5 -8
  125. package/js/components/sliding-panel.vue.js.map +1 -1
  126. package/js/components/sliding-panel.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  127. package/js/components/sliding-panel.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  128. package/js/components/suggestions/base-suggestions.vue.js +5 -8
  129. package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
  130. package/js/components/suggestions/base-suggestions.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  131. package/js/components/suggestions/base-suggestions.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  132. package/js/index.js +4 -0
  133. package/js/index.js.map +1 -1
  134. package/js/store/x.module.js +1 -0
  135. package/js/store/x.module.js.map +1 -1
  136. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js +1 -1
  137. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue_script.vue.js +1 -1
  138. package/js/x-modules/extra-params/x-module.js.map +1 -1
  139. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue_script.vue.js +1 -1
  140. package/js/x-modules/facets/components/facets/facets-provider.vue.js +5 -8
  141. package/js/x-modules/facets/components/facets/facets-provider.vue.js.map +1 -1
  142. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_script.vue.js +1 -1
  143. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  144. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  145. package/js/x-modules/facets/components/facets/facets.vue.js +5 -8
  146. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  147. package/js/x-modules/facets/components/facets/facets.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  148. package/js/x-modules/facets/components/facets/facets.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  149. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue_script.vue.js +1 -1
  150. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +5 -8
  151. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
  152. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  153. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  154. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue_script.vue.js +1 -1
  155. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue_script.vue.js +1 -1
  156. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue_script.vue.js +1 -1
  157. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue_script.vue.js +1 -1
  158. package/js/x-modules/facets/components/lists/filters-list.vue.js +5 -8
  159. package/js/x-modules/facets/components/lists/filters-list.vue.js.map +1 -1
  160. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue_script.vue.js +1 -1
  161. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  162. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  163. package/js/x-modules/facets/components/lists/filters-search.vue.js +5 -8
  164. package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
  165. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue_script.vue.js +1 -1
  166. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  167. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  168. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue_script.vue.js +1 -1
  169. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue_script.vue.js +1 -1
  170. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue_script.vue.js +1 -1
  171. package/js/x-modules/queries-preview/store/emitters.js +12 -0
  172. package/js/x-modules/queries-preview/store/emitters.js.map +1 -0
  173. package/js/x-modules/queries-preview/store/module.js +14 -0
  174. package/js/x-modules/queries-preview/store/module.js.map +1 -0
  175. package/js/x-modules/queries-preview/wiring.js +11 -0
  176. package/js/x-modules/queries-preview/wiring.js.map +1 -0
  177. package/js/x-modules/queries-preview/x-module.js +19 -0
  178. package/js/x-modules/queries-preview/x-module.js.map +1 -0
  179. package/js/x-modules/recommendations/components/recommendations.vue.js +5 -8
  180. package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
  181. package/js/x-modules/recommendations/components/recommendations.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  182. package/js/x-modules/recommendations/components/recommendations.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  183. package/js/x-modules/related-tags/components/related-tag.vue.js +5 -8
  184. package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
  185. package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  186. package/js/x-modules/related-tags/components/related-tag.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  187. package/js/x-modules/related-tags/components/related-tags.vue.js +5 -8
  188. package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
  189. package/js/x-modules/related-tags/components/related-tags.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  190. package/js/x-modules/related-tags/components/related-tags.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  191. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue_script.vue.js +1 -1
  192. package/js/x-modules/scroll/components/main-scroll.vue.js +5 -8
  193. package/js/x-modules/scroll/components/main-scroll.vue.js.map +1 -1
  194. package/js/x-modules/scroll/components/main-scroll.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  195. package/js/x-modules/scroll/components/main-scroll.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  196. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue_script.vue.js +1 -1
  197. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue_script.vue.js +1 -1
  198. package/js/x-modules/search/components/banner.vue.js +5 -8
  199. package/js/x-modules/search/components/banner.vue.js.map +1 -1
  200. package/js/x-modules/search/components/banner.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  201. package/js/x-modules/search/components/banner.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  202. package/js/x-modules/search/components/partial-results-list.vue.js +5 -8
  203. package/js/x-modules/search/components/partial-results-list.vue.js.map +1 -1
  204. package/js/x-modules/search/components/partial-results-list.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  205. package/js/x-modules/search/components/partial-results-list.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  206. package/js/x-modules/search/components/promoted.vue.js +5 -8
  207. package/js/x-modules/search/components/promoted.vue.js.map +1 -1
  208. package/js/x-modules/search/components/promoted.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  209. package/js/x-modules/search/components/promoted.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  210. package/js/x-modules/search/components/redirection.vue.js +0 -1
  211. package/js/x-modules/search/components/redirection.vue.js.map +1 -1
  212. package/js/x-modules/search/components/sort-list.vue.js +5 -8
  213. package/js/x-modules/search/components/sort-list.vue.js.map +1 -1
  214. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue_script.vue.js +1 -1
  215. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  216. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  217. package/js/x-modules/search/components/sort.mixin.js +1 -1
  218. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue_script.vue.js +1 -1
  219. package/js/x-modules/search-box/components/search-input.vue.js +5 -8
  220. package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
  221. package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue_styles.0.vue.js +7 -0
  222. package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue_styles.0.vue.js.map +1 -0
  223. package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue_script.vue.js +1 -1
  224. package/package.json +10 -7
  225. package/queries-preview/index.d.ts +1 -0
  226. package/queries-preview/index.js +4 -0
  227. package/report/x-components.api.json +310 -2
  228. package/report/x-components.api.md +44 -1
  229. package/types/adapter/e2e-adapter.d.ts +2 -12
  230. package/types/adapter/e2e-adapter.d.ts.map +1 -1
  231. package/types/index.d.ts +1 -0
  232. package/types/index.d.ts.map +1 -1
  233. package/types/store/x.module.d.ts.map +1 -1
  234. package/types/wiring/events.types.d.ts +3 -1
  235. package/types/wiring/events.types.d.ts.map +1 -1
  236. package/types/x-modules/extra-params/x-module.d.ts +1 -1
  237. package/types/x-modules/extra-params/x-module.d.ts.map +1 -1
  238. package/types/x-modules/queries-preview/events.types.d.ts +9 -0
  239. package/types/x-modules/queries-preview/events.types.d.ts.map +1 -0
  240. package/types/x-modules/queries-preview/index.d.ts +5 -0
  241. package/types/x-modules/queries-preview/index.d.ts.map +1 -0
  242. package/types/x-modules/queries-preview/store/emitters.d.ts +7 -0
  243. package/types/x-modules/queries-preview/store/emitters.d.ts.map +1 -0
  244. package/types/x-modules/queries-preview/store/index.d.ts +4 -0
  245. package/types/x-modules/queries-preview/store/index.d.ts.map +1 -0
  246. package/types/x-modules/queries-preview/store/module.d.ts +8 -0
  247. package/types/x-modules/queries-preview/store/module.d.ts.map +1 -0
  248. package/types/x-modules/queries-preview/store/types.d.ts +42 -0
  249. package/types/x-modules/queries-preview/store/types.d.ts.map +1 -0
  250. package/types/x-modules/queries-preview/wiring.d.ts +7 -0
  251. package/types/x-modules/queries-preview/wiring.d.ts.map +1 -0
  252. package/types/x-modules/queries-preview/x-module.d.ts +16 -0
  253. package/types/x-modules/queries-preview/x-module.d.ts.map +1 -0
  254. package/types/x-modules/x-modules.types.d.ts +6 -2
  255. package/types/x-modules/x-modules.types.d.ts.map +1 -1
@@ -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 tabIndex=\"0\"\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 /**\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":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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 tabIndex=\"0\"\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 /**\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":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import { createInjector } from 'vue-runtime-helpers';
2
+
3
+ var css = ".x-dropdown[data-v-7f6f2f40] {\n position: relative;\n}\n.x-dropdown__items-list[data-v-7f6f2f40] {\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}";
4
+ const injector=createInjector({});injector('/__w/x/x/packages/x-components/src/components/base-dropdown.vue?rollup-plugin-vue=styles.0.css',{source:css});
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=base-dropdown.vue_rollup-plugin-vue_styles.0.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-dropdown.vue_rollup-plugin-vue_styles.0.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,10 +1,9 @@
1
1
  import script from './base-grid.vue_rollup-plugin-vue_script.vue.js';
2
+ import './base-grid.vue_rollup-plugin-vue_styles.0.vue.js';
2
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.mjs';
3
- import __vue_create_injector__ from 'vue-runtime-helpers/dist/inject-style/browser.mjs';
4
4
 
5
5
  /* script */
6
6
  const __vue_script__ = script;
7
-
8
7
  /* template */
9
8
  var __vue_render__ = function () {
10
9
  var _vm = this;
@@ -55,17 +54,15 @@ var __vue_staticRenderFns__ = [];
55
54
  __vue_render__._withStripped = true;
56
55
 
57
56
  /* style */
58
- const __vue_inject_styles__ = function (inject) {
59
- if (!inject) return
60
- inject("data-v-604592d3_0", { source: ".x-base-grid[data-v-604592d3] {\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-604592d3], .x-base-grid__next-queries-group[data-v-604592d3] {\n grid-column-start: 1;\n grid-column-end: -1;\n}", map: undefined, media: undefined });
61
-
62
- };
57
+ const __vue_inject_styles__ = undefined;
63
58
  /* scoped */
64
59
  const __vue_scope_id__ = "data-v-604592d3";
65
60
  /* module identifier */
66
61
  const __vue_module_identifier__ = undefined;
67
62
  /* functional template */
68
63
  const __vue_is_functional_template__ = false;
64
+ /* style inject */
65
+
69
66
  /* style inject SSR */
70
67
 
71
68
  /* style inject shadow dom */
@@ -80,7 +77,7 @@ __vue_render__._withStripped = true;
80
77
  __vue_is_functional_template__,
81
78
  __vue_module_identifier__,
82
79
  false,
83
- __vue_create_injector__,
80
+ undefined,
84
81
  undefined,
85
82
  undefined
86
83
  );
@@ -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), 1fr))'\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 &__next-queries-group {\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":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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), 1fr))'\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 &__next-queries-group {\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":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import { createInjector } from 'vue-runtime-helpers';
2
+
3
+ var css = ".x-base-grid[data-v-604592d3] {\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-604592d3], .x-base-grid__next-queries-group[data-v-604592d3] {\n grid-column-start: 1;\n grid-column-end: -1;\n}";
4
+ const injector=createInjector({});injector('/__w/x/x/packages/x-components/src/components/base-grid.vue?rollup-plugin-vue=styles.0.css',{source:css});
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=base-grid.vue_rollup-plugin-vue_styles.0.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-grid.vue_rollup-plugin-vue_styles.0.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,10 +1,9 @@
1
1
  import script from './base-rating.vue_rollup-plugin-vue_script.vue.js';
2
+ import './base-rating.vue_rollup-plugin-vue_styles.0.vue.js';
2
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.mjs';
3
- import __vue_create_injector__ from 'vue-runtime-helpers/dist/inject-style/browser.mjs';
4
4
 
5
5
  /* script */
6
6
  const __vue_script__ = script;
7
-
8
7
  /* template */
9
8
  var __vue_render__ = function () {
10
9
  var _vm = this;
@@ -72,17 +71,15 @@ var __vue_staticRenderFns__ = [];
72
71
  __vue_render__._withStripped = true;
73
72
 
74
73
  /* style */
75
- const __vue_inject_styles__ = function (inject) {
76
- if (!inject) return
77
- inject("data-v-01a5c2e2_0", { source: ".x-rating[data-v-01a5c2e2] {\n position: relative;\n display: inline-block;\n}\n.x-rating--empty[data-v-01a5c2e2] {\n overflow: hidden;\n display: flex;\n flex-flow: row nowrap;\n white-space: nowrap;\n}\n.x-rating--filled[data-v-01a5c2e2] {\n display: flex;\n flex-flow: row nowrap;\n white-space: nowrap;\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n height: 100%;\n}\n.x-rating__default-icon[data-v-01a5c2e2] {\n fill: currentColor;\n stroke: currentColor;\n}\n.x-rating__default-icon--empty[data-v-01a5c2e2] {\n fill: none;\n}", map: undefined, media: undefined });
78
-
79
- };
74
+ const __vue_inject_styles__ = undefined;
80
75
  /* scoped */
81
76
  const __vue_scope_id__ = "data-v-01a5c2e2";
82
77
  /* module identifier */
83
78
  const __vue_module_identifier__ = undefined;
84
79
  /* functional template */
85
80
  const __vue_is_functional_template__ = false;
81
+ /* style inject */
82
+
86
83
  /* style inject SSR */
87
84
 
88
85
  /* style inject shadow dom */
@@ -97,7 +94,7 @@ __vue_render__._withStripped = true;
97
94
  __vue_is_functional_template__,
98
95
  __vue_module_identifier__,
99
96
  false,
100
- __vue_create_injector__,
97
+ undefined,
101
98
  undefined,
102
99
  undefined
103
100
  );
@@ -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=\"empty-icon\">\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=\"filled-icon\">\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 flex-flow: row nowrap;\n white-space: nowrap;\n }\n\n &--filled {\n display: flex;\n flex-flow: row nowrap;\n white-space: nowrap;\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n height: 100%;\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 #filled-icon>\n <TestIcon/>\n </template>\n <template #empty-icon>\n <TestIcon/>\n </template>\n</BaseRating>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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=\"empty-icon\">\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=\"filled-icon\">\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 flex-flow: row nowrap;\n white-space: nowrap;\n }\n\n &--filled {\n display: flex;\n flex-flow: row nowrap;\n white-space: nowrap;\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n height: 100%;\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 #filled-icon>\n <TestIcon/>\n </template>\n <template #empty-icon>\n <TestIcon/>\n </template>\n</BaseRating>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import { createInjector } from 'vue-runtime-helpers';
2
+
3
+ var css = ".x-rating[data-v-01a5c2e2] {\n position: relative;\n display: inline-block;\n}\n.x-rating--empty[data-v-01a5c2e2] {\n overflow: hidden;\n display: flex;\n flex-flow: row nowrap;\n white-space: nowrap;\n}\n.x-rating--filled[data-v-01a5c2e2] {\n display: flex;\n flex-flow: row nowrap;\n white-space: nowrap;\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n height: 100%;\n}\n.x-rating__default-icon[data-v-01a5c2e2] {\n fill: currentColor;\n stroke: currentColor;\n}\n.x-rating__default-icon--empty[data-v-01a5c2e2] {\n fill: none;\n}";
4
+ const injector=createInjector({});injector('/__w/x/x/packages/x-components/src/components/base-rating.vue?rollup-plugin-vue=styles.0.css',{source:css});
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=base-rating.vue_rollup-plugin-vue_styles.0.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-rating.vue_rollup-plugin-vue_styles.0.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,10 +1,9 @@
1
1
  import script from './base-switch.vue_rollup-plugin-vue_script.vue.js';
2
+ import './base-switch.vue_rollup-plugin-vue_styles.0.vue.js';
2
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.mjs';
3
- import __vue_create_injector__ from 'vue-runtime-helpers/dist/inject-style/browser.mjs';
4
4
 
5
5
  /* script */
6
6
  const __vue_script__ = script;
7
-
8
7
  /* template */
9
8
  var __vue_render__ = function () {
10
9
  var _vm = this;
@@ -25,17 +24,15 @@ var __vue_staticRenderFns__ = [];
25
24
  __vue_render__._withStripped = true;
26
25
 
27
26
  /* style */
28
- const __vue_inject_styles__ = function (inject) {
29
- if (!inject) return
30
- inject("data-v-25cc8ef8_0", { source: ".x-switch[data-v-25cc8ef8] {\n --x-switch-height: var(--x-size-base-05);\n --x-switch-width: calc(2 * (var(--x-switch-height)) + 2 * var(--x-switch-padding));\n --x-switch-background: var(--x-color-base-neutral-70);\n --x-switch-padding: var(--x-size-base-01);\n --x-switch-handle-size: calc(var(--x-switch-height));\n box-sizing: content-box;\n height: var(--x-switch-height);\n padding: var(--x-switch-padding);\n border-radius: var(--x-size-border-radius-base-pill);\n background: var(--x-switch-background);\n width: var(--x-switch-width);\n border: none;\n transition: 0.25s ease-out background-color;\n cursor: pointer;\n}\n.x-switch__handle[data-v-25cc8ef8] {\n background: var(--x-color-base-neutral-100);\n border-radius: 50%;\n height: var(--x-switch-handle-size);\n width: var(--x-switch-handle-size);\n transition: 0.25s ease-out transform;\n transform: translateX(var(--x-switch-translate-x, 0%));\n}\n.x-switch--is-selected[data-v-25cc8ef8] {\n --x-switch-translate-x: calc(var(--x-switch-padding) + var(--x-switch-width) / 2);\n --x-switch-background: var(--x-color-base-neutral-10);\n}\n.x-switch--sm[data-v-25cc8ef8] {\n --x-switch-height: var(--x-size-base-04);\n}\n.x-switch--lg[data-v-25cc8ef8] {\n --x-switch-height: var(--x-size-base-06);\n}", map: undefined, media: undefined });
31
-
32
- };
27
+ const __vue_inject_styles__ = undefined;
33
28
  /* scoped */
34
29
  const __vue_scope_id__ = "data-v-25cc8ef8";
35
30
  /* module identifier */
36
31
  const __vue_module_identifier__ = undefined;
37
32
  /* functional template */
38
33
  const __vue_is_functional_template__ = false;
34
+ /* style inject */
35
+
39
36
  /* style inject SSR */
40
37
 
41
38
  /* style inject shadow dom */
@@ -50,7 +47,7 @@ __vue_render__._withStripped = true;
50
47
  __vue_is_functional_template__,
51
48
  __vue_module_identifier__,
52
49
  false,
53
- __vue_create_injector__,
50
+ undefined,
54
51
  undefined,
55
52
  undefined
56
53
  );
@@ -1 +1 @@
1
- {"version":3,"file":"base-switch.vue.js","sources":["../../../src/components/base-switch.vue"],"sourcesContent":["<template>\n <button\n @click=\"toggle\"\n :aria-checked=\"value.toString()\"\n :class=\"cssClasses\"\n class=\"x-switch\"\n role=\"switch\"\n >\n <div class=\"x-switch__handle\" />\n </button>\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\n /**\n * Basic switch component to handle boolean values. This component receives\n * its selected state using a prop, and emits a Vue event whenever the user\n * clicks it.\n *\n * @public\n */\n @Component({\n model: {\n event: 'change'\n }\n })\n export default class BaseSwitch extends Vue {\n /**\n * The selected value of the switch.\n *\n * @public\n */\n @Prop({ required: true })\n public value!: boolean;\n\n /**\n * Dynamic CSS classes to add to the switch component\n * depending on its internal state.\n *\n * @returns A boolean dictionary with dynamic CSS classes.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-switch--is-selected': this.value\n };\n }\n\n /**\n * Emits a change event with the desired value of the switch.\n *\n * @internal\n */\n protected toggle(): void {\n this.$emit('change', !this.value);\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-switch {\n --x-switch-height: var(--x-size-base-05);\n --x-switch-width: calc(2 * (var(--x-switch-height)) + 2 * var(--x-switch-padding));\n --x-switch-background: var(--x-color-base-neutral-70);\n --x-switch-padding: var(--x-size-base-01);\n --x-switch-handle-size: calc(var(--x-switch-height));\n box-sizing: content-box;\n height: var(--x-switch-height);\n padding: var(--x-switch-padding);\n border-radius: var(--x-size-border-radius-base-pill);\n background: var(--x-switch-background);\n width: var(--x-switch-width);\n border: none;\n transition: 0.25s ease-out background-color;\n cursor: pointer;\n\n &__handle {\n background: var(--x-color-base-neutral-100);\n border-radius: 50%;\n height: var(--x-switch-handle-size);\n width: var(--x-switch-handle-size);\n transition: 0.25s ease-out transform;\n transform: translateX(var(--x-switch-translate-x, 0%));\n }\n\n &--is-selected {\n --x-switch-translate-x: calc(var(--x-switch-padding) + var(--x-switch-width) / 2);\n --x-switch-background: var(--x-color-base-neutral-10);\n }\n\n &--sm {\n --x-switch-height: var(--x-size-base-04);\n }\n\n &--lg {\n --x-switch-height: var(--x-size-base-06);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits no events.\n\n## See it in action\n\nHere you have a basic example of how the switch is rendered.\n\n_Try clicking it to see how it changes its state_\n\n```vue live\n<template>\n <BaseSwitch @change=\"value = !value\" :value=\"value\" />\n</template>\n\n<script>\n import { BaseSwitch } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSwitchDemo',\n components: {\n BaseSwitch\n },\n data() {\n return {\n value: false\n };\n }\n };\n</script>\n```\n\nThe switch component also supports using the `v-model` directive, to automatically handle its state\nchange:\n\n```vue live\n<template>\n <BaseSwitch v-model=\"value\" />\n</template>\n\n<script>\n import { BaseSwitch } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSwitchDemo',\n components: {\n BaseSwitch\n },\n data() {\n return {\n value: false\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-switch.vue.js","sources":["../../../src/components/base-switch.vue"],"sourcesContent":["<template>\n <button\n @click=\"toggle\"\n :aria-checked=\"value.toString()\"\n :class=\"cssClasses\"\n class=\"x-switch\"\n role=\"switch\"\n >\n <div class=\"x-switch__handle\" />\n </button>\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\n /**\n * Basic switch component to handle boolean values. This component receives\n * its selected state using a prop, and emits a Vue event whenever the user\n * clicks it.\n *\n * @public\n */\n @Component({\n model: {\n event: 'change'\n }\n })\n export default class BaseSwitch extends Vue {\n /**\n * The selected value of the switch.\n *\n * @public\n */\n @Prop({ required: true })\n public value!: boolean;\n\n /**\n * Dynamic CSS classes to add to the switch component\n * depending on its internal state.\n *\n * @returns A boolean dictionary with dynamic CSS classes.\n * @internal\n */\n protected get cssClasses(): VueCSSClasses {\n return {\n 'x-switch--is-selected': this.value\n };\n }\n\n /**\n * Emits a change event with the desired value of the switch.\n *\n * @internal\n */\n protected toggle(): void {\n this.$emit('change', !this.value);\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n .x-switch {\n --x-switch-height: var(--x-size-base-05);\n --x-switch-width: calc(2 * (var(--x-switch-height)) + 2 * var(--x-switch-padding));\n --x-switch-background: var(--x-color-base-neutral-70);\n --x-switch-padding: var(--x-size-base-01);\n --x-switch-handle-size: calc(var(--x-switch-height));\n box-sizing: content-box;\n height: var(--x-switch-height);\n padding: var(--x-switch-padding);\n border-radius: var(--x-size-border-radius-base-pill);\n background: var(--x-switch-background);\n width: var(--x-switch-width);\n border: none;\n transition: 0.25s ease-out background-color;\n cursor: pointer;\n\n &__handle {\n background: var(--x-color-base-neutral-100);\n border-radius: 50%;\n height: var(--x-switch-handle-size);\n width: var(--x-switch-handle-size);\n transition: 0.25s ease-out transform;\n transform: translateX(var(--x-switch-translate-x, 0%));\n }\n\n &--is-selected {\n --x-switch-translate-x: calc(var(--x-switch-padding) + var(--x-switch-width) / 2);\n --x-switch-background: var(--x-color-base-neutral-10);\n }\n\n &--sm {\n --x-switch-height: var(--x-size-base-04);\n }\n\n &--lg {\n --x-switch-height: var(--x-size-base-06);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits no events.\n\n## See it in action\n\nHere you have a basic example of how the switch is rendered.\n\n_Try clicking it to see how it changes its state_\n\n```vue live\n<template>\n <BaseSwitch @change=\"value = !value\" :value=\"value\" />\n</template>\n\n<script>\n import { BaseSwitch } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSwitchDemo',\n components: {\n BaseSwitch\n },\n data() {\n return {\n value: false\n };\n }\n };\n</script>\n```\n\nThe switch component also supports using the `v-model` directive, to automatically handle its state\nchange:\n\n```vue live\n<template>\n <BaseSwitch v-model=\"value\" />\n</template>\n\n<script>\n import { BaseSwitch } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSwitchDemo',\n components: {\n BaseSwitch\n },\n data() {\n return {\n value: false\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import { createInjector } from 'vue-runtime-helpers';
2
+
3
+ var css = ".x-switch[data-v-25cc8ef8] {\n --x-switch-height: var(--x-size-base-05);\n --x-switch-width: calc(2 * (var(--x-switch-height)) + 2 * var(--x-switch-padding));\n --x-switch-background: var(--x-color-base-neutral-70);\n --x-switch-padding: var(--x-size-base-01);\n --x-switch-handle-size: calc(var(--x-switch-height));\n box-sizing: content-box;\n height: var(--x-switch-height);\n padding: var(--x-switch-padding);\n border-radius: var(--x-size-border-radius-base-pill);\n background: var(--x-switch-background);\n width: var(--x-switch-width);\n border: none;\n transition: 0.25s ease-out background-color;\n cursor: pointer;\n}\n.x-switch__handle[data-v-25cc8ef8] {\n background: var(--x-color-base-neutral-100);\n border-radius: 50%;\n height: var(--x-switch-handle-size);\n width: var(--x-switch-handle-size);\n transition: 0.25s ease-out transform;\n transform: translateX(var(--x-switch-translate-x, 0%));\n}\n.x-switch--is-selected[data-v-25cc8ef8] {\n --x-switch-translate-x: calc(var(--x-switch-padding) + var(--x-switch-width) / 2);\n --x-switch-background: var(--x-color-base-neutral-10);\n}\n.x-switch--sm[data-v-25cc8ef8] {\n --x-switch-height: var(--x-size-base-04);\n}\n.x-switch--lg[data-v-25cc8ef8] {\n --x-switch-height: var(--x-size-base-06);\n}";
4
+ const injector=createInjector({});injector('/__w/x/x/packages/x-components/src/components/base-switch.vue?rollup-plugin-vue=styles.0.css',{source:css});
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=base-switch.vue_rollup-plugin-vue_styles.0.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-switch.vue_rollup-plugin-vue_styles.0.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,10 +1,9 @@
1
1
  import script from './base-column-picker-list.vue_rollup-plugin-vue_script.vue.js';
2
+ import './base-column-picker-list.vue_rollup-plugin-vue_styles.0.vue.js';
2
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.mjs';
3
- import __vue_create_injector__ from 'vue-runtime-helpers/dist/inject-style/browser.mjs';
4
4
 
5
5
  /* script */
6
6
  const __vue_script__ = script;
7
-
8
7
  /* template */
9
8
  var __vue_render__ = function () {
10
9
  var _vm = this;
@@ -63,17 +62,15 @@ var __vue_staticRenderFns__ = [];
63
62
  __vue_render__._withStripped = true;
64
63
 
65
64
  /* style */
66
- const __vue_inject_styles__ = function (inject) {
67
- if (!inject) return
68
- inject("data-v-435aee1f_0", { source: ".x-column-picker-list[data-v-435aee1f] {\n display: flex;\n list-style-type: none;\n}", map: undefined, media: undefined });
69
-
70
- };
65
+ const __vue_inject_styles__ = undefined;
71
66
  /* scoped */
72
67
  const __vue_scope_id__ = "data-v-435aee1f";
73
68
  /* module identifier */
74
69
  const __vue_module_identifier__ = undefined;
75
70
  /* functional template */
76
71
  const __vue_is_functional_template__ = false;
72
+ /* style inject */
73
+
77
74
  /* style inject SSR */
78
75
 
79
76
  /* style inject shadow dom */
@@ -88,7 +85,7 @@ __vue_render__._withStripped = true;
88
85
  __vue_is_functional_template__,
89
86
  __vue_module_identifier__,
90
87
  false,
91
- __vue_create_injector__,
88
+ undefined,
92
89
  undefined,
93
90
  undefined
94
91
  );
@@ -1 +1 @@
1
- {"version":3,"file":"base-column-picker-list.vue.js","sources":["../../../../src/components/column-picker/base-column-picker-list.vue"],"sourcesContent":["<template>\n <ul class=\"x-option-list x-column-picker-list\" data-test=\"column-picker-list\">\n <li\n v-for=\"{ column, cssClasses, events, isSelected } in columnsWithCssClasses\"\n :key=\"column\"\n :class=\"cssClasses\"\n class=\"x-option-list__item x-column-picker-list__item\"\n data-test=\"column-picker-item\"\n >\n <BaseEventButton\n class=\"x-button column-picker-item__button\"\n data-test=\"column-picker-button\"\n :aria-selected=\"isSelected.toString()\"\n :events=\"events\"\n >\n <!--\n @slot Customized Column Picker Button content. Specifying a slot with the column value\n will result in the column using that slot composition to render.\n @binding {number} column - Columns Number to pick.\n @binding {boolean} isSelected - True if the columns number are the chosen value.\n -->\n <slot v-bind=\"{ column, isSelected }\">\n {{ column }}\n </slot>\n </BaseEventButton>\n </li>\n </ul>\n</template>\n\n<style lang=\"scss\" scoped>\n .x-column-picker-list {\n display: flex;\n list-style-type: none;\n }\n</style>\n\n<script lang=\"ts\">\n import { mixins } from 'vue-class-component';\n import { Component } from 'vue-property-decorator';\n import { VueCSSClasses } from '../../utils/types';\n import { XEventsTypes } from '../../wiring';\n import BaseEventButton from '../base-event-button.vue';\n import ColumnPickerMixin from './column-picker.mixin';\n\n interface ColumnPickerItem {\n column: number;\n cssClasses: VueCSSClasses;\n events: Partial<XEventsTypes>;\n isSelected: boolean;\n }\n\n /**\n * Column picker list component renders a list of buttons to choose the columns number.\n *\n * @remarks It extends {@link ColumnPickerMixin}.\n *\n * @public\n */\n @Component({\n components: { BaseEventButton }\n })\n export default class BaseColumnPickerList extends mixins(ColumnPickerMixin) {\n /**\n * Maps the column to an object containing: the `column` and `CSS classes`.\n *\n * @returns An array of objects containing the column number and CSS classes.\n *\n * @internal\n */\n protected get columnsWithCssClasses(): ColumnPickerItem[] {\n return this.columns.map(column => ({\n column,\n cssClasses: [\n `x-column-picker-list__item--${column}-cols`,\n {\n 'x-column-picker-list__item--is-selected': this.selectedColumns === column,\n 'x-option-list__item--is-selected': this.selectedColumns === column\n }\n ],\n isSelected: this.selectedColumns === column,\n events: {\n UserClickedColumnPicker: column,\n ColumnsNumberProvided: column\n }\n }));\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders a list of elements in different slots depending on the columns prop. Each\nelement will emit the needed events to sync other instances of columns pickers, or grids with the\nnumber of columns that it is being selected when it is clicked.\n\n### Default usage\n\nIt is required to send the columns prop.\n\n```vue\n<template>\n <BaseColumnPickerList :columns=\"columns\" />\n</template>\n<script>\n import { BaseColumnPickerList } from '@empathyco/xcomponents';\n\n export default {\n components: {\n BaseColumnPickerList\n },\n data() {\n return { columns: [2, 4, 6] };\n }\n };\n</script>\n```\n\n#### Using v-model\n\nIt is possible to do two way binding in order to synchronize the value with the parents. It will be\nupdated if it changed the value or if the parent changes it.\n\n```vue\n<template>\n <BaseColumnPickerList :columns=\"columns\" v-model=\"selectedColumns\" />\n</template>\n<script>\n import { BaseColumnPickerList } from '@empathyco/xcomponents';\n\n export default {\n components: {\n BaseColumnPickerList\n },\n data() {\n return { columns: [2, 4, 6], selectedColumns: 4 };\n }\n };\n</script>\n```\n\n### Customized usage\n\n#### Overriding the slots\n\nIt is possible to override the column picker button content.\n\n```vue\n<template>\n <BaseColumnPickerList :columns=\"columns\" #default=\"{ column, isSelected }\">\n <span>{{ column }} {{ isSelected ? '🟢' : '' }}</span>\n </BaseColumnPickerList>\n</template>\n<script>\n import { BaseColumnPickerList } from '@empathyco/xcomponents';\n\n export default {\n components: {\n BaseColumnPickerList\n },\n data() {\n return { columns: [2, 4, 6] };\n }\n };\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserClickedColumnPicker`: the event is emitted after the user clicks an item. The event payload\n is the number of columns that the clicked item represents.\n- `ColumnsNumberProvided`: the event is emitted on component mount. The event payload is the current\n `selectedColumns` value.\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"base-column-picker-list.vue.js","sources":["../../../../src/components/column-picker/base-column-picker-list.vue"],"sourcesContent":["<template>\n <ul class=\"x-option-list x-column-picker-list\" data-test=\"column-picker-list\">\n <li\n v-for=\"{ column, cssClasses, events, isSelected } in columnsWithCssClasses\"\n :key=\"column\"\n :class=\"cssClasses\"\n class=\"x-option-list__item x-column-picker-list__item\"\n data-test=\"column-picker-item\"\n >\n <BaseEventButton\n class=\"x-button column-picker-item__button\"\n data-test=\"column-picker-button\"\n :aria-selected=\"isSelected.toString()\"\n :events=\"events\"\n >\n <!--\n @slot Customized Column Picker Button content. Specifying a slot with the column value\n will result in the column using that slot composition to render.\n @binding {number} column - Columns Number to pick.\n @binding {boolean} isSelected - True if the columns number are the chosen value.\n -->\n <slot v-bind=\"{ column, isSelected }\">\n {{ column }}\n </slot>\n </BaseEventButton>\n </li>\n </ul>\n</template>\n\n<style lang=\"scss\" scoped>\n .x-column-picker-list {\n display: flex;\n list-style-type: none;\n }\n</style>\n\n<script lang=\"ts\">\n import { mixins } from 'vue-class-component';\n import { Component } from 'vue-property-decorator';\n import { VueCSSClasses } from '../../utils/types';\n import { XEventsTypes } from '../../wiring';\n import BaseEventButton from '../base-event-button.vue';\n import ColumnPickerMixin from './column-picker.mixin';\n\n interface ColumnPickerItem {\n column: number;\n cssClasses: VueCSSClasses;\n events: Partial<XEventsTypes>;\n isSelected: boolean;\n }\n\n /**\n * Column picker list component renders a list of buttons to choose the columns number.\n *\n * @remarks It extends {@link ColumnPickerMixin}.\n *\n * @public\n */\n @Component({\n components: { BaseEventButton }\n })\n export default class BaseColumnPickerList extends mixins(ColumnPickerMixin) {\n /**\n * Maps the column to an object containing: the `column` and `CSS classes`.\n *\n * @returns An array of objects containing the column number and CSS classes.\n *\n * @internal\n */\n protected get columnsWithCssClasses(): ColumnPickerItem[] {\n return this.columns.map(column => ({\n column,\n cssClasses: [\n `x-column-picker-list__item--${column}-cols`,\n {\n 'x-column-picker-list__item--is-selected': this.selectedColumns === column,\n 'x-option-list__item--is-selected': this.selectedColumns === column\n }\n ],\n isSelected: this.selectedColumns === column,\n events: {\n UserClickedColumnPicker: column,\n ColumnsNumberProvided: column\n }\n }));\n }\n }\n</script>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders a list of elements in different slots depending on the columns prop. Each\nelement will emit the needed events to sync other instances of columns pickers, or grids with the\nnumber of columns that it is being selected when it is clicked.\n\n### Default usage\n\nIt is required to send the columns prop.\n\n```vue\n<template>\n <BaseColumnPickerList :columns=\"columns\" />\n</template>\n<script>\n import { BaseColumnPickerList } from '@empathyco/xcomponents';\n\n export default {\n components: {\n BaseColumnPickerList\n },\n data() {\n return { columns: [2, 4, 6] };\n }\n };\n</script>\n```\n\n#### Using v-model\n\nIt is possible to do two way binding in order to synchronize the value with the parents. It will be\nupdated if it changed the value or if the parent changes it.\n\n```vue\n<template>\n <BaseColumnPickerList :columns=\"columns\" v-model=\"selectedColumns\" />\n</template>\n<script>\n import { BaseColumnPickerList } from '@empathyco/xcomponents';\n\n export default {\n components: {\n BaseColumnPickerList\n },\n data() {\n return { columns: [2, 4, 6], selectedColumns: 4 };\n }\n };\n</script>\n```\n\n### Customized usage\n\n#### Overriding the slots\n\nIt is possible to override the column picker button content.\n\n```vue\n<template>\n <BaseColumnPickerList :columns=\"columns\" #default=\"{ column, isSelected }\">\n <span>{{ column }} {{ isSelected ? '🟢' : '' }}</span>\n </BaseColumnPickerList>\n</template>\n<script>\n import { BaseColumnPickerList } from '@empathyco/xcomponents';\n\n export default {\n components: {\n BaseColumnPickerList\n },\n data() {\n return { columns: [2, 4, 6] };\n }\n };\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- `UserClickedColumnPicker`: the event is emitted after the user clicks an item. The event payload\n is the number of columns that the clicked item represents.\n- `ColumnsNumberProvided`: the event is emitted on component mount. The event payload is the current\n `selectedColumns` value.\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import { createInjector } from 'vue-runtime-helpers';
2
+
3
+ var css = ".x-column-picker-list[data-v-435aee1f] {\n display: flex;\n list-style-type: none;\n}";
4
+ const injector=createInjector({});injector('/__w/x/x/packages/x-components/src/components/column-picker/base-column-picker-list.vue?rollup-plugin-vue=styles.0.css',{source:css});
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=base-column-picker-list.vue_rollup-plugin-vue_styles.0.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-column-picker-list.vue_rollup-plugin-vue_styles.0.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,10 +1,9 @@
1
1
  import script from './fixed-header-and-asides-layout.vue_rollup-plugin-vue_script.vue.js';
2
+ import './fixed-header-and-asides-layout.vue_rollup-plugin-vue_styles.0.vue.js';
2
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.mjs';
3
- import __vue_create_injector__ from 'vue-runtime-helpers/dist/inject-style/browser.mjs';
4
4
 
5
5
  /* script */
6
6
  const __vue_script__ = script;
7
-
8
7
  /* template */
9
8
  var __vue_render__ = function () {
10
9
  var _vm = this;
@@ -212,17 +211,15 @@ var __vue_staticRenderFns__ = [];
212
211
  __vue_render__._withStripped = true;
213
212
 
214
213
  /* style */
215
- const __vue_inject_styles__ = function (inject) {
216
- if (!inject) return
217
- inject("data-v-47983f10_0", { source: ".dev-mode .slot-helper[data-v-47983f10] {\n font-family: inherit;\n color: grey;\n box-sizing: border-box;\n display: flex;\n height: 100%;\n width: 100%;\n justify-content: center;\n align-items: center;\n border: dashed 1px grey;\n border-radius: 10px;\n}\n.x-layout[data-v-47983f10] {\n display: grid;\n align-content: stretch;\n min-height: 100%;\n max-height: 100%;\n --x-size-margin-max-width: calc((100vw - var(--x-size-max-width-layout, 1440px)) / 2);\n --x-size-margin-layout: max(\n var(--x-size-min-margin-layout, 20px),\n var(--x-size-margin-max-width)\n );\n grid-template-rows: [page-start header-start] auto [header-end sub-header-start] auto [sub-header-end toolbar-start] auto [toolbar-end main-start] 1fr [main-end page-end];\n grid-template-columns: [page-start] var(--x-size-margin-layout) [max-width-start] 1fr [max-width-end] var(--x-size-margin-layout) [page-end];\n}\n.x-layout__header[data-v-47983f10] {\n position: sticky;\n top: -0.5px;\n z-index: 2;\n grid-row: header;\n grid-column: page;\n max-height: var(--x-size-max-height-layout-header, auto);\n padding: 0 var(--x-size-margin-layout);\n background: var(--x-color-background-layout-header, transparent);\n border-color: var(--x-size-border-color-layout-header, transparent);\n border-width: var(--x-size-border-width-layout-header, 0);\n border-style: solid;\n}\n.x-layout__sub-header[data-v-47983f10] {\n grid-row: sub-header;\n grid-column: page;\n padding: 0 var(--x-size-margin-layout);\n background: var(--x-color-background-layout-sub-header, transparent);\n border-color: var(--x-size-border-color-layout-sub-header, transparent);\n border-width: var(--x-size-border-width-layout-sub-header, 0);\n border-style: solid;\n}\n.x-layout__toolbar[data-v-47983f10] {\n grid-row: toolbar;\n grid-column: max-width;\n}\n.x-layout__main[data-v-47983f10] {\n grid-row: main;\n grid-column: max-width;\n}\n.x-layout[data-v-47983f10] .x-layout__aside {\n pointer-events: none;\n}\n.x-layout[data-v-47983f10] .x-layout__aside.x-modal {\n z-index: 3;\n flex-flow: row nowrap;\n}\n.x-layout[data-v-47983f10] .x-layout__aside > *:not(.slot-helper) {\n pointer-events: all;\n}\n.x-layout[data-v-47983f10] .x-layout__aside--right.x-modal {\n justify-content: flex-end;\n}\n.x-layout__scroll-to-top[data-v-47983f10] {\n position: fixed;\n z-index: 1;\n bottom: var(--x-size-margin-bottom-layout-scroll-to-top, 16px);\n right: var(--x-size-margin-right-layout-scroll-to-top, 16px);\n}\n.x-layout__header-backdrop[data-v-47983f10] {\n grid-row: page;\n grid-column: page;\n position: sticky;\n top: -0.5px;\n z-index: 1;\n height: var(--x-size-height-layout-backdrop, 40vh);\n width: 100%;\n pointer-events: none;\n background-color: var(--x-color-background-layout-header-backdrop, var(--x-color-base-neutral-100, white));\n -webkit-mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n opacity: 0;\n transition: opacity 0.2s ease-out;\n}\n.x-layout__header-backdrop--is-visible[data-v-47983f10] {\n opacity: 1;\n}\n[data-v-47983f10] .x-layout__aside .x-modal__content {\n background-color: transparent;\n height: 100%;\n width: var(--x-size-width-layout-aside, 300px);\n}", map: undefined, media: undefined });
218
-
219
- };
214
+ const __vue_inject_styles__ = undefined;
220
215
  /* scoped */
221
216
  const __vue_scope_id__ = "data-v-47983f10";
222
217
  /* module identifier */
223
218
  const __vue_module_identifier__ = undefined;
224
219
  /* functional template */
225
220
  const __vue_is_functional_template__ = false;
221
+ /* style inject */
222
+
226
223
  /* style inject SSR */
227
224
 
228
225
  /* style inject shadow dom */
@@ -237,7 +234,7 @@ __vue_render__._withStripped = true;
237
234
  __vue_is_functional_template__,
238
235
  __vue_module_identifier__,
239
236
  false,
240
- __vue_create_injector__,
237
+ undefined,
241
238
  undefined,
242
239
  undefined
243
240
  );
@@ -1 +1 @@
1
- {"version":3,"file":"fixed-header-and-asides-layout.vue.js","sources":["../../../../src/components/layouts/fixed-header-and-asides-layout.vue"],"sourcesContent":["<template>\n <MainScroll>\n <Scroll\n @scroll=\"setPosition\"\n id=\"main-scroll\"\n class=\"x-layout x-layout--fixed-header-and-asides\"\n :class=\"{ 'dev-mode': devMode }\"\n >\n <div\n key=\"header-backdrop\"\n class=\"x-layout__header-backdrop\"\n :class=\"{ 'x-layout__header-backdrop--is-visible': isBackdropVisible }\"\n />\n\n <header\n v-if=\"hasContent('header')\"\n key=\"header\"\n class=\"x-layout__header x-list x-list--horizontal\"\n >\n <!-- @slot Slot that is be used for insert content into the Header. -->\n <slot name=\"header\">\n <span v-if=\"devMode\" class=\"slot-helper\">HEADER</span>\n </slot>\n </header>\n\n <div v-if=\"hasContent('sub-header')\" key=\"sub-header\" class=\"x-layout__sub-header\">\n <div class=\"x-layout__sub-header-content\">\n <!-- @slot Slot that can be used to insert content into below the header. -->\n <slot name=\"sub-header\">\n <span v-if=\"devMode\" class=\"slot-helper\">SUB HEADER</span>\n </slot>\n </div>\n </div>\n\n <section v-if=\"hasContent('toolbar')\" key=\"toolbar\" class=\"x-layout__toolbar\">\n <slot name=\"toolbar\">\n <!-- @slot Slot that can be used to insert content above the main. -->\n <span v-if=\"devMode\" class=\"slot-helper\">TOOLBAR</span>\n </slot>\n </section>\n\n <main v-if=\"hasContent('main')\" key=\"main\" class=\"x-layout__main x-list x-list--vertical\">\n <!-- @slot Slot that is be used for insert content into the Main. -->\n <slot name=\"main\">\n <span v-if=\"devMode\" class=\"slot-helper\">MAIN</span>\n </slot>\n </main>\n\n <BaseIdModal\n v-if=\"hasContent('left-aside')\"\n key=\"left-aside\"\n :animation=\"leftAsideAnimation\"\n modalId=\"left-aside\"\n class=\"x-layout__aside x-layout__aside--left\"\n >\n <!-- @slot Slot that is be used for insert content into the left aside. -->\n <slot name=\"left-aside\">\n <span v-if=\"devMode\" class=\"slot-helper\">LEFT ASIDE</span>\n </slot>\n </BaseIdModal>\n\n <BaseIdModal\n v-if=\"hasContent('right-aside')\"\n key=\"right-aside\"\n :animation=\"rightAsideAnimation\"\n modalId=\"right-aside\"\n class=\"x-layout__aside x-layout__aside--right\"\n >\n <!-- @slot Slot that is be used for insert content into the right aside. -->\n <slot name=\"right-aside\">\n <span v-if=\"devMode\" class=\"slot-helper\">RIGHT ASIDE</span>\n </slot>\n </BaseIdModal>\n\n <slot name=\"extra-aside\">\n <span v-if=\"devMode\" class=\"slot-helper\">EXTRA ASIDE</span>\n </slot>\n\n <div v-if=\"hasContent('scroll-to-top')\" key=\"scroll-to-top\" class=\"x-layout__scroll-to-top\">\n <slot name=\"scroll-to-top\">\n <span v-if=\"devMode\" class=\"slot-helper\">SCROLL TO TOP</span>\n </slot>\n </div>\n </Scroll>\n </MainScroll>\n</template>\n\n<script lang=\"ts\">\n import { Component } from 'vue-property-decorator';\n import { mixins } from 'vue-class-component';\n import MainScroll from '../../x-modules/scroll/components/main-scroll.vue';\n import { animateTranslate } from '../animations/animate-translate/animate-translate.factory';\n import BaseIdModal from '../modals/base-id-modal.vue';\n import Scroll from '../../x-modules/scroll/components/scroll.vue';\n import LayoutsMixin from './layouts.mixin';\n\n /**\n * Component for use as Layout to be filled with the rest of the components.\n *\n * @public\n */\n @Component({\n components: {\n BaseIdModal,\n MainScroll,\n Scroll\n }\n })\n export default class FixedHeaderAndAsidesLayout extends mixins(LayoutsMixin) {\n protected scrollPosition = 0;\n protected rightAsideAnimation = animateTranslate('right');\n protected leftAsideAnimation = animateTranslate('left');\n\n protected setPosition(position: number): void {\n this.scrollPosition = position;\n }\n\n protected get isBackdropVisible(): boolean {\n return this.scrollPosition > 0;\n }\n }\n</script>\n\n<style scoped lang=\"scss\">\n @import '../../design-system/utilities/dev-mode';\n\n .x-layout {\n // custom properties\n display: grid;\n align-content: stretch;\n min-height: 100%;\n\n // layout\n max-height: 100%;\n --x-size-margin-max-width: calc((100vw - var(--x-size-max-width-layout, 1440px)) / 2);\n --x-size-margin-layout: max(\n var(--x-size-min-margin-layout, 20px),\n var(--x-size-margin-max-width)\n );\n\n grid-template-rows:\n [page-start header-start]\n auto\n [header-end sub-header-start]\n auto\n [sub-header-end toolbar-start]\n auto\n [toolbar-end main-start]\n 1fr\n [main-end page-end];\n\n grid-template-columns:\n [page-start]\n var(--x-size-margin-layout)\n [max-width-start]\n 1fr\n [max-width-end]\n var(--x-size-margin-layout)\n [page-end];\n\n &__header {\n // layout\n position: sticky;\n top: -0.5px;\n z-index: 2;\n grid-row: header;\n grid-column: page;\n max-height: var(--x-size-max-height-layout-header, auto);\n padding: 0 var(--x-size-margin-layout);\n\n //color\n background: var(--x-color-background-layout-header, transparent);\n border-color: var(--x-size-border-color-layout-header, transparent);\n\n // border\n border-width: var(--x-size-border-width-layout-header, 0);\n border-style: solid;\n }\n\n &__sub-header {\n // layout\n grid-row: sub-header;\n grid-column: page;\n padding: 0 var(--x-size-margin-layout);\n\n //color\n background: var(--x-color-background-layout-sub-header, transparent);\n border-color: var(--x-size-border-color-layout-sub-header, transparent);\n\n // border\n border-width: var(--x-size-border-width-layout-sub-header, 0);\n border-style: solid;\n }\n\n &__toolbar {\n // layout\n grid-row: toolbar;\n grid-column: max-width;\n }\n\n &__main {\n // layout\n grid-row: main;\n grid-column: max-width;\n }\n\n ::v-deep .x-layout__aside {\n &.x-modal {\n // layout\n z-index: 3;\n flex-flow: row nowrap;\n }\n\n // others\n pointer-events: none;\n > *:not(.slot-helper) {\n pointer-events: all;\n }\n\n &--right.x-modal {\n justify-content: flex-end;\n }\n }\n\n &__scroll-to-top {\n position: fixed;\n z-index: 1;\n bottom: var(--x-size-margin-bottom-layout-scroll-to-top, 16px);\n right: var(--x-size-margin-right-layout-scroll-to-top, 16px);\n }\n\n &__header-backdrop {\n // layout\n grid-row: page;\n grid-column: page;\n position: sticky;\n top: -0.5px;\n z-index: 1;\n height: var(--x-size-height-layout-backdrop, 40vh);\n width: 100%;\n pointer-events: none;\n\n // color\n background-color: var(\n --x-color-background-layout-header-backdrop,\n var(--x-color-base-neutral-100, white)\n );\n mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n\n // transition\n opacity: 0;\n transition: opacity 0.2s ease-out;\n\n &--is-visible {\n opacity: 1;\n }\n }\n }\n\n ::v-deep .x-layout__aside {\n .x-modal__content {\n background-color: transparent;\n height: 100%;\n width: var(--x-size-width-layout-aside, 300px);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Layout\n\nThis component has the following layout with fixed headers and collapsible fixed asides:\n\n| | header | |\n| :--------: | :--------: | :-----------: |\n| left-aside | sub-header | right-aside |\n| | toolbar | |\n| | main | |\n| | | scroll-to-top |\n\nAdditionally it provides an empty slot `extra-aside` to be customized by the user.\n\n## Design Tokens\n\nThe component has also the following `Design Tokens` to configure it:\n\n| token | default value |\n| :-----------------------------------------: | :-----------: |\n| --x-size-height-layout-backdrop | 40vh |\n| --x-size-width-layout-aside | 300px |\n| --x-size-min-margin-layout | 20px |\n| --x-size-max-height-layout-header | auto |\n| --x-size-max-width-layout | 1440px |\n| --x-color-background-layout-header-backdrop | white |\n| --x-color-background-layout-header | transparent |\n| --x-size-border-color-layout-header | transparent |\n| --x-size-border-width-layout-header | 0px |\n| --x-color-background-layout-sub-header | transparent |\n| --x-size-border-color-layout-sub-header | transparent |\n| --x-size-border-width-layout-sub-header | 0px |\n\n| token | use |\n| :-----------------------------------------: | :---------------------------------------: |\n| --x-size-height-layout-backdrop | The height for header gradient backdrop |\n| --x-size-width-layout-aside | The width of the asides |\n| --x-size-min-margin-layout | The min horizontal margin for the Layout |\n| --x-size-max-height-layout-header | The max height for the Layout Header |\n| --x-size-max-width-layout | The max width for the Layout |\n| --x-color-background-layout-header-backdrop | The background color of the head backdrop |\n| --x-color-background-layout-header | The background color of the header |\n| --x-size-border-color-layout-header | The border color of the header |\n| --x-size-border-width-layout-header | The border with of the header |\n| --x-color-background-layout-sub-header | The background color of the sub header |\n| --x-size-border-color-layout-sub-header | The border color of the sub header |\n| --x-size-border-width-layout-sub-header | The border with of the sub header |\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fixed-header-and-asides-layout.vue.js","sources":["../../../../src/components/layouts/fixed-header-and-asides-layout.vue"],"sourcesContent":["<template>\n <MainScroll>\n <Scroll\n @scroll=\"setPosition\"\n id=\"main-scroll\"\n class=\"x-layout x-layout--fixed-header-and-asides\"\n :class=\"{ 'dev-mode': devMode }\"\n >\n <div\n key=\"header-backdrop\"\n class=\"x-layout__header-backdrop\"\n :class=\"{ 'x-layout__header-backdrop--is-visible': isBackdropVisible }\"\n />\n\n <header\n v-if=\"hasContent('header')\"\n key=\"header\"\n class=\"x-layout__header x-list x-list--horizontal\"\n >\n <!-- @slot Slot that is be used for insert content into the Header. -->\n <slot name=\"header\">\n <span v-if=\"devMode\" class=\"slot-helper\">HEADER</span>\n </slot>\n </header>\n\n <div v-if=\"hasContent('sub-header')\" key=\"sub-header\" class=\"x-layout__sub-header\">\n <div class=\"x-layout__sub-header-content\">\n <!-- @slot Slot that can be used to insert content into below the header. -->\n <slot name=\"sub-header\">\n <span v-if=\"devMode\" class=\"slot-helper\">SUB HEADER</span>\n </slot>\n </div>\n </div>\n\n <section v-if=\"hasContent('toolbar')\" key=\"toolbar\" class=\"x-layout__toolbar\">\n <slot name=\"toolbar\">\n <!-- @slot Slot that can be used to insert content above the main. -->\n <span v-if=\"devMode\" class=\"slot-helper\">TOOLBAR</span>\n </slot>\n </section>\n\n <main v-if=\"hasContent('main')\" key=\"main\" class=\"x-layout__main x-list x-list--vertical\">\n <!-- @slot Slot that is be used for insert content into the Main. -->\n <slot name=\"main\">\n <span v-if=\"devMode\" class=\"slot-helper\">MAIN</span>\n </slot>\n </main>\n\n <BaseIdModal\n v-if=\"hasContent('left-aside')\"\n key=\"left-aside\"\n :animation=\"leftAsideAnimation\"\n modalId=\"left-aside\"\n class=\"x-layout__aside x-layout__aside--left\"\n >\n <!-- @slot Slot that is be used for insert content into the left aside. -->\n <slot name=\"left-aside\">\n <span v-if=\"devMode\" class=\"slot-helper\">LEFT ASIDE</span>\n </slot>\n </BaseIdModal>\n\n <BaseIdModal\n v-if=\"hasContent('right-aside')\"\n key=\"right-aside\"\n :animation=\"rightAsideAnimation\"\n modalId=\"right-aside\"\n class=\"x-layout__aside x-layout__aside--right\"\n >\n <!-- @slot Slot that is be used for insert content into the right aside. -->\n <slot name=\"right-aside\">\n <span v-if=\"devMode\" class=\"slot-helper\">RIGHT ASIDE</span>\n </slot>\n </BaseIdModal>\n\n <slot name=\"extra-aside\">\n <span v-if=\"devMode\" class=\"slot-helper\">EXTRA ASIDE</span>\n </slot>\n\n <div v-if=\"hasContent('scroll-to-top')\" key=\"scroll-to-top\" class=\"x-layout__scroll-to-top\">\n <slot name=\"scroll-to-top\">\n <span v-if=\"devMode\" class=\"slot-helper\">SCROLL TO TOP</span>\n </slot>\n </div>\n </Scroll>\n </MainScroll>\n</template>\n\n<script lang=\"ts\">\n import { Component } from 'vue-property-decorator';\n import { mixins } from 'vue-class-component';\n import MainScroll from '../../x-modules/scroll/components/main-scroll.vue';\n import { animateTranslate } from '../animations/animate-translate/animate-translate.factory';\n import BaseIdModal from '../modals/base-id-modal.vue';\n import Scroll from '../../x-modules/scroll/components/scroll.vue';\n import LayoutsMixin from './layouts.mixin';\n\n /**\n * Component for use as Layout to be filled with the rest of the components.\n *\n * @public\n */\n @Component({\n components: {\n BaseIdModal,\n MainScroll,\n Scroll\n }\n })\n export default class FixedHeaderAndAsidesLayout extends mixins(LayoutsMixin) {\n protected scrollPosition = 0;\n protected rightAsideAnimation = animateTranslate('right');\n protected leftAsideAnimation = animateTranslate('left');\n\n protected setPosition(position: number): void {\n this.scrollPosition = position;\n }\n\n protected get isBackdropVisible(): boolean {\n return this.scrollPosition > 0;\n }\n }\n</script>\n\n<style scoped lang=\"scss\">\n @import '../../design-system/utilities/dev-mode';\n\n .x-layout {\n // custom properties\n display: grid;\n align-content: stretch;\n min-height: 100%;\n\n // layout\n max-height: 100%;\n --x-size-margin-max-width: calc((100vw - var(--x-size-max-width-layout, 1440px)) / 2);\n --x-size-margin-layout: max(\n var(--x-size-min-margin-layout, 20px),\n var(--x-size-margin-max-width)\n );\n\n grid-template-rows:\n [page-start header-start]\n auto\n [header-end sub-header-start]\n auto\n [sub-header-end toolbar-start]\n auto\n [toolbar-end main-start]\n 1fr\n [main-end page-end];\n\n grid-template-columns:\n [page-start]\n var(--x-size-margin-layout)\n [max-width-start]\n 1fr\n [max-width-end]\n var(--x-size-margin-layout)\n [page-end];\n\n &__header {\n // layout\n position: sticky;\n top: -0.5px;\n z-index: 2;\n grid-row: header;\n grid-column: page;\n max-height: var(--x-size-max-height-layout-header, auto);\n padding: 0 var(--x-size-margin-layout);\n\n //color\n background: var(--x-color-background-layout-header, transparent);\n border-color: var(--x-size-border-color-layout-header, transparent);\n\n // border\n border-width: var(--x-size-border-width-layout-header, 0);\n border-style: solid;\n }\n\n &__sub-header {\n // layout\n grid-row: sub-header;\n grid-column: page;\n padding: 0 var(--x-size-margin-layout);\n\n //color\n background: var(--x-color-background-layout-sub-header, transparent);\n border-color: var(--x-size-border-color-layout-sub-header, transparent);\n\n // border\n border-width: var(--x-size-border-width-layout-sub-header, 0);\n border-style: solid;\n }\n\n &__toolbar {\n // layout\n grid-row: toolbar;\n grid-column: max-width;\n }\n\n &__main {\n // layout\n grid-row: main;\n grid-column: max-width;\n }\n\n ::v-deep .x-layout__aside {\n &.x-modal {\n // layout\n z-index: 3;\n flex-flow: row nowrap;\n }\n\n // others\n pointer-events: none;\n > *:not(.slot-helper) {\n pointer-events: all;\n }\n\n &--right.x-modal {\n justify-content: flex-end;\n }\n }\n\n &__scroll-to-top {\n position: fixed;\n z-index: 1;\n bottom: var(--x-size-margin-bottom-layout-scroll-to-top, 16px);\n right: var(--x-size-margin-right-layout-scroll-to-top, 16px);\n }\n\n &__header-backdrop {\n // layout\n grid-row: page;\n grid-column: page;\n position: sticky;\n top: -0.5px;\n z-index: 1;\n height: var(--x-size-height-layout-backdrop, 40vh);\n width: 100%;\n pointer-events: none;\n\n // color\n background-color: var(\n --x-color-background-layout-header-backdrop,\n var(--x-color-base-neutral-100, white)\n );\n mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n\n // transition\n opacity: 0;\n transition: opacity 0.2s ease-out;\n\n &--is-visible {\n opacity: 1;\n }\n }\n }\n\n ::v-deep .x-layout__aside {\n .x-modal__content {\n background-color: transparent;\n height: 100%;\n width: var(--x-size-width-layout-aside, 300px);\n }\n }\n</style>\n\n<docs lang=\"mdx\">\n## Layout\n\nThis component has the following layout with fixed headers and collapsible fixed asides:\n\n| | header | |\n| :--------: | :--------: | :-----------: |\n| left-aside | sub-header | right-aside |\n| | toolbar | |\n| | main | |\n| | | scroll-to-top |\n\nAdditionally it provides an empty slot `extra-aside` to be customized by the user.\n\n## Design Tokens\n\nThe component has also the following `Design Tokens` to configure it:\n\n| token | default value |\n| :-----------------------------------------: | :-----------: |\n| --x-size-height-layout-backdrop | 40vh |\n| --x-size-width-layout-aside | 300px |\n| --x-size-min-margin-layout | 20px |\n| --x-size-max-height-layout-header | auto |\n| --x-size-max-width-layout | 1440px |\n| --x-color-background-layout-header-backdrop | white |\n| --x-color-background-layout-header | transparent |\n| --x-size-border-color-layout-header | transparent |\n| --x-size-border-width-layout-header | 0px |\n| --x-color-background-layout-sub-header | transparent |\n| --x-size-border-color-layout-sub-header | transparent |\n| --x-size-border-width-layout-sub-header | 0px |\n\n| token | use |\n| :-----------------------------------------: | :---------------------------------------: |\n| --x-size-height-layout-backdrop | The height for header gradient backdrop |\n| --x-size-width-layout-aside | The width of the asides |\n| --x-size-min-margin-layout | The min horizontal margin for the Layout |\n| --x-size-max-height-layout-header | The max height for the Layout Header |\n| --x-size-max-width-layout | The max width for the Layout |\n| --x-color-background-layout-header-backdrop | The background color of the head backdrop |\n| --x-color-background-layout-header | The background color of the header |\n| --x-size-border-color-layout-header | The border color of the header |\n| --x-size-border-width-layout-header | The border with of the header |\n| --x-color-background-layout-sub-header | The background color of the sub header |\n| --x-size-border-color-layout-sub-header | The border color of the sub header |\n| --x-size-border-width-layout-sub-header | The border with of the sub header |\n</docs>\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import { createInjector } from 'vue-runtime-helpers';
2
+
3
+ var css = ".dev-mode .slot-helper[data-v-47983f10] {\n font-family: inherit;\n color: grey;\n box-sizing: border-box;\n display: flex;\n height: 100%;\n width: 100%;\n justify-content: center;\n align-items: center;\n border: dashed 1px grey;\n border-radius: 10px;\n}\n.x-layout[data-v-47983f10] {\n display: grid;\n align-content: stretch;\n min-height: 100%;\n max-height: 100%;\n --x-size-margin-max-width: calc((100vw - var(--x-size-max-width-layout, 1440px)) / 2);\n --x-size-margin-layout: max(\n var(--x-size-min-margin-layout, 20px),\n var(--x-size-margin-max-width)\n );\n grid-template-rows: [page-start header-start] auto [header-end sub-header-start] auto [sub-header-end toolbar-start] auto [toolbar-end main-start] 1fr [main-end page-end];\n grid-template-columns: [page-start] var(--x-size-margin-layout) [max-width-start] 1fr [max-width-end] var(--x-size-margin-layout) [page-end];\n}\n.x-layout__header[data-v-47983f10] {\n position: sticky;\n top: -0.5px;\n z-index: 2;\n grid-row: header;\n grid-column: page;\n max-height: var(--x-size-max-height-layout-header, auto);\n padding: 0 var(--x-size-margin-layout);\n background: var(--x-color-background-layout-header, transparent);\n border-color: var(--x-size-border-color-layout-header, transparent);\n border-width: var(--x-size-border-width-layout-header, 0);\n border-style: solid;\n}\n.x-layout__sub-header[data-v-47983f10] {\n grid-row: sub-header;\n grid-column: page;\n padding: 0 var(--x-size-margin-layout);\n background: var(--x-color-background-layout-sub-header, transparent);\n border-color: var(--x-size-border-color-layout-sub-header, transparent);\n border-width: var(--x-size-border-width-layout-sub-header, 0);\n border-style: solid;\n}\n.x-layout__toolbar[data-v-47983f10] {\n grid-row: toolbar;\n grid-column: max-width;\n}\n.x-layout__main[data-v-47983f10] {\n grid-row: main;\n grid-column: max-width;\n}\n.x-layout[data-v-47983f10] .x-layout__aside {\n pointer-events: none;\n}\n.x-layout[data-v-47983f10] .x-layout__aside.x-modal {\n z-index: 3;\n flex-flow: row nowrap;\n}\n.x-layout[data-v-47983f10] .x-layout__aside > *:not(.slot-helper) {\n pointer-events: all;\n}\n.x-layout[data-v-47983f10] .x-layout__aside--right.x-modal {\n justify-content: flex-end;\n}\n.x-layout__scroll-to-top[data-v-47983f10] {\n position: fixed;\n z-index: 1;\n bottom: var(--x-size-margin-bottom-layout-scroll-to-top, 16px);\n right: var(--x-size-margin-right-layout-scroll-to-top, 16px);\n}\n.x-layout__header-backdrop[data-v-47983f10] {\n grid-row: page;\n grid-column: page;\n position: sticky;\n top: -0.5px;\n z-index: 1;\n height: var(--x-size-height-layout-backdrop, 40vh);\n width: 100%;\n pointer-events: none;\n background-color: var(--x-color-background-layout-header-backdrop, var(--x-color-base-neutral-100, white));\n -webkit-mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n opacity: 0;\n transition: opacity 0.2s ease-out;\n}\n.x-layout__header-backdrop--is-visible[data-v-47983f10] {\n opacity: 1;\n}\n[data-v-47983f10] .x-layout__aside .x-modal__content {\n background-color: transparent;\n height: 100%;\n width: var(--x-size-width-layout-aside, 300px);\n}";
4
+ const injector=createInjector({});injector('/__w/x/x/packages/x-components/src/components/layouts/fixed-header-and-asides-layout.vue?rollup-plugin-vue=styles.0.css',{source:css});
5
+
6
+ export { css, css as default };
7
+ //# sourceMappingURL=fixed-header-and-asides-layout.vue_rollup-plugin-vue_styles.0.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixed-header-and-asides-layout.vue_rollup-plugin-vue_styles.0.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}