@empathyco/x-components 6.0.0-alpha.17 → 6.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/design-system/deprecated-full-theme.css +1078 -1078
  3. package/docs/API-reference/api/x-components.baseslider.md +9 -0
  4. package/docs/API-reference/api/x-components.globalxbus.md +4 -0
  5. package/docs/API-reference/api/x-components.hierarchicalfilter.md +2 -0
  6. package/docs/API-reference/api/x-components.relatedpromptsxevents.md +2 -0
  7. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedprompt.md +13 -0
  8. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md +13 -0
  9. package/docs/API-reference/api/x-components.simplefilter.md +2 -0
  10. package/docs/API-reference/api/x-components.snippetcallbacks.md +2 -0
  11. package/docs/API-reference/api/x-types.stats.md +1 -1
  12. package/docs/API-reference/api/x-types.stats.price.md +2 -2
  13. package/docs/API-reference/components/common/x-components.base-slider.md +5 -4
  14. package/js/components/base-slider.vue.js +17 -18
  15. package/js/components/base-slider.vue.js.map +1 -1
  16. package/js/components/base-slider.vue2.js +5 -0
  17. package/js/components/base-slider.vue2.js.map +1 -1
  18. package/js/components/base-slider.vue3.js +1 -1
  19. package/package.json +4 -4
  20. package/report/x-adapter-platform.api.json +7 -7
  21. package/report/x-components.api.json +133 -7
  22. package/report/x-components.api.md +21 -0
  23. package/report/x-types.api.json +4 -4
  24. package/types/components/base-slider.vue.d.ts +11 -0
  25. package/types/components/base-slider.vue.d.ts.map +1 -1
  26. package/types/components/global-x-bus.vue.d.ts +4 -0
  27. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  28. package/types/components/snippet-callbacks.vue.d.ts +2 -0
  29. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  30. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +2 -0
  31. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  32. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +2 -0
  33. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  34. package/types/x-modules/related-prompts/events.types.d.ts +10 -0
  35. package/types/x-modules/related-prompts/events.types.d.ts.map +1 -1
@@ -29,6 +29,10 @@ _default: import("vue").DefineComponent<{
29
29
  }>;
30
30
  required: true;
31
31
  };
32
+ contentClass: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
32
36
  }, {
33
37
  slider: import("vue").Ref<HTMLElement | undefined>;
34
38
  rangeSelected: import("vue").ComputedRef<number[]>;
@@ -50,6 +54,10 @@ _default: import("vue").DefineComponent<{
50
54
  }>;
51
55
  required: true;
52
56
  };
57
+ contentClass: {
58
+ type: StringConstructor;
59
+ default: string;
60
+ };
53
61
  }>> & {
54
62
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
55
63
  }, {
@@ -57,5 +65,6 @@ _default: import("vue").DefineComponent<{
57
65
  min: number;
58
66
  max: number;
59
67
  };
68
+ contentClass: string;
60
69
  }, {}>
