@empathyco/x-components 6.0.0-alpha.238 → 6.0.0-alpha.239
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.
- package/CHANGELOG.md +11 -0
- package/core/index.d.ts +0 -1
- package/docs/API-reference/api/x-components.allfilter.md +1 -1
- package/docs/API-reference/api/x-components.highlight_2.md +1 -1
- package/docs/API-reference/api/x-components.slidingpanel.md +2 -2
- package/docs/API-reference/components/common/column-picker/x-components.base-column-picker-list.md +1 -1
- package/docs/API-reference/components/common/x-components.base-slider.md +2 -2
- package/js/components/animations/change-height.vue.js.map +1 -1
- package/js/components/animations/change-height.vue2.js.map +1 -1
- package/js/components/auto-progress-bar.vue.js +2 -2
- package/js/components/auto-progress-bar.vue.js.map +1 -1
- package/js/components/auto-progress-bar.vue2.js.map +1 -1
- package/js/components/base-slider.vue.js.map +1 -1
- package/js/components/base-slider.vue2.js.map +1 -1
- package/js/components/base-slider.vue3.js +1 -1
- package/js/components/base-switch.vue.js.map +1 -1
- package/js/components/base-switch.vue2.js +1 -1
- package/js/components/base-switch.vue2.js.map +1 -1
- package/js/components/column-picker/base-column-picker-list.vue.js +2 -2
- package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
- package/js/components/column-picker/base-column-picker-list.vue2.js +1 -1
- package/js/components/column-picker/base-column-picker-list.vue2.js.map +1 -1
- package/js/components/highlight.vue.js +1 -1
- package/js/components/highlight.vue.js.map +1 -1
- package/js/components/highlight.vue2.js +1 -1
- package/js/components/highlight.vue2.js.map +1 -1
- package/js/components/icons/ai-star.vue.js +1 -0
- package/js/components/icons/ai-star.vue.js.map +1 -1
- package/js/components/icons/arrow-down.vue.js +1 -1
- package/js/components/icons/arrow-down.vue.js.map +1 -1
- package/js/components/icons/arrow-left.vue.js +1 -1
- package/js/components/icons/arrow-left.vue.js.map +1 -1
- package/js/components/icons/arrow-right.vue.js +1 -1
- package/js/components/icons/arrow-right.vue.js.map +1 -1
- package/js/components/icons/arrow-up.vue.js +1 -1
- package/js/components/icons/arrow-up.vue.js.map +1 -1
- package/js/components/icons/bag.vue.js +1 -1
- package/js/components/icons/bag.vue.js.map +1 -1
- package/js/components/icons/bar-code.vue.js +1 -1
- package/js/components/icons/bar-code.vue.js.map +1 -1
- package/js/components/icons/barcode-tiny.vue.js +1 -1
- package/js/components/icons/barcode-tiny.vue.js.map +1 -1
- package/js/components/icons/cart-filled.vue.js +1 -1
- package/js/components/icons/cart-filled.vue.js.map +1 -1
- package/js/components/icons/cart.vue.js +1 -1
- package/js/components/icons/cart.vue.js.map +1 -1
- package/js/components/icons/check-tiny.vue.js +1 -1
- package/js/components/icons/check-tiny.vue.js.map +1 -1
- package/js/components/icons/check.vue.js +1 -1
- package/js/components/icons/check.vue.js.map +1 -1
- package/js/components/icons/checkbox-selected-filled.vue.js +1 -1
- package/js/components/icons/checkbox-selected-filled.vue.js.map +1 -1
- package/js/components/icons/checkbox-selected.vue.js +1 -1
- package/js/components/icons/checkbox-selected.vue.js.map +1 -1
- package/js/components/icons/checkbox-unselected-filled.vue.js +1 -1
- package/js/components/icons/checkbox-unselected-filled.vue.js.map +1 -1
- package/js/components/icons/checkbox-unselected.vue.js +1 -1
- package/js/components/icons/checkbox-unselected.vue.js.map +1 -1
- package/js/components/icons/chevron-down.vue.js +1 -1
- package/js/components/icons/chevron-down.vue.js.map +1 -1
- package/js/components/icons/chevron-left.vue.js +1 -1
- package/js/components/icons/chevron-left.vue.js.map +1 -1
- package/js/components/icons/chevron-right.vue.js +1 -1
- package/js/components/icons/chevron-right.vue.js.map +1 -1
- package/js/components/icons/chevron-tiny-down.vue.js +1 -1
- package/js/components/icons/chevron-tiny-down.vue.js.map +1 -1
- package/js/components/icons/chevron-tiny-left.vue.js +1 -1
- package/js/components/icons/chevron-tiny-left.vue.js.map +1 -1
- package/js/components/icons/chevron-tiny-right.vue.js +1 -1
- package/js/components/icons/chevron-tiny-right.vue.js.map +1 -1
- package/js/components/icons/chevron-tiny-up.vue.js +1 -1
- package/js/components/icons/chevron-tiny-up.vue.js.map +1 -1
- package/js/components/icons/chevron-up.vue.js +1 -1
- package/js/components/icons/chevron-up.vue.js.map +1 -1
- package/js/components/icons/corner-arrow-left.vue.js +1 -1
- package/js/components/icons/corner-arrow-left.vue.js.map +1 -1
- package/js/components/icons/corner-arrow-right.vue.js +1 -1
- package/js/components/icons/corner-arrow-right.vue.js.map +1 -1
- package/js/components/icons/cross-tiny.vue.js +1 -1
- package/js/components/icons/cross-tiny.vue.js.map +1 -1
- package/js/components/icons/cross.vue.js +1 -1
- package/js/components/icons/cross.vue.js.map +1 -1
- package/js/components/icons/curated-check-filled.vue.js +1 -1
- package/js/components/icons/curated-check-filled.vue.js.map +1 -1
- package/js/components/icons/curated-check-tiny-filled.vue.js +1 -1
- package/js/components/icons/curated-check-tiny-filled.vue.js.map +1 -1
- package/js/components/icons/curated-check-tiny.vue.js +1 -1
- package/js/components/icons/curated-check-tiny.vue.js.map +1 -1
- package/js/components/icons/curated-check.vue.js +1 -1
- package/js/components/icons/curated-check.vue.js.map +1 -1
- package/js/components/icons/diagonal-arrow-left-down.vue.js +1 -1
- package/js/components/icons/diagonal-arrow-left-down.vue.js.map +1 -1
- package/js/components/icons/diagonal-arrow-left-top.vue.js +1 -1
- package/js/components/icons/diagonal-arrow-left-top.vue.js.map +1 -1
- package/js/components/icons/diagonal-arrow-right-down.vue.js +1 -1
- package/js/components/icons/diagonal-arrow-right-down.vue.js.map +1 -1
- package/js/components/icons/diagonal-arrow-right-top.vue.js +1 -1
- package/js/components/icons/diagonal-arrow-right-top.vue.js.map +1 -1
- package/js/components/icons/filters.vue.js +1 -1
- package/js/components/icons/filters.vue.js.map +1 -1
- package/js/components/icons/grid-1-col.vue.js +1 -1
- package/js/components/icons/grid-1-col.vue.js.map +1 -1
- package/js/components/icons/grid-2-col.vue.js +1 -1
- package/js/components/icons/grid-2-col.vue.js.map +1 -1
- package/js/components/icons/grid-2-rows.vue.js +1 -1
- package/js/components/icons/grid-2-rows.vue.js.map +1 -1
- package/js/components/icons/grid-4-col.vue.js +1 -1
- package/js/components/icons/grid-4-col.vue.js.map +1 -1
- package/js/components/icons/heart-filled.vue.js +1 -1
- package/js/components/icons/heart-filled.vue.js.map +1 -1
- package/js/components/icons/heart.vue.js +1 -1
- package/js/components/icons/heart.vue.js.map +1 -1
- package/js/components/icons/hide.vue.js +1 -1
- package/js/components/icons/hide.vue.js.map +1 -1
- package/js/components/icons/history-tiny.vue.js +1 -1
- package/js/components/icons/history-tiny.vue.js.map +1 -1
- package/js/components/icons/history.vue.js +1 -1
- package/js/components/icons/history.vue.js.map +1 -1
- package/js/components/icons/light-bulb-off.vue.js +1 -1
- package/js/components/icons/light-bulb-off.vue.js.map +1 -1
- package/js/components/icons/light-bulb-on.vue.js +1 -1
- package/js/components/icons/light-bulb-on.vue.js.map +1 -1
- package/js/components/icons/menu.vue.js +1 -1
- package/js/components/icons/menu.vue.js.map +1 -1
- package/js/components/icons/minus-tiny.vue.js +1 -1
- package/js/components/icons/minus-tiny.vue.js.map +1 -1
- package/js/components/icons/minus.vue.js +1 -1
- package/js/components/icons/minus.vue.js.map +1 -1
- package/js/components/icons/plus-tiny.vue.js +1 -1
- package/js/components/icons/plus-tiny.vue.js.map +1 -1
- package/js/components/icons/plus.vue.js +1 -1
- package/js/components/icons/plus.vue.js.map +1 -1
- package/js/components/icons/radiobutton-selected.vue.js +1 -1
- package/js/components/icons/radiobutton-selected.vue.js.map +1 -1
- package/js/components/icons/radiobutton-unselected.vue.js +1 -1
- package/js/components/icons/radiobutton-unselected.vue.js.map +1 -1
- package/js/components/icons/search-tiny.vue.js +1 -1
- package/js/components/icons/search-tiny.vue.js.map +1 -1
- package/js/components/icons/search.vue.js +1 -1
- package/js/components/icons/search.vue.js.map +1 -1
- package/js/components/icons/settings.vue.js +1 -1
- package/js/components/icons/settings.vue.js.map +1 -1
- package/js/components/icons/show.vue.js +1 -1
- package/js/components/icons/show.vue.js.map +1 -1
- package/js/components/icons/sort-az.vue.js +1 -1
- package/js/components/icons/sort-az.vue.js.map +1 -1
- package/js/components/icons/sort-price-down.vue.js +1 -1
- package/js/components/icons/sort-price-down.vue.js.map +1 -1
- package/js/components/icons/sort-price-up.vue.js +1 -1
- package/js/components/icons/sort-price-up.vue.js.map +1 -1
- package/js/components/icons/sort-relevancy.vue.js +1 -1
- package/js/components/icons/sort-relevancy.vue.js.map +1 -1
- package/js/components/icons/sort-za.vue.js +1 -1
- package/js/components/icons/sort-za.vue.js.map +1 -1
- package/js/components/icons/spinner.vue.js +1 -1
- package/js/components/icons/spinner.vue.js.map +1 -1
- package/js/components/icons/star-filled.vue.js +1 -1
- package/js/components/icons/star-filled.vue.js.map +1 -1
- package/js/components/icons/star.vue.js +1 -1
- package/js/components/icons/star.vue.js.map +1 -1
- package/js/components/icons/tag-filled.vue.js +1 -1
- package/js/components/icons/tag-filled.vue.js.map +1 -1
- package/js/components/icons/tag.vue.js +1 -1
- package/js/components/icons/tag.vue.js.map +1 -1
- package/js/components/icons/trash-open.vue.js +1 -1
- package/js/components/icons/trash-open.vue.js.map +1 -1
- package/js/components/icons/trash.vue.js +1 -1
- package/js/components/icons/trash.vue.js.map +1 -1
- package/js/components/icons/trending-tiny.vue.js +1 -1
- package/js/components/icons/trending-tiny.vue.js.map +1 -1
- package/js/components/icons/trending.vue.js +1 -1
- package/js/components/icons/trending.vue.js.map +1 -1
- package/js/components/icons/user-filled.vue.js +1 -1
- package/js/components/icons/user-filled.vue.js.map +1 -1
- package/js/components/icons/user.vue.js +1 -1
- package/js/components/icons/user.vue.js.map +1 -1
- package/js/components/layouts/multi-column-max-width-layout.vue4.js +1 -1
- package/js/components/layouts/single-column-layout.vue3.js +1 -1
- package/js/components/modals/base-events-modal-close.vue.js +1 -1
- package/js/components/modals/base-events-modal-close.vue.js.map +1 -1
- package/js/components/modals/base-events-modal-close.vue2.js.map +1 -1
- package/js/components/modals/base-events-modal-open.vue.js +1 -1
- package/js/components/modals/base-events-modal-open.vue.js.map +1 -1
- package/js/components/modals/base-events-modal-open.vue2.js.map +1 -1
- package/js/components/modals/base-id-modal-close.vue.js +1 -1
- package/js/components/modals/base-id-modal-close.vue.js.map +1 -1
- package/js/components/modals/base-id-modal-close.vue2.js.map +1 -1
- package/js/components/modals/base-id-modal-open.vue.js +1 -1
- package/js/components/modals/base-id-modal-open.vue.js.map +1 -1
- package/js/components/modals/base-id-modal-open.vue2.js.map +1 -1
- package/js/components/page-loader-button.vue.js +1 -1
- package/js/components/page-loader-button.vue.js.map +1 -1
- package/js/components/page-loader-button.vue2.js.map +1 -1
- package/js/components/page-selector.vue.js +3 -3
- package/js/components/page-selector.vue.js.map +1 -1
- package/js/components/page-selector.vue2.js.map +1 -1
- package/js/components/panels/base-id-toggle-panel-button.vue.js +1 -1
- package/js/components/panels/base-id-toggle-panel-button.vue.js.map +1 -1
- package/js/components/panels/base-id-toggle-panel-button.vue2.js.map +1 -1
- package/js/components/result/base-result-add-to-cart.vue.js +1 -1
- package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
- package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
- package/js/components/result/base-result-image.vue.js +3 -3
- package/js/components/result/base-result-image.vue.js.map +1 -1
- package/js/components/result/base-result-image.vue2.js.map +1 -1
- package/js/components/scroll/base-scroll.vue.js +1 -1
- package/js/components/scroll/base-scroll.vue.js.map +1 -1
- package/js/components/scroll/base-scroll.vue2.js.map +1 -1
- package/js/components/sliding-panel.vue.js +4 -4
- package/js/components/sliding-panel.vue.js.map +1 -1
- package/js/components/sliding-panel.vue2.js +2 -2
- package/js/components/sliding-panel.vue2.js.map +1 -1
- package/js/components/sliding-panel.vue3.js +1 -1
- package/js/x-bus/x-bus.js +1 -3
- package/js/x-bus/x-bus.js.map +1 -1
- package/js/x-modules/ai/components/ai-carousel.vue.js +1 -1
- package/js/x-modules/ai/components/ai-carousel.vue.js.map +1 -1
- package/js/x-modules/ai/components/ai-carousel.vue2.js.map +1 -1
- package/js/x-modules/ai/components/ai-carousel.vue3.js +1 -1
- package/js/x-modules/ai/components/ai-overview.vue.js.map +1 -1
- package/js/x-modules/ai/components/ai-overview.vue2.js.map +1 -1
- package/js/x-modules/ai/components/ai-overview.vue3.js +1 -1
- package/js/x-modules/facets/components/clear-filters.vue.js +1 -1
- package/js/x-modules/facets/components/clear-filters.vue.js.map +1 -1
- package/js/x-modules/facets/components/clear-filters.vue2.js.map +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue.js +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue2.js +1 -1
- package/js/x-modules/facets/components/filters/all-filter.vue2.js.map +1 -1
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +4 -4
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/filters/editable-number-range-filter.vue2.js.map +1 -1
- package/js/x-modules/facets/components/filters/renderless-filter.vue.js +2 -2
- package/js/x-modules/facets/components/filters/renderless-filter.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-search.vue.js +1 -1
- package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/filters-search.vue2.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js +2 -2
- package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
- package/js/x-modules/facets/components/lists/sliced-filters.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js +1 -1
- package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/clear-history-queries.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-queries.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue.js +2 -2
- package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/history-query.vue2.js.map +1 -1
- package/js/x-modules/history-queries/components/my-history.vue.js +1 -1
- package/js/x-modules/history-queries/components/my-history.vue.js.map +1 -1
- package/js/x-modules/history-queries/components/my-history.vue2.js.map +1 -1
- package/js/x-modules/next-queries/components/next-queries.vue.js +1 -1
- package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
- package/js/x-modules/next-queries/components/next-queries.vue2.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-searches.vue.js +1 -1
- package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
- package/js/x-modules/popular-searches/components/popular-searches.vue2.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue.js +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-button.vue2.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview-list.vue3.js +1 -1
- package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
- package/js/x-modules/queries-preview/components/query-preview.vue2.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestions.vue.js +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
- package/js/x-modules/query-suggestions/components/query-suggestions.vue2.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue.js +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue2.js +1 -1
- package/js/x-modules/related-tags/components/related-tag.vue2.js.map +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue.js +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -1
- package/js/x-modules/scroll/components/scroll-to-top.vue2.js.map +1 -1
- package/js/x-modules/search/components/partial-query-button.vue.js +1 -1
- package/js/x-modules/search/components/partial-query-button.vue.js.map +1 -1
- package/js/x-modules/search/components/partial-query-button.vue2.js.map +1 -1
- package/js/x-modules/search/components/sort-list.vue.js +1 -1
- package/js/x-modules/search/components/sort-list.vue.js.map +1 -1
- package/js/x-modules/search/components/sort-list.vue2.js.map +1 -1
- package/js/x-modules/search/components/sort-picker-list.vue.js.map +1 -1
- package/js/x-modules/search/components/sort-picker-list.vue2.js +1 -1
- package/js/x-modules/search/components/sort-picker-list.vue2.js.map +1 -1
- package/js/x-modules/search-box/components/clear-search-input.vue.js +1 -1
- package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
- package/js/x-modules/search-box/components/clear-search-input.vue2.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue.js +2 -2
- package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-button.vue2.js.map +1 -1
- package/js/x-modules/search-box/components/search-input-placeholder.vue.js +1 -1
- package/js/x-modules/search-box/components/search-input-placeholder.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-input-placeholder.vue2.js.map +1 -1
- package/js/x-modules/search-box/components/search-input-placeholder.vue4.js +1 -1
- package/js/x-modules/search-box/components/search-input.vue.js +1 -1
- package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
- package/js/x-modules/search-box/components/search-input.vue2.js.map +1 -1
- package/package.json +6 -9
- package/report/x-components.api.json +3 -3
- package/report/x-components.api.md +5 -5
- package/types/demo/main.d.ts +1 -1
- package/types/demo/main.d.ts.map +1 -1
- package/types/demo/views/base-config.d.ts.map +1 -1
- package/types/demo/views/home/types.d.ts +0 -3
- package/types/demo/views/home/types.d.ts.map +1 -1
- package/types/demo/vite.config.d.ts.map +1 -1
- package/types/src/components/base-grid.types.d.ts.map +1 -1
- package/types/src/components/column-picker/base-column-picker-list.vue.d.ts +8 -1
- package/types/src/components/column-picker/base-column-picker-list.vue.d.ts.map +1 -1
- package/types/src/components/highlight.vue.d.ts +1 -1
- package/types/src/components/sliding-panel.vue.d.ts +2 -2
- package/types/src/index.d.ts +0 -1
- package/types/src/index.d.ts.map +1 -1
- package/types/src/x-bus/x-bus.d.ts.map +1 -1
- package/types/src/x-modules/facets/components/filters/all-filter.vue.d.ts +1 -1
- package/types/demo/views/adapter.d.ts +0 -3
- package/types/demo/views/adapter.d.ts.map +0 -1
- package/types/src/components/column-picker/base-column-picker-list.types.d.ts +0 -9
- package/types/src/components/column-picker/base-column-picker-list.types.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.0.0-alpha.239](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.238...@empathyco/x-components@6.0.0-alpha.239) (2026-04-13)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* **x-components:** migrate `x-components` package from deprecated `x-tailwindcss` to the new `x-design-system` and Tailwind 3 to 4. That implies migrating the prefix from `x-` to `xds:`. Keeping `x-` for BEM conventions.
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **x-components:** integrate `xds` with `x-components` (#1993)
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [6.0.0-alpha.238](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.237...@empathyco/x-components@6.0.0-alpha.238) (2026-04-10)
|
|
7
18
|
|
|
8
19
|
### Bug Fixes
|
package/core/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
17
17
|
}>, {
|
|
18
18
|
clickEvent: import("vue").ComputedRef<Partial<XEventsTypes>>;
|
|
19
19
|
cssClasses: import("vue").ComputedRef<{
|
|
20
|
-
'
|
|
20
|
+
'xds:selected x-all-filter--is-selected': boolean;
|
|
21
21
|
}>;
|
|
22
22
|
isSelected: import("vue").ComputedRef<boolean>;
|
|
23
23
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -40,7 +40,7 @@ _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
40
40
|
dynamicCSSClasses: import("vue").ComputedRef<{
|
|
41
41
|
[x: string]: boolean;
|
|
42
42
|
'x-highlight--has-match': boolean;
|
|
43
|
-
'
|
|
43
|
+
'xds:highlight-text': boolean;
|
|
44
44
|
}>;
|
|
45
45
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
46
46
|
text: {
|
|
@@ -38,8 +38,8 @@ _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
38
38
|
bottom: boolean;
|
|
39
39
|
};
|
|
40
40
|
cssClasses: import("vue").ComputedRef<{
|
|
41
|
-
'
|
|
42
|
-
'
|
|
41
|
+
'xds:sliding-panel-at-start': boolean;
|
|
42
|
+
'xds:sliding-panel-at-end': boolean;
|
|
43
43
|
}>;
|
|
44
44
|
scrollContainerRef: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
45
45
|
slotContainerWidth: import("vue").ShallowRef<number, number>;
|
package/docs/API-reference/components/common/column-picker/x-components.base-column-picker-list.md
CHANGED
|
@@ -124,7 +124,7 @@ The `buttonClass` prop can be used to add classes to the buttons.
|
|
|
124
124
|
|
|
125
125
|
```vue live
|
|
126
126
|
<template>
|
|
127
|
-
<BaseColumnPickerList :columns="columns" buttonClass="
|
|
127
|
+
<BaseColumnPickerList :columns="columns" buttonClass="xds:button-circle" />
|
|
128
128
|
</template>
|
|
129
129
|
|
|
130
130
|
<script setup>
|
|
@@ -115,7 +115,7 @@ manually.
|
|
|
115
115
|
<BaseSlider v-model="selectedRange" :threshold="threshold">
|
|
116
116
|
<input
|
|
117
117
|
@change="selectedRange.min = $event.target?.valueAsNumber || 0"
|
|
118
|
-
class="
|
|
118
|
+
class="xds:input"
|
|
119
119
|
name="min"
|
|
120
120
|
type="number"
|
|
121
121
|
:value="selectedRange.min"
|
|
@@ -125,7 +125,7 @@ manually.
|
|
|
125
125
|
<input
|
|
126
126
|
@change="selectedRange.max = $event.target?.valueAsNumber || 1000000"
|
|
127
127
|
style="display: block"
|
|
128
|
-
class="
|
|
128
|
+
class="xds:input"
|
|
129
129
|
name="max"
|
|
130
130
|
type="number"
|
|
131
131
|
:value="selectedRange.max"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-height.vue.js","sources":["../../../../src/components/animations/change-height.vue"],"sourcesContent":["<template>\n <div class=\"x-change-height\">\n <div ref=\"wrapper\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, onMounted, onUnmounted, ref } from 'vue'\n\nexport default defineComponent({\n setup() {\n const wrapper = ref<HTMLElement>()\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.target.parentElement) {\n entry.target.parentElement.style.height = `${entry.contentRect.height}px`\n }\n }\n })\n\n onMounted(() => {\n if (wrapper.value?.parentElement) {\n const height = wrapper.value.getBoundingClientRect().height\n wrapper.value.parentElement.style.height = `${height}px`\n observer.observe(wrapper.value)\n }\n })\n\n onUnmounted(() => {\n if (wrapper.value) {\n observer.unobserve(wrapper.value)\n }\n })\n\n return {\n wrapper,\n }\n },\n})\n</script>\n<style lang=\"css\">\n.x-change-height {\n --x-change-height-duration: 0.3s;\n overflow: hidden;\n transition: all var(--x-change-height-duration) ease-out;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThe ChangeHeight component automatically animates the height of its content when it changes size.\n\n### Basic usage:\n\n```vue\n<template>\n <ChangeHeight>\n <div>Content whose height will be animated</div>\n </ChangeHeight>\n</template>\n\n<script setup>\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n</script>\n```\n\n### Example with dynamic content:\n\n```vue\n<template>\n <div>\n <button @click=\"expanded = !expanded\">Toggle</button>\n <ChangeHeight>\n <div v-if=\"expanded\" style=\"height: 200px; background: #eee;\">Expanded content</div>\n <div v-else style=\"height: 50px; background: #ccc;\">Collapsed content</div>\n </ChangeHeight>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n\nconst expanded = ref(false)\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_renderSlot"],"mappings":";;;;;AACO,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,iBAAA,EAAiB;AACrB,MAAA,UAAA,GAAA,EAAA,GAAA,EAAI,SAAA,EAAS;;AADpB,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAIM,OAJN,UAAA,EAIM;AAAA,IAHJC,kBAAA;AAAA,MAEM,KAAA;AAAA,MAFN,UAAA;AAAA,MAEM;AAAA,QADJC,UAAA,CAAQ,IAAA,CAAA,MAAA,EAAA,SAAA;AAAA,OAAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"change-height.vue.js","sources":["../../../../src/components/animations/change-height.vue"],"sourcesContent":["<template>\n <div class=\"x-change-height\">\n <div ref=\"wrapper\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, onMounted, onUnmounted, ref } from 'vue'\n\nexport default defineComponent({\n setup() {\n const wrapper = ref<HTMLElement>()\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.target.parentElement) {\n entry.target.parentElement.style.height = `${entry.contentRect.height}px`\n }\n }\n })\n\n onMounted(() => {\n if (wrapper.value?.parentElement) {\n const height = wrapper.value.getBoundingClientRect().height\n wrapper.value.parentElement.style.height = `${height}px`\n observer.observe(wrapper.value)\n }\n })\n\n onUnmounted(() => {\n if (wrapper.value) {\n observer.unobserve(wrapper.value)\n }\n })\n\n return {\n wrapper,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-change-height {\n --x-change-height-duration: 0.3s;\n overflow: hidden;\n transition: all var(--x-change-height-duration) ease-out;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThe ChangeHeight component automatically animates the height of its content when it changes size.\n\n### Basic usage:\n\n```vue\n<template>\n <ChangeHeight>\n <div>Content whose height will be animated</div>\n </ChangeHeight>\n</template>\n\n<script setup>\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n</script>\n```\n\n### Example with dynamic content:\n\n```vue\n<template>\n <div>\n <button @click=\"expanded = !expanded\">Toggle</button>\n <ChangeHeight>\n <div v-if=\"expanded\" style=\"height: 200px; background: #eee;\">Expanded content</div>\n <div v-else style=\"height: 50px; background: #ccc;\">Collapsed content</div>\n </ChangeHeight>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n\nconst expanded = ref(false)\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_renderSlot"],"mappings":";;;;;AACO,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,iBAAA,EAAiB;AACrB,MAAA,UAAA,GAAA,EAAA,GAAA,EAAI,SAAA,EAAS;;AADpB,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAIM,OAJN,UAAA,EAIM;AAAA,IAHJC,kBAAA;AAAA,MAEM,KAAA;AAAA,MAFN,UAAA;AAAA,MAEM;AAAA,QADJC,UAAA,CAAQ,IAAA,CAAA,MAAA,EAAA,SAAA;AAAA,OAAA;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-height.vue2.js","sources":["../../../../src/components/animations/change-height.vue"],"sourcesContent":["<template>\n <div class=\"x-change-height\">\n <div ref=\"wrapper\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, onMounted, onUnmounted, ref } from 'vue'\n\nexport default defineComponent({\n setup() {\n const wrapper = ref<HTMLElement>()\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.target.parentElement) {\n entry.target.parentElement.style.height = `${entry.contentRect.height}px`\n }\n }\n })\n\n onMounted(() => {\n if (wrapper.value?.parentElement) {\n const height = wrapper.value.getBoundingClientRect().height\n wrapper.value.parentElement.style.height = `${height}px`\n observer.observe(wrapper.value)\n }\n })\n\n onUnmounted(() => {\n if (wrapper.value) {\n observer.unobserve(wrapper.value)\n }\n })\n\n return {\n wrapper,\n }\n },\n})\n</script>\n<style lang=\"css\">\n.x-change-height {\n --x-change-height-duration: 0.3s;\n overflow: hidden;\n transition: all var(--x-change-height-duration) ease-out;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThe ChangeHeight component automatically animates the height of its content when it changes size.\n\n### Basic usage:\n\n```vue\n<template>\n <ChangeHeight>\n <div>Content whose height will be animated</div>\n </ChangeHeight>\n</template>\n\n<script setup>\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n</script>\n```\n\n### Example with dynamic content:\n\n```vue\n<template>\n <div>\n <button @click=\"expanded = !expanded\">Toggle</button>\n <ChangeHeight>\n <div v-if=\"expanded\" style=\"height: 200px; background: #eee;\">Expanded content</div>\n <div v-else style=\"height: 50px; background: #ccc;\">Collapsed content</div>\n </ChangeHeight>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n\nconst expanded = ref(false)\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;AAWA,gBAAe,eAAe,CAAC;IAC7B,KAAK,GAAA;AACH,QAAA,MAAM,OAAM,GAAI,GAAG,EAAc;AACjC,QAAA,MAAM,QAAO,GAAI,IAAI,cAAc,CAAC,OAAM,IAAG;AAC3C,YAAA,KAAK,MAAM,KAAI,IAAK,OAAO,EAAE;AAC3B,gBAAA,IAAI,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE;AAC9B,oBAAA,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAK,GAAI,CAAA,EAAG,KAAK,CAAC,WAAW,CAAC,MAAM,IAAG;gBAC1E;YACF;AACF,QAAA,CAAC,CAAA;QAED,SAAS,CAAC,MAAI;AACZ,YAAA,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,EAAE;gBAChC,MAAM,MAAK,GAAI,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,MAAK;AAC1D,gBAAA,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAK,GAAI,CAAA,EAAG,MAAM,CAAA,EAAA,CAAG;AACvD,gBAAA,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAA;YAChC;AACF,QAAA,CAAC,CAAA;QAED,WAAW,CAAC,MAAI;AACd,YAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,gBAAA,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAA;YAClC;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,OAAO;SACT;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"change-height.vue2.js","sources":["../../../../src/components/animations/change-height.vue"],"sourcesContent":["<template>\n <div class=\"x-change-height\">\n <div ref=\"wrapper\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, onMounted, onUnmounted, ref } from 'vue'\n\nexport default defineComponent({\n setup() {\n const wrapper = ref<HTMLElement>()\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.target.parentElement) {\n entry.target.parentElement.style.height = `${entry.contentRect.height}px`\n }\n }\n })\n\n onMounted(() => {\n if (wrapper.value?.parentElement) {\n const height = wrapper.value.getBoundingClientRect().height\n wrapper.value.parentElement.style.height = `${height}px`\n observer.observe(wrapper.value)\n }\n })\n\n onUnmounted(() => {\n if (wrapper.value) {\n observer.unobserve(wrapper.value)\n }\n })\n\n return {\n wrapper,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-change-height {\n --x-change-height-duration: 0.3s;\n overflow: hidden;\n transition: all var(--x-change-height-duration) ease-out;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThe ChangeHeight component automatically animates the height of its content when it changes size.\n\n### Basic usage:\n\n```vue\n<template>\n <ChangeHeight>\n <div>Content whose height will be animated</div>\n </ChangeHeight>\n</template>\n\n<script setup>\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n</script>\n```\n\n### Example with dynamic content:\n\n```vue\n<template>\n <div>\n <button @click=\"expanded = !expanded\">Toggle</button>\n <ChangeHeight>\n <div v-if=\"expanded\" style=\"height: 200px; background: #eee;\">Expanded content</div>\n <div v-else style=\"height: 50px; background: #ccc;\">Collapsed content</div>\n </ChangeHeight>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport ChangeHeight from '@empathyco/x-components/js/components/animations/change-height.vue'\n\nconst expanded = ref(false)\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;AAWA,gBAAe,eAAe,CAAC;IAC7B,KAAK,GAAA;AACH,QAAA,MAAM,OAAM,GAAI,GAAG,EAAc;AACjC,QAAA,MAAM,QAAO,GAAI,IAAI,cAAc,CAAC,OAAM,IAAG;AAC3C,YAAA,KAAK,MAAM,KAAI,IAAK,OAAO,EAAE;AAC3B,gBAAA,IAAI,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE;AAC9B,oBAAA,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAK,GAAI,CAAA,EAAG,KAAK,CAAC,WAAW,CAAC,MAAM,IAAG;gBAC1E;YACF;AACF,QAAA,CAAC,CAAA;QAED,SAAS,CAAC,MAAI;AACZ,YAAA,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,EAAE;gBAChC,MAAM,MAAK,GAAI,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,MAAK;AAC1D,gBAAA,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAK,GAAI,CAAA,EAAG,MAAM,CAAA,EAAA,CAAG;AACvD,gBAAA,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAA;YAChC;AACF,QAAA,CAAC,CAAA;QAED,WAAW,CAAC,MAAI;AACd,YAAA,IAAI,OAAO,CAAC,KAAK,EAAE;AACjB,gBAAA,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAA;YAClC;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,OAAO;SACT;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -5,7 +5,7 @@ import _export_sfc from '../_virtual/_plugin-vue_export-helper.js';
|
|
|
5
5
|
|
|
6
6
|
const _hoisted_1 = {
|
|
7
7
|
key: 0,
|
|
8
|
-
class: "
|
|
8
|
+
class: "xds:progress-bar",
|
|
9
9
|
"data-test": "progress-bar",
|
|
10
10
|
role: "progressbar"
|
|
11
11
|
};
|
|
@@ -14,7 +14,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
14
14
|
createElementVNode(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
|
-
class: "
|
|
17
|
+
class: "xds:progress-bar-fill",
|
|
18
18
|
style: normalizeStyle(_ctx.cssStyles),
|
|
19
19
|
"data-test": "progress-bar-line"
|
|
20
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-progress-bar.vue.js","sources":["../../../src/components/auto-progress-bar.vue"],"sourcesContent":["<template>\n <div v-if=\"isLoading\" class=\"
|
|
1
|
+
{"version":3,"file":"auto-progress-bar.vue.js","sources":["../../../src/components/auto-progress-bar.vue"],"sourcesContent":["<template>\n <div v-if=\"isLoading\" class=\"xds:progress-bar\" data-test=\"progress-bar\" role=\"progressbar\">\n <div class=\"xds:progress-bar-fill\" :style=\"cssStyles\" data-test=\"progress-bar-line\" />\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { StyleValue } from 'vue'\nimport { computed, defineComponent } from 'vue'\n\n/**\n * The auto progress bar component is useful for displaying a visual indicator of numerical data\n * in a bar shape.\n *\n * @public\n */\nexport default defineComponent({\n name: 'AutoProgressBar',\n props: {\n /**\n * A boolean flag indicating if the bar is loading.\n *\n * @public\n */\n isLoading: {\n type: Boolean,\n default: true,\n },\n /**\n * The duration in seconds of the progress bar.\n *\n * @public\n */\n durationInSeconds: {\n type: Number,\n default: 5,\n },\n },\n setup(props) {\n /**\n * Computed property to calculate the animation's duration.\n *\n * @returns The CSS styles of the animation.\n *\n * @internal\n */\n const cssStyles = computed<StyleValue>(() => ({\n animationDuration: `${props.durationInSeconds}s`,\n }))\n\n return {\n cssStyles,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-progress-bar {\n display: inline-block;\n overflow: hidden;\n background-color: #dbe2e5;\n border-radius: 4px;\n}\n\n.x-progress-bar-fill {\n height: 4px;\n background-color: #283034;\n animation: slide linear;\n transform-origin: left;\n}\n\n@keyframes slide {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserClickedARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the redirection button.\n- [`UserClickedAbortARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the abort redirection button.\n\n## See it in action\n\nHere you have a basic example of how the auto progress bar is rendered.\n\n```vue live\n<template>\n <AutoProgressBar :isLoading=\"isLoading\" :durationInSeconds=\"durationInSeconds\" />\n</template>\n\n<script setup>\nimport { AutoProgressBar } from '@empathyco/x-components'\nconst isLoading = true\nconst durationInSeconds = 100\n</script>\n```\n\n### Play with props\n\nIn this example, the auto progress bar has been set to do an animation for 5 seconds. There is a way\nto cancel the animation by sending the isLoading prop to false.\n\n```vue live\n<template>\n <AutoProgressBar :durationInSeconds=\"5\" :isLoading=\"true\" />\n</template>\n\n<script setup>\nimport { AutoProgressBar } from '@empathyco/x-components'\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_normalizeStyle"],"mappings":";;;;;;;EACwB,KAAA,EAAM,kBAAA;AAAA,EAAmB,WAAA,EAAU,cAAA;AAAA,EAAe,IAAA,EAAK;;;SAAlE,IAAA,CAAA,SAAA,IAAAA,SAAA,EAAA,EAAXC,kBAAA,CAEM,OAFN,UAAA,EAEM;AAAA,IADJC,kBAAA;AAAA,MAAsF,KAAA;AAAA,MAAA;AAAA,QAAjF,KAAA,EAAM,uBAAA;AAAA,QAAyB,KAAA,EAAKC,eAAE,IAAA,CAAA,SAAS,CAAA;AAAA,QAAE,WAAA,EAAU;AAAA,OAAA;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-progress-bar.vue2.js","sources":["../../../src/components/auto-progress-bar.vue"],"sourcesContent":["<template>\n <div v-if=\"isLoading\" class=\"
|
|
1
|
+
{"version":3,"file":"auto-progress-bar.vue2.js","sources":["../../../src/components/auto-progress-bar.vue"],"sourcesContent":["<template>\n <div v-if=\"isLoading\" class=\"xds:progress-bar\" data-test=\"progress-bar\" role=\"progressbar\">\n <div class=\"xds:progress-bar-fill\" :style=\"cssStyles\" data-test=\"progress-bar-line\" />\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { StyleValue } from 'vue'\nimport { computed, defineComponent } from 'vue'\n\n/**\n * The auto progress bar component is useful for displaying a visual indicator of numerical data\n * in a bar shape.\n *\n * @public\n */\nexport default defineComponent({\n name: 'AutoProgressBar',\n props: {\n /**\n * A boolean flag indicating if the bar is loading.\n *\n * @public\n */\n isLoading: {\n type: Boolean,\n default: true,\n },\n /**\n * The duration in seconds of the progress bar.\n *\n * @public\n */\n durationInSeconds: {\n type: Number,\n default: 5,\n },\n },\n setup(props) {\n /**\n * Computed property to calculate the animation's duration.\n *\n * @returns The CSS styles of the animation.\n *\n * @internal\n */\n const cssStyles = computed<StyleValue>(() => ({\n animationDuration: `${props.durationInSeconds}s`,\n }))\n\n return {\n cssStyles,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-progress-bar {\n display: inline-block;\n overflow: hidden;\n background-color: #dbe2e5;\n border-radius: 4px;\n}\n\n.x-progress-bar-fill {\n height: 4px;\n background-color: #283034;\n animation: slide linear;\n transform-origin: left;\n}\n\n@keyframes slide {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n</style>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserClickedARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the redirection button.\n- [`UserClickedAbortARedirection`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n after the user clicks the abort redirection button.\n\n## See it in action\n\nHere you have a basic example of how the auto progress bar is rendered.\n\n```vue live\n<template>\n <AutoProgressBar :isLoading=\"isLoading\" :durationInSeconds=\"durationInSeconds\" />\n</template>\n\n<script setup>\nimport { AutoProgressBar } from '@empathyco/x-components'\nconst isLoading = true\nconst durationInSeconds = 100\n</script>\n```\n\n### Play with props\n\nIn this example, the auto progress bar has been set to do an animation for 5 seconds. There is a way\nto cancel the animation by sending the isLoading prop to false.\n\n```vue live\n<template>\n <AutoProgressBar :durationInSeconds=\"5\" :isLoading=\"true\" />\n</template>\n\n<script setup>\nimport { AutoProgressBar } from '@empathyco/x-components'\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;AAUA;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;;AAIE;AACF,QAAA,iBAAiB,EAAE;AACjB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;AAME;AACF,QAAA,MAAM,SAAQ,GAAI,QAAQ,CAAa,OAAO;AAC5C,YAAA,iBAAiB,EAAE,CAAA,EAAG,KAAK,CAAC,iBAAiB,CAAA,CAAA,CAAG;AACjD,SAAA,CAAC,CAAA;QAEF,OAAO;YACL,SAAS;SACX;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-slider.vue.js","sources":["../../../src/components/base-slider.vue"],"sourcesContent":["<template>\n <div class=\"x-base-slider\">\n <div ref=\"slider\" :class=\"['x-base-slider__nouislider'].concat(`${contentClass}`)\" />\n <div class=\"x-base-slider__selected\">\n <!--\n @slot Default selected range rendering. This slot will be used by default for rendering\n the selected range without an specific slot implementation.\n @binding {number[]} rangeSelected - The selected range values. Min position 0, Max position 1.\n -->\n <slot :range-selected=\"rangeSelected\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\">\nimport type { API } from 'nouislider'\nimport type { PropType } from 'vue'\nimport { create } from 'nouislider'\nimport { computed, defineComponent, onMounted, onUnmounted, ref, watch } from 'vue'\n\n/**\n * This component implements a range slider and prints the selected values.\n * It receives a threshold prop to set the limits and uses v-model to get and set\n * the selected values.\n *\n * It makes use of the nouslider library @see https://refreshless.com/nouislider/\n * for the slider implementation.\n *\n */\nexport default defineComponent({\n name: 'BaseSlider',\n props: {\n /** The threshold prop sets the limits for the slider. */\n threshold: {\n type: Object as PropType<{ min: number; max: number }>,\n default: () => ({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n },\n /** The modelValue prop sets the initial values for the slider. */\n modelValue: {\n type: Object as PropType<{ min: number; max: number }>,\n required: true,\n },\n /** Class to be able to customize slider styles. */\n contentClass: {\n type: String,\n default: '',\n },\n },\n /**\n * The component emits an event with the selected values whenever\n * the user changes the slider.\n */\n emits: ['update:modelValue'],\n setup(props, { emit }) {\n /** The nouislider instance. */\n let sliderInstance: API\n /** The nouislider element reference. */\n const slider = ref<HTMLElement>()\n\n /** The selected min value. */\n const minSelected = ref(props.modelValue?.min ?? props.threshold.min)\n /** The selected max value. */\n const maxSelected = ref(props.modelValue?.max ?? props.threshold.max)\n\n /** The selected range as an array. */\n const rangeSelected = computed(() => [minSelected.value, maxSelected.value])\n /** The range for the nouislider. */\n const slideRange = computed(() => ({ min: props.threshold.min, max: props.threshold.max }))\n\n onMounted(() => {\n // Create the slider instance\n sliderInstance = create(slider.value!, {\n start: rangeSelected.value,\n range: slideRange.value,\n step: 1,\n connect: true,\n margin: 1,\n })\n\n // Update the selected values when the slider update its values\n sliderInstance.on('update', ([min, max]) => {\n minSelected.value = Number(min)\n maxSelected.value = Number(max)\n })\n\n // Emits the selected values when the slider values change\n sliderInstance.on('change', () =>\n emit('update:modelValue', { min: minSelected.value, max: maxSelected.value }),\n )\n })\n\n onUnmounted(() => {\n // Waiting to finish the collapse animation before destroying it\n setTimeout(sliderInstance.destroy.bind(sliderInstance), 600)\n })\n\n /**\n * Watch the threshold prop to update the slider state and emit the selected values.\n */\n watch(\n () => props.threshold,\n ({ min, max }) => {\n sliderInstance.updateOptions({ range: slideRange.value, start: [min, max] }, false)\n emit('update:modelValue', { min, max })\n },\n )\n\n /**\n * Watch the modelValue prop to update the slider state.\n *\n * @remarks It only update the values if the values are corrects. It means,\n * values within the threshold limits and not equal to the current values.\n *\n * @returns Undefined.\n */\n watch([() => props.modelValue.min, () => props.modelValue.max], ([min, max]) => {\n // Check if the values are the same\n if (min === minSelected.value && max === maxSelected.value) {\n return\n }\n\n // Validate the values\n const minValidated = min < props.threshold.min ? props.threshold.min : min\n const maxValidated = max > props.threshold.max ? props.threshold.max : max\n\n // Update the nouislider values\n sliderInstance.set([minValidated, maxValidated])\n\n // Emit the selected values\n if (minValidated !== min || maxValidated !== max) {\n emit('update:modelValue', { min: minValidated, max: maxValidated })\n }\n })\n\n return {\n slider,\n rangeSelected,\n }\n },\n})\n</script>\n<style lang=\"css\">\n@import 'nouislider/dist/nouislider.css';\n/** Customize nouislider styles: https://refreshless.com/nouislider/examples/#section-styling */\n\n.x-base-slider {\n gap: 16px;\n}\n\n.x-base-slider,\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n display: flex;\n flex-flow: column nowrap;\n}\n\n.x-base-slider__selected {\n display: inline-flex;\n}\n\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n flex: 50%;\n}\n\n.x-base-slider__nouislider {\n margin: 16px 0;\n padding: 0 16px;\n}\n\n.x-base-slider__nouislider .noUi-handle {\n box-shadow: none;\n}\n\n.x-base-slider__nouislider .noUi-handle:before,\n.x-base-slider__nouislider .noUi-handle:after {\n content: none;\n}\n</style>\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders a slider and the selected values. The component needs the threshold for the\nslider, although is not required (If not passed, fallback is min: 0, max: Number.MAX_SAFE_INTEGER ),\nwhich are passed using the `threshold` prop and the selected range, which is passed in using the\nv-model.\n\n### Default usage\n\nIt is required to send the value prop which holds the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst selectedRange = ref({ min: 0, max: 1000 })\n</script>\n```\n\n#### With threshold\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\n### Customized usage\n\n#### Overriding the slots\n\nIt is possible to override the default slot to customize the layout for the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" v-slot=\"{ rangeSelected }\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\nIt is also possible to add inputs to complement the slider and allow to change the selected values\nmanually.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\">\n <input\n @change=\"selectedRange.min = $event.target?.valueAsNumber || 0\"\n class=\"x-input\"\n name=\"min\"\n type=\"number\"\n :value=\"selectedRange.min\"\n :aria-label=\"'min'\"\n />\n\n <input\n @change=\"selectedRange.max = $event.target?.valueAsNumber || 1000000\"\n style=\"display: block\"\n class=\"x-input\"\n name=\"max\"\n type=\"number\"\n :value=\"selectedRange.max\"\n :aria-label=\"'max'\"\n />\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_renderSlot","_toDisplayString"],"mappings":";;;;;AACO,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,eAAA,EAAe;AAEnB,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,yBAAA,EAAyB;AAO7B,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,6BAAA,EAA6B;AAMnC,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,6BAAA,EAA6B;;AAf5C,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAuBM,OAvBN,UAAA,EAuBM;AAAA,IAtBJC,kBAAA;AAAA,MAAqF,KAAA;AAAA,MAAA;AAAA,QAAhF,GAAA,EAAI,QAAA;AAAA,QAAU,KAAA,EAAKC,cAAA,CAAA,CAAA,2BAAA,CAAA,CAAgC,MAAA,CAAM,CAAA,EAAI,IAAA,CAAA,YAAY,CAAA,CAAA,CAAA;AAAA,OAAA;;;;;AAC9E,IAAAD,kBAAA,CAoBM,OApBN,UAAA,EAoBM;AAAA,MAdJE,UAAA,CAaO,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAbA,aAAA,EAAgB,IAAA,CAAA,aAAA,IAAvB,MAaO;AAAA,QAZLF,kBAAA,CAKI,KALJ,UAAA,EAKI;AAAA,UAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAJFA,kBAAA;AAAA,YAAsB,MAAA;AAAA,YAAA,IAAA;AAAA,YAAhB,WAAA;AAAA,YAAS;AAAA;AAAA,WAAA,CAAA;AAAA,UACfA,kBAAA;AAAA,YAEO,MAAA;AAAA,YAAA,IAAA;AAAA,YAAAG,eAAA,CADF,IAAA,CAAA,aAAA,CAAa,CAAA,CAAA,CAAA;AAAA,YAAA;AAAA;AAAA;AAAA,SAAA,CAAA;AAGpB,QAAAH,kBAAA,CAKI,KALJ,UAAA,EAKI;AAAA,UAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAJFA,kBAAA;AAAA,YAAsB,MAAA;AAAA,YAAA,IAAA;AAAA,YAAhB,WAAA;AAAA,YAAS;AAAA;AAAA,WAAA,CAAA;AAAA,UACfA,kBAAA;AAAA,YAEO,MAAA;AAAA,YAAA,IAAA;AAAA,YAAAG,eAAA,CADF,IAAA,CAAA,aAAA,CAAa,CAAA,CAAA,CAAA;AAAA,YAAA;AAAA;AAAA;AAAA,SAAA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"base-slider.vue.js","sources":["../../../src/components/base-slider.vue"],"sourcesContent":["<template>\n <div class=\"x-base-slider\">\n <div ref=\"slider\" :class=\"['x-base-slider__nouislider'].concat(`${contentClass}`)\" />\n <div class=\"x-base-slider__selected\">\n <!--\n @slot Default selected range rendering. This slot will be used by default for rendering\n the selected range without an specific slot implementation.\n @binding {number[]} rangeSelected - The selected range values. Min position 0, Max position 1.\n -->\n <slot :range-selected=\"rangeSelected\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { API } from 'nouislider'\nimport type { PropType } from 'vue'\nimport { create } from 'nouislider'\nimport { computed, defineComponent, onMounted, onUnmounted, ref, watch } from 'vue'\n\n/**\n * This component implements a range slider and prints the selected values.\n * It receives a threshold prop to set the limits and uses v-model to get and set\n * the selected values.\n *\n * It makes use of the nouslider library @see https://refreshless.com/nouislider/\n * for the slider implementation.\n *\n */\nexport default defineComponent({\n name: 'BaseSlider',\n props: {\n /** The threshold prop sets the limits for the slider. */\n threshold: {\n type: Object as PropType<{ min: number; max: number }>,\n default: () => ({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n },\n /** The modelValue prop sets the initial values for the slider. */\n modelValue: {\n type: Object as PropType<{ min: number; max: number }>,\n required: true,\n },\n /** Class to be able to customize slider styles. */\n contentClass: {\n type: String,\n default: '',\n },\n },\n /**\n * The component emits an event with the selected values whenever\n * the user changes the slider.\n */\n emits: ['update:modelValue'],\n setup(props, { emit }) {\n /** The nouislider instance. */\n let sliderInstance: API\n /** The nouislider element reference. */\n const slider = ref<HTMLElement>()\n\n /** The selected min value. */\n const minSelected = ref(props.modelValue?.min ?? props.threshold.min)\n /** The selected max value. */\n const maxSelected = ref(props.modelValue?.max ?? props.threshold.max)\n\n /** The selected range as an array. */\n const rangeSelected = computed(() => [minSelected.value, maxSelected.value])\n /** The range for the nouislider. */\n const slideRange = computed(() => ({ min: props.threshold.min, max: props.threshold.max }))\n\n onMounted(() => {\n // Create the slider instance\n sliderInstance = create(slider.value!, {\n start: rangeSelected.value,\n range: slideRange.value,\n step: 1,\n connect: true,\n margin: 1,\n })\n\n // Update the selected values when the slider update its values\n sliderInstance.on('update', ([min, max]) => {\n minSelected.value = Number(min)\n maxSelected.value = Number(max)\n })\n\n // Emits the selected values when the slider values change\n sliderInstance.on('change', () =>\n emit('update:modelValue', { min: minSelected.value, max: maxSelected.value }),\n )\n })\n\n onUnmounted(() => {\n // Waiting to finish the collapse animation before destroying it\n setTimeout(sliderInstance.destroy.bind(sliderInstance), 600)\n })\n\n /**\n * Watch the threshold prop to update the slider state and emit the selected values.\n */\n watch(\n () => props.threshold,\n ({ min, max }) => {\n sliderInstance.updateOptions({ range: slideRange.value, start: [min, max] }, false)\n emit('update:modelValue', { min, max })\n },\n )\n\n /**\n * Watch the modelValue prop to update the slider state.\n *\n * @remarks It only update the values if the values are corrects. It means,\n * values within the threshold limits and not equal to the current values.\n *\n * @returns Undefined.\n */\n watch([() => props.modelValue.min, () => props.modelValue.max], ([min, max]) => {\n // Check if the values are the same\n if (min === minSelected.value && max === maxSelected.value) {\n return\n }\n\n // Validate the values\n const minValidated = min < props.threshold.min ? props.threshold.min : min\n const maxValidated = max > props.threshold.max ? props.threshold.max : max\n\n // Update the nouislider values\n sliderInstance.set([minValidated, maxValidated])\n\n // Emit the selected values\n if (minValidated !== min || maxValidated !== max) {\n emit('update:modelValue', { min: minValidated, max: maxValidated })\n }\n })\n\n return {\n slider,\n rangeSelected,\n }\n },\n})\n</script>\n<style lang=\"css\">\n@import 'nouislider/dist/nouislider.css';\n/** Customize nouislider styles: https://refreshless.com/nouislider/examples/#section-styling */\n\n.x-base-slider {\n gap: 16px;\n}\n\n.x-base-slider,\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n display: flex;\n flex-flow: column nowrap;\n}\n\n.x-base-slider__selected {\n display: inline-flex;\n}\n\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n flex: 50%;\n}\n\n.x-base-slider__nouislider {\n margin: 16px 0;\n padding: 0 16px;\n}\n\n.x-base-slider__nouislider .noUi-handle {\n box-shadow: none;\n}\n\n.x-base-slider__nouislider .noUi-handle:before,\n.x-base-slider__nouislider .noUi-handle:after {\n content: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders a slider and the selected values. The component needs the threshold for the\nslider, although is not required (If not passed, fallback is min: 0, max: Number.MAX_SAFE_INTEGER ),\nwhich are passed using the `threshold` prop and the selected range, which is passed in using the\nv-model.\n\n### Default usage\n\nIt is required to send the value prop which holds the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst selectedRange = ref({ min: 0, max: 1000 })\n</script>\n```\n\n#### With threshold\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\n### Customized usage\n\n#### Overriding the slots\n\nIt is possible to override the default slot to customize the layout for the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" v-slot=\"{ rangeSelected }\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\nIt is also possible to add inputs to complement the slider and allow to change the selected values\nmanually.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\">\n <input\n @change=\"selectedRange.min = $event.target?.valueAsNumber || 0\"\n class=\"xds:input\"\n name=\"min\"\n type=\"number\"\n :value=\"selectedRange.min\"\n :aria-label=\"'min'\"\n />\n\n <input\n @change=\"selectedRange.max = $event.target?.valueAsNumber || 1000000\"\n style=\"display: block\"\n class=\"xds:input\"\n name=\"max\"\n type=\"number\"\n :value=\"selectedRange.max\"\n :aria-label=\"'max'\"\n />\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_renderSlot","_toDisplayString"],"mappings":";;;;;AACO,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,eAAA,EAAe;AAEnB,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,yBAAA,EAAyB;AAO7B,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,6BAAA,EAA6B;AAMnC,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,6BAAA,EAA6B;;AAf5C,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAuBM,OAvBN,UAAA,EAuBM;AAAA,IAtBJC,kBAAA;AAAA,MAAqF,KAAA;AAAA,MAAA;AAAA,QAAhF,GAAA,EAAI,QAAA;AAAA,QAAU,KAAA,EAAKC,cAAA,CAAA,CAAA,2BAAA,CAAA,CAAgC,MAAA,CAAM,CAAA,EAAI,IAAA,CAAA,YAAY,CAAA,CAAA,CAAA;AAAA,OAAA;;;;;AAC9E,IAAAD,kBAAA,CAoBM,OApBN,UAAA,EAoBM;AAAA,MAdJE,UAAA,CAaO,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAbA,aAAA,EAAgB,IAAA,CAAA,aAAA,IAAvB,MAaO;AAAA,QAZLF,kBAAA,CAKI,KALJ,UAAA,EAKI;AAAA,UAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAJFA,kBAAA;AAAA,YAAsB,MAAA;AAAA,YAAA,IAAA;AAAA,YAAhB,WAAA;AAAA,YAAS;AAAA;AAAA,WAAA,CAAA;AAAA,UACfA,kBAAA;AAAA,YAEO,MAAA;AAAA,YAAA,IAAA;AAAA,YAAAG,eAAA,CADF,IAAA,CAAA,aAAA,CAAa,CAAA,CAAA,CAAA;AAAA,YAAA;AAAA;AAAA;AAAA,SAAA,CAAA;AAGpB,QAAAH,kBAAA,CAKI,KALJ,UAAA,EAKI;AAAA,UAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAJFA,kBAAA;AAAA,YAAsB,MAAA;AAAA,YAAA,IAAA;AAAA,YAAhB,WAAA;AAAA,YAAS;AAAA;AAAA,WAAA,CAAA;AAAA,UACfA,kBAAA;AAAA,YAEO,MAAA;AAAA,YAAA,IAAA;AAAA,YAAAG,eAAA,CADF,IAAA,CAAA,aAAA,CAAa,CAAA,CAAA,CAAA;AAAA,YAAA;AAAA;AAAA;AAAA,SAAA;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-slider.vue2.js","sources":["../../../src/components/base-slider.vue"],"sourcesContent":["<template>\n <div class=\"x-base-slider\">\n <div ref=\"slider\" :class=\"['x-base-slider__nouislider'].concat(`${contentClass}`)\" />\n <div class=\"x-base-slider__selected\">\n <!--\n @slot Default selected range rendering. This slot will be used by default for rendering\n the selected range without an specific slot implementation.\n @binding {number[]} rangeSelected - The selected range values. Min position 0, Max position 1.\n -->\n <slot :range-selected=\"rangeSelected\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\">\nimport type { API } from 'nouislider'\nimport type { PropType } from 'vue'\nimport { create } from 'nouislider'\nimport { computed, defineComponent, onMounted, onUnmounted, ref, watch } from 'vue'\n\n/**\n * This component implements a range slider and prints the selected values.\n * It receives a threshold prop to set the limits and uses v-model to get and set\n * the selected values.\n *\n * It makes use of the nouslider library @see https://refreshless.com/nouislider/\n * for the slider implementation.\n *\n */\nexport default defineComponent({\n name: 'BaseSlider',\n props: {\n /** The threshold prop sets the limits for the slider. */\n threshold: {\n type: Object as PropType<{ min: number; max: number }>,\n default: () => ({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n },\n /** The modelValue prop sets the initial values for the slider. */\n modelValue: {\n type: Object as PropType<{ min: number; max: number }>,\n required: true,\n },\n /** Class to be able to customize slider styles. */\n contentClass: {\n type: String,\n default: '',\n },\n },\n /**\n * The component emits an event with the selected values whenever\n * the user changes the slider.\n */\n emits: ['update:modelValue'],\n setup(props, { emit }) {\n /** The nouislider instance. */\n let sliderInstance: API\n /** The nouislider element reference. */\n const slider = ref<HTMLElement>()\n\n /** The selected min value. */\n const minSelected = ref(props.modelValue?.min ?? props.threshold.min)\n /** The selected max value. */\n const maxSelected = ref(props.modelValue?.max ?? props.threshold.max)\n\n /** The selected range as an array. */\n const rangeSelected = computed(() => [minSelected.value, maxSelected.value])\n /** The range for the nouislider. */\n const slideRange = computed(() => ({ min: props.threshold.min, max: props.threshold.max }))\n\n onMounted(() => {\n // Create the slider instance\n sliderInstance = create(slider.value!, {\n start: rangeSelected.value,\n range: slideRange.value,\n step: 1,\n connect: true,\n margin: 1,\n })\n\n // Update the selected values when the slider update its values\n sliderInstance.on('update', ([min, max]) => {\n minSelected.value = Number(min)\n maxSelected.value = Number(max)\n })\n\n // Emits the selected values when the slider values change\n sliderInstance.on('change', () =>\n emit('update:modelValue', { min: minSelected.value, max: maxSelected.value }),\n )\n })\n\n onUnmounted(() => {\n // Waiting to finish the collapse animation before destroying it\n setTimeout(sliderInstance.destroy.bind(sliderInstance), 600)\n })\n\n /**\n * Watch the threshold prop to update the slider state and emit the selected values.\n */\n watch(\n () => props.threshold,\n ({ min, max }) => {\n sliderInstance.updateOptions({ range: slideRange.value, start: [min, max] }, false)\n emit('update:modelValue', { min, max })\n },\n )\n\n /**\n * Watch the modelValue prop to update the slider state.\n *\n * @remarks It only update the values if the values are corrects. It means,\n * values within the threshold limits and not equal to the current values.\n *\n * @returns Undefined.\n */\n watch([() => props.modelValue.min, () => props.modelValue.max], ([min, max]) => {\n // Check if the values are the same\n if (min === minSelected.value && max === maxSelected.value) {\n return\n }\n\n // Validate the values\n const minValidated = min < props.threshold.min ? props.threshold.min : min\n const maxValidated = max > props.threshold.max ? props.threshold.max : max\n\n // Update the nouislider values\n sliderInstance.set([minValidated, maxValidated])\n\n // Emit the selected values\n if (minValidated !== min || maxValidated !== max) {\n emit('update:modelValue', { min: minValidated, max: maxValidated })\n }\n })\n\n return {\n slider,\n rangeSelected,\n }\n },\n})\n</script>\n<style lang=\"css\">\n@import 'nouislider/dist/nouislider.css';\n/** Customize nouislider styles: https://refreshless.com/nouislider/examples/#section-styling */\n\n.x-base-slider {\n gap: 16px;\n}\n\n.x-base-slider,\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n display: flex;\n flex-flow: column nowrap;\n}\n\n.x-base-slider__selected {\n display: inline-flex;\n}\n\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n flex: 50%;\n}\n\n.x-base-slider__nouislider {\n margin: 16px 0;\n padding: 0 16px;\n}\n\n.x-base-slider__nouislider .noUi-handle {\n box-shadow: none;\n}\n\n.x-base-slider__nouislider .noUi-handle:before,\n.x-base-slider__nouislider .noUi-handle:after {\n content: none;\n}\n</style>\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders a slider and the selected values. The component needs the threshold for the\nslider, although is not required (If not passed, fallback is min: 0, max: Number.MAX_SAFE_INTEGER ),\nwhich are passed using the `threshold` prop and the selected range, which is passed in using the\nv-model.\n\n### Default usage\n\nIt is required to send the value prop which holds the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst selectedRange = ref({ min: 0, max: 1000 })\n</script>\n```\n\n#### With threshold\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\n### Customized usage\n\n#### Overriding the slots\n\nIt is possible to override the default slot to customize the layout for the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" v-slot=\"{ rangeSelected }\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\nIt is also possible to add inputs to complement the slider and allow to change the selected values\nmanually.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\">\n <input\n @change=\"selectedRange.min = $event.target?.valueAsNumber || 0\"\n class=\"x-input\"\n name=\"min\"\n type=\"number\"\n :value=\"selectedRange.min\"\n :aria-label=\"'min'\"\n />\n\n <input\n @change=\"selectedRange.max = $event.target?.valueAsNumber || 1000000\"\n style=\"display: block\"\n class=\"x-input\"\n name=\"max\"\n type=\"number\"\n :value=\"selectedRange.max\"\n :aria-label=\"'max'\"\n />\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AAgCA;;;;;;;;AAQE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,MAAgD;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,gBAAe,EAAG,CAAC;AAC1D,SAAA;;AAED,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAAgD;AACtD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,EAAE;AACZ,SAAA;AACF,KAAA;AACD;;;AAGE;IACF,KAAK,EAAE,CAAC,mBAAmB,CAAC;AAC5B,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,IAAG,EAAG,EAAA;;AAEnB,QAAA,IAAI,cAAkB;;AAEtB,QAAA,MAAM,MAAK,GAAI,GAAG,EAAc;;AAGhC,QAAA,MAAM,WAAU,GAAI,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,GAAE,IAAK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAA;;AAEpE,QAAA,MAAM,WAAU,GAAI,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,GAAE,IAAK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAA;;AAGpE,QAAA,MAAM,aAAY,GAAI,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;;QAE3E,MAAM,UAAS,GAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,GAAE,EAAG,CAAC,CAAA;QAE1F,SAAS,CAAC,MAAI;;AAEZ,YAAA,cAAa,GAAI,MAAM,CAAC,MAAM,CAAC,KAAM,EAAE;gBACrC,KAAK,EAAE,aAAa,CAAC,KAAK;gBAC1B,KAAK,EAAE,UAAU,CAAC,KAAK;AACvB,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,MAAM,EAAE,CAAC;AACV,aAAA,CAAA;;AAGD,YAAA,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,KAAG;AACxC,gBAAA,WAAW,CAAC,KAAI,GAAI,MAAM,CAAC,GAAG,CAAA;AAC9B,gBAAA,WAAW,CAAC,KAAI,GAAI,MAAM,CAAC,GAAG,CAAA;AAChC,YAAA,CAAC,CAAA;;YAGD,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAC1B,IAAI,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,WAAW,CAAC,KAAI,EAAG,CAAC,CAC/E;AACF,QAAA,CAAC,CAAA;QAED,WAAW,CAAC,MAAI;;AAEd,YAAA,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,GAAG,CAAA;AAC7D,QAAA,CAAC,CAAA;AAED;;AAEE;AACF,QAAA,KAAK,CACH,MAAM,KAAK,CAAC,SAAS,EACrB,CAAC,EAAE,GAAG,EAAE,GAAE,EAAG,KAAG;YACd,cAAc,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAA,EAAG,EAAE,KAAK,CAAA;YAClF,IAAI,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAA;AACxC,QAAA,CAAC,CACH;AAEA;;;;;;;AAOE;AACF,QAAA,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,KAAG;;AAE5E,YAAA,IAAI,QAAQ,WAAW,CAAC,KAAI,IAAK,GAAE,KAAM,WAAW,CAAC,KAAK,EAAE;gBAC1D;YACF;;YAGA,MAAM,YAAW,GAAI,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,GAAE;YACzE,MAAM,YAAW,GAAI,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,GAAE;;YAGzE,cAAc,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;;YAG/C,IAAI,YAAW,KAAM,GAAE,IAAK,iBAAiB,GAAG,EAAE;AAChD,gBAAA,IAAI,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,YAAW,EAAG,CAAA;YACpE;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,MAAM;YACN,aAAa;SACf;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"base-slider.vue2.js","sources":["../../../src/components/base-slider.vue"],"sourcesContent":["<template>\n <div class=\"x-base-slider\">\n <div ref=\"slider\" :class=\"['x-base-slider__nouislider'].concat(`${contentClass}`)\" />\n <div class=\"x-base-slider__selected\">\n <!--\n @slot Default selected range rendering. This slot will be used by default for rendering\n the selected range without an specific slot implementation.\n @binding {number[]} rangeSelected - The selected range values. Min position 0, Max position 1.\n -->\n <slot :range-selected=\"rangeSelected\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { API } from 'nouislider'\nimport type { PropType } from 'vue'\nimport { create } from 'nouislider'\nimport { computed, defineComponent, onMounted, onUnmounted, ref, watch } from 'vue'\n\n/**\n * This component implements a range slider and prints the selected values.\n * It receives a threshold prop to set the limits and uses v-model to get and set\n * the selected values.\n *\n * It makes use of the nouslider library @see https://refreshless.com/nouislider/\n * for the slider implementation.\n *\n */\nexport default defineComponent({\n name: 'BaseSlider',\n props: {\n /** The threshold prop sets the limits for the slider. */\n threshold: {\n type: Object as PropType<{ min: number; max: number }>,\n default: () => ({ min: 0, max: Number.MAX_SAFE_INTEGER }),\n },\n /** The modelValue prop sets the initial values for the slider. */\n modelValue: {\n type: Object as PropType<{ min: number; max: number }>,\n required: true,\n },\n /** Class to be able to customize slider styles. */\n contentClass: {\n type: String,\n default: '',\n },\n },\n /**\n * The component emits an event with the selected values whenever\n * the user changes the slider.\n */\n emits: ['update:modelValue'],\n setup(props, { emit }) {\n /** The nouislider instance. */\n let sliderInstance: API\n /** The nouislider element reference. */\n const slider = ref<HTMLElement>()\n\n /** The selected min value. */\n const minSelected = ref(props.modelValue?.min ?? props.threshold.min)\n /** The selected max value. */\n const maxSelected = ref(props.modelValue?.max ?? props.threshold.max)\n\n /** The selected range as an array. */\n const rangeSelected = computed(() => [minSelected.value, maxSelected.value])\n /** The range for the nouislider. */\n const slideRange = computed(() => ({ min: props.threshold.min, max: props.threshold.max }))\n\n onMounted(() => {\n // Create the slider instance\n sliderInstance = create(slider.value!, {\n start: rangeSelected.value,\n range: slideRange.value,\n step: 1,\n connect: true,\n margin: 1,\n })\n\n // Update the selected values when the slider update its values\n sliderInstance.on('update', ([min, max]) => {\n minSelected.value = Number(min)\n maxSelected.value = Number(max)\n })\n\n // Emits the selected values when the slider values change\n sliderInstance.on('change', () =>\n emit('update:modelValue', { min: minSelected.value, max: maxSelected.value }),\n )\n })\n\n onUnmounted(() => {\n // Waiting to finish the collapse animation before destroying it\n setTimeout(sliderInstance.destroy.bind(sliderInstance), 600)\n })\n\n /**\n * Watch the threshold prop to update the slider state and emit the selected values.\n */\n watch(\n () => props.threshold,\n ({ min, max }) => {\n sliderInstance.updateOptions({ range: slideRange.value, start: [min, max] }, false)\n emit('update:modelValue', { min, max })\n },\n )\n\n /**\n * Watch the modelValue prop to update the slider state.\n *\n * @remarks It only update the values if the values are corrects. It means,\n * values within the threshold limits and not equal to the current values.\n *\n * @returns Undefined.\n */\n watch([() => props.modelValue.min, () => props.modelValue.max], ([min, max]) => {\n // Check if the values are the same\n if (min === minSelected.value && max === maxSelected.value) {\n return\n }\n\n // Validate the values\n const minValidated = min < props.threshold.min ? props.threshold.min : min\n const maxValidated = max > props.threshold.max ? props.threshold.max : max\n\n // Update the nouislider values\n sliderInstance.set([minValidated, maxValidated])\n\n // Emit the selected values\n if (minValidated !== min || maxValidated !== max) {\n emit('update:modelValue', { min: minValidated, max: maxValidated })\n }\n })\n\n return {\n slider,\n rangeSelected,\n }\n },\n})\n</script>\n<style lang=\"css\">\n@import 'nouislider/dist/nouislider.css';\n/** Customize nouislider styles: https://refreshless.com/nouislider/examples/#section-styling */\n\n.x-base-slider {\n gap: 16px;\n}\n\n.x-base-slider,\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n display: flex;\n flex-flow: column nowrap;\n}\n\n.x-base-slider__selected {\n display: inline-flex;\n}\n\n.x-base-slider__selected-min,\n.x-base-slider__selected-max {\n flex: 50%;\n}\n\n.x-base-slider__nouislider {\n margin: 16px 0;\n padding: 0 16px;\n}\n\n.x-base-slider__nouislider .noUi-handle {\n box-shadow: none;\n}\n\n.x-base-slider__nouislider .noUi-handle:before,\n.x-base-slider__nouislider .noUi-handle:after {\n content: none;\n}\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\nThis component renders a slider and the selected values. The component needs the threshold for the\nslider, although is not required (If not passed, fallback is min: 0, max: Number.MAX_SAFE_INTEGER ),\nwhich are passed using the `threshold` prop and the selected range, which is passed in using the\nv-model.\n\n### Default usage\n\nIt is required to send the value prop which holds the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst selectedRange = ref({ min: 0, max: 1000 })\n</script>\n```\n\n#### With threshold\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" />\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\n### Customized usage\n\n#### Overriding the slots\n\nIt is possible to override the default slot to customize the layout for the selected values.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\" v-slot=\"{ rangeSelected }\">\n <p class=\"x-base-slider__selected-min\">\n <span>min value</span>\n <span>\n {{ rangeSelected[0] }}\n </span>\n </p>\n <p class=\"x-base-slider__selected-max\">\n <span>max value</span>\n <span>\n {{ rangeSelected[1] }}\n </span>\n </p>\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n\nIt is also possible to add inputs to complement the slider and allow to change the selected values\nmanually.\n\n```vue live\n<template>\n <BaseSlider v-model=\"selectedRange\" :threshold=\"threshold\">\n <input\n @change=\"selectedRange.min = $event.target?.valueAsNumber || 0\"\n class=\"xds:input\"\n name=\"min\"\n type=\"number\"\n :value=\"selectedRange.min\"\n :aria-label=\"'min'\"\n />\n\n <input\n @change=\"selectedRange.max = $event.target?.valueAsNumber || 1000000\"\n style=\"display: block\"\n class=\"xds:input\"\n name=\"max\"\n type=\"number\"\n :value=\"selectedRange.max\"\n :aria-label=\"'max'\"\n />\n </BaseSlider>\n</template>\n\n<script setup>\nimport { BaseSlider } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst threshold = { min: 0, max: 1000 }\nconst selectedRange = ref({ ...threshold })\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AAiCA;;;;;;;;AAQE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,MAAgD;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,gBAAe,EAAG,CAAC;AAC1D,SAAA;;AAED,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAAgD;AACtD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,EAAE;AACZ,SAAA;AACF,KAAA;AACD;;;AAGE;IACF,KAAK,EAAE,CAAC,mBAAmB,CAAC;AAC5B,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,IAAG,EAAG,EAAA;;AAEnB,QAAA,IAAI,cAAkB;;AAEtB,QAAA,MAAM,MAAK,GAAI,GAAG,EAAc;;AAGhC,QAAA,MAAM,WAAU,GAAI,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,GAAE,IAAK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAA;;AAEpE,QAAA,MAAM,WAAU,GAAI,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,GAAE,IAAK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAA;;AAGpE,QAAA,MAAM,aAAY,GAAI,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;;QAE3E,MAAM,UAAS,GAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,GAAE,EAAG,CAAC,CAAA;QAE1F,SAAS,CAAC,MAAI;;AAEZ,YAAA,cAAa,GAAI,MAAM,CAAC,MAAM,CAAC,KAAM,EAAE;gBACrC,KAAK,EAAE,aAAa,CAAC,KAAK;gBAC1B,KAAK,EAAE,UAAU,CAAC,KAAK;AACvB,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,MAAM,EAAE,CAAC;AACV,aAAA,CAAA;;AAGD,YAAA,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,KAAG;AACxC,gBAAA,WAAW,CAAC,KAAI,GAAI,MAAM,CAAC,GAAG,CAAA;AAC9B,gBAAA,WAAW,CAAC,KAAI,GAAI,MAAM,CAAC,GAAG,CAAA;AAChC,YAAA,CAAC,CAAA;;YAGD,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAC1B,IAAI,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,WAAW,CAAC,KAAI,EAAG,CAAC,CAC/E;AACF,QAAA,CAAC,CAAA;QAED,WAAW,CAAC,MAAI;;AAEd,YAAA,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,GAAG,CAAA;AAC7D,QAAA,CAAC,CAAA;AAED;;AAEE;AACF,QAAA,KAAK,CACH,MAAM,KAAK,CAAC,SAAS,EACrB,CAAC,EAAE,GAAG,EAAE,GAAE,EAAG,KAAG;YACd,cAAc,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAA,EAAG,EAAE,KAAK,CAAA;YAClF,IAAI,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAA;AACxC,QAAA,CAAC,CACH;AAEA;;;;;;;AAOE;AACF,QAAA,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,KAAG;;AAE5E,YAAA,IAAI,QAAQ,WAAW,CAAC,KAAI,IAAK,GAAE,KAAM,WAAW,CAAC,KAAK,EAAE;gBAC1D;YACF;;YAGA,MAAM,YAAW,GAAI,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,GAAE;YACzE,MAAM,YAAW,GAAI,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,GAAE;;YAGzE,cAAc,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;;YAG/C,IAAI,YAAW,KAAM,GAAE,IAAK,iBAAiB,GAAG,EAAE;AAChD,gBAAA,IAAI,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,YAAW,EAAG,CAAA;YACpE;AACF,QAAA,CAAC,CAAA;QAED,OAAO;YACL,MAAM;YACN,aAAa;SACf;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import injectCss from '../../tools/inject-css.js';
|
|
2
2
|
|
|
3
|
-
var css = ".noUi-target,.noUi-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box;touch-action:none;-webkit-user-select:none;user-select:none}.noUi-target{position:relative}.noUi-base,.noUi-connects{height:100%;position:relative;width:100%;z-index:1}.noUi-connects{overflow:hidden;z-index:0}.noUi-connect,.noUi-origin{height:100%;position:absolute;right:0;top:0;-ms-transform-origin:0 0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform-style:preserve-3d;transform-style:flat;width:100%;will-change:transform;z-index:1}.noUi-txt-dir-rtl.noUi-horizontal .noUi-origin{left:0;right:auto}.noUi-vertical .noUi-origin{top:-100%;width:0}.noUi-horizontal .noUi-origin{height:0}.noUi-handle{backface-visibility:hidden;position:absolute}.noUi-touch-area{height:100%;width:100%}.noUi-state-tap .noUi-connect,.noUi-state-tap .noUi-origin{transition:transform .3s}.noUi-state-drag *{cursor:inherit!important}.noUi-horizontal{height:18px}.noUi-horizontal .noUi-handle{height:28px;right:-17px;top:-6px;width:34px}.noUi-vertical{width:18px}.noUi-vertical .noUi-handle{bottom:-17px;height:34px;right:-6px;width:28px}.noUi-txt-dir-rtl.noUi-horizontal .noUi-handle{left:-17px;right:auto}.noUi-target{background:#fafafa;border:1px solid #d3d3d3;border-radius:4px;box-shadow:inset 0 1px 1px #f0f0f0,0 3px 6px -5px #bbb}.noUi-connects{border-radius:3px}.noUi-connect{background:#3fb8af}.noUi-draggable{cursor:ew-resize}.noUi-vertical .noUi-draggable{cursor:ns-resize}.noUi-handle{background:#fff;border:1px solid #d9d9d9;border-radius:3px;box-shadow:inset 0 0 1px #fff,inset 0 1px 7px #ebebeb,0 3px 6px -3px #bbb;cursor:default}.noUi-active{box-shadow:inset 0 0 1px #fff,inset 0 1px 7px #ddd,0 3px 6px -3px #bbb}.noUi-handle:after,.noUi-handle:before{background:#e8e7e6;content:\"\";display:block;height:14px;left:14px;position:absolute;top:6px;width:1px}.noUi-handle:after{left:17px}.noUi-vertical .noUi-handle:after,.noUi-vertical .noUi-handle:before{height:1px;left:6px;top:14px;width:14px}.noUi-vertical .noUi-handle:after{top:17px}[disabled] .noUi-connect{background:#b8b8b8}[disabled] .noUi-handle,[disabled].noUi-handle,[disabled].noUi-target{cursor:not-allowed}.noUi-pips,.noUi-pips *{box-sizing:border-box}.noUi-pips{color:#999;position:absolute}.noUi-value{position:absolute;text-align:center;white-space:nowrap}.noUi-value-sub{color:#ccc;font-size:10px}.noUi-marker{background:#ccc;position:absolute}.noUi-marker-large,.noUi-marker-sub{background:#aaa}.noUi-pips-horizontal{height:80px;left:0;padding:10px 0;top:100%;width:100%}.noUi-value-horizontal{transform:translate(-50%,50%)}.noUi-rtl .noUi-value-horizontal{transform:translate(50%,50%)}.noUi-marker-horizontal.noUi-marker{height:5px;margin-left:-1px;width:2px}.noUi-marker-horizontal.noUi-marker-sub{height:10px}.noUi-marker-horizontal.noUi-marker-large{height:15px}.noUi-pips-vertical{height:100%;left:100%;padding:0 10px;top:0}.noUi-value-vertical{padding-left:25px;transform:translateY(-50%)}.noUi-rtl .noUi-value-vertical{transform:translateY(50%)}.noUi-marker-vertical.noUi-marker{height:2px;margin-top:-1px;width:5px}.noUi-marker-vertical.noUi-marker-sub{width:10px}.noUi-marker-vertical.noUi-marker-large{width:15px}.noUi-tooltip{background:#fff;border:1px solid #d9d9d9;border-radius:3px;color:#000;display:block;padding:5px;position:absolute;text-align:center;white-space:nowrap}.noUi-horizontal .noUi-tooltip{bottom:120%;left:50
|
|
3
|
+
var css = ".noUi-target,.noUi-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-moz-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;user-select:none}.noUi-target{position:relative}.noUi-base,.noUi-connects{height:100%;position:relative;width:100%;z-index:1}.noUi-connects{overflow:hidden;z-index:0}.noUi-connect,.noUi-origin{height:100%;position:absolute;right:0;top:0;-ms-transform-origin:0 0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform-style:preserve-3d;transform-style:flat;width:100%;will-change:transform;z-index:1}.noUi-txt-dir-rtl.noUi-horizontal .noUi-origin{left:0;right:auto}.noUi-vertical .noUi-origin{top:-100%;width:0}.noUi-horizontal .noUi-origin{height:0}.noUi-handle{-webkit-backface-visibility:hidden;backface-visibility:hidden;position:absolute}.noUi-touch-area{height:100%;width:100%}.noUi-state-tap .noUi-connect,.noUi-state-tap .noUi-origin{-webkit-transition:transform .3s;transition:transform .3s}.noUi-state-drag *{cursor:inherit!important}.noUi-horizontal{height:18px}.noUi-horizontal .noUi-handle{height:28px;right:-17px;top:-6px;width:34px}.noUi-vertical{width:18px}.noUi-vertical .noUi-handle{bottom:-17px;height:34px;right:-6px;width:28px}.noUi-txt-dir-rtl.noUi-horizontal .noUi-handle{left:-17px;right:auto}.noUi-target{background:#fafafa;border:1px solid #d3d3d3;border-radius:4px;box-shadow:inset 0 1px 1px #f0f0f0,0 3px 6px -5px #bbb}.noUi-connects{border-radius:3px}.noUi-connect{background:#3fb8af}.noUi-draggable{cursor:ew-resize}.noUi-vertical .noUi-draggable{cursor:ns-resize}.noUi-handle{background:#fff;border:1px solid #d9d9d9;border-radius:3px;box-shadow:inset 0 0 1px #fff,inset 0 1px 7px #ebebeb,0 3px 6px -3px #bbb;cursor:default}.noUi-active{box-shadow:inset 0 0 1px #fff,inset 0 1px 7px #ddd,0 3px 6px -3px #bbb}.noUi-handle:after,.noUi-handle:before{background:#e8e7e6;content:\"\";display:block;height:14px;left:14px;position:absolute;top:6px;width:1px}.noUi-handle:after{left:17px}.noUi-vertical .noUi-handle:after,.noUi-vertical .noUi-handle:before{height:1px;left:6px;top:14px;width:14px}.noUi-vertical .noUi-handle:after{top:17px}[disabled] .noUi-connect{background:#b8b8b8}[disabled] .noUi-handle,[disabled].noUi-handle,[disabled].noUi-target{cursor:not-allowed}.noUi-pips,.noUi-pips *{-moz-box-sizing:border-box;box-sizing:border-box}.noUi-pips{color:#999;position:absolute}.noUi-value{position:absolute;text-align:center;white-space:nowrap}.noUi-value-sub{color:#ccc;font-size:10px}.noUi-marker{background:#ccc;position:absolute}.noUi-marker-large,.noUi-marker-sub{background:#aaa}.noUi-pips-horizontal{height:80px;left:0;padding:10px 0;top:100%;width:100%}.noUi-value-horizontal{-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%)}.noUi-rtl .noUi-value-horizontal{-webkit-transform:translate(50%,50%);transform:translate(50%,50%)}.noUi-marker-horizontal.noUi-marker{height:5px;margin-left:-1px;width:2px}.noUi-marker-horizontal.noUi-marker-sub{height:10px}.noUi-marker-horizontal.noUi-marker-large{height:15px}.noUi-pips-vertical{height:100%;left:100%;padding:0 10px;top:0}.noUi-value-vertical{padding-left:25px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.noUi-rtl .noUi-value-vertical{-webkit-transform:translateY(50%);transform:translateY(50%)}.noUi-marker-vertical.noUi-marker{height:2px;margin-top:-1px;width:5px}.noUi-marker-vertical.noUi-marker-sub{width:10px}.noUi-marker-vertical.noUi-marker-large{width:15px}.noUi-tooltip{background:#fff;border:1px solid #d9d9d9;border-radius:3px;color:#000;display:block;padding:5px;position:absolute;text-align:center;white-space:nowrap}.noUi-horizontal .noUi-tooltip{bottom:120%;left:50%;-webkit-transform:translate(-50%);transform:translate(-50%)}.noUi-vertical .noUi-tooltip{right:120%;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.noUi-horizontal .noUi-origin>.noUi-tooltip{bottom:10px;left:auto;-webkit-transform:translate(50%);transform:translate(50%)}.noUi-vertical .noUi-origin>.noUi-tooltip{right:28px;top:auto;-webkit-transform:translateY(-18px);transform:translateY(-18px)}.x-base-slider{gap:16px}.x-base-slider,.x-base-slider__selected-max,.x-base-slider__selected-min{display:flex;flex-flow:column nowrap}.x-base-slider__selected{display:inline-flex}.x-base-slider__selected-max,.x-base-slider__selected-min{flex:50%}.x-base-slider__nouislider{margin:16px 0;padding:0 16px}.x-base-slider__nouislider .noUi-handle{box-shadow:none}.x-base-slider__nouislider .noUi-handle:after,.x-base-slider__nouislider .noUi-handle:before{content:none}";
|
|
4
4
|
injectCss(css);
|
|
5
5
|
|
|
6
6
|
export { css };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-switch.vue.js","sources":["../../../src/components/base-switch.vue"],"sourcesContent":["<template>\n <button\n :aria-checked=\"modelValue || undefined\"\n :class=\"cssClasses\"\n class=\"x-switch\"\n role=\"switch\"\n @click=\"toggle\"\n >\n <div class=\"x-switch__handle\" />\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../utils/types'\nimport { computed, defineComponent } from 'vue'\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\nexport default defineComponent({\n name: 'BaseSwitch',\n /**\n * The selected value of the switch.\n *\n * @public\n */\n props: {\n modelValue: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update:modelValue'],\n setup(props, { emit }) {\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 const cssClasses = computed<VueCSSClasses>(() => ({\n 'x-switch--is-selected
|
|
1
|
+
{"version":3,"file":"base-switch.vue.js","sources":["../../../src/components/base-switch.vue"],"sourcesContent":["<template>\n <button\n :aria-checked=\"modelValue || undefined\"\n :class=\"cssClasses\"\n class=\"x-switch\"\n role=\"switch\"\n @click=\"toggle\"\n >\n <div class=\"x-switch__handle\" />\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../utils/types'\nimport { computed, defineComponent } from 'vue'\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\nexport default defineComponent({\n name: 'BaseSwitch',\n /**\n * The selected value of the switch.\n *\n * @public\n */\n props: {\n modelValue: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update:modelValue'],\n setup(props, { emit }) {\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 const cssClasses = computed<VueCSSClasses>(() => ({\n 'x-switch--is-selected xds:selected': props.modelValue,\n }))\n\n /**\n * Emits an event with the new value of the switch.\n *\n * @internal\n */\n const toggle = (): void => {\n const newValue = !props.modelValue\n emit('update:modelValue', newValue)\n }\n\n return {\n cssClasses,\n toggle,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-switch {\n --x-switch-height: 16px;\n --x-switch-width: calc(2 * (var(--x-switch-height)) + 2 * var(--x-switch-padding));\n --x-switch-background: #b3b3b3;\n --x-switch-padding: 2px;\n --x-switch-handle-size: var(--x-switch-height);\n box-sizing: content-box;\n height: var(--x-switch-height);\n padding: var(--x-switch-padding);\n border-radius: 99999px;\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\n.x-switch__handle {\n background: #ffffff;\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.x-switch--is-selected {\n --x-switch-translate-x: calc(var(--x-switch-padding) + var(--x-switch-width) / 2);\n --x-switch-background: #1a1a1a;\n}\n\n.x-switch--sm {\n --x-switch-height: 12px;\n}\n\n.x-switch--lg {\n --x-switch-height: 24px;\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 v-model=\"value\" />\n</template>\n\n<script setup>\nimport { BaseSwitch } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst value = ref(false)\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 setup>\nimport { BaseSwitch } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst value = ref(false)\n</script>\n```\n</docs>\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode"],"mappings":";;;;;;;sBACEA,kBAAA,CAQS,QAAA,EAAA;AAAA,IAPN,gBAAc,IAAA,CAAA,UAAA,IAAc,MAAA;AAAA,IAC5B,KAAA,EAAKC,cAAA,CAAA,CAAE,IAAA,CAAA,UAAA,EACF,UAAU,CAAA,CAAA;AAAA,IAChB,IAAA,EAAK,QAAA;AAAA,IACJ,SAAK,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAE,IAAA,CAAA,MAAA,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,IAAA,CAAA;AAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA;AAER,IAAAC,kBAAA;AAAA,MAAgC,KAAA;AAAA,MAAA,EAA3B,OAAM,kBAAA,EAAkB;AAAA,MAAA,IAAA;AAAA,MAAA;AAAA;AAAA;AAAA,GAAA,CAAA,CAAA,EAAA,EAAA,EAAA,UAAA,CAAA;;;;;;"}
|
|
@@ -30,7 +30,7 @@ var _sfc_main = defineComponent({
|
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
32
|
const cssClasses = computed(() => ({
|
|
33
|
-
'x-switch--is-selected
|
|
33
|
+
'x-switch--is-selected xds:selected': props.modelValue,
|
|
34
34
|
}));
|
|
35
35
|
/**
|
|
36
36
|
* Emits an event with the new value of the switch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-switch.vue2.js","sources":["../../../src/components/base-switch.vue"],"sourcesContent":["<template>\n <button\n :aria-checked=\"modelValue || undefined\"\n :class=\"cssClasses\"\n class=\"x-switch\"\n role=\"switch\"\n @click=\"toggle\"\n >\n <div class=\"x-switch__handle\" />\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../utils/types'\nimport { computed, defineComponent } from 'vue'\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\nexport default defineComponent({\n name: 'BaseSwitch',\n /**\n * The selected value of the switch.\n *\n * @public\n */\n props: {\n modelValue: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update:modelValue'],\n setup(props, { emit }) {\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 const cssClasses = computed<VueCSSClasses>(() => ({\n 'x-switch--is-selected
|
|
1
|
+
{"version":3,"file":"base-switch.vue2.js","sources":["../../../src/components/base-switch.vue"],"sourcesContent":["<template>\n <button\n :aria-checked=\"modelValue || undefined\"\n :class=\"cssClasses\"\n class=\"x-switch\"\n role=\"switch\"\n @click=\"toggle\"\n >\n <div class=\"x-switch__handle\" />\n </button>\n</template>\n\n<script lang=\"ts\">\nimport type { VueCSSClasses } from '../utils/types'\nimport { computed, defineComponent } from 'vue'\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\nexport default defineComponent({\n name: 'BaseSwitch',\n /**\n * The selected value of the switch.\n *\n * @public\n */\n props: {\n modelValue: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['update:modelValue'],\n setup(props, { emit }) {\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 const cssClasses = computed<VueCSSClasses>(() => ({\n 'x-switch--is-selected xds:selected': props.modelValue,\n }))\n\n /**\n * Emits an event with the new value of the switch.\n *\n * @internal\n */\n const toggle = (): void => {\n const newValue = !props.modelValue\n emit('update:modelValue', newValue)\n }\n\n return {\n cssClasses,\n toggle,\n }\n },\n})\n</script>\n\n<style lang=\"css\" scoped>\n.x-switch {\n --x-switch-height: 16px;\n --x-switch-width: calc(2 * (var(--x-switch-height)) + 2 * var(--x-switch-padding));\n --x-switch-background: #b3b3b3;\n --x-switch-padding: 2px;\n --x-switch-handle-size: var(--x-switch-height);\n box-sizing: content-box;\n height: var(--x-switch-height);\n padding: var(--x-switch-padding);\n border-radius: 99999px;\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\n.x-switch__handle {\n background: #ffffff;\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.x-switch--is-selected {\n --x-switch-translate-x: calc(var(--x-switch-padding) + var(--x-switch-width) / 2);\n --x-switch-background: #1a1a1a;\n}\n\n.x-switch--sm {\n --x-switch-height: 12px;\n}\n\n.x-switch--lg {\n --x-switch-height: 24px;\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 v-model=\"value\" />\n</template>\n\n<script setup>\nimport { BaseSwitch } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst value = ref(false)\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 setup>\nimport { BaseSwitch } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst value = ref(false)\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;AAgBA;;;;;;AAME;AAEF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,YAAY;AAClB;;;;AAIE;AACF,IAAA,KAAK,EAAE;AACL,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;AACF,KAAA;IACD,KAAK,EAAE,CAAC,mBAAmB,CAAC;AAC5B,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,IAAG,EAAG,EAAA;AACnB;;;;;;AAME;AACF,QAAA,MAAM,UAAS,GAAI,QAAQ,CAAgB,OAAO;YAChD,oCAAoC,EAAE,KAAK,CAAC,UAAU;AACvD,SAAA,CAAC,CAAA;AAEF;;;;AAIE;QACF,MAAM,SAAS,MAAU;AACvB,YAAA,MAAM,QAAO,GAAI,CAAC,KAAK,CAAC,UAAS;AACjC,YAAA,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAA;AACpC,QAAA,CAAA;QAEA,OAAO;YACL,UAAU;YACV,MAAM;SACR;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -3,7 +3,7 @@ import { resolveComponent, openBlock, createElementBlock, Fragment, renderList,
|
|
|
3
3
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = {
|
|
6
|
-
class: "x-column-picker-list
|
|
6
|
+
class: "x-column-picker-list xds:button-group",
|
|
7
7
|
"data-test": "column-picker-list",
|
|
8
8
|
role: "list"
|
|
9
9
|
};
|
|
@@ -19,7 +19,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19
19
|
{ key: column },
|
|
20
20
|
[
|
|
21
21
|
createVNode(_component_BaseEventButton, {
|
|
22
|
-
class: normalizeClass(["x-column-picker-list__button
|
|
22
|
+
class: normalizeClass(["x-column-picker-list__button xds:button", [_ctx.buttonClass, cssClasses]]),
|
|
23
23
|
"data-test": "column-picker-button",
|
|
24
24
|
"aria-pressed": isSelected.toString(),
|
|
25
25
|
events,
|
|
@@ -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 <div class=\"x-column-picker-list
|
|
1
|
+
{"version":3,"file":"base-column-picker-list.vue.js","sources":["../../../../src/components/column-picker/base-column-picker-list.vue"],"sourcesContent":["<template>\n <div class=\"x-column-picker-list xds:button-group\" data-test=\"column-picker-list\" role=\"list\">\n <template\n v-for=\"({ column, cssClasses, events, isSelected }, index) in columnsWithCssClasses\"\n :key=\"column\"\n >\n <BaseEventButton\n class=\"x-column-picker-list__button xds:button\"\n :class=\"[buttonClass, cssClasses]\"\n data-test=\"column-picker-button\"\n :aria-pressed=\"isSelected.toString()\"\n :events=\"events\"\n :aria-label=\"`${column} columns`\"\n role=\"listitem\"\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\n <!--\n @slot Customized Column Picker divider. Specify an element to act as divider for\n the items in the column picker. Empty by default.\n -->\n <slot v-if=\"index !== columnsWithCssClasses.length - 1\" name=\"divider\"></slot>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../utils/types'\nimport type { XEventsTypes } from '../../wiring'\nimport { computed, defineComponent, onBeforeMount, ref, watch } from 'vue'\nimport { use$x } from '../../composables/use-$x'\nimport BaseEventButton from '../base-event-button.vue'\n\nexport 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 * Additionally, this component exposes the following props to modify the classes of the\n * elements: `buttonClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'BaseColumnPickerList',\n components: { BaseEventButton },\n props: {\n /** An array of numbers that represents the number of columns to render. */\n columns: {\n type: Array as PropType<number[]>,\n required: true,\n },\n /** The value of the selected columns number. */\n modelValue: Number,\n /** Class inherited by each button. */\n buttonClass: String,\n },\n emits: ['update:modelValue'],\n setup(props, { emit }) {\n const $x = use$x()\n\n const providedSelectedColumns = computed(() => props.modelValue ?? props.columns[0])\n const selectedColumns = ref(providedSelectedColumns.value)\n\n /**\n * Assigns `selectedColumns` value and emits `ColumnsNumberProvided`.\n *\n * @param column - Column number provided.\n */\n function emitColumnsNumberProvided(column: number) {\n selectedColumns.value = column\n $x.emit('ColumnsNumberProvided', column)\n }\n\n /**\n * Emits `update:modelValue` with the column selected.\n *\n * @param column - Column number selected.\n */\n function emitUpdateModelValue(column: number) {\n if (props.modelValue !== column) {\n emit('update:modelValue', column)\n }\n }\n\n watch(providedSelectedColumns, emitColumnsNumberProvided)\n watch(selectedColumns, emitUpdateModelValue)\n\n $x.on('ColumnsNumberProvided', false).subscribe(column => (selectedColumns.value = column))\n\n /**\n * Synchronizes the columns number before mounting the component. If the real number of selected\n * columns equals the provided columns, it emits the event to sync it with every other component.\n * If it is not equal it means that the user has already selected a number of columns, so we emit\n * a `update:modelValue` event so developers can sync the provided value.\n */\n onBeforeMount(() => {\n if (selectedColumns.value === providedSelectedColumns.value) {\n emitColumnsNumberProvided(selectedColumns.value)\n } else {\n emitUpdateModelValue(selectedColumns.value)\n }\n })\n\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 const columnsWithCssClasses = computed<ColumnPickerItem[]>(() =>\n props.columns.map(column => ({\n column,\n cssClasses: [\n `x-column-picker-list__button--${column}-cols`,\n { 'xds:selected': selectedColumns.value === column },\n ],\n isSelected: selectedColumns.value === column,\n events: {\n UserClickedColumnPicker: column,\n ColumnsNumberProvided: column,\n },\n })),\n )\n\n return { columnsWithCssClasses }\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\nbutton emits the needed events to sync other instances of column pickers or grids with the\nnumber of columns being selected when clicked.\n\n### Default usage\n\nIt is required to send the columns prop.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\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 parent. It will be\nupdated if the value changes or if the parent changes it.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" v-model=\"selectedColumns\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\nconst selectedColumns = ref(4)\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 live\n<template>\n <BaseColumnPickerList :columns=\"columns\">\n <template #default=\"{ column, isSelected }\">\n <span>{{ column }} {{ isSelected ? '🟢' : '' }}</span>\n </template>\n </BaseColumnPickerList>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\nIt is also possible to add a divider element between the column picker buttons by overriding the\n`divider` slot.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\">\n <template #divider>\n <ChevronRightIcon aria-hidden=\"true\" />\n </template>\n </BaseColumnPickerList>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\nimport ChevronRightIcon from '@empathyco/x-components/js/components/icons/chevron-right.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\n#### Customizing the buttons with classes\n\nThe `buttonClass` prop can be used to add classes to the buttons.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" buttonClass=\"xds:button-circle\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedColumnPicker`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks an item. The event payload is the number of columns\n that the clicked item represents.\n- [`ColumnsNumberProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted on component mount. The event payload is the current `selectedColumns` value.\n</docs>\n"],"names":["_openBlock","_createElementBlock","_Fragment","_renderList","_createVNode","_normalizeClass","_renderSlot","_mergeProps","_createTextVNode","_createCommentVNode"],"mappings":";;;;;EACO,KAAA,EAAM,uCAAA;AAAA,EAAwC,WAAA,EAAU,oBAAA;AAAA,EAAqB,IAAA,EAAK;;;;AAAvF,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CA+BM,OA/BN,UAAA,EA+BM;AAAA,KAAAD,SAAA,CAAA,IAAA,CAAA,EA9BJC,kBAAA;AAAA,MA6BWC,QAAA;AAAA,MAAA,IAAA;AAAA,MAAAC,UAAA,CA5BqD,4BAAqB,CAAA,EAAzE,MAAA,EAAQ,YAAY,MAAA,EAAQ,UAAA,IAAc,KAAA,KAAK;;;iBACnD,MAAA,EAAM;AAAA,UAAA;AAAA,YAEZC,WAAA,CAkBkB,0BAAA,EAAA;AAAA,cAjBhB,KAAA,EAAKC,cAAA,CAAA,CAAC,yCAAA,EAAyC,CACtC,kBAAa,UAAU,CAAA,CAAA,CAAA;AAAA,cAChC,WAAA,EAAU,sBAAA;AAAA,cACT,cAAA,EAAc,WAAW,QAAA,EAAQ;AAAA,cACjC,MAAA;AAAA,cACA,YAAA,EAAU,GAAK,MAAM,CAAA,QAAA,CAAA;AAAA,cACtB,IAAA,EAAK;AAAA,aAAA,EAAA;+BAQL,MAEO;AAAA,gBAFPC,WAEO,IAAA,CAAA,MAAA,EAAA,SAAA,EAFPC,UAAA,CAEO,qBAFS,MAAA,EAAQ,UAAA,KAAxB,MAEO;AAAA,kBAAAC,eAAA;oCADF,MAAM,CAAA;AAAA,oBAAA;AAAA;AAAA;AAAA,iBAAA;;;;;YAQD,KAAA,KAAU,IAAA,CAAA,qBAAA,CAAsB,MAAA,GAAM,CAAA,GAAlDF,UAAA,CAA8E,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,GAAAG,kBAAA,CAAA,MAAA,EAAA,IAAA;;;;;;;;;;;;;;;"}
|
|
@@ -74,7 +74,7 @@ var _sfc_main = defineComponent({
|
|
|
74
74
|
column,
|
|
75
75
|
cssClasses: [
|
|
76
76
|
`x-column-picker-list__button--${column}-cols`,
|
|
77
|
-
{ '
|
|
77
|
+
{ 'xds:selected': selectedColumns.value === column },
|
|
78
78
|
],
|
|
79
79
|
isSelected: selectedColumns.value === column,
|
|
80
80
|
events: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-column-picker-list.vue2.js","sources":["../../../../src/components/column-picker/base-column-picker-list.vue"],"sourcesContent":["<template>\n <div class=\"x-column-picker-list x-button-group\" data-test=\"column-picker-list\" role=\"list\">\n <template\n v-for=\"({ column, cssClasses, events, isSelected }, index) in columnsWithCssClasses\"\n :key=\"column\"\n >\n <BaseEventButton\n class=\"x-column-picker-list__button x-button\"\n :class=\"[buttonClass, cssClasses]\"\n data-test=\"column-picker-button\"\n :aria-pressed=\"isSelected.toString()\"\n :events=\"events\"\n :aria-label=\"`${column} columns`\"\n role=\"listitem\"\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\n <!--\n @slot Customized Column Picker divider. Specify an element to act as divider for\n the items in the column picker. Empty by default.\n -->\n <slot v-if=\"index !== columnsWithCssClasses.length - 1\" name=\"divider\"></slot>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { ColumnPickerItem } from './base-column-picker-list.types'\nimport { computed, defineComponent, onBeforeMount, ref, watch } from 'vue'\nimport { use$x } from '../../composables/use-$x'\nimport BaseEventButton from '../base-event-button.vue'\n\n/**\n * Column picker list component renders a list of buttons to choose the columns number.\n *\n * Additionally, this component exposes the following props to modify the classes of the\n * elements: `buttonClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'BaseColumnPickerList',\n components: { BaseEventButton },\n props: {\n /** An array of numbers that represents the number of columns to render. */\n columns: {\n type: Array as PropType<number[]>,\n required: true,\n },\n /** The value of the selected columns number. */\n modelValue: Number,\n /** Class inherited by each button. */\n buttonClass: String,\n },\n emits: ['update:modelValue'],\n setup(props, { emit }) {\n const $x = use$x()\n\n const providedSelectedColumns = computed(() => props.modelValue ?? props.columns[0])\n const selectedColumns = ref(providedSelectedColumns.value)\n\n /**\n * Assigns `selectedColumns` value and emits `ColumnsNumberProvided`.\n *\n * @param column - Column number provided.\n */\n function emitColumnsNumberProvided(column: number) {\n selectedColumns.value = column\n $x.emit('ColumnsNumberProvided', column)\n }\n\n /**\n * Emits `update:modelValue` with the column selected.\n *\n * @param column - Column number selected.\n */\n function emitUpdateModelValue(column: number) {\n if (props.modelValue !== column) {\n emit('update:modelValue', column)\n }\n }\n\n watch(providedSelectedColumns, emitColumnsNumberProvided)\n watch(selectedColumns, emitUpdateModelValue)\n\n $x.on('ColumnsNumberProvided', false).subscribe(column => (selectedColumns.value = column))\n\n /**\n * Synchronizes the columns number before mounting the component. If the real number of selected\n * columns equals the provided columns, it emits the event to sync it with every other component.\n * If it is not equal it means that the user has already selected a number of columns, so we emit\n * a `update:modelValue` event so developers can sync the provided value.\n */\n onBeforeMount(() => {\n if (selectedColumns.value === providedSelectedColumns.value) {\n emitColumnsNumberProvided(selectedColumns.value)\n } else {\n emitUpdateModelValue(selectedColumns.value)\n }\n })\n\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 const columnsWithCssClasses = computed<ColumnPickerItem[]>(() =>\n props.columns.map(column => ({\n column,\n cssClasses: [\n `x-column-picker-list__button--${column}-cols`,\n { 'x-selected': selectedColumns.value === column },\n ],\n isSelected: selectedColumns.value === column,\n events: {\n UserClickedColumnPicker: column,\n ColumnsNumberProvided: column,\n },\n })),\n )\n\n return { columnsWithCssClasses }\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\nbutton emits the needed events to sync other instances of column pickers or grids with the\nnumber of columns being selected when clicked.\n\n### Default usage\n\nIt is required to send the columns prop.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\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 parent. It will be\nupdated if the value changes or if the parent changes it.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" v-model=\"selectedColumns\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\nconst selectedColumns = ref(4)\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 live\n<template>\n <BaseColumnPickerList :columns=\"columns\">\n <template #default=\"{ column, isSelected }\">\n <span>{{ column }} {{ isSelected ? '🟢' : '' }}</span>\n </template>\n </BaseColumnPickerList>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\nIt is also possible to add a divider element between the column picker buttons by overriding the\n`divider` slot.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\">\n <template #divider>\n <ChevronRightIcon aria-hidden=\"true\" />\n </template>\n </BaseColumnPickerList>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\nimport ChevronRightIcon from '@empathyco/x-components/js/components/icons/chevron-right.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\n#### Customizing the buttons with classes\n\nThe `buttonClass` prop can be used to add classes to the buttons.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" buttonClass=\"x-button--round\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedColumnPicker`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks an item. The event payload is the number of columns\n that the clicked item represents.\n- [`ColumnsNumberProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted on component mount. The event payload is the current `selectedColumns` value.\n</docs>\n"],"names":[],"mappings":";;;;AA0CA;;;;;;;AAOE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;;AAEL,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,KAA2B;AACjC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,UAAU,EAAE,MAAM;;AAElB,QAAA,WAAW,EAAE,MAAM;AACpB,KAAA;IACD,KAAK,EAAE,CAAC,mBAAmB,CAAC;AAC5B,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,IAAG,EAAG,EAAA;AACnB,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;AAEjB,QAAA,MAAM,uBAAsB,GAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,UAAS,IAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACnF,MAAM,eAAc,GAAI,GAAG,CAAC,uBAAuB,CAAC,KAAK,CAAA;AAEzD;;;;AAIE;QACF,SAAS,yBAAyB,CAAC,MAAc,EAAA;AAC/C,YAAA,eAAe,CAAC,KAAI,GAAI,MAAK;AAC7B,YAAA,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAA;QACzC;AAEA;;;;AAIE;QACF,SAAS,oBAAoB,CAAC,MAAc,EAAA;AAC1C,YAAA,IAAI,KAAK,CAAC,UAAS,KAAM,MAAM,EAAE;AAC/B,gBAAA,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAA;YAClC;QACF;AAEA,QAAA,KAAK,CAAC,uBAAuB,EAAE,yBAAyB,CAAA;AACxD,QAAA,KAAK,CAAC,eAAe,EAAE,oBAAoB,CAAA;QAE3C,EAAE,CAAC,EAAE,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,MAAK,KAAM,eAAe,CAAC,KAAI,GAAI,MAAM,CAAC,CAAA;AAE1F;;;;;AAKE;QACF,aAAa,CAAC,MAAI;YAChB,IAAI,eAAe,CAAC,KAAI,KAAM,uBAAuB,CAAC,KAAK,EAAE;AAC3D,gBAAA,yBAAyB,CAAC,eAAe,CAAC,KAAK,CAAA;YACjD;iBAAO;AACL,gBAAA,oBAAoB,CAAC,eAAe,CAAC,KAAK,CAAA;YAC5C;AACF,QAAA,CAAC,CAAA;AAED;;;;AAIE;AACF,QAAA,MAAM,qBAAoB,GAAI,QAAQ,CAAqB,MACzD,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAK,KAAM;YAC3B,MAAM;AACN,YAAA,UAAU,EAAE;AACV,gBAAA,CAAA,8BAAA,EAAiC,MAAM,CAAA,KAAA,CAAO;AAC9C,gBAAA,EAAE,YAAY,EAAE,eAAe,CAAC,UAAU,QAAQ;AACnD,aAAA;AACD,YAAA,UAAU,EAAE,eAAe,CAAC,KAAI,KAAM,MAAM;AAC5C,YAAA,MAAM,EAAE;AACN,gBAAA,uBAAuB,EAAE,MAAM;AAC/B,gBAAA,qBAAqB,EAAE,MAAM;AAC9B,aAAA;SACF,CAAC,CAAC,CACL;QAEA,OAAO,EAAE,qBAAoB,EAAE;IACjC,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"base-column-picker-list.vue2.js","sources":["../../../../src/components/column-picker/base-column-picker-list.vue"],"sourcesContent":["<template>\n <div class=\"x-column-picker-list xds:button-group\" data-test=\"column-picker-list\" role=\"list\">\n <template\n v-for=\"({ column, cssClasses, events, isSelected }, index) in columnsWithCssClasses\"\n :key=\"column\"\n >\n <BaseEventButton\n class=\"x-column-picker-list__button xds:button\"\n :class=\"[buttonClass, cssClasses]\"\n data-test=\"column-picker-button\"\n :aria-pressed=\"isSelected.toString()\"\n :events=\"events\"\n :aria-label=\"`${column} columns`\"\n role=\"listitem\"\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\n <!--\n @slot Customized Column Picker divider. Specify an element to act as divider for\n the items in the column picker. Empty by default.\n -->\n <slot v-if=\"index !== columnsWithCssClasses.length - 1\" name=\"divider\"></slot>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport type { VueCSSClasses } from '../../utils/types'\nimport type { XEventsTypes } from '../../wiring'\nimport { computed, defineComponent, onBeforeMount, ref, watch } from 'vue'\nimport { use$x } from '../../composables/use-$x'\nimport BaseEventButton from '../base-event-button.vue'\n\nexport 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 * Additionally, this component exposes the following props to modify the classes of the\n * elements: `buttonClass`.\n *\n * @public\n */\nexport default defineComponent({\n name: 'BaseColumnPickerList',\n components: { BaseEventButton },\n props: {\n /** An array of numbers that represents the number of columns to render. */\n columns: {\n type: Array as PropType<number[]>,\n required: true,\n },\n /** The value of the selected columns number. */\n modelValue: Number,\n /** Class inherited by each button. */\n buttonClass: String,\n },\n emits: ['update:modelValue'],\n setup(props, { emit }) {\n const $x = use$x()\n\n const providedSelectedColumns = computed(() => props.modelValue ?? props.columns[0])\n const selectedColumns = ref(providedSelectedColumns.value)\n\n /**\n * Assigns `selectedColumns` value and emits `ColumnsNumberProvided`.\n *\n * @param column - Column number provided.\n */\n function emitColumnsNumberProvided(column: number) {\n selectedColumns.value = column\n $x.emit('ColumnsNumberProvided', column)\n }\n\n /**\n * Emits `update:modelValue` with the column selected.\n *\n * @param column - Column number selected.\n */\n function emitUpdateModelValue(column: number) {\n if (props.modelValue !== column) {\n emit('update:modelValue', column)\n }\n }\n\n watch(providedSelectedColumns, emitColumnsNumberProvided)\n watch(selectedColumns, emitUpdateModelValue)\n\n $x.on('ColumnsNumberProvided', false).subscribe(column => (selectedColumns.value = column))\n\n /**\n * Synchronizes the columns number before mounting the component. If the real number of selected\n * columns equals the provided columns, it emits the event to sync it with every other component.\n * If it is not equal it means that the user has already selected a number of columns, so we emit\n * a `update:modelValue` event so developers can sync the provided value.\n */\n onBeforeMount(() => {\n if (selectedColumns.value === providedSelectedColumns.value) {\n emitColumnsNumberProvided(selectedColumns.value)\n } else {\n emitUpdateModelValue(selectedColumns.value)\n }\n })\n\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 const columnsWithCssClasses = computed<ColumnPickerItem[]>(() =>\n props.columns.map(column => ({\n column,\n cssClasses: [\n `x-column-picker-list__button--${column}-cols`,\n { 'xds:selected': selectedColumns.value === column },\n ],\n isSelected: selectedColumns.value === column,\n events: {\n UserClickedColumnPicker: column,\n ColumnsNumberProvided: column,\n },\n })),\n )\n\n return { columnsWithCssClasses }\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\nbutton emits the needed events to sync other instances of column pickers or grids with the\nnumber of columns being selected when clicked.\n\n### Default usage\n\nIt is required to send the columns prop.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\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 parent. It will be\nupdated if the value changes or if the parent changes it.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" v-model=\"selectedColumns\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\nconst selectedColumns = ref(4)\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 live\n<template>\n <BaseColumnPickerList :columns=\"columns\">\n <template #default=\"{ column, isSelected }\">\n <span>{{ column }} {{ isSelected ? '🟢' : '' }}</span>\n </template>\n </BaseColumnPickerList>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\nIt is also possible to add a divider element between the column picker buttons by overriding the\n`divider` slot.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\">\n <template #divider>\n <ChevronRightIcon aria-hidden=\"true\" />\n </template>\n </BaseColumnPickerList>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\nimport ChevronRightIcon from '@empathyco/x-components/js/components/icons/chevron-right.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\n#### Customizing the buttons with classes\n\nThe `buttonClass` prop can be used to add classes to the buttons.\n\n```vue live\n<template>\n <BaseColumnPickerList :columns=\"columns\" buttonClass=\"xds:button-circle\" />\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nimport BaseColumnPickerList from '@empathyco/x-components/js/components/column-picker/base-column-picker-list.vue'\n\nconst columns = ref([2, 4, 6])\n</script>\n```\n\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedColumnPicker`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks an item. The event payload is the number of columns\n that the clicked item represents.\n- [`ColumnsNumberProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted on component mount. The event payload is the current `selectedColumns` value.\n</docs>\n"],"names":[],"mappings":";;;;AAkDA;;;;;;;AAOE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;;AAEL,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,KAA2B;AACjC,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;;AAED,QAAA,UAAU,EAAE,MAAM;;AAElB,QAAA,WAAW,EAAE,MAAM;AACpB,KAAA;IACD,KAAK,EAAE,CAAC,mBAAmB,CAAC;AAC5B,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,IAAG,EAAG,EAAA;AACnB,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;AAEjB,QAAA,MAAM,uBAAsB,GAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,UAAS,IAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACnF,MAAM,eAAc,GAAI,GAAG,CAAC,uBAAuB,CAAC,KAAK,CAAA;AAEzD;;;;AAIE;QACF,SAAS,yBAAyB,CAAC,MAAc,EAAA;AAC/C,YAAA,eAAe,CAAC,KAAI,GAAI,MAAK;AAC7B,YAAA,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAA;QACzC;AAEA;;;;AAIE;QACF,SAAS,oBAAoB,CAAC,MAAc,EAAA;AAC1C,YAAA,IAAI,KAAK,CAAC,UAAS,KAAM,MAAM,EAAE;AAC/B,gBAAA,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAA;YAClC;QACF;AAEA,QAAA,KAAK,CAAC,uBAAuB,EAAE,yBAAyB,CAAA;AACxD,QAAA,KAAK,CAAC,eAAe,EAAE,oBAAoB,CAAA;QAE3C,EAAE,CAAC,EAAE,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,MAAK,KAAM,eAAe,CAAC,KAAI,GAAI,MAAM,CAAC,CAAA;AAE1F;;;;;AAKE;QACF,aAAa,CAAC,MAAI;YAChB,IAAI,eAAe,CAAC,KAAI,KAAM,uBAAuB,CAAC,KAAK,EAAE;AAC3D,gBAAA,yBAAyB,CAAC,eAAe,CAAC,KAAK,CAAA;YACjD;iBAAO;AACL,gBAAA,oBAAoB,CAAC,eAAe,CAAC,KAAK,CAAA;YAC5C;AACF,QAAA,CAAC,CAAA;AAED;;;;AAIE;AACF,QAAA,MAAM,qBAAoB,GAAI,QAAQ,CAAqB,MACzD,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAK,KAAM;YAC3B,MAAM;AACN,YAAA,UAAU,EAAE;AACV,gBAAA,CAAA,8BAAA,EAAiC,MAAM,CAAA,KAAA,CAAO;AAC9C,gBAAA,EAAE,cAAc,EAAE,eAAe,CAAC,KAAI,KAAM,MAAK,EAAG;AACrD,aAAA;AACD,YAAA,UAAU,EAAE,eAAe,CAAC,KAAI,KAAM,MAAM;AAC5C,YAAA,MAAM,EAAE;AACN,gBAAA,uBAAuB,EAAE,MAAM;AAC/B,gBAAA,qBAAqB,EAAE,MAAM;AAC9B,aAAA;SACF,CAAC,CAAC,CACL;QAEA,OAAO,EAAE,qBAAoB,EAAE;IACjC,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -20,7 +20,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20
20
|
}, null, 8, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
21
21
|
_ctx.hasMatch ? (openBlock(), createElementBlock("span", {
|
|
22
22
|
key: 1,
|
|
23
|
-
class: normalizeClass(["x-highlight__text
|
|
23
|
+
class: normalizeClass(["x-highlight__text xds:highlight-text-match", _ctx.matchingPartClass]),
|
|
24
24
|
"data-test": "matching-part",
|
|
25
25
|
textContent: toDisplayString(_ctx.matchParts.match)
|
|
26
26
|
}, null, 10, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlight.vue.js","sources":["../../../src/components/highlight.vue"],"sourcesContent":["<template>\n <span class=\"x-highlight\" :class=\"dynamicCSSClasses\">\n <span\n v-if=\"matchParts.start\"\n class=\"x-highlight__text\"\n data-test=\"highlight-start\"\n v-text=\"matchParts.start\"\n />\n <span\n v-if=\"hasMatch\"\n class=\"x-highlight__text
|
|
1
|
+
{"version":3,"file":"highlight.vue.js","sources":["../../../src/components/highlight.vue"],"sourcesContent":["<template>\n <span class=\"x-highlight\" :class=\"dynamicCSSClasses\">\n <span\n v-if=\"matchParts.start\"\n class=\"x-highlight__text\"\n data-test=\"highlight-start\"\n v-text=\"matchParts.start\"\n />\n <span\n v-if=\"hasMatch\"\n class=\"x-highlight__text xds:highlight-text-match\"\n :class=\"matchingPartClass\"\n data-test=\"matching-part\"\n v-text=\"matchParts.match\"\n />\n <span\n v-if=\"matchParts.end\"\n class=\"x-highlight__text\"\n data-test=\"highlight-end\"\n v-text=\"matchParts.end\"\n />\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue'\nimport { normalizeString } from '../utils'\n\n/**\n * Highlights the given part of the text. The component is smart enough to do matches\n * between special characters like tilde, cedilla, eñe, capital letters...\n *\n * @public\n */\nexport default defineComponent({\n name: 'Highlight',\n props: {\n /** The text to highlight some part of it. */\n text: {\n type: String,\n default: '',\n },\n /** The part of the text to be highlighted. */\n highlight: {\n type: String,\n default: '',\n },\n /** CSS Class to add when the `text` string contains the `highlight` string. */\n matchClass: {\n type: String,\n default: '',\n },\n /** CSS Class to add when the given `text` doesn't contain the `highlight` string. */\n noMatchClass: {\n type: String,\n default: '',\n },\n /** CSS Class to add to the matching text. */\n matchingPartClass: {\n type: String,\n default: '',\n },\n },\n setup(props, { slots }) {\n /**\n * Splits the label in three parts based on two indexes.\n *\n * @param label - The string that will be divided in three parts.\n * @param start - The first index that the label will be divided by.\n * @param end - The second index that the label will be divided by.\n *\n * @returns The three parts of the divided label.\n */\n function splitAt(label: string, start: number, end: number) {\n return {\n start: label.substring(0, start),\n match: label.substring(start, end),\n end: label.substring(end),\n }\n }\n\n /**\n * Splits the text to highlight into 3 parts: a starting part, the matching part\n * and the ending part. If there is no match between the text and the highlight, the `start`\n * property will contain the whole text.\n *\n * @returns An object containing the different parts of the text.\n */\n const matchParts = computed(() => {\n const matcherIndex = normalizeString(props.text).indexOf(normalizeString(props.highlight))\n return matcherIndex !== -1 && props.highlight\n ? splitAt(props.text.trim(), matcherIndex, matcherIndex + props.highlight.trim().length)\n : { start: props.text, match: '', end: '' }\n })\n\n /**\n * Checks if the normalized suggestion query matches with the module's query, so it has a\n * matching part.\n *\n * @returns True if there is a match between the text and the highlight strings.\n */\n const hasMatch = computed(() => !!matchParts.value.match)\n\n /**\n * CSS classes to add depending on the component state.\n *\n * @remarks\n * `x-highlight--has-match`: When there is a match between the text and the part to highlight.\n * `[matchClass]`: When there is a match between the text and\n * the part to highlight.\n * `[noMatchClass]`: when there is no match between the text to highlight.\n * @returns The CSS classes.\n */\n const dynamicCSSClasses = computed(() => {\n const classes = {\n 'x-highlight--has-match': hasMatch.value,\n 'xds:highlight-text': hasMatch.value,\n [props.matchClass]: hasMatch.value,\n }\n if (props.noMatchClass) {\n classes[props.noMatchClass] = !hasMatch.value\n }\n return classes\n })\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot.\n */\n function renderDefaultSlot() {\n const slotProps = {\n text: props.text,\n hasMatch: hasMatch.value,\n ...matchParts.value,\n }\n return slots.default?.(slotProps)[0]\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { hasMatch, matchParts, dynamicCSSClasses }\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps\n },\n})\n</script>\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 highlight component is rendered.\n\n_Type any term in the input field to try it out!_\n\n```vue live\n<template>\n <div>\n <input v-model=\"highlight\" />\n <Highlight :highlight=\"highlight\" text=\"milanesa\" />\n </div>\n</template>\n\n<script setup>\nimport { Highlight } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst highlight = ref('')\n</script>\n```\n\n### Customise the layout\n\nThis component allows to customise the whole layout.\n\n```vue live\n<template>\n <div>\n <input v-model=\"highlight\" />\n <Highlight\n :highlight=\"highlight\"\n text=\"Entraña\"\n #default=\"{ hasMatch, start, match, end, text }\"\n >\n <span class=\"custom-layout\" v-if=\"hasMatch\">\n <strong>{{ start }}</strong>\n {{ match }}\n <strong>{{ end }}</strong>\n </span>\n <span v-else>{{ text }}</span>\n </Highlight>\n </div>\n</template>\n\n<script setup>\nimport { Highlight } from '@empathyco/x-components'\nimport { ref } from 'vue'\nconst highlight = ref('entran')\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_toDisplayString","_createCommentVNode"],"mappings":";;;;;;;;AACE,EAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA;AAAA,IAoBO,MAAA;AAAA,IAAA;AAAA,MApBD,KAAA,EAAKC,cAAA,CAAA,CAAC,aAAA,EAAsB,IAAA,CAAA,iBAAiB,CAAA;AAAA,KAAA;;AAEzC,MAAA,IAAA,CAAA,UAAA,CAAW,sBADnBD,kBAAA,CAKE,MAAA,EAAA;AAAA,QAAA,GAAA,EAAA,CAAA;QAHA,KAAA,EAAM,mBAAA;AAAA,QACN,WAAA,EAAU,iBAAA;AAAA,QAAA,WAAA,EACVE,eAAA,CAAyB,IAAA,CAAjB,UAAA,CAAW,KAAK;AAAA,OAAA,EAAA,IAAA,EAAA,CAAA,EAAA,UAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAGlB,MAAA,IAAA,CAAA,QAAA,IAAAJ,SAAA,EAAA,EADRC,kBAAA,CAME,MAAA,EAAA;AAAA,QAAA,GAAA,EAAA,CAAA;QAJA,KAAA,EAAKC,cAAA,CAAA,CAAC,8CACE,IAAA,CAAA,iBAAiB,CAAA,CAAA;AAAA,QACzB,WAAA,EAAU,eAAA;AAAA,QAAA,WAAA,EACVC,eAAA,CAAyB,IAAA,CAAjB,UAAA,CAAW,KAAK;AAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAGlB,MAAA,IAAA,CAAA,UAAA,CAAW,oBADnBH,kBAAA,CAKE,MAAA,EAAA;AAAA,QAAA,GAAA,EAAA,CAAA;QAHA,KAAA,EAAM,mBAAA;AAAA,QACN,WAAA,EAAU,eAAA;AAAA,QAAA,WAAA,EACVE,eAAA,CAAuB,IAAA,CAAf,UAAA,CAAW,GAAG;AAAA,OAAA,EAAA,IAAA,EAAA,CAAA,EAAA,UAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA;;;;;;;;;;"}
|