61
70
  ```
@@ -172,6 +172,8 @@ _default: import("vue").DefineComponent<{
172
172
  PushableUrlStateUpdated: (payload: import("..").UrlParams, metadata: import("..").WireMetadata) => unknown;
173
173
  ReplaceableUrlStateUpdated: (payload: import("..").UrlParams, metadata: import("..").WireMetadata) => unknown;
174
174
  RelatedPromptsRequestUpdated: (payload: import("@empathyco/x-types").RelatedPromptsRequest | null, metadata: import("..").WireMetadata) => unknown;
175
+ UserSelectedARelatedPrompt: (payload: number, metadata: import("..").WireMetadata) => unknown;
176
+ UserSelectedARelatedPromptQuery: (payload: number, metadata: import("..").WireMetadata) => unknown;
175
177
  }>>;
176
178
  required: true;
177
179
  };
@@ -338,6 +340,8 @@ _default: import("vue").DefineComponent<{
338
340
  PushableUrlStateUpdated: (payload: import("..").UrlParams, metadata: import("..").WireMetadata) => unknown;
339
341
  ReplaceableUrlStateUpdated: (payload: import("..").UrlParams, metadata: import("..").WireMetadata) => unknown;
340
342
  RelatedPromptsRequestUpdated: (payload: import("@empathyco/x-types").RelatedPromptsRequest | null, metadata: import("..").WireMetadata) => unknown;
343
+ UserSelectedARelatedPrompt: (payload: number, metadata: import("..").WireMetadata) => unknown;
344
+ UserSelectedARelatedPromptQuery: (payload: number, metadata: import("..").WireMetadata) => unknown;
341
345
  }>>;
342
346
  required: true;
343
347
  };
@@ -184,6 +184,8 @@ _default: import("vue").DefineComponent<{
184
184
  PushableUrlStateUpdated?: import("../../../../types").UrlParams | undefined;
185
185
  ReplaceableUrlStateUpdated?: import("../../../../types").UrlParams | undefined;
186
186
  RelatedPromptsRequestUpdated?: import("@empathyco/x-types").RelatedPromptsRequest | null | undefined;
187
+ UserSelectedARelatedPrompt?: number | undefined;
188
+ UserSelectedARelatedPromptQuery?: number | undefined;
187
189
  }>;
188
190
  innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
189
191
  renderedChildrenFilters: import("vue").ComputedRef<HierarchicalFilterModel[]>;
@@ -17,4 +17,6 @@ export interface RelatedPromptsXEvents
17
17
  | Property | Modifiers | Type | Description |
18
18
  | --- | --- | --- | --- |
19
19
  | [RelatedPromptsRequestUpdated](./x-components.relatedpromptsxevents.relatedpromptsrequestupdated.md) | | RelatedPromptsRequest \| null | Any property of the related-prompts request has changed Payload: The new related-prompts request or <code>null</code> if there is not enough data in the state to conform a valid request. |
20
+ | [UserSelectedARelatedPrompt](./x-components.relatedpromptsxevents.userselectedarelatedprompt.md) | | number | The selected prompt has changed. Payload: The index of the prompt in the RelatedPrompts list or -1 to remove selection. |
21
+ | [UserSelectedARelatedPromptQuery](./x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md) | | number | The selected next query of the selected prompt has changed. Payload: The index of the next query in the NextQueries list or -1 to remove selection. |
20
22
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [RelatedPromptsXEvents](./x-components.relatedpromptsxevents.md) &gt; [UserSelectedARelatedPrompt](./x-components.relatedpromptsxevents.userselectedarelatedprompt.md)
4
+
5
+ ## RelatedPromptsXEvents.UserSelectedARelatedPrompt property
6
+
7
+ The selected prompt has changed. Payload: The index of the prompt in the RelatedPrompts list or -1 to remove selection.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ UserSelectedARelatedPrompt: number;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [RelatedPromptsXEvents](./x-components.relatedpromptsxevents.md) &gt; [UserSelectedARelatedPromptQuery](./x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md)
4
+
5
+ ## RelatedPromptsXEvents.UserSelectedARelatedPromptQuery property
6
+
7
+ The selected next query of the selected prompt has changed. Payload: The index of the next query in the NextQueries list or -1 to remove selection.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ UserSelectedARelatedPromptQuery: number;
13
+ ```
@@ -181,6 +181,8 @@ _default: import("vue").DefineComponent<{
181
181
  PushableUrlStateUpdated?: import("../../../..").UrlParams | undefined;
182
182
  ReplaceableUrlStateUpdated?: import("../../../..").UrlParams | undefined;
183
183
  RelatedPromptsRequestUpdated?: import("@empathyco/x-types").RelatedPromptsRequest | null | undefined;
184
+ UserSelectedARelatedPrompt?: number | undefined;
185
+ UserSelectedARelatedPromptQuery?: number | undefined;
184
186
  }>;
185
187
  innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
186
188
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -171,6 +171,8 @@ _default: import("vue").DefineComponent<{}, {
171
171
  PushableUrlStateUpdated: (payload: import("..").UrlParams, metadata: WireMetadata) => unknown;
172
172
  ReplaceableUrlStateUpdated: (payload: import("..").UrlParams, metadata: WireMetadata) => unknown;
173
173
  RelatedPromptsRequestUpdated: (payload: import("@empathyco/x-types").RelatedPromptsRequest | null, metadata: WireMetadata) => unknown;
174
+ UserSelectedARelatedPrompt: (payload: number, metadata: WireMetadata) => unknown;
175
+ UserSelectedARelatedPromptQuery: (payload: number, metadata: WireMetadata) => unknown;
174
176
  }>>;
175
177
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>
176
178
  ```
@@ -18,5 +18,5 @@ export interface Stats
18
18
 
19
19
  | Property | Modifiers | Type | Description |
20
20
  | --- | --- | --- | --- |
21
- | [price](./x-types.stats.price.md) | | { min: number; max: number; } | |
21
+ | [price](./x-types.stats.price.md) | | { min: number \| undefined; max: number \| undefined; } | |
22
22
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  ```typescript
10
10
  price: {
11
- min: number;
12
- max: number;
11
+ min: number | undefined;
12
+ max: number | undefined;
13
13
  };
14
14
  ```
@@ -14,10 +14,11 @@ implementation.
14
14
 
15
15
  ## Props
16
16
 
17
- | Name | Description | Type | Default |
18
- | ----------------------- | ----------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------- |
19
- | <code>threshold</code> | The threshold prop sets the limits for the slider. | <code>{ min: number; max: number }</code> | <code>() => ({ min: 0, max: Number.MAX_SAFE_INTEGER })</code> |
20
- | <code>modelValue</code> | The modelValue prop sets the initial values for the slider. | <code>{ min: number; max: number }</code> | <code></code> |
17
+ | Name | Description | Type | Default |
18
+ | ------------------------- | ----------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------- |
19
+ | <code>threshold</code> | The threshold prop sets the limits for the slider. | <code>{ min: number; max: number }</code> | <code>() => ({ min: 0, max: Number.MAX_SAFE_INTEGER })</code> |
20
+ | <code>modelValue</code> | The modelValue prop sets the initial values for the slider. | <code>{ min: number; max: number }</code> | <code></code> |
21
+ | <code>contentClass</code> | Class to be able to customize slider styles. | <code>string</code> | <code>''</code> |
21
22
 
22
23
  ## Events
23
24
 
@@ -1,24 +1,20 @@
1
1
  import _sfc_main from './base-slider.vue2.js';
2
- import { openBlock, createElementBlock, createElementVNode, createCommentVNode, renderSlot, toDisplayString } from 'vue';
2
+ import { openBlock, createElementBlock, createElementVNode, normalizeClass, createCommentVNode, renderSlot, toDisplayString } from 'vue';
3
3
  import './base-slider.vue3.js';
4
4
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.js';
5
5
 
6
6
  const _hoisted_1 = { class: "x-base-slider" };
7
- const _hoisted_2 = {
8
- ref: "slider",
9
- class: "x-base-slider__nouislider"
10
- };
11
- const _hoisted_3 = { class: "x-base-slider__selected" };
12
- const _hoisted_4 = { class: "x-base-slider__selected-min" };
13
- const _hoisted_5 = /* @__PURE__ */ createElementVNode(
7
+ const _hoisted_2 = { class: "x-base-slider__selected" };
8
+ const _hoisted_3 = { class: "x-base-slider__selected-min" };
9
+ const _hoisted_4 = /* @__PURE__ */ createElementVNode(
14
10
  "span",
15
11
  null,
16
12
  "min value",
17
13
  -1
18
14
  /* HOISTED */
19
15
  );
20
- const _hoisted_6 = { class: "x-base-slider__selected-max" };
21
- const _hoisted_7 = /* @__PURE__ */ createElementVNode(
16
+ const _hoisted_5 = { class: "x-base-slider__selected-max" };
17
+ const _hoisted_6 = /* @__PURE__ */ createElementVNode(
22
18
  "span",
23
19
  null,
24
20
  "max value",
@@ -29,16 +25,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
29
25
  return openBlock(), createElementBlock("div", _hoisted_1, [
30
26
  createElementVNode(
31
27
  "div",
32
- _hoisted_2,
28
+ {
29
+ ref: "slider",
30
+ class: normalizeClass(["x-base-slider__nouislider"].concat(`${_ctx.contentClass}`))
31
+ },
33
32
  null,
34
- 512
35
- /* NEED_PATCH */
33
+ 2
34
+ /* CLASS */
36
35
  ),
37
- createElementVNode("div", _hoisted_3, [
36
+ createElementVNode("div", _hoisted_2, [
38
37
  createCommentVNode("\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 "),
39
38
  renderSlot(_ctx.$slots, "default", { rangeSelected: _ctx.rangeSelected }, () => [
40
- createElementVNode("p", _hoisted_4, [
41
- _hoisted_5,
39
+ createElementVNode("p", _hoisted_3, [
40
+ _hoisted_4,
42
41
  createElementVNode(
43
42
  "span",
44
43
  null,
@@ -47,8 +46,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
47
46
  /* TEXT */
48
47
  )
49
48
  ]),
50
- createElementVNode("p", _hoisted_6, [
51
- _hoisted_7,
49
+ createElementVNode("p", _hoisted_5, [
50
+ _hoisted_6,
52
51
  createElementVNode(
53
52
  "span",
54
53
  null,
@@ -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\" />\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 :rangeSelected=\"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\">\n import { API, create } from 'nouislider';\n import { computed, defineComponent, onMounted, onUnmounted, PropType, 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 */\n export 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 },\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: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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSlider\n },\n setup() {\n const selectedRange = ref({ min: 0, max: 1000 });\n\n return {\n selectedRange\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\n</script>\n```\n</docs>\n"],"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;;;;;;;;;;;"}
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 :rangeSelected=\"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\">\n import { API, create } from 'nouislider';\n import { computed, defineComponent, onMounted, onUnmounted, PropType, 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 */\n export 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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSlider\n },\n setup() {\n const selectedRange = ref({ min: 0, max: 1000 });\n\n return {\n selectedRange\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_createElementVNode","_openBlock","_createElementBlock","_normalizeClass","_createCommentVNode","_renderSlot","_toDisplayString"],"mappings":";;;;;qBAUW,KAAM,EAAA,eAAA,EAAA,CAAA;AACe,MAAA,UAAA,GAAA,EAAA,KAAA,EAAA,yBAAA,EAAA,CAAA;AAKrB,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,6BAA6B,EAAA,CAAA;AACpC,MAAA,UAAA,mBAAAA,kBAAA;AAAA,EAAsB,MAAA;AAAA,EAAA,IAAA;AAAA,EAAhB,WAAA;AAAA,EAAS,CAAA,CAAA;AAAA;AAAA,CAAA,CAAA;;;;;;;;;SAfrB,WAAqF,CAAA,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;SAA7EC,SAAS,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,IAAAF,kBAAA;AAFrB,MAAA,KAAA;AAAA,MAAA;AAAA,QAAA,GAAA,EAAA,QAAA;QAGI,KAoBM,EAAAG,cAAA,CAAA,CAAA,2BAAA,CAAA,CAAA,MAAA,CAAA,CAAA,EAAA,IAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA;AAAA,OAAA;AAnBJ,MAAA,IAAA;AAAA,MAAA,CAAA;AAAA;AAAA,KAAA;AAAA,IAkBOH,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,MAAAI,kBAAA,CAZL,4RAKI,CAAA;AAAA,MAAAC,UAAA,CAJF,IAAsB,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,aAAA,EAAA,IAAA,CAAA,aAAA,EAAA,EAAA,MAAA;AAAA,QAAAL,kBAAA,CACtB,GAEO,EAAA,UAAA,EAAA;AAAA,UAAA,UAAA;AAET,UAAAA,kBAAA;AAAA,YAKI,MAAA;AAAA,YALJ,IAAA;AAAA,YAKIM,eAAA,CAAA,IAAA,CAAA,aAAA,CAAA,CAAA,CAAA,CAAA;AAAA,YAAA,CAAA;AAAA;AAAA,WAAA;AAAA,SAAA,CAAA;2BAHF,GAEO,EAAA,UAAA,EAAA;AAAA,UAAA,UAAA;;;;;;;;;;;;;;;;;"}
@@ -22,6 +22,11 @@ var _sfc_main = defineComponent({
22
22
  modelValue: {
23
23
  type: Object,
24
24
  required: true
25
+ },
26
+ /** Class to be able to customize slider styles. */
27
+ contentClass: {
28
+ type: String,
29
+ default: ''
25
30
  }
26
31
  },
27
32
  /**
@@ -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\" />\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 :rangeSelected=\"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\">\n import { API, create } from 'nouislider';\n import { computed, defineComponent, onMounted, onUnmounted, PropType, 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 */\n export 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 },\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: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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSlider\n },\n setup() {\n const selectedRange = ref({ min: 0, max: 1000 });\n\n return {\n selectedRange\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AA8BE;;;;;;;;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,CAAA;AACzD,SAAA;;AAED,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAAgD;AACtD,YAAA,QAAQ,EAAE,IAAG;AACf,SAAA;AACD,KAAA;AACD;;;AAGE;IACF,KAAK,EAAE,CAAC,mBAAmB,CAAC;AAC5B,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,IAAG,EAAG,EAAA;;AAEnB,QAAA,IAAI,cAAmB,CAAA;;AAEvB,QAAA,MAAM,MAAK,GAAI,GAAG,EAAe,CAAA;;AAGjC,QAAA,MAAM,WAAY,GAAE,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,GAAE,IAAK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;;AAErE,QAAA,MAAM,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;AACD,CAAA,CAAC;;;;"}
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 :rangeSelected=\"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\">\n import { API, create } from 'nouislider';\n import { computed, defineComponent, onMounted, onUnmounted, PropType, 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 */\n export 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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSlider\n },\n setup() {\n const selectedRange = ref({ min: 0, max: 1000 });\n\n return {\n selectedRange\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\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>\n import { BaseSlider } from '@empathyco/x-components';\n\n export default {\n name: 'BaseSliderDemo',\n components: {\n BaseSliderDemo\n },\n setup() {\n const threshold = ref({ min: 0, max: 1000 });\n const selectedRange = ref(threshold.value);\n\n return {\n selectedRange,\n threshold\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;AA8BE;;;;;;;;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,CAAA;AACzD,SAAA;;AAED,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAAgD;AACtD,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAM;AACZ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AI,GAAE,KAAK,CAAC,SAAS,CAAC,GAAE,GAAI,GAAG,CAAA;;YAG1E,cAAc,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;;AAGhD,YAAA,IAAI,YAAW,KAAM,GAAE,IAAK,iBAAiB,GAAG,EAAE;AAChD,gBAAA,IAAI,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,YAAa,EAAC,CAAC,CAAA;AACrE,aAAA;AACF,SAAC,CAAC,CAAA;QAEF,OAAO;YACL,MAAM;YACN,aAAY;SACb,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -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%;transform:translate(-50%)}.noUi-vertical .noUi-tooltip{right:120%;top:50%;transform:translateY(-50%)}.noUi-horizontal .noUi-origin>.noUi-tooltip{bottom:10px;left:auto;transform:translate(50%)}.noUi-vertical .noUi-origin>.noUi-tooltip{right:28px;top:auto;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:after,.x-base-slider__nouislider .noUi-handle:before{content:none}";
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%;transform:translate(-50%)}.noUi-vertical .noUi-tooltip{right:120%;top:50%;transform:translateY(-50%)}.noUi-horizontal .noUi-origin>.noUi-tooltip{bottom:10px;left:auto;transform:translate(50%)}.noUi-vertical .noUi-origin>.noUi-tooltip{right:28px;top:auto;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, css as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "6.0.0-alpha.17",
3
+ "version": "6.0.0-alpha.19",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -70,12 +70,12 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@empathyco/x-adapter": "^8.1.0-alpha.0",
73
- "@empathyco/x-adapter-platform": "^1.1.0-alpha.8",
73
+ "@empathyco/x-adapter-platform": "^1.1.0-alpha.9",
74
74
  "@empathyco/x-bus": "^1.0.3-alpha.1",
75
75
  "@empathyco/x-deep-merge": "^2.0.3-alpha.1",
76
76
  "@empathyco/x-logger": "^1.2.0-alpha.11",
77
77
  "@empathyco/x-storage-service": "^2.0.3-alpha.0",
78
- "@empathyco/x-types": "^10.1.0-alpha.5",
78
+ "@empathyco/x-types": "^10.1.0-alpha.6",
79
79
  "@empathyco/x-utils": "^1.0.3-alpha.1",
80
80
  "@vue/devtools-api": "~6.5.0",
81
81
  "@vueuse/core": "~10.7.1",
@@ -138,5 +138,5 @@
138
138
  "access": "public",
139
139
  "directory": "dist"
140
140
  },
141
- "gitHead": "e977a597bc5442be5341d324c23f290660721d16"
141
+ "gitHead": "795153eb4d238072a21ac57b668c4cf42d4d60f3"
142
142
  }
@@ -3703,7 +3703,7 @@
3703
3703
  {
3704
3704
  "kind": "Interface",
3705
3705
  "canonicalReference": "@empathyco/x-adapter-platform!PlatformRelatedPrompt:interface",
3706
- "docComment": "/**\n * Related prompt model for the `platform` API.\n */\n",
3706
+ "docComment": "/**\n * Related prompt model for the `platform` API.\n *\n * @public\n */\n",
3707
3707
  "excerptTokens": [
3708
3708
  {
3709
3709
  "kind": "Content",
@@ -3846,7 +3846,7 @@
3846
3846
  {
3847
3847
  "kind": "Interface",
3848
3848
  "canonicalReference": "@empathyco/x-adapter-platform!PlatformRelatedPromptsResponse:interface",
3849
- "docComment": "/**\n * Response for the `related prompts` endpoint.\n */\n",
3849
+ "docComment": "/**\n * Response for the `related prompts` endpoint.\n *\n * @public\n */\n",
3850
3850
  "excerptTokens": [
3851
3851
  {
3852
3852
  "kind": "Content",
@@ -5895,7 +5895,7 @@
5895
5895
  {
5896
5896
  "kind": "Variable",
5897
5897
  "canonicalReference": "@empathyco/x-adapter-platform!relatedPromptSchema:var",
5898
- "docComment": "/**\n * Default implementation for the RelatedPromptSchema.\n */\n",
5898
+ "docComment": "/**\n * Default implementation for the RelatedPromptSchema.\n *\n * @public\n */\n",
5899
5899
  "excerptTokens": [
5900
5900
  {
5901
5901
  "kind": "Content",
@@ -5995,7 +5995,7 @@
5995
5995
  {
5996
5996
  "kind": "Variable",
5997
5997
  "canonicalReference": "@empathyco/x-adapter-platform!relatedPromptsRequestMapper:var",
5998
- "docComment": "/**\n * Default implementation for the RelatedPromptsRequestMapper.\n */\n",
5998
+ "docComment": "/**\n * Default implementation for the RelatedPromptsRequestMapper.\n *\n * @public\n */\n",
5999
5999
  "excerptTokens": [
6000
6000
  {
6001
6001
  "kind": "Content",
@@ -6045,7 +6045,7 @@
6045
6045
  {
6046
6046
  "kind": "Variable",
6047
6047
  "canonicalReference": "@empathyco/x-adapter-platform!relatedPromptsRequestSchema:var",
6048
- "docComment": "/**\n * Default implementation for the RelatedPromptsRequestSchema.\n */\n",
6048
+ "docComment": "/**\n * Default implementation for the RelatedPromptsRequestSchema.\n *\n * @public\n */\n",
6049
6049
  "excerptTokens": [
6050
6050
  {
6051
6051
  "kind": "Content",
@@ -6095,7 +6095,7 @@
6095
6095
  {
6096
6096
  "kind": "Variable",
6097
6097
  "canonicalReference": "@empathyco/x-adapter-platform!relatedPromptsResponseMapper:var",
6098
- "docComment": "/**\n * Default implementation for the RelatedPromptsResponseMapper.\n */\n",
6098
+ "docComment": "/**\n * Default implementation for the RelatedPromptsResponseMapper.\n *\n * @public\n */\n",
6099
6099
  "excerptTokens": [
6100
6100
  {
6101
6101
  "kind": "Content",
@@ -6145,7 +6145,7 @@
6145
6145
  {
6146
6146
  "kind": "Variable",
6147
6147
  "canonicalReference": "@empathyco/x-adapter-platform!relatedPromptsResponseSchema:var",
6148
- "docComment": "/**\n * Default implementation for the RelatedPromptsResponseSchema.\n */\n",
6148
+ "docComment": "/**\n * Default implementation for the RelatedPromptsResponseSchema.\n *\n * @public\n */\n",
6149
6149
  "excerptTokens": [
6150
6150
  {
6151
6151
  "kind": "Content",